summaryrefslogtreecommitdiffstats
path: root/src/include
diff options
context:
space:
mode:
authorTerry J. Opie <opiet@us.ibm.com>2012-01-03 15:06:17 -0600
committerA. Patrick Williams III <iawillia@us.ibm.com>2012-01-31 13:06:56 -0600
commite5908dd4c110595e7c11d46009b07aa068dc19cd (patch)
treee0b7647123fbc87f4f459f909bb4f2be0da8f0dd /src/include
parent39b01da0087097401dea4d9a9f4e483734e751d8 (diff)
downloadtalos-hostboot-e5908dd4c110595e7c11d46009b07aa068dc19cd.tar.gz
talos-hostboot-e5908dd4c110595e7c11d46009b07aa068dc19cd.zip
SPD Device Driver
- JEDEC format for DDR3 - Testcases Change-Id: I8a9bf87335914d5cb824adb92f11546c37e5b423 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/610 Tested-by: Jenkins Server Reviewed-by: Van H. Lee <vanlee@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/include')
-rw-r--r--src/include/usr/devicefw/userif.H27
-rw-r--r--src/include/usr/hbotcompid.H8
-rw-r--r--src/include/usr/initservice/initsvcreasoncodes.H1
-rw-r--r--src/include/usr/spd/spdenums.H114
-rw-r--r--src/include/usr/spd/spdreasoncodes.H78
5 files changed, 219 insertions, 9 deletions
diff --git a/src/include/usr/devicefw/userif.H b/src/include/usr/devicefw/userif.H
index 836e468ca..0fbe63149 100644
--- a/src/include/usr/devicefw/userif.H
+++ b/src/include/usr/devicefw/userif.H
@@ -21,8 +21,8 @@
//
// IBM_PROLOG_END
/** @file userif.H
- * @brief Provides the user application interfaces for performing device
- * access.
+ * @brief Provides the user application interfaces for performing device
+ * access.
*
* @note These interfaces should not be used directly by device drivers.
* Use driverif.H instead.
@@ -47,16 +47,17 @@ namespace DeviceFW
MAILBOX,
PRESENT,
FSI,
+ SPD,
LAST_ACCESS_TYPE,
};
-
- /** Construct the device addressing parameters for SCOM device ops.
+
+ /** Construct the device addressing parameters for SCOM device ops.
* @param[in] i_address - Scom address to operate on.
*/
#define DEVICE_SCOM_ADDRESS(i_address) \
DeviceFW::SCOM, static_cast<uint64_t>((i_address))
-
+
/** Construct the device addressing parameters for the PRESENT device ops.
*/
#define DEVICE_PRESENT_ADDRESS() \
@@ -78,15 +79,23 @@ namespace DeviceFW
*/
#define DEVICE_PNOR_ADDRESS( i_chip, i_addr ) \
DeviceFW::PNOR, ((static_cast<uint64_t>(i_chip)<<32)|static_cast<uint64_t>(i_addr))
-
+
/** Construct the device addressing parameters for FSI device ops.
* @param[in] i_address - FSI address to operate on.
*/
#define DEVICE_FSI_ADDRESS(i_address) \
DeviceFW::FSI, static_cast<uint64_t>((i_address))
+ /**
+ * Construct the device addressing parameters for the SPD device ops.
+ * @param[in] i_keyword - The keyword enumeration value to be accessed
+ * by the device driver.
+ */
+ #define DEVICE_SPD_ADDRESS( i_keyword )\
+ DeviceFW::SPD, static_cast<uint64_t>(( i_keyword ))
+
- /**
+ /**
* @brief Perform a hardware read operation.
*
* @param[in] i_target Device target to operate on.
@@ -112,11 +121,11 @@ namespace DeviceFW
* </PRE>
*
*/
- errlHndl_t deviceRead(TARGETING::Target* i_target,
+ errlHndl_t deviceRead(TARGETING::Target* i_target,
void* o_buffer, size_t& io_buflen,
AccessType i_accessType, ...);
- /**
+ /**
* @brief Perform a hardware write operation.
*
* @param[in] i_target Device target to operate on.
diff --git a/src/include/usr/hbotcompid.H b/src/include/usr/hbotcompid.H
index a4102001c..711670aa2 100644
--- a/src/include/usr/hbotcompid.H
+++ b/src/include/usr/hbotcompid.H
@@ -180,6 +180,14 @@ const compId_t INTR_COMP_ID = 0x0F00;
const char INTR_COMP_NAME[] = "intr";
//@}
+/** @name SPD
+ * EEPROM device driver component
+ */
+//@{
+const compId_t SPD_COMP_ID = 0x1000;
+const char SPD_COMP_NAME[] = "spd";
+//@}
+
// ----------------------------------------------------------
// CXXTEST Unit Test, reserve compid near the end...
/** @name CXXTEST
diff --git a/src/include/usr/initservice/initsvcreasoncodes.H b/src/include/usr/initservice/initsvcreasoncodes.H
index 6cbaa81c7..971c8c29f 100644
--- a/src/include/usr/initservice/initsvcreasoncodes.H
+++ b/src/include/usr/initservice/initsvcreasoncodes.H
@@ -64,6 +64,7 @@ enum InitServiceModuleID
START_TARGETING_ERRL_ID = 0x18,
START_I2C_ERRL_ID = 0x19,
START_INTR_ERRL_ID = 0x1A,
+ START_SPD_ERRL_ID = 0x1B,
// Internal InitService codes
diff --git a/src/include/usr/spd/spdenums.H b/src/include/usr/spd/spdenums.H
new file mode 100644
index 000000000..8ca1cd39f
--- /dev/null
+++ b/src/include/usr/spd/spdenums.H
@@ -0,0 +1,114 @@
+// IBM_PROLOG_BEGIN_TAG
+// This is an automatically generated prolog.
+//
+// $Source: src/include/usr/spd/spdenums.H $
+//
+// IBM CONFIDENTIAL
+//
+// COPYRIGHT International Business Machines Corp. 2012
+//
+// 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 spdenums.H
+ *
+ * @brief Enums for the SPD fields to be requested.
+ *
+ */
+#ifndef __SPDENUMS_H
+#define __SPDENUMS_H
+
+namespace SPD
+{
+
+/**
+* @brief Enumerations for fields that can be accessed in the SPD
+*/
+enum
+{
+ SPD_FIRST_KEYWORD = 0x00,
+ CRC_EXCLUDE = SPD_FIRST_KEYWORD,
+ SPD_BYTES_TOTAL = 0x01,
+ SPD_BYTES_USED = 0x02,
+ SPD_MAJOR_REVISION = 0x03,
+ SPD_MINOR_REVISION = 0x04,
+ BASIC_MEMORY_TYPE = 0x05,
+ MODULE_TYPE = 0x06,
+ BANK_ADDRESS_BITS = 0x07,
+ DENSITY = 0x08,
+ ROW_ADDRESS = 0x09,
+ COL_ADDRESS = 0x0a,
+ MODULE_NOMINAL_VOLTAGE = 0x0b,
+ MODULE_RANKS = 0x0c,
+ MODULE_DRAM_WIDTH = 0x0d,
+ ECC_BITS = 0x0e,
+ MODULE_MEMORY_BUS_WIDTH = 0x0f,
+ FTB_DIVIDEND = 0x10,
+ FTB_DIVISOR = 0x11,
+ MTB_DIVIDEND = 0x12,
+ MTB_DIVISOR = 0x13,
+ TCK_MIN = 0x14,
+ CAS_LATENCIES_SUPPORTED = 0x15,
+ MIN_CAS_LATENCY = 0x16,
+ TWR_MIN = 0x17,
+ TRCD_MIN = 0x18,
+ TRRD_MIN = 0x19,
+ TRP_MIN = 0x1a,
+ TRC_MIN = 0x1b,
+ TRAS_MIN = 0x1c,
+ TRFC_MIN = 0x1d,
+ TWTR_MIN = 0x1e,
+ TRTP_MIN = 0x1f,
+ TFAW_MIN = 0x20,
+ DLL_OFF = 0x21,
+ RZQ_7 = 0x22,
+ RZQ_6 = 0x23,
+ PASR = 0x24,
+ ODTS = 0x25,
+ ASR = 0x26,
+ ETR_1X = 0x27,
+ ETR = 0x28,
+ THERMAL_SENSOR_PRESENT = 0x29,
+ THERMAL_SENSOR_ACCURACY = 0x2a,
+ SDRAM_DEVICE_TYPE_NONSTD = 0x2b,
+ SDRAM_DEVICE_TYPE = 0x2c,
+ MODULE_TYPE_SPECIFIC_SECTION = 0x2d,
+ MODULE_MANUFACTURER_ID = 0x2e,
+ MODULE_MANUFACTURING_LOCATION = 0x2f,
+ MODULE_MANUFACTURING_DATE = 0x30,
+ MODULE_SERIAL_NUMBER = 0x31,
+ MODULE_CRC = 0x32,
+ MODULE_PART_NUMBER = 0x33,
+ MODULE_REVISION_CODE = 0x34,
+ DRAM_MANUFACTURER_ID = 0x35,
+ MANUFACTURER_SPECIFIC_DATA = 0x36,
+ TCKMIN_FINE_OFFSET = 0x37,
+ TAAMIN_FINE_OFFSET = 0x38,
+ TRCDMIN_FINE_OFFSET = 0x39,
+ TRPMIN_FINE_OFFSET = 0x3a,
+ TRPCMIN_FINE_OFFSET = 0x3b,
+ MODULE_THERMAL_SENSOR = 0x3c,
+ SDRAM_OPTIONAL_FEATURES = 0x3d,
+ SDRAM_THERMAL_REFRESH_OPTIONS = 0x3e,
+
+ // This keyword should be last in the list
+ SPD_LAST_KEYWORD,
+
+ // Invalid Keyword
+ INVALID_SPD_KEYWORD = 0xFFFF,
+};
+
+}; // end SPD
+
+#endif
diff --git a/src/include/usr/spd/spdreasoncodes.H b/src/include/usr/spd/spdreasoncodes.H
new file mode 100644
index 000000000..d1c128100
--- /dev/null
+++ b/src/include/usr/spd/spdreasoncodes.H
@@ -0,0 +1,78 @@
+// IBM_PROLOG_BEGIN_TAG
+// This is an automatically generated prolog.
+//
+// $Source: src/include/usr/spd/spdreasoncodes.H $
+//
+// IBM CONFIDENTIAL
+//
+// COPYRIGHT International Business Machines Corp. 2012
+//
+// 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 spdreasoncodes.H
+ *
+ * @brief Reason codes and module ids for the SPD device driver
+ *
+ */
+#ifndef __SPDREASONCODES_H
+#define __SPDREASONCODES_H
+// -----------------------------------------------
+// Includes
+// -----------------------------------------------
+#include <hbotcompid.H>
+
+namespace SPD
+{
+
+/**
+* @enum spdModuleid
+*
+* @brief Module Ids used in created errorlogs. Indicates which
+* functions an error log was created in.
+*
+*/
+enum spdModuleId
+{
+ SPD_INVALID_MODULE = 0x00,
+ SPD_GET_KEYWORD_VALUE = 0x01,
+ SPD_GET_VALUE = 0x02,
+ SPD_CHECK_SIZE = 0x03,
+ SPD_READ_BINARY_FILE = 0x04,
+ SPD_WRITE_KEYWORD_VALUE = 0x05,
+ SPD_SPECIAL_CASES = 0x06,
+};
+
+/**
+ * @enum spdReasonCode
+ *
+ * @brief Reasoncodes used to describe what errors are being indicated.
+ *
+ */
+enum spdReasonCode
+{
+ SPD_INVALID_REASONCODE = SPD_COMP_ID | 0x00, // Invalid Reasoncode
+ SPD_INVALID_BASIC_MEMORY_TYPE = SPD_COMP_ID | 0x01,
+ SPD_BASIC_MEMORY_TYPE = SPD_COMP_ID | 0x02,
+ SPD_INVALID_SPD_KEYWORD = SPD_COMP_ID | 0x03,
+ SPD_MEMTYPE_NOT_SUPPORTED = SPD_COMP_ID | 0x04,
+ SPD_INSUFFICIENT_BUFFER_SIZE = SPD_COMP_ID | 0x05,
+ SPD_INSUFFICIENT_FILE_SIZE = SPD_COMP_ID | 0x06,
+ SPD_NOT_SUPPORTED = SPD_COMP_ID | 0x07,
+ SPD_KEYWORD_NOT_FOUND = SPD_COMP_ID | 0x08,
+};
+
+}; // end SPD
+
+#endif
OpenPOWER on IntegriCloud