[Skiboot] [PATCH 14/14] phb4: Assert PERST before PHB reset
Michael Neuling
mikey at neuling.org
Wed Jul 26 20:50:13 AEST 2017
Currently we don't assert PERST before issuing a PHB reset. This means
any link issues while resetting the PHB will be logged as errors.
This asserts PERST before we start resetting the PHB to avoid this.
Signed-off-by: Michael Neuling <mikey at neuling.org>
---
hw/phb4.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/hw/phb4.c b/hw/phb4.c
index c978050d5f..a9f9c05fc0 100644
--- a/hw/phb4.c
+++ b/hw/phb4.c
@@ -2606,7 +2606,7 @@ static int64_t load_capp_ucode(struct phb4 *p)
static int64_t phb4_creset(struct pci_slot *slot)
{
struct phb4 *p = phb_to_phb4(slot->phb);
- uint64_t pbcq_status;
+ uint64_t pbcq_status, reg;
switch (slot->state) {
case PHB4_SLOT_NORMAL:
@@ -2633,6 +2633,11 @@ static int64_t phb4_creset(struct pci_slot *slot)
*/
p->flags |= PHB4_CFG_USE_ASB | PHB4_AIB_FENCED;
+ /* Assert PREST before clearing errors */
+ reg = phb4_read_reg(p, PHB_PCIE_CRESET);
+ reg &= ~PHB_PCIE_CRESET_PERST_N;
+ phb4_write_reg(p, PHB_PCIE_CRESET, reg);
+
/* Clear errors, following the proper sequence */
phb4_err_clear(p);
--
2.11.0
More information about the Skiboot
mailing list