diff options
author | Roland Veloz <rveloz@us.ibm.com> | 2018-09-26 00:51:53 -0500 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2018-12-06 19:18:15 -0600 |
commit | b63c84765363b7bf4eea4a19d4cf5bba2533b63b (patch) | |
tree | a9e19493bf958bc47233af466f3106ecc4f2e22f /src/include/usr/devicefw | |
parent | 082f9363ee8ea21647959637cf05a102fec4d24e (diff) | |
download | talos-hostboot-b63c84765363b7bf4eea4a19d4cf5bba2533b63b.tar.gz talos-hostboot-b63c84765363b7bf4eea4a19d4cf5bba2533b63b.zip |
Driver changes to support i2c mux
- Updated data structures gpioAddr_t, eeprom_addr_t, misc_args_t, nvdimm_addr_t
and tpm_info_t with I2C MUX data members. Also added constructors to these
structures to default there data members with the correct default info.
- Updated macros DEVICE_I2C_PARMS, DEVICE_I2C_ADDRESS and
DEVICE_I2C_ADDRESS_OFFSET to take the I2C MUX bus selector parameter and the
I2C MUX entity path.
- Added method i2cAccessMux to file i2c.H/.C that will setup the call for the
I2C MUX. Method i2cCommonOP calls i2cAccessMux which then calls i2cCommonOp
with appropriate parameters for the I2C MUX: i2cCommonOP -> i2cAccessMux
-> i2cCommonOP.
- Updated i2ctest.H with new I2C MUX params to get it to pass.
RTC:191352
Change-Id: I6a70860eb2286bbd23d6157d72351b8adfa21aac
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/66651
Reviewed-by: Ilya Smirnov <ismirno@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Nicholas E. Bofferding <bofferdn@us.ibm.com>
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/include/usr/devicefw')
-rw-r--r-- | src/include/usr/devicefw/driverif.H | 66 |
1 files changed, 47 insertions, 19 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. |