From a17b84a6678febef7ced9f0908cf39d5f16671df Mon Sep 17 00:00:00 2001 From: Bill Hoffa Date: Mon, 19 Feb 2018 16:13:38 -0600 Subject: Enable FAPI Cumulus test cases - Only run MCBIST/MCS/MCA testcases on Nimbus procs - Add MC/MI/DMI testcases on Cumulus procs Change-Id: Ica5783c2694ef549e81ad8eb484cc62bdc499de0 RTC: 178802 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/54396 Reviewed-by: Christian R. Geddes Reviewed-by: Prachi Gupta Tested-by: Jenkins Server Tested-by: Jenkins OP Build CI Tested-by: Jenkins OP HW Tested-by: FSP CI Jenkins Reviewed-by: Daniel M. Crowell --- src/usr/fapi2/test/p9_sample_procedure.C | 73 +++++++++++++++++++++++++++++++- 1 file changed, 72 insertions(+), 1 deletion(-) (limited to 'src/usr/fapi2/test/p9_sample_procedure.C') diff --git a/src/usr/fapi2/test/p9_sample_procedure.C b/src/usr/fapi2/test/p9_sample_procedure.C index 57ef2309e..469fa534a 100644 --- a/src/usr/fapi2/test/p9_sample_procedure.C +++ b/src/usr/fapi2/test/p9_sample_procedure.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2015,2017 */ +/* Contributors Listed Below - COPYRIGHT 2015,2018 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -384,3 +384,74 @@ fapi_try_exit: } +fapi2::ReturnCode p9_sample_procedure_mc( + fapi2::Target& i_target, + uint8_t expectedValue) +{ + uint8_t l_attr_scratch = 0; + FAPI_INF("Entering ..."); + FAPI_INF("Set Scratch Attr on MC Target"); + FAPI_TRY(FAPI_ATTR_SET(fapi2::ATTR_SCRATCH_UINT8_1, i_target, + expectedValue)); + + FAPI_INF("Get Scratch Attr on MC Target"); + FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_SCRATCH_UINT8_1, i_target, + l_attr_scratch)); + FAPI_ASSERT( (l_attr_scratch == expectedValue), + fapi2::FAPI2_SAMPLE(), + "p9_sample_procedure_mc read scratch value: %d , expected it to be: %d", l_attr_scratch, expectedValue); + FAPI_INF("Read scratch value : %d , expected it to be %d", l_attr_scratch, expectedValue); + +fapi_try_exit: + FAPI_INF("Exiting ..."); + return fapi2::current_err; + +} + +fapi2::ReturnCode p9_sample_procedure_mi( + fapi2::Target& i_target, + uint8_t expectedValue) +{ + uint8_t l_attr_scratch = 0; + FAPI_INF("Entering ..."); + FAPI_INF("Set Scratch Attr on MI Target"); + FAPI_TRY(FAPI_ATTR_SET(fapi2::ATTR_SCRATCH_UINT8_1, i_target, + expectedValue)); + + FAPI_INF("Get Scratch Attr on MI Target"); + FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_SCRATCH_UINT8_1, i_target, + l_attr_scratch)); + FAPI_ASSERT( (l_attr_scratch == expectedValue), + fapi2::FAPI2_SAMPLE(), + "p9_sample_procedure_mi read scratch value: %d , expected it to be: %d", l_attr_scratch, expectedValue); + FAPI_INF("Read scratch value : %d , expected it to be %d", l_attr_scratch, expectedValue); + +fapi_try_exit: + FAPI_INF("Exiting ..."); + return fapi2::current_err; + +} + +fapi2::ReturnCode p9_sample_procedure_dmi( + fapi2::Target& i_target, + uint8_t expectedValue) +{ + uint8_t l_attr_scratch = 0; + FAPI_INF("Entering ..."); + FAPI_INF("Set Scratch Attr on DMI Target"); + FAPI_TRY(FAPI_ATTR_SET(fapi2::ATTR_SCRATCH_UINT8_1, i_target, + expectedValue)); + + FAPI_INF("Get Scratch Attr on DMI Target"); + FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_SCRATCH_UINT8_1, i_target, + l_attr_scratch)); + FAPI_ASSERT( (l_attr_scratch == expectedValue), + fapi2::FAPI2_SAMPLE(), + "p9_sample_procedure_dmi read scratch value: %d , expected it to be: %d", l_attr_scratch, expectedValue); + FAPI_INF("Read scratch value : %d , expected it to be %d", l_attr_scratch, expectedValue); + +fapi_try_exit: + FAPI_INF("Exiting ..."); + return fapi2::current_err; + +} -- cgit v1.2.1