[v2,10/17] hdata: Create ibm,dump DT node

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

Commit Message

Vasant Hegde May 4, 2018, 10:28 a.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 1c9a9681a..565579aae 100644
--- a/hdata/spira.c
+++ b/hdata/spira.c
@@ -1119,6 +1119,25 @@  static void add_iplparams_sys_params(const void *iplp, struct dt_node *node)
 		dt_init_secureboot_node(p);
 }
 
+static void fadump_add_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;
@@ -1167,6 +1186,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 fadump node */
+	fadump_add_node(p);
 }
 
 static void add_iplparams_serials(const void *iplp, struct dt_node *node)