[Skiboot] [PATCH 3/3] phb4: Change debug prints

Michael Neuling mikey at neuling.org
Wed Nov 16 16:49:25 AEDT 2016


Currently we print "PHB4" and mean either "PHB version 4" or "PHB
number 4" which can be quite confusing.

This makes it clearer when it's one or the other.

Also fixes some cut and paste errors in comments from PHB3.

Signed-off-by: Michael Neuling <mikey at neuling.org>
---
 hw/phb4.c      | 38 ++++++++++++++++++++------------------
 include/phb4.h |  4 ++--
 2 files changed, 22 insertions(+), 20 deletions(-)

diff --git a/hw/phb4.c b/hw/phb4.c
index d6960d4e25..09d53a8bf7 100644
--- a/hw/phb4.c
+++ b/hw/phb4.c
@@ -59,12 +59,15 @@
 
 static void phb4_init_hw(struct phb4 *p, bool first_init);
 
-#define PHBDBG(p, fmt, a...)	prlog(PR_DEBUG, "PHB%d: " fmt, \
-				      (p)->phb.opal_id, ## a)
-#define PHBINF(p, fmt, a...)	prlog(PR_INFO, "PHB%d: " fmt, \
-				      (p)->phb.opal_id, ## a)
-#define PHBERR(p, fmt, a...)	prlog(PR_ERR, "PHB%d: " fmt, \
-				      (p)->phb.opal_id, ## a)
+#define PHBDBG(p, fmt, a...)	prlog(PR_DEBUG, "PHB#%d[%d:%d]: " fmt, \
+				      (p)->phb.opal_id, (p)->chip_id, \
+				      (p)->index,  ## a)
+#define PHBINF(p, fmt, a...)	prlog(PR_INFO, "PHB#%d[%d:%d]: " fmt, \
+				      (p)->phb.opal_id, (p)->chip_id, \
+				      (p)->index,  ## a)
+#define PHBERR(p, fmt, a...)	prlog(PR_ERR, "PHB#%d[%d:%d]: " fmt, \
+				      (p)->phb.opal_id, (p)->chip_id, \
+				      (p)->index,  ## a)
 #ifdef LOG_CFG
 #define PHBLOGCFG(p, fmt, a...)	PHBDBG(p, fmt, ## a)
 #else
@@ -913,8 +916,7 @@ static int64_t phb4_ioda_reset(struct phb *phb, bool purge)
 	uint64_t val;
 
 	if (purge) {
-		prlog(PR_DEBUG, "PHB%d: Purging all IODA tables...\n",
-		      p->phb.opal_id);
+		PHBDBG(p, "Purging all IODA tables...\n");
 		phb4_init_ioda_cache(p);
 	}
 
@@ -3264,7 +3266,7 @@ static void phb4_probe_stack(struct dt_node *stk_node, uint32_t pec_index,
 	stk_index = dt_prop_get_u32(stk_node, "reg");
 	phb_num = dt_prop_get_u32(stk_node, "ibm,phb-index");
 	path = dt_get_path(stk_node);
-	prlog(PR_NOTICE, "PHB4: Chip %d Found PBCQ%d Stack %d at %s\n",
+	prlog(PR_NOTICE, "PHB: Chip %d Found PHB4 PBCQ%d Stack %d at %s\n",
 	      gcid, pec_index, stk_index, path);
 	free(path);
 
@@ -3275,7 +3277,7 @@ static void phb4_probe_stack(struct dt_node *stk_node, uint32_t pec_index,
 	nest_stack = nest_base + 0x40 * (stk_index + 1);
 	etu_base = pci_base + 0x100 + 0x40 * stk_index;
 
-	prlog(PR_DEBUG, "PHB4[%d:%d] X[PE]=0x%08x/0x%08x X[PCI]=0x%08x/0x%08x X[ETU]=0x%08x\n",
+	prlog(PR_DEBUG, "PHB[%d:%d] X[PE]=0x%08x/0x%08x X[PCI]=0x%08x/0x%08x X[ETU]=0x%08x\n",
 	      gcid, phb_num, nest_base, nest_stack, pci_base, pci_stack, etu_base);
 
 	/* Default BAR enables */
@@ -3284,7 +3286,7 @@ static void phb4_probe_stack(struct dt_node *stk_node, uint32_t pec_index,
 	/* Get and/or initialize PHB register BAR */
 	xscom_read(gcid, nest_stack + XPEC_NEST_STK_PHB_REG_BAR, &phb_bar);
 	if (phb_bar == 0 || force_assign) {
-		prerror("PHB4[%d:%d] No PHB BAR set ! Overriding\n", gcid, phb_num);
+		prerror("PHB[%d:%d] No PHB BAR set ! Overriding\n", gcid, phb_num);
 		phb_bar = MMIO_CALC(gcid, phb_num, PHB_BAR);
 		xscom_write(gcid, nest_stack + XPEC_NEST_STK_PHB_REG_BAR, phb_bar << 8);
 	}
@@ -3292,12 +3294,12 @@ static void phb4_probe_stack(struct dt_node *stk_node, uint32_t pec_index,
 
 	xscom_read(gcid, nest_stack + XPEC_NEST_STK_PHB_REG_BAR, &phb_bar);
 	phb_bar >>= 8;
-	prlog(PR_ERR, "PHB4[%d:%d] REGS     = 0x%016llx [4k]\n", gcid, phb_num, phb_bar);
+	prlog(PR_ERR, "PHB[%d:%d] REGS     = 0x%016llx [4k]\n", gcid, phb_num, phb_bar);
 
 	/* Same with INT BAR (ESB) */
 	xscom_read(gcid, nest_stack + XPEC_NEST_STK_IRQ_BAR, &irq_bar);
 	if (irq_bar == 0 || force_assign) {
-		prerror("PHB4[%d:%d] No IRQ BAR set ! Overriding\n", gcid, phb_num);
+		prerror("PHB[%d:%d] No IRQ BAR set ! Overriding\n", gcid, phb_num);
 		irq_bar = MMIO_CALC(gcid, phb_num, ESB_BAR);
 		xscom_write(gcid, nest_stack + XPEC_NEST_STK_IRQ_BAR, irq_bar << 8);
 	}
@@ -3305,12 +3307,12 @@ static void phb4_probe_stack(struct dt_node *stk_node, uint32_t pec_index,
 
 	xscom_read(gcid, nest_stack + XPEC_NEST_STK_IRQ_BAR, &irq_bar);
 	irq_bar >>= 8;
-	prlog(PR_ERR, "PHB4[%d:%d] ESB      = 0x%016llx [...]\n", gcid, phb_num, irq_bar);
+	prlog(PR_ERR, "PHB[%d:%d] ESB      = 0x%016llx [...]\n", gcid, phb_num, irq_bar);
 
 	/* Same with MMIO windows */
 	xscom_read(gcid, nest_stack + XPEC_NEST_STK_MMIO_BAR0, &mmio0_bar);
 	if (mmio0_bar == 0 || force_assign) {
-		prerror("PHB4[%d:%d] No MMIO BAR set ! Overriding\n", gcid, phb_num);
+		prerror("PHB[%d:%d] No MMIO BAR set ! Overriding\n", gcid, phb_num);
 		mmio0_bar = MMIO_CALC(gcid, phb_num, MMIO0_BAR);
 		mmio0_bmask =  (~(MMIO0_BAR_SIZE - 1)) & 0x00FFFFFFFFFFFFFFULL;
 		xscom_write(gcid, nest_stack + XPEC_NEST_STK_MMIO_BAR0, mmio0_bar << 8);
@@ -3328,7 +3330,7 @@ static void phb4_probe_stack(struct dt_node *stk_node, uint32_t pec_index,
 	mmio0_bmask &= 0xffffffffff000000ull;
 	mmio0_sz = ((~mmio0_bmask) >> 8) + 1;
 	mmio0_bar >>= 8;
-	prlog(PR_DEBUG, "PHB4[%d:%d] MMIO0    = 0x%016llx [0x%016llx]\n",
+	prlog(PR_DEBUG, "PHB[%d:%d] MMIO0    = 0x%016llx [0x%016llx]\n",
 	      gcid, phb_num, mmio0_bar, mmio0_sz);
 
 	xscom_read(gcid, nest_stack + XPEC_NEST_STK_MMIO_BAR1, &mmio1_bar);
@@ -3336,7 +3338,7 @@ static void phb4_probe_stack(struct dt_node *stk_node, uint32_t pec_index,
 	mmio1_bmask &= 0xffffffffff000000ull;
 	mmio1_sz = ((~mmio1_bmask) >> 8) + 1;
 	mmio1_bar >>= 8;
-	prlog(PR_DEBUG, "PHB4[%d:%d] MMIO1    = 0x%016llx [0x%016llx]\n",
+	prlog(PR_DEBUG, "PHB[%d:%d] MMIO1    = 0x%016llx [0x%016llx]\n",
 	      gcid, phb_num, mmio1_bar, mmio1_sz);
 
 	/* Build MMIO windows list */
@@ -3359,7 +3361,7 @@ static void phb4_probe_stack(struct dt_node *stk_node, uint32_t pec_index,
 
 	/* No MMIO windows ? Barf ! */
 	if (mmio_win_sz == 0) {
-		prerror("PHB4[%d:%d] No MMIO windows enabled !\n", gcid, phb_num);
+		prerror("PHB[%d:%d] No MMIO windows enabled !\n", gcid, phb_num);
 		return;
 	}
 
diff --git a/include/phb4.h b/include/phb4.h
index 523f8710e7..bed6eef092 100644
--- a/include/phb4.h
+++ b/include/phb4.h
@@ -224,9 +224,9 @@ struct phb4_err {
 #define PHB4_CAPP_RECOVERY	0x00000008
 
 struct phb4 {
-	unsigned int		index;	    /* 0..2 index inside P8 */
+	unsigned int		index;	    /* 0..5 index inside p9 */
 	unsigned int		flags;
-	unsigned int		chip_id;    /* Chip ID (== GCID on P8) */
+	unsigned int		chip_id;    /* Chip ID (== GCID on p9) */
 	enum phb4_state		state;
 	unsigned int		rev;        /* 00MMmmmm */
 #define PHB4_REV_NIMBUS_DD10	0xa40001
-- 
2.9.3



More information about the Skiboot mailing list