summaryrefslogtreecommitdiff
path: root/zephyr/drivers
diff options
context:
space:
mode:
authorJun Lin <CHLin56@nuvoton.com>2021-05-26 10:18:42 +0800
committerCommit Bot <commit-bot@chromium.org>2021-05-26 06:07:18 +0000
commit96aa4cd3557439f63f87a1c52cbb72428b6e2b5f (patch)
treecbb16ea9e98e955ce7eb21863901c8d1cc864e49 /zephyr/drivers
parent4f92b9c3b754735dfba03bc47d31539c3f73be76 (diff)
downloadchrome-ec-96aa4cd3557439f63f87a1c52cbb72428b6e2b5f.tar.gz
zephyr: cros_system_npcx: do jtag_init only when dbg node exists
With this CL, we can build the zephyr project even when the dbg node is not declared in the device tree. BRANCH=none BUG=none TEST=remove dbg node from npcx.dtsi, there is no build error reported. Signed-off-by: Jun Lin <CHLin56@nuvoton.com> Change-Id: I8c4ec1f81ba04e62d9b871b10d185d1244a2da6b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2918808 Reviewed-by: Yuval Peress <peress@chromium.org> Commit-Queue: Yuval Peress <peress@chromium.org> Tested-by: Yuval Peress <peress@chromium.org>
Diffstat (limited to 'zephyr/drivers')
-rw-r--r--zephyr/drivers/cros_system/cros_system_npcx.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/zephyr/drivers/cros_system/cros_system_npcx.c b/zephyr/drivers/cros_system/cros_system_npcx.c
index ee0a9135c9..9fecde6116 100644
--- a/zephyr/drivers/cros_system/cros_system_npcx.c
+++ b/zephyr/drivers/cros_system/cros_system_npcx.c
@@ -556,6 +556,7 @@ DEVICE_DEFINE(cros_system_npcx_0, "CROS_SYSTEM", cros_system_npcx_init, NULL,
CONFIG_CROS_SYSTEM_NPCX_INIT_PRIORITY,
&cros_system_driver_npcx_api);
+#if DT_NODE_EXISTS(DT_NODELABEL(dbg))
#define HAL_DBG_REG_BASE_ADDR \
((struct dbg_reg *)DT_REG_ADDR(DT_INST(0, nuvoton_npcx_cros_dbg)))
@@ -586,3 +587,4 @@ static int jtag_init(const struct device *dev)
#error "jtag_init must be called after default kernel init"
#endif
SYS_INIT(jtag_init, PRE_KERNEL_1, 41);
+#endif /* DT_NODE_EXISTS(DT_NODELABEL(dbg)) */