summaryrefslogtreecommitdiffstats
path: root/src/usr/htmgt/htmgt.C
diff options
context:
space:
mode:
Diffstat (limited to 'src/usr/htmgt/htmgt.C')
-rw-r--r--src/usr/htmgt/htmgt.C664
1 files changed, 384 insertions, 280 deletions
diff --git a/src/usr/htmgt/htmgt.C b/src/usr/htmgt/htmgt.C
index 502b661e0..fb23ee008 100644
--- a/src/usr/htmgt/htmgt.C
+++ b/src/usr/htmgt/htmgt.C
@@ -44,8 +44,8 @@
// HBOCC support
#include <hwpf/hwp/occ/occ_common.H>
-
#include <sys/time.h>
+#include <targeting/common/attributeTank.H>
namespace HTMGT
{
@@ -55,7 +55,7 @@ namespace HTMGT
void processOccStartStatus(const bool i_startCompleted,
TARGETING::Target * i_failedOccTarget)
{
- TMGT_INF(">>processOccStartStatus(%d,%p)",
+ TMGT_INF(">>processOccStartStatus(%d,0x%p)",
i_startCompleted, i_failedOccTarget);
errlHndl_t l_err = NULL;
uint32_t l_huid = 0;
@@ -65,156 +65,170 @@ namespace HTMGT
}
TMGT_INF("processOccStartStatus(Start Success=%c, failedOcc=0x%08X)",
i_startCompleted?'y':'n', l_huid);
- if (i_startCompleted)
+ if (false == int_flags_set(FLAG_HOLD_OCCS_IN_RESET))
{
- // Query functional OCCs
- l_err = OccManager::buildOccs();
- if (NULL == l_err)
+ if (i_startCompleted)
{
- if (NULL != OccManager::getMasterOcc())
+ // Query functional OCCs
+ l_err = OccManager::buildOccs();
+ if (NULL == l_err)
{
- do
+ if (NULL != OccManager::getMasterOcc())
{
-#ifndef __HOSTBOOT_RUNTIME
- // Build normal pstate tables (once per IPL)
- l_err = genPstateTables(true);
- if(l_err)
+ do
{
- break;
- }
+#ifndef __HOSTBOOT_RUNTIME
+ // Build normal pstate tables (once per IPL)
+ l_err = genPstateTables(true);
+ if(l_err)
+ {
+ break;
+ }
- // Calc memory throttles (once per IPL)
- calcMemThrottles();
+ // Calc memory throttles (once per IPL)
+ calcMemThrottles();
#endif
- // Make sure OCCs are ready for communication
- l_err = OccManager::waitForOccCheckpoint();
- if (l_err)
- {
- break;
- }
+ // Make sure OCCs are ready for communication
+ OccManager::waitForOccCheckpoint();
#ifdef __HOSTBOOT_RUNTIME
- // TODO RTC 124738 Final solution TBD
- // Perhapse POLL scom 0x6a214 until bit 31 is set?
- nanosleep(1,0);
+ // TODO RTC 124738 Final solution TBD
+ // Perhapse POLL scom 0x6a214 until bit 31 is set?
+ nanosleep(1,0);
#endif
- // Send poll to establish comm
- TMGT_INF("Send initial poll to all OCCs to"
- " establish comm");
- l_err = OccManager::sendOccPoll();
- if (l_err)
- {
- if (OccManager::occNeedsReset())
+ // Send poll to establish comm
+ TMGT_INF("Send initial poll to all OCCs to"
+ " establish comm");
+ l_err = OccManager::sendOccPoll();
+ if (l_err)
{
- // No need to continue if reset is required
- TMGT_ERR("sendOccConfigData(): OCCs need "
- "to be reset");
- break;
- }
- else
- {
- // Continue even if failed (will be retried)
- ERRORLOG::errlCommit(l_err, HTMGT_COMP_ID);
+ if (OccManager::occNeedsReset())
+ {
+ // No need to continue if reset is required
+ TMGT_ERR("sendOccConfigData(): OCCs need "
+ "to be reset");
+ break;
+ }
+ else
+ {
+ // Continue even if failed (will be retried)
+ ERRORLOG::errlCommit(l_err, HTMGT_COMP_ID);
+ }
}
- }
- // Send ALL config data
- sendOccConfigData();
+ // Send ALL config data
+ sendOccConfigData();
- // Set the User PCAP
- l_err = sendOccUserPowerCap();
- if (l_err)
- {
- break;
- }
+ // Set the User PCAP
+ l_err = sendOccUserPowerCap();
+ if (l_err)
+ {
+ break;
+ }
- // Wait for all OCCs to go to the target state
- l_err = waitForOccState();
- if ( l_err )
- {
- break;
- }
+ // Wait for all OCCs to go to the target state
+ l_err = waitForOccState();
+ if ( l_err )
+ {
+ break;
+ }
- // Set active sensors for all OCCs,
- // so BMC can start communication with OCCs
- l_err = setOccActiveSensors(true);
- if (l_err)
- {
- // Continue even if failed to update sensor
- ERRORLOG::errlCommit(l_err, HTMGT_COMP_ID);
- }
+ // Set active sensors for all OCCs,
+ // so BMC can start communication with OCCs
+ l_err = setOccActiveSensors(true);
+ if (l_err)
+ {
+ // Continue even if failed to update sensor
+ ERRORLOG::errlCommit(l_err, HTMGT_COMP_ID);
+ }
- } while(0);
+ } while(0);
+ }
+ else
+ {
+ TMGT_ERR("Unable to find any Master capable OCCs");
+ /*@
+ * @errortype
+ * @reasoncode HTMGT_RC_OCC_MASTER_NOT_FOUND
+ * @moduleid HTMGT_MOD_LOAD_START_STATUS
+ * @userdata1 number of OCCs
+ * @devdesc No OCC master was found
+ */
+ bldErrLog(l_err, HTMGT_MOD_LOAD_START_STATUS,
+ HTMGT_RC_OCC_MASTER_NOT_FOUND,
+ 0, OccManager::getNumOccs(), 0, 0,
+ ERRORLOG::ERRL_SEV_INFORMATIONAL);
+ }
}
else
{
- TMGT_ERR("Unable to find any Master capable OCCs");
- /*@
- * @errortype
- * @reasoncode HTMGT_RC_OCC_MASTER_NOT_FOUND
- * @moduleid HTMGT_MOD_LOAD_START_STATUS
- * @userdata1 number of OCCs
- * @devdesc No OCC master was found
- */
- bldErrLog(l_err, HTMGT_MOD_LOAD_START_STATUS,
- HTMGT_RC_OCC_MASTER_NOT_FOUND,
- 0, OccManager::getNumOccs(), 0, 0,
- ERRORLOG::ERRL_SEV_INFORMATIONAL);
+ // Failed to find functional OCCs, no need to try again
+ // Set original error log as unrecoverable and commit
+ l_err->setSev(ERRORLOG::ERRL_SEV_UNRECOVERABLE);
+ ERRORLOG::errlCommit(l_err, HTMGT_COMP_ID);
}
}
else
{
- // Failed to find functional OCCs, no need to try again
- // Set original error log as unrecoverable and commit
- l_err->setSev(ERRORLOG::ERRL_SEV_UNRECOVERABLE);
- ERRORLOG::errlCommit(l_err, HTMGT_COMP_ID);
+ TMGT_ERR("All OCCs were not loaded/started successfully");
+ /*@
+ * @errortype
+ * @reasoncode HTMGT_RC_OCC_START_FAIL
+ * @moduleid HTMGT_MOD_LOAD_START_STATUS
+ * @userdata1 Failing OCC HUID
+ * @devdesc OCCs were not loaded/started successfully
+ */
+ bldErrLog(l_err, HTMGT_MOD_LOAD_START_STATUS,
+ HTMGT_RC_OCC_START_FAIL,
+ 0, l_huid, 0, 0,
+ ERRORLOG::ERRL_SEV_INFORMATIONAL);
}
- }
- else
- {
- TMGT_ERR("All OCCs were not loaded/started successfully");
- /*@
- * @errortype
- * @reasoncode HTMGT_RC_OCC_START_FAIL
- * @moduleid HTMGT_MOD_LOAD_START_STATUS
- * @userdata1 Failing OCC HUID
- * @devdesc OCCs were not loaded/started successfully
- */
- bldErrLog(l_err, HTMGT_MOD_LOAD_START_STATUS,
- HTMGT_RC_OCC_START_FAIL,
- 0, l_huid, 0, 0,
- ERRORLOG::ERRL_SEV_INFORMATIONAL);
- }
- if (NULL != l_err)
- {
- TMGT_ERR("OCCs not all active (rc=0x%04X). Attempting OCC "
- "Reset", l_err->reasonCode());
- TMGT_CONSOLE("OCCs are not active (rc=0x%04X). "
- "Attempting OCC Reset",
- l_err->reasonCode());
- TMGT_INF("processOccStartStatus: Calling resetOccs");
- errlHndl_t err2 = OccManager::resetOccs(NULL);
- if(err2)
+ if (NULL != l_err)
{
- TMGT_ERR("OccManager::resetOccs failed with 0x%04X",
- err2->reasonCode());
+ TMGT_ERR("OCCs not all active (rc=0x%04X). Attempting OCC "
+ "Reset", l_err->reasonCode());
+ TMGT_CONSOLE("OCCs are not active (rc=0x%04X). "
+ "Attempting OCC Reset",
+ l_err->reasonCode());
+ TMGT_INF("processOccStartStatus: Calling resetOccs");
+ errlHndl_t err2 = OccManager::resetOccs(NULL);
+ if(err2)
+ {
+ TMGT_ERR("OccManager::resetOccs failed with 0x%04X",
+ err2->reasonCode());
- // Set original error log as unrecoverable and commit
- l_err->setSev(ERRORLOG::ERRL_SEV_UNRECOVERABLE);
- ERRORLOG::errlCommit(l_err, HTMGT_COMP_ID);
+ // Set original error log as unrecoverable and commit
+ l_err->setSev(ERRORLOG::ERRL_SEV_UNRECOVERABLE);
+ ERRORLOG::errlCommit(l_err, HTMGT_COMP_ID);
- // Commit occReset error
- ERRORLOG::errlCommit(err2, HTMGT_COMP_ID);
+ // Commit occReset error
+ ERRORLOG::errlCommit(err2, HTMGT_COMP_ID);
+ }
+ else
+ {
+ // retry worked - commit original error as informational
+ l_err->setSev(ERRORLOG::ERRL_SEV_INFORMATIONAL);
+ ERRORLOG::errlCommit(l_err, HTMGT_COMP_ID);
+ }
}
- else
+ }
+ else
+ {
+ TMGT_INF("processOccStartStatus: Skipping start of OCCS due to "
+ "internal flags 0x%08X", get_int_flags());
+ // Reset all OCCs
+ TMGT_INF("processOccStartStatus: Calling HBOCC::stopAllOCCs");
+ l_err = HBOCC::stopAllOCCs();
+ if(l_err)
{
- // retry worked - commit original error as informational
l_err->setSev(ERRORLOG::ERRL_SEV_INFORMATIONAL);
+ l_err->collectTrace("HTMGT");
ERRORLOG::errlCommit(l_err, HTMGT_COMP_ID);
}
+
}
TMGT_INF("<<processOccStartStatus()");
@@ -226,7 +240,7 @@ namespace HTMGT
// Notify HTMGT that an OCC has an error to report
void processOccError(TARGETING::Target * i_procTarget)
{
- TMGT_INF(">>processOccError(%p)", i_procTarget);
+ TMGT_INF(">>processOccError(0x%p)", i_procTarget);
TARGETING::Target* sys = NULL;
TARGETING::targetService().getTopLevelTarget(sys);
@@ -302,7 +316,7 @@ namespace HTMGT
// Notify HTMGT that an OCC has failed and needs to be reset
void processOccReset(TARGETING::Target * i_proc)
{
- TMGT_INF(">>processOccReset(%p)", i_proc);
+ TMGT_INF(">>processOccReset(0x%p)", i_proc);
errlHndl_t errl = NULL;
TARGETING::Target * failedOccTarget = NULL;
@@ -318,14 +332,12 @@ namespace HTMGT
return;
}
- if (i_proc)
+ // Get functional OCC (one per proc)
+ TARGETING::TargetHandleList pOccs;
+ getChildChiplets(pOccs, i_proc, TARGETING::TYPE_OCC);
+ if (pOccs.size() > 0)
{
- TARGETING::TargetHandleList pOccs;
- getChildChiplets(pOccs, i_proc, TARGETING::TYPE_OCC);
- if (pOccs.size() > 0)
- {
- failedOccTarget = pOccs[0];
- }
+ failedOccTarget = pOccs[0];
}
if(NULL != failedOccTarget)
@@ -359,12 +371,21 @@ namespace HTMGT
ERRORLOG::errlCommit(errl, HTMGT_COMP_ID); // sets errl to NULL
}
- errl = OccManager::resetOccs(failedOccTarget);
- if(errl)
+ if (false == int_flags_set(FLAG_EXT_RESET_DISABLED))
{
- ERRORLOG::errlCommit(errl, HTMGT_COMP_ID); // sets errl to NULL
+ errl = OccManager::resetOccs(failedOccTarget);
+ if(errl)
+ {
+ ERRORLOG::errlCommit(errl, HTMGT_COMP_ID); // sets errl to NULL
+ }
+ }
+ else
+ {
+ TMGT_INF("processOccReset: Skipping external reset due to "
+ "internal flags 0x%08X", get_int_flags());
}
TMGT_INF("<<processOccReset()");
+
} // end processOccReset()
@@ -460,6 +481,57 @@ namespace HTMGT
+ errlHndl_t dumpAttribute(const uint16_t i_length,
+ const uint8_t * i_data,
+ uint16_t & o_attrLength,
+ uint8_t * o_attrData)
+ {
+ errlHndl_t err = NULL;
+ uint32_t attrId = 0;
+
+ if ((i_data[0] == ATTR_RAW) && (i_length == 5))
+ {
+ // Dump attribute based on raw ID
+
+ attrId = UINT32_GET(&i_data[1]);
+ TMGT_INF("Attempting to read attribute 0x%08X", attrId);
+ //if (TARGETING::AttributeTank::attributeExists(attrId))
+ //{
+ // if (TARGETING::AttributeTank::getAttribute(attrId,
+ // TARGETING::TYPE_SYS, AttributeTank::ATTR_POS_NA,
+ // AttributeTank::ATTR_UNIT_POS_NA,
+ // AttributeTank::ATTR_NODE_NA, attrPtr))
+ // {
+ // // // Got attribute!
+ // }
+ //}
+ }
+ else if ((i_data[0] == ATTR_PSTATE) || (i_data[0] == ATTR_PSTATE_MFG))
+ {
+ uint8_t selectedOcc = 0;
+ if (i_length >= 2)
+ {
+ selectedOcc = i_data[1];
+ }
+ getPstateTable((i_data[0] == ATTR_PSTATE),
+ selectedOcc, o_attrLength, o_attrData);
+ }
+ else
+ {
+ TMGT_ERR("dumpAttribute: Invalid attribute specified 0x%02X "
+ "(length %d)", i_data[0], i_length);
+ bldErrLog(err, HTMGT_MOD_PASS_THRU,
+ HTMGT_RC_INVALID_PARAMETER,
+ UINT32_GET(&i_data[0]),
+ UINT32_GET(&i_data[4]),
+ 0, i_length,
+ ERRORLOG::ERRL_SEV_INFORMATIONAL);
+ }
+ return err;
+ }
+
+
+
// Send pass-thru command to HTMGT
errlHndl_t passThruCommand(uint16_t i_cmdLength,
uint8_t * i_cmdData,
@@ -470,190 +542,223 @@ namespace HTMGT
htmgtReasonCode failingSrc = HTMGT_RC_NO_ERROR;
o_rspLength = 0;
- err = OccManager::buildOccs();
- if (NULL == err)
+ if ((i_cmdLength > 0) && (NULL != i_cmdData))
{
- if ((i_cmdLength > 0) && (NULL != i_cmdData))
+ switch (i_cmdData[0])
{
- switch (i_cmdData[0])
- {
- case PASSTHRU_OCC_STATUS:
- TMGT_INF("passThruCommand: OCC Status");
- OccManager::getOccData(o_rspLength, o_rspData);
- break;
+ case PASSTHRU_OCC_STATUS:
+ TMGT_INF("passThruCommand: OCC Status");
+ OccManager::getOccData(o_rspLength, o_rspData);
+ break;
+
+ case PASSTHRU_GENERATE_MFG_PSTATE:
+ if (i_cmdLength == 1)
+ {
+ TMGT_INF("passThruCommand: Generate MFG pstate tables",
+ i_cmdData[1]);
+ err = genPstateTables(false);
+ }
+ else
+ {
+ TMGT_ERR("passThruCommand: invalid generate pstate "
+ "command length %d", i_cmdLength);
+ /*@
+ * @errortype
+ * @reasoncode HTMGT_RC_INVALID_LENGTH
+ * @moduleid HTMGT_MOD_PASS_THRU
+ * @userdata1 command data[0-7]
+ * @userdata2 command data length
+ * @devdesc Invalid pass thru command data length
+ */
+ failingSrc = HTMGT_RC_INVALID_LENGTH;
+ }
+ break;
- case PASSTHRU_GENERATE_MFG_PSTATE:
- if (i_cmdLength == 1)
+ case PASSTHRU_LOAD_PSTATE:
+ if (i_cmdLength == 2)
+ {
+ const uint8_t pstateType = i_cmdData[1];
+ if ((0 == pstateType) || (1 == pstateType))
{
- TMGT_INF("passThruCommand: Generate MFG pstate "
- "tables", i_cmdData[1]);
- err = genPstateTables(false);
+ TMGT_INF("passThruCommand: Load pstate tables "
+ "(type: %d)", pstateType);
+ // 0 = Normal Pstate Tables
+ err = OccManager::loadPstates(0 == pstateType);
}
else
{
- TMGT_ERR("passThruCommand: invalid generate pstate "
- "command length %d", i_cmdLength);
+ TMGT_ERR("passThruCommand: invalid pstate type "
+ "specified: %d", pstateType);
/*@
* @errortype
- * @reasoncode HTMGT_RC_INVALID_LENGTH
+ * @reasoncode HTMGT_RC_INVALID_PARAMETER
* @moduleid HTMGT_MOD_PASS_THRU
* @userdata1 command data[0-7]
* @userdata2 command data length
- * @devdesc Invalid pass thru command data len
+ * @devdesc Invalid load pstate table type
*/
- failingSrc = HTMGT_RC_INVALID_LENGTH;
+ failingSrc = HTMGT_RC_INVALID_PARAMETER;
}
- break;
+ }
+ else
+ {
+ TMGT_ERR("passThruCommand: invalid load pstate "
+ "command length %d", i_cmdLength);
+ failingSrc = HTMGT_RC_INVALID_LENGTH;
+ }
+ break;
+
+ case PASSTHRU_INTERNAL_FLAG:
+ if (i_cmdLength == 1)
+ {
+ // get internal flag value
+ o_rspLength = 4;
+ UINT32_PUT(o_rspData, get_int_flags());
+ }
+ else if (i_cmdLength == 5)
+ {
+ // set internal flag value
+ TMGT_INF("passThruCommand: Updating internal flags "
+ "from 0x%08X to 0x%08X",
+ get_int_flags(), UINT32_GET(&i_cmdData[1]));
+ set_int_flags(UINT32_GET(&i_cmdData[1]));
+ }
+ else
+ {
+ TMGT_ERR("passThruCommand: invalid internal flag "
+ "length %d", i_cmdLength);
+ failingSrc = HTMGT_RC_INVALID_LENGTH;
+ }
+ break;
- case PASSTHRU_LOAD_PSTATE:
- if (i_cmdLength == 2)
+ case PASSTHRU_SEND_OCC_COMMAND:
+ if (i_cmdLength >= 3)
+ {
+ const uint8_t occInstance = i_cmdData[1];
+ const occCommandType occCmd =
+ (occCommandType)i_cmdData[2];
+ const uint16_t dataLen = i_cmdLength-3;
+ Occ *occPtr = OccManager::getOcc(occInstance);
+ if (occPtr)
{
- const uint8_t pstateType = i_cmdData[1];
- if ((0 == pstateType) || (1 == pstateType))
+ TMGT_INF("passThruCommand: Send OCC%d command "
+ "0x%02X (%d bytes)",
+ occInstance, occCmd, dataLen);
+ OccCmd cmd(occPtr, occCmd, dataLen, &i_cmdData[3]);
+ err = cmd.sendOccCmd();
+ if (err != NULL)
{
- TMGT_INF("passThruCommand: Load pstate tables "
- "(type: %d)", pstateType);
- // 0 = Normal Pstate Tables
- err = OccManager::loadPstates(0 == pstateType);
+ TMGT_ERR("passThruCommand: OCC%d cmd 0x%02X "
+ "failed with rc 0x%04X",
+ occInstance, occCmd,
+ err->reasonCode());
}
else
{
- TMGT_ERR("passThruCommand: invalid pstate "
- "type specified: %d", pstateType);
- /*@
- * @errortype
- * @reasoncode HTMGT_RC_INVALID_PARAMETER
- * @moduleid HTMGT_MOD_PASS_THRU
- * @userdata1 command data[0-7]
- * @userdata2 command data length
- * @devdesc Invalid load pstate table type
- */
- failingSrc = HTMGT_RC_INVALID_PARAMETER;
+ uint8_t *rspPtr = NULL;
+ o_rspLength = cmd.getResponseData(rspPtr);
+ memcpy(o_rspData, rspPtr, o_rspLength);
+ TMGT_INF("passThruCommand: OCC%d rsp status "
+ "0x%02X (%d bytes)", occInstance,
+ o_rspData[2], o_rspLength);
}
}
else
{
- TMGT_ERR("passThruCommand: invalid load pstate "
- "command length %d", i_cmdLength);
- failingSrc = HTMGT_RC_INVALID_LENGTH;
+ TMGT_ERR("passThruCommand: Unable to find OCC%d",
+ occInstance);
+ /*@
+ * @errortype
+ * @reasoncode HTMGT_RC_OCC_UNAVAILABLE
+ * @moduleid HTMGT_MOD_PASS_THRU
+ * @userdata1 command data[0-7]
+ * @userdata2 command data length
+ * @devdesc Specified OCC not available
+ */
+ failingSrc = HTMGT_RC_OCC_UNAVAILABLE;
}
- break;
+ }
+ else
+ {
+ TMGT_ERR("passThruCommand: invalid OCC command "
+ "length %d", i_cmdLength);
+ failingSrc = HTMGT_RC_INVALID_LENGTH;
+ }
+ break;
- case PASSTHRU_SEND_OCC_COMMAND:
- if (i_cmdLength >= 3)
+ case PASSTHRU_CLEAR_RESET_COUNTS:
+ TMGT_INF("passThruCommand: Clear all OCC reset counts");
+ OccManager::clearResetCounts();
+ break;
+
+ case PASSTHRU_EXIT_SAFE_MODE:
+ {
+ TMGT_INF("passThruCommand: Clear Safe Mode");
+ // Clear OCC reset counts and failed flags
+ OccManager::clearResetCounts();
+ // Clear safe mode reason
+ OccManager::updateSafeModeReason(0, 0);
+ // Clear system safe mode flag/attribute
+ TARGETING::Target* sys = NULL;
+ TARGETING::targetService().getTopLevelTarget(sys);
+ const uint8_t safeMode = 0;
+ // Mark system as NOT being in safe mode
+ if(sys)
{
- const uint8_t occInstance = i_cmdData[1];
- const occCommandType occCmd =
- (occCommandType)i_cmdData[2];
- const uint16_t dataLen = i_cmdLength-3;
- Occ *occPtr = OccManager::getOcc(occInstance);
- if (occPtr)
- {
- TMGT_INF("passThruCommand: Send OCC%d command "
- "0x%02X (%d bytes)",
- occInstance, occCmd, dataLen);
- OccCmd cmd(occPtr, occCmd, dataLen,
- &i_cmdData[3]);
- err = cmd.sendOccCmd();
- if (err != NULL)
- {
- TMGT_ERR("passThruCommand: OCC%d cmd "
- "0x%02X failed with rc 0x%04X",
- occInstance, occCmd,
- err->reasonCode());
- }
- else
- {
- uint8_t *rspPtr = NULL;
- o_rspLength = cmd.getResponseData(rspPtr);
- memcpy(o_rspData, rspPtr, o_rspLength);
- TMGT_INF("passThruCommand: OCC%d rsp "
- "status 0x%02X (%d bytes)",
- occInstance, o_rspData[2],
- o_rspLength);
- }
- }
- else
- {
- TMGT_ERR("passThruCommand: Unable to find "
- "OCC%d", occInstance);
- /*@
- * @errortype
- * @reasoncode HTMGT_RC_OCC_UNAVAILABLE
- * @moduleid HTMGT_MOD_PASS_THRU
- * @userdata1 command data[0-7]
- * @userdata2 command data length
- * @devdesc Specified OCC not available
- */
- failingSrc = HTMGT_RC_OCC_UNAVAILABLE;
- }
+ sys->setAttr<TARGETING::ATTR_HTMGT_SAFEMODE>
+ (safeMode);
}
- else
+ // Reset the OCCs (do not increment reset count
+ // or attempt comm with OCC since they are in reset)
+ TMGT_INF("passThruCommand: Calling resetOccs");
+ err = OccManager::resetOccs(NULL, true, true);
+ if (err != NULL)
{
- TMGT_ERR("passThruCommand: invalid OCC command "
- "length %d", i_cmdLength);
- failingSrc = HTMGT_RC_INVALID_LENGTH;
+ TMGT_ERR("passThruCommand: resetOccs failed "
+ "with rc 0x%04X", err->reasonCode());
}
- break;
-
- case PASSTHRU_CLEAR_RESET_COUNTS:
- TMGT_INF("passThruCommand: Clear all OCC reset counts");
- OccManager::clearResetCounts();
- break;
+ }
+ break;
- case PASSTHRU_EXIT_SAFE_MODE:
- {
- TMGT_INF("passThruCommand: Clear Safe Mode");
- // Clear OCC reset counts and failed flags
- OccManager::clearResetCounts();
- // Clear safe mode reason
- OccManager::updateSafeModeReason(0, 0);
- // Clear system safe mode flag/attribute
- TARGETING::Target* sys = NULL;
- TARGETING::targetService().getTopLevelTarget(sys);
- const uint8_t safeMode = 0;
- if(sys)
- {
- sys->setAttr<TARGETING::ATTR_HTMGT_SAFEMODE>
- (safeMode);
- }
- // Reset the OCCs (do not increment reset count
- // or attempt comm with OCC since they are in reset)
- TMGT_INF("passThruCommand: Calling resetOccs");
- err = OccManager::resetOccs(NULL, true, true);
- if (err != NULL)
- {
- TMGT_ERR("passThruCommand: resetOccs failed "
- "with rc 0x%04X", err->reasonCode());
- }
- }
- break;
+ case PASSTHRU_DUMP_ATTRIBUTE:
+ if (i_cmdLength >= 2)
+ {
+ TMGT_INF("passThruCommand: Dump Attribute 0x%02X",
+ i_cmdData[1]);
+ err = dumpAttribute(i_cmdLength-1, &i_cmdData[1],
+ o_rspLength, o_rspData);
+ }
+ else
+ {
+ TMGT_ERR("passThruCommand: invalid dump attribute "
+ "command length %d", i_cmdLength);
+ failingSrc = HTMGT_RC_INVALID_LENGTH;
+ }
+ break;
- default:
- TMGT_ERR("passThruCommand: Invalid command 0x%08X "
- "(%d bytes)",
- UINT32_GET(i_cmdData), i_cmdLength);
- /*@
- * @errortype
- * @reasoncode HTMGT_RC_INVALID_DATA
- * @moduleid HTMGT_MOD_PASS_THRU
- * @userdata1 command data[0-7]
- * @userdata2 command data length
- * @devdesc Invalid pass thru command
- */
- failingSrc = HTMGT_RC_INVALID_DATA;
- break;
- }
+ default:
+ TMGT_ERR("passThruCommand: Invalid command 0x%08X "
+ "(%d bytes)", UINT32_GET(i_cmdData), i_cmdLength);
+ /*@
+ * @errortype
+ * @reasoncode HTMGT_RC_INVALID_DATA
+ * @moduleid HTMGT_MOD_PASS_THRU
+ * @userdata1 command data[0-7]
+ * @userdata2 command data length
+ * @devdesc Invalid pass thru command
+ */
+ failingSrc = HTMGT_RC_INVALID_DATA;
+ break;
+ }
- if ((HTMGT_RC_NO_ERROR != failingSrc) && (NULL == err))
- {
- bldErrLog(err, HTMGT_MOD_PASS_THRU,
- failingSrc,
- UINT32_GET(i_cmdData),
- UINT32_GET(&i_cmdData[4]),
- 0, i_cmdLength,
- ERRORLOG::ERRL_SEV_INFORMATIONAL);
- }
+ if ((HTMGT_RC_NO_ERROR != failingSrc) && (NULL == err))
+ {
+ bldErrLog(err, HTMGT_MOD_PASS_THRU,
+ failingSrc,
+ UINT32_GET(i_cmdData),
+ UINT32_GET(&i_cmdData[4]),
+ 0, i_cmdLength,
+ ERRORLOG::ERRL_SEV_INFORMATIONAL);
}
}
@@ -662,4 +767,3 @@ namespace HTMGT
} // end passThruCommand()
}
-
OpenPOWER on IntegriCloud