summaryrefslogtreecommitdiffstats
path: root/src/include
diff options
context:
space:
mode:
authoraalugore <aalugore@us.ibm.com>2016-01-22 13:36:14 -0600
committerStephen Cprek <smcprek@us.ibm.com>2016-04-21 13:51:43 -0500
commit4f4f097d65e919bcc8bd5706f50ea0f413b8bfef (patch)
tree90030301032f3a87e952e5c161763bab0ad812be /src/include
parent18e7af4cee8e4a9b88dee257edffb528b969ecd3 (diff)
downloadtalos-hostboot-4f4f097d65e919bcc8bd5706f50ea0f413b8bfef.tar.gz
talos-hostboot-4f4f097d65e919bcc8bd5706f50ea0f413b8bfef.zip
DDR4 - Allow SPD writes
-DDR4 has 512-byte EEPROM with 2 256-byte pages. This commit contains the necessary page switching logic to support this. Change-Id: Iaa8e3e344def98b71d6a9e9387c5e0d9137a0397 RTC:137707 ForwardPort: yes Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/797 Tested-by: Jenkins Server Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com> Tested-by: Jenkins OP Build CI Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com> Tested-by: Jenkins OP HW Tested-by: FSP CI Jenkins Reviewed-by: Matthew A. Ploetz <maploetz@us.ibm.com> Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/871
Diffstat (limited to 'src/include')
-rw-r--r--src/include/usr/devicefw/driverif.H27
-rw-r--r--src/include/usr/i2c/i2creasoncodes.H7
-rw-r--r--src/include/usr/vpd/spdenums.H4
3 files changed, 34 insertions, 4 deletions
diff --git a/src/include/usr/devicefw/driverif.H b/src/include/usr/devicefw/driverif.H
index 0842f734d..a148725b5 100644
--- a/src/include/usr/devicefw/driverif.H
+++ b/src/include/usr/devicefw/driverif.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2011,2014 */
+/* Contributors Listed Below - COPYRIGHT 2011,2016 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -132,6 +132,31 @@ namespace DeviceFW
#define DEVICE_I2C_ADDRESS_OFFSET( i_port, i_engine, i_devAddr, i_offset_len, i_offset)\
DeviceFW::I2C, DEVICE_I2C_PARMS(i_port, i_engine, i_devAddr, i_offset_len, i_offset)
+
+ /**
+ * Construct the device addressing parameters for locking the page
+ * attribute of an I2C master target
+ *
+ * @param[in] i_port - Which port to use from the I2C master.
+ * @param[in] i_engine - Which I2C master engine to use.
+ * @param[in] i_shouldLock - bool to determine whether we are
+ * attempting to lock or unlock the page.
+ * @param[in] i_desired_page - The EEPROM page we want to switch to
+ * iff a page switch is needed.
+ * @param[in] i_lockMutex - bool to determine whether we actually
+ * want to lock the page mutex or not. This bool allows
+ * us to switch pages mid read without hitting a deadlock.
+ */
+#define DEVICE_I2C_CONTROL_PAGE_OP( i_port, i_engine, i_shouldLock, i_desired_page, i_lockMutex )\
+ DeviceFW::I2C,\
+ static_cast<uint64_t>(i_port),\
+ static_cast<uint64_t>(i_engine),\
+ 0xffffffff,\
+ static_cast<uint64_t>(i_shouldLock),\
+ static_cast<uint64_t>(i_desiredPage),\
+ static_cast<uint64_t>(i_lockMutex)
+
+
/**
* Construct the device addressing parameters for the Host I2C device ops.
* @param[in] i_port - Which port to use from the I2C master.
diff --git a/src/include/usr/i2c/i2creasoncodes.H b/src/include/usr/i2c/i2creasoncodes.H
index fda1c142c..d46546ca2 100644
--- a/src/include/usr/i2c/i2creasoncodes.H
+++ b/src/include/usr/i2c/i2creasoncodes.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2011,2015 */
+/* Contributors Listed Below - COPYRIGHT 2011,2016 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -59,6 +59,8 @@ enum i2cModuleId
I2C_SEND_SLAVE_STOP = 0x09,
I2C_PROCESS_ACTIVE_MASTERS = 0x0A,
I2C_FORCE_RESET_AND_UNLOCK = 0x0B,
+ I2C_PAGE_LOCK_OP = 0x0C,
+ I2C_PAGE_UNLOCK_OP = 0x0D,
};
@@ -86,6 +88,9 @@ enum i2cReasonCode
I2C_RUNTIME_INTERFACE_ERR = I2C_COMP_ID | 0x0D, // Read/write unavailable at runtime
I2C_RUNTIME_ERR = I2C_COMP_ID | 0x0E, // Failed run-time operation
I2C_RUNTIME_INVALID_OFFSET_LENGTH = I2C_COMP_ID | 0x0F, // Offset length of invalid size
+ I2C_INVALID_EEPROM_PAGE_MUTEX = I2C_COMP_ID | 0x10, // Error getting page mutex for i2c engine.
+ I2C_INVALID_EEPROM_PAGE_REQUEST = I2C_COMP_ID | 0x11, // Invalid EEPROM page request
+ I2C_FAILURE_UNLOCKING_EEPROM_PAGE = I2C_COMP_ID | 0x12 // Error while attempting to unlock the eeprom page
};
diff --git a/src/include/usr/vpd/spdenums.H b/src/include/usr/vpd/spdenums.H
index b728e3fbf..9decbe862 100644
--- a/src/include/usr/vpd/spdenums.H
+++ b/src/include/usr/vpd/spdenums.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2013,2015 */
+/* Contributors Listed Below - COPYRIGHT 2013,2016 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -139,7 +139,7 @@ enum
TRRDS_FINE_OFFSET = SPD_FIRST_NORM_KEYWORD | 0x53,
TCKMAX_FINE_OFFSET = SPD_FIRST_NORM_KEYWORD | 0x54,
BASE_CONFIG_CRC = SPD_FIRST_NORM_KEYWORD | 0x55,
- MODULE_REVISION_CODE_DDR4 = SPD_FIRST_NORM_KEYWORD | 0x56,
+ MODULE_REVISION_CODE_DDR4 = MODULE_REVISION_CODE,
DRAM_STEPPING = SPD_FIRST_NORM_KEYWORD | 0x57,
MANUFACTURING_SECTION_CRC = SPD_FIRST_NORM_KEYWORD | 0x58,
SPD_LAST_NORM_KEYWORD = SPD_FIRST_NORM_KEYWORD | 0x58,
OpenPOWER on IntegriCloud