From 8adc624080ac8af063e9a18b9b4273826f7aff9d Mon Sep 17 00:00:00 2001 From: Jack Rosenthal Date: Thu, 18 Mar 2021 10:19:59 -0600 Subject: 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 Change-Id: I860088360480946b644fd1bb276a29266c57c614 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2774368 Reviewed-by: Simon Glass Reviewed-by: Wai-Hong Tam --- zephyr/projects/trogdor/lazor/include/gpio_map.h | 30 +++++++++++++++++++----- zephyr/projects/trogdor/lazor/prj.conf | 5 ++++ 2 files changed, 29 insertions(+), 6 deletions(-) (limited to 'zephyr/projects/trogdor') 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 #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 -- cgit v1.2.1