summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/include/usr/hwpf/hwp/chip_accessors/getPciOscswitchConfig.H63
-rw-r--r--src/include/usr/hwpf/plat/fapiPlatAttributeService.H19
-rw-r--r--src/usr/hwpf/hwp/chip_accessors/chip.mk29
-rw-r--r--src/usr/hwpf/hwp/chip_accessors/chip_errors.xml63
-rw-r--r--src/usr/hwpf/hwp/chip_accessors/getPciOscswitchConfig.C153
-rw-r--r--src/usr/hwpf/hwp/chip_attributes.xml12
-rw-r--r--src/usr/hwpf/hwp/makefile3
-rw-r--r--src/usr/hwpf/makefile3
-rw-r--r--src/usr/hwpf/plat/fapiPlatAttributeService.C13
9 files changed, 354 insertions, 4 deletions
diff --git a/src/include/usr/hwpf/hwp/chip_accessors/getPciOscswitchConfig.H b/src/include/usr/hwpf/hwp/chip_accessors/getPciOscswitchConfig.H
new file mode 100644
index 000000000..2ac313235
--- /dev/null
+++ b/src/include/usr/hwpf/hwp/chip_accessors/getPciOscswitchConfig.H
@@ -0,0 +1,63 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/include/usr/hwpf/hwp/getPciOscswitchConfig.H $ */
+/* */
+/* IBM CONFIDENTIAL */
+/* */
+/* COPYRIGHT International Business Machines Corp. 2013,2014 */
+/* */
+/* 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 otherwise */
+/* divested of its trade secrets, irrespective of what has been */
+/* deposited with the U.S. Copyright Office. */
+/* */
+/* Origin: 30 */
+/* */
+/* IBM_PROLOG_END_TAG */
+// $Id: getPciOscswitchConfig.H,v 1.2 2014/01/15 20:03:21 whs Exp $
+/**
+ * @file getPciOscswitchConfig.H
+ *
+ * @brief Accessor for providing the ATTR_PCI_OSCSWITCH_CONFIG attribute
+ */
+
+#ifndef _HWP_GETPCIOSCSWITCHCONFIG_
+#define _HWP_GETPCIOSCSWITCHCONFIG_
+
+#include <fapi.H>
+
+// configuration values
+enum PciOscswitchConfigValues
+{
+ MURANO_DD1X = 0x03,
+ MURANO_DD2X = 0x0C,
+ VENICE_P0P2 = 0x09, // position 0 and 2
+ VENICE_P1P3 = 0x06, // position 1 and 3
+};
+
+// function pointer typedef definition for HWP call support
+typedef fapi::ReturnCode (*getPciOscswitchConfig_FP_t)
+ (const fapi::Target &, uint8_t &);
+
+extern "C"
+{
+/**
+ * @brief Get the ATTR_PCI_OSCSWITCH_CONFIG FAPI attribute
+ *
+ * @param[in] i_procTarget - Reference to processor chip target
+ * @param[out] o_val - Filled in with pci oscswitch config
+ *
+ * @return fapi::ReturnCode FAPI_RC_SUCCESS if success, else error code
+ */
+fapi::ReturnCode getPciOscswitchConfig(
+ const fapi::Target & i_procTarget,
+ uint8_t & o_val);
+}
+
+#endif
diff --git a/src/include/usr/hwpf/plat/fapiPlatAttributeService.H b/src/include/usr/hwpf/plat/fapiPlatAttributeService.H
index 8deb64e68..a06510ebf 100644
--- a/src/include/usr/hwpf/plat/fapiPlatAttributeService.H
+++ b/src/include/usr/hwpf/plat/fapiPlatAttributeService.H
@@ -667,6 +667,17 @@ fapi::ReturnCode fapiPlatGetSpdAttrAccessor (
*/
fapi::ReturnCode fapiPlatGetL3DDAttr(const fapi::Target * i_pProcTarget,
uint32_t (&o_data)[DELTA_DATA_SIZE]);
+/**
+ * @brief This function is called by the FAPI_ATTR_GET macro when getting the
+ * ATTR_PCI_OSCSWITCH_CONFIG attribute. It should not be called
+ * directly.
+ *
+ * @param[in] i_pProcTarget Processor Chip Target pointer
+ * @param[out] o_data Reference to output data
+ */
+fapi::ReturnCode fapiPlatGetPciOscswitchConfig
+ (const fapi::Target * i_pProcTarget,
+ uint8_t &o_val);
} // namespace platAttrSvc
@@ -1738,4 +1749,12 @@ fapi::ReturnCode fapiPlatGetL3DDAttr(const fapi::Target * i_pProcTarget,
fapi::AttrOverrideSync::getAttrOverrideFunc(fapi::ID, PTARGET, &VAL) ? fapi::FAPI_RC_SUCCESS : \
fapi::platAttrSvc::fapiPlatGetL3DDAttr(PTARGET, VAL)
+//------------------------------------------------------------------------------
+// MACRO to support pci osc switch config
+//------------------------------------------------------------------------------
+#define ATTR_PCI_OSCSWITCH_CONFIG_GETMACRO(ID, PTARGET, VAL) \
+ fapi::AttrOverrideSync::getAttrOverrideFunc(fapi::ID, PTARGET, &VAL) ?\
+ fapi::FAPI_RC_SUCCESS : \
+ fapi::platAttrSvc::fapiPlatGetPciOscswitchConfig(PTARGET, VAL)
+
#endif // FAPIPLATATTRIBUTESERVICE_H_
diff --git a/src/usr/hwpf/hwp/chip_accessors/chip.mk b/src/usr/hwpf/hwp/chip_accessors/chip.mk
new file mode 100644
index 000000000..516179bcb
--- /dev/null
+++ b/src/usr/hwpf/hwp/chip_accessors/chip.mk
@@ -0,0 +1,29 @@
+# IBM_PROLOG_BEGIN_TAG
+# This is an automatically generated prolog.
+#
+# $Source: src/usr/hwpf/hwp/chip_accessors/chip.mk $
+#
+# IBM CONFIDENTIAL
+#
+# COPYRIGHT International Business Machines Corp. 2012,2014
+#
+# 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 otherwise
+# divested of its trade secrets, irrespective of what has been
+# deposited with the U.S. Copyright Office.
+#
+# Origin: 30
+#
+# IBM_PROLOG_END_TAG
+EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/chip_accessors
+EXTRAINCDIR += ${ROOTPATH}/src/include/usr/hwpf/hwp/chip_accessors
+
+VPATH += chip_accessors
+
+OBJS += getPciOscswitchConfig.o
+
diff --git a/src/usr/hwpf/hwp/chip_accessors/chip_errors.xml b/src/usr/hwpf/hwp/chip_accessors/chip_errors.xml
new file mode 100644
index 000000000..9aecaddb1
--- /dev/null
+++ b/src/usr/hwpf/hwp/chip_accessors/chip_errors.xml
@@ -0,0 +1,63 @@
+<!-- IBM_PROLOG_BEGIN_TAG -->
+<!-- This is an automatically generated prolog. -->
+<!-- -->
+<!-- $Source: src/usr/hwpf/hwp/chip_errors.xml $ -->
+<!-- -->
+<!-- IBM CONFIDENTIAL -->
+<!-- -->
+<!-- COPYRIGHT International Business Machines Corp. 2012,2014 -->
+<!-- -->
+<!-- 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 otherwise -->
+<!-- divested of its trade secrets, irrespective of what has been -->
+<!-- deposited with the U.S. Copyright Office. -->
+<!-- -->
+<!-- Origin: 30 -->
+<!-- -->
+<!-- IBM_PROLOG_END_TAG -->
+<!-- XML file specifying errors generated by chip HWPs. -->
+<!-- $Id: chip_errors.xml,v 1.2 2014/01/15 20:05:04 whs Exp $ -->
+<hwpErrors>
+ <!-- ******************************************************************** -->
+ <hwpError>
+ <rc>RC_OSC_SWITCH_UNEXPECTED_CHIP_TYPE</rc>
+ <description>
+ The hwp accessor encountered an unexpected chip type.
+ </description>
+ <ffdc>FFDC_CHIP_TYPE</ffdc>
+ <callout>
+ <procedure>CODE</procedure>
+ <priority>HIGH</priority>
+ </callout>
+ </hwpError>
+ <!-- ******************************************************************** -->
+ <hwpError>
+ <rc>RC_OSC_SWITCH_UNEXPECTED_CHIP_POSITION</rc>
+ <description>
+ The hwp accessor encountered an unexpected chip position.
+ </description>
+ <ffdc>FFDC_CHIP_POSITION</ffdc>
+ <callout>
+ <procedure>CODE</procedure>
+ <priority>HIGH</priority>
+ </callout>
+ </hwpError>
+ <!-- ******************************************************************** -->
+ <hwpError>
+ <rc>RC_OSC_SWITCH_UNEXPECTED_CHIP_EC</rc>
+ <description>
+ The hwp accessor encountered an unexpected chip ec.
+ </description>
+ <callout>
+ <procedure>CODE</procedure>
+ <priority>HIGH</priority>
+ </callout>
+ <ffdc>FFDC_CHIP_EC</ffdc>
+ </hwpError>
+ <!-- ******************************************************************** -->
+</hwpErrors>
diff --git a/src/usr/hwpf/hwp/chip_accessors/getPciOscswitchConfig.C b/src/usr/hwpf/hwp/chip_accessors/getPciOscswitchConfig.C
new file mode 100644
index 000000000..8df20f95d
--- /dev/null
+++ b/src/usr/hwpf/hwp/chip_accessors/getPciOscswitchConfig.C
@@ -0,0 +1,153 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/hwpf/hwp/getPciOscswitchConfig.C $ */
+/* */
+/* IBM CONFIDENTIAL */
+/* */
+/* COPYRIGHT International Business Machines Corp. 2012,2014 */
+/* */
+/* 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 otherwise */
+/* divested of its trade secrets, irrespective of what has been */
+/* deposited with the U.S. Copyright Office. */
+/* */
+/* Origin: 30 */
+/* */
+/* IBM_PROLOG_END_TAG */
+// $Id: getPciOscswitchConfig.C,v 1.2 2014/01/15 20:03:06 whs Exp $
+/**
+ * @file getPciOscswitchConfig.C
+ *
+ * @brief Accessor for providing the ATTR_PCI_OSCSWITCH_CONFIG attribute
+ *
+ */
+
+#include <stdint.h>
+
+// fapi support
+#include <fapi.H>
+#include <fapiUtil.H>
+#include <getPciOscswitchConfig.H>
+
+extern "C"
+{
+using namespace fapi;
+
+fapi::ReturnCode getPciOscswitchConfig(
+ const fapi::Target &i_procTarget,
+ uint8_t & o_val)
+{
+ fapi::ReturnCode l_fapirc;
+ fapi::ATTR_NAME_Type l_chipType = 0x00;
+ const uint32_t DEFAULT_EC_VALUE = 0x10;
+ uint8_t l_attrDdLevel = DEFAULT_EC_VALUE;
+ uint32_t l_position = 0;
+
+ FAPI_DBG("getPciOscswitchConfig: entry ");
+
+ do {
+ FAPI_DBG("getPciOscswitchConfig: parent path=%s ",
+ i_procTarget.toEcmdString() );
+
+ // Get chip type
+ l_fapirc = FAPI_ATTR_GET_PRIVILEGED(ATTR_NAME,
+ &i_procTarget,
+ l_chipType);
+ if (l_fapirc) {
+ FAPI_ERR("getPciOscswitchConig:FAPI_ATTR_GET_PRIVILEGED(ATTR_NAME) "
+ "failed w/rc=0x%08x",
+ static_cast<uint32_t>(l_fapirc) );
+ break; // break out with error
+ }
+ FAPI_DBG("getPciOscswitchConfig: Chip type=0x%02x",l_chipType);
+
+ // Get EC level
+ l_fapirc = FAPI_ATTR_GET_PRIVILEGED(ATTR_EC,
+ &i_procTarget,
+ l_attrDdLevel);
+ if (l_fapirc) {
+ FAPI_ERR("getPciOscswitchConig:FAPI_ATTR_GET_PRIVILEGED(ATTR_EC) "
+ "failed w/rc=0x%08x",
+ static_cast<uint32_t>(l_fapirc) );
+ break; // break out with error
+ }
+ FAPI_DBG("getPciOscswitchConfig: EC level=0x%02x",l_attrDdLevel);
+
+ // Get the position
+ l_fapirc = FAPI_ATTR_GET_PRIVILEGED(ATTR_POS,
+ &i_procTarget,
+ l_position);
+ if (l_fapirc) {
+ FAPI_ERR("getPciOscswitchConig:FAPI_ATTR_GET_PRIVILEGED(ATTR_POS) "
+ "failed w/rc=0x%08x",
+ static_cast<uint32_t>(l_fapirc) );
+ break; // break out with error
+ }
+ FAPI_DBG("getPciOscswitchConfig: position=0x%08x",l_position);
+
+ // determine value to return
+ if (l_chipType == ENUM_ATTR_NAME_MURANO)
+ {
+ if (l_attrDdLevel < 0x20 )
+ {
+ o_val = MURANO_DD1X;
+ }
+ else if (l_attrDdLevel < 0x30 )
+ {
+ o_val = MURANO_DD2X;
+ }
+ else
+ {
+ FAPI_ERR("getPciOscswitchConfig: unexpected ec=0x%02x",
+ l_attrDdLevel);
+ const uint32_t & FFDC_CHIP_EC = l_attrDdLevel;
+ FAPI_SET_HWP_ERROR(l_fapirc,RC_OSC_SWITCH_UNEXPECTED_CHIP_EC);
+ break; // break out with error
+ }
+ }
+ else if (l_chipType == ENUM_ATTR_NAME_VENICE)
+ {
+ if (l_position == 0x00 || l_position == 0x02 )
+ {
+ o_val = VENICE_P0P2;
+ }
+ else if (l_position == 0x01 || l_position == 0x03 )
+ {
+ o_val = VENICE_P1P3;
+ }
+ else
+ {
+ FAPI_ERR("getPciOscswitchConfig: unexpected position=0x%08x",
+ l_position);
+ const uint32_t & FFDC_CHIP_POSITION = l_position;
+ FAPI_SET_HWP_ERROR(l_fapirc,
+ RC_OSC_SWITCH_UNEXPECTED_CHIP_POSITION);
+ break; // break out with error
+ }
+ }
+ else
+ {
+ FAPI_ERR("getPciOscswitchConfig: unexpected chip type=0x%02x",
+ l_chipType);
+ const uint32_t & FFDC_CHIP_TYPE = l_chipType;
+ FAPI_SET_HWP_ERROR(l_fapirc,RC_OSC_SWITCH_UNEXPECTED_CHIP_TYPE);
+ break; // break out with error
+ }
+ FAPI_DBG("getPciOscswitchConfig: pci oscswitch config=0x%02x",
+ o_val);
+
+ } while (0);
+
+ FAPI_DBG("getPciOscswitchConfig: exit rc=0x%08x)",
+ static_cast<uint32_t>(l_fapirc));
+
+ return l_fapirc;
+}
+
+} // extern "C"
diff --git a/src/usr/hwpf/hwp/chip_attributes.xml b/src/usr/hwpf/hwp/chip_attributes.xml
index 00aeb28ed..cd45db284 100644
--- a/src/usr/hwpf/hwp/chip_attributes.xml
+++ b/src/usr/hwpf/hwp/chip_attributes.xml
@@ -5,7 +5,7 @@
<!-- -->
<!-- IBM CONFIDENTIAL -->
<!-- -->
-<!-- COPYRIGHT International Business Machines Corp. 2012,2013 -->
+<!-- COPYRIGHT International Business Machines Corp. 2012,2014 -->
<!-- -->
<!-- p1 -->
<!-- -->
@@ -178,6 +178,16 @@
</attribute>
<!-- ********************************************************************* -->
<attribute>
+ <id>ATTR_PCI_OSCSWITCH_CONFIG</id>
+ <targetType>TARGET_TYPE_PROC_CHIP</targetType>
+ <description>
+ Defines PCI oscswitch configuration (FSI GP7 bits 0:3)
+ </description>
+ <valueType>uint8</valueType>
+ <platInit/>
+ </attribute>
+ <!-- ********************************************************************* -->
+ <attribute>
<id>ATTR_PROC_MASTER_TYPE</id>
<targetType>TARGET_TYPE_PROC_CHIP</targetType>
<description>
diff --git a/src/usr/hwpf/hwp/makefile b/src/usr/hwpf/hwp/makefile
index 7a5946d80..b9877a705 100644
--- a/src/usr/hwpf/hwp/makefile
+++ b/src/usr/hwpf/hwp/makefile
@@ -5,7 +5,7 @@
#
# IBM CONFIDENTIAL
#
-# COPYRIGHT International Business Machines Corp. 2011,2013
+# COPYRIGHT International Business Machines Corp. 2011,2014
#
# p1
#
@@ -56,5 +56,6 @@ include spd_accessors/spd.mk
include pll_accessors/pll.mk
include winkle_ring_accessors/winkle_ring.mk
include utility_procedures/utils.mk
+include chip_accessors/chip.mk
include ${ROOTPATH}/config.mk
diff --git a/src/usr/hwpf/makefile b/src/usr/hwpf/makefile
index 8d5a91fc2..af778a9c7 100644
--- a/src/usr/hwpf/makefile
+++ b/src/usr/hwpf/makefile
@@ -33,7 +33,8 @@ SUBDIRS = fapi.d hwp.d plat.d test.d
HWP_ERROR_XML_FILES = hwp/fapiHwpErrorInfo.xml \
hwp/dmi_training/proc_cen_framelock/proc_cen_framelock_errors.xml \
hwp/bus_training/io_errors.xml \
- hwp/dimm_errors.xml \
+ hwp/dimm_errors.xml \
+ hwp/chip_accessors/chip_errors.xml \
hwp/dram_training/memory_errors.xml \
hwp/nest_chiplets/proc_start_clocks_chiplets/proc_start_clocks_chiplets_errors.xml \
hwp/edi_ei_initialization/proc_fab_iovalid/proc_fab_smp_errors.xml \
diff --git a/src/usr/hwpf/plat/fapiPlatAttributeService.C b/src/usr/hwpf/plat/fapiPlatAttributeService.C
index b1d530fb5..7c90557d8 100644
--- a/src/usr/hwpf/plat/fapiPlatAttributeService.C
+++ b/src/usr/hwpf/plat/fapiPlatAttributeService.C
@@ -5,7 +5,7 @@
/* */
/* IBM CONFIDENTIAL */
/* */
-/* COPYRIGHT International Business Machines Corp. 2011,2013 */
+/* COPYRIGHT International Business Machines Corp. 2011,2014 */
/* */
/* p1 */
/* */
@@ -51,6 +51,7 @@
#include <hwpf/hwp/mvpd_accessors/getMBvpdDram2NModeEnabled.H>
#include <hwpf/hwp/mvpd_accessors/getMBvpdSensorMap.H>
#include <hwpf/hwp/mvpd_accessors/accessMBvpdL4BankDelete.H>
+#include <hwpf/hwp/chip_accessors/getPciOscswitchConfig.H>
#include <fapiPllRingAttr.H>
#include <hwpf/hwp/pll_accessors/getPllRingAttr.H>
#include <hwpf/hwp/pll_accessors/getPllRingInfoAttr.H>
@@ -1435,6 +1436,16 @@ fapi::ReturnCode fapiPlatGetL3DDAttr(const fapi::Target * i_pProcTarget,
return l_rc;
}
+//-----------------------------------------------------------------------------
+fapi::ReturnCode fapiPlatGetPciOscswitchConfig
+ (const fapi::Target * i_pProcTarget,
+ uint8_t &o_val)
+{
+ fapi::ReturnCode l_rc;
+ FAPI_EXEC_HWP(l_rc, getPciOscswitchConfig, *i_pProcTarget, o_val);
+ return l_rc;
+}
+
} // End platAttrSvc namespace
} // End fapi namespace
OpenPOWER on IntegriCloud