aboutsummaryrefslogtreecommitdiff
path: root/hdata
diff options
context:
space:
mode:
authorVasant Hegde <hegdevasant@linux.vnet.ibm.com>2016-03-22 11:18:55 +0530
committerStewart Smith <stewart@linux.vnet.ibm.com>2016-04-01 13:11:25 +1100
commit9abe84f83212d6e92c8c3d15f73b8fa26b169fdc (patch)
treea4185e6654566d6ecf113b45b9886e415e2980e5 /hdata
parent198aa67cc87a106923c7de435951d0e4a89d327e (diff)
downloadskiboot-9abe84f83212d6e92c8c3d15f73b8fa26b169fdc.zip
skiboot-9abe84f83212d6e92c8c3d15f73b8fa26b169fdc.tar.gz
skiboot-9abe84f83212d6e92c8c3d15f73b8fa26b169fdc.tar.bz2
hdata: Initialize SPIRA-H structure
Previous patch reduced reserved space in spira structure. Now its safe to reduce the memory for spira section from 2K to 1K. Create separate memory section with 1K size for SPIRA-H. Also initialize SPIRA-H. FSP makes use of this information to pass various boot time data (like SPIRA-S, etc) to host. 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.c46
-rw-r--r--hdata/spira.h2
2 files changed, 48 insertions, 0 deletions
diff --git a/hdata/spira.c b/hdata/spira.c
index 1286856..b8ef0b0 100644
--- a/hdata/spira.c
+++ b/hdata/spira.c
@@ -147,6 +147,52 @@ __section(".spira.data") struct spira spira = {
},
};
+/* The Hypervisor SPIRA-H Structure */
+__section(".spirah.data") struct spirah spirah = {
+ .hdr = HDIF_SIMPLE_HDR(SPIRAH_HDIF_SIG, SPIRAH_VERSION, struct spirah),
+ .ntuples_ptr = HDIF_IDATA_PTR(offsetof(struct spirah, ntuples),
+ sizeof(struct spirah_ntuples)),
+ .ntuples = {
+ .array_hdr = {
+ .offset = CPU_TO_BE32(HDIF_ARRAY_OFFSET),
+ .ecnt = CPU_TO_BE32(SPIRAH_NTUPLES_COUNT),
+ .esize
+ = CPU_TO_BE32(sizeof(struct spira_ntuple)),
+ .eactsz = CPU_TO_BE32(0x18),
+ },
+ /* Host Data Areas */
+ .hs_data_area = {
+ .addr = CPU_TO_BE64(SPIRA_HEAP_BASE),
+ .alloc_cnt = CPU_TO_BE16(1),
+ .alloc_len = CPU_TO_BE32(SPIRA_HEAP_SIZE),
+ },
+ /* We only populate some n-tuples */
+ .proc_init = {
+ .addr = CPU_TO_BE64(PROCIN_OFF),
+ .alloc_cnt = CPU_TO_BE16(1),
+ .act_cnt = CPU_TO_BE16(1),
+ .alloc_len
+ = CPU_TO_BE32(sizeof(struct proc_init_data)),
+ },
+#if !defined(TEST)
+ .cpu_ctrl = {
+ .addr = CPU_TO_BE64((unsigned long)&cpu_ctl_init_data),
+ .alloc_cnt = CPU_TO_BE16(1),
+ .act_cnt = CPU_TO_BE16(1),
+ .alloc_len =
+ CPU_TO_BE32(sizeof(cpu_ctl_init_data)),
+ },
+#endif
+ .mdump_src = {
+ .addr = CPU_TO_BE64(MDST_TABLE_OFF),
+ .alloc_cnt = CPU_TO_BE16(ARRAY_SIZE(init_mdst_table)),
+ .act_cnt = CPU_TO_BE16(ARRAY_SIZE(init_mdst_table)),
+ .alloc_len =
+ CPU_TO_BE32(sizeof(init_mdst_table)),
+ },
+ },
+};
+
/* Overridden for testing. */
#ifndef spira_check_ptr
bool spira_check_ptr(const void *ptr, const char *file, unsigned int line)
diff --git a/hdata/spira.h b/hdata/spira.h
index a912fe4..0025cdd 100644
--- a/hdata/spira.h
+++ b/hdata/spira.h
@@ -113,6 +113,8 @@ struct spirah {
u8 reserved[0x100];
} __packed __align(0x100);
+extern struct spirah spirah;
+
/* SPIRA-S signature */
#define SPIRAS_HDIF_SIG "SPIRAS"