Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drivers: jtag: refactor npcm4xx jtag driver #58

Merged
merged 1 commit into from
Sep 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions boards/arm/npcm400f_evb/npcm400f_evb.dts
Original file line number Diff line number Diff line change
Expand Up @@ -220,3 +220,11 @@
&usbd0 {
status = "okay";
};

&jtag1 {
tck-gpios = <&gpiof 0 (GPIO_PUSH_PULL | GPIO_ACTIVE_HIGH)>;
tdi-gpios = <&gpiof 1 (GPIO_PUSH_PULL | GPIO_ACTIVE_HIGH)>;
tdo-gpios = <&gpiof 2 (GPIO_ACTIVE_HIGH)>;
tms-gpios = <&gpiof 3 (GPIO_PUSH_PULL | GPIO_ACTIVE_HIGH)>;
status = "okay";
};
5 changes: 5 additions & 0 deletions boards/arm/npcm400f_evb/npcm400f_evb_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,8 @@ CONFIG_SPIP_NPCM4XX=y
# USB Driver
CONFIG_USB=y
CONFIG_USB_DC_NPCM4XX=y

# JTAG Driver
CONFIG_JTAG=y
CONFIG_JTAG_SHELL=y
CONFIG_JTAG_NPCM4XX=y
1 change: 1 addition & 0 deletions drivers/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,4 @@ add_subdirectory_ifdef(CONFIG_NEURAL_NET_ACCEL neural_net)
add_subdirectory_ifdef(CONFIG_PTP_CLOCK ptp_clock)
add_subdirectory_ifdef(CONFIG_EDAC edac)
add_subdirectory_ifdef(CONFIG_CACHE_MANAGEMENT cache)
add_subdirectory_ifdef(CONFIG_JTAG jtag)
2 changes: 2 additions & 0 deletions drivers/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,6 @@ source "drivers/disk/Kconfig"

source "drivers/cache/Kconfig"

source "drivers/jtag/Kconfig"

endmenu
6 changes: 6 additions & 0 deletions drivers/jtag/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# SPDX-License-Identifier: Apache-2.0

zephyr_library()

zephyr_library_sources_ifdef(CONFIG_JTAG_SHELL jtag_shell.c)
zephyr_library_sources_ifdef(CONFIG_JTAG_NPCM4XX jtag_npcm4xx.c)
29 changes: 29 additions & 0 deletions drivers/jtag/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# JTAG configuration options

# Copyright (c) 2023 Zephyr
# SPDX-License-Identifier: Apache-2.0

#
# JTAG options
#
menuconfig JTAG
bool "JTAG drivers"
help
Enable JTAG driver configuration.

if JTAG

config JTAG_SHELL
bool "Enable JTAG Shell"
default y
depends on SHELL
help
Enable JTAG Shell for testing.

module = JTAG
module-str = JTAG
source "subsys/logging/Kconfig.template.log_config"

source "drivers/jtag/Kconfig.npcm4xx"

endif
12 changes: 12 additions & 0 deletions drivers/jtag/Kconfig.npcm4xx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# NPCM4XX JTAG driver configuration options

# Copyright (c) 2023 Nuvoton Technology Inc.
# SPDX-License-Identifier: Apache-2.0

config JTAG_NPCM4XX
bool "NPCM4XX JTAG driver"
depends on SOC_FAMILY_NPCM4XX
help
This option enables the JTAG driver for NPCM4XX family of
processors.
Say y if you wish to use JTAG channels on NPCM4XX MCU.
Loading
Loading