summaryrefslogtreecommitdiffstats
path: root/hw/phb4.c
diff options
context:
space:
mode:
authorOliver O'Halloran <oohall@gmail.com>2018-07-26 12:18:38 +1000
committerStewart Smith <stewart@linux.ibm.com>2018-07-26 03:10:41 -0500
commit3e23604be0cbff4919cd1d99369483f9817f8c76 (patch)
tree11c7f21f94ccc1e0172c51904eaf28841c3f2359 /hw/phb4.c
parentd1ac16801a3868cfbd857416b397acab0de25c5e (diff)
downloadblackbird-skiboot-3e23604be0cbff4919cd1d99369483f9817f8c76.tar.gz
blackbird-skiboot-3e23604be0cbff4919cd1d99369483f9817f8c76.zip
hw/phb4: Add helpers to dump the IODA tables
The IODA tables are stored inside the PHB itself rather than in memory. This makes accessing them slightly tedious, but the process is more or less the same for every table. This patch adds a helper function for dumping the contents of the IODA tables to help with debugging PHB issues. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
Diffstat (limited to 'hw/phb4.c')
-rw-r--r--hw/phb4.c89
1 files changed, 89 insertions, 0 deletions
diff --git a/hw/phb4.c b/hw/phb4.c
index 6fc8f36c..4ed79a70 100644
--- a/hw/phb4.c
+++ b/hw/phb4.c
@@ -1973,6 +1973,95 @@ static void __unused phb4_dump_peltv(struct phb4 *p)
}
}
+static void __unused phb4_dump_ioda_table(struct phb4 *p, int table)
+{
+ const char *name;
+ int entries, i;
+
+ switch (table) {
+ case IODA3_TBL_LIST:
+ name = "LIST";
+ entries = 8;
+ break;
+ case IODA3_TBL_MIST:
+ name = "MIST";
+ entries = 1024;
+ break;
+ case IODA3_TBL_RCAM:
+ name = "RCAM";
+ entries = 128;
+ break;
+ case IODA3_TBL_MRT:
+ name = "MRT";
+ entries = 16;
+ break;
+ case IODA3_TBL_PESTA:
+ name = "PESTA";
+ entries = 512;
+ break;
+ case IODA3_TBL_PESTB:
+ name = "PESTB";
+ entries = 512;
+ break;
+ case IODA3_TBL_TVT:
+ name = "TVT";
+ entries = 512;
+ break;
+ case IODA3_TBL_TCAM:
+ name = "TCAM";
+ entries = 1024;
+ break;
+ case IODA3_TBL_TDR:
+ name = "TDR";
+ entries = 1024;
+ break;
+ case IODA3_TBL_MBT: /* special case, see below */
+ name = "MBT";
+ entries = 64;
+ break;
+ case IODA3_TBL_MDT:
+ name = "MDT";
+ entries = 512;
+ break;
+ case IODA3_TBL_PEEV:
+ name = "PEEV";
+ entries = 8;
+ break;
+ default:
+ PHBERR(p, "Invalid IODA table %d!\n", table);
+ return;
+ }
+
+ PHBERR(p, "Start %s dump (only non-zero entries are printed):\n", name);
+
+ phb4_ioda_sel(p, table, 0, true);
+
+ /*
+ * Each entry in the MBT is 16 bytes. Every other table has 8 byte
+ * entries so we special case the MDT to keep the output readable.
+ */
+ if (table == IODA3_TBL_MBT) {
+ for (i = 0; i < 32; i++) {
+ uint64_t v1 = phb4_read_reg_asb(p, PHB_IODA_DATA0);
+ uint64_t v2 = phb4_read_reg_asb(p, PHB_IODA_DATA0);
+
+ if (!v1 && !v2)
+ continue;
+ PHBERR(p, "MBT[%03x] = %016llx %016llx\n", i, v1, v2);
+ }
+ } else {
+ for (i = 0; i < entries; i++) {
+ uint64_t v = phb4_read_reg_asb(p, PHB_IODA_DATA0);
+
+ if (!v)
+ continue;
+ PHBERR(p, "%s[%03x] = %016llx\n", name, i, v);
+ }
+ }
+
+ PHBERR(p, "End %s dump\n", name);
+}
+
static void phb4_eeh_dump_regs(struct phb4 *p)
{
struct OpalIoPhb4ErrorData *s;
OpenPOWER on IntegriCloud