summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJack Rosenthal <jrosenth@chromium.org>2021-02-16 15:33:59 -0700
committerCommit Bot <commit-bot@chromium.org>2021-03-02 17:51:04 +0000
commit3070dd3bf817a8bf32e9aeec26cc20f6545cbe9c (patch)
tree9279a033f52921cf007d20806f3eb789e451ce47
parentb3fc5760c5b8b74766eeb771275a6e2b0441c0f5 (diff)
downloadchrome-ec-3070dd3bf817a8bf32e9aeec26cc20f6545cbe9c.tar.gz
zephyr: delbin: enable power sequencing
Bring up power sequencing for delbin. BUG=b:180410072 BRANCH=none TEST=boot ChromeOS Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: If5955eeac158cc4ad06cec80eed612a08e815b4e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2699534 Reviewed-by: Keith Short <keithshort@chromium.org>
-rw-r--r--zephyr/projects/delbin/CMakeLists.txt15
-rw-r--r--zephyr/projects/delbin/include/gpio_map.h37
-rw-r--r--zephyr/projects/delbin/prj.conf6
3 files changed, 57 insertions, 1 deletions
diff --git a/zephyr/projects/delbin/CMakeLists.txt b/zephyr/projects/delbin/CMakeLists.txt
index b7330162de..059ab77018 100644
--- a/zephyr/projects/delbin/CMakeLists.txt
+++ b/zephyr/projects/delbin/CMakeLists.txt
@@ -7,4 +7,19 @@ cmake_minimum_required(VERSION 3.13.1)
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(delbin)
+set(PLATFORM_EC_BOARD "${PLATFORM_EC}/board/delbin" CACHE PATH
+ "Path to the platform/ec board directory")
+set(PLATFORM_EC_BASEBOARD "${PLATFORM_EC}/baseboard/volteer" CACHE PATH
+ "Path to the platform/ec baseboard directory")
+
+# Include board specific header files
+zephyr_include_directories(
+ include
+ "${PLATFORM_EC_BASEBOARD}"
+ "${PLATFORM_EC_BOARD}")
+
+# Include selected EC source for the baseboard
+zephyr_sources_ifdef(CONFIG_PLATFORM_EC_POWERSEQ
+ "${PLATFORM_EC_BASEBOARD}/power.c")
+
zephyr_include_directories(include)
diff --git a/zephyr/projects/delbin/include/gpio_map.h b/zephyr/projects/delbin/include/gpio_map.h
index cc38970187..b697abc11d 100644
--- a/zephyr/projects/delbin/include/gpio_map.h
+++ b/zephyr/projects/delbin/include/gpio_map.h
@@ -10,12 +10,40 @@
#include <gpio_signal.h>
#define GPIO_AC_PRESENT NAMED_GPIO(acok_od)
+#define GPIO_CPU_PROCHOT NAMED_GPIO(ec_prochot_odl)
+#define GPIO_EC_PCH_SYS_PWROK NAMED_GPIO(ec_pch_sys_pwrok)
#define GPIO_EC_PCH_WAKE_ODL NAMED_GPIO(ec_pch_wake_odl)
+#define GPIO_EC_PROCHOT_IN_L NAMED_GPIO(ec_prochot_in_l)
#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_EN_PPVAR_VCCIN NAMED_GPIO(en_ppvar_vccin)
#define GPIO_LID_OPEN NAMED_GPIO(ec_lid_open)
+#define GPIO_PCH_PWRBTN_L NAMED_GPIO(ec_pch_pwr_btn_odl)
+#define GPIO_PCH_RSMRST_L NAMED_GPIO(ec_pch_rsmrst_odl)
+#define GPIO_PCH_RTCRST NAMED_GPIO(ec_pch_rtcrst)
+#define GPIO_PCH_SLP_S0_L NAMED_GPIO(slp_s0_l)
+#define GPIO_PCH_SLP_S3_L NAMED_GPIO(slp_s3_l)
+#define GPIO_PCH_DSW_PWROK GPIO_UNIMPLEMENTED
+#define GPIO_PG_EC_ALL_SYS_PWRGD NAMED_GPIO(pg_ec_all_sys_pwrgd)
+#define GPIO_PG_EC_DSW_PWROK NAMED_GPIO(dsw_pwrok)
+#define GPIO_PG_EC_RSMRST_ODL NAMED_GPIO(pg_ec_rsmrst_odl)
#define GPIO_POWER_BUTTON_L NAMED_GPIO(h1_ec_pwr_btn_odl)
+#define GPIO_RSMRST_L_PGOOD NAMED_GPIO(pg_ec_rsmrst_odl)
+#define GPIO_SLP_SUS_L NAMED_GPIO(slp_sus_l)
+#define GPIO_SYS_RESET_L NAMED_GPIO(sys_rst_odl)
#define GPIO_WP_L NAMED_GPIO(ec_wp_l)
+#ifdef CONFIG_PLATFORM_EC_POWERSEQ
+#define POWER_SIGNAL_INT(gpio, edge) \
+ GPIO_INT(gpio, edge, power_signal_interrupt)
+#define AP_PROCHOT_INT(gpio, edge) \
+ GPIO_INT(gpio, edge, throttle_ap_prochot_input_interrupt)
+#else
+#define POWER_SIGNAL_INT(gpio, edge)
+#define AP_PROCHOT_INT(gpio, edge)
+#endif
+
/*
* Set EC_CROS_GPIO_INTERRUPTS to a space-separated list of GPIO_INT items.
*
@@ -36,6 +64,13 @@
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_WP_L, GPIO_INT_EDGE_BOTH, switch_interrupt)
+ GPIO_INT(GPIO_WP_L, GPIO_INT_EDGE_BOTH, switch_interrupt) \
+ POWER_SIGNAL_INT(GPIO_PCH_SLP_S0_L, GPIO_INT_EDGE_BOTH) \
+ POWER_SIGNAL_INT(GPIO_PCH_SLP_S3_L, GPIO_INT_EDGE_BOTH) \
+ POWER_SIGNAL_INT(GPIO_PG_EC_DSW_PWROK, GPIO_INT_EDGE_BOTH) \
+ POWER_SIGNAL_INT(GPIO_PG_EC_RSMRST_ODL, GPIO_INT_EDGE_BOTH) \
+ POWER_SIGNAL_INT(GPIO_PG_EC_ALL_SYS_PWRGD, GPIO_INT_EDGE_BOTH) \
+ POWER_SIGNAL_INT(GPIO_SLP_SUS_L, GPIO_INT_EDGE_BOTH) \
+ AP_PROCHOT_INT(GPIO_EC_PROCHOT_IN_L, GPIO_INT_EDGE_BOTH)
#endif /* __ZEPHYR_GPIO_MAP_H */
diff --git a/zephyr/projects/delbin/prj.conf b/zephyr/projects/delbin/prj.conf
index e52e451622..fbb304c0c9 100644
--- a/zephyr/projects/delbin/prj.conf
+++ b/zephyr/projects/delbin/prj.conf
@@ -16,6 +16,12 @@ CONFIG_PLATFORM_EC_EXTPOWER_GPIO=y
CONFIG_PLATFORM_EC_LID_SWITCH=y
CONFIG_PLATFORM_EC_POWER_BUTTON=y
+# Power sequencing
+CONFIG_AP=y
+CONFIG_AP_X86_INTEL_TGL=y
+CONFIG_PLATFORM_EC_POWERSEQ=y
+CONFIG_PLATFORM_EC_POWERSEQ_RTC_RESET=y
+
# TODO(b/180410072): bringup these features
CONFIG_PLATFORM_EC_BACKLIGHT_LID=n
CONFIG_PLATFORM_EC_BOARD_VERSION=n