diff --git a/soc/realtek/ec/rts5912/CMakeLists.txt b/soc/realtek/ec/rts5912/CMakeLists.txt index 219c68e5a8d..a9e58c970ac 100644 --- a/soc/realtek/ec/rts5912/CMakeLists.txt +++ b/soc/realtek/ec/rts5912/CMakeLists.txt @@ -12,6 +12,6 @@ zephyr_sources_ifdef(CONFIG_PM power.c ) -zephyr_sources_ifdef(CONFIG_DT_HAS_SWJ_CONNECTOR_ENABLED debug_swj.c) +zephyr_sources_ifdef(CONFIG_RTS5912_DEBUG_SWJ debug_swj.c) set(SOC_LINKER_SCRIPT ${ZEPHYR_BASE}/include/zephyr/arch/arm/cortex_m/scripts/linker.ld CACHE INTERNAL "") diff --git a/soc/realtek/ec/rts5912/Kconfig b/soc/realtek/ec/rts5912/Kconfig index aebac7b3d00..c3a86e9b8e1 100644 --- a/soc/realtek/ec/rts5912/Kconfig +++ b/soc/realtek/ec/rts5912/Kconfig @@ -22,4 +22,11 @@ config RTS5912_ON_ENTER_CPU_IDLE_HOOK If needed, this hook can be used to prevent the CPU from actually entering sleep by skipping the WFE/WFI instruction. +config RTS5912_DEBUG_SWJ + bool "Serial wire JTAG" + default y + depends on DT_HAS_SWJ_CONNECTOR_ENABLED + help + Enables the serial wire JTAG connection on the RTS5912 EC. + endif # SOC_SERIES_RTS5912 diff --git a/soc/realtek/ec/rts5912/soc.c b/soc/realtek/ec/rts5912/soc.c index ce1e254e051..e08495e22a2 100644 --- a/soc/realtek/ec/rts5912/soc.c +++ b/soc/realtek/ec/rts5912/soc.c @@ -28,6 +28,10 @@ bool z_arm_on_enter_cpu_idle(void) */ void soc_early_init_hook(void) { + if (!IS_ENABLED(CONFIG_RTS5912_DEBUG_SWJ)) { + return; + } + int ret; /* Apply device related preinit configuration */