diff options
author | Mike Baiocchi <baiocchi@us.ibm.com> | 2014-08-25 10:21:27 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2014-09-08 09:09:00 -0500 |
commit | 1995279e84f86117e083b42dceec6d0e9b26a8e9 (patch) | |
tree | 792fd887920c5d074b175759d9117168c2d08bf4 /src | |
parent | c57af7db48ddc21ce693057209c2a5070f8a5b62 (diff) | |
download | talos-hostboot-1995279e84f86117e083b42dceec6d0e9b26a8e9.tar.gz talos-hostboot-1995279e84f86117e083b42dceec6d0e9b26a8e9.zip |
Initial Setup of FSI I2C Access Method
Add attributes and device driver hooks to add ability to switch
between Host or FSI I2C access methods on a per target basis.
Change-Id: I145f62583ddfe2d72feec1da3a76205b5191fb83
RTC: 109926
Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/12998
Tested-by: Jenkins Server
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/include/usr/devicefw/driverif.H | 71 | ||||
-rwxr-xr-x | src/usr/i2c/test/i2ctest.H | 4 | ||||
-rw-r--r-- | src/usr/targeting/common/xmltohb/attribute_types.xml | 37 | ||||
-rw-r--r-- | src/usr/targeting/common/xmltohb/target_types.xml | 16 |
4 files changed, 116 insertions, 12 deletions
diff --git a/src/include/usr/devicefw/driverif.H b/src/include/usr/devicefw/driverif.H index 2e321298b..0842f734d 100644 --- a/src/include/usr/devicefw/driverif.H +++ b/src/include/usr/devicefw/driverif.H @@ -5,7 +5,9 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* COPYRIGHT International Business Machines Corp. 2011,2014 */ +/* Contributors Listed Below - COPYRIGHT 2011,2014 */ +/* [+] 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. */ @@ -51,6 +53,8 @@ namespace DeviceFW I2C, FSISCOM, IBSCOM, + HOSTI2C, + FSI_I2C, LAST_DRIVER_ACCESS_TYPE }; @@ -98,6 +102,16 @@ namespace DeviceFW DeviceFW::IBSCOM, static_cast<uint64_t>((i_address)) /** + * @brief Macro that handles the I2C parameters + */ + #define DEVICE_I2C_PARMS(port, engine, devAddr, offset_len, offset)\ + 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 ) + + /** * 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. @@ -105,11 +119,7 @@ namespace DeviceFW * @note '0' and 'NULL' added to line up with other DeviceFW::I2C */ #define DEVICE_I2C_ADDRESS( i_port, i_engine, i_devAddr )\ - DeviceFW::I2C, static_cast<uint64_t>(( i_port )),\ - static_cast<uint64_t>(( i_engine )),\ - static_cast<uint64_t>(( i_devAddr )),\ - 0,\ - NULL + DeviceFW::I2C, DEVICE_I2C_PARMS(i_port, i_engine, i_devAddr, 0, NULL) /** * Construct the device addressing parameters for the I2C-offset device ops. @@ -120,11 +130,50 @@ namespace DeviceFW * @param[in] i_offset - Offset into I2C device */ #define DEVICE_I2C_ADDRESS_OFFSET( i_port, i_engine, i_devAddr, i_offset_len, i_offset)\ - DeviceFW::I2C, static_cast<uint64_t>(( i_port )),\ - static_cast<uint64_t>(( i_engine )),\ - static_cast<uint64_t>(( i_devAddr )),\ - static_cast<uint64_t>(( i_offset_len )),\ - static_cast<uint8_t*>(( i_offset )) + DeviceFW::I2C, DEVICE_I2C_PARMS(i_port, i_engine, i_devAddr, i_offset_len, i_offset) + + /** + * Construct the device addressing parameters for the Host 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 + */ + #define DEVICE_HOSTI2C_ADDRESS( i_port, i_engine, i_devAddr )\ + DeviceFW::HOSTI2C, DEVICE_I2C_PARMS(i_port, i_engine, i_devAddr, 0, NULL) + + /** + * 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) + + /** + * 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 + */ + #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) + + /** + * 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) + /** @class InvalidParameterType * @brief Unused type to cause compiler fails for invalid template types. diff --git a/src/usr/i2c/test/i2ctest.H b/src/usr/i2c/test/i2ctest.H index e8c0da9c0..f19edde02 100755 --- a/src/usr/i2c/test/i2ctest.H +++ b/src/usr/i2c/test/i2ctest.H @@ -5,7 +5,9 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* COPYRIGHT International Business Machines Corp. 2011,2014 */ +/* Contributors Listed Below - COPYRIGHT 2011,2014 */ +/* [+] 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. */ diff --git a/src/usr/targeting/common/xmltohb/attribute_types.xml b/src/usr/targeting/common/xmltohb/attribute_types.xml index 17643aaef..e9fa7eb11 100644 --- a/src/usr/targeting/common/xmltohb/attribute_types.xml +++ b/src/usr/targeting/common/xmltohb/attribute_types.xml @@ -14230,4 +14230,41 @@ firmware notes: Platforms should initialize this attribute to AUTO (0)</descript </hwpfToHbAttrMap> </attribute> +<attribute> + <id>I2C_SWITCHES</id> + <description>Attribute storing information about which I2C method to use</description> + <complexType> + <description>Structure which defines which I2C access method to use at + a point in time. Only applicable if target supports one or more I2C + types. Only one bit (of the first two) can ever be set at any one time. + </description> + <field> + <name>useFsiI2C</name> + <description>0b0: Do not use FSI I2C at this time. 0b1: Use FSI + I2C at this time</description> + <type>uint8_t</type> + <bits>1</bits> + <default>0</default> + </field> + <field> + <name>useHostI2C</name> + <description>0b0: Do not use Host I2C at this time. 0b1: Use + Host I2C at this time</description> + <type>uint8_t</type> + <bits>1</bits> + <default>0</default> + </field> + <field> + <name>reserved</name> + <description>Reserved for future expansion</description> + <type>uint8_t</type> + <bits>6</bits> + <default>0</default> + </field> + </complexType> + <persistency>volatile</persistency> + <readable/> + <writeable/> +</attribute> + </attributes> diff --git a/src/usr/targeting/common/xmltohb/target_types.xml b/src/usr/targeting/common/xmltohb/target_types.xml index 575905118..acd8f9885 100644 --- a/src/usr/targeting/common/xmltohb/target_types.xml +++ b/src/usr/targeting/common/xmltohb/target_types.xml @@ -484,6 +484,14 @@ <attribute><id>PM_PBA_FIR_MASK</id></attribute> <attribute><id>PM_PMC_LFIR_MASK</id></attribute> <attribute><id>PM_FIRINIT_DONE_ONCE_FLAG</id></attribute> + <attribute> + <id>I2C_SWITCHES</id> + <default> + <field><id>useFsiI2C</id><value>0</value></field> + <field><id>useHostI2C</id><value>1</value></field> + <field><id>reserved</id><value>0</value></field> + </default> + </attribute> </targetType> <targetType> @@ -1347,6 +1355,14 @@ <attribute><id>MSS_VOLT_OVERRIDE</id></attribute> <attribute><id>MSS_POWER_CONTROL_REQUESTED</id></attribute> <attribute><id>MSS_POWER_CONTROL_CAPABLE</id></attribute> + <attribute> + <id>I2C_SWITCHES</id> + <default> + <field><id>useFsiI2C</id><value>1</value></field> + <field><id>useHostI2C</id><value>0</value></field> + <field><id>reserved</id><value>0</value></field> + </default> + </attribute> </targetType> <!-- Centaur L4 --> |