aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVasant Hegde <hegdevasant@linux.vnet.ibm.com>2019-07-12 16:47:56 +0530
committerOliver O'Halloran <oohall@gmail.com>2019-08-15 17:54:08 +1000
commit6326c712e770c398cb39dbc7346f13bbf1166cea (patch)
tree8e5f31ac69b35aaa857043dfe8b6cc21f18ed635
parent4a669d0f49c43880aefd752a8b223eb0c3829864 (diff)
downloadskiboot-6326c712e770c398cb39dbc7346f13bbf1166cea.zip
skiboot-6326c712e770c398cb39dbc7346f13bbf1166cea.tar.gz
skiboot-6326c712e770c398cb39dbc7346f13bbf1166cea.tar.bz2
hdata: Add "mpipl-boot" property to "dump" node
During MPIPL boot, hostboot updates HDAT to indicate its MPIPL boot. Lets add "mpipl-boot" property to device tree. So that kernel can detect its MPIPL boot and create dump. Device tree property: /ibm,opal/dump/mpipl-boot - Indicate kernel that its MPIPL boot Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> [oliver: rebased] Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
-rw-r--r--hdata/spira.c43
-rw-r--r--hdata/spira.h4
2 files changed, 47 insertions, 0 deletions
diff --git a/hdata/spira.c b/hdata/spira.c
index 41f45b3..0c44a66 100644
--- a/hdata/spira.c
+++ b/hdata/spira.c
@@ -928,6 +928,46 @@ static void dt_init_secureboot_node(const struct iplparams_sysparams *sysparams)
dt_add_property_cells(node, "hw-key-hash-size", hw_key_hash_size);
}
+static void opal_dump_add_mpipl_boot(const struct iplparams_iplparams *p)
+{
+ u32 mdrt_cnt = spira.ntuples.mdump_res.act_cnt;
+ u32 mdrt_max_cnt = MDRT_TABLE_SIZE / sizeof(struct mdrt_table);
+ struct dt_node *dump_node;
+
+ dump_node = dt_find_by_path(opal_node, "dump");
+ if (!dump_node)
+ return;
+
+ /* Check boot params to detect MPIPL boot or not */
+ if (p->cec_ipl_maj_type != IPLPARAMS_MAJ_TYPE_REIPL)
+ return;
+
+ /*
+ * On FSP system we get minor type as post dump IPL and on BMC system
+ * we get platform reboot. Hence lets check for both values.
+ */
+ if (p->cec_ipl_min_type != IPLPARAMS_MIN_TYPE_POST_DUMP &&
+ p->cec_ipl_min_type != IPLPARAMS_MIN_TYPE_PLAT_REBOOT) {
+ prlog(PR_NOTICE, "DUMP: Non MPIPL reboot "
+ "[minor type = 0x%x]\n", p->cec_ipl_min_type);
+ return;
+ }
+
+ if (p->cec_ipl_attrib != IPLPARAMS_ATTRIB_MEM_PRESERVE) {
+ prlog(PR_DEBUG, "DUMP: Memory not preserved\n");
+ return;
+ }
+
+ if (mdrt_cnt == 0 || mdrt_cnt >= mdrt_max_cnt) {
+ prlog(PR_DEBUG, "DUMP: Invalid MDRT count : %x\n", mdrt_cnt);
+ return;
+ }
+
+ prlog(PR_NOTICE, "DUMP: Dump found, MDRT count = 0x%x\n", mdrt_cnt);
+
+ dt_add_property(dump_node, "mpipl-boot", NULL, 0);
+}
+
static void add_opal_dump_node(void)
{
u64 fw_load_area[4];
@@ -1088,6 +1128,9 @@ static void add_iplparams_ipl_params(const void *iplp, struct dt_node *node)
else
dt_add_property_strings(led_node, DT_PROPERTY_LED_MODE,
LED_MODE_GUIDING_LIGHT);
+
+ /* Populate opal dump result table */
+ opal_dump_add_mpipl_boot(p);
}
static void add_iplparams_serials(const void *iplp, struct dt_node *node)
diff --git a/hdata/spira.h b/hdata/spira.h
index 16bde6f..ce24441 100644
--- a/hdata/spira.h
+++ b/hdata/spira.h
@@ -388,8 +388,12 @@ struct iplparams_iplparams {
#define IPLPARAMS_FSP_FW_IPL_SIDE_TEMP 0x01
uint8_t ipl_speed;
__be16 cec_ipl_attrib;
+#define IPLPARAMS_ATTRIB_MEM_PRESERVE PPC_BIT16(2)
uint8_t cec_ipl_maj_type;
+#define IPLPARAMS_MAJ_TYPE_REIPL 0x1
uint8_t cec_ipl_min_type;
+#define IPLPARAMS_MIN_TYPE_POST_DUMP 0xc
+#define IPLPARAMS_MIN_TYPE_PLAT_REBOOT 0xd
uint8_t os_ipl_mode;
uint8_t keylock_pos;
uint8_t lmb_size;