diff options
Diffstat (limited to 'src/sbefw/app/power')
-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 |
4 files changed, 74 insertions, 5 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(); |