diff mbox series

[v8,07/24] hdata: Update spirah structure

Message ID 20190616171024.22799-8-hegdevasant@linux.vnet.ibm.com
State Superseded
Headers show
Series MPIPL support | expand

Checks

Context Check Description
snowpatch_ozlabs/apply_patch success Successfully applied on branch master (dbf27b6c4af84addb36bd3be34f96580aba9c873)
snowpatch_ozlabs/snowpatch_job_snowpatch-skiboot fail Test snowpatch/job/snowpatch-skiboot on branch master
snowpatch_ozlabs/snowpatch_job_snowpatch-skiboot-dco success Signed-off-by present

Commit Message

Vasant Hegde June 16, 2019, 5:10 p.m. UTC
Update MDST, MDDT and MDRT ntuple inside spirah. During MPIPL
hostboot will use these details to preserve memory.

Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
---
 hdata/spira.c | 27 ++++++++++++++++++++++++---
 1 file changed, 24 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/hdata/spira.c b/hdata/spira.c
index 6fbe8cd05..328c3479b 100644
--- a/hdata/spira.c
+++ b/hdata/spira.c
@@ -187,10 +187,31 @@  __section(".spirah.data") struct spirah spirah = {
 #endif
 		.mdump_src = {
 			.addr		= CPU_TO_BE64(MDST_TABLE_OFF),
-			.alloc_cnt	= CPU_TO_BE16(ARRAY_SIZE(init_mdst_table)),
+			.alloc_cnt	= CPU_TO_BE16(MDST_TABLE_SIZE / sizeof(struct mdst_table)),
 			.act_cnt	= CPU_TO_BE16(ARRAY_SIZE(init_mdst_table)),
-			.alloc_len	=
-				CPU_TO_BE32(sizeof(init_mdst_table)),
+			.alloc_len	= CPU_TO_BE32(sizeof(struct mdst_table)),
+			.act_len	= CPU_TO_BE32(sizeof(struct mdst_table)),
+		},
+		.mdump_dst = {
+			.addr		= CPU_TO_BE64(MDDT_TABLE_OFF),
+			.alloc_cnt	= CPU_TO_BE16(MDDT_TABLE_SIZE / sizeof(struct mddt_table)),
+			.act_cnt	= CPU_TO_BE16(0),
+			.alloc_len	= CPU_TO_BE32(sizeof(struct mddt_table)),
+			.act_len	= CPU_TO_BE32(sizeof(struct mddt_table)),
+		},
+		.mdump_res = {
+			.addr		= CPU_TO_BE64(MDRT_TABLE_BASE),
+			.alloc_cnt	= CPU_TO_BE16(MDRT_TABLE_SIZE / sizeof(struct mdrt_table)),
+			/*
+			 * XXX: Ideally hostboot should use allocated count and
+			 *      length. But looks like hostboot uses actual count
+			 *      and length to get MDRT table size. And post dump
+			 *      hostboot will update act_cnt. Hence update both
+			 *      alloc_cnt and act_cnt.
+			 */
+			.act_cnt        = CPU_TO_BE16(MDRT_TABLE_SIZE / sizeof(struct mdrt_table)),
+			.alloc_len      = CPU_TO_BE32(sizeof(struct mdrt_table)),
+			.act_len        = CPU_TO_BE32(sizeof(struct mdrt_table)),
 		},
 	},
 };