2008-11-30 16:25:43 -06:00
|
|
|
#
|
|
|
|
# This is for the "at91rm9200-DK" (not the EK) eval board.
|
|
|
|
#
|
|
|
|
# The two are probably very simular.... I have DK...
|
|
|
|
#
|
|
|
|
# It has atmel at91rm9200 chip.
|
|
|
|
source [find target/at91rm9200.cfg]
|
2010-05-18 04:38:01 -05:00
|
|
|
|
|
|
|
reset_config trst_and_srst
|
|
|
|
|
2008-11-30 16:25:43 -06:00
|
|
|
$_TARGETNAME configure -event gdb-attach { reset init }
|
|
|
|
$_TARGETNAME configure -event reset-init { at91rm9200_dk_init }
|
|
|
|
|
2010-03-26 02:17:46 -05:00
|
|
|
#flash bank <name> <driver> <base> <size> <chip_width> <bus_width> <target>
|
|
|
|
set _FLASHNAME $_CHIPNAME.flash
|
2010-04-15 04:11:01 -05:00
|
|
|
flash bank $_FLASHNAME cfi 0x10000000 0x00200000 2 2 $_TARGETNAME
|
2008-11-30 16:25:43 -06:00
|
|
|
|
|
|
|
|
|
|
|
proc at91rm9200_dk_init { } {
|
|
|
|
# Try to run at 1khz... Yea, that slow!
|
|
|
|
# Chip is really running @ 32khz
|
2010-03-15 10:37:43 -05:00
|
|
|
adapter_khz 8
|
2009-09-21 13:48:22 -05:00
|
|
|
|
2008-11-30 16:25:43 -06:00
|
|
|
mww 0xfffffc64 0xffffffff
|
|
|
|
## disable all clocks but system clock
|
|
|
|
mww 0xfffffc04 0xfffffffe
|
|
|
|
## disable all clocks to pioa and piob
|
|
|
|
mww 0xfffffc14 0xffffffc3
|
|
|
|
## master clock = slow cpu = slow
|
|
|
|
## (means the CPU is running at 32khz!)
|
|
|
|
mww 0xfffffc30 0
|
|
|
|
## main osc enable
|
|
|
|
mww 0xfffffc20 0x0000ff01
|
|
|
|
## program pllA
|
|
|
|
mww 0xfffffc28 0x20263e04
|
|
|
|
## program pllB
|
|
|
|
mww 0xfffffc2c 0x10483e0e
|
|
|
|
## let pll settle... sleep 100msec
|
|
|
|
sleep 100
|
|
|
|
## switch to fast clock
|
|
|
|
mww 0xfffffc30 0x202
|
|
|
|
## Sleep some - (go read)
|
|
|
|
sleep 100
|
2009-09-21 13:48:22 -05:00
|
|
|
|
2008-11-30 16:25:43 -06:00
|
|
|
#========================================
|
|
|
|
# CPU now runs at 180mhz
|
|
|
|
# SYS runs at 60mhz.
|
2010-03-15 10:37:43 -05:00
|
|
|
adapter_khz 40000
|
2008-11-30 16:25:43 -06:00
|
|
|
#========================================
|
2009-09-21 13:48:22 -05:00
|
|
|
|
|
|
|
|
2008-11-30 16:25:43 -06:00
|
|
|
## set memc for all memories
|
|
|
|
mww 0xffffff60 0x02
|
|
|
|
## program smc controller
|
|
|
|
mww 0xffffff70 0x3284
|
|
|
|
## init sdram
|
|
|
|
mww 0xffffff98 0x7fffffd0
|
|
|
|
## all banks precharge
|
|
|
|
mww 0xffffff80 0x02
|
|
|
|
## touch sdram chip to make it work
|
|
|
|
mww 0x20000000 0
|
2009-09-21 13:48:22 -05:00
|
|
|
## sdram controller mode register
|
2008-11-30 16:25:43 -06:00
|
|
|
mww 0xffffff90 0x04
|
|
|
|
mww 0x20000000 0
|
|
|
|
mww 0x20000000 0
|
|
|
|
mww 0x20000000 0
|
|
|
|
mww 0x20000000 0
|
|
|
|
mww 0x20000000 0
|
|
|
|
mww 0x20000000 0
|
|
|
|
mww 0x20000000 0
|
|
|
|
mww 0x20000000 0
|
|
|
|
## sdram controller mode register
|
|
|
|
## Refresh, etc....
|
|
|
|
mww 0xffffff90 0x03
|
|
|
|
mww 0x20000080 0
|
|
|
|
mww 0xffffff94 0x1f4
|
|
|
|
mww 0x20000080 0
|
|
|
|
mww 0xffffff90 0x10
|
|
|
|
mww 0x20000000 0
|
|
|
|
mww 0xffffff00 0x01
|
|
|
|
|
|
|
|
}
|