diff options
author | Stefan Reinauer <stepan@coresystems.de> | 2008-08-07 19:09:17 +0000 |
---|---|---|
committer | Stefan Reinauer <stepan@openbios.org> | 2008-08-07 19:09:17 +0000 |
commit | 88ad6b0f919bcb3b86e0a91c903be26934097125 (patch) | |
tree | e07d2c8389c5e3d7881aad0088c95fccebe0f8e4 /payloads/coreinfo | |
parent | 85c7aec73ea37136a158fd7fd98249ddedaffba5 (diff) |
Add a full set of pci access functions.
Signed-off-by: Stefan Reinauer <stepan@coresystems.de>
Acked-by: Jordan Crouse <jordan.crouse@amd.com>
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3479 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'payloads/coreinfo')
-rw-r--r-- | payloads/coreinfo/pci_module.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/payloads/coreinfo/pci_module.c b/payloads/coreinfo/pci_module.c index 3e05b8bd54..b2cd8a01f5 100644 --- a/payloads/coreinfo/pci_module.c +++ b/payloads/coreinfo/pci_module.c @@ -94,7 +94,8 @@ static void show_config_space(WINDOW *win, int row, int col, int index) devfn = devices[index].device & 0xff; for (i = 0; i < 64; i += 4) - pci_read_dword(bus, devfn, i, ((unsigned int *)&cspace[i])); + cspace[i] = pci_read_config32(PCI_DEV(bus, PCI_SLOT(devfn), + PCI_FUNC(devfn)), i); for (y = 0; y < 4; y++) { for (x = 0; x < 16; x++) @@ -180,7 +181,10 @@ static void pci_scan_bus(int bus) for (devfn = 0; devfn < 0x100;) { for (func = 0; func < 8; func++, devfn++) { - pci_read_dword(bus, devfn, REG_VENDOR_ID, &val); + pcidev_t dev = PCI_DEV(bus, PCI_SLOT(devfn), + PCI_FUNC(devfn)); + + val = pci_read_config32(dev, REG_VENDOR_ID); /* Nobody home. */ if (val == 0xffffffff || val == 0x00000000 || @@ -197,14 +201,13 @@ static void pci_scan_bus(int bus) devices[devices_index++].id = val; /* If this is a bridge, then follow it. */ - pci_read_byte(bus, devfn, REG_HEADER_TYPE, &hdr); + hdr = pci_read_config8(dev, REG_HEADER_TYPE); hdr &= 0x7f; if (hdr == HEADER_TYPE_BRIDGE || hdr == HEADER_TYPE_CARDBUS) { unsigned int busses; - pci_read_dword(bus, devfn, REG_PRIMARY_BUS, - &busses); + busses = pci_read_config32(dev, REG_PRIMARY_BUS); pci_scan_bus((busses >> 8) & 0xff); |