From 02f8995967cc97988cf3cdb40b1805915517bbaf Mon Sep 17 00:00:00 2001 From: Christian Geddes Date: Wed, 14 Mar 2018 15:07:39 -0500 Subject: Use SCOM to access Master Processor's SBE MSG register Previously we always used CFAM to acess the sbe_msg_register. However, this will fail if we attempt to read the master via CFAM. The master processor cannot call getCfam on itself. In the case where we need to get this msg reg from the master we must use scom. RTC: 180604 CQ: SW421405 Change-Id: Iaa199361272e30b73114fafb8d3f6887c794464b Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/55883 Tested-by: FSP CI Jenkins Tested-by: Jenkins Server Tested-by: HWSV CI Reviewed-by: Jennifer A. Stofer Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/55893 Reviewed-by: Christian R. Geddes --- .../procedures/hwp/sbe/p9_get_sbe_msg_register.C | 26 +++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) (limited to 'src/import/chips/p9') diff --git a/src/import/chips/p9/procedures/hwp/sbe/p9_get_sbe_msg_register.C b/src/import/chips/p9/procedures/hwp/sbe/p9_get_sbe_msg_register.C index 8f8b32a88..5e6ece884 100644 --- a/src/import/chips/p9/procedures/hwp/sbe/p9_get_sbe_msg_register.C +++ b/src/import/chips/p9/procedures/hwp/sbe/p9_get_sbe_msg_register.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2016,2017 */ +/* Contributors Listed Below - COPYRIGHT 2016,2018 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -40,13 +40,29 @@ fapi2::ReturnCode p9_get_sbe_msg_register(const fapi2::Target& i_chip, sbeMsgReg_t& o_sbeReg) { - fapi2::buffer l_reg; - FAPI_DBG("Entering ..."); - FAPI_TRY(fapi2::getCfamRegister(i_chip, PERV_SB_MSG_FSI, l_reg)); + fapi2::buffer l_cfamReg; +#ifdef __HOSTBOOT_MODULE + fapi2::buffer l_scomReg; +#ifndef __HOSTBOOT_RUNTIME + uint8_t l_is_master_chip = 0; + FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_PROC_SBE_MASTER_CHIP, i_chip, l_is_master_chip)); - o_sbeReg.reg = l_reg; + if(l_is_master_chip) +#else + if(true) +#endif + { + FAPI_TRY(fapi2::getScom(i_chip, PERV_SB_MSG_SCOM, l_scomReg)); + l_scomReg.extract<0, 32>(o_sbeReg.reg); + } + else +#endif + { + FAPI_TRY(fapi2::getCfamRegister(i_chip, PERV_SB_MSG_FSI, l_cfamReg)); + o_sbeReg.reg = l_cfamReg; + } FAPI_DBG("Exiting ..."); -- cgit v1.2.1