summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Barnes <robbarnes@google.com>2022-08-15 13:40:16 +0000
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-08-16 21:08:30 +0000
commita50aa9c82256c784ef4b85e53a24c82f4973f3c9 (patch)
treecd0a7f71eabd1b673bbb9b2e64bc2b291a7fb4f3
parent40e0183a6ab68e5d22528bdf6d54c52dc95f2589 (diff)
downloadchrome-ec-a50aa9c82256c784ef4b85e53a24c82f4973f3c9.tar.gz
skyrim: Register common skyrim logging module
Declare a common skryim logging module and register it in skyrim/common.c. A logging module must be registered exactly once. The current code only compiles because logging is not currently enabled on skyrim. BUG=None BRANCH=None TEST=Boot skyrim Change-Id: I996a2658cf6bbc590daaf067e36130ede5c0d0a6 Signed-off-by: Rob Barnes <robbarnes@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3830282 Reviewed-by: Diana Z <dzigterman@chromium.org>
-rw-r--r--zephyr/projects/skyrim/CMakeLists.txt2
-rw-r--r--zephyr/projects/skyrim/Kconfig4
-rw-r--r--zephyr/projects/skyrim/common.c8
3 files changed, 14 insertions, 0 deletions
diff --git a/zephyr/projects/skyrim/CMakeLists.txt b/zephyr/projects/skyrim/CMakeLists.txt
index 74197d1373..b63c8af5c5 100644
--- a/zephyr/projects/skyrim/CMakeLists.txt
+++ b/zephyr/projects/skyrim/CMakeLists.txt
@@ -9,6 +9,8 @@ project(skyrim)
cros_ec_library_include_directories_ifdef(CONFIG_BOARD_SKYRIM include)
+zephyr_library_sources_ifdef(CONFIG_BOARD_SKYRIM "common.c")
+
zephyr_library_sources_ifdef(CONFIG_BOARD_SKYRIM "power_signals.c")
zephyr_library_sources_ifdef(CONFIG_BOARD_SKYRIM "usbc_config.c")
diff --git a/zephyr/projects/skyrim/Kconfig b/zephyr/projects/skyrim/Kconfig
index 6da27ee2d0..0573c3c73a 100644
--- a/zephyr/projects/skyrim/Kconfig
+++ b/zephyr/projects/skyrim/Kconfig
@@ -2,6 +2,10 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+module = SKYRIM
+module-str = Skyrim board-specific code
+source "subsys/logging/Kconfig.template.log_config"
+
config BOARD_SKYRIM
bool "Google Skyrim Board"
help
diff --git a/zephyr/projects/skyrim/common.c b/zephyr/projects/skyrim/common.c
new file mode 100644
index 0000000000..5a0e03a665
--- /dev/null
+++ b/zephyr/projects/skyrim/common.c
@@ -0,0 +1,8 @@
+/* Copyright 2022 The ChromiumOS Authors.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#include <zephyr/logging/log.h>
+
+LOG_MODULE_REGISTER(skyrim, CONFIG_SKYRIM_LOG_LEVEL);