From 6e1aa07f958f0205e501c8bdbe7756df31d5b22c Mon Sep 17 00:00:00 2001 From: Huaqi Fang <578567190@qq.com> Date: Fri, 27 Oct 2023 11:01:32 +0800 Subject: [PATCH] tcl: change nuclei-demosoc.cfg to nuclei-evalsoc.cfg Change-Id: I3d5cb3f25d9097e290fd829becd15ae17895c46d Signed-off-by: Huaqi Fang <578567190@qq.com> --- tcl/board/nuclei-demosoc.cfg | 53 ------------------------------------ tcl/board/nuclei-evalsoc.cfg | 48 ++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 53 deletions(-) delete mode 100644 tcl/board/nuclei-demosoc.cfg create mode 100644 tcl/board/nuclei-evalsoc.cfg diff --git a/tcl/board/nuclei-demosoc.cfg b/tcl/board/nuclei-demosoc.cfg deleted file mode 100644 index 7776f491a3..0000000000 --- a/tcl/board/nuclei-demosoc.cfg +++ /dev/null @@ -1,53 +0,0 @@ -adapter_khz 1000 - -interface ftdi -ftdi_vid_pid 0x0403 0x6010 -# change to on to enable cJTAG 2-wire OSCAN1 protocol -ftdi_oscan1_mode off - -## bindto 0.0.0.0 can be used to cover all available interfaces. -## Uncomment bindto line to enable remote machine debug -# bindto 0.0.0.0 - -## If ftdi_device_desc not specified, the device description is ignored during device selection. -## So if you want to specify a dedicated FTDI device, you can select following device description: -## "Dual RS232-HS" is for Nuclei HummingBird Debugger V1 -## "USB <-> JTAG-DEBUGGER" is for Nuclei HummingBird Debugger V2 -## Uncomment one which match your device description -# ftdi_device_desc "Dual RS232-HS" -# ftdi_device_desc "USB <-> JTAG-DEBUGGER" - -transport select jtag - -ftdi_layout_init 0x0008 0x001b -ftdi_layout_signal nSRST -oe 0x0020 -data 0x0020 -ftdi_layout_signal TCK -data 0x0001 -ftdi_layout_signal TDI -data 0x0002 -ftdi_layout_signal TDO -input 0x0004 -ftdi_layout_signal TMS -data 0x0008 -ftdi_layout_signal JTAG_SEL -data 0x0100 -oe 0x0100 - -set _CHIPNAME riscv -jtag newtap $_CHIPNAME cpu -irlen 5 - -set _TARGETNAME $_CHIPNAME.cpu -target create $_TARGETNAME riscv -chain-position $_TARGETNAME -$_TARGETNAME configure -work-area-phys 0x80000000 -work-area-size 10000 -work-area-backup 1 - -set _FLASHNAME $_CHIPNAME.flash -flash bank $_FLASHNAME nuspi 0x20000000 0 0 0 $_TARGETNAME - -# Expose Nuclei self-defined CSRS -# See https://github.com/riscv/riscv-gnu-toolchain/issues/319#issuecomment-358397306 -# Then user can view the csr register value in gdb using: info reg csr775 for CSR MTVT(0x307) -riscv expose_csrs 416-496,770-800,835-850,1227-1231,1483-1486,1984-2040,2064-2070,2370-2380,2490-2500,4032-4040 - -init - -if {[ info exists pulse_srst]} { - ftdi_set_signal nSRST 0 - ftdi_set_signal nSRST z -} -halt -# We must turn on this because otherwise the IDE version debug cannot download the program into flash -flash protect 0 0 last off diff --git a/tcl/board/nuclei-evalsoc.cfg b/tcl/board/nuclei-evalsoc.cfg new file mode 100644 index 0000000000..aa877be9a7 --- /dev/null +++ b/tcl/board/nuclei-evalsoc.cfg @@ -0,0 +1,48 @@ +adapter speed 1000 + +adapter driver ftdi +ftdi vid_pid 0x0403 0x6010 +# change to on to enable cJTAG 2-wire OSCAN1 protocol +# ocan1_mode -> nscan1_mode in 2023.10 Nuclei OpenOCD release +# ftdi oscan1_mode off +ftdi nscan1_mode off + +## bindto 0.0.0.0 can be used to cover all available interfaces. +## Uncomment bindto line to enable remote machine debug +# bindto 0.0.0.0 + +# specify adapter serial to select a ftdi chip if you have multiple jtag devices +# adapter serial "FT6S9RD6" + +transport select jtag + +ftdi layout_init 0x0008 0x001b +ftdi layout_signal nSRST -oe 0x0020 -data 0x0020 +ftdi layout_signal TCK -data 0x0001 +ftdi layout_signal TDI -data 0x0002 +ftdi layout_signal TDO -input 0x0004 +ftdi layout_signal TMS -data 0x0008 +ftdi layout_signal JTAG_SEL -data 0x0100 -oe 0x0100 + + +set _CHIPNAME riscv +jtag newtap $_CHIPNAME cpu -irlen 5 + +set _TARGETNAME $_CHIPNAME.cpu +target create $_TARGETNAME riscv -chain-position $_TARGETNAME +$_TARGETNAME configure -work-area-phys 0x80000000 -work-area-size 10000 -work-area-backup 1 + +set _FLASHNAME $_CHIPNAME.flash +flash bank $_FLASHNAME nuspi 0x20000000 0 0 0 $_TARGETNAME + +init + +if {[ info exists pulse_srst]} { + ftdi_set_signal nSRST 0 + ftdi_set_signal nSRST z +} +halt + +# We must turn on this because otherwise the IDE version debug cannot download the program into flash + +flash protect 0 0 last off