5320_7c0000_gma.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520
  1. /*
  2. * This file is part of the coreboot project.
  3. *
  4. * Copyright (C) 2008-2009 coresystems GmbH
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; version 2 of the License.
  9. *
  10. * This program 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 this program; if not, write to the Free Software
  17. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  18. */
  19. #include <console/console.h>
  20. #include <bootmode.h>
  21. #include <delay.h>
  22. #include <device/device.h>
  23. #include <device/pci.h>
  24. #include <device/pci_ids.h>
  25. #include <pc80/mc146818rtc.h>
  26. #include "i945.h"
  27. #include "chip.h"
  28. #include <edid.h>
  29. #include <drivers/intel/gma/edid.h>
  30. #include <drivers/intel/gma/i915.h>
  31. #include <string.h>
  32. #define GDRST 0xc0
  33. #define LVDS_CLOCK_A_POWERUP_ALL (3 << 8)
  34. #define LVDS_CLOCK_B_POWERUP_ALL (3 << 4)
  35. #define LVDS_CLOCK_BOTH_POWERUP_ALL (3 << 2)
  36. #define DISPPLANE_BGRX888 (0x6<<26)
  37. #define DPLLB_LVDS_P2_CLOCK_DIV_7 (1 << 24) /* i915 */
  38. #define DPLL_INTEGRATED_CRI_CLK_VLV (1<<14)
  39. #define PGETBL_CTL 0x2020
  40. #define PGETBL_ENABLED 0x00000001
  41. #define BASE_FREQUENCY 120000
  42. #if CONFIG_MAINBOARD_DO_NATIVE_VGA_INIT
  43. static int gtt_setup(unsigned int mmiobase)
  44. {
  45. unsigned long PGETBL_save;
  46. PGETBL_save = read32(mmiobase + PGETBL_CTL) & ~PGETBL_ENABLED;
  47. PGETBL_save |= PGETBL_ENABLED;
  48. PGETBL_save |= pci_read_config32(dev_find_slot(0, PCI_DEVFN(2,0)), 0x5c) & 0xfffff000;
  49. PGETBL_save |= 2; /* set GTT to 256kb */
  50. // hack!!!
  51. PGETBL_save += 0x7c0000; // ugly hack. from 5927/3. Must calculate it properly!
  52. /// hack!!!
  53. write32(mmiobase + GFX_FLSH_CNTL, 0);
  54. write32(mmiobase + PGETBL_CTL, PGETBL_save);
  55. /* verify */
  56. /* // old
  57. if (read32(mmiobase + PGETBL_CTL) & PGETBL_ENABLED) {
  58. printk(BIOS_DEBUG, "gtt_setup is enabled.\n");
  59. */
  60. // Hack. Must do properly later:
  61. PGETBL_save = read32(mmiobase + PGETBL_CTL);
  62. if (PGETBL_save & PGETBL_ENABLED) {
  63. printk(BIOS_DEBUG, "gtt_setup is enabled: GTT PGETLB_CTL register: 0x%lx\n", PGETBL_save);
  64. // end hack
  65. } else {
  66. printk(BIOS_DEBUG, "gtt_setup failed!!!\n");
  67. return 1;
  68. }
  69. write32(mmiobase + GFX_FLSH_CNTL, 0);
  70. return 0;
  71. }
  72. static int intel_gma_init(struct northbridge_intel_i945_config *conf,
  73. unsigned int pphysbase, unsigned int piobase,
  74. unsigned int pmmio, unsigned int pgfx)
  75. {
  76. struct edid edid;
  77. u8 edid_data[128];
  78. unsigned long temp;
  79. int hpolarity, vpolarity;
  80. u32 candp1, candn;
  81. u32 best_delta = 0xffffffff;
  82. u32 target_frequency;
  83. u32 pixel_p1 = 1;
  84. u32 pixel_n = 1;
  85. u32 pixel_m1 = 1;
  86. u32 pixel_m2 = 1;
  87. u32 hactive, vactive, right_border, bottom_border;
  88. u32 vsync, hsync, vblank, hblank, hfront_porch, vfront_porch;
  89. u32 i, j;
  90. pphysbase += 0x20000;
  91. printk(BIOS_SPEW,
  92. "i915lightup: graphics %p mmio %08x addrport %04x physbase %08x\n",
  93. (void *)pgfx, pmmio, piobase, pphysbase);
  94. intel_gmbus_read_edid(pmmio + GMBUS0, 3, 0x50, edid_data, 128);
  95. decode_edid(edid_data, sizeof(edid_data), &edid);
  96. hpolarity = (edid.phsync == '-');
  97. vpolarity = (edid.pvsync == '-');
  98. hactive = edid.x_resolution;
  99. vactive = edid.y_resolution;
  100. right_border = edid.hborder;
  101. bottom_border = edid.vborder;
  102. vblank = edid.vbl;
  103. hblank = edid.hbl;
  104. vsync = edid.vspw;
  105. hsync = edid.hspw;
  106. hfront_porch = edid.hso;
  107. vfront_porch = edid.vso;
  108. for (i = 0; i < 2; i++)
  109. for (j = 0; j < 0x100; j++)
  110. /* R=j, G=j, B=j. */
  111. write32(pmmio + PALETTE(i) + 4 * j, 0x10101 * j);
  112. write32(pmmio + PCH_PP_CONTROL, PANEL_UNLOCK_REGS
  113. | (read32(pmmio + PCH_PP_CONTROL) & ~PANEL_UNLOCK_MASK));
  114. write32(pmmio + MI_ARB_STATE, MI_ARB_C3_LP_WRITE_ENABLE | (1 << 27));
  115. /* Clean registers. */
  116. for (i = 0; i < 0x20; i += 4)
  117. write32(pmmio + RENDER_RING_BASE + i, 0);
  118. for (i = 0; i < 0x20; i += 4)
  119. write32(pmmio + FENCE_REG_965_0 + i, 0);
  120. write32(pmmio + PP_ON_DELAYS, 0);
  121. write32(pmmio + PP_OFF_DELAYS, 0);
  122. /* Disable VGA. */
  123. write32(pmmio + VGACNTRL, VGA_DISP_DISABLE);
  124. /* Disable pipes. */
  125. write32(pmmio + PIPECONF(0), 0);
  126. write32(pmmio + PIPECONF(1), 0);
  127. /* Init PRB0. */
  128. write32(pmmio + HWS_PGA, 0x352d2000);
  129. write32(pmmio + PRB0_CTL, 0);
  130. write32(pmmio + PRB0_HEAD, 0);
  131. write32(pmmio + PRB0_TAIL, 0);
  132. write32(pmmio + PRB0_START, 0);
  133. write32(pmmio + PRB0_CTL, 0x0001f001);
  134. write32(pmmio + D_STATE, DSTATE_PLL_D3_OFF
  135. | DSTATE_GFX_CLOCK_GATING | DSTATE_DOT_CLOCK_GATING);
  136. write32(pmmio + ECOSKPD, 0x00010000);
  137. write32(pmmio + HWSTAM, 0xeffe);
  138. write32(pmmio + PORT_HOTPLUG_EN, conf->gpu_hotplug);
  139. write32(pmmio + INSTPM, 0x08000000 | INSTPM_AGPBUSY_DIS);
  140. target_frequency = conf->gpu_lvds_is_dual_channel ? edid.pixel_clock
  141. : (2 * edid.pixel_clock);
  142. /* Find suitable divisors. */
  143. for (candp1 = 1; candp1 <= 8; candp1++) {
  144. for (candn = 5; candn <= 10; candn++) {
  145. u32 cur_frequency;
  146. u32 m; /* 77 - 131. */
  147. u32 denom; /* 35 - 560. */
  148. u32 current_delta;
  149. denom = candn * candp1 * 7;
  150. /* Doesnt overflow for up to
  151. 5000000 kHz = 5 GHz. */
  152. m = (target_frequency * denom
  153. + BASE_FREQUENCY / 2) / BASE_FREQUENCY;
  154. if (m < 77 || m > 131)
  155. continue;
  156. cur_frequency = (BASE_FREQUENCY * m) / denom;
  157. if (target_frequency > cur_frequency)
  158. current_delta = target_frequency - cur_frequency;
  159. else
  160. current_delta = cur_frequency - target_frequency;
  161. if (best_delta > current_delta) {
  162. best_delta = current_delta;
  163. pixel_n = candn;
  164. pixel_p1 = candp1;
  165. pixel_m2 = ((m + 3) % 5) + 7;
  166. pixel_m1 = (m - pixel_m2) / 5;
  167. }
  168. }
  169. }
  170. if (best_delta == 0xffffffff) {
  171. printk (BIOS_ERR, "Couldn't find GFX clock divisors\n");
  172. return -1;
  173. }
  174. printk(BIOS_INFO, "bringing up panel at resolution %d x %d\n",
  175. hactive, vactive);
  176. printk(BIOS_DEBUG, "Borders %d x %d\n", right_border, bottom_border);
  177. printk(BIOS_DEBUG, "Blank %d x %d\n", hblank, vblank);
  178. printk(BIOS_DEBUG, "Sync %d x %d\n", hsync, vsync);
  179. printk(BIOS_DEBUG, "Front porch %d x %d\n", hfront_porch, vfront_porch);
  180. printk(BIOS_DEBUG, (conf->gpu_lvds_use_spread_spectrum_clock
  181. ? "Spread spectrum clock\n"
  182. : "DREF clock\n"));
  183. printk(BIOS_DEBUG, (conf->gpu_lvds_is_dual_channel
  184. ? "Dual channel\n"
  185. : "Single channel\n"));
  186. printk(BIOS_DEBUG, "Polarities %d, %d\n",
  187. hpolarity, vpolarity);
  188. printk(BIOS_DEBUG, "Pixel N=%d, M1=%d, M2=%d, P1=%d\n",
  189. pixel_n, pixel_m1, pixel_m2, pixel_p1);
  190. printk(BIOS_DEBUG, "Pixel clock %d kHz\n",
  191. BASE_FREQUENCY * (5 * pixel_m1 + pixel_m2) / pixel_n
  192. / (pixel_p1 * 7));
  193. write32(pmmio + DSPCNTR(0), DISPPLANE_BGRX888
  194. | DISPPLANE_SEL_PIPE_B | DISPPLANE_GAMMA_ENABLE);
  195. mdelay(1);
  196. write32(pmmio + PP_CONTROL, PANEL_UNLOCK_REGS
  197. | (read32(pmmio + PP_CONTROL) & ~PANEL_UNLOCK_MASK));
  198. write32(pmmio + FP0(1),
  199. ((pixel_n - 2) << 16)
  200. | ((pixel_m1 - 2) << 8) | pixel_m2);
  201. write32(pmmio + DPLL(1),
  202. DPLL_VGA_MODE_DIS |
  203. DPLL_VCO_ENABLE | DPLLB_MODE_LVDS
  204. | (conf->gpu_lvds_is_dual_channel ? DPLLB_LVDS_P2_CLOCK_DIV_7
  205. : DPLLB_LVDS_P2_CLOCK_DIV_14)
  206. | (conf->gpu_lvds_use_spread_spectrum_clock
  207. ? DPLL_INTEGRATED_CLOCK_VLV | DPLL_INTEGRATED_CRI_CLK_VLV
  208. : 0)
  209. | (pixel_p1 << 16)
  210. | (pixel_p1));
  211. mdelay(1);
  212. write32(pmmio + DPLL(1),
  213. DPLL_VGA_MODE_DIS |
  214. DPLL_VCO_ENABLE | DPLLB_MODE_LVDS
  215. | (conf->gpu_lvds_is_dual_channel ? DPLLB_LVDS_P2_CLOCK_DIV_7
  216. : DPLLB_LVDS_P2_CLOCK_DIV_14)
  217. | ((conf->gpu_lvds_use_spread_spectrum_clock ? 3 : 0) << 13)
  218. | (pixel_p1 << 16)
  219. | (pixel_p1));
  220. mdelay(1);
  221. write32(pmmio + HTOTAL(1),
  222. ((hactive + right_border + hblank - 1) << 16)
  223. | (hactive - 1));
  224. write32(pmmio + HBLANK(1),
  225. ((hactive + right_border + hblank - 1) << 16)
  226. | (hactive + right_border - 1));
  227. write32(pmmio + HSYNC(1),
  228. ((hactive + right_border + hfront_porch + hsync - 1) << 16)
  229. | (hactive + right_border + hfront_porch - 1));
  230. write32(pmmio + VTOTAL(1), ((vactive + bottom_border + vblank - 1) << 16)
  231. | (vactive - 1));
  232. write32(pmmio + VBLANK(1), ((vactive + bottom_border + vblank - 1) << 16)
  233. | (vactive + bottom_border - 1));
  234. write32(pmmio + VSYNC(1),
  235. (vactive + bottom_border + vfront_porch + vsync - 1)
  236. | (vactive + bottom_border + vfront_porch - 1));
  237. write32(pmmio + PIPESRC(1), ((hactive - 1) << 16) | (vactive - 1));
  238. /* Disable panel fitter (we're in native resolution). */
  239. write32(pmmio + PF_CTL(0), 0);
  240. write32(pmmio + PF_WIN_SZ(0), 0);
  241. write32(pmmio + PF_WIN_POS(0), 0);
  242. write32(pmmio + PFIT_PGM_RATIOS, 0);
  243. write32(pmmio + PFIT_CONTROL, 0);
  244. mdelay(1);
  245. write32(pmmio + DSPSIZE(0), (hactive - 1) | ((vactive - 1) << 16));
  246. write32(pmmio + DSPPOS(0), 0);
  247. /* Backlight init. */
  248. write32(pmmio + FW_BLC_SELF, FW_BLC_SELF_EN_MASK);
  249. write32(pmmio + FW_BLC, 0x011d011a);
  250. write32(pmmio + FW_BLC2, 0x00000102);
  251. write32(pmmio + FW_BLC_SELF, FW_BLC_SELF_EN_MASK);
  252. write32(pmmio + FW_BLC_SELF, 0x0001003f);
  253. write32(pmmio + FW_BLC, 0x011d0109);
  254. write32(pmmio + FW_BLC2, 0x00000102);
  255. write32(pmmio + FW_BLC_SELF, FW_BLC_SELF_EN_MASK);
  256. write32(pmmio + BLC_PWM_CTL, conf->gpu_backlight);
  257. edid.bytes_per_line = (edid.bytes_per_line + 63) & ~63;
  258. write32(pmmio + DSPADDR(0), 0);
  259. write32(pmmio + DSPSURF(0), 0);
  260. write32(pmmio + DSPSTRIDE(0), edid.bytes_per_line);
  261. write32(pmmio + DSPCNTR(0), DISPLAY_PLANE_ENABLE | DISPPLANE_BGRX888
  262. | DISPPLANE_SEL_PIPE_B | DISPPLANE_GAMMA_ENABLE);
  263. mdelay(1);
  264. write32(pmmio + PIPECONF(1), PIPECONF_ENABLE);
  265. write32(pmmio + LVDS, LVDS_ON
  266. | (hpolarity << 20) | (vpolarity << 21)
  267. | (conf->gpu_lvds_is_dual_channel ? LVDS_CLOCK_B_POWERUP_ALL
  268. | LVDS_CLOCK_BOTH_POWERUP_ALL : 0)
  269. | LVDS_CLOCK_A_POWERUP_ALL
  270. | LVDS_PIPE(1));
  271. write32(pmmio + PP_CONTROL, PANEL_UNLOCK_REGS | PANEL_POWER_OFF);
  272. write32(pmmio + PP_CONTROL, PANEL_UNLOCK_REGS | PANEL_POWER_RESET);
  273. mdelay(1);
  274. write32(pmmio + PP_CONTROL, PANEL_UNLOCK_REGS
  275. | PANEL_POWER_ON | PANEL_POWER_RESET);
  276. printk (BIOS_DEBUG, "waiting for panel powerup\n");
  277. while (1) {
  278. u32 reg32;
  279. reg32 = read32(pmmio + PP_STATUS);
  280. if ((reg32 & PP_SEQUENCE_MASK) == PP_SEQUENCE_NONE)
  281. break;
  282. }
  283. printk (BIOS_DEBUG, "panel powered up\n");
  284. write32(pmmio + PP_CONTROL, PANEL_POWER_ON | PANEL_POWER_RESET);
  285. /* Clear interrupts. */
  286. write32(pmmio + DEIIR, 0xffffffff);
  287. write32(pmmio + SDEIIR, 0xffffffff);
  288. write32(pmmio + IIR, 0xffffffff);
  289. write32(pmmio + IMR, 0xffffffff);
  290. write32(pmmio + EIR, 0xffffffff);
  291. /* GTT is the Global Translation Table for the graphics pipeline.
  292. * It is used to translate graphics addresses to physical
  293. * memory addresses. As in the CPU, GTTs map 4K pages.
  294. * There are 32 bits per pixel, or 4 bytes,
  295. * which means 1024 pixels per page.
  296. * There are 4250 GTTs on Link:
  297. * 2650 (X) * 1700 (Y) pixels / 1024 pixels per page.
  298. * The setgtt function adds a further bit of flexibility:
  299. * it allows you to set a range (the first two parameters) to point
  300. * to a physical address (third parameter);the physical address is
  301. * incremented by a count (fourth parameter) for each GTT in the
  302. * range.
  303. * Why do it this way? For ultrafast startup,
  304. * we can point all the GTT entries to point to one page,
  305. * and set that page to 0s:
  306. * memset(physbase, 0, 4096);
  307. * setgtt(0, 4250, physbase, 0);
  308. * this takes about 2 ms, and is a win because zeroing
  309. * the page takes a up to 200 ms. We will be exploiting this
  310. * trick in a later rev of this code.
  311. * This call sets the GTT to point to a linear range of pages
  312. * starting at physbase.
  313. */
  314. if (gtt_setup(pmmio)) {
  315. printk(BIOS_ERR, "ERROR: GTT Setup Failed!!!\n");
  316. return 0;
  317. }
  318. /* Setup GTT. */
  319. for (i = 0; i < 0x2000; i++)
  320. {
  321. outl((i << 2) | 1, piobase);
  322. outl(pphysbase + (i << 12) + 1, piobase + 4);
  323. }
  324. temp = read32(pmmio + PGETBL_CTL);
  325. printk(BIOS_INFO, "GTT PGETBL_CTL register: 0x%lx\n", temp);
  326. if (temp & 1)
  327. printk(BIOS_INFO, "GTT Enabled\n");
  328. else
  329. printk(BIOS_ERR, "ERROR: GTT is still Disabled!!!\n");
  330. printk(BIOS_SPEW, "memset %p to 0x00 for %d bytes\n",
  331. (void *)pgfx, hactive * vactive * 4);
  332. memset((void *)pgfx, 0x00, hactive * vactive * 4);
  333. set_vbe_mode_info_valid(&edid, pgfx);
  334. return 0;
  335. }
  336. #endif
  337. static void gma_func0_init(struct device *dev)
  338. {
  339. u32 reg32;
  340. /* Unconditionally reset graphics */
  341. pci_write_config8(dev, GDRST, 1);
  342. udelay(50);
  343. pci_write_config8(dev, GDRST, 0);
  344. /* wait for device to finish */
  345. while (pci_read_config8(dev, GDRST) & 1) { };
  346. /* IGD needs to be Bus Master */
  347. reg32 = pci_read_config32(dev, PCI_COMMAND);
  348. pci_write_config32(dev, PCI_COMMAND, reg32 | PCI_COMMAND_MASTER
  349. | PCI_COMMAND_IO | PCI_COMMAND_MEMORY);
  350. #if !CONFIG_MAINBOARD_DO_NATIVE_VGA_INIT
  351. /* PCI Init, will run VBIOS */
  352. pci_dev_init(dev);
  353. #endif
  354. #if CONFIG_MAINBOARD_DO_NATIVE_VGA_INIT
  355. /* This should probably run before post VBIOS init. */
  356. printk(BIOS_SPEW, "Initializing VGA without OPROM.\n");
  357. u32 iobase, mmiobase, graphics_base;
  358. struct northbridge_intel_i945_config *conf = dev->chip_info;
  359. iobase = dev->resource_list[1].base;
  360. mmiobase = dev->resource_list[0].base;
  361. graphics_base = dev->resource_list[2].base;
  362. printk(BIOS_SPEW, "GMADR=0x%08x GTTADR=0x%08x\n",
  363. pci_read_config32(dev, 0x18),
  364. pci_read_config32(dev, 0x1c)
  365. );
  366. int err;
  367. err = intel_gma_init(conf, pci_read_config32(dev, 0x5c) & ~0xf,
  368. iobase, mmiobase, graphics_base);
  369. if (err == 0)
  370. gfx_set_init_done(1);
  371. #endif
  372. }
  373. /* This doesn't reclaim stolen UMA memory, but IGD could still
  374. be reenabled later. */
  375. static void gma_func0_disable(struct device *dev)
  376. {
  377. struct device *dev_host = dev_find_slot(0, PCI_DEVFN(0x0, 0));
  378. pci_write_config16(dev, GCFC, 0xa00);
  379. pci_write_config16(dev_host, GGC, (1 << 1));
  380. unsigned int reg32 = pci_read_config32(dev_host, DEVEN);
  381. reg32 &= ~(DEVEN_D2F0 | DEVEN_D2F1);
  382. pci_write_config32(dev_host, DEVEN, reg32);
  383. dev->enabled = 0;
  384. }
  385. static void gma_func1_init(struct device *dev)
  386. {
  387. u32 reg32;
  388. u8 val;
  389. /* IGD needs to be Bus Master, also enable IO accesss */
  390. reg32 = pci_read_config32(dev, PCI_COMMAND);
  391. pci_write_config32(dev, PCI_COMMAND, reg32 |
  392. PCI_COMMAND_MASTER | PCI_COMMAND_MEMORY | PCI_COMMAND_IO);
  393. if (get_option(&val, "tft_brightness") == CB_SUCCESS)
  394. pci_write_config8(dev, 0xf4, val);
  395. else
  396. pci_write_config8(dev, 0xf4, 0xff);
  397. }
  398. static void gma_set_subsystem(device_t dev, unsigned vendor, unsigned device)
  399. {
  400. if (!vendor || !device) {
  401. pci_write_config32(dev, PCI_SUBSYSTEM_VENDOR_ID,
  402. pci_read_config32(dev, PCI_VENDOR_ID));
  403. } else {
  404. pci_write_config32(dev, PCI_SUBSYSTEM_VENDOR_ID,
  405. ((device & 0xffff) << 16) | (vendor & 0xffff));
  406. }
  407. }
  408. static struct pci_operations gma_pci_ops = {
  409. .set_subsystem = gma_set_subsystem,
  410. };
  411. static struct device_operations gma_func0_ops = {
  412. .read_resources = pci_dev_read_resources,
  413. .set_resources = pci_dev_set_resources,
  414. .enable_resources = pci_dev_enable_resources,
  415. .init = gma_func0_init,
  416. .scan_bus = 0,
  417. .enable = 0,
  418. .disable = gma_func0_disable,
  419. .ops_pci = &gma_pci_ops,
  420. };
  421. static struct device_operations gma_func1_ops = {
  422. .read_resources = pci_dev_read_resources,
  423. .set_resources = pci_dev_set_resources,
  424. .enable_resources = pci_dev_enable_resources,
  425. .init = gma_func1_init,
  426. .scan_bus = 0,
  427. .enable = 0,
  428. .ops_pci = &gma_pci_ops,
  429. };
  430. static const struct pci_driver i945_gma_func0_driver __pci_driver = {
  431. .ops = &gma_func0_ops,
  432. .vendor = PCI_VENDOR_ID_INTEL,
  433. .device = 0x27a2,
  434. };
  435. static const struct pci_driver i945_gma_func1_driver __pci_driver = {
  436. .ops = &gma_func1_ops,
  437. .vendor = PCI_VENDOR_ID_INTEL,
  438. .device = 0x27a6,
  439. };