coreboot-kgpe-d16/src/devices
Carl-Daniel Hailfinger 00003ae712 If no pci access method has been set for the device tree so far (e.g.
during early coreboot_ram), pci_{read,write}_config{8,16,32} will die().
This patch changes pci_{read,write}_config{8,16,32} to use the existing
PCI access method autodetection infrastructure instead of die()ing.

Until r4340, any usage of pci_{read,write}_config{8,16,32} in
coreboot_ram before the device tree was set up resulted in either a
silent hang or a NULL pointer dereference. I changed the code in r4340
to die() properly with a loud error message. That still was not perfect,
but at least it allowed people to see why their new ports died.
Still, die() is not something developers like to see, and thus a patch
to automatically pick a sensible default instead of dying was created.
Of course, handling PCI access method selection automatically for
fallback purposes has certain limitations before the device tree is set
up. We only check if conf1 works and use conf2 as fallback. No further
tests are done.

This patch enables cleanups and readability improvements in early
coreboot_ram code:
Without this patch:
dword = pci_cf8_conf1.read32(&pbus, sm_dev->bus->secondary,
        sm_dev->path.pci.devfn, 0x64);
With this patch:
dword = pci_read_config32(sm_dev, 0x64);

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Peter Stuge <peter@stuge.se>


git-svn-id: svn://svn.coreboot.org/coreboot/trunk@4646 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2009-09-22 00:09:41 +00:00
..
agp_device.c coreboot-v2: drop this ugly historic union name in v2 that was dropped in v3 2009-02-28 20:10:20 +00:00
cardbus_device.c Move the v3 resource allocator to v2. 2009-07-02 18:56:24 +00:00
Config.lb Some changes required to get yabel working on v2 (and they generally make 2009-03-01 10:16:01 +00:00
device.c Separate CONFIG_VGA_CONSOLE from CONFIG_VGA_BRIDGE_SETUP. 2009-09-17 16:54:46 +00:00
device_util.c Move the v3 resource allocator to v2. 2009-07-02 18:56:24 +00:00
hypertransport.c This patch unifies the use of config options in v2 to all start with CONFIG_ 2009-06-30 15:17:49 +00:00
Kconfig Separate CONFIG_VGA_CONSOLE from CONFIG_VGA_BRIDGE_SETUP. 2009-09-17 16:54:46 +00:00
Makefile.inc Add Kconfig support for PCI option ROMS. 2009-08-28 14:36:12 +00:00
pci_device.c Trivial spelling corrections. 2009-08-21 14:59:14 +00:00
pci_ops.c If no pci access method has been set for the device tree so far (e.g. 2009-09-22 00:09:41 +00:00
pci_rom.c Fix a little white space issue. Also, don't copy the rom image 2009-06-09 14:44:37 +00:00
pciexp_device.c coreboot-v2: drop this ugly historic union name in v2 that was dropped in v3 2009-02-28 20:10:20 +00:00
pcix_device.c coreboot-v2: drop this ugly historic union name in v2 that was dropped in v3 2009-02-28 20:10:20 +00:00
pnp_device.c coreboot-v2: drop this ugly historic union name in v2 that was dropped in v3 2009-02-28 20:10:20 +00:00
root_device.c Move the v3 resource allocator to v2. 2009-07-02 18:56:24 +00:00
smbus_ops.c die() does never return. Annotate it as such. 2009-06-05 11:41:51 +00:00