aboutsummaryrefslogtreecommitdiff
path: root/hdata
diff options
context:
space:
mode:
authorVasant Hegde <hegdevasant@linux.vnet.ibm.com>2016-03-22 11:18:56 +0530
committerStewart Smith <stewart@linux.vnet.ibm.com>2016-04-01 13:11:25 +1100
commitd65cfefe8a7888aedc90b91fd28b72bc7677d326 (patch)
tree23e2972d23e151ca5292dc366145baecac769141 /hdata
parent9abe84f83212d6e92c8c3d15f73b8fa26b169fdc (diff)
downloadskiboot-d65cfefe8a7888aedc90b91fd28b72bc7677d326.zip
skiboot-d65cfefe8a7888aedc90b91fd28b72bc7677d326.tar.gz
skiboot-d65cfefe8a7888aedc90b91fd28b72bc7677d326.tar.bz2
hdata: Enable SPIRA-H
Update the SPIRA-H pointer in the NACA so that the FSP can build and pass the SPIRA-S structure to OPAL instead of the legacy SPIRA. Older systems (which does not support SPIRA-H) ignores SPIRA-H pointer and continue to pass legacy SPIRA. "spira" is a global structure and referred everywhere inside hdata dir. Once we enable SPIRA-H we get data in SPIRA-S area, not in legacy spira. Hence fixup spira structure, so that we don't break building device tree. Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'hdata')
-rw-r--r--hdata/spira.c48
-rw-r--r--hdata/spira.h2
2 files changed, 50 insertions, 0 deletions
diff --git a/hdata/spira.c b/hdata/spira.c
index b8ef0b0..bff6d71 100644
--- a/hdata/spira.c
+++ b/hdata/spira.c
@@ -193,6 +193,9 @@ __section(".spirah.data") struct spirah spirah = {
},
};
+/* The service processor SPIRA-S structure */
+struct spiras *spiras;
+
/* Overridden for testing. */
#ifndef spira_check_ptr
bool spira_check_ptr(const void *ptr, const char *file, unsigned int line)
@@ -1039,12 +1042,57 @@ static void hostservices_parse(void)
hservices_from_hdat(dt_blob, size);
}
+/*
+ * Legacy SPIRA is being deprecated and we have new SPIRA-H/S structures.
+ * But on older system (p7?) we will continue to get legacy SPIRA.
+ *
+ * SPIRA-S is initialized and provided by FSP. We use SPIRA-S signature
+ * to identify supported format. Also if required adjust spira pointer.
+ */
+static void fixup_spira(void)
+{
+#if !defined(TEST)
+ spiras = (struct spiras *)CPU_TO_BE64(SPIRA_HEAP_BASE);
+#endif
+
+ /* Validate SPIRA-S signature */
+ if (!spiras)
+ return;
+ if (!HDIF_check(&spiras->hdr, SPIRAS_HDIF_SIG))
+ return;
+
+ prlog(PR_NOTICE, "SPIRA-S found.\n");
+
+ spira.ntuples.sp_subsys = spiras->ntuples.sp_subsys;
+ spira.ntuples.ipl_parms = spiras->ntuples.ipl_parms;
+ spira.ntuples.nt_enclosure_vpd = spiras->ntuples.nt_enclosure_vpd;
+ spira.ntuples.slca = spiras->ntuples.slca;
+ spira.ntuples.backplane_vpd = spiras->ntuples.backplane_vpd;
+ spira.ntuples.system_vpd = spiras->ntuples.system_vpd;
+ spira.ntuples.proc_init = spirah.ntuples.proc_init;
+ spira.ntuples.clock_vpd = spiras->ntuples.clock_vpd;
+ spira.ntuples.anchor_vpd = spiras->ntuples.anchor_vpd;
+ spira.ntuples.op_panel_vpd = spiras->ntuples.op_panel_vpd;
+ spira.ntuples.misc_cec_fru_vpd = spiras->ntuples.misc_cec_fru_vpd;
+ spira.ntuples.ms_vpd = spiras->ntuples.ms_vpd;
+ spira.ntuples.cec_iohub_fru = spiras->ntuples.cec_iohub_fru;
+ spira.ntuples.cpu_ctrl = spirah.ntuples.cpu_ctrl;
+ spira.ntuples.mdump_src = spirah.ntuples.mdump_src;
+ spira.ntuples.mdump_dst = spirah.ntuples.mdump_dst;
+ spira.ntuples.mdump_res = spirah.ntuples.mdump_res;
+ spira.ntuples.pcia = spiras->ntuples.pcia;
+ spira.ntuples.proc_chip = spiras->ntuples.proc_chip;
+ spira.ntuples.hs_data = spiras->ntuples.hs_data;
+}
+
void parse_hdat(bool is_opal, uint32_t master_cpu)
{
cpu_type = PVR_TYPE(mfspr(SPR_PVR));
prlog(PR_DEBUG, "Parsing HDAT...\n");
+ fixup_spira();
+
dt_root = dt_new_root("");
/*
diff --git a/hdata/spira.h b/hdata/spira.h
index 0025cdd..bd10ae7 100644
--- a/hdata/spira.h
+++ b/hdata/spira.h
@@ -152,6 +152,8 @@ struct spiras {
u8 reserved[0x1c0];
} __packed __align(0x100);
+extern struct spiras *spiras;
+
/* This macro can be used to check the validity of a pointer returned
* by one of the HDIF API functions. It returns true if the pointer