summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--zephyr/program/nissa/CMakeLists.txt4
-rw-r--r--zephyr/program/nissa/Kconfig9
-rw-r--r--zephyr/program/nissa/src/common.c10
-rw-r--r--zephyr/program/nissa/src/sub_board.c10
4 files changed, 21 insertions, 12 deletions
diff --git a/zephyr/program/nissa/CMakeLists.txt b/zephyr/program/nissa/CMakeLists.txt
index 101146507b..967fff2229 100644
--- a/zephyr/program/nissa/CMakeLists.txt
+++ b/zephyr/program/nissa/CMakeLists.txt
@@ -8,7 +8,7 @@ find_package(Zephyr REQUIRED HINTS "${ZEPHYR_BASE}")
zephyr_include_directories(include)
zephyr_library_sources("src/common.c")
-zephyr_library_sources("src/sub_board.c")
+zephyr_library_sources_ifdef(CONFIG_NISSA_SUB_BOARD "src/sub_board.c")
zephyr_library_sources_ifdef(CONFIG_AP_PWRSEQ "src/board_power.c")
if(DEFINED CONFIG_BOARD_NIVVIKS)
@@ -96,4 +96,4 @@ if(DEFINED CONFIG_BOARD_XIVUR)
zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_FAN "xivur/src/fan.c")
zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_USBC "xivur/src/usbc.c")
zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_CHARGER "xivur/src/charger.c")
-endif() \ No newline at end of file
+endif()
diff --git a/zephyr/program/nissa/Kconfig b/zephyr/program/nissa/Kconfig
index 2eb694577d..a7fb4c666a 100644
--- a/zephyr/program/nissa/Kconfig
+++ b/zephyr/program/nissa/Kconfig
@@ -2,6 +2,15 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+config NISSA_SUB_BOARD
+ bool "Nissa sub-board support"
+ default y
+ help
+ Enable the sub-board support for Nissa boards.
+ This uses a common fw_config bitfield to select
+ one of a number of option sub-boards with different
+ hardware configurations.
+
config BOARD_NIVVIKS
bool "Google Nivviks Board"
help
diff --git a/zephyr/program/nissa/src/common.c b/zephyr/program/nissa/src/common.c
index 155dc541d4..d437bfca47 100644
--- a/zephyr/program/nissa/src/common.c
+++ b/zephyr/program/nissa/src/common.c
@@ -187,3 +187,13 @@ __override int pd_is_valid_input_voltage(int mv)
return true;
}
#endif
+
+/* Trigger shutdown by enabling the Z-sleep circuit */
+__override void board_hibernate_late(void)
+{
+ gpio_pin_set_dt(GPIO_DT_FROM_NODELABEL(gpio_en_slp_z), 1);
+ /*
+ * The system should hibernate, but there may be
+ * a small delay, so return.
+ */
+}
diff --git a/zephyr/program/nissa/src/sub_board.c b/zephyr/program/nissa/src/sub_board.c
index 830e361ac1..e8e9648ba6 100644
--- a/zephyr/program/nissa/src/sub_board.c
+++ b/zephyr/program/nissa/src/sub_board.c
@@ -286,13 +286,3 @@ static void board_init(void)
#endif
}
DECLARE_HOOK(HOOK_INIT, board_init, HOOK_PRIO_DEFAULT);
-
-/* Trigger shutdown by enabling the Z-sleep circuit */
-__override void board_hibernate_late(void)
-{
- gpio_pin_set_dt(GPIO_DT_FROM_NODELABEL(gpio_en_slp_z), 1);
- /*
- * The system should hibernate, but there may be
- * a small delay, so return.
- */
-}