1 # SPDX-License-Identifier: GPL-2.0-or-later
3 ################################################################################
4 # Author: Michael Trensch (MTrensch@googlemail.com)
5 ################################################################################
7 source [find target/hilscher_netx10.cfg]
9 # Usually it is not needed to set srst_pulls_trst
10 # but sometimes it does not work without it. If you encounter
11 # problems try to line below
12 # reset_config trst_and_srst srst_pulls_trst
13 reset_config trst_and_srst
14 adapter srst delay 500
17 $_TARGETNAME configure -work-area-virt 0x08000000 -work-area-phys 0x08000000 -work-area-size 0x4000 -work-area-backup 1
19 # Par. Flash can only be accessed if DIP switch on the board is set in proper
20 # position and init_sdrambus was called. Don't call these functions if the DIP
21 # switch is in invalid position, as some outputs may collide. This is why this
22 # function is not called automatically
24 puts "Configuring SRAM nCS0 for 90ns Par. Flash (x16)"
25 mww 0x101C0100 0x01010008
31 return [read_memory $addr 32 1]
34 proc init_clocks { } {
35 puts "Enabling all clocks "
36 set accesskey [mread32 0x101c0070]
37 mww 0x101c0070 $accesskey
39 mww 0x101c0028 0x00007511
42 proc init_sdrambus { } {
43 puts "Initializing external SDRAM Bus 16 Bit "
44 set accesskey [mread32 0x101c0070]
45 mww 0x101c0070 $accesskey
46 mww 0x101c0C40 0x00000050
48 puts "Configuring SDRAM controller for K4S561632E (32MB) "
51 #mww 0x101C0144 0x00a13262
52 mww 0x101C0144 0x00a13251
53 mww 0x101C0148 0x00000033
54 mww 0x101C0140 0x030d0121
57 $_TARGETNAME configure -event reset-init {
61 arm7_9 fast_memory_access enable
62 arm7_9 dcc_downloads enable
68 puts "-------------------------------------------------"
69 puts "Call 'init_clocks' to enable all clocks"
70 puts "Call 'init_sdrambus' to enable external SDRAM bus"
71 puts "-------------------------------------------------"
78 #flash bank <name> <driver> <base> <size> <chip width> <bus width> <target#>
79 #flash bank parflash cfi 0xC0000000 0x01000000 2 2 $_TARGETNAME