From 8ed959b6030f18379e0870feb4b85f8f5295303e Mon Sep 17 00:00:00 2001 From: Sachin Gupta Date: Fri, 9 Sep 2016 02:32:25 -0500 Subject: Use new PCBPIB enums in sbefw code Change-Id: I33c1ab68c24de4150c6f901a429c3bfde1de8ea0 RTC: 158199 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/29410 Tested-by: Jenkins Server Tested-by: FSP CI Jenkins Reviewed-by: Shakeeb A. Pasha B K Reviewed-by: AMIT J. TENDOLKAR Reviewed-by: RAJA DAS Reviewed-by: Sachin Gupta --- src/sbefw/sbeFifoMsgUtils.C | 4 +++- src/sbefw/sbe_sp_intf.H | 17 +---------------- src/sbefw/sbecmdcntrldmt.C | 9 ++++++--- src/sbefw/sbecmdscomaccess.C | 10 ++++++---- src/sbefw/sbescom.C | 11 ++++++----- 5 files changed, 22 insertions(+), 29 deletions(-) (limited to 'src/sbefw') diff --git a/src/sbefw/sbeFifoMsgUtils.C b/src/sbefw/sbeFifoMsgUtils.C index d8e433a2..6edc341e 100644 --- a/src/sbefw/sbeFifoMsgUtils.C +++ b/src/sbefw/sbeFifoMsgUtils.C @@ -6,6 +6,7 @@ /* OpenPOWER sbe Project */ /* */ /* Contributors Listed Below - COPYRIGHT 2015,2016 */ +/* [+] International Business Machines Corp. */ /* */ /* */ /* Licensed under the Apache License, Version 2.0 (the "License"); */ @@ -33,6 +34,7 @@ #include "sbe_sp_intf.H" #include "sbeFifoMsgUtils.H" #include "sbeerrorcodes.H" +#include "plat_hw_access.H" #include "assert.h" #include "sbeFFDC.H" #include "hwp_error_info.H" @@ -267,7 +269,7 @@ void sbeBuildMinRespHdr ( uint32_t *io_pBuf, // Pcb-Pib error is optional, // not needed for success case if ( (i_primStatus != SBE_PRI_OPERATION_SUCCESSFUL) || - (i_pcbpibStatus != SBE_PCB_PIB_ERROR_NONE) ) + (i_pcbpibStatus != PIB_NO_ERROR) ) { io_pBuf[++io_curIndex] = i_pcbpibStatus; } diff --git a/src/sbefw/sbe_sp_intf.H b/src/sbefw/sbe_sp_intf.H index 0734343d..f210adb7 100644 --- a/src/sbefw/sbe_sp_intf.H +++ b/src/sbefw/sbe_sp_intf.H @@ -6,6 +6,7 @@ /* OpenPOWER sbe Project */ /* */ /* Contributors Listed Below - COPYRIGHT 2015,2016 */ +/* [+] International Business Machines Corp. */ /* */ /* */ /* Licensed under the Apache License, Version 2.0 (the "License"); */ @@ -218,22 +219,6 @@ enum sbeCmdRespTimeout SBE_CMD_TIMEOUT_LONG_IN_MSEC = 30000, }; -/** - * @brief enums for PCB-PIB Generic Error codes - * -*/ -enum sbePCBPIBErrorRC -{ - SBE_PCB_PIB_ERROR_NONE = 0x00, - SBE_PCB_PIB_ERROR_RESOURCE_OCCUPIED = 0x01, - SBE_PCB_PIB_ERROR_CHIPLET_OFFLINE = 0x02, - SBE_PCB_PIB_ERROR_PARTIAL_GOOD = 0x03, - SBE_PCB_PIB_ERROR_ADDRESS_ERROR = 0x04, - SBE_PCB_PIB_ERROR_CLOCK_ERROR = 0x05, - SBE_PCB_PIB_ERROR_PACKET_ERROR = 0x06, - SBE_PCB_PIB_ERROR_TIMEOUT = 0x07, -}; - /** * @brief capabilities index values. * Get Capability response will return 18 capabilities. This diff --git a/src/sbefw/sbecmdcntrldmt.C b/src/sbefw/sbecmdcntrldmt.C index a4cf8c97..a1a43c96 100644 --- a/src/sbefw/sbecmdcntrldmt.C +++ b/src/sbefw/sbecmdcntrldmt.C @@ -6,6 +6,7 @@ /* OpenPOWER sbe Project */ /* */ /* Contributors Listed Below - COPYRIGHT 2016 */ +/* [+] International Business Machines Corp. */ /* */ /* */ /* Licensed under the Apache License, Version 2.0 (the "License"); */ @@ -37,6 +38,7 @@ #include "sbestates.H" #include "sbe_sp_intf.H" #include "fapi2.H" +#include "plat_hw_access.H" #include "p9_sbe_check_master_stop15.H" #include "p9_perv_scom_addresses.H" #include "p9_block_wakeup_intr.H" @@ -65,9 +67,10 @@ void sbeDmtPkExpiryCallback(void *) SBE_DUMP_FAILURE_EVENT); // check stop the system - uint32_t l_status = SBE_PCB_PIB_ERROR_NONE; - l_status = putscom_abs (PERV_N3_LOCAL_FIR_OR, N3_FIR_CORE_CHECKSTOP_BIT); - if(SBE_PCB_PIB_ERROR_NONE != l_status) + uint32_t l_status = PIB_NO_ERROR; + l_status = putscom_abs_wrap(PERV_N3_LOCAL_FIR_OR, + N3_FIR_CORE_CHECKSTOP_BIT); + if(PIB_NO_ERROR != l_status) { // Scom failed SBE_ERROR(SBE_FUNC "PutScom failed for REG PERV_N3_LOCAL_FIR"); diff --git a/src/sbefw/sbecmdscomaccess.C b/src/sbefw/sbecmdscomaccess.C index e99ce89f..835dd12c 100644 --- a/src/sbefw/sbecmdscomaccess.C +++ b/src/sbefw/sbecmdscomaccess.C @@ -6,6 +6,7 @@ /* OpenPOWER sbe Project */ /* */ /* Contributors Listed Below - COPYRIGHT 2015,2016 */ +/* [+] International Business Machines Corp. */ /* */ /* */ /* Licensed under the Apache License, Version 2.0 (the "License"); */ @@ -35,6 +36,7 @@ #include "sbescom.H" #include "sbeutil.H" #include "sbeFifoMsgUtils.H" +#include "plat_hw_access.H" ////////////////////////////////////////////////////// @@ -67,7 +69,7 @@ uint32_t sbeGetScom (uint8_t *i_pArg) } uint32_t l_sbeDownFifoRespBuf[6] = {0}; - uint32_t l_pcbpibStatus = SBE_PCB_PIB_ERROR_NONE; + uint32_t l_pcbpibStatus = PIB_NO_ERROR; uint32_t l_len2enqueue = 0; uint32_t l_index = 0; @@ -168,7 +170,7 @@ uint32_t sbePutScom (uint8_t *i_pArg) uint64_t l_scomData = 0; uint32_t l_sbeDownFifoRespBuf[4] = {0}; - uint32_t l_pcbpibStatus = SBE_PCB_PIB_ERROR_NONE; + uint32_t l_pcbpibStatus = PIB_NO_ERROR; uint32_t l_len2enqueue = 0; // successfully dequeued two entries for // scom address followed by the EOT entry @@ -265,7 +267,7 @@ uint32_t sbeModifyScom (uint8_t *i_pArg) } uint32_t l_sbeDownFifoRespBuf[4] = {0}; - uint32_t l_pcbpibStatus = SBE_PCB_PIB_ERROR_NONE; + uint32_t l_pcbpibStatus = PIB_NO_ERROR; uint32_t l_len2enqueue = 0; // Modifying Data @@ -407,7 +409,7 @@ uint32_t sbePutScomUnderMask (uint8_t *i_pArg) } uint32_t l_sbeDownFifoRespBuf[4] = {0}; - uint32_t l_pcbpibStatus = SBE_PCB_PIB_ERROR_NONE; + uint32_t l_pcbpibStatus = PIB_NO_ERROR; uint32_t l_len2enqueue = 0; SBE_DEBUG(SBE_FUNC"scomAddr[0x%08X%08X]," diff --git a/src/sbefw/sbescom.C b/src/sbefw/sbescom.C index 5d397902..81cfafde 100644 --- a/src/sbefw/sbescom.C +++ b/src/sbefw/sbescom.C @@ -26,8 +26,9 @@ #include #include "sbe_sp_intf.H" #include "sbetrace.H" -#include "ppe42_scom.h" +#include "plat_hw_access.H" +using namespace fapi2; /** * @brief Indirect SCOM Status */ @@ -82,12 +83,12 @@ uint32_t checkIndirectAndDoScom( const bool i_isRead, SBE_INFO(SBE_FUNC "Performing Direct scom."); if( i_isRead ) { - o_pcbPibStatus = getscom_abs ( (uint32_t)i_addr, + o_pcbPibStatus = getscom_abs_wrap ( (uint32_t)i_addr, & io_data); } else { - o_pcbPibStatus = putscom_abs ( (uint32_t)i_addr, + o_pcbPibStatus = putscom_abs_wrap ( (uint32_t)i_addr, io_data); } break; @@ -144,7 +145,7 @@ uint32_t checkIndirectAndDoScom( const bool i_isRead, // perform write before the read with the new // IO_buffer with the imbedded indirect scom addr. - o_pcbPibStatus = putscom_abs ( tempAddr, tempBuffer); + o_pcbPibStatus = putscom_abs_wrap ( tempAddr, tempBuffer); if( ( o_pcbPibStatus ) || ( scomType == SBE_SCOM_TYPE_INDIRECT_2 )) { @@ -158,7 +159,7 @@ uint32_t checkIndirectAndDoScom( const bool i_isRead, { // Now perform the op requested using the passed in // IO_Buffer to pass the read data back to caller. - o_pcbPibStatus = getscom_abs ( tempAddr, &(scomout.data64)); + o_pcbPibStatus = getscom_abs_wrap ( tempAddr, &(scomout.data64)); if( o_pcbPibStatus ) break; // if bit 32 is on indicating a complete bit -- cgit v1.2.1