diff --git a/src/include/usr/hwas/common/hwasCallout.H b/src/include/usr/hwas/common/hwasCallout.H index 9c11236df49..3cf4a2638d4 100644 --- a/src/include/usr/hwas/common/hwasCallout.H +++ b/src/include/usr/hwas/common/hwasCallout.H @@ -180,6 +180,7 @@ enum callOutPriority enum busTypeEnum { + NO_BUS_TYPE = 0, FSI_BUS_TYPE = 1, DMI_BUS_TYPE = 2, A_BUS_TYPE = 3, @@ -188,6 +189,8 @@ enum busTypeEnum PSI_BUS_TYPE = 6, O_BUS_TYPE = 7, OMI_BUS_TYPE = 8, + + LAST_BUS_TYPE, //for looping in testcases }; // Used by Hostboot code where real clock targets do not exist @@ -227,6 +230,8 @@ enum partTypeEnum BPM_CABLE_PART_TYPE = 13, //Backup Power Module Cable for NVDIMM NV_CONTROLLER_PART_TYPE = 14, //Controller for NVDIMM BPM_PART_TYPE = 15, //Backup Power Module for NVDIMM + + LAST_PART_TYPE, //for looping in testcases }; enum sensorTypeEnum @@ -235,6 +240,8 @@ enum sensorTypeEnum GPU_FUNC_SENSOR = 1, GPU_TEMPERATURE_SENSOR = 2, GPU_MEMORY_TEMP_SENSOR = 3, + + LAST_SENSOR_TYPE, //for looping in testcases }; //-- Flags diff --git a/src/usr/errl/errlentry_consts.H b/src/usr/errl/errlentry_consts.H index 86d58a77c2c..81673801061 100644 --- a/src/usr/errl/errlentry_consts.H +++ b/src/usr/errl/errlentry_consts.H @@ -166,6 +166,9 @@ const epubPartTypeToSub_t PART_TO_SUBSYS_TABLE[] = { HWAS::PROC_REF_CLOCK , EPUB_CEC_HDW_CLK_CTL }, { HWAS::PCI_REF_CLOCK , EPUB_CEC_HDW_CLK_CTL }, { HWAS::SMP_CABLE , EPUB_CEC_HDW_SUBSYS }, + { HWAS::BPM_CABLE_PART_TYPE , EPUB_MEMORY_SUBSYS }, + { HWAS::NV_CONTROLLER_PART_TYPE , EPUB_MEMORY_SUBSYS }, + { HWAS::BPM_PART_TYPE , EPUB_MEMORY_SUBSYS }, }; struct epubSensorTypeToSub_t diff --git a/src/usr/errl/test/errltest.H b/src/usr/errl/test/errltest.H index ff5df6b6518..32e798ac4e7 100644 --- a/src/usr/errl/test/errltest.H +++ b/src/usr/errl/test/errltest.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2011,2018 */ +/* Contributors Listed Below - COPYRIGHT 2011,2019 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -1214,6 +1214,57 @@ public: l_err = NULL; } + /** + * @brief Ensure all callouts have a SUBSYS mapping + * + */ + void testErrl_ensureSubsystemMapping(void) + { + // dummy log to call non-static methods with + errlHndl_t l_err = new ERRORLOG::ErrlEntry( + ERRORLOG::ERRL_SEV_INFORMATIONAL, + ERRORLOG::ERRL_TEST_MOD_ID, + ERRORLOG::ERRL_TEST_REASON_CODE, + 0x494E464F, //INFO + 0); + + // Walk through every BUS_TYPE + for( busTypeEnum bus = (busTypeEnum)(NO_BUS_TYPE+1); + bus < LAST_BUS_TYPE; + bus = (busTypeEnum)(bus+1) ) + { + if( l_err->getSubSystem(bus) == EPUB_MISC_UNKNOWN ) + { + TS_FAIL( "No subsystem returned for BUS_TYPE %d", bus ); + } + } + + // Walk through every PART_TYPE + for( partTypeEnum part = (partTypeEnum)(NO_PART_TYPE+1); + part < LAST_PART_TYPE; + part = (partTypeEnum)(part+1) ) + { + if( l_err->getSubSystem(part) == EPUB_MISC_UNKNOWN ) + { + TS_FAIL( "No subsystem returned for PART_TYPE %d", part ); + } + } + + // Walk through every SENSOR_TYPE + for( sensorTypeEnum sensor = (sensorTypeEnum)(UNKNOWN_SENSOR+1); + sensor < LAST_SENSOR_TYPE; + sensor = (sensorTypeEnum)(sensor+1) ) + { + if( l_err->getSubSystem(sensor) == EPUB_MISC_UNKNOWN ) + { + TS_FAIL( "No subsystem returned for SENSOR_TYPE %d", sensor ); + } + } + + // Note - Can't loop over epubProcedureID because the values are + // sparsely populated + + } };