2 * ATI Rage XL Initialization. Support for Xpert98 and Victoria
5 * Copyright (C) 2002 MontaVista Software Inc.
6 * Author: MontaVista Software, Inc.
7 * stevel@mvista.com or source@mvista.com
8 * Copyright (C) 2004 Tyan Computer.
9 * Auther: Yinghai Lu yhlu@tyan.com
11 * This code is distributed without warranty under the GPL v2 (see COPYING) *
18 #include <console/console.h>
19 #include <device/device.h>
20 #include <device/pci.h>
21 #include <device/pci_ids.h>
22 #include <device/pci_ops.h>
28 struct aty_cmap_regs {
38 #include <console/btext.h>
40 #include "mach64_ct.c"
42 #define MPLL_GAIN 0xad
43 #define VPLL_GAIN 0xd5
51 //static struct aty_pll_ops aty_pll_ct;
53 #define DEFAULT_CARD XPERT98
54 static int xl_card = DEFAULT_CARD;
56 static const struct xl_card_cfg_t {
57 int ref_crystal; // 10^4 Hz
66 u32 custom_macro_cntl;
69 } card_cfg[NUM_XL_CARDS] = {
71 { 2700, SDRAM, 0x800000,
72 0x10757A3B, 0x64000C81, 0x00110202, 0x7b33A040,
73 0x82010102, 0x48803800, 0x005E0179,
77 { 1432, WRAM, 0x800000,
78 0x00165A2B, 0xE0000CF1, 0x00200213, 0x7333A001,
79 0x8000000A, 0x48833800, 0x007F0779,
89 static const lcd_tbl_t lcd_tbl[] = {
100 { 0x35, 0x00000000 },
101 { 0x36, 0x00000000 },
105 static inline u32 aty_ld_lcd(u8 lcd_reg, struct fb_info_aty *info)
107 aty_st_8(LCD_INDEX, lcd_reg, info);
108 return aty_ld_le32(LCD_DATA, info);
111 static inline void aty_st_lcd(u8 lcd_reg, u32 val,
112 struct fb_info_aty *info)
114 aty_st_8(LCD_INDEX, lcd_reg, info);
115 aty_st_le32(LCD_DATA, val, info);
118 static void reset_gui(struct fb_info_aty *info)
120 aty_st_8(GEN_TEST_CNTL+1, 0x01, info);
121 aty_st_8(GEN_TEST_CNTL+1, 0x00, info);
122 aty_st_8(GEN_TEST_CNTL+1, 0x02, info);
127 static void reset_sdram(struct fb_info_aty *info)
131 temp = aty_ld_8(EXT_MEM_CNTL, info);
133 aty_st_8(EXT_MEM_CNTL, temp, info); // MEM_SDRAM_RESET = 1b
135 aty_st_8(EXT_MEM_CNTL, temp, info); // MEM_CYC_TEST = 10b
137 aty_st_8(EXT_MEM_CNTL, temp, info); // MEM_CYC_TEST = 11b
140 aty_st_8(EXT_MEM_CNTL, temp, info); // MEM_CYC_TEST = 00b
142 aty_st_8(EXT_MEM_CNTL, temp, info); // MEM_SDRAM_REST = 0b
146 static void init_dll(struct fb_info_aty *info)
149 aty_st_pll(PLL_GEN_CNTL,
150 aty_ld_pll(PLL_GEN_CNTL, info) & 0x7f,
154 aty_st_pll(DLL_CNTL, 0x82, info);
155 aty_st_pll(DLL_CNTL, 0xE2, info);
157 aty_st_pll(DLL_CNTL, 0x82, info);
161 static void reset_clocks(struct fb_info_aty *info, struct pll_ct *pll,
165 aty_st_pll(MCLK_FB_DIV, pll->mclk_fb_div, info);
166 aty_st_pll(SCLK_FB_DIV, pll->sclk_fb_div, info);
170 aty_st_8(GEN_TEST_CNTL+1, 0x00, info);
172 aty_st_8(CRTC_GEN_CNTL+3, 0x04, info);
175 aty_st_8(CRTC_GEN_CNTL+3,
176 hsync_enb ? 0x00 : 0x04, info);
178 aty_st_pll(SPLL_CNTL2, pll->spll_cntl2, info);
179 aty_st_pll(PLL_GEN_CNTL, pll->pll_gen_cntl, info);
180 aty_st_pll(PLL_VCLK_CNTL, pll->pll_vclk_cntl, info);
183 static int atyfb_xl_init(struct fb_info_aty *info)
188 const struct xl_card_cfg_t * card = &card_cfg[xl_card];
190 aty_st_8(CONFIG_STAT0, 0x85, info);
194 * The following needs to be set before the call
195 * to var_to_pll() below. They'll be re-set again
196 * to the same values in aty_init().
198 info->ref_clk_per = 100000000UL/card->ref_crystal;
199 info->ram_type = card->mem_type;
200 info->total_vram = card->mem_size;
201 if (xl_card == VICTORIA) {
202 // the MCLK, XCLK are 120MHz on victoria card
203 info->mclk_per = 1000000/120;
204 info->xclk_per = 1000000/120;
205 info->features &= ~M64F_MFB_TIMES_4;
209 * Calculate mclk and xclk dividers, etc. The passed
210 * pixclock and bpp values don't matter yet, the vclk
211 * isn't programmed until later.
213 if ((err = aty_var_to_pll_ct(info, 39726, 8, &pll))) return err;
214 // if ((err = aty_pll_ct.var_to_pll(info, 39726, 8, &pll))) return err;
217 aty_st_pll(LVDS_CNTL0, 0x00, info);
218 aty_st_pll(DLL2_CNTL, card->dll2_cntl, info);
219 aty_st_pll(V2PLL_CNTL, 0x10, info);
220 aty_st_pll(MPLL_CNTL, MPLL_GAIN, info);
221 aty_st_pll(VPLL_CNTL, VPLL_GAIN, info);
222 aty_st_pll(PLL_VCLK_CNTL, 0x00, info);
223 aty_st_pll(VFC_CNTL, 0x1B, info);
224 aty_st_pll(PLL_REF_DIV, pll.ct.pll_ref_div, info);
225 aty_st_pll(PLL_EXT_CNTL, pll.ct.pll_ext_cntl, info);
226 aty_st_pll(SPLL_CNTL2, 0x03, info);
227 aty_st_pll(PLL_GEN_CNTL, 0x44, info);
229 reset_clocks(info, &pll.ct, 0);
232 aty_st_pll(VCLK_POST_DIV, 0x03, info);
233 aty_st_pll(VCLK0_FB_DIV, 0xDA, info);
234 aty_st_pll(VCLK_POST_DIV, 0x0F, info);
235 aty_st_pll(VCLK1_FB_DIV, 0xF5, info);
236 aty_st_pll(VCLK_POST_DIV, 0x3F, info);
237 aty_st_pll(PLL_EXT_CNTL, 0x40 | pll.ct.pll_ext_cntl, info);
238 aty_st_pll(VCLK2_FB_DIV, 0x00, info);
239 aty_st_pll(VCLK_POST_DIV, 0xFF, info);
240 aty_st_pll(PLL_EXT_CNTL, 0xC0 | pll.ct.pll_ext_cntl, info);
241 aty_st_pll(VCLK3_FB_DIV, 0x00, info);
243 aty_st_8(BUS_CNTL, 0x01, info);
244 aty_st_le32(BUS_CNTL, card->bus_cntl | 0x08000000, info);
246 aty_st_le32(CRTC_GEN_CNTL, 0x04000200, info);
247 aty_st_le16(CONFIG_STAT0, 0x0020, info);
248 aty_st_le32(MEM_CNTL, 0x10151A33, info);
249 aty_st_le32(EXT_MEM_CNTL, 0xE0000C01, info);
250 aty_st_le16(CRTC_GEN_CNTL+2, 0x0000, info);
251 aty_st_le32(DAC_CNTL, card->dac_cntl, info);
252 aty_st_le16(GEN_TEST_CNTL, 0x0100, info);
253 aty_st_le32(CUSTOM_MACRO_CNTL, 0x003C0171, info);
254 aty_st_le32(MEM_BUF_CNTL, 0x00382848, info);
256 aty_st_le32(HW_DEBUG, card->hw_debug, info);
257 aty_st_le16(MEM_ADDR_CONFIG, 0x0000, info);
258 aty_st_le16(GP_IO+2, 0x0000, info);
259 aty_st_le16(GEN_TEST_CNTL, 0x0000, info);
260 aty_st_le16(EXT_DAC_REGS+2, 0x0000, info);
261 aty_st_le32(CRTC_INT_CNTL, 0x00000000, info);
262 aty_st_le32(TIMER_CONFIG, 0x00000000, info);
263 aty_st_le32(0xEC, 0x00000000, info);
264 aty_st_le32(0xFC, 0x00000000, info);
266 for (i=0; i<sizeof(lcd_tbl)/sizeof(lcd_tbl_t); i++) {
267 aty_st_lcd(lcd_tbl[i].lcd_reg, lcd_tbl[i].val, info);
270 aty_st_le16(CONFIG_STAT0, 0x00A4, info);
273 aty_st_8(BUS_CNTL+1, 0xA0, info);
276 reset_clocks(info, &pll.ct, 1);
279 // something about power management
280 aty_st_8(LCD_INDEX, 0x08, info);
281 aty_st_8(LCD_DATA, 0x0A, info);
282 aty_st_8(LCD_INDEX, 0x08, info);
283 aty_st_8(LCD_DATA+3, 0x02, info);
284 aty_st_8(LCD_INDEX, 0x08, info);
285 aty_st_8(LCD_DATA, 0x0B, info);
288 // enable display requests, enable CRTC
289 aty_st_8(CRTC_GEN_CNTL+3, 0x02, info);
291 aty_st_8(CRTC_GEN_CNTL, 0x40, info);
292 // disable display requests, disable CRTC
293 aty_st_8(CRTC_GEN_CNTL+3, 0x04, info);
296 aty_st_pll(PLL_YCLK_CNTL, 0x25, info);
298 aty_st_le16(CUSTOM_MACRO_CNTL, 0x0179, info);
299 aty_st_le16(CUSTOM_MACRO_CNTL+2, 0x005E, info);
300 aty_st_le16(CUSTOM_MACRO_CNTL+2, card->custom_macro_cntl>>16, info);
301 aty_st_8(CUSTOM_MACRO_CNTL+1,
302 (card->custom_macro_cntl>>8) & 0xff, info);
304 aty_st_le32(MEM_ADDR_CONFIG, card->mem_addr_config, info);
305 aty_st_le32(MEM_CNTL, card->mem_cntl, info);
306 aty_st_le32(EXT_MEM_CNTL, card->ext_mem_cntl, info);
308 aty_st_8(CONFIG_STAT0, 0xA0 | card->mem_type, info);
310 aty_st_pll(PLL_YCLK_CNTL, 0x01, info);
312 aty_st_pll(PLL_YCLK_CNTL, card->pll_yclk_cntl, info);
315 reset_clocks(info, &pll.ct, 0);
317 reset_clocks(info, &pll.ct, 0);
320 // enable extended register block
321 aty_st_8(BUS_CNTL+3, 0x7B, info);
323 // disable extended register block
324 aty_st_8(BUS_CNTL+3, 0x73, info);
326 aty_st_8(CONFIG_STAT0, 0x80 | card->mem_type, info);
328 // disable display requests, disable CRTC
329 aty_st_8(CRTC_GEN_CNTL+3, 0x04, info);
330 // disable mapping registers in VGA aperture
331 aty_st_8(CONFIG_CNTL, aty_ld_8(CONFIG_CNTL, info) & ~0x04, info);
333 // enable display requests, enable CRTC
334 aty_st_8(CRTC_GEN_CNTL+3, 0x02, info);
336 // make GPIO's 14,15,16 all inputs
337 aty_st_8(LCD_INDEX, 0x07, info);
338 aty_st_8(LCD_DATA+3, 0x00, info);
340 // enable the display
341 aty_st_8(CRTC_GEN_CNTL, 0x00, info);
343 // reset the memory controller
344 aty_st_8(GEN_TEST_CNTL+1, 0x02, info);
346 aty_st_8(GEN_TEST_CNTL+1, 0x00, info);
349 // enable extended register block
351 (u8)(aty_ld_8(BUS_CNTL+3, info) | 0x08),
353 // set FIFO size to 512 (PIO)
354 aty_st_le32(GUI_CNTL,
355 aty_ld_le32(GUI_CNTL, info) & ~0x3,
358 // enable CRT and disable lcd
359 aty_st_8(LCD_INDEX, 0x01, info);
360 temp = aty_ld_le32(LCD_DATA, info);
361 temp = (temp | 0x01) & ~0x02;
362 aty_st_le32(LCD_DATA, temp, info);
367 static char m64n_xl_33[] = "3D RAGE (XL PCI-33MHz)";
368 static char m64n_xl_66[] = "3D RAGE (XL PCI-66MHz)";
370 static void aty_set_crtc(const struct fb_info_aty *info,
371 const struct crtc *crtc);
372 static int aty_var_to_crtc(const struct fb_info_aty *info,
373 const struct fb_var_screeninfo *var,
376 static int aty_crtc_to_var(const struct crtc *crtc,
377 struct fb_var_screeninfo *var);
380 static void atyfb_set_par(const struct atyfb_par *par,
381 struct fb_info_aty *info);
382 static int atyfb_decode_var(const struct fb_var_screeninfo *var,
383 struct atyfb_par *par,
384 const struct fb_info_aty *info);
386 static int atyfb_encode_var(struct fb_var_screeninfo *var,
387 const struct atyfb_par *par,
388 const struct fb_info_aty *info);
391 static void do_install_cmap(int con, struct fb_info *fb);
394 static u32 default_vram = 0;
397 unsigned char color_table[] = { 0, 4, 2, 6, 1, 5, 3, 7,
398 8,12,10,14, 9,13,11,15 };
400 /* the default colour table, for VGA+ colour systems */
401 int default_red[] = {0x00,0xaa,0x00,0xaa,0x00,0xaa,0x00,0xaa,
402 0x55,0xff,0x55,0xff,0x55,0xff,0x55,0xff};
403 int default_grn[] = {0x00,0x00,0xaa,0x55,0x00,0x00,0xaa,0xaa,
404 0x55,0x55,0xff,0xff,0x55,0x55,0xff,0xff};
405 int default_blu[] = {0x00,0x00,0x00,0x00,0xaa,0xaa,0xaa,0xaa,
406 0x55,0x55,0x55,0x55,0xff,0xff,0xff,0xff};
409 struct fb_var_screeninfo default_var = {
410 /* 640x480, 60 Hz, Non-Interlaced (25.175 MHz dotclock) */
411 640, 480, 640, 480, 0, 0, 8, 0,
412 {0, 8, 0}, {0, 8, 0}, {0, 8, 0}, {0, 0, 0},
413 0, 0, -1, -1, 0, 39722, 48, 16, 33, 10, 96, 2,
414 0, FB_VMODE_NONINTERLACED
418 u16 pci_id, chip_type;
419 u8 rev_mask, rev_val;
424 /* 3D RAGE XL PCI-66/BGA */
425 { 0x474f, 0x474f, 0x00, 0x00, m64n_xl_66, 230, 83, 63, M64F_GT | M64F_INTEGRATED | M64F_RESET_3D | M64F_GTB_DSP | M64F_SDRAM_MAGIC_PLL | M64F_EXTRA_BRIGHT | M64F_XL_DLL | M64F_MFB_TIMES_4 },
426 /* 3D RAGE XL PCI-33/BGA */
427 { 0x4752, 0x4752, 0x00, 0x00, m64n_xl_33, 230, 83, 63, M64F_GT | M64F_INTEGRATED | M64F_RESET_3D | M64F_GTB_DSP | M64F_SDRAM_MAGIC_PLL | M64F_EXTRA_BRIGHT | M64F_XL_DLL | M64F_MFB_TIMES_4 },
430 static void aty_calc_mem_refresh(struct fb_info_aty *info,
436 const int ragepro_tbl[] = {
437 44, 50, 55, 66, 75, 80, 100
440 const int ragexl_tbl[] = {
441 50, 66, 75, 83, 90, 95, 100, 105,
442 110, 115, 120, 125, 133, 143, 166
444 const int *refresh_tbl;
448 refresh_tbl = ragexl_tbl;
449 size = sizeof(ragexl_tbl)/sizeof(int);
452 refresh_tbl = ragepro_tbl;
453 size = sizeof(ragepro_tbl)/sizeof(int);
457 for (i=0; i < size; i++) {
458 if (xclk < refresh_tbl[i])
462 info->mem_refresh_rate = i;
465 static void ati_ragexl_init(device_t dev) {
471 const char *chipname = NULL, *xtal;
477 struct fb_info_aty *info;
478 struct fb_info_aty info_t;
479 struct resource *res;
482 struct fb_var_screeninfo var;
484 struct display *disp;
491 #define USE_AUX_REG 1
493 res = &dev->resource[0];
494 if(res->flags & IORESOURCE_IO) {
495 res = &dev->resource[1];
497 info->frame_buffer = res->base;
499 info->ati_regbase = res->base+0x7ff000+0xc00;
501 res = &dev->resource[2];
502 if(res->flags & IORESOURCE_MEM) {
503 info->ati_regbase = res->base+0x400; //using auxiliary register
507 printk_info("ati_regbase = 0x%08x, frame_buffer = 0x%08x\r\n", info->ati_regbase, info->frame_buffer);
509 info->aty_cmap_regs = (struct aty_cmap_regs *)(info->ati_regbase+0xc0);
511 chip_id = aty_ld_le32(CONFIG_CHIP_ID, info);
512 type = chip_id & CFG_CHIP_TYPE;
513 rev = (chip_id & CFG_CHIP_REV)>>24;
514 for (j = 0; j < (sizeof(aty_chips)/sizeof(*aty_chips)); j++)
515 if (type == aty_chips[j].chip_type &&
516 (rev & aty_chips[j].rev_mask) == aty_chips[j].rev_val) {
517 chipname = aty_chips[j].name;
518 pll = aty_chips[j].pll;
519 mclk = aty_chips[j].mclk;
520 xclk = aty_chips[j].xclk;
521 info->features = aty_chips[j].features;
524 printk_debug("ati_ragexl_init: Unknown mach64 0x%04x rev 0x%04x\n", type, rev);
528 printk_info("ati_ragexl_init: %s [0x%04x rev 0x%02x]\r\n", chipname, type, rev);
530 if (M64_HAS(INTEGRATED)) {
531 /* for many chips, the mclk is 67 MHz for SDRAM, 63 MHz otherwise */
532 if (mclk == 67 && info->ram_type < SDRAM)
536 aty_calc_mem_refresh(info, type, xclk);
537 info->pll_per = 1000000/pll;
538 info->mclk_per = 1000000/mclk;
539 info->xclk_per = 1000000/xclk;
541 // info->dac_ops = &aty_dac_ct;
542 // info->pll_ops = &aty_pll_ct;
543 info->bus_type = PCI;
548 info->ram_type = (aty_ld_le32(CONFIG_STAT0, info) & 0x07);
550 info->ref_clk_per = 1000000000000ULL/14318180;
553 if (M64_HAS(GTB_DSP) && (pll_ref_div = aty_ld_pll(PLL_REF_DIV, info))) {
555 diff1 = 510*14/pll_ref_div-pll;
556 diff2 = 510*29/pll_ref_div-pll;
562 info->ref_clk_per = 1000000000000ULL/29498928;
568 i = aty_ld_le32(MEM_CNTL, info);
570 gtb_memsize = M64_HAS(GTB_DSP);
571 if (gtb_memsize) // We have
573 switch (i & 0xF) { /* 0xF used instead of MEM_SIZE_ALIAS */
575 info->total_vram = 0x80000;
578 info->total_vram = 0x100000;
580 case MEM_SIZE_2M_GTB:
581 info->total_vram = 0x200000;
583 case MEM_SIZE_4M_GTB:
584 info->total_vram = 0x400000;
586 case MEM_SIZE_6M_GTB:
587 info->total_vram = 0x600000;
589 case MEM_SIZE_8M_GTB:
590 info->total_vram = 0x800000;
593 info->total_vram = 0x80000;
597 switch (i & MEM_SIZE_ALIAS) {
599 info->total_vram = 0x80000;
602 info->total_vram = 0x100000;
605 info->total_vram = 0x200000;
608 info->total_vram = 0x400000;
611 info->total_vram = 0x600000;
614 info->total_vram = 0x800000;
617 info->total_vram = 0x80000;
621 if (M64_HAS(MAGIC_VRAM_SIZE)) {
622 if (aty_ld_le32(CONFIG_STAT1, info) & 0x40000000)
623 info->total_vram += 0x400000;
627 info->total_vram = default_vram*1024;
628 i = i & ~(gtb_memsize ? 0xF : MEM_SIZE_ALIAS);
629 if (info->total_vram <= 0x80000)
631 else if (info->total_vram <= 0x100000)
633 else if (info->total_vram <= 0x200000)
634 i |= gtb_memsize ? MEM_SIZE_2M_GTB : MEM_SIZE_2M;
635 else if (info->total_vram <= 0x400000)
636 i |= gtb_memsize ? MEM_SIZE_4M_GTB : MEM_SIZE_4M;
637 else if (info->total_vram <= 0x600000)
638 i |= gtb_memsize ? MEM_SIZE_6M_GTB : MEM_SIZE_6M;
640 i |= gtb_memsize ? MEM_SIZE_8M_GTB : MEM_SIZE_8M;
641 aty_st_le32(MEM_CNTL, i, info);
645 /* Clear the video memory */
646 // fb_memset((void *)info->frame_buffer, 0, info->total_vram);
650 // strcpy(info->fb_info.modename, atyfb_name);
651 info->fb_info.node = -1;
652 // info->fb_info.fbops = &atyfb_ops;
653 info->fb_info.disp = disp;
654 // strcpy(info->fb_info.fontname, fontname);
655 info->fb_info.changevar = NULL;
656 // info->fb_info.switch_con = &atyfbcon_switch;
657 // info->fb_info.updatevar = &atyfbcon_updatevar;
658 // info->fb_info.blank = &atyfbcon_blank;
659 info->fb_info.flags = FBINFO_FLAG_DEFAULT;
664 if (noaccel) // We has noaccel in default
665 var.accel_flags &= ~FB_ACCELF_TEXT;
667 var.accel_flags |= FB_ACCELF_TEXT;
670 if (var.yres == var.yres_virtual) {
671 u32 vram = info->total_vram ;
672 var.yres_virtual = ((vram * 8) / var.bits_per_pixel) / var.xres_virtual;
673 if (var.yres_virtual < var.yres)
674 var.yres_virtual = var.yres;
677 if (atyfb_decode_var(&var, &info->default_par, info)) {
678 printk_debug("atyfb: can't set default video mode\n");
682 for (j = 0; j < 16; j++) {
684 info->palette[j].red = default_red[k];
685 info->palette[j].green = default_grn[k];
686 info->palette[j].blue = default_blu[k];
691 if (curblink && M64_HAS(INTEGRATED)) {
692 info->cursor = aty_init_cursor(info);
694 info->dispsw.cursor = atyfb_cursor;
695 info->dispsw.set_font = atyfb_set_font;
701 atyfb_set_var(&var, -1, &info->fb_info);
703 atyfb_set_par(&info->default_par, info);
704 do_install_cmap(-1, &info->fb_info);
709 printk_info("framebuffer=0x%08x, width=%d, height=%d, bpp=%d, pitch=%d\n",info->frame_buffer,
710 (((info->current_par.crtc.h_tot_disp>>16) & 0xff)+1)*8,
711 ((info->current_par.crtc.v_tot_disp>>16) & 0x7ff)+1,
712 info->current_par.crtc.bpp,
713 info->current_par.crtc.vxres*info->default_par.crtc.bpp/8
716 (((info->current_par.crtc.h_tot_disp>>16) & 0xff)+1)*8,
717 ((info->current_par.crtc.v_tot_disp>>16) & 0x7ff)+1,
718 info->current_par.crtc.bpp,
719 info->current_par.crtc.vxres*info->current_par.crtc.bpp/8,info->frame_buffer);
721 printk_debug("framebuffer=0x%08x, width=%d, height=%d, bpp=%d, pitch=%d\n",info->frame_buffer,
722 (((info->default_par.crtc.h_tot_disp>>16) & 0xff)+1)*8,
723 ((info->default_par.crtc.v_tot_disp>>16) & 0x7ff)+1,
724 info->default_par.crtc.bpp,
725 info->default_par.crtc.vxres*info->default_par.crtc.bpp/8
728 (((info->default_par.crtc.h_tot_disp>>16) & 0xff)+1)*8,
729 ((info->default_par.crtc.v_tot_disp>>16) & 0x7ff)+1,
730 info->default_par.crtc.bpp,
731 info->default_par.crtc.vxres*info->default_par.crtc.bpp/8,info->frame_buffer);
739 btext_drawstring("1\n");
740 btext_drawstring("2\n");
741 btext_drawstring("3\n");
742 btext_drawstring("4\n");
743 btext_drawstring("test framebuffer 5\n");
744 btext_drawstring("test framebuffer 6\n");
745 btext_drawstring("test framebuffer 7\n");
746 btext_drawstring("test framebuffer 8\n");
747 btext_drawstring("test framebuffer 9\n");
748 btext_drawstring("test framebuffer 10\n");
749 btext_drawstring("test framebuffer 11\n");
750 btext_drawstring("test framebuffer 12\n");
751 btext_drawstring("test framebuffer 13\n");
752 btext_drawstring("test framebuffer 14\n");
753 btext_drawstring("test framebuffer 15\n");
754 btext_drawstring("test framebuffer 16\n");
755 btext_drawstring("test framebuffer 17\n");
756 btext_drawstring("test framebuffer 18\n");
757 btext_drawstring("test framebuffer 19\n");
758 btext_drawstring("test framebuffer 20\n");
759 btext_drawstring("test framebuffer 21\n");
760 btext_drawstring("test framebuffer 22\n");
761 btext_drawstring("test framebuffer 23\n");
762 btext_drawstring("test framebuffer 24\n");
770 static int atyfb_decode_var(const struct fb_var_screeninfo *var,
771 struct atyfb_par *par,
772 const struct fb_info_aty *info)
776 if ((err = aty_var_to_crtc(info, var, &par->crtc)) ||
777 (err = aty_var_to_pll_ct(info, var->pixclock, par->crtc.bpp,
782 if (var->accel_flags & FB_ACCELF_TEXT)
783 par->accel_flags = FB_ACCELF_TEXT;
786 par->accel_flags = 0;
788 #if 0 /* fbmon is not done. uncomment for 2.5.x -brad */
789 if (!fbmon_valid_timings(var->pixclock, htotal, vtotal, info))
796 static int atyfb_encode_var(struct fb_var_screeninfo *var,
797 const struct atyfb_par *par,
798 const struct fb_info_aty *info)
802 memset(var, 0, sizeof(struct fb_var_screeninfo));
804 if ((err = aty_crtc_to_var(&par->crtc, var)))
806 var->pixclock = aty_pll_ct_to_var(info, &par->pll);
810 var->accel_flags = par->accel_flags;
815 static void aty_set_crtc(const struct fb_info_aty *info,
816 const struct crtc *crtc)
818 aty_st_le32(CRTC_H_TOTAL_DISP, crtc->h_tot_disp, info);
819 aty_st_le32(CRTC_H_SYNC_STRT_WID, crtc->h_sync_strt_wid, info);
820 aty_st_le32(CRTC_V_TOTAL_DISP, crtc->v_tot_disp, info);
821 aty_st_le32(CRTC_V_SYNC_STRT_WID, crtc->v_sync_strt_wid, info);
822 aty_st_le32(CRTC_VLINE_CRNT_VLINE, 0, info);
823 aty_st_le32(CRTC_OFF_PITCH, crtc->off_pitch, info);
824 aty_st_le32(CRTC_GEN_CNTL, crtc->gen_cntl, info);
827 static int aty_var_to_crtc(const struct fb_info_aty *info,
828 const struct fb_var_screeninfo *var,
831 u32 xres, yres, vxres, vyres, xoffset, yoffset, bpp;
832 u32 left, right, upper, lower, hslen, vslen, sync, vmode;
833 u32 h_total, h_disp, h_sync_strt, h_sync_dly, h_sync_wid, h_sync_pol;
834 u32 v_total, v_disp, v_sync_strt, v_sync_wid, v_sync_pol, c_sync;
835 u32 pix_width, dp_pix_width, dp_chain_mask;
840 vxres = var->xres_virtual;
841 vyres = var->yres_virtual;
842 xoffset = var->xoffset;
843 yoffset = var->yoffset;
844 bpp = var->bits_per_pixel;
845 left = var->left_margin;
846 right = var->right_margin;
847 upper = var->upper_margin;
848 lower = var->lower_margin;
849 hslen = var->hsync_len;
850 vslen = var->vsync_len;
854 /* convert (and round up) and validate */
855 xres = (xres+7) & ~7;
856 xoffset = (xoffset+7) & ~7;
857 vxres = (vxres+7) & ~7;
858 if (vxres < xres+xoffset)
859 vxres = xres+xoffset;
862 FAIL("h_disp too large");
863 h_sync_strt = h_disp+(right/8);
864 if (h_sync_strt > 0x1ff)
865 FAIL("h_sync_start too large");
866 h_sync_dly = right & 7;
867 h_sync_wid = (hslen+7)/8;
868 if (h_sync_wid > 0x1f)
869 FAIL("h_sync_wid too large");
870 h_total = h_sync_strt+h_sync_wid+(h_sync_dly+left+7)/8;
872 FAIL("h_total too large");
873 h_sync_pol = sync & FB_SYNC_HOR_HIGH_ACT ? 0 : 1;
875 if (vyres < yres+yoffset)
876 vyres = yres+yoffset;
879 FAIL("v_disp too large");
880 v_sync_strt = v_disp+lower;
881 if (v_sync_strt > 0x7ff)
882 FAIL("v_sync_strt too large");
884 if (v_sync_wid > 0x1f)
885 FAIL("v_sync_wid too large");
886 v_total = v_sync_strt+v_sync_wid+upper;
888 FAIL("v_total too large");
889 v_sync_pol = sync & FB_SYNC_VERT_HIGH_ACT ? 0 : 1;
891 c_sync = sync & FB_SYNC_COMP_HIGH_ACT ? CRTC_CSYNC_EN : 0;
895 pix_width = CRTC_PIX_WIDTH_8BPP;
896 dp_pix_width = HOST_8BPP | SRC_8BPP | DST_8BPP | BYTE_ORDER_LSB_TO_MSB;
897 dp_chain_mask = 0x8080;
900 else if (bpp <= 16) {
902 pix_width = CRTC_PIX_WIDTH_15BPP;
903 dp_pix_width = HOST_15BPP | SRC_15BPP | DST_15BPP |
904 BYTE_ORDER_LSB_TO_MSB;
905 dp_chain_mask = 0x4210;
906 } else if (bpp <= 24 && M64_HAS(INTEGRATED)) {
908 pix_width = CRTC_PIX_WIDTH_24BPP;
909 dp_pix_width = HOST_8BPP | SRC_8BPP | DST_8BPP | BYTE_ORDER_LSB_TO_MSB;
910 dp_chain_mask = 0x8080;
911 } else if (bpp <= 32) {
913 pix_width = CRTC_PIX_WIDTH_32BPP;
914 dp_pix_width = HOST_32BPP | SRC_32BPP | DST_32BPP |
915 BYTE_ORDER_LSB_TO_MSB;
916 dp_chain_mask = 0x8080;
922 if (vxres*vyres*bpp/8 > info->total_vram)
923 FAIL("not enough video RAM");
924 if ((vmode & FB_VMODE_MASK) != FB_VMODE_NONINTERLACED)
925 FAIL("invalid vmode");
930 crtc->xoffset = xoffset;
931 crtc->yoffset = yoffset;
933 crtc->h_tot_disp = h_total | (h_disp<<16);
934 crtc->h_sync_strt_wid = (h_sync_strt & 0xff) | (h_sync_dly<<8) |
935 ((h_sync_strt & 0x100)<<4) | (h_sync_wid<<16) |
937 crtc->v_tot_disp = v_total | (v_disp<<16);
938 crtc->v_sync_strt_wid = v_sync_strt | (v_sync_wid<<16) | (v_sync_pol<<21);
939 crtc->off_pitch = ((yoffset*vxres+xoffset)*bpp/64) | (vxres<<19);
940 crtc->gen_cntl = pix_width | c_sync | CRTC_EXT_DISP_EN | CRTC_ENABLE;
941 if (M64_HAS(MAGIC_FIFO)) {
943 /* FIXME: magic FIFO values */
944 crtc->gen_cntl |= aty_ld_le32(CRTC_GEN_CNTL, info) & 0x000e0000;
946 crtc->dp_pix_width = dp_pix_width;
947 crtc->dp_chain_mask = dp_chain_mask;
952 static int aty_crtc_to_var(const struct crtc *crtc,
953 struct fb_var_screeninfo *var)
955 u32 xres, yres, bpp, left, right, upper, lower, hslen, vslen, sync;
956 u32 h_total, h_disp, h_sync_strt, h_sync_dly, h_sync_wid, h_sync_pol;
957 u32 v_total, v_disp, v_sync_strt, v_sync_wid, v_sync_pol, c_sync;
961 h_total = crtc->h_tot_disp & 0x1ff;
962 h_disp = (crtc->h_tot_disp>>16) & 0xff;
963 h_sync_strt = (crtc->h_sync_strt_wid & 0xff) |
964 ((crtc->h_sync_strt_wid>>4) & 0x100);
965 h_sync_dly = (crtc->h_sync_strt_wid>>8) & 0x7;
966 h_sync_wid = (crtc->h_sync_strt_wid>>16) & 0x1f;
967 h_sync_pol = (crtc->h_sync_strt_wid>>21) & 0x1;
968 v_total = crtc->v_tot_disp & 0x7ff;
969 v_disp = (crtc->v_tot_disp>>16) & 0x7ff;
970 v_sync_strt = crtc->v_sync_strt_wid & 0x7ff;
971 v_sync_wid = (crtc->v_sync_strt_wid>>16) & 0x1f;
972 v_sync_pol = (crtc->v_sync_strt_wid>>21) & 0x1;
973 c_sync = crtc->gen_cntl & CRTC_CSYNC_EN ? 1 : 0;
974 pix_width = crtc->gen_cntl & CRTC_PIX_WIDTH_MASK;
979 left = (h_total-h_sync_strt-h_sync_wid)*8-h_sync_dly;
980 right = (h_sync_strt-h_disp)*8+h_sync_dly;
981 hslen = h_sync_wid*8;
982 upper = v_total-v_sync_strt-v_sync_wid;
983 lower = v_sync_strt-v_disp;
985 sync = (h_sync_pol ? 0 : FB_SYNC_HOR_HIGH_ACT) |
986 (v_sync_pol ? 0 : FB_SYNC_VERT_HIGH_ACT) |
987 (c_sync ? FB_SYNC_COMP_HIGH_ACT : 0);
991 case CRTC_PIX_WIDTH_4BPP:
995 var->green.offset = 0;
996 var->green.length = 8;
997 var->blue.offset = 0;
998 var->blue.length = 8;
999 var->transp.offset = 0;
1000 var->transp.length = 0;
1003 case CRTC_PIX_WIDTH_8BPP:
1005 var->red.offset = 0;
1006 var->red.length = 8;
1007 var->green.offset = 0;
1008 var->green.length = 8;
1009 var->blue.offset = 0;
1010 var->blue.length = 8;
1011 var->transp.offset = 0;
1012 var->transp.length = 0;
1015 case CRTC_PIX_WIDTH_15BPP: /* RGB 555 */
1017 var->red.offset = 10;
1018 var->red.length = 5;
1019 var->green.offset = 5;
1020 var->green.length = 5;
1021 var->blue.offset = 0;
1022 var->blue.length = 5;
1023 var->transp.offset = 0;
1024 var->transp.length = 0;
1028 case CRTC_PIX_WIDTH_16BPP: /* RGB 565 */
1030 var->red.offset = 11;
1031 var->red.length = 5;
1032 var->green.offset = 5;
1033 var->green.length = 6;
1034 var->blue.offset = 0;
1035 var->blue.length = 5;
1036 var->transp.offset = 0;
1037 var->transp.length = 0;
1041 case CRTC_PIX_WIDTH_24BPP: /* RGB 888 */
1043 var->red.offset = 16;
1044 var->red.length = 8;
1045 var->green.offset = 8;
1046 var->green.length = 8;
1047 var->blue.offset = 0;
1048 var->blue.length = 8;
1049 var->transp.offset = 0;
1050 var->transp.length = 0;
1052 case CRTC_PIX_WIDTH_32BPP: /* ARGB 8888 */
1054 var->red.offset = 16;
1055 var->red.length = 8;
1056 var->green.offset = 8;
1057 var->green.length = 8;
1058 var->blue.offset = 0;
1059 var->blue.length = 8;
1060 var->transp.offset = 24;
1061 var->transp.length = 8;
1065 FAIL("Invalid pixel width");
1071 var->xres_virtual = crtc->vxres;
1072 var->yres_virtual = crtc->vyres;
1073 var->bits_per_pixel = bpp;
1074 var->xoffset = crtc->xoffset;
1075 var->yoffset = crtc->yoffset;
1076 var->left_margin = left;
1077 var->right_margin = right;
1078 var->upper_margin = upper;
1079 var->lower_margin = lower;
1080 var->hsync_len = hslen;
1081 var->vsync_len = vslen;
1083 var->vmode = FB_VMODE_NONINTERLACED;
1090 static int encode_fix(struct fb_fix_screeninfo *fix,
1091 const struct atyfb_par *par,
1092 const struct fb_info_aty *info)
1094 memset(fix, 0, sizeof(struct fb_fix_screeninfo));
1096 // strcpy(fix->id, atyfb_name);
1097 memcpy(fix->id, "atyfb", 5);
1098 fix->smem_start = info->frame_buffer;
1099 fix->smem_len = (u32)info->total_vram;
1102 * Reg Block 0 (CT-compatible block) is at ati_regbase_phys
1103 * Reg Block 1 (multimedia extensions) is at ati_regbase_phys-0x400
1106 fix->mmio_start = info->ati_regbase;
1107 fix->mmio_len = 0x400;
1108 fix->accel = FB_ACCEL_ATI_MACH64GX;
1109 } else if (M64_HAS(CT)) {
1110 fix->mmio_start = info->ati_regbase;
1111 fix->mmio_len = 0x400;
1112 fix->accel = FB_ACCEL_ATI_MACH64CT;
1113 } else if (M64_HAS(VT)) {
1114 fix->mmio_start = info->ati_regbase-0x400;
1115 fix->mmio_len = 0x800;
1116 fix->accel = FB_ACCEL_ATI_MACH64VT;
1117 } else /* if (M64_HAS(GT)) */ {
1118 fix->mmio_start = info->ati_regbase-0x400;
1119 fix->mmio_len = 0x800;
1120 fix->accel = FB_ACCEL_ATI_MACH64GT;
1122 fix->type = FB_TYPE_PACKED_PIXELS;
1124 fix->line_length = par->crtc.vxres*par->crtc.bpp/8;
1125 fix->visual = par->crtc.bpp <= 8 ? FB_VISUAL_PSEUDOCOLOR
1126 : FB_VISUAL_DIRECTCOLOR;
1135 * Set the User Defined Part of the Display
1138 static int atyfb_set_var(struct fb_var_screeninfo *var, int con,
1141 struct fb_info_aty *info = (struct fb_info_aty *)fb;
1142 struct atyfb_par par;
1144 struct display *display;
1145 int oldxres, oldyres, oldvxres, oldvyres, oldbpp, oldaccel, accel;
1148 int activate = var->activate;
1152 display = &fb_display[con];
1156 display = fb->disp; /* used during initialization */
1159 if ((err = atyfb_decode_var(var, &par, info)))
1162 atyfb_encode_var(var, &par, (struct fb_info_aty *)info);
1165 printk_info("atyfb_set_var: activate=%d\n", activate & FB_ACTIVATE_MASK);
1168 if ((activate & FB_ACTIVATE_MASK) == FB_ACTIVATE_NOW) {
1170 oldxres = display->var.xres;
1171 oldyres = display->var.yres;
1172 oldvxres = display->var.xres_virtual;
1173 oldvyres = display->var.yres_virtual;
1174 oldbpp = display->var.bits_per_pixel;
1175 oldaccel = display->var.accel_flags;
1176 display->var = *var;
1177 accel = var->accel_flags & FB_ACCELF_TEXT;
1178 if (oldxres != var->xres || oldyres != var->yres ||
1179 oldvxres != var->xres_virtual || oldvyres != var->yres_virtual ||
1180 oldbpp != var->bits_per_pixel || oldaccel != var->accel_flags) {
1181 struct fb_fix_screeninfo fix;
1183 encode_fix(&fix, &par, info);
1184 display->screen_base = (char *)info->frame_buffer;
1185 display->visual = fix.visual;
1186 display->type = fix.type;
1187 display->type_aux = fix.type_aux;
1188 display->ypanstep = fix.ypanstep;
1189 display->ywrapstep = fix.ywrapstep;
1190 display->line_length = fix.line_length;
1191 display->can_soft_blank = 1;
1192 display->inverse = 0;
1195 display->scrollmode = (info->bus_type == PCI) ? SCROLL_YNOMOVE : 0;
1198 display->scrollmode = SCROLL_YREDRAW;
1200 if (info->fb_info.changevar)
1201 (*info->fb_info.changevar)(con);
1205 // if (!info->fb_info.display_fg ||
1206 // info->fb_info.display_fg->vc_num == con) {
1207 atyfb_set_par(&par, info);
1209 atyfb_set_dispsw(display, info, par.crtc.bpp, accel);
1213 if (oldbpp != var->bits_per_pixel) {
1214 if ((err = fb_alloc_cmap(&display->cmap, 0, 0)))
1217 do_install_cmap(con, &info->fb_info);
1227 /* ------------------------------------------------------------------------- */
1229 static void atyfb_set_par(const struct atyfb_par *par,
1230 struct fb_info_aty *info)
1236 accelmode = par->accel_flags; /* hack */
1239 // We only use default_par
1240 info->current_par = *par;
1243 if (info->blitter_may_be_busy)
1244 wait_for_idle(info);
1245 tmp = aty_ld_8(CRTC_GEN_CNTL + 3, info);
1246 aty_set_crtc(info, &par->crtc);
1247 aty_st_8(CLOCK_CNTL + info->clk_wr_offset, 0, info);
1248 /* better call aty_StrobeClock ?? */
1249 aty_st_8(CLOCK_CNTL + info->clk_wr_offset, CLOCK_STROBE, info);
1251 //info->dac_ops->set_dac(info, &par->pll, par->crtc.bpp, accelmode);
1252 //info->pll_ops->set_pll(info, &par->pll);
1253 aty_set_pll_ct(info, &par->pll);
1256 if (!M64_HAS(INTEGRATED)) {
1257 /* Don't forget MEM_CNTL */
1258 i = aty_ld_le32(MEM_CNTL, info) & 0xf0ffffff;
1259 switch (par->crtc.bpp) {
1272 aty_st_le32(MEM_CNTL, i, info);
1274 i = aty_ld_le32(MEM_CNTL, info) & 0xf00fffff;
1275 if (!M64_HAS(MAGIC_POSTDIV))
1276 i |= info->mem_refresh_rate << 20;
1277 switch (par->crtc.bpp) {
1291 if (M64_HAS(CT_BUS)) {
1292 aty_st_le32(DAC_CNTL, 0x87010184, info);
1293 aty_st_le32(BUS_CNTL, 0x680000f9, info);
1294 } else if (M64_HAS(VT_BUS)) {
1295 aty_st_le32(DAC_CNTL, 0x87010184, info);
1296 aty_st_le32(BUS_CNTL, 0x680000f9, info);
1297 } else if (M64_HAS(MOBIL_BUS)) {
1298 aty_st_le32(DAC_CNTL, 0x80010102, info);
1299 aty_st_le32(BUS_CNTL, 0x7b33a040, info);
1302 aty_st_le32(DAC_CNTL, 0x86010102, info);
1303 aty_st_le32(BUS_CNTL, 0x7b23a040, info);
1304 aty_st_le32(EXT_MEM_CNTL,
1305 aty_ld_le32(EXT_MEM_CNTL, info) | 0x5000001, info);
1308 aty_st_le32(MEM_CNTL, i, info);
1310 aty_st_8(DAC_MASK, 0xff, info);
1312 /* Initialize the graphics engine */
1314 if (par->accel_flags & FB_ACCELF_TEXT)
1315 aty_init_engine(par, info);
1320 btext_update_display(info->frame_buffer_phys,
1321 (((par->crtc.h_tot_disp>>16) & 0xff)+1)*8,
1322 ((par->crtc.v_tot_disp>>16) & 0x7ff)+1,
1324 par->crtc.vxres*par->crtc.bpp/8);
1328 static u16 red2[] = {
1331 static u16 green2[] = {
1334 static u16 blue2[] = {
1338 static u16 red4[] = {
1339 0x0000, 0xaaaa, 0x5555, 0xffff
1341 static u16 green4[] = {
1342 0x0000, 0xaaaa, 0x5555, 0xffff
1344 static u16 blue4[] = {
1345 0x0000, 0xaaaa, 0x5555, 0xffff
1348 static u16 red8[] = {
1349 0x0000, 0x0000, 0x0000, 0x0000, 0xaaaa, 0xaaaa, 0xaaaa, 0xaaaa
1351 static u16 green8[] = {
1352 0x0000, 0x0000, 0xaaaa, 0xaaaa, 0x0000, 0x0000, 0x5555, 0xaaaa
1354 static u16 blue8[] = {
1355 0x0000, 0xaaaa, 0x0000, 0xaaaa, 0x0000, 0xaaaa, 0x0000, 0xaaaa
1358 static u16 red16[] = {
1359 0x0000, 0x0000, 0x0000, 0x0000, 0xaaaa, 0xaaaa, 0xaaaa, 0xaaaa,
1360 0x5555, 0x5555, 0x5555, 0x5555, 0xffff, 0xffff, 0xffff, 0xffff
1362 static u16 green16[] = {
1363 0x0000, 0x0000, 0xaaaa, 0xaaaa, 0x0000, 0x0000, 0x5555, 0xaaaa,
1364 0x5555, 0x5555, 0xffff, 0xffff, 0x5555, 0x5555, 0xffff, 0xffff
1366 static u16 blue16[] = {
1367 0x0000, 0xaaaa, 0x0000, 0xaaaa, 0x0000, 0xaaaa, 0x0000, 0xaaaa,
1368 0x5555, 0xffff, 0x5555, 0xffff, 0x5555, 0xffff, 0x5555, 0xffff
1371 static struct fb_cmap default_2_colors = {
1372 0, 2, red2, green2, blue2, NULL
1374 static struct fb_cmap default_8_colors = {
1375 0, 8, red8, green8, blue8, NULL
1377 static struct fb_cmap default_4_colors = {
1378 0, 4, red4, green4, blue4, NULL
1381 static struct fb_cmap default_16_colors = {
1382 0, 16, red16, green16, blue16, NULL
1387 static int atyfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
1388 u_int transp, struct fb_info *fb)
1390 struct fb_info_aty *info = (struct fb_info_aty *)fb;
1399 //We don't need to store it
1400 info->palette[regno].red = red;
1401 info->palette[regno].green = green;
1402 info->palette[regno].blue = blue;
1404 i = aty_ld_8(DAC_CNTL, info) & 0xfc;
1405 if (M64_HAS(EXTRA_BRIGHT))
1406 i |= 0x2; /*DAC_CNTL|0x2 turns off the extra brightness for gt*/
1407 aty_st_8(DAC_CNTL, i, info);
1408 aty_st_8(DAC_MASK, 0xff, info);
1410 scale = (M64_HAS(INTEGRATED) && info->current_par.crtc.bpp == 16) ? 3 : 0;
1412 scale = (M64_HAS(INTEGRATED) && info->default_par.crtc.bpp == 16) ? 3 : 0;
1414 writeb(regno << scale, &info->aty_cmap_regs->windex);
1415 writeb(red, &info->aty_cmap_regs->lut);
1416 writeb(green, &info->aty_cmap_regs->lut);
1417 writeb(blue, &info->aty_cmap_regs->lut);
1421 int fb_set_cmap(struct fb_cmap *cmap, int kspc,
1422 int (*setcolreg)(u_int, u_int, u_int, u_int, u_int,
1427 u16 *red, *green, *blue, *transp;
1428 u_int hred, hgreen, hblue, htransp;
1431 green = cmap->green;
1433 transp = cmap->transp;
1434 start = cmap->start;
1438 for (i = 0; i < cmap->len; i++) {
1442 htransp = transp ? *transp : 0;
1448 if (setcolreg(start++, hred, hgreen, hblue, htransp, fb))
1454 struct fb_cmap *fb_default_cmap(int len)
1458 return &default_2_colors;
1460 return &default_4_colors;
1462 return &default_8_colors;
1464 return &default_16_colors;
1467 static void do_install_cmap(int con, struct fb_info *fb)
1470 struct fb_info_aty *info = (struct fb_info_aty *)fb;
1471 int size = info->current_par.crtc.bpp == 16 ? 32 : 256;
1475 fb_set_cmap(fb_default_cmap(size), 1, atyfb_setcolreg, fb);
1479 static struct device_operations ati_ragexl_graph_ops = {
1480 .read_resources = pci_dev_read_resources,
1481 .set_resources = pci_dev_set_resources,
1482 .enable_resources = pci_dev_enable_resources,
1483 .init = ati_ragexl_init,
1487 static struct pci_driver ati_ragexl_graph_driver __pci_driver = {
1488 .ops = &ati_ragexl_graph_ops,
1489 .vendor = PCI_VENDOR_ID_ATI,
1490 .device = PCI_DEVICE_ID_ATI_215XL,