2008-03-01 16:00:13 -06:00
|
|
|
#use combined on interfaces or targets that can't set TRST/SRST separately
|
|
|
|
reset_config srst_only srst_pulls_trst
|
|
|
|
|
2009-09-21 13:48:22 -05:00
|
|
|
if { [info exists CHIPNAME] } {
|
|
|
|
set _CHIPNAME $CHIPNAME
|
|
|
|
} else {
|
2008-11-30 16:25:43 -06:00
|
|
|
set _CHIPNAME sam7x256
|
|
|
|
}
|
|
|
|
|
2009-09-21 13:48:22 -05:00
|
|
|
if { [info exists ENDIAN] } {
|
|
|
|
set _ENDIAN $ENDIAN
|
|
|
|
} else {
|
2008-11-30 16:25:43 -06:00
|
|
|
set _ENDIAN little
|
|
|
|
}
|
|
|
|
|
|
|
|
if { [info exists CPUTAPID ] } {
|
|
|
|
set _CPUTAPID $CPUTAPID
|
|
|
|
} else {
|
|
|
|
set _CPUTAPID 0x3f0f0f0f
|
|
|
|
}
|
|
|
|
|
|
|
|
jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID
|
|
|
|
|
2009-09-04 00:17:03 -05:00
|
|
|
set _TARGETNAME $_CHIPNAME.cpu
|
2008-11-30 16:25:43 -06:00
|
|
|
target create $_TARGETNAME arm7tdmi -endian $_ENDIAN -chain-position $_TARGETNAME -variant arm7tdmi
|
2009-09-04 00:17:03 -05:00
|
|
|
|
2009-09-21 13:48:22 -05:00
|
|
|
$_TARGETNAME configure -event reset-init {
|
2008-10-31 01:57:42 -05:00
|
|
|
# disable watchdog
|
2009-09-21 13:48:22 -05:00
|
|
|
mww 0xfffffd44 0x00008000
|
2008-10-31 01:57:42 -05:00
|
|
|
# enable user reset
|
2009-09-21 13:48:22 -05:00
|
|
|
mww 0xfffffd08 0xa5000001
|
2008-10-31 01:57:42 -05:00
|
|
|
# CKGR_MOR : enable the main oscillator
|
2009-09-21 13:48:22 -05:00
|
|
|
mww 0xfffffc20 0x00000601
|
2008-10-31 01:57:42 -05:00
|
|
|
sleep 10
|
|
|
|
# CKGR_PLLR: 96.1097 MHz
|
2009-09-21 13:48:22 -05:00
|
|
|
mww 0xfffffc2c 0x00481c0e
|
2008-10-31 01:57:42 -05:00
|
|
|
sleep 10
|
|
|
|
# PMC_MCKR : MCK = PLL / 2 ~= 48 MHz
|
2009-09-21 13:48:22 -05:00
|
|
|
mww 0xfffffc30 0x00000007
|
2008-10-31 01:57:42 -05:00
|
|
|
sleep 10
|
|
|
|
# MC_FMR: flash mode (FWS=1,FMCN=60)
|
2009-09-21 13:48:22 -05:00
|
|
|
mww 0xffffff60 0x003c0100
|
2008-10-31 01:57:42 -05:00
|
|
|
sleep 100
|
|
|
|
}
|
2008-03-01 16:00:13 -06:00
|
|
|
|
2009-11-08 10:52:40 -06:00
|
|
|
$_TARGETNAME configure -work-area-phys 0x00200000 -work-area-size 0x4000 -work-area-backup 0
|
2008-03-01 16:00:13 -06:00
|
|
|
|
2009-05-23 13:26:06 -05:00
|
|
|
#flash bank <driver> <base_addr> <size> <chip_width> <bus_width> <target_number> [<target_name> <banks> <sectors_per_bank> <pages_per_sector> <page_size> <num_nvmbits> <ext_freq_khz>]
|
|
|
|
flash bank at91sam7 0 0 0 0 0 0 0 0 0 0 0 0 18432
|
2008-03-01 16:00:13 -06:00
|
|
|
|
|
|
|
# For more information about the configuration files, take a look at:
|
2008-08-18 02:23:54 -05:00
|
|
|
# openocd.texi
|