diff options
author | Vasant Hegde <hegdevasant@linux.vnet.ibm.com> | 2019-07-12 16:47:45 +0530 |
---|---|---|
committer | Oliver O'Halloran <oohall@gmail.com> | 2019-08-15 17:52:49 +1000 |
commit | ed7110eed47555617d669f58f293d3698514b4d4 (patch) | |
tree | 2695fe0263a4356156dc5eec5b451cf68f586ce9 /hdata | |
parent | 935fccb098b454a06c6d01496eb4da32efc0c03f (diff) | |
download | skiboot-ed7110eed47555617d669f58f293d3698514b4d4.zip skiboot-ed7110eed47555617d669f58f293d3698514b4d4.tar.gz skiboot-ed7110eed47555617d669f58f293d3698514b4d4.tar.bz2 |
hdata: Adjust various structure offset after relocation
ntuple addresses in SPIRAH are relative to payload base. Update various
addresses after relocation so that hostboot can access new address to
capture dump.
Note that we update relocated SPIRAH. So future if we add early OPAL
crash support, hostboot can still collect dump using origianl skiboot
base.
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
[oliver: rebased]
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Diffstat (limited to 'hdata')
-rw-r--r-- | hdata/spira.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/hdata/spira.c b/hdata/spira.c index 72c72f3..8dd8621 100644 --- a/hdata/spira.c +++ b/hdata/spira.c @@ -1602,6 +1602,27 @@ static void fixup_spira(void) spira.ntuples.node_stb_data = spiras->ntuples.node_stb_data; } +/* + * All the data structure addresses are relative to payload base. Hence adjust + * structures that are needed to capture OPAL dump during MPIPL. + */ +static void update_spirah_addr(void) +{ +#if !defined(TEST) + extern uint32_t naca; + uint64_t *spirah_offset = (uint64_t *)&naca; + uint64_t *spira_offset = (uint64_t *)((u64)(&naca) + 0x30); + + if (proc_gen < proc_gen_p9) + return; + + *spirah_offset = SPIRAH_OFF; + *spira_offset = SPIRA_OFF; + spirah.ntuples.hs_data_area.addr = CPU_TO_BE64(SPIRA_HEAP_BASE - SKIBOOT_BASE); + spirah.ntuples.mdump_res.addr = CPU_TO_BE64(MDRT_TABLE_BASE - SKIBOOT_BASE); +#endif +} + int parse_hdat(bool is_opal) { cpu_type = PVR_TYPE(mfspr(SPR_PVR)); @@ -1610,6 +1631,8 @@ int parse_hdat(bool is_opal) fixup_spira(); + update_spirah_addr(); + /* * Basic DT root stuff */ |