From 41daed137d2f31ba125a1ada241755e42f36868c Mon Sep 17 00:00:00 2001 From: Dan Crowell Date: Thu, 31 May 2018 17:03:24 -0500 Subject: Write Hostboot HRMOR into core scratch reg 1 Hostboot code will write the current HRMOR value into core scratch reg 1 (scom=xx010A87, spr=0x08) at initial boot. This data is ORed into the memory size data that was already present. The bootloader code will do the same. Also updated the debug tools to key off of this data if it is available to avoid any HRMOR hardcoding. The purpose of this change is to provide a method for the FSP code to handle various memory remapping scenarios that are currently in plan without needing any explicit communication from Hostboot. Change-Id: Ia3c81980ebd780ae182956cddae785dd408fbed9 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/59699 Reviewed-by: Prachi Gupta Tested-by: Jenkins Server Tested-by: FSP CI Jenkins Tested-by: Jenkins OP Build CI Tested-by: Jenkins OP HW Reviewed-by: William G. Hoffa --- src/kernel/misc.C | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/kernel/misc.C') diff --git a/src/kernel/misc.C b/src/kernel/misc.C index 3ab2a7a57..b602ed707 100644 --- a/src/kernel/misc.C +++ b/src/kernel/misc.C @@ -591,22 +591,22 @@ namespace KernelMisc namespace KernelMemState { void setMemScratchReg(MemLocation i_location, - MemSize i_size) + MemSize i_size) { - mem_location l_MemData; + MemState_t l_MemData; - l_MemData.memMode = i_location; - l_MemData.reserved = 0; - l_MemData.memSize = i_size; + l_MemData.location = i_location; + l_MemData.hrmor = getHRMOR(); + l_MemData.size = i_size; + kassert( i_size < KernelMemState::MAX_MEMORY ); isync(); - kernel_hbDescriptor.kernelMemoryState = l_MemData.Scratch6Data; + kernel_hbDescriptor.kernelMemoryState = l_MemData.fullData; KernelMisc::updateScratchReg(MMIO_SCRATCH_MEMORY_STATE, - l_MemData.Scratch6Data); + l_MemData.fullData); lwsync(); } - }; const char* ProcessorCoreTypeStrings[] -- cgit v1.2.1