diff options
author | Andrew Geissler <andrewg@us.ibm.com> | 2016-07-26 14:21:15 -0500 |
---|---|---|
committer | William G. Hoffa <wghoffa@us.ibm.com> | 2016-08-16 15:43:07 -0400 |
commit | 025298b52002867f1e3516ba9810fd4642262980 (patch) | |
tree | 70ef20aabd7e1bb0d727e7f94d72ac74e522e62d /src | |
parent | 5d57720970f8c8ffcefee7bfa5f9ec24f141501d (diff) | |
download | talos-hostboot-025298b52002867f1e3516ba9810fd4642262980.tar.gz talos-hostboot-025298b52002867f1e3516ba9810fd4642262980.zip |
Updates for new scratch registers in P9
P9 moves us from 8 scratch registers to 4. This commit handles
this change and also adds the base support for partial cache.
Change-Id: Ibe050c663744285dd3e77850649236a669dadbd6
RTC: 150923
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/27462
Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Martin Gloff <mgloff@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com>
Diffstat (limited to 'src')
-rwxr-xr-x | src/build/debug/Hostboot/Dump.pm | 30 | ||||
-rwxr-xr-x | src/build/debug/fsp-memdump.sh | 11 | ||||
-rw-r--r-- | src/include/kernel/memstate.H | 3 | ||||
-rw-r--r-- | src/include/sys/mmio.h | 26 | ||||
-rw-r--r-- | src/kernel/misc.C | 10 | ||||
-rw-r--r-- | src/kernel/shutdown.S | 4 | ||||
-rw-r--r-- | src/lib/syscall_mmio.C | 7 |
7 files changed, 51 insertions, 40 deletions
diff --git a/src/build/debug/Hostboot/Dump.pm b/src/build/debug/Hostboot/Dump.pm index 7f9fda8ec..ac33fff47 100755 --- a/src/build/debug/Hostboot/Dump.pm +++ b/src/build/debug/Hostboot/Dump.pm @@ -6,7 +6,9 @@ # # OpenPOWER HostBoot Project # -# COPYRIGHT International Business Machines Corp. 2011,2014 +# Contributors Listed Below - COPYRIGHT 2012,2016 +# [+] International Business Machines Corp. +# # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -32,7 +34,8 @@ use Fcntl qw(SEEK_SET); use constant MEMSTATE_NO_MEM => 0x0; use constant MEMSTATE_HALF_CACHE => 0x4; -use constant MEMSTATE_FULL_CACHE => 0x8; +use constant MEMSTATE_REDUCED_CACHE => 0x8; +use constant MEMSTATE_FULL_CACHE => 0xa; use constant MEMSTATE_MS_32MEG => 0x20; use constant MEMSTATE_PRE_SECURE_BOOT => 0xff; @@ -64,16 +67,21 @@ our %memory_maps = ( 2 * _MB + 512 * _KB, 512 * _KB, 3 * _MB + 512 * _KB, 512 * _KB ], - MEMSTATE_FULL_CACHE() => - # Add next full 4MB after we expand to the full cache. + MEMSTATE_REDUCED_CACHE() => + # Initial chips may have 2MB bad cache [ 4 * _MB, 1 * _MB, 5 * _MB, 1 * _MB, 6 * _MB, 1 * _MB, 7 * _MB, 1 * _MB ], + MEMSTATE_FULL_CACHE() => + # Full cache is 10MB + [ 8 * _MB, 1 * _MB, + 9 * _MB, 1 * _MB + ], MEMSTATE_MS_32MEG() => - # Add next 24MB after we expand to memory. - [ 8 * _MB, 24 * _MB + # Add next 22MB after we expand to memory. + [ 10 * _MB, 22 * _MB ] ); @@ -83,11 +91,15 @@ our %memory_states = ( MEMSTATE_PRE_SECURE_BOOT() => [ MEMSTATE_NO_MEM, MEMSTATE_PRE_SECURE_BOOT ], MEMSTATE_HALF_CACHE() => [ MEMSTATE_NO_MEM, MEMSTATE_PRE_SECURE_BOOT, MEMSTATE_HALF_CACHE ], + MEMSTATE_REDUCED_CACHE() => + [ MEMSTATE_NO_MEM, MEMSTATE_PRE_SECURE_BOOT, + MEMSTATE_HALF_CACHE, MEMSTATE_REDUCED_CACHE ], MEMSTATE_FULL_CACHE() => [ MEMSTATE_NO_MEM, MEMSTATE_PRE_SECURE_BOOT, - MEMSTATE_HALF_CACHE, MEMSTATE_FULL_CACHE ], + MEMSTATE_HALF_CACHE, MEMSTATE_REDUCED_CACHE, + MEMSTATE_FULL_CACHE ], MEMSTATE_MS_32MEG() => [ MEMSTATE_NO_MEM, MEMSTATE_PRE_SECURE_BOOT, - MEMSTATE_HALF_CACHE, MEMSTATE_FULL_CACHE, - MEMSTATE_MS_32MEG ] + MEMSTATE_HALF_CACHE, MEMSTATE_REDUCED_CACHE, + MEMSTATE_FULL_CACHE, MEMSTATE_MS_32MEG ] ); sub main diff --git a/src/build/debug/fsp-memdump.sh b/src/build/debug/fsp-memdump.sh index 974fa3aea..d02b11ff8 100755 --- a/src/build/debug/fsp-memdump.sh +++ b/src/build/debug/fsp-memdump.sh @@ -6,7 +6,9 @@ # # OpenPOWER HostBoot Project # -# COPYRIGHT International Business Machines Corp. 2013,2014 +# Contributors Listed Below - COPYRIGHT 2013,2016 +# [+] International Business Machines Corp. +# # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -146,9 +148,12 @@ do dump 7340032 1048576 STATE=04 ;; - 20) + 0A|A) dump 8388608 1048576 dump 9437184 1048576 + STATE=08 + ;; + 20) dump 10485760 1048576 dump 11534336 1048576 dump 12582912 1048576 @@ -171,7 +176,7 @@ do dump 30408704 1048576 dump 31457280 1048576 dump 32505856 1048576 - STATE=08 + STATE=0A ;; discover) # Call discover function to determine state. discover diff --git a/src/include/kernel/memstate.H b/src/include/kernel/memstate.H index 6ef43aaab..b5215a806 100644 --- a/src/include/kernel/memstate.H +++ b/src/include/kernel/memstate.H @@ -32,8 +32,7 @@ namespace KernelMemState { // hb_Mem_Location struct values are defined below. - /* Core Scratch 6 (Scom 0x10013289) will be used to indicate the memory - state + /* see mmio.h for scratch reg definitions Register Bit Definition: - 0:7 - Indicator of memory mode diff --git a/src/include/sys/mmio.h b/src/include/sys/mmio.h index 4de734266..470c74e48 100644 --- a/src/include/sys/mmio.h +++ b/src/include/sys/mmio.h @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2010,2014 */ +/* Contributors Listed Below - COPYRIGHT 2010,2016 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -88,25 +88,15 @@ void mmio_hmer_write(uint64_t value); */ enum MMIO_Scratch_Register { - /** Thread0 Scratch Register - Progress Code / Status. */ + /** Progress Code / Status. */ MMIO_SCRATCH_PROGRESS_CODE = 0x0, - /** Thread1 Scratch Register - PNOR mode control*/ - MMIO_SCRATCH_PNOR_MODE = 0x8, - /** Thread2 Scratch Register - Unused */ - MMIO_SCRATCH_ISTEP_MODE = 0x10, - /** Thread3 Scratch Register - Identifies if Hostboot is active after - * host_start_payload. */ + /** Identifies where hostboot currently resides and how large the + * space is */ + MMIO_SCRATCH_MEMORY_STATE = 0x08, + /** Spare scratch reg */ + MMIO_SCRATCH_SPARE = 0x10, + /** Identifies if Hostboot is active after host_start_payload. */ MMIO_SCRATCH_HOSTBOOT_ACTIVE = 0x18, - /** Thread4 Scratch Register - Unused */ - MMIO_SCRATCH_RSVD_T4 = 0x20, - /** Thread5 Scratch Register - Unused (unit tests may modify) */ - MMIO_SCRATCH_RSVD_T5_TESTCASES = 0x28, - /** Thread6 Scratch Register - Identifies where hostboot currently - resides and how large the space is */ - MMIO_SCRATCH_MEMORY_STATE = 0x30, - /** Thread7 Scratch Register - Set be SBE for reduced-threads support - * for AVPs. */ - MMIO_SCRATCH_AVP_THREADS = 0x38, }; /** @fn mmio_scratch_read() diff --git a/src/kernel/misc.C b/src/kernel/misc.C index 972a30a19..f7b6a0cc1 100644 --- a/src/kernel/misc.C +++ b/src/kernel/misc.C @@ -593,13 +593,17 @@ namespace KernelMisc case CORE_POWER8_MURANO: case CORE_POWER8_VENICE: case CORE_POWER8_NAPLES: + l_scratch_addr = l_scratch_addr + 0x40; + break; case CORE_POWER9_NIMBUS: case CORE_POWER9_CUMULUS: case CORE_UNKNOWN: - l_scratch_addr = l_scratch_addr + 0x40; - break; + default: + // See EX07.EC.CC.PCC0.COMMON.SPR_COMMON.SCOMC in scomdef for + // info on this offset - MODE_CX_SCOMC: 0000xxx = SCRATCH xx SPR + // It's 0 for P9 so just pass through scratch reg offset + break; } - writeScratchReg(l_scratch_addr, data); }; diff --git a/src/kernel/shutdown.S b/src/kernel/shutdown.S index 22ebfd1b0..b3c47725a 100644 --- a/src/kernel/shutdown.S +++ b/src/kernel/shutdown.S @@ -5,7 +5,7 @@ # # OpenPOWER HostBoot Project # -# Contributors Listed Below - COPYRIGHT 2012,2015 +# Contributors Listed Below - COPYRIGHT 2012,2016 # [+] International Business Machines Corp. # # @@ -143,7 +143,7 @@ kernel_shutdown_ea0_1_mode: isync 2: ;// Clear "Hostboot active" scratch register. - li r3, (0x40 + 0x18) ;// See sys/mmio.h + li r3, 0x18 ;// See sys/mmio.h mtspr SPRC, r3 li r3, 0x0 mtspr SPRD, r3 diff --git a/src/lib/syscall_mmio.C b/src/lib/syscall_mmio.C index 1a0de8a9f..f7bce955b 100644 --- a/src/lib/syscall_mmio.C +++ b/src/lib/syscall_mmio.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2010,2015 */ +/* Contributors Listed Below - COPYRIGHT 2010,2016 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -66,18 +66,19 @@ void mmio_hmer_write(uint64_t value) */ static uint64_t mmio_scratch_base() { - // @todo-RTC:130438 Verify value for P9 ProcessorCoreType cpuType = CpuID::getCpuType(); switch (cpuType) { case CORE_POWER8_MURANO: case CORE_POWER8_VENICE: case CORE_POWER8_NAPLES: + return 0x40; case CORE_POWER9_NIMBUS: case CORE_POWER9_CUMULUS: case CORE_UNKNOWN: default: - return 0x40; + // See misc.C - updateScratchReg() for more info on this + return 0x00; } } /** Global cache of the scratch register SPRC base address. */ |