sm712.c 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819
  1. /*
  2. * GRUB -- GRand Unified Bootloader
  3. * Copyright (C) 2005,2006,2007,2008,2009,2010 Free Software Foundation, Inc.
  4. *
  5. * GRUB is free software: you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation, either version 3 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * GRUB is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. #define grub_video_render_target grub_video_fbrender_target
  19. #if !defined (TEST) && !defined(GENINIT)
  20. #include <grub/err.h>
  21. #include <grub/types.h>
  22. #include <grub/dl.h>
  23. #include <grub/misc.h>
  24. #include <grub/mm.h>
  25. #include <grub/video.h>
  26. #include <grub/video_fb.h>
  27. #include <grub/pci.h>
  28. #include <grub/vga.h>
  29. #include <grub/cache.h>
  30. #else
  31. typedef unsigned char grub_uint8_t;
  32. typedef unsigned short grub_uint16_t;
  33. typedef unsigned int grub_uint32_t;
  34. typedef int grub_err_t;
  35. #include <grub/vgaregs.h>
  36. #include <stdio.h>
  37. #define ARRAY_SIZE(array) (sizeof (array) / sizeof (array[0]))
  38. #endif
  39. #include "sm712_init.c"
  40. #pragma GCC diagnostic ignored "-Wcast-align"
  41. #define GRUB_SM712_TOTAL_MEMORY_SPACE 0x700400
  42. #define GRUB_SM712_REG_BASE 0x700000
  43. #define GRUB_SM712_PCIID 0x0712126f
  44. enum
  45. {
  46. GRUB_SM712_SR_TV_CONTROL = 0x65,
  47. GRUB_SM712_SR_RAM_LUT = 0x66,
  48. GRUB_SM712_SR_CLOCK_CONTROL1 = 0x68,
  49. GRUB_SM712_SR_CLOCK_CONTROL2 = 0x69,
  50. GRUB_SM712_SR_VCLK_NUM = 0x6c,
  51. GRUB_SM712_SR_VCLK_DENOM = 0x6d,
  52. GRUB_SM712_SR_VCLK2_NUM = 0x6e,
  53. GRUB_SM712_SR_VCLK2_DENOM = 0x6f,
  54. GRUB_SM712_SR_POPUP_ICON_LOW = 0x80,
  55. GRUB_SM712_SR_POPUP_ICON_HIGH = 0x81,
  56. GRUB_SM712_SR_POPUP_ICON_CTRL = 0x82,
  57. GRUB_SM712_SR_POPUP_ICON_COLOR1 = 0x84,
  58. GRUB_SM712_SR_POPUP_ICON_COLOR2 = 0x85,
  59. GRUB_SM712_SR_POPUP_ICON_COLOR3 = 0x86,
  60. GRUB_SM712_SR_HW_CURSOR_UPPER_LEFT_X_LOW = 0x88,
  61. GRUB_SM712_SR_HW_CURSOR_UPPER_LEFT_X_HIGH = 0x89,
  62. GRUB_SM712_SR_HW_CURSOR_UPPER_LEFT_Y_LOW = 0x8a,
  63. GRUB_SM712_SR_HW_CURSOR_UPPER_LEFT_Y_HIGH = 0x8b,
  64. GRUB_SM712_SR_HW_CURSOR_FG_COLOR = 0x8c,
  65. GRUB_SM712_SR_HW_CURSOR_BG_COLOR = 0x8d,
  66. GRUB_SM712_SR_POPUP_ICON_X_LOW = 0x90,
  67. GRUB_SM712_SR_POPUP_ICON_X_HIGH = 0x91,
  68. GRUB_SM712_SR_POPUP_ICON_Y_LOW = 0x92,
  69. GRUB_SM712_SR_POPUP_ICON_Y_HIGH = 0x93,
  70. GRUB_SM712_SR_PANEL_HW_VIDEO_CONTROL = 0xa0,
  71. GRUB_SM712_SR_PANEL_HW_VIDEO_COLOR_KEY_LOW = 0xa1,
  72. GRUB_SM712_SR_PANEL_HW_VIDEO_COLOR_KEY_HIGH = 0xa2,
  73. GRUB_SM712_SR_PANEL_HW_VIDEO_COLOR_KEY_MASK_LOW = 0xa3,
  74. GRUB_SM712_SR_PANEL_HW_VIDEO_COLOR_KEY_MASK_HIGH = 0xa4,
  75. GRUB_SM712_SR_PANEL_HW_VIDEO_RED_CONSTANT = 0xa5,
  76. GRUB_SM712_SR_PANEL_HW_VIDEO_GREEN_CONSTANT = 0xa6,
  77. GRUB_SM712_SR_PANEL_HW_VIDEO_BLUE_CONSTANT = 0xa7,
  78. GRUB_SM712_SR_PANEL_HW_VIDEO_TOP_BOUNDARY = 0xa8,
  79. GRUB_SM712_SR_PANEL_HW_VIDEO_LEFT_BOUNDARY = 0xa9,
  80. GRUB_SM712_SR_PANEL_HW_VIDEO_BOTTOM_BOUNDARY = 0xaa,
  81. GRUB_SM712_SR_PANEL_HW_VIDEO_RIGHT_BOUNDARY = 0xab,
  82. GRUB_SM712_SR_PANEL_HW_VIDEO_TOP_LEFT_OVERFLOW_BOUNDARY = 0xac,
  83. GRUB_SM712_SR_PANEL_HW_VIDEO_BOTTOM_RIGHT_OVERFLOW_BOUNDARY = 0xad,
  84. GRUB_SM712_SR_PANEL_HW_VIDEO_VERTICAL_STRETCH_FACTOR = 0xae,
  85. GRUB_SM712_SR_PANEL_HW_VIDEO_HORIZONTAL_STRETCH_FACTOR = 0xaf,
  86. };
  87. enum
  88. {
  89. GRUB_SM712_SR_TV_CRT_SRAM = 0x00,
  90. GRUB_SM712_SR_TV_LCD_SRAM = 0x08
  91. };
  92. enum
  93. {
  94. GRUB_SM712_SR_TV_ALT_CLOCK = 0x00,
  95. GRUB_SM712_SR_TV_FREE_RUN_CLOCK = 0x04
  96. };
  97. enum
  98. {
  99. GRUB_SM712_SR_TV_CLOCK_CKIN_NTSC = 0x00,
  100. GRUB_SM712_SR_TV_CLOCK_REFCLK_PAL = 0x04
  101. };
  102. enum
  103. {
  104. GRUB_SM712_SR_TV_HSYNC = 0x00,
  105. GRUB_SM712_SR_TV_COMPOSITE_HSYNC = 0x01
  106. };
  107. enum
  108. {
  109. GRUB_SM712_SR_RAM_LUT_NORMAL = 0,
  110. GRUB_SM712_SR_RAM_LUT_LCD_RAM_OFF = 0x80,
  111. GRUB_SM712_SR_RAM_LUT_CRT_RAM_OFF = 0x40,
  112. GRUB_SM712_SR_RAM_LUT_LCD_RAM_NO_WRITE = 0x20,
  113. GRUB_SM712_SR_RAM_LUT_CRT_RAM_NO_WRITE = 0x10,
  114. GRUB_SM712_SR_RAM_LUT_CRT_8BIT = 0x08,
  115. GRUB_SM712_SR_RAM_LUT_CRT_GAMMA = 0x04
  116. };
  117. enum
  118. {
  119. GRUB_SM712_SR_CLOCK_CONTROL1_VCLK_FROM_CCR = 0x40,
  120. GRUB_SM712_SR_CLOCK_CONTROL1_8DOT_CLOCK = 0x10,
  121. };
  122. enum
  123. {
  124. GRUB_SM712_SR_CLOCK_CONTROL2_PROGRAM_VCLOCK = 0x03
  125. };
  126. #define GRUB_SM712_SR_POPUP_ICON_HIGH_MASK 0x7
  127. #define GRUB_SM712_SR_POPUP_ICON_HIGH_HW_CURSOR_EN 0x80
  128. enum
  129. {
  130. GRUB_SM712_SR_POPUP_ICON_CTRL_DISABLED = 0,
  131. GRUB_SM712_SR_POPUP_ICON_CTRL_ZOOM_ENABLED = 0x40,
  132. GRUB_SM712_SR_POPUP_ICON_CTRL_ENABLED = 0x80
  133. };
  134. #define RGB332_BLACK 0
  135. #define RGB332_WHITE 0xff
  136. enum
  137. {
  138. GRUB_SM712_CR_OVERFLOW_INTERLACE = 0x30,
  139. GRUB_SM712_CR_INTERLACE_RETRACE = 0x31,
  140. GRUB_SM712_CR_TV_VDISPLAY_START = 0x32,
  141. GRUB_SM712_CR_TV_VDISPLAY_END_HIGH = 0x33,
  142. GRUB_SM712_CR_TV_VDISPLAY_END_LOW = 0x34,
  143. GRUB_SM712_CR_DDA_CONTROL_LOW = 0x35,
  144. GRUB_SM712_CR_DDA_CONTROL_HIGH = 0x36,
  145. GRUB_SM712_CR_TV_EQUALIZER = 0x38,
  146. GRUB_SM712_CR_TV_SERRATION = 0x39,
  147. GRUB_SM712_CR_HSYNC_CTRL = 0x3a,
  148. GRUB_SM712_CR_DEBUG = 0x3c,
  149. GRUB_SM712_CR_SHADOW_VGA_HTOTAL = 0x40,
  150. GRUB_SM712_CR_SHADOW_VGA_HBLANK_START = 0x41,
  151. GRUB_SM712_CR_SHADOW_VGA_HBLANK_END = 0x42,
  152. GRUB_SM712_CR_SHADOW_VGA_HRETRACE_START = 0x43,
  153. GRUB_SM712_CR_SHADOW_VGA_HRETRACE_END = 0x44,
  154. GRUB_SM712_CR_SHADOW_VGA_VERTICAL_TOTAL = 0x45,
  155. GRUB_SM712_CR_SHADOW_VGA_VBLANK_START = 0x46,
  156. GRUB_SM712_CR_SHADOW_VGA_VBLANK_END = 0x47,
  157. GRUB_SM712_CR_SHADOW_VGA_VRETRACE_START = 0x48,
  158. GRUB_SM712_CR_SHADOW_VGA_VRETRACE_END = 0x49,
  159. GRUB_SM712_CR_SHADOW_VGA_OVERFLOW = 0x4a,
  160. GRUB_SM712_CR_SHADOW_VGA_CELL_HEIGHT = 0x4b,
  161. GRUB_SM712_CR_SHADOW_VGA_HDISPLAY_END = 0x4c,
  162. GRUB_SM712_CR_SHADOW_VGA_VDISPLAY_END = 0x4d,
  163. GRUB_SM712_CR_DDA_LOOKUP_REG3_START = 0x90,
  164. GRUB_SM712_CR_DDA_LOOKUP_REG2_START = 0x91,
  165. GRUB_SM712_CR_DDA_LOOKUP_REG1_START = 0xa0,
  166. GRUB_SM712_CR_VCENTERING_OFFSET = 0xa6,
  167. GRUB_SM712_CR_HCENTERING_OFFSET = 0xa7,
  168. };
  169. #define GRUB_SM712_CR_DEBUG_NONE 0
  170. #define SM712_DDA_REG3_COMPARE_SHIFT 2
  171. #define SM712_DDA_REG3_COMPARE_MASK 0xfc
  172. #define SM712_DDA_REG3_DDA_SHIFT 8
  173. #define SM712_DDA_REG3_DDA_MASK 0x3
  174. #define SM712_DDA_REG2_DDA_MASK 0xff
  175. #define SM712_DDA_REG2_VCENTER_MASK 0x3f
  176. static struct
  177. {
  178. grub_uint8_t compare;
  179. grub_uint16_t dda;
  180. grub_uint8_t vcentering;
  181. } dda_lookups[] = {
  182. { 21, 469, 2},
  183. { 23, 477, 2},
  184. { 33, 535, 2},
  185. { 35, 682, 21},
  186. { 34, 675, 2},
  187. { 55, 683, 6},
  188. };
  189. static struct
  190. {
  191. #if !defined (TEST) && !defined(GENINIT)
  192. struct grub_video_mode_info mode_info;
  193. #endif
  194. volatile grub_uint8_t *ptr;
  195. grub_uint8_t *cached_ptr;
  196. int mapped;
  197. grub_uint32_t base;
  198. #if !defined (TEST) && !defined(GENINIT)
  199. grub_pci_device_t dev;
  200. #endif
  201. } framebuffer;
  202. #if !defined (TEST) && !defined(GENINIT)
  203. static grub_err_t
  204. grub_video_sm712_video_init (void)
  205. {
  206. /* Reset frame buffer. */
  207. grub_memset (&framebuffer, 0, sizeof(framebuffer));
  208. return grub_video_fb_init ();
  209. }
  210. static grub_err_t
  211. grub_video_sm712_video_fini (void)
  212. {
  213. if (framebuffer.mapped)
  214. {
  215. grub_pci_device_unmap_range (framebuffer.dev, framebuffer.ptr,
  216. GRUB_SM712_TOTAL_MEMORY_SPACE);
  217. grub_pci_device_unmap_range (framebuffer.dev, framebuffer.cached_ptr,
  218. GRUB_SM712_TOTAL_MEMORY_SPACE);
  219. }
  220. return grub_video_fb_fini ();
  221. }
  222. #endif
  223. static inline void
  224. grub_sm712_write_reg (grub_uint8_t val, grub_uint16_t addr)
  225. {
  226. #ifdef TEST
  227. printf (" {1, 0x%x, 0x%x},\n", addr, val);
  228. #elif defined (GENINIT)
  229. printf (" .byte 0x%02x, 0x%02x\n", (addr - 0x3c0), val);
  230. if ((addr - 0x3c0) & ~0x7f)
  231. printf ("FAIL\n");
  232. #else
  233. *(volatile grub_uint8_t *) (framebuffer.ptr + GRUB_SM712_REG_BASE
  234. + addr) = val;
  235. #endif
  236. }
  237. static inline grub_uint8_t
  238. grub_sm712_read_reg (grub_uint16_t addr)
  239. {
  240. #ifdef TEST
  241. printf (" {-1, 0x%x, 0x5},\n", addr);
  242. #elif defined (GENINIT)
  243. if ((addr - 0x3c0) & ~0x7f)
  244. printf ("FAIL\n");
  245. printf (" .byte 0x%04x, 0x00\n", (addr - 0x3c0) | 0x80);
  246. #else
  247. return *(volatile grub_uint8_t *) (framebuffer.ptr + GRUB_SM712_REG_BASE
  248. + addr);
  249. #endif
  250. }
  251. static inline grub_uint8_t
  252. grub_sm712_sr_read (grub_uint8_t addr)
  253. {
  254. grub_sm712_write_reg (addr, GRUB_VGA_IO_SR_INDEX);
  255. return grub_sm712_read_reg (GRUB_VGA_IO_SR_DATA);
  256. }
  257. static inline void
  258. grub_sm712_sr_write (grub_uint8_t val, grub_uint8_t addr)
  259. {
  260. grub_sm712_write_reg (addr, GRUB_VGA_IO_SR_INDEX);
  261. grub_sm712_write_reg (val, GRUB_VGA_IO_SR_DATA);
  262. }
  263. static inline void
  264. grub_sm712_gr_write (grub_uint8_t val, grub_uint8_t addr)
  265. {
  266. grub_sm712_write_reg (addr, GRUB_VGA_IO_GR_INDEX);
  267. grub_sm712_write_reg (val, GRUB_VGA_IO_GR_DATA);
  268. }
  269. static inline void
  270. grub_sm712_cr_write (grub_uint8_t val, grub_uint8_t addr)
  271. {
  272. grub_sm712_write_reg (addr, GRUB_VGA_IO_CR_INDEX);
  273. grub_sm712_write_reg (val, GRUB_VGA_IO_CR_DATA);
  274. }
  275. static inline void
  276. grub_sm712_write_arx (grub_uint8_t val, grub_uint8_t addr)
  277. {
  278. grub_sm712_read_reg (GRUB_VGA_IO_INPUT_STATUS1_REGISTER);
  279. grub_sm712_write_reg (addr, GRUB_VGA_IO_ARX);
  280. grub_sm712_read_reg (GRUB_VGA_IO_ARX_READ);
  281. grub_sm712_write_reg (val, GRUB_VGA_IO_ARX);
  282. }
  283. static inline void
  284. grub_sm712_cr_shadow_write (grub_uint8_t val, grub_uint8_t addr)
  285. {
  286. grub_uint8_t mapping[] =
  287. {
  288. [GRUB_VGA_CR_HTOTAL] = GRUB_SM712_CR_SHADOW_VGA_HTOTAL,
  289. [GRUB_VGA_CR_HORIZ_END] = 0xff,
  290. [GRUB_VGA_CR_HBLANK_START] = GRUB_SM712_CR_SHADOW_VGA_HBLANK_START,
  291. [GRUB_VGA_CR_HBLANK_END] = GRUB_SM712_CR_SHADOW_VGA_HBLANK_END,
  292. [GRUB_VGA_CR_HORIZ_SYNC_PULSE_START] = GRUB_SM712_CR_SHADOW_VGA_HRETRACE_START,
  293. [GRUB_VGA_CR_HORIZ_SYNC_PULSE_END] = GRUB_SM712_CR_SHADOW_VGA_HRETRACE_END,
  294. [GRUB_VGA_CR_VERT_TOTAL] = GRUB_SM712_CR_SHADOW_VGA_VERTICAL_TOTAL,
  295. [GRUB_VGA_CR_OVERFLOW] = GRUB_SM712_CR_SHADOW_VGA_OVERFLOW,
  296. [GRUB_VGA_CR_BYTE_PANNING] = 0xff,
  297. [GRUB_VGA_CR_CELL_HEIGHT] = GRUB_SM712_CR_SHADOW_VGA_CELL_HEIGHT,
  298. [GRUB_VGA_CR_CURSOR_START] = 0xff,
  299. [GRUB_VGA_CR_CURSOR_END] = 0xff,
  300. [GRUB_VGA_CR_START_ADDR_HIGH_REGISTER] = 0xff,
  301. [GRUB_VGA_CR_START_ADDR_LOW_REGISTER] = 0xff,
  302. [GRUB_VGA_CR_CURSOR_ADDR_HIGH] = 0xff,
  303. [GRUB_VGA_CR_CURSOR_ADDR_LOW] = 0xff,
  304. [GRUB_VGA_CR_VSYNC_START] = GRUB_SM712_CR_SHADOW_VGA_VRETRACE_START,
  305. [GRUB_VGA_CR_VSYNC_END] = GRUB_SM712_CR_SHADOW_VGA_VRETRACE_END,
  306. [GRUB_VGA_CR_VDISPLAY_END] = GRUB_SM712_CR_SHADOW_VGA_VDISPLAY_END,
  307. [GRUB_VGA_CR_PITCH] = GRUB_SM712_CR_SHADOW_VGA_HDISPLAY_END,
  308. [GRUB_VGA_CR_UNDERLINE_LOCATION] = 0xff,
  309. [GRUB_VGA_CR_VERTICAL_BLANK_START] = GRUB_SM712_CR_SHADOW_VGA_VBLANK_START,
  310. [GRUB_VGA_CR_VERTICAL_BLANK_END] = GRUB_SM712_CR_SHADOW_VGA_VBLANK_END,
  311. [GRUB_VGA_CR_MODE] = 0xff,
  312. [GRUB_VGA_CR_LINE_COMPARE] = 0xff
  313. };
  314. if (addr >= ARRAY_SIZE (mapping) || mapping[addr] == 0xff)
  315. return;
  316. grub_sm712_cr_write (val, mapping[addr]);
  317. }
  318. static inline void
  319. grub_sm712_write_dda_lookup (int idx, grub_uint8_t compare, grub_uint16_t dda,
  320. grub_uint8_t vcentering)
  321. {
  322. grub_sm712_cr_write (((compare << SM712_DDA_REG3_COMPARE_SHIFT)
  323. & SM712_DDA_REG3_COMPARE_MASK)
  324. | ((dda >> SM712_DDA_REG3_DDA_SHIFT)
  325. & SM712_DDA_REG3_DDA_MASK),
  326. GRUB_SM712_CR_DDA_LOOKUP_REG3_START + 2 * idx);
  327. grub_sm712_cr_write (dda & SM712_DDA_REG2_DDA_MASK,
  328. GRUB_SM712_CR_DDA_LOOKUP_REG2_START + 2 * idx);
  329. grub_sm712_cr_write (vcentering & SM712_DDA_REG2_VCENTER_MASK,
  330. GRUB_SM712_CR_DDA_LOOKUP_REG1_START + idx);
  331. }
  332. #if !defined (TEST) && !defined(GENINIT)
  333. /* Helper for grub_video_sm712_setup. */
  334. static int
  335. find_card (grub_pci_device_t dev, grub_pci_id_t pciid, void *data)
  336. {
  337. int *found = data;
  338. grub_pci_address_t addr;
  339. grub_uint32_t class;
  340. addr = grub_pci_make_address (dev, GRUB_PCI_REG_CLASS);
  341. class = grub_pci_read (addr);
  342. if (((class >> 16) & 0xffff) != GRUB_PCI_CLASS_DISPLAY_VGA
  343. || pciid != GRUB_SM712_PCIID)
  344. return 0;
  345. *found = 1;
  346. addr = grub_pci_make_address (dev, GRUB_PCI_REG_ADDRESS_REG0);
  347. framebuffer.base = grub_pci_read (addr);
  348. framebuffer.dev = dev;
  349. return 1;
  350. }
  351. #endif
  352. static grub_err_t
  353. grub_video_sm712_setup (unsigned int width, unsigned int height,
  354. unsigned int mode_type, unsigned int mode_mask __attribute__ ((unused)))
  355. {
  356. unsigned i;
  357. #if !defined (TEST) && !defined(GENINIT)
  358. int depth;
  359. grub_err_t err;
  360. int found = 0;
  361. /* Decode depth from mode_type. If it is zero, then autodetect. */
  362. depth = (mode_type & GRUB_VIDEO_MODE_TYPE_DEPTH_MASK)
  363. >> GRUB_VIDEO_MODE_TYPE_DEPTH_POS;
  364. if ((width != 1024 && width != 0) || (height != 600 && height != 0)
  365. || (depth != 16 && depth != 0))
  366. return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
  367. "Only 1024x600x16 is supported");
  368. grub_pci_iterate (find_card, &found);
  369. if (!found)
  370. return grub_error (GRUB_ERR_IO, "Couldn't find graphics card");
  371. /* Fill mode info details. */
  372. framebuffer.mode_info.width = 1024;
  373. framebuffer.mode_info.height = 600;
  374. framebuffer.mode_info.mode_type = (GRUB_VIDEO_MODE_TYPE_RGB
  375. | GRUB_VIDEO_MODE_TYPE_DOUBLE_BUFFERED
  376. | GRUB_VIDEO_MODE_TYPE_UPDATING_SWAP);
  377. framebuffer.mode_info.bpp = 16;
  378. framebuffer.mode_info.bytes_per_pixel = 2;
  379. framebuffer.mode_info.pitch = 1024 * 2;
  380. framebuffer.mode_info.number_of_colors = 256;
  381. framebuffer.mode_info.red_mask_size = 5;
  382. framebuffer.mode_info.red_field_pos = 11;
  383. framebuffer.mode_info.green_mask_size = 6;
  384. framebuffer.mode_info.green_field_pos = 5;
  385. framebuffer.mode_info.blue_mask_size = 5;
  386. framebuffer.mode_info.blue_field_pos = 0;
  387. framebuffer.mode_info.reserved_mask_size = 0;
  388. framebuffer.mode_info.reserved_field_pos = 0;
  389. framebuffer.mode_info.blit_format
  390. = grub_video_get_blit_format (&framebuffer.mode_info);
  391. #endif
  392. #if !defined (TEST) && !defined(GENINIT)
  393. if (found && framebuffer.base == 0)
  394. {
  395. grub_pci_address_t addr;
  396. /* FIXME: choose address dynamically if needed. */
  397. framebuffer.base = 0x04000000;
  398. addr = grub_pci_make_address (framebuffer.dev, GRUB_PCI_REG_ADDRESS_REG0);
  399. grub_pci_write (addr, framebuffer.base);
  400. /* Set latency. */
  401. addr = grub_pci_make_address (framebuffer.dev, GRUB_PCI_REG_CACHELINE);
  402. grub_pci_write (addr, 0x8);
  403. /* Enable address spaces. */
  404. addr = grub_pci_make_address (framebuffer.dev, GRUB_PCI_REG_COMMAND);
  405. grub_pci_write (addr, 0x7);
  406. }
  407. #endif
  408. /* We can safely discard volatile attribute. */
  409. #if !defined (TEST) && !defined(GENINIT)
  410. framebuffer.ptr
  411. = grub_pci_device_map_range (framebuffer.dev,
  412. framebuffer.base,
  413. GRUB_SM712_TOTAL_MEMORY_SPACE);
  414. framebuffer.cached_ptr
  415. = grub_pci_device_map_range_cached (framebuffer.dev,
  416. framebuffer.base,
  417. GRUB_SM712_TOTAL_MEMORY_SPACE);
  418. #endif
  419. framebuffer.mapped = 1;
  420. /* Initialise SM712. */
  421. #if !defined (TEST) && !defined(GENINIT)
  422. /* FIXME */
  423. grub_vga_sr_write (0x11, 0x18);
  424. #endif
  425. #if !defined (TEST) && !defined(GENINIT)
  426. /* Prevent garbage from appearing on the screen. */
  427. grub_memset ((void *) framebuffer.cached_ptr, 0,
  428. framebuffer.mode_info.height * framebuffer.mode_info.pitch);
  429. #endif
  430. /* FIXME */
  431. grub_sm712_sr_write (0, 0x21);
  432. grub_sm712_sr_write (0x7a, 0x62);
  433. grub_sm712_sr_write (0x16, 0x6a);
  434. grub_sm712_sr_write (0x2, 0x6b);
  435. grub_sm712_write_reg (0, GRUB_VGA_IO_PIXEL_MASK);
  436. grub_sm712_sr_write (GRUB_VGA_SR_RESET_ASYNC, GRUB_VGA_SR_RESET);
  437. grub_sm712_write_reg (GRUB_VGA_IO_MISC_NEGATIVE_VERT_POLARITY
  438. | GRUB_VGA_IO_MISC_NEGATIVE_HORIZ_POLARITY
  439. | GRUB_VGA_IO_MISC_UPPER_64K
  440. | GRUB_VGA_IO_MISC_EXTERNAL_CLOCK_0
  441. | GRUB_VGA_IO_MISC_ENABLE_VRAM_ACCESS
  442. | GRUB_VGA_IO_MISC_COLOR, GRUB_VGA_IO_MISC_WRITE);
  443. grub_sm712_sr_write (GRUB_VGA_SR_RESET_ASYNC | GRUB_VGA_SR_RESET_SYNC,
  444. GRUB_VGA_SR_RESET);
  445. grub_sm712_sr_write (GRUB_VGA_SR_CLOCKING_MODE_8_DOT_CLOCK,
  446. GRUB_VGA_SR_CLOCKING_MODE);
  447. grub_sm712_sr_write (GRUB_VGA_ALL_PLANES, GRUB_VGA_SR_MAP_MASK_REGISTER);
  448. grub_sm712_sr_write (0, GRUB_VGA_SR_CHAR_MAP_SELECT);
  449. grub_sm712_sr_write (GRUB_VGA_SR_MEMORY_MODE_CHAIN4
  450. | GRUB_VGA_SR_MEMORY_MODE_SEQUENTIAL_ADDRESSING
  451. | GRUB_VGA_SR_MEMORY_MODE_EXTERNAL_VIDEO_MEMORY,
  452. GRUB_VGA_SR_MEMORY_MODE);
  453. for (i = 0; i < ARRAY_SIZE (sm712_sr_seq1); i++)
  454. grub_sm712_sr_write (sm712_sr_seq1[i], 0x10 + i);
  455. for (i = 0; i < ARRAY_SIZE (sm712_sr_seq2); i++)
  456. grub_sm712_sr_write (sm712_sr_seq2[i], 0x30 + i);
  457. /* Undocumented. */
  458. grub_sm712_sr_write (0x1a, 0x63);
  459. /* Undocumented. */
  460. grub_sm712_sr_write (0x1a, 0x64);
  461. grub_sm712_sr_write (GRUB_SM712_SR_TV_CRT_SRAM | GRUB_SM712_SR_TV_ALT_CLOCK
  462. | GRUB_SM712_SR_TV_CLOCK_CKIN_NTSC
  463. | GRUB_SM712_SR_TV_HSYNC,
  464. GRUB_SM712_SR_TV_CONTROL);
  465. grub_sm712_sr_write (GRUB_SM712_SR_RAM_LUT_NORMAL, GRUB_SM712_SR_RAM_LUT);
  466. /* Undocumented. */
  467. grub_sm712_sr_write (0x00, 0x67);
  468. grub_sm712_sr_write (GRUB_SM712_SR_CLOCK_CONTROL1_VCLK_FROM_CCR
  469. | GRUB_SM712_SR_CLOCK_CONTROL1_8DOT_CLOCK,
  470. GRUB_SM712_SR_CLOCK_CONTROL1);
  471. grub_sm712_sr_write (GRUB_SM712_SR_CLOCK_CONTROL2_PROGRAM_VCLOCK,
  472. GRUB_SM712_SR_CLOCK_CONTROL2);
  473. grub_sm712_sr_write (82, GRUB_SM712_SR_VCLK_NUM);
  474. grub_sm712_sr_write (137, GRUB_SM712_SR_VCLK_DENOM);
  475. grub_sm712_sr_write (9, GRUB_SM712_SR_VCLK2_NUM);
  476. grub_sm712_sr_write (2, GRUB_SM712_SR_VCLK2_DENOM);
  477. /* FIXME */
  478. grub_sm712_sr_write (0x04, 0x70);
  479. /* FIXME */
  480. grub_sm712_sr_write (0x45, 0x71);
  481. /* Undocumented */
  482. grub_sm712_sr_write (0x30, 0x72);
  483. /* Undocumented */
  484. grub_sm712_sr_write (0x30, 0x73);
  485. /* Undocumented */
  486. grub_sm712_sr_write (0x40, 0x74);
  487. /* Undocumented */
  488. grub_sm712_sr_write (0x20, 0x75);
  489. grub_sm712_sr_write (0xff, GRUB_SM712_SR_POPUP_ICON_LOW);
  490. grub_sm712_sr_write (GRUB_SM712_SR_POPUP_ICON_HIGH_MASK,
  491. GRUB_SM712_SR_POPUP_ICON_HIGH);
  492. grub_sm712_sr_write (GRUB_SM712_SR_POPUP_ICON_CTRL_DISABLED,
  493. GRUB_SM712_SR_POPUP_ICON_CTRL);
  494. /* Undocumented */
  495. grub_sm712_sr_write (0x0, 0x83);
  496. grub_sm712_sr_write (8, GRUB_SM712_SR_POPUP_ICON_COLOR1);
  497. grub_sm712_sr_write (0, GRUB_SM712_SR_POPUP_ICON_COLOR2);
  498. grub_sm712_sr_write (0x42, GRUB_SM712_SR_POPUP_ICON_COLOR3);
  499. /* Undocumented */
  500. grub_sm712_sr_write (0x3a, 0x87);
  501. /* Why theese coordinates? */
  502. grub_sm712_sr_write (0x59, GRUB_SM712_SR_HW_CURSOR_UPPER_LEFT_X_LOW);
  503. grub_sm712_sr_write (0x02, GRUB_SM712_SR_HW_CURSOR_UPPER_LEFT_X_HIGH);
  504. grub_sm712_sr_write (0x44, GRUB_SM712_SR_HW_CURSOR_UPPER_LEFT_Y_LOW);
  505. grub_sm712_sr_write (0x02, GRUB_SM712_SR_HW_CURSOR_UPPER_LEFT_Y_HIGH);
  506. grub_sm712_sr_write (RGB332_BLACK, GRUB_SM712_SR_HW_CURSOR_FG_COLOR);
  507. grub_sm712_sr_write (RGB332_WHITE, GRUB_SM712_SR_HW_CURSOR_BG_COLOR);
  508. /* Undocumented */
  509. grub_sm712_sr_write (0x3a, 0x8e);
  510. grub_sm712_sr_write (0x3a, 0x8f);
  511. grub_sm712_sr_write (0, GRUB_SM712_SR_POPUP_ICON_X_LOW);
  512. grub_sm712_sr_write (0, GRUB_SM712_SR_POPUP_ICON_X_HIGH);
  513. grub_sm712_sr_write (0, GRUB_SM712_SR_POPUP_ICON_Y_LOW);
  514. grub_sm712_sr_write (0, GRUB_SM712_SR_POPUP_ICON_Y_HIGH);
  515. grub_sm712_sr_write (0, GRUB_SM712_SR_PANEL_HW_VIDEO_CONTROL);
  516. grub_sm712_sr_write (0x10, GRUB_SM712_SR_PANEL_HW_VIDEO_COLOR_KEY_LOW);
  517. grub_sm712_sr_write (0x08, GRUB_SM712_SR_PANEL_HW_VIDEO_COLOR_KEY_HIGH);
  518. grub_sm712_sr_write (0x00, GRUB_SM712_SR_PANEL_HW_VIDEO_COLOR_KEY_MASK_LOW);
  519. grub_sm712_sr_write (0x02, GRUB_SM712_SR_PANEL_HW_VIDEO_COLOR_KEY_MASK_HIGH);
  520. grub_sm712_sr_write (0xed, GRUB_SM712_SR_PANEL_HW_VIDEO_RED_CONSTANT);
  521. grub_sm712_sr_write (0xed, GRUB_SM712_SR_PANEL_HW_VIDEO_GREEN_CONSTANT);
  522. grub_sm712_sr_write (0xed, GRUB_SM712_SR_PANEL_HW_VIDEO_BLUE_CONSTANT);
  523. grub_sm712_sr_write (0x7b, GRUB_SM712_SR_PANEL_HW_VIDEO_TOP_BOUNDARY);
  524. grub_sm712_sr_write (0xfb, GRUB_SM712_SR_PANEL_HW_VIDEO_LEFT_BOUNDARY);
  525. grub_sm712_sr_write (0xff, GRUB_SM712_SR_PANEL_HW_VIDEO_BOTTOM_BOUNDARY);
  526. grub_sm712_sr_write (0xff, GRUB_SM712_SR_PANEL_HW_VIDEO_RIGHT_BOUNDARY);
  527. /* Doesn't match documentation? */
  528. grub_sm712_sr_write (0x97, GRUB_SM712_SR_PANEL_HW_VIDEO_TOP_LEFT_OVERFLOW_BOUNDARY);
  529. grub_sm712_sr_write (0xef, GRUB_SM712_SR_PANEL_HW_VIDEO_BOTTOM_RIGHT_OVERFLOW_BOUNDARY);
  530. grub_sm712_sr_write (0xbf, GRUB_SM712_SR_PANEL_HW_VIDEO_VERTICAL_STRETCH_FACTOR);
  531. grub_sm712_sr_write (0xdf, GRUB_SM712_SR_PANEL_HW_VIDEO_HORIZONTAL_STRETCH_FACTOR);
  532. grub_sm712_gr_write (GRUB_VGA_NO_PLANES, GRUB_VGA_GR_SET_RESET_PLANE);
  533. grub_sm712_gr_write (GRUB_VGA_NO_PLANES, GRUB_VGA_GR_SET_RESET_PLANE_ENABLE);
  534. grub_sm712_gr_write (GRUB_VGA_NO_PLANES, GRUB_VGA_GR_COLOR_COMPARE);
  535. grub_sm712_gr_write (GRUB_VGA_GR_DATA_ROTATE_NOP, GRUB_VGA_GR_DATA_ROTATE);
  536. grub_sm712_gr_write (GRUB_VGA_NO_PLANES, GRUB_VGA_GR_READ_MAP_REGISTER);
  537. grub_sm712_gr_write (GRUB_VGA_GR_MODE_256_COLOR, GRUB_VGA_GR_MODE);
  538. grub_sm712_gr_write (GRUB_VGA_GR_GR6_MMAP_A0
  539. | GRUB_VGA_GR_GR6_GRAPHICS_MODE, GRUB_VGA_GR_GR6);
  540. grub_sm712_gr_write (GRUB_VGA_ALL_PLANES, GRUB_VGA_GR_COLOR_COMPARE_DISABLE);
  541. grub_sm712_gr_write (0xff, GRUB_VGA_GR_BITMASK);
  542. /* Write palette mapping. */
  543. for (i = 0; i < 16; i++)
  544. grub_sm712_write_arx (i, i);
  545. grub_sm712_write_arx (GRUB_VGA_ARX_MODE_ENABLE_256COLOR
  546. | GRUB_VGA_ARX_MODE_GRAPHICS, GRUB_VGA_ARX_MODE);
  547. grub_sm712_write_arx (0, GRUB_VGA_ARX_OVERSCAN);
  548. grub_sm712_write_arx (GRUB_VGA_ALL_PLANES, GRUB_VGA_ARX_COLOR_PLANE_ENABLE);
  549. grub_sm712_write_arx (0, GRUB_VGA_ARX_HORIZONTAL_PANNING);
  550. grub_sm712_write_arx (0, GRUB_VGA_ARX_COLOR_SELECT);
  551. /* FIXME: compute this generically. */
  552. {
  553. struct grub_video_hw_config config =
  554. {
  555. .vertical_total = 806,
  556. .vertical_blank_start = 0x300,
  557. .vertical_blank_end = 0,
  558. .vertical_sync_start = 0x303,
  559. .vertical_sync_end = 0x9,
  560. .line_compare = 0x3ff,
  561. .vdisplay_end = 0x300,
  562. .pitch = 0x80,
  563. .horizontal_total = 164,
  564. .horizontal_end = 128,
  565. .horizontal_blank_start = 128,
  566. .horizontal_blank_end = 0,
  567. .horizontal_sync_pulse_start = 133,
  568. .horizontal_sync_pulse_end = 22
  569. };
  570. grub_vga_set_geometry (&config, grub_sm712_cr_write);
  571. config.horizontal_sync_pulse_start = 134;
  572. config.horizontal_sync_pulse_end = 21;
  573. config.vertical_sync_start = 0x301;
  574. config.vertical_sync_end = 0x0;
  575. config.line_compare = 0x0ff;
  576. config.vdisplay_end = 0x258;
  577. config.pitch = 0x7f;
  578. grub_vga_set_geometry (&config, grub_sm712_cr_shadow_write);
  579. }
  580. grub_sm712_cr_write (GRUB_VGA_CR_BYTE_PANNING_NORMAL,
  581. GRUB_VGA_CR_BYTE_PANNING);
  582. grub_sm712_cr_write (0, GRUB_VGA_CR_CURSOR_START);
  583. grub_sm712_cr_write (0, GRUB_VGA_CR_CURSOR_END);
  584. grub_sm712_cr_write (0, GRUB_VGA_CR_START_ADDR_HIGH_REGISTER);
  585. grub_sm712_cr_write (0, GRUB_VGA_CR_START_ADDR_LOW_REGISTER);
  586. grub_sm712_cr_write (0, GRUB_VGA_CR_CURSOR_ADDR_HIGH);
  587. grub_sm712_cr_write (0, GRUB_VGA_CR_CURSOR_ADDR_LOW);
  588. grub_sm712_cr_write (GRUB_VGA_CR_UNDERLINE_LOCATION_DWORD_MODE,
  589. GRUB_VGA_CR_UNDERLINE_LOCATION);
  590. grub_sm712_cr_write (GRUB_VGA_CR_MODE_ADDRESS_WRAP
  591. | GRUB_VGA_CR_MODE_BYTE_MODE
  592. | GRUB_VGA_CR_MODE_TIMING_ENABLE
  593. | GRUB_VGA_CR_MODE_NO_CGA
  594. | GRUB_VGA_CR_MODE_NO_HERCULES,
  595. GRUB_VGA_CR_MODE);
  596. grub_sm712_cr_write (0, GRUB_SM712_CR_OVERFLOW_INTERLACE);
  597. grub_sm712_cr_write (0, GRUB_SM712_CR_INTERLACE_RETRACE);
  598. grub_sm712_cr_write (0, GRUB_SM712_CR_TV_VDISPLAY_START);
  599. grub_sm712_cr_write (0, GRUB_SM712_CR_TV_VDISPLAY_END_HIGH);
  600. grub_sm712_cr_write (0, GRUB_SM712_CR_TV_VDISPLAY_END_LOW);
  601. grub_sm712_cr_write (0x80, GRUB_SM712_CR_DDA_CONTROL_LOW);
  602. grub_sm712_cr_write (0x02, GRUB_SM712_CR_DDA_CONTROL_HIGH);
  603. /* Undocumented */
  604. grub_sm712_cr_write (0x20, 0x37);
  605. grub_sm712_cr_write (0, GRUB_SM712_CR_TV_EQUALIZER);
  606. grub_sm712_cr_write (0, GRUB_SM712_CR_TV_SERRATION);
  607. grub_sm712_cr_write (0, GRUB_SM712_CR_HSYNC_CTRL);
  608. /* Undocumented */
  609. grub_sm712_cr_write (0x40, 0x3b);
  610. grub_sm712_cr_write (GRUB_SM712_CR_DEBUG_NONE, GRUB_SM712_CR_DEBUG);
  611. /* Undocumented */
  612. grub_sm712_cr_write (0xff, 0x3d);
  613. grub_sm712_cr_write (0x46, 0x3e);
  614. grub_sm712_cr_write (0x91, 0x3f);
  615. for (i = 0; i < ARRAY_SIZE (dda_lookups); i++)
  616. grub_sm712_write_dda_lookup (i, dda_lookups[i].compare, dda_lookups[i].dda,
  617. dda_lookups[i].vcentering);
  618. /* Undocumented */
  619. grub_sm712_cr_write (0, 0x9c);
  620. grub_sm712_cr_write (0, 0x9d);
  621. grub_sm712_cr_write (0, 0x9e);
  622. grub_sm712_cr_write (0, 0x9f);
  623. grub_sm712_cr_write (0, GRUB_SM712_CR_VCENTERING_OFFSET);
  624. grub_sm712_cr_write (0, GRUB_SM712_CR_HCENTERING_OFFSET);
  625. grub_sm712_write_reg (GRUB_VGA_IO_MISC_NEGATIVE_HORIZ_POLARITY
  626. | GRUB_VGA_IO_MISC_UPPER_64K
  627. | GRUB_VGA_IO_MISC_28MHZ
  628. | GRUB_VGA_IO_MISC_ENABLE_VRAM_ACCESS
  629. | GRUB_VGA_IO_MISC_COLOR,
  630. GRUB_VGA_IO_MISC_WRITE);
  631. #if !defined (TEST) && !defined(GENINIT)
  632. /* Undocumented? */
  633. *(volatile grub_uint32_t *) ((char *) framebuffer.ptr + 0x40c00c) = 0;
  634. *(volatile grub_uint32_t *) ((char *) framebuffer.ptr + 0x40c040) = 0;
  635. *(volatile grub_uint32_t *) ((char *) framebuffer.ptr + 0x40c000) = 0x20000;
  636. *(volatile grub_uint32_t *) ((char *) framebuffer.ptr + 0x40c010) = 0x1020100;
  637. #endif
  638. (void) grub_sm712_sr_read (0x16);
  639. #if !defined (TEST) && !defined(GENINIT)
  640. err = grub_video_fb_setup (mode_type, mode_mask,
  641. &framebuffer.mode_info,
  642. framebuffer.cached_ptr, NULL, NULL);
  643. if (err)
  644. return err;
  645. /* Copy default palette to initialize emulated palette. */
  646. err = grub_video_fb_set_palette (0, GRUB_VIDEO_FBSTD_NUMCOLORS,
  647. grub_video_fbstd_colors);
  648. return err;
  649. #else
  650. return 0;
  651. #endif
  652. }
  653. #if !defined (TEST) && !defined(GENINIT)
  654. static grub_err_t
  655. grub_video_sm712_swap_buffers (void)
  656. {
  657. grub_size_t s;
  658. s = (framebuffer.mode_info.height
  659. * framebuffer.mode_info.pitch
  660. * framebuffer.mode_info.bytes_per_pixel);
  661. grub_video_fb_swap_buffers ();
  662. grub_arch_sync_dma_caches (framebuffer.cached_ptr, s);
  663. return GRUB_ERR_NONE;
  664. }
  665. static grub_err_t
  666. grub_video_sm712_get_info_and_fini (struct grub_video_mode_info *mode_info,
  667. void **framebuf)
  668. {
  669. grub_memcpy (mode_info, &(framebuffer.mode_info), sizeof (*mode_info));
  670. *framebuf = (char *) framebuffer.ptr;
  671. grub_video_fb_fini ();
  672. return GRUB_ERR_NONE;
  673. }
  674. static struct grub_video_adapter grub_video_sm712_adapter =
  675. {
  676. .name = "SM712 Video Driver",
  677. .id = GRUB_VIDEO_DRIVER_SM712,
  678. .prio = GRUB_VIDEO_ADAPTER_PRIO_NATIVE,
  679. .init = grub_video_sm712_video_init,
  680. .fini = grub_video_sm712_video_fini,
  681. .setup = grub_video_sm712_setup,
  682. .get_info = grub_video_fb_get_info,
  683. .get_info_and_fini = grub_video_sm712_get_info_and_fini,
  684. .set_palette = grub_video_fb_set_palette,
  685. .get_palette = grub_video_fb_get_palette,
  686. .set_viewport = grub_video_fb_set_viewport,
  687. .get_viewport = grub_video_fb_get_viewport,
  688. .set_region = grub_video_fb_set_region,
  689. .get_region = grub_video_fb_get_region,
  690. .set_area_status = grub_video_fb_set_area_status,
  691. .get_area_status = grub_video_fb_get_area_status,
  692. .map_color = grub_video_fb_map_color,
  693. .map_rgb = grub_video_fb_map_rgb,
  694. .map_rgba = grub_video_fb_map_rgba,
  695. .unmap_color = grub_video_fb_unmap_color,
  696. .fill_rect = grub_video_fb_fill_rect,
  697. .blit_bitmap = grub_video_fb_blit_bitmap,
  698. .blit_render_target = grub_video_fb_blit_render_target,
  699. .scroll = grub_video_fb_scroll,
  700. .swap_buffers = grub_video_sm712_swap_buffers,
  701. .create_render_target = grub_video_fb_create_render_target,
  702. .delete_render_target = grub_video_fb_delete_render_target,
  703. .set_active_render_target = grub_video_fb_set_active_render_target,
  704. .get_active_render_target = grub_video_fb_get_active_render_target,
  705. .next = 0
  706. };
  707. GRUB_MOD_INIT(video_sm712)
  708. {
  709. grub_video_register (&grub_video_sm712_adapter);
  710. }
  711. GRUB_MOD_FINI(video_sm712)
  712. {
  713. grub_video_unregister (&grub_video_sm712_adapter);
  714. }
  715. #else
  716. int
  717. main ()
  718. {
  719. grub_video_sm712_setup (1024, 600, 0, 0);
  720. }
  721. #endif