[RFC,10/16] hdata: Create ibm,dump DT node

Message ID 20180403120447.24364-11-hegdevasant@linux.vnet.ibm.com
State RFC
Headers show
Series
  • MPIPL support
Related show

Commit Message

Vasant Hegde April 3, 2018, 12:04 p.m.
Create /ibm,dump device tree node and populate below properties:
  - compatible   - ibm,dump version
  - fw-load-area - Memory used by OPAL to load kernel/initrd from PNOR
                  (KERNEL_LOAD_BASE & INITRAMFS_LOAD_BASE)

Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
---
 hdata/spira.c | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

Patch

diff --git a/hdata/spira.c b/hdata/spira.c
index 48b6ef813..5394e609f 100644
--- a/hdata/spira.c
+++ b/hdata/spira.c
@@ -1117,6 +1117,25 @@  static void add_iplparams_sys_params(const void *iplp, struct dt_node *node)
 		dt_init_secureboot_node(p);
 }
 
+static void add_fadump_node(const struct iplparams_iplparams *p __unused)
+{
+	u64 fw_load_area[4];
+	struct dt_node *node;
+
+	if (proc_gen < proc_gen_p9)
+		return;
+
+	node = dt_new(dt_root, "ibm,dump");
+	assert(node);
+	dt_add_property_string(node, "compatible", "ibm,opal-dump-v1");
+
+	fw_load_area[0] = (u64)KERNEL_LOAD_BASE;
+	fw_load_area[1] = KERNEL_LOAD_SIZE;
+	fw_load_area[2] = (u64)INITRAMFS_LOAD_BASE;
+	fw_load_area[3] = INITRAMFS_LOAD_SIZE;
+	dt_add_property(node, "fw-load-area", fw_load_area, sizeof(fw_load_area));
+}
+
 static void add_iplparams_ipl_params(const void *iplp, struct dt_node *node)
 {
 	const struct iplparams_iplparams *p;
@@ -1155,6 +1174,9 @@  static void add_iplparams_ipl_params(const void *iplp, struct dt_node *node)
 	dt_add_property_strings(node, "cec-major-type",
 				p->cec_ipl_maj_type ? "hot" : "cold");
 
+	/* Populate fadump node */
+	add_fadump_node(p);
+
 	/* Add LED type info under '/ibm,opal/led' node */
 	led_node = dt_find_by_path(opal_node, DT_PROPERTY_LED_NODE);
 	assert(led_node);