Skip to content

Commit

Permalink
Fill MBOX response on get capabilities
Browse files Browse the repository at this point in the history
Change-Id: I0d5f9cbc940a5f84278acea96d5f963b3a0a4d9e
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/59726
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: RAJA DAS <rajadas2@in.ibm.com>
Reviewed-by: Sachin Gupta <sgupta2m@in.ibm.com>
  • Loading branch information
Shakeebbk authored and sgupta2m committed Jun 21, 2018
1 parent 45f5609 commit 8ea4ecd
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/sbefw/app/common/sbecmdgeneric.C
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,28 @@ uint32_t sbePsuGetCapabilities(uint8_t *i_pArg)
SBE_SEC_INVALID_PARAMS);
break;
}

// Set MBOX response words
uint64_t data = (uint64_t)SBE_CAPABILITES_LEN_PSU & 0x00000000FFFFFFFFull;
rc = sbeWriteSbe2PsuMbxReg(SBE_HOST_PSU_MBOX_REG5,
&data,
sizeof(data)/sizeof(uint64_t));
if(SBE_SEC_OPERATION_SUCCESSFUL != rc)
{
SBE_ERROR(SBE_FUNC" Failed to write to "
"SBE_HOST_PSU_MBOX_REG5");
break;
}
rc = sbeWriteSbe2PsuMbxReg(SBE_HOST_PSU_MBOX_REG6,
(uint64_t*)&capMsg,
1);
if(SBE_SEC_OPERATION_SUCCESSFUL != rc)
{
SBE_ERROR(SBE_FUNC" Failed to write to "
"SBE_HOST_PSU_MBOX_REG6");
break;
}

p9_PBA_oper_flag l_myPbaFlag;
l_myPbaFlag.setOperationType(p9_PBA_oper_flag::INJ);

Expand Down
4 changes: 4 additions & 0 deletions src/test/testcases/testPSUGetCapabilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ def getCapabilities(addr, size, exp_status):
#----------------------------------------------------------------------------------------------------------------
["read", reg.PSU_HOST_DOORBELL_REG_WO_OR, "0", 8, "8000000000000000", "Reading Host Doorbell for Interrupt"],
)
length = 0
if exp_status == 0:
length = 92
'''
#---------------------
# Host side test data
Expand All @@ -106,6 +109,7 @@ def getCapabilities(addr, size, exp_status):
# OP Reg ValueToWrite size Test Expected Data Description
#----------------------------------------------------------------------------------------------------------------
["read", reg.REG_MBOX4, "0", 8, getdoubleword((exp_status << 32)+0x00F0D702), "Reading Host MBOX4 data to Validate"],
["read", reg.REG_MBOX5, "0", 8, getdoubleword(length), "Reading Host MBOX4 data to Validate"],
)
# HOST->SBE data set execution - Less length setup
regObj.ExecuteTestOp( testPSUUtil.simSbeObj, sbe_test_data )
Expand Down

0 comments on commit 8ea4ecd

Please sign in to comment.