better support enable_dev for amd8111
authorYinghai Lu <yinghailu@gmail.com>
Thu, 21 Oct 2004 01:52:21 +0000 (01:52 +0000)
committerYinghai Lu <yinghailu@gmail.com>
Thu, 21 Oct 2004 01:52:21 +0000 (01:52 +0000)
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@1695 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1

src/southbridge/amd/amd8111/Config.lb
src/southbridge/amd/amd8111/amd8111.c
src/southbridge/amd/amd8111/amd8111_ac97.c
src/southbridge/amd/amd8111/amd8111_acpi.c
src/southbridge/amd/amd8111/amd8111_lpc.c
src/southbridge/amd/amd8111/amd8111_nic.c
src/southbridge/amd/amd8111/amd8111_usb.c
src/southbridge/amd/amd8111/amd8111_usb2.c

index 8575c2b1ebb90b9dda3eb0274b80a4813e402876..584b15ecd4eaf7ef54b3db24794e0e92e7aa2704 100644 (file)
@@ -5,7 +5,7 @@ driver amd8111_lpc.o
 driver amd8111_ide.o
 driver amd8111_acpi.o
 #driver amd8111_usb2.o
-driver amd8111_ac97.o
-driver amd8111_nic.o
+#driver amd8111_ac97.o
+#driver amd8111_nic.o
 driver amd8111_pci.o
 object amd8111_reset.o
index afb02f1fecd0d8215ed9c98887559418e0738dc3..a9b132cdafcdd660e25f5532a35d4ca2b2727559 100644 (file)
@@ -9,9 +9,11 @@ void amd8111_enable(device_t dev)
        device_t lpc_dev;
        device_t bus_dev;
        unsigned index;
+       uint32_t dword;
        uint16_t reg_old, reg;
        uint8_t byte;
 
+
        /* See if we are on the behind the amd8111 pci bridge */
        bus_dev = dev->bus->dev;
        if ((bus_dev->vendor == PCI_VENDOR_ID_AMD) && 
@@ -39,8 +41,13 @@ void amd8111_enable(device_t dev)
                }
        }
 
-        if ((dev->vendor == PCI_VENDOR_ID_AMD) &&
-            (dev->device == PCI_DEVICE_ID_AMD_8111_USB2)) {
+        /* Now read the vendor and device id */
+        dword= pci_read_config32(dev, PCI_VENDOR_ID);
+#if 0
+       printk_debug(" %s dev->vendor= %04x, dev->device= %04x, id = %08x\n", dev_path(dev), dev->vendor, dev->device, dword);
+#endif
+       
+        if (dword == (PCI_VENDOR_ID_AMD | (PCI_DEVICE_ID_AMD_8111_USB2 << 16)))  {
                if(!dev->enabled) {
                        byte = pci_read_config8(lpc_dev, 0x47);
                        byte |= (1<<7);
index 63a0e1264e922c4bd04a0fc4d04145ffc2df8701..36ed41feed80f18117c4a6ab8991b99987f22c97 100644 (file)
@@ -13,7 +13,7 @@ static struct device_operations ac97audio_ops  = {
        .read_resources   = pci_dev_read_resources,
        .set_resources    = pci_dev_set_resources,
        .enable_resources = pci_dev_enable_resources,
-       .enable           = amd8111_enable,
+//     .enable           = amd8111_enable,
        .init             = 0,
        .scan_bus         = 0,
 };
@@ -29,7 +29,7 @@ static struct device_operations ac97modem_ops  = {
        .read_resources   = pci_dev_read_resources,
        .set_resources    = pci_dev_set_resources,
        .enable_resources = pci_dev_enable_resources,
-       .enable           = amd8111_enable,
+//     .enable           = amd8111_enable,
        .init             = 0,
        .scan_bus         = 0,
 };
index e3b7038e46bd19666bbf94add163e62ab82a0f78..557e54f858e43f3ca1da23cd3bf6f6b46f441fc5 100644 (file)
@@ -104,7 +104,7 @@ static struct device_operations acpi_ops  = {
        .enable_resources = pci_dev_enable_resources,
        .init             = acpi_init,
        .scan_bus         = 0,
-       .enable           = amd8111_enable,
+//     .enable           = amd8111_enable,
 };
 
 static struct pci_driver acpi_driver __pci_driver = {
index ff767c7cc42bf98cb57cb2d62ae5b7772929d330..6441c86efe9e4d9034f3d204632b71012738ef13 100644 (file)
@@ -194,7 +194,7 @@ static struct device_operations lpc_ops  = {
        .enable_resources = pci_dev_enable_resources,
        .init             = lpc_init,
        .scan_bus         = scan_static_bus,
-       .enable           = amd8111_enable,
+//     .enable           = amd8111_enable,
 };
 
 static struct pci_driver lpc_driver __pci_driver = {
index b3792086a565ac8c9544ed849f077983125decd6..512b2683c52e45631053023fcc6b860923d4f994 100644 (file)
@@ -13,7 +13,7 @@ static struct device_operations nic_ops  = {
        .read_resources   = pci_dev_read_resources,
        .set_resources    = pci_dev_set_resources,
        .enable_resources = pci_dev_enable_resources,
-       .enable           = amd8111_enable,
+//     .enable           = amd8111_enable,
        .init             = 0,
        .scan_bus         = 0,
 };
index 669b828e551e55ff29bd0b24c0944953dd10591f..680b6102673cf6f160564d4d719ed38981376ea3 100644 (file)
@@ -7,17 +7,19 @@
 
 static void usb_init(struct device *dev)
 {
-#if 0
        uint32_t cmd;
 
+#if 0
        printk_debug("USB: Setting up controller.. ");
        cmd = pci_read_config32(dev, PCI_COMMAND);
        pci_write_config32(dev, PCI_COMMAND, 
                cmd | PCI_COMMAND_IO | PCI_COMMAND_MEMORY | 
                PCI_COMMAND_MASTER | PCI_COMMAND_INVALIDATE);
 
+
        printk_debug("done.\n");
 #endif
+
 }
 
 static struct device_operations usb_ops  = {
@@ -26,7 +28,7 @@ static struct device_operations usb_ops  = {
        .enable_resources = pci_dev_enable_resources,
        .init             = usb_init,
        .scan_bus         = 0,
-       .enable           = amd8111_enable,
+//     .enable           = amd8111_enable,
 };
 
 static struct pci_driver usb_driver __pci_driver = {
index 12a9cfb010ee68110fc6893b0cc1e462be9ef344..d3393ae4d301a551ccf2ed79963c528dbba8a423 100644 (file)
@@ -9,9 +9,9 @@
 
 static void usb2_init(struct device *dev)
 {
-#if 0
        uint32_t cmd;
 
+#if 0
        printk_debug("USB: Setting up controller.. ");
        cmd = pci_read_config32(dev, PCI_COMMAND);
        pci_write_config32(dev, PCI_COMMAND, 
@@ -29,7 +29,7 @@ static struct device_operations usb2_ops  = {
        .enable_resources = pci_dev_enable_resources,
        .init             = usb2_init,
        .scan_bus         = 0,
-       .enable           = amd8111_enable,
+//     .enable           = amd8111_enable,
 };
 
 static struct pci_driver usb2_driver __pci_driver = {