summaryrefslogtreecommitdiffstats
path: root/src/import
diff options
context:
space:
mode:
authorStephen Cprek <smcprek@us.ibm.com>2017-02-27 15:37:47 -0600
committerSachin Gupta <sgupta2m@in.ibm.com>2017-03-14 05:44:22 -0400
commit70255934e478e2038be21525efe1bacf605beaef (patch)
treea5677d611ecce6ab48a4376cc8a46b5005de5ecd /src/import
parente57a94a12b94f36993ecf35f8ef8e6cf2122a58e (diff)
downloadtalos-sbe-70255934e478e2038be21525efe1bacf605beaef.tar.gz
talos-sbe-70255934e478e2038be21525efe1bacf605beaef.zip
Add Secure Access Bit to Bootloader Config Data
RTC: 167741 Change-Id: I2708ad1da5ccca19ad2703e0944e9146de866f14 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/37123 Reviewed-by: Martin Gloff <mgloff@us.ibm.com> Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: PPE CI <ppe-ci+hostboot@us.ibm.com> Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com> Reviewed-by: Nicholas E. Bofferding <bofferdn@us.ibm.com> Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com> Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/37130 Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Stephen M. Cprek <smcprek@us.ibm.com> Reviewed-by: Sachin Gupta <sgupta2m@in.ibm.com>
Diffstat (limited to 'src/import')
-rw-r--r--src/import/chips/p9/procedures/hwp/nest/p9_sbe_hb_structures.H12
-rw-r--r--src/import/chips/p9/procedures/hwp/nest/p9_sbe_load_bootloader.C15
2 files changed, 24 insertions, 3 deletions
diff --git a/src/import/chips/p9/procedures/hwp/nest/p9_sbe_hb_structures.H b/src/import/chips/p9/procedures/hwp/nest/p9_sbe_hb_structures.H
index 5a6f430f..babec52d 100644
--- a/src/import/chips/p9/procedures/hwp/nest/p9_sbe_hb_structures.H
+++ b/src/import/chips/p9/procedures/hwp/nest/p9_sbe_hb_structures.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER sbe Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2016 */
+/* Contributors Listed Below - COPYRIGHT 2016,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -49,6 +49,15 @@
// Constant definitions
//-----------------------------------------------------------------------------------
+// Used for version checking as the BootloaderConfigData_t structure changes
+enum SbeBootloaderVersion
+{
+ // Keep initial version formatted as it was originally
+ INIT = 0x901,
+ // Later versions use format [release:2][version:2]
+ SAB_ADDED = 0x00090002
+};
+
// Structure starts at the bootloader zero address
struct BootloaderConfigData_t
{
@@ -57,6 +66,7 @@ struct BootloaderConfigData_t
uint8_t pnorBootSide; // 0=PNOR side A, 1=PNOR side B [ATTR_PNOR_BOOT_SIDE]
uint16_t pnorSizeMB; // Size of PNOR in MB [ATTR_PNOR_SIZE]
uint64_t blLoadSize; // Size of Load (Exception vectors and Bootloader)
+ uint8_t secureAccessBit;
};
#endif
diff --git a/src/import/chips/p9/procedures/hwp/nest/p9_sbe_load_bootloader.C b/src/import/chips/p9/procedures/hwp/nest/p9_sbe_load_bootloader.C
index e58e83a9..713b775e 100644
--- a/src/import/chips/p9/procedures/hwp/nest/p9_sbe_load_bootloader.C
+++ b/src/import/chips/p9/procedures/hwp/nest/p9_sbe_load_bootloader.C
@@ -47,6 +47,7 @@
#include <p9_quad_scom_addresses.H>
#include <p9_quad_scom_addresses_fld.H>
#include <p9_ram_core.H>
+#include <p9_perv_scom_addresses.H>
//-----------------------------------------------------------------------------------
// Constant definitions
@@ -55,7 +56,6 @@
// PBA setup/access HWP call constants
const bool PBA_HWP_WRITE_OP = false;
const int EXCEPTION_VECTOR_NUM_CACHELINES = 96;
-const uint32_t SBE_BOOTLOADER_VERSION = 0x901;
const uint8_t PERV_TO_CORE_POS_OFFSET = 0x20;
//-----------------------------------------------------------------------------------
// Function definitions
@@ -159,7 +159,7 @@ fapi2::ReturnCode p9_sbe_load_bootloader(
BootloaderConfigData_t l_bootloader_config_data;
- l_bootloader_config_data.version = SBE_BOOTLOADER_VERSION;
+ l_bootloader_config_data.version = SAB_ADDED;
//At address X + 0x8 put whatever is in ATTR_SBE_BOOT_SIDE
FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_SBE_BOOT_SIDE, FAPI_SYSTEM, l_bootloader_config_data.sbeBootSide),
@@ -190,6 +190,12 @@ fapi2::ReturnCode p9_sbe_load_bootloader(
// Pass size of load including exception vectors and Bootloader
l_bootloader_config_data.blLoadSize = l_exception_vector_size + i_payload_size;
+ // Get Secure Access Bit
+ FAPI_TRY(fapi2::getScom(i_master_chip_target, PERV_CBS_CS_SCOM, l_dataBuf),
+ "fapiGetScom of PERV_CBS_CS_SCOM failed");
+ l_bootloader_config_data.secureAccessBit = l_dataBuf.getBit<4>() ? 1 : 0;
+ l_dataBuf.flush<0>();
+
// move data using PBA setup/access HWPs
l_myPbaFlag.setFastMode(true); // FASTMODE
@@ -260,6 +266,11 @@ fapi2::ReturnCode p9_sbe_load_bootloader(
{
l_data_to_pass_to_pba_array[i] = (l_bootloader_config_data.blLoadSize >> (56 - 8 * ((i - 12) % 8))) & 0xFF;
}
+ //At address X + 0x14 put the secure access bit
+ else if (i == 20)
+ {
+ l_data_to_pass_to_pba_array[i] = l_bootloader_config_data.secureAccessBit;
+ }
//Fill the rest with the exception vector instruction
else
{
OpenPOWER on IntegriCloud