summaryrefslogtreecommitdiffstats
path: root/src/import/chips/common
diff options
context:
space:
mode:
authorDan Crowell <dcrowell@us.ibm.com>2018-10-03 11:45:39 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2018-11-27 13:31:14 -0600
commitb08f9e7eb4a76ed813b0596b4b0eab30070cb3a4 (patch)
treecc607d0808f7c383b32509be1cf7191d66e6f4e3 /src/import/chips/common
parentaac415d940835878d8d19afb4556e193d3bb6399 (diff)
downloadtalos-hostboot-b08f9e7eb4a76ed813b0596b4b0eab30070cb3a4.tar.gz
talos-hostboot-b08f9e7eb4a76ed813b0596b4b0eab30070cb3a4.zip
Add header file to keep track of Chip IDs
New header file includes 32-bit and 16-bit versions of the standard chip id (cfam id, idec). Also added the OpenCAPI device id for Explorer. Change-Id: I3ae122ed447b86c269a4b9cbc5ea7b8aefa4c702 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/66931 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Reviewed-by: Joseph J. McGill <jmcgill@us.ibm.com> Reviewed-by: Benjamin Gass <bgass@us.ibm.com> Reviewed-by: Brent Wieman <bwieman@us.ibm.com> Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com> Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/69099 Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/import/chips/common')
-rw-r--r--src/import/chips/common/utils/chipids.H111
1 files changed, 111 insertions, 0 deletions
diff --git a/src/import/chips/common/utils/chipids.H b/src/import/chips/common/utils/chipids.H
new file mode 100644
index 000000000..5f9a321d6
--- /dev/null
+++ b/src/import/chips/common/utils/chipids.H
@@ -0,0 +1,111 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/import/chips/common/utils/chipids.H $ */
+/* */
+/* OpenPOWER HostBoot Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2018 */
+/* [+] International Business Machines Corp. */
+/* */
+/* */
+/* Licensed under the Apache License, Version 2.0 (the "License"); */
+/* you may not use this file except in compliance with the License. */
+/* You may obtain a copy of the License at */
+/* */
+/* http://www.apache.org/licenses/LICENSE-2.0 */
+/* */
+/* Unless required by applicable law or agreed to in writing, software */
+/* distributed under the License is distributed on an "AS IS" BASIS, */
+/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */
+/* implied. See the License for the specific language governing */
+/* permissions and limitations under the License. */
+/* */
+/* IBM_PROLOG_END_TAG */
+/**
+ * Contains constants for defined chip ids (aka. CFAM IDs, IDEC, etc)
+ * for supported chips in POWER systems
+ */
+
+#ifndef _CHIPIDS_H
+#define _CHIPIDS_H
+
+#include <stdint.h>
+
+// Standard chip ids
+namespace POWER_CHIPID
+{
+
+/**
+ * The format for all CFAM-based chips is: MLmCC049
+ * M.m = Major.minor DD level, e.g. DD1.3
+ * L = Location
+ * CC = Unique chip id
+ *
+ * See https://eclipz.pok.ibm.com/sys/ras/docs/cfam_ids.txt
+ */
+
+/**
+ * Extract the chipid from the full 32-bit CFAM ID
+ * @param[in] i_cfamId : 32-bit register data
+ * @return 32-bit chipid value
+ */
+inline uint32_t extract_chipid32( uint32_t i_cfamId )
+{
+ return (i_cfamId & 0x0F0FF000);
+};
+
+/**
+ * Extract the smaller chipid from the full 32-bit CFAM ID
+ * @param[in] i_cfamId : 32-bit register data
+ * @return Left-justified 16-bit chipid value
+ */
+inline uint16_t extract_chipid16( uint32_t i_cfamId )
+{
+ return static_cast<uint16_t>((i_cfamId & 0x0F0FF000) >> 12);
+};
+
+/**
+ * Extract the DD level from the full 32-bit CFAM ID
+ * @param[in] i_cfamId : 32-bit register data
+ * @return Right-justified (1 byte) M.m DD level
+ */
+inline uint32_t extract_ddlevel( uint32_t i_cfamId )
+{
+ uint32_t l_major = 0xF0000000 & i_cfamId;
+ uint32_t l_minor = 0x00F00000 & i_cfamId;
+ return ((l_major >> 24) | (l_minor >> 20));
+};
+
+
+// Full 32-bit value with empty nibbles for DD level
+constexpr uint32_t NIMBUS = 0x020D1049;
+constexpr uint32_t CUMULUS = 0x020D4049;
+constexpr uint32_t AXONE = 0x020D9049;
+constexpr uint32_t CENTAUR = 0x06039049;
+constexpr uint32_t EXPLORER = 0x060D2049;
+
+// Shorter 16-bit value (drops Major nibble and 049)
+constexpr uint32_t NIMBUS_16 = 0x20D1;
+constexpr uint32_t CUMULUS_16 = 0x20D4;
+constexpr uint32_t AXONE_16 = 0x20D9;
+constexpr uint32_t CENTAUR_16 = 0x6039;
+constexpr uint32_t EXPLORER_16 = 0x60D2;
+
+}; //namespace
+
+
+// OpenCAPI ids
+namespace POWER_OCID
+{
+
+// Device IDs
+constexpr uint16_t EXPLORER = 0x0636;
+
+
+// Vendir IDs
+constexpr uint16_t VENDOR_IBM = 0x1014;
+
+}; //namespace
+
+#endif /* _CHIPIDS_H */
OpenPOWER on IntegriCloud