aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorOliver O'Halloran <oohall@gmail.com>2019-05-30 14:36:42 +1000
committerStewart Smith <stewart@linux.ibm.com>2019-06-03 10:28:57 +1000
commit771497098efded8d3a2c0688bab1c1d48d093443 (patch)
tree5023c6ee61dcf563be2656ecbdc70a902a58d977 /hw
parent02a683bf09d94757a72eec00e602c5609aa8d754 (diff)
downloadskiboot-771497098efded8d3a2c0688bab1c1d48d093443.zip
skiboot-771497098efded8d3a2c0688bab1c1d48d093443.tar.gz
skiboot-771497098efded8d3a2c0688bab1c1d48d093443.tar.bz2
hw/phb4: Use read/write_reg in assert_perst
While the PHB is fenced we can't use the MMIO interface to access PHB registers. While processing a complete reset we inject a PHB fence to isolate the PHB from the rest of the system because the PHB won't respond to MMIOs from the rest of the system while being reset. We assert PERST after the fence has been erected which requires us to use the XSCOM indirect interface to access the PHB registers rather than the MMIO interface. Previously we did that when asserting PERST in the CRESET path. However in b8b4c79d4419 ("hw/phb4: Factor out PERST control"). This was re-written to use the raw in_be64() accessor. This means that CRESET would not be asserted in the reset path. On some Mellanox cards this would prevent them from re-loading their firmware when the system was fast-reset. This patch fixes the problem by replacing the raw {in|out}_be64() accessors with the phb4_{read|write}_reg() functions. Reported-by: Carol L Soto <clsoto@us.ibm.com> Fixes: b8b4c79d4419 ("hw/phb4: Factor out PERST control") Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Tested-by: Carol L Soto <clsoto@us.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/phb4.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/phb4.c b/hw/phb4.c
index ec37c15..5f4956e 100644
--- a/hw/phb4.c
+++ b/hw/phb4.c
@@ -2895,7 +2895,7 @@ static void phb4_assert_perst(struct pci_slot *slot, bool assert)
* bit in the btctl register also works.
*/
phb4_pcicfg_read16(&p->phb, 0, p->ecap + PCICAP_EXP_LCTL, &linkctl);
- reg = in_be64(p->regs + PHB_PCIE_CRESET);
+ reg = phb4_read_reg(p, PHB_PCIE_CRESET);
if (assert) {
linkctl |= PCICAP_EXP_LCTL_LINK_DIS;
@@ -2905,7 +2905,7 @@ static void phb4_assert_perst(struct pci_slot *slot, bool assert)
reg |= PHB_PCIE_CRESET_PERST_N;
}
- out_be64(p->regs + PHB_PCIE_CRESET, reg);
+ phb4_write_reg(p, PHB_PCIE_CRESET, reg);
phb4_pcicfg_write16(&p->phb, 0, p->ecap + PCICAP_EXP_LCTL, linkctl);
}