aboutsummaryrefslogtreecommitdiff
path: root/tcl
diff options
context:
space:
mode:
authorKyle Schwarz <zeranoe@gmail.com>2022-07-10 15:58:14 -0400
committerAntonio Borneo <borneo.antonio@gmail.com>2023-01-15 14:47:30 +0000
commit0c28006cf2cf2d98ba2d73a73bf629e781f4ffb8 (patch)
treeccb82f6744278abc63715a25344bec3cf47b67c0 /tcl
parent95603fae18f81eebdafc5b318e70f9e2cdefab9e (diff)
downloadriscv-openocd-0c28006cf2cf2d98ba2d73a73bf629e781f4ffb8.zip
riscv-openocd-0c28006cf2cf2d98ba2d73a73bf629e781f4ffb8.tar.gz
riscv-openocd-0c28006cf2cf2d98ba2d73a73bf629e781f4ffb8.tar.bz2
flash/nor/avrf: add ATmega32U4 support
Add new chip info and tcl target Change-Id: Ib9d33d1b145a8659857b7a6cc9c5acba047f41d1 Signed-off-by: Kyle Schwarz <zeranoe@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7081 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Diffstat (limited to 'tcl')
-rw-r--r--tcl/target/atmega32u4.cfg30
1 files changed, 30 insertions, 0 deletions
diff --git a/tcl/target/atmega32u4.cfg b/tcl/target/atmega32u4.cfg
new file mode 100644
index 0000000..9199c74
--- /dev/null
+++ b/tcl/target/atmega32u4.cfg
@@ -0,0 +1,30 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
+# ATmega32U4
+
+if { [info exists CHIPNAME] } {
+ set _CHIPNAME $CHIPNAME
+} else {
+ set _CHIPNAME avr
+}
+
+if { [info exists ENDIAN] } {
+ set _ENDIAN $ENDIAN
+} else {
+ set _ENDIAN little
+}
+
+if { [info exists CPUTAPID] } {
+ set _CPUTAPID $CPUTAPID
+} else {
+ set _CPUTAPID 0x4958703f
+}
+
+adapter speed 4500
+
+jtag newtap $_CHIPNAME cpu -irlen 4 -expected-id $_CPUTAPID
+
+set _TARGETNAME $_CHIPNAME.cpu
+target create $_TARGETNAME avr -endian $_ENDIAN -chain-position $_TARGETNAME
+
+set _FLASHNAME $_CHIPNAME.flash
+flash bank $_FLASHNAME avr 0 0 0 0 $_TARGETNAME