diff options
author | Vijay Hiremath <vijay.p.hiremath@intel.com> | 2019-05-30 16:25:15 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-06-13 23:02:44 +0000 |
commit | 8ca44cb4eca69d44e9fce0b93b58be9c7d9d19f3 (patch) | |
tree | 4913ea0403d24fc4574bfa2941ee4de7e28a000c | |
parent | 037eb91f65510d2949289f837c716b7fa997746f (diff) | |
download | chrome-ec-8ca44cb4eca69d44e9fce0b93b58be9c7d9d19f3.tar.gz |
intel_x86/power: Consolidate chipset specific power signals array
Currently chipset specific power signals are defined at board/baseboard
level. These power signals are moved to chipset specific file to minimize
the redundant power signals array defined for each board/baseboard.
BUG=b:134079574
BRANCH=none
TEST=make buildall -j
Change-Id: I351904f7cd2e0f27844c0711beb118d390219581
Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1636837
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
61 files changed, 252 insertions, 731 deletions
diff --git a/baseboard/dragonegg/baseboard.c b/baseboard/dragonegg/baseboard.c index dda630e739..84a225c33a 100644 --- a/baseboard/dragonegg/baseboard.c +++ b/baseboard/dragonegg/baseboard.c @@ -79,31 +79,6 @@ const struct i2c_port_t i2c_ports[] = { }; const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports); -/* power signal list. */ -const struct power_signal_info power_signal_list[] = { - [X86_SLP_S0_DEASSERTED] = {GPIO_SLP_S0_L, - POWER_SIGNAL_ACTIVE_HIGH | POWER_SIGNAL_DISABLE_AT_BOOT, - "SLP_S0_DEASSERTED"}, -#ifdef CONFIG_HOSTCMD_ESPI_VW_SLP_SIGNALS - [X86_SLP_S3_DEASSERTED] = {VW_SLP_S3_L, POWER_SIGNAL_ACTIVE_HIGH, - "SLP_S3_DEASSERTED"}, - [X86_SLP_S4_DEASSERTED] = {VW_SLP_S4_L, POWER_SIGNAL_ACTIVE_HIGH, - "SLP_S4_DEASSERTED"}, -#else - [X86_SLP_S3_DEASSERTED] = {GPIO_SLP_S3_L, POWER_SIGNAL_ACTIVE_HIGH, - "SLP_S3_DEASSERTED"}, - [X86_SLP_S4_DEASSERTED] = {GPIO_SLP_S4_L, POWER_SIGNAL_ACTIVE_HIGH, - "SLP_S4_DEASSERTED"}, -#endif - [X86_SLP_SUS_DEASSERTED] = {GPIO_SLP_SUS_L, POWER_SIGNAL_ACTIVE_HIGH, - "SLP_SUS_DEASSERTED"}, - [X86_RSMRST_L_PGOOD] = {GPIO_PG_EC_RSMRST_ODL, POWER_SIGNAL_ACTIVE_HIGH, - "RSMRST_L_PGOOD"}, - [X86_DSW_DPWROK] = {GPIO_PG_EC_DSW_PWROK, POWER_SIGNAL_ACTIVE_HIGH, - "DSW_DPWROK"}, -}; -BUILD_ASSERT(ARRAY_SIZE(power_signal_list) == POWER_SIGNAL_COUNT); - /******************************************************************************/ /* Chipset callbacks/hooks */ diff --git a/baseboard/dragonegg/baseboard.h b/baseboard/dragonegg/baseboard.h index 10f037e48d..d51c5c3e62 100644 --- a/baseboard/dragonegg/baseboard.h +++ b/baseboard/dragonegg/baseboard.h @@ -137,17 +137,6 @@ #ifndef __ASSEMBLER__ -enum power_signal { - X86_SLP_S0_DEASSERTED, - X86_SLP_S3_DEASSERTED, - X86_SLP_S4_DEASSERTED, - X86_SLP_SUS_DEASSERTED, - X86_RSMRST_L_PGOOD, - X86_DSW_DPWROK, - /* Number of X86 signals */ - POWER_SIGNAL_COUNT -}; - /* Forward declare common (within DragonEgg) board-specific functions */ void board_reset_pd_mcu(void); diff --git a/baseboard/hatch/baseboard.c b/baseboard/hatch/baseboard.c index 2e9c23aa19..9ca4c836a5 100644 --- a/baseboard/hatch/baseboard.c +++ b/baseboard/hatch/baseboard.c @@ -76,32 +76,6 @@ const struct i2c_port_t i2c_ports[] = { }; const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports); -/* power signal list. */ -const struct power_signal_info power_signal_list[] = { - - [X86_SLP_S0_DEASSERTED] = {GPIO_SLP_S0_L, - POWER_SIGNAL_ACTIVE_HIGH | POWER_SIGNAL_DISABLE_AT_BOOT, - "SLP_S0_DEASSERTED"}, -#ifdef CONFIG_HOSTCMD_ESPI_VW_SIGNALS - [X86_SLP_S3_DEASSERTED] = {VW_SLP_S3_L, POWER_SIGNAL_ACTIVE_HIGH, - "SLP_S3_DEASSERTED"}, - [X86_SLP_S4_DEASSERTED] = {VW_SLP_S4_L, POWER_SIGNAL_ACTIVE_HIGH, - "SLP_S4_DEASSERTED"}, -#else - [X86_SLP_S3_DEASSERTED] = {GPIO_SLP_S3_L, POWER_SIGNAL_ACTIVE_HIGH, - "SLP_S3_DEASSERTED"}, - [X86_SLP_S4_DEASSERTED] = {GPIO_SLP_S4_L, POWER_SIGNAL_ACTIVE_HIGH, - "SLP_S4_DEASSERTED"}, -#endif - [X86_RSMRST_L_PGOOD] = {GPIO_PG_EC_RSMRST_L, POWER_SIGNAL_ACTIVE_HIGH, - "RSMRST_L_PGOOD"}, - [PP5000_A_PGOOD] = {GPIO_PP5000_A_PG_OD, POWER_SIGNAL_ACTIVE_HIGH, - "PP5000_A_PGOOD"}, - [ALL_SYS_PGOOD] = {GPIO_PG_EC_ALL_SYS_PWRGD, POWER_SIGNAL_ACTIVE_HIGH, - "ALL_SYS_PWRGD"} -}; -BUILD_ASSERT(ARRAY_SIZE(power_signal_list) == POWER_SIGNAL_COUNT); - /******************************************************************************/ /* Chipset callbacks/hooks */ diff --git a/baseboard/hatch/baseboard.h b/baseboard/hatch/baseboard.h index a3e22171a1..706e1fe5d8 100644 --- a/baseboard/hatch/baseboard.h +++ b/baseboard/hatch/baseboard.h @@ -162,17 +162,6 @@ #ifndef __ASSEMBLER__ -enum power_signal { - X86_SLP_S0_DEASSERTED, - X86_SLP_S3_DEASSERTED, - X86_SLP_S4_DEASSERTED, - X86_RSMRST_L_PGOOD, - PP5000_A_PGOOD, - ALL_SYS_PGOOD, - /* Number of X86 signals */ - POWER_SIGNAL_COUNT -}; - enum mst_source { MST_TYPE_C0, MST_TYPE_C1, diff --git a/baseboard/intelrvp/baseboard.c b/baseboard/intelrvp/baseboard.c index b48bda035f..af1edd2b9d 100644 --- a/baseboard/intelrvp/baseboard.c +++ b/baseboard/intelrvp/baseboard.c @@ -16,63 +16,6 @@ #include "temp_sensor.h" #include "thermistor.h" -/* GPIO for power signal */ -#ifdef CONFIG_HOSTCMD_ESPI_VW_SLP_SIGNALS -#define SLP_S3_SIGNAL_L VW_SLP_S3_L -#define SLP_S4_SIGNAL_L VW_SLP_S4_L -#else -#define SLP_S3_SIGNAL_L GPIO_PCH_SLP_S3_L -#define SLP_S4_SIGNAL_L GPIO_PCH_SLP_S4_L -#endif - -/* power signal list. Must match order of enum power_signal. */ -const struct power_signal_info power_signal_list[] = { - [X86_SLP_S0_DEASSERTED] = { - GPIO_PCH_SLP_S0_L, - POWER_SIGNAL_ACTIVE_HIGH | POWER_SIGNAL_DISABLE_AT_BOOT, - "SLP_S0_DEASSERTED", - }, - [X86_SLP_S3_DEASSERTED] = { - SLP_S3_SIGNAL_L, - POWER_SIGNAL_ACTIVE_HIGH, - "SLP_S3_DEASSERTED", - }, - [X86_SLP_S4_DEASSERTED] = { - SLP_S4_SIGNAL_L, - POWER_SIGNAL_ACTIVE_HIGH, - "SLP_S4_DEASSERTED", - }, - [X86_RSMRST_L_PGOOD] = { - GPIO_RSMRST_L_PGOOD, - POWER_SIGNAL_ACTIVE_HIGH, - "RSMRST_L_PGOOD", - }, - [X86_ALL_SYS_PWRGD] = { - GPIO_ALL_SYS_PWRGD, - POWER_SIGNAL_ACTIVE_HIGH, - "ALL_SYS_PWRGD", - }, -#if defined(CONFIG_CHIPSET_ICELAKE) - [X86_SLP_SUS_DEASSERTED] = { - GPIO_PCH_SLP_SUS_L, - POWER_SIGNAL_ACTIVE_HIGH, - "SLP_SUS_DEASSERTED", - }, - [X86_DSW_DPWROK] = { - GPIO_DSW_DPWROK, - POWER_SIGNAL_ACTIVE_HIGH, - "DSW_DPWROK", - }, -#elif defined(CONFIG_CHIPSET_COMETLAKE) - [PP5000_A_PGOOD] = { - GPIO_PP5000_A_PG_OD, - POWER_SIGNAL_ACTIVE_HIGH, - "PP5000_A_PGOOD", - }, -#endif -}; -BUILD_ASSERT(ARRAY_SIZE(power_signal_list) == POWER_SIGNAL_COUNT); - /* Wake-up pins for hibernate */ const enum gpio_signal hibernate_wake_pins[] = { GPIO_AC_PRESENT, diff --git a/baseboard/intelrvp/baseboard.h b/baseboard/intelrvp/baseboard.h index 5eaf4640de..b4bfbc7153 100644 --- a/baseboard/intelrvp/baseboard.h +++ b/baseboard/intelrvp/baseboard.h @@ -81,11 +81,11 @@ #define CONFIG_USBC_SS_MUX /* SoC / PCH */ +#define CONFIG_CHIPSET_RESET_HOOK #define CONFIG_HOSTCMD_ESPI #define CONFIG_HOSTCMD_ESPI_VW_SLP_SIGNALS #define CONFIG_MKBP_EVENT #define CONFIG_MKBP_USE_HOST_EVENT -#define CONFIG_CHIPSET_RESET_HOOK #define CONFIG_POWER_BUTTON #define CONFIG_POWER_BUTTON_X86 #define CONFIG_POWER_COMMON @@ -143,24 +143,6 @@ #include "registers.h" #include "usb_pd_tcpm.h" -enum power_signal { - X86_SLP_S0_DEASSERTED, - X86_SLP_S3_DEASSERTED, - X86_SLP_S4_DEASSERTED, - X86_RSMRST_L_PGOOD, - X86_ALL_SYS_PWRGD, -#if defined(CONFIG_CHIPSET_ICELAKE) - X86_SLP_SUS_DEASSERTED, - X86_DSW_DPWROK, -#elif defined(CONFIG_CHIPSET_COMETLAKE) - PP5000_A_PGOOD, -#else - #error "define Intel AP chipset variant" -#endif - /* Number of X86 signals */ - POWER_SIGNAL_COUNT -}; - /* PWM channels */ enum pwm_channel { PWM_CH_FAN, diff --git a/baseboard/kalista/baseboard.c b/baseboard/kalista/baseboard.c index 5956223f48..7cf73be3e6 100644 --- a/baseboard/kalista/baseboard.c +++ b/baseboard/kalista/baseboard.c @@ -91,17 +91,6 @@ void vbus0_evt(enum gpio_signal signal) #include "gpio_list.h" -/* power signal list. Must match order of enum power_signal. */ -const struct power_signal_info power_signal_list[] = { - {GPIO_PCH_SLP_S0_L, POWER_SIGNAL_ACTIVE_HIGH, "SLP_S0_DEASSERTED"}, - {VW_SLP_S3_L, POWER_SIGNAL_ACTIVE_HIGH, "SLP_S3_DEASSERTED"}, - {VW_SLP_S4_L, POWER_SIGNAL_ACTIVE_HIGH, "SLP_S4_DEASSERTED"}, - {GPIO_PCH_SLP_SUS_L, POWER_SIGNAL_ACTIVE_HIGH, "SLP_SUS_DEASSERTED"}, - {GPIO_RSMRST_L_PGOOD, POWER_SIGNAL_ACTIVE_HIGH, "RSMRST_L_PGOOD"}, - {GPIO_PMIC_DPWROK, POWER_SIGNAL_ACTIVE_HIGH, "PMIC_DPWROK"}, -}; -BUILD_ASSERT(ARRAY_SIZE(power_signal_list) == POWER_SIGNAL_COUNT); - /* Hibernate wake configuration */ const enum gpio_signal hibernate_wake_pins[] = { GPIO_POWER_BUTTON_L, diff --git a/baseboard/kalista/baseboard.h b/baseboard/kalista/baseboard.h index 7d7fe10a7e..b94df35a1c 100644 --- a/baseboard/kalista/baseboard.h +++ b/baseboard/kalista/baseboard.h @@ -179,16 +179,6 @@ enum charge_port { CHARGE_PORT_BARRELJACK, }; -enum power_signal { - X86_SLP_S0_DEASSERTED, - X86_SLP_S3_DEASSERTED, - X86_SLP_S4_DEASSERTED, - X86_SLP_SUS_DEASSERTED, - X86_RSMRST_L_PGOOD, - X86_PMIC_DPWROK, - POWER_SIGNAL_COUNT -}; - enum temp_sensor_id { TEMP_SENSOR_CHARGER, /* BD99992GW SYSTHERM1 */ TEMP_SENSOR_DRAM, /* BD99992GW SYSTHERM2 */ diff --git a/baseboard/octopus/baseboard.c b/baseboard/octopus/baseboard.c index 1f5abc55f4..929bf77139 100644 --- a/baseboard/octopus/baseboard.c +++ b/baseboard/octopus/baseboard.c @@ -30,26 +30,6 @@ #define CPRINTFUSB(format, args...) cprintf(CC_USBCHARGE, format, ## args) /******************************************************************************/ -/* Power signal list. Must match order of enum power_signal. */ -const struct power_signal_info power_signal_list[] = { -#ifdef CONFIG_POWER_S0IX - {GPIO_PCH_SLP_S0_L, - POWER_SIGNAL_ACTIVE_HIGH | POWER_SIGNAL_DISABLE_AT_BOOT, - "SLP_S0_DEASSERTED"}, -#endif - {GPIO_PCH_SLP_S3_L, POWER_SIGNAL_ACTIVE_HIGH, "SLP_S3_DEASSERTED"}, - {GPIO_PCH_SLP_S4_L, POWER_SIGNAL_ACTIVE_HIGH, "SLP_S4_DEASSERTED"}, - {GPIO_SUSPWRDNACK, POWER_SIGNAL_ACTIVE_HIGH, - "SUSPWRDNACK_DEASSERTED"}, - - {GPIO_ALL_SYS_PGOOD, POWER_SIGNAL_ACTIVE_HIGH, "ALL_SYS_PGOOD"}, - {GPIO_RSMRST_L_PGOOD, POWER_SIGNAL_ACTIVE_HIGH, "RSMRST_L"}, - {GPIO_PP3300_PG, POWER_SIGNAL_ACTIVE_HIGH, "PP3300_PG"}, - {GPIO_PP5000_PG, POWER_SIGNAL_ACTIVE_HIGH, "PP5000_PG"}, -}; -BUILD_ASSERT(ARRAY_SIZE(power_signal_list) == POWER_SIGNAL_COUNT); - -/******************************************************************************/ /* Keyboard scan setting */ struct keyboard_scan_config keyscan_config = { /* diff --git a/baseboard/octopus/baseboard.h b/baseboard/octopus/baseboard.h index 977416f0d2..a062b021ce 100644 --- a/baseboard/octopus/baseboard.h +++ b/baseboard/octopus/baseboard.h @@ -292,23 +292,6 @@ #include "gpio_signal.h" -enum power_signal { -#ifdef CONFIG_POWER_S0IX - X86_SLP_S0_N, /* PCH -> SLP_S0_L */ -#endif - X86_SLP_S3_N, /* PCH -> SLP_S3_L */ - X86_SLP_S4_N, /* PCH -> SLP_S4_L */ - X86_SUSPWRDNACK, /* PCH -> SUSPWRDNACK */ - - X86_ALL_SYS_PG, /* PMIC -> PMIC_EC_PWROK_OD */ - X86_RSMRST_N, /* PMIC -> PMIC_EC_RSMRST_ODL */ - X86_PGOOD_PP3300, /* PMIC -> PP3300_PG_OD */ - X86_PGOOD_PP5000, /* PMIC -> PP5000_PG_OD */ - - /* Number of X86 signals */ - POWER_SIGNAL_COUNT -}; - /* Forward declare common (within octopus) board-specific functions */ void board_reset_pd_mcu(void); diff --git a/board/atlas/board.c b/board/atlas/board.c index 78fbcd53f2..c72ba963bb 100644 --- a/board/atlas/board.c +++ b/board/atlas/board.c @@ -69,19 +69,6 @@ static void tcpc_alert_event(enum gpio_signal signal) #include "gpio_list.h" -/* power signal list. Must match order of enum power_signal. */ -const struct power_signal_info power_signal_list[] = { - {GPIO_SLP_S0_L, - POWER_SIGNAL_ACTIVE_HIGH | POWER_SIGNAL_DISABLE_AT_BOOT, - "SLP_S0_DEASSERTED"}, - {VW_SLP_S3_L, POWER_SIGNAL_ACTIVE_HIGH, "SLP_S3_DEASSERTED"}, - {VW_SLP_S4_L, POWER_SIGNAL_ACTIVE_HIGH, "SLP_S4_DEASSERTED"}, - {GPIO_PCH_SLP_SUS_L, POWER_SIGNAL_ACTIVE_HIGH, "SLP_SUS_DEASSERTED"}, - {GPIO_RSMRST_L_PGOOD, POWER_SIGNAL_ACTIVE_HIGH, "RSMRST_L_PGOOD"}, - {GPIO_PMIC_DPWROK, POWER_SIGNAL_ACTIVE_HIGH, "PMIC_DPWROK"}, -}; -BUILD_ASSERT(ARRAY_SIZE(power_signal_list) == POWER_SIGNAL_COUNT); - /* Keyboard scan. Increase output_settle_us to 80us from default 50us. */ struct keyboard_scan_config keyscan_config = { .output_settle_us = 80, diff --git a/board/atlas/board.h b/board/atlas/board.h index 1f261144f7..b9d9ca5eae 100644 --- a/board/atlas/board.h +++ b/board/atlas/board.h @@ -175,16 +175,6 @@ #include "gpio_signal.h" #include "registers.h" -enum power_signal { - X86_SLP_S0_DEASSERTED, - X86_SLP_S3_DEASSERTED, - X86_SLP_S4_DEASSERTED, - X86_SLP_SUS_DEASSERTED, - X86_RSMRST_L_PGOOD, - X86_PMIC_DPWROK, - POWER_SIGNAL_COUNT -}; - enum temp_sensor_id { TEMP_SENSOR_BATTERY, /* BD99956GW TSENSE */ TEMP_SENSOR_SYSTHERM0, /* BD99992GW SYSTHERM0 */ diff --git a/board/chell/board.c b/board/chell/board.c index 14b1e56d2c..2ab6b556d2 100644 --- a/board/chell/board.c +++ b/board/chell/board.c @@ -79,21 +79,6 @@ void usb1_evt(enum gpio_signal signal) #include "gpio_list.h" -/* power signal list. Must match order of enum power_signal. */ -const struct power_signal_info power_signal_list[] = { -#ifdef CONFIG_POWER_S0IX - {GPIO_PCH_SLP_S0_L, - POWER_SIGNAL_ACTIVE_HIGH | POWER_SIGNAL_DISABLE_AT_BOOT, - "SLP_S0_DEASSERTED"}, -#endif - {GPIO_RSMRST_L_PGOOD, POWER_SIGNAL_ACTIVE_HIGH, "RSMRST_N_PWRGD"}, - {GPIO_PCH_SLP_S3_L, POWER_SIGNAL_ACTIVE_HIGH, "SLP_S3_DEASSERTED"}, - {GPIO_PCH_SLP_S4_L, POWER_SIGNAL_ACTIVE_HIGH, "SLP_S4_DEASSERTED"}, - {GPIO_PCH_SLP_SUS_L, POWER_SIGNAL_ACTIVE_HIGH, "SLP_SUS_DEASSERTED"}, - {GPIO_PMIC_DPWROK, POWER_SIGNAL_ACTIVE_HIGH, "PMIC_DPWROK"}, -}; -BUILD_ASSERT(ARRAY_SIZE(power_signal_list) == POWER_SIGNAL_COUNT); - /* ADC channels */ const struct adc_t adc_channels[] = { /* Vbus sensing. Converted to mV, full ADC is equivalent to 30V. */ diff --git a/board/chell/board.h b/board/chell/board.h index f9a75bf4c5..aaf89ee8f3 100644 --- a/board/chell/board.h +++ b/board/chell/board.h @@ -169,21 +169,6 @@ enum pwm_channel { PWM_CH_COUNT }; -/* power signal definitions */ -enum power_signal { -#ifdef CONFIG_POWER_S0IX - X86_SLP_S0_DEASSERTED, -#endif - X86_RSMRST_L_PWRGD, - X86_SLP_S3_DEASSERTED, - X86_SLP_S4_DEASSERTED, - X86_SLP_SUS_DEASSERTED, - X86_PMIC_DPWROK, - - /* Number of X86 signals */ - POWER_SIGNAL_COUNT -}; - enum temp_sensor_id { TEMP_SENSOR_BATTERY, diff --git a/board/coral/board.c b/board/coral/board.c index 2872b7357d..6b0c613567 100644 --- a/board/coral/board.c +++ b/board/coral/board.c @@ -127,25 +127,6 @@ void tablet_mode_interrupt(enum gpio_signal signal) #include "gpio_list.h" -/* power signal list. Must match order of enum power_signal. */ -const struct power_signal_info power_signal_list[] = { -#ifdef CONFIG_POWER_S0IX - {GPIO_PCH_SLP_S0_L, - POWER_SIGNAL_ACTIVE_HIGH | POWER_SIGNAL_DISABLE_AT_BOOT, - "SLP_S0_DEASSERTED"}, -#endif - {GPIO_RSMRST_L_PGOOD, POWER_SIGNAL_ACTIVE_HIGH, "RSMRST_L"}, - {GPIO_PCH_SLP_S3_L, POWER_SIGNAL_ACTIVE_HIGH, "SLP_S3_DEASSERTED"}, - {GPIO_PCH_SLP_S4_L, POWER_SIGNAL_ACTIVE_HIGH, "SLP_S4_DEASSERTED"}, - {GPIO_SUSPWRNACK, POWER_SIGNAL_ACTIVE_HIGH, - "SUSPWRNACK_DEASSERTED"}, - - {GPIO_ALL_SYS_PGOOD, POWER_SIGNAL_ACTIVE_HIGH, "ALL_SYS_PGOOD"}, - {GPIO_PP3300_PG, POWER_SIGNAL_ACTIVE_HIGH, "PP3300_PG"}, - {GPIO_PP5000_PG, POWER_SIGNAL_ACTIVE_HIGH, "PP5000_PG"}, -}; -BUILD_ASSERT(ARRAY_SIZE(power_signal_list) == POWER_SIGNAL_COUNT); - /* ADC channels */ const struct adc_t adc_channels[] = { /* Vfs = Vref = 2.816V, 10-bit unsigned reading */ diff --git a/board/coral/board.h b/board/coral/board.h index f9dfb4e174..8a84cbb062 100644 --- a/board/coral/board.h +++ b/board/coral/board.h @@ -235,23 +235,6 @@ enum pwm_channel { PWM_CH_COUNT }; -enum power_signal { -#ifdef CONFIG_POWER_S0IX - X86_SLP_S0_N, -#endif - X86_RSMRST_N, - X86_SLP_S3_N, - X86_SLP_S4_N, - X86_SUSPWRDNACK, - - X86_ALL_SYS_PG, /* PMIC_EC_PWROK_OD */ - X86_PGOOD_PP3300, /* GPIO_PP3300_PG */ - X86_PGOOD_PP5000, /* GPIO_PP5000_PG */ - - /* Number of X86 signals */ - POWER_SIGNAL_COUNT -}; - enum temp_sensor_id { TEMP_SENSOR_BATTERY = 0, TEMP_SENSOR_AMBIENT, diff --git a/board/coral/gpio.inc b/board/coral/gpio.inc index a4f236a22c..43a130a140 100644 --- a/board/coral/gpio.inc +++ b/board/coral/gpio.inc @@ -23,7 +23,7 @@ GPIO_INT(PCH_SLP_S0_L, PIN(7, 5), GPIO_INT_BOTH, power_signal_interrupt) /* #endif GPIO_INT(PCH_SLP_S4_L, PIN(8, 6), GPIO_INT_BOTH, power_signal_interrupt) /* SLP_S4_L */ GPIO_INT(PCH_SLP_S3_L, PIN(7, 3), GPIO_INT_BOTH, power_signal_interrupt) /* SLP_S3_L */ -GPIO_INT(SUSPWRNACK, PIN(7, 2), GPIO_INT_BOTH, power_signal_interrupt) +GPIO_INT(SUSPWRDNACK, PIN(7, 2), GPIO_INT_BOTH, power_signal_interrupt) GPIO_INT(RSMRST_L_PGOOD, PIN(6, 0), GPIO_INT_BOTH, power_signal_interrupt) /* PMIC_EC_RSMRST_ODL */ GPIO_INT(ALL_SYS_PGOOD, PIN(5, 0), GPIO_INT_BOTH, power_signal_interrupt) /* PMIC_EC_PWROK_OD */ diff --git a/board/eve/board.c b/board/eve/board.c index c7eb7e6c57..fbca0c09e3 100644 --- a/board/eve/board.c +++ b/board/eve/board.c @@ -157,17 +157,6 @@ void anx74xx_cable_det_interrupt(enum gpio_signal signal) #include "gpio_list.h" -/* power signal list. Must match order of enum power_signal. */ -const struct power_signal_info power_signal_list[] = { - {GPIO_PCH_SLP_S0_L, POWER_SIGNAL_ACTIVE_HIGH, "SLP_S0_DEASSERTED"}, - {VW_SLP_S3_L, POWER_SIGNAL_ACTIVE_HIGH, "SLP_S3_DEASSERTED"}, - {VW_SLP_S4_L, POWER_SIGNAL_ACTIVE_HIGH, "SLP_S4_DEASSERTED"}, - {GPIO_PCH_SLP_SUS_L, POWER_SIGNAL_ACTIVE_HIGH, "SLP_SUS_DEASSERTED"}, - {GPIO_RSMRST_L_PGOOD, POWER_SIGNAL_ACTIVE_HIGH, "RSMRST_L_PGOOD"}, - {GPIO_PMIC_DPWROK, POWER_SIGNAL_ACTIVE_HIGH, "PMIC_DPWROK"}, -}; -BUILD_ASSERT(ARRAY_SIZE(power_signal_list) == POWER_SIGNAL_COUNT); - /* Keyboard scan. Increase output_settle_us to 80us from default 50us. */ struct keyboard_scan_config keyscan_config = { .output_settle_us = 80, diff --git a/board/eve/board.h b/board/eve/board.h index 311cc97955..84a4dc2cef 100644 --- a/board/eve/board.h +++ b/board/eve/board.h @@ -213,16 +213,6 @@ enum board_version_list { BOARD_VERSION_PVT, }; -enum power_signal { - X86_SLP_S0_DEASSERTED, - X86_SLP_S3_DEASSERTED, - X86_SLP_S4_DEASSERTED, - X86_SLP_SUS_DEASSERTED, - X86_RSMRST_L_PGOOD, - X86_PMIC_DPWROK, - POWER_SIGNAL_COUNT -}; - enum temp_sensor_id { TEMP_SENSOR_BATTERY, /* BD99956GW TSENSE */ TEMP_SENSOR_AMBIENT, /* BD99992GW SYSTHERM0 */ diff --git a/board/fizz/board.c b/board/fizz/board.c index 693c26c9b4..4e51c9851c 100644 --- a/board/fizz/board.c +++ b/board/fizz/board.c @@ -117,22 +117,6 @@ void vbus0_evt(enum gpio_signal signal) #include "gpio_list.h" -/* power signal list. Must match order of enum power_signal. */ -const struct power_signal_info power_signal_list[] = { - {GPIO_PCH_SLP_S0_L, POWER_SIGNAL_ACTIVE_HIGH, "SLP_S0_DEASSERTED"}, -#ifdef CONFIG_HOSTCMD_ESPI_VW_SLP_SIGNALS - {VW_SLP_S3_L, POWER_SIGNAL_ACTIVE_HIGH, "SLP_S3_DEASSERTED"}, - {VW_SLP_S4_L, POWER_SIGNAL_ACTIVE_HIGH, "SLP_S4_DEASSERTED"}, -#else - {GPIO_PCH_SLP_S3_L, POWER_SIGNAL_ACTIVE_HIGH, "SLP_S3_DEASSERTED"}, - {GPIO_PCH_SLP_S4_L, POWER_SIGNAL_ACTIVE_HIGH, "SLP_S4_DEASSERTED"}, -#endif - {GPIO_PCH_SLP_SUS_L, POWER_SIGNAL_ACTIVE_HIGH, "SLP_SUS_DEASSERTED"}, - {GPIO_RSMRST_L_PGOOD, POWER_SIGNAL_ACTIVE_HIGH, "RSMRST_L_PGOOD"}, - {GPIO_PMIC_DPWROK, POWER_SIGNAL_ACTIVE_HIGH, "PMIC_DPWROK"}, -}; -BUILD_ASSERT(ARRAY_SIZE(power_signal_list) == POWER_SIGNAL_COUNT); - /* Hibernate wake configuration */ const enum gpio_signal hibernate_wake_pins[] = { GPIO_POWER_BUTTON_L, diff --git a/board/fizz/board.h b/board/fizz/board.h index 09f5e15c4c..92d2ae05f1 100644 --- a/board/fizz/board.h +++ b/board/fizz/board.h @@ -193,16 +193,6 @@ enum charge_port { CHARGE_PORT_BARRELJACK, }; -enum power_signal { - X86_SLP_S0_DEASSERTED, - X86_SLP_S3_DEASSERTED, - X86_SLP_S4_DEASSERTED, - X86_SLP_SUS_DEASSERTED, - X86_RSMRST_L_PGOOD, - X86_PMIC_DPWROK, - POWER_SIGNAL_COUNT -}; - enum temp_sensor_id { TEMP_SENSOR_CHARGER, /* BD99992GW SYSTHERM1 */ TEMP_SENSOR_DRAM, /* BD99992GW SYSTHERM2 */ diff --git a/board/glados/board.c b/board/glados/board.c index c24c3ebef6..1521800439 100644 --- a/board/glados/board.c +++ b/board/glados/board.c @@ -97,16 +97,6 @@ void tablet_mode_interrupt(enum gpio_signal signal) #include "gpio_list.h" -/* power signal list. Must match order of enum power_signal. */ -const struct power_signal_info power_signal_list[] = { - {GPIO_RSMRST_L_PGOOD, POWER_SIGNAL_ACTIVE_HIGH, "RSMRST_N_PWRGD"}, - {GPIO_PCH_SLP_S3_L, POWER_SIGNAL_ACTIVE_HIGH, "SLP_S3_DEASSERTED"}, - {GPIO_PCH_SLP_S4_L, POWER_SIGNAL_ACTIVE_HIGH, "SLP_S4_DEASSERTED"}, - {GPIO_PCH_SLP_SUS_L, POWER_SIGNAL_ACTIVE_HIGH, "SLP_SUS_DEASSERTED"}, - {GPIO_PMIC_DPWROK, POWER_SIGNAL_ACTIVE_HIGH, "PMIC_DPWROK"}, -}; -BUILD_ASSERT(ARRAY_SIZE(power_signal_list) == POWER_SIGNAL_COUNT); - /* ADC channels */ const struct adc_t adc_channels[] = { /* Vbus sensing. Converted to mV, full ADC is equivalent to 30V. */ diff --git a/board/glados/board.h b/board/glados/board.h index c58c2f87a7..2fa9662b0b 100644 --- a/board/glados/board.h +++ b/board/glados/board.h @@ -164,18 +164,6 @@ enum adc_channel { ADC_CH_COUNT }; -/* power signal definitions */ -enum power_signal { - X86_RSMRST_L_PWRGD = 0, - X86_SLP_S3_DEASSERTED, - X86_SLP_S4_DEASSERTED, - X86_SLP_SUS_DEASSERTED, - X86_PMIC_DPWROK, - - /* Number of X86 signals */ - POWER_SIGNAL_COUNT -}; - enum temp_sensor_id { TEMP_SENSOR_BATTERY, diff --git a/board/glkrvp/board.c b/board/glkrvp/board.c index 898c53971c..c7445d19a3 100644 --- a/board/glkrvp/board.c +++ b/board/glkrvp/board.c @@ -43,21 +43,6 @@ pca9555_read(I2C_PORT_PCA555_BOARD_ID_GPIO, \ I2C_ADDR_PCA555_BOARD_ID_GPIO, (reg), (data)) -/* power signal list. Must match order of enum power_signal. */ -const struct power_signal_info power_signal_list[] = { - {GPIO_RSMRST_L_PGOOD, POWER_SIGNAL_ACTIVE_HIGH, "RSMRST_L"}, - {GPIO_PCH_SLP_S0_L, - POWER_SIGNAL_ACTIVE_HIGH | POWER_SIGNAL_DISABLE_AT_BOOT, - "SLP_S0_DEASSERTED"}, - {GPIO_PCH_SLP_S3_L, POWER_SIGNAL_ACTIVE_HIGH, "SLP_S3_DEASSERTED"}, - {GPIO_PCH_SLP_S4_L, POWER_SIGNAL_ACTIVE_HIGH, "SLP_S4_DEASSERTED"}, - {GPIO_SUSPWRNACK, POWER_SIGNAL_ACTIVE_HIGH, - "SUSPWRNACK_DEASSERTED"}, - - {GPIO_ALL_SYS_PGOOD, POWER_SIGNAL_ACTIVE_HIGH, "ALL_SYS_PGOOD"}, -}; -BUILD_ASSERT(ARRAY_SIZE(power_signal_list) == POWER_SIGNAL_COUNT); - /* I2C ports */ const struct i2c_port_t i2c_ports[] = { {"pmic", NPCX_I2C_PORT0_0, 100, GPIO_I2C0_SCL, GPIO_I2C0_SDA}, diff --git a/board/glkrvp/board.h b/board/glkrvp/board.h index fc37732bc8..7d37645f36 100644 --- a/board/glkrvp/board.h +++ b/board/glkrvp/board.h @@ -131,19 +131,6 @@ #include "gpio_signal.h" #include "registers.h" -enum power_signal { - X86_RSMRST_N = 0, - X86_SLP_S0_N, - X86_SLP_S3_N, - X86_SLP_S4_N, - X86_SUSPWRDNACK, - - X86_ALL_SYS_PG, /* PMIC_EC_PWROK_OD */ - - /* Number of X86 signals */ - POWER_SIGNAL_COUNT -}; - enum adc_channel { ADC_VBUS, ADC_CH_COUNT, diff --git a/board/glkrvp/gpio.inc b/board/glkrvp/gpio.inc index f66f903e97..a173ba6333 100644 --- a/board/glkrvp/gpio.inc +++ b/board/glkrvp/gpio.inc @@ -13,7 +13,7 @@ */ /* Power sequencing interrupts */ -GPIO_INT(SUSPWRNACK, PIN(0, 2), GPIO_INT_BOTH, power_signal_interrupt) +GPIO_INT(SUSPWRDNACK, PIN(0, 2), GPIO_INT_BOTH, power_signal_interrupt) GPIO_INT(RSMRST_L_PGOOD,PIN(3, 6), GPIO_INT_BOTH, power_signal_interrupt) GPIO_INT(ALL_SYS_PGOOD, PIN(7, 2), GPIO_INT_BOTH, power_signal_interrupt) GPIO_INT(PCH_SLP_S0_L, PIN(8, 1), GPIO_INT_BOTH, power_signal_interrupt) @@ -33,6 +33,9 @@ GPIO_INT(USB_C1_PD_INT_ODL, PIN(6, 3), GPIO_INT_FALLING, tcpc_alert_event) GPIO_INT(AC_PRESENT, PIN(D, 2), GPIO_INT_BOTH, extpower_interrupt) GPIO_INT(WP_L, PIN(9, 3), GPIO_INT_BOTH | GPIO_SEL_1P8V, switch_interrupt) +UNIMPLEMENTED(PP3300_PG) +UNIMPLEMENTED(PP5000_PG) + /* Power sequencing GPIOs */ GPIO(SYS_RESET_L, PIN(0, 0), GPIO_ODR_HIGH) GPIO(PCH_RSMRST_L, PIN(0, 1), GPIO_OUT_LOW) diff --git a/board/glkrvp_ite/board.c b/board/glkrvp_ite/board.c index fab4e8dde7..4127a29634 100644 --- a/board/glkrvp_ite/board.c +++ b/board/glkrvp_ite/board.c @@ -33,21 +33,6 @@ #define I2C_PORT_PCA555_BOARD_ID_GPIO IT83XX_I2C_CH_C #define I2C_ADDR_PCA555_BOARD_ID_GPIO 0x40 -/* power signal list. Must match order of enum power_signal. */ -const struct power_signal_info power_signal_list[] = { - {GPIO_RSMRST_L_PGOOD, POWER_SIGNAL_ACTIVE_HIGH, "RSMRST_L"}, - {GPIO_PCH_SLP_S0_L, - POWER_SIGNAL_ACTIVE_HIGH | POWER_SIGNAL_DISABLE_AT_BOOT, - "SLP_S0_DEASSERTED"}, - {GPIO_PCH_SLP_S3_L, POWER_SIGNAL_ACTIVE_HIGH, "SLP_S3_DEASSERTED"}, - {GPIO_PCH_SLP_S4_L, POWER_SIGNAL_ACTIVE_HIGH, "SLP_S4_DEASSERTED"}, - {GPIO_SUSPWRNACK, POWER_SIGNAL_ACTIVE_HIGH, - "SUSPWRNACK_DEASSERTED"}, - - {GPIO_ALL_SYS_PGOOD, POWER_SIGNAL_ACTIVE_HIGH, "ALL_SYS_PGOOD"}, -}; -BUILD_ASSERT(ARRAY_SIZE(power_signal_list) == POWER_SIGNAL_COUNT); - /* I2C ports */ const struct i2c_port_t i2c_ports[] = { {"charger", IT83XX_I2C_CH_A, 100, GPIO_I2C_A_SCL, GPIO_I2C_A_SDA}, diff --git a/board/glkrvp_ite/board.h b/board/glkrvp_ite/board.h index 3d5abee7e0..d1d3b7be7d 100644 --- a/board/glkrvp_ite/board.h +++ b/board/glkrvp_ite/board.h @@ -126,19 +126,6 @@ #include "gpio_signal.h" #include "registers.h" -enum power_signal { - X86_RSMRST_N = 0, - X86_SLP_S0_N, - X86_SLP_S3_N, - X86_SLP_S4_N, - X86_SUSPWRDNACK, - - X86_ALL_SYS_PG, /* PMIC_EC_PWROK_OD */ - - /* Number of X86 signals */ - POWER_SIGNAL_COUNT -}; - enum adc_channel { ADC_VBUS, ADC_CH_COUNT, diff --git a/board/glkrvp_ite/gpio.inc b/board/glkrvp_ite/gpio.inc index 2cda04e59c..a4f21a64f4 100644 --- a/board/glkrvp_ite/gpio.inc +++ b/board/glkrvp_ite/gpio.inc @@ -13,7 +13,7 @@ */ /* Power sequencing interrupts */ -GPIO_INT(SUSPWRNACK, PIN(E, 1), GPIO_INT_BOTH, power_signal_interrupt) +GPIO_INT(SUSPWRDNACK, PIN(E, 1), GPIO_INT_BOTH, power_signal_interrupt) GPIO_INT(PCH_SLP_S0_L, PIN(F, 0), GPIO_INT_BOTH, power_signal_interrupt) GPIO_INT(PCH_SLP_S3_L, PIN(F, 2), GPIO_INT_BOTH, power_signal_interrupt) GPIO_INT(PCH_SLP_S4_L, PIN(F, 3), GPIO_INT_BOTH, power_signal_interrupt) @@ -39,6 +39,8 @@ UNIMPLEMENTED(USB_C0_PD_INT_ODL) UNIMPLEMENTED(USB_C1_PD_INT_ODL) UNIMPLEMENTED(WP_L) +UNIMPLEMENTED(PP3300_PG) +UNIMPLEMENTED(PP5000_PG) /* Power sequencing GPIOs */ UNIMPLEMENTED(SYS_RESET_L) diff --git a/board/mchpevb1/board.c b/board/mchpevb1/board.c index ed5a661224..7f4bb26c46 100644 --- a/board/mchpevb1/board.c +++ b/board/mchpevb1/board.c @@ -215,17 +215,6 @@ void tablet_mode_interrupt(enum gpio_signal signal) #include "gpio_list.h" -/* power signal list. Must match order of enum power_signal. */ -const struct power_signal_info power_signal_list[] = { - {GPIO_RSMRST_L_PGOOD, POWER_SIGNAL_ACTIVE_HIGH, "RSMRST_N_PWRGD"}, - {VW_SLP_S3_L, POWER_SIGNAL_ACTIVE_HIGH, "SLP_S3_DEASSERTED"}, - {VW_SLP_S4_L, POWER_SIGNAL_ACTIVE_HIGH, "SLP_S4_DEASSERTED"}, - {GPIO_PCH_SLP_SUS_L, POWER_SIGNAL_ACTIVE_HIGH, "SLP_SUS_DEASSERTED"}, - {GPIO_PMIC_DPWROK, POWER_SIGNAL_ACTIVE_HIGH, "PMIC_DPWROK"}, - {GPIO_ALL_SYS_PWRGD, POWER_SIGNAL_ACTIVE_HIGH, "ALL_SYS_PWRGD"} -}; -BUILD_ASSERT(ARRAY_SIZE(power_signal_list) == POWER_SIGNAL_COUNT); - /* ADC channels * name, factor multiplier, factor divider, shift, channel */ diff --git a/board/mchpevb1/board.h b/board/mchpevb1/board.h index ee6f9d92ba..0dbfe2bb3c 100644 --- a/board/mchpevb1/board.h +++ b/board/mchpevb1/board.h @@ -423,19 +423,6 @@ enum adc_channel { ADC_CH_COUNT }; -/* power signal definitions */ -enum power_signal { - X86_RSMRST_L_PWRGD = 0, - X86_SLP_S3_DEASSERTED, - X86_SLP_S4_DEASSERTED, - X86_SLP_SUS_DEASSERTED, - X86_PMIC_DPWROK, - X86_ALL_SYS_PWRGD, /* MCHP mec1701_evb + SKL/KBL RVP3 */ - - /* Number of X86 signals */ - POWER_SIGNAL_COUNT -}; - enum temp_sensor_id { TEMP_SENSOR_BATTERY, diff --git a/board/nami/board.c b/board/nami/board.c index 59fc0b4c1c..ffdc530903 100644 --- a/board/nami/board.c +++ b/board/nami/board.c @@ -148,21 +148,6 @@ void usb1_evt(enum gpio_signal signal) #include "gpio_list.h" -/* power signal list. Must match order of enum power_signal. */ -const struct power_signal_info power_signal_list[] = { -#ifdef CONFIG_POWER_S0IX - {GPIO_PCH_SLP_S0_L, - POWER_SIGNAL_ACTIVE_HIGH | POWER_SIGNAL_DISABLE_AT_BOOT, - "SLP_S0_DEASSERTED"}, -#endif - {VW_SLP_S3_L, POWER_SIGNAL_ACTIVE_HIGH, "SLP_S3_DEASSERTED"}, - {VW_SLP_S4_L, POWER_SIGNAL_ACTIVE_HIGH, "SLP_S4_DEASSERTED"}, - {GPIO_PCH_SLP_SUS_L, POWER_SIGNAL_ACTIVE_HIGH, "SLP_SUS_DEASSERTED"}, - {GPIO_RSMRST_L_PGOOD, POWER_SIGNAL_ACTIVE_HIGH, "RSMRST_L_PGOOD"}, - {GPIO_PMIC_DPWROK, POWER_SIGNAL_ACTIVE_HIGH, "PMIC_DPWROK"}, -}; -BUILD_ASSERT(ARRAY_SIZE(power_signal_list) == POWER_SIGNAL_COUNT); - /* ADC channels */ const struct adc_t adc_channels[] = { /* Vbus sensing (10x voltage divider). PPVAR_BOOSTIN_SENSE */ diff --git a/board/nami/board.h b/board/nami/board.h index 61d1274c46..be0404c45b 100644 --- a/board/nami/board.h +++ b/board/nami/board.h @@ -223,18 +223,6 @@ extern const int keyboard_factory_scan_pins_used; #include "gpio_signal.h" #include "registers.h" -enum power_signal { -#ifdef CONFIG_POWER_S0IX - X86_SLP_S0_DEASSERTED, -#endif - X86_SLP_S3_DEASSERTED, - X86_SLP_S4_DEASSERTED, - X86_SLP_SUS_DEASSERTED, - X86_RSMRST_L_PGOOD, - X86_PMIC_DPWROK, - POWER_SIGNAL_COUNT, -}; - enum temp_sensor_id { TEMP_SENSOR_LOCAL = 0, TEMP_SENSOR_REMOTE1, diff --git a/board/nautilus/board.c b/board/nautilus/board.c index b0071bc84c..5dc1df0328 100644 --- a/board/nautilus/board.c +++ b/board/nautilus/board.c @@ -112,26 +112,6 @@ void usb1_evt(enum gpio_signal signal) #include "gpio_list.h" -/* power signal list. Must match order of enum power_signal. */ -const struct power_signal_info power_signal_list[] = { -#ifdef CONFIG_POWER_S0IX - {GPIO_PCH_SLP_S0_L, - POWER_SIGNAL_ACTIVE_HIGH | POWER_SIGNAL_DISABLE_AT_BOOT, - "SLP_S0_DEASSERTED"}, -#endif -#ifdef CONFIG_HOSTCMD_ESPI_VW_SLP_SIGNALS - {VW_SLP_S3_L, POWER_SIGNAL_ACTIVE_HIGH, "SLP_S3_DEASSERTED"}, - {VW_SLP_S4_L, POWER_SIGNAL_ACTIVE_HIGH, "SLP_S4_DEASSERTED"}, -#else - {GPIO_PCH_SLP_S3_L, POWER_SIGNAL_ACTIVE_HIGH, "SLP_S3_DEASSERTED"}, - {GPIO_PCH_SLP_S4_L, POWER_SIGNAL_ACTIVE_HIGH, "SLP_S4_DEASSERTED"}, -#endif - {GPIO_PCH_SLP_SUS_L, POWER_SIGNAL_ACTIVE_HIGH, "SLP_SUS_DEASSERTED"}, - {GPIO_RSMRST_L_PGOOD, POWER_SIGNAL_ACTIVE_HIGH, "RSMRST_L_PGOOD"}, - {GPIO_PMIC_DPWROK, POWER_SIGNAL_ACTIVE_HIGH, "PMIC_DPWROK"}, -}; -BUILD_ASSERT(ARRAY_SIZE(power_signal_list) == POWER_SIGNAL_COUNT); - /* Hibernate wake configuration */ const enum gpio_signal hibernate_wake_pins[] = { GPIO_AC_PRESENT, diff --git a/board/nautilus/board.h b/board/nautilus/board.h index 93a283c4c3..014f821482 100644 --- a/board/nautilus/board.h +++ b/board/nautilus/board.h @@ -189,18 +189,6 @@ #include "gpio_signal.h" #include "registers.h" -enum power_signal { -#ifdef CONFIG_POWER_S0IX - X86_SLP_S0_DEASSERTED, -#endif - X86_SLP_S3_DEASSERTED, - X86_SLP_S4_DEASSERTED, - X86_SLP_SUS_DEASSERTED, - X86_RSMRST_L_PGOOD, - X86_PMIC_DPWROK, - POWER_SIGNAL_COUNT -}; - /* Nautilus doesn't have systherm0 and systherm3 */ enum temp_sensor_id { TEMP_SENSOR_BATTERY, /* BD99956GW TSENSE */ diff --git a/board/nocturne/board.c b/board/nocturne/board.c index 02d4a1f6dc..8fe2a58e66 100644 --- a/board/nocturne/board.c +++ b/board/nocturne/board.c @@ -112,19 +112,6 @@ const struct adc_t adc_channels[] = { }, }; -/* Power signal list. Must match order of enum power_signal. */ -const struct power_signal_info power_signal_list[] = { - {GPIO_SLP_S0_L, - POWER_SIGNAL_ACTIVE_HIGH | POWER_SIGNAL_DISABLE_AT_BOOT, - "SLP_S0_DEASSERTED"}, - {GPIO_SLP_S3_L, POWER_SIGNAL_ACTIVE_HIGH, "SLP_S3_DEASSERTED"}, - {GPIO_SLP_S4_L, POWER_SIGNAL_ACTIVE_HIGH, "SLP_S4_DEASSERTED"}, - {GPIO_PCH_SLP_SUS_L, POWER_SIGNAL_ACTIVE_HIGH, "SLP_SUS_DEASSERTED"}, - {GPIO_RSMRST_L_PGOOD, POWER_SIGNAL_ACTIVE_HIGH, "RSMRST_L_PGOOD"}, - {GPIO_PMIC_DPWROK, POWER_SIGNAL_ACTIVE_HIGH, "PMIC_DPWROK"}, -}; -BUILD_ASSERT(ARRAY_SIZE(power_signal_list) == POWER_SIGNAL_COUNT); - /* PWM channels. Must be in the exactly same order as in enum pwm_channel. */ const struct pwm_t pwm_channels[] = { [PWM_CH_DB0_LED_RED] = { 3, PWM_CONFIG_ACTIVE_LOW | PWM_CONFIG_DSLEEP, diff --git a/board/nocturne/board.h b/board/nocturne/board.h index 9fe50b7fbd..51d7ae6906 100644 --- a/board/nocturne/board.h +++ b/board/nocturne/board.h @@ -213,16 +213,6 @@ enum adc_channel { ADC_CH_COUNT }; -enum power_signal { - X86_SLP_S0_DEASSERTED, - X86_SLP_S3_DEASSERTED, - X86_SLP_S4_DEASSERTED, - X86_SLP_SUS_DEASSERTED, - X86_RSMRST_L_PGOOD, - X86_PMIC_DPWROK, - POWER_SIGNAL_COUNT -}; - enum temp_sensor_id { TEMP_SENSOR_BATTERY, /* BD99956GW TSENSE */ TEMP_SENSOR_AMBIENT, /* BD99992GW SYSTHERM0 */ diff --git a/board/poppy/board.c b/board/poppy/board.c index 3c27da46ba..cc26a6206d 100644 --- a/board/poppy/board.c +++ b/board/poppy/board.c @@ -144,26 +144,6 @@ void anx74xx_cable_det_interrupt(enum gpio_signal signal) #include "gpio_list.h" -/* power signal list. Must match order of enum power_signal. */ -const struct power_signal_info power_signal_list[] = { -#ifdef CONFIG_POWER_S0IX - {GPIO_PCH_SLP_S0_L, - POWER_SIGNAL_ACTIVE_HIGH | POWER_SIGNAL_DISABLE_AT_BOOT, - "SLP_S0_DEASSERTED"}, -#endif -#ifdef CONFIG_HOSTCMD_ESPI_VW_SLP_SIGNALS - {VW_SLP_S3_L, POWER_SIGNAL_ACTIVE_HIGH, "SLP_S3_DEASSERTED"}, - {VW_SLP_S4_L, POWER_SIGNAL_ACTIVE_HIGH, "SLP_S4_DEASSERTED"}, -#else - {GPIO_PCH_SLP_S3_L, POWER_SIGNAL_ACTIVE_HIGH, "SLP_S3_DEASSERTED"}, - {GPIO_PCH_SLP_S4_L, POWER_SIGNAL_ACTIVE_HIGH, "SLP_S4_DEASSERTED"}, -#endif - {GPIO_PCH_SLP_SUS_L, POWER_SIGNAL_ACTIVE_HIGH, "SLP_SUS_DEASSERTED"}, - {GPIO_RSMRST_L_PGOOD, POWER_SIGNAL_ACTIVE_HIGH, "RSMRST_L_PGOOD"}, - {GPIO_PMIC_DPWROK, POWER_SIGNAL_ACTIVE_HIGH, "PMIC_DPWROK"}, -}; -BUILD_ASSERT(ARRAY_SIZE(power_signal_list) == POWER_SIGNAL_COUNT); - /* Hibernate wake configuration */ const enum gpio_signal hibernate_wake_pins[] = { GPIO_AC_PRESENT, diff --git a/board/poppy/board.h b/board/poppy/board.h index 87262ca4b6..39e0f1796f 100644 --- a/board/poppy/board.h +++ b/board/poppy/board.h @@ -200,18 +200,6 @@ #include "gpio_signal.h" #include "registers.h" -enum power_signal { -#ifdef CONFIG_POWER_S0IX - X86_SLP_S0_DEASSERTED, -#endif - X86_SLP_S3_DEASSERTED, - X86_SLP_S4_DEASSERTED, - X86_SLP_SUS_DEASSERTED, - X86_RSMRST_L_PGOOD, - X86_PMIC_DPWROK, - POWER_SIGNAL_COUNT -}; - enum temp_sensor_id { TEMP_SENSOR_BATTERY, /* BD99956GW TSENSE */ TEMP_SENSOR_AMBIENT, /* BD99992GW SYSTHERM0 */ diff --git a/board/rammus/board.c b/board/rammus/board.c index 472bb81ebc..1596407718 100644 --- a/board/rammus/board.c +++ b/board/rammus/board.c @@ -114,21 +114,6 @@ void usb1_evt(enum gpio_signal signal) #include "gpio_list.h" -/* power signal list. Must match order of enum power_signal. */ -const struct power_signal_info power_signal_list[] = { -#ifdef CONFIG_POWER_S0IX - {GPIO_PCH_SLP_S0_L, - POWER_SIGNAL_ACTIVE_HIGH | POWER_SIGNAL_DISABLE_AT_BOOT, - "SLP_S0_DEASSERTED"}, -#endif - {VW_SLP_S3_L, POWER_SIGNAL_ACTIVE_HIGH, "SLP_S3_DEASSERTED"}, - {VW_SLP_S4_L, POWER_SIGNAL_ACTIVE_HIGH, "SLP_S4_DEASSERTED"}, - {GPIO_PCH_SLP_SUS_L, POWER_SIGNAL_ACTIVE_HIGH, "SLP_SUS_DEASSERTED"}, - {GPIO_RSMRST_L_PGOOD, POWER_SIGNAL_ACTIVE_HIGH, "RSMRST_L_PGOOD"}, - {GPIO_PMIC_DPWROK, POWER_SIGNAL_ACTIVE_HIGH, "PMIC_DPWROK"}, -}; -BUILD_ASSERT(ARRAY_SIZE(power_signal_list) == POWER_SIGNAL_COUNT); - /* Hibernate wake configuration */ const enum gpio_signal hibernate_wake_pins[] = { GPIO_AC_PRESENT, diff --git a/board/rammus/board.h b/board/rammus/board.h index ba4b1c9936..8c36ca46b9 100644 --- a/board/rammus/board.h +++ b/board/rammus/board.h @@ -213,18 +213,6 @@ #include "gpio_signal.h" #include "registers.h" -enum power_signal { -#ifdef CONFIG_POWER_S0IX - X86_SLP_S0_DEASSERTED, -#endif - X86_SLP_S3_DEASSERTED, - X86_SLP_S4_DEASSERTED, - X86_SLP_SUS_DEASSERTED, - X86_RSMRST_L_PGOOD, - X86_PMIC_DPWROK, - POWER_SIGNAL_COUNT -}; - enum temp_sensor_id { TEMP_SENSOR_BATTERY, /* Smart Battery Temperature */ TEMP_SENSOR_AMBIENT, /* BD99992GW SYSTHERM0 */ diff --git a/board/reef/board.c b/board/reef/board.c index 579627d536..2189146e34 100644 --- a/board/reef/board.c +++ b/board/reef/board.c @@ -125,25 +125,6 @@ void tablet_mode_interrupt(enum gpio_signal signal) #include "gpio_list.h" -/* power signal list. Must match order of enum power_signal. */ -const struct power_signal_info power_signal_list[] = { -#ifdef CONFIG_POWER_S0IX - {GPIO_PCH_SLP_S0_L, - POWER_SIGNAL_ACTIVE_HIGH | POWER_SIGNAL_DISABLE_AT_BOOT, - "SLP_S0_DEASSERTED"}, -#endif - {GPIO_RSMRST_L_PGOOD, POWER_SIGNAL_ACTIVE_HIGH, "RSMRST_L"}, - {GPIO_PCH_SLP_S3_L, POWER_SIGNAL_ACTIVE_HIGH, "SLP_S3_DEASSERTED"}, - {GPIO_PCH_SLP_S4_L, POWER_SIGNAL_ACTIVE_HIGH, "SLP_S4_DEASSERTED"}, - {GPIO_SUSPWRNACK, POWER_SIGNAL_ACTIVE_HIGH, - "SUSPWRNACK_DEASSERTED"}, - - {GPIO_ALL_SYS_PGOOD, POWER_SIGNAL_ACTIVE_HIGH, "ALL_SYS_PGOOD"}, - {GPIO_PP3300_PG, POWER_SIGNAL_ACTIVE_HIGH, "PP3300_PG"}, - {GPIO_PP5000_PG, POWER_SIGNAL_ACTIVE_HIGH, "PP5000_PG"}, -}; -BUILD_ASSERT(ARRAY_SIZE(power_signal_list) == POWER_SIGNAL_COUNT); - /* ADC channels */ const struct adc_t adc_channels[] = { /* Vfs = Vref = 2.816V, 10-bit unsigned reading */ diff --git a/board/reef/board.h b/board/reef/board.h index 13495970bc..5dd0a3bf06 100644 --- a/board/reef/board.h +++ b/board/reef/board.h @@ -233,23 +233,6 @@ enum pwm_channel { PWM_CH_COUNT }; -enum power_signal { -#ifdef CONFIG_POWER_S0IX - X86_SLP_S0_N, -#endif - X86_RSMRST_N, - X86_SLP_S3_N, - X86_SLP_S4_N, - X86_SUSPWRDNACK, - - X86_ALL_SYS_PG, /* PMIC_EC_PWROK_OD */ - X86_PGOOD_PP3300, /* GPIO_PP3300_PG */ - X86_PGOOD_PP5000, /* GPIO_PP5000_PG */ - - /* Number of X86 signals */ - POWER_SIGNAL_COUNT -}; - enum temp_sensor_id { TEMP_SENSOR_BATTERY = 0, TEMP_SENSOR_AMBIENT, diff --git a/board/reef/gpio.inc b/board/reef/gpio.inc index 95a45b17f7..2b6a5342f4 100644 --- a/board/reef/gpio.inc +++ b/board/reef/gpio.inc @@ -24,7 +24,7 @@ GPIO_INT(PCH_SLP_S0_L, PIN(7, 5), GPIO_INT_BOTH, power_signal_interrupt) /* SLP #endif GPIO_INT(PCH_SLP_S4_L, PIN(8, 6), GPIO_INT_BOTH, power_signal_interrupt) /* SLP_S4_L */ GPIO_INT(PCH_SLP_S3_L, PIN(7, 3), GPIO_INT_BOTH, power_signal_interrupt) /* SLP_S3_L */ -GPIO_INT(SUSPWRNACK, PIN(7, 2), GPIO_INT_BOTH, power_signal_interrupt) +GPIO_INT(SUSPWRDNACK, PIN(7, 2), GPIO_INT_BOTH, power_signal_interrupt) GPIO_INT(RSMRST_L_PGOOD, PIN(6, 0), GPIO_INT_BOTH, power_signal_interrupt) /* PMIC_EC_RSMRST_ODL */ GPIO_INT(ALL_SYS_PGOOD, PIN(5, 0), GPIO_INT_BOTH, power_signal_interrupt) /* PMIC_EC_PWROK_OD */ diff --git a/board/reef_it8320/board.c b/board/reef_it8320/board.c index 47c63c0599..6174e7e24b 100644 --- a/board/reef_it8320/board.c +++ b/board/reef_it8320/board.c @@ -57,26 +57,6 @@ #include "gpio_list.h" -/* power signal list. Must match order of enum power_signal. */ -const struct power_signal_info power_signal_list[] = { -#ifdef CONFIG_POWER_S0IX - {GPIO_PCH_SLP_S0_L, - POWER_SIGNAL_ACTIVE_HIGH | POWER_SIGNAL_DISABLE_AT_BOOT, - "SLP_S0_DEASSERTED"}, -#endif - {GPIO_RSMRST_L_PGOOD, POWER_SIGNAL_ACTIVE_HIGH, "RSMRST_L"}, - {GPIO_PCH_SLP_S3_L, POWER_SIGNAL_ACTIVE_HIGH, "SLP_S3_DEASSERTED"}, - {GPIO_PCH_SLP_S4_L, POWER_SIGNAL_ACTIVE_HIGH, "SLP_S4_DEASSERTED"}, - {GPIO_SUSPWRNACK, POWER_SIGNAL_ACTIVE_HIGH, - "SUSPWRNACK_DEASSERTED"}, - - {GPIO_ALL_SYS_PGOOD, POWER_SIGNAL_ACTIVE_HIGH, "ALL_SYS_PGOOD"}, - {GPIO_PP3300_PG, POWER_SIGNAL_ACTIVE_HIGH, "PP3300_PG"}, - {GPIO_PP5000_PG, POWER_SIGNAL_ACTIVE_HIGH, "PP5000_PG"}, -}; -BUILD_ASSERT(ARRAY_SIZE(power_signal_list) == POWER_SIGNAL_COUNT); - -/* ADC channels */ const struct adc_t adc_channels[] = { /* Convert to mV (3000mV/1024). */ {"CHARGER", 3000, 1024, 0, CHIP_ADC_CH1}, /* GPI1 */ diff --git a/board/reef_it8320/board.h b/board/reef_it8320/board.h index 85399a3cc5..ef1a3361e1 100644 --- a/board/reef_it8320/board.h +++ b/board/reef_it8320/board.h @@ -160,23 +160,6 @@ enum adc_channel { ADC_CH_COUNT }; -enum power_signal { -#ifdef CONFIG_POWER_S0IX - X86_SLP_S0_N, -#endif - X86_RSMRST_N, - X86_SLP_S3_N, - X86_SLP_S4_N, - X86_SUSPWRDNACK, - - X86_ALL_SYS_PG, /* PMIC_EC_PWROK_OD */ - X86_PGOOD_PP3300, /* GPIO_PP3300_PG */ - X86_PGOOD_PP5000, /* GPIO_PP5000_PG */ - - /* Number of X86 signals */ - POWER_SIGNAL_COUNT -}; - enum temp_sensor_id { TEMP_SENSOR_BATTERY = 0, TEMP_SENSOR_AMBIENT, diff --git a/board/reef_it8320/gpio.inc b/board/reef_it8320/gpio.inc index 6c07d19f38..808787d475 100644 --- a/board/reef_it8320/gpio.inc +++ b/board/reef_it8320/gpio.inc @@ -18,7 +18,7 @@ GPIO_INT(EC_VOLDN_BTN_ODL, PIN(D, 6), GPIO_INT_BOTH | GPIO_PULL_UP, button_inter #ifdef CONFIG_POWER_S0IX GPIO_INT(PCH_SLP_S0_L, PIN(B, 7), GPIO_INT_BOTH, power_signal_interrupt) /* SLP_S0_L */ #endif -GPIO_INT(SUSPWRNACK, PIN(E, 1), GPIO_INT_BOTH, power_signal_interrupt) /* SUSPWRNACK */ +GPIO_INT(SUSPWRDNACK, PIN(E, 1), GPIO_INT_BOTH, power_signal_interrupt) /* SUSPWRNACK */ GPIO_INT(LID_OPEN, PIN(E, 2), GPIO_INT_BOTH, lid_interrupt) /* LID_OPEN */ #ifndef CONFIG_HOSTCMD_ESPI_VW_SLP_SIGNALS GPIO_INT(PCH_PLTRST_L, PIN(E, 3), GPIO_INT_BOTH | GPIO_PULL_UP, lpcrst_interrupt) /* PLT_RST_L */ diff --git a/board/reef_mchp/board.c b/board/reef_mchp/board.c index 21a64bd60b..b66b5eaa27 100644 --- a/board/reef_mchp/board.c +++ b/board/reef_mchp/board.c @@ -161,28 +161,6 @@ void tablet_mode_interrupt(enum gpio_signal signal) #include "gpio_list.h" -/* power signal list. Must match order of enum power_signal. */ -const struct power_signal_info power_signal_list[] = { -#ifdef CONFIG_POWER_S0IX - {GPIO_PCH_SLP_S0_L, - POWER_SIGNAL_ACTIVE_HIGH | POWER_SIGNAL_DISABLE_AT_BOOT, - "SLP_S0_DEASSERTED"}, -#endif - {GPIO_RSMRST_L_PGOOD, POWER_SIGNAL_ACTIVE_HIGH, - "RSMRST_L"}, - {GPIO_PCH_SLP_S3_L, POWER_SIGNAL_ACTIVE_HIGH, - "SLP_S3_DEASSERTED"}, - {GPIO_PCH_SLP_S4_L, POWER_SIGNAL_ACTIVE_HIGH, - "SLP_S4_DEASSERTED"}, - {GPIO_SUSPWRNACK, POWER_SIGNAL_ACTIVE_HIGH, - "SUSPWRNACK_DEASSERTED"}, - {GPIO_ALL_SYS_PGOOD, POWER_SIGNAL_ACTIVE_HIGH, - "ALL_SYS_PGOOD"}, - {GPIO_PP3300_PG, POWER_SIGNAL_ACTIVE_HIGH, "PP3300_PG"}, - {GPIO_PP5000_PG, POWER_SIGNAL_ACTIVE_HIGH, "PP5000_PG"}, -}; -BUILD_ASSERT(ARRAY_SIZE(power_signal_list) == POWER_SIGNAL_COUNT); - /* SPI devices */ const struct spi_device_t spi_devices[] = { { QMSPI0_PORT, 4, GPIO_QMSPI_CS0}, diff --git a/board/reef_mchp/board.h b/board/reef_mchp/board.h index 162f863009..dabdabb587 100644 --- a/board/reef_mchp/board.h +++ b/board/reef_mchp/board.h @@ -240,23 +240,6 @@ enum pwm_channel { PWM_CH_COUNT }; -enum power_signal { -#ifdef CONFIG_POWER_S0IX - X86_SLP_S0_N, -#endif - X86_RSMRST_N, - X86_SLP_S3_N, - X86_SLP_S4_N, - X86_SUSPWRDNACK, - - X86_ALL_SYS_PG, /* PMIC_EC_PWROK_OD */ - X86_PGOOD_PP3300, /* GPIO_PP3300_PG */ - X86_PGOOD_PP5000, /* GPIO_PP5000_PG */ - - /* Number of X86 signals */ - POWER_SIGNAL_COUNT -}; - enum temp_sensor_id { TEMP_SENSOR_BATTERY = 0, TEMP_SENSOR_AMBIENT, diff --git a/board/reef_mchp/gpio.inc b/board/reef_mchp/gpio.inc index 754f259d79..baaf36330e 100644 --- a/board/reef_mchp/gpio.inc +++ b/board/reef_mchp/gpio.inc @@ -36,7 +36,7 @@ GPIO_INT(PCH_SLP_S0_L, PIN(050), GPIO_INT_BOTH, power_signal_interrupt) /* SLP_S #endif GPIO_INT(PCH_SLP_S4_L, PIN(033), GPIO_INT_BOTH, power_signal_interrupt) /* SLP_S4_L */ GPIO_INT(PCH_SLP_S3_L, PIN(035), GPIO_INT_BOTH, power_signal_interrupt) /* SLP_S3_L */ -GPIO_INT(SUSPWRNACK, PIN(057), GPIO_INT_BOTH, power_signal_interrupt) +GPIO_INT(SUSPWRDNACK, PIN(057), GPIO_INT_BOTH, power_signal_interrupt) GPIO_INT(RSMRST_L_PGOOD, PIN(0243), GPIO_INT_BOTH, power_signal_interrupt) /* PMIC_EC_RSMRST_ODL */ GPIO_INT(ALL_SYS_PGOOD, PIN(0240), GPIO_INT_BOTH, power_signal_interrupt) /* PMIC_EC_PWROK_OD */ diff --git a/power/apollolake.c b/power/apollolake.c index a9ac1c06d9..36c78c8158 100644 --- a/power/apollolake.c +++ b/power/apollolake.c @@ -5,7 +5,6 @@ /* Apollolake chipset power control module for Chrome EC */ -#include "apollolake.h" #include "chipset.h" #include "console.h" #include "gpio.h" @@ -22,6 +21,53 @@ */ static int force_shutdown; +/* Power signals list. Must match order of enum power_signal. */ +const struct power_signal_info power_signal_list[] = { +#ifdef CONFIG_POWER_S0IX + [X86_SLP_S0_N] = { + GPIO_PCH_SLP_S0_L, + POWER_SIGNAL_ACTIVE_HIGH | POWER_SIGNAL_DISABLE_AT_BOOT, + "SLP_S0_DEASSERTED", + }, +#endif + [X86_SLP_S3_N] = { + GPIO_PCH_SLP_S3_L, + POWER_SIGNAL_ACTIVE_HIGH, + "SLP_S3_DEASSERTED", + }, + [X86_SLP_S4_N] = { + GPIO_PCH_SLP_S4_L, + POWER_SIGNAL_ACTIVE_HIGH, + "SLP_S4_DEASSERTED", + }, + [X86_SUSPWRDNACK] = { + GPIO_SUSPWRDNACK, + POWER_SIGNAL_ACTIVE_HIGH, + "SUSPWRDNACK_DEASSERTED", + }, + [X86_ALL_SYS_PG] = { + GPIO_ALL_SYS_PGOOD, + POWER_SIGNAL_ACTIVE_HIGH, + "ALL_SYS_PGOOD", + }, + [X86_RSMRST_N] = { + GPIO_RSMRST_L_PGOOD, + POWER_SIGNAL_ACTIVE_HIGH, + "RSMRST_L", + }, + [X86_PGOOD_PP3300] = { + GPIO_PP3300_PG, + POWER_SIGNAL_ACTIVE_HIGH, + "PP3300_PG", + }, + [X86_PGOOD_PP5000] = { + GPIO_PP5000_PG, + POWER_SIGNAL_ACTIVE_HIGH, + "PP5000_PG", + }, +}; +BUILD_ASSERT(ARRAY_SIZE(power_signal_list) == POWER_SIGNAL_COUNT); + __attribute__((weak)) void chipset_do_shutdown(void) { /* Need to implement board specific shutdown */ diff --git a/power/apollolake.h b/power/apollolake.h index da5e86121f..cc864f26c3 100644 --- a/power/apollolake.h +++ b/power/apollolake.h @@ -32,4 +32,21 @@ #define CHARGER_INITIALIZED_DELAY_MS 100 #define CHARGER_INITIALIZED_TRIES 40 +enum power_signal { +#ifdef CONFIG_POWER_S0IX + X86_SLP_S0_N, /* PCH -> SLP_S0_L */ +#endif + X86_SLP_S3_N, /* PCH -> SLP_S3_L */ + X86_SLP_S4_N, /* PCH -> SLP_S4_L */ + X86_SUSPWRDNACK, /* PCH -> SUSPWRDNACK */ + + X86_ALL_SYS_PG, /* PMIC -> PMIC_EC_PWROK_OD */ + X86_RSMRST_N, /* PMIC -> PMIC_EC_RSMRST_ODL */ + X86_PGOOD_PP3300, /* PMIC -> PP3300_PG_OD */ + X86_PGOOD_PP5000, /* PMIC -> PP5000_PG_OD */ + + /* Number of X86 signals */ + POWER_SIGNAL_COUNT +}; + #endif /* __CROS_EC_APOLLOLAKE_H */ diff --git a/power/cometlake.c b/power/cometlake.c index ec0052ff85..32363a5f34 100644 --- a/power/cometlake.c +++ b/power/cometlake.c @@ -5,7 +5,6 @@ /* Cometlake chipset power control module for Chrome EC */ -#include "cometlake.h" #include "chipset.h" #include "console.h" #include "gpio.h" @@ -18,6 +17,41 @@ /* Console output macros */ #define CPRINTS(format, args...) cprints(CC_CHIPSET, format, ## args) +/* Power signals list. Must match order of enum power_signal. */ +const struct power_signal_info power_signal_list[] = { + [X86_SLP_S0_DEASSERTED] = { + GPIO_PCH_SLP_S0_L, + POWER_SIGNAL_ACTIVE_HIGH | POWER_SIGNAL_DISABLE_AT_BOOT, + "SLP_S0_DEASSERTED", + }, + [X86_SLP_S3_DEASSERTED] = { + SLP_S3_SIGNAL_L, + POWER_SIGNAL_ACTIVE_HIGH, + "SLP_S3_DEASSERTED", + }, + [X86_SLP_S4_DEASSERTED] = { + SLP_S4_SIGNAL_L, + POWER_SIGNAL_ACTIVE_HIGH, + "SLP_S4_DEASSERTED", + }, + [X86_RSMRST_L_PGOOD] = { + GPIO_RSMRST_L_PGOOD, + POWER_SIGNAL_ACTIVE_HIGH, + "RSMRST_L_PGOOD", + }, + [PP5000_A_PGOOD] = { + GPIO_PP5000_A_PG_OD, + POWER_SIGNAL_ACTIVE_HIGH, + "PP5000_A_PGOOD", + }, + [ALL_SYS_PGOOD] = { + GPIO_PG_EC_ALL_SYS_PWRGD, + POWER_SIGNAL_ACTIVE_HIGH, + "ALL_SYS_PWRGD", + }, +}; +BUILD_ASSERT(ARRAY_SIZE(power_signal_list) == POWER_SIGNAL_COUNT); + static int forcing_shutdown; /* Forced shutdown in progress? */ void chipset_force_shutdown(enum chipset_shutdown_reason reason) diff --git a/power/cometlake.h b/power/cometlake.h index c40562da17..5c9762ca58 100644 --- a/power/cometlake.h +++ b/power/cometlake.h @@ -26,4 +26,17 @@ #define CHARGER_INITIALIZED_DELAY_MS 100 #define CHARGER_INITIALIZED_TRIES 40 +/* Power signals list */ +enum power_signal { + X86_SLP_S0_DEASSERTED, + X86_SLP_S3_DEASSERTED, + X86_SLP_S4_DEASSERTED, + X86_RSMRST_L_PGOOD, + PP5000_A_PGOOD, + ALL_SYS_PGOOD, + + /* Number of X86 signals */ + POWER_SIGNAL_COUNT +}; + #endif /* __CROS_EC_COMETLAKE_H */ diff --git a/power/common.c b/power/common.c index 6d7fb7869d..f33e589d4f 100644 --- a/power/common.c +++ b/power/common.c @@ -11,17 +11,18 @@ #include "common.h" #include "console.h" #include "display_7seg.h" +#include "espi.h" #include "extpower.h" #include "gpio.h" #include "hooks.h" #include "host_command.h" +#include "intel_x86.h" #include "lpc.h" #include "power.h" #include "system.h" #include "task.h" #include "timer.h" #include "util.h" -#include "espi.h" /* Console output macros */ #define CPUTS(outstr) cputs(CC_CHIPSET, outstr) diff --git a/power/icelake.c b/power/icelake.c index 86f0f7e459..27a8b60c97 100644 --- a/power/icelake.c +++ b/power/icelake.c @@ -5,7 +5,6 @@ /* Icelake chipset power control module for Chrome EC */ -#include "icelake.h" #include "chipset.h" #include "console.h" #include "gpio.h" @@ -23,6 +22,41 @@ static int forcing_shutdown; /* Forced shutdown in progress? */ +/* Power signals list. Must match order of enum power_signal. */ +const struct power_signal_info power_signal_list[] = { + [X86_SLP_S0_DEASSERTED] = { + GPIO_PCH_SLP_S0_L, + POWER_SIGNAL_ACTIVE_HIGH | POWER_SIGNAL_DISABLE_AT_BOOT, + "SLP_S0_DEASSERTED", + }, + [X86_SLP_S3_DEASSERTED] = { + SLP_S3_SIGNAL_L, + POWER_SIGNAL_ACTIVE_HIGH, + "SLP_S3_DEASSERTED", + }, + [X86_SLP_S4_DEASSERTED] = { + SLP_S4_SIGNAL_L, + POWER_SIGNAL_ACTIVE_HIGH, + "SLP_S4_DEASSERTED", + }, + [X86_SLP_SUS_DEASSERTED] = { + GPIO_SLP_SUS_L, + POWER_SIGNAL_ACTIVE_HIGH, + "SLP_SUS_DEASSERTED", + }, + [X86_RSMRST_L_PGOOD] = { + GPIO_PG_EC_RSMRST_ODL, + POWER_SIGNAL_ACTIVE_HIGH, + "RSMRST_L_PGOOD", + }, + [X86_DSW_DPWROK] = { + GPIO_PG_EC_DSW_PWROK, + POWER_SIGNAL_ACTIVE_HIGH, + "DSW_DPWROK", + }, +}; +BUILD_ASSERT(ARRAY_SIZE(power_signal_list) == POWER_SIGNAL_COUNT); + void chipset_force_shutdown(enum chipset_shutdown_reason reason) { int timeout_ms = 50; diff --git a/power/icelake.h b/power/icelake.h index f28e1d71dd..5eeb3fb037 100644 --- a/power/icelake.h +++ b/power/icelake.h @@ -26,4 +26,17 @@ #define CHARGER_INITIALIZED_DELAY_MS 100 #define CHARGER_INITIALIZED_TRIES 40 +/* Power signals list */ +enum power_signal { + X86_SLP_S0_DEASSERTED, + X86_SLP_S3_DEASSERTED, + X86_SLP_S4_DEASSERTED, + X86_SLP_SUS_DEASSERTED, + X86_RSMRST_L_PGOOD, + X86_DSW_DPWROK, + + /* Number of X86 signals */ + POWER_SIGNAL_COUNT +}; + #endif /* __CROS_EC_ICELAKE_H */ diff --git a/power/intel_x86.c b/power/intel_x86.c index 838935777f..f4be052443 100644 --- a/power/intel_x86.c +++ b/power/intel_x86.c @@ -10,7 +10,6 @@ #include "chipset.h" #include "console.h" #include "ec_commands.h" -#include "espi.h" #include "gpio.h" #include "hooks.h" #include "intel_x86.h" @@ -23,20 +22,6 @@ #include "vboot.h" #include "wireless.h" -/* Chipset specific header files */ -/* Geminilake and apollolake use same power sequencing. */ -#ifdef CONFIG_CHIPSET_APL_GLK -#include "apollolake.h" -#elif defined(CONFIG_CHIPSET_CANNONLAKE) -#include "cannonlake.h" -#elif defined(CONFIG_CHIPSET_COMETLAKE) -#include "cometlake.h" -#elif defined(CONFIG_CHIPSET_ICELAKE) -#include "icelake.h" -#elif defined(CONFIG_CHIPSET_SKYLAKE) -#include "skylake.h" -#endif - /* Console output macros */ #define CPRINTS(format, args...) cprints(CC_CHIPSET, format, ## args) #define CPRINTF(format, args...) cprintf(CC_CHIPSET, format, ## args) @@ -50,13 +35,8 @@ enum sys_sleep_state { }; static const int sleep_sig[] = { -#ifdef CONFIG_HOSTCMD_ESPI_VW_SLP_SIGNALS - [SYS_SLEEP_S3] = VW_SLP_S3_L, - [SYS_SLEEP_S4] = VW_SLP_S4_L, -#else - [SYS_SLEEP_S3] = GPIO_PCH_SLP_S3_L, - [SYS_SLEEP_S4] = GPIO_PCH_SLP_S4_L, -#endif + [SYS_SLEEP_S3] = SLP_S3_SIGNAL_L, + [SYS_SLEEP_S4] = SLP_S4_SIGNAL_L, #ifdef CONFIG_POWER_S0IX [SYS_SLEEP_S0IX] = GPIO_PCH_SLP_S0_L, #endif diff --git a/power/intel_x86.h b/power/intel_x86.h index bfbf89538c..452b033838 100644 --- a/power/intel_x86.h +++ b/power/intel_x86.h @@ -9,8 +9,32 @@ #ifndef __CROS_EC_INTEL_X86_H #define __CROS_EC_INTEL_X86_H +#include "espi.h" #include "power.h" +/* Chipset specific header files */ +/* Geminilake and apollolake use same power sequencing. */ +#ifdef CONFIG_CHIPSET_APL_GLK +#include "apollolake.h" +#elif defined(CONFIG_CHIPSET_CANNONLAKE) +#include "cannonlake.h" +#elif defined(CONFIG_CHIPSET_COMETLAKE) +#include "cometlake.h" +#elif defined(CONFIG_CHIPSET_ICELAKE) +#include "icelake.h" +#elif defined(CONFIG_CHIPSET_SKYLAKE) +#include "skylake.h" +#endif + +/* GPIO for power signal */ +#ifdef CONFIG_HOSTCMD_ESPI_VW_SLP_SIGNALS +#define SLP_S3_SIGNAL_L VW_SLP_S3_L +#define SLP_S4_SIGNAL_L VW_SLP_S4_L +#else +#define SLP_S3_SIGNAL_L GPIO_PCH_SLP_S3_L +#define SLP_S4_SIGNAL_L GPIO_PCH_SLP_S4_L +#endif + /** * Handle RSMRST signal. * diff --git a/power/skylake.c b/power/skylake.c index a5cf6aa0a5..ce6b823b5e 100644 --- a/power/skylake.c +++ b/power/skylake.c @@ -13,7 +13,6 @@ #include "lpc.h" #include "panic.h" #include "power_button.h" -#include "skylake.h" #include "system.h" #include "timer.h" @@ -22,6 +21,43 @@ static int forcing_shutdown; /* Forced shutdown in progress? */ +/* Power signals list. Must match order of enum power_signal. */ +const struct power_signal_info power_signal_list[] = { +#ifdef CONFIG_POWER_S0IX + [X86_SLP_S0_DEASSERTED] = { + GPIO_PCH_SLP_S0_L, + POWER_SIGNAL_ACTIVE_HIGH | POWER_SIGNAL_DISABLE_AT_BOOT, + "SLP_S0_DEASSERTED", + }, +#endif + [X86_SLP_S3_DEASSERTED] = { + SLP_S3_SIGNAL_L, + POWER_SIGNAL_ACTIVE_HIGH, + "SLP_S3_DEASSERTED", + }, + [X86_SLP_S4_DEASSERTED] = { + SLP_S4_SIGNAL_L, + POWER_SIGNAL_ACTIVE_HIGH, + "SLP_S4_DEASSERTED", + }, + [X86_SLP_SUS_DEASSERTED] = { + GPIO_PCH_SLP_SUS_L, + POWER_SIGNAL_ACTIVE_HIGH, + "SLP_SUS_DEASSERTED", + }, + [X86_RSMRST_L_PWRGD] = { + GPIO_RSMRST_L_PGOOD, + POWER_SIGNAL_ACTIVE_HIGH, + "RSMRST_N_PWRGD", + }, + [X86_PMIC_DPWROK] = { + GPIO_PMIC_DPWROK, + POWER_SIGNAL_ACTIVE_HIGH, + "PMIC_DPWROK", + }, +}; +BUILD_ASSERT(ARRAY_SIZE(power_signal_list) == POWER_SIGNAL_COUNT); + void chipset_force_shutdown(enum chipset_shutdown_reason reason) { diff --git a/power/skylake.h b/power/skylake.h index 431cccf836..c8a656c6c5 100644 --- a/power/skylake.h +++ b/power/skylake.h @@ -33,6 +33,21 @@ #define CHARGER_INITIALIZED_DELAY_MS 100 #define CHARGER_INITIALIZED_TRIES 40 +/* Power signals list */ +enum power_signal { +#ifdef CONFIG_POWER_S0IX + X86_SLP_S0_DEASSERTED, +#endif + X86_SLP_S3_DEASSERTED, + X86_SLP_S4_DEASSERTED, + X86_SLP_SUS_DEASSERTED, + X86_RSMRST_L_PWRGD, + X86_PMIC_DPWROK, + + /* Number of X86 signals */ + POWER_SIGNAL_COUNT +}; + /* * Board can define this function to indicate to the skylake * power code that it does not have working reset flags. |