]> git.hungrycats.org Git - linux/commitdiff
[PATCH] ide: sis5513 fix for SiS962 chipset
authorBartlomiej Zolnierkiewicz <bzolnier@elka.pw.edu.pl>
Sun, 12 Sep 2004 06:56:20 +0000 (23:56 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Sun, 12 Sep 2004 06:56:20 +0000 (23:56 -0700)
From: Thomas Gleixner <tglx@linutronix.de>

1. If the fake 5513 id bit is not set by the BIOS we must have the 5518
id in the device table.

2. If the register remapping is not set by the BIOS then the enable bit
check in ide_pci_setup_ports will fail. It's safe to switch to the
remapping mode here. Keeping the not remapped mode would need quite big
changes AFAICS.

Forward ported to 2.6 by me.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@elka.pw.edu.pl>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/ide/pci/sis5513.c
drivers/pci/pci.ids

index 9ca2b1fb74ea99bd37eabba353666ac812993d51..37a7d88d66b991fdd124fe568a43982d797b289e 100644 (file)
@@ -788,6 +788,15 @@ static unsigned int __init init_chipset_sis5513 (struct pci_dev *dev, const char
                        if (trueid == 0x5518) {
                                printk(KERN_INFO "SIS5513: SiS 962/963 MuTIOL IDE UDMA133 controller\n");
                                chipset_family = ATA_133;
+
+                               /* Check for 5513 compability mapping
+                                * We must use this, else the port enabled code will fail,
+                                * as it expects the enablebits at 0x4a.
+                                */
+                               if ((idemisc & 0x40000000) == 0) {
+                                       pci_write_config_dword(dev, 0x54, idemisc | 0x40000000);
+                                       printk(KERN_INFO "SIS5513: Switching to 5513 register mapping\n");
+                               }
                        }
        }
 
@@ -945,24 +954,31 @@ static void __init init_hwif_sis5513 (ide_hwif_t *hwif)
        return;
 }
 
-static ide_pci_device_t sis5513_chipset __devinitdata = {
-       .name           = "SIS5513",
-       .init_chipset   = init_chipset_sis5513,
-       .init_hwif      = init_hwif_sis5513,
-       .channels       = 2,
-       .autodma        = NOAUTODMA,
-       .enablebits     = {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}},
-       .bootable       = ON_BOARD,
+#define DECLARE_SIS_DEV(name_str)                                      \
+       {                                                               \
+               .name           = name_str,                             \
+               .init_chipset   = init_chipset_sis5513,                 \
+               .init_hwif      = init_hwif_sis5513,                    \
+               .channels       = 2,                                    \
+               .autodma        = NOAUTODMA,                            \
+               .enablebits     = {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}}, \
+               .bootable       = ON_BOARD,                             \
+       }
+
+static ide_pci_device_t sis5513_chipsets[] __devinitdata = {
+       /* 0 */ DECLARE_SIS_DEV("SIS5513"),
+       /* 1 */ DECLARE_SIS_DEV("SIS5518")
 };
 
 static int __devinit sis5513_init_one(struct pci_dev *dev, const struct pci_device_id *id)
 {
-       ide_setup_pci_device(dev, &sis5513_chipset);
+       ide_setup_pci_device(dev, &sis5513_chipsets[id->driver_data]);
        return 0;
 }
 
 static struct pci_device_id sis5513_pci_tbl[] = {
        { PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_5513, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
+       { PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_5518, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1},
        { 0, },
 };
 MODULE_DEVICE_TABLE(pci, sis5513_pci_tbl);
index b08a1f93865c23d7b53b39e22886b983ef6973e6..9670ed4047d95197085f64dd0ce28e58229be5f3 100644 (file)
                1039 5513  SiS5513 EIDE Controller (A,B step)
                1043 8035  CUSI-FX motherboard
        5517  5517
+       5518  5518 [IDE]
        5571  5571
        5581  5581 Pentium Chipset
        5582  5582