summaryrefslogtreecommitdiffstats
path: root/src/sbefw/app/power/sbecmdgeneric.C
diff options
context:
space:
mode:
Diffstat (limited to 'src/sbefw/app/power/sbecmdgeneric.C')
-rw-r--r--src/sbefw/app/power/sbecmdgeneric.C81
1 files changed, 1 insertions, 80 deletions
diff --git a/src/sbefw/app/power/sbecmdgeneric.C b/src/sbefw/app/power/sbecmdgeneric.C
index d0031da3..3f4294d0 100644
--- a/src/sbefw/app/power/sbecmdgeneric.C
+++ b/src/sbefw/app/power/sbecmdgeneric.C
@@ -6,6 +6,7 @@
/* OpenPOWER sbe Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2015,2018 */
+/* [+] International Business Machines Corp. */
/* */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); */
@@ -104,85 +105,5 @@ sbeCapabilityRespMsg::sbeCapabilityRespMsg()
#endif //__SBEFW_SEEPROM__
#ifndef __SBEFW_SEEPROM__
-//----------------------------------------------------------------------------
-uint32_t sbeReadMem( uint8_t *i_pArg )
-{
- #define SBE_FUNC "sbeReadMem"
- SBE_ENTER(SBE_FUNC);
- uint32_t rc = SBE_SEC_OPERATION_SUCCESSFUL;
- uint32_t fapiRc = FAPI2_RC_SUCCESS;
- sbeReadMemReq_t req = {};
-
- do
- {
- // Extract the request
- // and send Ack to Host via SBE_SBE2PSU_DOORBELL_SET_BIT1
- rc = sbeReadPsu2SbeMbxReg(SBE_HOST_PSU_MBOX_REG1,
- (sizeof(req)/sizeof(uint64_t)),
- (uint64_t*)&req,
- true);
- if(SBE_SEC_OPERATION_SUCCESSFUL != rc)
- {
- SBE_ERROR(SBE_FUNC "Failed to extract SBE_HOST_PSU_MBOX_REG1 and "
- "SBE_HOST_PSU_MBOX_REG2");
- break;
- }
-
- if(!( req.validateReq()) )
- {
- SBE_ERROR(SBE_FUNC"Invalid data. offset:0x%08X size:0x%08X",
- req.offset, req.size );
- SBE_GLOBAL->sbeSbe2PsuRespHdr.setStatus(SBE_PRI_USER_ERROR,
- SBE_SEC_INVALID_PARAMS);
- break;
- }
-
- // Default EX Target Init. As its not LCO mode, ex does not matter.
- fapi2::Target<fapi2::TARGET_TYPE_EX> l_ex(
- fapi2::plat_getTargetHandleByChipletNumber<fapi2::TARGET_TYPE_EX>(
- sbeMemAccessInterface::PBA_DEFAULT_EX_CHIPLET_ID));
- p9_PBA_oper_flag l_myPbaFlag;
- l_myPbaFlag.setOperationType(p9_PBA_oper_flag::INJ);
-
- sbeMemAccessInterface pbaInterface(
- SBE_MEM_ACCESS_PBA,
- req.responseAddr,
- &l_myPbaFlag,
- SBE_MEM_ACCESS_WRITE,
- sbeMemAccessInterface::PBA_GRAN_SIZE_BYTES,
- l_ex);
- uint32_t len = req.size;
- uint64_t *seepromAddr = req.getEffectiveAddr();
- while( len > 0)
- {
- uint64_t *dataBuffer = static_cast<uint64_t*>
- (pbaInterface.getBuffer());
- for(size_t idx=0;
- idx < (sbeMemAccessInterface::PBA_GRAN_SIZE_BYTES/
- sizeof(uint64_t));
- idx++)
- {
- *dataBuffer = *seepromAddr;
- dataBuffer++;
- seepromAddr++;
- }
-
- fapi2::ReturnCode fapiRc = pbaInterface.accessGranule(
- len == sbeMemAccessInterface::PBA_GRAN_SIZE_BYTES);
- if( fapiRc != fapi2::FAPI2_RC_SUCCESS)
- {
- break;
- }
- len = len - sbeMemAccessInterface::PBA_GRAN_SIZE_BYTES;
- }
- } while(false);
-
- // Send the response
- sbePSUSendResponse(SBE_GLOBAL->sbeSbe2PsuRespHdr, fapiRc, rc);
-
- SBE_EXIT(SBE_FUNC);
- return rc;
- #undef SBE_FUNC
-}
#endif //not __SBEFW_SEEPROM__
OpenPOWER on IntegriCloud