diff options
author | Jack Rosenthal <jrosenth@chromium.org> | 2021-03-18 10:19:59 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-03-22 07:32:54 +0000 |
commit | 8adc624080ac8af063e9a18b9b4273826f7aff9d (patch) | |
tree | dc17395d31960d48a5b72917ea634b19657415de | |
parent | 54c452f2568059199b97b59b59adc58f3b6359d2 (diff) | |
download | chrome-ec-8adc624080ac8af063e9a18b9b4273826f7aff9d.tar.gz |
zephyr: lazor: enable power sequencing
Enable SC7180 power sequencing code.
Currently, depthcharge starts and then times out on some host
commands, and the AP issues a reboot. We're going to need the SPI
host interface up and going in Zephyr to get any further, so may as
well submit this for now.
BUG=b:183054226
BRANCH=none
TEST=used serial firmware to verify that depthcharge starts, times out
on some host commands, and then reboots
Signed-off-by: Jack Rosenthal <jrosenth@chromium.org>
Change-Id: I860088360480946b644fd1bb276a29266c57c614
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2774368
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Wai-Hong Tam <waihong@google.com>
-rw-r--r-- | zephyr/CMakeLists.txt | 2 | ||||
-rw-r--r-- | zephyr/Kconfig.powerseq | 8 | ||||
-rw-r--r-- | zephyr/projects/trogdor/lazor/include/gpio_map.h | 30 | ||||
-rw-r--r-- | zephyr/projects/trogdor/lazor/prj.conf | 5 |
4 files changed, 39 insertions, 6 deletions
diff --git a/zephyr/CMakeLists.txt b/zephyr/CMakeLists.txt index 5078537dc1..58e908bc06 100644 --- a/zephyr/CMakeLists.txt +++ b/zephyr/CMakeLists.txt @@ -259,6 +259,8 @@ zephyr_sources_ifdef(CONFIG_PLATFORM_EC_POWERSEQ_INTEL "${PLATFORM_EC}/power/intel_x86.c") zephyr_sources_ifdef(CONFIG_PLATFORM_EC_POWERSEQ_HOST_SLEEP "${PLATFORM_EC}/power/host_sleep.c") +zephyr_sources_ifdef(CONFIG_PLATFORM_EC_POWERSEQ_SC7180 + "${PLATFORM_EC}/power/sc7180.c") zephyr_sources_ifdef(CONFIG_PLATFORM_EC_PANIC "${PLATFORM_EC}/common/panic_output.c") zephyr_sources_ifdef(CONFIG_PLATFORM_EC_PWM "${PLATFORM_EC}/common/pwm.c") zephyr_sources_ifdef(CONFIG_PLATFORM_EC_SHA256_SW diff --git a/zephyr/Kconfig.powerseq b/zephyr/Kconfig.powerseq index c01a6742c8..df83d0ae82 100644 --- a/zephyr/Kconfig.powerseq +++ b/zephyr/Kconfig.powerseq @@ -125,4 +125,12 @@ endif # PLATFORM_EC_POWERSEQ_ICELAKE endif # PLATFORM_EC_POWERSEQ_INTEL +config PLATFORM_EC_POWERSEQ_SC7180 + bool "SC7180 power sequencing" + depends on AP_ARM_QUALCOMM_SC7180 + default y + help + Enable power sequencing for the Qualcomm Snapdragon SC7180 + chipset. + endif # PLATFORM_EC_POWERSEQ diff --git a/zephyr/projects/trogdor/lazor/include/gpio_map.h b/zephyr/projects/trogdor/lazor/include/gpio_map.h index 6981fa768e..7dcb60996a 100644 --- a/zephyr/projects/trogdor/lazor/include/gpio_map.h +++ b/zephyr/projects/trogdor/lazor/include/gpio_map.h @@ -10,19 +10,30 @@ #include <gpio_signal.h> #define GPIO_AC_PRESENT NAMED_GPIO(acok_od) +#define GPIO_AP_RST_L NAMED_GPIO(ap_rst_l) +#define GPIO_AP_SUSPEND NAMED_GPIO(ap_suspend) #define GPIO_BOARD_VERSION1 NAMED_GPIO(brd_id0) #define GPIO_BOARD_VERSION2 NAMED_GPIO(brd_id1) #define GPIO_BOARD_VERSION3 NAMED_GPIO(brd_id2) #define GPIO_DA9313_GPIO0 NAMED_GPIO(da9313_gpio0) +#define GPIO_DEPRECATED_AP_RST_REQ NAMED_GPIO(deprecated_ap_rst_req) #define GPIO_ENTERING_RW NAMED_GPIO(ec_entering_rw) +#define GPIO_EN_PP3300_A NAMED_GPIO(en_pp3300_a) +#define GPIO_EN_PP5000 NAMED_GPIO(en_pp5000_a) #define GPIO_LID_OPEN NAMED_GPIO(lid_open_ec) +#define GPIO_PMIC_KPD_PWR_ODL NAMED_GPIO(pmic_kpd_pwr_odl) +#define GPIO_PMIC_RESIN_L NAMED_GPIO(pm845_resin_l) #define GPIO_POWER_BUTTON_L NAMED_GPIO(ec_pwr_btn_odl) +#define GPIO_POWER_GOOD NAMED_GPIO(power_good) +#define GPIO_PS_HOLD NAMED_GPIO(ps_hold) +#define GPIO_QSIP_ON NAMED_GPIO(qsip_on) #define GPIO_SKU_ID0 NAMED_GPIO(sku_id0) #define GPIO_SKU_ID1 NAMED_GPIO(sku_id1) #define GPIO_SKU_ID2 NAMED_GPIO(sku_id2) #define GPIO_SWITCHCAP_ON NAMED_GPIO(switchcap_on) #define GPIO_SWITCHCAP_ON_L NAMED_GPIO(switchcap_on) #define GPIO_SWITCHCAP_PG_INT_L NAMED_GPIO(da9313_gpio0) +#define GPIO_WARM_RESET_L NAMED_GPIO(warm_reset_l) #define GPIO_WP_L NAMED_GPIO(ec_wp_odl) /* @@ -40,11 +51,18 @@ * #define EC_CROS_GPIO_INTERRUPTS \ * GPIO_INT(NAMED_GPIO(h1_ec_pwr_btn_odl), GPIO_INT_EDGE_BOTH, button_print) */ -#define EC_CROS_GPIO_INTERRUPTS \ - GPIO_INT(GPIO_AC_PRESENT, GPIO_INT_EDGE_BOTH, extpower_interrupt) \ - GPIO_INT(GPIO_LID_OPEN, GPIO_INT_EDGE_BOTH, lid_interrupt) \ - GPIO_INT(GPIO_POWER_BUTTON_L, GPIO_INT_EDGE_BOTH, \ - power_button_interrupt) \ - GPIO_INT(GPIO_SWITCHCAP_PG_INT_L, GPIO_INT_FALLING, ln9310_interrupt) +#define EC_CROS_GPIO_INTERRUPTS \ + GPIO_INT(GPIO_AC_PRESENT, GPIO_INT_EDGE_BOTH, extpower_interrupt) \ + GPIO_INT(GPIO_LID_OPEN, GPIO_INT_EDGE_BOTH, lid_interrupt) \ + GPIO_INT(GPIO_POWER_BUTTON_L, GPIO_INT_EDGE_BOTH, \ + power_button_interrupt) \ + GPIO_INT(GPIO_SWITCHCAP_PG_INT_L, GPIO_INT_FALLING, ln9310_interrupt) \ + GPIO_INT(GPIO_AP_RST_L, GPIO_INT_EDGE_BOTH, power_signal_interrupt) \ + GPIO_INT(GPIO_AP_SUSPEND, GPIO_INT_EDGE_BOTH, power_signal_interrupt) \ + GPIO_INT(GPIO_DEPRECATED_AP_RST_REQ, GPIO_INT_EDGE_BOTH, \ + power_signal_interrupt) \ + GPIO_INT(GPIO_POWER_GOOD, GPIO_INT_EDGE_BOTH, power_signal_interrupt) \ + GPIO_INT(GPIO_PS_HOLD, GPIO_INT_EDGE_BOTH, power_signal_interrupt) \ + GPIO_INT(GPIO_WARM_RESET_L, GPIO_INT_EDGE_BOTH, power_signal_interrupt) #endif /* __ZEPHYR_GPIO_MAP_H */ diff --git a/zephyr/projects/trogdor/lazor/prj.conf b/zephyr/projects/trogdor/lazor/prj.conf index 40798790c9..6973069d8a 100644 --- a/zephyr/projects/trogdor/lazor/prj.conf +++ b/zephyr/projects/trogdor/lazor/prj.conf @@ -23,6 +23,11 @@ CONFIG_PLATFORM_EC_BOARD_VERSION_GPIO=y # LN9310 Switchcap CONFIG_PLATFORM_EC_SWITCHCAP_LN9310=y +# Power Sequencing +CONFIG_PLATFORM_EC_POWERSEQ=y +CONFIG_PLATFORM_EC_POWERSEQ_HOST_SLEEP=y +CONFIG_PLATFORM_EC_CHIPSET_RESET_HOOK=y + # Trogdor family does not use EFS2 (toggled by PLATFORM_EC_VBOOT). CONFIG_PLATFORM_EC_VBOOT=n |