[Skiboot] [PATCH 03/14] phb4: Dump devctl and devstat registers

Michael Neuling mikey at neuling.org
Wed Jul 26 20:50:02 AEST 2017


Dump devctl and devstat registers.  These would have been useful when
debugging the MPS issue.

Suggested-by: Mike Perez <perezma at us.ibm.com>
Signed-off-by: Michael Neuling <mikey at neuling.org>
---
 hw/phb4.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/hw/phb4.c b/hw/phb4.c
index 4e2816ec3a..827808c14d 100644
--- a/hw/phb4.c
+++ b/hw/phb4.c
@@ -1888,6 +1888,7 @@ static void phb4_read_phb_status(struct phb4 *p,
 static void phb4_eeh_dump_regs(struct phb4 *p)
 {
 	struct OpalIoPhb4ErrorData *s;
+	uint32_t reg;
 	unsigned int i;
 
 	s = zalloc(sizeof(struct OpalIoPhb4ErrorData));
@@ -1907,6 +1908,13 @@ static void phb4_eeh_dump_regs(struct phb4 *p)
 	PHBERR(p, "         corrErrorStatus = %08x\n", s->corrErrorStatus);
 	PHBERR(p, "       uncorrErrorStatus = %08x\n", s->uncorrErrorStatus);
 
+	/* Two non OPAL API registers that are useful */
+	phb4_pcicfg_read32(&p->phb, 0, p->ecap + PCICAP_EXP_DEVCTL, &reg);
+	PHBERR(p, "                  devctl = %08x\n", reg);
+	phb4_pcicfg_read32(&p->phb, 0, p->ecap + PCICAP_EXP_DEVSTAT,
+			   &reg);
+	PHBERR(p, "                 devStat = %08x\n", reg);
+
 	/* Byte swap TLP headers so they are the same as the PCIe spec */
 	PHBERR(p, "                 tlpHdr1 = %08x\n", bswap_32(s->tlpHdr1));
 	PHBERR(p, "                 tlpHdr2 = %08x\n", bswap_32(s->tlpHdr2));
-- 
2.11.0



More information about the Skiboot mailing list