diff options
author | Isaku Yamahata <yamahata@valinux.co.jp> | 2010-06-22 17:57:51 +0900 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2010-07-04 08:52:44 -0400 |
commit | 5d0de15ad76a07042daa368b4731d9cb87b07b24 (patch) | |
tree | 426e28bd790aa6b453b70dbb1b672a598b6ed933 | |
parent | a65821dbbb7a01d1b48cab890df9561f9d178c83 (diff) | |
download | seabios-5d0de15ad76a07042daa368b4731d9cb87b07b24.tar.gz |
seabios: pciinit: make bar offset calculation pci bridge aware.
This patch makes pci bar offset calculation pci bridge aware.
The offset of pci bridge rom is different from normal device.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
-rw-r--r-- | src/pciinit.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/pciinit.c b/src/pciinit.c index 9109739e..23b79bcb 100644 --- a/src/pciinit.c +++ b/src/pciinit.c @@ -27,7 +27,11 @@ static u32 pci_bar(u16 bdf, int region_num) if (region_num != PCI_ROM_SLOT) { return PCI_BASE_ADDRESS_0 + region_num * 4; } - return PCI_ROM_ADDRESS; + +#define PCI_HEADER_TYPE_MULTI_FUNCTION 0x80 + u8 type = pci_config_readb(bdf, PCI_HEADER_TYPE); + type &= ~PCI_HEADER_TYPE_MULTI_FUNCTION; + return type == PCI_HEADER_TYPE_BRIDGE ? PCI_ROM_ADDRESS1 : PCI_ROM_ADDRESS; } static void pci_set_io_region_addr(u16 bdf, int region_num, u32 addr) |