* Rage128/Radeon framebuffer updates
@ 2003-08-16 1:24 Jon Smirl
2003-08-16 10:04 ` Benjamin Herrenschmidt
0 siblings, 1 reply; 4+ messages in thread
From: Jon Smirl @ 2003-08-16 1:24 UTC (permalink / raw)
To: fb-devel, dri-devel
[-- Attachment #1: Type: text/plain, Size: 538 bytes --]
linux/pci_ids.h just had a check-in which caused a big
merge conflict with my patch. I have tried to sort it
out.
Please check Radeon PCI IDs and chip families in
radeonfb driver. It is important that the PCI IDs of
secondary devices be marked as such.
This patch merges Rage128 and Radeon changes into a
single patch. It is against current 2.5 bk r1.1188.
=====
Jon Smirl
jonsmirl@yahoo.com
__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com
[-- Attachment #2: ati.patch --]
[-- Type: application/octet-stream, Size: 50476 bytes --]
diff -Nru a/drivers/ide/pci/alim15x3.c b/drivers/ide/pci/alim15x3.c
--- a/drivers/ide/pci/alim15x3.c Fri Aug 15 21:19:02 2003
+++ b/drivers/ide/pci/alim15x3.c Fri Aug 15 21:19:02 2003
@@ -860,7 +860,7 @@
{
ide_pci_device_t *d = &ali15x3_chipsets[id->driver_data];
- if(pci_find_device(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_IGP, NULL))
+ if(pci_find_device(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RS100, NULL))
printk(KERN_ERR "Warning: ATI Radeon IGP Northbridge is not yet fully tested.\n");
#if defined(CONFIG_SPARC64)
diff -Nru a/drivers/video/aty/aty128fb.c b/drivers/video/aty/aty128fb.c
--- a/drivers/video/aty/aty128fb.c Fri Aug 15 21:19:02 2003
+++ b/drivers/video/aty/aty128fb.c Fri Aug 15 21:19:02 2003
@@ -24,6 +24,10 @@
* Paul Mundt
* - PCI hotplug
*
+ * Jon Smirl <jonsmirl@yahoo.com>
+ * - PCI ID update
+ * - replace ROM BIOS search
+ *
* Based off of Geert's atyfb.c and vfb.c.
*
* TODO:
@@ -43,6 +47,7 @@
#include <linux/config.h>
#include <linux/module.h>
+#include <linux/moduleparam.h>
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/string.h>
@@ -136,8 +141,25 @@
/* Chip generations */
enum {
rage_128,
+ rage_128_pci,
rage_128_pro,
- rage_M3
+ rage_128_pro_pci,
+ rage_M3,
+ rage_M3_pci,
+ rage_M4,
+ rage_128_ultra,
+};
+
+/* Must match above enum */
+static const char *r128_family[] __devinitdata = {
+ "AGP",
+ "PCI",
+ "PRO AGP",
+ "PRO PCI",
+ "M3 AGP",
+ "M3 PCI",
+ "M4 AGP",
+ "Ultra AGP",
};
/*
@@ -149,32 +171,100 @@
/* supported Rage128 chipsets */
static struct pci_device_id aty128_pci_tbl[] = {
- { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_RE,
- PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128 },
- { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_RF,
- PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128 },
- { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_RI,
- PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128 },
- { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_RK,
- PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128 },
- { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_RL,
- PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128 },
- { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_Rage128_PD,
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_LE,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_M3_pci },
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_LF,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_M3 },
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_MF,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_M4 },
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_ML,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_M4 },
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_PA,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128_pro },
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_PB,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128_pro },
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_PC,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128_pro },
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_PD,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128_pro_pci },
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_PE,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128_pro },
{ PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_PF,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128_pro },
- { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_PR,
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_PG,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128_pro },
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_PH,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128_pro },
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_PI,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128_pro },
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_PJ,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128_pro },
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_PK,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128_pro },
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_PL,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128_pro },
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_PM,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128_pro },
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_PN,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128_pro },
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_PO,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128_pro },
{ PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_PP,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128_pro_pci },
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_PQ,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128_pro },
- { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_U3,
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_PR,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128_pro_pci },
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_PS,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128_pro },
- { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_U1,
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_PT,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128_pro },
- { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_LE,
- PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_M3 },
- { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_LF,
- PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_M3 },
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_PU,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128_pro },
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_PV,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128_pro },
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_PW,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128_pro },
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_PX,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128_pro },
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_RE,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128_pci },
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_RF,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128 },
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_RG,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128 },
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_RK,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128_pci },
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_RL,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128 },
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_SE,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128 },
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_SF,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128_pci },
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_SG,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128 },
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_SH,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128 },
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_SK,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128 },
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_SL,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128 },
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_SM,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128 },
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_SN,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128 },
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_TF,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128_ultra },
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_TL,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128_ultra },
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_TR,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128_ultra },
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_TS,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128_ultra },
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_TT,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128_ultra },
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_TU,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0, rage_128_ultra },
{ 0, }
};
@@ -250,14 +340,7 @@
.accel = FB_ACCEL_ATI_RAGE128,
};
-#ifdef MODULE
static char *mode __initdata = NULL;
-#ifdef CONFIG_MTRR
-static int nomtrr __initdata = 0;
-#endif /* CONFIG_MTRR */
-#endif /* MODULE */
-
-static char *mode_option __initdata = NULL;
#ifdef CONFIG_PPC_PMAC
static int default_vmode __initdata = VMODE_1024_768_60;
@@ -374,7 +457,7 @@
#if !defined(CONFIG_PPC) && !defined(__sparc__)
static void __init aty128_get_pllinfo(struct aty128fb_par *par,
void *bios);
-static void __init *aty128_map_ROM(struct pci_dev *pdev);
+static void __init *aty128_map_ROM(struct pci_dev *pdev, const struct aty128fb_par *par);
static void __init aty128_unmap_ROM(struct pci_dev *dev, void * rom);
#endif
static void aty128_timings(struct aty128fb_par *par);
@@ -1410,61 +1493,6 @@
return 0;
}
-int __init
-aty128fb_setup(char *options)
-{
- char *this_opt;
-
- if (!options || !*options)
- return 0;
-
- while ((this_opt = strsep(&options, ",")) != NULL) {
-#ifdef CONFIG_PMAC_PBOOK
- if (!strncmp(this_opt, "lcd:", 4)) {
- default_lcd_on = simple_strtoul(this_opt+4, NULL, 0);
- continue;
- } else if (!strncmp(this_opt, "crt:", 4)) {
- default_crt_on = simple_strtoul(this_opt+4, NULL, 0);
- continue;
- }
-#endif
-#ifdef CONFIG_MTRR
- if(!strncmp(this_opt, "nomtrr", 6)) {
- mtrr = 0;
- continue;
- }
-#endif
-#ifdef CONFIG_PPC_PMAC
- /* vmode and cmode deprecated */
- if (!strncmp(this_opt, "vmode:", 6)) {
- unsigned int vmode = simple_strtoul(this_opt+6, NULL, 0);
- if (vmode > 0 && vmode <= VMODE_MAX)
- default_vmode = vmode;
- continue;
- } else if (!strncmp(this_opt, "cmode:", 6)) {
- unsigned int cmode = simple_strtoul(this_opt+6, NULL, 0);
- switch (cmode) {
- case 0:
- case 8:
- default_cmode = CMODE_8;
- break;
- case 15:
- case 16:
- default_cmode = CMODE_16;
- break;
- case 24:
- case 32:
- default_cmode = CMODE_32;
- break;
- }
- continue;
- }
-#endif /* CONFIG_PPC_PMAC */
- mode_option = this_opt;
- }
- return 0;
-}
-
/*
* Initialisation
@@ -1476,7 +1504,7 @@
struct fb_info *info = pci_get_drvdata(pdev);
struct aty128fb_par *par = info->par;
struct fb_var_screeninfo var;
- char video_card[25];
+ char video_card[DEVICE_NAME_SIZE];
u8 chip_rev;
u32 dac;
@@ -1486,43 +1514,13 @@
/* Get the chip revision */
chip_rev = (aty_ld_le32(CONFIG_CNTL) >> 16) & 0x1F;
- switch (pdev->device) {
- case PCI_DEVICE_ID_ATI_RAGE128_RE:
- strcpy(video_card, "Rage128 RE (PCI)");
- break;
- case PCI_DEVICE_ID_ATI_RAGE128_RF:
- strcpy(video_card, "Rage128 RF (AGP)");
- break;
- case PCI_DEVICE_ID_ATI_RAGE128_RK:
- strcpy(video_card, "Rage128 RK (PCI)");
- break;
- case PCI_DEVICE_ID_ATI_RAGE128_RL:
- strcpy(video_card, "Rage128 RL (AGP)");
- break;
- case PCI_DEVICE_ID_ATI_Rage128_PD:
- strcpy(video_card, "Rage128 Pro PD (PCI)");
- break;
- case PCI_DEVICE_ID_ATI_RAGE128_PF:
- strcpy(video_card, "Rage128 Pro PF (AGP)");
- break;
- case PCI_DEVICE_ID_ATI_RAGE128_PR:
- strcpy(video_card, "Rage128 Pro PR (PCI)");
- break;
- case PCI_DEVICE_ID_ATI_RAGE128_U3:
- strcpy(video_card, "Rage128 Pro TR (AGP)");
- break;
- case PCI_DEVICE_ID_ATI_RAGE128_U1:
- strcpy(video_card, "Rage128 Pro TF (AGP)");
- break;
- case PCI_DEVICE_ID_ATI_RAGE128_LE:
- strcpy(video_card, "Rage Mobility M3 (PCI)");
- break;
- case PCI_DEVICE_ID_ATI_RAGE128_LF:
- strcpy(video_card, "Rage Mobility M3 (AGP)");
- break;
- default:
- return -ENODEV;
- }
+ strcpy(video_card, "Rage128 XX ");
+ video_card[8] = ent->device >> 8;
+ video_card[9] = ent->device & 0xFF;
+
+ /* range check to make sure */
+ if (ent->driver_data < (sizeof(r128_family)/sizeof(char *)))
+ strncat(video_card, r128_family[ent->driver_data], sizeof(video_card));
printk(KERN_INFO "aty128fb: %s [chip rev 0x%x] ", video_card, chip_rev);
@@ -1536,17 +1534,17 @@
/* fill in info */
info->fbops = &aty128fb_ops;
info->flags = FBINFO_FLAG_DEFAULT;
-
+
#ifdef CONFIG_PMAC_PBOOK
par->lcd_on = default_lcd_on;
par->crt_on = default_crt_on;
#endif
-
+
var = default_var;
#ifdef CONFIG_PPC_PMAC
if (_machine == _MACH_Pmac) {
- if (mode_option) {
- if (!mac_find_mode(&var, info, mode_option, 8))
+ if (mode) {
+ if (!mac_find_mode(&var, info, mode, 8))
var = default_var;
} else {
if (default_vmode <= 0 || default_vmode > VMODE_MAX)
@@ -1575,8 +1573,12 @@
if (machine_is_compatible("PowerBook3,2"))
default_vmode = VMODE_1152_768_60;
- if (default_cmode < CMODE_8 || default_cmode > CMODE_32)
- default_cmode = CMODE_8;
+ if (default_cmode > 16)
+ default_cmode = CMODE_32;
+ else if (default_cmode > 8)
+ default_cmode = CMODE_16;
+ else
+ default_cmode = CMODE_8;
if (mac_vmode_to_var(default_vmode, default_cmode, &var))
var = default_var;
@@ -1584,9 +1586,10 @@
} else
#endif /* CONFIG_PPC_PMAC */
{
- if (fb_find_mode(&var, info, mode_option, NULL, 0,
- &defaultmode, 8) == 0)
- var = default_var;
+ if (mode)
+ if (fb_find_mode(&var, info, mode, NULL,
+ 0, &defaultmode, 8) == 0)
+ var = default_var;
}
var.accel_flags &= ~FB_ACCELF_TEXT;
@@ -1614,7 +1617,7 @@
var.activate = FB_ACTIVATE_NOW;
aty128_init_engine(par);
-
+
if (register_framebuffer(info) < 0)
return 0;
@@ -1716,7 +1719,7 @@
}
#if !defined(CONFIG_PPC) && !defined(__sparc__)
- if (!(bios = aty128_map_ROM(pdev)))
+ if (!(bios = aty128_map_ROM(pdev, par)))
printk(KERN_INFO "aty128fb: BIOS not located, guessing timings.\n");
else {
printk(KERN_INFO "aty128fb: Rage128 BIOS located at %lx\n",
@@ -1776,8 +1779,6 @@
release_mem_region(pci_resource_start(pdev, 0),
pci_resource_len(pdev, 0));
- release_mem_region(pci_resource_start(pdev, 1),
- pci_resource_len(pdev, 1));
release_mem_region(pci_resource_start(pdev, 2),
pci_resource_len(pdev, 2));
#ifdef CONFIG_PMAC_PBOOK
@@ -1790,33 +1791,47 @@
/* PPC and Sparc cannot read video ROM */
#if !defined(CONFIG_PPC) && !defined(__sparc__)
-static void * __init aty128_map_ROM(struct pci_dev *dev)
+static void * __init aty128_map_ROM(struct pci_dev *dev, const struct aty128fb_par *par)
{
// If this is a primary card, there is a shadow copy of the
// ROM somewhere in the first meg. We will just ignore the copy
// and use the ROM directly.
+ /* Fix from ATI for problem with Rage128 hardware not leaving ROM enabled */
+ unsigned int temp;
+ temp = aty_ld_le32(RAGE128_MPP_TB_CONFIG);
+ temp &= 0x00ffffffu;
+ temp |= 0x04 << 24;
+ aty_st_le32(RAGE128_MPP_TB_CONFIG, temp);
+ temp = aty_ld_le32(RAGE128_MPP_TB_CONFIG);
+
// no need to search for the ROM, just ask the card where it is.
struct resource *r = &dev->resource[PCI_ROM_RESOURCE];
- unsigned char *addr;
+ void *rom;
// assign the ROM an address if it doesn't have one
if (r->start == 0)
pci_assign_resource(dev, PCI_ROM_RESOURCE);
// enable if needed
- if (!(r->flags & PCI_ROM_ADDRESS_ENABLE))
+ if (!(r->flags & PCI_ROM_ADDRESS_ENABLE)) {
pci_write_config_dword(dev, dev->rom_base_reg, r->start | PCI_ROM_ADDRESS_ENABLE);
+ r->flags |= PCI_ROM_ADDRESS_ENABLE;
+ }
- addr = ioremap(r->start, r->end - r->start + 1);
+ rom = ioremap(r->start, r->end - r->start + 1);
+ if (!rom) {
+ printk(KERN_ERR "aty128fb: ROM failed to map\n");
+ return NULL;
+ }
// Very simple test to make sure it appeared
- if (addr && (*addr != 0x55)) {
- printk("aty128fb: Invalid ROM signature %x\n", *addr);
- iounmap(addr);
+ if (readb(rom) != 0x55) {
+ printk(KERN_ERR "aty128fb: Invalid ROM signature %x should be 0x55\n", readb(rom));
+ aty128_unmap_ROM(dev, rom);
return NULL;
}
- return (void *)addr;
+ return rom;
}
static void __init aty128_unmap_ROM(struct pci_dev *dev, void * rom)
@@ -1826,10 +1841,12 @@
iounmap(rom);
- r->flags &= !PCI_ROM_ADDRESS_ENABLE;
+ r->flags &= ~PCI_ROM_ADDRESS_ENABLE;
r->end -= r->start;
r->start = 0;
+ /* This will disable and set address to unassigned */
pci_write_config_dword(dev, dev->rom_base_reg, 0);
+ release_resource(r);
}
static void __init
@@ -2339,13 +2356,30 @@
pci_unregister_driver(&aty128fb_driver);
}
+#ifdef MODULE
+module_init(aty128fb_init);
+module_exit(aty128fb_exit);
+#endif
+
MODULE_AUTHOR("(c)1999-2003 Brad Douglas <brad@neruo.com>");
MODULE_DESCRIPTION("FBDev driver for ATI Rage128 / Pro cards");
MODULE_LICENSE("GPL");
-MODULE_PARM(mode, "s");
+module_param(mode, charp, 0);
MODULE_PARM_DESC(mode, "Specify resolution as \"<xres>x<yres>[-<bpp>][@<refresh>]\" ");
#ifdef CONFIG_MTRR
-MODULE_PARM(nomtrr, "i");
-MODULE_PARM_DESC(nomtrr, "Disable MTRR support (0 or 1=disabled) (default=0)");
+module_param_named(nomtrr, mtrr, invbool, 0);
+MODULE_PARM_DESC(mtrr, "bool: Disable MTRR support (0 or 1=disabled) (default=0)");
+#endif
+#ifdef CONFIG_PPC_PMAC
+module_param_named(vmode, default_vmode, int, 0);
+MODULE_PARM_DESC(default_vmode, "Deprecated: video mode int");
+module_param_named(cmode, default_cmode, int, 0);
+MODULE_PARM_DESC(default_cmode, "Deprecated: color mode int");
+#endif
+#ifdef CONFIG_PMAC_PBOOK
+module_param_named(lcd, default_lcd_on, bool, 0);
+MODULE_PARM_DESC(default_lcd_on, "bool: Default LCD on");
+module_param_named(crt, default_crt_on, bool, 0);
+MODULE_PARM_DESC(default_crt_on, "bool: Default CRT on");
#endif
diff -Nru a/drivers/video/radeonfb.c b/drivers/video/radeonfb.c
--- a/drivers/video/radeonfb.c Fri Aug 15 21:19:02 2003
+++ b/drivers/video/radeonfb.c Fri Aug 15 21:19:02 2003
@@ -23,6 +23,9 @@
* 2002-06-03 MTRR support, Peter Horton, 0.1.5
* 2002-09-21 rv250, r300, m9 initial support,
* added mirror option, 0.1.6
+ * 2003-08-12 added a bunch more PCI IDs for various Radeons
+ * converted module params to 2.6 scheme
+ * Jon Smirl <jonsmirl@yahoo.com>
*
* Special thanks to ATI DevRel team for their hardware donations.
*
@@ -34,6 +37,7 @@
#include <linux/config.h>
#include <linux/module.h>
+#include <linux/moduleparam.h>
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/string.h>
@@ -91,89 +95,41 @@
// XXX
#undef CONFIG_PMAC_PBOOK
-
-enum radeon_chips {
- RADEON_QD,
- RADEON_QE,
- RADEON_QF,
- RADEON_QG,
- RADEON_QY,
- RADEON_QZ,
- RADEON_LW,
- RADEON_LX,
- RADEON_LY,
- RADEON_LZ,
- RADEON_QL,
- RADEON_QN,
- RADEON_QO,
- RADEON_Ql,
- RADEON_BB,
- RADEON_QW,
- RADEON_QX,
- RADEON_Id,
- RADEON_Ie,
- RADEON_If,
- RADEON_Ig,
- RADEON_Ld,
- RADEON_Le,
- RADEON_Lf,
- RADEON_Lg,
- RADEON_ND,
- RADEON_NE,
- RADEON_NF,
- RADEON_NG,
- RADEON_QM
-};
-
enum radeon_arch {
+ RADEON_IGP,
RADEON_R100,
RADEON_RV100,
RADEON_R200,
RADEON_RV200,
RADEON_RV250,
RADEON_R300,
+ RADEON_RS300,
+ RADEON_R350,
RADEON_M6,
RADEON_M7,
- RADEON_M9
+ RADEON_M9,
+ RADEON_R200_SEC,
+ RADEON_RV250_SEC,
+ RADEON_R300_SEC,
+ RADEON_R350_SEC,
+ RADEON_M9_SEC,
};
-static struct radeon_chip_info {
- const char *name;
- unsigned char arch;
-} radeon_chip_info[] __devinitdata = {
- { "QD", RADEON_R100 },
- { "QE", RADEON_R100 },
- { "QF", RADEON_R100 },
- { "QG", RADEON_R100 },
- { "VE QY", RADEON_RV100 },
- { "VE QZ", RADEON_RV100 },
- { "M7 LW", RADEON_M7 },
- { "M7 LX", RADEON_M7 },
- { "M6 LY", RADEON_M6 },
- { "M6 LZ", RADEON_M6 },
- { "8500 QL", RADEON_R200 },
- { "8500 QN", RADEON_R200 },
- { "8500 QO", RADEON_R200 },
- { "8500 Ql", RADEON_R200 },
- { "8500 BB", RADEON_R200 },
- { "7500 QW", RADEON_RV200 },
- { "7500 QX", RADEON_RV200 },
- { "9000 Id", RADEON_RV250 },
- { "9000 Ie", RADEON_RV250 },
- { "9000 If", RADEON_RV250 },
- { "9000 Ig", RADEON_RV250 },
- { "M9 Ld", RADEON_M9 },
- { "M9 Le", RADEON_M9 },
- { "M9 Lf", RADEON_M9 },
- { "M9 Lg", RADEON_M9 },
- { "9700 ND", RADEON_R300 },
- { "9700 NE", RADEON_R300 },
- { "9700 NF", RADEON_R300 },
- { "9700 NG", RADEON_R300 },
- { "9100 QM", RADEON_R200 }
+static const char *radeon_family[] __devinitdata = {
+ "IGP",
+ "R100",
+ "VE RV100",
+ "8500 R200",
+ "7500 RV200",
+ "9000 RV250",
+ "9700 R300",
+ "9700 RS300",
+ "9800 R350",
+ "Mobility M6",
+ "Mobility M7",
+ "Mobility M9",
};
-
-
+
enum radeon_montype
{
MT_NONE,
@@ -186,36 +142,67 @@
static struct pci_device_id radeonfb_pci_table[] = {
- { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_QD, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_QD},
- { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_QE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_QE},
- { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_QF, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_QF},
- { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_QG, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_QG},
- { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_QY, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_QY},
- { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_QZ, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_QZ},
- { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_LW, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_LW},
- { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_LX, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_LX},
- { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_LY, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_LY},
- { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_LZ, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_LZ},
- { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_QL, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_QL},
- { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_QN, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_QN},
- { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_QO, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_QO},
- { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_Ql, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_Ql},
- { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_BB, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_BB},
- { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_QW, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_QW},
- { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_QX, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_QX},
- { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_Id, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_Id},
- { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_Ie, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_Ie},
- { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_If, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_If},
- { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_Ig, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_Ig},
- { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_Ld, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_Ld},
- { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_Le, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_Le},
- { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_Lf, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_Lf},
- { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_Lg, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_Lg},
- { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_ND, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_ND},
- { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_NE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_NE},
- { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_NF, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_NF},
- { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_NG, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_NG},
- { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_QM, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_QM},
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_A6, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_IGP},
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_A7, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_IGP},
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_AD, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_R300},
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_AE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_R300},
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_AF, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_R300},
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_AG, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_R300},
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_Ad, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_R300_SEC},
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_B7, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_IGP},
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_BB, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_R200},
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_C6, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_IGP},
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_C7, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_IGP},
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_D7, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_IGP},
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_Id, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_RV250},
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_Ie, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_RV250},
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_If, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_RV250},
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_Ig, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_RV250},
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_In, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_RV250_SEC},
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_LW, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_M7},
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_LX, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_M7},
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_LY, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_M6},
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_LZ, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_M6},
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_Ld, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_M9},
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_Le, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_M9},
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_Lf, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_M9},
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_Lg, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_M9},
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_Ln, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_M9_SEC},
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_ND, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_R300},
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_NE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_R300},
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_NF, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_R300},
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_NG, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_R300},
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_NH, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_R350},
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_Nd, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_R300_SEC},
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_Ne, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_R300_SEC},
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_Nf, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_R300_SEC},
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_Ng, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_R300_SEC},
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_Nh, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_R350_SEC},
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_QD, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_R100},
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_QE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_R100},
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_QF, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_R100},
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_QG, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_R100},
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_QH, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_R200},
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_QI, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_R200},
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_QJ, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_R200},
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_QK, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_R200},
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_QL, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_R200},
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_QM, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_R200},
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_QN, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_R200},
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_QO, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_R200},
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_QW, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_RV200},
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_QX, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_RV200},
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_QY, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_RV100},
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_QZ, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_RV100},
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_Qh, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_R200_SEC},
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_Qi, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_R200_SEC},
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_Qj, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_R200_SEC},
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_Qk, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_R200_SEC},
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_Ql, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_R200_SEC},
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_X4, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_RS300},
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_X5, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_RS300},
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_X6, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_RS300},
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_X7, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_RS300},
{ 0, }
};
MODULE_DEVICE_TABLE(pci, radeonfb_pci_table);
@@ -350,7 +337,7 @@
struct radeon_regs state;
struct radeon_regs init_state;
- char name[32];
+ char name[DEVICE_NAME_SIZE];
char ram_type[12];
unsigned long mmio_base_phys;
@@ -679,12 +666,14 @@
*/
static char *mode_option __initdata;
-static char noaccel = 1;
-static char mirror = 0;
+static int noaccel = 1;
+static int mirror = 0;
static int panel_yres __initdata = 0;
-static char force_dfp __initdata = 0;
+static int force_dfp __initdata = 0;
static struct radeonfb_info *board_list = NULL;
-static char nomtrr __initdata = 0;
+#ifdef CONFIG_MTRR
+static int nomtrr __initdata = 0;
+#endif
/*
* prototypes
@@ -698,7 +687,10 @@
static int __devinit radeon_set_fbinfo (struct radeonfb_info *rinfo);
static int __devinit radeon_init_disp (struct radeonfb_info *rinfo);
static int radeon_init_disp_var (struct radeonfb_info *rinfo, struct fb_var_screeninfo *var);
-static char *radeon_find_rom(struct radeonfb_info *rinfo);
+#if defined(__i386__)
+static void __init *radeon_map_ROM(struct radeonfb_info *rinfo, struct pci_dev *pdev);
+static void __init radeon_unmap_ROM(struct pci_dev *dev, void * rom);
+#endif
static void radeon_get_pllinfo(struct radeonfb_info *rinfo, char *bios_seg);
static void radeon_get_moninfo (struct radeonfb_info *rinfo);
static int radeon_get_dfpinfo (struct radeonfb_info *rinfo);
@@ -731,74 +723,65 @@
#endif /* CONFIG_PPC_OF */
-static char *radeon_find_rom(struct radeonfb_info *rinfo)
-{
#if defined(__i386__)
- u32 segstart;
- char *rom_base;
- char *rom;
- int stage;
- int i,j;
- char aty_rom_sig[] = "761295520";
- char *radeon_sig[] = {
- "RG6",
- "RADEON"
- };
-
- for(segstart=0x000c0000; segstart<0x000f0000; segstart+=0x00001000) {
-
- stage = 1;
-
- rom_base = (char *)ioremap(segstart, 0x1000);
-
- if ((*rom_base == 0x55) && (((*(rom_base + 1)) & 0xff) == 0xaa))
- stage = 2;
-
-
- if (stage != 2) {
- iounmap(rom_base);
- continue;
- }
-
- rom = rom_base;
-
- for (i = 0; (i < 128 - strlen(aty_rom_sig)) && (stage != 3); i++) {
- if (aty_rom_sig[0] == *rom)
- if (strncmp(aty_rom_sig, rom,
- strlen(aty_rom_sig)) == 0)
- stage = 3;
- rom++;
- }
- if (stage != 3) {
- iounmap(rom_base);
- continue;
- }
- rom = rom_base;
-
- for (i = 0; (i < 512) && (stage != 4); i++) {
- for(j = 0;j < sizeof(radeon_sig)/sizeof(char *);j++) {
- if (radeon_sig[j][0] == *rom)
- if (strncmp(radeon_sig[j], rom,
- strlen(radeon_sig[j])) == 0) {
- stage = 4;
- break;
- }
- }
- rom++;
- }
- if (stage != 4) {
- iounmap(rom_base);
- continue;
- }
-
- return rom_base;
- }
-#endif
- return NULL;
+static void * __init radeon_map_ROM(struct radeonfb_info *rinfo, struct pci_dev *dev)
+{
+ // If this is a primary card, there is a shadow copy of the
+ // ROM somewhere in the first meg. We will just ignore the copy
+ // and use the ROM directly.
+
+ /* Fix from ATI for problem with Radeon hardware not leaving ROM enabled */
+ unsigned int temp;
+ temp = INREG(RADEON_MPP_TB_CONFIG);
+ temp &= 0x00ffffffu;
+ temp |= 0x04 << 24;
+ OUTREG(RADEON_MPP_TB_CONFIG, temp);
+ temp = INREG(RADEON_MPP_TB_CONFIG);
+
+ // no need to search for the ROM, just ask the card where it is.
+ struct resource *r = &dev->resource[PCI_ROM_RESOURCE];
+ void *rom;
+
+ // assign the ROM an address if it doesn't have one
+ if (r->start == 0)
+ pci_assign_resource(dev, PCI_ROM_RESOURCE);
+
+ // enable if needed
+ if (!(r->flags & PCI_ROM_ADDRESS_ENABLE)) {
+ pci_write_config_dword(dev, dev->rom_base_reg, r->start | PCI_ROM_ADDRESS_ENABLE);
+ r->flags |= PCI_ROM_ADDRESS_ENABLE;
+ }
+
+ rom = ioremap(r->start, r->end - r->start + 1);
+ if (!rom) {
+ printk(KERN_ERR "radeonfb: ROM failed to map\n");
+ return NULL;
+ }
+
+ // Very simple test to make sure it appeared
+ if (readb(rom) != 0x55) {
+ printk(KERN_ERR "radeonfb: Invalid ROM signature %x should be 0x55\n", readb(rom));
+ radeon_unmap_ROM(dev, rom);
+ return NULL;
+ }
+ return rom;
}
-
-
+static void __init radeon_unmap_ROM(struct pci_dev *dev, void * rom)
+{
+ // leave it disabled and unassigned
+ struct resource *r = &dev->resource[PCI_ROM_RESOURCE];
+
+ iounmap(rom);
+
+ r->flags &= ~PCI_ROM_ADDRESS_ENABLE;
+ r->end -= r->start;
+ r->start = 0;
+ /* This will disable and set address to unassigned */
+ pci_write_config_dword(dev, dev->rom_base_reg, 0);
+ release_resource(r);
+}
+#endif
static void radeon_get_pllinfo(struct radeonfb_info *rinfo, char *bios_seg)
{
@@ -1081,12 +1064,12 @@
return 0;
if (!(fpbiosstart = rinfo->bios_seg + readw(rinfo->bios_seg + 0x48))) {
- printk("radeonfb: Failed to detect DFP panel info using BIOS\n");
+ printk(KERN_ERR "radeonfb: Failed to detect DFP panel info using BIOS\n");
return 0;
}
if (!(tmp = rinfo->bios_seg + readw(fpbiosstart + 0x40))) {
- printk("radeonfb: Failed to detect DFP panel info using BIOS\n");
+ printk(KERN_ERR "radeonfb: Failed to detect DFP panel info using BIOS\n");
return 0;
}
@@ -1172,7 +1155,7 @@
rinfo->panel_xres = 1600;
break;
default:
- printk("radeonfb: Failed to detect DFP panel size\n");
+ printk(KERN_ERR "radeonfb: Failed to detect DFP panel size\n");
return 0;
}
@@ -2794,10 +2777,21 @@
const struct pci_device_id *ent)
{
struct radeonfb_info *rinfo;
- struct radeon_chip_info *rci = &radeon_chip_info[ent->driver_data];
u32 tmp;
RTRACE("radeonfb_pci_register BEGIN\n");
+
+ /* The driver acknowledges owning secondary devices but they are handled by primary */
+ switch (ent->driver_data) {
+ case RADEON_R200_SEC:
+ case RADEON_RV250_SEC:
+ case RADEON_R300_SEC:
+ case RADEON_R350_SEC:
+ case RADEON_M9_SEC:
+ return 0;
+ default:
+ break;
+ }
/* Enable device in PCI config */
if (pci_enable_device(pdev) != 0) {
@@ -2807,15 +2801,23 @@
rinfo = kmalloc (sizeof (struct radeonfb_info), GFP_KERNEL);
if (!rinfo) {
- printk ("radeonfb: could not allocate memory\n");
+ printk (KERN_ERR "radeonfb: could not allocate memory\n");
return -ENODEV;
}
memset (rinfo, 0, sizeof (struct radeonfb_info));
- //info = &rinfo->info;
+
rinfo->pdev = pdev;
- strcpy(rinfo->name, rci->name);
- rinfo->arch = rci->arch;
+
+ strcpy(rinfo->name, "ATI Radeon XX ");
+ rinfo->name[11] = ent->device >> 8;
+ rinfo->name[12] = ent->device & 0xFF;
+
+ /* range check to make sure */
+ if (ent->driver_data < (sizeof(radeon_family)/sizeof(char *)))
+ strncat(rinfo->name, radeon_family[ent->driver_data], sizeof(rinfo->name));
+
+ rinfo->arch = ent->driver_data;
/* Set base addrs */
rinfo->fb_base_phys = pci_resource_start (pdev, 0);
@@ -2824,30 +2826,21 @@
/* request the mem regions */
if (!request_mem_region (rinfo->fb_base_phys,
pci_resource_len(pdev, 0), "radeonfb")) {
- printk ("radeonfb: cannot reserve FB region\n");
- kfree (rinfo);
- return -ENODEV;
+ printk (KERN_ERR "radeonfb: cannot reserve FB region\n");
+ goto free_rinfo;
}
if (!request_mem_region (rinfo->mmio_base_phys,
pci_resource_len(pdev, 2), "radeonfb")) {
- printk ("radeonfb: cannot reserve MMIO region\n");
- release_mem_region (rinfo->fb_base_phys,
- pci_resource_len(pdev, 0));
- kfree (rinfo);
- return -ENODEV;
+ printk (KERN_ERR "radeonfb: cannot reserve MMIO region\n");
+ goto release_fb;
}
/* map the regions */
rinfo->mmio_base = (unsigned long) ioremap (rinfo->mmio_base_phys, RADEON_REGSIZE);
if (!rinfo->mmio_base) {
- printk ("radeonfb: cannot map MMIO\n");
- release_mem_region (rinfo->mmio_base_phys,
- pci_resource_len(pdev, 2));
- release_mem_region (rinfo->fb_base_phys,
- pci_resource_len(pdev, 0));
- kfree (rinfo);
- return -ENODEV;
+ printk (KERN_ERR "radeonfb: cannot map MMIO\n");
+ goto release_mmio;
}
rinfo->chipset = pdev->device;
@@ -2924,7 +2917,7 @@
break;
}
- rinfo->bios_seg = radeon_find_rom(rinfo);
+ rinfo->bios_seg = radeon_map_ROM(rinfo, pdev);
radeon_get_pllinfo(rinfo, rinfo->bios_seg);
/*
@@ -2966,26 +2959,14 @@
if ((rinfo->dviDisp_type == MT_DFP) || (rinfo->dviDisp_type == MT_LCD) ||
(rinfo->crtDisp_type == MT_DFP)) {
if (!radeon_get_dfpinfo(rinfo)) {
- iounmap ((void*)rinfo->mmio_base);
- release_mem_region (rinfo->mmio_base_phys,
- pci_resource_len(pdev, 2));
- release_mem_region (rinfo->fb_base_phys,
- pci_resource_len(pdev, 0));
- kfree (rinfo);
- return -ENODEV;
+ goto unmap_rom;
}
}
rinfo->fb_base = (unsigned long) ioremap (rinfo->fb_base_phys, rinfo->video_ram);
if (!rinfo->fb_base) {
- printk ("radeonfb: cannot map FB\n");
- iounmap ((void*)rinfo->mmio_base);
- release_mem_region (rinfo->mmio_base_phys,
- pci_resource_len(pdev, 2));
- release_mem_region (rinfo->fb_base_phys,
- pci_resource_len(pdev, 0));
- kfree (rinfo);
- return -ENODEV;
+ printk (KERN_ERR "radeonfb: cannot map FB\n");
+ goto unmap_rom;
}
/* I SHOULD FIX THAT CRAP ! I should probably mimmic XFree DRI
@@ -3035,15 +3016,8 @@
board_list = rinfo;
if (register_framebuffer ((struct fb_info *) rinfo) < 0) {
- printk ("radeonfb: could not register framebuffer\n");
- iounmap ((void*)rinfo->fb_base);
- iounmap ((void*)rinfo->mmio_base);
- release_mem_region (rinfo->mmio_base_phys,
- pci_resource_len(pdev, 2));
- release_mem_region (rinfo->fb_base_phys,
- pci_resource_len(pdev, 0));
- kfree (rinfo);
- return -ENODEV;
+ printk (KERN_ERR "radeonfb: could not register framebuffer\n");
+ goto unmap_fb;
}
#ifdef CONFIG_MTRR
@@ -3065,7 +3039,7 @@
}
#endif
- printk ("radeonfb: ATI Radeon %s %s %d MB\n", rinfo->name, rinfo->ram_type,
+ printk ("radeonfb: %s %s %d MB\n", rinfo->name, rinfo->ram_type,
(rinfo->video_ram/(1024*1024)));
if (rinfo->hasCRTC2) {
@@ -3078,9 +3052,24 @@
GET_MON_NAME(rinfo->crtDisp_type));
}
+ radeon_unmap_ROM(pdev, rinfo->bios_seg);
RTRACE("radeonfb_pci_register END\n");
return 0;
+unmap_fb:
+ iounmap ((void*)rinfo->fb_base);
+unmap_rom:
+ radeon_unmap_ROM(pdev, rinfo->bios_seg);
+ iounmap ((void*)rinfo->mmio_base);
+release_mmio:
+ release_mem_region (rinfo->mmio_base_phys,
+ pci_resource_len(pdev, 2));
+release_fb:
+ release_mem_region (rinfo->fb_base_phys,
+ pci_resource_len(pdev, 0));
+free_rinfo:
+ kfree (rinfo);
+ return -ENODEV;
}
@@ -3137,40 +3126,25 @@
pci_unregister_driver (&radeonfb_driver);
}
-
-int __init radeonfb_setup (char *options)
-{
- char *this_opt;
-
- if (!options || !*options)
- return 0;
-
- while ((this_opt = strsep (&options, ",")) != NULL) {
- if (!*this_opt)
- continue;
- if (!strncmp(this_opt, "noaccel", 7)) {
- noaccel = 1;
- } else if (!strncmp(this_opt, "mirror", 6)) {
- mirror = 1;
- } else if (!strncmp(this_opt, "dfp", 3)) {
- force_dfp = 1;
- } else if (!strncmp(this_opt, "panel_yres:", 11)) {
- panel_yres = simple_strtoul((this_opt+11), NULL, 0);
- } else if (!strncmp(this_opt, "nomtrr", 6)) {
- nomtrr = 1;
- } else
- mode_option = this_opt;
- }
-
- return 0;
-}
-
#ifdef MODULE
module_init(radeonfb_init);
module_exit(radeonfb_exit);
#endif
-
MODULE_AUTHOR("Ani Joshi");
MODULE_DESCRIPTION("framebuffer driver for ATI Radeon chipset");
MODULE_LICENSE("GPL");
+module_param(noaccel, bool, 0);
+MODULE_PARM_DESC(noaccel, "bool: disable acceleration");
+module_param(mirror, bool, 0);
+MODULE_PARM_DESC(mirror, "bool: mirror the display to both monitors");
+module_param(force_dfp, bool, 0);
+MODULE_PARM_DESC(force_dfp, "bool: force display to dfp");
+#ifdef CONFIG_MTRR
+module_param(nomtrr, bool, 0);
+MODULE_PARM_DESC(nomtrr, "bool: disable use of MTRR registers");
+#endif
+module_param(panel_yres, int, 0);
+MODULE_PARM_DESC(force_dfp, "int: set panel yres");
+module_param(mode_option, charp, 0);
+MODULE_PARM_DESC(mode_option, "Specify resolution as \"<xres>x<yres>[-<bpp>][@<refresh>]\" ");
diff -Nru a/include/linux/pci_ids.h b/include/linux/pci_ids.h
--- a/include/linux/pci_ids.h Fri Aug 15 21:19:02 2003
+++ b/include/linux/pci_ids.h Fri Aug 15 21:19:02 2003
@@ -182,8 +182,21 @@
#define PCI_DEVICE_ID_LSI_63C815 0x1000
#define PCI_VENDOR_ID_ATI 0x1002
-/* Mach64 */
+/* Radeon */
+#define PCI_DEVICE_ID_ATI_RADEON_A6 0x4136
+#define PCI_DEVICE_ID_ATI_RADEON_A7 0x4137
+#define PCI_DEVICE_ID_ATI_RADEON_AD 0x4144
+#define PCI_DEVICE_ID_ATI_RADEON_AE 0x4145
+#define PCI_DEVICE_ID_ATI_RADEON_AF 0x4146
+#define PCI_DEVICE_ID_ATI_RADEON_AG 0x4147
#define PCI_DEVICE_ID_ATI_68800 0x4158
+#define PCI_DEVICE_ID_ATI_RADEON_Ad 0x4164
+#define PCI_DEVICE_ID_ATI_RADEON_B7 0x4237
+#define PCI_DEVICE_ID_ATI_RADEON_BB 0x4242
+#define PCI_DEVICE_ID_ATI_RADEON_C6 0x4336
+#define PCI_DEVICE_ID_ATI_RADEON_C7 0x4337
+#define PCI_DEVICE_ID_ATI_RADEON_D7 0x4337
+/* Mach64 */
#define PCI_DEVICE_ID_ATI_215CT222 0x4354
#define PCI_DEVICE_ID_ATI_210888CX 0x4358
#define PCI_DEVICE_ID_ATI_215ET222 0x4554
@@ -200,6 +213,13 @@
#define PCI_DEVICE_ID_ATI_215_IW 0x4757
#define PCI_DEVICE_ID_ATI_215_IZ 0x475A
#define PCI_DEVICE_ID_ATI_210888GX 0x4758
+/* Radeon RV250 (9000) */
+#define PCI_DEVICE_ID_ATI_RADEON_Id 0x4964
+#define PCI_DEVICE_ID_ATI_RADEON_Ie 0x4965
+#define PCI_DEVICE_ID_ATI_RADEON_If 0x4966
+#define PCI_DEVICE_ID_ATI_RADEON_Ig 0x4967
+#define PCI_DEVICE_ID_ATI_RADEON_In 0x496e
+/* Mach64 / Rage */
#define PCI_DEVICE_ID_ATI_215_LB 0x4c42
#define PCI_DEVICE_ID_ATI_215_LD 0x4c44
#define PCI_DEVICE_ID_ATI_215_LG 0x4c47
@@ -209,15 +229,40 @@
#define PCI_DEVICE_ID_ATI_215_LR 0x4c52
#define PCI_DEVICE_ID_ATI_215_LS 0x4c53
#define PCI_DEVICE_ID_ATI_264_LT 0x4c54
-/* Radeon M4 */
-#define PCI_DEVICE_ID_ATI_RADEON_LE 0x4d45
-#define PCI_DEVICE_ID_ATI_RADEON_LF 0x4d46
+/* Radeon M7 */
+#define PCI_DEVICE_ID_ATI_RADEON_LW 0x4c57
+#define PCI_DEVICE_ID_ATI_RADEON_LX 0x4c58
+/* Radeon M6 */
+#define PCI_DEVICE_ID_ATI_RADEON_LY 0x4c59
+#define PCI_DEVICE_ID_ATI_RADEON_LZ 0x4c5a
+#define PCI_DEVICE_ID_ATI_RADEON_Ld 0x4c64
+#define PCI_DEVICE_ID_ATI_RADEON_Le 0x4c65
+#define PCI_DEVICE_ID_ATI_RADEON_Lf 0x4c66
+#define PCI_DEVICE_ID_ATI_RADEON_Lg 0x4c67
+#define PCI_DEVICE_ID_ATI_RADEON_Ln 0x4c6e
+/* Rage128 M3 */
+#define PCI_DEVICE_ID_ATI_RAGE128_LE 0x4c45
+#define PCI_DEVICE_ID_ATI_RAGE128_LF 0x4c46
+/* Rage128 M4 */
+#define PCI_DEVICE_ID_ATI_RAGE128_MF 0x4d46
+#define PCI_DEVICE_ID_ATI_RAGE128_ML 0x4d4c
+/* Radeon R300 (9700) */
+#define PCI_DEVICE_ID_ATI_RADEON_ND 0x4e44
+#define PCI_DEVICE_ID_ATI_RADEON_NE 0x4e45
+#define PCI_DEVICE_ID_ATI_RADEON_NF 0x4e46
+#define PCI_DEVICE_ID_ATI_RADEON_NG 0x4e47
+#define PCI_DEVICE_ID_ATI_RADEON_NH 0x4e48
+#define PCI_DEVICE_ID_ATI_RADEON_Nd 0x4e64
+#define PCI_DEVICE_ID_ATI_RADEON_Ne 0x4e65
+#define PCI_DEVICE_ID_ATI_RADEON_Nf 0x4e66
+#define PCI_DEVICE_ID_ATI_RADEON_Ng 0x4e67
+#define PCI_DEVICE_ID_ATI_RADEON_Nh 0x4e68
/* Rage128 Pro GL */
-#define PCI_DEVICE_ID_ATI_Rage128_PA 0x5041
-#define PCI_DEVICE_ID_ATI_Rage128_PB 0x5042
-#define PCI_DEVICE_ID_ATI_Rage128_PC 0x5043
-#define PCI_DEVICE_ID_ATI_Rage128_PD 0x5044
-#define PCI_DEVICE_ID_ATI_Rage128_PE 0x5045
+#define PCI_DEVICE_ID_ATI_RAGE128_PA 0x5041
+#define PCI_DEVICE_ID_ATI_RAGE128_PB 0x5042
+#define PCI_DEVICE_ID_ATI_RAGE128_PC 0x5043
+#define PCI_DEVICE_ID_ATI_RAGE128_PD 0x5044
+#define PCI_DEVICE_ID_ATI_RAGE128_PE 0x5045
#define PCI_DEVICE_ID_ATI_RAGE128_PF 0x5046
/* Rage128 Pro VR */
#define PCI_DEVICE_ID_ATI_RAGE128_PG 0x5047
@@ -244,78 +289,60 @@
#define PCI_DEVICE_ID_ATI_RADEON_QE 0x5145
#define PCI_DEVICE_ID_ATI_RADEON_QF 0x5146
#define PCI_DEVICE_ID_ATI_RADEON_QG 0x5147
+#define PCI_DEVICE_ID_ATI_RADEON_QH 0x5148
+#define PCI_DEVICE_ID_ATI_RADEON_QI 0x5149
+#define PCI_DEVICE_ID_ATI_RADEON_QJ 0x514a
+#define PCI_DEVICE_ID_ATI_RADEON_QK 0x514b
/* Radeon R200 (8500) */
#define PCI_DEVICE_ID_ATI_RADEON_QL 0x514c
+#define PCI_DEVICE_ID_ATI_RADEON_QM 0x514d
#define PCI_DEVICE_ID_ATI_RADEON_QN 0x514e
#define PCI_DEVICE_ID_ATI_RADEON_QO 0x514f
-#define PCI_DEVICE_ID_ATI_RADEON_Ql 0x516c
-#define PCI_DEVICE_ID_ATI_RADEON_BB 0x4242
/* Radeon RV200 (7500) */
#define PCI_DEVICE_ID_ATI_RADEON_QW 0x5157
#define PCI_DEVICE_ID_ATI_RADEON_QX 0x5158
-/* Radeon NV-100 */
-#define PCI_DEVICE_ID_ATI_RADEON_N1 0x5159
-#define PCI_DEVICE_ID_ATI_RADEON_N2 0x515a
/* Radeon RV100 (VE) */
#define PCI_DEVICE_ID_ATI_RADEON_QY 0x5159
#define PCI_DEVICE_ID_ATI_RADEON_QZ 0x515a
-/* Radeon RV250 (9000) */
-#define PCI_DEVICE_ID_ATI_RADEON_Id 0x4964
-#define PCI_DEVICE_ID_ATI_RADEON_Ie 0x4965
-#define PCI_DEVICE_ID_ATI_RADEON_If 0x4966
-#define PCI_DEVICE_ID_ATI_RADEON_Ig 0x4967
-#define PCI_DEVICE_ID_ATI_RADEON_QM 0x514d
-/* Radeon R300 (9700) */
-#define PCI_DEVICE_ID_ATI_RADEON_ND 0x4e44
-#define PCI_DEVICE_ID_ATI_RADEON_NE 0x4e45
-#define PCI_DEVICE_ID_ATI_RADEON_NF 0x4e46
-#define PCI_DEVICE_ID_ATI_RADEON_NG 0x4e47
-/* Radeon M6 */
-#define PCI_DEVICE_ID_ATI_RADEON_LY 0x4c59
-#define PCI_DEVICE_ID_ATI_RADEON_LZ 0x4c5a
-/* Radeon M7 */
-#define PCI_DEVICE_ID_ATI_RADEON_LW 0x4c57
-#define PCI_DEVICE_ID_ATI_RADEON_LX 0x4c58
-#define PCI_DEVICE_ID_ATI_RADEON_Ld 0x4964
-#define PCI_DEVICE_ID_ATI_RADEON_Le 0x4965
-#define PCI_DEVICE_ID_ATI_RADEON_Lf 0x4966
-#define PCI_DEVICE_ID_ATI_RADEON_Lg 0x4967
-/* Radeon */
-#define PCI_DEVICE_ID_ATI_RADEON_RA 0x5144
-#define PCI_DEVICE_ID_ATI_RADEON_RB 0x5145
-#define PCI_DEVICE_ID_ATI_RADEON_RC 0x5146
-#define PCI_DEVICE_ID_ATI_RADEON_RD 0x5147
-/* Rage128 GL */
+#define PCI_DEVICE_ID_ATI_RADEON_Qh 0x5168
+#define PCI_DEVICE_ID_ATI_RADEON_Qi 0x5169
+#define PCI_DEVICE_ID_ATI_RADEON_Qj 0x516a
+#define PCI_DEVICE_ID_ATI_RADEON_Qk 0x516b
+#define PCI_DEVICE_ID_ATI_RADEON_Ql 0x516c
+/* Rage128 VR */
#define PCI_DEVICE_ID_ATI_RAGE128_RE 0x5245
#define PCI_DEVICE_ID_ATI_RAGE128_RF 0x5246
-#define PCI_DEVICE_ID_ATI_RAGE128_RG 0x534b
-#define PCI_DEVICE_ID_ATI_RAGE128_RH 0x534c
-#define PCI_DEVICE_ID_ATI_RAGE128_RI 0x534d
-/* Rage128 VR */
+#define PCI_DEVICE_ID_ATI_RAGE128_RG 0x5247
#define PCI_DEVICE_ID_ATI_RAGE128_RK 0x524b
#define PCI_DEVICE_ID_ATI_RAGE128_RL 0x524c
-#define PCI_DEVICE_ID_ATI_RAGE128_RM 0x5345
-#define PCI_DEVICE_ID_ATI_RAGE128_RN 0x5346
-#define PCI_DEVICE_ID_ATI_RAGE128_RO 0x5347
-/* Rage128 M3 */
-#define PCI_DEVICE_ID_ATI_RAGE128_LE 0x4c45
-#define PCI_DEVICE_ID_ATI_RAGE128_LF 0x4c46
+#define PCI_DEVICE_ID_ATI_RAGE128_SE 0x5345
+#define PCI_DEVICE_ID_ATI_RAGE128_SF 0x5346
+#define PCI_DEVICE_ID_ATI_RAGE128_SG 0x5347
+#define PCI_DEVICE_ID_ATI_RAGE128_SH 0x5348
+#define PCI_DEVICE_ID_ATI_RAGE128_SK 0x534b
+#define PCI_DEVICE_ID_ATI_RAGE128_SL 0x534c
+#define PCI_DEVICE_ID_ATI_RAGE128_SM 0x534d
+#define PCI_DEVICE_ID_ATI_RAGE128_SN 0x534e
/* Rage128 Pro Ultra */
-#define PCI_DEVICE_ID_ATI_RAGE128_U1 0x5446
-#define PCI_DEVICE_ID_ATI_RAGE128_U2 0x544C
-#define PCI_DEVICE_ID_ATI_RAGE128_U3 0x5452
-/* Mach64 VT */
-#define PCI_DEVICE_ID_ATI_264VT 0x5654
-#define PCI_DEVICE_ID_ATI_264VU 0x5655
-#define PCI_DEVICE_ID_ATI_264VV 0x5656
+#define PCI_DEVICE_ID_ATI_RAGE128_TF 0x5446
+#define PCI_DEVICE_ID_ATI_RAGE128_TL 0x544C
+#define PCI_DEVICE_ID_ATI_RAGE128_TR 0x5452
+#define PCI_DEVICE_ID_ATI_RAGE128_TS 0x5453
+#define PCI_DEVICE_ID_ATI_RAGE128_TT 0x5454
+#define PCI_DEVICE_ID_ATI_RAGE128_TU 0x5455
+/* Radeon RS300 */
+#define PCI_DEVICE_ID_ATI_RADEON_X0 0x5830
+#define PCI_DEVICE_ID_ATI_RADEON_X1 0x5831
+#define PCI_DEVICE_ID_ATI_RADEON_X2 0x5832
+#define PCI_DEVICE_ID_ATI_RADEON_X3 0x5833
+#define PCI_DEVICE_ID_ATI_RADEON_X4 0x5834
+#define PCI_DEVICE_ID_ATI_RADEON_X5 0x5835
+#define PCI_DEVICE_ID_ATI_RADEON_X6 0x5836
+#define PCI_DEVICE_ID_ATI_RADEON_X7 0x5837
/* RadeonIGP */
#define PCI_DEVICE_ID_ATI_RS100 0xcab0
#define PCI_DEVICE_ID_ATI_RS200 0xcab2
#define PCI_DEVICE_ID_ATI_RS250 0xcab3
-#define PCI_DEVICE_ID_ATI_RS300_100 0x5830
-#define PCI_DEVICE_ID_ATI_RS300_133 0x5831
-#define PCI_DEVICE_ID_ATI_RS300_166 0x5832
-#define PCI_DEVICE_ID_ATI_RS300_200 0x5833
#define PCI_VENDOR_ID_VLSI 0x1004
#define PCI_DEVICE_ID_VLSI_82C592 0x0005
diff -Nru a/include/video/aty128.h b/include/video/aty128.h
--- a/include/video/aty128.h Fri Aug 15 21:19:02 2003
+++ b/include/video/aty128.h Fri Aug 15 21:19:02 2003
@@ -416,4 +416,7 @@
#define PMI_PMSCR_REG 0x60
+/* used by ATI bug fix for hardware ROM */
+#define RAGE128_MPP_TB_CONFIG 0x01c0
+
#endif /* REG_RAGE128_H */
diff -Nru a/include/video/radeon.h b/include/video/radeon.h
--- a/include/video/radeon.h Fri Aug 15 21:19:02 2003
+++ b/include/video/radeon.h Fri Aug 15 21:19:02 2003
@@ -872,5 +872,8 @@
#define GUI_ACTIVE 0x80000000
+/* used by ATI bug fix for hardware ROM */
+#define RADEON_MPP_TB_CONFIG 0x01c0
+
#endif /* _RADEON_H */
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Rage128/Radeon framebuffer updates
2003-08-16 1:24 Rage128/Radeon framebuffer updates Jon Smirl
@ 2003-08-16 10:04 ` Benjamin Herrenschmidt
2003-08-16 16:19 ` [Dri-devel] " Jon Smirl
0 siblings, 1 reply; 4+ messages in thread
From: Benjamin Herrenschmidt @ 2003-08-16 10:04 UTC (permalink / raw)
To: Jon Smirl; +Cc: fb-devel, dri-devel, Paul Mackerras
On Sat, 2003-08-16 at 03:24, Jon Smirl wrote:
> linux/pci_ids.h just had a check-in which caused a big
> merge conflict with my patch. I have tried to sort it
> out.
>
> Please check Radeon PCI IDs and chip families in
> radeonfb driver. It is important that the PCI IDs of
> secondary devices be marked as such.
>
> This patch merges Rage128 and Radeon changes into a
> single patch. It is against current 2.5 bk r1.1188.
So you still go to ROM unconditionally... Well, we should
get that tested, I don't have the offending x86 hardware,
but I'd like to know if that still works with all those
DFPs for which we obtain the EDID via the BIOS image in RAM...
Again, adding that fixed the driver for a _lot_ of users, so
I'd like not to change that until we have a replacement with
real i2c accesses...
(Note: The DFP code may not be in the current 2.6 version of
the driver, it's only in 2.4 afaik, it's part of some radeonfb
updates I have pending).
What we could do is, if we can figure out which is the primary
card, do the RAM search on it only, and use ROM for others,
but then, that leads me to another question regarding multiple
cards: Are they all POSTed (initialized) by the BIOS ? I though
x86 BIOSes only initialized the first card ?
If they aren't, then there's no point in that fix anyway since
neither aty128fb nor radeonfb will work on a card that wasn't
POSTed by the BIOS.
Also, looking quickly at the patches:
- r128: why do you change the chip generations this way ? Is
there any _use_ of that change (splitting PCI/nonPCI) or it's
just that you prefer it like that ? I'd rather leave it the way
it was, and/or eventually add some bit flags indicating if it's
PCI and/or AGP...
- r128 & radeon : your change of the setup functions to turn them
into module params, I'm not sure I like them at least not at this
point. This will change the syntax on the kernel command line at
least, which I'd rather not do at this stage
- AFAIK, Paul Mackerras <paulus@samba.org> is the current aty128fb
maintainer, can you pass the changes through him ?
Ben.
-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Dri-devel] Re: Rage128/Radeon framebuffer updates
2003-08-16 10:04 ` Benjamin Herrenschmidt
@ 2003-08-16 16:19 ` Jon Smirl
2003-08-16 16:35 ` Benjamin Herrenschmidt
0 siblings, 1 reply; 4+ messages in thread
From: Jon Smirl @ 2003-08-16 16:19 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: fb-devel, dri-devel, Paul Mackerras
--- Benjamin Herrenschmidt <benh@kernel.crashing.org>
wrote:
The big picture here is that aty128fb and radeonfb
have not had their PCI ID tables updated since 2.6 was
started. Any hardware made since then can't use the
framebuffer drivers.
> So you still go to ROM unconditionally... Well, we
> should get that tested, I don't have the offending
x86
> hardware, but I'd like to know if that still works
with all
> those DFPs for which we obtain the EDID via the BIOS
> image in RAM...
I can't break something that doesn't exist in the 2.6
framebuffer code.
> Again, adding that fixed the driver for a _lot_ of
> users, so I'd like not to change that until we have
a
> replacement with real i2c accesses...
I am not changing this, it doesn't exist in 2.6.
> (Note: The DFP code may not be in the current 2.6
> version of the driver, it's only in 2.4 afaik, it's
part of
> some radeonfb updates I have pending).
>
> What we could do is, if we can figure out which is
> the primary card, do the RAM search on it only, and
> use ROM for others, but then, that leads me to
another
> question regarding multiple cards: Are they all
POSTed
> (initialized) by the BIOS? I though x86 BIOSes only
> initialized the first card ?
Only the primary card is POSTed and copied to low RAM.
Note that it is possible to mix vendors and the copy
in RAM may not even belong to a Rage/Radeon.
The correct solution is to read the I2C data like
XFree does and not to rely on the copy in the BIOS.
The Redhat installer also gets it data from I2C.
Reading the copy in low RAM doesn't work if the user
switches monitors either. Besides, how are you sure
the copy in low RAM belongs to your adapter?
Another way to get EDID data is to use an INT10 from a
user level program. This is compilcated because you
need to use the real mode emulator and change the
INT10 vectors for the various cards.
When PCI/X gets here next year this problem will be
much worse since it will be trivial to install
multiple video cards.
I'm all for using EDID data, it just needs to
retrieved in the correct manner.
> If they aren't, then there's no point in that fix
anyway
> since neither aty128fb nor radeonfb will work on a
card
> that wasn't POSTed by the BIOS.
I have a small program that will POST a secondary
card. Starting XFree on them as a primary or secondary
will also POST them.
I have been annoying ATI (without success) for months
trying to get code out of them to do this so that I
can add it directly to the fb driver.
> Also, looking quickly at the patches:
>
> - r128: why do you change the chip generations this
> way ? Is
> there any _use_ of that change (splitting
> PCI/nonPCI) or it's
> just that you prefer it like that ? I'd rather leave
> it the way
> it was, and/or eventually add some bit flags
> indicating if it's
> PCI and/or AGP...
>
The change was made to select a string for the
appropriate chip generation in the sign-on message.
The driver has to know PCI or AGP. The PCI IDs are
used to tell.
> - r128 & radeon : your change of the setup
> functions to turn them into module params,
> I'm not sure I like them at least not at this
> point. This will change the syntax on the kernel
> command line at least, which I'd rather not do
> at this stage
2.6 has provided module functions to standardize the
module parameter syntax.
The only chage is under the old scheme you could say:
modprobe radeonfb 1024x768
now you have to say:
modprobe radeonfb mode=1024x768
Is there a way to do unnamed params with the new
functions, or was that purposely left out?
I have posted several times indicating that I believe
setting the mode from the load command to be
non-functional in 2.6 anyway and asking for an
explaination of how it is suppose to work.
The current code, which I did not change, only uses
the mode data to set the mode variables and not to
actually set the mode. It I modify the driver to
actually set the mode fbconsole breaks.
> - AFAIK, Paul Mackerras <paulus@samba.org> is the
> current aty128fb
> maintainer, can you pass the changes through him ?
I sent him a copy. Doesn't he read the fbdev list?
=====
Jon Smirl
jonsmirl@yahoo.com
__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com
-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Dri-devel] Re: Rage128/Radeon framebuffer updates
2003-08-16 16:19 ` [Dri-devel] " Jon Smirl
@ 2003-08-16 16:35 ` Benjamin Herrenschmidt
0 siblings, 0 replies; 4+ messages in thread
From: Benjamin Herrenschmidt @ 2003-08-16 16:35 UTC (permalink / raw)
To: Jon Smirl; +Cc: fb-devel, dri-devel, Paul Mackerras
On Sat, 2003-08-16 at 18:19, Jon Smirl wrote:
> --- Benjamin Herrenschmidt <benh@kernel.crashing.org>
> wrote:
>
> The big picture here is that aty128fb and radeonfb
> have not had their PCI ID tables updated since 2.6 was
> started. Any hardware made since then can't use the
> framebuffer drivers.
Yup, and that part of your patch is great. I have more chips
in the version in my tree than in official 2.6, but your list
is definitely more complete.
One reason my version isn't merged upstream yet is that it relies
on some other bits (mostly power management) that James didn't merge
yet, but I could strip them out.
> > So you still go to ROM unconditionally... Well, we
> > should get that tested, I don't have the offending
> x86
> > hardware, but I'd like to know if that still works
> with all
> > those DFPs for which we obtain the EDID via the BIOS
> > image in RAM...
>
> I can't break something that doesn't exist in the 2.6
> framebuffer code.
It's in the 2.4 one and I was about to push it to 2.6. It is
necessary for a bunch of cases
> > Again, adding that fixed the driver for a _lot_ of
> > users, so I'd like not to change that until we have
> a
> > replacement with real i2c accesses...
>
> I am not changing this, it doesn't exist in 2.6.
As I told you, it is in 2.4. The 2.6 codebase isn't up to date,
but that's not a reason not to fix that, the DFP code is necessary
for a lot of machines.
> Only the primary card is POSTed and copied to low RAM.
> Note that it is possible to mix vendors and the copy
> in RAM may not even belong to a Rage/Radeon.
This is a real issue yes.
> The correct solution is to read the I2C data like
> XFree does and not to rely on the copy in the BIOS.
Yes.
> The Redhat installer also gets it data from I2C.
> Reading the copy in low RAM doesn't work if the user
> switches monitors either. Besides, how are you sure
> the copy in low RAM belongs to your adapter?
>
> Another way to get EDID data is to use an INT10 from a
> user level program. This is compilcated because you
> need to use the real mode emulator and change the
> INT10 vectors for the various cards.
Int10 will not work on all archs
> When PCI/X gets here next year this problem will be
> much worse since it will be trivial to install
> multiple video cards.
>
> I'm all for using EDID data, it just needs to
> retrieved in the correct manner.
Yes, but the current 2.4 DFP tweak is not that bad, few
people have more than one board, I'm also curious how does
XFree since that EDID thing was copied from it, I suppose
it gives me a c00000 RAM image that isn't the real one but
comes from what it's own call to that card's BIOS POST
generated...
> > If they aren't, then there's no point in that fix
> anyway
> > since neither aty128fb nor radeonfb will work on a
> card
> > that wasn't POSTed by the BIOS.
>
> I have a small program that will POST a secondary
> card. Starting XFree on them as a primary or secondary
> will also POST them.
Provided they have an x86 BIOS...
> I have been annoying ATI (without success) for months
> trying to get code out of them to do this so that I
> can add it directly to the fb driver.
They'll not give you that as the POST code is basically board
specific (depends on how things are wired on a given board) and
only the version of BIOS on that board knows that...
> The change was made to select a string for the
> appropriate chip generation in the sign-on message.
>
> The driver has to know PCI or AGP. The PCI IDs are
> used to tell.
>
> > - r128 & radeon : your change of the setup
> > functions to turn them into module params,
> > I'm not sure I like them at least not at this
> > point. This will change the syntax on the kernel
> > command line at least, which I'd rather not do
> > at this stage
>
> 2.6 has provided module functions to standardize the
> module parameter syntax.
>
> The only chage is under the old scheme you could say:
> modprobe radeonfb 1024x768
> now you have to say:
> modprobe radeonfb mode=1024x768
> Is there a way to do unnamed params with the new
> functions, or was that purposely left out?
What about kernel command line ? This is used a lot for
fbdev drivers
> I have posted several times indicating that I believe
> setting the mode from the load command to be
> non-functional in 2.6 anyway and asking for an
> explaination of how it is suppose to work.
>
> The current code, which I did not change, only uses
> the mode data to set the mode variables and not to
> actually set the mode. It I modify the driver to
> actually set the mode fbconsole breaks.
The mode is set by takeover_console on boot, though I didn't
try loading radeonfb as a module, that may be broken.
> > - AFAIK, Paul Mackerras <paulus@samba.org> is the
> > current aty128fb
> > maintainer, can you pass the changes through him ?
>
> I sent him a copy. Doesn't he read the fbdev list?
I don't know, it's always best to CC at least a maintainer. People
like Paul or I have way too many mails & lists to follow... at least
when I'm on the To or CC list, some filters highlight the message for
me.
Also, while it's not in the comments yet, I took over maintainership
of radeonfb in 2.4. I'm not 100% sure I want to be the maintainer for
2.6 as well (though I did the current port from an older 2.4 version),
let me know if you want to take that role.
Ben.
-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2003-08-16 16:35 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-08-16 1:24 Rage128/Radeon framebuffer updates Jon Smirl
2003-08-16 10:04 ` Benjamin Herrenschmidt
2003-08-16 16:19 ` [Dri-devel] " Jon Smirl
2003-08-16 16:35 ` Benjamin Herrenschmidt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).