diff options
author | Dan Crowell <dcrowell@us.ibm.com> | 2018-05-31 17:03:24 -0500 |
---|---|---|
committer | William G. Hoffa <wghoffa@us.ibm.com> | 2018-06-04 17:32:40 -0400 |
commit | 41daed137d2f31ba125a1ada241755e42f36868c (patch) | |
tree | 5067edb244a9ed4bd0bc7a04b792df15c0a93619 /src/include/kernel | |
parent | cbacafbc508accc492c63d4f18e509a6082e8f45 (diff) | |
download | talos-hostboot-41daed137d2f31ba125a1ada241755e42f36868c.tar.gz talos-hostboot-41daed137d2f31ba125a1ada241755e42f36868c.zip |
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 <pragupta@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com>
Diffstat (limited to 'src/include/kernel')
-rw-r--r-- | src/include/kernel/memstate.H | 58 |
1 files changed, 23 insertions, 35 deletions
diff --git a/src/include/kernel/memstate.H b/src/include/kernel/memstate.H index fb42ed31f..350cf6a2d 100644 --- a/src/include/kernel/memstate.H +++ b/src/include/kernel/memstate.H @@ -33,67 +33,55 @@ namespace KernelMemState { - // hb_Mem_Location struct values are defined below. - /* see mmio.h for scratch reg definitions - - Register Bit Definition: - - 0:7 - Indicator of memory mode - NOTE: having no bits on in this range indicated the memory is not ready. - - - 0b00000000 = Hostboot contained in L3 - - - 0b00000001 = Hostboot expanded to mainstore - - 8:31 - Reserved/Unused - - 32:63 - Size of active Hostboot memory in MB - - - 0 = Hostboot is not ready yet. - - - 4 = Hostboot is using half a cache - - - 8 = Hostboot is using reduced cache - - - 10 = Hostboot is using the full cache - - - XX = Hostboot is using XX MB of mainstore*/ - + /* see mmio.h for scratch reg definitions */ enum MemLocation { MEM_CONTAINED_NR = 0x0, - MEM_CONTAINED_L3 = 0x80, - MEM_CONTAINED_MS = 0x40, + MEM_CONTAINED_L3 = 0x8, + MEM_CONTAINED_MS = 0x4, }; // This constants must be kept in sync with the Dump.pm debug tool. enum MemSize { - NO_MEM = 0x0, - HALF_CACHE = 0x00000004, - REDUCED_CACHE = 0x00000008, - FULL_CACHE = 0x0000000A, + NO_MEM = 0x000, + HALF_CACHE = 0x004, + REDUCED_CACHE = 0x008, + FULL_CACHE = 0x00A, FULL_MEM = (VMM_MEMORY_SIZE/MEGABYTE), + MAX_MEMORY = 0xFFF //max space allocated for size }; - struct mem_location + struct MemState_t { union{ struct { - uint64_t memMode:8; /**< indicator of memory mode HostBoot - contained in l3 or mainstore */ - - uint64_t reserved:24; /**< reserved */ - uint64_t memSize:32; /**< Size of the memory */ + // 00:03 - Indicator of memory mode + uint64_t location:4; /**< Indicator of memory mode HostBoot + contained in L3 or mainstore */ + // 04:51 - Current HRMOR + uint64_t hrmor:48; /**< Current HRMOR in MB */ + // 52:63 - Size of active Hostboot memory + uint64_t size:12; /**< Size of the memory in MB */ }; - uint64_t Scratch6Data; /**< Full double word */ + uint64_t fullData; /**< Full double word */ }; - }; + } PACKED; - /** @fn set + /** @fn setMemScratchReg * - * @brief Sets the Hostboot memory location and size in the scratch - * register 6 + * @brief Sets the Hostboot memory location and size * - * This is used to update the core scratch reg 6 with the current + * This is used to update the core scratch reg with the current * location of hostboot memory and the size it is. * * @param[in] uint16_t - location of the memory (L3 or Mainstore) * @param[in] uint32_t - size of the memory */ - void setMemScratchReg(MemLocation i_location,MemSize i_size); + void setMemScratchReg( MemLocation i_location, + MemSize i_size ); }; |