better support enable_dev for amd8111

git-svn-id: svn://svn.coreboot.org/coreboot/trunk@1695 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
This commit is contained in:
Yinghai Lu 2004-10-21 01:52:21 +00:00
parent 6014983bab
commit f19e2c766a
8 changed files with 22 additions and 13 deletions

View File

@ -5,7 +5,7 @@ driver amd8111_lpc.o
driver amd8111_ide.o driver amd8111_ide.o
driver amd8111_acpi.o driver amd8111_acpi.o
#driver amd8111_usb2.o #driver amd8111_usb2.o
driver amd8111_ac97.o #driver amd8111_ac97.o
driver amd8111_nic.o #driver amd8111_nic.o
driver amd8111_pci.o driver amd8111_pci.o
object amd8111_reset.o object amd8111_reset.o

View File

@ -9,9 +9,11 @@ void amd8111_enable(device_t dev)
device_t lpc_dev; device_t lpc_dev;
device_t bus_dev; device_t bus_dev;
unsigned index; unsigned index;
uint32_t dword;
uint16_t reg_old, reg; uint16_t reg_old, reg;
uint8_t byte; uint8_t byte;
/* See if we are on the behind the amd8111 pci bridge */ /* See if we are on the behind the amd8111 pci bridge */
bus_dev = dev->bus->dev; bus_dev = dev->bus->dev;
if ((bus_dev->vendor == PCI_VENDOR_ID_AMD) && 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) && /* Now read the vendor and device id */
(dev->device == PCI_DEVICE_ID_AMD_8111_USB2)) { 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) { if(!dev->enabled) {
byte = pci_read_config8(lpc_dev, 0x47); byte = pci_read_config8(lpc_dev, 0x47);
byte |= (1<<7); byte |= (1<<7);

View File

@ -13,7 +13,7 @@ static struct device_operations ac97audio_ops = {
.read_resources = pci_dev_read_resources, .read_resources = pci_dev_read_resources,
.set_resources = pci_dev_set_resources, .set_resources = pci_dev_set_resources,
.enable_resources = pci_dev_enable_resources, .enable_resources = pci_dev_enable_resources,
.enable = amd8111_enable, // .enable = amd8111_enable,
.init = 0, .init = 0,
.scan_bus = 0, .scan_bus = 0,
}; };
@ -29,7 +29,7 @@ static struct device_operations ac97modem_ops = {
.read_resources = pci_dev_read_resources, .read_resources = pci_dev_read_resources,
.set_resources = pci_dev_set_resources, .set_resources = pci_dev_set_resources,
.enable_resources = pci_dev_enable_resources, .enable_resources = pci_dev_enable_resources,
.enable = amd8111_enable, // .enable = amd8111_enable,
.init = 0, .init = 0,
.scan_bus = 0, .scan_bus = 0,
}; };

View File

@ -104,7 +104,7 @@ static struct device_operations acpi_ops = {
.enable_resources = pci_dev_enable_resources, .enable_resources = pci_dev_enable_resources,
.init = acpi_init, .init = acpi_init,
.scan_bus = 0, .scan_bus = 0,
.enable = amd8111_enable, // .enable = amd8111_enable,
}; };
static struct pci_driver acpi_driver __pci_driver = { static struct pci_driver acpi_driver __pci_driver = {

View File

@ -194,7 +194,7 @@ static struct device_operations lpc_ops = {
.enable_resources = pci_dev_enable_resources, .enable_resources = pci_dev_enable_resources,
.init = lpc_init, .init = lpc_init,
.scan_bus = scan_static_bus, .scan_bus = scan_static_bus,
.enable = amd8111_enable, // .enable = amd8111_enable,
}; };
static struct pci_driver lpc_driver __pci_driver = { static struct pci_driver lpc_driver __pci_driver = {

View File

@ -13,7 +13,7 @@ static struct device_operations nic_ops = {
.read_resources = pci_dev_read_resources, .read_resources = pci_dev_read_resources,
.set_resources = pci_dev_set_resources, .set_resources = pci_dev_set_resources,
.enable_resources = pci_dev_enable_resources, .enable_resources = pci_dev_enable_resources,
.enable = amd8111_enable, // .enable = amd8111_enable,
.init = 0, .init = 0,
.scan_bus = 0, .scan_bus = 0,
}; };

View File

@ -7,17 +7,19 @@
static void usb_init(struct device *dev) static void usb_init(struct device *dev)
{ {
#if 0
uint32_t cmd; uint32_t cmd;
#if 0
printk_debug("USB: Setting up controller.. "); printk_debug("USB: Setting up controller.. ");
cmd = pci_read_config32(dev, PCI_COMMAND); cmd = pci_read_config32(dev, PCI_COMMAND);
pci_write_config32(dev, PCI_COMMAND, pci_write_config32(dev, PCI_COMMAND,
cmd | PCI_COMMAND_IO | PCI_COMMAND_MEMORY | cmd | PCI_COMMAND_IO | PCI_COMMAND_MEMORY |
PCI_COMMAND_MASTER | PCI_COMMAND_INVALIDATE); PCI_COMMAND_MASTER | PCI_COMMAND_INVALIDATE);
printk_debug("done.\n"); printk_debug("done.\n");
#endif #endif
} }
static struct device_operations usb_ops = { static struct device_operations usb_ops = {
@ -26,7 +28,7 @@ static struct device_operations usb_ops = {
.enable_resources = pci_dev_enable_resources, .enable_resources = pci_dev_enable_resources,
.init = usb_init, .init = usb_init,
.scan_bus = 0, .scan_bus = 0,
.enable = amd8111_enable, // .enable = amd8111_enable,
}; };
static struct pci_driver usb_driver __pci_driver = { static struct pci_driver usb_driver __pci_driver = {

View File

@ -9,9 +9,9 @@
static void usb2_init(struct device *dev) static void usb2_init(struct device *dev)
{ {
#if 0
uint32_t cmd; uint32_t cmd;
#if 0
printk_debug("USB: Setting up controller.. "); printk_debug("USB: Setting up controller.. ");
cmd = pci_read_config32(dev, PCI_COMMAND); cmd = pci_read_config32(dev, PCI_COMMAND);
pci_write_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, .enable_resources = pci_dev_enable_resources,
.init = usb2_init, .init = usb2_init,
.scan_bus = 0, .scan_bus = 0,
.enable = amd8111_enable, // .enable = amd8111_enable,
}; };
static struct pci_driver usb2_driver __pci_driver = { static struct pci_driver usb2_driver __pci_driver = {