diff options
author | CamVan Nguyen <ctnguyen@us.ibm.com> | 2012-05-22 08:44:39 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2012-05-30 10:26:38 -0500 |
commit | 7b99c2041cfe126bb85325a3d18ca69d279f54ad (patch) | |
tree | b249b0bf4773e2677ec8620eab3074e8e1acb310 /src/usr/hwpf/test/hwpftest.H | |
parent | 99d1dab56d4e067cb4ee4b089cd3456acba6a89c (diff) | |
download | talos-hostboot-7b99c2041cfe126bb85325a3d18ca69d279f54ad.tar.gz talos-hostboot-7b99c2041cfe126bb85325a3d18ca69d279f54ad.zip |
SCOM Initfile: Support for associated attributes.
Change-Id: Ie86bce0abaa12b986a7858723625c8e305a899d9
RTC: 41742
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/1093
Tested-by: Jenkins Server
Reviewed-by: MIKE J. JONES <mjjones@us.ibm.com>
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/hwpf/test/hwpftest.H')
-rw-r--r-- | src/usr/hwpf/test/hwpftest.H | 81 |
1 files changed, 77 insertions, 4 deletions
diff --git a/src/usr/hwpf/test/hwpftest.H b/src/usr/hwpf/test/hwpftest.H index a74f357ef..24f3c769e 100644 --- a/src/usr/hwpf/test/hwpftest.H +++ b/src/usr/hwpf/test/hwpftest.H @@ -306,10 +306,11 @@ public: (0x8000000000000000 >> 0x10) | (0x8000000000000000 >> 0x13) | (0x0306400412000000 >> 0x15) }, - {0x0000000013013286, 0, 0}, + {0x0000000013013286, 0, 0x0000000000000192}, {0x0000000013013287, 0, 0x0000000000000182}, {0x0000000013013288, 0, 0x0000000000000192}, - {0x0000000013013289, 0, 0x8000000000000000 >> 0x17} + {0x0000000013013289, 0, (0x8000000000000000 >> 0x17) | + (0x4000000000000000 >> 0x18)} }; fapi::ReturnCode l_rc = fapi::FAPI_RC_SUCCESS; @@ -340,6 +341,14 @@ public: break; } + l_uint32 = 0; + l_rc = FAPI_ATTR_SET(ATTR_SCRATCH_UINT32_2, NULL, l_uint32); + if (l_rc != fapi::FAPI_RC_SUCCESS) + { + TS_FAIL("testHwpf5: ATTR_SCRATCH_UINT32_2. Error from SET"); + break; + } + uint64_t l_uint64 = 2; l_rc = FAPI_ATTR_SET(ATTR_SCRATCH_UINT64_1, NULL, l_uint64); if (l_rc != fapi::FAPI_RC_SUCCESS) @@ -348,6 +357,14 @@ public: break; } + l_uint64 = 0; + l_rc = FAPI_ATTR_SET(ATTR_SCRATCH_UINT64_2, NULL, l_uint64); + if (l_rc != fapi::FAPI_RC_SUCCESS) + { + TS_FAIL("testHwpf5: ATTR_SCRATCH_UINT64_2. Error from SET"); + break; + } + uint8_t l_uint8array1[32]; l_uint8array1[0] = 1; l_uint8array1[1] = 4; @@ -391,12 +408,68 @@ public: //printk("ATTR_IS_SIMULATION = %d\n", l_flag); } - // Get the master processor chip + //Set the targets + + std::vector<fapi::Target> l_target; + + // Get the master processor chip & set it as the main target for Scom ops TARGETING::Target* l_pTarget = NULL; TARGETING::targetService().masterProcChipTargetHandle(l_pTarget); fapi::Target l_fapiTarget(TARGET_TYPE_PROC_CHIP, reinterpret_cast<void *> (l_pTarget)); + l_target.push_back(l_fapiTarget); + + // Get the target for the MBA chiplets of the first MEMBUF chip + TARGETING::PredicateCTM l_membufChip(TARGETING::CLASS_CHIP, + TARGETING::TYPE_MEMBUF); + + TARGETING::TargetRangeFilter l_filter( + TARGETING::targetService().begin(), + TARGETING::targetService().end(), + &l_membufChip); + + PredicateCTM l_mba(CLASS_UNIT,TYPE_MBA); + + // Just look at the first MEMBUF chip + if (l_filter) + { + TargetHandleList l_list; + (void) targetService().getAssociated( + l_list, + *l_filter, + TARGETING::TargetService::CHILD, + TARGETING::TargetService::ALL, + &l_mba); + + if (2 == l_list.size()) + { + for (size_t i = 0; i < l_list.size(); i++) + { + //Set the associated targets + fapi::Target l_fapiTargetAssoc(fapi::TARGET_TYPE_MBA_CHIPLET, + reinterpret_cast<void *>(l_list.at(i))); + l_target.push_back(l_fapiTargetAssoc); + } + } + else + { + TS_FAIL("testHwpf5: Incorrect # of MBAs found: %u", + l_list.size()); + + size_t l_ffdc = l_list.size(); + size_t & FFDC_IF_TEST_NUM_MBAS_FOUND = l_ffdc; + FAPI_SET_HWP_ERROR(l_rc, + RC_HWP_EXEC_INITFILE_TEST_INCORRECT_NUM_MBAS_FOUND); + break; + } + } + else + { + TS_FAIL("testHwpf5: No MEMBUFs found"); + FAPI_SET_HWP_ERROR(l_rc, RC_HWP_EXEC_INITFILE_TEST_NO_MEMBUF_FOUND); + break; + } // Test ATTR_EC attribute access through FAPI uint8_t l_EC_R = 0xFF; @@ -450,7 +523,7 @@ public: } //Call Hwp to execute the initfile - FAPI_EXEC_HWP(l_rc, fapiHwpExecInitFile, l_fapiTarget, "sample.if"); + FAPI_EXEC_HWP(l_rc, fapiHwpExecInitFile, l_target, "sample.if"); if (l_rc != fapi::FAPI_RC_SUCCESS) { |