diff options
Diffstat (limited to 'src')
4 files changed, 21 insertions, 8 deletions
diff --git a/src/mainboard/google/reef/smihandler.c b/src/mainboard/google/reef/smihandler.c index d8b47027bf..6bc519078a 100644 --- a/src/mainboard/google/reef/smihandler.c +++ b/src/mainboard/google/reef/smihandler.c @@ -35,7 +35,7 @@ void mainboard_smi_sleep(u8 slp_typ) const struct pad_config *pads; size_t num; - pads = variant_sleep_gpio_table(&num); + pads = variant_sleep_gpio_table(slp_typ, &num); gpio_configure_pads(pads, num); if (IS_ENABLED(CONFIG_EC_GOOGLE_CHROMEEC)) diff --git a/src/mainboard/google/reef/variants/baseboard/gpio.c b/src/mainboard/google/reef/variants/baseboard/gpio.c index 5aa9f7721f..7440cf8f2c 100644 --- a/src/mainboard/google/reef/variants/baseboard/gpio.c +++ b/src/mainboard/google/reef/variants/baseboard/gpio.c @@ -376,7 +376,7 @@ static const struct pad_config sleep_gpio_table[] = { }; const struct pad_config * __attribute__((weak)) -variant_sleep_gpio_table(size_t *num) +variant_sleep_gpio_table(u8 slp_typ, size_t *num) { *num = ARRAY_SIZE(sleep_gpio_table); return sleep_gpio_table; diff --git a/src/mainboard/google/reef/variants/baseboard/include/baseboard/variants.h b/src/mainboard/google/reef/variants/baseboard/include/baseboard/variants.h index 18fbf54dbd..3e30ccb299 100644 --- a/src/mainboard/google/reef/variants/baseboard/include/baseboard/variants.h +++ b/src/mainboard/google/reef/variants/baseboard/include/baseboard/variants.h @@ -28,7 +28,7 @@ uint8_t sku_strapping_value(void); * entries for each table. */ const struct pad_config *variant_gpio_table(size_t *num); const struct pad_config *variant_early_gpio_table(size_t *num); -const struct pad_config *variant_sleep_gpio_table(size_t *num); +const struct pad_config *variant_sleep_gpio_table(u8 slp_typ, size_t *num); /* Baseboard default swizzle. Can be reused if swizzle is same. */ extern const struct lpddr4_swizzle_cfg baseboard_lpddr4_swizzle; diff --git a/src/mainboard/google/reef/variants/coral/gpio.c b/src/mainboard/google/reef/variants/coral/gpio.c index 8e9f04c8e3..e89e5b5c82 100644 --- a/src/mainboard/google/reef/variants/coral/gpio.c +++ b/src/mainboard/google/reef/variants/coral/gpio.c @@ -13,6 +13,7 @@ * GNU General Public License for more details. */ +#include <arch/acpi.h> #include <baseboard/gpio.h> #include <baseboard/variants.h> #include <commonlib/helpers.h> @@ -368,16 +369,28 @@ const struct pad_config *variant_early_gpio_table(size_t *num) return early_gpio_table; } -/* GPIO settings before entering sleep. */ -static const struct pad_config sleep_gpio_table[] = { +/* Default GPIO settings before entering sleep. */ +static const struct pad_config default_sleep_gpio_table[] = { PAD_CFG_GPO(GPIO_150, 0, DEEP), /* NFC_RESET_ODL */ PAD_CFG_GPI_APIC_LOW(GPIO_20, NONE, DEEP), /* NFC_INT_L */ }; -const struct pad_config *variant_sleep_gpio_table(size_t *num) +/* GPIO settings before entering S5, which are same as default_sleep_gpio_table + * but also turn off EN_PP3300_DX_LTE_SOC. */ +static const struct pad_config s5_sleep_gpio_table[] = { + PAD_CFG_GPO(GPIO_150, 0, DEEP), /* NFC_RESET_ODL */ + PAD_CFG_GPI_APIC_LOW(GPIO_20, NONE, DEEP), /* NFC_INT_L */ + PAD_CFG_GPO(GPIO_78, 0, DEEP), /* I2S1_SDO -- EN_PP3300_DX_LTE_SOC */ +}; + +const struct pad_config *variant_sleep_gpio_table(u8 slp_typ, size_t *num) { - *num = ARRAY_SIZE(sleep_gpio_table); - return sleep_gpio_table; + if (slp_typ == ACPI_S5) { + *num = ARRAY_SIZE(s5_sleep_gpio_table); + return s5_sleep_gpio_table; + } + *num = ARRAY_SIZE(default_sleep_gpio_table); + return default_sleep_gpio_table; } static const struct cros_gpio cros_gpios[] = { |