You can subscribe to this list here.
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(75) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2009 |
Jan
(70) |
Feb
(20) |
Mar
(52) |
Apr
(149) |
May
(387) |
Jun
(466) |
Jul
(133) |
Aug
(87) |
Sep
(122) |
Oct
(140) |
Nov
(185) |
Dec
(105) |
2010 |
Jan
(85) |
Feb
(45) |
Mar
(75) |
Apr
(17) |
May
(41) |
Jun
(52) |
Jul
(33) |
Aug
(29) |
Sep
(36) |
Oct
(15) |
Nov
(26) |
Dec
(34) |
2011 |
Jan
(26) |
Feb
(25) |
Mar
(26) |
Apr
(29) |
May
(20) |
Jun
(27) |
Jul
(15) |
Aug
(32) |
Sep
(13) |
Oct
(64) |
Nov
(60) |
Dec
(10) |
2012 |
Jan
(64) |
Feb
(63) |
Mar
(39) |
Apr
(43) |
May
(54) |
Jun
(11) |
Jul
(30) |
Aug
(45) |
Sep
(11) |
Oct
(70) |
Nov
(24) |
Dec
(23) |
2013 |
Jan
(17) |
Feb
(8) |
Mar
(35) |
Apr
(40) |
May
(20) |
Jun
(24) |
Jul
(36) |
Aug
(25) |
Sep
(42) |
Oct
(40) |
Nov
(9) |
Dec
(21) |
2014 |
Jan
(29) |
Feb
(24) |
Mar
(60) |
Apr
(22) |
May
(22) |
Jun
(46) |
Jul
(11) |
Aug
(23) |
Sep
(26) |
Oct
(10) |
Nov
(14) |
Dec
(2) |
2015 |
Jan
(28) |
Feb
(47) |
Mar
(33) |
Apr
(58) |
May
(5) |
Jun
(1) |
Jul
|
Aug
(8) |
Sep
(12) |
Oct
(25) |
Nov
(58) |
Dec
(21) |
2016 |
Jan
(12) |
Feb
(40) |
Mar
(2) |
Apr
(1) |
May
(67) |
Jun
(2) |
Jul
(5) |
Aug
(36) |
Sep
|
Oct
(24) |
Nov
(17) |
Dec
(50) |
2017 |
Jan
(14) |
Feb
(16) |
Mar
(2) |
Apr
(35) |
May
(14) |
Jun
(16) |
Jul
(3) |
Aug
(3) |
Sep
|
Oct
(19) |
Nov
|
Dec
(16) |
2018 |
Jan
(55) |
Feb
(11) |
Mar
(34) |
Apr
(14) |
May
(4) |
Jun
(20) |
Jul
(39) |
Aug
(16) |
Sep
(17) |
Oct
(16) |
Nov
(20) |
Dec
(30) |
2019 |
Jan
(29) |
Feb
(24) |
Mar
(37) |
Apr
(26) |
May
(19) |
Jun
(21) |
Jul
(2) |
Aug
(3) |
Sep
(9) |
Oct
(12) |
Nov
(12) |
Dec
(12) |
2020 |
Jan
(47) |
Feb
(36) |
Mar
(54) |
Apr
(44) |
May
(37) |
Jun
(19) |
Jul
(32) |
Aug
(13) |
Sep
(16) |
Oct
(24) |
Nov
(32) |
Dec
(11) |
2021 |
Jan
(14) |
Feb
(5) |
Mar
(40) |
Apr
(32) |
May
(42) |
Jun
(31) |
Jul
(29) |
Aug
(47) |
Sep
(38) |
Oct
(17) |
Nov
(74) |
Dec
(33) |
2022 |
Jan
(11) |
Feb
(15) |
Mar
(40) |
Apr
(21) |
May
(39) |
Jun
(44) |
Jul
(19) |
Aug
(46) |
Sep
(79) |
Oct
(35) |
Nov
(21) |
Dec
(15) |
2023 |
Jan
(56) |
Feb
(13) |
Mar
(43) |
Apr
(28) |
May
(60) |
Jun
(15) |
Jul
(29) |
Aug
(28) |
Sep
(32) |
Oct
(21) |
Nov
(42) |
Dec
(39) |
2024 |
Jan
(35) |
Feb
(17) |
Mar
(28) |
Apr
(7) |
May
(14) |
Jun
(35) |
Jul
(30) |
Aug
(35) |
Sep
(30) |
Oct
(28) |
Nov
(38) |
Dec
(18) |
2025 |
Jan
(21) |
Feb
(28) |
Mar
(36) |
Apr
(35) |
May
(34) |
Jun
(58) |
Jul
(9) |
Aug
(37) |
Sep
|
Oct
|
Nov
|
Dec
|
From: David B. <dbr...@us...> - 2010-01-09 22:38:07
|
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 1dd5277ba3eb8c5938832b41c2bf6cb5bf19146e (commit) from 1c5c57ec8e3f285cc81d4ad101edccb82b721beb (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 1dd5277ba3eb8c5938832b41c2bf6cb5bf19146e Author: David Brownell <dbr...@us...> Date: Sat Jan 9 13:32:08 2010 -0800 src/helper: usage/help updates Make "usage" messages use the same EBNF as the User's Guide; no angle brackets. Improve and correct various helptexts. Don't use "&function"; a function's name is its address. Fix some whitespace glitches, shrink a few overlong lines. Signed-off-by: David Brownell <dbr...@us...> diff --git a/src/helper/command.c b/src/helper/command.c index 0ddcd01..288ed72 100644 --- a/src/helper/command.c +++ b/src/helper/command.c @@ -1087,6 +1087,7 @@ static int jim_command_mode(Jim_Interp *interp, int argc, Jim_Obj *const *argv) { struct command_context *cmd_ctx = current_command_context(interp); enum command_mode mode; + if (argc > 1) { struct command *c = cmd_ctx->commands; @@ -1223,7 +1224,7 @@ COMMAND_HANDLER(handle_help_add_command) return help_add_command(CMD_CTX, c, cmd_name, help, usage); } -/* sleep command sleeps for <n> miliseconds +/* sleep command sleeps for <n> milliseconds * this is useful in target startup scripts */ COMMAND_HANDLER(handle_sleep_command) @@ -1263,19 +1264,22 @@ static const struct command_registration command_subcommand_handlers[] = { { .name = "mode", .mode = COMMAND_ANY, - .jim_handler = &jim_command_mode, - .usage = "[<name> ...]", + .jim_handler = jim_command_mode, + .usage = "[command_name ...]", .help = "Returns the command modes allowed by a command:" "'any', 'config', or 'exec'. If no command is" - "specified, returns the current command mode.", + "specified, returns the current command mode. " + "Returns 'unknown' if an unknown command is given. " + "Command can be multiple tokens.", }, { .name = "type", .mode = COMMAND_ANY, - .jim_handler = &jim_command_type, - .usage = "<name> ...", + .jim_handler = jim_command_type, + .usage = "command_name [...]", .help = "Returns the type of built-in command:" - "'native', 'simple', 'group', or 'unknown'", + "'native', 'simple', 'group', or 'unknown'. " + "Command can be multiple tokens.", }, COMMAND_REGISTRATION_DONE }; @@ -1283,39 +1287,43 @@ static const struct command_registration command_subcommand_handlers[] = { static const struct command_registration command_builtin_handlers[] = { { .name = "add_help_text", - .handler = &handle_help_add_command, + .handler = handle_help_add_command, .mode = COMMAND_ANY, - .help = "add new command help text", - .usage = "<command> [...] <help_text>]", + .help = "Add new command help text; " + "Command can be multiple tokens.", + .usage = "command_name helptext_string", }, { .name = "add_usage_text", - .handler = &handle_help_add_command, + .handler = handle_help_add_command, .mode = COMMAND_ANY, - .help = "add new command usage text", - .usage = "<command> [...] <usage_text>]", + .help = "Add new command usage text; " + "command can be multiple tokens.", + .usage = "command_name usage_string", }, { .name = "sleep", - .handler = &handle_sleep_command, + .handler = handle_sleep_command, .mode = COMMAND_ANY, - .help = "sleep for n milliseconds. " - "\"busy\" will busy wait", - .usage = "<n> [busy]", + .help = "Sleep for specified number of milliseconds. " + "\"busy\" will busy wait instead (avoid this).", + .usage = "milliseconds ['busy']", }, { .name = "help", - .handler = &handle_help_command, + .handler = handle_help_command, .mode = COMMAND_ANY, - .help = "show full command help", - .usage = "[<command> ...]", + .help = "Show full command help; " + "command can be multiple tokens.", + .usage = "[command_name]", }, { .name = "usage", - .handler = &handle_help_command, + .handler = handle_help_command, .mode = COMMAND_ANY, - .help = "show basic command usage", - .usage = "[<command> ...]", + .help = "Show basic command usage; " + "command can be multiple tokens.", + .usage = "[command_name]", }, { .name = "command", diff --git a/src/helper/ioutil.c b/src/helper/ioutil.c index 27bffad..14f6e91 100644 --- a/src/helper/ioutil.c +++ b/src/helper/ioutil.c @@ -191,6 +191,7 @@ COMMAND_HANDLER(handle_append_command) int retval = ERROR_FAIL; FILE *config_file = NULL; + config_file = fopen(CMD_ARGV[0], "a"); if (config_file != NULL) { @@ -199,7 +200,8 @@ COMMAND_HANDLER(handle_append_command) unsigned i; for (i = 1; i < CMD_ARGC; i++) { - if (fwrite(CMD_ARGV[i], 1, strlen(CMD_ARGV[i]), config_file) != strlen(CMD_ARGV[i])) + if (fwrite(CMD_ARGV[i], 1, strlen(CMD_ARGV[i]), + config_file) != strlen(CMD_ARGV[i])) break; if (i != CMD_ARGC - 1) { @@ -208,9 +210,8 @@ COMMAND_HANDLER(handle_append_command) } } if ((i == CMD_ARGC) && (fwrite("\n", 1, 1, config_file) == 1)) - { retval = ERROR_OK; - } + fclose(config_file); } @@ -619,76 +620,86 @@ static int zylinjtag_Jim_Command_mac(Jim_Interp *interp, int argc, static const struct command_registration ioutil_command_handlers[] = { { .name = "cat", - .handler = &handle_cat_command, + .handler = handle_cat_command, .mode = COMMAND_ANY, - .help = "display file content", - .usage= "<file_name>", + .help = "display text file content", + .usage= "file_name", }, { .name = "trunc", - .handler = &handle_trunc_command, + .handler = handle_trunc_command, .mode = COMMAND_ANY, - .help = "truncate a file 0 size", - .usage= "<file_name>", + .help = "truncate a file to zero length", + .usage= "file_name", }, { .name = "cp", - .handler = &handle_cp_command, + .handler = handle_cp_command, .mode = COMMAND_ANY, .help = "copy a file", - .usage = "<src> <dst>", + .usage = "src_file_name dst_file_name", }, { .name = "append_file", - .handler = &handle_append_command, + .handler = handle_append_command, .mode = COMMAND_ANY, .help = "append a variable number of strings to a file", - .usage= "<file_name> [<string> ...]", + .usage= "file_name [string ...]", }, { .name = "meminfo", - .handler = &handle_meminfo_command, + .handler = handle_meminfo_command, .mode = COMMAND_ANY, - .help = "display available ram memory", + .help = "display free heap space", }, { .name = "rm", .mode = COMMAND_ANY, - .handler = &handle_rm_command, - .help = "remove a file", - .usage = "<file>", + .handler = handle_rm_command, + .help = "remove a directory or file", + .usage = "file_name", }, + + /* + * REVISIT shouldn't most, or all, these zylinjtag_*() + * entries be #ifdef ZY1000? If not, why so they have + * those names? + * + * Peek and poke are security holes -- they manipulate + * server-internal addresses. + */ + // jim handlers { .name = "peek", .mode = COMMAND_ANY, - .jim_handler = &zylinjtag_Jim_Command_peek, + .jim_handler = zylinjtag_Jim_Command_peek, .help = "peek at a memory address", - .usage = "<addr>", + .usage = "address", }, { .name = "poke", .mode = COMMAND_ANY, - .jim_handler = &zylinjtag_Jim_Command_poke, + .jim_handler = zylinjtag_Jim_Command_poke, .help = "poke at a memory address", - .usage = "<addr> <value>", + .usage = "address value", }, { .name = "ls", .mode = COMMAND_ANY, - .jim_handler = &zylinjtag_Jim_Command_ls, + .jim_handler = zylinjtag_Jim_Command_ls, .help = "show a listing of files", - .usage = "<dir>", + .usage = "dirname", }, { .name = "mac", .mode = COMMAND_ANY, - .jim_handler = &zylinjtag_Jim_Command_mac, + .jim_handler = zylinjtag_Jim_Command_mac, .help = "show MAC address", }, { .name = "ip", - .jim_handler = &zylinjtag_Jim_Command_ip, + .jim_handler = zylinjtag_Jim_Command_ip, .mode = COMMAND_ANY, .help = "show IP address", }, diff --git a/src/helper/log.c b/src/helper/log.c index 6adde4b..7450fef 100644 --- a/src/helper/log.c +++ b/src/helper/log.c @@ -286,13 +286,16 @@ COMMAND_HANDLER(handle_debug_level_command) if (debug_level >= LOG_LVL_DEBUG && server_use_pipes == 1) { - /* if we are enabling debug info then we need to write to a log file - * otherwise the pipe will get full and cause issues with gdb */ + /* if we are enabling debug info then we need to write to a + * log file otherwise the pipe will get full and cause issues + * with gdb + */ FILE* file = fopen("openocd.log", "w"); if (file) { log_output = file; - LOG_WARNING("enabling log output as we are using pipes"); + LOG_WARNING("enabling logfile output because " + "we are using pipes to talk to GDB."); } } @@ -319,17 +322,19 @@ COMMAND_HANDLER(handle_log_output_command) static struct command_registration log_command_handlers[] = { { .name = "log_output", - .handler = &handle_log_output_command, + .handler = handle_log_output_command, .mode = COMMAND_ANY, .help = "redirect logging to a file (default: stderr)", - .usage = "<file_name>", + .usage = "file_name", }, { .name = "debug_level", - .handler = &handle_debug_level_command, + .handler = handle_debug_level_command, .mode = COMMAND_ANY, - .help = "sets the verbosity level of debugging output", - .usage = "<level:0-3>", + .help = "Sets the verbosity level of debugging output. " + "0 shows errors only; 1 adds warnings; " + "2 (default) adds other info; 3 adds debugging.", + .usage = "number", }, COMMAND_REGISTRATION_DONE }; ----------------------------------------------------------------------- Summary of changes: src/helper/command.c | 54 ++++++++++++++++++++++++------------------ src/helper/ioutil.c | 63 +++++++++++++++++++++++++++++-------------------- src/helper/log.c | 21 ++++++++++------ 3 files changed, 81 insertions(+), 57 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: David B. <dbr...@us...> - 2010-01-09 19:28:55
|
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 1c5c57ec8e3f285cc81d4ad101edccb82b721beb (commit) from 70738bd75dbc122e380ff3288542ac4e73700eed (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 1c5c57ec8e3f285cc81d4ad101edccb82b721beb Author: David Brownell <dbr...@us...> Date: Sat Jan 9 08:58:38 2010 -0800 src/flash/nor: usage/help/doc updates Make "usage" messages use the same EBNF as the User's Guide; no angle brackets. Improve and correct various helptexts. Don't use "&function"; a function's name is its address. Remove a couple instances of pointless whitespace; shrink a few overlong lines; fix some bad indents. Add TODO list entry re full support for NAND/NOR bank names. Signed-off-by: David Brownell <dbr...@us...> diff --git a/TODO b/TODO index 73e4aa7..41d3457 100644 --- a/TODO +++ b/TODO @@ -215,6 +215,10 @@ https://lists.berlios.de/pipermail/openocd-development/2009-October/011506.html - NOR flash_write_unlock() does that between sectors - there may be other cases too +- Make sure all commands accept either a bank name or a bank number, + and be sure both identifiers show up in "flash banks" and "nand list". + Right now the user-friendly names are pretty much hidden... + @subsection thelistflashcfi CFI - finish implementing bus width/chip width handling (suggested by NC) diff --git a/doc/openocd.texi b/doc/openocd.texi index 47951c6..f8956a3 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -3737,7 +3737,7 @@ see the driver-specific documentation. @itemize @bullet @item @var{name} ... may be used to reference the flash bank -in other flash commands. +in other flash commands. A number is also available. @item @var{driver} ... identifies the controller driver associated with the flash bank being declared. This is usually @code{cfi} for external flash, or else @@ -4103,7 +4103,7 @@ plane (of up to 256KB), and it will be used automatically when you issue @command{flash erase_sector} or @command{flash erase_address} commands. @deffn Command {at91sam7 gpnvm} bitnum (@option{set}|@option{clear}) -Set or clear a ``General Purpose Non-Volatle Memory'' (GPNVM) +Set or clear a ``General Purpose Non-Volatile Memory'' (GPNVM) bit for the processor. Each processor has a number of such bits, used for controlling features such as brownout detection (so they are not truly general purpose). diff --git a/src/flash/nor/at91sam3.c b/src/flash/nor/at91sam3.c index 1194e25..5dacf6f 100644 --- a/src/flash/nor/at91sam3.c +++ b/src/flash/nor/at91sam3.c @@ -2288,7 +2288,7 @@ COMMAND_HANDLER(sam3_handle_info_command) return ERROR_FAIL; } } - // above garentees the "chip details" structure is valid + // above guarantees the "chip details" structure is valid // and thus, bank private areas are valid // and we have a SAM3 chip, what a concept! @@ -2386,7 +2386,7 @@ COMMAND_HANDLER(sam3_handle_gpnvm_command) if (0 == strcmp("show", CMD_ARGV[0])) { if (who == -1) { - showall: +showall: r = ERROR_OK; for (x = 0 ; x < pChip->details.n_gpnvms ; x++) { r = FLASHD_GetGPNVM(&(pChip->details.bank[0]), x, &v); @@ -2466,24 +2466,27 @@ COMMAND_HANDLER(sam3_handle_slowclk_command) static const struct command_registration at91sam3_exec_command_handlers[] = { { .name = "gpnvm", - .handler = &sam3_handle_gpnvm_command, + .handler = sam3_handle_gpnvm_command, .mode = COMMAND_EXEC, - .usage = "[(set|clear) [<bit_id>]]", - .help = "Without arguments, shows the gpnvm register; " - "otherwise, sets or clear the specified bit.", + .usage = "[('clr'|'set'|'show') bitnum]", + .help = "Without arguments, shows all bits in the gpnvm " + "register. Otherwise, clears, sets, or shows one " + "General Purpose Non-Volatile Memory (gpnvm) bit.", }, { .name = "info", - .handler = &sam3_handle_info_command, + .handler = sam3_handle_info_command, .mode = COMMAND_EXEC, - .help = "print information about the current sam3 chip", + .help = "Print information about the current at91sam3 chip" + "and its flash configuration.", }, { .name = "slowclk", - .handler = &sam3_handle_slowclk_command, + .handler = sam3_handle_slowclk_command, .mode = COMMAND_EXEC, - .usage = "<value>", - .help = "set the slowclock frequency (default 32768hz)", + .usage = "[clock_hz]", + .help = "Display or set the slowclock frequency " + "(default 32768 Hz).", }, COMMAND_REGISTRATION_DONE }; diff --git a/src/flash/nor/at91sam7.c b/src/flash/nor/at91sam7.c index 97d6b56..cca0cf2 100644 --- a/src/flash/nor/at91sam7.c +++ b/src/flash/nor/at91sam7.c @@ -1182,10 +1182,11 @@ COMMAND_HANDLER(at91sam7_handle_gpnvm_command) static const struct command_registration at91sam7_exec_command_handlers[] = { { .name = "gpnvm", - .handler = &at91sam7_handle_gpnvm_command, + .handler = at91sam7_handle_gpnvm_command, .mode = COMMAND_EXEC, - .usage = "gpnvm <bit> set | clear, " - "set or clear one gpnvm bit", + .help = "set or clear one General Purpose Non-Volatile Memory " + "(gpnvm) bit", + .usage = "bitnum ('set'|'clear')", }, COMMAND_REGISTRATION_DONE }; @@ -1200,15 +1201,15 @@ static const struct command_registration at91sam7_command_handlers[] = { }; struct flash_driver at91sam7_flash = { - .name = "at91sam7", - .commands = at91sam7_command_handlers, - .flash_bank_command = &at91sam7_flash_bank_command, - .erase = &at91sam7_erase, - .protect = &at91sam7_protect, - .write = &at91sam7_write, - .probe = &at91sam7_probe, - .auto_probe = &at91sam7_probe, - .erase_check = &at91sam7_erase_check, - .protect_check = &at91sam7_protect_check, - .info = &at91sam7_info, - }; + .name = "at91sam7", + .commands = at91sam7_command_handlers, + .flash_bank_command = at91sam7_flash_bank_command, + .erase = at91sam7_erase, + .protect = at91sam7_protect, + .write = at91sam7_write, + .probe = at91sam7_probe, + .auto_probe = at91sam7_probe, + .erase_check = at91sam7_erase_check, + .protect_check = at91sam7_protect_check, + .info = at91sam7_info, +}; diff --git a/src/flash/nor/lpc2900.c b/src/flash/nor/lpc2900.c index 13dd731..d39b2dd 100644 --- a/src/flash/nor/lpc2900.c +++ b/src/flash/nor/lpc2900.c @@ -953,43 +953,47 @@ static const struct command_registration lpc2900_exec_command_handlers[] = { .name = "signature", .handler = &lpc2900_handle_signature_command, .mode = COMMAND_EXEC, - .usage = "<bank>", - .help = "print device signature of flash bank", + .usage = "bank_id", + .help = "Calculate and display signature of flash bank.", }, { .name = "read_custom", .handler = &lpc2900_handle_read_custom_command, .mode = COMMAND_EXEC, - .usage = "<bank> <filename>", - .help = "read customer information from index sector to file", + .usage = "bank_id filename", + .help = "Copies 912 bytes of customer information " + "from index sector into file.", }, { .name = "password", .handler = &lpc2900_handle_password_command, .mode = COMMAND_EXEC, - .usage = "<bank> <password>", - .help = "enter password to enable 'dangerous' options", + .usage = "bank_id password", + .help = "Enter fixed password to enable 'dangerous' options.", }, { .name = "write_custom", .handler = &lpc2900_handle_write_custom_command, .mode = COMMAND_EXEC, - .usage = "<bank> <filename> [<type>]", - .help = "write customer info from file to index sector", + .usage = "bank_id filename ('bin'|'ihex'|'elf'|'s19')", + .help = "Copies 912 bytes of customer info from file " + "to index sector.", }, { .name = "secure_sector", .handler = &lpc2900_handle_secure_sector_command, .mode = COMMAND_EXEC, - .usage = "<bank> <first> <last>", - .help = "activate sector security for a range of sectors", + .usage = "bank_id first_sector last_sector", + .help = "Activate sector security for a range of sectors. " + "It will be effective after a power cycle.", }, { .name = "secure_jtag", .handler = &lpc2900_handle_secure_jtag_command, .mode = COMMAND_EXEC, - .usage = "<bank> <level>", - .help = "activate JTAG security", + .usage = "bank_id", + .help = "Disable the JTAG port. " + "It will be effective after a power cycle.", }, COMMAND_REGISTRATION_DONE }; diff --git a/src/flash/nor/stm32x.c b/src/flash/nor/stm32x.c index 9e08576..75dcf3b 100644 --- a/src/flash/nor/stm32x.c +++ b/src/flash/nor/stm32x.c @@ -1066,29 +1066,36 @@ COMMAND_HANDLER(stm32x_handle_options_write_command) return ERROR_TARGET_NOT_HALTED; } + /* REVISIT: ignores some options which we will display... + * and doesn't insist on the specified syntax. + */ + + /* OPT_RDWDGSW */ if (strcmp(CMD_ARGV[1], "SWWDG") == 0) { optionbyte |= (1 << 0); } - else + else /* REVISIT must be "HWWDG" then ... */ { optionbyte &= ~(1 << 0); } + /* OPT_RDRSTSTDBY */ if (strcmp(CMD_ARGV[2], "NORSTSTNDBY") == 0) { optionbyte |= (1 << 1); } - else + else /* REVISIT must be "RSTSTNDBY" then ... */ { optionbyte &= ~(1 << 1); } + /* OPT_RDRSTSTOP */ if (strcmp(CMD_ARGV[3], "NORSTSTOP") == 0) { optionbyte |= (1 << 2); } - else + else /* REVISIT must be "RSTSTOP" then ... */ { optionbyte &= ~(1 << 2); } @@ -1188,36 +1195,38 @@ static const struct command_registration stm32x_exec_command_handlers[] = { .name = "lock", .handler = &stm32x_handle_lock_command, .mode = COMMAND_EXEC, - .usage = "<bank>", - .help = "lock device", + .usage = "bank_id", + .help = "Lock entire flash device.", }, { .name = "unlock", .handler = &stm32x_handle_unlock_command, .mode = COMMAND_EXEC, - .usage = "<bank>", - .help = "unlock protected device", + .usage = "bank_id", + .help = "Unlock entire protected flash device.", }, { .name = "mass_erase", .handler = &stm32x_handle_mass_erase_command, .mode = COMMAND_EXEC, - .usage = "<bank>", - .help = "mass erase device", + .usage = "bank_id", + .help = "Erase entire flash device.", }, { .name = "options_read", .handler = &stm32x_handle_options_read_command, .mode = COMMAND_EXEC, - .usage = "<bank>", - .help = "read device option bytes", + .usage = "bank_id", + .help = "Read and display device option byte.", }, { .name = "options_write", .handler = &stm32x_handle_options_write_command, .mode = COMMAND_EXEC, - .usage = "<bank> <SWWDG | HWWDG> <RSTSTNDBY | NORSTSTNDBY> <RSTSTOP | NORSTSTOP>", - .help = "write device option bytes", + .usage = "bank_id ('SWWDG'|'HWWDG') " + "('RSTSTNDBY'|'NORSTSTNDBY') " + "('RSTSTOP'|'NORSTSTOP')", + .help = "Replace bits in device option byte.", }, COMMAND_REGISTRATION_DONE }; diff --git a/src/flash/nor/str9x.c b/src/flash/nor/str9x.c index 9cddb50..bf3f750 100644 --- a/src/flash/nor/str9x.c +++ b/src/flash/nor/str9x.c @@ -679,11 +679,12 @@ COMMAND_HANDLER(str9x_handle_flash_config_command) static const struct command_registration str9x_config_command_handlers[] = { { - .name = "disable_jtag", + .name = "flash_config", .handler = &str9x_handle_flash_config_command, .mode = COMMAND_EXEC, - .help = "configure str9x flash controller", - .usage = "<bank_id> <BBSR> <NBBSR> <BBADR> <NBBADR>", + .help = "Configure str9x flash controller, prior to " + "programming the flash.", + .usage = "bank_id BBSR NBBSR BBADR NBBADR", }, COMMAND_REGISTRATION_DONE }; diff --git a/src/flash/nor/tcl.c b/src/flash/nor/tcl.c index ad2b8f1..65523fb 100644 --- a/src/flash/nor/tcl.c +++ b/src/flash/nor/tcl.c @@ -654,89 +654,99 @@ void flash_set_dirty(void) static const struct command_registration flash_exec_command_handlers[] = { { .name = "probe", - .handler = &handle_flash_probe_command, + .handler = handle_flash_probe_command, .mode = COMMAND_EXEC, - .usage = "<bank>", - .help = "identify flash bank", + .usage = "bank_id", + .help = "Identify a flash bank.", }, { .name = "info", - .handler = &handle_flash_info_command, + .handler = handle_flash_info_command, .mode = COMMAND_EXEC, - .usage = "<bank>", - .help = "print bank information", + .usage = "bank_id", + .help = "Print information about a flash bank.", }, { .name = "erase_check", - .handler = &handle_flash_erase_check_command, + .handler = handle_flash_erase_check_command, .mode = COMMAND_EXEC, - .usage = "<bank>", - .help = "check erase state of sectors", + .usage = "bank_id", + .help = "Check erase state of all blocks in a " + "flash bank.", }, { .name = "protect_check", - .handler = &handle_flash_protect_check_command, + .handler = handle_flash_protect_check_command, .mode = COMMAND_EXEC, - .usage = "<bank>", - .help = "check protection state of sectors", + .usage = "bank_id", + .help = "Check protection state of all blocks in a " + "flash bank.", }, { .name = "erase_sector", - .handler = &handle_flash_erase_command, + .handler = handle_flash_erase_command, .mode = COMMAND_EXEC, - .usage = "<bank> <first> <last>", - .help = "erase sectors", + .usage = "bank_id first_sector_num last_sector_num", + .help = "Erase a range of sectors in a flash bank.", }, { .name = "erase_address", - .handler = &handle_flash_erase_address_command, + .handler = handle_flash_erase_address_command, .mode = COMMAND_EXEC, - .usage = "<address> <length>", - .help = "erase address range", - + .usage = "address length", + .help = "Erase flash blocks starting at address " + "and continuing for length bytes.", }, { .name = "fillw", - .handler = &handle_flash_fill_command, + .handler = handle_flash_fill_command, .mode = COMMAND_EXEC, - .usage = "<address> <word_pattern> <count>", - .help = "fill with pattern (no autoerase)", + .usage = "address value n", + .help = "Fill n words with 32-bit value, starting at " + "word address. (No autoerase.)", }, { .name = "fillh", - .handler = &handle_flash_fill_command, + .handler = handle_flash_fill_command, .mode = COMMAND_EXEC, - .usage = "<address> <halfword_pattern> <count>", - .help = "fill with pattern", + .usage = "address value n", + .help = "Fill n halfwords with 16-bit value, starting at " + "word address. (No autoerase.)", }, { .name = "fillb", - .handler = &handle_flash_fill_command, + .handler = handle_flash_fill_command, .mode = COMMAND_EXEC, - .usage = "<address> <byte_pattern> <count>", - .help = "fill with pattern", - + .usage = "address value n", + .help = "Fill n bytes with 8-bit value, starting at " + "word address. (No autoerase.)", }, { .name = "write_bank", - .handler = &handle_flash_write_bank_command, + .handler = handle_flash_write_bank_command, .mode = COMMAND_EXEC, - .usage = "<bank> <file> <offset>", - .help = "write binary data", + .usage = "bank_id filename offset", + .help = "Write binary data from file to flash bank, " + "starting at specified byte offset from the " + "beginning of the bank.", }, { .name = "write_image", - .handler = &handle_flash_write_image_command, + .handler = handle_flash_write_image_command, .mode = COMMAND_EXEC, - .usage = "[erase] [unlock] <file> [offset] [type]", - .help = "write an image to flash" + .usage = "[erase] [unlock] filename [offset [file_type]]", + .help = "Write an image to flash. Optionally first unprotect " + "and/or erase the region to be used. Allow optional " + "offset from beginning of bank (defaults to zero)", }, { .name = "protect", - .handler = &handle_flash_protect_command, + .handler = handle_flash_protect_command, .mode = COMMAND_EXEC, - .usage = "<bank> <first> <last> <on | off>", - .help = "set protection of sectors", + .usage = "bank_id first_sector [last_sector|'last'] " + "('on'|'off')", + .help = "Turn protection on or off for a range of sectors " + "in a given flash bank.", }, COMMAND_REGISTRATION_DONE }; @@ -893,8 +903,8 @@ static const struct command_registration flash_config_command_handlers[] = { .name = "bank", .handler = &handle_flash_bank_command, .mode = COMMAND_CONFIG, - .usage = "<name> <driver> <base> <size> " - "<chip_width> <bus_width> <target> " + .usage = "bank_id driver_name base_address size_bytes " + "chip_width_bytes bus_width_bytes target " "[driver_options ...]", .help = "Define a new bank with the given name, " "using the specified NOR flash driver.", @@ -903,19 +913,19 @@ static const struct command_registration flash_config_command_handlers[] = { .name = "init", .mode = COMMAND_CONFIG, .handler = &handle_flash_init_command, - .help = "initialize flash devices", + .help = "Initialize flash devices.", }, { .name = "banks", .mode = COMMAND_ANY, .handler = &handle_flash_banks_command, - .help = "return readable information about the flash banks", + .help = "Display table with information about flash banks.", }, { .name = "list", .mode = COMMAND_ANY, .jim_handler = &jim_flash_list, - .help = "returns a list of details about the flash banks", + .help = "Returns a list of details about the flash banks.", }, COMMAND_REGISTRATION_DONE }; ----------------------------------------------------------------------- Summary of changes: TODO | 4 ++ doc/openocd.texi | 4 +- src/flash/nor/at91sam3.c | 25 +++++++----- src/flash/nor/at91sam7.c | 31 ++++++++------- src/flash/nor/lpc2900.c | 28 ++++++++------ src/flash/nor/stm32x.c | 35 ++++++++++------ src/flash/nor/str9x.c | 7 ++- src/flash/nor/tcl.c | 96 +++++++++++++++++++++++++-------------------- 8 files changed, 131 insertions(+), 99 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: Spencer O. <nt...@us...> - 2010-01-09 15:43:50
|
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 70738bd75dbc122e380ff3288542ac4e73700eed (commit) from fc9a2d0e6f3270dc86f84749ad10dd79d97c8392 (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 70738bd75dbc122e380ff3288542ac4e73700eed Author: Spencer Oliver <nt...@us...> Date: Fri Jan 8 22:35:08 2010 +0000 MIPS: update arch_info access to match other targets - add target_to_mips32 and target_to_m4k to match test of codebase. - mips32_arch_state now shows if processer is running mips16e isa. Signed-off-by: Spencer Oliver <nt...@us...> diff --git a/src/target/mips32.c b/src/target/mips32.c index 0f6f9b0..5bb4104 100644 --- a/src/target/mips32.c +++ b/src/target/mips32.c @@ -38,6 +38,11 @@ char* mips32_core_reg_list[] = "status", "lo", "hi", "badvaddr", "cause", "pc" }; +const char *mips_isa_strings[] = +{ + "MIPS32", "MIPS16e" +}; + struct mips32_core_reg mips32_core_reg_list_arch_info[MIPS32NUMCOREREGS] = { {0, NULL, NULL}, @@ -103,7 +108,7 @@ int mips32_get_core_reg(struct reg *reg) int retval; struct mips32_core_reg *mips32_reg = reg->arch_info; struct target *target = mips32_reg->target; - struct mips32_common *mips32_target = target->arch_info; + struct mips32_common *mips32_target = target_to_mips32(target); if (target->state != TARGET_HALTED) { @@ -139,7 +144,7 @@ int mips32_read_core_reg(struct target *target, int num) struct mips32_core_reg *mips_core_reg; /* get pointers to arch-specific information */ - struct mips32_common *mips32 = target->arch_info; + struct mips32_common *mips32 = target_to_mips32(target); if ((num < 0) || (num >= MIPS32NUMCOREREGS)) return ERROR_INVALID_ARGUMENTS; @@ -159,7 +164,7 @@ int mips32_write_core_reg(struct target *target, int num) struct mips32_core_reg *mips_core_reg; /* get pointers to arch-specific information */ - struct mips32_common *mips32 = target->arch_info; + struct mips32_common *mips32 = target_to_mips32(target); if ((num < 0) || (num >= MIPS32NUMCOREREGS)) return ERROR_INVALID_ARGUMENTS; @@ -177,7 +182,7 @@ int mips32_write_core_reg(struct target *target, int num) int mips32_get_gdb_reg_list(struct target *target, struct reg **reg_list[], int *reg_list_size) { /* get pointers to arch-specific information */ - struct mips32_common *mips32 = target->arch_info; + struct mips32_common *mips32 = target_to_mips32(target); int i; /* include floating point registers */ @@ -203,7 +208,7 @@ int mips32_save_context(struct target *target) int i; /* get pointers to arch-specific information */ - struct mips32_common *mips32 = target->arch_info; + struct mips32_common *mips32 = target_to_mips32(target); struct mips_ejtag *ejtag_info = &mips32->ejtag_info; /* read core registers */ @@ -225,7 +230,7 @@ int mips32_restore_context(struct target *target) int i; /* get pointers to arch-specific information */ - struct mips32_common *mips32 = target->arch_info; + struct mips32_common *mips32 = target_to_mips32(target); struct mips_ejtag *ejtag_info = &mips32->ejtag_info; for (i = 0; i < MIPS32NUMCOREREGS; i++) @@ -244,15 +249,10 @@ int mips32_restore_context(struct target *target) int mips32_arch_state(struct target *target) { - struct mips32_common *mips32 = target->arch_info; - - if (mips32->common_magic != MIPS32_COMMON_MAGIC) - { - LOG_ERROR("BUG: called for a non-MIPS32 target"); - return ERROR_FAIL; - } + struct mips32_common *mips32 = target_to_mips32(target); - LOG_USER("target halted due to %s, pc: 0x%8.8" PRIx32 "", + LOG_USER("target halted in %s mode due to %s, pc: 0x%8.8" PRIx32 "", + mips_isa_strings[mips32->isa_mode], debug_reason_name(target), buf_get_u32(mips32->core_cache->reg_list[MIPS32_PC].value, 0, 32)); @@ -267,7 +267,7 @@ static const struct reg_arch_type mips32_reg_type = { struct reg_cache *mips32_build_reg_cache(struct target *target) { /* get pointers to arch-specific information */ - struct mips32_common *mips32 = target->arch_info; + struct mips32_common *mips32 = target_to_mips32(target); int num_regs = MIPS32NUMCOREREGS; struct reg_cache **cache_p = register_get_last_cache_p(&target->reg_cache); @@ -327,7 +327,7 @@ int mips32_run_algorithm(struct target *target, int num_mem_params, struct mem_p int mips32_examine(struct target *target) { - struct mips32_common *mips32 = target->arch_info; + struct mips32_common *mips32 = target_to_mips32(target); if (!target_was_examined(target)) { @@ -347,7 +347,7 @@ int mips32_examine(struct target *target) int mips32_configure_break_unit(struct target *target) { /* get pointers to arch-specific information */ - struct mips32_common *mips32 = target->arch_info; + struct mips32_common *mips32 = target_to_mips32(target); int retval; uint32_t dcr, bpinfo; int i; @@ -359,7 +359,7 @@ int mips32_configure_break_unit(struct target *target) if ((retval = target_read_u32(target, EJTAG_DCR, &dcr)) != ERROR_OK) return retval; - if (dcr & (1 << 16)) + if (dcr & EJTAG_DCR_IB) { /* get number of inst breakpoints */ if ((retval = target_read_u32(target, EJTAG_IBS, &bpinfo)) != ERROR_OK) @@ -378,7 +378,7 @@ int mips32_configure_break_unit(struct target *target) return retval; } - if (dcr & (1 << 17)) + if (dcr & EJTAG_DCR_DB) { /* get number of data breakpoints */ if ((retval = target_read_u32(target, EJTAG_DBS, &bpinfo)) != ERROR_OK) @@ -416,19 +416,19 @@ int mips32_enable_interrupts(struct target *target, int enable) if (enable) { - if (!(dcr & (1 << 4))) + if (!(dcr & EJTAG_DCR_INTE)) { /* enable interrupts */ - dcr |= (1 << 4); + dcr |= EJTAG_DCR_INTE; update = 1; } } else { - if (dcr & (1 << 4)) + if (dcr & EJTAG_DCR_INTE) { /* disable interrupts */ - dcr &= ~(1 << 4); + dcr &= ~EJTAG_DCR_INTE; update = 1; } } diff --git a/src/target/mips32.h b/src/target/mips32.h index 4fe61bc..b731c68 100644 --- a/src/target/mips32.h +++ b/src/target/mips32.h @@ -26,7 +26,6 @@ #include "target.h" #include "mips32_pracc.h" - #define MIPS32_COMMON_MAGIC 0xB320B320 /* offsets into mips32 core register cache */ @@ -36,10 +35,17 @@ enum MIPS32NUMCOREREGS }; +enum mips32_isa_mode +{ + MIPS32_ISA_MIPS32 = 0, + MIPS32_ISA_MIPS16E = 1, +}; + +extern const char *mips_isa_strings[]; + struct mips32_comparator { int used; - //int type; uint32_t bp_value; uint32_t reg_address; }; @@ -51,6 +57,7 @@ struct mips32_common struct reg_cache *core_cache; struct mips_ejtag ejtag_info; uint32_t core_regs[MIPS32NUMCOREREGS]; + enum mips32_isa_mode isa_mode; int bp_scanned; int num_inst_bpoints; @@ -65,6 +72,12 @@ struct mips32_common int (*write_core_reg)(struct target *target, int num); }; +static inline struct mips32_common * +target_to_mips32(struct target *target) +{ + return target->arch_info; +} + struct mips32_core_reg { uint32_t num; diff --git a/src/target/mips32_pracc.c b/src/target/mips32_pracc.c index 52d31bd..11d5a43 100644 --- a/src/target/mips32_pracc.c +++ b/src/target/mips32_pracc.c @@ -810,7 +810,7 @@ int mips32_pracc_write_regs(struct mips_ejtag *ejtag_info, uint32_t *regs) MIPS32_LW(2,36*4,1), /* lw $2,36*4($1) */ MIPS32_MTC0(2,13,0), /* move $2 to cause*/ MIPS32_LW(2,37*4,1), /* lw $2,37*4($1) */ - MIPS32_MTC0(2,24,0), /* move $2 to pc */ + MIPS32_MTC0(2,24,0), /* move $2 to depc (pc) */ MIPS32_LW(2,2*4,1), /* lw $2,2*4($1) */ MIPS32_LW(1,0,15), /* lw $1,($15) */ @@ -884,7 +884,7 @@ int mips32_pracc_read_regs(struct mips_ejtag *ejtag_info, uint32_t *regs) MIPS32_SW(2,35*4,1), /* sw $2,35*4($1) */ MIPS32_MFC0(2,13,0), /* move cause to $2 */ MIPS32_SW(2,36*4,1), /* sw $2,36*4($1) */ - MIPS32_MFC0(2,24,0), /* move pc to $2 */ + MIPS32_MFC0(2,24,0), /* move depc (pc) to $2 */ MIPS32_SW(2,37*4,1), /* sw $2,37*4($1) */ MIPS32_LW(2,0,15), /* lw $2,($15) */ diff --git a/src/target/mips_ejtag.c b/src/target/mips_ejtag.c index 58bd392..336adb5 100644 --- a/src/target/mips_ejtag.c +++ b/src/target/mips_ejtag.c @@ -264,16 +264,15 @@ int mips_ejtag_init(struct mips_ejtag *ejtag_info) break; } LOG_DEBUG("EJTAG: features:%s%s%s%s%s%s%s", - ejtag_info->impcode & (1 << 28) ? " R3k": " R4k", - ejtag_info->impcode & (1 << 24) ? " DINT": "", - ejtag_info->impcode & (1 << 22) ? " ASID_8": "", - ejtag_info->impcode & (1 << 21) ? " ASID_6": "", - ejtag_info->impcode & (1 << 16) ? " MIPS16": "", - ejtag_info->impcode & (1 << 14) ? " noDMA": " DMA", - ejtag_info->impcode & (1 << 0) ? " MIPS64": " MIPS32" -); - - if ((ejtag_info->impcode & (1 << 14)) == 0) + ejtag_info->impcode & EJTAG_IMP_R3K ? " R3k" : " R4k", + ejtag_info->impcode & EJTAG_IMP_DINT ? " DINT" : "", + ejtag_info->impcode & (1 << 22) ? " ASID_8" : "", + ejtag_info->impcode & (1 << 21) ? " ASID_6" : "", + ejtag_info->impcode & EJTAG_IMP_MIPS16 ? " MIPS16" : "", + ejtag_info->impcode & EJTAG_IMP_NODMA ? " noDMA" : " DMA", + ejtag_info->impcode & EJTAG_DCR_MIPS64 ? " MIPS64" : " MIPS32"); + + if ((ejtag_info->impcode & EJTAG_IMP_NODMA) == 0) LOG_DEBUG("EJTAG: DMA Access Mode Support Enabled"); /* set initial state for ejtag control reg */ diff --git a/src/target/mips_ejtag.h b/src/target/mips_ejtag.h index e9da39e..2f62f2b 100644 --- a/src/target/mips_ejtag.h +++ b/src/target/mips_ejtag.h @@ -40,7 +40,7 @@ #define EJTAG_INST_TCBDATA 0x12 #define EJTAG_INST_BYPASS 0xFF -/* debug control register bits ECR */ +/* ejtag control register bits ECR */ #define EJTAG_CTRL_TOF (1 << 1) #define EJTAG_CTRL_TIF (1 << 2) #define EJTAG_CTRL_BRKST (1 << 3) @@ -87,11 +87,20 @@ #define EJTAG_DEBUG_DBD (1 << 31) /* implementaion register bits */ +#define EJTAG_IMP_R3K (1 << 28) +#define EJTAG_IMP_DINT (1 << 24) #define EJTAG_IMP_NODMA (1 << 14) #define EJTAG_IMP_MIPS16 (1 << 16) +#define EJTAG_DCR_MIPS64 (1 << 0) -/* breakpoint support */ +/* Debug Control Register DCR */ #define EJTAG_DCR 0xFF300000 +#define EJTAG_DCR_ENM (1 << 29) +#define EJTAG_DCR_DB (1 << 17) +#define EJTAG_DCR_IB (1 << 16) +#define EJTAG_DCR_INTE (1 << 4) + +/* breakpoint support */ #define EJTAG_IBS 0xFF301000 #define EJTAG_IBA1 0xFF301100 #define EJTAG_DBS 0xFF302000 @@ -107,7 +116,6 @@ struct mips_ejtag struct jtag_tap *tap; uint32_t impcode; uint32_t idcode; - /*int use_dma;*/ uint32_t ejtag_ctrl; }; diff --git a/src/target/mips_m4k.c b/src/target/mips_m4k.c index f229690..1a65c50 100644 --- a/src/target/mips_m4k.c +++ b/src/target/mips_m4k.c @@ -107,12 +107,12 @@ int mips_m4k_examine_debug_reason(struct target *target) } /* get info about data breakpoint support */ - if ((retval = target_read_u32(target, 0xFF302000, &break_status)) != ERROR_OK) + if ((retval = target_read_u32(target, EJTAG_DBS, &break_status)) != ERROR_OK) return retval; if (break_status & 0x1f) { /* we have halted on a breakpoint */ - if ((retval = target_write_u32(target, 0xFF302000, 0)) != ERROR_OK) + if ((retval = target_write_u32(target, EJTAG_DBS, 0)) != ERROR_OK) return retval; target->debug_reason = DBG_REASON_WATCHPOINT; } @@ -123,14 +123,14 @@ int mips_m4k_examine_debug_reason(struct target *target) int mips_m4k_debug_entry(struct target *target) { - struct mips32_common *mips32 = target->arch_info; + struct mips32_common *mips32 = target_to_mips32(target); struct mips_ejtag *ejtag_info = &mips32->ejtag_info; uint32_t debug_reg; /* read debug register */ mips_ejtag_read_debug(ejtag_info, &debug_reg); - /* make sure break uit configured */ + /* make sure break unit configured */ mips32_configure_break_unit(target); /* attempt to find halt reason */ @@ -145,9 +145,21 @@ int mips_m4k_debug_entry(struct target *target) mips32_save_context(target); + /* default to mips32 isa, it will be changed below if required */ + mips32->isa_mode = MIPS32_ISA_MIPS32; + + if (ejtag_info->impcode & EJTAG_IMP_MIPS16) + { + if (buf_get_u32(mips32->core_cache->reg_list[MIPS32_PC].value, 0, 32) & 0x01) + { + /* core is running mips16e isa */ + mips32->isa_mode = MIPS32_ISA_MIPS16E; + } + } + LOG_DEBUG("entered debug state at PC 0x%" PRIx32 ", target->state: %s", - *(uint32_t*)(mips32->core_cache->reg_list[MIPS32_PC].value), - target_state_name(target)); + buf_get_u32(mips32->core_cache->reg_list[MIPS32_PC].value, 0, 32), + target_state_name(target)); return ERROR_OK; } @@ -155,7 +167,7 @@ int mips_m4k_debug_entry(struct target *target) int mips_m4k_poll(struct target *target) { int retval; - struct mips32_common *mips32 = target->arch_info; + struct mips32_common *mips32 = target_to_mips32(target); struct mips_ejtag *ejtag_info = &mips32->ejtag_info; uint32_t ejtag_ctrl = ejtag_info->ejtag_ctrl; @@ -215,7 +227,7 @@ int mips_m4k_poll(struct target *target) int mips_m4k_halt(struct target *target) { - struct mips32_common *mips32 = target->arch_info; + struct mips32_common *mips32 = target_to_mips32(target); struct mips_ejtag *ejtag_info = &mips32->ejtag_info; LOG_DEBUG("target->state: %s", @@ -260,7 +272,7 @@ int mips_m4k_halt(struct target *target) int mips_m4k_assert_reset(struct target *target) { - struct mips32_common *mips32 = target->arch_info; + struct mips32_common *mips32 = target_to_mips32(target); struct mips_ejtag *ejtag_info = &mips32->ejtag_info; LOG_DEBUG("target->state: %s", @@ -339,7 +351,7 @@ int mips_m4k_soft_reset_halt(struct target *target) int mips_m4k_single_step_core(struct target *target) { - struct mips32_common *mips32 = target->arch_info; + struct mips32_common *mips32 = target_to_mips32(target); struct mips_ejtag *ejtag_info = &mips32->ejtag_info; /* configure single step mode */ @@ -358,7 +370,7 @@ int mips_m4k_single_step_core(struct target *target) int mips_m4k_resume(struct target *target, int current, uint32_t address, int handle_breakpoints, int debug_execution) { - struct mips32_common *mips32 = target->arch_info; + struct mips32_common *mips32 = target_to_mips32(target); struct mips_ejtag *ejtag_info = &mips32->ejtag_info; struct breakpoint *breakpoint = NULL; uint32_t resume_pc; @@ -430,7 +442,7 @@ int mips_m4k_resume(struct target *target, int current, uint32_t address, int ha int mips_m4k_step(struct target *target, int current, uint32_t address, int handle_breakpoints) { /* get pointers to arch-specific information */ - struct mips32_common *mips32 = target->arch_info; + struct mips32_common *mips32 = target_to_mips32(target); struct mips_ejtag *ejtag_info = &mips32->ejtag_info; struct breakpoint *breakpoint = NULL; @@ -494,7 +506,7 @@ void mips_m4k_enable_breakpoints(struct target *target) int mips_m4k_set_breakpoint(struct target *target, struct breakpoint *breakpoint) { - struct mips32_common *mips32 = target->arch_info; + struct mips32_common *mips32 = target_to_mips32(target); struct mips32_comparator * comparator_list = mips32->inst_break_list; int retval; @@ -585,8 +597,8 @@ int mips_m4k_set_breakpoint(struct target *target, struct breakpoint *breakpoint int mips_m4k_unset_breakpoint(struct target *target, struct breakpoint *breakpoint) { /* get pointers to arch-specific information */ - struct mips32_common *mips32 = target->arch_info; - struct mips32_comparator * comparator_list = mips32->inst_break_list; + struct mips32_common *mips32 = target_to_mips32(target); + struct mips32_comparator *comparator_list = mips32->inst_break_list; int retval; if (!breakpoint->set) @@ -659,7 +671,7 @@ int mips_m4k_unset_breakpoint(struct target *target, struct breakpoint *breakpoi int mips_m4k_add_breakpoint(struct target *target, struct breakpoint *breakpoint) { - struct mips32_common *mips32 = target->arch_info; + struct mips32_common *mips32 = target_to_mips32(target); if (breakpoint->type == BKPT_HARD) { @@ -680,7 +692,7 @@ int mips_m4k_add_breakpoint(struct target *target, struct breakpoint *breakpoint int mips_m4k_remove_breakpoint(struct target *target, struct breakpoint *breakpoint) { /* get pointers to arch-specific information */ - struct mips32_common *mips32 = target->arch_info; + struct mips32_common *mips32 = target_to_mips32(target); if (target->state != TARGET_HALTED) { @@ -701,8 +713,8 @@ int mips_m4k_remove_breakpoint(struct target *target, struct breakpoint *breakpo int mips_m4k_set_watchpoint(struct target *target, struct watchpoint *watchpoint) { - struct mips32_common *mips32 = target->arch_info; - struct mips32_comparator * comparator_list = mips32->data_break_list; + struct mips32_common *mips32 = target_to_mips32(target); + struct mips32_comparator *comparator_list = mips32->data_break_list; int wp_num = 0; /* * watchpoint enabled, ignore all byte lanes in value register @@ -769,8 +781,8 @@ int mips_m4k_set_watchpoint(struct target *target, struct watchpoint *watchpoint int mips_m4k_unset_watchpoint(struct target *target, struct watchpoint *watchpoint) { /* get pointers to arch-specific information */ - struct mips32_common *mips32 = target->arch_info; - struct mips32_comparator * comparator_list = mips32->data_break_list; + struct mips32_common *mips32 = target_to_mips32(target); + struct mips32_comparator *comparator_list = mips32->data_break_list; if (!watchpoint->set) { @@ -794,7 +806,7 @@ int mips_m4k_unset_watchpoint(struct target *target, struct watchpoint *watchpoi int mips_m4k_add_watchpoint(struct target *target, struct watchpoint *watchpoint) { - struct mips32_common *mips32 = target->arch_info; + struct mips32_common *mips32 = target_to_mips32(target); if (mips32->num_data_bpoints_avail < 1) { @@ -811,7 +823,7 @@ int mips_m4k_add_watchpoint(struct target *target, struct watchpoint *watchpoint int mips_m4k_remove_watchpoint(struct target *target, struct watchpoint *watchpoint) { /* get pointers to arch-specific information */ - struct mips32_common *mips32 = target->arch_info; + struct mips32_common *mips32 = target_to_mips32(target); if (target->state != TARGET_HALTED) { @@ -844,7 +856,7 @@ void mips_m4k_enable_watchpoints(struct target *target) int mips_m4k_read_memory(struct target *target, uint32_t address, uint32_t size, uint32_t count, uint8_t *buffer) { - struct mips32_common *mips32 = target->arch_info; + struct mips32_common *mips32 = target_to_mips32(target); struct mips_ejtag *ejtag_info = &mips32->ejtag_info; LOG_DEBUG("address: 0x%8.8" PRIx32 ", size: 0x%8.8" PRIx32 ", count: 0x%8.8" PRIx32 "", address, size, count); @@ -876,7 +888,7 @@ int mips_m4k_read_memory(struct target *target, uint32_t address, uint32_t size, int mips_m4k_write_memory(struct target *target, uint32_t address, uint32_t size, uint32_t count, uint8_t *buffer) { - struct mips32_common *mips32 = target->arch_info; + struct mips32_common *mips32 = target_to_mips32(target); struct mips_ejtag *ejtag_info = &mips32->ejtag_info; LOG_DEBUG("address: 0x%8.8" PRIx32 ", size: 0x%8.8" PRIx32 ", count: 0x%8.8" PRIx32 "", address, size, count); @@ -923,7 +935,7 @@ int mips_m4k_init_arch_info(struct target *target, struct mips_m4k_common *mips_ int mips_m4k_target_create(struct target *target, Jim_Interp *interp) { - struct mips_m4k_common *mips_m4k = calloc(1,sizeof(struct mips_m4k_common)); + struct mips_m4k_common *mips_m4k = calloc(1, sizeof(struct mips_m4k_common)); mips_m4k_init_arch_info(target, mips_m4k, target->tap); @@ -933,7 +945,7 @@ int mips_m4k_target_create(struct target *target, Jim_Interp *interp) int mips_m4k_examine(struct target *target) { int retval; - struct mips32_common *mips32 = target->arch_info; + struct mips32_common *mips32 = target_to_mips32(target); struct mips_ejtag *ejtag_info = &mips32->ejtag_info; uint32_t idcode = 0; @@ -963,7 +975,7 @@ int mips_m4k_examine(struct target *target) int mips_m4k_bulk_write_memory(struct target *target, uint32_t address, uint32_t count, uint8_t *buffer) { - struct mips32_common *mips32 = target->arch_info; + struct mips32_common *mips32 = target_to_mips32(target); struct mips_ejtag *ejtag_info = &mips32->ejtag_info; struct working_area *source; int retval; diff --git a/src/target/mips_m4k.h b/src/target/mips_m4k.h index c5f9be2..4fe14a0 100644 --- a/src/target/mips_m4k.h +++ b/src/target/mips_m4k.h @@ -35,6 +35,13 @@ struct mips_m4k_common struct mips32_common mips32_common; }; +static inline struct mips_m4k_common * +target_to_m4k(struct target *target) +{ + return container_of(target->arch_info, + struct mips_m4k_common, mips32_common); +} + int mips_m4k_bulk_write_memory(struct target *target, uint32_t address, uint32_t count, uint8_t *buffer); ----------------------------------------------------------------------- Summary of changes: src/target/mips32.c | 46 +++++++++++++++--------------- src/target/mips32.h | 17 ++++++++++- src/target/mips32_pracc.c | 4 +- src/target/mips_ejtag.c | 19 ++++++------ src/target/mips_ejtag.h | 14 +++++++-- src/target/mips_m4k.c | 68 ++++++++++++++++++++++++++------------------ src/target/mips_m4k.h | 7 ++++ 7 files changed, 107 insertions(+), 68 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: David B. <dbr...@us...> - 2010-01-09 10:03:00
|
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 fc9a2d0e6f3270dc86f84749ad10dd79d97c8392 (commit) from aafd3877e6fbc1745dbfc5d4f54a2c7efe8cc3d6 (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 fc9a2d0e6f3270dc86f84749ad10dd79d97c8392 Author: David Brownell <dbr...@us...> Date: Sat Jan 9 00:55:41 2010 -0800 src/server: usage/help/doc updates Make "usage" messages use the same EBNF as the User's Guide; no angle brackets. Improve and correct various helptexts. Specifically for the port commands, clarify that the number is optional, and omitting it causes the current number to be displayed. Don't use "&function"; a function's name is its address. Remove a couple instances of pointless whitespace; shrink a few overlong lines. Signed-off-by: David Brownell <dbr...@us...> diff --git a/doc/openocd.texi b/doc/openocd.texi index 3adc33a..47951c6 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -1721,17 +1721,17 @@ In such cases, just specify the relevant port number as zero. If you disable all access through TCP/IP, you will need to use the command line @option{-pipe} option. -@deffn {Command} gdb_port (number) +@deffn {Command} gdb_port [number] @cindex GDB server Specify or query the first port used for incoming GDB connections. The GDB port for the first target will be gdb_port, the second target will listen on gdb_port + 1, and so on. When not specified during the configuration stage, the port @var{number} defaults to 3333. -When specified as zero, this port is not activated. +When specified as zero, GDB remote access ports are not activated. @end deffn -@deffn {Command} tcl_port (number) +@deffn {Command} tcl_port [number] Specify or query the port used for a simplified RPC connection that can be used by clients to issue TCL commands and get the output from the Tcl engine. @@ -1741,7 +1741,7 @@ the port @var{number} defaults to 6666. When specified as zero, this port is not activated. @end deffn -@deffn {Command} telnet_port (number) +@deffn {Command} telnet_port [number] Specify or query the port on which to listen for incoming telnet connections. This port is intended for interaction with one human through TCL commands. diff --git a/src/server/gdb_server.c b/src/server/gdb_server.c index 96b9dbf..08daa68 100644 --- a/src/server/gdb_server.c +++ b/src/server/gdb_server.c @@ -2412,7 +2412,7 @@ COMMAND_HANDLER(handle_gdb_breakpoint_override_command) static const struct command_registration gdb_command_handlers[] = { { .name = "gdb_sync", - .handler = &handle_gdb_sync_command, + .handler = handle_gdb_sync_command, .mode = COMMAND_ANY, .help = "next stepi will return immediately allowing " "GDB to fetch register state without affecting " @@ -2420,40 +2420,41 @@ static const struct command_registration gdb_command_handlers[] = { }, { .name = "gdb_port", - .handler = &handle_gdb_port_command, + .handler = handle_gdb_port_command, .mode = COMMAND_ANY, - .help = "daemon configuration command gdb_port. No arguments reports " - "GDB port.", - .usage = "<port>", + .help = "Display or specify base port on which to listen " + "for incoming GDB connections. " + "No arguments reports GDB port; zero disables.", + .usage = "[port_num]", }, { .name = "gdb_memory_map", - .handler = &handle_gdb_memory_map_command, + .handler = handle_gdb_memory_map_command, .mode = COMMAND_CONFIG, .help = "enable or disable memory map", - .usage = "enable|disable" + .usage = "('enable'|'disable')" }, { .name = "gdb_flash_program", - .handler = &handle_gdb_flash_program_command, + .handler = handle_gdb_flash_program_command, .mode = COMMAND_CONFIG, .help = "enable or disable flash program", - .usage = "enable|disable" + .usage = "('enable'|'disable')" }, { .name = "gdb_report_data_abort", - .handler = &handle_gdb_report_data_abort_command, + .handler = handle_gdb_report_data_abort_command, .mode = COMMAND_CONFIG, .help = "enable or disable reporting data aborts", - .usage = "enable|disable" + .usage = "('enable'|'disable')" }, { .name = "gdb_breakpoint_override", - .handler = &handle_gdb_breakpoint_override_command, + .handler = handle_gdb_breakpoint_override_command, .mode = COMMAND_EXEC, - .help = "force type of breakpoint " - "used by gdb 'break' commands.", - .usage = "hard|soft|disable", + .help = "Display or specify type of breakpoint " + "to be used by gdb 'break' commands.", + .usage = "('hard'|'soft'|'disable')" }, COMMAND_REGISTRATION_DONE }; diff --git a/src/server/httpd.c b/src/server/httpd.c index 9554ff0..af8c3c8 100644 --- a/src/server/httpd.c +++ b/src/server/httpd.c @@ -118,11 +118,11 @@ static int httpd_Jim_Command_writeform(Jim_Interp *interp, int argc, // Find length const char *data; int actual; - int retcode; - - const char *script = alloc_printf("set dummy_val $httppostdata(%s); set dummy_val", + const char *script = alloc_printf( + "set dummy_val $httppostdata(%s); set dummy_val", name); + retcode = Jim_Eval_Named(interp, script, __FILE__, __LINE__); free((void *) script); if (retcode != JIM_OK) @@ -154,27 +154,25 @@ httpd_Jim_Command_formfetch(Jim_Interp *interp, int argc, Jim_Obj *const *argv) { - if (argc != 2) - { - Jim_WrongNumArgs(interp, 1, argv, "method ?CMD_ARGV ...?"); - return JIM_ERR; - } - char *name = (char*)Jim_GetString(argv[1], NULL); - - - const char *script = alloc_printf("set dummy_val $httppostdata(%s); set dummy_val", - name); - int retcode = Jim_Eval_Named(interp, script, __FILE__, __LINE__); - free((void *) script); - if (retcode != JIM_OK) - { - Jim_SetResult(interp, Jim_NewEmptyStringObj(interp)); - } else - { - Jim_SetResult(interp, Jim_GetResult(interp)); - } - - return JIM_OK; + if (argc != 2) + { + Jim_WrongNumArgs(interp, 1, argv, "method ?CMD_ARGV ...?"); + return JIM_ERR; + } + + char *name = (char*)Jim_GetString(argv[1], NULL); + const char *script = alloc_printf( + "set dummy_val $httppostdata(%s); set dummy_val", + name); + int retcode = Jim_Eval_Named(interp, script, __FILE__, __LINE__); + + free((void *) script); + if (retcode != JIM_OK) + Jim_SetResult(interp, Jim_NewEmptyStringObj(interp)); + else + Jim_SetResult(interp, Jim_GetResult(interp)); + + return JIM_OK; } struct httpd_request @@ -467,16 +465,16 @@ static struct MHD_Daemon * d; static const struct command_registration httpd_command_handlers[] = { { .name = "formfetch", - .jim_handler = &httpd_Jim_Command_formfetch, + .jim_handler = httpd_Jim_Command_formfetch, .mode = COMMAND_EXEC, - .usage = "<parameter_name>", + .usage = "parameter_name", .help = "Reads a posted form value.", }, { .name = "writeform", - .jim_handler = &httpd_Jim_Command_writeform, + .jim_handler = httpd_Jim_Command_writeform, .mode = COMMAND_EXEC, - .usage = "<parameter_name> <file>", + .usage = "parameter_name filename", .help = "Writes a form value to a file.", }, COMMAND_REGISTRATION_DONE diff --git a/src/server/tcl_server.c b/src/server/tcl_server.c index a772c0a..a88c436 100644 --- a/src/server/tcl_server.c +++ b/src/server/tcl_server.c @@ -181,11 +181,12 @@ COMMAND_HANDLER(handle_tcl_port_command) static const struct command_registration tcl_command_handlers[] = { { .name = "tcl_port", - .handler = &handle_tcl_port_command, + .handler = handle_tcl_port_command, .mode = COMMAND_CONFIG, - .help = "port on which to listen " - "for incoming TCL syntax", - .usage = "<port>", + .help = "Specify port on which to listen " + "for incoming Tcl syntax. " + "No arguments reports Tcl port; zero disables.", + .usage = "[port_num]", }, COMMAND_REGISTRATION_DONE }; diff --git a/src/server/telnet_server.c b/src/server/telnet_server.c index 92e7480..6f26f0a 100644 --- a/src/server/telnet_server.c +++ b/src/server/telnet_server.c @@ -619,17 +619,18 @@ COMMAND_HANDLER(handle_exit_command) static const struct command_registration telnet_command_handlers[] = { { .name = "exit", - .handler = &handle_exit_command, + .handler = handle_exit_command, .mode = COMMAND_EXEC, .help = "exit telnet session", }, { .name = "telnet_port", - .handler = &handle_telnet_port_command, + .handler = handle_telnet_port_command, .mode = COMMAND_ANY, - .help = "port on which to listen " - "for incoming telnet connections", - .usage = "<port>", + .help = "Specify port on which to listen " + "for incoming telnet connections. " + "No arguments reports telnet port; zero disables.", + .usage = "[port_num]", }, COMMAND_REGISTRATION_DONE }; ----------------------------------------------------------------------- Summary of changes: doc/openocd.texi | 8 +++--- src/server/gdb_server.c | 31 +++++++++++++------------ src/server/httpd.c | 54 +++++++++++++++++++++---------------------- src/server/tcl_server.c | 9 ++++--- src/server/telnet_server.c | 11 +++++---- 5 files changed, 57 insertions(+), 56 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: David B. <dbr...@us...> - 2010-01-09 09:10:38
|
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 aafd3877e6fbc1745dbfc5d4f54a2c7efe8cc3d6 (commit) via 973cd9a299d904ab22bb089319beab65c339d783 (commit) via 2a76c1bcf94f8ed00c9e744a5405d0ac07cdc85a (commit) via ae710059291ba9830a9b20d899bdef6a5122dd73 (commit) from b800eb0336a190ed53da90a2b7216a35bfbfdb23 (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 aafd3877e6fbc1745dbfc5d4f54a2c7efe8cc3d6 Author: Masaki Muranaka <mo...@mo...> Date: Sat Jan 9 15:41:31 2010 +0900 buildfix on MacOS Recent Apple gcc versions use __APPLE__ instead of __DARWIN__; accept that too. Also use #warning, not #warn; neither is standard, but most CPP versions require it to be spelled out. Signed-off-by: David Brownell <dbr...@us...> diff --git a/src/helper/command.c b/src/helper/command.c index ab82785..0ddcd01 100644 --- a/src/helper/command.c +++ b/src/helper/command.c @@ -1361,7 +1361,7 @@ struct command_context* command_init(const char *startup_tcl, Jim_Interp *interp HostOs = "winxx"; #elif defined(__linux__) HostOs = "linux"; -#elif defined(__DARWIN__) +#elif defined(__APPLE__) || defined(__DARWIN__) HostOs = "darwin"; #elif defined(__CYGWIN__) HostOs = "cygwin"; @@ -1370,7 +1370,7 @@ struct command_context* command_init(const char *startup_tcl, Jim_Interp *interp #elif defined(__ECOS) HostOs = "ecos"; #else -#warn unrecognized host OS... +#warning "Unrecognized host OS..." HostOs = "other"; #endif Jim_SetGlobalVariableStr(interp, "ocd_HOSTOS", commit 973cd9a299d904ab22bb089319beab65c339d783 Author: David Brownell <dbr...@us...> Date: Fri Jan 8 23:23:55 2010 -0800 PLD: usage/help updates Make "usage" messages use the same EBNF as the User's Guide; no angle brackets. Improve and correct various helptexts. Don't use "&function"; a function's name is its address. Remove a couple instances of pointless whitespace, shrink a few overlong lines. Signed-off-by: David Brownell <dbr...@us...> diff --git a/src/pld/pld.c b/src/pld/pld.c index 6a0bd93..5ed7596 100644 --- a/src/pld/pld.c +++ b/src/pld/pld.c @@ -76,7 +76,7 @@ COMMAND_HANDLER(handle_pld_device_command) /* register pld specific commands */ int retval; if (pld_drivers[i]->commands) { - retval = register_commands(CMD_CTX, NULL, + retval = register_commands(CMD_CTX, NULL, pld_drivers[i]->commands); if (ERROR_OK != retval) { @@ -89,10 +89,12 @@ COMMAND_HANDLER(handle_pld_device_command) c->driver = pld_drivers[i]; c->next = NULL; - retval = CALL_COMMAND_HANDLER(pld_drivers[i]->pld_device_command, c); + retval = CALL_COMMAND_HANDLER( + pld_drivers[i]->pld_device_command, c); if (ERROR_OK != retval) { - LOG_ERROR("'%s' driver rejected pld device", CMD_ARGV[0]); + LOG_ERROR("'%s' driver rejected pld device", + CMD_ARGV[0]); free(c); return ERROR_OK; } @@ -191,16 +193,16 @@ COMMAND_HANDLER(handle_pld_load_command) static const struct command_registration pld_exec_command_handlers[] = { { .name = "devices", - .handler = &handle_pld_devices_command, + .handler = handle_pld_devices_command, .mode = COMMAND_EXEC, .help = "list configured pld devices", }, { .name = "load", - .handler = &handle_pld_load_command, + .handler = handle_pld_load_command, .mode = COMMAND_EXEC, .help = "load configuration file into PLD", - .usage = "<device#> <file>", + .usage = "pld_num filename", }, COMMAND_REGISTRATION_DONE }; @@ -234,14 +236,14 @@ static const struct command_registration pld_config_command_handlers[] = { { .name = "device", .mode = COMMAND_CONFIG, - .handler = &handle_pld_device_command, + .handler = handle_pld_device_command, .help = "configure a PLD device", - .usage = "<driver> ...", + .usage = "driver_name [driver_args ... ]", }, { .name = "init", .mode = COMMAND_CONFIG, - .handler = &handle_pld_init_command, + .handler = handle_pld_init_command, .help = "initialize PLD devices", }, COMMAND_REGISTRATION_DONE @@ -251,7 +253,6 @@ static const struct command_registration pld_command_handler[] = { .name = "pld", .mode = COMMAND_ANY, .help = "programmable logic device commands", - .chain = pld_config_command_handlers, }, COMMAND_REGISTRATION_DONE diff --git a/src/pld/virtex2.c b/src/pld/virtex2.c index 77eb866..bbf6b66 100644 --- a/src/pld/virtex2.c +++ b/src/pld/virtex2.c @@ -237,9 +237,9 @@ static const struct command_registration virtex2_exec_command_handlers[] = { { .name = "read_stat", .mode = COMMAND_EXEC, - .handler = &virtex2_handle_read_stat_command, + .handler = virtex2_handle_read_stat_command, .help = "read status register", - .usage = "<device_id>", + .usage = "pld_num", }, COMMAND_REGISTRATION_DONE }; commit 2a76c1bcf94f8ed00c9e744a5405d0ac07cdc85a Author: David Brownell <dbr...@us...> Date: Fri Jan 8 23:18:46 2010 -0800 NAND: help/usage/doc updates Usage messages should use the same EBNF as the User's Guide; no angle brackets. Be more complete too ... some params were missing. Improve and correct various helptexts. Make user's guide refer to the NAND "driver" name, not the controller name; that's a bit more precise. Don't use "&function"; its name is its address. Line up struct initializers properly. Remove some blank lines. Signed-off-by: David Brownell <dbr...@us...> diff --git a/doc/openocd.texi b/doc/openocd.texi index 2e0143e..3adc33a 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -4673,7 +4673,7 @@ NAND chips must be declared in configuration scripts, plus some additional configuration that's done after OpenOCD has initialized. -@deffn {Config Command} {nand device} name controller target [configparams...] +@deffn {Config Command} {nand device} name driver target [configparams...] Declares a NAND device, which can be read and written to after it has been configured through @command{nand probe}. In OpenOCD, devices are single chips; this is unlike some @@ -4688,8 +4688,8 @@ configuration files, not interactively. @itemize @bullet @item @var{name} ... may be used to reference the NAND bank -in other commands. -@item @var{controller} ... identifies the controller driver +in most other NAND commands. A number is also available. +@item @var{driver} ... identifies the NAND controller driver associated with the NAND device being declared. @xref{NAND Driver List}. @item @var{target} ... names the target used when issuing diff --git a/src/flash/nand/at91sam9.c b/src/flash/nand/at91sam9.c index 5cfbb0a..92ab047 100644 --- a/src/flash/nand/at91sam9.c +++ b/src/flash/nand/at91sam9.c @@ -697,28 +697,30 @@ static const struct command_registration at91sam9_sub_command_handlers[] = { .handler = handle_at91sam9_cle_command, .mode = COMMAND_CONFIG, .help = "set command latch enable address line (default is 22)", - .usage = "<device_id> <address_line>", + .usage = "bank_id address_line", }, { .name = "ale", .handler = handle_at91sam9_ale_command, .mode = COMMAND_CONFIG, .help = "set address latch enable address line (default is 21)", - .usage = "<device_id> <address_line>", + .usage = "bank_id address_line", }, { .name = "rdy_busy", .handler = handle_at91sam9_rdy_busy_command, .mode = COMMAND_CONFIG, - .help = "set the input pin connected to RDY/~BUSY signal (no default)", - .usage = "<device_id> <base_pioc> <pin_num>", + .help = "set the GPIO input pin connected to " + "the RDY/~BUSY signal (no default)", + .usage = "bank_id pio_base_addr pin_num", }, { .name = "ce", .handler = handle_at91sam9_ce_command, .mode = COMMAND_CONFIG, - .help = "set the output pin connected to chip enable signal (no default)", - .usage = "<device_id> <base_pioc> <pin_num>", + .help = "set the GPIO output pin connected to " + "the chip enable signal (no default)", + .usage = "bank_id pio_base_addr pin_num", }, COMMAND_REGISTRATION_DONE }; diff --git a/src/flash/nand/lpc3180.c b/src/flash/nand/lpc3180.c index 4268b66..51ab34b 100644 --- a/src/flash/nand/lpc3180.c +++ b/src/flash/nand/lpc3180.c @@ -878,10 +878,10 @@ COMMAND_HANDLER(handle_lpc3180_select_command) static const struct command_registration lpc3180_exec_command_handlers[] = { { .name = "select", - .handler = &handle_lpc3180_select_command, + .handler = handle_lpc3180_select_command, .mode = COMMAND_EXEC, - .help = "select <'mlc'|'slc'> controller (default is mlc)", - .usage = "<device_id> (mlc|slc)", + .help = "select MLC or SLC controller (default is MLC)", + .usage = "bank_id ['mlc'|'slc']", }, COMMAND_REGISTRATION_DONE }; @@ -896,17 +896,17 @@ static const struct command_registration lpc3180_command_handler[] = { }; struct nand_flash_controller lpc3180_nand_controller = { - .name = "lpc3180", - .commands = lpc3180_command_handler, - .nand_device_command = lpc3180_nand_device_command, - .init = lpc3180_init, - .reset = lpc3180_reset, - .command = lpc3180_command, - .address = lpc3180_address, - .write_data = lpc3180_write_data, - .read_data = lpc3180_read_data, - .write_page = lpc3180_write_page, - .read_page = lpc3180_read_page, - .controller_ready = lpc3180_controller_ready, - .nand_ready = lpc3180_nand_ready, - }; + .name = "lpc3180", + .commands = lpc3180_command_handler, + .nand_device_command = lpc3180_nand_device_command, + .init = lpc3180_init, + .reset = lpc3180_reset, + .command = lpc3180_command, + .address = lpc3180_address, + .write_data = lpc3180_write_data, + .read_data = lpc3180_read_data, + .write_page = lpc3180_write_page, + .read_page = lpc3180_read_page, + .controller_ready = lpc3180_controller_ready, + .nand_ready = lpc3180_nand_ready, +}; diff --git a/src/flash/nand/tcl.c b/src/flash/nand/tcl.c index 4f90c7b..29b4b69 100644 --- a/src/flash/nand/tcl.c +++ b/src/flash/nand/tcl.c @@ -446,68 +446,67 @@ COMMAND_HANDLER(handle_nand_raw_access_command) static const struct command_registration nand_exec_command_handlers[] = { { .name = "list", - .handler = &handle_nand_list_command, + .handler = handle_nand_list_command, .mode = COMMAND_EXEC, .help = "list configured NAND flash devices", }, { .name = "info", - .handler = &handle_nand_info_command, + .handler = handle_nand_info_command, .mode = COMMAND_EXEC, - .usage = "<bank>", - .help = "print info about a NAND flash device", + .usage = "[banknum | first_bank_num last_bank_num]", + .help = "print info about one or more NAND flash devices", }, { .name = "probe", - .handler = &handle_nand_probe_command, + .handler = handle_nand_probe_command, .mode = COMMAND_EXEC, - .usage = "<bank>", - .help = "identify NAND flash device <num>", - + .usage = "bank_id", + .help = "identify NAND flash device", }, { .name = "check_bad_blocks", - .handler = &handle_nand_check_bad_blocks_command, + .handler = handle_nand_check_bad_blocks_command, .mode = COMMAND_EXEC, - .usage = "<bank> [<offset> <length>]", - .help = "check NAND flash device <num> for bad blocks", + .usage = "bank_id [offset length]", + .help = "check all or part of NAND flash device for bad blocks", }, { .name = "erase", - .handler = &handle_nand_erase_command, + .handler = handle_nand_erase_command, .mode = COMMAND_EXEC, - .usage = "<bank> [<offset> <length>]", - .help = "erase blocks on NAND flash device", + .usage = "bank_id [offset length]", + .help = "erase all or subset of blocks on NAND flash device", }, { .name = "dump", - .handler = &handle_nand_dump_command, + .handler = handle_nand_dump_command, .mode = COMMAND_EXEC, - .usage = "<bank> <filename> <offset> <length> " - "[oob_raw | oob_only]", + .usage = "bank_id filename offset length " + "['oob_raw'|'oob_only']", .help = "dump from NAND flash device", }, { .name = "verify", - .handler = &handle_nand_verify_command, + .handler = handle_nand_verify_command, .mode = COMMAND_EXEC, - .usage = "<bank> <filename> <offset> " - "[oob_raw | oob_only | oob_softecc | oob_softecc_kw]", + .usage = "bank_id filename offset " + "['oob_raw'|'oob_only'|'oob_softecc'|'oob_softecc_kw']", .help = "verify NAND flash device", }, { .name = "write", - .handler = &handle_nand_write_command, + .handler = handle_nand_write_command, .mode = COMMAND_EXEC, - .usage = "<bank> <filename> <offset> " - "[oob_raw | oob_only | oob_softecc | oob_softecc_kw]", + .usage = "bank_id filename offset " + "['oob_raw'|'oob_only'|'oob_softecc'|'oob_softecc_kw']", .help = "write to NAND flash device", }, { .name = "raw_access", - .handler = &handle_nand_raw_access_command, + .handler = handle_nand_raw_access_command, .mode = COMMAND_EXEC, - .usage = "<num> ['enable'|'disable']", + .usage = "bank_id ['enable'|'disable']", .help = "raw access to NAND flash device", }, COMMAND_REGISTRATION_DONE @@ -614,6 +613,7 @@ static const struct command_registration nand_config_command_handlers[] = { .handler = &handle_nand_device_command, .mode = COMMAND_CONFIG, .help = "defines a new NAND bank", + .usage = "bank_id driver target [driver_options ...]", }, { .name = "drivers", commit ae710059291ba9830a9b20d899bdef6a5122dd73 Author: David Brownell <dbr...@us...> Date: Fri Jan 8 23:13:39 2010 -0800 Doc/examples: clarify usage messages Update/bugfix the "hello" example; emphasize using EBNF syntax, matching the User's Guide. Correct the Texinfo style guide to say EBNF, not BNF. Signed-off-by: David Brownell <dbr...@us...> diff --git a/doc/manual/primer/commands.txt b/doc/manual/primer/commands.txt index 6169734..5f89d50 100644 --- a/doc/manual/primer/commands.txt +++ b/doc/manual/primer/commands.txt @@ -68,9 +68,9 @@ static const struct command_registration hello_command_handlers[] = { { .name = "hello", .mode = COMMAND_ANY, - .handler = &handle_hello_command, - .help = "print a warm greetings", - .usage = "[<name>]", + .handler = handle_hello_command, + .help = "print a warm greeting", + .usage = "[name]", }, { .chain = foo_command_handlers, @@ -84,7 +84,12 @@ int hello_register_commands(struct command_context_s *cmd_ctx) } @endcode -That's it! The command should now be registered and avaiable to scripts. +Note that the "usage" text should use the same EBNF that's found +in the User's Guide: literals in 'single quotes', sequences of +optional parameters in [square brackets], and alternatives in +(parentheses|with|vertical bars), and so forth. No angle brackets. + +That's it! The command should now be registered and available to scripts. @section primercmdchain Command Chaining diff --git a/doc/manual/style.txt b/doc/manual/style.txt index 71bb5f6..87b1e6b 100644 --- a/doc/manual/style.txt +++ b/doc/manual/style.txt @@ -308,7 +308,7 @@ For technical reference material: - Else it's a "Config Command" if it must be used before the configuration stage completes. - For a "Driver", list its name. - - Use BNF style regular expressions to define parameters: + - Use EBNF style regular expressions to define parameters: brackets around zero-or-one choices, parentheses around exactly-one choices. - Use \@option, \@file, \@var and other mechanisms where appropriate. diff --git a/src/hello.c b/src/hello.c index 0cd06ad..8cd5fab 100644 --- a/src/hello.c +++ b/src/hello.c @@ -58,14 +58,14 @@ static const struct command_registration foo_command_handlers[] = { .name = "bar", .handler = &handle_foo_command, .mode = COMMAND_ANY, - .usage = "<address> [enable|disable]", + .usage = "address ['enable'|'disable']", .help = "an example command", }, { .name = "baz", .handler = &handle_foo_command, .mode = COMMAND_ANY, - .usage = "<address> [enable|disable]", + .usage = "address ['enable'|'disable']", .help = "a sample command", }, { @@ -107,10 +107,10 @@ COMMAND_HANDLER(handle_hello_command) const struct command_registration hello_command_handlers[] = { { .name = "hello", - .handler = &handle_hello_command, + .handler = handle_hello_command, .mode = COMMAND_ANY, .help = "prints a warm welcome", - .usage = "[<name>]", + .usage = "[name]", }, { .name = "foo", ----------------------------------------------------------------------- Summary of changes: doc/manual/primer/commands.txt | 13 +++++++--- doc/manual/style.txt | 2 +- doc/openocd.texi | 6 ++-- src/flash/nand/at91sam9.c | 14 ++++++---- src/flash/nand/lpc3180.c | 34 +++++++++++++------------- src/flash/nand/tcl.c | 50 ++++++++++++++++++++-------------------- src/hello.c | 8 +++--- src/helper/command.c | 4 +- src/pld/pld.c | 21 ++++++++-------- src/pld/virtex2.c | 4 +- 10 files changed, 82 insertions(+), 74 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: David B. <dbr...@us...> - 2010-01-09 05:58:20
|
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 b800eb0336a190ed53da90a2b7216a35bfbfdb23 (commit) via 1a2c258ed4537ca95b50e1f9e776215d82de2a86 (commit) from c1cb20971ea89e4602bb23ba66180d647880bbef (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 b800eb0336a190ed53da90a2b7216a35bfbfdb23 Author: David Brownell <dbr...@us...> Date: Fri Jan 8 20:16:05 2010 -0800 *SVF: help/usage updates Usage messages should use the same EBNF as the User's Guide; no angle brackets. Be more complete too ... some params were missing. Don't use "&function"; its name is its address. Unrelated: fix typo in one "target.c" usage message. Signed-off-by: David Brownell <dbr...@us...> diff --git a/src/svf/svf.c b/src/svf/svf.c index dfdecbc..7cb2200 100644 --- a/src/svf/svf.c +++ b/src/svf/svf.c @@ -1461,10 +1461,10 @@ static int svf_run_command(struct command_context *cmd_ctx, char *cmd_str) static const struct command_registration svf_command_handlers[] = { { .name = "svf", - .handler = &handle_svf_command, + .handler = handle_svf_command, .mode = COMMAND_EXEC, .help = "Runs a SVF file.", - .usage = "<file>", + .usage = "filename ['quiet']", }, COMMAND_REGISTRATION_DONE }; diff --git a/src/target/target.c b/src/target/target.c index c29c45e..7994aff 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -4916,7 +4916,7 @@ static const struct command_registration target_exec_command_handlers[] = { .handler = handle_virt2phys_command, .mode = COMMAND_ANY, .help = "translate a virtual address into a physical address", - .usage = "virual_address", + .usage = "virtual_address", }, { .name = "reg", diff --git a/src/xsvf/xsvf.c b/src/xsvf/xsvf.c index b1ddea9..539fbdc 100644 --- a/src/xsvf/xsvf.c +++ b/src/xsvf/xsvf.c @@ -1053,13 +1053,13 @@ COMMAND_HANDLER(handle_xsvf_command) static const struct command_registration xsvf_command_handlers[] = { { .name = "xsvf", - .handler = &handle_xsvf_command, + .handler = handle_xsvf_command, .mode = COMMAND_EXEC, .help = "Runs a XSVF file. If 'virt2' is given, xruntest " "counts are interpreted as TCK cycles rather than " "as microseconds. Without the 'quiet' option, all " "comments, retries, and mismatches will be reported.", - .usage = "<file> [virt2] [quiet]", + .usage = "(tapname|'plain') filename ['virt2'] ['quiet']", }, COMMAND_REGISTRATION_DONE }; commit 1a2c258ed4537ca95b50e1f9e776215d82de2a86 Author: David Brownell <dbr...@us...> Date: Fri Jan 8 20:12:18 2010 -0800 MFLASH: help/usage updates Make "usage" messages use the same EBNF as the User's Guide; no angle brackets. Improve and correct various helptexts. Don't use "&function"; a function's name is its address. Remove a couple instances of pointless whitespace. Signed-off-by: David Brownell <dbr...@us...> diff --git a/src/flash/mflash.c b/src/flash/mflash.c index 04f5c77..289fe5e 100644 --- a/src/flash/mflash.c +++ b/src/flash/mflash.c @@ -762,7 +762,7 @@ COMMAND_HANDLER(mg_write_cmd) return ERROR_OK; mg_write_cmd_err: - free(buffer); + free(buffer); fileio_close(&fileio); return ret; @@ -829,7 +829,7 @@ COMMAND_HANDLER(mg_dump_cmd) return ERROR_OK; mg_dump_cmd_err: - free(buffer); + free(buffer); fileio_close(&fileio); return ret; @@ -1271,30 +1271,33 @@ COMMAND_HANDLER(mg_config_cmd) static const struct command_registration mflash_exec_command_handlers[] = { { .name = "probe", - .handler = &mg_probe_cmd, + .handler = mg_probe_cmd, .mode = COMMAND_EXEC, .help = "Detect bank configuration information", }, { .name = "write", - .handler = &mg_write_cmd, + .handler = mg_write_cmd, .mode = COMMAND_EXEC, - .usage = "<num> <file> <address>", - .help = "Write a file at the specified address", + /* FIXME bank_num is unused */ + .usage = "bank_num filename address", + .help = "Write binary file at the specified address.", }, { .name = "dump", - .handler = &mg_dump_cmd, + .handler = mg_dump_cmd, .mode = COMMAND_EXEC, - .usage = "<num> <file> <address> <size>", - .help = "Dump to a file from the specified address", + /* FIXME bank_num is unused */ + .usage = "bank_num filename address size", + .help = "Write specified number of bytes from a binary file " + "to the specified, address.", }, { .name = "config", - .handler = &mg_config_cmd, + .handler = mg_config_cmd, .mode = COMMAND_EXEC, - .usage = "<num> <stage>", - .help = "Dump to a file from the specified address", + .help = "Configure MFLASH options.", + .usage = "('boot'|'storage'|'pll' frequency)", }, COMMAND_REGISTRATION_DONE }; @@ -1367,15 +1370,15 @@ COMMAND_HANDLER(mg_bank_cmd) static const struct command_registration mflash_config_command_handlers[] = { { .name = "bank", - .handler = &mg_bank_cmd, + .handler = mg_bank_cmd, .mode = COMMAND_CONFIG, .help = "configure a mflash device bank", - .usage = "<soc> <base> <RST pin> <target #>", + .usage = "soc_type base_addr pin_id target", }, { .name = "init", .mode = COMMAND_CONFIG, - .handler = &handle_mflash_init_command, + .handler = handle_mflash_init_command, .help = "initialize mflash devices", }, COMMAND_REGISTRATION_DONE ----------------------------------------------------------------------- Summary of changes: src/flash/mflash.c | 33 ++++++++++++++++++--------------- src/svf/svf.c | 4 ++-- src/target/target.c | 2 +- src/xsvf/xsvf.c | 4 ++-- 4 files changed, 23 insertions(+), 20 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: David B. <dbr...@us...> - 2010-01-09 02:22:25
|
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 c1cb20971ea89e4602bb23ba66180d647880bbef (commit) from 296a011db5833b8a3258a058e6a805cc5ddb2bfe (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 c1cb20971ea89e4602bb23ba66180d647880bbef Author: David Brownell <dbr...@us...> Date: Fri Jan 8 17:20:47 2010 -0800 Coexist with quilt: rename PATCHES --> PATCHES.txt The issues is on Win32, which ignores case in filesystem and thus doesn't tolerate the quilt "patches" directory. Rename, and add "patches" to .gitignore so that developers can choose to use quilt for local patch management. Signed-off-by: David Brownell <dbr...@us...> diff --git a/.gitignore b/.gitignore index 5ec831e..e37ee5a 100644 --- a/.gitignore +++ b/.gitignore @@ -66,6 +66,9 @@ stamp-vti INSTALL NOTES +# coexist with quilt +patches + # Eclipse stuff .project .cproject diff --git a/BUGS b/BUGS index 961b339..36a7da3 100644 --- a/BUGS +++ b/BUGS @@ -26,8 +26,8 @@ that may be important. http://www.kernel.org/pub/software/scm/git/docs/git-bisect.html If possible, please develop and attach a patch that helps to expose or -solve the reported problem. See the PATCHES file for more information -for that process. +solve the reported problem. See the PATCHES.txt file for information +about that process. Attach all files directly to your posting. The mailing list knows to transform attachments to links, but attachments must be less than 300KB diff --git a/Doxyfile.in b/Doxyfile.in index 49630f2..519bb2f 100644 --- a/Doxyfile.in +++ b/Doxyfile.in @@ -567,7 +567,7 @@ WARN_LOGFILE = INPUT = @srcdir@/doc/manual \ @srcdir@/TODO \ @srcdir@/BUGS \ - @srcdir@/PATCHES \ + @srcdir@/PATCHES.txt \ @srcdir@/src \ @srcdir@/config.h diff --git a/NEWS b/NEWS index ba7e0e6..b169606 100644 --- a/NEWS +++ b/NEWS @@ -8,6 +8,7 @@ JTAG Layer: Support USB-JTAG, Altera USB-Blaster and compatibles. Boundary Scan: + Target Layer: General - new "reset-assert" event, for systems without SRST @@ -36,6 +37,8 @@ Target Layer: ETM, ETB - "trigger_percent" command moved ETM --> ETB - "etm trigger_debug" command added + MIPS + - use fastdata writes Freescale DSP563xx cores (partial support) Flash Layer: @@ -81,4 +84,4 @@ For older NEWS, see the NEWS files associated with each release For more information about contributing test reports, bug fixes, or new features and device support, please read the new Developer Manual (or -the BUGS and PATCHES files in the source archive). +the BUGS and PATCHES.txt files in the source archive). diff --git a/PATCHES b/PATCHES.txt similarity index 100% rename from PATCHES rename to PATCHES.txt diff --git a/doc/openocd.texi b/doc/openocd.texi index 84bdb3c..2e0143e 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -223,7 +223,7 @@ communication between developers: @uref{https://lists.berlios.de/mailman/listinfo/openocd-development} Discuss and submit patches to this list. -The @file{PATCHES} file contains basic information about how +The @file{PATCHES.txt} file contains basic information about how to prepare patches. diff --git a/tools/release.sh b/tools/release.sh index c464c49..12dfdb6 100755 --- a/tools/release.sh +++ b/tools/release.sh @@ -205,7 +205,7 @@ For older NEWS, see the NEWS files associated with each release For more information about contributing test reports, bug fixes, or new features and device support, please read the new Developer Manual (or -the BUGS and PATCHES files in the source archive). +the BUGS and PATCHES.txt files in the source archive). NEWS git add NEWS ----------------------------------------------------------------------- Summary of changes: .gitignore | 3 +++ BUGS | 4 ++-- Doxyfile.in | 2 +- NEWS | 5 ++++- PATCHES => PATCHES.txt | 0 doc/openocd.texi | 2 +- tools/release.sh | 2 +- 7 files changed, 12 insertions(+), 6 deletions(-) rename PATCHES => PATCHES.txt (100%) hooks/post-receive -- Main OpenOCD repository |
From: David B. <dbr...@us...> - 2010-01-09 01:49:52
|
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 296a011db5833b8a3258a058e6a805cc5ddb2bfe (commit) from 12c143d5948355b3b54c9c0decc779177b22d5d9 (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 296a011db5833b8a3258a058e6a805cc5ddb2bfe Author: David Brownell <dbr...@us...> Date: Fri Jan 8 16:47:58 2010 -0800 NOR: add FIXMEs for writing ones It can invalidate ECC codes, and in general is not guaranteed to work. (However on some chips it _appears_ to behave.) Just don't do it; don't write in those cases. Signed-off-by: David Brownell <dbr...@us...> diff --git a/TODO b/TODO index 8fed264..73e4aa7 100644 --- a/TODO +++ b/TODO @@ -209,6 +209,12 @@ https://lists.berlios.de/pipermail/openocd-development/2009-October/011506.html - ocl - str9xpec +- Don't expect writing all-ones to be a safe way to write without + changing bit values. Minimally it loses on flash modules with + internal ECC, where it may change the ECC. + - NOR flash_write_unlock() does that between sectors + - there may be other cases too + @subsection thelistflashcfi CFI - finish implementing bus width/chip width handling (suggested by NC) diff --git a/src/flash/nor/core.c b/src/flash/nor/core.c index 01088f3..7e783d4 100644 --- a/src/flash/nor/core.c +++ b/src/flash/nor/core.c @@ -449,9 +449,12 @@ int flash_write_unlock(struct target *target, struct image *image, break; } - /* REVISIT This needlessly touches sectors BETWEEN the + /* FIXME This needlessly touches sectors BETWEEN the * sections it's writing. Without auto erase, it just - * writes ones; unlikely to destroy data. + * writes ones. That WILL INVALIDATE data in cases + * like Stellaris Tempest chips, corrupting internal + * ECC codes; and at least FreeScale suggests issues + * with that approach (in HC11 documentation). * * With auto erase enabled, data in those sectors will * be needlessly destroyed; and some of the limited ----------------------------------------------------------------------- Summary of changes: TODO | 6 ++++++ src/flash/nor/core.c | 7 +++++-- 2 files changed, 11 insertions(+), 2 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: David B. <dbr...@us...> - 2010-01-08 02:07:43
|
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 12c143d5948355b3b54c9c0decc779177b22d5d9 (commit) via 82c0fb527783a56f7cf82e21b85546b425378b00 (commit) via e7965cd3eb6204e618f9555331b7172e3dba7df8 (commit) via a42bea654ce1316dd521b1c9beffa8f829bf8be0 (commit) via e0b6e5deef2d7b0054058116b6ddf9c684053739 (commit) via 199abf49ea02f03aedd1239b6ef3928d35f5dbb7 (commit) via 48d51e1719c2b48509786bba7c84c09d329929d3 (commit) via 17921f51abc4402c9c5aadf3e664eb37663f744f (commit) via e19fe9ad09e28df1976257052afe6edf765aa778 (commit) via dd8f679aa2ea447a96f393db3a8938259f63eebc (commit) via 7c3aee96b2f122fd16ec20e305cb16fe89180c9b (commit) from 991d030fcc9be971f29498ea7e1b3afbed05815b (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 12c143d5948355b3b54c9c0decc779177b22d5d9 Author: David Brownell <dbr...@us...> Date: Thu Jan 7 16:41:42 2010 -0800 misc ARM help/usage updates Usage syntax messages have the same EBNF as the User's Guide; there should be no angle brackets in either place. Uupdate some helptext to be more accurate. Don't use "&function"; functions are like arrays, their address is their name. Signed-off-by: David Brownell <dbr...@us...> diff --git a/src/target/arm926ejs.c b/src/target/arm926ejs.c index 4ac92a2..e099919 100644 --- a/src/target/arm926ejs.c +++ b/src/target/arm926ejs.c @@ -757,7 +757,7 @@ static int arm926ejs_mmu(struct target *target, int *enabled) static const struct command_registration arm926ejs_exec_command_handlers[] = { { .name = "cache_info", - .handler = &arm926ejs_handle_cache_info_command, + .handler = arm926ejs_handle_cache_info_command, .mode = COMMAND_EXEC, .help = "display information about target caches", diff --git a/src/target/arm9tdmi.c b/src/target/arm9tdmi.c index ae0c4e0..823e962 100644 --- a/src/target/arm9tdmi.c +++ b/src/target/arm9tdmi.c @@ -918,7 +918,9 @@ static const struct command_registration arm9tdmi_exec_command_handlers[] = { .name = "vector_catch", .handler = handle_arm9tdmi_catch_vectors_command, .mode = COMMAND_EXEC, - .usage = "[all|none|reset|undef|swi|pabt|dabt|irq|fiq] ...", + .help = "Display, after optionally updating, configuration " + "of vector catch unit.", + .usage = "[all|none|(reset|undef|swi|pabt|dabt|irq|fiq)*]", }, COMMAND_REGISTRATION_DONE }; diff --git a/src/target/armv4_5.c b/src/target/armv4_5.c index 1c4923b..c7b7367 100644 --- a/src/target/armv4_5.c +++ b/src/target/armv4_5.c @@ -928,22 +928,22 @@ static int jim_mcrmrc(Jim_Interp *interp, int argc, Jim_Obj *const *argv) static const struct command_registration arm_exec_command_handlers[] = { { .name = "reg", - .handler = &handle_armv4_5_reg_command, + .handler = handle_armv4_5_reg_command, .mode = COMMAND_EXEC, .help = "display ARM core registers", }, { .name = "core_state", - .handler = &handle_armv4_5_core_state_command, + .handler = handle_armv4_5_core_state_command, .mode = COMMAND_EXEC, - .usage = "<arm | thumb>", + .usage = "['arm'|'thumb']", .help = "display/change ARM core state", }, { .name = "disassemble", - .handler = &handle_armv4_5_disassemble_command, + .handler = handle_armv4_5_disassemble_command, .mode = COMMAND_EXEC, - .usage = "<address> [<count> ['thumb']]", + .usage = "address [count ['thumb']]", .help = "disassemble instructions ", }, { commit 82c0fb527783a56f7cf82e21b85546b425378b00 Author: David Brownell <dbr...@us...> Date: Thu Jan 7 16:39:32 2010 -0800 ARM966: help/usage updates Usage syntax messages have the same EBNF as the User's Guide; there should be no angle brackets in either place. Fix the User's Guide to say where the magic CP15 bits are defined; and add comments in case someone provides mcr/mrc methods. Signed-off-by: David Brownell <dbr...@us...> diff --git a/doc/openocd.texi b/doc/openocd.texi index 285603a..84bdb3c 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -6030,6 +6030,10 @@ and ARM9 commands. @deffn Command {arm966e cp15} regnum [value] Display cp15 register @var{regnum}; else if a @var{value} is provided, that value is written to that register. +The six bit @var{regnum} values are bits 37..32 from table 7-2 of the +ARM966E-S TRM. +There is no current control over bits 31..30 from that table, +as required for BIST support. @end deffn @subsection XScale specific commands diff --git a/src/target/arm966e.c b/src/target/arm966e.c index 82be738..86af0f6 100644 --- a/src/target/arm966e.c +++ b/src/target/arm966e.c @@ -68,6 +68,13 @@ static int arm966e_verify_pointer(struct command_context *cmd_ctx, return ERROR_OK; } +/* + * REVISIT: The "read_cp15" and "write_cp15" commands could hook up + * to eventual mrc() and mcr() routines ... the reg_addr values being + * constructed (for CP15 only) from Opcode_1, Opcode_2, and CRn values. + * See section 7.3 of the ARM966E-S TRM. + */ + static int arm966e_read_cp15(struct target *target, int reg_addr, uint32_t *value) { int retval = ERROR_OK; @@ -86,6 +93,9 @@ static int arm966e_read_cp15(struct target *target, int reg_addr, uint32_t *valu fields[0].tap = jtag_info->tap; fields[0].num_bits = 32; + /* REVISIT: table 7-2 shows that bits 31-31 need to be + * specified for accessing BIST registers ... + */ fields[0].out_value = NULL; fields[0].in_value = NULL; @@ -227,7 +237,7 @@ static const struct command_registration arm966e_exec_command_handlers[] = { .name = "cp15", .handler = arm966e_handle_cp15_command, .mode = COMMAND_EXEC, - .usage = "<opcode> [value]", + .usage = "regnum [value]", .help = "display/modify cp15 register", }, COMMAND_REGISTRATION_DONE commit e7965cd3eb6204e618f9555331b7172e3dba7df8 Author: David Brownell <dbr...@us...> Date: Thu Jan 7 16:34:44 2010 -0800 Xscale: User's Guide updates Fix some EBNF goofs ... these commands have *optional* params, etc Signed-off-by: David Brownell <dbr...@us...> diff --git a/doc/openocd.texi b/doc/openocd.texi index bf7402d..285603a 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -6105,7 +6105,7 @@ else if a @var{value} is provided, that value is written to that register. Changes the address used for the specified target's debug handler. @end deffn -@deffn Command {xscale dcache} (@option{enable}|@option{disable}) +@deffn Command {xscale dcache} [@option{enable}|@option{disable}] Enables or disable the CPU's data cache. @end deffn @@ -6113,17 +6113,18 @@ Enables or disable the CPU's data cache. Dumps the raw contents of the trace buffer to @file{filename}. @end deffn -@deffn Command {xscale icache} (@option{enable}|@option{disable}) +@deffn Command {xscale icache} [@option{enable}|@option{disable}] Enables or disable the CPU's instruction cache. @end deffn -@deffn Command {xscale mmu} (@option{enable}|@option{disable}) +@deffn Command {xscale mmu} [@option{enable}|@option{disable}] Enables or disable the CPU's memory management unit. @end deffn -@deffn Command {xscale trace_buffer} (@option{enable}|@option{disable}) [@option{fill} [n] | @option{wrap}] -Enables or disables the trace buffer, -and controls how it is emptied. +@deffn Command {xscale trace_buffer} [@option{enable}|@option{disable} [@option{fill} [n] | @option{wrap}]] +Displays the trace buffer status, after optionally +enabling or disabling the trace buffer +and modifying how it is emptied. @end deffn @deffn Command {xscale trace_image} filename [offset [type]] @@ -6155,7 +6156,7 @@ The mask bits correspond with bit 16..23 in the DCSR: @end deffn @anchor{xscale vector_table} -@deffn Command {xscale vector_table} [<low|high> <index> <value>] +@deffn Command {xscale vector_table} [(@option{low}|@option{high}) index value] @cindex vector_table Set an entry in the mini-IC vector table. There are two tables: one for commit a42bea654ce1316dd521b1c9beffa8f829bf8be0 Author: David Brownell <dbr...@us...> Date: Thu Jan 7 16:30:09 2010 -0800 ARM720: help/usage updates Deprecate the "pass an instruction opcode" flavor of cp15 access in favor of the "arm mcr ..." and "arm mrc ..." commands, which offer fewer ways to break things. Use the same EBNF syntax in the code as for the user's guide. Update User's Guide to say where to find those magic values (which table in the ARM920 TRM). Signed-off-by: David Brownell <dbr...@us...> diff --git a/doc/openocd.texi b/doc/openocd.texi index ea23bf7..bf7402d 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -5978,13 +5978,21 @@ is an ARM920T (2x16kByte cache) or ARM922T (2x8kByte cache). @deffn Command {arm920t cp15} regnum [value] Display cp15 register @var{regnum}; else if a @var{value} is provided, that value is written to that register. +This uses "physical access" and the register number is as +shown in bits 38..33 of table 9-9 in the ARM920T TRM. +(Not all registers can be written.) @end deffn @deffn Command {arm920t cp15i} opcode [value [address]] -Interpreted access using cp15 @var{opcode}. +@emph{DEPRECATED -- avoid using this. +Use the @command{arm mrc} or @command{arm mcr} commands instead.} + +Interpreted access using ARM instruction @var{opcode}, which should +be the value of either an MRC or MCR instruction +(as shown tables 9-11, 9-12, and 9-13 in the ARM920T TRM). If no @var{value} is provided, the result is displayed. Else if that value is written using the specified @var{address}, -or using zero if no other address is not provided. +or using zero if no other address is provided. @end deffn @deffn Command {arm920t read_cache} filename diff --git a/src/target/arm920t.c b/src/target/arm920t.c index c5b7c88..29eb62d 100644 --- a/src/target/arm920t.c +++ b/src/target/arm920t.c @@ -1384,35 +1384,39 @@ static int arm920t_mcr(struct target *target, int cpnum, static const struct command_registration arm920t_exec_command_handlers[] = { { .name = "cp15", - .handler = &arm920t_handle_cp15_command, + .handler = arm920t_handle_cp15_command, .mode = COMMAND_EXEC, .help = "display/modify cp15 register", - .usage = "<num> [value]", + .usage = "regnum [value]", }, { .name = "cp15i", - .handler = &arm920t_handle_cp15i_command, + .handler = arm920t_handle_cp15i_command, .mode = COMMAND_EXEC, - .help = "display/modify cp15 (interpreted access)", - .usage = "<opcode> [value] [address]", + /* prefer using less error-prone "arm mcr" or "arm mrc" */ + .help = "display/modify cp15 register using ARM opcode" + " (DEPRECATED)", + .usage = "instruction [value [address]]", }, { .name = "cache_info", - .handler = &arm920t_handle_cache_info_command, + .handler = arm920t_handle_cache_info_command, .mode = COMMAND_EXEC, .help = "display information about target caches", }, { .name = "read_cache", - .handler = &arm920t_handle_read_cache_command, + .handler = arm920t_handle_read_cache_command, .mode = COMMAND_EXEC, - .help = "display I/D cache content", + .help = "dump I/D cache content to file", + .usage = "filename", }, { .name = "read_mmu", - .handler = &arm920t_handle_read_mmu_command, + .handler = arm920t_handle_read_mmu_command, .mode = COMMAND_EXEC, - .help = "display I/D mmu content", + .help = "dump I/D mmu content to file", + .usage = "filename", }, COMMAND_REGISTRATION_DONE }; commit e0b6e5deef2d7b0054058116b6ddf9c684053739 Author: David Brownell <dbr...@us...> Date: Thu Jan 7 16:25:03 2010 -0800 ARM720: help/usage updates Deprecate the "pass an instruction opcode" flavor of cp15 access in favor of the "arm mcr ..." and "arm mrc ..." commands, which offer fewer ways to break things. Use the same EBNF syntax in the code as for the user's guide. Signed-off-by: David Brownell <dbr...@us...> diff --git a/doc/openocd.texi b/doc/openocd.texi index a6fb970..ea23bf7 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -5921,9 +5921,13 @@ which are implementations of the ARMv4T architecture based on the ARM7TDMI-S integer core. They are available in addition to the ARM and ARM7/ARM9 commands. -@deffn Command {arm720t cp15} regnum [value] -Display cp15 register @var{regnum}; +@deffn Command {arm720t cp15} opcode [value] +@emph{DEPRECATED -- avoid using this. +Use the @command{arm mrc} or @command{arm mcr} commands instead.} + +Display cp15 register returned by the ARM instruction @var{opcode}; else if a @var{value} is provided, that value is written to that register. +The @var{opcode} should be the value of either an MRC or MCR instruction. @end deffn @subsection ARM9 specific commands diff --git a/src/target/arm720t.c b/src/target/arm720t.c index 84c66b8..2f51699 100644 --- a/src/target/arm720t.c +++ b/src/target/arm720t.c @@ -516,8 +516,10 @@ static const struct command_registration arm720t_exec_command_handlers[] = { .name = "cp15", .handler = arm720t_handle_cp15_command, .mode = COMMAND_EXEC, - .usage = "<opcode> [value]", - .help = "display/modify cp15 register", + /* prefer using less error-prone "arm mcr" or "arm mrc" */ + .help = "display/modify cp15 register using ARM opcode" + " (DEPRECATED)", + .usage = "instruction [value]", }, COMMAND_REGISTRATION_DONE }; commit 199abf49ea02f03aedd1239b6ef3928d35f5dbb7 Author: David Brownell <dbr...@us...> Date: Thu Jan 7 16:21:10 2010 -0800 ARM11: help/usage updates Usage syntax messages have the same EBNF as the User's Guide; there should be no angle brackets in either place. Uupdate some helptext to be more accurate. Fix the User's Guide in a few places to be more consistent (mostly to use brackets not parentheses) and to recognize that parameter may be entirely optional (in which case the command just displays output, and changes nothing). Also reference NXP, not Philips, for LPC chips. Don't use "&function"; functions are like arrays, their address is their name. Signed-off-by: David Brownell <dbr...@us...> diff --git a/doc/openocd.texi b/doc/openocd.texi index b91e754..a6fb970 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -6162,27 +6162,29 @@ Without arguments, the current settings are displayed. @subsection ARM11 specific commands @cindex ARM11 -@deffn Command {arm11 memwrite burst} [value] +@deffn Command {arm11 memwrite burst} [@option{enable}|@option{disable}] Displays the value of the memwrite burst-enable flag, -which is enabled by default. Burst writes are only used -for memory writes larger than 1 word. Single word writes -are likely to be from reset init scripts and those writes -are often to non-memory locations which could easily have -many wait states, which could easily break burst writes. -If @var{value} is defined, first assigns that. +which is enabled by default. +If a boolean parameter is provided, first assigns that flag. +Burst writes are only used for memory writes larger than 1 word. +They improve performance by assuming that the CPU has read each data +word over JTAG and completed its write before the next word arrives, +instead of polling for a status flag to verify that completion. +This is usually safe, because JTAG runs much slower than the CPU. @end deffn -@deffn Command {arm11 memwrite error_fatal} [value] +@deffn Command {arm11 memwrite error_fatal} [@option{enable}|@option{disable}] Displays the value of the memwrite error_fatal flag, which is enabled by default. -If @var{value} is defined, first assigns that. +If a boolean parameter is provided, first assigns that flag. +When set, certain memory write errors cause earlier transfer termination. @end deffn -@deffn Command {arm11 step_irq_enable} [value] +@deffn Command {arm11 step_irq_enable} [@option{enable}|@option{disable}] Displays the value of the flag controlling whether IRQs are enabled during single stepping; they are disabled by default. -If @var{value} is defined, first assigns that. +If a boolean parameter is provided, first assigns that. @end deffn @deffn Command {arm11 vcr} [value] diff --git a/src/target/arm11.c b/src/target/arm11.c index 67a8409..082930a 100644 --- a/src/target/arm11.c +++ b/src/target/arm11.c @@ -1318,17 +1318,20 @@ COMMAND_HANDLER(arm11_handle_vcr) static const struct command_registration arm11_mw_command_handlers[] = { { .name = "burst", - .handler = &arm11_handle_bool_memwrite_burst, + .handler = arm11_handle_bool_memwrite_burst, .mode = COMMAND_ANY, - .help = "Enable/Disable potentially risky fast burst mode" - " (default: enabled)", + .help = "Display or modify flag controlling potentially " + "risky fast burst mode (default: enabled)", + .usage = "['enable'|'disable']", }, { .name = "error_fatal", - .handler = &arm11_handle_bool_memwrite_error_fatal, + .handler = arm11_handle_bool_memwrite_error_fatal, .mode = COMMAND_ANY, - .help = "Terminate program if transfer error was found" + .help = "Display or modify flag controlling transfer " + "termination on transfer errors" " (default: enabled)", + .usage = "['enable'|'disable']", }, COMMAND_REGISTRATION_DONE }; @@ -1338,11 +1341,11 @@ static const struct command_registration arm11_any_command_handlers[] = { * simulate + breakpoint implementation is broken. * TEMPORARY! NOT DOCUMENTED! */ .name = "hardware_step", - .handler = &arm11_handle_bool_hardware_step, + .handler = arm11_handle_bool_hardware_step, .mode = COMMAND_ANY, .help = "DEBUG ONLY - Hardware single stepping" " (default: disabled)", - .usage = "(enable|disable)", + .usage = "['enable'|'disable']", }, { .name = "memwrite", @@ -1352,16 +1355,18 @@ static const struct command_registration arm11_any_command_handlers[] = { }, { .name = "step_irq_enable", - .handler = &arm11_handle_bool_step_irq_enable, + .handler = arm11_handle_bool_step_irq_enable, .mode = COMMAND_ANY, - .help = "Enable interrupts while stepping" - " (default: disabled)", + .help = "Display or modify flag controlling interrupt " + "enable while stepping (default: disabled)", + .usage = "['enable'|'disable']", }, { .name = "vcr", - .handler = &arm11_handle_vcr, + .handler = arm11_handle_vcr, .mode = COMMAND_ANY, - .help = "Control (Interrupt) Vector Catch Register", + .help = "Display or modify Vector Catch Register", + .usage = "[value]", }, COMMAND_REGISTRATION_DONE }; commit 48d51e1719c2b48509786bba7c84c09d329929d3 Author: David Brownell <dbr...@us...> Date: Thu Jan 7 16:20:14 2010 -0800 ARM7/ARM9: help/usage updates Provide helptext which was sometimes missing; update some of it to be more accurate. Usage syntax messages have the same EBNF as the User's Guide; there should be no angle brackets in either place. Fix the User's Guide in a few places to be more consistent (mostly to use brackets not parentheses) and to recognize that parameter may be entirely optional (in which case the command just displays output, and changes nothing). Also reference NXP, not Philips, for LPC chips. Don't use "&function"; functions are like arrays, their address is their name. Shrink some overlong lines. Signed-off-by: David Brownell <dbr...@us...> diff --git a/doc/openocd.texi b/doc/openocd.texi index 6057aad..b91e754 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -2501,7 +2501,7 @@ signal implementations. The default behaviour if no option given is @option{separate}, indicating everything behaves normally. @option{srst_pulls_trst} states that the -test logic is reset together with the reset of the system (e.g. Philips +test logic is reset together with the reset of the system (e.g. NXP LPC2000, "broken" board layout), @option{trst_pulls_srst} says that the system is reset together with the test logic (only hypothetical, I haven't seen hardware with such a bug, and can be worked around). @@ -5867,26 +5867,36 @@ ARM9TDMI, ARM920T or ARM926EJ-S. They are available in addition to the ARM commands, and any other core-specific commands that may be available. -@deffn Command {arm7_9 dbgrq} (@option{enable}|@option{disable}) -Control use of the EmbeddedIce DBGRQ signal to force entry into debug mode, -instead of breakpoints. This should be -safe for all but ARM7TDMI--S cores (like Philips LPC). +@deffn Command {arm7_9 dbgrq} [@option{enable}|@option{disable}] +Displays the value of the flag controlling use of the +the EmbeddedIce DBGRQ signal to force entry into debug mode, +instead of breakpoints. +If a boolean parameter is provided, first assigns that flag. + +This should be +safe for all but ARM7TDMI-S cores (like NXP LPC). This feature is enabled by default on most ARM9 cores, including ARM9TDMI, ARM920T, and ARM926EJ-S. @end deffn -@deffn Command {arm7_9 dcc_downloads} (@option{enable}|@option{disable}) +@deffn Command {arm7_9 dcc_downloads} [@option{enable}|@option{disable}] @cindex DCC -Control the use of the debug communications channel (DCC) to write larger (>128 byte) -amounts of memory. DCC downloads offer a huge speed increase, but might be +Displays the value of the flag controlling use of the debug communications +channel (DCC) to write larger (>128 byte) amounts of memory. +If a boolean parameter is provided, first assigns that flag. + +DCC downloads offer a huge speed increase, but might be unsafe, especially with targets running at very low speeds. This command was introduced with OpenOCD rev. 60, and requires a few bytes of working area. @end deffn @anchor{arm7_9 fast_memory_access} -@deffn Command {arm7_9 fast_memory_access} (@option{enable}|@option{disable}) -Enable or disable memory writes and reads that don't check completion of -the operation. This provides a huge speed increase, especially with USB JTAG +@deffn Command {arm7_9 fast_memory_access} [@option{enable}|@option{disable}] +Displays the value of the flag controlling use of memory writes and reads +that don't check completion of the operation. +If a boolean parameter is provided, first assigns that flag. + +This provides a huge speed increase, especially with USB JTAG cables (FT2232), but might be unsafe if used with targets running at very low speeds, like the 32kHz startup clock of an AT91RM9200. @end deffn diff --git a/src/target/arm7_9_common.c b/src/target/arm7_9_common.c index a09b0ad..2f4c408 100644 --- a/src/target/arm7_9_common.c +++ b/src/target/arm7_9_common.c @@ -2864,32 +2864,32 @@ int arm7_9_init_arch_info(struct target *target, struct arm7_9_common *arm7_9) static const struct command_registration arm7_9_any_command_handlers[] = { { "dbgrq", - .handler = &handle_arm7_9_dbgrq_command, + .handler = handle_arm7_9_dbgrq_command, .mode = COMMAND_ANY, - .usage = "<enable|disable>", + .usage = "['enable'|'disable']", .help = "use EmbeddedICE dbgrq instead of breakpoint " "for target halt requests", }, { "fast_memory_access", - .handler = &handle_arm7_9_fast_memory_access_command, + .handler = handle_arm7_9_fast_memory_access_command, .mode = COMMAND_ANY, - .usage = "<enable|disable>", + .usage = "['enable'|'disable']", .help = "use fast memory accesses instead of slower " "but potentially safer accesses", }, { "dcc_downloads", - .handler = &handle_arm7_9_dcc_downloads_command, + .handler = handle_arm7_9_dcc_downloads_command, .mode = COMMAND_ANY, - .usage = "<enable | disable>", + .usage = "['enable'|'disable']", .help = "use DCC downloads for larger memory writes", }, { "semihosting", - .handler = &handle_arm7_9_semihosting_command, + .handler = handle_arm7_9_semihosting_command, .mode = COMMAND_EXEC, - .usage = "<enable | disable>", + .usage = "['enable'|'disable']", .help = "activate support for semihosting operations", }, COMMAND_REGISTRATION_DONE commit 17921f51abc4402c9c5aadf3e664eb37663f744f Author: David Brownell <dbr...@us...> Date: Thu Jan 7 15:52:38 2010 -0800 ARMv7: help/usage updates Provide helptext which was sometimes missing; update some of it to be more accurate. Usage syntax messages have the same EBNF as the User's Guide; there should be no angle brackets in either place. Don't use "&function"; functions are like arrays, their address is their name. Shrink some overlong lines, remove some empties. Add a couple comments about things that should change: those extra TCK cycles for MEM-AP reads are in the wrong place (that might explain some problems we've seen); the DAP command tables should be shared, not copied. Signed-off-by: David Brownell <dbr...@us...> diff --git a/doc/openocd.texi b/doc/openocd.texi index 3f5882c..6057aad 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -6198,26 +6198,28 @@ These commands are specific to ARM architecture v7 Debug Access Port (DAP), included on Cortex-M3 and Cortex-A8 systems. They are available in addition to other core-specific commands that may be available. -@deffn Command {dap info} [num] -Displays dap info for ap @var{num}, defaulting to the currently selected AP. +@deffn Command {dap apid} [num] +Displays ID register from AP @var{num}, +defaulting to the currently selected AP. @end deffn @deffn Command {dap apsel} [num] Select AP @var{num}, defaulting to 0. @end deffn -@deffn Command {dap apid} [num] -Displays id register from AP @var{num}, +@deffn Command {dap baseaddr} [num] +Displays debug base address from MEM-AP @var{num}, defaulting to the currently selected AP. @end deffn -@deffn Command {dap baseaddr} [num] -Displays debug base address from AP @var{num}, +@deffn Command {dap info} [num] +Displays the ROM table for MEM-AP @var{num}, defaulting to the currently selected AP. @end deffn @deffn Command {dap memaccess} [value] -Displays the number of extra tck for mem-ap memory bus access [0-255]. +Displays the number of extra tck cycles in the JTAG idle to use for MEM-AP +memory bus access [0-255], giving additional time to respond to reads. If @var{value} is defined, first assigns that. @end deffn diff --git a/src/target/arm_adi_v5.c b/src/target/arm_adi_v5.c index 96accf3..e490f2e 100644 --- a/src/target/arm_adi_v5.c +++ b/src/target/arm_adi_v5.c @@ -101,6 +101,10 @@ static int adi_jtag_dp_scan(struct swjdp_common *swjdp, arm_jtag_set_instr(jtag_info, instr, NULL); /* Add specified number of tck clocks before accessing memory bus */ + + /* REVISIT these TCK cycles should be *AFTER* updating APACC, since + * they provide more time for the (MEM) AP to complete the read ... + */ if ((instr == JTAG_DP_APACC) && ((reg_addr == AP_REG_DRW) || ((reg_addr & 0xF0) == AP_REG_BD0)) @@ -137,6 +141,10 @@ static int adi_jtag_dp_scan_u32(struct swjdp_common *swjdp, arm_jtag_set_instr(jtag_info, instr, NULL); /* Add specified number of tck clocks before accessing memory bus */ + + /* REVISIT these TCK cycles should be *AFTER* updating APACC, since + * they provide more time for the (MEM) AP to complete the read ... + */ if ((instr == JTAG_DP_APACC) && ((reg_addr == AP_REG_DRW) || ((reg_addr & 0xF0) == AP_REG_BD0)) diff --git a/src/target/armv7a.c b/src/target/armv7a.c index 31538c2..fe87fee 100644 --- a/src/target/armv7a.c +++ b/src/target/armv7a.c @@ -174,40 +174,49 @@ COMMAND_HANDLER(handle_dap_info_command) return dap_info_command(CMD_CTX, swjdp, apsel); } +/* FIXME this table should be part of generic DAP support, and + * be shared by the ARMv7-A/R and ARMv7-M support ... + */ static const struct command_registration armv7a_exec_command_handlers[] = { { .name = "info", - .handler = &handle_dap_info_command, + .handler = handle_dap_info_command, .mode = COMMAND_EXEC, - .help = "dap info for ap [num], " - "default currently selected AP", + .help = "display ROM table for MEM-AP " + "(default currently selected AP)", + .usage = "[ap_num]", }, { .name = "apsel", - .handler = &handle_dap_apsel_command, + .handler = handle_dap_apsel_command, .mode = COMMAND_EXEC, - .help = "select a different AP [num] (default 0)", + .help = "Set the currently selected AP (default 0) " + "and display the result", + .usage = "[ap_num]", }, { .name = "apid", - .handler = &handle_dap_apid_command, + .handler = handle_dap_apid_command, .mode = COMMAND_EXEC, - .help = "return id reg from AP [num], " - "default currently selected AP", + .help = "return ID register from AP " + "(default currently selected AP)", + .usage = "[ap_num]", }, { .name = "baseaddr", - .handler = &handle_dap_baseaddr_command, + .handler = handle_dap_baseaddr_command, .mode = COMMAND_EXEC, - .help = "return debug base address from AP [num], " - "default currently selected AP", + .help = "return debug base address from MEM-AP " + "(default currently selected AP)", + .usage = "[ap_num]", }, { .name = "memaccess", - .handler = &handle_dap_memaccess_command, + .handler = handle_dap_memaccess_command, .mode = COMMAND_EXEC, - .help = "set/get number of extra tck for mem-ap memory " + .help = "set/get number of extra tck for MEM-AP memory " "bus access [0-255]", + .usage = "[cycles]", }, COMMAND_REGISTRATION_DONE }; diff --git a/src/target/armv7m.c b/src/target/armv7m.c index 9d8132d..233fb95 100644 --- a/src/target/armv7m.c +++ b/src/target/armv7m.c @@ -799,40 +799,49 @@ COMMAND_HANDLER(handle_dap_info_command) return dap_info_command(CMD_CTX, swjdp, apsel); } +/* FIXME this table should be part of generic DAP support, and + * be shared by the ARMv7-A/R and ARMv7-M support ... + */ static const struct command_registration armv7m_exec_command_handlers[] = { { .name = "info", - .handler = &handle_dap_info_command, + .handler = handle_dap_info_command, .mode = COMMAND_EXEC, - .help = "dap info for ap [num], " - "default currently selected AP", + .help = "display ROM table for MEM-AP " + "(default currently selected AP)", + .usage = "[ap_num]", }, { .name = "apsel", - .handler = &handle_dap_apsel_command, + .handler = handle_dap_apsel_command, .mode = COMMAND_EXEC, - .help = "select a different AP [num] (default 0)", + .help = "Set the currently selected AP (default 0) " + "and display the result", + .usage = "[ap_num]", }, { .name = "apid", - .handler = &handle_dap_apid_command, + .handler = handle_dap_apid_command, .mode = COMMAND_EXEC, - .help = "return id reg from AP [num], " - "default currently selected AP", + .help = "return ID register from AP " + "(default currently selected AP)", + .usage = "[ap_num]", }, { .name = "baseaddr", - .handler = &handle_dap_baseaddr_command, + .handler = handle_dap_baseaddr_command, .mode = COMMAND_EXEC, - .help = "return debug base address from AP [num], " - "default currently selected AP", + .help = "return debug base address from MEM-AP " + "(default currently selected AP)", + .usage = "[ap_num]", }, { .name = "memaccess", - .handler = &handle_dap_memaccess_command, + .handler = handle_dap_memaccess_command, .mode = COMMAND_EXEC, - .help = "set/get number of extra tck for mem-ap memory " + .help = "set/get number of extra tck for MEM-AP memory " "bus access [0-255]", + .usage = "[cycles]", }, COMMAND_REGISTRATION_DONE }; diff --git a/src/target/cortex_a8.c b/src/target/cortex_a8.c index 424263d..18edd95 100644 --- a/src/target/cortex_a8.c +++ b/src/target/cortex_a8.c @@ -1642,13 +1642,13 @@ COMMAND_HANDLER(cortex_a8_handle_dbginit_command) static const struct command_registration cortex_a8_exec_command_handlers[] = { { .name = "cache_info", - .handler = &cortex_a8_handle_cache_info_command, + .handler = cortex_a8_handle_cache_info_command, .mode = COMMAND_EXEC, .help = "display information about target caches", }, { .name = "dbginit", - .handler = &cortex_a8_handle_dbginit_command, + .handler = cortex_a8_handle_dbginit_command, .mode = COMMAND_EXEC, .help = "Initialize core debug", }, diff --git a/src/target/cortex_m3.c b/src/target/cortex_m3.c index 9685821..c6b1bb2 100644 --- a/src/target/cortex_m3.c +++ b/src/target/cortex_m3.c @@ -1989,24 +1989,24 @@ COMMAND_HANDLER(handle_cortex_m3_mask_interrupts_command) static const struct command_registration cortex_m3_exec_command_handlers[] = { { .name = "disassemble", - .handler = &handle_cortex_m3_disassemble_command, + .handler = handle_cortex_m3_disassemble_command, .mode = COMMAND_EXEC, .help = "disassemble Thumb2 instructions", - .usage = "<address> [<count>]", + .usage = "address [count]", }, { .name = "maskisr", - .handler = &handle_cortex_m3_mask_interrupts_command, + .handler = handle_cortex_m3_mask_interrupts_command, .mode = COMMAND_EXEC, .help = "mask cortex_m3 interrupts", .usage = "['on'|'off']", }, { .name = "vector_catch", - .handler = &handle_cortex_m3_vector_catch_command, + .handler = handle_cortex_m3_vector_catch_command, .mode = COMMAND_EXEC, - .help = "catch hardware vectors", - .usage = "['all'|'none'|<list>]", + .help = "configure hardware vectors to trigger debug entry", + .usage = "['all'|'none'|('bus_err'|'chk_err'|...)*]", }, COMMAND_REGISTRATION_DONE }; commit e19fe9ad09e28df1976257052afe6edf765aa778 Author: David Brownell <dbr...@us...> Date: Thu Jan 7 15:22:41 2010 -0800 ARM ETM/ETB/trace: help/usage updates Provide helptext which was sometimes missing; update some of it to be more accurate. Usage syntax messages have the same EBNF as the User's Guide; no angle brackets in either place. Don't use "&function"; functions are like arrays, their address is their name. Shrink some overlong lines, remove some empties. Signed-off-by: David Brownell <dbr...@us...> diff --git a/src/target/etb.c b/src/target/etb.c index fb2dd60..18258f6 100644 --- a/src/target/etb.c +++ b/src/target/etb.c @@ -447,17 +447,21 @@ COMMAND_HANDLER(handle_etb_trigger_percent_command) static const struct command_registration etb_config_command_handlers[] = { { + /* NOTE: with ADIv5, ETBs are accessed using DAP operations, + * possibly over SWD, not through separate TAPs... + */ .name = "config", - .handler = &handle_etb_config_command, + .handler = handle_etb_config_command, .mode = COMMAND_CONFIG, + .help = "Associate ETB with target and JTAG TAP.", .usage = "target tap", }, { .name = "trigger_percent", - .handler = &handle_etb_trigger_percent_command, + .handler = handle_etb_trigger_percent_command, .mode = COMMAND_EXEC, - .help = "percent of trace buffer to be filled " - "after the trigger occurs", + .help = "Set percent of trace buffer to be filled " + "after the trigger occurs (2..100).", .usage = "[percent]", }, COMMAND_REGISTRATION_DONE diff --git a/src/target/etm.c b/src/target/etm.c index d22bc40..3126efc 100644 --- a/src/target/etm.c +++ b/src/target/etm.c @@ -1259,12 +1259,16 @@ COMMAND_HANDLER(handle_etm_tracemode_command) case 0: break; case 4: - CALL_COMMAND_HANDLER(handle_etm_tracemode_command_update, &tracemode); + CALL_COMMAND_HANDLER(handle_etm_tracemode_command_update, + &tracemode); break; default: - command_print(CMD_CTX, "usage: configure trace mode " - "<none | data | address | all> " - "<context id bits> <cycle accurate> <branch output>"); + command_print(CMD_CTX, "usage: tracemode " + "('none'|'data'|'address'|'all') " + "context_id_bits " + "('enable'|'disable') " + "('enable'|'disable')" + ); return ERROR_FAIL; } @@ -2112,11 +2116,16 @@ COMMAND_HANDLER(handle_etm_analyze_command) static const struct command_registration etm_config_command_handlers[] = { { + /* NOTE: with ADIv5, ETMs are accessed by DAP operations, + * possibly over SWD, not JTAG scanchain 6 of 'target'. + * + * Also, these parameters don't match ETM v3+ modules... + */ .name = "config", - .handler = &handle_etm_config_command, + .handler = handle_etm_config_command, .mode = COMMAND_CONFIG, - .usage = "<target> <port_width> <port_mode> " - "<clocking> <capture_driver>", + .help = "Set up ETM output port.", + .usage = "target port_width port_mode clocking capture_driver", }, COMMAND_REGISTRATION_DONE }; @@ -2132,33 +2141,36 @@ const struct command_registration etm_command_handlers[] = { static const struct command_registration etm_exec_command_handlers[] = { { - .name = "tracemode", handle_etm_tracemode_command, + .name = "tracemode", + .handler = handle_etm_tracemode_command, .mode = COMMAND_EXEC, .help = "configure/display trace mode", - .usage = "<none | data | address | all> " - "<context_id_bits> <cycle_accurate> <branch_output>", + .usage = "('none'|'data'|'address'|'all') " + "context_id_bits " + "['enable'|'disable'] " + "['enable'|'disable']", }, { .name = "info", - .handler = &handle_etm_info_command, + .handler = handle_etm_info_command, .mode = COMMAND_EXEC, .help = "display info about the current target's ETM", }, { .name = "status", - .handler = &handle_etm_status_command, + .handler = handle_etm_status_command, .mode = COMMAND_EXEC, .help = "display current target's ETM status", }, { .name = "start", - .handler = &handle_etm_start_command, + .handler = handle_etm_start_command, .mode = COMMAND_EXEC, .help = "start ETM trace collection", }, { .name = "stop", - .handler = &handle_etm_stop_command, + .handler = handle_etm_stop_command, .mode = COMMAND_EXEC, .help = "stop ETM trace collection", }, @@ -2167,7 +2179,7 @@ static const struct command_registration etm_exec_command_handlers[] = { .handler = handle_etm_trigger_debug_command, .mode = COMMAND_EXEC, .help = "enable/disable debug entry on trigger", - .usage = "(enable | disable)", + .usage = "['enable'|'disable']", }, { .name = "analyze", @@ -2177,19 +2189,21 @@ static const struct command_registration etm_exec_command_handlers[] = { }, { .name = "image", - .handler = &handle_etm_image_command, + .handler = handle_etm_image_command, .mode = COMMAND_EXEC, - .help = "load image from <file> [base address]", + .help = "load image from file with optional offset", + .usage = "filename [offset]", }, { .name = "dump", - .handler = &handle_etm_dump_command, + .handler = handle_etm_dump_command, .mode = COMMAND_EXEC, - .help = "dump captured trace data <file>", + .help = "dump captured trace data to file", + .usage = "filename", }, { .name = "load", - .handler = &handle_etm_load_command, + .handler = handle_etm_load_command, .mode = COMMAND_EXEC, .help = "load trace data for analysis <file>", }, diff --git a/src/target/etm_dummy.c b/src/target/etm_dummy.c index 19a078f..f9c6fe7 100644 --- a/src/target/etm_dummy.c +++ b/src/target/etm_dummy.c @@ -61,9 +61,9 @@ COMMAND_HANDLER(handle_etm_dummy_config_command) static const struct command_registration etm_dummy_config_command_handlers[] = { { .name = "config", - .handler = &handle_etm_dummy_config_command, + .handler = handle_etm_dummy_config_command, .mode = COMMAND_CONFIG, - .usage = "<target>", + .usage = "target", }, COMMAND_REGISTRATION_DONE }; diff --git a/src/target/oocd_trace.c b/src/target/oocd_trace.c index 2533c40..3b43571 100644 --- a/src/target/oocd_trace.c +++ b/src/target/oocd_trace.c @@ -398,13 +398,13 @@ COMMAND_HANDLER(handle_oocd_trace_resync_command) static const struct command_registration oocd_trace_all_command_handlers[] = { { .name = "config", - .handler = &handle_oocd_trace_config_command, + .handler = handle_oocd_trace_config_command, .mode = COMMAND_CONFIG, - .usage = "<target>", + .usage = "target", }, { .name = "status", - .handler = &handle_oocd_trace_status_command, + .handler = handle_oocd_trace_status_command, .mode = COMMAND_EXEC, .help = "display OpenOCD + trace status", }, commit dd8f679aa2ea447a96f393db3a8938259f63eebc Author: David Brownell <dbr...@us...> Date: Thu Jan 7 15:05:26 2010 -0800 target misc: help/usage updates Provide helptext which was sometimes missing; update some of it to be more accurate. Usage syntax messages have the same EBNF as the User's Guide. Don't use "&function"; functions are like arrays, their address is their name. Shrink some overlong lines; remove some empties. Signed-off-by: David Brownell <dbr...@us...> diff --git a/src/target/target.c b/src/target/target.c index 73a762d..c29c45e 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -45,8 +45,10 @@ #include "image.h" -static int target_array2mem(Jim_Interp *interp, struct target *target, int argc, Jim_Obj *const *argv); -static int target_mem2array(Jim_Interp *interp, struct target *target, int argc, Jim_Obj *const *argv); +static int target_array2mem(Jim_Interp *interp, struct target *target, + int argc, Jim_Obj *const *argv); +static int target_mem2array(Jim_Interp *interp, struct target *target, + int argc, Jim_Obj *const *argv); /* targets */ extern struct target_type arm7tdmi_target; @@ -2960,7 +2962,8 @@ static void writeGmon(uint32_t *samples, uint32_t sampleNum, const char *filenam fclose(f); } -/* profiling samples the CPU PC as quickly as OpenOCD is able, which will be used as a random sampling of PC */ +/* profiling samples the CPU PC as quickly as OpenOCD is able, + * which will be used as a random sampling of PC */ COMMAND_HANDLER(handle_profile_command) { struct target *target = get_current_target(CMD_CTX); @@ -2976,6 +2979,12 @@ COMMAND_HANDLER(handle_profile_command) timeval_add_time(&timeout, offset, 0); + /** + * @todo: Some cores let us sample the PC without the + * annoying halt/resume step; for example, ARMv7 PCSR. + * Provide a way to use that more efficient mechanism. + */ + command_print(CMD_CTX, "Starting profiling. Halting and resuming the target as often as we can..."); static const int maxSample = 10000; @@ -3287,7 +3296,9 @@ static int jim_array2mem(Jim_Interp *interp, int argc, Jim_Obj *const *argv) return target_array2mem(interp,target, argc-1, argv + 1); } -static int target_array2mem(Jim_Interp *interp, struct target *target, int argc, Jim_Obj *const *argv) + +static int target_array2mem(Jim_Interp *interp, struct target *target, + int argc, Jim_Obj *const *argv) { long l; uint32_t width; @@ -3789,11 +3800,13 @@ static int target_configure(Jim_GetOptInfo *goi, struct target *target) return JIM_OK; } -static int jim_target_configure(Jim_Interp *interp, int argc, Jim_Obj *const *argv) +static int +jim_target_configure(Jim_Interp *interp, int argc, Jim_Obj *const *argv) { Jim_GetOptInfo goi; + Jim_GetOpt_Setup(&goi, interp, argc - 1, argv + 1); - goi.isconfigure = strcmp(Jim_GetString(argv[0], NULL), "configure") == 0; + goi.isconfigure = !strcmp(Jim_GetString(argv[0], NULL), "configure"); int need_args = 1 + goi.isconfigure; if (goi.argc < need_args) { @@ -3988,13 +4001,15 @@ static int jim_target_md(Jim_Interp *interp, int argc, Jim_Obj *const *argv) return JIM_OK; } -static int jim_target_mem2array(Jim_Interp *interp, int argc, Jim_Obj *const *argv) +static int jim_target_mem2array(Jim_Interp *interp, + int argc, Jim_Obj *const *argv) { struct target *target = Jim_CmdPrivData(interp); return target_mem2array(interp, target, argc - 1, argv + 1); } -static int jim_target_array2mem(Jim_Interp *interp, int argc, Jim_Obj *const *argv) +static int jim_target_array2mem(Jim_Interp *interp, + int argc, Jim_Obj *const *argv) { struct target *target = Jim_CmdPrivData(interp); return target_array2mem(interp, target, argc - 1, argv + 1); @@ -4219,108 +4234,123 @@ static const struct command_registration target_instance_command_handlers[] = { { .name = "configure", .mode = COMMAND_CONFIG, - .jim_handler = &jim_target_configure, - .usage = "[<target_options> ...]", + .jim_handler = jim_target_configure, .help = "configure a new target for use", + .usage = "[target_attribute ...]", }, { .name = "cget", .mode = COMMAND_ANY, - .jim_handler = &jim_target_configure, - .usage = "<target_type> [<target_options> ...]", - .help = "configure a new target for use", + .jim_handler = jim_target_configure, + .help = "returns the specified target attribute", + .usage = "target_attribute", }, { .name = "mww", .mode = COMMAND_EXEC, - .jim_handler = &jim_target_mw, - .usage = "<address> <data> [<count>]", + .jim_handler = jim_target_mw, .help = "Write 32-bit word(s) to target memory", + .usage = "address data [count]", }, { .name = "mwh", .mode = COMMAND_EXEC, - .jim_handler = &jim_target_mw, - .usage = "<address> <data> [<count>]", + .jim_handler = jim_target_mw, .help = "Write 16-bit half-word(s) to target memory", + .usage = "address data [count]", }, { .name = "mwb", .mode = COMMAND_EXEC, - .jim_handler = &jim_target_mw, - .usage = "<address> <data> [<count>]", + .jim_handler = jim_target_mw, .help = "Write byte(s) to target memory", + .usage = "address data [count]", }, { .name = "mdw", .mode = COMMAND_EXEC, - .jim_handler = &jim_target_md, - .usage = "<address> [<count>]", + .jim_handler = jim_target_md, .help = "Display target memory as 32-bit words", + .usage = "address [count]", }, { .name = "mdh", .mode = COMMAND_EXEC, - .jim_handler = &jim_target_md, - .usage = "<address> [<count>]", + .jim_handler = jim_target_md, .help = "Display target memory as 16-bit half-words", + .usage = "address [count]", }, { .name = "mdb", .mode = COMMAND_EXEC, - .jim_handler = &jim_target_md, - .usage = "<address> [<count>]", + .jim_handler = jim_target_md, .help = "Display target memory as 8-bit bytes", + .usage = "address [count]", }, { .name = "array2mem", .mode = COMMAND_EXEC, - .jim_handler = &jim_target_array2mem, + .jim_handler = jim_target_array2mem, + .help = "Writes Tcl array of 8/16/32 bit numbers " + "to target memory", + .usage = "arrayname bitwidth address count", }, { .name = "mem2array", .mode = COMMAND_EXEC, - .jim_handler = &jim_target_mem2array, + .jim_handler = jim_target_mem2array, + .help = "Loads Tcl array of 8/16/32 bit numbers " + "from target memory", + .usage = "arrayname bitwidth address count", }, { .name = "eventlist", .mode = COMMAND_EXEC, - .jim_handler = &jim_target_event_list, + .jim_handler = jim_target_event_list, + .help = "displays a table of events defined for this target", }, { .name = "curstate", .mode = COMMAND_EXEC, - .jim_handler = &jim_target_current_state, + .jim_handler = jim_target_current_state, + .help = "displays the current state of this target", }, { .name = "arp_examine", .mode = COMMAND_EXEC, - .jim_handler = &jim_target_examine, + .jim_handler = jim_target_examine, + .help = "used internally for reset processing", }, { .name = "arp_poll", .mode = COMMAND_EXEC, - .jim_handler = &jim_target_poll, + .jim_handler = jim_target_poll, + .help = "used internally for reset processing", }, { .name = "arp_reset", .mode = COMMAND_EXEC, - .jim_handler = &jim_target_reset, + .jim_handler = jim_target_reset, + .help = "used internally for reset processing", }, { .name = "arp_halt", .mode = COMMAND_EXEC, - .jim_handler = &jim_target_halt, + .jim_handler = jim_target_halt, + .help = "used internally for reset processing", }, { .name = "arp_waitstate", .mode = COMMAND_EXEC, - .jim_handler = &jim_target_wait_state, + .jim_handler = jim_target_wait_state, + .help = "used internally for reset processing", }, { .name = "invoke-event", .mode = COMMAND_EXEC, - .jim_handler = &jim_target_invoke_event, + .jim_handler = jim_target_invoke_event, + .help = "invoke handler for specified event", + .usage = "event_name", }, COMMAND_REGISTRATION_DONE }; @@ -4472,7 +4502,7 @@ static int target_create(Jim_GetOptInfo *goi) } *tpp = target; } - + /* now - create the new target name command */ const const struct command_registration target_subcommands[] = { { @@ -4615,51 +4645,54 @@ static const struct command_registration target_subcommand_handlers[] = { { .name = "init", .mode = COMMAND_CONFIG, - .handler = &handle_target_init_command, + .handler = handle_target_init_command, .help = "initialize targets", }, { .name = "create", + /* REVISIT this should be COMMAND_CONFIG ... */ .mode = COMMAND_ANY, - .jim_handler = &jim_target_create, - .usage = "<name> <type> ...", - .help = "Returns the currently selected target", + .jim_handler = jim_target_create, + .usage = "name type '-chain-position' name [options ...]", + .help = "Creates and selects a new target", }, { .name = "current", .mode = COMMAND_ANY, - .jim_handler = &jim_target_current, + .jim_handler = jim_target_current, .help = "Returns the currently selected target", }, { .name = "types", .mode = COMMAND_ANY, - .jim_handler = &jim_target_types, - .help = "Returns the available target types as a list of strings", + .jim_handler = jim_target_types, + .help = "Returns the available target types as " + "a list of strings", }, { .name = "names", .mode = COMMAND_ANY, - .jim_handler = &jim_target_names, + .jim_handler = jim_target_names, .help = "Returns the names of all targets as a list of strings", }, { .name = "number", .mode = COMMAND_ANY, - .jim_handler = &jim_target_number, - .usage = "<number>", - .help = "Returns the name of target <n>", + .jim_handler = jim_target_number, + .usage = "number", + .help = "Returns the name of the numbered target " + "(DEPRECATED)", }, { .name = "count", .mode = COMMAND_ANY, - .jim_handler = &jim_target_count, - .help = "Returns the number of targets as an integer", + .jim_handler = jim_target_count, + .help = "Returns the number of targets as an integer " + "(DEPRECATED)", }, COMMAND_REGISTRATION_DONE }; - struct FastLoad { uint32_t address; @@ -4833,11 +4866,11 @@ COMMAND_HANDLER(handle_fast_load_command) static const struct command_registration target_command_handlers[] = { { .name = "targets", - .handler = &handle_targets_command, + .handler = handle_targets_command, .mode = COMMAND_ANY, - .help = "change current command line target (one parameter) " - "or list targets (no parameters)", - .usage = "[<new_current_target>]", + .help = "change current default target (one parameter) " + "or prints table of all targets (no parameters)", + .usage = "[target]", }, { .name = "target", @@ -4857,69 +4890,75 @@ int target_register_commands(struct command_context *cmd_ctx) static const struct command_registration target_exec_command_handlers[] = { { .name = "fast_load_image", - .handler = &handle_fast_load_image_command, + .handler = handle_fast_load_image_command, .mode = COMMAND_ANY, - .help = "Load image into memory, mainly for profiling purposes", - .usage = "<file> <address> ['bin'|'ihex'|'elf'|'s19'] " - "[min_address] [max_length]", + .help = "Load image into server memory for later use by " + "fast_load; primarily for profiling", + .usage = "filename address ['bin'|'ihex'|'elf'|'s19'] " + "[min_address [max_length]]", }, { .name = "fast_load", - .handler = &handle_fast_load_command, + .handler = handle_fast_load_command, .mode = COMMAND_EXEC, .help = "loads active fast load image to current target " "- mainly for profiling purposes", }, { .name = "profile", - .handler = &handle_profile_command, + .handler = handle_profile_command, .mode = COMMAND_EXEC, .help = "profiling samples the CPU PC", }, /** @todo don't register virt2phys() unless target supports it */ { .name = "virt2phys", - .handler = &handle_virt2phys_command, + .handler = handle_virt2phys_command, .mode = COMMAND_ANY, .help = "translate a virtual address into a physical address", + .usage = "virual_address", }, - { .name = "reg", - .handler = &handle_reg_command, + .handler = handle_reg_command, .mode = COMMAND_EXEC, - .help = "display or set a register", + .help = "display or set a register; with no arguments, " + "displays all registers and their values", + .usage = "[(register_name|register_number) [value]]", }, - { .name = "poll", - .handler = &handle_poll_command, + .handler = handle_poll_command, .mode = COMMAND_EXEC, - .help = "poll target state", + .help = "poll target state; or reconfigure background polling", + .usage = "['on'|'off']", }, { .name = "wait_halt", - .handler = &handle_wait_halt_command, + .handler = handle_wait_halt_command, .mode = COMMAND_EXEC, - .help = "wait for target halt", - .usage = "[time (s)]", + .help = "wait up to the specified number of milliseconds " + "(default 5) for a previously requested halt", + .usage = "[milliseconds]", }, { .name = "halt", - .handler = &handle_halt_command, + .handler = handle_halt_command, .mode = COMMAND_EXEC, - .help = "halt target", + .help = "request target to halt, then wait up to the specified" + "number of milliseconds (default 5) for it to complete", + .usage = "[milliseconds]", }, { .name = "resume", - .handler = &handle_resume_command, + .handler = handle_resume_command, .mode = COMMAND_EXEC, - .help = "resume target", - .usage = "[<address>]", + .help = "resume target execution from current PC or address", + .usage = "[address]", }, { .name = "reset", - .handler = &handle_reset_command, + .handler = handle_reset_command, .mode = COMMAND_EXEC, .usage = "[run|halt|init]", .help = "Reset all targets into the specified mode." @@ -4927,133 +4966,127 @@ static const struct command_registration target_exec_command_handlers[] = { }, { .name = "soft_reset_halt", - .handler = &handle_soft_reset_halt_command, + .handler = handle_soft_reset_halt_command, .mode = COMMAND_EXEC, .help = "halt the target and do a soft reset", }, { - .name = "step", - .handler = &handle_step_command, + .handler = handle_step_command, .mode = COMMAND_EXEC, - .help = "step one instruction from current PC or [addr]", - .usage = "[<address>]", + .help = "step one instruction from current PC or address", + .usage = "[address]", }, { - .name = "mdw", - .handler = &handle_md_command, + .handler = handle_md_command, .mode = COMMAND_EXEC, .help = "display memory words", - .usage = "[phys] <addr> [count]", + .usage = "['phys'] address [count]", }, { .name = "mdh", - .handler = &handle_md_command, + .handler = handle_md_command, .mode = COMMAND_EXEC, .help = "display memory half-words", - .usage = "[phys] <addr> [count]", + .usage = "['phys'] address [count]", }, { .name = "mdb", - .handler = &handle_md_command, + .handler = handle_md_command, .mode = COMMAND_EXEC, .help = "display memory bytes", - .usage = "[phys] <addr> [count]", + .usage = "['phys'] address [count]", }, { - .name = "mww", - .handler = &handle_mw_command, + .handler = handle_mw_command, .mode = COMMAND_EXEC, .help = "write memory word", - .usage = "[phys] <addr> <value> [count]", + .usage = "['phys'] address value [count]", }, { .name = "mwh", - .handler = &handle_mw_command, + .handler = handle_mw_command, .mode = COMMAND_EXEC, .help = "write memory half-word", - .usage = "[phys] <addr> <value> [count]", + .usage = "['phys'] address value [count]", }, { .name = "mwb", - .handler = &handle_mw_command, + .handler = handle_mw_command, .mode = COMMAND_EXEC, .help = "write memory byte", - .usage = "[phys] <addr> <value> [count]", + .usage = "['phys'] address value [count]", }, { - .name = "bp", - .handler = &handle_bp_command, + .handler = handle_bp_command, .mode = COMMAND_EXEC, - .help = "list or set breakpoint", - .usage = "[<address> <length> [hw]]", + .help = "list or set hardware or software breakpoint", + .usage = "[address length ['hw']]", }, { .name = "rbp", - .handler = &handle_rbp_command, + .handler = handle_rbp_command, .mode = COMMAND_EXEC, .help = "remove breakpoint", - .usage = "<address>", + .usage = "address", }, { - .name = "wp", - .handler = &handle_wp_command, + .handler = handle_wp_command, .mode = COMMAND_EXEC, - .help = "list or set watchpoint", - .usage = "[<address> <length> <r/w/a> [value] [mask]]", + .help = "list (no params) or create watchpoints", + .usage = "[address length [('r'|'w'|'a') value [mask]]]", }, { .name = "rwp", - .handler = &handle_rwp_command, + .handler = handle_rwp_command, .mode = COMMAND_EXEC, .help = "remove watchpoint", - .usage = "<address>", - + .usage = "address", }, { .name = "load_image", - .handler = &handle_load_image_command, + .handler = handle_load_image_command, .mode = COMMAND_EXEC, - .usage = "<file> <address> ['bin'|'ihex'|'elf'|'s19'] " + .usage = "filename address ['bin'|'ihex'|'elf'|'s19'] " "[min_address] [max_length]", }, { .name = "dump_image", - .handler = &handle_dump_image_command, + .handler = handle_dump_image_command, .mode = COMMAND_EXEC, - .usage = "<file> <address> <size>", + .usage = "filename address size", }, { .name = "verify_image", - .handler = &handle_verify_image_command, + .handler = handle_verify_image_command, .mode = COMMAND_EXEC, - .usage = "<file> [offset] [type]", + .usage = "filename [offset [type]]", }, { .name = "test_image", - .handler = &handle_test_image_command, + .handler = handle_test_image_command, .mode = COMMAND_EXEC, - .usage = "<file> [offset] [type]", + .usage = "filename [offset [type]]", }, { .name = "ocd_mem2array", .mode = COMMAND_EXEC, - .jim_handler = &jim_mem2array, - .help = "read memory and return as a TCL array " + .jim_handler = jim_mem2array, + .help = "read 8/16/32 bit memory and return as a TCL array " "for script processing", - .usage = "<arrayname> <width=32|16|8> <address> <count>", + .usage = "arrayname bitwidth address count", }, { .name = "ocd_array2mem", .mode = COMMAND_EXEC, - .jim_handler = &jim_array2mem, + .jim_handler = jim_array2mem, .help = "convert a TCL array to memory locations " - "and write the values", - .usage = "<arrayname> <width=32|16|8> <address> <count>", + "and write the 8/16/32 bit values", + .usage = "arrayname bitwidth address count", }, COMMAND_REGISTRATION_DONE }; diff --git a/src/target/target_request.c b/src/target/target_request.c index d22b8a2..ec3d48e 100644 --- a/src/target/target_request.c +++ b/src/target/target_request.c @@ -303,10 +303,10 @@ COMMAND_HANDLER(handle_target_request_debugmsgs_command) static const struct command_registration target_req_exec_command_handlers[] = { { .name = "debugmsgs", - .handler = &handle_target_request_debugmsgs_command, + .handler = handle_target_request_debugmsgs_command, .mode = COMMAND_EXEC, - .help = "set reception of debug messages from target", - .usage = "(enable|disable)", + .help = "display and/or modify reception of debug messages from target", + .usage = "['enable'|'charmsg'|'disable']", }, COMMAND_REGISTRATION_DONE }; diff --git a/src/target/trace.c b/src/target/trace.c index 56a18a4..a8ec143 100644 --- a/src/target/trace.c +++ b/src/target/trace.c @@ -159,18 +159,18 @@ COMMAND_HANDLER(handle_trace_history_command) static const struct command_registration trace_exec_command_handlers[] = { { .name = "history", - .handler = &handle_trace_history_command, + .handler = handle_trace_history_command, .mode... [truncated message content] |
From: Spencer O. <nt...@us...> - 2010-01-07 23:41:17
|
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 991d030fcc9be971f29498ea7e1b3afbed05815b (commit) via c68c2751f309103cc7116464e6c3242d54c1007b (commit) via 2d450b90333b01fbd85570e5d881c3a795038744 (commit) from 2bc7446bb8caf751f7d6900af26384f6c64cc791 (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 991d030fcc9be971f29498ea7e1b3afbed05815b Author: Spencer Oliver <nt...@us...> Date: Thu Jan 7 22:39:35 2010 +0000 MIPS: change bulk_write_memory fallback msg to LOG_DEBUG Signed-off-by: Spencer Oliver <nt...@us...> diff --git a/src/target/mips_m4k.c b/src/target/mips_m4k.c index 312fc09..f229690 100644 --- a/src/target/mips_m4k.c +++ b/src/target/mips_m4k.c @@ -1004,7 +1004,7 @@ int mips_m4k_bulk_write_memory(struct target *target, uint32_t address, uint32_t if (retval != ERROR_OK) { /* FASTDATA access failed, try normal memory write */ - LOG_WARNING("Fastdata access Failed, falling back to non-bulk write"); + LOG_DEBUG("Fastdata access Failed, falling back to non-bulk write"); retval = mips_m4k_write_memory(target, address, 4, count, buffer); } commit c68c2751f309103cc7116464e6c3242d54c1007b Author: Spencer Oliver <nt...@us...> Date: Thu Jan 7 20:56:07 2010 +0000 MIPS: whitespace cleanup Signed-off-by: Spencer Oliver <nt...@us...> diff --git a/src/target/mips32.h b/src/target/mips32.h index 9ad5293..4fe61bc 100644 --- a/src/target/mips32.h +++ b/src/target/mips32.h @@ -123,7 +123,7 @@ struct mips32_core_reg /* ejtag specific instructions */ #define MIPS32_DRET 0x4200001F #define MIPS32_SDBBP 0x7000003F -#define MIPS16_SDBBP 0xE801 +#define MIPS16_SDBBP 0xE801 int mips32_arch_state(struct target *target); diff --git a/src/target/mips32_pracc.c b/src/target/mips32_pracc.c index ac1d1b3..52d31bd 100644 --- a/src/target/mips32_pracc.c +++ b/src/target/mips32_pracc.c @@ -288,37 +288,37 @@ int mips32_pracc_read_mem32(struct mips_ejtag *ejtag_info, uint32_t addr, int co static const uint32_t code[] = { /* start: */ MIPS32_MTC0(15,31,0), /* move $15 to COP0 DeSave */ - MIPS32_LUI(15,UPPER16(MIPS32_PRACC_STACK)), /* $15 = MIPS32_PRACC_STACK */ + MIPS32_LUI(15,UPPER16(MIPS32_PRACC_STACK)), /* $15 = MIPS32_PRACC_STACK */ MIPS32_ORI(15,15,LOWER16(MIPS32_PRACC_STACK)), - MIPS32_SW(8,0,15), /* sw $8,($15) */ - MIPS32_SW(9,0,15), /* sw $9,($15) */ - MIPS32_SW(10,0,15), /* sw $10,($15) */ - MIPS32_SW(11,0,15), /* sw $11,($15) */ + MIPS32_SW(8,0,15), /* sw $8,($15) */ + MIPS32_SW(9,0,15), /* sw $9,($15) */ + MIPS32_SW(10,0,15), /* sw $10,($15) */ + MIPS32_SW(11,0,15), /* sw $11,($15) */ MIPS32_LUI(8,UPPER16(MIPS32_PRACC_PARAM_IN)), /* $8 = MIPS32_PRACC_PARAM_IN */ MIPS32_ORI(8,8,LOWER16(MIPS32_PRACC_PARAM_IN)), MIPS32_LW(9,0,8), /* $9 = mem[$8]; read addr */ MIPS32_LW(10,4,8), /* $10 = mem[$8 + 4]; read count */ - MIPS32_LUI(11,UPPER16(MIPS32_PRACC_PARAM_OUT)), /* $11 = MIPS32_PRACC_PARAM_OUT */ + MIPS32_LUI(11,UPPER16(MIPS32_PRACC_PARAM_OUT)), /* $11 = MIPS32_PRACC_PARAM_OUT */ MIPS32_ORI(11,11,LOWER16(MIPS32_PRACC_PARAM_OUT)), /* loop: */ MIPS32_BEQ(0,10,8), /* beq 0, $10, end */ MIPS32_NOP, - MIPS32_LW(8,0,9), /* lw $8,0($9), Load $8 with the word @mem[$9] */ - MIPS32_SW(8,0,11), /* sw $8,0($11) */ + MIPS32_LW(8,0,9), /* lw $8,0($9), Load $8 with the word @mem[$9] */ + MIPS32_SW(8,0,11), /* sw $8,0($11) */ - MIPS32_ADDI(10,10,NEG16(1)), /* $10-- */ - MIPS32_ADDI(9,9,4), /* $1 += 4 */ - MIPS32_ADDI(11,11,4), /* $11 += 4 */ + MIPS32_ADDI(10,10,NEG16(1)), /* $10-- */ + MIPS32_ADDI(9,9,4), /* $1 += 4 */ + MIPS32_ADDI(11,11,4), /* $11 += 4 */ MIPS32_B(NEG16(8)), /* b loop */ MIPS32_NOP, /* end: */ - MIPS32_LW(11,0,15), /* lw $11,($15) */ - MIPS32_LW(10,0,15), /* lw $10,($15) */ - MIPS32_LW(9,0,15), /* lw $9,($15) */ - MIPS32_LW(8,0,15), /* lw $8,($15) */ + MIPS32_LW(11,0,15), /* lw $11,($15) */ + MIPS32_LW(10,0,15), /* lw $10,($15) */ + MIPS32_LW(9,0,15), /* lw $9,($15) */ + MIPS32_LW(8,0,15), /* lw $8,($15) */ MIPS32_B(NEG16(27)), /* b start */ MIPS32_MFC0(15,31,0), /* move COP0 DeSave to $15 */ }; @@ -358,16 +358,16 @@ int mips32_pracc_read_u32(struct mips_ejtag *ejtag_info, uint32_t addr, uint32_t static const uint32_t code[] = { /* start: */ MIPS32_MTC0(15,31,0), /* move $15 to COP0 DeSave */ - MIPS32_LUI(15,UPPER16(MIPS32_PRACC_STACK)), /* $15 = MIPS32_PRACC_STACK */ + MIPS32_LUI(15,UPPER16(MIPS32_PRACC_STACK)), /* $15 = MIPS32_PRACC_STACK */ MIPS32_ORI(15,15,LOWER16(MIPS32_PRACC_STACK)), - MIPS32_SW(8,0,15), /* sw $8,($15) */ + MIPS32_SW(8,0,15), /* sw $8,($15) */ MIPS32_LW(8,NEG16(MIPS32_PRACC_STACK-MIPS32_PRACC_PARAM_IN),15), /* load R8 @ param_in[0] = address */ - MIPS32_LW(8,0,8), /* lw $8,0($8), Load $8 with the word @mem[$8] */ + MIPS32_LW(8,0,8), /* lw $8,0($8), Load $8 with the word @mem[$8] */ MIPS32_SW(8,NEG16(MIPS32_PRACC_STACK-MIPS32_PRACC_PARAM_OUT),15), /* store R8 @ param_out[0] */ - MIPS32_LW(8,0,15), /* lw $8,($15) */ + MIPS32_LW(8,0,15), /* lw $8,($15) */ MIPS32_B(NEG16(9)), /* b start */ MIPS32_MFC0(15,31,0), /* move COP0 DeSave to $15 */ }; @@ -391,12 +391,12 @@ int mips32_pracc_read_mem16(struct mips_ejtag *ejtag_info, uint32_t addr, int co static const uint32_t code[] = { /* start: */ MIPS32_MTC0(15,31,0), /* move $15 to COP0 DeSave */ - MIPS32_LUI(15,UPPER16(MIPS32_PRACC_STACK)), /* $15 = MIPS32_PRACC_STACK */ + MIPS32_LUI(15,UPPER16(MIPS32_PRACC_STACK)), /* $15 = MIPS32_PRACC_STACK */ MIPS32_ORI(15,15,LOWER16(MIPS32_PRACC_STACK)), - MIPS32_SW(8,0,15), /* sw $8,($15) */ - MIPS32_SW(9,0,15), /* sw $9,($15) */ - MIPS32_SW(10,0,15), /* sw $10,($15) */ - MIPS32_SW(11,0,15), /* sw $11,($15) */ + MIPS32_SW(8,0,15), /* sw $8,($15) */ + MIPS32_SW(9,0,15), /* sw $9,($15) */ + MIPS32_SW(10,0,15), /* sw $10,($15) */ + MIPS32_SW(11,0,15), /* sw $11,($15) */ MIPS32_LUI(8,UPPER16(MIPS32_PRACC_PARAM_IN)), /* $8 = MIPS32_PRACC_PARAM_IN */ MIPS32_ORI(8,8,LOWER16(MIPS32_PRACC_PARAM_IN)), @@ -405,22 +405,22 @@ int mips32_pracc_read_mem16(struct mips_ejtag *ejtag_info, uint32_t addr, int co MIPS32_LUI(11,UPPER16(MIPS32_PRACC_PARAM_OUT)), /* $11 = MIPS32_PRACC_PARAM_OUT */ MIPS32_ORI(11,11,LOWER16(MIPS32_PRACC_PARAM_OUT)), /* loop: */ - MIPS32_BEQ(0,10,8), /* beq 0, $10, end */ + MIPS32_BEQ(0,10,8), /* beq 0, $10, end */ MIPS32_NOP, - MIPS32_LHU(8,0,9), /* lw $8,0($9), Load $8 with the halfword @mem[$9] */ - MIPS32_SW(8,0,11), /* sw $8,0($11) */ + MIPS32_LHU(8,0,9), /* lw $8,0($9), Load $8 with the halfword @mem[$9] */ + MIPS32_SW(8,0,11), /* sw $8,0($11) */ - MIPS32_ADDI(10,10,NEG16(1)), /* $10-- */ - MIPS32_ADDI(9,9,2), /* $9 += 2 */ - MIPS32_ADDI(11,11,4), /* $11 += 4 */ + MIPS32_ADDI(10,10,NEG16(1)), /* $10-- */ + MIPS32_ADDI(9,9,2), /* $9 += 2 */ + MIPS32_ADDI(11,11,4), /* $11 += 4 */ MIPS32_B(NEG16(8)), /* b loop */ MIPS32_NOP, /* end: */ - MIPS32_LW(11,0,15), /* lw $11,($15) */ - MIPS32_LW(10,0,15), /* lw $10,($15) */ - MIPS32_LW(9,0,15), /* lw $9,($15) */ - MIPS32_LW(8,0,15), /* lw $8,($15) */ + MIPS32_LW(11,0,15), /* lw $11,($15) */ + MIPS32_LW(10,0,15), /* lw $10,($15) */ + MIPS32_LW(9,0,15), /* lw $9,($15) */ + MIPS32_LW(8,0,15), /* lw $8,($15) */ MIPS32_B(NEG16(27)), /* b start */ MIPS32_MFC0(15,30,0), /* move COP0 DeSave to $15 */ }; @@ -468,36 +468,36 @@ int mips32_pracc_read_mem8(struct mips_ejtag *ejtag_info, uint32_t addr, int cou static const uint32_t code[] = { /* start: */ MIPS32_MTC0(15,31,0), /* move $15 to COP0 DeSave */ - MIPS32_LUI(15,UPPER16(MIPS32_PRACC_STACK)), /* $15 = MIPS32_PRACC_STACK */ + MIPS32_LUI(15,UPPER16(MIPS32_PRACC_STACK)), /* $15 = MIPS32_PRACC_STACK */ MIPS32_ORI(15,15,LOWER16(MIPS32_PRACC_STACK)), - MIPS32_SW(8,0,15), /* sw $8,($15) */ - MIPS32_SW(9,0,15), /* sw $9,($15) */ - MIPS32_SW(10,0,15), /* sw $10,($15) */ - MIPS32_SW(11,0,15), /* sw $11,($15) */ + MIPS32_SW(8,0,15), /* sw $8,($15) */ + MIPS32_SW(9,0,15), /* sw $9,($15) */ + MIPS32_SW(10,0,15), /* sw $10,($15) */ + MIPS32_SW(11,0,15), /* sw $11,($15) */ - MIPS32_LUI(8,UPPER16(MIPS32_PRACC_PARAM_IN)), /* $8 = MIPS32_PRACC_PARAM_IN */ + MIPS32_LUI(8,UPPER16(MIPS32_PRACC_PARAM_IN)), /* $8 = MIPS32_PRACC_PARAM_IN */ MIPS32_ORI(8,8,LOWER16(MIPS32_PRACC_PARAM_IN)), - MIPS32_LW(9,0,8), /* $9 = mem[$8]; read addr */ - MIPS32_LW(10,4,8), /* $10 = mem[$8 + 4]; read count */ - MIPS32_LUI(11,UPPER16(MIPS32_PRACC_PARAM_OUT)), /* $11 = MIPS32_PRACC_PARAM_OUT */ + MIPS32_LW(9,0,8), /* $9 = mem[$8]; read addr */ + MIPS32_LW(10,4,8), /* $10 = mem[$8 + 4]; read count */ + MIPS32_LUI(11,UPPER16(MIPS32_PRACC_PARAM_OUT)), /* $11 = MIPS32_PRACC_PARAM_OUT */ MIPS32_ORI(11,11,LOWER16(MIPS32_PRACC_PARAM_OUT)), /* loop: */ - MIPS32_BEQ(0,10,8), /* beq 0, $10, end */ + MIPS32_BEQ(0,10,8), /* beq 0, $10, end */ MIPS32_NOP, - MIPS32_LBU(8,0,9), /* lw $8,0($9), Load t4 with the byte @mem[t1] */ - MIPS32_SW(8,0,11), /* sw $8,0($11) */ + MIPS32_LBU(8,0,9), /* lw $8,0($9), Load t4 with the byte @mem[t1] */ + MIPS32_SW(8,0,11), /* sw $8,0($11) */ - MIPS32_ADDI(10,10,NEG16(1)), /* $10-- */ - MIPS32_ADDI(9,9,1), /* $9 += 1 */ - MIPS32_ADDI(11,11,4), /* $11 += 4 */ + MIPS32_ADDI(10,10,NEG16(1)), /* $10-- */ + MIPS32_ADDI(9,9,1), /* $9 += 1 */ + MIPS32_ADDI(11,11,4), /* $11 += 4 */ MIPS32_B(NEG16(8)), /* b loop */ MIPS32_NOP, /* end: */ - MIPS32_LW(11,0,15), /* lw $11,($15) */ - MIPS32_LW(10,0,15), /* lw $10,($15) */ - MIPS32_LW(9,0,15), /* lw $9,($15) */ - MIPS32_LW(8,0,15), /* lw $8,($15) */ + MIPS32_LW(11,0,15), /* lw $11,($15) */ + MIPS32_LW(10,0,15), /* lw $10,($15) */ + MIPS32_LW(9,0,15), /* lw $9,($15) */ + MIPS32_LW(8,0,15), /* lw $8,($15) */ MIPS32_B(NEG16(27)), /* b start */ MIPS32_MFC0(15,31,0), /* move COP0 DeSave to $15 */ }; @@ -563,31 +563,31 @@ int mips32_pracc_write_mem32(struct mips_ejtag *ejtag_info, uint32_t addr, int c static const uint32_t code[] = { /* start: */ MIPS32_MTC0(15,31,0), /* move $15 to COP0 DeSave */ - MIPS32_LUI(15,UPPER16(MIPS32_PRACC_STACK)), /* $15 = MIPS32_PRACC_STACK */ + MIPS32_LUI(15,UPPER16(MIPS32_PRACC_STACK)), /* $15 = MIPS32_PRACC_STACK */ MIPS32_ORI(15,15,LOWER16(MIPS32_PRACC_STACK)), - MIPS32_SW(8,0,15), /* sw $8,($15) */ - MIPS32_SW(9,0,15), /* sw $9,($15) */ - MIPS32_SW(10,0,15), /* sw $10,($15) */ - MIPS32_SW(11,0,15), /* sw $11,($15) */ + MIPS32_SW(8,0,15), /* sw $8,($15) */ + MIPS32_SW(9,0,15), /* sw $9,($15) */ + MIPS32_SW(10,0,15), /* sw $10,($15) */ + MIPS32_SW(11,0,15), /* sw $11,($15) */ MIPS32_ADDI(8,15,NEG16(MIPS32_PRACC_STACK-MIPS32_PRACC_PARAM_IN)), /* $8= MIPS32_PRACC_PARAM_IN */ - MIPS32_LW(9,0,8), /* Load write addr to $9 */ + MIPS32_LW(9,0,8), /* Load write addr to $9 */ MIPS32_LW(10,4,8), /* Load write count to $10 */ MIPS32_ADDI(8,8,8), /* $8 += 8 beginning of data */ /* loop: */ - MIPS32_LW(11,0,8), /* lw $11,0($8), Load $11 with the word @mem[$8] */ - MIPS32_SW(11,0,9), /* sw $11,0($9) */ + MIPS32_LW(11,0,8), /* lw $11,0($8), Load $11 with the word @mem[$8] */ + MIPS32_SW(11,0,9), /* sw $11,0($9) */ - MIPS32_ADDI(9,9,4), /* $9 += 4 */ + MIPS32_ADDI(9,9,4), /* $9 += 4 */ MIPS32_BNE(10,9,NEG16(4)), /* bne $10, $9, loop */ MIPS32_ADDI(8,8,4), /* $8 += 4 */ /* end: */ - MIPS32_LW(11,0,15), /* lw $11,($15) */ - MIPS32_LW(10,0,15), /* lw $10,($15) */ - MIPS32_LW(9,0,15), /* lw $9,($15) */ - MIPS32_LW(8,0,15), /* lw $8,($15) */ + MIPS32_LW(11,0,15), /* lw $11,($15) */ + MIPS32_LW(10,0,15), /* lw $10,($15) */ + MIPS32_LW(9,0,15), /* lw $9,($15) */ + MIPS32_LW(8,0,15), /* lw $8,($15) */ MIPS32_B(NEG16(21)), /* b start */ MIPS32_MFC0(15,31,0), /* move COP0 DeSave to $15 */ }; @@ -612,18 +612,18 @@ int mips32_pracc_write_u32(struct mips_ejtag *ejtag_info, uint32_t addr, uint32_ static const uint32_t code[] = { /* start: */ MIPS32_MTC0(15,31,0), /* move $15 to COP0 DeSave */ - MIPS32_LUI(15,UPPER16(MIPS32_PRACC_STACK)), /* $15 = MIPS32_PRACC_STACK */ + MIPS32_LUI(15,UPPER16(MIPS32_PRACC_STACK)), /* $15 = MIPS32_PRACC_STACK */ MIPS32_ORI(15,15,LOWER16(MIPS32_PRACC_STACK)), - MIPS32_SW(8,0,15), /* sw $8,($15) */ - MIPS32_SW(9,0,15), /* sw $9,($15) */ + MIPS32_SW(8,0,15), /* sw $8,($15) */ + MIPS32_SW(9,0,15), /* sw $9,($15) */ MIPS32_LW(8,NEG16((MIPS32_PRACC_STACK-MIPS32_PRACC_PARAM_IN)-4), 15), /* load R8 @ param_in[1] = data */ MIPS32_LW(9,NEG16(MIPS32_PRACC_STACK-MIPS32_PRACC_PARAM_IN), 15), /* load R9 @ param_in[0] = address */ - MIPS32_SW(8,0,9), /* sw $8,0($9) */ + MIPS32_SW(8,0,9), /* sw $8,0($9) */ - MIPS32_LW(9,0,15), /* lw $9,($15) */ - MIPS32_LW(8,0,15), /* lw $8,($15) */ + MIPS32_LW(9,0,15), /* lw $9,($15) */ + MIPS32_LW(8,0,15), /* lw $8,($15) */ MIPS32_B(NEG16(11)), /* b start */ MIPS32_MFC0(15,31,0), /* move COP0 DeSave to $15 */ }; @@ -644,36 +644,36 @@ int mips32_pracc_write_mem16(struct mips_ejtag *ejtag_info, uint32_t addr, int c static const uint32_t code[] = { /* start: */ MIPS32_MTC0(15,31,0), /* move $15 to COP0 DeSave */ - MIPS32_LUI(15,UPPER16(MIPS32_PRACC_STACK)), /* $15 = MIPS32_PRACC_STACK */ + MIPS32_LUI(15,UPPER16(MIPS32_PRACC_STACK)), /* $15 = MIPS32_PRACC_STACK */ MIPS32_ORI(15,15,LOWER16(MIPS32_PRACC_STACK)), - MIPS32_SW(8,0,15), /* sw $8,($15) */ - MIPS32_SW(9,0,15), /* sw $9,($15) */ - MIPS32_SW(10,0,15), /* sw $10,($15) */ - MIPS32_SW(11,0,15), /* sw $11,($15) */ + MIPS32_SW(8,0,15), /* sw $8,($15) */ + MIPS32_SW(9,0,15), /* sw $9,($15) */ + MIPS32_SW(10,0,15), /* sw $10,($15) */ + MIPS32_SW(11,0,15), /* sw $11,($15) */ - MIPS32_LUI(8,UPPER16(MIPS32_PRACC_PARAM_IN)), /* $8 = MIPS32_PRACC_PARAM_IN */ + MIPS32_LUI(8,UPPER16(MIPS32_PRACC_PARAM_IN)), /* $8 = MIPS32_PRACC_PARAM_IN */ MIPS32_ORI(8,8,LOWER16(MIPS32_PRACC_PARAM_IN)), - MIPS32_LW(9,0,8), /* Load write addr to $9 */ - MIPS32_LW(10,4,8), /* Load write count to $10 */ - MIPS32_ADDI(8,8,8), /* $8 += 8 */ + MIPS32_LW(9,0,8), /* Load write addr to $9 */ + MIPS32_LW(10,4,8), /* Load write count to $10 */ + MIPS32_ADDI(8,8,8), /* $8 += 8 */ /* loop: */ MIPS32_BEQ(0,10,8), /* beq $0, $10, end */ MIPS32_NOP, - MIPS32_LW(11,0,8), /* lw $11,0($8), Load $11 with the word @mem[$8] */ - MIPS32_SH(11,0,9), /* sh $11,0($9) */ + MIPS32_LW(11,0,8), /* lw $11,0($8), Load $11 with the word @mem[$8] */ + MIPS32_SH(11,0,9), /* sh $11,0($9) */ - MIPS32_ADDI(10,10,NEG16(1)), /* $10-- */ - MIPS32_ADDI(9,9,2), /* $9 += 2 */ - MIPS32_ADDI(8,8,4), /* $8 += 4 */ + MIPS32_ADDI(10,10,NEG16(1)), /* $10-- */ + MIPS32_ADDI(9,9,2), /* $9 += 2 */ + MIPS32_ADDI(8,8,4), /* $8 += 4 */ MIPS32_B(NEG16(8)), /* b loop */ MIPS32_NOP, /* end: */ - MIPS32_LW(11,0,15), /* lw $11,($15) */ - MIPS32_LW(10,0,15), /* lw $10,($15) */ - MIPS32_LW(9,0,15), /* lw $9,($15) */ - MIPS32_LW(8,0,15), /* lw $8,($15) */ + MIPS32_LW(11,0,15), /* lw $11,($15) */ + MIPS32_LW(10,0,15), /* lw $10,($15) */ + MIPS32_LW(9,0,15), /* lw $9,($15) */ + MIPS32_LW(8,0,15), /* lw $8,($15) */ MIPS32_B(NEG16(26)), /* b start */ MIPS32_MFC0(15,31,0), /* move COP0 DeSave to $15 */ }; @@ -702,36 +702,36 @@ int mips32_pracc_write_mem8(struct mips_ejtag *ejtag_info, uint32_t addr, int co static const uint32_t code[] = { /* start: */ MIPS32_MTC0(15,31,0), /* move $15 to COP0 DeSave */ - MIPS32_LUI(15,UPPER16(MIPS32_PRACC_STACK)), /* $15 = MIPS32_PRACC_STACK */ + MIPS32_LUI(15,UPPER16(MIPS32_PRACC_STACK)), /* $15 = MIPS32_PRACC_STACK */ MIPS32_ORI(15,15,LOWER16(MIPS32_PRACC_STACK)), - MIPS32_SW(8,0,15), /* sw $8,($15) */ - MIPS32_SW(9,0,15), /* sw $9,($15) */ - MIPS32_SW(10,0,15), /* sw $10,($15) */ - MIPS32_SW(11,0,15), /* sw $11,($15) */ + MIPS32_SW(8,0,15), /* sw $8,($15) */ + MIPS32_SW(9,0,15), /* sw $9,($15) */ + MIPS32_SW(10,0,15), /* sw $10,($15) */ + MIPS32_SW(11,0,15), /* sw $11,($15) */ - MIPS32_LUI(8,UPPER16(MIPS32_PRACC_PARAM_IN)), /* $8 = MIPS32_PRACC_PARAM_IN */ + MIPS32_LUI(8,UPPER16(MIPS32_PRACC_PARAM_IN)), /* $8 = MIPS32_PRACC_PARAM_IN */ MIPS32_ORI(8,8,LOWER16(MIPS32_PRACC_PARAM_IN)), - MIPS32_LW(9,0,8), /* Load write addr to $9 */ - MIPS32_LW(10,4,8), /* Load write count to $10 */ - MIPS32_ADDI(8,8,8), /* $8 += 8 */ + MIPS32_LW(9,0,8), /* Load write addr to $9 */ + MIPS32_LW(10,4,8), /* Load write count to $10 */ + MIPS32_ADDI(8,8,8), /* $8 += 8 */ /* loop: */ MIPS32_BEQ(0,10,8), /* beq $0, $10, end */ MIPS32_NOP, - MIPS32_LW(11,0,8), /* lw $11,0($8), Load $11 with the word @mem[$8] */ - MIPS32_SB(11,0,9), /* sb $11,0($9) */ + MIPS32_LW(11,0,8), /* lw $11,0($8), Load $11 with the word @mem[$8] */ + MIPS32_SB(11,0,9), /* sb $11,0($9) */ - MIPS32_ADDI(10,10,NEG16(1)), /* $10-- */ - MIPS32_ADDI(9,9,1), /* $9 += 1 */ - MIPS32_ADDI(8,8,4), /* $8 += 4 */ + MIPS32_ADDI(10,10,NEG16(1)), /* $10-- */ + MIPS32_ADDI(9,9,1), /* $9 += 1 */ + MIPS32_ADDI(8,8,4), /* $8 += 4 */ MIPS32_B(NEG16(8)), /* b loop */ MIPS32_NOP, /* end: */ - MIPS32_LW(11,0,15), /* lw $11,($15) */ - MIPS32_LW(10,0,15), /* lw $10,($15) */ - MIPS32_LW(9,0,15), /* lw $9,($15) */ - MIPS32_LW(8,0,15), /* lw $8,($15) */ + MIPS32_LW(11,0,15), /* lw $11,($15) */ + MIPS32_LW(10,0,15), /* lw $10,($15) */ + MIPS32_LW(9,0,15), /* lw $9,($15) */ + MIPS32_LW(8,0,15), /* lw $8,($15) */ MIPS32_B(NEG16(26)), /* b start */ MIPS32_MFC0(15,31,0), /* move COP0 DeSave to $15 */ }; @@ -760,60 +760,60 @@ int mips32_pracc_write_regs(struct mips_ejtag *ejtag_info, uint32_t *regs) { static const uint32_t code[] = { /* start: */ - MIPS32_LUI(2,UPPER16(MIPS32_PRACC_PARAM_IN)), /* $2 = MIPS32_PRACC_PARAM_IN */ + MIPS32_LUI(2,UPPER16(MIPS32_PRACC_PARAM_IN)), /* $2 = MIPS32_PRACC_PARAM_IN */ MIPS32_ORI(2,2,LOWER16(MIPS32_PRACC_PARAM_IN)), - MIPS32_LW(1,1*4,2), /* lw $1,1*4($2) */ - MIPS32_LW(15,15*4,2), /* lw $15,15*4($2) */ + MIPS32_LW(1,1*4,2), /* lw $1,1*4($2) */ + MIPS32_LW(15,15*4,2), /* lw $15,15*4($2) */ MIPS32_MTC0(15,31,0), /* move $15 to COP0 DeSave */ - MIPS32_LUI(15,UPPER16(MIPS32_PRACC_STACK)), /* $15 = MIPS32_PRACC_STACK */ + MIPS32_LUI(15,UPPER16(MIPS32_PRACC_STACK)), /* $15 = MIPS32_PRACC_STACK */ MIPS32_ORI(15,15,LOWER16(MIPS32_PRACC_STACK)), - MIPS32_SW(1,0,15), /* sw $1,($15) */ - MIPS32_LUI(1,UPPER16(MIPS32_PRACC_PARAM_IN)), /* $1 = MIPS32_PRACC_PARAM_IN */ + MIPS32_SW(1,0,15), /* sw $1,($15) */ + MIPS32_LUI(1,UPPER16(MIPS32_PRACC_PARAM_IN)), /* $1 = MIPS32_PRACC_PARAM_IN */ MIPS32_ORI(1,1,LOWER16(MIPS32_PRACC_PARAM_IN)), - MIPS32_LW(3,3*4,1), /* lw $3,3*4($1) */ - MIPS32_LW(4,4*4,1), /* lw $4,4*4($1) */ - MIPS32_LW(5,5*4,1), /* lw $5,5*4($1) */ - MIPS32_LW(6,6*4,1), /* lw $6,6*4($1) */ - MIPS32_LW(7,7*4,1), /* lw $7,7*4($1) */ - MIPS32_LW(8,8*4,1), /* lw $8,8*4($1) */ - MIPS32_LW(9,9*4,1), /* lw $9,9*4($1) */ - MIPS32_LW(10,10*4,1), /* lw $10,10*4($1) */ - MIPS32_LW(11,11*4,1), /* lw $11,11*4($1) */ - MIPS32_LW(12,12*4,1), /* lw $12,12*4($1) */ - MIPS32_LW(13,13*4,1), /* lw $13,13*4($1) */ - MIPS32_LW(14,14*4,1), /* lw $14,14*4($1) */ - MIPS32_LW(16,16*4,1), /* lw $16,16*4($1) */ - MIPS32_LW(17,17*4,1), /* lw $17,17*4($1) */ - MIPS32_LW(18,18*4,1), /* lw $18,18*4($1) */ - MIPS32_LW(19,19*4,1), /* lw $19,19*4($1) */ - MIPS32_LW(20,20*4,1), /* lw $20,20*4($1) */ - MIPS32_LW(21,21*4,1), /* lw $21,21*4($1) */ - MIPS32_LW(22,22*4,1), /* lw $22,22*4($1) */ - MIPS32_LW(23,23*4,1), /* lw $23,23*4($1) */ - MIPS32_LW(24,24*4,1), /* lw $24,24*4($1) */ - MIPS32_LW(25,25*4,1), /* lw $25,25*4($1) */ - MIPS32_LW(26,26*4,1), /* lw $26,26*4($1) */ - MIPS32_LW(27,27*4,1), /* lw $27,27*4($1) */ - MIPS32_LW(28,28*4,1), /* lw $28,28*4($1) */ - MIPS32_LW(29,29*4,1), /* lw $29,29*4($1) */ - MIPS32_LW(30,30*4,1), /* lw $30,30*4($1) */ - MIPS32_LW(31,31*4,1), /* lw $31,31*4($1) */ - - MIPS32_LW(2,32*4,1), /* lw $2,32*4($1) */ + MIPS32_LW(3,3*4,1), /* lw $3,3*4($1) */ + MIPS32_LW(4,4*4,1), /* lw $4,4*4($1) */ + MIPS32_LW(5,5*4,1), /* lw $5,5*4($1) */ + MIPS32_LW(6,6*4,1), /* lw $6,6*4($1) */ + MIPS32_LW(7,7*4,1), /* lw $7,7*4($1) */ + MIPS32_LW(8,8*4,1), /* lw $8,8*4($1) */ + MIPS32_LW(9,9*4,1), /* lw $9,9*4($1) */ + MIPS32_LW(10,10*4,1), /* lw $10,10*4($1) */ + MIPS32_LW(11,11*4,1), /* lw $11,11*4($1) */ + MIPS32_LW(12,12*4,1), /* lw $12,12*4($1) */ + MIPS32_LW(13,13*4,1), /* lw $13,13*4($1) */ + MIPS32_LW(14,14*4,1), /* lw $14,14*4($1) */ + MIPS32_LW(16,16*4,1), /* lw $16,16*4($1) */ + MIPS32_LW(17,17*4,1), /* lw $17,17*4($1) */ + MIPS32_LW(18,18*4,1), /* lw $18,18*4($1) */ + MIPS32_LW(19,19*4,1), /* lw $19,19*4($1) */ + MIPS32_LW(20,20*4,1), /* lw $20,20*4($1) */ + MIPS32_LW(21,21*4,1), /* lw $21,21*4($1) */ + MIPS32_LW(22,22*4,1), /* lw $22,22*4($1) */ + MIPS32_LW(23,23*4,1), /* lw $23,23*4($1) */ + MIPS32_LW(24,24*4,1), /* lw $24,24*4($1) */ + MIPS32_LW(25,25*4,1), /* lw $25,25*4($1) */ + MIPS32_LW(26,26*4,1), /* lw $26,26*4($1) */ + MIPS32_LW(27,27*4,1), /* lw $27,27*4($1) */ + MIPS32_LW(28,28*4,1), /* lw $28,28*4($1) */ + MIPS32_LW(29,29*4,1), /* lw $29,29*4($1) */ + MIPS32_LW(30,30*4,1), /* lw $30,30*4($1) */ + MIPS32_LW(31,31*4,1), /* lw $31,31*4($1) */ + + MIPS32_LW(2,32*4,1), /* lw $2,32*4($1) */ MIPS32_MTC0(2,12,0), /* move $2 to status */ - MIPS32_LW(2,33*4,1), /* lw $2,33*4($1) */ + MIPS32_LW(2,33*4,1), /* lw $2,33*4($1) */ MIPS32_MTLO(2), /* move $2 to lo */ - MIPS32_LW(2,34*4,1), /* lw $2,34*4($1) */ + MIPS32_LW(2,34*4,1), /* lw $2,34*4($1) */ MIPS32_MTHI(2), /* move $2 to hi */ - MIPS32_LW(2,35*4,1), /* lw $2,35*4($1) */ + MIPS32_LW(2,35*4,1), /* lw $2,35*4($1) */ MIPS32_MTC0(2,8,0), /* move $2 to badvaddr */ - MIPS32_LW(2,36*4,1), /* lw $2,36*4($1) */ + MIPS32_LW(2,36*4,1), /* lw $2,36*4($1) */ MIPS32_MTC0(2,13,0), /* move $2 to cause*/ - MIPS32_LW(2,37*4,1), /* lw $2,37*4($1) */ + MIPS32_LW(2,37*4,1), /* lw $2,37*4($1) */ MIPS32_MTC0(2,24,0), /* move $2 to pc */ - MIPS32_LW(2,2*4,1), /* lw $2,2*4($1) */ - MIPS32_LW(1,0,15), /* lw $1,($15) */ + MIPS32_LW(2,2*4,1), /* lw $2,2*4($1) */ + MIPS32_LW(1,0,15), /* lw $1,($15) */ MIPS32_B(NEG16(53)), /* b start */ MIPS32_MFC0(15,31,0), /* move COP0 DeSave to $15 */ }; @@ -831,64 +831,64 @@ int mips32_pracc_read_regs(struct mips_ejtag *ejtag_info, uint32_t *regs) static const uint32_t code[] = { /* start: */ MIPS32_MTC0(2,31,0), /* move $2 to COP0 DeSave */ - MIPS32_LUI(2,UPPER16(MIPS32_PRACC_PARAM_OUT)), /* $2 = MIPS32_PRACC_PARAM_OUT */ + MIPS32_LUI(2,UPPER16(MIPS32_PRACC_PARAM_OUT)), /* $2 = MIPS32_PRACC_PARAM_OUT */ MIPS32_ORI(2,2,LOWER16(MIPS32_PRACC_PARAM_OUT)), MIPS32_SW(0,0*4,2), /* sw $0,0*4($2) */ - MIPS32_SW(1,1*4,2), /* sw $1,1*4($2) */ - MIPS32_SW(15,15*4,2), /* sw $15,15*4($2) */ + MIPS32_SW(1,1*4,2), /* sw $1,1*4($2) */ + MIPS32_SW(15,15*4,2), /* sw $15,15*4($2) */ MIPS32_MFC0(2,31,0), /* move COP0 DeSave to $2 */ MIPS32_MTC0(15,31,0), /* move $15 to COP0 DeSave */ - MIPS32_LUI(15,UPPER16(MIPS32_PRACC_STACK)), /* $15 = MIPS32_PRACC_STACK */ + MIPS32_LUI(15,UPPER16(MIPS32_PRACC_STACK)), /* $15 = MIPS32_PRACC_STACK */ MIPS32_ORI(15,15,LOWER16(MIPS32_PRACC_STACK)), - MIPS32_SW(1,0,15), /* sw $1,($15) */ - MIPS32_SW(2,0,15), /* sw $2,($15) */ - MIPS32_LUI(1,UPPER16(MIPS32_PRACC_PARAM_OUT)), /* $1 = MIPS32_PRACC_PARAM_OUT */ + MIPS32_SW(1,0,15), /* sw $1,($15) */ + MIPS32_SW(2,0,15), /* sw $2,($15) */ + MIPS32_LUI(1,UPPER16(MIPS32_PRACC_PARAM_OUT)), /* $1 = MIPS32_PRACC_PARAM_OUT */ MIPS32_ORI(1,1,LOWER16(MIPS32_PRACC_PARAM_OUT)), - MIPS32_SW(2,2*4,1), /* sw $2,2*4($1) */ - MIPS32_SW(3,3*4,1), /* sw $3,3*4($1) */ - MIPS32_SW(4,4*4,1), /* sw $4,4*4($1) */ - MIPS32_SW(5,5*4,1), /* sw $5,5*4($1) */ - MIPS32_SW(6,6*4,1), /* sw $6,6*4($1) */ - MIPS32_SW(7,7*4,1), /* sw $7,7*4($1) */ - MIPS32_SW(8,8*4,1), /* sw $8,8*4($1) */ - MIPS32_SW(9,9*4,1), /* sw $9,9*4($1) */ - MIPS32_SW(10,10*4,1), /* sw $10,10*4($1) */ - MIPS32_SW(11,11*4,1), /* sw $11,11*4($1) */ - MIPS32_SW(12,12*4,1), /* sw $12,12*4($1) */ - MIPS32_SW(13,13*4,1), /* sw $13,13*4($1) */ - MIPS32_SW(14,14*4,1), /* sw $14,14*4($1) */ - MIPS32_SW(16,16*4,1), /* sw $16,16*4($1) */ - MIPS32_SW(17,17*4,1), /* sw $17,17*4($1) */ - MIPS32_SW(18,18*4,1), /* sw $18,18*4($1) */ - MIPS32_SW(19,19*4,1), /* sw $19,19*4($1) */ - MIPS32_SW(20,20*4,1), /* sw $20,20*4($1) */ - MIPS32_SW(21,21*4,1), /* sw $21,21*4($1) */ - MIPS32_SW(22,22*4,1), /* sw $22,22*4($1) */ - MIPS32_SW(23,23*4,1), /* sw $23,23*4($1) */ - MIPS32_SW(24,24*4,1), /* sw $24,24*4($1) */ - MIPS32_SW(25,25*4,1), /* sw $25,25*4($1) */ - MIPS32_SW(26,26*4,1), /* sw $26,26*4($1) */ - MIPS32_SW(27,27*4,1), /* sw $27,27*4($1) */ - MIPS32_SW(28,28*4,1), /* sw $28,28*4($1) */ - MIPS32_SW(29,29*4,1), /* sw $29,29*4($1) */ - MIPS32_SW(30,30*4,1), /* sw $30,30*4($1) */ - MIPS32_SW(31,31*4,1), /* sw $31,31*4($1) */ + MIPS32_SW(2,2*4,1), /* sw $2,2*4($1) */ + MIPS32_SW(3,3*4,1), /* sw $3,3*4($1) */ + MIPS32_SW(4,4*4,1), /* sw $4,4*4($1) */ + MIPS32_SW(5,5*4,1), /* sw $5,5*4($1) */ + MIPS32_SW(6,6*4,1), /* sw $6,6*4($1) */ + MIPS32_SW(7,7*4,1), /* sw $7,7*4($1) */ + MIPS32_SW(8,8*4,1), /* sw $8,8*4($1) */ + MIPS32_SW(9,9*4,1), /* sw $9,9*4($1) */ + MIPS32_SW(10,10*4,1), /* sw $10,10*4($1) */ + MIPS32_SW(11,11*4,1), /* sw $11,11*4($1) */ + MIPS32_SW(12,12*4,1), /* sw $12,12*4($1) */ + MIPS32_SW(13,13*4,1), /* sw $13,13*4($1) */ + MIPS32_SW(14,14*4,1), /* sw $14,14*4($1) */ + MIPS32_SW(16,16*4,1), /* sw $16,16*4($1) */ + MIPS32_SW(17,17*4,1), /* sw $17,17*4($1) */ + MIPS32_SW(18,18*4,1), /* sw $18,18*4($1) */ + MIPS32_SW(19,19*4,1), /* sw $19,19*4($1) */ + MIPS32_SW(20,20*4,1), /* sw $20,20*4($1) */ + MIPS32_SW(21,21*4,1), /* sw $21,21*4($1) */ + MIPS32_SW(22,22*4,1), /* sw $22,22*4($1) */ + MIPS32_SW(23,23*4,1), /* sw $23,23*4($1) */ + MIPS32_SW(24,24*4,1), /* sw $24,24*4($1) */ + MIPS32_SW(25,25*4,1), /* sw $25,25*4($1) */ + MIPS32_SW(26,26*4,1), /* sw $26,26*4($1) */ + MIPS32_SW(27,27*4,1), /* sw $27,27*4($1) */ + MIPS32_SW(28,28*4,1), /* sw $28,28*4($1) */ + MIPS32_SW(29,29*4,1), /* sw $29,29*4($1) */ + MIPS32_SW(30,30*4,1), /* sw $30,30*4($1) */ + MIPS32_SW(31,31*4,1), /* sw $31,31*4($1) */ MIPS32_MFC0(2,12,0), /* move status to $2 */ - MIPS32_SW(2,32*4,1), /* sw $2,32*4($1) */ + MIPS32_SW(2,32*4,1), /* sw $2,32*4($1) */ MIPS32_MFLO(2), /* move lo to $2 */ - MIPS32_SW(2,33*4,1), /* sw $2,33*4($1) */ + MIPS32_SW(2,33*4,1), /* sw $2,33*4($1) */ MIPS32_MFHI(2), /* move hi to $2 */ - MIPS32_SW(2,34*4,1), /* sw $2,34*4($1) */ + MIPS32_SW(2,34*4,1), /* sw $2,34*4($1) */ MIPS32_MFC0(2,8,0), /* move badvaddr to $2 */ - MIPS32_SW(2,35*4,1), /* sw $2,35*4($1) */ + MIPS32_SW(2,35*4,1), /* sw $2,35*4($1) */ MIPS32_MFC0(2,13,0), /* move cause to $2 */ - MIPS32_SW(2,36*4,1), /* sw $2,36*4($1) */ + MIPS32_SW(2,36*4,1), /* sw $2,36*4($1) */ MIPS32_MFC0(2,24,0), /* move pc to $2 */ - MIPS32_SW(2,37*4,1), /* sw $2,37*4($1) */ + MIPS32_SW(2,37*4,1), /* sw $2,37*4($1) */ - MIPS32_LW(2,0,15), /* lw $2,($15) */ - MIPS32_LW(1,0,15), /* lw $1,($15) */ + MIPS32_LW(2,0,15), /* lw $2,($15) */ + MIPS32_LW(1,0,15), /* lw $1,($15) */ MIPS32_B(NEG16(58)), /* b start */ MIPS32_MFC0(15,31,0), /* move COP0 DeSave to $15 */ }; diff --git a/src/target/mips32_pracc.h b/src/target/mips32_pracc.h index a914686..f8b00d0 100644 --- a/src/target/mips32_pracc.h +++ b/src/target/mips32_pracc.h @@ -27,17 +27,17 @@ #define MIPS32_PRACC_FASTDATA_AREA 0xFF200000 #define MIPS32_PRACC_FASTDATA_SIZE 16 -#define MIPS32_PRACC_TEXT 0xFF200200 -#define MIPS32_PRACC_STACK 0xFF204000 -#define MIPS32_PRACC_PARAM_IN 0xFF201000 -#define MIPS32_PRACC_PARAM_IN_SIZE 0x1000 -#define MIPS32_PRACC_PARAM_OUT (MIPS32_PRACC_PARAM_IN + MIPS32_PRACC_PARAM_IN_SIZE) -#define MIPS32_PRACC_PARAM_OUT_SIZE 0x1000 +#define MIPS32_PRACC_TEXT 0xFF200200 +#define MIPS32_PRACC_STACK 0xFF204000 +#define MIPS32_PRACC_PARAM_IN 0xFF201000 +#define MIPS32_PRACC_PARAM_IN_SIZE 0x1000 +#define MIPS32_PRACC_PARAM_OUT (MIPS32_PRACC_PARAM_IN + MIPS32_PRACC_PARAM_IN_SIZE) +#define MIPS32_PRACC_PARAM_OUT_SIZE 0x1000 #define MIPS32_FASTDATA_HANDLER_SIZE 0x80 -#define UPPER16(uint32_t) (uint32_t >> 16) -#define LOWER16(uint32_t) (uint32_t & 0xFFFF) -#define NEG16(v) (((~(v)) + 1) & 0xFFFF) +#define UPPER16(uint32_t) (uint32_t >> 16) +#define LOWER16(uint32_t) (uint32_t & 0xFFFF) +#define NEG16(v) (((~(v)) + 1) & 0xFFFF) /*#define NEG18(v) (((~(v)) + 1) & 0x3FFFF)*/ int mips32_pracc_read_mem(struct mips_ejtag *ejtag_info, diff --git a/src/target/mips_ejtag.c b/src/target/mips_ejtag.c index bebad9a..58bd392 100644 --- a/src/target/mips_ejtag.c +++ b/src/target/mips_ejtag.c @@ -28,7 +28,6 @@ #include "mips32.h" #include "mips_ejtag.h" - int mips_ejtag_set_instr(struct mips_ejtag *ejtag_info, int new_instr, void *delete_me_and_submit_patch) { struct jtag_tap *tap; @@ -152,12 +151,12 @@ int mips_ejtag_step_disable(struct mips_ejtag *ejtag_info) { uint32_t code[] = { MIPS32_MTC0(15,31,0), /* move $15 to COP0 DeSave */ - MIPS32_LUI(15,UPPER16(MIPS32_PRACC_STACK)), /* $15 = MIPS32_PRACC_STACK */ + MIPS32_LUI(15,UPPER16(MIPS32_PRACC_STACK)), /* $15 = MIPS32_PRACC_STACK */ MIPS32_ORI(15,15,LOWER16(MIPS32_PRACC_STACK)), - MIPS32_SW(1,0,15), /* sw $1,($15) */ - MIPS32_SW(2,0,15), /* sw $2,($15) */ + MIPS32_SW(1,0,15), /* sw $1,($15) */ + MIPS32_SW(2,0,15), /* sw $2,($15) */ MIPS32_MFC0(1,23,0), /* move COP0 Debug to $1 */ - MIPS32_LUI(2,0xFFFF), /* $2 = 0xfffffeff */ + MIPS32_LUI(2,0xFFFF), /* $2 = 0xfffffeff */ MIPS32_ORI(2,2,0xFEFF), MIPS32_AND(1,1,2), MIPS32_MTC0(1,23,0), /* move $1 to COP0 Debug */ @@ -216,11 +215,11 @@ int mips_ejtag_read_debug(struct mips_ejtag *ejtag_info, uint32_t* debug_reg) /* read ejtag ECR */ uint32_t code[] = { MIPS32_MTC0(15,31,0), /* move $15 to COP0 DeSave */ - MIPS32_LUI(15,UPPER16(MIPS32_PRACC_STACK)), /* $15 = MIPS32_PRACC_STACK */ + MIPS32_LUI(15,UPPER16(MIPS32_PRACC_STACK)), /* $15 = MIPS32_PRACC_STACK */ MIPS32_ORI(15,15,LOWER16(MIPS32_PRACC_STACK)), - MIPS32_SW(1,0,15), /* sw $1,($15) */ - MIPS32_SW(2,0,15), /* sw $2,($15) */ - MIPS32_LUI(1,UPPER16(MIPS32_PRACC_PARAM_OUT)), /* $1 = MIPS32_PRACC_PARAM_OUT */ + MIPS32_SW(1,0,15), /* sw $1,($15) */ + MIPS32_SW(2,0,15), /* sw $2,($15) */ + MIPS32_LUI(1,UPPER16(MIPS32_PRACC_PARAM_OUT)), /* $1 = MIPS32_PRACC_PARAM_OUT */ MIPS32_ORI(1,1,LOWER16(MIPS32_PRACC_PARAM_OUT)), MIPS32_MFC0(2,23,0), /* move COP0 Debug to $2 */ MIPS32_SW(2,0,1), diff --git a/src/target/mips_ejtag.h b/src/target/mips_ejtag.h index eb42d67..e9da39e 100644 --- a/src/target/mips_ejtag.h +++ b/src/target/mips_ejtag.h @@ -96,11 +96,11 @@ #define EJTAG_IBA1 0xFF301100 #define EJTAG_DBS 0xFF302000 #define EJTAG_DBA1 0xFF302100 -#define EJTAG_DBCn_NOSB (1 << 13) -#define EJTAG_DBCn_NOLB (1 << 12) -#define EJTAG_DBCn_BLM_MASK 0xff -#define EJTAG_DBCn_BLM_SHIFT 4 -#define EJTAG_DBCn_BE (1 << 0) +#define EJTAG_DBCn_NOSB (1 << 13) +#define EJTAG_DBCn_NOLB (1 << 12) +#define EJTAG_DBCn_BLM_MASK 0xff +#define EJTAG_DBCn_BLM_SHIFT 4 +#define EJTAG_DBCn_BE (1 << 0) struct mips_ejtag { commit 2d450b90333b01fbd85570e5d881c3a795038744 Author: Spencer Oliver <nt...@us...> Date: Wed Jan 6 20:24:31 2010 +0000 MIPS: fastdata bulk write fallback If fastdata access fails, then fallback to default mips_m4k_write_memory Remove unnecessary fastdata loader verify check Signed-off-by: Spencer Oliver <nt...@us...> diff --git a/src/target/mips32_pracc.c b/src/target/mips32_pracc.c index 26d5a6b..ac1d1b3 100644 --- a/src/target/mips32_pracc.c +++ b/src/target/mips32_pracc.c @@ -968,15 +968,7 @@ int mips32_pracc_fastdata_xfer(struct mips_ejtag *ejtag_info, struct working_are /* write program into RAM */ mips32_pracc_write_mem32(ejtag_info, source->address, ARRAY_SIZE(handler_code), handler_code); - /* quick verify RAM is working */ - mips32_pracc_read_u32(ejtag_info, source->address, &val); - if (val != handler_code[0]) - { - LOG_ERROR("fastdata handler verify failed\n"); - return ERROR_TARGET_RESOURCE_NOT_AVAILABLE; - } - - LOG_INFO("%s using 0x%.8x for write handler\n", __func__, source->address); + LOG_DEBUG("%s using 0x%.8x for write handler\n", __func__, source->address); jmp_code[1] |= UPPER16(source->address); jmp_code[2] |= LOWER16(source->address); diff --git a/src/target/mips_m4k.c b/src/target/mips_m4k.c index 4adc1f1..312fc09 100644 --- a/src/target/mips_m4k.c +++ b/src/target/mips_m4k.c @@ -1001,6 +1001,12 @@ int mips_m4k_bulk_write_memory(struct target *target, uint32_t address, uint32_t } retval = mips32_pracc_fastdata_xfer(ejtag_info, source, write, address, count, (uint32_t*) buffer); + if (retval != ERROR_OK) + { + /* FASTDATA access failed, try normal memory write */ + LOG_WARNING("Fastdata access Failed, falling back to non-bulk write"); + retval = mips_m4k_write_memory(target, address, 4, count, buffer); + } if (source) target_free_working_area(target, source); ----------------------------------------------------------------------- Summary of changes: src/target/mips32.h | 2 +- src/target/mips32_pracc.c | 400 ++++++++++++++++++++++----------------------- src/target/mips32_pracc.h | 18 +- src/target/mips_ejtag.c | 17 +- src/target/mips_ejtag.h | 10 +- src/target/mips_m4k.c | 6 + 6 files changed, 225 insertions(+), 228 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: David B. <dbr...@us...> - 2010-01-05 23:16:25
|
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 2bc7446bb8caf751f7d6900af26384f6c64cc791 (commit) from 844b5eb49d7fd4afa4f0309ce47f29d99886a2f7 (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 2bc7446bb8caf751f7d6900af26384f6c64cc791 Author: David Brownell <dbr...@us...> Date: Tue Jan 5 14:11:03 2010 -0800 buildfix with -DNDEBUG Don't save that state unless its only user, an assertion, is compiled. Saving it broke a cygwin build. Signed-off-by: David Brownell <dbr...@us...> diff --git a/src/jtag/drivers/driver.c b/src/jtag/drivers/driver.c index c57386a..45c5d10 100644 --- a/src/jtag/drivers/driver.c +++ b/src/jtag/drivers/driver.c @@ -215,7 +215,10 @@ int interface_jtag_add_dr_scan(int in_num_fields, const struct scan_field *in_fi if (!tap->bypass) { - struct scan_field * start_field = field; /* keep initial position for assert() */ +#ifndef NDEBUG + /* remember initial position for assert() */ + struct scan_field *start_field = field; +#endif /* NDEBUG */ for (int j = 0; j < in_num_fields; j++) { ----------------------------------------------------------------------- Summary of changes: src/jtag/drivers/driver.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: David B. <dbr...@us...> - 2010-01-05 22:33:20
|
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 844b5eb49d7fd4afa4f0309ce47f29d99886a2f7 (commit) from fccb812f829e55940e26466c4cda8c25765d4f6c (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 844b5eb49d7fd4afa4f0309ce47f29d99886a2f7 Author: David Brownell <dbr...@us...> Date: Tue Jan 5 13:32:39 2010 -0800 don't require 'openocd.cfg' to start Starting the daemon with with just a bare "openocd" I saw: Can't find openocd.cfg That's not an error; don't treat it as if it were. There may be an error later -- like, "no interface set up" -- but let messages only report real errors, not fake ones. diff --git a/src/helper/configuration.c b/src/helper/configuration.c index 007246c..eedd8a1 100644 --- a/src/helper/configuration.c +++ b/src/helper/configuration.c @@ -115,8 +115,10 @@ int parse_config_file(struct command_context *cmd_ctx) int retval; char **cfg; - if (!config_file_names) - add_config_command ("script openocd.cfg"); + if (!config_file_names) { + command_run_line(cmd_ctx, "script openocd.cfg"); + return ERROR_OK; + } cfg = config_file_names; ----------------------------------------------------------------------- Summary of changes: src/helper/configuration.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: David B. <dbr...@us...> - 2010-01-05 22:10:42
|
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 fccb812f829e55940e26466c4cda8c25765d4f6c (commit) via adf2a9a267422a2914a50b4a4a35a0e19b25d1c3 (commit) from 9d83df72dcbfc791b470b12949890df3f2d1508d (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 fccb812f829e55940e26466c4cda8c25765d4f6c Author: David Brownell <dbr...@us...> Date: Tue Jan 5 13:03:27 2010 -0800 ARM: add #defines for JTAG ack codes JTAG has only two possible JTAG ack codes for APACC and DPACC register reads/writes. Define them, and remove empty "else" clause in the code which now uses those codes. Signed-off-by: David Brownell <dbr...@us...> diff --git a/src/target/arm_adi_v5.c b/src/target/arm_adi_v5.c index 9f26064..96accf3 100644 --- a/src/target/arm_adi_v5.c +++ b/src/target/arm_adi_v5.c @@ -249,12 +249,14 @@ int swjdp_transaction_endcheck(struct swjdp_common *swjdp) swjdp->ack = swjdp->ack & 0x7; - if (swjdp->ack != 2) + /* common code path avoids calling timeval_ms() */ + if (swjdp->ack != JTAG_ACK_OK_FAULT) { long long then = timeval_ms(); - while (swjdp->ack != 2) + + while (swjdp->ack != JTAG_ACK_OK_FAULT) { - if (swjdp->ack == 1) + if (swjdp->ack == JTAG_ACK_WAIT) { if ((timeval_ms()-then) > 1000) { @@ -280,9 +282,6 @@ int swjdp_transaction_endcheck(struct swjdp_common *swjdp) return retval; swjdp->ack = swjdp->ack & 0x7; } - } else - { - /* common code path avoids fn to timeval_ms() */ } /* Check for STICKYERR and STICKYORUN */ diff --git a/src/target/arm_adi_v5.h b/src/target/arm_adi_v5.h index 4e1b1aa..675a173 100644 --- a/src/target/arm_adi_v5.h +++ b/src/target/arm_adi_v5.h @@ -38,6 +38,10 @@ #define JTAG_DP_APACC 0xB #define JTAG_DP_IDCODE 0xE +/* three-bit ACK values for DPACC and APACC reads */ +#define JTAG_ACK_OK_FAULT 0x2 +#define JTAG_ACK_WAIT 0x1 + #define DPAP_WRITE 0 #define DPAP_READ 1 commit adf2a9a267422a2914a50b4a4a35a0e19b25d1c3 Author: David Brownell <dbr...@us...> Date: Tue Jan 5 12:55:46 2010 -0800 ARM: add comments re DAP assumptions I think some of these assumptions are not well-founded. Related, that swjdp_transaction_endcheck() is a bit iffy. Signed-off-by: David Brownell <dbr...@us...> diff --git a/src/target/arm_adi_v5.c b/src/target/arm_adi_v5.c index 82a2a28..9f26064 100644 --- a/src/target/arm_adi_v5.c +++ b/src/target/arm_adi_v5.c @@ -195,8 +195,12 @@ static int scan_inout_check_u32(struct swjdp_common *swjdp, uint8_t instr, uint8_t reg_addr, uint8_t RnW, uint32_t outvalue, uint32_t *invalue) { + /* Issue the read or write */ adi_jtag_dp_scan_u32(swjdp, instr, reg_addr, RnW, outvalue, NULL, NULL); + /* For reads, collect posted value; RDBUFF has no other effect. + * Assumes read gets acked with OK/FAULT, and CTRL_STAT says "OK". + */ if ((RnW == DPAP_READ) && (invalue != NULL)) adi_jtag_dp_scan_u32(swjdp, JTAG_DP_DPACC, DP_RDBUFF, DPAP_READ, 0, invalue, &swjdp->ack); @@ -235,6 +239,9 @@ int swjdp_transaction_endcheck(struct swjdp_common *swjdp) /* Why??? second time it works??? */ #endif + /* Post CTRL/STAT read; discard any previous posted read value + * but collect its ACK status. + */ scan_inout_check_u32(swjdp, JTAG_DP_DPACC, DP_CTRL_STAT, DPAP_READ, 0, &ctrlstat); if ((retval = jtag_execute_queue()) != ERROR_OK) @@ -787,13 +794,18 @@ int mem_ap_read_buf_u32(struct swjdp_common *swjdp, uint8_t *buffer, int count, DPAP_READ, 0, NULL, NULL); for (readcount = 0; readcount < blocksize - 1; readcount++) { - /* Scan out read instruction and scan in previous value */ + /* Scan out next read; scan in posted value for the + * previous one. Assumes read is acked "OK/FAULT", + * and CTRL_STAT says that meant "OK". + */ adi_jtag_dp_scan(swjdp, JTAG_DP_APACC, AP_REG_DRW, DPAP_READ, 0, buffer + 4 * readcount, &swjdp->ack); } - /* Scan in last value */ + /* Scan in last posted value; RDBUFF has no other effect, + * assuming ack is OK/FAULT and CTRL_STAT says "OK". + */ adi_jtag_dp_scan(swjdp, JTAG_DP_DPACC, DP_RDBUFF, DPAP_READ, 0, buffer + 4 * readcount, &swjdp->ack); ----------------------------------------------------------------------- Summary of changes: src/target/arm_adi_v5.c | 27 +++++++++++++++++++-------- src/target/arm_adi_v5.h | 4 ++++ 2 files changed, 23 insertions(+), 8 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: Spencer O. <nt...@us...> - 2010-01-05 20:55:39
|
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 9d83df72dcbfc791b470b12949890df3f2d1508d (commit) via ba96fc3e9de935708cd5fa7c38e547dc7598087d (commit) via f6412d9c7b22ab25caec6be19317f0fc4a840fdd (commit) via faad9e59233306e608a3a01388a38099ece9688b (commit) via 03e8649bc699053ccdbbd4a3c2eaf05241e22a5b (commit) from 95f86e8e0525fc93093cc2bc060df5017d2f504e (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 9d83df72dcbfc791b470b12949890df3f2d1508d Author: Spencer Oliver <nt...@us...> Date: Tue Jan 5 17:43:29 2010 +0000 MIPS: pracc access tweaks reorder the pracc access so we can save a few access cycles Signed-off-by: Spencer Oliver <nt...@us...> diff --git a/src/target/mips32_pracc.c b/src/target/mips32_pracc.c index 4bd1da7..26d5a6b 100644 --- a/src/target/mips32_pracc.c +++ b/src/target/mips32_pracc.c @@ -319,9 +319,8 @@ int mips32_pracc_read_mem32(struct mips_ejtag *ejtag_info, uint32_t addr, int co MIPS32_LW(10,0,15), /* lw $10,($15) */ MIPS32_LW(9,0,15), /* lw $9,($15) */ MIPS32_LW(8,0,15), /* lw $8,($15) */ + MIPS32_B(NEG16(27)), /* b start */ MIPS32_MFC0(15,31,0), /* move COP0 DeSave to $15 */ - MIPS32_B(NEG16(28)), /* b start */ - MIPS32_NOP, }; int retval = ERROR_OK; @@ -422,9 +421,8 @@ int mips32_pracc_read_mem16(struct mips_ejtag *ejtag_info, uint32_t addr, int co MIPS32_LW(10,0,15), /* lw $10,($15) */ MIPS32_LW(9,0,15), /* lw $9,($15) */ MIPS32_LW(8,0,15), /* lw $8,($15) */ - MIPS32_MFC0(15,31,0), /* move COP0 DeSave to $15 */ - MIPS32_B(NEG16(28)), /* b start */ - MIPS32_NOP, + MIPS32_B(NEG16(27)), /* b start */ + MIPS32_MFC0(15,30,0), /* move COP0 DeSave to $15 */ }; /* TODO remove array */ @@ -500,9 +498,8 @@ int mips32_pracc_read_mem8(struct mips_ejtag *ejtag_info, uint32_t addr, int cou MIPS32_LW(10,0,15), /* lw $10,($15) */ MIPS32_LW(9,0,15), /* lw $9,($15) */ MIPS32_LW(8,0,15), /* lw $8,($15) */ + MIPS32_B(NEG16(27)), /* b start */ MIPS32_MFC0(15,31,0), /* move COP0 DeSave to $15 */ - MIPS32_B(NEG16(28)), /* b start */ - MIPS32_NOP, }; /* TODO remove array */ @@ -677,9 +674,8 @@ int mips32_pracc_write_mem16(struct mips_ejtag *ejtag_info, uint32_t addr, int c MIPS32_LW(10,0,15), /* lw $10,($15) */ MIPS32_LW(9,0,15), /* lw $9,($15) */ MIPS32_LW(8,0,15), /* lw $8,($15) */ + MIPS32_B(NEG16(26)), /* b start */ MIPS32_MFC0(15,31,0), /* move COP0 DeSave to $15 */ - MIPS32_B(NEG16(27)), /* b start */ - MIPS32_NOP, }; /* TODO remove array */ @@ -736,9 +732,8 @@ int mips32_pracc_write_mem8(struct mips_ejtag *ejtag_info, uint32_t addr, int co MIPS32_LW(10,0,15), /* lw $10,($15) */ MIPS32_LW(9,0,15), /* lw $9,($15) */ MIPS32_LW(8,0,15), /* lw $8,($15) */ + MIPS32_B(NEG16(26)), /* b start */ MIPS32_MFC0(15,31,0), /* move COP0 DeSave to $15 */ - MIPS32_B(NEG16(27)), /* b start */ - MIPS32_NOP, }; /* TODO remove array */ @@ -819,9 +814,8 @@ int mips32_pracc_write_regs(struct mips_ejtag *ejtag_info, uint32_t *regs) MIPS32_LW(2,2*4,1), /* lw $2,2*4($1) */ MIPS32_LW(1,0,15), /* lw $1,($15) */ + MIPS32_B(NEG16(53)), /* b start */ MIPS32_MFC0(15,31,0), /* move COP0 DeSave to $15 */ - MIPS32_B(NEG16(54)), /* b start */ - MIPS32_NOP, }; int retval; @@ -895,9 +889,8 @@ int mips32_pracc_read_regs(struct mips_ejtag *ejtag_info, uint32_t *regs) MIPS32_LW(2,0,15), /* lw $2,($15) */ MIPS32_LW(1,0,15), /* lw $1,($15) */ + MIPS32_B(NEG16(58)), /* b start */ MIPS32_MFC0(15,31,0), /* move COP0 DeSave to $15 */ - MIPS32_B(NEG16(59)), /* b start */ - MIPS32_NOP, }; int retval; commit ba96fc3e9de935708cd5fa7c38e547dc7598087d Author: Spencer Oliver <nt...@us...> Date: Mon Dec 21 17:23:09 2009 +0000 PIC32: enable ram execution add reset-init script to allow ram execution from reset, this is required for ejtag fastdata access. Signed-off-by: Spencer Oliver <nt...@us...> diff --git a/tcl/target/pic32mx.cfg b/tcl/target/pic32mx.cfg index e0ebdc2..1561d73 100644 --- a/tcl/target/pic32mx.cfg +++ b/tcl/target/pic32mx.cfg @@ -31,7 +31,23 @@ jtag newtap $_CHIPNAME cpu -irlen 5 -ircapture 0x1 -irmask 0x1f -expected-id $_ set _TARGETNAME $_CHIPNAME.cpu target create $_TARGETNAME mips_m4k -endian $_ENDIAN -chain-position $_TARGETNAME -$_TARGETNAME configure -work-area-phys 0xa0000000 -work-area-size 16384 -work-area-backup 0 +$_TARGETNAME configure -work-area-phys 0xa0000800 -work-area-size 16384 -work-area-backup 0 + +$_TARGETNAME configure -event reset-init { + # + # from reset the pic32 cannot execute code in ram - enable ram execution + # minimum offset from start of ram is 2k + # + + # BMXCON + mww 0xbf882000 0x001f0040 + # BMXDKPBA: 0xa0000800 + mww 0xbf882010 0x00000800 + # BMXDUDBA + mww 0xbf882020 0x00004000 + # BMXDUPBA + mww 0xbf882030 0x00004000 +} set _FLASHNAME $_CHIPNAME.flash flash bank $_FLASHNAME pic32mx 0xbd000000 0 0 0 $_TARGETNAME commit f6412d9c7b22ab25caec6be19317f0fc4a840fdd Author: Spencer Oliver <nt...@us...> Date: Mon Dec 21 16:33:03 2009 +0000 MIPS: optimize pracc access remove unnecessary nops when accessing ejtag pracc general fastdata patch cleanup Signed-off-by: Spencer Oliver <nt...@us...> diff --git a/src/target/mips32_pracc.c b/src/target/mips32_pracc.c index 34794f3..4bd1da7 100644 --- a/src/target/mips32_pracc.c +++ b/src/target/mips32_pracc.c @@ -33,7 +33,6 @@ instruction after a branch instruction (one delay slot). For example: - LW $2, ($5 +10) B foo LW $1, ($2 +100) @@ -129,7 +128,7 @@ static int mips32_pracc_exec_read(struct mips32_pracc_context *ctx, uint32_t add data = ctx->local_oparam[offset]; } else if ((address >= MIPS32_PRACC_TEXT) - && (address <= MIPS32_PRACC_TEXT + ctx->code_len*4)) + && (address <= MIPS32_PRACC_TEXT + ctx->code_len * 4)) { offset = (address - MIPS32_PRACC_TEXT) / 4; data = ctx->code[offset]; @@ -145,7 +144,7 @@ static int mips32_pracc_exec_read(struct mips32_pracc_context *ctx, uint32_t add * to start of debug vector */ data = 0; - LOG_ERROR("Error reading unexpected address %8.8" PRIx32 "", address); + LOG_ERROR("Error reading unexpected address 0x%8.8" PRIx32 "", address); return ERROR_JTAG_DEVICE_ERROR; } @@ -154,7 +153,6 @@ static int mips32_pracc_exec_read(struct mips32_pracc_context *ctx, uint32_t add mips_ejtag_drscan_32(ctx->ejtag_info, &data); /* Clear the access pending bit (let the processor eat!) */ - ejtag_ctrl = ejtag_info->ejtag_ctrl & ~EJTAG_CTRL_PRACC; mips_ejtag_set_instr(ctx->ejtag_info, EJTAG_INST_CONTROL, NULL); mips_ejtag_drscan_32(ctx->ejtag_info, &ejtag_ctrl); @@ -201,7 +199,7 @@ static int mips32_pracc_exec_write(struct mips32_pracc_context *ctx, uint32_t ad } else { - LOG_ERROR("Error writing unexpected address %8.8" PRIx32 "", address); + LOG_ERROR("Error writing unexpected address 0x%8.8" PRIx32 "", address); return ERROR_JTAG_DEVICE_ERROR; } @@ -234,8 +232,6 @@ int mips32_pracc_exec(struct mips_ejtag *ejtag_info, int code_len, const uint32_ mips_ejtag_set_instr(ejtag_info, EJTAG_INST_ADDRESS, NULL); mips_ejtag_drscan_32(ejtag_info, &address); -// printf("Adres: %.8x\n", address); - /* Check for read or write */ if (ejtag_ctrl & EJTAG_CTRL_PRNW) { @@ -305,9 +301,8 @@ int mips32_pracc_read_mem32(struct mips_ejtag *ejtag_info, uint32_t addr, int co MIPS32_LW(10,4,8), /* $10 = mem[$8 + 4]; read count */ MIPS32_LUI(11,UPPER16(MIPS32_PRACC_PARAM_OUT)), /* $11 = MIPS32_PRACC_PARAM_OUT */ MIPS32_ORI(11,11,LOWER16(MIPS32_PRACC_PARAM_OUT)), - MIPS32_NOP, /* loop: */ - MIPS32_BEQ(0,10,9), /* beq 0, $10, end */ + MIPS32_BEQ(0,10,8), /* beq 0, $10, end */ MIPS32_NOP, MIPS32_LW(8,0,9), /* lw $8,0($9), Load $8 with the word @mem[$9] */ @@ -317,8 +312,7 @@ int mips32_pracc_read_mem32(struct mips_ejtag *ejtag_info, uint32_t addr, int co MIPS32_ADDI(9,9,4), /* $1 += 4 */ MIPS32_ADDI(11,11,4), /* $11 += 4 */ - MIPS32_NOP, - MIPS32_B(NEG16(9)), /* b loop */ + MIPS32_B(NEG16(8)), /* b loop */ MIPS32_NOP, /* end: */ MIPS32_LW(11,0,15), /* lw $11,($15) */ @@ -326,8 +320,7 @@ int mips32_pracc_read_mem32(struct mips_ejtag *ejtag_info, uint32_t addr, int co MIPS32_LW(9,0,15), /* lw $9,($15) */ MIPS32_LW(8,0,15), /* lw $8,($15) */ MIPS32_MFC0(15,31,0), /* move COP0 DeSave to $15 */ - MIPS32_NOP, - MIPS32_B(NEG16(31)), /* b start */ + MIPS32_B(NEG16(28)), /* b start */ MIPS32_NOP, }; @@ -370,15 +363,14 @@ int mips32_pracc_read_u32(struct mips_ejtag *ejtag_info, uint32_t addr, uint32_t MIPS32_ORI(15,15,LOWER16(MIPS32_PRACC_STACK)), MIPS32_SW(8,0,15), /* sw $8,($15) */ - MIPS32_LW(8,NEG16(MIPS32_PRACC_STACK-MIPS32_PRACC_PARAM_IN), 15), //load R8 @ param_in[0] = address + MIPS32_LW(8,NEG16(MIPS32_PRACC_STACK-MIPS32_PRACC_PARAM_IN),15), /* load R8 @ param_in[0] = address */ MIPS32_LW(8,0,8), /* lw $8,0($8), Load $8 with the word @mem[$8] */ - MIPS32_SW(8,NEG16(MIPS32_PRACC_STACK-MIPS32_PRACC_PARAM_OUT),15), /* sw $8,0($9) */ + MIPS32_SW(8,NEG16(MIPS32_PRACC_STACK-MIPS32_PRACC_PARAM_OUT),15), /* store R8 @ param_out[0] */ MIPS32_LW(8,0,15), /* lw $8,($15) */ - MIPS32_B(NEG16(9)), //was 17 /* b start */ - MIPS32_MFC0(15,31,0), //this instruction will be executed (MIPS executes instruction after jump) /* move COP0 DeSave to $15 */ - MIPS32_NOP, + MIPS32_B(NEG16(9)), /* b start */ + MIPS32_MFC0(15,31,0), /* move COP0 DeSave to $15 */ }; int retval = ERROR_OK; @@ -387,7 +379,7 @@ int mips32_pracc_read_u32(struct mips_ejtag *ejtag_info, uint32_t addr, uint32_t param_in[0] = addr; if ((retval = mips32_pracc_exec(ejtag_info, ARRAY_SIZE(code), code, - ARRAY_SIZE(param_in), param_in, sizeof(uint32_t), buf, 1)) != ERROR_OK) + ARRAY_SIZE(param_in), param_in, 1, buf, 1)) != ERROR_OK) { return retval; } @@ -413,9 +405,8 @@ int mips32_pracc_read_mem16(struct mips_ejtag *ejtag_info, uint32_t addr, int co MIPS32_LW(10,4,8), /* $10 = mem[$8 + 4]; read count */ MIPS32_LUI(11,UPPER16(MIPS32_PRACC_PARAM_OUT)), /* $11 = MIPS32_PRACC_PARAM_OUT */ MIPS32_ORI(11,11,LOWER16(MIPS32_PRACC_PARAM_OUT)), - MIPS32_NOP, /* loop: */ - MIPS32_BEQ(0,10,9), /* beq 0, $10, end */ + MIPS32_BEQ(0,10,8), /* beq 0, $10, end */ MIPS32_NOP, MIPS32_LHU(8,0,9), /* lw $8,0($9), Load $8 with the halfword @mem[$9] */ @@ -424,21 +415,19 @@ int mips32_pracc_read_mem16(struct mips_ejtag *ejtag_info, uint32_t addr, int co MIPS32_ADDI(10,10,NEG16(1)), /* $10-- */ MIPS32_ADDI(9,9,2), /* $9 += 2 */ MIPS32_ADDI(11,11,4), /* $11 += 4 */ + MIPS32_B(NEG16(8)), /* b loop */ MIPS32_NOP, - MIPS32_B(NEG16(9)), /* b loop */ - MIPS32_NOP, - + /* end: */ MIPS32_LW(11,0,15), /* lw $11,($15) */ MIPS32_LW(10,0,15), /* lw $10,($15) */ MIPS32_LW(9,0,15), /* lw $9,($15) */ MIPS32_LW(8,0,15), /* lw $8,($15) */ MIPS32_MFC0(15,31,0), /* move COP0 DeSave to $15 */ - MIPS32_NOP, - MIPS32_B(NEG16(31)), /* b start */ + MIPS32_B(NEG16(28)), /* b start */ MIPS32_NOP, }; -// /* TODO remove array */ + /* TODO remove array */ uint32_t *param_out = malloc(count * sizeof(uint32_t)); int i; @@ -494,9 +483,8 @@ int mips32_pracc_read_mem8(struct mips_ejtag *ejtag_info, uint32_t addr, int cou MIPS32_LW(10,4,8), /* $10 = mem[$8 + 4]; read count */ MIPS32_LUI(11,UPPER16(MIPS32_PRACC_PARAM_OUT)), /* $11 = MIPS32_PRACC_PARAM_OUT */ MIPS32_ORI(11,11,LOWER16(MIPS32_PRACC_PARAM_OUT)), - MIPS32_NOP, /* loop: */ - MIPS32_BEQ(0,10,9), /* beq 0, $10, end */ + MIPS32_BEQ(0,10,8), /* beq 0, $10, end */ MIPS32_NOP, MIPS32_LBU(8,0,9), /* lw $8,0($9), Load t4 with the byte @mem[t1] */ @@ -505,8 +493,7 @@ int mips32_pracc_read_mem8(struct mips_ejtag *ejtag_info, uint32_t addr, int cou MIPS32_ADDI(10,10,NEG16(1)), /* $10-- */ MIPS32_ADDI(9,9,1), /* $9 += 1 */ MIPS32_ADDI(11,11,4), /* $11 += 4 */ - MIPS32_NOP, - MIPS32_B(NEG16(9)), /* b loop */ + MIPS32_B(NEG16(8)), /* b loop */ MIPS32_NOP, /* end: */ MIPS32_LW(11,0,15), /* lw $11,($15) */ @@ -514,12 +501,11 @@ int mips32_pracc_read_mem8(struct mips_ejtag *ejtag_info, uint32_t addr, int cou MIPS32_LW(9,0,15), /* lw $9,($15) */ MIPS32_LW(8,0,15), /* lw $8,($15) */ MIPS32_MFC0(15,31,0), /* move COP0 DeSave to $15 */ - MIPS32_NOP, - MIPS32_B(NEG16(31)), /* b start */ + MIPS32_B(NEG16(28)), /* b start */ MIPS32_NOP, }; -// /* TODO remove array */ + /* TODO remove array */ uint32_t *param_out = malloc(count * sizeof(uint32_t)); int i; @@ -577,8 +563,6 @@ int mips32_pracc_write_mem(struct mips_ejtag *ejtag_info, uint32_t addr, int siz int mips32_pracc_write_mem32(struct mips_ejtag *ejtag_info, uint32_t addr, int count, uint32_t *buf) { - -//NC: use destination pointer as loop counter (last address is in $10) static const uint32_t code[] = { /* start: */ MIPS32_MTC0(15,31,0), /* move $15 to COP0 DeSave */ @@ -589,32 +573,32 @@ int mips32_pracc_write_mem32(struct mips_ejtag *ejtag_info, uint32_t addr, int c MIPS32_SW(10,0,15), /* sw $10,($15) */ MIPS32_SW(11,0,15), /* sw $11,($15) */ - MIPS32_ADDI(8,15,NEG16(MIPS32_PRACC_STACK-MIPS32_PRACC_PARAM_IN)), //$8= MIPS32_PRACC_PARAM_IN + MIPS32_ADDI(8,15,NEG16(MIPS32_PRACC_STACK-MIPS32_PRACC_PARAM_IN)), /* $8= MIPS32_PRACC_PARAM_IN */ MIPS32_LW(9,0,8), /* Load write addr to $9 */ - MIPS32_LW(10,4,8), //last address /* Load write count to $10 */ - MIPS32_ADDI(8,8,8), // $8 += 8 beginning of data + MIPS32_LW(10,4,8), /* Load write count to $10 */ + MIPS32_ADDI(8,8,8), /* $8 += 8 beginning of data */ -//loop: + /* loop: */ MIPS32_LW(11,0,8), /* lw $11,0($8), Load $11 with the word @mem[$8] */ MIPS32_SW(11,0,9), /* sw $11,0($9) */ MIPS32_ADDI(9,9,4), /* $9 += 4 */ - MIPS32_BNE(10,9,NEG16(4)), //was 9 BNE $10, 9, loop /* b loop */ - MIPS32_ADDI(8,8,4), //this instruction is part of the loop (one delay slot)! /* $8 += 4 */ + MIPS32_BNE(10,9,NEG16(4)), /* bne $10, $9, loop */ + MIPS32_ADDI(8,8,4), /* $8 += 4 */ + /* end: */ MIPS32_LW(11,0,15), /* lw $11,($15) */ MIPS32_LW(10,0,15), /* lw $10,($15) */ MIPS32_LW(9,0,15), /* lw $9,($15) */ MIPS32_LW(8,0,15), /* lw $8,($15) */ - MIPS32_B(NEG16(21)), //was 30 /* b start */ + MIPS32_B(NEG16(21)), /* b start */ MIPS32_MFC0(15,31,0), /* move COP0 DeSave to $15 */ - MIPS32_NOP, //this one will not be executed }; /* TODO remove array */ uint32_t *param_in = malloc((count + 2) * sizeof(uint32_t)); param_in[0] = addr; - param_in[1] = addr + count * sizeof(uint32_t); //last address + param_in[1] = addr + (count * sizeof(uint32_t)); /* last address */ memcpy(¶m_in[2], buf, count * sizeof(uint32_t)); @@ -636,16 +620,15 @@ int mips32_pracc_write_u32(struct mips_ejtag *ejtag_info, uint32_t addr, uint32_ MIPS32_SW(8,0,15), /* sw $8,($15) */ MIPS32_SW(9,0,15), /* sw $9,($15) */ - MIPS32_LW(8,NEG16((MIPS32_PRACC_STACK-MIPS32_PRACC_PARAM_IN)-4), 15), //load R8 @ param_in[1] = data - MIPS32_LW(9,NEG16(MIPS32_PRACC_STACK-MIPS32_PRACC_PARAM_IN), 15), //load R9 @ param_in[0] = address + MIPS32_LW(8,NEG16((MIPS32_PRACC_STACK-MIPS32_PRACC_PARAM_IN)-4), 15), /* load R8 @ param_in[1] = data */ + MIPS32_LW(9,NEG16(MIPS32_PRACC_STACK-MIPS32_PRACC_PARAM_IN), 15), /* load R9 @ param_in[0] = address */ MIPS32_SW(8,0,9), /* sw $8,0($9) */ MIPS32_LW(9,0,15), /* lw $9,($15) */ MIPS32_LW(8,0,15), /* lw $8,($15) */ MIPS32_B(NEG16(11)), /* b start */ - MIPS32_MFC0(15,31,0), /* move COP0 DeSave to $15 */ - MIPS32_NOP, + MIPS32_MFC0(15,31,0), /* move COP0 DeSave to $15 */ }; /* TODO remove array */ @@ -654,7 +637,7 @@ int mips32_pracc_write_u32(struct mips_ejtag *ejtag_info, uint32_t addr, uint32_ param_in[1] = *buf; mips32_pracc_exec(ejtag_info, ARRAY_SIZE(code), code, \ - ARRAY_SIZE(param_in),param_in, 0, NULL, 1); + ARRAY_SIZE(param_in), param_in, 0, NULL, 1); return ERROR_OK; } @@ -676,9 +659,8 @@ int mips32_pracc_write_mem16(struct mips_ejtag *ejtag_info, uint32_t addr, int c MIPS32_LW(9,0,8), /* Load write addr to $9 */ MIPS32_LW(10,4,8), /* Load write count to $10 */ MIPS32_ADDI(8,8,8), /* $8 += 8 */ - MIPS32_NOP, /* loop: */ - MIPS32_BEQ(0,10,9), /* beq $0, $10, end */ + MIPS32_BEQ(0,10,8), /* beq $0, $10, end */ MIPS32_NOP, MIPS32_LW(11,0,8), /* lw $11,0($8), Load $11 with the word @mem[$8] */ @@ -688,8 +670,7 @@ int mips32_pracc_write_mem16(struct mips_ejtag *ejtag_info, uint32_t addr, int c MIPS32_ADDI(9,9,2), /* $9 += 2 */ MIPS32_ADDI(8,8,4), /* $8 += 4 */ - MIPS32_NOP, - MIPS32_B(NEG16(9)), /* b loop */ + MIPS32_B(NEG16(8)), /* b loop */ MIPS32_NOP, /* end: */ MIPS32_LW(11,0,15), /* lw $11,($15) */ @@ -697,8 +678,7 @@ int mips32_pracc_write_mem16(struct mips_ejtag *ejtag_info, uint32_t addr, int c MIPS32_LW(9,0,15), /* lw $9,($15) */ MIPS32_LW(8,0,15), /* lw $8,($15) */ MIPS32_MFC0(15,31,0), /* move COP0 DeSave to $15 */ - MIPS32_NOP, - MIPS32_B(NEG16(30)), /* b start */ + MIPS32_B(NEG16(27)), /* b start */ MIPS32_NOP, }; @@ -738,9 +718,8 @@ int mips32_pracc_write_mem8(struct mips_ejtag *ejtag_info, uint32_t addr, int co MIPS32_LW(9,0,8), /* Load write addr to $9 */ MIPS32_LW(10,4,8), /* Load write count to $10 */ MIPS32_ADDI(8,8,8), /* $8 += 8 */ - MIPS32_NOP, /* loop: */ - MIPS32_BEQ(0,10,9), /* beq $0, $10, end */ + MIPS32_BEQ(0,10,8), /* beq $0, $10, end */ MIPS32_NOP, MIPS32_LW(11,0,8), /* lw $11,0($8), Load $11 with the word @mem[$8] */ @@ -750,8 +729,7 @@ int mips32_pracc_write_mem8(struct mips_ejtag *ejtag_info, uint32_t addr, int co MIPS32_ADDI(9,9,1), /* $9 += 1 */ MIPS32_ADDI(8,8,4), /* $8 += 4 */ - MIPS32_NOP, - MIPS32_B(NEG16(9)), /* b loop */ + MIPS32_B(NEG16(8)), /* b loop */ MIPS32_NOP, /* end: */ MIPS32_LW(11,0,15), /* lw $11,($15) */ @@ -759,8 +737,7 @@ int mips32_pracc_write_mem8(struct mips_ejtag *ejtag_info, uint32_t addr, int co MIPS32_LW(9,0,15), /* lw $9,($15) */ MIPS32_LW(8,0,15), /* lw $8,($15) */ MIPS32_MFC0(15,31,0), /* move COP0 DeSave to $15 */ - MIPS32_NOP, - MIPS32_B(NEG16(30)), /* b start */ + MIPS32_B(NEG16(27)), /* b start */ MIPS32_NOP, }; @@ -777,7 +754,7 @@ int mips32_pracc_write_mem8(struct mips_ejtag *ejtag_info, uint32_t addr, int co } retval = mips32_pracc_exec(ejtag_info, ARRAY_SIZE(code), code, \ - count +2, param_in, 0, NULL, 1); + count + 2, param_in, 0, NULL, 1); free(param_in); @@ -843,15 +820,14 @@ int mips32_pracc_write_regs(struct mips_ejtag *ejtag_info, uint32_t *regs) MIPS32_LW(2,2*4,1), /* lw $2,2*4($1) */ MIPS32_LW(1,0,15), /* lw $1,($15) */ MIPS32_MFC0(15,31,0), /* move COP0 DeSave to $15 */ - MIPS32_NOP, - MIPS32_B(NEG16(55)), /* b start */ + MIPS32_B(NEG16(54)), /* b start */ MIPS32_NOP, }; int retval; retval = mips32_pracc_exec(ejtag_info, ARRAY_SIZE(code), code, \ - 38, regs, 0, NULL, 1); + MIPS32NUMCOREREGS, regs, 0, NULL, 1); return retval; } @@ -920,15 +896,14 @@ int mips32_pracc_read_regs(struct mips_ejtag *ejtag_info, uint32_t *regs) MIPS32_LW(2,0,15), /* lw $2,($15) */ MIPS32_LW(1,0,15), /* lw $1,($15) */ MIPS32_MFC0(15,31,0), /* move COP0 DeSave to $15 */ - MIPS32_NOP, - MIPS32_B(NEG16(60)), /* b start */ + MIPS32_B(NEG16(59)), /* b start */ MIPS32_NOP, }; int retval; retval = mips32_pracc_exec(ejtag_info, ARRAY_SIZE(code), code, \ - 0, NULL, 38, regs, 1); + 0, NULL, MIPS32NUMCOREREGS, regs, 1); return retval; } @@ -970,7 +945,6 @@ int mips32_pracc_fastdata_xfer(struct mips_ejtag *ejtag_info, struct working_are MIPS32_ORI(15,15,LOWER16(MIPS32_PRACC_TEXT)), MIPS32_JR(15), /* jr start */ MIPS32_MFC0(15,31,0), /* move COP0 DeSave to $15 */ - MIPS32_NOP, }; uint32_t jmp_code[] = { @@ -981,9 +955,6 @@ int mips32_pracc_fastdata_xfer(struct mips_ejtag *ejtag_info, struct working_are MIPS32_NOP, }; -#define JMP_CODE_SIZE (sizeof(jmp_code)/sizeof(jmp_code[0])) -#define HANDLER_CODE_SIZE sizeof(handler_code)/sizeof(handler_code[0]) - int retval, i; uint32_t val, ejtag_ctrl, address; @@ -1002,7 +973,7 @@ int mips32_pracc_fastdata_xfer(struct mips_ejtag *ejtag_info, struct working_are } /* write program into RAM */ - mips32_pracc_write_mem32(ejtag_info, source->address, HANDLER_CODE_SIZE, handler_code); + mips32_pracc_write_mem32(ejtag_info, source->address, ARRAY_SIZE(handler_code), handler_code); /* quick verify RAM is working */ mips32_pracc_read_u32(ejtag_info, source->address, &val); @@ -1017,7 +988,7 @@ int mips32_pracc_fastdata_xfer(struct mips_ejtag *ejtag_info, struct working_are jmp_code[1] |= UPPER16(source->address); jmp_code[2] |= LOWER16(source->address); - for (i = 0; i < (int) JMP_CODE_SIZE; i++) + for (i = 0; i < (int) ARRAY_SIZE(jmp_code); i++) { if ((retval = wait_for_pracc_rw(ejtag_info, &ejtag_ctrl)) != ERROR_OK) return retval; @@ -1026,7 +997,6 @@ int mips32_pracc_fastdata_xfer(struct mips_ejtag *ejtag_info, struct working_are mips_ejtag_drscan_32(ejtag_info, &jmp_code[i]); /* Clear the access pending bit (let the processor eat!) */ - ejtag_ctrl = ejtag_info->ejtag_ctrl & ~EJTAG_CTRL_PRACC; mips_ejtag_set_instr(ejtag_info, EJTAG_INST_CONTROL, NULL); mips_ejtag_drscan_32(ejtag_info, &ejtag_ctrl); diff --git a/src/target/mips32_pracc.h b/src/target/mips32_pracc.h index 41a7325..a914686 100644 --- a/src/target/mips32_pracc.h +++ b/src/target/mips32_pracc.h @@ -28,7 +28,6 @@ #define MIPS32_PRACC_FASTDATA_AREA 0xFF200000 #define MIPS32_PRACC_FASTDATA_SIZE 16 #define MIPS32_PRACC_TEXT 0xFF200200 -//#define MIPS32_PRACC_STACK 0xFF2FFFFC #define MIPS32_PRACC_STACK 0xFF204000 #define MIPS32_PRACC_PARAM_IN 0xFF201000 #define MIPS32_PRACC_PARAM_IN_SIZE 0x1000 diff --git a/src/target/mips_ejtag.c b/src/target/mips_ejtag.c index 6f7baf0..bebad9a 100644 --- a/src/target/mips_ejtag.c +++ b/src/target/mips_ejtag.c @@ -139,10 +139,8 @@ int mips_ejtag_step_enable(struct mips_ejtag *ejtag_info) MIPS32_MFC0(1,23,0), /* move COP0 Debug to $1 */ MIPS32_ORI(1,1,0x0100), /* set SSt bit in debug reg */ MIPS32_MTC0(1,23,0), /* move $1 to COP0 Debug */ + MIPS32_B(NEG16(5)), MIPS32_MFC0(1,31,0), /* move COP0 DeSave to $1 */ - MIPS32_NOP, - MIPS32_B(NEG16(7)), - MIPS32_NOP, }; mips32_pracc_exec(ejtag_info, ARRAY_SIZE(code), code, \ @@ -165,10 +163,8 @@ int mips_ejtag_step_disable(struct mips_ejtag *ejtag_info) MIPS32_MTC0(1,23,0), /* move $1 to COP0 Debug */ MIPS32_LW(2,0,15), MIPS32_LW(1,0,15), + MIPS32_B(NEG16(13)), MIPS32_MFC0(15,31,0), /* move COP0 DeSave to $15 */ - MIPS32_NOP, - MIPS32_B(NEG16(15)), - MIPS32_NOP, }; mips32_pracc_exec(ejtag_info, ARRAY_SIZE(code), code, \ @@ -230,10 +226,8 @@ int mips_ejtag_read_debug(struct mips_ejtag *ejtag_info, uint32_t* debug_reg) MIPS32_SW(2,0,1), MIPS32_LW(2,0,15), MIPS32_LW(1,0,15), + MIPS32_B(NEG16(12)), MIPS32_MFC0(15,31,0), /* move COP0 DeSave to $15 */ - MIPS32_NOP, - MIPS32_B(NEG16(14)), - MIPS32_NOP, }; mips32_pracc_exec(ejtag_info, ARRAY_SIZE(code), code, \ diff --git a/src/target/mips_m4k.c b/src/target/mips_m4k.c index f3191ae..4adc1f1 100644 --- a/src/target/mips_m4k.c +++ b/src/target/mips_m4k.c @@ -993,14 +993,14 @@ int mips_m4k_bulk_write_memory(struct target *target, uint32_t address, uint32_t if (target->endianness == TARGET_BIG_ENDIAN) { uint32_t i, t32; - for(i = 0; i < (count*4); i+=4) + for(i = 0; i < (count * 4); i += 4) { t32 = be_to_h_u32((uint8_t *) &buffer[i]); h_u32_to_le(&buffer[i], t32); } } - retval = mips32_pracc_fastdata_xfer(ejtag_info, source, write, address, count, (uint32_t *) buffer); + retval = mips32_pracc_fastdata_xfer(ejtag_info, source, write, address, count, (uint32_t*) buffer); if (source) target_free_working_area(target, source); commit faad9e59233306e608a3a01388a38099ece9688b Author: Spencer Oliver <nt...@us...> Date: Thu Dec 17 11:53:39 2009 +0000 parport: output port as hex rather than dec Signed-off-by: Spencer Oliver <nt...@us...> diff --git a/src/jtag/drivers/parport.c b/src/jtag/drivers/parport.c index 2e6b9ed..b280d04 100644 --- a/src/jtag/drivers/parport.c +++ b/src/jtag/drivers/parport.c @@ -424,7 +424,7 @@ COMMAND_HANDLER(parport_handle_parport_port_command) } } - command_print(CMD_CTX, "parport port = %u", parport_port); + command_print(CMD_CTX, "parport port = 0x%" PRIx16 "", parport_port); return ERROR_OK; } commit 03e8649bc699053ccdbbd4a3c2eaf05241e22a5b Author: David Claffey <dnc...@gm...> Date: Wed Dec 16 11:23:52 2009 +0000 MIPS: merge mips fast_data patch from David N. Claffey Signed-off-by: Spencer Oliver <nt...@us...> diff --git a/src/target/mips32.c b/src/target/mips32.c index e8ea541..0f6f9b0 100644 --- a/src/target/mips32.c +++ b/src/target/mips32.c @@ -29,7 +29,6 @@ #include "mips32.h" #include "register.h" - char* mips32_core_reg_list[] = { "zero", "at", "v0", "v1", "a0", "a1", "a2", "a3", diff --git a/src/target/mips32.h b/src/target/mips32.h index 7d1928e..9ad5293 100644 --- a/src/target/mips32.h +++ b/src/target/mips32.h @@ -77,6 +77,7 @@ struct mips32_core_reg #define MIPS32_OP_ADDI 0x08 #define MIPS32_OP_AND 0x24 #define MIPS32_OP_COP0 0x10 +#define MIPS32_OP_JR 0x08 #define MIPS32_OP_LUI 0x0F #define MIPS32_OP_LW 0x23 #define MIPS32_OP_LBU 0x24 @@ -103,6 +104,7 @@ struct mips32_core_reg #define MIPS32_B(off) MIPS32_BEQ(0, 0, off) #define MIPS32_BEQ(src,tar,off) MIPS32_I_INST(MIPS32_OP_BEQ, src, tar, off) #define MIPS32_BNE(src,tar,off) MIPS32_I_INST(MIPS32_OP_BNE, src, tar, off) +#define MIPS32_JR(reg) MIPS32_R_INST(0, reg, 0, 0, 0, MIPS32_OP_JR) #define MIPS32_MFC0(gpr, cpr, sel) MIPS32_R_INST(MIPS32_OP_COP0, MIPS32_COP0_MF, gpr, cpr, 0, sel) #define MIPS32_MTC0(gpr,cpr, sel) MIPS32_R_INST(MIPS32_OP_COP0, MIPS32_COP0_MT, gpr, cpr, 0, sel) #define MIPS32_LBU(reg, off, base) MIPS32_I_INST(MIPS32_OP_LBU, base, reg, off) diff --git a/src/target/mips32_pracc.c b/src/target/mips32_pracc.c index 604d34e..34794f3 100644 --- a/src/target/mips32_pracc.c +++ b/src/target/mips32_pracc.c @@ -4,6 +4,8 @@ * * * Copyright (C) 2008 by David T.L. Wong * * * + * Copyright (C) 2009 by David N. Claffey <dnc...@gm...> * + * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * @@ -69,7 +71,6 @@ OpenOCD is used as a flash programmer or as a debug tool. Nico Coesel */ - #ifdef HAVE_CONFIG_H #include "config.h" #endif @@ -161,7 +162,6 @@ static int mips32_pracc_exec_read(struct mips32_pracc_context *ctx, uint32_t add jtag_add_clocks(5); jtag_execute_queue(); - return ERROR_OK; } @@ -254,7 +254,6 @@ int mips32_pracc_exec(struct mips_ejtag *ejtag_info, int code_len, const uint32_ if ((retval = mips32_pracc_exec_read(&ctx, address)) != ERROR_OK) return retval; - } if (cycle == 0) @@ -933,3 +932,149 @@ int mips32_pracc_read_regs(struct mips_ejtag *ejtag_info, uint32_t *regs) return retval; } + +/* fastdata upload/download requires an initialized working area + * to load the download code; it should not be called otherwise + * fetch order from the fastdata area + * 1. start addr + * 2. end addr + * 3. data ... + */ +int mips32_pracc_fastdata_xfer(struct mips_ejtag *ejtag_info, struct working_area *source, + int write, uint32_t addr, int count, uint32_t *buf) +{ + uint32_t handler_code[] = { + /* caution when editing, table is modified below */ + /* r15 points to the start of this code */ + MIPS32_SW(8,MIPS32_FASTDATA_HANDLER_SIZE - 4,15), + MIPS32_SW(9,MIPS32_FASTDATA_HANDLER_SIZE - 8,15), + MIPS32_SW(10,MIPS32_FASTDATA_HANDLER_SIZE - 12,15), + MIPS32_SW(11,MIPS32_FASTDATA_HANDLER_SIZE - 16,15), + /* start of fastdata area in t0 */ + MIPS32_LUI(8,UPPER16(MIPS32_PRACC_FASTDATA_AREA)), + MIPS32_ORI(8,8,LOWER16(MIPS32_PRACC_FASTDATA_AREA)), + MIPS32_LW(9,0,8), /* start addr in t1 */ + MIPS32_LW(10,0,8), /* end addr to t2 */ + /* loop: */ + /* 8 */ MIPS32_LW(11,0,0), /* lw t3,[t8 | r9] */ + /* 9 */ MIPS32_SW(11,0,0), /* sw t3,[r9 | r8] */ + MIPS32_BNE(10,9,NEG16(3)), /* bne $t2,t1,loop */ + MIPS32_ADDI(9,9,4), /* addi t1,t1,4 */ + + MIPS32_LW(8,MIPS32_FASTDATA_HANDLER_SIZE - 4,15), + MIPS32_LW(9,MIPS32_FASTDATA_HANDLER_SIZE - 8,15), + MIPS32_LW(10,MIPS32_FASTDATA_HANDLER_SIZE - 12,15), + MIPS32_LW(11,MIPS32_FASTDATA_HANDLER_SIZE - 16,15), + + MIPS32_LUI(15,UPPER16(MIPS32_PRACC_TEXT)), + MIPS32_ORI(15,15,LOWER16(MIPS32_PRACC_TEXT)), + MIPS32_JR(15), /* jr start */ + MIPS32_MFC0(15,31,0), /* move COP0 DeSave to $15 */ + MIPS32_NOP, + }; + + uint32_t jmp_code[] = { + MIPS32_MTC0(15,31,0), /* move $15 to COP0 DeSave */ + /* 1 */ MIPS32_LUI(15,0), /* addr of working area added below */ + /* 2 */ MIPS32_ORI(15,15,0), /* addr of working area added below */ + MIPS32_JR(15), /* jump to ram program */ + MIPS32_NOP, + }; + +#define JMP_CODE_SIZE (sizeof(jmp_code)/sizeof(jmp_code[0])) +#define HANDLER_CODE_SIZE sizeof(handler_code)/sizeof(handler_code[0]) + + int retval, i; + uint32_t val, ejtag_ctrl, address; + + if (source->size < MIPS32_FASTDATA_HANDLER_SIZE) + return ERROR_TARGET_RESOURCE_NOT_AVAILABLE; + + if (write) + { + handler_code[8] = MIPS32_LW(11,0,8); /* load data from probe at fastdata area */ + handler_code[9] = MIPS32_SW(11,0,9); /* store data to RAM @ r9 */ + } + else + { + handler_code[8] = MIPS32_LW(11,0,9); /* load data from RAM @ r9 */ + handler_code[9] = MIPS32_SW(11,0,8); /* store data to probe at fastdata area */ + } + + /* write program into RAM */ + mips32_pracc_write_mem32(ejtag_info, source->address, HANDLER_CODE_SIZE, handler_code); + + /* quick verify RAM is working */ + mips32_pracc_read_u32(ejtag_info, source->address, &val); + if (val != handler_code[0]) + { + LOG_ERROR("fastdata handler verify failed\n"); + return ERROR_TARGET_RESOURCE_NOT_AVAILABLE; + } + + LOG_INFO("%s using 0x%.8x for write handler\n", __func__, source->address); + + jmp_code[1] |= UPPER16(source->address); + jmp_code[2] |= LOWER16(source->address); + + for (i = 0; i < (int) JMP_CODE_SIZE; i++) + { + if ((retval = wait_for_pracc_rw(ejtag_info, &ejtag_ctrl)) != ERROR_OK) + return retval; + + mips_ejtag_set_instr(ejtag_info, EJTAG_INST_DATA, NULL); + mips_ejtag_drscan_32(ejtag_info, &jmp_code[i]); + + /* Clear the access pending bit (let the processor eat!) */ + + ejtag_ctrl = ejtag_info->ejtag_ctrl & ~EJTAG_CTRL_PRACC; + mips_ejtag_set_instr(ejtag_info, EJTAG_INST_CONTROL, NULL); + mips_ejtag_drscan_32(ejtag_info, &ejtag_ctrl); + } + + if ((retval = wait_for_pracc_rw(ejtag_info, &ejtag_ctrl)) != ERROR_OK) + return retval; + + /* next fetch to dmseg should be in FASTDATA_AREA, check */ + address = 0; + mips_ejtag_set_instr(ejtag_info, EJTAG_INST_ADDRESS, NULL); + mips_ejtag_drscan_32(ejtag_info, &address); + + if (address != MIPS32_PRACC_FASTDATA_AREA) + return ERROR_FAIL; + + /* Send the load start address */ + val = addr; + mips_ejtag_set_instr(ejtag_info, EJTAG_INST_FASTDATA, NULL); + mips_ejtag_fastdata_scan(ejtag_info, 1, &val); + + /* Send the load end address */ + val = addr + (count - 1) * 4; + mips_ejtag_set_instr(ejtag_info, EJTAG_INST_FASTDATA, NULL); + mips_ejtag_fastdata_scan(ejtag_info, 1, &val); + + for (i = 0; i < count; i++) + { + /* Send the data out using fastdata (clears the access pending bit) */ + if ((retval = mips_ejtag_fastdata_scan(ejtag_info, write, buf++)) != ERROR_OK) + return retval; + } + + if ((retval = jtag_execute_queue()) != ERROR_OK) + { + LOG_ERROR("fastdata load failed"); + return retval; + } + + if ((retval = wait_for_pracc_rw(ejtag_info, &ejtag_ctrl)) != ERROR_OK) + return retval; + + address = 0; + mips_ejtag_set_instr(ejtag_info, EJTAG_INST_ADDRESS, NULL); + mips_ejtag_drscan_32(ejtag_info, &address); + + if (address != MIPS32_PRACC_TEXT) + LOG_ERROR("mini program did not return to start\n"); + + return retval; +} diff --git a/src/target/mips32_pracc.h b/src/target/mips32_pracc.h index 5d1cf3d..41a7325 100644 --- a/src/target/mips32_pracc.h +++ b/src/target/mips32_pracc.h @@ -22,8 +22,11 @@ #ifndef MIPS32_PRACC_H #define MIPS32_PRACC_H -#include "mips_ejtag.h" +#include <target/mips32.h> +#include <target/mips_ejtag.h> +#define MIPS32_PRACC_FASTDATA_AREA 0xFF200000 +#define MIPS32_PRACC_FASTDATA_SIZE 16 #define MIPS32_PRACC_TEXT 0xFF200200 //#define MIPS32_PRACC_STACK 0xFF2FFFFC #define MIPS32_PRACC_STACK 0xFF204000 @@ -32,6 +35,7 @@ #define MIPS32_PRACC_PARAM_OUT (MIPS32_PRACC_PARAM_IN + MIPS32_PRACC_PARAM_IN_SIZE) #define MIPS32_PRACC_PARAM_OUT_SIZE 0x1000 +#define MIPS32_FASTDATA_HANDLER_SIZE 0x80 #define UPPER16(uint32_t) (uint32_t >> 16) #define LOWER16(uint32_t) (uint32_t & 0xFFFF) #define NEG16(v) (((~(v)) + 1) & 0xFFFF) @@ -41,6 +45,8 @@ int mips32_pracc_read_mem(struct mips_ejtag *ejtag_info, uint32_t addr, int size, int count, void *buf); int mips32_pracc_write_mem(struct mips_ejtag *ejtag_info, uint32_t addr, int size, int count, void *buf); +int mips32_pracc_fastdata_xfer(struct mips_ejtag *ejtag_info, struct working_area *source, + int write, uint32_t addr, int count, uint32_t *buf); int mips32_pracc_read_mem8(struct mips_ejtag *ejtag_info, uint32_t addr, int count, uint8_t *buf); diff --git a/src/target/mips_ejtag.c b/src/target/mips_ejtag.c index 68a39fa..6f7baf0 100644 --- a/src/target/mips_ejtag.c +++ b/src/target/mips_ejtag.c @@ -4,6 +4,8 @@ * * * Copyright (C) 2008 by David T.L. Wong * * * + * Copyright (C) 2009 by David N. Claffey <dnc...@gm...> * + * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * @@ -286,3 +288,42 @@ int mips_ejtag_init(struct mips_ejtag *ejtag_info) return ERROR_OK; } + +int mips_ejtag_fastdata_scan(struct mips_ejtag *ejtag_info, int write, uint32_t *data) +{ + struct jtag_tap *tap; + tap = ejtag_info->tap; + + if (tap == NULL) + return ERROR_FAIL; + + struct scan_field fields[2]; + uint8_t spracc = 0; + uint8_t t[4] = {0, 0, 0, 0}; + + /* fastdata 1-bit register */ + fields[0].tap = tap; + fields[0].num_bits = 1; + fields[0].out_value = &spracc; + fields[0].in_value = NULL; + + /* processor access data register 32 bit */ + fields[1].tap = tap; + fields[1].num_bits = 32; + fields[1].out_value = t; + + if (write) + { + fields[1].in_value = NULL; + buf_set_u32(t, 0, 32, *data); + } + else + { + fields[1].in_value = (uint8_t *) data; + } + + jtag_add_dr_scan(2, fields, jtag_get_end_state()); + keep_alive(); + + return ERROR_OK; +} diff --git a/src/target/mips_ejtag.h b/src/target/mips_ejtag.h index 93b4a6a..eb42d67 100644 --- a/src/target/mips_ejtag.h +++ b/src/target/mips_ejtag.h @@ -118,6 +118,7 @@ int mips_ejtag_exit_debug(struct mips_ejtag *ejtag_info); int mips_ejtag_get_impcode(struct mips_ejtag *ejtag_info, uint32_t *impcode); int mips_ejtag_get_idcode(struct mips_ejtag *ejtag_info, uint32_t *idcode); int mips_ejtag_drscan_32(struct mips_ejtag *ejtag_info, uint32_t *data); +int mips_ejtag_fastdata_scan(struct mips_ejtag *ejtag_info, int write, uint32_t *data); int mips_ejtag_init(struct mips_ejtag *ejtag_info); int mips_ejtag_config_step(struct mips_ejtag *ejtag_info, int enable_step); diff --git a/src/target/mips_m4k.c b/src/target/mips_m4k.c index a83217f..f3191ae 100644 --- a/src/target/mips_m4k.c +++ b/src/target/mips_m4k.c @@ -4,6 +4,8 @@ * * * Copyright (C) 2008 by David T.L. Wong * * * + * Copyright (C) 2009 by David N. Claffey <dnc...@gm...> * + * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * @@ -30,7 +32,6 @@ #include "target_type.h" #include "register.h" - /* cli handling */ /* forward declarations */ @@ -962,7 +963,49 @@ int mips_m4k_examine(struct target *target) int mips_m4k_bulk_write_memory(struct target *target, uint32_t address, uint32_t count, uint8_t *buffer) { - return mips_m4k_write_memory(target, address, 4, count, buffer); + struct mips32_common *mips32 = target->arch_info; + struct mips_ejtag *ejtag_info = &mips32->ejtag_info; + struct working_area *source; + int retval; + int write = 1; + + LOG_DEBUG("address: 0x%8.8x, count: 0x%8.8x", address, count); + + if (target->state != TARGET_HALTED) + { + LOG_WARNING("target not halted"); + return ERROR_TARGET_NOT_HALTED; + } + + /* check alignment */ + if (address & 0x3u) + return ERROR_TARGET_UNALIGNED_ACCESS; + + /* Get memory for block write handler */ + retval = target_alloc_working_area(target, MIPS32_FASTDATA_HANDLER_SIZE, &source); + if (retval != ERROR_OK) + { + LOG_WARNING("No working area available, falling back to non-bulk write"); + return mips_m4k_write_memory(target, address, 4, count, buffer); + } + + /* TAP data register is loaded LSB first (little endian) */ + if (target->endianness == TARGET_BIG_ENDIAN) + { + uint32_t i, t32; + for(i = 0; i < (count*4); i+=4) + { + t32 = be_to_h_u32((uint8_t *) &buffer[i]); + h_u32_to_le(&buffer[i], t32); + } + } + + retval = mips32_pracc_fastdata_xfer(ejtag_info, source, write, address, count, (uint32_t *) buffer); + + if (source) + target_free_working_area(target, source); + + return retval; } int mips_m4k_checksum_memory(struct target *target, uint32_t address, uint32_t size, uint32_t *checksum) ----------------------------------------------------------------------- Summary of changes: src/jtag/drivers/parport.c | 2 +- src/target/mips32.c | 1 - src/target/mips32.h | 2 + src/target/mips32_pracc.c | 268 +++++++++++++++++++++++++++++++------------- src/target/mips32_pracc.h | 9 +- src/target/mips_ejtag.c | 53 +++++++-- src/target/mips_ejtag.h | 1 + src/target/mips_m4k.c | 47 ++++++++- tcl/target/pic32mx.cfg | 18 +++- 9 files changed, 305 insertions(+), 96 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: Øyvind H. <go...@us...> - 2010-01-05 20:25:22
|
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 95f86e8e0525fc93093cc2bc060df5017d2f504e (commit) from 6d4abe906fe4b3f3a70f8ccfa356f8c0ebbfabad (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 95f86e8e0525fc93093cc2bc060df5017d2f504e Author: Ãyvind Harboe <oyv...@zy...> Date: Tue Jan 5 14:57:45 2010 +0100 gdb: fix regression in gdb_port command The gdb_port command can be invoked during normal execution to report the port used for gdb, whereas it was listed as CONFIG stage only, which caused an error when excuting it to return the reported error. Also in line with the grander goal of making more commands available during all "modes" (perhaps retiring config mode), there is no particular reason to limit gdb_port to the config stage. Regression was introduced in: b3bf1d12b2fdfba1c1cbee3e1afbfbb27cbd1a26 aka v0.4.0-rc1-32-gb3bf1d1 Signed-off-by: Ãyvind Harboe <oyv...@zy...> diff --git a/src/server/gdb_server.c b/src/server/gdb_server.c index d5d7042..96b9dbf 100644 --- a/src/server/gdb_server.c +++ b/src/server/gdb_server.c @@ -2421,8 +2421,9 @@ static const struct command_registration gdb_command_handlers[] = { { .name = "gdb_port", .handler = &handle_gdb_port_command, - .mode = COMMAND_CONFIG, - .help = "daemon configuration command gdb_port", + .mode = COMMAND_ANY, + .help = "daemon configuration command gdb_port. No arguments reports " + "GDB port.", .usage = "<port>", }, { ----------------------------------------------------------------------- Summary of changes: src/server/gdb_server.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: David B. <dbr...@us...> - 2010-01-05 10:54:28
|
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 6d4abe906fe4b3f3a70f8ccfa356f8c0ebbfabad (commit) via 1b3f15d51ee3388e18edb06201f5c6c8b75c3361 (commit) from 237a707f9653d7ca8a1ec550b497e9a8d0ce0311 (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 6d4abe906fe4b3f3a70f8ccfa356f8c0ebbfabad Author: Johannes Stezenbach <js...@si...> Date: Mon Jan 4 16:08:10 2010 +0100 update udev rules for new udev version New versions of udev (148+) emit the following warnings: udevd[425]: BUS= will be removed in a future udev version, please use SUBSYSTEM= to match the event device, or SUBSYSTEMS= to match a parent device, in /lib/udev/rules.d/60-openocd.rules:1 udevd[425]: SYSFS{}= will be removed in a future udev version, please use ATTR{}= to match the event device, or ATTRS{}= to match a parent device, in /lib/udev/rules.d/60-openocd.rules:4 udevd[425]: SYSFS{}= will be removed in a future udev version, please use ATTR{}= to match the event device, or ATTRS{}= to match a parent device, in /lib/udev/rules.d/60-openocd.rules:7 ... See also http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=560141 [dbr...@us...: add IDs for Stellaris ICDI, Olimex Tiny-H] Signed-off-by: David Brownell <dbr...@us...> diff --git a/contrib/openocd.udev b/contrib/openocd.udev index c878975..bcec6af 100644 --- a/contrib/openocd.udev +++ b/contrib/openocd.udev @@ -1,60 +1,68 @@ -BUS!="usb", ACTION!="add", SUBSYSTEM!=="usb_device", GOTO="openocd_rules_end" +ACTION!="add|change", GOTO="openocd_rules_end" +SUBSYSTEM!="usb", GOTO="openocd_rules_end" +ENV{DEVTYPE}!="usb_device", GOTO="openocd_rules_end" # Olimex ARM-USB-OCD -SYSFS{idVendor}=="15ba", SYSFS{idProduct}=="0003", MODE="664", GROUP="plugdev" +ATTRS{idVendor}=="15ba", ATTRS{idProduct}=="0003", MODE="664", GROUP="plugdev" # Olimex ARM-USB-OCD-TINY -SYSFS{idVendor}=="15ba", SYSFS{idProduct}=="0004", MODE="664", GROUP="plugdev" +ATTRS{idVendor}=="15ba", ATTRS{idProduct}=="0004", MODE="664", GROUP="plugdev" # Olimex ARM-JTAG-EW -SYSFS{idVendor}=="15ba", SYSFS{idProduct}=="001e", MODE="664", GROUP="plugdev" +ATTRS{idVendor}=="15ba", ATTRS{idProduct}=="001e", MODE="664", GROUP="plugdev" + +# Olimex ARM-USB-OCD-TINY-H +ATTRS{idVendor}=="15ba", ATTRS{idProduct}=="002a", MODE="664", GROUP="plugdev" # USBprog with OpenOCD firmware -SYSFS{idVendor}=="1781", SYSFS{idProduct}=="0c63", MODE="664", GROUP="plugdev" +ATTRS{idVendor}=="1781", ATTRS{idProduct}=="0c63", MODE="664", GROUP="plugdev" # Amontec JTAGkey and JTAGkey-tiny -SYSFS{idVendor}=="0403", SYSFS{idProduct}=="cff8", MODE="664", GROUP="plugdev" +ATTRS{idVendor}=="0403", ATTRS{idProduct}=="cff8", MODE="664", GROUP="plugdev" # Amontec JTAGkey-HiSpeed -SYSFS{idVendor}=="0fbb", SYSFS{idProduct}=="1000", MODE="664", GROUP="plugdev" +ATTRS{idVendor}=="0fbb", ATTRS{idProduct}=="1000", MODE="664", GROUP="plugdev" # Axiom AXM-0432 Link (Symphony SoundBite?) # Calao Systems USB-A9260-C01 # TinCanTools Flyswatter # OOCD-Link # Marvell Sheevaplug (early development versions) -SYSFS{idVendor}=="0403", SYSFS{idProduct}=="6010", MODE="664", GROUP="plugdev" +ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6010", MODE="664", GROUP="plugdev" # Calao Systems USB-A9260-C02 -SYSFS{idVendor}=="0403", SYSFS{idProduct}=="6001", MODE="664", GROUP="plugdev" +ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", MODE="664", GROUP="plugdev" # IAR J-Link USB -SYSFS{idVendor}=="1366", SYSFS{idProduct}=="0101", MODE="664", GROUP="plugdev" +ATTRS{idVendor}=="1366", ATTRS{idProduct}=="0101", MODE="664", GROUP="plugdev" # Raisonance RLink -SYSFS{idVendor}=="138e", SYSFS{idProduct}=="9000", MODE="664", GROUP="plugdev" +ATTRS{idVendor}=="138e", ATTRS{idProduct}=="9000", MODE="664", GROUP="plugdev" # Hitex STR9-comStick -SYSFS{idVendor}=="0640", SYSFS{idProduct}=="002c", MODE="664", GROUP="plugdev" +ATTRS{idVendor}=="0640", ATTRS{idProduct}=="002c", MODE="664", GROUP="plugdev" # Hitex STM32-PerformanceStick -SYSFS{idVendor}=="0640", SYSFS{idProduct}=="002d", MODE="664", GROUP="plugdev" +ATTRS{idVendor}=="0640", ATTRS{idProduct}=="002d", MODE="664", GROUP="plugdev" + +# TI/Luminary Stellaris Evaluation Board (several) +ATTRS{idVendor}=="0403", ATTRS{idProduct}=="bcd9", MODE="664", GROUP="plugdev" -# Luminary Micro Stellaris/LM3S811 -SYSFS{idVendor}=="0403", SYSFS{idProduct}=="bcd9", MODE="664", GROUP="plugdev" +# TI/Luminary Stellaris In-Circuit Debug Interface (ICDI) Board +ATTRS{idVendor}=="0403", ATTRS{idProduct}=="bcda", MODE="664", GROUP="plugdev" # Xverve Signalyzer Tool (DT-USB-ST) -SYSFS{idVendor}=="0403", SYSFS{idProduct}=="bca0", MODE="664", GROUP="plugdev" +ATTRS{idVendor}=="0403", ATTRS{idProduct}=="bca0", MODE="664", GROUP="plugdev" # egnite Turtelizer 2 -SYSFS{idVendor}=="0403", SYSFS{idProduct}=="bdc8", MODE="664", GROUP="plugdev" +ATTRS{idVendor}=="0403", ATTRS{idProduct}=="bdc8", MODE="664", GROUP="plugdev" # Marvell Sheevaplug -SYSFS{idVendor}=="9e88", SYSFS{idProduct}=="9e8f", MODE="664", GROUP="plugdev" +ATTRS{idVendor}=="9e88", ATTRS{idProduct}=="9e8f", MODE="664", GROUP="plugdev" # Section5 ICEbear -SYSFS{idVendor}=="0403", SYSFS{idProduct}=="c140", MODE="664", GROUP="plugdev" -SYSFS{idVendor}=="0403", SYSFS{idProduct}=="c141", MODE="664", GROUP="plugdev" +ATTRS{idVendor}=="0403", ATTRS{idProduct}=="c140", MODE="664", GROUP="plugdev" +ATTRS{idVendor}=="0403", ATTRS{idProduct}=="c141", MODE="664", GROUP="plugdev" LABEL="openocd_rules_end" commit 1b3f15d51ee3388e18edb06201f5c6c8b75c3361 Author: David Brownell <dbr...@us...> Date: Mon Jan 4 22:11:34 2010 -0800 ARMv7-M: use AP_REG_* symbol Signed-off-by: David Brownell <dbr...@us...> diff --git a/src/target/armv7m.c b/src/target/armv7m.c index d0f58de..9d8132d 100644 --- a/src/target/armv7m.c +++ b/src/target/armv7m.c @@ -731,7 +731,12 @@ COMMAND_HANDLER(handle_dap_baseaddr_command) if (apselsave != apsel) dap_ap_select(swjdp, apsel); - dap_ap_read_reg_u32(swjdp, 0xF8, &baseaddr); + /* NOTE: assumes we're talking to a MEM-AP, which + * has a base address. There are other kinds of AP, + * though they're not common for now. This should + * use the ID register to verify it's a MEM-AP. + */ + dap_ap_read_reg_u32(swjdp, AP_REG_BASE, &baseaddr); retval = swjdp_transaction_endcheck(swjdp); command_print(CMD_CTX, "0x%8.8" PRIx32 "", baseaddr); ----------------------------------------------------------------------- Summary of changes: contrib/openocd.udev | 48 ++++++++++++++++++++++++++++-------------------- src/target/armv7m.c | 7 ++++++- 2 files changed, 34 insertions(+), 21 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: David B. <dbr...@us...> - 2010-01-04 00:15:25
|
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 237a707f9653d7ca8a1ec550b497e9a8d0ce0311 (commit) via e1258c703bf9e6a0868f4d9e939c4be77567c53e (commit) via 50fb3a512931586cc689ac8c36fb3b6832dc0c5a (commit) from 4aedb02fcd4a16d77caeab8f6a3cf505ce9a93bf (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 237a707f9653d7ca8a1ec550b497e9a8d0ce0311 Author: David Brownell <dbr...@us...> Date: Sun Jan 3 15:02:51 2010 -0800 FT2232: fix doc typo Signed-off-by: David Brownell <dbr...@us...> diff --git a/src/jtag/drivers/ft2232.c b/src/jtag/drivers/ft2232.c index e9eba54..82132d3 100644 --- a/src/jtag/drivers/ft2232.c +++ b/src/jtag/drivers/ft2232.c @@ -33,7 +33,7 @@ * popular low cost JTAG debug solutions. Many FT2232 based JTAG adapters * are discrete, but development boards may integrate them as alternatives * to more capable (and expensive) third party JTAG pods. Since JTAG uses - * only one of the two parts on these devices, on integrated boards the + * only one of the two ports on these devices, on integrated boards the * second port often serves as a USB-to-serial adapter for the target's * console UART even when the JTAG port is not in use. (Systems which * support ARM's SWD in addition to JTAG, or instead of it, may use that commit e1258c703bf9e6a0868f4d9e939c4be77567c53e Author: David Brownell <dbr...@us...> Date: Sun Jan 3 14:54:52 2010 -0800 JTAG/drivers: ft2232 docs Add doxyegen description for this driver. Correct the helptext (configures *or* displays based on #params), and usage (use the same BNF as the User's Guide). Remove superfluous #include Signed-off-by: David Brownell <dbr...@us...> diff --git a/src/jtag/drivers/ft2232.c b/src/jtag/drivers/ft2232.c index a3ac142..e9eba54 100644 --- a/src/jtag/drivers/ft2232.c +++ b/src/jtag/drivers/ft2232.c @@ -27,13 +27,40 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -/* This code uses information contained in the MPSSE specification which was +/** + * @file + * JTAG adapters based on the FT2232 full and high speed USB parts are + * popular low cost JTAG debug solutions. Many FT2232 based JTAG adapters + * are discrete, but development boards may integrate them as alternatives + * to more capable (and expensive) third party JTAG pods. Since JTAG uses + * only one of the two parts on these devices, on integrated boards the + * second port often serves as a USB-to-serial adapter for the target's + * console UART even when the JTAG port is not in use. (Systems which + * support ARM's SWD in addition to JTAG, or instead of it, may use that + * second port for reading SWV trace data.) + * + * FT2232 based JTAG adapters are "dumb" not "smart", because most JTAG + * request/response interactions involve round trips over the USB link. + * A "smart" JTAG adapter has intelligence close to the scan chain, so it + * can for example poll quickly for a status change (usually taking on the + * order of microseconds not milliseconds) before beginning a queued + * transaction which require the previous one to have completed. + * + * There are dozens of adapters of this type, differing in details which + * this driver needs to understand. Those "layout" details are required + * as part of FT2232 driver configuration. + * + * This code uses information contained in the MPSSE specification which was * found here: * http://www.ftdichip.com/Documents/AppNotes/AN2232C-01_MPSSE_Cmnd.pdf * Hereafter this is called the "MPSSE Spec". * * The datasheet for the ftdichip.com's FT2232D part is here: * http://www.ftdichip.com/Documents/DataSheets/DS_FT2232D.pdf + * + * Also note the issue with code 0x4b (clock data to TMS) noted in + * http://developer.intra2net.com/mailarchive/html/libftdi/2009/msg00292.html + * which can affect longer JTAG state paths. */ #ifdef HAVE_CONFIG_H @@ -42,7 +69,6 @@ /* project specific includes */ #include <jtag/interface.h> -#include <jtag/commands.h> #include <helper/time_support.h> #if IS_CYGWIN == 1 @@ -3983,14 +4009,14 @@ static const struct command_registration ft2232_command_handlers[] = { .handler = &ft2232_handle_device_desc_command, .mode = COMMAND_CONFIG, .help = "set the USB device description of the FTDI FT2232 device", - .usage = "<description>", + .usage = "description_string", }, { .name = "ft2232_serial", .handler = &ft2232_handle_serial_command, .mode = COMMAND_CONFIG, .help = "set the serial number of the FTDI FT2232 device", - .usage = "<serial#>", + .usage = "serial_string", }, { .name = "ft2232_layout", @@ -3998,21 +4024,21 @@ static const struct command_registration ft2232_command_handlers[] = { .mode = COMMAND_CONFIG, .help = "set the layout of the FT2232 GPIO signals used " "to control output-enables and reset signals", - .usage = "<layout>", + .usage = "layout_name", }, { .name = "ft2232_vid_pid", .handler = &ft2232_handle_vid_pid_command, .mode = COMMAND_CONFIG, .help = "the vendor ID and product ID of the FTDI FT2232 device", - .usage = "<vid> <pid> [...]", + .usage = "(vid pid)* ", }, { .name = "ft2232_latency", .handler = &ft2232_handle_latency_command, .mode = COMMAND_CONFIG, .help = "set the FT2232 latency timer to a new value", - .usage = "<vid> <pid> [...]", + .usage = "value", }, COMMAND_REGISTRATION_DONE }; commit 50fb3a512931586cc689ac8c36fb3b6832dc0c5a Author: David Brownell <dbr...@us...> Date: Sun Jan 3 14:51:01 2010 -0800 JTAG/Drivers: Amontec JTAG accelerator fixes Remove superfluous #include. Correct the helptext (configures *or* displays based on #params), and usage (use the same BNF as the User's Guide). Add doxygen -- file-level description and a @todo for doing RTCK correctly. Signed-off-by: David Brownell <dbr...@us...> diff --git a/src/jtag/drivers/amt_jtagaccel.c b/src/jtag/drivers/amt_jtagaccel.c index 974761e..121649b 100644 --- a/src/jtag/drivers/amt_jtagaccel.c +++ b/src/jtag/drivers/amt_jtagaccel.c @@ -22,8 +22,6 @@ #endif #include <jtag/interface.h> -#include <jtag/commands.h> - #if PARPORT_USE_PPDEV == 1 #include <linux/parport.h> @@ -41,6 +39,15 @@ #endif #endif +/** + * @file + * Support the Amontec Chameleon POD with JTAG Accelerator support. + * This is a parallel port JTAG adapter with a CPLD between the + * parallel port and the JTAG connection. VHDL code running in the + * CPLD significantly accelerates JTAG operations compared to the + * bitbanging "Wiggler" style of most parallel port adapters. + */ + /* configuration */ static uint16_t amt_jtagaccel_port; @@ -573,15 +580,21 @@ static const struct command_registration amtjtagaccel_command_handlers[] = { .name = "parport_port", .handler = &amt_jtagaccel_handle_parport_port_command, .mode = COMMAND_CONFIG, - .help = "configure the parallel port to use", - .usage = "<port_num>", + .help = "configure or display the parallel port to use", + .usage = "[port_num]", }, { + /** + * @todo Remove this "rtck" command; just use the standard + * mechanism to enable/disable adaptive clocking. First + * implement the standard mechanism and deprecate "rtck"; + * after a year or so, it'll be safe to remove this. + */ .name = "rtck", .handler = &amt_jtagaccel_handle_rtck_command, .mode = COMMAND_CONFIG, - .help = "enable RTCK", - .usage = "<enable|disable>", + .help = "configure or display RTCK support", + .usage = "[enable|disable]", }, COMMAND_REGISTRATION_DONE }; ----------------------------------------------------------------------- Summary of changes: src/jtag/drivers/amt_jtagaccel.c | 25 ++++++++++++++++++----- src/jtag/drivers/ft2232.c | 40 +++++++++++++++++++++++++++++++------ 2 files changed, 52 insertions(+), 13 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: David B. <dbr...@us...> - 2010-01-03 22:33:16
|
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 4aedb02fcd4a16d77caeab8f6a3cf505ce9a93bf (commit) from e0338293b80211aee4254848ea56e0cf38bf3b9a (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 4aedb02fcd4a16d77caeab8f6a3cf505ce9a93bf Author: David Brownell <dbr...@us...> Date: Sun Jan 3 13:30:06 2010 -0800 JTAG: Amontec JTAG accelerater "rtck" is back The command processing conversion a while back lost the "rtck" enable/disable command; restore it. NOTE that having such a command is wrong; there's a standard way to enable adaptive clocking ("speed 0"). Signed-off-by: David Brownell <dbr...@us...> diff --git a/src/jtag/drivers/amt_jtagaccel.c b/src/jtag/drivers/amt_jtagaccel.c index de7cdcb..974761e 100644 --- a/src/jtag/drivers/amt_jtagaccel.c +++ b/src/jtag/drivers/amt_jtagaccel.c @@ -577,7 +577,7 @@ static const struct command_registration amtjtagaccel_command_handlers[] = { .usage = "<port_num>", }, { - .name = "parport_port", + .name = "rtck", .handler = &amt_jtagaccel_handle_rtck_command, .mode = COMMAND_CONFIG, .help = "enable RTCK", ----------------------------------------------------------------------- Summary of changes: src/jtag/drivers/amt_jtagaccel.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: David B. <dbr...@us...> - 2010-01-03 22:10:49
|
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 e0338293b80211aee4254848ea56e0cf38bf3b9a (commit) via d9508b30e096b5cc44a4fdbf2d6b99ca173a43f1 (commit) from 4ed5b45097cb2c13f9ef0682848c4682b5fd7240 (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 e0338293b80211aee4254848ea56e0cf38bf3b9a Author: David Brownell <dbr...@us...> Date: Sun Jan 3 13:07:18 2010 -0800 JTAG/drivers: cleanup jtag_interface structs Get rid of excess indents. Ditto superfluous "&" before function pointers. Signed-off-by: David Brownell <dbr...@us...> diff --git a/src/jtag/drivers/arm-jtag-ew.c b/src/jtag/drivers/arm-jtag-ew.c index 6221011..e54c8c6 100644 --- a/src/jtag/drivers/arm-jtag-ew.c +++ b/src/jtag/drivers/arm-jtag-ew.c @@ -513,17 +513,15 @@ static const struct command_registration armjtagew_command_handlers[] = { }; struct jtag_interface armjtagew_interface = { - .name = "arm-jtag-ew", - - .commands = armjtagew_command_handlers, - - .execute_queue = &armjtagew_execute_queue, - .speed = &armjtagew_speed, - .khz = &armjtagew_khz, - - .init = &armjtagew_init, - .quit = &armjtagew_quit, - }; + .name = "arm-jtag-ew", + .commands = armjtagew_command_handlers, + + .execute_queue = armjtagew_execute_queue, + .speed = armjtagew_speed, + .khz = armjtagew_khz, + .init = armjtagew_init, + .quit = armjtagew_quit, +}; /***************************************************************************/ /* ARM-JTAG-EW tap functions */ diff --git a/src/jtag/drivers/ft2232.c b/src/jtag/drivers/ft2232.c index 06fc252..a3ac142 100644 --- a/src/jtag/drivers/ft2232.c +++ b/src/jtag/drivers/ft2232.c @@ -4018,12 +4018,13 @@ static const struct command_registration ft2232_command_handlers[] = { }; struct jtag_interface ft2232_interface = { - .name = "ft2232", - .commands = ft2232_command_handlers, - .init = &ft2232_init, - .quit = &ft2232_quit, - .speed = &ft2232_speed, - .speed_div = &ft2232_speed_div, - .khz = &ft2232_khz, - .execute_queue = &ft2232_execute_queue, - }; + .name = "ft2232", + .commands = ft2232_command_handlers, + + .init = ft2232_init, + .quit = ft2232_quit, + .speed = ft2232_speed, + .speed_div = ft2232_speed_div, + .khz = ft2232_khz, + .execute_queue = ft2232_execute_queue, +}; diff --git a/src/jtag/drivers/gw16012.c b/src/jtag/drivers/gw16012.c index 9083e92..38e5dd7 100644 --- a/src/jtag/drivers/gw16012.c +++ b/src/jtag/drivers/gw16012.c @@ -574,10 +574,11 @@ static const struct command_registration gw16012_command_handlers[] = { }; struct jtag_interface gw16012_interface = { - .name = "gw16012", - .commands = gw16012_command_handlers, - .init = &gw16012_init, - .quit = &gw16012_quit, - .speed = &gw16012_speed, - .execute_queue = &gw16012_execute_queue, - }; + .name = "gw16012", + .commands = gw16012_command_handlers, + + .init = gw16012_init, + .quit = gw16012_quit, + .speed = gw16012_speed, + .execute_queue = gw16012_execute_queue, +}; diff --git a/src/jtag/drivers/jlink.c b/src/jtag/drivers/jlink.c index 4ca4349..6596849 100644 --- a/src/jtag/drivers/jlink.c +++ b/src/jtag/drivers/jlink.c @@ -645,18 +645,16 @@ static const struct command_registration jlink_command_handlers[] = { }; struct jtag_interface jlink_interface = { - .name = "jlink", - - .commands = jlink_command_handlers, - - .execute_queue = &jlink_execute_queue, - .speed = &jlink_speed, - .speed_div = &jlink_speed_div, - .khz = &jlink_khz, - - .init = &jlink_init, - .quit = &jlink_quit, - }; + .name = "jlink", + .commands = jlink_command_handlers, + + .execute_queue = jlink_execute_queue, + .speed = jlink_speed, + .speed_div = jlink_speed_div, + .khz = jlink_khz, + .init = jlink_init, + .quit = jlink_quit, +}; /***************************************************************************/ /* J-Link tap functions */ diff --git a/src/jtag/drivers/parport.c b/src/jtag/drivers/parport.c index 04ac272..2e6b9ed 100644 --- a/src/jtag/drivers/parport.c +++ b/src/jtag/drivers/parport.c @@ -517,16 +517,13 @@ static const struct command_registration parport_command_handlers[] = { }; struct jtag_interface parport_interface = { - .name = "parport", - - .commands = parport_command_handlers, - - .init = &parport_init, - .quit = &parport_quit, - - .khz = &parport_khz, - .speed_div = &parport_speed_div, - .speed = &parport_speed, - - .execute_queue = &bitbang_execute_queue, - }; + .name = "parport", + .commands = parport_command_handlers, + + .init = parport_init, + .quit = parport_quit, + .khz = parport_khz, + .speed_div = parport_speed_div, + .speed = parport_speed, + .execute_queue = bitbang_execute_queue, +}; diff --git a/src/jtag/drivers/presto.c b/src/jtag/drivers/presto.c index fac5e82..0baf561 100644 --- a/src/jtag/drivers/presto.c +++ b/src/jtag/drivers/presto.c @@ -786,15 +786,13 @@ static int presto_jtag_quit(void) } struct jtag_interface presto_interface = { - .name = "presto", - - .commands = presto_command_handlers, - - .execute_queue = &bitq_execute_queue, - .speed = &presto_jtag_speed, - .khz = &presto_jtag_khz, - .speed_div = &presto_jtag_speed_div, - - .init = &presto_jtag_init, - .quit = &presto_jtag_quit, - }; + .name = "presto", + .commands = presto_command_handlers, + + .execute_queue = bitq_execute_queue, + .speed = presto_jtag_speed, + .khz = presto_jtag_khz, + .speed_div = presto_jtag_speed_div, + .init = presto_jtag_init, + .quit = presto_jtag_quit, +}; diff --git a/src/jtag/drivers/usbprog.c b/src/jtag/drivers/usbprog.c index f6d8a97..0d51b27 100644 --- a/src/jtag/drivers/usbprog.c +++ b/src/jtag/drivers/usbprog.c @@ -652,9 +652,10 @@ static void usbprog_jtag_tms_send(struct usbprog_jtag *usbprog_jtag) } struct jtag_interface usbprog_interface = { - .name = "usbprog", - .execute_queue = &usbprog_execute_queue, - .speed = &usbprog_speed, - .init = &usbprog_init, - .quit = &usbprog_quit - }; + .name = "usbprog", + + .execute_queue = usbprog_execute_queue, + .speed = usbprog_speed, + .init = usbprog_init, + .quit = usbprog_quit +}; diff --git a/src/jtag/drivers/vsllink.c b/src/jtag/drivers/vsllink.c index bbbb5f9..d301290 100644 --- a/src/jtag/drivers/vsllink.c +++ b/src/jtag/drivers/vsllink.c @@ -1891,13 +1891,13 @@ static const struct command_registration vsllink_command_handlers[] = { }; struct jtag_interface vsllink_interface = { - .name = "vsllink", - .commands = vsllink_command_handlers, - - .init = &vsllink_init, - .quit = &vsllink_quit, - .khz = &vsllink_khz, - .speed = &vsllink_speed, - .speed_div = &vsllink_speed_div, - .execute_queue = &vsllink_execute_queue, - }; + .name = "vsllink", + .commands = vsllink_command_handlers, + + .init = vsllink_init, + .quit = vsllink_quit, + .khz = vsllink_khz, + .speed = vsllink_speed, + .speed_div = vsllink_speed_div, + .execute_queue = vsllink_execute_queue, +}; commit d9508b30e096b5cc44a4fdbf2d6b99ca173a43f1 Author: David Brownell <dbr...@us...> Date: Sun Jan 3 12:59:51 2010 -0800 JTAG/drivers: amt_jtagaccel fixes + cleanup Build fixes: it failed abysmally with PPDEV enabled. Swapped a build-time error with a FIXME comment in the affected macros. Cleanup: remove "&" before function pointers, and excess indent, for the interface struct declaration. Signed-off-by: David Brownell <dbr...@us...> diff --git a/src/jtag/drivers/amt_jtagaccel.c b/src/jtag/drivers/amt_jtagaccel.c index 8ba1583..de7cdcb 100644 --- a/src/jtag/drivers/amt_jtagaccel.c +++ b/src/jtag/drivers/amt_jtagaccel.c @@ -55,13 +55,41 @@ static int rtck_enabled = 0; #if PARPORT_USE_PPDEV == 1 static int device_handle; -static int addr_mode = IEEE1284_MODE_EPP | IEEE1284_ADDR ; -#define AMT_AW(val) do { ioctl(device_handle, PPSETMODE, &addr_mode); write(device_handle, &val, 1); } while (0) -#define AMT_AR(val) do { ioctl(device_handle, PPSETMODE, &addr_mode); read(device_handle, &val, 1); } while (0) - -static int data_mode = IEEE1284_MODE_EPP | IEEE1284_DATA ; -#define AMT_DW(val) do { ioctl(device_handle, PPSETMODE, &data_mode); write(device_handle, &val, 1); } while (0) -#define AMT_DR(val) do { ioctl(device_handle, PPSETMODE, &data_mode); read(device_handle, &val, 1); } while (0) +static const int addr_mode = IEEE1284_MODE_EPP | IEEE1284_ADDR; + +/* FIXME do something sane when these ioctl/read/write calls fail. */ + +#define AMT_AW(val) \ + do { \ + int __retval; \ + \ + __retval = ioctl(device_handle, PPSETMODE, &addr_mode); \ + __retval = write(device_handle, &val, 1); \ + } while (0) +#define AMT_AR(val) \ + do { \ + int __retval; \ + \ + __retval = ioctl(device_handle, PPSETMODE, &addr_mode); \ + __retval = read(device_handle, &val, 1); \ + } while (0) + +static const int data_mode = IEEE1284_MODE_EPP | IEEE1284_DATA; + +#define AMT_DW(val) \ + do { \ + int __retval; \ + \ + __retval = ioctl(device_handle, PPSETMODE, &data_mode); \ + __retval = write(device_handle, &val, 1); \ + } while (0) +#define AMT_DR(val) \ + do { \ + int __retval; \ + \ + __retval = ioctl(device_handle, PPSETMODE, &data_mode); \ + __retval = read(device_handle, &val, 1); \ + } while (0) #else @@ -559,10 +587,11 @@ static const struct command_registration amtjtagaccel_command_handlers[] = { }; struct jtag_interface amt_jtagaccel_interface = { - .name = "amt_jtagaccel", - .commands = amtjtagaccel_command_handlers, - .init = &amt_jtagaccel_init, - .quit = &amt_jtagaccel_quit, - .speed = &amt_jtagaccel_speed, - .execute_queue = &amt_jtagaccel_execute_queue, - }; + .name = "amt_jtagaccel", + .commands = amtjtagaccel_command_handlers, + + .init = amt_jtagaccel_init, + .quit = amt_jtagaccel_quit, + .speed = amt_jtagaccel_speed, + .execute_queue = amt_jtagaccel_execute_queue, +}; ----------------------------------------------------------------------- Summary of changes: src/jtag/drivers/amt_jtagaccel.c | 57 ++++++++++++++++++++++++++++--------- src/jtag/drivers/arm-jtag-ew.c | 20 ++++++------- src/jtag/drivers/ft2232.c | 19 ++++++------ src/jtag/drivers/gw16012.c | 15 +++++---- src/jtag/drivers/jlink.c | 22 ++++++-------- src/jtag/drivers/parport.c | 23 ++++++-------- src/jtag/drivers/presto.c | 22 ++++++-------- src/jtag/drivers/usbprog.c | 13 ++++---- src/jtag/drivers/vsllink.c | 20 ++++++------ 9 files changed, 117 insertions(+), 94 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: David B. <dbr...@us...> - 2010-01-03 02:03:53
|
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 4ed5b45097cb2c13f9ef0682848c4682b5fd7240 (commit) via 858226aae27b262cb3cb8274c6c7459a0068cc8a (commit) via 6105f2bc4a65e1e42a0fb238096cbc0577b994c0 (commit) via e60c164cdb50a0aa268165e57de0a4cd0d58fcdf (commit) via ec88ccc51cb5d8594ae95660c826954f3a9042ec (commit) via b3bf1d12b2fdfba1c1cbee3e1afbfbb27cbd1a26 (commit) from 9d167d62f2eadf81e0028e471e05154c9aabbbfb (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 4ed5b45097cb2c13f9ef0682848c4682b5fd7240 Author: David Brownell <dbr...@us...> Date: Sat Jan 2 15:53:33 2010 -0800 ARM: ADIv5 JTAG symbol cleanup Rename DAP_IR_* as JTAG_DP_* since those symbols are specifically for JTAG-DP (or SWJ-DP in JTAG mode), and won't work with SWD. Define the JTAG ABORT and IDCODE instructions for completeness; add a comment about where to (someday) use ABORT. Fix messaging which assumes everything is an SWJ-DP; say "JTAG-DP" instead, it's at least more appropriate for all JTAG transports. Shrink the affected lines. Signed-off-by: David Brownell <dbr...@us...> diff --git a/src/target/arm_adi_v5.c b/src/target/arm_adi_v5.c index 72a07cd..82a2a28 100644 --- a/src/target/arm_adi_v5.c +++ b/src/target/arm_adi_v5.c @@ -101,7 +101,10 @@ static int adi_jtag_dp_scan(struct swjdp_common *swjdp, arm_jtag_set_instr(jtag_info, instr, NULL); /* Add specified number of tck clocks before accessing memory bus */ - if ((instr == DAP_IR_APACC) && ((reg_addr == AP_REG_DRW)||((reg_addr&0xF0) == AP_REG_BD0))&& (swjdp->memaccess_tck != 0)) + if ((instr == JTAG_DP_APACC) + && ((reg_addr == AP_REG_DRW) + || ((reg_addr & 0xF0) == AP_REG_BD0)) + && (swjdp->memaccess_tck != 0)) jtag_add_runtest(swjdp->memaccess_tck, jtag_set_end_state(TAP_IDLE)); fields[0].tap = jtag_info->tap; @@ -134,7 +137,10 @@ static int adi_jtag_dp_scan_u32(struct swjdp_common *swjdp, arm_jtag_set_instr(jtag_info, instr, NULL); /* Add specified number of tck clocks before accessing memory bus */ - if ((instr == DAP_IR_APACC) && ((reg_addr == AP_REG_DRW)||((reg_addr&0xF0) == AP_REG_BD0))&& (swjdp->memaccess_tck != 0)) + if ((instr == JTAG_DP_APACC) + && ((reg_addr == AP_REG_DRW) + || ((reg_addr & 0xF0) == AP_REG_BD0)) + && (swjdp->memaccess_tck != 0)) jtag_add_runtest(swjdp->memaccess_tck, jtag_set_end_state(TAP_IDLE)); fields[0].tap = jtag_info->tap; @@ -172,15 +178,15 @@ static int scan_inout_check(struct swjdp_common *swjdp, adi_jtag_dp_scan(swjdp, instr, reg_addr, RnW, outvalue, NULL, NULL); if ((RnW == DPAP_READ) && (invalue != NULL)) - { - adi_jtag_dp_scan(swjdp, DAP_IR_DPACC, DP_RDBUFF, DPAP_READ, 0, invalue, &swjdp->ack); - } + adi_jtag_dp_scan(swjdp, JTAG_DP_DPACC, + DP_RDBUFF, DPAP_READ, 0, invalue, &swjdp->ack); - /* In TRANS_MODE_ATOMIC all DAP_IR_APACC transactions wait for ack = OK/FAULT and the check CTRL_STAT */ - if ((instr == DAP_IR_APACC) && (swjdp->trans_mode == TRANS_MODE_ATOMIC)) - { + /* In TRANS_MODE_ATOMIC all JTAG_DP_APACC transactions wait for + * ack = OK/FAULT and the check CTRL_STAT + */ + if ((instr == JTAG_DP_APACC) + && (swjdp->trans_mode == TRANS_MODE_ATOMIC)) return swjdp_transaction_endcheck(swjdp); - } return ERROR_OK; } @@ -192,15 +198,15 @@ static int scan_inout_check_u32(struct swjdp_common *swjdp, adi_jtag_dp_scan_u32(swjdp, instr, reg_addr, RnW, outvalue, NULL, NULL); if ((RnW == DPAP_READ) && (invalue != NULL)) - { - adi_jtag_dp_scan_u32(swjdp, DAP_IR_DPACC, DP_RDBUFF, DPAP_READ, 0, invalue, &swjdp->ack); - } + adi_jtag_dp_scan_u32(swjdp, JTAG_DP_DPACC, + DP_RDBUFF, DPAP_READ, 0, invalue, &swjdp->ack); - /* In TRANS_MODE_ATOMIC all DAP_IR_APACC transactions wait for ack = OK/FAULT and then check CTRL_STAT */ - if ((instr == DAP_IR_APACC) && (swjdp->trans_mode == TRANS_MODE_ATOMIC)) - { + /* In TRANS_MODE_ATOMIC all JTAG_DP_APACC transactions wait for + * ack = OK/FAULT and then check CTRL_STAT + */ + if ((instr == JTAG_DP_APACC) + && (swjdp->trans_mode == TRANS_MODE_ATOMIC)) return swjdp_transaction_endcheck(swjdp); - } return ERROR_OK; } @@ -214,7 +220,8 @@ int swjdp_transaction_endcheck(struct swjdp_common *swjdp) #if 0 /* Danger!!!! BROKEN!!!! */ - scan_inout_check_u32(swjdp, DAP_IR_DPACC, DP_CTRL_STAT, DPAP_READ, 0, &ctrlstat); + scan_inout_check_u32(swjdp, JTAG_DP_DPACC, + DP_CTRL_STAT, DPAP_READ, 0, &ctrlstat); /* Danger!!!! BROKEN!!!! Why will jtag_execute_queue() fail here???? R956 introduced the check on return value here and now Michael Schwingen reports that this code no longer works.... @@ -228,7 +235,8 @@ int swjdp_transaction_endcheck(struct swjdp_common *swjdp) /* Why??? second time it works??? */ #endif - scan_inout_check_u32(swjdp, DAP_IR_DPACC, DP_CTRL_STAT, DPAP_READ, 0, &ctrlstat); + scan_inout_check_u32(swjdp, JTAG_DP_DPACC, + DP_CTRL_STAT, DPAP_READ, 0, &ctrlstat); if ((retval = jtag_execute_queue()) != ERROR_OK) return retval; @@ -243,17 +251,24 @@ int swjdp_transaction_endcheck(struct swjdp_common *swjdp) { if ((timeval_ms()-then) > 1000) { - LOG_WARNING("Timeout (1000ms) waiting for ACK = OK/FAULT in SWJDP transaction"); + /* NOTE: this would be a good spot + * to use JTAG_DP_ABORT. + */ + LOG_WARNING("Timeout (1000ms) waiting " + "for ACK=OK/FAULT " + "in JTAG-DP transaction"); return ERROR_JTAG_DEVICE_ERROR; } } else { - LOG_WARNING("Invalid ACK in SWJDP transaction"); + LOG_WARNING("Invalid ACK " + "in JTAG-DP transaction"); return ERROR_JTAG_DEVICE_ERROR; } - scan_inout_check_u32(swjdp, DAP_IR_DPACC, DP_CTRL_STAT, DPAP_READ, 0, &ctrlstat); + scan_inout_check_u32(swjdp, JTAG_DP_DPACC, + DP_CTRL_STAT, DPAP_READ, 0, &ctrlstat); if ((retval = jtag_execute_queue()) != ERROR_OK) return retval; swjdp->ack = swjdp->ack & 0x7; @@ -279,14 +294,19 @@ int swjdp_transaction_endcheck(struct swjdp_common *swjdp) /* Print information about last AHBAP access */ LOG_ERROR("AHBAP Cached values: dp_select 0x%" PRIx32 ", ap_csw 0x%" PRIx32 ", ap_tar 0x%" PRIx32 "", swjdp->dp_select_value, swjdp->ap_csw_value, swjdp->ap_tar_value); if (ctrlstat & SSTICKYORUN) - LOG_ERROR("SWJ-DP OVERRUN - check clock or reduce jtag speed"); + LOG_ERROR("JTAG-DP OVERRUN - " + "check clock or reduce jtag speed"); if (ctrlstat & SSTICKYERR) - LOG_ERROR("SWJ-DP STICKY ERROR"); + LOG_ERROR("JTAG-DP STICKY ERROR"); /* Clear Sticky Error Bits */ - scan_inout_check_u32(swjdp, DAP_IR_DPACC, DP_CTRL_STAT, DPAP_WRITE, swjdp->dp_ctrl_stat | SSTICKYORUN | SSTICKYERR, NULL); - scan_inout_check_u32(swjdp, DAP_IR_DPACC, DP_CTRL_STAT, DPAP_READ, 0, &ctrlstat); + scan_inout_check_u32(swjdp, JTAG_DP_DPACC, + DP_CTRL_STAT, DPAP_WRITE, + swjdp->dp_ctrl_stat | SSTICKYORUN + | SSTICKYERR, NULL); + scan_inout_check_u32(swjdp, JTAG_DP_DPACC, + DP_CTRL_STAT, DPAP_READ, 0, &ctrlstat); if ((retval = jtag_execute_queue()) != ERROR_OK) return retval; @@ -316,13 +336,15 @@ int swjdp_transaction_endcheck(struct swjdp_common *swjdp) static int dap_dp_write_reg(struct swjdp_common *swjdp, uint32_t value, uint8_t reg_addr) { - return scan_inout_check_u32(swjdp, DAP_IR_DPACC, reg_addr, DPAP_WRITE, value, NULL); + return scan_inout_check_u32(swjdp, JTAG_DP_DPACC, + reg_addr, DPAP_WRITE, value, NULL); } static int dap_dp_read_reg(struct swjdp_common *swjdp, uint32_t *value, uint8_t reg_addr) { - return scan_inout_check_u32(swjdp, DAP_IR_DPACC, reg_addr, DPAP_READ, 0, value); + return scan_inout_check_u32(swjdp, JTAG_DP_DPACC, + reg_addr, DPAP_READ, 0, value); } int dap_ap_select(struct swjdp_common *swjdp,uint8_t apsel) @@ -360,7 +382,8 @@ static int dap_ap_write_reg(struct swjdp_common *swjdp, uint32_t reg_addr, uint8_t *out_value_buf) { dap_dp_bankselect(swjdp, reg_addr); - scan_inout_check(swjdp, DAP_IR_APACC, reg_addr, DPAP_WRITE, out_value_buf, NULL); + scan_inout_check(swjdp, JTAG_DP_APACC, reg_addr, + DPAP_WRITE, out_value_buf, NULL); return ERROR_OK; } @@ -371,7 +394,8 @@ int dap_ap_write_reg_u32(struct swjdp_common *swjdp, uint32_t reg_addr, uint32_t buf_set_u32(out_value_buf, 0, 32, value); dap_dp_bankselect(swjdp, reg_addr); - scan_inout_check(swjdp, DAP_IR_APACC, reg_addr, DPAP_WRITE, out_value_buf, NULL); + scan_inout_check(swjdp, JTAG_DP_APACC, reg_addr, + DPAP_WRITE, out_value_buf, NULL); return ERROR_OK; } @@ -379,7 +403,8 @@ int dap_ap_write_reg_u32(struct swjdp_common *swjdp, uint32_t reg_addr, uint32_t int dap_ap_read_reg_u32(struct swjdp_common *swjdp, uint32_t reg_addr, uint32_t *value) { dap_dp_bankselect(swjdp, reg_addr); - scan_inout_check_u32(swjdp, DAP_IR_APACC, reg_addr, DPAP_READ, 0, value); + scan_inout_check_u32(swjdp, JTAG_DP_APACC, reg_addr, + DPAP_READ, 0, value); return ERROR_OK; } @@ -758,15 +783,20 @@ int mem_ap_read_buf_u32(struct swjdp_common *swjdp, uint8_t *buffer, int count, dap_setup_accessport(swjdp, CSW_32BIT | CSW_ADDRINC_SINGLE, address); /* Scan out first read */ - adi_jtag_dp_scan(swjdp, DAP_IR_APACC, AP_REG_DRW, DPAP_READ, 0, NULL, NULL); + adi_jtag_dp_scan(swjdp, JTAG_DP_APACC, AP_REG_DRW, + DPAP_READ, 0, NULL, NULL); for (readcount = 0; readcount < blocksize - 1; readcount++) { /* Scan out read instruction and scan in previous value */ - adi_jtag_dp_scan(swjdp, DAP_IR_APACC, AP_REG_DRW, DPAP_READ, 0, buffer + 4 * readcount, &swjdp->ack); + adi_jtag_dp_scan(swjdp, JTAG_DP_APACC, AP_REG_DRW, + DPAP_READ, 0, buffer + 4 * readcount, + &swjdp->ack); } /* Scan in last value */ - adi_jtag_dp_scan(swjdp, DAP_IR_DPACC, DP_RDBUFF, DPAP_READ, 0, buffer + 4 * readcount, &swjdp->ack); + adi_jtag_dp_scan(swjdp, JTAG_DP_DPACC, DP_RDBUFF, + DPAP_READ, 0, buffer + 4 * readcount, + &swjdp->ack); if (swjdp_transaction_endcheck(swjdp) == ERROR_OK) { wcount = wcount - blocksize; diff --git a/src/target/arm_adi_v5.h b/src/target/arm_adi_v5.h index bfa5105..4e1b1aa 100644 --- a/src/target/arm_adi_v5.h +++ b/src/target/arm_adi_v5.h @@ -32,8 +32,11 @@ #include "arm_jtag.h" -#define DAP_IR_DPACC 0xA -#define DAP_IR_APACC 0xB +/* JTAG instructions/registers for JTAG-DP and SWJ-DP */ +#define JTAG_DP_ABORT 0x8 +#define JTAG_DP_DPACC 0xA +#define JTAG_DP_APACC 0xB +#define JTAG_DP_IDCODE 0xE #define DPAP_WRITE 0 #define DPAP_READ 1 commit 858226aae27b262cb3cb8274c6c7459a0068cc8a Author: David Brownell <dbr...@us...> Date: Sat Jan 2 15:53:18 2010 -0800 ARM: dap info fix + tweaks Fix: don't print the BASE address except if it's a MEM-AP; that's an unlikely error, but there's no point getting it wrong. Tweaks: comments, capitalization. Signed-off-by: David Brownell <dbr...@us...> diff --git a/src/target/arm_adi_v5.c b/src/target/arm_adi_v5.c index 19154ce..72a07cd 100644 --- a/src/target/arm_adi_v5.c +++ b/src/target/arm_adi_v5.c @@ -1075,7 +1075,7 @@ is_dap_cid_ok(uint32_t cid3, uint32_t cid2, uint32_t cid1, uint32_t cid0) int dap_info_command(struct command_context *cmd_ctx, struct swjdp_common *swjdp, int apsel) { - uint32_t dbgbase,apid; + uint32_t dbgbase, apid; int romtable_present = 0; uint8_t mem_ap; uint32_t apselold; @@ -1087,25 +1087,31 @@ int dap_info_command(struct command_context *cmd_ctx, struct swjdp_common *swjdp swjdp_transaction_endcheck(swjdp); /* Now we read ROM table ID registers, ref. ARM IHI 0029B sec */ mem_ap = ((apid&0x10000) && ((apid&0x0F) != 0)); - command_print(cmd_ctx, "ap identification register 0x%8.8" PRIx32 "", apid); + command_print(cmd_ctx, "AP ID register 0x%8.8" PRIx32, apid); if (apid) { switch (apid&0x0F) { case 0: - command_print(cmd_ctx, "\tType is jtag-ap"); + command_print(cmd_ctx, "\tType is JTAG-AP"); break; case 1: - command_print(cmd_ctx, "\tType is mem-ap AHB"); + command_print(cmd_ctx, "\tType is MEM-AP AHB"); break; case 2: - command_print(cmd_ctx, "\tType is mem-ap APB"); + command_print(cmd_ctx, "\tType is MEM-AP APB"); break; default: - command_print(cmd_ctx, "\tUnknown AP-type"); - break; + command_print(cmd_ctx, "\tUnknown AP type"); + break; } - command_print(cmd_ctx, "ap debugbase 0x%8.8" PRIx32 "", dbgbase); + + /* NOTE: a MEM-AP may have a single CoreSight component that's + * not a ROM table ... or have no such components at all. + */ + if (mem_ap) + command_print(cmd_ctx, "AP BASE 0x%8.8" PRIx32, + dbgbase); } else { commit 6105f2bc4a65e1e42a0fb238096cbc0577b994c0 Author: David Brownell <dbr...@us...> Date: Sat Jan 2 15:53:06 2010 -0800 ARM: ADIv5 export cleanup Make some private functions "static". Remove their public declarations, and what is now an obviously unused function. Shrinks this object's size (about 5% on x86_64) while making the code's scope easier to understand. Shrink the affected lines. Signed-off-by: David Brownell <dbr...@us...> diff --git a/src/target/arm_adi_v5.c b/src/target/arm_adi_v5.c index 59f5638..19154ce 100644 --- a/src/target/arm_adi_v5.c +++ b/src/target/arm_adi_v5.c @@ -89,7 +89,9 @@ static uint32_t max_tar_block_size(uint32_t tar_autoincr_block, uint32_t address ***************************************************************************/ /* Scan out and in from target ordered uint8_t buffers */ -int adi_jtag_dp_scan(struct swjdp_common *swjdp, uint8_t instr, uint8_t reg_addr, uint8_t RnW, uint8_t *outvalue, uint8_t *invalue, uint8_t *ack) +static int adi_jtag_dp_scan(struct swjdp_common *swjdp, + uint8_t instr, uint8_t reg_addr, uint8_t RnW, + uint8_t *outvalue, uint8_t *invalue, uint8_t *ack) { struct arm_jtag *jtag_info = swjdp->jtag_info; struct scan_field fields[2]; @@ -119,7 +121,9 @@ int adi_jtag_dp_scan(struct swjdp_common *swjdp, uint8_t instr, uint8_t reg_addr } /* Scan out and in from host ordered uint32_t variables */ -int adi_jtag_dp_scan_u32(struct swjdp_common *swjdp, uint8_t instr, uint8_t reg_addr, uint8_t RnW, uint32_t outvalue, uint32_t *invalue, uint8_t *ack) +static int adi_jtag_dp_scan_u32(struct swjdp_common *swjdp, + uint8_t instr, uint8_t reg_addr, uint8_t RnW, + uint32_t outvalue, uint32_t *invalue, uint8_t *ack) { struct arm_jtag *jtag_info = swjdp->jtag_info; struct scan_field fields[2]; @@ -161,7 +165,9 @@ int adi_jtag_dp_scan_u32(struct swjdp_common *swjdp, uint8_t instr, uint8_t reg_ } /* scan_inout_check adds one extra inscan for DPAP_READ commands to read variables */ -int scan_inout_check(struct swjdp_common *swjdp, uint8_t instr, uint8_t reg_addr, uint8_t RnW, uint8_t *outvalue, uint8_t *invalue) +static int scan_inout_check(struct swjdp_common *swjdp, + uint8_t instr, uint8_t reg_addr, uint8_t RnW, + uint8_t *outvalue, uint8_t *invalue) { adi_jtag_dp_scan(swjdp, instr, reg_addr, RnW, outvalue, NULL, NULL); @@ -179,7 +185,9 @@ int scan_inout_check(struct swjdp_common *swjdp, uint8_t instr, uint8_t reg_addr return ERROR_OK; } -int scan_inout_check_u32(struct swjdp_common *swjdp, uint8_t instr, uint8_t reg_addr, uint8_t RnW, uint32_t outvalue, uint32_t *invalue) +static int scan_inout_check_u32(struct swjdp_common *swjdp, + uint8_t instr, uint8_t reg_addr, uint8_t RnW, + uint32_t outvalue, uint32_t *invalue) { adi_jtag_dp_scan_u32(swjdp, instr, reg_addr, RnW, outvalue, NULL, NULL); @@ -305,12 +313,14 @@ int swjdp_transaction_endcheck(struct swjdp_common *swjdp) * * ***************************************************************************/ -int dap_dp_write_reg(struct swjdp_common *swjdp, uint32_t value, uint8_t reg_addr) +static int dap_dp_write_reg(struct swjdp_common *swjdp, + uint32_t value, uint8_t reg_addr) { return scan_inout_check_u32(swjdp, DAP_IR_DPACC, reg_addr, DPAP_WRITE, value, NULL); } -int dap_dp_read_reg(struct swjdp_common *swjdp, uint32_t *value, uint8_t reg_addr) +static int dap_dp_read_reg(struct swjdp_common *swjdp, + uint32_t *value, uint8_t reg_addr) { return scan_inout_check_u32(swjdp, DAP_IR_DPACC, reg_addr, DPAP_READ, 0, value); } @@ -332,7 +342,7 @@ int dap_ap_select(struct swjdp_common *swjdp,uint8_t apsel) return ERROR_OK; } -int dap_dp_bankselect(struct swjdp_common *swjdp,uint32_t ap_reg) +static int dap_dp_bankselect(struct swjdp_common *swjdp, uint32_t ap_reg) { uint32_t select; select = (ap_reg & 0x000000F0); @@ -346,7 +356,8 @@ int dap_dp_bankselect(struct swjdp_common *swjdp,uint32_t ap_reg) return ERROR_OK; } -int dap_ap_write_reg(struct swjdp_common *swjdp, uint32_t reg_addr, uint8_t* out_value_buf) +static int dap_ap_write_reg(struct swjdp_common *swjdp, + uint32_t reg_addr, uint8_t *out_value_buf) { dap_dp_bankselect(swjdp, reg_addr); scan_inout_check(swjdp, DAP_IR_APACC, reg_addr, DPAP_WRITE, out_value_buf, NULL); @@ -354,13 +365,6 @@ int dap_ap_write_reg(struct swjdp_common *swjdp, uint32_t reg_addr, uint8_t* out return ERROR_OK; } -int dap_ap_read_reg(struct swjdp_common *swjdp, uint32_t reg_addr, uint8_t *in_value_buf) -{ - dap_dp_bankselect(swjdp, reg_addr); - scan_inout_check(swjdp, DAP_IR_APACC, reg_addr, DPAP_READ, 0, in_value_buf); - - return ERROR_OK; -} int dap_ap_write_reg_u32(struct swjdp_common *swjdp, uint32_t reg_addr, uint32_t value) { uint8_t out_value_buf[4]; @@ -534,7 +538,8 @@ int mem_ap_write_buf_u32(struct swjdp_common *swjdp, uint8_t *buffer, int count, return retval; } -int mem_ap_write_buf_packed_u16(struct swjdp_common *swjdp, uint8_t *buffer, int count, uint32_t address) +static int mem_ap_write_buf_packed_u16(struct swjdp_common *swjdp, + uint8_t *buffer, int count, uint32_t address) { int retval = ERROR_OK; int wcount, blocksize, writecount, i; @@ -630,7 +635,8 @@ int mem_ap_write_buf_u16(struct swjdp_common *swjdp, uint8_t *buffer, int count, return retval; } -int mem_ap_write_buf_packed_u8(struct swjdp_common *swjdp, uint8_t *buffer, int count, uint32_t address) +static int mem_ap_write_buf_packed_u8(struct swjdp_common *swjdp, + uint8_t *buffer, int count, uint32_t address) { int retval = ERROR_OK; int wcount, blocksize, writecount, i; @@ -800,7 +806,8 @@ int mem_ap_read_buf_u32(struct swjdp_common *swjdp, uint8_t *buffer, int count, return retval; } -int mem_ap_read_buf_packed_u16(struct swjdp_common *swjdp, uint8_t *buffer, int count, uint32_t address) +static int mem_ap_read_buf_packed_u16(struct swjdp_common *swjdp, + uint8_t *buffer, int count, uint32_t address) { uint32_t invalue; int retval = ERROR_OK; @@ -895,7 +902,8 @@ int mem_ap_read_buf_u16(struct swjdp_common *swjdp, uint8_t *buffer, int count, * The solution is to arrange for a large out/in scan in this loop and * and convert data afterwards. */ -int mem_ap_read_buf_packed_u8(struct swjdp_common *swjdp, uint8_t *buffer, int count, uint32_t address) +static int mem_ap_read_buf_packed_u8(struct swjdp_common *swjdp, + uint8_t *buffer, int count, uint32_t address) { uint32_t invalue; int retval = ERROR_OK; diff --git a/src/target/arm_adi_v5.h b/src/target/arm_adi_v5.h index 2a09684..bfa5105 100644 --- a/src/target/arm_adi_v5.h +++ b/src/target/arm_adi_v5.h @@ -134,20 +134,16 @@ static inline uint8_t dap_ap_get_select(struct swjdp_common *swjdp) return (uint8_t)(swjdp ->apsel >> 24); } -/* Internal functions used in the module, partial transactions, use with caution */ -int dap_dp_write_reg(struct swjdp_common *swjdp, uint32_t value, uint8_t reg_addr); -/* int swjdp_write_apacc(struct swjdp_common *swjdp, uint32_t value, uint8_t reg_addr); */ -int dap_dp_read_reg(struct swjdp_common *swjdp, uint32_t *value, uint8_t reg_addr); -/* int swjdp_read_apacc(struct swjdp_common *swjdp, uint32_t *value, uint8_t reg_addr); */ -int dap_setup_accessport(struct swjdp_common *swjdp, uint32_t csw, uint32_t tar); +/* Queued transactions -- use with care */ +int dap_setup_accessport(struct swjdp_common *swjdp, + uint32_t csw, uint32_t tar); int dap_ap_select(struct swjdp_common *swjdp,uint8_t apsel); +int dap_ap_write_reg_u32(struct swjdp_common *swjdp, + uint32_t addr, uint32_t value); +int dap_ap_read_reg_u32(struct swjdp_common *swjdp, + uint32_t addr, uint32_t *value); -int dap_ap_write_reg(struct swjdp_common *swjdp, uint32_t addr, uint8_t* out_buf); -int dap_ap_write_reg_u32(struct swjdp_common *swjdp, uint32_t addr, uint32_t value); -int dap_ap_read_reg(struct swjdp_common *swjdp, uint32_t addr, uint8_t *in_buf); -int dap_ap_read_reg_u32(struct swjdp_common *swjdp, uint32_t addr, uint32_t *value); - -/* External interface, partial operations must be completed with swjdp_transaction_endcheck() */ +/* Queued transactions must be completed with swjdp_transaction_endcheck() */ int swjdp_transaction_endcheck(struct swjdp_common *swjdp); /* MEM-AP memory mapped bus single uint32_t register transfers, without endcheck */ commit e60c164cdb50a0aa268165e57de0a4cd0d58fcdf Author: David Brownell <dbr...@us...> Date: Sat Jan 2 15:53:03 2010 -0800 ARM: ADIv5 symbol and comment cleanup Instead of magic numbers, use their AP_REG_* constants. Rename the ROM address symbol as BASE to match ARM's documentation. Comment various other symbols in the header; add some missing ones. Remove an unused struct. Add some doxygen for stuff including the DAP structure and initialization. Signed-off-by: David Brownell <dbr...@us...> diff --git a/src/target/arm_adi_v5.c b/src/target/arm_adi_v5.c index 6ca50ab..59f5638 100644 --- a/src/target/arm_adi_v5.c +++ b/src/target/arm_adi_v5.c @@ -7,7 +7,7 @@ * * * Copyright (C) 2009 by Oyvind Harboe * * oyv...@zy... * - * * + * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * @@ -23,16 +23,34 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -/*************************************************************************** - * * - * This file implements support for the ARM Debug Interface v5 (ADI_V5) * - * * - * ARM(tm) Debug Interface v5 Architecture Specification ARM IHI 0031A * - * * - * CoreSight(tm) DAP-Lite TRM, ARM DDI 0316D * - * Cortex-M3(tm) TRM, ARM DDI 0337G * - * * -***************************************************************************/ + +/** + * @file + * This file implements support for the ARM Debug Interface version 5 (ADIv5) + * debugging architecture. Compared with previous versions, this includes + * a low pin-count Serial Wire Debug (SWD) alternative to JTAG for message + * transport, and focusses on memory mapped resources as defined by the + * CoreSight architecture. + * + * A key concept in ADIv5 is the Debug Access Port, or DAP. A DAP has two + * basic components: a Debug Port (DP) transporting messages to and from a + * debugger, and an Access Port (AP) accessing resources. Three types of DP + * are defined. One uses only JTAG for communication, and is called JTAG-DP. + * One uses only SWD for communication, and is called SW-DP. The third can + * use either SWD or JTAG, and is called SWJ-DP. The most common type of AP + * is used to access memory mapped resources and is called a MEM-AP. Also a + * JTAG-AP is also defined, bridging to JTAG resources; those are uncommon. + */ + +/* + * Relevant specifications from ARM include: + * + * ARM(tm) Debug Interface v5 Architecture Specification ARM IHI 0031A + * CoreSight(tm) v1.0 Architecture Specification ARM IHI 0029B + * + * CoreSight(tm) DAP-Lite TRM, ARM DDI 0316D + * Cortex-M3(tm) TRM, ARM DDI 0337G + */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -950,6 +968,13 @@ int mem_ap_read_buf_u8(struct swjdp_common *swjdp, uint8_t *buffer, int count, u return retval; } +/** + * Initialize a DAP. + * + * @todo Rename this. We also need an initialization scheme which account + * for SWD transports not just JTAG; that will need to address differences + * in layering. (JTAG is useful without any debug target; but not SWD.) + */ int ahbap_debugport_init(struct swjdp_common *swjdp) { uint32_t idreg, romaddr, dummy; @@ -959,9 +984,17 @@ int ahbap_debugport_init(struct swjdp_common *swjdp) LOG_DEBUG(" "); + /* Default MEM-AP setup. + * + * REVISIT AP #0 may be an inappropriate default for this. + * Should we probe, or receve a hint from the caller? + * Presumably we can ignore the possibility of multiple APs. + */ swjdp->apsel = 0; swjdp->ap_csw_value = -1; swjdp->ap_tar_value = -1; + + /* DP initialization */ swjdp->trans_mode = TRANS_MODE_ATOMIC; dap_dp_read_reg(swjdp, &dummy, DP_CTRL_STAT); dap_dp_write_reg(swjdp, SSTICKYERR, DP_CTRL_STAT); @@ -999,8 +1032,14 @@ int ahbap_debugport_init(struct swjdp_common *swjdp) dap_dp_write_reg(swjdp, swjdp->dp_ctrl_stat, DP_CTRL_STAT); dap_dp_read_reg(swjdp, &dummy, DP_CTRL_STAT); - dap_ap_read_reg_u32(swjdp, 0xFC, &idreg); - dap_ap_read_reg_u32(swjdp, 0xF8, &romaddr); + /* + * REVISIT this isn't actually *initializing* anything in an AP, + * and doesn't care if it's a MEM-AP at all (much less AHB-AP). + * Should it? If the ROM address is valid, is this the right + * place to scan the table and do any topology detection? + */ + dap_ap_read_reg_u32(swjdp, AP_REG_IDR, &idreg); + dap_ap_read_reg_u32(swjdp, AP_REG_BASE, &romaddr); LOG_DEBUG("AHB-AP ID Register 0x%" PRIx32 ", Debug ROM Address 0x%" PRIx32 "", idreg, romaddr); @@ -1035,8 +1074,8 @@ int dap_info_command(struct command_context *cmd_ctx, struct swjdp_common *swjdp apselold = swjdp->apsel; dap_ap_select(swjdp, apsel); - dap_ap_read_reg_u32(swjdp, 0xF8, &dbgbase); - dap_ap_read_reg_u32(swjdp, 0xFC, &apid); + dap_ap_read_reg_u32(swjdp, AP_REG_BASE, &dbgbase); + dap_ap_read_reg_u32(swjdp, AP_REG_IDR, &apid); swjdp_transaction_endcheck(swjdp); /* Now we read ROM table ID registers, ref. ARM IHI 0029B sec */ mem_ap = ((apid&0x10000) && ((apid&0x0F) != 0)); @@ -1387,7 +1426,7 @@ DAP_COMMAND_HANDLER(dap_baseaddr_command) if (apselsave != apsel) dap_ap_select(swjdp, apsel); - dap_ap_read_reg_u32(swjdp, 0xF8, &baseaddr); + dap_ap_read_reg_u32(swjdp, AP_REG_BASE, &baseaddr); retval = swjdp_transaction_endcheck(swjdp); command_print(CMD_CTX, "0x%8.8" PRIx32, baseaddr); @@ -1436,7 +1475,7 @@ DAP_COMMAND_HANDLER(dap_apsel_command) } dap_ap_select(swjdp, apsel); - dap_ap_read_reg_u32(swjdp, 0xFC, &apid); + dap_ap_read_reg_u32(swjdp, AP_REG_IDR, &apid); retval = swjdp_transaction_endcheck(swjdp); command_print(CMD_CTX, "ap %" PRIi32 " selected, identification register 0x%8.8" PRIx32, apsel, apid); @@ -1464,7 +1503,7 @@ DAP_COMMAND_HANDLER(dap_apid_command) if (apselsave != apsel) dap_ap_select(swjdp, apsel); - dap_ap_read_reg_u32(swjdp, 0xFC, &apid); + dap_ap_read_reg_u32(swjdp, AP_REG_IDR, &apid); retval = swjdp_transaction_endcheck(swjdp); command_print(CMD_CTX, "0x%8.8" PRIx32, apid); if (apselsave != apsel) diff --git a/src/target/arm_adi_v5.h b/src/target/arm_adi_v5.h index a78193c..2a09684 100644 --- a/src/target/arm_adi_v5.h +++ b/src/target/arm_adi_v5.h @@ -23,6 +23,13 @@ #ifndef ARM_ADI_V5_H #define ARM_ADI_V5_H +/** + * @file + * This defines formats and data structures used to talk to ADIv5 entities. + * Those include a DAP, different types of Debug Port (DP), and memory mapped + * resources accessed through a MEM-AP. + */ + #include "arm_jtag.h" #define DAP_IR_DPACC 0xA @@ -30,14 +37,22 @@ #define DPAP_WRITE 0 #define DPAP_READ 1 + +/* A[3:0] for DP registers (for JTAG, stored in DPACC) */ #define DP_ZERO 0 #define DP_CTRL_STAT 0x4 #define DP_SELECT 0x8 #define DP_RDBUFF 0xC +/* Fields of the DP's CTRL/STAT register */ #define CORUNDETECT (1 << 0) #define SSTICKYORUN (1 << 1) +/* 3:2 - transaction mode (e.g. pushed compare) */ #define SSTICKYERR (1 << 5) +#define READOK (1 << 6) +#define WDATAERR (1 << 7) +/* 11:8 - mask lanes for pushed compare or verify ops */ +/* 21:12 - transaction counter */ #define CDBGRSTREQ (1 << 26) #define CDBGRSTACK (1 << 27) #define CDBGPWRUPREQ (1 << 28) @@ -45,26 +60,35 @@ #define CSYSPWRUPREQ (1 << 30) #define CSYSPWRUPACK (1 << 31) -#define AP_REG_CSW 0x00 +/* MEM-AP register addresses */ +/* TODO: rename as MEM_AP_REG_* */ +#define AP_REG_CSW 0x00 #define AP_REG_TAR 0x04 #define AP_REG_DRW 0x0C #define AP_REG_BD0 0x10 #define AP_REG_BD1 0x14 #define AP_REG_BD2 0x18 #define AP_REG_BD3 0x1C -#define AP_REG_DBGROMA 0xF8 +#define AP_REG_CFG 0xF4 /* big endian? */ +#define AP_REG_BASE 0xF8 + +/* Generic AP register address */ #define AP_REG_IDR 0xFC +/* Fields of the MEM-AP's CSW register */ #define CSW_8BIT 0 #define CSW_16BIT 1 #define CSW_32BIT 2 - #define CSW_ADDRINC_MASK (3 << 4) #define CSW_ADDRINC_OFF 0 #define CSW_ADDRINC_SINGLE (1 << 4) #define CSW_ADDRINC_PACKED (2 << 4) -#define CSW_HPROT (1 << 25) -#define CSW_MASTER_DEBUG (1 << 29) +#define CSW_DEVICE_EN (1 << 6) +#define CSW_TRIN_PROG (1 << 7) +#define CSW_SPIDEN (1 << 23) +/* 30:24 - implementation-defined! */ +#define CSW_HPROT (1 << 25) /* ? */ +#define CSW_MASTER_DEBUG (1 << 29) /* ? */ #define CSW_DBGSWENABLE (1 << 31) /* transaction mode */ @@ -74,12 +98,14 @@ /* Freerunning transactions with delays and overrun checking */ #define TRANS_MODE_COMPOSITE 2 -struct swjdp_reg -{ - int addr; - struct arm_jtag *jtag_info; -}; - +/** + * This represents an ARM Debug Interface (v5) Debug Access Port (DAP). + * A DAP has two types of component: one Debug Port (DP), which is a + * transport agent; and at least one Access Port (AP), controlling + * resource access. Most common is a MEM-AP, for memory access. + * + * @todo Rename "swjdp_common" as "dap". Use of SWJ-DP is optional! + */ struct swjdp_common { struct arm_jtag *jtag_info; commit ec88ccc51cb5d8594ae95660c826954f3a9042ec Author: David Brownell <dbr...@us...> Date: Sat Jan 2 15:52:52 2010 -0800 Cortex-M3: minor breakpoint cleanup Shrink some lines, add some comments, simplify some tests. During debug startup, log the core revision level too. Signed-off-by: David Brownell <dbr...@us...> diff --git a/src/target/cortex_m3.c b/src/target/cortex_m3.c index 556928f..9685821 100644 --- a/src/target/cortex_m3.c +++ b/src/target/cortex_m3.c @@ -42,6 +42,9 @@ /* NOTE: most of this should work fine for the Cortex-M1 and * Cortex-M0 cores too, although they're ARMv6-M not ARMv7-M. + * Some differences: M0/M1 doesn't have FBP remapping or the + * DWT tracing/profiling support. (So the cycle counter will + * not be usable; the other stuff isn't currently used here.) * * Although there are some workarounds for errata seen only in r0p0 * silicon, such old parts are hard to find and thus not much tested @@ -579,7 +582,7 @@ static void cortex_m3_enable_breakpoints(struct target *target) /* set any pending breakpoints */ while (breakpoint) { - if (breakpoint->set == 0) + if (!breakpoint->set) cortex_m3_set_breakpoint(target, breakpoint); breakpoint = breakpoint->next; } @@ -936,16 +939,25 @@ cortex_m3_set_breakpoint(struct target *target, struct breakpoint *breakpoint) else if (breakpoint->type == BKPT_SOFT) { uint8_t code[4]; + + /* NOTE: on ARMv6-M and ARMv7-M, BKPT(0xab) is used for + * semihosting; don't use that. Otherwise the BKPT + * parameter is arbitrary. + */ buf_set_u32(code, 0, 32, ARMV5_T_BKPT(0x11)); - if ((retval = target_read_memory(target, breakpoint->address & 0xFFFFFFFE, breakpoint->length, 1, breakpoint->orig_instr)) != ERROR_OK) - { + retval = target_read_memory(target, + breakpoint->address & 0xFFFFFFFE, + breakpoint->length, 1, + breakpoint->orig_instr); + if (retval != ERROR_OK) return retval; - } - if ((retval = target_write_memory(target, breakpoint->address & 0xFFFFFFFE, breakpoint->length, 1, code)) != ERROR_OK) - { + retval = target_write_memory(target, + breakpoint->address & 0xFFFFFFFE, + breakpoint->length, 1, + code); + if (retval != ERROR_OK) return retval; - } - breakpoint->set = 0x11; /* Any nice value but 0 */ + breakpoint->set = true; } LOG_DEBUG("BPID: %d, Type: %d, Address: 0x%08" PRIx32 " Length: %d (set=%d)", @@ -1008,7 +1020,7 @@ cortex_m3_unset_breakpoint(struct target *target, struct breakpoint *breakpoint) } } } - breakpoint->set = 0; + breakpoint->set = false; return ERROR_OK; } @@ -1187,7 +1199,7 @@ cortex_m3_unset_watchpoint(struct target *target, struct watchpoint *watchpoint) target_write_u32(target, comparator->dwt_comparator_address + 8, comparator->function); - watchpoint->set = 0; + watchpoint->set = false; return ERROR_OK; } @@ -1273,7 +1285,7 @@ static void cortex_m3_enable_watchpoints(struct target *target) /* set any pending watchpoints */ while (watchpoint) { - if (watchpoint->set == 0) + if (!watchpoint->set) cortex_m3_set_watchpoint(target, watchpoint); watchpoint = watchpoint->next; } @@ -1647,7 +1659,8 @@ static int cortex_m3_examine(struct target *target) return retval; if (((cpuid >> 4) & 0xc3f) == 0xc23) - LOG_DEBUG("CORTEX-M3 processor detected"); + LOG_DEBUG("Cortex-M3 r%dp%d processor detected", + (cpuid >> 20) & 0xf, (cpuid >> 0) & 0xf); LOG_DEBUG("cpuid: 0x%8.8" PRIx32 "", cpuid); /* NOTE: FPB and DWT are both optional. */ commit b3bf1d12b2fdfba1c1cbee3e1afbfbb27cbd1a26 Author: David Brownell <dbr...@us...> Date: Sat Jan 2 15:52:35 2010 -0800 streamline and document helptext mode displays Most commands are usable only at runtime; so don't bother saying that, it's noise. Moreover, tokens like EXEC are cryptic. Be more clear: highlight only the commands which may (also) be used during the config stage, thus matching the docs more closely. There are - Configuration commands (per documentation) - And also some commands that valid at *any* time. Update the docs to note that "help" now shows this mode info. This also highlighted a few mistakes in command configuration, mostly commands listed as "valid at any time" which shouldn't have been. This just fixes ones I noted when sanity testing. Signed-off-by: David Brownell <dbr...@us...> diff --git a/doc/openocd.texi b/doc/openocd.texi index cc0edf8..3f5882c 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -1630,9 +1630,14 @@ supported. When the OpenOCD server process starts up, it enters a @emph{configuration stage} which is the only time that certain commands, @emph{configuration commands}, may be issued. +Normally, configuration commands are only available +inside startup scripts. + In this manual, the definition of a configuration command is presented as a @emph{Config Command}, not as a @emph{Command} which may be issued interactively. +The runtime @command{help} command also highlights configuration +commands, and those which may be issued at any time. Those configuration commands include declaration of TAPs, flash banks, @@ -5093,13 +5098,15 @@ port is 5555. Exits the current telnet session. @end deffn -@c note EXTREMELY ANNOYING word wrap at column 75 -@c even when lines are e.g. 100+ columns ... -@c coded in startup.tcl @deffn {Command} help [string] With no parameters, prints help text for all commands. Otherwise, prints each helptext containing @var{string}. Not every command provides helptext. + +Configuration commands, and commands valid at any time, are +explicitly noted in parenthesis. +In most cases, no such restriction is listed; this indicates commands +which are only available after the configuration stage has completed. @end deffn @deffn Command sleep msec [@option{busy}] diff --git a/src/flash/nor/stellaris.c b/src/flash/nor/stellaris.c index f414ca6..8d35f9b 100644 --- a/src/flash/nor/stellaris.c +++ b/src/flash/nor/stellaris.c @@ -1182,7 +1182,7 @@ static const struct command_registration stellaris_exec_command_handlers[] = { static const struct command_registration stellaris_command_handlers[] = { { .name = "stellaris", - .mode = COMMAND_ANY, + .mode = COMMAND_EXEC, .help = "Stellaris flash command group", .chain = stellaris_exec_command_handlers, }, diff --git a/src/helper/command.c b/src/helper/command.c index b4e31ea..ab82785 100644 --- a/src/helper/command.c +++ b/src/helper/command.c @@ -914,7 +914,7 @@ static COMMAND_HELPER(command_help_show, struct command *c, unsigned n, bool is_match = (strstr(cmd_name, match) != NULL) || ((c->usage != NULL) && (strstr(c->usage, match) != NULL)) || ((c->help != NULL) && (strstr(c->help, match) != NULL)); - + if (is_match) { command_help_show_indent(n); @@ -934,15 +934,27 @@ static COMMAND_HELPER(command_help_show, struct command *c, unsigned n, if (is_match && show_help) { - const char *stage_msg; - switch (c->mode) { - case COMMAND_CONFIG: stage_msg = "CONFIG"; break; - case COMMAND_EXEC: stage_msg = "EXEC"; break; - case COMMAND_ANY: stage_msg = "CONFIG or EXEC"; break; - default: stage_msg = "***UNKNOWN***"; break; - } - char *msg = alloc_printf("%s%sValid Modes: %s", - c->help ? : "", c->help ? " " : "", stage_msg); + char *msg; + + /* Normal commands are runtime-only; highlight exceptions */ + if (c->mode != COMMAND_EXEC) { + const char *stage_msg = ""; + + switch (c->mode) { + case COMMAND_CONFIG: + stage_msg = " (configuration command)"; + break; + case COMMAND_ANY: + stage_msg = " (command valid any time)"; + break; + default: + stage_msg = " (?mode error?)"; + break; + } + msg = alloc_printf("%s%s", c->help ? : "", stage_msg); + } else + msg = alloc_printf("%s", c->help ? : ""); + if (NULL != msg) { command_help_show_wrap(msg, n + 3, n + 3); diff --git a/src/server/gdb_server.c b/src/server/gdb_server.c index cf62864..d5d7042 100644 --- a/src/server/gdb_server.c +++ b/src/server/gdb_server.c @@ -2272,6 +2272,7 @@ static int gdb_target_start(struct target *target, uint16_t port) return ERROR_OK; } +/* FIXME static */ int gdb_target_add_one(struct target *target) { if (gdb_port == 0 && server_use_pipes == 0) @@ -2420,7 +2421,7 @@ static const struct command_registration gdb_command_handlers[] = { { .name = "gdb_port", .handler = &handle_gdb_port_command, - .mode = COMMAND_ANY, + .mode = COMMAND_CONFIG, .help = "daemon configuration command gdb_port", .usage = "<port>", }, diff --git a/src/target/armv7m.c b/src/target/armv7m.c index d4f6309..d0f58de 100644 --- a/src/target/armv7m.c +++ b/src/target/armv7m.c @@ -834,7 +834,7 @@ static const struct command_registration armv7m_exec_command_handlers[] = { const struct command_registration armv7m_command_handlers[] = { { .name = "dap", - .mode = COMMAND_ANY, + .mode = COMMAND_EXEC, .help = "Cortex DAP command group", .chain = armv7m_exec_command_handlers, }, diff --git a/src/target/cortex_m3.c b/src/target/cortex_m3.c index edf9b6f..556928f 100644 --- a/src/target/cortex_m3.c +++ b/src/target/cortex_m3.c @@ -2003,7 +2003,7 @@ static const struct command_registration cortex_m3_command_handlers[] = { }, { .name = "cortex_m3", - .mode = COMMAND_ANY, + .mode = COMMAND_EXEC, .help = "Cortex-M3 command group", .chain = cortex_m3_exec_command_handlers, }, diff --git a/src/target/target.c b/src/target/target.c index d3d1bee..73a762d 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -4866,7 +4866,7 @@ static const struct command_registration target_exec_command_handlers[] = { { .name = "fast_load", .handler = &handle_fast_load_command, - .mode = COMMAND_ANY, + .mode = COMMAND_EXEC, .help = "loads active fast load image to current target " "- mainly for profiling purposes", }, diff --git a/src/target/trace.c b/src/target/trace.c index 99d6bae..56a18a4 100644 --- a/src/target/trace.c +++ b/src/target/trace.c @@ -177,7 +177,7 @@ static const struct command_registration trace_exec_command_handlers[] = { static const struct command_registration trace_command_handlers[] = { { .name = "trace", - .mode = COMMAND_ANY, + .mode = COMMAND_EXEC, .help = "trace command group", .chain = trace_exec_command_handlers, }, ----------------------------------------------------------------------- Summary of changes: doc/openocd.texi | 13 ++- src/flash/nor/stellaris.c | 2 +- src/helper/command.c | 32 ++++-- src/server/gdb_server.c | 3 +- src/target/arm_adi_v5.c | 243 ++++++++++++++++++++++++++++++--------------- src/target/arm_adi_v5.h | 75 +++++++++----- src/target/armv7m.c | 2 +- src/target/cortex_m3.c | 39 +++++--- src/target/target.c | 2 +- src/target/trace.c | 2 +- 10 files changed, 277 insertions(+), 136 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: David B. <dbr...@us...> - 2010-01-02 11:11:21
|
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 9d167d62f2eadf81e0028e471e05154c9aabbbfb (commit) via be01786186951b42d8aa8b8968ac1615e080a9c7 (commit) via 668f20d0abc22765dda6dd5d094eb79bea321ace (commit) from 384e9193e99d54d6cafb979b6b2e1fd8e3fbd200 (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 9d167d62f2eadf81e0028e471e05154c9aabbbfb Author: Dean Glazeski <dn...@gm...> Date: Thu Dec 31 16:01:32 2009 -0600 Fix usage/help search for subcommands. This makes it so that the usage/help command properly uses the whole command, including subcommand, in the search for help information. This previously caused erroneous output from the usage command handler. Signed-off-by: David Brownell <dbr...@us...> diff --git a/src/helper/command.c b/src/helper/command.c index e55f9e7..b4e31ea 100644 --- a/src/helper/command.c +++ b/src/helper/command.c @@ -960,18 +960,45 @@ static COMMAND_HELPER(command_help_show, struct command *c, unsigned n, COMMAND_HANDLER(handle_help_command) { bool full = strcmp(CMD_NAME, "help") == 0; - + int retval; struct command *c = CMD_CTX->commands; + char *match = NULL; - const char *match = ""; if (CMD_ARGC == 0) match = ""; - else if (CMD_ARGC == 1) - match = CMD_ARGV[0]; - else + else if (CMD_ARGC >= 1) { + unsigned i; + + for (i = 0; i < CMD_ARGC; ++i) { + if (NULL != match) { + char *prev = match; + + match = alloc_printf("%s %s", match, + CMD_ARGV[i]); + free(prev); + if (NULL == match) { + LOG_ERROR("unable to build " + "search string"); + return -ENOMEM; + } + } else { + match = alloc_printf("%s", CMD_ARGV[i]); + if (NULL == match) { + LOG_ERROR("unable to build " + "search string"); + return -ENOMEM; + } + } + } + } else return ERROR_COMMAND_SYNTAX_ERROR; - - return CALL_COMMAND_HANDLER(command_help_show_list, c, 0, full, match); + + retval = CALL_COMMAND_HANDLER(command_help_show_list, + c, 0, full, match); + + if (CMD_ARGC >= 1) + free(match); + return retval; } static int command_unknown_find(unsigned argc, Jim_Obj *const *argv, commit be01786186951b42d8aa8b8968ac1615e080a9c7 Author: Dean Glazeski <dn...@gm...> Date: Fri Jan 1 19:58:38 2010 -0600 Add the current command to the command information I wanted to make it so I can be ignorant of a commands invocation string, so I tried to use CMD_CURRENT (aka cmd->current) which is supposed to house a pointer to the current command. Â It turns out that this wasn't being set. This patch adds the current command structure to the command invocation structure before sending it along to the command handler. Signed-off-by: David Brownell <dbr...@us...> diff --git a/src/helper/command.c b/src/helper/command.c index b991544..e55f9e7 100644 --- a/src/helper/command.c +++ b/src/helper/command.c @@ -580,6 +580,7 @@ static int run_command(struct command_context *context, struct command_invocation cmd = { .ctx = context, + .current = c, .name = c->name, .argc = num_words - 1, .argv = words + 1, commit 668f20d0abc22765dda6dd5d094eb79bea321ace Author: Antonio Borneo <bor...@gm...> Date: Thu Dec 31 20:19:26 2009 +0800 Added ST FlashLINK interface config file. The relevant cable config is already in OpenOCD, but not a config for the JTAG adapter. I have tested with FlashLINK on ARM926. Signed-off-by: Antonio Borneo <bor...@gm...> Signed-off-by: David Brownell <dbr...@us...> diff --git a/tcl/interface/flashlink.cfg b/tcl/interface/flashlink.cfg new file mode 100644 index 0000000..4b00de9 --- /dev/null +++ b/tcl/interface/flashlink.cfg @@ -0,0 +1,10 @@ +# +# ST FlashLINK JTAG parallel cable +# +# http://www.st.com/mcu/contentid-94-80-FL_101.html +# http://www.st.com/stonline/products/literature/um/7889.pdf +# + +interface parport +parport_port 0 +parport_cable flashlink ----------------------------------------------------------------------- Summary of changes: src/helper/command.c | 42 +++++++++++++++++++++++++++++++++++------- tcl/interface/flashlink.cfg | 10 ++++++++++ 2 files changed, 45 insertions(+), 7 deletions(-) create mode 100644 tcl/interface/flashlink.cfg hooks/post-receive -- Main OpenOCD repository |
From: David B. <dbr...@us...> - 2009-12-31 13:47:32
|
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 384e9193e99d54d6cafb979b6b2e1fd8e3fbd200 (commit) from 7cef6d650c291de746b5948596fb3aab036c2775 (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 384e9193e99d54d6cafb979b6b2e1fd8e3fbd200 Author: David Brownell <dbr...@us...> Date: Thu Dec 31 03:09:03 2009 -0800 User's Guide: warn about the forum Namely, that developers don't hang out; it's a users-only club. Signed-off-by: David Brownell <dbr...@us...> diff --git a/doc/openocd.texi b/doc/openocd.texi index 7281d71..cc0edf8 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -152,7 +152,11 @@ PDF form is likewise published at: @section OpenOCD User's Forum -There is an OpenOCD forum (phpBB) hosted by SparkFun: +There is an OpenOCD forum (phpBB) hosted by SparkFun, +which might be helpful to you. Note that if you want +anything to come to the attention of developers, you +should post it to the OpenOCD Developer Mailing List +instead of this forum. @uref{http://forum.sparkfun.com/viewforum.php?f=18} ----------------------------------------------------------------------- Summary of changes: doc/openocd.texi | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: David B. <dbr...@us...> - 2009-12-31 08:26:45
|
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 7cef6d650c291de746b5948596fb3aab036c2775 (commit) from 3ed254c18aa7fc24cbc692433729ec3819fc5537 (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 7cef6d650c291de746b5948596fb3aab036c2775 Author: Dean Glazeski <dn...@gm...> Date: Wed Dec 30 23:21:33 2009 -0600 Remove some more Eclipse stuff from Git's eyes. This adds the .settings folder and the .cproject file put down by Eclipse from the eyes of Git. Signed-off-by: David Brownell <dbr...@us...> diff --git a/.gitignore b/.gitignore index 9928129..5ec831e 100644 --- a/.gitignore +++ b/.gitignore @@ -68,4 +68,5 @@ NOTES # Eclipse stuff .project - +.cproject +.settings ----------------------------------------------------------------------- Summary of changes: .gitignore | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: David B. <dbr...@us...> - 2009-12-31 02:02:13
|
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 3ed254c18aa7fc24cbc692433729ec3819fc5537 (commit) from 7c5acf8660ddfce4746152e03749b699532f513f (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 3ed254c18aa7fc24cbc692433729ec3819fc5537 Author: Antonio Borneo <bor...@gm...> Date: Thu Dec 31 07:13:16 2009 +0800 ARM7_9: Fix segfaults Handlers for commands - arm7_9 semihosting <enable | disable> - $_TARGETNAME arp_reset assert 1 didn't check if target has already been examined, and could segfault when using the NULL pointer "arm7_9->eice_cache". Signed-off-by: Antonio Borneo <bor...@gm...> Signed-off-by: David Brownell <dbr...@us...> diff --git a/src/target/arm7_9_common.c b/src/target/arm7_9_common.c index e596980..a09b0ad 100644 --- a/src/target/arm7_9_common.c +++ b/src/target/arm7_9_common.c @@ -2797,6 +2797,12 @@ COMMAND_HANDLER(handle_arm7_9_semihosting_command) COMMAND_PARSE_ENABLE(CMD_ARGV[0], semihosting); + if (!target_was_examined(target)) + { + LOG_ERROR("Target not examined yet"); + return ERROR_FAIL; + } + if (arm7_9->has_vector_catch) { struct reg *vector_catch = &arm7_9->eice_cache ->reg_list[EICE_VEC_CATCH]; diff --git a/src/target/target.c b/src/target/target.c index 8cb53b3..d3d1bee 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -4079,6 +4079,11 @@ static int jim_target_reset(Jim_Interp *interp, int argc, Jim_Obj *const *argv) struct target *target = Jim_CmdPrivData(goi.interp); if (!target->tap->enabled) return jim_target_tap_disabled(interp); + if (!(target_was_examined(target))) + { + LOG_ERROR("Target not examined yet"); + return ERROR_TARGET_NOT_EXAMINED; + } if (!target->type->assert_reset || !target->type->deassert_reset) { Jim_SetResult_sprintf(interp, ----------------------------------------------------------------------- Summary of changes: src/target/arm7_9_common.c | 6 ++++++ src/target/target.c | 5 +++++ 2 files changed, 11 insertions(+), 0 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: David B. <dbr...@us...> - 2009-12-30 21:00:36
|
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 7c5acf8660ddfce4746152e03749b699532f513f (commit) via 17fb7ead4b901f10c01c0824f594d91775b012b3 (commit) from c116d8f6bcb745ccc8fb8e6b562c8f22d54cd003 (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 7c5acf8660ddfce4746152e03749b699532f513f Author: Antonio Borneo <bor...@gm...> Date: Wed Dec 30 07:48:49 2009 +0800 whitespace cleanup, mostly for docs Remove useless space/tab at end of lines. Remove spaces in indentation and replace with tab. Signed-off-by: Antonio Borneo <bor...@gm...> Signed-off-by: David Brownell <dbr...@us...> diff --git a/BUGS b/BUGS index 6967525..961b339 100644 --- a/BUGS +++ b/BUGS @@ -22,7 +22,7 @@ that may be important. - If the report is for a regression: - Include logs for both working and broken versions. - Find the precise version that caused the regression by binary search. - You can use "git bisect" to expedite this binary search: + You can use "git bisect" to expedite this binary search: http://www.kernel.org/pub/software/scm/git/docs/git-bisect.html If possible, please develop and attach a patch that helps to expose or @@ -36,7 +36,7 @@ in total. @section bugscrashdump Obtaining Crash Backtraces If OpenOCD is crashing, there are two very effective things you can do to -improve your chances of getting help on the development mailing list. +improve your chances of getting help on the development mailing list. Try to reproduce the problem using the dummy JTAG interface to allow other developers to replicate your problem robustly and use GDB to get a trace:@par diff --git a/NEWS-0.2.0 b/NEWS-0.2.0 index f56c7a4..7426926 100644 --- a/NEWS-0.2.0 +++ b/NEWS-0.2.0 @@ -9,7 +9,7 @@ must past stricter value checks, and many more error conditions have been handled correctly. These efforts helped to make the 0.2.0 release more stable and robust, though some changes may expose latent bugs in your existing configuration scripts. - + This release does not maintain backward compatibility in all respects, so some target or configuration scripts may need to be updated. In some cases, you may also see warnings; resolve those, because they indicate @@ -20,7 +20,7 @@ The following areas of OpenOCD functionality changed in this release: JTAG Layer: - Improves modularity: core, TCL, driver commands, and interface have been separated, encapsulated, and documented for developers. Mostly. -- Improves JTAG TAP transition tables: +- Improves JTAG TAP transition tables: * Makes TAP paths variable length, rather than being fixed at 7 steps. * Fixes problems with some targets that did not like longer paths. - Improves JTAG driver/minidriver modularity and encapsulation. diff --git a/NEWTAPS b/NEWTAPS index 2fc6f12..e789054 100644 --- a/NEWTAPS +++ b/NEWTAPS @@ -30,7 +30,7 @@ Version Number Changes: not a big deal. Please do report this information. We'd like to know about it. - For example + For example Error: ERROR: Tap: s3c4510.cpu - Expected id: 0x3f0f0f0f, Got: 0x1f0f0f0f Error: ERROR: expected: mfg: 0x787, part: 0xf0f0, ver: 0x3 @@ -39,7 +39,7 @@ Error: ERROR: got: mfg: 0x787, part: 0xf0f0, ver: 0x1 ======================================== Updating the Tap ID number your self - + Why do this? You just want the warning to go away. And don't want to update your version/instance of OpenOCD. @@ -79,11 +79,11 @@ Examples: 0x3f0f0f0f - is a newer ARM7TDMI 0x3ba00477 - is an ARM cortex M3 -Some chips have multiple JTAG taps - be sure to list +Some chips have multiple JTAG taps - be sure to list each one individually - ORDER is important! ======================================== -B) The maker of the part +B) The maker of the part Examples: Xilinx, Atmel, ST Micro Systems, Freescale @@ -94,7 +94,7 @@ C) The family of parts it belongs to Examples: "NXP LPC Series" "Atmel SAM7 Series" - + ======================================== D) The actual part number on the package @@ -121,7 +121,7 @@ For example: A consumer GPS unit or a cellphone ie: Olimex, LogicPD, Freescale(eval board) ======================================== - + (G) Identifying information on the board. Not good: "iar red ST eval board" diff --git a/PATCHES b/PATCHES index 74a76fd..856b094 100644 --- a/PATCHES +++ b/PATCHES @@ -32,7 +32,7 @@ in response to feedback. Add yourself to the GPL copyright for non-trivial changes. To create a patch from the command line: -@code +@code git diff >mypatch.txt @endcode diff --git a/README.Win32 b/README.Win32 index bec4567..6c690c9 100644 --- a/README.Win32 +++ b/README.Win32 @@ -27,8 +27,8 @@ based JTAG debuggers. http://sourceforge.net/projects/libusb-win32/ -You need to download the libusb-win32-device-bin-0.1.12.2.tar.gz -package. Extract this file into a temp directory. +You need to download the libusb-win32-device-bin-0.1.12.2.tar.gz +package. Extract this file into a temp directory. Copy the file libusb-win32-device-bin-0.1.12.2\include\usb.h to your MinGW include directory. @@ -59,10 +59,10 @@ released source tarball or the git tree. If you are using the git tree, the following are the instructions from README.mingw. You will need to have the cmake utility installed. -- Edit Toolchain-mingw32.cmake to point to the correct MinGW +- Edit Toolchain-mingw32.cmake to point to the correct MinGW installation. - Create a build directory like "mkdir build-win32", e.g in ../libftdi/ -- cd into that directory and run +- cd into that directory and run "cmake -DCMAKE_TOOLCHAIN_FILE=../Toolchain-mingw32.cmake .." - Copy src/ftdi.h to your MinGW include directory. - Copy build-win32/src/*.a to your MinGW lib directory. diff --git a/TODO b/TODO index a9e95f6..8fed264 100644 --- a/TODO +++ b/TODO @@ -27,8 +27,8 @@ This section provides possible things to improve with OpenOCD's TCL support. parameters. Currently variables assigned through one such parameter command/script are unset before the next one is invoked. -- Isolate all TCL command support: - - Pure C CLI implementations using --disable-builtin-tcl. +- Isolate all TCL command support: + - Pure C CLI implementations using --disable-builtin-tcl. - Allow developers to build new dongles using OpenOCD's JTAG core. - At first, provide only low-level JTAG support; target layer and above rely heavily on scripting event mechanisms. @@ -112,7 +112,7 @@ TCP/IP packets handled by the server. @section thelistswd Serial Wire Debug -- implement Serial Wire Debug interface +- implement Serial Wire Debug interface @section thelistbs Boundary Scan Support @@ -163,7 +163,7 @@ https://lists.berlios.de/pipermail/openocd-development/2009-October/011506.html use hardware stepping if available. - mdb can return garbage data if read byte operation fails for a memory region(16 & 32 byte access modes may be supported). Is this - a bug in the .MX31 PDK init script? Try on i.MX31 PDK: + a bug in the .MX31 PDK init script? Try on i.MX31 PDK: mdw 0xb80005f0 0x8, mdh 0xb80005f0 0x10, mdb 0xb80005f0 0x20. mdb returns garabage. - implement missing functionality (grep FNC_INFO_NOTIMPLEMENTED ...) @@ -197,8 +197,8 @@ https://lists.berlios.de/pipermail/openocd-development/2009-October/011506.html @section thelistsvf SVF/XSVF -- develop SVF unit tests -- develop XSVF unit tests +- develop SVF unit tests +- develop XSVF unit tests @section thelistflash Flash Support @@ -328,7 +328,7 @@ at the bottom of the list below. Example, on amd64: from unaligned memory addresses - libopenocd support: @par https://lists.berlios.de/pipermail/openocd-development/2009-May/006405.html -- review and clean up interface/target/flash APIs +- review and clean up interface/target/flash APIs The following strategic tasks will require ambition, knowledge, and time to complete: diff --git a/bootstrap b/bootstrap index 268d07c..9094a27 100755 --- a/bootstrap +++ b/bootstrap @@ -1,7 +1,7 @@ #!/bin/sh -e # Run the autotools bootstrap sequence to create the configure script -# Stop execution as soon as we have an unknown command +# Stop execution as soon as we have an unknown command set -e if libtoolize --version >/dev/null 2>&1; then diff --git a/configure.in b/configure.in index 21edba9..ecc9c6d 100644 --- a/configure.in +++ b/configure.in @@ -559,7 +559,7 @@ case $host in AC_MSG_WARN([--disable-parport-giveio is not supported by MinGW32 hosts]) fi parport_use_giveio=yes - + CFLAGS="$CFLAGS -D__USE_MINGW_ANSI_STDIO" AC_DEFINE(IS_MINGW, 1, [1 if building for MinGW.]) diff --git a/doc/manual/primer/commands.txt b/doc/manual/primer/commands.txt index c9db7cc..6169734 100644 --- a/doc/manual/primer/commands.txt +++ b/doc/manual/primer/commands.txt @@ -55,7 +55,7 @@ static COMMAND_HELPER(handle_hello_args, const char **sep, const char **name) @endcode Of course, you may also call other macros or functions, but that extends -beyond the scope of this tutorial on writing commands. +beyond the scope of this tutorial on writing commands. @section primercmdreg Command Registration diff --git a/doc/manual/release.txt b/doc/manual/release.txt index 737cf13..70a22ff 100644 --- a/doc/manual/release.txt +++ b/doc/manual/release.txt @@ -399,7 +399,7 @@ affect its behavior: @section releasetutorial Release Tutorials -This section should contain a brief tutorial for using the Release +This section should contain a brief tutorial for using the Release Script to perform release tasks, but the new script needs to be used for 0.3.0. diff --git a/doc/manual/server.txt b/doc/manual/server.txt index 57bac4a..5250f7f 100644 --- a/doc/manual/server.txt +++ b/doc/manual/server.txt @@ -320,6 +320,6 @@ openocd -s /usr/local/share/openocd -f httpd/httpd.tcl -f interface/dummy.cfg -f Navigate to: http://localhost:8888/ - + */ diff --git a/doc/openocd.texi b/doc/openocd.texi index 02caf5b..7281d71 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -3757,14 +3757,14 @@ Use it in board specific configuration files, not interactively. @comment the REAL name for this command is "ocd_flash_banks" @comment less confusing would be: "flash list" (like "nand list") @deffn Command {flash banks} -Prints a one-line summary of each device that was +Prints a one-line summary of each device that was declared using @command{flash bank}, numbered from zero. Note that this is the @emph{plural} form; the @emph{singular} form is a very different command. @end deffn @deffn Command {flash list} -Retrieves a list of associative arrays for each device that was +Retrieves a list of associative arrays for each device that was declared using @command{flash bank}, numbered from zero. This returned list can be manipulated easily from within scripts. @end deffn @@ -4914,28 +4914,28 @@ nand device $NANDFLASH at91sam9 $CHIPNAME 0x40000000 0xfffffe800 @end example AT91SAM9 chips support single-bit ECC hardware. The @code{write_page} and @code{read_page} methods are used to utilize the ECC hardware unless they are -disabled by using the @command{nand raw_access} command. There are four +disabled by using the @command{nand raw_access} command. There are four additional commands that are needed to fully configure the AT91SAM9 NAND controller. Two are optional; most boards use the same wiring for ALE/CLE: @deffn Command {at91sam9 cle} num addr_line -Configure the address line used for latching commands. The @var{num} +Configure the address line used for latching commands. The @var{num} parameter is the value shown by @command{nand list}. @end deffn @deffn Command {at91sam9 ale} num addr_line -Configure the address line used for latching addresses. The @var{num} +Configure the address line used for latching addresses. The @var{num} parameter is the value shown by @command{nand list}. @end deffn -For the next two commands, it is assumed that the pins have already been +For the next two commands, it is assumed that the pins have already been properly configured for input or output. @deffn Command {at91sam9 rdy_busy} num pio_base_addr pin -Configure the RDY/nBUSY input from the NAND device. The @var{num} -parameter is the value shown by @command{nand list}. @var{pio_base_addr} +Configure the RDY/nBUSY input from the NAND device. The @var{num} +parameter is the value shown by @command{nand list}. @var{pio_base_addr} is the base address of the PIO controller and @var{pin} is the pin number. @end deffn @deffn Command {at91sam9 ce} num pio_base_addr pin -Configure the chip enable input to the NAND device. The @var{num} -parameter is the value shown by @command{nand list}. @var{pio_base_addr} +Configure the chip enable input to the NAND device. The @var{num} +parameter is the value shown by @command{nand list}. @var{pio_base_addr} is the base address of the PIO controller and @var{pin} is the pin number. @end deffn @end deffn @@ -5824,7 +5824,7 @@ and using the MCR instruction. an ARM register.) @end deffn -@deffn Command {arm mrc} pX coproc op1 CRn CRm op2 +@deffn Command {arm mrc} pX coproc op1 CRn CRm op2 Read a coprocessor @var{pX} register passing parameters @var{CRn}, @var{CRm}, opcodes @var{opc1} and @var{opc2}, and the MRC instruction. @@ -5843,7 +5843,7 @@ core mode if necessary. @cindex ARMv5 The ARMv4 and ARMv5 architectures are widely used in embedded systems, -and introduced core parts of the instruction set in use today. +and introduced core parts of the instruction set in use today. That includes the Thumb instruction set, introduced in the ARMv4T variant. diff --git a/ecosflash/notes.txt b/ecosflash/notes.txt index 773db9f..bf456bb 100644 --- a/ecosflash/notes.txt +++ b/ecosflash/notes.txt @@ -1,4 +1,4 @@ -Some of these binaries are build & linked using eCos. +Some of these binaries are build & linked using eCos. For source for the flash drivers, see: diff --git a/src/server/httpd/menu.xml b/src/server/httpd/menu.xml index ef1d4ec..be14464 100644 --- a/src/server/httpd/menu.xml +++ b/src/server/httpd/menu.xml @@ -1,26 +1,26 @@ <?xml version = "1.0" encoding="iso-8859-1" standalone="yes"?> <?xml-stylesheet type="text/xsl" href="plaintext.xsl"?> <website> - + <language lang="Norsk"> <page lang="eng"> <outfile>index.tcl</outfile> - <menutext>Config Target</menutext> - <menulink>index.tcl</menulink> + <menutext>Config Target</menutext> + <menulink>index.tcl</menulink> <pageheading>OpenOCD debugger</pageheading> <level2parent>index.tcl</level2parent> <level2menu href="index.tcl" title="Target Status" titlestyle="color:#4e6627;"> </level2menu> - <!-- + <!-- <level2menu href="terminal.tcl" title="UART forwarding" titlestyle="color:#4e6627;"> </level2menu> --> - + <pagetext> <markup_code><![CDATA[ - + <table> <tr><td style="height:10px;width:535px;"> </td></tr> <tr><td style="height:1px;width:535px;background-color:#a2c5d1;"></td></tr> @@ -35,18 +35,18 @@ <tcl> set form_address [formfetch form_address] set form_action [formfetch form_action] - + if {[string compare $form_action "Halt"]==0} { append console [encode [capture_catch "halt"]] } if {[string compare $form_action "Resume"]==0} { append console [encode [capture_catch "resume"]] } - + if {[string compare $form_action "Reset and run"]==0} { append console [encode [capture_catch "reset run"]] } - + if {[string compare $form_action "Power on"]==0} { append console [encode [capture_catch "power on"]] } @@ -54,13 +54,13 @@ append console [encode [capture_catch "power off"]] } </tcl> - + <tcl>append console [encode [capture_catch poll]]</tcl> </td> </tr> </table> - <form action="index.tcl" method="post"> + <form action="index.tcl" method="post"> <table><tr> <td><input type="submit" name="form_action" value="Reset and run"></td> <td class="buttonspacesmall"></td><td><input type="submit" name="form_action" value="Halt"></td> @@ -69,32 +69,32 @@ <td class="buttonspacesmall"></td><td><input type="submit" name="form_action" value="Power off"></td> </tr></table> - <br> - <br> - + <br> + <br> + <p> </form> ]]></markup_code> <right_column> <markup_code><![CDATA[ - <p>Target status shows that status of the connected target. </p> + <p>Target status shows that status of the connected target. </p> <p><b>Current target</b> - selected target configuration. <br> <p><b>Startup</b> - whether or not the target script ran to completion. Note that even if the target is disconnected, powered down or unresponsive, the startup script will still run to completion. Startup - OK does not mean that the target is fully operational, simply that the configuration script - did not contain syntax errors for instance. + did not contain syntax errors for instance. See log for details. <br> <p><b>Target power</b> - Detects power on target. <br> If the JTAG cable is not connected, or the target has no power, then no target power will be detected.</p> <p>Type "help power" in telnet for command to control power relay.</p> ]]></markup_code> </right_column> - + </pagetext> </page> - - + + <page lang="eng"> @@ -103,12 +103,12 @@ <pageheading>Target config quick start guide</pageheading> <pagetext> <markup_code><![CDATA[ - + A target needs an openocd.cfg file. This config file sets up the CPU, flash and reset init script. Either OpenOCD ships with an openocd.cfg file for your target or you need to take an existing config file and modify it for your needs. - <p> + <p> The reset init script is crucial. It will set up e.g. MMU, chip select registers, etc. after a reset. The init.cfg (reset init script) is embedded into the openocd.cfg file in the sampls OpenOCD provides. @@ -116,25 +116,25 @@ Writing an openocd.cfg from scratch is a non-trivial exercise, but fortunally it only has to be done once for a target and afterwards it rarely if ever needs to be changed. - - + + ]]></markup_code> <right_column> - - Quick start guide on how to configure a target. + + Quick start guide on how to configure a target. </right_column> </pagetext> - - + + </page> - + <page lang="eng"> <outfile>flashinfo.tcl</outfile> - <menutext>Flash</menutext> - <menulink>flashinfo.tcl</menulink> + <menutext>Flash</menutext> + <menulink>flashinfo.tcl</menulink> <pageheading>Flash Information</pageheading> <level2parent>flashinfo.tcl</level2parent> <level2menu href="flashinfo.tcl" title="Info" titlestyle="color:#4e6627;"> @@ -150,13 +150,13 @@ <markup_code><![CDATA[ <div style="font-size:14px;">Configured flash banks:</div> - <p> + <p> <code style="white-space: nowrap;"> <tcl> set flash_return [ocd_flash_banks] if {[llength $flash_return]!=0} { append buffer [encode [flash banks]] - + set form_action [formfetch form_action] if {[string compare $form_action "Reset CPU and probe flash"]==0} { append console [encode [capture_catch "reset init"]] @@ -168,17 +168,17 @@ } </tcl> <p> - <form action="flashinfo.tcl" method="post"> + <form action="flashinfo.tcl" method="post"> <input type="submit" name="form_action" value="Reset CPU and probe flash"> </form> <tcl> foreach a [ocd_flash_banks] { append buffer "Flash bank at [format "0x%08x size 0x%08x" $a(base) $a(size)]: " </tcl> - <form action="downloadmem.tcl" method="post"> + <form action="downloadmem.tcl" method="post"> <input type="hidden" name="form_address" value="<tcl>append buffer [format "0x%08x" $a(base)]</tcl>"> <input type="hidden" name="form_length" value="<tcl>append buffer [format "0x%08x" $a(size)]</tcl>"> - + <input type="submit" value="Download" name="form_action"> <br> </form> @@ -186,7 +186,7 @@ } </tcl> </code> - + ]]></markup_code> <right_column> @@ -198,7 +198,7 @@ the different sectors in the flash, and the flash driver used.</p> ]]> </right_column> - + </pagetext> </page> @@ -208,82 +208,82 @@ <pageheading>Program / Verify Flash</pageheading> <pagetext> <markup_code><![CDATA[ - + <tcl> - + set form_offset [formfetch form_offset] set form_action [formfetch form_action] set form_type [formfetch form_type] - - + + set post "" catch {set post $post_data} err - + if {[string compare $form_offset ""]==0} { set form_offset 0 } if {[string compare $form_type ""]==0} { set form_type "" } - + </tcl><code style="white-space: nowrap;"><tcl> - + set data "" append buffer {<form enctype="multipart/form-data" action="flash.tcl" method="post">} - - set action_reset [expr {[string length $form_action]!=0}] - set action_flash [expr {[string compare $form_action "Flash"]==0 || [string compare $form_action "Flash and verify"]==0}] + + set action_reset [expr {[string length $form_action]!=0}] + set action_flash [expr {[string compare $form_action "Flash"]==0 || [string compare $form_action "Flash and verify"]==0}] set action_verify [expr {[string compare $form_action "Verify"]==0 || [string compare $form_action "Flash and verify"]==0}] - + if {$action_reset} { append console [encode [capture_catch "reset init"]] } </tcl> </code><tcl> - + append buffer {<table>} append buffer {<tr><td class="formtext">File</td><td><input type="file" name="form_filecontent"></td></tr>} append buffer "<tr><td class=\"formtext\" >Offset</td><td><input type=\"text\" name=\"form_offset\" value=\"$form_offset\"></td></tr>" - + </tcl> <tr><td class="formtext" style="padding-top:1px;">Type</td><td> <select name="form_type"> - <option - <tcl>if {[string compare $form_type ""]==0} { append buffer {selected="selected"} } </tcl> - value ="">auto</option> - <option - <tcl>if {[string compare $form_type "elf"]==0} { append buffer {selected="selected"} } </tcl> - value ="elf">elf</option> - <option - <tcl>if {[string compare $form_type "bin"]==0} { append buffer {selected="selected"} } </tcl> - value ="bin">binary</option> - <option - <tcl>if {[string compare $form_type "ihex"]==0} { append buffer {selected="selected"} } </tcl> - value ="ihex">ihex</option> - <!-- broken <option value ="s19">s19</option> --> + <option + <tcl>if {[string compare $form_type ""]==0} { append buffer {selected="selected"} } </tcl> + value ="">auto</option> + <option + <tcl>if {[string compare $form_type "elf"]==0} { append buffer {selected="selected"} } </tcl> + value ="elf">elf</option> + <option + <tcl>if {[string compare $form_type "bin"]==0} { append buffer {selected="selected"} } </tcl> + value ="bin">binary</option> + <option + <tcl>if {[string compare $form_type "ihex"]==0} { append buffer {selected="selected"} } </tcl> + value ="ihex">ihex</option> + <!-- broken <option value ="s19">s19</option> --> </select> </td> - + </tr> - - + + </table> - + <table> <tr><td style="height:15px;width:535px;"> </td></tr> <tr><td style="height:1px;width:535px;background-color:#a2c5d1;"></td></tr> <tr><td style="height:15px;width:535px;"> </td></tr> </table> - + <table><tr> <td><input type="submit" name="form_action" value="Flash" ></td> <td class="buttonspacesmall"></td><td><input type="submit" name="form_action" value="Flash and verify" ></td> <td class="buttonspacesmall"></td><td><input type="submit" name="form_action" value="Verify" ></td> </tr></table> - + <p> <tcl> - + if {$action_flash||$action_verify} { catch {writeform form_filecontent $upload_filename} result append console [encode $result] @@ -313,27 +313,27 @@ } append buffer "</b>" } - </tcl> - + </tcl> + </form> - + ]]></markup_code> - + <right_column> <![CDATA[ <p>Program and/or verify the flash on your target.</p> <p><b>Flash</b> - Halt CPU, automatically erase flash if required and program flash with image.</p> <p><b>Flash and verify</b> - Programs the flash and verifies the programmed flash content is correct.</p> <p><b>Verify</b> - Halt CPU and verify image in flash or RAM.</p> - <p><b>Offset</b> - This value is added to the address of the image.<br> - Binary images start at address 0 by default, whereas elf and ihex have addresses encoded into the image.<br> + <p><b>Offset</b> - This value is added to the address of the image.<br> + Binary images start at address 0 by default, whereas elf and ihex have addresses encoded into the image.<br> Typically 0 for elf/ihex and the address to write the image to for binary files.</p> - ]]> + ]]> </right_column> - - + + </pagetext> - + </page> @@ -350,23 +350,23 @@ set form_serialnumber [formfetch form_serialnumber] append buffer [production_info] </tcl> - + <form enctype="multipart/form-data" action="production.tcl" method="post"> <code style="white-space: nowrap;"> - <tcl> + <tcl> if {[string compare $form_action "Upload firmware"]==0} { - set wrotedata [catch {writeform form_filecontent $upload_filename} result] + set wrotedata [catch {writeform form_filecontent $upload_filename} result] append buffer [encode $result] if {$wrotedata==0} { append buffer "<br>Running production procedure<p>" append buffer "<br>Reset and init: <br>" - + append console [encode [capture_catch {catch "production $upload_filename $form_serialnumber"}]] } } if {[string compare $form_action "Test"]==0} { append buffer "<br>Running production test. Output from first 10 seconds printed below. <p>" - + append console [encode [capture_catch {catch production_test}]] } if {[string compare $form_action "Power on"]==0} { @@ -381,13 +381,13 @@ append buffer {<p class="formtext">Firmware file(raw binary) <input type="file" name="form_filecontent"><p>} append buffer {<p class="formtext">Serial number <input type="text" name="form_serialnumber"><p>} </tcl> - + <table> <tr><td style="height:15px;width:535px;"> </td></tr> <tr><td style="height:1px;width:535px;background-color:#a2c5d1;"></td></tr> <tr><td style="height:15px;width:535px;"> </td></tr> </table> - + <table><tr> <td><input type="submit" name="form_action" value="Upload firmware" ></td> <td class="buttonspacesmall"> </td><td><input type="submit" name="form_action" value="Test"></td> @@ -395,55 +395,55 @@ <td class="buttonspacesmall"> </td><td><input type="submit" name="form_action" value="Power off"> </tr></table> </form> - + ]]></markup_code> - + <right_column> <![CDATA[ The target script can implement the "production", "production_info" and "production_test" tcl proc's. These procedures are used on this page. There are default implementations that do nothing. - + <p><b>Upload firmware</b> - Power cycle target, reset target and program raw binary file to flash bank 0, offset 0 and verify flash programming. Leave target powered on.</p> - <p><b>Test</b> - Power up target, run 10 second target test. Output is provided via the DCC output channel. </p> + <p><b>Test</b> - Power up target, run 10 second target test. Output is provided via the DCC output channel. </p> <p><b>Power on</b> - Power on target.</p> <p><b>Power off</b> - Power off target.</p> <p><b>Serial number</b> - A target script can use this string in the production procedure. Type "help production" for more info.</p> - ]]> + ]]> </right_column> - - + + </pagetext> - + </page> <page lang="eng"> <outfile>erase.tcl</outfile> - <menulink>erase.tcl</menulink> + <menulink>erase.tcl</menulink> <pageheading>Erase Flash</pageheading> <level2parent>flashinfo.tcl</level2parent> <pagetext> <markup_code><![CDATA[ - + <tcl> - + set form_address [formfetch form_address] set form_length [formfetch form_length] set form_action [formfetch form_action] - + if {[string compare $form_length ""]==0} { set form_length 0x10000 - } + } if {[string compare $form_address ""]==0} { if {[catch {[first_flash_base]} result]==0} { set form_address "0x[tohex $result]" - } - } - - + } + } + + if {[string compare $form_address ""]!=0} { if {[string compare $form_action "Erase"]==0} { append buffer "<code style=\"white-space: nowrap;\">" @@ -451,13 +451,13 @@ reset init flash erase_address $form_address $form_length}]] append buffer </code> - } + } } - - + + </tcl> - - <form action="erase.tcl" method="post"> + + <form action="erase.tcl" method="post"> <table> <tr><td class="formtext" style="padding-right:10px;">Address</td><td><input type="text" name="form_address" value="<tcl>append buffer $form_address</tcl>"></td></tr> <tr><td class="formtext">Length</td><td><input type="text" name="form_length" value="<tcl>append buffer $form_length</tcl>"></td></tr> @@ -468,14 +468,14 @@ <tr><td style="height:1px;width:535px;background-color:#a2c5d1;"></td></tr> <tr><td style="height:15px;width:535px;"> </td></tr> </table> - + <input type="submit" name="form_action" value="Erase"><br> - - + + </form> - - + + ]]></markup_code> <right_column> <![CDATA[ @@ -484,21 +484,21 @@ <p>The length field is specified in number of bytes.</p> ]]> </right_column> - + </pagetext> </page> <page lang="eng"> <outfile>run.tcl</outfile> - <menulink>run.tcl</menulink> + <menulink>run.tcl</menulink> <pageheading>Run program</pageheading> <level2parent>flashinfo.tcl</level2parent> <pagetext> <markup_code><![CDATA[ - + <tcl> set form_address [formfetch form_address] @@ -508,26 +508,26 @@ if {[string compare $form_action "Run from address"]==0} { append console [encode [capture_catch "halt"]] append console [encode [capture_catch "wait_halt"]] append console [encode [capture_catch "resume $form_address"]] -} +} if {[string compare $form_action "Halt"]==0} { append console [encode [capture_catch "halt"]] append console [encode [capture_catch "wait_halt"]] } - + if {[string compare $form_action "Reset and run"]==0} { append console [encode [capture_catch "reset run"]] } - + if {[string compare $form_action "Reset and init"]==0} { append console [encode [capture_catch "reset init"]] -} +} append console [encode [capture_catch poll]] </tcl> -<form action="run.tcl" method="post"> +<form action="run.tcl" method="post"> <table> <tr><td class="formtext" style="padding-right:10px;">Address</td><td><input type="text" name="form_address" value="<tcl>append buffer $form_address</tcl>"></td></tr> </td></tr> @@ -537,12 +537,12 @@ append console [encode [capture_catch poll]] <tr><td style="height:1px;width:535px;background-color:#a2c5d1;"></td></tr> <tr><td style="height:15px;width:535px;"> </td></tr> </table> - + <input type="submit" name="form_action" value="Reset and run"> <input type="submit" name="form_action" value="Run from address"> <input type="submit" name="form_action" value="Halt"><input type="submit" name="form_action" value="Reset and init"><br> </form> - - + + ]]></markup_code> <right_column> <![CDATA[ @@ -552,15 +552,15 @@ append console [encode [capture_catch poll]] <p>Reset and init - reset CPU and run init script.</p> ]]> </right_column> - + </pagetext> </page> <page lang="eng"> <outfile>browsemem.tcl</outfile> - <menutext>Memory</menutext> - <menulink>browsemem.tcl</menulink> + <menutext>Memory</menutext> + <menulink>browsemem.tcl</menulink> <pageheading>Browse / Edit Memory</pageheading> <level2parent>browsemem.tcl</level2parent> <level2menu href="browsemem.tcl" title="Browse / Edit" titlestyle="color:#4e6627;"> @@ -570,53 +570,53 @@ append console [encode [capture_catch poll]] </level2menu> <level2menu href="downloadmem.tcl" title="Download" titlestyle="color:#4e6627;"> <![CDATA[ - Copy memory range to developer machine + Copy memory range to developer machine ]]> </level2menu> - + <pagetext> <markup_code><![CDATA[ - + <tcl> - + set form_address [formfetch form_address] set form_length [formfetch form_length] set form_type [formfetch form_type] set form_action [formfetch form_action] set form_value [formfetch form_value] - + if {[string compare $form_length ""]==0} { set form_length 0 - } + } if {$form_length<=0} { set form_length 0x80 - } + } if {$form_length>0x1000} { set form_length 0x1000 - } - + } + if {[string compare $form_type ""]==0} { set form_type mdw } - + if {[string compare $form_type "mdw"]==0} { set wordsize 4 - set modify_cmd mww + set modify_cmd mww } if {[string compare $form_type "mdh"]==0} { set wordsize 2 - set modify_cmd mwh + set modify_cmd mwh } if {[string compare $form_type "mdb"]==0} { set wordsize 1 - set modify_cmd mwb + set modify_cmd mwb } - - - - + + + + if {[string compare $form_address ""]!=0} { if {[string compare $form_action "Previous"]==0} { # Kludge! Work around problems parsing hex in Jim Tcl expressions @@ -626,24 +626,24 @@ append console [encode [capture_catch poll]] } else { set form_address "0x0" } - } + } if {[string compare $form_action "Next"]==0} { # Kludge! Work around problems parsing hex in Jim Tcl expressions incr form_address ; set form_address [expr $form_address-1] set form_address "0x[tohex [expr $form_address+$form_length]]" - } + } if {[string compare $form_action "Modify"]==0} { append console [capture_catch "$modify_cmd $form_address $form_value"] - } + } if {[string compare $form_action "Fill"]==0} { append console [capture_catch "$modify_cmd $form_address $form_value $form_length"] - } + } } - - + + </tcl> - - <form action="browsemem.tcl" method="post"> + + <form action="browsemem.tcl" method="post"> <table> <tr><td class="formtext">Address</td><td><input type="text" name="form_address" value="<tcl>append buffer $form_address</tcl>"></td></tr> <tr><td class="formtext">Length</td><td><input type="text" name="form_length" value="<tcl>append buffer "0x[tohex $form_length]"</tcl>"></td></tr> @@ -652,17 +652,17 @@ append console [encode [capture_catch poll]] <td class="buttonspacesmall"> </td><td><input type="submit" name="form_action" value="Fill"></td></tr> <tr><td class="formtext">Type</td><td style="padding-top:1px;"> <select name="form_type"> - <option - <tcl>if {[string compare $form_type "mdb"]==0} { append buffer {selected="selected"} } </tcl> value ="mdb">8 bit - </option> - <option - <tcl>if {[string compare $form_type "mdh"]==0} { append buffer {selected="selected"} } </tcl> value ="mdh">16 bit - </option> - <option - <tcl>if {[string compare $form_type "mdw"]==0} { append buffer {selected="selected"} } </tcl>value ="mdw">32 bit - </option> + <option + <tcl>if {[string compare $form_type "mdb"]==0} { append buffer {selected="selected"} } </tcl> value ="mdb">8 bit + </option> + <option + <tcl>if {[string compare $form_type "mdh"]==0} { append buffer {selected="selected"} } </tcl> value ="mdh">16 bit + </option> + <option + <tcl>if {[string compare $form_type "mdw"]==0} { append buffer {selected="selected"} } </tcl>value ="mdw">32 bit + </option> </select> - + </td></tr> </table> <table> @@ -670,14 +670,14 @@ append console [encode [capture_catch poll]] <tr><td style="height:1px;width:535px;background-color:#a2c5d1;"></td></tr> <tr><td style="height:15px;width:535px;"> </td></tr> </table> - + <table><tr> <td><input type="submit" name="form_action" value="Refresh"></td> <td class="buttonspacesmall"> </td><td><input type="submit" name="form_action" value="Previous" ></td> <td class="buttonspacesmall"> </td><td><input type="submit" name="form_action" value="Next" ></td> </tr></table> <br> - + </form> <p> <div class="fontbigger">Memory:</div><p> @@ -686,19 +686,19 @@ append console [encode [capture_catch poll]] if {[string compare $form_address ""]!=0} { append console [encode [capture_catch halt]] append buffer [encode [capture_catch "$form_type $form_address [expr $form_length]"]] - } + } </tcl> </code> - - + + ]]></markup_code> <right_column> <![CDATA[ <p>Browse and edit target memory.<br> - Length is in bytes, maximum 4096 bytes.</p> + Length is in bytes, maximum 4096 bytes.</p> <p>An error message is shown when trying to browse or edit memory which cases a CPU fault.</p> <p>CPU will be halted if required.</p> <p><b>Modify</b> - Will modify only one byte, half-word or word starting at Address.</p> @@ -706,11 +706,11 @@ append console [encode [capture_catch poll]] <p><b>Refresh</b> - Display the content of the specified memory area.</p> ]]> </right_column> - + </pagetext> </page> - + <page lang="eng"> @@ -723,8 +723,8 @@ append console [encode [capture_catch poll]] set form_address [formfetch form_address] set form_length [formfetch form_length] set form_action [formfetch form_action] - </tcl> - <form action="downloadmem.tcl" method="post"> + </tcl> + <form action="downloadmem.tcl" method="post"> <table> <tr><td class="formtext">Address</td><td><input type="text" name="form_address" value="<tcl>append buffer $form_address</tcl>"></td></tr> <tr><td class="formtext">Length</td><td><input type="text" name="form_length" value="<tcl>append buffer $form_length</tcl>"></td></tr> @@ -736,29 +736,29 @@ append console [encode [capture_catch poll]] <tr><td style="height:1px;width:535px;background-color:#a2c5d1;"></td></tr> <tr><td style="height:15px;width:535px;"> </td></tr> </table> - + <input type="submit" value="Download" name="form_action"> - - + + </form> <tcl> if {[string compare $form_action "Download"]==0} { append console [encode [capture_catch "reset init"]] append console [encode [capture_catch "dump_image /tmp/dump.bin $form_address $form_length"]] </tcl> - <form action="../dump.bin" target="_blank"> + <form action="../dump.bin" target="_blank"> <input type="submit" name="form_action" value="Save downloaded memory"> </form> - <tcl> + <tcl> } - + </tcl> - + ]]></markup_code> <right_column> - <![CDATA[ + <![CDATA[ Download memory from target. <br> <b>Note</b> that download memory can take a long time(potentially minutes for megabytes at low JTAG clk speeds). @@ -768,25 +768,25 @@ append console [encode [capture_catch poll]] ]]> </right_column> </pagetext> - + </page> <page lang="eng"> <outfile>openocd.tcl</outfile> - <menutext>OpenOCD</menutext> - <menulink>openocd.tcl</menulink> + <menutext>OpenOCD</menutext> + <menulink>openocd.tcl</menulink> <pageheading>Run Command</pageheading> <level2parent>openocd.tcl</level2parent> <level2menu href="openocd.tcl" title="Run Command" titlestyle="color:#4e6627;"> </level2menu> <level2menu href="guiupload.tcl" title="Upload File" titlestyle="color:#4e6627;"> <![CDATA[ - Upload file + Upload file ]]> </level2menu> - + <pagetext> <markup_code><![CDATA[ @@ -797,23 +797,23 @@ append console [encode [capture_catch poll]] if {[string length $form_command]>0} { set form_edittext [capture_catch {eval $form_command}] } - + append buffer {<form action="openocd.tcl" method="post">} "\n" append buffer {Command<br>} - append buffer {<textarea style="overflow:auto;" rows="5" cols="65" name="form_command" wrap="off">} + append buffer {<textarea style="overflow:auto;" rows="5" cols="65" name="form_command" wrap="off">} append buffer [to_textarea $form_command] append buffer {</textarea><br>} append buffer {<input type="submit" value="Run" name="form_action" ><br>} - append buffer {<textarea style="overflow:auto;" rows="21" cols="65" name="form_edittext" readonly=1 wrap="off">} + append buffer {<textarea style="overflow:auto;" rows="21" cols="65" name="form_edittext" readonly=1 wrap="off">} append buffer [to_textarea $form_edittext] append buffer {</textarea><br>} - + append buffer {</form>} "\n" - + </tcl> ]]></markup_code> - + <right_column> <![CDATA[ <p>Run tcl statement(s). Add "ocd_" prefix to OpenOCD commands otherwise @@ -828,28 +828,28 @@ append console [encode [capture_catch poll]] <code> curl --form form_command=ocd_version <tcl>append buffer [ip]</tcl>runtcl.tcl </code> - + ]]> </right_column> </pagetext> </page> - - + + <page lang="eng"> <outfile>guiupload.tcl</outfile> <level2parent>openocd.tcl</level2parent> <pageheading>Upload File</pageheading> <pagetext> <markup_code><![CDATA[ - + <tcl> set form_filename [formfetch form_filename]; set form_action [formfetch form_action]; #set form_filecontent [formfetch form_filecontent]; - + append buffer {<form enctype="multipart/form-data" action="guiupload.tcl" method="post">} - append buffer <br> + append buffer <br> if {[string compare $form_action "Upload"]==0} { if {[catch {writeform form_filecontent $form_filename} result]==0} { append buffer [encode $result] @@ -857,20 +857,20 @@ append console [encode [capture_catch poll]] append buffer Wrote $form_filename } } - + append buffer {<table style="padding:0px;border-collapse:collapse;"><tr><td class="formtext">Filename on OpenOCD machine</td><td><input type="text" name="form_filename"></td></tr>} append buffer {<td class="formtext">File to upload</td><td><input type="file" name="form_filecontent"></td></tr></table>} append buffer {<table><tr><td style="height:15px;width:535px;"> </td></tr><tr><td style="height:1px;width:535px;background-color:#a2c5d1;"></td></tr><tr><td style="height:15px;width:535px;"> </td></tr></table>} append buffer {<input type="submit" name="form_action" value="Upload" ><br> } append buffer {</form>} - + </tcl> - + ]]></markup_code> </pagetext> - + </page> - + <page lang="eng"> @@ -879,12 +879,12 @@ append console [encode [capture_catch poll]] <pageheading>Target config quick start guide</pageheading> <pagetext> <markup_code><![CDATA[ - + A target needs an openocd.cfg file. This config file sets up the CPU, flash and reset init script. Either OpenOCD ships with an openocd.cfg file for your target or you need to take an existing config file and modify it for your needs. - <p> + <p> The reset init script is crucial. It will set up e.g. MMU, chip select registers, etc. after a reset. The init.cfg (reset init script) is embedded into the openocd.cfg file in the sampls OpenOCD provides. @@ -892,24 +892,24 @@ append console [encode [capture_catch poll]] Writing an openocd.cfg from scratch is a non-trivial exercise, but fortunally it only has to be done once for a target and afterwards it rarely if ever needs to be changed. - - + + ]]></markup_code> <right_column> - - Quick start guide on how to configure a target. + + Quick start guide on how to configure a target. </right_column> </pagetext> - - + + </page> - + <page lang="eng"> - <menulink>index.tcl</menulink> + <menulink>index.tcl</menulink> <level2parent>index.tcl</level2parent> <outfile>terminal.tcl</outfile> <pageheading>UART forwarding</pageheading> @@ -924,27 +924,27 @@ append console [encode [capture_catch poll]] set form_action [formfetch form_action] </tcl> <form action="terminal.tcl" method="post"> - Target baudrate: + Target baudrate: <select name="form_baudrate"> <tcl> - foreach i {9600 19200 38400 57600 115200} { + foreach i {9600 19200 38400 57600 115200} { + </tcl> + <option <tcl>if {[string compare $form_baudrate $i]==0} { append buffer {selected="selected"} } </tcl> + value ="<tcl>append buffer $i</tcl>"><tcl>append buffer $i</tcl></option> + <tcl> + } </tcl> - <option <tcl>if {[string compare $form_baudrate $i]==0} { append buffer {selected="selected"} } </tcl> - value ="<tcl>append buffer $i</tcl>"><tcl>append buffer $i</tcl></option> - <tcl> - } - </tcl> </select> - <p> + <p> <input type="submit" name="form_action" value="Set baudrate" > - </form> + </form> <tcl> if {[string compare $form_action "Set baudrate"]==0} { append console [encode [ocd_uart $form_baudrate]] } </tcl> - + <h2>Simple UART</h2> This terminal window is purely for illustrative purposes. Use telnet or a terminal program to talk to the target over TCP/IP for anything but trivial case of reading/writing a few @@ -963,11 +963,11 @@ append console [encode [capture_catch poll]] ]]> </right_column> </pagetext> - + </page> - + </language> - -</website> \ No newline at end of file + +</website> diff --git a/src/server/httpd/menu.xsl b/src/server/httpd/menu.xsl index 7b47d9e..b54f16c 100644 --- a/src/server/httpd/menu.xsl +++ b/src/server/httpd/menu.xsl @@ -2,7 +2,7 @@ <!DOCTYPE xsl:stylesheet [<!ENTITY nbsp " ">]> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/TR/REC-html40" version="1.0"> <xsl:output method="html" version="4.0" indent="yes" encoding="UTF-8" - + media-type="text/plain; charset=UTF-8"/> <xsl:param name="pagetogenerate" select="UNDEFINED"/> @@ -16,17 +16,17 @@ <html> <head> <title>OpenOCD debugger</title> - <meta http-equiv="Content-Type" content="text/html" charset="utf-8"/> - <link href="menuweb.css" rel="stylesheet" type="text/css"/> - + <meta http-equiv="Content-Type" content="text/html" charset="utf-8"/> + <link href="menuweb.css" rel="stylesheet" type="text/css"/> + </head> - - + + <tcl> set console "" set upload_filename /ram/upload </tcl> - + <body style="margin:0px;"> <div style="width:974px;height:85px;"> <div style="float:left;position:relative;left:32px;width:478px;"> @@ -92,17 +92,17 @@ </xsl:for-each> <tr> <td style="width:140px;height:35px;background-image:url('menu_cuts/v_1.png')"> - + </td> </tr> <tr> <td style="width:140px;background-image:url('menu_cuts/v_2_tile.png')"> - + </td> </tr> <tr> <td style="width:140px;height:140px;background-image:url('menu_cuts/v_3.png')"> - + </td> </tr> </table> @@ -142,96 +142,96 @@ </xsl:for-each> </tr> </table> - </td> - </tr> - <tr> - <td colspan="6" style="height:30px;width:535px;background-image:url('menu_cuts/center_top.png');background-repeat: no-repeat;background-position:top right;"> - <div style="width:500px;background-color:#ffffff;height:100%;"> - - </div> - </td> - </tr> - <tr> - <td colspan="6" style="background-color:#ffffff;text-indent:30px;height:40px;"> - <H1><xsl:value-of select="pageheading"/></H1> - </td> - </tr> - <tr style="height:100%;"> - <td colspan="6" style="background-color:#ffffff;padding-left:30px;padding-right:30px;width=535px;height:100%;"> + </td> + </tr> + <tr> + <td colspan="6" style="height:30px;width:535px;background-image:url('menu_cuts/center_top.png');background-repeat: no-repeat;background-position:top right;"> + <div style="width:500px;background-color:#ffffff;height:100%;"> + + </div> + </td> + </tr> + <tr> + <td colspan="6" style="background-color:#ffffff;text-indent:30px;height:40px;"> + <H1><xsl:value-of select="pageheading"/></H1> + </td> + </tr> + <tr style="height:100%;"> + <td colspan="6" style="background-color:#ffffff;padding-left:30px;padding-right:30px;width=535px;height:100%;"> <xsl:value-of disable-output-escaping="yes" select="pagetext/markup_code"/> - </td> - </tr> - <tcl> - <!-- This is the output from any OpenOCD commands --> - set toggle_details [formfetch toggle_details] - if {[string length $toggle_details]==0} { - set toggle_details 0 - } - set show_details [load_var show_details] - if {[string length $show_details]==0} { - set show_details 0 - } - if {$toggle_details==1} { - set show_details [expr 1-$show_details] - save_var show_details $show_details - } - - if {[string length $console]!=0} { - </tcl> - <tr style="height:100%;"> - <td colspan="6" style="height:100%;background-color:red;"> + </td> + </tr> + <tcl> + <!-- This is the output from any OpenOCD commands --> + set toggle_details [formfetch toggle_details] + if {[string length $toggle_details]==0} { + set toggle_details 0 + } + set show_details [load_var show_details] + if {[string length $show_details]==0} { + set show_details 0 + } + if {$toggle_details==1} { + set show_details [expr 1-$show_details] + save_var show_details $show_details + } + + if {[string length $console]!=0} { + </tcl> + <tr style="height:100%;"> + <td colspan="6" style="height:100%;background-color:red;"> <table class="textgray" style="padding:0px;border-collapse:collapse;background-color:#ffffff;width:100%"> - <td style="width:25px;"> </td> - <tcl> - if {$show_details==1} { - append buffer <xsl:text disable-output-escaping="yes"><![CDATA[<]]></xsl:text> - append buffer {td style="background-color:#dddddd;padding-left:5px;padding-right:5px;padding-top:3px;padding-bottom:3px;"} - append buffer <xsl:text disable-output-escaping="yes"><![CDATA[>]]></xsl:text> - } else { - append buffer <xsl:text disable-output-escaping="yes"><![CDATA[<]]></xsl:text> - append buffer {td style="background-image:url('menu_cuts/h_tab_free.png');width:110px;height:29px;background-repeat: no-repeat;background-position:top left;"} - append buffer <xsl:text disable-output-escaping="yes"><![CDATA[>]]></xsl:text> - } - </tcl> - <a class="openocd"> + <td style="width:25px;"> </td> + <tcl> + if {$show_details==1} { + append buffer <xsl:text disable-output-escaping="yes"><![CDATA[<]]></xsl:text> + append buffer {td style="background-color:#dddddd;padding-left:5px;padding-right:5px;padding-top:3px;padding-bottom:3px;"} + append buffer <xsl:text disable-output-escaping="yes"><![CDATA[>]]></xsl:text> + } else { + append buffer <xsl:text disable-output-escaping="yes"><![CDATA[<]]></xsl:text> + append buffer {td style="background-image:url('menu_cuts/h_tab_free.png');width:110px;height:29px;background-repeat: no-repeat;background-position:top left;"} + append buffer <xsl:text disable-output-escaping="yes"><![CDATA[>]]></xsl:text> + } + </tcl> + <a class="openocd"> <xsl:attribute name="href"><xsl:value-of select="$pagetogenerate"/>?toggle_details=1</xsl:attribute> <tcl> if {$show_details==1} { append buffer "Hide details" - append buffer <br/> + append buffer <br/> } else { append buffer {<div style="position:relative;top:7px;text-align:center;">} append buffer "Show details" append buffer {</div>} } </tcl> - </a> - <tcl> - if {$show_details==1} { - append buffer $console - } - </tcl> + </a> + <tcl> + if {$show_details==1} { + append buffer $console + } + </tcl> <xsl:text disable-output-escaping="yes"><![CDATA[<]]></xsl:text>/td<xsl:text disable-output-escaping="yes"><![CDATA[>]]></xsl:text> <tcl> - if {$show_details!=1} { - append buffer {<td> </td>} - } + if {$show_details!=1} { + append buffer {<td> </td>} + } </tcl> - <td style="width:25px;"> </td> - </table> - </td> + <td style="width:25px;"> </td> + </table> + </td> </tr> - <tcl> + <tcl> } </tcl> - <tr> - <td colspan="6" style="height:30px;background-image:url('menu_cuts/center_bottom.png');background-repeat: no-repeat;background-position:top right;"> - <div style="width:500px;background-color:#ffffff;height:100%;"> - - </div> - </td> - </tr> - </table> + <tr> + <td colspan="6" style="height:30px;background-image:url('menu_cuts/center_bottom.png');background-repeat: no-repeat;background-position:top right;"> + <div style="width:500px;background-color:#ffffff;height:100%;"> + + </div> + </td> + </tr> + </table> </td> <td style="width:6px;"> </td> @@ -240,56 +240,56 @@ <tr> <td style="width:103px;height:29px;background-image:url('menu_cuts/h_tab2_selected.png');background-repeat: no-repeat;"> <div class="textgray" style="position:relative;top:7px;;font-weight:bold;text-align:center;width:100px;"> - Documentation + Documentation </div> - </td> - <td width="40px"> - - </td> - <td> - </td> + </td> + <td width="40px"> + + </td> + <td> + </td> + </tr> + <tr> + <td colspan="3" style="height:10px;width:245px;background-image:url('menu_cuts/right_top_small.png');"></td> + </tr> + <tr> + <td colspan="3" style="background-color:#d8d7d7;width:245px;padding-left:10px;padding-buttom:10px;line-height:17px;"> + <a href="http://openocd.berlios.de/doc/openocd.pdf" target="_blank">OpenOCD Manual</a><br/> + </td> </tr> - <tr> - <td colspan="3" style="height:10px;width:245px;background-image:url('menu_cuts/right_top_small.png');"></td> - </tr> - <tr> - <td colspan="3" style="background-color:#d8d7d7;width:245px;padding-left:10px;padding-buttom:10px;line-height:17px;"> - <a href="http://openocd.berlios.de/doc/openocd.pdf" target="_blank">OpenOCD Manual</a><br/> - </td> - </tr> - <tr><td colspan="3" style="background-color:#d8d7d7;height:15px;"></td></tr> - <tr> - <td colspan="3"> - <table style="padding:0px;border-collapse:collapse;"> - <td style="background-color:#d8d7d7;width:10px;height:1px"></td> - <td style="background-color:#999999;width:225px; height:1px;"></td> - <td style="background-color:#d8d7d7;width:10px;height:1px"></td> - </table> - </td> - </tr> - <tr><td colspan="3" style="background-color:#d8d7d7;height:15px;"></td></tr> - <tr style="height:100%;"> - <td class="textgray" colspan="3" style="height:100%;background-color:#d8d7d7;padding-left:10px;padding-right:10px;"> + <tr><td colspan="3" style="background-color:#d8d7d7;height:15px;"></td></tr> + <tr> + <td colspan="3"> + <table style="padding:0px;border-collapse:collapse;"> + <td style="background-color:#d8d7d7;width:10px;height:1px"></td> + <td style="background-color:#999999;width:225px; height:1px;"></td> + <td style="background-color:#d8d7d7;width:10px;height:1px"></td> + </table> + </td> + </tr> + <tr><td colspan="3" style="background-color:#d8d7d7;height:15px;"></td></tr> + <tr style="height:100%;"> + <td class="textgray" colspan="3" style="height:100%;background-color:#d8d7d7;padding-left:10px;padding-right:10px;"> <xsl:choose> <xsl:when test="(pagetext/right_column)"> <xsl:value-of disable-output-escaping="yes" select="pagetext/right_column"/> </xsl:when> <xsl:otherwise> - + </xsl:otherwise> </xsl:choose> - </td> - </tr> - <tr> - <td colspan="3" style="height:30px;background-image:url('menu_cuts/right_bottom.png');"> - - </td> - </tr> + </td> + </tr> + <tr> + <td colspan="3" style="height:30px;background-image:url('menu_cuts/right_bottom.png');"> + + </td> + </tr> </table> - + </td> </tr> - + </table> </body> </html> diff --git a/src/server/httpd/menuweb.css b/src/server/httpd/menuweb.css index ac87c85..60c6239 100644 --- a/src/server/httpd/menuweb.css +++ b/src/server/httpd/menuweb.css @@ -70,7 +70,7 @@ body font-size: 12px; line-height: 15px; color : #024d67; - + } h1 @@ -86,7 +86,7 @@ td { padding: 0px; font-size: 12px; - vertical-align:top; + vertical-align:top; } @@ -95,7 +95,7 @@ td color: #cccccc; padding: 0px; font-size: 12px; - vertical-align:top; + vertical-align:top; } diff --git a/src/server/httpd/readme.txt b/src/server/httpd/readme.txt index bade32c..7bc80e6 100644 --- a/src/server/httpd/readme.... [truncated message content] |