From: Spencer O. <nt...@us...> - 2010-05-13 21:48:26
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 215a5f7442773693045613cff9e3ce3c7f7e9678 (commit) via a7fb60dc7b23a78be0ad5876b0e76a0e76875d5c (commit) via 7b36d2a229ecde1a497773233ee1850bb10d80a7 (commit) from 7b76da57f471e77a24519c10927aab79890783a9 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 215a5f7442773693045613cff9e3ce3c7f7e9678 Author: Spencer Oliver <nt...@us...> Date: Wed May 12 23:04:57 2010 +0100 scripts: update flash bank names As the flash bank name is now unique update the scripts to suit. Signed-off-by: Spencer Oliver <nt...@us...> diff --git a/tcl/board/hitex_str9-comstick.cfg b/tcl/board/hitex_str9-comstick.cfg index 4d1bb2e..c85681b 100644 --- a/tcl/board/hitex_str9-comstick.cfg +++ b/tcl/board/hitex_str9-comstick.cfg @@ -73,7 +73,7 @@ $_TARGETNAME configure -event reset-init { $_TARGETNAME configure -work-area-phys 0x50000000 -work-area-size 16384 -work-area-backup 0 #flash bank <driver> <base> <size> <chip_width> <bus_width> -set _FLASHNAME $_CHIPNAME.flash +set _FLASHNAME $_CHIPNAME.flash0 flash bank $_FLASHNAME str9x 0x00000000 0x00080000 0 0 0 -set _FLASHNAME $_CHIPNAME.flash +set _FLASHNAME $_CHIPNAME.flash1 flash bank $_FLASHNAME str9x 0x00080000 0x00008000 0 0 0 diff --git a/tcl/board/lubbock.cfg b/tcl/board/lubbock.cfg index 095c60a..b58ad5a 100644 --- a/tcl/board/lubbock.cfg +++ b/tcl/board/lubbock.cfg @@ -12,9 +12,9 @@ jtag_ntrst_delay 250 # CS0, CS1 -- two banks of CFI flash, 32 MBytes each # each bank is 32-bits wide, two 16-bit chips in parallel -set _FLASHNAME $_CHIPNAME.flash +set _FLASHNAME $_CHIPNAME.flash0 flash bank $_FLASHNAME cfi 0x00000000 0x02000000 2 4 $_TARGETNAME -set _FLASHNAME $_CHIPNAME.flash +set _FLASHNAME $_CHIPNAME.flash1 flash bank $_FLASHNAME cfi 0x04000000 0x02000000 2 4 $_TARGETNAME # CS2 low -- FPGA registers diff --git a/tcl/board/str910-eval.cfg b/tcl/board/str910-eval.cfg index a2772a8..9e3f881 100644 --- a/tcl/board/str910-eval.cfg +++ b/tcl/board/str910-eval.cfg @@ -58,9 +58,9 @@ $_TARGETNAME configure -event reset-init { } #flash bank str9x <base> <size> 0 0 <target#> <variant> -set _FLASHNAME $_CHIPNAME.flash +set _FLASHNAME $_CHIPNAME.flash0 flash bank $_FLASHNAME str9x 0x00000000 0x00080000 0 0 0 -set _FLASHNAME $_CHIPNAME.flash +set _FLASHNAME $_CHIPNAME.flash1 flash bank $_FLASHNAME str9x 0x00080000 0x00008000 0 0 0 # For more information about the configuration files, take a look at: diff --git a/tcl/target/at91sam3u4c.cfg b/tcl/target/at91sam3u4c.cfg index e281287..5cacbcb 100644 --- a/tcl/target/at91sam3u4c.cfg +++ b/tcl/target/at91sam3u4c.cfg @@ -2,10 +2,10 @@ source [find target/at91sam3uxx.cfg] # size is automatically "calculated" by probing -set _FLASHNAME $_CHIPNAME.flash +set _FLASHNAME $_CHIPNAME.flash0 flash bank $_FLASHNAME at91sam3 0x000080000 0 1 1 $_TARGETNAME # This is a 256K chip, it has the 2nd bank -set _FLASHNAME $_CHIPNAME.flash +set _FLASHNAME $_CHIPNAME.flash1 flash bank $_FLASHNAME at91sam3 0x000100000 0 1 1 $_TARGETNAME diff --git a/tcl/target/at91sam3u4e.cfg b/tcl/target/at91sam3u4e.cfg index e549185..6f6e0d8 100644 --- a/tcl/target/at91sam3u4e.cfg +++ b/tcl/target/at91sam3u4e.cfg @@ -2,10 +2,10 @@ source [find target/at91sam3uXX.cfg] # size is automatically "calculated" by probing -set _FLASHNAME $_CHIPNAME.flash +set _FLASHNAME $_CHIPNAME.flash0 flash bank $_FLASHNAME at91sam3 0x000080000 0 1 1 $_TARGETNAME # This is a 256K chip - it has the 2nd bank -set _FLASHNAME $_CHIPNAME.flash +set _FLASHNAME $_CHIPNAME.flash1 flash bank $_FLASHNAME at91sam3 0x000100000 0 1 1 $_TARGETNAME diff --git a/tcl/target/pic32mx.cfg b/tcl/target/pic32mx.cfg index 673d254..0b99cdb 100644 --- a/tcl/target/pic32mx.cfg +++ b/tcl/target/pic32mx.cfg @@ -67,9 +67,9 @@ $_TARGETNAME configure -event reset-init { mww 0xbf882030 $_PIC32MX_PROGSIZE } -set _FLASHNAME $_CHIPNAME.flash +set _FLASHNAME $_CHIPNAME.flash0 flash bank $_FLASHNAME pic32mx 0x1fc00000 0 0 0 $_TARGETNAME -set _FLASHNAME $_CHIPNAME.flash +set _FLASHNAME $_CHIPNAME.flash1 flash bank $_FLASHNAME pic32mx 0x1d000000 0 0 0 $_TARGETNAME # For more information about the configuration files, take a look at: diff --git a/tcl/target/str710.cfg b/tcl/target/str710.cfg index 4d68586..a5955b6 100644 --- a/tcl/target/str710.cfg +++ b/tcl/target/str710.cfg @@ -47,9 +47,9 @@ $_TARGETNAME configure -event gdb-flash-erase-start { $_TARGETNAME configure -work-area-phys 0x2000C000 -work-area-size 0x4000 -work-area-backup 0 #flash bank str7x <base> <size> 0 0 <target#> <variant> -set _FLASHNAME $_CHIPNAME.flash +set _FLASHNAME $_CHIPNAME.flash0 flash bank $_FLASHNAME str7x 0x40000000 0x00040000 0 0 $_TARGETNAME STR71x -set _FLASHNAME $_CHIPNAME.flash +set _FLASHNAME $_CHIPNAME.flash1 flash bank $_FLASHNAME str7x 0x400C0000 0x00004000 0 0 $_TARGETNAME STR71x # For more information about the configuration files, take a look at: diff --git a/tcl/target/str750.cfg b/tcl/target/str750.cfg index 8a64226..7d9f034 100644 --- a/tcl/target/str750.cfg +++ b/tcl/target/str750.cfg @@ -53,8 +53,8 @@ $_TARGETNAME configure -event gdb-flash-erase-start { $_TARGETNAME configure -work-area-phys 0x40000000 -work-area-size 0x4000 -work-area-backup 0 #flash bank <driver> <base> <size> <chip_width> <bus_width> -set _FLASHNAME $_CHIPNAME.flash +set _FLASHNAME $_CHIPNAME.flash0 flash bank $_FLASHNAME str7x 0x20000000 0x00040000 0 0 $_TARGETNAME STR75x -set _FLASHNAME $_CHIPNAME.flash +set _FLASHNAME $_CHIPNAME.flash1 flash bank $_FLASHNAME str7x 0x200C0000 0x00004000 0 0 $_TARGETNAME STR75x diff --git a/tcl/target/str912.cfg b/tcl/target/str912.cfg index 6f2981a..a16c83a 100644 --- a/tcl/target/str912.cfg +++ b/tcl/target/str912.cfg @@ -63,9 +63,9 @@ $_TARGETNAME configure -event reset-init { $_TARGETNAME configure -work-area-phys 0x50000000 -work-area-size 16384 -work-area-backup 0 #flash bank str9x <base> <size> 0 0 <target#> <variant> -set _FLASHNAME $_CHIPNAME.flash +set _FLASHNAME $_CHIPNAME.flash0 flash bank $_FLASHNAME str9x 0x00000000 0x00080000 0 0 $_TARGETNAME -set _FLASHNAME $_CHIPNAME.flash +set _FLASHNAME $_CHIPNAME.flash1 flash bank $_FLASHNAME str9x 0x00080000 0x00008000 0 0 $_TARGETNAME # For more information about the configuration files, take a look at: commit a7fb60dc7b23a78be0ad5876b0e76a0e76875d5c Author: Spencer Oliver <nt...@us...> Date: Wed May 12 22:42:26 2010 +0100 flash: require unique flash bank name Make sure the flash bank name is unique Signed-off-by: Spencer Oliver <nt...@us...> diff --git a/src/flash/nor/tcl.c b/src/flash/nor/tcl.c index a3efd80..a6e942e 100644 --- a/src/flash/nor/tcl.c +++ b/src/flash/nor/tcl.c @@ -795,6 +795,14 @@ COMMAND_HANDLER(handle_flash_bank_command) return ERROR_FAIL; } + /* check the flash bank name is unique */ + if (get_flash_bank_by_name(bank_name) != NULL) + { + /* flash bank name already exists */ + LOG_ERROR("flash bank name '%s' already exists", bank_name); + return ERROR_FAIL; + } + /* register flash specific commands */ if (NULL != driver->commands) { commit 7b36d2a229ecde1a497773233ee1850bb10d80a7 Author: Spencer Oliver <nt...@us...> Date: Wed May 12 22:40:19 2010 +0100 flash: add flash bank name support flash cmds can now be passed either the bank name or the bank number. For example. flash info stm32.flash flash info 0 Signed-off-by: Spencer Oliver <nt...@us...> diff --git a/src/flash/nor/tcl.c b/src/flash/nor/tcl.c index 17c6e91..a3efd80 100644 --- a/src/flash/nor/tcl.c +++ b/src/flash/nor/tcl.c @@ -49,21 +49,18 @@ COMMAND_HELPER(flash_command_get_bank, unsigned name_index, COMMAND_HANDLER(handle_flash_info_command) { struct flash_bank *p; - uint32_t i = 0; int j = 0; int retval; if (CMD_ARGC != 1) return ERROR_COMMAND_SYNTAX_ERROR; - unsigned bank_nr; - COMMAND_PARSE_NUMBER(uint, CMD_ARGV[0], bank_nr); + retval = CALL_COMMAND_HANDLER(flash_command_get_bank, 0, &p); + if (retval != ERROR_OK) + return retval; - for (p = flash_bank_list(); p; p = p->next, i++) + if (p != NULL) { - if (i != bank_nr) - continue; - char buf[1024]; /* attempt auto probe */ @@ -76,8 +73,8 @@ COMMAND_HANDLER(handle_flash_info_command) return retval; command_print(CMD_CTX, - "#%" PRIi32 " : %s at 0x%8.8" PRIx32 ", size 0x%8.8" PRIx32 ", buswidth %i, chipwidth %i", - i, + "#%" PRIu32 " : %s at 0x%8.8" PRIx32 ", size 0x%8.8" PRIx32 ", buswidth %i, chipwidth %i", + p->bank_number, p->driver->name, p->base, p->size, @@ -115,6 +112,7 @@ COMMAND_HANDLER(handle_flash_info_command) COMMAND_HANDLER(handle_flash_probe_command) { + struct flash_bank *p; int retval; if (CMD_ARGC != 1) @@ -122,9 +120,10 @@ COMMAND_HANDLER(handle_flash_probe_command) return ERROR_COMMAND_SYNTAX_ERROR; } - unsigned bank_nr; - COMMAND_PARSE_NUMBER(uint, CMD_ARGV[0], bank_nr); - struct flash_bank *p = get_flash_bank_by_num_noprobe(bank_nr); + retval = CALL_COMMAND_HANDLER(flash_command_get_bank, 0, &p); + if (retval != ERROR_OK) + return retval; + if (p) { if ((retval = p->driver->probe(p)) == ERROR_OK) @@ -294,15 +293,13 @@ COMMAND_HANDLER(handle_flash_erase_command) if (CMD_ARGC != 3) return ERROR_COMMAND_SYNTAX_ERROR; - uint32_t bank_nr; uint32_t first; uint32_t last; - COMMAND_PARSE_NUMBER(u32, CMD_ARGV[0], bank_nr); - struct flash_bank *p; int retval; - retval = get_flash_bank_by_num(bank_nr, &p); + + retval = CALL_COMMAND_HANDLER(flash_command_get_bank, 0, &p); if (retval != ERROR_OK) return retval; @@ -325,7 +322,7 @@ COMMAND_HANDLER(handle_flash_erase_command) { command_print(CMD_CTX, "erased sectors %" PRIu32 " " "through %" PRIu32" on flash bank %" PRIu32 " " - "in %fs", first, last, bank_nr, duration_elapsed(&bench)); + "in %fs", first, last, p->bank_number, duration_elapsed(&bench)); } return ERROR_OK; @@ -336,13 +333,13 @@ COMMAND_HANDLER(handle_flash_protect_command) if (CMD_ARGC != 4) return ERROR_COMMAND_SYNTAX_ERROR; - uint32_t bank_nr; uint32_t first; uint32_t last; - COMMAND_PARSE_NUMBER(u32, CMD_ARGV[0], bank_nr); struct flash_bank *p; - int retval = get_flash_bank_by_num(bank_nr, &p); + int retval; + + retval = CALL_COMMAND_HANDLER(flash_command_get_bank, 0, &p); if (retval != ERROR_OK) return retval; @@ -362,9 +359,9 @@ COMMAND_HANDLER(handle_flash_protect_command) retval = flash_driver_protect(p, set, first, last); if (retval == ERROR_OK) { command_print(CMD_CTX, "%s protection for sectors %i " - "through %i on flash bank %i", + "through %i on flash bank %" PRIu32 "", (set) ? "set" : "cleared", (int) first, - (int) last, (int) bank_nr); + (int) last, p->bank_number); } return ERROR_OK; @@ -847,8 +844,8 @@ COMMAND_HANDLER(handle_flash_banks_command) unsigned n = 0; for (struct flash_bank *p = flash_bank_list(); p; p = p->next, n++) { - LOG_USER("#%u: %s at 0x%8.8" PRIx32 ", size 0x%8.8" PRIx32 ", " - "buswidth %u, chipwidth %u", n, + LOG_USER("#%" PRIu32 " : %s at 0x%8.8" PRIx32 ", size 0x%8.8" PRIx32 ", " + "buswidth %u, chipwidth %u", p->bank_number, p->driver->name, p->base, p->size, p->bus_width, p->chip_width); } ----------------------------------------------------------------------- Summary of changes: src/flash/nor/tcl.c | 53 ++++++++++++++++++++---------------- tcl/board/hitex_str9-comstick.cfg | 4 +- tcl/board/lubbock.cfg | 4 +- tcl/board/str910-eval.cfg | 4 +- tcl/target/at91sam3u4c.cfg | 4 +- tcl/target/at91sam3u4e.cfg | 4 +- tcl/target/pic32mx.cfg | 4 +- tcl/target/str710.cfg | 4 +- tcl/target/str750.cfg | 4 +- tcl/target/str912.cfg | 4 +- 10 files changed, 47 insertions(+), 42 deletions(-) hooks/post-receive -- Main OpenOCD repository |