diff options
author | Sunil Kumar <skumar8j@in.ibm.com> | 2019-01-03 05:23:44 -0600 |
---|---|---|
committer | RAJA DAS <rajadas2@in.ibm.com> | 2019-01-07 06:54:43 -0600 |
commit | 64cbaffb38a087fb92ce093d1127e5269e7faae0 (patch) | |
tree | a5d6a4aeb3a1b40fb25e067588b2e6e4e28088bb /src/sbefw | |
parent | 658b2f4ef5f3057b1c7ea0cf0a0fa7579451a81e (diff) | |
download | talos-sbe-64cbaffb38a087fb92ce093d1127e5269e7faae0.tar.gz talos-sbe-64cbaffb38a087fb92ce093d1127e5269e7faae0.zip |
Flush NVDIMM Chipop
Change-Id: Ibf249b59fd20f883a8b01e640f3e9be5f4a68500
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/70070
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: RAJA DAS <rajadas2@in.ibm.com>
Diffstat (limited to 'src/sbefw')
-rw-r--r-- | src/sbefw/app/power/chipop_table.C | 6 | ||||
-rw-r--r-- | src/sbefw/app/power/sbecmdgeneric.C | 5 | ||||
-rw-r--r-- | src/sbefw/app/power/sbecmdiplcontrol.C | 56 | ||||
-rw-r--r-- | src/sbefw/app/power/sbecmdiplcontrol.H | 12 | ||||
-rw-r--r-- | src/sbefw/core/sbe_sp_intf.H | 5 |
5 files changed, 78 insertions, 6 deletions
diff --git a/src/sbefw/app/power/chipop_table.C b/src/sbefw/app/power/chipop_table.C index fb0f6ea1..1431b343 100644 --- a/src/sbefw/app/power/chipop_table.C +++ b/src/sbefw/app/power/chipop_table.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER sbe Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2017,2018 */ +/* Contributors Listed Below - COPYRIGHT 2017,2019 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -93,6 +93,10 @@ CMD_ARR( {sbeHandleSuspendIO, SBE_CMD_SUSPEND_IO, SBE_FENCE_AT_DUMPING, + }, + {sbeHandleFlushNVDIMM, + SBE_CMD_FLUSH_NVDIMM, + HARDWARE_FENCED_STATE|SBE_FENCE_AT_DUMPING, } ) diff --git a/src/sbefw/app/power/sbecmdgeneric.C b/src/sbefw/app/power/sbecmdgeneric.C index 4064da29..0879ba29 100644 --- a/src/sbefw/app/power/sbecmdgeneric.C +++ b/src/sbefw/app/power/sbecmdgeneric.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER sbe Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2015,2018 */ +/* Contributors Listed Below - COPYRIGHT 2015,2019 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -99,7 +99,8 @@ void updateFifoCapabilities(uint32_t * capability) // Update Capability flags based on lastes spec. capability[IPL_CAPABILITY_START_IDX] = EXECUTE_ISTEP_SUPPPORTED | - SUSPEND_IO_SUPPPORTED; + SUSPEND_IO_SUPPPORTED | + FLUSH_NVDIMM_SUPPPORTED; capability[IPL_CAPABILITY_START_IDX+1] = RESERVED_A1_CAPABILITIES; diff --git a/src/sbefw/app/power/sbecmdiplcontrol.C b/src/sbefw/app/power/sbecmdiplcontrol.C index f18d41be..88eb9b8d 100644 --- a/src/sbefw/app/power/sbecmdiplcontrol.C +++ b/src/sbefw/app/power/sbecmdiplcontrol.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER sbe Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2015,2018 */ +/* Contributors Listed Below - COPYRIGHT 2015,2019 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -47,6 +47,7 @@ #include "p9n2_quad_scom_addresses.H" #include "p9_suspend_io.H" +//#include "nvdimm_workarounds.H" #include <p9_sbe_attr_setup.H> @@ -305,6 +306,59 @@ uint32_t sbeHandleSuspendIO(uint8_t *i_pArg) } //---------------------------------------------------------------------------- +/////////////////////////////////////////////////////////////////////// +// @brief sbeHandleFlushNVDIMM Sbe flush NVDIMM function +// +// @return RC from the underlying FIFO utility +/////////////////////////////////////////////////////////////////////// + +//mss::workarounds::nvdimm::p9_flush_nvdimm_FP_t p9_flush_nvdimm_hwp = &mss::workarounds::nvdimm::trigger_csave; + +uint32_t sbeHandleFlushNVDIMM(uint8_t *i_pArg) +{ + + #define SBE_FUNC " sbeHandleFlushNVDIMM " + SBE_ENTER(SBE_FUNC); + uint32_t rc = SBE_SEC_OPERATION_SUCCESSFUL; + ReturnCode fapiRc = FAPI2_RC_SUCCESS; + uint32_t len = 0; + sbeRespGenHdr_t respHdr; + respHdr.init(); + sbeResponseFfdc_t ffdc; + //Target<TARGET_TYPE_PROC_CHIP > procTgt = plat_getChipTarget(); + + do + { + // Dequeue the EOT entry as no more data is expected. + rc = sbeUpFifoDeq_mult (len, NULL); + CHECK_SBE_RC_AND_BREAK_IF_NOT_SUCCESS(rc); + + //SBE_EXEC_HWP(fapiRc, p9_flush_nvdimm_hwp, procTgt); + if( fapiRc != FAPI2_RC_SUCCESS ) + { + SBE_ERROR(SBE_FUNC "p9_flush_NVDIMM_hwp failed"); + respHdr.setStatus( SBE_PRI_GENERIC_EXECUTION_FAILURE, + SBE_SEC_HWP_FAILURE); + ffdc.setRc(fapiRc); + break; + } + }while(0); + + // Create the Response to caller + do + { + // If there was a FIFO error, will skip sending the response, + // instead give the control back to the command processor thread + CHECK_SBE_RC_AND_BREAK_IF_NOT_SUCCESS(rc); + rc = sbeDsSendRespHdr( respHdr, &ffdc); + }while(0); + + SBE_EXIT(SBE_FUNC); + return rc; + #undef SBE_FUNC +} +//---------------------------------------------------------------------------- + ReturnCode performAttrSetup( ) { #define SBE_FUNC "performAttrSetup " diff --git a/src/sbefw/app/power/sbecmdiplcontrol.H b/src/sbefw/app/power/sbecmdiplcontrol.H index 6e0993f0..9721b212 100644 --- a/src/sbefw/app/power/sbecmdiplcontrol.H +++ b/src/sbefw/app/power/sbecmdiplcontrol.H @@ -5,7 +5,8 @@ /* */ /* OpenPOWER sbe Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2015,2018 */ +/* Contributors Listed Below - COPYRIGHT 2015,2019 */ +/* [+] International Business Machines Corp. */ /* */ /* */ /* Licensed under the Apache License, Version 2.0 (the "License"); */ @@ -44,6 +45,15 @@ */ uint32_t sbeHandleSuspendIO(uint8_t *i_pArg); +/** + * @brief execute flush NVDIMM chip-op (0xA103) + * + * @param[in] i_pArg Buffer to be passed to the function (not used as of now) + * + * @return Rc from the FIFO access utility + */ +uint32_t sbeHandleFlushNVDIMM(uint8_t *i_pArg); + // Utility function to do TPM reset fapi2::ReturnCode performTpmReset(); diff --git a/src/sbefw/core/sbe_sp_intf.H b/src/sbefw/core/sbe_sp_intf.H index 678ab626..3542823c 100644 --- a/src/sbefw/core/sbe_sp_intf.H +++ b/src/sbefw/core/sbe_sp_intf.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER sbe Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2015,2018 */ +/* Contributors Listed Below - COPYRIGHT 2015,2019 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -73,6 +73,7 @@ enum sbeIplControlCommands { SBE_CMD_EXECUTE_ISTEP = 0x01, /* Execute istep */ SBE_CMD_SUSPEND_IO = 0x02, /* Suspend IO */ + SBE_CMD_FLUSH_NVDIMM = 0x03, /* Flush NVDIMM */ }; /** @@ -230,6 +231,7 @@ enum sbeSecondaryResponse SBE_SEC_SPECIAL_WAKEUP_SCOM_FAILURE = 0x29, SBE_SEC_S0_ARCH_REG_DUMP_FAILED = 0x2A, SBE_SEC_LPC_ACCESS_FAILED = 0x2B, + SBE_SEC_HWP_FAILURE = 0x2C, }; /** @@ -280,6 +282,7 @@ enum EXECUTE_ISTEP_SUPPPORTED = 0xA1000001, SUSPEND_IO_SUPPPORTED = 0xA1000002, + FLUSH_NVDIMM_SUPPPORTED = 0xA1000003, RESERVED_A1_CAPABILITIES = 0xA1800000, GET_SCOM_SUPPPORTED = 0xA2000001, |