summaryrefslogtreecommitdiffstats
path: root/src/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/include')
-rw-r--r--src/include/usr/devicefw/driverif.H66
-rw-r--r--src/include/usr/i2c/i2creasoncodes.H3
-rw-r--r--src/include/usr/i2c/tpmddif.H9
3 files changed, 58 insertions, 20 deletions
diff --git a/src/include/usr/devicefw/driverif.H b/src/include/usr/devicefw/driverif.H
index 9bed7bb94..6e94f04e4 100644
--- a/src/include/usr/devicefw/driverif.H
+++ b/src/include/usr/devicefw/driverif.H
@@ -41,6 +41,14 @@
#endif // not PARSER
+namespace I2C_MUX
+{
+ enum SELECTOR: uint8_t
+ {
+ NOT_APPLICABLE = 0xFF,
+ };
+}
+
namespace DeviceFW
{
/** @enum AccessType_DriverOnly
@@ -57,6 +65,7 @@ namespace DeviceFW
FSI_I2C,
SBEFIFOSCOM,
I2CSCOM,
+ I2C_MUX,
LAST_DRIVER_ACCESS_TYPE
};
@@ -119,22 +128,29 @@ namespace DeviceFW
/**
* @brief Macro that handles the I2C parameters
*/
- #define DEVICE_I2C_PARMS(port, engine, devAddr, offset_len, offset)\
+ #define DEVICE_I2C_PARMS(port, engine, devAddr, offset_len,\
+ offset, muxSelector, i_i2cMuxPath)\
static_cast<uint64_t>( port ),\
static_cast<uint64_t>( engine ),\
static_cast<uint64_t>( devAddr ),\
static_cast<uint64_t>( offset_len ),\
- static_cast<uint8_t*>( offset )
+ static_cast<uint8_t*>( offset ),\
+ static_cast<uint64_t>( muxSelector), \
+ static_cast<const TARGETING::EntityPath*>(i_i2cMuxPath)
/**
* Construct the device addressing parameters for the I2C device ops.
* @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_devAddr - The device address on a given engine/port.
- * @note '0' and 'NULL' added to line up with other DeviceFW::I2C
+ * @param[in] i_i2cMuxBusSelector - The I2C MUX bus selector
+ * @param[in] i_i2cMuxPath - The I2C MUX entity path
+ * @note '0' and 'nullptr' added to line up with other DeviceFW::I2C
*/
- #define DEVICE_I2C_ADDRESS( i_port, i_engine, i_devAddr )\
- DeviceFW::I2C, DEVICE_I2C_PARMS(i_port, i_engine, i_devAddr, 0, NULL)
+ #define DEVICE_I2C_ADDRESS( i_port, i_engine, i_devAddr, \
+ i_i2cMuxBusSelector, i_i2cMuxPath )\
+ DeviceFW::I2C, DEVICE_I2C_PARMS(i_port, i_engine, i_devAddr,\
+ 0, nullptr, i_i2cMuxBusSelector, i_i2cMuxPath)
/**
* Construct the device addressing parameters for the I2C-offset device ops.
@@ -143,10 +159,13 @@ namespace DeviceFW
* @param[in] i_devAddr - The device address on a given engine/port.
* @param[in] i_offset_len - Length of offset (in bytes)
* @param[in] i_offset - Offset into I2C device
+ * @param[in] i_i2cMuxBusSelector - The I2C MUX bus selector
+ * @param[in] i_i2cMuxPath - The I2C MUX entity path
*/
- #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)
-
+ #define DEVICE_I2C_ADDRESS_OFFSET( i_port, i_engine, i_devAddr,\
+ i_offset_len, i_offset, i_i2cMuxBusSelector, i_i2cMuxPath)\
+ DeviceFW::I2C, DEVICE_I2C_PARMS(i_port, i_engine, i_devAddr,\
+ i_offset_len, i_offset, i_i2cMuxBusSelector, i_i2cMuxPath)
/**
* Construct the device addressing parameters for locking the page
@@ -162,7 +181,8 @@ namespace DeviceFW
* 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 )\
+#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),\
@@ -177,42 +197,50 @@ namespace DeviceFW
* @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_devAddr - The device address on a given engine/port.
- * @note '0' and 'NULL' added to line up with other DeviceFW::I2C
+ * @note '0' and 'nullptr' added to line up with other DeviceFW::I2C
*/
#define DEVICE_HOSTI2C_ADDRESS( i_port, i_engine, i_devAddr )\
- DeviceFW::HOSTI2C, DEVICE_I2C_PARMS(i_port, i_engine, i_devAddr, 0, NULL)
+ DeviceFW::HOSTI2C, DEVICE_I2C_PARMS(i_port, i_engine, i_devAddr,\
+ 0, nullptr)
/**
- * Construct the device addressing parameters for the Host I2C-offset device ops.
+ * Construct the device addressing parameters for the Host I2C-offset
+ * device ops.
* @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_devAddr - The device address on a given engine/port.
* @param[in] i_offset_len - Length of offset (in bytes)
* @param[in] i_offset - Offset into I2C device
*/
- #define DEVICE_HOSTI2C_ADDRESS_OFFSET( i_port, i_engine, i_devAddr, i_offset_len, i_offset)\
- DeviceFW::HOSTI2C, DEVICE_I2C_PARMS(i_port, i_engine, i_devAddr, i_offset_len, i_offset)
+ #define DEVICE_HOSTI2C_ADDRESS_OFFSET( i_port, i_engine, i_devAddr,\
+ i_offset_len, i_offset)\
+ DeviceFW::HOSTI2C, DEVICE_I2C_PARMS(i_port, i_engine, i_devAddr,\
+ i_offset_len, i_offset)
/**
* Construct the device addressing parameters for the FSI I2C device ops.
* @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_devAddr - The device address on a given engine/port.
- * @note '0' and 'NULL' added to line up with other DeviceFW::I2C
+ * @note '0' and 'nullptr' added to line up with other DeviceFW::I2C
*/
#define DEVICE_FSI_I2C_ADDRESS( i_port, i_engine, i_devAddr )\
- DeviceFW::FSI_I2C, DEVICE_I2C_PARMS(i_port, i_engine, i_devAddr, 0, NULL)
+ DeviceFW::FSI_I2C, DEVICE_I2C_PARMS(i_port, i_engine,\
+ i_devAddr, 0, nullptr)
/**
- * Construct the device addressing parameters for the FSI I2C-offset device ops.
+ * Construct the device addressing parameters for the FSI I2C-offset
+ * device ops.
* @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_devAddr - The device address on a given engine/port.
* @param[in] i_offset_len - Length of offset (in bytes)
* @param[in] i_offset - Offset into I2C device
*/
- #define DEVICE_FSI_I2C_ADDRESS_OFFSET( i_port, i_engine, i_devAddr, i_offset_len, i_offset)\
- DeviceFW::FSI_I2C, DEVICE_I2C_PARMS(i_port, i_engine, i_devAddr, i_offset_len, i_offset)
+ #define DEVICE_FSI_I2C_ADDRESS_OFFSET( i_port, i_engine, i_devAddr,\
+ i_offset_len, i_offset)\
+ DeviceFW::FSI_I2C, DEVICE_I2C_PARMS(i_port, i_engine, i_devAddr,\
+ i_offset_len, i_offset)
/** Construct the device addressing parameters for the SBE FIFO Scom
* device ops.
diff --git a/src/include/usr/i2c/i2creasoncodes.H b/src/include/usr/i2c/i2creasoncodes.H
index 4ce6c3a81..e17b057ef 100644
--- a/src/include/usr/i2c/i2creasoncodes.H
+++ b/src/include/usr/i2c/i2creasoncodes.H
@@ -64,6 +64,7 @@ enum i2cModuleId
I2C_CHOOSE_EEPROM_PAGE = 0x0E,
FAPI_I2C_PERFORM_OP = 0x0F,
READ_I2C_ATTRIBUTES = 0x10,
+ I2C_ACCESS_MUX = 0x11,
};
@@ -95,6 +96,8 @@ enum i2cReasonCode
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
INVALID_MASTER_TARGET = I2C_COMP_ID | 0x13, // Master I2C target not valid
+ I2C_MUX_TARGET_NOT_FOUND = I2C_COMP_ID | 0x14, // The MUX target is not valid (null)
+ I2C_MUX_TARGET_NON_FUNCTIONAL = I2C_COMP_ID | 0x15, // The MUX target is non functional
};
diff --git a/src/include/usr/i2c/tpmddif.H b/src/include/usr/i2c/tpmddif.H
index 34128e04c..d9ff469b8 100644
--- a/src/include/usr/i2c/tpmddif.H
+++ b/src/include/usr/i2c/tpmddif.H
@@ -25,6 +25,8 @@
#ifndef __TPMDDIF_H
#define __TPMDDIF_H
+#include "usr/devicefw/driverif.H" // I2C_MUX::NOT_APPLICABLE
+
namespace TPMDD
{
@@ -79,6 +81,9 @@ struct tpm_info_t
size_t offset; ///< TPM Device register offset
tpm_addr_size_t addrSize; ///< I2C Addr size
+ uint8_t i2cMuxBusSelector; ///< The Selector for the I2C MUX
+ TARGETING::EntityPath i2cMuxPath; ///< I2C MUX path
+
/**
* @brief Construct a default tpm_info_t
*/
@@ -93,7 +98,9 @@ struct tpm_info_t
tpmEnabled(false),
devAddr(0),
offset(0),
- addrSize(LAST_DEVICE_TYPE)
+ addrSize(LAST_DEVICE_TYPE),
+ i2cMuxBusSelector(I2C_MUX::NOT_APPLICABLE),
+ i2cMuxPath()
{
}
};
OpenPOWER on IntegriCloud