diff options
author | Joe McGill <jmcgill@us.ibm.com> | 2018-06-11 17:02:08 -0500 |
---|---|---|
committer | Nicholas E. Bofferding <bofferdn@us.ibm.com> | 2018-06-20 18:13:10 -0400 |
commit | 8dba363050dcc367bbb05f838de6f7640deba6b3 (patch) | |
tree | e9374c5824ce44a42c92aabb570c1350802a73e7 /src/import/chips/p9 | |
parent | ccea7f349f6edc9729a6e7481bbba9060a62ecac (diff) | |
download | talos-hostboot-8dba363050dcc367bbb05f838de6f7640deba6b3.tar.gz talos-hostboot-8dba363050dcc367bbb05f838de6f7640deba6b3.zip |
shift OBUS FIR programming inits for secure boot
p9_sbe_scominit:
unmask all OBUS EXTFIR bits, use PB CENT FIR 14 to mark update
for downstream code (qualify XBUS/OBUS EXTFIR updates to apply to PPE
platform only)
p9_fab_iovalid:
conditionally unmask OBUS EXTFIR based on state of PB CENT FIR 14
(will handle unmasking here when insecure -- Cronus or old SBE images)
p9_obus_extfir_setup:
new HWP for HB to call, mask OBUS EXTFIR bits for unused busses
Change-Id: If54c36bbc4d431a4c91e63ce9678a54bb8ada95f
Original-Change-Id: I07e7da4a7c61c041451ff4ddfeec3c266385d404
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/60600
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: HWSV CI <hwsv-ci+hostboot@us.ibm.com>
Tested-by: PPE CI <ppe-ci+hostboot@us.ibm.com>
Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/60960
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: Christian R. Geddes <crgeddes@us.ibm.com>
Diffstat (limited to 'src/import/chips/p9')
3 files changed, 216 insertions, 0 deletions
diff --git a/src/import/chips/p9/procedures/hwp/nest/p9_obus_extfir_setup.C b/src/import/chips/p9/procedures/hwp/nest/p9_obus_extfir_setup.C new file mode 100644 index 000000000..7f7685187 --- /dev/null +++ b/src/import/chips/p9/procedures/hwp/nest/p9_obus_extfir_setup.C @@ -0,0 +1,103 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/import/chips/p9/procedures/hwp/nest/p9_obus_extfir_setup.C $ */ +/* */ +/* OpenPOWER HostBoot Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2018 */ +/* [+] 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. */ +/* You may obtain a copy of the License at */ +/* */ +/* http://www.apache.org/licenses/LICENSE-2.0 */ +/* */ +/* Unless required by applicable law or agreed to in writing, software */ +/* distributed under the License is distributed on an "AS IS" BASIS, */ +/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ +/* implied. See the License for the specific language governing */ +/* permissions and limitations under the License. */ +/* */ +/* IBM_PROLOG_END_TAG */ +/// +/// @file p9_obus_extfir_setup.C +/// @brief Manage fabric link iovalid controls (FAPI2) +/// +/// @author Joe McGill <jmcgill@us.ibm.com> +/// + +// +// *HWP HWP Owner: Joe McGill <jmcgill@us.ibm.com> +// *HWP FW Owner: Thi Tran <thi@us.ibm.com> +// *HWP Team: Nest +// *HWP Level: 3 +// *HWP Consumed by: HB +// + +//------------------------------------------------------------------------------ +// Includes +//------------------------------------------------------------------------------ +#include <p9_obus_extfir_setup.H> +#include <p9_misc_scom_addresses.H> +#include <p9_misc_scom_addresses_fld.H> + + +//------------------------------------------------------------------------------ +// Function definitions +//------------------------------------------------------------------------------ + + +// NOTE: see doxygen comments in header +fapi2::ReturnCode +p9_obus_extfir_setup(const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>& i_target, + const bool i_o0_smp_active, + const bool i_o1_smp_active, + const bool i_o2_smp_active, + const bool i_o3_smp_active) +{ + FAPI_INF("Start"); + + fapi2::buffer<uint64_t> l_fbc_cent_fir; + fapi2::buffer<uint64_t> l_ras_fir_mask; + + // read FBC center FIR to determine if SBE has unmasked all EXTFIR bits (new + // behavior) + FAPI_TRY(fapi2::getScom(i_target, PU_PB_CENT_SM0_PB_CENT_FIR_REG, l_fbc_cent_fir), + "Error from getScom (PU_PB_CENT_SM0_PB_CENT_FIR_REG)"); + + // new SBE code, set mask bits for inactive links + if (l_fbc_cent_fir.getBit<PU_PB_CENT_SM0_PB_CENT_FIR_MASK_REG_SPARE_14>()) + { + l_ras_fir_mask.flush<0>(); + + if (!i_o0_smp_active) + { + l_ras_fir_mask.setBit<PU_PB_CENT_SM1_EXTFIR_REG_PB_X3_FIR_ERR>(); + } + + if (!i_o1_smp_active) + { + l_ras_fir_mask.setBit<PU_PB_CENT_SM1_EXTFIR_REG_PB_X4_FIR_ERR>(); + } + + if (!i_o2_smp_active) + { + l_ras_fir_mask.setBit<PU_PB_CENT_SM1_EXTFIR_REG_PB_X5_FIR_ERR>(); + } + + if (!i_o3_smp_active) + { + l_ras_fir_mask.setBit<PU_PB_CENT_SM1_EXTFIR_REG_PB_X6_FIR_ERR>(); + } + + FAPI_TRY(fapi2::putScom(i_target, PU_PB_CENT_SM1_EXTFIR_MASK_REG_OR, l_ras_fir_mask), + "Error writing RAS FIR mask register (PU_PB_CENT_SM1_EXTFIR_MASK_REG_OR)!"); + } + +fapi_try_exit: + FAPI_INF("End"); + return fapi2::current_err; +} diff --git a/src/import/chips/p9/procedures/hwp/nest/p9_obus_extfir_setup.H b/src/import/chips/p9/procedures/hwp/nest/p9_obus_extfir_setup.H new file mode 100755 index 000000000..5be36dfd5 --- /dev/null +++ b/src/import/chips/p9/procedures/hwp/nest/p9_obus_extfir_setup.H @@ -0,0 +1,87 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/import/chips/p9/procedures/hwp/nest/p9_obus_extfir_setup.H $ */ +/* */ +/* OpenPOWER HostBoot Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2018 */ +/* [+] 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. */ +/* You may obtain a copy of the License at */ +/* */ +/* http://www.apache.org/licenses/LICENSE-2.0 */ +/* */ +/* Unless required by applicable law or agreed to in writing, software */ +/* distributed under the License is distributed on an "AS IS" BASIS, */ +/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ +/* implied. See the License for the specific language governing */ +/* permissions and limitations under the License. */ +/* */ +/* IBM_PROLOG_END_TAG */ +/// +/// @file p9_obus_extfir_setup.H +/// @brief Manage FBC EXTFIR setup (FAPI2) +/// +/// @author Joe McGill <jmcgill@us.ibm.com> +/// + +// +// *HWP HWP Owner: Joe McGill <jmcgill@us.ibm.com> +// *HWP FW Owner: Thi Tran <thi@us.ibm.com> +// *HWP Team: Nest +// *HWP Level: 3 +// *HWP Consumed by: HB +// + +#ifndef _P9_OBUS_EXTFIR_SETUP_H_ +#define _P9_OBUS_EXTFIR_SETUP_H_ + + +//------------------------------------------------------------------------------ +// Includes +//------------------------------------------------------------------------------ +#include <fapi2.H> + +//------------------------------------------------------------------------------ +// Structure definitions +//------------------------------------------------------------------------------ + +/// function pointer typedef definition for HWP call support +typedef fapi2::ReturnCode (*p9_obus_extfir_setup_FP_t) ( + const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>&, + const bool, + const bool, + const bool, + const bool); + +//------------------------------------------------------------------------------ +// Function prototypes +//------------------------------------------------------------------------------ + +extern "C" +{ + +/// +/// @brief Setup FBC EXTFIR for selected obus links +/// +/// @param[in] i_target Reference to processor chip target +/// @param[in] i_o0_smp_active OBUS0 active as fabric link? +/// @param[in] i_o1_smp_active OBUS1 active as fabric link? +/// @param[in] i_o2_smp_active OBUS2 active as fabric link? +/// @param[in] i_o3_smp_active OBUS3 active as fabric link? +/// +/// @return fapi::ReturnCode. FAPI2_RC_SUCCESS if success, else error code. +/// + fapi2::ReturnCode p9_obus_extfir_setup(const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>& i_target, + const bool i_o0_smp_active, + const bool i_o1_smp_active, + const bool i_o2_smp_active, + const bool i_o3_smp_active); + +} // extern "C" + +#endif // _P9_OBUS_EXTFIR_SETUP_H_ diff --git a/src/import/chips/p9/procedures/hwp/nest/p9_obus_extfir_setup.mk b/src/import/chips/p9/procedures/hwp/nest/p9_obus_extfir_setup.mk new file mode 100644 index 000000000..96313c74e --- /dev/null +++ b/src/import/chips/p9/procedures/hwp/nest/p9_obus_extfir_setup.mk @@ -0,0 +1,26 @@ +# IBM_PROLOG_BEGIN_TAG +# This is an automatically generated prolog. +# +# $Source: src/import/chips/p9/procedures/hwp/nest/p9_obus_extfir_setup.mk $ +# +# OpenPOWER HostBoot Project +# +# Contributors Listed Below - COPYRIGHT 2018 +# [+] 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. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. See the License for the specific language governing +# permissions and limitations under the License. +# +# IBM_PROLOG_END_TAG +PROCEDURE=p9_obus_extfir_setup +$(call BUILD_PROCEDURE) |