2009-05-18 07:04:58 +00:00
|
|
|
######################################
|
|
|
|
# Target: DIGI ConnectCore Wi-9C
|
|
|
|
######################################
|
|
|
|
|
|
|
|
reset_config trst_and_srst
|
|
|
|
|
2009-12-15 22:39:25 +00:00
|
|
|
# FIXME use some standard target config, maybe create one from this
|
|
|
|
#
|
|
|
|
# source [find target/...cfg]
|
|
|
|
|
2009-09-21 18:48:22 +00:00
|
|
|
if { [info exists CHIPNAME] } {
|
|
|
|
set _CHIPNAME $CHIPNAME
|
|
|
|
} else {
|
2009-05-18 07:04:58 +00:00
|
|
|
set _CHIPNAME ns9360
|
|
|
|
}
|
|
|
|
|
2009-09-21 18:48:22 +00:00
|
|
|
if { [info exists ENDIAN] } {
|
|
|
|
set _ENDIAN $ENDIAN
|
|
|
|
} else {
|
2009-05-18 07:04:58 +00:00
|
|
|
# This config file was defaulting to big endian..
|
|
|
|
set _ENDIAN big
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
# What's a good fallback frequency for this board if RCLK is
|
|
|
|
# not available??
|
|
|
|
jtag_rclk 1000
|
|
|
|
|
|
|
|
|
2011-10-29 21:32:17 +00:00
|
|
|
if { [info exists CPUTAPID] } {
|
2009-05-18 07:04:58 +00:00
|
|
|
set _CPUTAPID $CPUTAPID
|
|
|
|
} else {
|
2009-07-06 08:05:58 +00:00
|
|
|
set _CPUTAPID 0x07926031
|
2009-05-18 07:04:58 +00:00
|
|
|
}
|
|
|
|
|
2009-12-15 22:39:25 +00:00
|
|
|
set _TARGETNAME $_CHIPNAME.cpu
|
2009-05-18 07:04:58 +00:00
|
|
|
jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID
|
|
|
|
|
2010-03-15 15:41:30 +00:00
|
|
|
adapter_nsrst_delay 200
|
2009-05-18 07:04:58 +00:00
|
|
|
jtag_ntrst_delay 0
|
|
|
|
|
|
|
|
|
|
|
|
######################
|
|
|
|
# Target configuration
|
|
|
|
######################
|
|
|
|
|
2009-12-15 22:39:25 +00:00
|
|
|
target create $_TARGETNAME arm926ejs -endian $_ENDIAN -chain-position $_TARGETNAME
|
2009-07-06 08:05:58 +00:00
|
|
|
|
2009-05-18 07:04:58 +00:00
|
|
|
$_TARGETNAME configure -event reset-init {
|
|
|
|
mww 0x90600104 0x33313333
|
2010-12-18 17:22:53 +00:00
|
|
|
mww 0xA0700000 0x00000001 ;# Enable the memory controller.
|
|
|
|
mww 0xA0700024 0x00000006 ;# Set the refresh counter 6
|
|
|
|
mww 0xA0700028 0x00000001 ;#
|
|
|
|
mww 0xA0700030 0x00000001 ;# Set the precharge period
|
|
|
|
mww 0xA0700034 0x00000004 ;# Active to precharge command period is 16 clock cycles
|
|
|
|
mww 0xA070003C 0x00000001 ;# tAPR
|
|
|
|
mww 0xA0700040 0x00000005 ;# tDAL
|
|
|
|
mww 0xA0700044 0x00000001 ;# tWR
|
|
|
|
mww 0xA0700048 0x00000006 ;# tRC 32 clock cycles
|
|
|
|
mww 0xA070004C 0x00000006 ;# tRFC 32 clock cycles
|
|
|
|
mww 0xA0700054 0x00000001 ;# tRRD
|
|
|
|
mww 0xA0700058 0x00000001 ;# tMRD
|
|
|
|
mww 0xA0700100 0x00004280 ;# Dynamic Config 0 (cs4)
|
|
|
|
mww 0xA0700120 0x00004280 ;# Dynamic Config 1 (cs5)
|
|
|
|
mww 0xA0700140 0x00004280 ;# Dynamic Config 2 (cs6)
|
|
|
|
mww 0xA0700160 0x00004280 ;# Dynamic Config 3 (cs7)
|
2009-05-18 07:04:58 +00:00
|
|
|
#
|
2010-12-18 17:22:53 +00:00
|
|
|
mww 0xA0700104 0x00000203 ;# CAS latency is 2 at 100 MHz
|
|
|
|
mww 0xA0700124 0x00000203 ;# CAS latency is 2 at 100 MHz
|
|
|
|
mww 0xA0700144 0x00000203 ;# CAS latency is 2 at 100 MHz
|
|
|
|
mww 0xA0700164 0x00000203 ;# CAS latency is 2 at 100 MHz
|
2009-05-18 07:04:58 +00:00
|
|
|
#
|
2010-12-18 17:22:53 +00:00
|
|
|
mww 0xA0700020 0x00000103 ;# issue SDRAM PALL command
|
2009-05-18 07:04:58 +00:00
|
|
|
#
|
2010-12-18 17:22:53 +00:00
|
|
|
mww 0xA0700024 0x00000001 ;# Set the refresh counter to be as small as possible
|
2009-05-18 07:04:58 +00:00
|
|
|
#
|
|
|
|
# Add some dummy writes to give the SDRAM time to settle, it needs two
|
|
|
|
# AHB clock cycles, here we poke in the debugger flag, this lets
|
|
|
|
# the software know that we are in the debugger
|
|
|
|
mww 0xA0900000 0x00000002
|
|
|
|
mww 0xA0900000 0x00000002
|
|
|
|
mww 0xA0900000 0x00000002
|
|
|
|
mww 0xA0900000 0x00000002
|
|
|
|
mww 0xA0900000 0x00000002
|
|
|
|
#
|
2009-09-21 18:48:22 +00:00
|
|
|
mdw 0xA0900000
|
|
|
|
mdw 0xA0900000
|
|
|
|
mdw 0xA0900000
|
|
|
|
mdw 0xA0900000
|
|
|
|
mdw 0xA0900000
|
2009-05-18 07:04:58 +00:00
|
|
|
#
|
2010-12-18 17:22:53 +00:00
|
|
|
mww 0xA0700024 0x00000030 ;# Set the refresh counter to 30
|
|
|
|
mww 0xA0700020 0x00000083 ;# Issue SDRAM MODE command
|
2009-05-18 07:04:58 +00:00
|
|
|
#
|
|
|
|
# Next we perform a read of RAM.
|
|
|
|
# mw = move word.
|
|
|
|
mdw 0x00022000
|
|
|
|
# mw 0x00022000:P, r3 # 22000 for cas2 latency, 32000 for cas 3
|
|
|
|
#
|
2010-12-18 17:22:53 +00:00
|
|
|
mww 0xA0700020 0x00000003 ;# issue SDRAM NORMAL command
|
|
|
|
mww 0xA0700100 0x00084280 ;# Enable buffer access
|
|
|
|
mww 0xA0700120 0x00084280 ;# Enable buffer access
|
|
|
|
mww 0xA0700140 0x00084280 ;# Enable buffer access
|
|
|
|
mww 0xA0700160 0x00084280 ;# Enable buffer access
|
2009-05-18 07:04:58 +00:00
|
|
|
|
|
|
|
#Set byte lane state (static mem 1)"
|
2009-07-06 08:05:58 +00:00
|
|
|
mww 0xA0700220 0x00000082
|
2009-05-18 07:04:58 +00:00
|
|
|
#Flash Start
|
2009-07-06 08:05:58 +00:00
|
|
|
mww 0xA09001F8 0x50000000
|
2009-05-18 07:04:58 +00:00
|
|
|
#Flash Mask Reg
|
2009-07-06 08:05:58 +00:00
|
|
|
mww 0xA09001FC 0xFF000001
|
|
|
|
mww 0xA0700028 0x00000001
|
2009-05-18 07:04:58 +00:00
|
|
|
|
|
|
|
# RAMAddr = 0x00020000
|
|
|
|
# RAMSize = 0x00004000
|
|
|
|
|
|
|
|
# Set the processor mode
|
|
|
|
reg cpsr 0xd3
|
|
|
|
}
|
|
|
|
|
2009-11-08 16:52:40 +00:00
|
|
|
$_TARGETNAME configure -work-area-phys 0x00000000 -work-area-size 0x1000 -work-area-backup 1
|
2009-05-18 07:04:58 +00:00
|
|
|
|
|
|
|
#####################
|
|
|
|
# Flash configuration
|
|
|
|
#####################
|
|
|
|
|
|
|
|
#M29DW323DB - not working
|
2010-03-26 07:17:46 +00:00
|
|
|
#flash bank <name> cfi <base> <size> <chip width> <bus width> <target>
|
2009-11-18 10:15:52 +00:00
|
|
|
set _FLASHNAME $_CHIPNAME.flash
|
2010-03-26 07:17:46 +00:00
|
|
|
flash bank $_FLASHNAME cfi 0x50000000 0x0400000 2 2 $_TARGETNAME
|