Browse Source

jh8100: openocd: Update recipe for jh8100 support

Added jh8100 openocd config

Signed-off-by: yang.lee <yang.lee@starfivetech.com>
yang.lee 8 months ago
parent
commit
973fcf0a8e

+ 0 - 0
dynamic-layers/openembedded-layer/recipes-devtools/openocd/openocd/olimex-openocd_s5.cfg → dynamic-layers/openembedded-layer/recipes-devtools/openocd/openocd/dubhe_olimex-openocd_s5.cfg


+ 0 - 0
dynamic-layers/openembedded-layer/recipes-devtools/openocd/openocd/olimex_flash_write.cfg → dynamic-layers/openembedded-layer/recipes-devtools/openocd/openocd/dubhe_olimex_flash_write.cfg


+ 87 - 0
dynamic-layers/openembedded-layer/recipes-devtools/openocd/openocd/jh8100_0150_f1.cfg

@@ -0,0 +1,87 @@
+# _MULTI_TARGETS:
+#   0 - for debug single CPU. Start openocd locally.
+#   1 - for debug multiple CPUs. Start openocd (need version >= 0.11.0 for e24) before and set "Remote Target" port.
+set _MULTI_TARGETS	0
+set _JLINK		0
+set _CHIPNAME		JH8100
+
+# "adapter_khz" is DEPRECATED in openocd v0.11.0, replace with "adapter speed" if not available
+#adapter_khz   4000
+adapter speed   2000
+# listen on all interfaces for incoming TCP/IP connections, useful for multiple targets (_MULTI_TARGETS == 1)
+bindto 0.0.0.0
+
+if { $_JLINK } {
+	#interface jlink
+	adapter driver jlink
+	# Select a specific device if more than one connected
+	#jlink serial 4294967295
+} else {
+	#source [find interface/ftdi/olimex-arm-usb-tiny-h.cfg]
+	#source olimex-arm-usb-tiny-h.cfg
+	# Select a specific device if more than one connected
+	interface ftdi
+	ftdi_device_desc "Olimex OpenOCD JTAG ARM-USB-TINY-H"
+	ftdi_vid_pid 0x15ba 0x002a
+
+	ftdi_serial "OL3EBABB"
+
+	ftdi_layout_init 0x0808 0x0a1b
+	ftdi_layout_signal nSRST -oe 0x0200
+	ftdi_layout_signal nTRST -data 0x0100 -oe 0x0100
+	ftdi_layout_signal LED -data 0x0800
+}
+
+
+transport select jtag
+
+#set remote interrupt-on-connect off
+## Follow chain order
+jtag newtap RV64ABCDFHIMSU cpu -irlen 5 -expected-id 0x08100cfd -disable
+jtag newtap RV32ACFIMUX cpu -irlen 5 -expected-id 0x08100cfd -disable
+
+source [find jrc.cfg]
+
+target create RV32ACFIMUX.hart0 riscv -chain-position RV32ACFIMUX.cpu -coreid 0 -gdb-port 3334
+target create RV64ABCDFHIMSU.core0 riscv -chain-position RV64ABCDFHIMSU.cpu -coreid 2 -rtos hwthread -gdb-port 3333
+
+init
+
+RV32ACFIMUX.hart0 configure -event gdb-detach {
+    jtag tapdisable RV32ACFIMUX.cpu
+    jtag tapdisable RV64ABCDFHIMSU.cpu
+    shutdown
+}
+
+RV64ABCDFHIMSU.core0 configure -event gdb-detach {
+    jtag tapdisable RV64ABCDFHIMSU.cpu
+    jtag tapdisable RV32ACFIMUX.cpu
+    shutdown
+}
+
+halt
+scan_chain
+
+#echo "load U-Boot SPL .................."
+#fast_load_image u-boot-spl.bin 0xb000000
+#fast_load
+
+#echo "load U-Boot itb images .................."
+#fast_load_image u-boot.itb 0xa0000000
+#fast_load
+
+#echo "load Linux kernel image .................."
+#fast_load_image Image_165.gz 0x47000000
+#fast_load
+
+#echo "load Linux dtb image .................."
+#fast_load_image jh8100-fpga_165.dtb 0x46000000
+#fast_load
+
+#echo "load rootfs image .................."
+#fast_load_image rootfs_165.cpio 0x59000000
+#fast_load
+
+echo "Finish loading images.................."
+
+echo "Ready for Remote Connections"

+ 87 - 0
dynamic-layers/openembedded-layer/recipes-devtools/openocd/openocd/jh8100_0150_f2.cfg

@@ -0,0 +1,87 @@
+# _MULTI_TARGETS:
+#   0 - for debug single CPU. Start openocd locally.
+#   1 - for debug multiple CPUs. Start openocd (need version >= 0.11.0 for e24) before and set "Remote Target" port.
+set _MULTI_TARGETS	0
+set _JLINK		0
+set _CHIPNAME		JH8100
+
+# "adapter_khz" is DEPRECATED in openocd v0.11.0, replace with "adapter speed" if not available
+#adapter_khz   4000
+adapter speed   2000
+# listen on all interfaces for incoming TCP/IP connections, useful for multiple targets (_MULTI_TARGETS == 1)
+bindto 0.0.0.0
+
+if { $_JLINK } {
+	#interface jlink
+	adapter driver jlink
+	# Select a specific device if more than one connected
+	#jlink serial 4294967295
+} else {
+	#source [find interface/ftdi/olimex-arm-usb-tiny-h.cfg]
+	#source olimex-arm-usb-tiny-h.cfg
+	# Select a specific device if more than one connected
+	interface ftdi
+	ftdi_device_desc "Olimex OpenOCD JTAG ARM-USB-TINY-H"
+	ftdi_vid_pid 0x15ba 0x002a
+
+	ftdi_serial "OL570962"
+
+	ftdi_layout_init 0x0808 0x0a1b
+	ftdi_layout_signal nSRST -oe 0x0200
+	ftdi_layout_signal nTRST -data 0x0100 -oe 0x0100
+	ftdi_layout_signal LED -data 0x0800
+}
+
+
+transport select jtag
+
+#set remote interrupt-on-connect off
+## Follow chain order
+jtag newtap RV64ABCDFHIMSU cpu -irlen 5 -expected-id 0x08100cfd -disable
+jtag newtap RV32ACFIMUX cpu -irlen 5 -expected-id 0x08100cfd -disable
+
+source [find jrc.cfg]
+
+target create RV32ACFIMUX.hart0 riscv -chain-position RV32ACFIMUX.cpu -coreid 0 -gdb-port 3341
+target create RV64ABCDFHIMSU.core0 riscv -chain-position RV64ABCDFHIMSU.cpu -coreid 2 -rtos hwthread -gdb-port 3340
+
+init
+
+RV32ACFIMUX.hart0 configure -event gdb-detach {
+    jtag tapdisable RV32ACFIMUX.cpu
+    jtag tapdisable RV64ABCDFHIMSU.cpu
+    shutdown
+}
+
+RV64ABCDFHIMSU.core0 configure -event gdb-detach {
+    jtag tapdisable RV64ABCDFHIMSU.cpu
+    jtag tapdisable RV32ACFIMUX.cpu
+    shutdown
+}
+
+halt
+scan_chain
+
+#echo "load U-Boot SPL .................."
+#fast_load_image u-boot-spl.bin 0xb000000
+#fast_load
+
+#echo "load U-Boot itb images .................."
+#fast_load_image u-boot.itb 0xa0000000
+#fast_load
+
+# echo "load Linux kernel image .................."
+# fast_load_image Image_165.gz 0x47000000
+# fast_load
+
+# echo "load Linux dtb image .................."
+# fast_load_image jh8100-fpga_165.dtb 0x46000000
+# fast_load
+
+# echo "load rootfs image .................."
+# fast_load_image rootfs_165.cpio 0x59000000
+# fast_load
+
+echo "Finish loading images.................."
+
+echo "Ready for Remote Connections"

+ 42 - 0
dynamic-layers/openembedded-layer/recipes-devtools/openocd/openocd/jh8100_jrc.cfg

@@ -0,0 +1,42 @@
+jtag newtap CHIP jrc -irlen 4 -expected-id 0x08100cfd -enable
+
+## E24 enable handler
+jtag configure RV32ACFIMUX.cpu -event tap-enable {
+    irscan CHIP.jrc 0x2 -endstate RUN/IDLE 
+    drscan CHIP.jrc 16 0x4102 -endstate RUN/IDLE 
+    runtest 10
+    ## Place jrc in bypass
+    irscan CHIP.jrc 0xF -endstate RUN/IDLE 
+    runtest 10
+}
+
+## E24 disable handler 
+jtag configure RV32ACFIMUX.cpu -event tap-disable {
+    irscan CHIP.jrc 0x2 -endstate RUN/IDLE
+    drscan CHIP.jrc 16 0x4100 -endstate RUN/IDLE
+    runtest 10
+    ## Place jrc in bypass
+    irscan CHIP.jrc 0xF -endstate RUN/IDLE 
+}
+
+## BC enable handler 
+jtag configure RV64ABCDFHIMSU.cpu -event tap-enable {
+    irscan CHIP.jrc 0x2 -endstate RUN/IDLE 
+    drscan CHIP.jrc 16 0x4402 -endstate RUN/IDLE 
+    runtest 10
+    ## Place jrc in bypass
+    irscan CHIP.jrc 0xF -endstate RUN/IDLE
+}
+
+## BC disable handler 
+jtag configure RV64ABCDFHIMSU.cpu -event tap-disable {
+    irscan CHIP.jrc 0x2 -endstate RUN/IDLE 
+    drscan CHIP.jrc 16 0x4400 -endstate RUN/IDLE 
+    runtest 10
+    ## Place jrc in bypass
+    irscan CHIP.jrc 0xF -endstate RUN/IDLE 
+}
+
+jtag configure CHIP.jrc -event post-reset "runtest 20"
+jtag configure CHIP.jrc -event setup "jtag tapenable RV64ABCDFHIMSU.cpu"
+#"jtag tapenable RV64ABCDFHIMSU.cpu; jtag tapenable RV32ACFIMUX.cpu"

+ 13 - 6
dynamic-layers/openembedded-layer/recipes-devtools/openocd/openocd_riscv.bbappend

@@ -9,10 +9,13 @@ SRC_URI = " \
     git://repo.or.cz/r/git2cl.git;protocol=http;destsuffix=tools/git2cl;name=git2cl;branch=master \
     git://github.com/msteveb/jimtcl.git;protocol=https;branch=master;name=jimtcl;destsuffix=git/jimtcl \
     git://repo.or.cz/r/libjaylink.git;protocol=http;destsuffix=git/src/jtag/drivers/libjaylink;name=libjaylink;branch=master \
-    file://Dubhe_FPGA_openocd.patch \
-    file://olimex-openocd_s5.cfg \
-    file://olimex_flash_write.cfg \
     file://0001-autosetup-cc-check-tools-check-only-the-name.patch \
+    file://Dubhe_FPGA_openocd.patch \
+    file://dubhe_olimex-openocd_s5.cfg \
+    file://dubhe_olimex_flash_write.cfg \
+    file://jh8100_0150_f1.cfg \
+    file://jh8100_0150_f2.cfg \
+    file://jh8100_jrc.cfg \
 "
 
 SRCREV_openocd = "a037b20f2e015859327ab37588792386c4fc942f"
@@ -21,9 +24,13 @@ SRCREV_jimtcl = "70b007b63669a709b0e8aef34a22658047815cc2"
 EXTRA_OECONF = "--enable-ftdi"
 
 inherit deploy
-do_deploy(){
-	install -m 755 ${WORKDIR}/olimex-openocd_s5.cfg ${DEPLOYDIR}/
-	install -m 755 ${WORKDIR}/olimex_flash_write.cfg ${DEPLOYDIR}/
+
+do_deploy() {
+	install -m 755 ${WORKDIR}/dubhe_olimex-openocd_s5.cfg ${DEPLOYDIR}/
+	install -m 755 ${WORKDIR}/dubhe_olimex_flash_write.cfg ${DEPLOYDIR}/
+	install -m 755 ${WORKDIR}/jh8100_0150_f1.cfg ${DEPLOYDIR}/
+	install -m 755 ${WORKDIR}/jh8100_0150_f2.cfg ${DEPLOYDIR}/
+	install -m 755 ${WORKDIR}/jh8100_jrc.cfg ${DEPLOYDIR}/
 }
 
 addtask deploy before do_build after do_install