$_TARGETNAME configure -event gdb-attach { reset init }
$_TARGETNAME configure -event reset-init { at91rm9200_dk_init }
-#flash bank <driver> <base> <size> <chip_width> <bus_width>
-flash_bank cfi 0x10000000 0x00200000 2 2 0
+#flash bank <name> <driver> <base> <size> <chip_width> <bus_width> <target>
+set _FLASHNAME $_CHIPNAME.flash
+flash_bank $_FLASHNAME cfi 0x10000000 0x00200000 2 2 $_TARGETNAME
proc at91rm9200_dk_init { } {
# Override this in the interface config for parallel dongles
reset_config trst_and_srst separate
-# flash bank <driver> <base> <size> <chip_width> <bus_width>
+# flash bank <name> <driver> <base> <size> <chip_width> <bus_width> <target>
# 29LV650 64Mbit Flash
set _FLASHNAME $_CHIPNAME.flash
-flash bank $_FLASHNAME cfi 0x00000000 0x800000 2 2 0
+flash bank $_FLASHNAME cfi 0x00000000 0x800000 2 2 $_TARGETNAME
#####################
#M29DW323DB - not working
-#flash bank cfi <base> <size> <chip width> <bus width> <target#>
+#flash bank <name> cfi <base> <size> <chip width> <bus width> <target>
set _FLASHNAME $_CHIPNAME.flash
-flash bank $_FLASHNAME cfi 0x50000000 0x0400000 2 2 0
+flash bank $_FLASHNAME cfi 0x50000000 0x0400000 2 2 $_TARGETNAME
if { $CS2_MODE == "NOR" } {
# 16 Mbytes address space; 16 bit bus width
# (older boards used 32MB parts, with upper 16 MB unusable)
- flash bank cfi 0x02000000 0x01000000 2 2 $_TARGETNAME
+ set _FLASHNAME $_CHIPNAME.flash
+ flash bank $_FLASHNAME cfi 0x02000000 0x01000000 2 2 $_TARGETNAME
proc flashprobe {} { flash probe 0 }
} elseif { $CS2_MODE == "NAND" } {
# 64 Mbyte small page; 8 bit bus width
#flash configuration
-#flash bank <driver> <base> <size> <chip_width> <bus_width> [driver_options ...]
+#flash bank <name> <driver> <base> <size> <chip_width> <bus_width> <target> [driver_options ...]
set _FLASHNAME $_CHIPNAME.flash
-flash bank $_FLASHNAME cfi 0x00000000 0x1000000 2 2 0
+flash bank $_FLASHNAME cfi 0x00000000 0x1000000 2 2 $_TARGETNAME
$_TARGETNAME configure -event reset-init { imx27ads_init }
# The IMX27 ADS board has a NOR flash on CS0
-flash_bank cfi 0xc0000000 0x00200000 2 2 0
+set _FLASHNAME $_CHIPNAME.flash
+flash_bank $_FLASHNAME cfi 0xc0000000 0x00200000 2 2 $_TARGETNAME
proc imx27ads_init { } {
# This setup puts RAM at 0xA0000000
source [find target/imx27.cfg]
# The Logic PD board has a NOR flash on CS0
-flash_bank cfi 0xc0000000 0x00200000 2 2 0
+set _FLASHNAME $_CHIPNAME.flash
+flash_bank $_FLASHNAME cfi 0xc0000000 0x00200000 2 2 $_TARGETNAME
#
# FIX ME, Add support to
# Flash configuration
#####################
-#flash bank cfi <base> <size> <chip width> <bus width> <target#>
+#flash bank <name> cfi <base> <size> <chip width> <bus width> <target>
set _FLASHNAME $_CHIPNAME.flash
-flash bank $_FLASHNAME cfi 0x20000000 0x2000000 2 2 0
+flash bank $_FLASHNAME cfi 0x20000000 0x2000000 2 2 $_TARGETNAME
# Flash configuration
#####################
-#flash bank cfi <base> <size> <chip width> <bus width> <target#>
+#flash bank <name> cfi <base> <size> <chip width> <bus width> <target>
set _FLASHNAME $_CHIPNAME.flash
-flash bank $_FLASHNAME cfi 0x20000000 0x1000000 2 2 0
+flash bank $_FLASHNAME cfi 0x20000000 0x1000000 2 2 $_TARGETNAME
# Flash configuration
#####################
-#flash bank cfi <base> <size> <chip width> <bus width> <target#>
+#flash bank <name> cfi <base> <size> <chip width> <bus width> <target>
set _FLASHNAME $_CHIPNAME.flash
-flash bank $_FLASHNAME cfi 0x10000000 0x01000000 2 2 0
+flash bank $_FLASHNAME cfi 0x10000000 0x01000000 2 2 $_TARGETNAME
$_TARGETNAME configure -event reset-init { x300t_init }
# 1MB CFI capable flash
-# flash bank <driver> <base> <size> <chip_width> <bus_width>
+# flash bank <name> <driver> <base> <size> <chip_width> <bus_width> <target>
set _FLASHNAME $_CHIPNAME.flash
-flash bank $_FLASHNAME cfi 0xac000000 0x100000 2 2 0
+flash bank $_FLASHNAME cfi 0xac000000 0x100000 2 2 $_TARGETNAME
proc x300t_init { } {
# Setup SDRAM config and flash mapping
# Flash configuration
-#flash bank cfi <base> <size> <chip width> <bus width> <target#>
+#flash bank <name> cfi <base> <size> <chip width> <bus width> <target>
set _FLASHNAME $_CHIPNAME.flash
flash bank $_FLASHNAME cfi 0x10000000 0x01000000 2 2 $_TARGETNAME