Skip to content

Commit e81f881

Browse files
authored
Merge pull request #149 from wangnuannuan/jingru-add-openocd-config-file-for-different-board
board: add openocd config files for different boards
2 parents 748992d + a5e723b commit e81f881

File tree

17 files changed

+164
-16
lines changed

17 files changed

+164
-16
lines changed

board/axs/configs/103/core_debug.mk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
ifeq ($(VALID_CUR_CORE),archs36)
2-
OPENOCD_CFG_FILE ?= $(OPENOCD_SCRIPT_ROOT)/board/snps_axs103_hs36.cfg
2+
OPENOCD_CFG_FILE ?= $(BOARD_CORE_DIR)/openocd/snps_axs103_hs36.cfg
33
else
44
ifeq ($(VALID_CUR_CORE),archs38)
5-
OPENOCD_CFG_FILE ?= $(OPENOCD_SCRIPT_ROOT)/board/snps_axs103_hs38.cfg
5+
OPENOCD_CFG_FILE ?= $(BOARD_CORE_DIR)/openocd/snps_axs103_hs38.cfg
66
else
7-
OPENOCD_CFG_FILE ?= $(OPENOCD_SCRIPT_ROOT)/board/snps_axs103_hs36.cfg
7+
OPENOCD_CFG_FILE ?= $(BOARD_CORE_DIR)/openocd/snps_axs103_hs36.cfg
88
endif
99
endif
1010

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Configure JTAG cable
2+
# SDP has built-in FT2232 chip, which is similiar to Digilent HS-1, except that
3+
# it uses channgel B for JTAG, instead of channel A.
4+
interface ftdi
5+
ftdi_vid_pid 0x0403 0x6010
6+
ftdi_layout_init 0x0088 0x008b
7+
ftdi_channel 1
8+
9+
if { [info exists _FTDI_SERIAL] } {
10+
ftdi_serial $_FTDI_SERIAL
11+
}
12+
13+
adapter_khz 10000
14+
15+
# ARCs supports only JTAG.
16+
transport select jtag
17+
18+
# Configure SoC
19+
source [find target/snps_axc003_hs36.cfg]
20+
21+
# Initialize
22+
init
23+
reset halt
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Configure JTAG cable
2+
# SDP has built-in FT2232 chip, which is similiar to Digilent HS-1, except that
3+
# it uses channgel B for JTAG, instead of channel A.
4+
interface ftdi
5+
ftdi_vid_pid 0x0403 0x6010
6+
ftdi_layout_init 0x0088 0x008b
7+
ftdi_channel 1
8+
9+
if { [info exists _FTDI_SERIAL] } {
10+
ftdi_serial $_FTDI_SERIAL
11+
}
12+
13+
adapter_khz 10000
14+
15+
# ARCs supports only JTAG.
16+
transport select jtag
17+
18+
# Configure SoC
19+
source [find target/snps_axc003_hs38.cfg]
20+
21+
# Initialize
22+
init
23+
reset hal

board/axs/configs/core_configs.mk

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,5 @@ ifneq ($(wildcard $(CORE_DEBUG_MK)),)
4949
COMMON_COMPILE_PREREQUISITES += $(CORE_DEBUG_MK)
5050
include $(CORE_DEBUG_MK)
5151
else
52-
OPENOCD_CFG_FILE ?= $(OPENOCD_SCRIPT_ROOT)/board/snps_axs103_hs36.cfg
52+
OPENOCD_CFG_FILE ?= $(BOARD_CORE_DIR)/openocd/snps_axs103_hs36.cfg
5353
endif
54-
55-
OPENOCD_OPTIONS = -s $(OPENOCD_SCRIPT_ROOT) -f $(OPENOCD_CFG_FILE)

board/board.mk

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@ BOARD_ID = $(call uc,BOARD_$(VALID_BOARD))
5454
COMMON_COMPILE_PREREQUISITES += $(BOARDS_ROOT)/$(VALID_BOARD)/$(VALID_BOARD).mk
5555
include $(BOARDS_ROOT)/$(VALID_BOARD)/$(VALID_BOARD).mk
5656

57+
ifneq ($(strip $(DIG_NUM)), )
58+
OPENOCD_OPTIONS = -s $(OPENOCD_SCRIPT_ROOT) -c 'set _FTDI_SERIAL $(DIG_NUM)' -f $(OPENOCD_CFG_FILE)
59+
else
60+
OPENOCD_OPTIONS = -s $(OPENOCD_SCRIPT_ROOT) -f $(OPENOCD_CFG_FILE)
61+
endif
62+
5763
##
5864
# \brief add defines for board
5965
##

board/emsdp/emsdp.mk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ include $(BOARD_EMSDP_DIR)/$(VALID_BD_VER)/configs/core_compiler.mk
6060

6161
## Board Related Settings
6262
OPENOCD_CFG_FILE = $(BOARD_EMSDP_DIR)/openocd/snps_emsdp.cfg
63-
OPENOCD_OPTIONS = -s $(OPENOCD_SCRIPT_ROOT) -f $(OPENOCD_CFG_FILE)
6463

6564

6665
##

board/emsdp/openocd/snps_emsdp.cfg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ ftdi_vid_pid 0x0403 0x6010
2424
ftdi_layout_init 0x0088 0x008b
2525
ftdi_channel 0
2626

27+
if { [info exists _FTDI_SERIAL] } {
28+
ftdi_serial $_FTDI_SERIAL
29+
}
2730

2831
adapter_khz 10000
2932

board/emsk/configs/11/openocd.cfg

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Configure JTAG cable
2+
# EM Starter Kit has built-in FT2232 chip, which is similiar to Digilent HS-1.
3+
interface ftdi
4+
ftdi_vid_pid 0x0403 0x6010
5+
ftdi_layout_init 0x0088 0x008b
6+
7+
if { [info exists _FTDI_SERIAL] } {
8+
ftdi_serial $_FTDI_SERIAL
9+
}
10+
11+
adapter_khz 10000
12+
13+
# ARCs support only JTAG.
14+
transport select jtag
15+
16+
# Configure FPGA. This script supports both LX45 and LX150.
17+
source [find target/snps_em_sk_fpga.cfg]
18+
19+
# Initialize
20+
init
21+
reset halt

board/emsk/configs/22/openocd.cfg

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Configure JTAG cable
2+
# EM Starter Kit has built-in FT2232 chip, which is similiar to Digilent HS-1.
3+
interface ftdi
4+
ftdi_vid_pid 0x0403 0x6010
5+
ftdi_layout_init 0x0088 0x008b
6+
7+
if { [info exists _FTDI_SERIAL] } {
8+
ftdi_serial $_FTDI_SERIAL
9+
}
10+
11+
# EM11D reportedly requires 5 MHz. Other cores and board can work faster.
12+
adapter_khz 5000
13+
14+
# ARCs support only JTAG.
15+
transport select jtag
16+
17+
# Configure FPGA. This script supports both LX45 and LX150.
18+
source [find target/snps_em_sk_fpga.cfg]
19+
20+
# Initialize
21+
init
22+
reset halt

board/emsk/configs/23/openocd.cfg

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Configure JTAG cable
2+
# EM Starter Kit has built-in FT2232 chip, which is similiar to Digilent HS-1.
3+
interface ftdi
4+
ftdi_vid_pid 0x0403 0x6010
5+
ftdi_layout_init 0x0088 0x008b
6+
7+
if { [info exists _FTDI_SERIAL] } {
8+
ftdi_serial $_FTDI_SERIAL
9+
}
10+
11+
# EM11D reportedly requires 5 MHz. Other cores and board can work faster.
12+
adapter_khz 5000
13+
14+
# ARCs support only JTAG.
15+
transport select jtag
16+
17+
# Configure FPGA. This script supports both LX45 and LX150.
18+
source [find target/snps_em_sk_fpga.cfg]
19+
20+
# Initialize
21+
init
22+
reset halt

0 commit comments

Comments
 (0)