summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOliver O'Halloran <oohall@gmail.com>2019-03-07 13:40:08 +1100
committerStewart Smith <stewart@linux.ibm.com>2019-04-17 15:56:34 +1000
commitb507209d22669ab0a2ad49822d11b2cbb08c49f1 (patch)
tree4c7bf286d5ed1b735650134bd8b8a934692df9d6
parent7f22e25c2b971d80d3d15f1377e3cfc3407ee013 (diff)
downloadblackbird-skiboot-b507209d22669ab0a2ad49822d11b2cbb08c49f1.tar.gz
blackbird-skiboot-b507209d22669ab0a2ad49822d11b2cbb08c49f1.zip
hw/phb4: Squash the IO bridge window
The PCI-PCI bridge spec says that bridges that implement an IO window should hardcode the IO base and limit registers to zero. Unfortunately, these registers only define the upper bits of the IO window and the low bits are assumed to be 0 for the base and 1 for the limit address. As a result, setting both to zero can be mis-interpreted as a 4K IO window. This patch fixes the problem the same way PHB3 does. It sets the IO base and limit values to 0xf000 and 0x1000 respectively which most software interprets as a disabled window. lspci before patch: 0000:00:00.0 PCI bridge: IBM Device 04c1 (prog-if 00 [Normal decode]) I/O behind bridge: 00000000-00000fff lspci after patch: 0000:00:00.0 PCI bridge: IBM Device 04c1 (prog-if 00 [Normal decode]) I/O behind bridge: None Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
-rw-r--r--hw/phb4.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/hw/phb4.c b/hw/phb4.c
index 8f75a956..52aedc89 100644
--- a/hw/phb4.c
+++ b/hw/phb4.c
@@ -318,6 +318,14 @@ static int64_t phb4_rc_read(struct phb4 *p, uint32_t offset, uint8_t sz,
oval = in_le32(p->regs + PHB_RC_CONFIG_BASE + reg);
}
}
+
+ /* Apply any post-read fixups */
+ switch (reg) {
+ case PCI_CFG_IO_BASE:
+ oval |= 0x01f1; /* Set IO base < limit to disable the window */
+ break;
+ }
+
switch (sz) {
case 1:
offset &= 3;
OpenPOWER on IntegriCloud