diff options
-rw-r--r-- | baseboard/trogdor/baseboard.c | 29 | ||||
-rw-r--r-- | baseboard/trogdor/baseboard.h | 15 | ||||
-rw-r--r-- | include/power/sc7180.h | 21 | ||||
-rw-r--r-- | power/common.c | 1 | ||||
-rw-r--r-- | power/sc7180.c | 36 | ||||
-rw-r--r-- | zephyr/shim/include/config_chip.h | 4 |
6 files changed, 62 insertions, 44 deletions
diff --git a/baseboard/trogdor/baseboard.c b/baseboard/trogdor/baseboard.c index affd121057..4f457de254 100644 --- a/baseboard/trogdor/baseboard.c +++ b/baseboard/trogdor/baseboard.c @@ -30,35 +30,6 @@ void board_hibernate_late(void) gpio_set_level(GPIO_HIBERNATE_L, 0); } -/* Power signal list. Must match order of enum power_signal. */ -const struct power_signal_info power_signal_list[] = { - [SC7180_AP_RST_ASSERTED] = { - GPIO_AP_RST_L, - POWER_SIGNAL_ACTIVE_LOW | POWER_SIGNAL_DISABLE_AT_BOOT, - "AP_RST_ASSERTED"}, - [SC7180_PS_HOLD] = { - GPIO_PS_HOLD, - POWER_SIGNAL_ACTIVE_HIGH, - "PS_HOLD"}, - [SC7180_POWER_GOOD] = { - GPIO_POWER_GOOD, - POWER_SIGNAL_ACTIVE_HIGH, - "POWER_GOOD"}, - [SC7180_WARM_RESET] = { - GPIO_WARM_RESET_L, - POWER_SIGNAL_ACTIVE_HIGH, - "WARM_RESET_L"}, - [SC7180_AP_SUSPEND] = { - GPIO_AP_SUSPEND, - POWER_SIGNAL_ACTIVE_HIGH, - "AP_SUSPEND"}, - [SC7180_DEPRECATED_AP_RST_REQ] = { - GPIO_DEPRECATED_AP_RST_REQ, - POWER_SIGNAL_ACTIVE_HIGH, - "DEPRECATED_AP_RST_REQ"}, -}; -BUILD_ASSERT(ARRAY_SIZE(power_signal_list) == POWER_SIGNAL_COUNT); - const struct charger_config_t chg_chips[] = { { .i2c_port = I2C_PORT_CHARGER, diff --git a/baseboard/trogdor/baseboard.h b/baseboard/trogdor/baseboard.h index 83d5438e5b..8e3dbe4b1e 100644 --- a/baseboard/trogdor/baseboard.h +++ b/baseboard/trogdor/baseboard.h @@ -216,19 +216,4 @@ BIT(EC_MKBP_EVENT_SENSOR_FIFO)) #endif -#ifndef __ASSEMBLER__ - -enum power_signal { - SC7180_AP_RST_ASSERTED = 0, - SC7180_PS_HOLD, - SC7180_POWER_GOOD, - SC7180_WARM_RESET, - SC7180_AP_SUSPEND, - SC7180_DEPRECATED_AP_RST_REQ, - /* Number of power signals */ - POWER_SIGNAL_COUNT -}; - -#endif /* !defined(__ASSEMBLER__) */ - #endif /* __CROS_EC_BASEBOARD_H */ diff --git a/include/power/sc7180.h b/include/power/sc7180.h new file mode 100644 index 0000000000..4b61fe539c --- /dev/null +++ b/include/power/sc7180.h @@ -0,0 +1,21 @@ +/* Copyright 2021 The Chromium OS Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +#ifndef __CROS_EC_POWER_SC7180_H_ +#define __CROS_EC_POWER_SC7180_H_ + +#ifdef CONFIG_CHIPSET_SC7180 +enum power_signal { + SC7180_AP_RST_ASSERTED = 0, + SC7180_PS_HOLD, + SC7180_POWER_GOOD, + SC7180_WARM_RESET, + SC7180_AP_SUSPEND, + SC7180_DEPRECATED_AP_RST_REQ, + POWER_SIGNAL_COUNT, +}; +#endif + +#endif /* __CROS_EC_POWER_SC7180_H_ */ diff --git a/power/common.c b/power/common.c index 1ea6439563..34b5cd7b57 100644 --- a/power/common.c +++ b/power/common.c @@ -19,6 +19,7 @@ #include "lpc.h" #include "power.h" #include "power/intel_x86.h" +#include "power/sc7180.h" #include "system.h" #include "task.h" #include "timer.h" diff --git a/power/sc7180.c b/power/sc7180.c index c35d484213..81892c2894 100644 --- a/power/sc7180.c +++ b/power/sc7180.c @@ -29,6 +29,7 @@ #include "hooks.h" #include "lid_switch.h" #include "power.h" +#include "power/sc7180.h" #include "power_button.h" #include "system.h" #include "task.h" @@ -36,6 +37,41 @@ #define CPRINTS(format, args...) cprints(CC_CHIPSET, format, ## args) +/* Power signal list. Must match order of enum power_signal. */ +const struct power_signal_info power_signal_list[] = { + [SC7180_AP_RST_ASSERTED] = { + GPIO_AP_RST_L, + POWER_SIGNAL_ACTIVE_LOW | POWER_SIGNAL_DISABLE_AT_BOOT, + "AP_RST_ASSERTED", + }, + [SC7180_PS_HOLD] = { + GPIO_PS_HOLD, + POWER_SIGNAL_ACTIVE_HIGH, + "PS_HOLD", + }, + [SC7180_POWER_GOOD] = { + GPIO_POWER_GOOD, + POWER_SIGNAL_ACTIVE_HIGH, + "POWER_GOOD", + }, + [SC7180_WARM_RESET] = { + GPIO_WARM_RESET_L, + POWER_SIGNAL_ACTIVE_HIGH, + "WARM_RESET_L", + }, + [SC7180_AP_SUSPEND] = { + GPIO_AP_SUSPEND, + POWER_SIGNAL_ACTIVE_HIGH, + "AP_SUSPEND", + }, + [SC7180_DEPRECATED_AP_RST_REQ] = { + GPIO_DEPRECATED_AP_RST_REQ, + POWER_SIGNAL_ACTIVE_HIGH, + "DEPRECATED_AP_RST_REQ", + }, +}; +BUILD_ASSERT(ARRAY_SIZE(power_signal_list) == POWER_SIGNAL_COUNT); + /* Masks for power signals */ #define IN_POWER_GOOD POWER_SIGNAL_MASK(SC7180_POWER_GOOD) #define IN_AP_RST_ASSERTED POWER_SIGNAL_MASK(SC7180_AP_RST_ASSERTED) diff --git a/zephyr/shim/include/config_chip.h b/zephyr/shim/include/config_chip.h index b1c021fc4f..5b5792314e 100644 --- a/zephyr/shim/include/config_chip.h +++ b/zephyr/shim/include/config_chip.h @@ -93,6 +93,10 @@ #define HOOK_TICK_INTERVAL_MS (HOOK_TICK_INTERVAL / 1000) /* Chipset and power configuration */ +#ifdef CONFIG_AP_ARM_QUALCOMM_SC7180 +#define CONFIG_CHIPSET_SC7180 +#endif + #ifdef CONFIG_AP_X86_INTEL_CML #define CONFIG_CHIPSET_COMETLAKE #define CONFIG_CHIPSET_HAS_PRE_INIT_CALLBACK |