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>
This commit is contained in:
Kyle Schwarz 2022-07-10 15:58:14 -04:00 committed by Antonio Borneo
parent 95603fae18
commit 0c28006cf2
2 changed files with 31 additions and 0 deletions

View File

@ -64,6 +64,7 @@ static const struct avrf_type avft_chips_info[] = {
{"atmega324pa", 0x9511, 128, 256, 4, 256},
{"atmega644p", 0x960a, 256, 256, 8, 256},
{"atmega1284p", 0x9705, 256, 512, 8, 512},
{"atmega32u4", 0x9587, 128, 256, 4, 256},
};
/* avr program functions */

30
tcl/target/atmega32u4.cfg Normal file
View File

@ -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