diff options
Diffstat (limited to 'src')
5 files changed, 100 insertions, 0 deletions
diff --git a/src/usr/hwpf/hwp/chip_attributes.xml b/src/usr/hwpf/hwp/chip_attributes.xml index 28020f143..09f6eecd9 100644 --- a/src/usr/hwpf/hwp/chip_attributes.xml +++ b/src/usr/hwpf/hwp/chip_attributes.xml @@ -220,6 +220,16 @@ </attribute> <!-- ********************************************************************* --> <attribute> + <id>ATTR_I2C_SLAVE_ADDRESS</id> + <targetType>TARGET_TYPE_PROC_CHIP</targetType> + <description> + Defines I2C slave address + </description> + <valueType>uint8</valueType> + <platInit/> + </attribute> + <!-- ********************************************************************* --> + <attribute> <id>ATTR_TARGET_SCOMABLE</id> <targetType>TARGET_TYPE_PROC_CHIP,TARGET_TYPE_MEMBUF_CHIP,TARGET_TYPE_EX_CHIPLET,TARGET_TYPE_MCS_CHIPLET,TARGET_TYPE_XBUS_ENDPOINT,TARGET_TYPE_ABUS_ENDPOINT,TARGET_TYPE_MBA_CHIPLET</targetType> <description> diff --git a/src/usr/hwpf/hwp/include/common_scom_addresses.H b/src/usr/hwpf/hwp/include/common_scom_addresses.H index d5a2d35f4..8a37e56f4 100755 --- a/src/usr/hwpf/hwp/include/common_scom_addresses.H +++ b/src/usr/hwpf/hwp/include/common_scom_addresses.H @@ -285,6 +285,12 @@ CONST_UINT64_T( TP_CLK_ADJ_SET_0x010F0016 , ULL(0x010F0016) ); CONST_UINT64_T( ECCB_ECC_ADDR_REG_0x000C0004 , ULL(0x000C0004) ); //------------------------------------------------------------------------------ +// I2C SLAVE REGISTERS +//------------------------------------------------------------------------------ + +CONST_UINT64_T( I2C_SLAVE_CONFIG_REG_0x000D0000 , ULL(0x000D0000) ); + +//------------------------------------------------------------------------------ // I2C MASTER (MEMS0) //------------------------------------------------------------------------------ CONST_UINT64_T( I2CMS_MEMS0_CONTROL_0x000A0000 , ULL(0x000A0000) ); diff --git a/src/usr/hwpf/hwp/nest_chiplets/proc_chiplet_scominit/proc_chiplet_scominit.C b/src/usr/hwpf/hwp/nest_chiplets/proc_chiplet_scominit/proc_chiplet_scominit.C index 722c2424d..d49b010f6 100644 --- a/src/usr/hwpf/hwp/nest_chiplets/proc_chiplet_scominit/proc_chiplet_scominit.C +++ b/src/usr/hwpf/hwp/nest_chiplets/proc_chiplet_scominit/proc_chiplet_scominit.C @@ -70,6 +70,7 @@ fapi::ReturnCode proc_chiplet_scominit(const fapi::Target & i_target) uint8_t master_mcs_pos = 0xFF; fapi::Target master_mcs; uint8_t enable_xbus_resonant_clocking = 0x0; + uint8_t i2c_slave_address = 0x0; ecmdDataBufferBase data(64); ecmdDataBufferBase cfam_data(32); @@ -270,6 +271,70 @@ fapi::ReturnCode proc_chiplet_scominit(const fapi::Target & i_target) PROC_CHIPLET_SCOMINIT_NX_IF, PROC_CHIPLET_SCOMINIT_CXA_IF, PROC_CHIPLET_SCOMINIT_AS_IF); } + // conditionally enable I2C Slave + rc = FAPI_ATTR_GET(ATTR_I2C_SLAVE_ADDRESS, + &i_target, + i2c_slave_address); + if (!rc.ok()) + { + FAPI_ERR("proc_chiplet_scominit: Error querying ATTR_I2C_SLAVE_ADDRESS on %s", + i_target.toEcmdString()); + break; + } + rc = fapiGetScom(i_target, + I2C_SLAVE_CONFIG_REG_0x000D0000, + data); + if (!rc.ok()) + { + FAPI_ERR("proc_chiplet_scominit: fapiGetScom error (I2C_SLAVE_CONFIG_REG_0x000D0000) on %s", + i_target.toEcmdString()); + break; + } + if (i2c_slave_address) + { + FAPI_DBG("proc_chiplet_scominit: I2C Slave enabled (%s) address = %d", + i_target.toEcmdString(),i2c_slave_address); + + //set I2C address + rc_ecmd |= data.insert(i2c_slave_address,0,7); + + // disable error state. when this is enabled and there + // is an error from I2CS it locks up the I2CS and no + // more operations are allowed unless cleared + // through FSI. Not good for a FSPless system. + rc_ecmd |= data.clearBit(23); + + // enable I2C interface + rc_ecmd |= data.setBit(21); + + } + else + { + FAPI_DBG("proc_chiplet_scominit: I2C Slave disabled (%s)", + i_target.toEcmdString()); + + // disable I2C interface when attribute = 0x0 + rc_ecmd |= data.clearBit(21); + } + + if (rc_ecmd) + { + FAPI_ERR("proc_chiplet_scominit: Error 0x%x setting I2C Slave register data buffer", + rc_ecmd); + rc.setEcmdError(rc_ecmd); + break; + } + + rc = fapiPutScom(i_target, + I2C_SLAVE_CONFIG_REG_0x000D0000, + data); + if (!rc.ok()) + { + FAPI_ERR("proc_chiplet_scominit: fapiPutScom error (I2C_SLAVE_CONFIG_REG_0x000D0000) on %s", + i_target.toEcmdString()); + break; + } + // conditionally enable resonant clocking for XBUS rc = FAPI_ATTR_GET(ATTR_CHIP_EC_FEATURE_XBUS_RESONANT_CLK_VALID, &i_target, @@ -281,6 +346,7 @@ fapi::ReturnCode proc_chiplet_scominit(const fapi::Target & i_target) break; } + if (enable_xbus_resonant_clocking) { FAPI_DBG("proc_chiplet_scominit: Enabling XBUS resonant clocking"); @@ -348,6 +414,7 @@ fapi::ReturnCode proc_chiplet_scominit(const fapi::Target & i_target) break; } + // determine set of functional MCS chiplets rc = fapiGetChildChiplets(i_target, fapi::TARGET_TYPE_MCS_CHIPLET, diff --git a/src/usr/targeting/common/xmltohb/attribute_types.xml b/src/usr/targeting/common/xmltohb/attribute_types.xml index dda04e4ed..33ea22772 100644 --- a/src/usr/targeting/common/xmltohb/attribute_types.xml +++ b/src/usr/targeting/common/xmltohb/attribute_types.xml @@ -964,6 +964,22 @@ ID for the sensor number returned with the elog. --> </attribute> <attribute> + <id>I2C_SLAVE_ADDRESS</id> + <description>I2C Slave Address</description> + <simpleType> + <uint8_t> + <default>0x00</default> + </uint8_t> + </simpleType> + <persistency>non-volatile</persistency> + <readable/> + <hwpfToHbAttrMap> + <id>ATTR_I2C_SLAVE_ADDRESS</id> + <macro>DIRECT</macro> + </hwpfToHbAttrMap> +</attribute> + +<attribute> <id>FSI_SLAVE_CASCADE</id> <description>Slave cascade position</description> <simpleType> diff --git a/src/usr/targeting/common/xmltohb/target_types.xml b/src/usr/targeting/common/xmltohb/target_types.xml index 421993a90..5ff314e05 100644 --- a/src/usr/targeting/common/xmltohb/target_types.xml +++ b/src/usr/targeting/common/xmltohb/target_types.xml @@ -605,6 +605,7 @@ <attribute><id>PROC_PCIE_IOP_TX_FFE_GEN1</id></attribute> <attribute><id>PROC_PCIE_IOP_TX_FFE_GEN2</id></attribute> + <attribute><id>I2C_SLAVE_ADDRESS</id></attribute> </targetType> <targetType> |