diff options
| author | Corey Swenson <cswenson@us.ibm.com> | 2015-01-27 09:05:37 -0600 |
|---|---|---|
| committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2015-02-18 15:12:13 -0600 |
| commit | 417c6e0a4bb7c8f9d9721b73ddcae696007be15e (patch) | |
| tree | 42778d629a19bf85f740cbd649ca2d27d8a20aa9 /src/include | |
| parent | 79ea7abf6d31c146c680d39b9f3ae007e434a573 (diff) | |
| download | blackbird-hostboot-417c6e0a4bb7c8f9d9721b73ddcae696007be15e.tar.gz blackbird-hostboot-417c6e0a4bb7c8f9d9721b73ddcae696007be15e.zip | |
HBRT Runtime VPD Updates
Enables writes to VPD and handles disabling
PNOR cache in manufacturing mode
Change-Id: I03d4246ceb91520939f8b04f3b3d2fc31c116079
RTC: 114911
Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/15462
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/include')
| -rw-r--r-- | src/include/runtime/interface.h | 48 | ||||
| -rw-r--r-- | src/include/usr/i2c/i2cif.H | 5 | ||||
| -rw-r--r-- | src/include/usr/i2c/i2creasoncodes.H | 2 | ||||
| -rw-r--r-- | src/include/usr/vpd/vpd_if.H | 7 |
4 files changed, 56 insertions, 6 deletions
diff --git a/src/include/runtime/interface.h b/src/include/runtime/interface.h index 9f52c09c1..9ade9a07d 100644 --- a/src/include/runtime/interface.h +++ b/src/include/runtime/interface.h @@ -41,6 +41,24 @@ #include <stdint.h> #include <time.h> + +/** + * i2c master description: chip, engine and port packed into + * a single 64-bit argument + * + * --------------------------------------------------- + * | chip | reserved | eng | port | + * | (32) | (16) | (8) | (8) | + * --------------------------------------------------- + */ +#define HBRT_I2C_MASTER_CHIP_SHIFT 32 +#define HBRT_I2C_MASTER_CHIP_MASK (0xfffffffful << 32) +#define HBRT_I2C_MASTER_ENGINE_SHIFT 8 +#define HBRT_I2C_MASTER_ENGINE_MASK (0xfful << 8) +#define HBRT_I2C_MASTER_PORT_SHIFT 0 +#define HBRT_I2C_MASTER_PORT_MASK (0xfful) + + /** @typedef hostInterfaces_t * @brief Interfaces provided by the underlying environment (ex. Sapphire). * @@ -179,6 +197,36 @@ typedef struct hostInterfaces int (*pnor_write) (uint32_t i_proc, const char* i_partitionName, uint64_t i_offset, void* i_data, size_t i_sizeBytes); + /** + * @brief Read data from an i2c device + * @param[in] i_master - Chip/engine/port of i2c bus + * @param[in] i_devAddr - I2C address of device + * @param[in] i_offsetSize - Length of offset (in bytes) + * @param[in] i_offset - Offset within device to read + * @param[in] i_length - Number of bytes to read + * @param[out] o_data - Data that was read + * @return 0 on success else return code + * @platform OpenPOWER + */ + int (*i2c_read)( uint64_t i_master, uint16_t i_devAddr, + uint32_t i_offsetSize, uint32_t i_offset, + uint32_t i_length, void* o_data ); + + /** + * @brief Write data to an i2c device + * @param[in] i_master - Chip/engine/port of i2c bus + * @param[in] i_devAddr - I2C address of device + * @param[in] i_offsetSize - Length of offset (in bytes) + * @param[in] i_offset - Offset within device to write + * @param[in] i_length - Number of bytes to write + * @param[in] Data to write + * @return 0 on success else return code + * @platform OpenPOWER + */ + int (*i2c_write)( uint64_t i_master, uint16_t i_devAddr, + uint32_t i_offsetSize, uint32_t i_offset, + uint32_t i_length, void* i_data ); + // Reserve some space for future growth. void (*reserved[32])(void); diff --git a/src/include/usr/i2c/i2cif.H b/src/include/usr/i2c/i2cif.H index 51e3c3aad..f03e3bbcd 100644 --- a/src/include/usr/i2c/i2cif.H +++ b/src/include/usr/i2c/i2cif.H @@ -25,11 +25,6 @@ #ifndef __I2CIF_H #define __I2CIF_H -// Handy macros to check i2c ranges -// Pass in an instance of a TARGETING::ATTR_I2C_BUS_SPEED_ARRAY_type -#define I2C_BUS_MAX_ENGINE(var) (sizeof(var)/sizeof(var[0])) -#define I2C_BUS_MAX_PORT(var) (sizeof(var[0])/sizeof(var[0][0])) - namespace I2C { diff --git a/src/include/usr/i2c/i2creasoncodes.H b/src/include/usr/i2c/i2creasoncodes.H index c6685e181..a63e8d5a6 100644 --- a/src/include/usr/i2c/i2creasoncodes.H +++ b/src/include/usr/i2c/i2creasoncodes.H @@ -82,6 +82,8 @@ enum i2cReasonCode I2C_ATTRIBUTE_NOT_FOUND = I2C_COMP_ID | 0x0A, // Needed I2C-related Attribute not found I2C_NACK_ONLY_FOUND = I2C_COMP_ID | 0x0B, // Only NACK found in status register I2C_ARBITRATION_LOST_ONLY_FOUND = I2C_COMP_ID | 0x0C, // Bus Arbi lost found in status reg + I2C_RUNTIME_INTERFACE_ERR = I2C_COMP_ID | 0x0D, // Read/write unavailable at runtime + I2C_RUNTIME_ERR = I2C_COMP_ID | 0x0E, // Failed run-time operation }; diff --git a/src/include/usr/vpd/vpd_if.H b/src/include/usr/vpd/vpd_if.H index af8e501d5..776ccd084 100644 --- a/src/include/usr/vpd/vpd_if.H +++ b/src/include/usr/vpd/vpd_if.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2013,2014 */ +/* Contributors Listed Below - COPYRIGHT 2013,2015 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -87,6 +87,11 @@ namespace VPD */ errlHndl_t invalidatePnorCache ( TARGETING::Target * i_target ); + /** + * @brief This function sets the VPD config flags to use HW and not PNOR + */ + void setVpdConfigFlagsHW ( ); + }; //end vpd namespace #endif |

