summaryrefslogtreecommitdiffstats
path: root/src/usr/hwpf/hwp/fapiTestHwpConfig.C
diff options
context:
space:
mode:
authorMike Jones <mjjones@us.ibm.com>2011-09-13 11:44:54 -0500
committerMIKE J. JONES <mjjones@us.ibm.com>2011-09-14 08:26:05 -0500
commite59e01da049d2b864ff7cb1dd03b82e5a8a393b9 (patch)
tree138460bf6523c5b94a46f5100dac468f6026348f /src/usr/hwpf/hwp/fapiTestHwpConfig.C
parentf00cbc2321649c74c078784a1fc47da3b10e1a54 (diff)
downloadtalos-hostboot-e59e01da049d2b864ff7cb1dd03b82e5a8a393b9.tar.gz
talos-hostboot-e59e01da049d2b864ff7cb1dd03b82e5a8a393b9.zip
HWPF: Add support for new System Config Query functions
Change-Id: I00220dc4a1ee4f630138d0ed87a943053a7a93d5 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/337 Tested-by: Jenkins Server Reviewed-by: Andrew J. Geissler <andrewg@us.ibm.com> Reviewed-by: Monte K. Copeland <copelanm@us.ibm.com> Reviewed-by: MIKE J. JONES <mjjones@us.ibm.com>
Diffstat (limited to 'src/usr/hwpf/hwp/fapiTestHwpConfig.C')
-rw-r--r--src/usr/hwpf/hwp/fapiTestHwpConfig.C116
1 files changed, 116 insertions, 0 deletions
diff --git a/src/usr/hwpf/hwp/fapiTestHwpConfig.C b/src/usr/hwpf/hwp/fapiTestHwpConfig.C
new file mode 100644
index 000000000..ce47b82df
--- /dev/null
+++ b/src/usr/hwpf/hwp/fapiTestHwpConfig.C
@@ -0,0 +1,116 @@
+// IBM_PROLOG_BEGIN_TAG
+// This is an automatically generated prolog.
+//
+// $Source: src/usr/hwpf/hwp/fapiTestHwpConfig.C $
+//
+// IBM CONFIDENTIAL
+//
+// COPYRIGHT International Business Machines Corp. 2011
+//
+// p1
+//
+// Object Code Only (OCO) source materials
+// Licensed Internal Code Source Materials
+// IBM HostBoot Licensed Internal Code
+//
+// The source code for this program is not published or other-
+// wise divested of its trade secrets, irrespective of what has
+// been deposited with the U.S. Copyright Office.
+//
+// Origin: 30
+//
+// IBM_PROLOG_END
+/**
+ * @file fapiTestHwpConfig.C
+ *
+ * @brief Implements a Hardware Procedure that exercises the FAPI System Config
+ * Query functions.
+ */
+
+/*
+ * Change Log ******************************************************************
+ * Flag Defect/Feature User Date Description
+ * ------ -------------- ---------- ----------- ----------------------------
+ * mjjones 09/12/2011 Created.
+ *
+ */
+
+#include <fapiTestHwpConfig.H>
+
+extern "C"
+{
+
+//******************************************************************************
+// hwpTestConfig
+//******************************************************************************
+fapi::ReturnCode hwpTestConfig(const fapi::Target & i_chip)
+{
+ FAPI_INF("Performing HWP: hwpTestConfig");
+
+ // Print the ecmd string of the chip
+ char l_string[fapi::MAX_ECMD_STRING_LEN] = {0};
+ i_chip.toString(l_string);
+ FAPI_INF("hwpInitialTest: Chip: %s", l_string);
+
+ fapi::ReturnCode l_rc;
+ std::vector<fapi::Target> l_targets;
+
+ // Call fapiGetChildChiplets to get the child MCS chiplets
+ l_rc = fapiGetChildChiplets(i_chip, fapi::TARGET_TYPE_MCS_CHIPLET,
+ l_targets);
+
+ if (l_rc)
+ {
+ FAPI_ERR("hwpTestConfig: Error from fapiGetChildChiplets");
+ }
+ else
+ {
+ FAPI_INF("hwpTestConfig: %d MCS chiplets", l_targets.size());
+
+ if (l_targets.size() == 0)
+ {
+ FAPI_ERR("hwpTestConfig: No MCS chiplets");
+ l_rc = fapi::RC_TEST_ERROR_A;
+ }
+ else
+ {
+ // Save the first MCS target
+ fapi::Target l_mcs = l_targets[0];
+
+ // Call fapiGetAssociatedDimms to get the dimms for this MCS
+ l_rc = fapiGetAssociatedDimms(l_mcs, l_targets);
+
+ if (l_rc)
+ {
+ FAPI_ERR("hwpTestConfig: Error from fapiGetAssociatedDimms");
+ }
+ else
+ {
+ FAPI_INF("hwpTestConfig: %d dimms", l_targets.size());
+
+ // Call fapiGetParentChip to get the parent of the MCS
+ fapi::Target l_chip;
+
+ l_rc = fapiGetParentChip(l_mcs, l_chip);
+
+ if (l_rc)
+ {
+ FAPI_ERR("hwpTestConfig: Error from fapiGetParentChip");
+ }
+ else
+ {
+ // Check that the parent chip is is same as the input chip
+ if (i_chip != l_chip)
+ {
+ FAPI_ERR("hwpTestConfig: Chip mismatch");
+ l_rc = fapi::RC_TEST_ERROR_B;
+ }
+ }
+ }
+ }
+ }
+
+ return l_rc;
+}
+
+} // extern "C"
OpenPOWER on IntegriCloud