diff options
Diffstat (limited to 'src/import')
3 files changed, 52 insertions, 0 deletions
diff --git a/src/import/chips/p9/procedures/hwp/perv/p9_sbe_lpc_init.C b/src/import/chips/p9/procedures/hwp/perv/p9_sbe_lpc_init.C index f8cbbb56..2f30f195 100644 --- a/src/import/chips/p9/procedures/hwp/perv/p9_sbe_lpc_init.C +++ b/src/import/chips/p9/procedures/hwp/perv/p9_sbe_lpc_init.C @@ -42,14 +42,34 @@ #include "p9_perv_scom_addresses.H" #include "p9_perv_scom_addresses_fld.H" #include "p9_misc_scom_addresses.H" +#include "p9_misc_scom_addresses_fld.H" fapi2::ReturnCode p9_sbe_lpc_init(const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>& i_target_chip) { fapi2::buffer<uint64_t> l_data64; + uint8_t l_use_gpio = 0; + uint8_t l_is_fsp = 0; FAPI_DBG("p9_sbe_lpc_init: Entering ..."); + FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_CHIP_EC_FEATURE_LPC_RESET_GPIO, i_target_chip, l_use_gpio), + "Error getting the use_gpio_attr"); + + FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_IS_SP_MODE, i_target_chip, l_is_fsp), "Error getting ATTR_IS_SP_MODE"); + + if ((l_use_gpio != 0) && (l_is_fsp == fapi2::ENUM_ATTR_IS_SP_MODE_FSP)) + { + //LPC Reset active + l_data64.flush<1>().clearBit<0>(); + FAPI_TRY(fapi2::putScom(i_target_chip, PU_GPIO_OUTPUT_SCOM2, l_data64)); + + //Set GPI0 output enable + FAPI_TRY(fapi2::getScom(i_target_chip, PU_GPIO_OUTPUT_EN, l_data64)); + l_data64.setBit<PU_GPIO_OUTPUT_EN_DO_EN_0>(); + FAPI_TRY(fapi2::putScom(i_target_chip, PU_GPIO_OUTPUT_EN, l_data64)); + } + //Settting registers to do an LPC functional reset l_data64.flush<0>().setBit<CPLT_CONF1_TC_LP_RESET>(); FAPI_TRY(fapi2::putScom(i_target_chip, PERV_N3_CPLT_CONF1_OR, l_data64)); @@ -70,6 +90,18 @@ fapi2::ReturnCode p9_sbe_lpc_init(const l_data64.flush<0>().setBit<CPLT_CONF1_TC_LP_RESET>(); FAPI_TRY(fapi2::putScom(i_target_chip, PERV_N3_CPLT_CONF1_CLEAR, l_data64)); + if ((l_use_gpio != 0) && (l_is_fsp == fapi2::ENUM_ATTR_IS_SP_MODE_FSP)) + { + //LPC Reset Disabled + l_data64.flush<0>().setBit<0>(); + FAPI_TRY(fapi2::putScom(i_target_chip, PU_GPIO_OUTPUT_SCOM1, l_data64)); + + //Unset GPIO output enable + FAPI_TRY(fapi2::getScom(i_target_chip, PU_GPIO_OUTPUT_EN, l_data64)); + l_data64.clearBit<PU_GPIO_OUTPUT_EN_DO_EN_0>(); + FAPI_TRY(fapi2::putScom(i_target_chip, PU_GPIO_OUTPUT_EN, l_data64)); + } + FAPI_DBG("p9_sbe_lpc_init: Exiting ..."); fapi_try_exit: diff --git a/src/import/chips/p9/procedures/xml/attribute_info/chip_ec_attributes.xml b/src/import/chips/p9/procedures/xml/attribute_info/chip_ec_attributes.xml index 02e1a29d..afde2896 100644 --- a/src/import/chips/p9/procedures/xml/attribute_info/chip_ec_attributes.xml +++ b/src/import/chips/p9/procedures/xml/attribute_info/chip_ec_attributes.xml @@ -270,6 +270,22 @@ </chipEcFeature> </attribute> <!-- ******************************************************************** --> + <attribute> + <id>ATTR_CHIP_EC_FEATURE_LPC_RESET_GPIO</id> + <targetType>TARGET_TYPE_PROC_CHIP</targetType> + <description> + DD1 only: to do an LPC reset set the GPIO bits + </description> + <chipEcFeature> + <chip> + <name>ENUM_ATTR_NAME_NIMBUS</name> + <ec> + <value>0x20</value> + <test>LESS_THAN</test> + </ec> + </chip> + </chipEcFeature> + </attribute> <!-- ******************************************************************** --> <!-- Memory Section --> diff --git a/src/import/chips/p9/procedures/xml/attribute_info/p9_sbe_attributes.xml b/src/import/chips/p9/procedures/xml/attribute_info/p9_sbe_attributes.xml index e93681ce..1026bbdc 100644 --- a/src/import/chips/p9/procedures/xml/attribute_info/p9_sbe_attributes.xml +++ b/src/import/chips/p9/procedures/xml/attribute_info/p9_sbe_attributes.xml @@ -533,6 +533,10 @@ attribute tank <name>ATTR_CHIP_EC_FEATURE_HW388878</name> <virtual/> </entry> + <entry> + <name>ATTR_CHIP_EC_FEATURE_LPC_RESET_GPIO</name> + <virtual/> + </entry> <entry> <name>ATTR_PROC_XSCOM_BAR_BASE_ADDR_OFFSET</name> |