diff options
author | Peter Stuge <peter@stuge.se> | 2011-06-04 15:40:12 +0000 |
---|---|---|
committer | Peter Stuge <peter@stuge.se> | 2011-06-04 15:40:12 +0000 |
commit | e1898b5fa1f007069c25be53a8369429135fa7e9 (patch) | |
tree | 4b31e211079c17999dc5534ebcd08149af0dd791 /src/southbridge/via/vt8237r/bootblock.c | |
parent | 471f103e530b97c1125acdab259043dd7f252fe9 (diff) | |
download | coreboot-e1898b5fa1f007069c25be53a8369429135fa7e9.tar.xz |
vt8237r: Simplify bootblock init to work around nested if() romcc problem
During the hackathon in Prague we discovered that romcc has a problem
compiling the previous nested if() statements correctly. This patch
makes the code a little simpler, and indeed works around the romcc issue.
Signed-off-by: Peter Stuge <peter@stuge.se>
Acked-by: Peter Stuge <peter@stuge.se>
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@6620 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'src/southbridge/via/vt8237r/bootblock.c')
-rw-r--r-- | src/southbridge/via/vt8237r/bootblock.c | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/src/southbridge/via/vt8237r/bootblock.c b/src/southbridge/via/vt8237r/bootblock.c index b231f844c9..8df37aad7c 100644 --- a/src/southbridge/via/vt8237r/bootblock.c +++ b/src/southbridge/via/vt8237r/bootblock.c @@ -33,20 +33,23 @@ static void bootblock_southbridge_init(void) dev = pci_locate_device_on_bus(PCI_ID(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_VT8237R_LPC), 0); - if (dev == PCI_DEV_INVALID) { - /* Power management controller */ - dev = pci_locate_device_on_bus(PCI_ID(PCI_VENDOR_ID_VIA, - PCI_DEVICE_ID_VIA_VT8237S_LPC), 0); + if (dev != PCI_DEV_INVALID) + goto found; - if (dev == PCI_DEV_INVALID) { - /* Power management controller */ - dev = pci_locate_device_on_bus(PCI_ID(PCI_VENDOR_ID_VIA, - PCI_DEVICE_ID_VIA_VT8237A_LPC), 0); + /* Power management controller */ + dev = pci_locate_device_on_bus(PCI_ID(PCI_VENDOR_ID_VIA, + PCI_DEVICE_ID_VIA_VT8237S_LPC), 0); + + if (dev != PCI_DEV_INVALID) + goto found; + + /* Power management controller */ + dev = pci_locate_device_on_bus(PCI_ID(PCI_VENDOR_ID_VIA, + PCI_DEVICE_ID_VIA_VT8237A_LPC), 0); - if (dev == PCI_DEV_INVALID) - return; - } - } + if (dev == PCI_DEV_INVALID) + return; +found: pci_write_config8(dev, 0x41, 0x7f); } |