Skip to content

Commit

Permalink
Use SCOM to access Master Processor's SBE MSG register
Browse files Browse the repository at this point in the history
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 <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>
Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/55893
Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com>
  • Loading branch information
crgeddes committed Apr 5, 2018
1 parent 211b0cb commit 02f8995
Showing 1 changed file with 21 additions and 5 deletions.
26 changes: 21 additions & 5 deletions src/import/chips/p9/procedures/hwp/sbe/p9_get_sbe_msg_register.C
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2016,2017 */
/* Contributors Listed Below - COPYRIGHT 2016,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -40,13 +40,29 @@
fapi2::ReturnCode p9_get_sbe_msg_register(const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>& i_chip,
sbeMsgReg_t& o_sbeReg)
{
fapi2::buffer<uint32_t> l_reg;

FAPI_DBG("Entering ...");

FAPI_TRY(fapi2::getCfamRegister(i_chip, PERV_SB_MSG_FSI, l_reg));
fapi2::buffer<uint32_t> l_cfamReg;
#ifdef __HOSTBOOT_MODULE
fapi2::buffer<uint64_t> 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 ...");

Expand Down

0 comments on commit 02f8995

Please sign in to comment.