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...> - 2009-12-03 23:44:19
|
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 adbf40a04537acba3cf5fea7b71dab6ac3249646 (commit) from de27ebfa837a13309a03bfa0674513deed0d59e9 (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 adbf40a04537acba3cf5fea7b71dab6ac3249646 Author: David Brownell <dbr...@us...> Date: Thu Dec 3 14:44:03 2009 -0800 fix another init regression This makes Beagle work again, instead of losing horribly because the JTAG event handlers are no longer able to e.g. "runtest". I get the previous quirky behavior ... comes up OK but "reset halt" somewhat mysteriously makes it all better. (Instead of nothing being able to work at all...) However, I'm still seeing: The 'init' command must be used before 'init'. That seems to come from invoking "jtag init", sometime after it gets mapped to "ocd_jtag init", according to debug message traces. Signed-off-by: David Brownell <dbr...@us...> diff --git a/src/openocd.c b/src/openocd.c index 03a57dc..da15969 100644 --- a/src/openocd.c +++ b/src/openocd.c @@ -121,18 +121,21 @@ COMMAND_HANDLER(handle_init_command) } LOG_DEBUG("jtag interface init complete"); - /* Try to initialize & examine the JTAG chain at this point, but - * continue startup regardless */ + /* Try to initialize & examine the JTAG chain at this point, + * but continue startup regardless. Note that platforms + * need to be able to provide JTAG event handlers that use + * a variety of JTAG operations in order to do that... + */ + command_context_mode(CMD_CTX, COMMAND_EXEC); if (command_run_line(CMD_CTX, "jtag init") == ERROR_OK) { - command_context_mode(CMD_CTX, COMMAND_EXEC); LOG_DEBUG("Examining targets..."); if (target_examine() != ERROR_OK) LOG_DEBUG("target examination failed"); - command_context_mode(CMD_CTX, COMMAND_CONFIG); } else LOG_WARNING("jtag initialization failed; try 'jtag init' again."); + command_context_mode(CMD_CTX, COMMAND_CONFIG); if (command_run_line(CMD_CTX, "flash init") != ERROR_OK) return ERROR_FAIL; ----------------------------------------------------------------------- Summary of changes: src/openocd.c | 11 +++++++---- 1 files changed, 7 insertions(+), 4 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: Zach W. <zw...@us...> - 2009-12-03 14:39:23
|
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 de27ebfa837a13309a03bfa0674513deed0d59e9 (commit) via 23f07d08e3998642326aa115cdd4cb1199f2704b (commit) from 434f570e51a0b0f2c09184646d91154c74bbff81 (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 de27ebfa837a13309a03bfa0674513deed0d59e9 Author: Zachary T Welch <zw...@su...> Date: Thu Dec 3 05:23:16 2009 -0800 fix double 'init' regression To prevent regression in the behavior of 'init', we allow it to run in any mode. If provided with -c init and with -c noinit, then the second init at startup caused a spurious mode failure. Let 'init' handle it. diff --git a/src/openocd.c b/src/openocd.c index 793aa6a..03a57dc 100644 --- a/src/openocd.c +++ b/src/openocd.c @@ -171,7 +171,7 @@ static const struct command_registration openocd_command_handlers[] = { { .name = "init", .handler = &handle_init_command, - .mode = COMMAND_CONFIG, + .mode = COMMAND_ANY, .help = "Initializes configured targets and servers. " "Changes command mode from CONFIG to EXEC. " "Unless 'noinit' is called, this command is " commit 23f07d08e3998642326aa115cdd4cb1199f2704b Author: Zachary T Welch <zw...@su...> Date: Thu Dec 3 05:13:45 2009 -0800 fix regressions with GDB port numbers Use a separate variable for iterating GDB service port numbers than the one set by the user. Restores the behavior of returning the original port number and only incrementing the port used on success. diff --git a/src/server/gdb_server.c b/src/server/gdb_server.c index 40380a8..21cd0fe 100644 --- a/src/server/gdb_server.c +++ b/src/server/gdb_server.c @@ -48,6 +48,7 @@ static enum breakpoint_type gdb_breakpoint_override_type; extern int gdb_error(struct connection *connection, int retval); static unsigned short gdb_port = 3333; +static unsigned short gdb_port_next = 0; static const char *DIGITS = "0123456789abcdef"; static void gdb_log_callback(void *priv, const char *file, unsigned line, @@ -2217,6 +2218,8 @@ int gdb_target_add_one(struct target *target) LOG_INFO("gdb port disabled"); return ERROR_OK; } + if (0 == gdb_port_next) + gdb_port_next = gdb_port; bool use_pipes = server_use_pipes; static bool server_started_with_pipes = false; @@ -2229,10 +2232,12 @@ int gdb_target_add_one(struct target *target) use_pipes = false; } - int e = gdb_target_start(target, use_pipes ? 0 : gdb_port++); + int e = gdb_target_start(target, use_pipes ? 0 : gdb_port_next); if (ERROR_OK == e) + { server_started_with_pipes |= use_pipes; - + gdb_port_next++; + } return e; } @@ -2278,7 +2283,10 @@ COMMAND_HANDLER(handle_gdb_sync_command) /* daemon configuration command gdb_port */ COMMAND_HANDLER(handle_gdb_port_command) { - return CALL_COMMAND_HANDLER(server_port_command, &gdb_port); + int retval = CALL_COMMAND_HANDLER(server_port_command, &gdb_port); + if (ERROR_OK == retval) + gdb_port_next = gdb_port; + return retval; } COMMAND_HANDLER(handle_gdb_memory_map_command) ----------------------------------------------------------------------- Summary of changes: src/openocd.c | 2 +- src/server/gdb_server.c | 14 +++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: Øyvind H. <go...@us...> - 2009-12-03 13: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 434f570e51a0b0f2c09184646d91154c74bbff81 (commit) from 822c06d9e3983b37cd1830c594210973cb560991 (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 434f570e51a0b0f2c09184646d91154c74bbff81 Author: Ãyvind Harboe <oyv...@zy...> Date: Thu Dec 3 13:47:25 2009 +0100 zy1000: include files have moved about now compiles again after include files were moved about to reduce -I usage and stop using quotes but rather angle brackets for include files. Signed-off-by: Ãyvind Harboe <oyv...@zy...> diff --git a/src/ecosboard.c b/src/ecosboard.c index 6e41eba..7d0c3d0 100644 --- a/src/ecosboard.c +++ b/src/ecosboard.c @@ -33,9 +33,9 @@ #include <server/server.h> #include <server/telnet_server.h> #include <server/gdb_server.h> -#include "openocd.h" +#include <openocd.h> -#include <time_support.h> +#include <helper/time_support.h> #include <sys/time.h> #include <stdio.h> #include <stdlib.h> ----------------------------------------------------------------------- Summary of changes: src/ecosboard.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: Zach W. <zw...@us...> - 2009-12-03 13:32:19
|
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 822c06d9e3983b37cd1830c594210973cb560991 (commit) via f7bd1e8f3a302378687ded559e865c258d441c89 (commit) via 12499f97fdeceb7175a4d3847d6b9e2c95ce8b34 (commit) via 66e45ba611b13bae0c6b7747ce27c37f7bfb21bc (commit) via 49675db9723ea6481ea38e9e34351123fc7954a0 (commit) via 8256a792c5a74ba0c37121652d3e753b65aee02d (commit) via c538a830cdaafa92c9e9a624d84915cc39cce05b (commit) via 6db3ed48c6d152446dafc70b8495970cd2b22d3a (commit) via 5e7369d99aaa27a4c110507a3f0b0431fa566090 (commit) via 2a402ae2c7bf5ce515ff5bfdd7d68f875686e289 (commit) via afb6d38bd52e508970cfcc4a0d26610f33f42875 (commit) via 450ceda9aec12a0b67cca8dfbaf0384824cbd6c2 (commit) via 9cbab8d3a6b6157629b75457b79e1b828c78bf6e (commit) via 2b2d5ec1e38efdd10ec64f8e880588350fb4edea (commit) via eac262e5d2a56e470e3d13becd646a135aa187c5 (commit) via 7a4f4457e5713eab8537a723ed10474287377225 (commit) via 5a94612148940db460252f2ad68585d96ee71415 (commit) via c6dd6a576d0b680f67ad9fd8af12fb342b26c83d (commit) via fa43bdff54a2f42e7c5a77304d8d1ffb3fe75ea5 (commit) via aaf948a6be72a92aef286c01f6902505364e8152 (commit) via 36e53978b91c124fb7388d795856fa01ab138dc5 (commit) via a8880f0b5ab7f5c9d4d3b031fd487caac766b99f (commit) via 7da02a8330d48f05f1ea9af93adb572f083aa728 (commit) via 0241b1e1054e7d3d187c0a41c7ffefab321b6b67 (commit) via 1650ab3a22d62c834126138f253643031c8418ba (commit) via 26e4fac57e2e022409b63a444928a41399a0a76b (commit) via 54063d72945e1022def8ad9b46dc61564eee1f22 (commit) via f52a5968604ae0dffc5b93e745724f850a416282 (commit) via a1c40f5120bd45f98974fd73d1cdaa10c674f09c (commit) via 377c5504b9cd040aa986d0927ab8aa49032b8584 (commit) via 56adfadb5de436ea627dc04a537917318317fd01 (commit) via ddea03304310e1342ee127fc7e6507bbfb237ae4 (commit) via 15accefbe284cfa0c4735ecb5ae3d2127ac8cfff (commit) via 98eea5680b491a26812214ddfeeafb3f088b94aa (commit) via 0c1bc6703cc76b61d352477af9a796dcab28adcd (commit) via 2c35b35e111b5a23a3316e02e419c212840c4cc2 (commit) via 41e92d8a7a987a5bbdeb7e5b36595c8bcc62e620 (commit) via 447f0896dd4652b240e316275913a6e13b11d03e (commit) via 9e3136a5f84a402ae9f5c9e24a1e6c2a7451aac3 (commit) via 28b17945059a4dcca4dba0ef30d07f0c3f328366 (commit) via 2958665f6b1239705a7dcc2b275810c394023f0f (commit) via 2641fd9576ae5e3c2856de9a06176b24d05149ac (commit) via cb4a475f6c26ff197cd9d601b0b9f86653d961a2 (commit) via 165fb9309d16ff91967f26ce8c01bfd176371506 (commit) via c9e448222cc5d1162f5e495cdfd327732c50a484 (commit) via df0e90ec8c728be50f1457ecc513d78de044f5a4 (commit) via 6512e5e36b067ae458cb7f6a9fdfb08d38da3583 (commit) via ba00ba47d289381d1fbfb84b6f4b18f8dff2f011 (commit) via 6c3a28ca260833dc2347d16792fb2cb2abec6e52 (commit) via c79cca04bed78839a18e73f3996805eb8001a812 (commit) via 35f1a40f6fad146db9d5546c47c45472d0ef0bed (commit) via 2fc071c6e1180f8dab1e2513106d5e18213fdc8b (commit) via 14ed20967f660ca888bba53c47c1c648f470f8e2 (commit) via 0b7720d2ffc92a1a27bc01cb05ebd7d8d83c427c (commit) via 264d24495d7ff0048bd5c49736042ed66b90f7a6 (commit) via d1bc4375e99ce52b72988494f35beca364234bae (commit) via 5d57cad00136ac4191483ff5c04d8795c8ea3bde (commit) via 4bbe7d174f1d307487db1db86da62676a8a9fb6c (commit) via 896ac8d4ef3212f80887bf009d626c5becb1240a (commit) from a976ce2dd4d3d6f0e851a5903494805ea60133f4 (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 822c06d9e3983b37cd1830c594210973cb560991 Author: Zachary T Welch <zw...@su...> Date: Sat Nov 28 16:27:10 2009 -0800 remove tertiary include paths With all #include directives converted, we only need to have the top-level src/ directory in the search path. diff --git a/src/Makefile.am b/src/Makefile.am index 2033752..e6462c1 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -24,15 +24,7 @@ noinst_HEADERS = \ # set the include path found by configure AM_CPPFLAGS = \ - -I$(top_srcdir)/src \ - -I$(top_srcdir)/src/helper \ - -I$(top_srcdir)/src/jtag \ - -I$(top_srcdir)/src/target \ - -I$(top_srcdir)/src/xsvf \ - -I$(top_srcdir)/src/svf \ - -I$(top_srcdir)/src/server \ - -I$(top_srcdir)/src/flash \ - -I$(top_srcdir)/src/pld + -I$(top_srcdir)/src libopenocd_la_CPPFLAGS = -DPKGBLDDATE=\"`date +%F-%R`\" diff --git a/src/flash/Makefile.am b/src/flash/Makefile.am index ee322ee..cda59e4 100644 --- a/src/flash/Makefile.am +++ b/src/flash/Makefile.am @@ -3,10 +3,7 @@ SUBDIRS = \ nand AM_CPPFLAGS = \ - -I$(top_srcdir)/src \ - -I$(top_srcdir)/src/helper \ - -I$(top_srcdir)/src/jtag \ - -I$(top_srcdir)/src/target + -I$(top_srcdir)/src METASOURCES = AUTO noinst_LTLIBRARIES = libflash.la diff --git a/src/flash/nand/Makefile.am b/src/flash/nand/Makefile.am index 921b7f3..34947b6 100644 --- a/src/flash/nand/Makefile.am +++ b/src/flash/nand/Makefile.am @@ -1,9 +1,4 @@ -AM_CPPFLAGS = \ - -I$(top_srcdir)/src \ - -I$(top_srcdir)/src/flash \ - -I$(top_srcdir)/src/helper \ - -I$(top_srcdir)/src/jtag \ - -I$(top_srcdir)/src/target +AM_CPPFLAGS = -I$(top_srcdir)/src noinst_LTLIBRARIES = libocdflashnand.la diff --git a/src/flash/nor/Makefile.am b/src/flash/nor/Makefile.am index 1be84be..211366b 100644 --- a/src/flash/nor/Makefile.am +++ b/src/flash/nor/Makefile.am @@ -1,9 +1,4 @@ -AM_CPPFLAGS = \ - -I$(top_srcdir)/src \ - -I$(top_srcdir)/src/helper \ - -I$(top_srcdir)/src/jtag \ - -I$(top_srcdir)/src/flash \ - -I$(top_srcdir)/src/target +AM_CPPFLAGS = -I$(top_srcdir)/src noinst_LTLIBRARIES = libocdflashnor.la libocdflashnor_la_SOURCES = \ diff --git a/src/helper/Makefile.am b/src/helper/Makefile.am index bf8527f..4f74b9a 100644 --- a/src/helper/Makefile.am +++ b/src/helper/Makefile.am @@ -1,7 +1,5 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/src \ - -I$(top_srcdir)/src/server \ - -I$(top_srcdir)/src/target \ -DPKGDATADIR=\"$(pkgdatadir)\" METASOURCES = AUTO diff --git a/src/jtag/Makefile.am b/src/jtag/Makefile.am index 4ca0c78..39b4b59 100644 --- a/src/jtag/Makefile.am +++ b/src/jtag/Makefile.am @@ -1,7 +1,5 @@ AM_CPPFLAGS = \ - -I$(top_srcdir)/src \ - -I$(top_srcdir)/src/helper \ - -I$(top_srcdir)/src/target + -I$(top_srcdir)/src METASOURCES = AUTO noinst_LTLIBRARIES = libjtag.la diff --git a/src/jtag/drivers/Makefile.am b/src/jtag/drivers/Makefile.am index 4e2bce0..92a96f3 100644 --- a/src/jtag/drivers/Makefile.am +++ b/src/jtag/drivers/Makefile.am @@ -1,7 +1,4 @@ -AM_CPPFLAGS = \ - -I$(top_srcdir)/src \ - -I$(top_srcdir)/src/helper \ - -I$(top_srcdir)/src/jtag +AM_CPPFLAGS = -I$(top_srcdir)/src noinst_LTLIBRARIES = libocdjtagdrivers.la diff --git a/src/pld/Makefile.am b/src/pld/Makefile.am index d99a89c..fa40e56 100644 --- a/src/pld/Makefile.am +++ b/src/pld/Makefile.am @@ -1,8 +1,5 @@ AM_CPPFLAGS = \ - -I$(top_srcdir)/src \ - -I$(top_srcdir)/src/server \ - -I$(top_srcdir)/src/helper \ - -I$(top_srcdir)/src/jtag + -I$(top_srcdir)/src METASOURCES = AUTO noinst_LTLIBRARIES = libpld.la diff --git a/src/server/Makefile.am b/src/server/Makefile.am index 989a682..de83a06 100644 --- a/src/server/Makefile.am +++ b/src/server/Makefile.am @@ -1,9 +1,5 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/src \ - -I$(top_srcdir)/src/helper \ - -I$(top_srcdir)/src/target \ - -I$(top_srcdir)/src/flash \ - -I$(top_srcdir)/src/jtag \ -DPKGDATADIR=\"$(pkgdatadir)\" METASOURCES = AUTO diff --git a/src/svf/Makefile.am b/src/svf/Makefile.am index 10cb967..adc415f 100644 --- a/src/svf/Makefile.am +++ b/src/svf/Makefile.am @@ -1,8 +1,5 @@ AM_CPPFLAGS = \ - -I$(top_srcdir)/src \ - -I$(top_srcdir)/src/server \ - -I$(top_srcdir)/src/helper \ - -I$(top_srcdir)/src/jtag + -I$(top_srcdir)/src METASOURCES = AUTO noinst_LTLIBRARIES = libsvf.la diff --git a/src/target/Makefile.am b/src/target/Makefile.am index cd90355..7631bea 100644 --- a/src/target/Makefile.am +++ b/src/target/Makefile.am @@ -6,10 +6,7 @@ OOCD_TRACE_FILES = endif AM_CPPFLAGS = \ - -I$(top_srcdir)/src \ - -I$(top_srcdir)/src/helper \ - -I$(top_srcdir)/src/jtag \ - -I$(top_srcdir)/src/xsvf + -I$(top_srcdir)/src BIN2C = $(top_builddir)/src/helper/bin2char$(EXEEXT_FOR_BUILD) diff --git a/src/xsvf/Makefile.am b/src/xsvf/Makefile.am index 5a58e26..3e2a04e 100644 --- a/src/xsvf/Makefile.am +++ b/src/xsvf/Makefile.am @@ -1,9 +1,5 @@ AM_CPPFLAGS = \ - -I$(top_srcdir)/src \ - -I$(top_srcdir)/src/server \ - -I$(top_srcdir)/src/helper \ - -I$(top_srcdir)/src/svf \ - -I$(top_srcdir)/src/jtag + -I$(top_srcdir)/src METASOURCES = AUTO noinst_LTLIBRARIES = libxsvf.la commit f7bd1e8f3a302378687ded559e865c258d441c89 Author: Zachary T Welch <zw...@su...> Date: Thu Dec 3 03:46:15 2009 -0800 change #include "../hello.h" to "hello.h" Before we can -I the top-level src/ directory alone, references to "hello.h" must be updated. This is an internal header, so it does not need angle brackets. diff --git a/src/flash/nand/nonce.c b/src/flash/nand/nonce.c index f441164..8d15040 100644 --- a/src/flash/nand/nonce.c +++ b/src/flash/nand/nonce.c @@ -21,6 +21,7 @@ #include "config.h" #endif #include <flash/nand.h> +#include "hello.h" static int nonce_nand_command(struct nand_device *nand, uint8_t command) @@ -68,6 +69,7 @@ static int nonce_nand_init(struct nand_device *nand) struct nand_flash_controller nonce_nand_controller = { .name = "nonce", + .commands = hello_command_handlers, .nand_device_command = &nonce_nand_device_command, .init = &nonce_nand_init, .reset = &nonce_nand_reset, diff --git a/src/flash/nor/faux.c b/src/flash/nor/faux.c index 49a0f72..c996522 100644 --- a/src/flash/nor/faux.c +++ b/src/flash/nor/faux.c @@ -23,7 +23,7 @@ #include <flash/flash.h> #include <target/image.h> -#include "../hello.h" +#include "hello.h" struct faux_flash_bank diff --git a/src/jtag/drivers/dummy.c b/src/jtag/drivers/dummy.c index 7370c81..1880712 100644 --- a/src/jtag/drivers/dummy.c +++ b/src/jtag/drivers/dummy.c @@ -23,7 +23,7 @@ #include <jtag/interface.h> #include "bitbang.h" -#include "../hello.h" +#include "hello.h" /* my private tap controller state, which tracks state for calling code */ diff --git a/src/target/testee.c b/src/target/testee.c index 4527388..991c64e 100644 --- a/src/target/testee.c +++ b/src/target/testee.c @@ -23,7 +23,7 @@ #include "target.h" #include "target_type.h" #include <helper/log.h> -#include "../hello.h" +#include "hello.h" static const struct command_registration testee_command_handlers[] = { { commit 12499f97fdeceb7175a4d3847d6b9e2c95ce8b34 Author: Zachary T Welch <zw...@su...> Date: Thu Dec 3 04:15:05 2009 -0800 change #include "xsvf.h" to <xsvf/xsvf.h> Changes from the flat namespace to heirarchical one. Instead of writing: #include "xsvf.h" the following form should be used. #include <xsvf/xsvf.h> The exception is from .c files in the same directory. diff --git a/src/ecosboard.c b/src/ecosboard.c index 5dcbfcb..6e41eba 100644 --- a/src/ecosboard.c +++ b/src/ecosboard.c @@ -25,7 +25,7 @@ #include <jtag/jtag.h> #include <helper/ioutil.h> #include <helper/configuration.h> -#include "xsvf.h" +#include <xsvf/xsvf.h> #include <svf/svf.h> #include <flash/nand.h> #include <pld/pld.h> diff --git a/src/openocd.c b/src/openocd.c index a77bf89..793aa6a 100644 --- a/src/openocd.c +++ b/src/openocd.c @@ -32,7 +32,7 @@ #include <jtag/jtag.h> #include <helper/ioutil.h> #include <helper/configuration.h> -#include "xsvf.h" +#include <xsvf/xsvf.h> #include <svf/svf.h> #include <flash/nand.h> #include <pld/pld.h> commit 66e45ba611b13bae0c6b7747ce27c37f7bfb21bc Author: Zachary T Welch <zw...@su...> Date: Thu Dec 3 04:15:05 2009 -0800 change #include "svf.h" to <svf/svf.h> Changes from the flat namespace to heirarchical one. Instead of writing: #include "svf.h" the following form should be used. #include <svf/svf.h> The exception is from .c files in the same directory. diff --git a/src/ecosboard.c b/src/ecosboard.c index e4e5cb9..5dcbfcb 100644 --- a/src/ecosboard.c +++ b/src/ecosboard.c @@ -26,7 +26,7 @@ #include <helper/ioutil.h> #include <helper/configuration.h> #include "xsvf.h" -#include "svf.h" +#include <svf/svf.h> #include <flash/nand.h> #include <pld/pld.h> diff --git a/src/openocd.c b/src/openocd.c index 138f5cb..a77bf89 100644 --- a/src/openocd.c +++ b/src/openocd.c @@ -33,7 +33,7 @@ #include <helper/ioutil.h> #include <helper/configuration.h> #include "xsvf.h" -#include "svf.h" +#include <svf/svf.h> #include <flash/nand.h> #include <pld/pld.h> #include <flash/mflash.h> diff --git a/src/xsvf/xsvf.c b/src/xsvf/xsvf.c index 5cacbed..b1ddea9 100644 --- a/src/xsvf/xsvf.c +++ b/src/xsvf/xsvf.c @@ -42,7 +42,7 @@ #include "xsvf.h" #include <jtag/jtag.h> -#include "svf.h" +#include <svf/svf.h> /* XSVF commands, from appendix B of xapp503.pdf */ commit 49675db9723ea6481ea38e9e34351123fc7954a0 Author: Zachary T Welch <zw...@su...> Date: Thu Dec 3 04:15:04 2009 -0800 change #include "pld.h" to <pld/pld.h> Changes from the flat namespace to heirarchical one. Instead of writing: #include "pld.h" the following form should be used. #include <pld/pld.h> The exception is from .c files in the same directory. diff --git a/src/ecosboard.c b/src/ecosboard.c index fa2e2c6..e4e5cb9 100644 --- a/src/ecosboard.c +++ b/src/ecosboard.c @@ -28,7 +28,7 @@ #include "xsvf.h" #include "svf.h" #include <flash/nand.h> -#include "pld.h" +#include <pld/pld.h> #include <server/server.h> #include <server/telnet_server.h> diff --git a/src/openocd.c b/src/openocd.c index cbb28b7..138f5cb 100644 --- a/src/openocd.c +++ b/src/openocd.c @@ -35,7 +35,7 @@ #include "xsvf.h" #include "svf.h" #include <flash/nand.h> -#include "pld.h" +#include <pld/pld.h> #include <flash/mflash.h> #include <server/server.h> commit 8256a792c5a74ba0c37121652d3e753b65aee02d Author: Zachary T Welch <zw...@su...> Date: Thu Dec 3 04:15:03 2009 -0800 change #include "telnet_server.h" to <server/telnet_server.h> Changes from the flat namespace to heirarchical one. Instead of writing: #include "telnet_server.h" the following form should be used. #include <server/telnet_server.h> The exception is from .c files in the same directory. diff --git a/src/ecosboard.c b/src/ecosboard.c index 53ad7ba..fa2e2c6 100644 --- a/src/ecosboard.c +++ b/src/ecosboard.c @@ -31,7 +31,7 @@ #include "pld.h" #include <server/server.h> -#include "telnet_server.h" +#include <server/telnet_server.h> #include <server/gdb_server.h> #include "openocd.h" commit c538a830cdaafa92c9e9a624d84915cc39cce05b Author: Zachary T Welch <zw...@su...> Date: Thu Dec 3 04:15:03 2009 -0800 change #include "server.h" to <server/server.h> Changes from the flat namespace to heirarchical one. Instead of writing: #include "server.h" the following form should be used. #include <server/server.h> The exception is from .c files in the same directory. diff --git a/src/ecosboard.c b/src/ecosboard.c index d94f8b4..53ad7ba 100644 --- a/src/ecosboard.c +++ b/src/ecosboard.c @@ -30,7 +30,7 @@ #include <flash/nand.h> #include "pld.h" -#include "server.h" +#include <server/server.h> #include "telnet_server.h" #include <server/gdb_server.h> #include "openocd.h" diff --git a/src/helper/log.c b/src/helper/log.c index 3067ecc..6adde4b 100644 --- a/src/helper/log.c +++ b/src/helper/log.c @@ -29,7 +29,7 @@ #include "time_support.h" // @todo the inclusion of server.h here is a layering violation -#include "server.h" +#include <server/server.h> #include <stdarg.h> diff --git a/src/helper/options.c b/src/helper/options.c index 3db96fd..573026a 100644 --- a/src/helper/options.c +++ b/src/helper/options.c @@ -26,7 +26,7 @@ #include "configuration.h" // @todo the inclusion of server.h here is a layering violation -#include "server.h" +#include <server/server.h> #include <getopt.h> diff --git a/src/openocd.c b/src/openocd.c index 58ad617..cbb28b7 100644 --- a/src/openocd.c +++ b/src/openocd.c @@ -38,7 +38,7 @@ #include "pld.h" #include <flash/mflash.h> -#include "server.h" +#include <server/server.h> #include <server/gdb_server.h> #include <server/httpd.h> diff --git a/src/server/tcl_server.h b/src/server/tcl_server.h index e0d7b16..68ad821 100644 --- a/src/server/tcl_server.h +++ b/src/server/tcl_server.h @@ -20,7 +20,7 @@ #ifndef _TCL_SERVER_H_ #define _TCL_SERVER_H_ -#include "server.h" +#include <server/server.h> int tcl_init(struct command_context *cmd_ctx); int tcl_register_commands(struct command_context *cmd_ctx); diff --git a/src/server/telnet_server.h b/src/server/telnet_server.h index 7e39822..b0c5ceb 100644 --- a/src/server/telnet_server.h +++ b/src/server/telnet_server.h @@ -26,7 +26,7 @@ #ifndef TELNET_SERVER_H #define TELNET_SERVER_H -#include "server.h" +#include <server/server.h> #define TELNET_BUFFER_SIZE (1024) commit 6db3ed48c6d152446dafc70b8495970cd2b22d3a Author: Zachary T Welch <zw...@su...> Date: Thu Dec 3 04:15:03 2009 -0800 change #include "httpd.h" to <server/httpd.h> Changes from the flat namespace to heirarchical one. Instead of writing: #include "httpd.h" the following form should be used. #include <server/httpd.h> The exception is from .c files in the same directory. diff --git a/src/openocd.c b/src/openocd.c index c061423..58ad617 100644 --- a/src/openocd.c +++ b/src/openocd.c @@ -40,7 +40,7 @@ #include "server.h" #include <server/gdb_server.h> -#include "httpd.h" +#include <server/httpd.h> #ifdef HAVE_STRINGS_H #include <strings.h> commit 5e7369d99aaa27a4c110507a3f0b0431fa566090 Author: Zachary T Welch <zw...@su...> Date: Thu Dec 3 04:15:02 2009 -0800 change #include "gdb_server.h" to <server/gdb_server.h> Changes from the flat namespace to heirarchical one. Instead of writing: #include "gdb_server.h" the following form should be used. #include <server/gdb_server.h> The exception is from .c files in the same directory. diff --git a/src/ecosboard.c b/src/ecosboard.c index 2464868..d94f8b4 100644 --- a/src/ecosboard.c +++ b/src/ecosboard.c @@ -32,7 +32,7 @@ #include "server.h" #include "telnet_server.h" -#include "gdb_server.h" +#include <server/gdb_server.h> #include "openocd.h" #include <time_support.h> diff --git a/src/openocd.c b/src/openocd.c index 9377816..c061423 100644 --- a/src/openocd.c +++ b/src/openocd.c @@ -39,7 +39,7 @@ #include <flash/mflash.h> #include "server.h" -#include "gdb_server.h" +#include <server/gdb_server.h> #include "httpd.h" #ifdef HAVE_STRINGS_H commit 2a402ae2c7bf5ce515ff5bfdd7d68f875686e289 Author: Zachary T Welch <zw...@su...> Date: Thu Dec 3 04:15:02 2009 -0800 change #include "s3c24xx_regs.h" to <flash/nand/s3c24xx_regs.h> Changes from the flat namespace to heirarchical one. Instead of writing: #include "s3c24xx_regs.h" the following form should be used. #include <flash/nand/s3c24xx_regs.h> The exception is from .c files in the same directory. diff --git a/src/flash/nand/s3c24xx.h b/src/flash/nand/s3c24xx.h index 0f899da..f89bf6e 100644 --- a/src/flash/nand/s3c24xx.h +++ b/src/flash/nand/s3c24xx.h @@ -28,7 +28,7 @@ */ #include <flash/nand.h> -#include "s3c24xx_regs.h" +#include <flash/nand/s3c24xx_regs.h> struct s3c24xx_nand_controller { commit afb6d38bd52e508970cfcc4a0d26610f33f42875 Author: Zachary T Welch <zw...@su...> Date: Thu Dec 3 04:14:58 2009 -0800 change #include "ocl.h" to <flash/nor/ocl.h> Changes from the flat namespace to heirarchical one. Instead of writing: #include "ocl.h" the following form should be used. #include <flash/nor/ocl.h> The exception is from .c files in the same directory. diff --git a/src/flash/ocl/at91sam7x/main.c b/src/flash/ocl/at91sam7x/main.c index 2146d74..e4c0c3f 100644 --- a/src/flash/ocl/at91sam7x/main.c +++ b/src/flash/ocl/at91sam7x/main.c @@ -19,7 +19,7 @@ ***************************************************************************/ #include "platform.h" -#include "ocl.h" +#include <flash/nor/ocl.h> #include "dcc.h" #include "samflash.h" commit 450ceda9aec12a0b67cca8dfbaf0384824cbd6c2 Author: Zachary T Welch <zw...@su...> Date: Thu Dec 3 04:14:55 2009 -0800 change #include "nand.h" to <flash/nand.h> Changes from the flat namespace to heirarchical one. Instead of writing: #include "nand.h" the following form should be used. #include <flash/nand.h> The exception is from .c files in the same directory. diff --git a/src/ecosboard.c b/src/ecosboard.c index b42a777..2464868 100644 --- a/src/ecosboard.c +++ b/src/ecosboard.c @@ -27,7 +27,7 @@ #include <helper/configuration.h> #include "xsvf.h" #include "svf.h" -#include "nand.h" +#include <flash/nand.h> #include "pld.h" #include "server.h" diff --git a/src/flash/arm_nandio.h b/src/flash/arm_nandio.h index 6788e36..27b3ad3 100644 --- a/src/flash/arm_nandio.h +++ b/src/flash/arm_nandio.h @@ -1,7 +1,7 @@ #ifndef __ARM_NANDIO_H #define __ARM_NANDIO_H -#include "nand.h" +#include <flash/nand.h> #include <helper/binarybuffer.h> /** diff --git a/src/flash/nand/lpc3180.c b/src/flash/nand/lpc3180.c index 031e6b1..80284cc 100644 --- a/src/flash/nand/lpc3180.c +++ b/src/flash/nand/lpc3180.c @@ -22,7 +22,7 @@ #endif #include "lpc3180.h" -#include "nand.h" +#include <flash/nand.h> static int lpc3180_reset(struct nand_device *nand); static int lpc3180_controller_ready(struct nand_device *nand, int timeout); diff --git a/src/flash/nand/mx3.h b/src/flash/nand/mx3.h index 09289ae..94dbf0c 100644 --- a/src/flash/nand/mx3.h +++ b/src/flash/nand/mx3.h @@ -25,7 +25,7 @@ * * Many thanks to Ben Dooks for writing s3c24xx driver. */ -#include "nand.h" +#include <flash/nand.h> #define MX3_NF_BASE_ADDR 0xb8000000 #define MX3_NF_BUFSIZ (MX3_NF_BASE_ADDR + 0xe00) diff --git a/src/flash/nand/nonce.c b/src/flash/nand/nonce.c index dae62a7..f441164 100644 --- a/src/flash/nand/nonce.c +++ b/src/flash/nand/nonce.c @@ -20,7 +20,7 @@ #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include "nand.h" +#include <flash/nand.h> static int nonce_nand_command(struct nand_device *nand, uint8_t command) diff --git a/src/flash/nand/s3c24xx.h b/src/flash/nand/s3c24xx.h index 38057b2..0f899da 100644 --- a/src/flash/nand/s3c24xx.h +++ b/src/flash/nand/s3c24xx.h @@ -27,7 +27,7 @@ * Many thanks to Simtec Electronics for sponsoring this work. */ -#include "nand.h" +#include <flash/nand.h> #include "s3c24xx_regs.h" struct s3c24xx_nand_controller diff --git a/src/openocd.c b/src/openocd.c index eae8c0c..9377816 100644 --- a/src/openocd.c +++ b/src/openocd.c @@ -34,7 +34,7 @@ #include <helper/configuration.h> #include "xsvf.h" #include "svf.h" -#include "nand.h" +#include <flash/nand.h> #include "pld.h" #include <flash/mflash.h> commit 9cbab8d3a6b6157629b75457b79e1b828c78bf6e Author: Zachary T Welch <zw...@su...> Date: Thu Dec 3 04:14:55 2009 -0800 change #include "mflash.h" to <flash/mflash.h> Changes from the flat namespace to heirarchical one. Instead of writing: #include "mflash.h" the following form should be used. #include <flash/mflash.h> The exception is from .c files in the same directory. diff --git a/src/openocd.c b/src/openocd.c index 38eb57b..eae8c0c 100644 --- a/src/openocd.c +++ b/src/openocd.c @@ -36,7 +36,7 @@ #include "svf.h" #include "nand.h" #include "pld.h" -#include "mflash.h" +#include <flash/mflash.h> #include "server.h" #include "gdb_server.h" commit 2b2d5ec1e38efdd10ec64f8e880588350fb4edea Author: Zachary T Welch <zw...@su...> Date: Thu Dec 3 04:14:54 2009 -0800 change #include "flash.h" to <flash/flash.h> Changes from the flat namespace to heirarchical one. Instead of writing: #include "flash.h" the following form should be used. #include <flash/flash.h> The exception is from .c files in the same directory. diff --git a/src/flash/nand.h b/src/flash/nand.h index a30a654..d73aee1 100644 --- a/src/flash/nand.h +++ b/src/flash/nand.h @@ -25,7 +25,7 @@ #ifndef NAND_H #define NAND_H -#include "flash.h" +#include <flash/flash.h> struct nand_device; diff --git a/src/flash/nor/aduc702x.c b/src/flash/nor/aduc702x.c index a8d76ce..6696912 100644 --- a/src/flash/nor/aduc702x.c +++ b/src/flash/nor/aduc702x.c @@ -23,7 +23,7 @@ #include "config.h" #endif -#include "flash.h" +#include <flash/flash.h> #include <target/armv4_5.h> #include <helper/binarybuffer.h> #include <helper/time_support.h> diff --git a/src/flash/nor/at91sam3.c b/src/flash/nor/at91sam3.c index 5f7e8d7..dd4f347 100644 --- a/src/flash/nor/at91sam3.c +++ b/src/flash/nor/at91sam3.c @@ -61,7 +61,7 @@ #include <string.h> #include <stddef.h> #include <helper/types.h> -#include "flash.h" +#include <flash/flash.h> #include <helper/membuf.h> #include "at91sam3.h" #include <helper/time_support.h> diff --git a/src/flash/nor/at91sam7.h b/src/flash/nor/at91sam7.h index 4510686..8077879 100644 --- a/src/flash/nor/at91sam7.h +++ b/src/flash/nor/at91sam7.h @@ -23,7 +23,7 @@ #ifndef AT91SAM7_H #define AT91SAM7_H -#include "flash.h" +#include <flash/flash.h> struct at91sam7_flash_bank { diff --git a/src/flash/nor/avrf.c b/src/flash/nor/avrf.c index 2bc4438..fbc9277 100644 --- a/src/flash/nor/avrf.c +++ b/src/flash/nor/avrf.c @@ -23,7 +23,7 @@ #include "avrf.h" #include <target/avrt.h> -#include "flash.h" +#include <flash/flash.h> /* AVR_JTAG_Instructions */ diff --git a/src/flash/nor/cfi.h b/src/flash/nor/cfi.h index d55fd34..565a2b6 100644 --- a/src/flash/nor/cfi.h +++ b/src/flash/nor/cfi.h @@ -20,7 +20,7 @@ #ifndef CFI_H #define CFI_H -#include "flash.h" +#include <flash/flash.h> #define CFI_STATUS_POLL_MASK_DQ5_DQ6_DQ7 0xE0 /* DQ5..DQ7 */ #define CFI_STATUS_POLL_MASK_DQ6_DQ7 0xC0 /* DQ6..DQ7 */ diff --git a/src/flash/nor/ecos.c b/src/flash/nor/ecos.c index 81223b6..8f8f746 100644 --- a/src/flash/nor/ecos.c +++ b/src/flash/nor/ecos.c @@ -21,7 +21,7 @@ #include "config.h" #endif -#include "flash.h" +#include <flash/flash.h> #include <target/embeddedice.h> #include <target/image.h> #include <target/algorithm.h> diff --git a/src/flash/nor/faux.c b/src/flash/nor/faux.c index 124ca3e..49a0f72 100644 --- a/src/flash/nor/faux.c +++ b/src/flash/nor/faux.c @@ -21,7 +21,7 @@ #include "config.h" #endif -#include "flash.h" +#include <flash/flash.h> #include <target/image.h> #include "../hello.h" diff --git a/src/flash/nor/lpc2000.h b/src/flash/nor/lpc2000.h index 08e278a..30be304 100644 --- a/src/flash/nor/lpc2000.h +++ b/src/flash/nor/lpc2000.h @@ -23,7 +23,7 @@ #ifndef LPC2000_H #define LPC2000_H -#include "flash.h" +#include <flash/flash.h> typedef enum { diff --git a/src/flash/nor/lpc288x.h b/src/flash/nor/lpc288x.h index 5a71ee0..06f634a 100644 --- a/src/flash/nor/lpc288x.h +++ b/src/flash/nor/lpc288x.h @@ -21,7 +21,7 @@ #ifndef lpc288x_H #define lpc288x_H -#include "flash.h" +#include <flash/flash.h> struct lpc288x_flash_bank { diff --git a/src/flash/nor/lpc2900.c b/src/flash/nor/lpc2900.c index c1fefd7..dc466f8 100644 --- a/src/flash/nor/lpc2900.c +++ b/src/flash/nor/lpc2900.c @@ -24,7 +24,7 @@ #include <target/image.h> -#include "flash.h" +#include <flash/flash.h> #include <helper/binarybuffer.h> #include <target/armv4_5.h> #include <target/algorithm.h> diff --git a/src/flash/nor/non_cfi.h b/src/flash/nor/non_cfi.h index 44c92db..cc6004e 100644 --- a/src/flash/nor/non_cfi.h +++ b/src/flash/nor/non_cfi.h @@ -20,7 +20,7 @@ #ifndef NON_CFI_H #define NON_CFI_H -#include "flash.h" +#include <flash/flash.h> struct non_cfi { diff --git a/src/flash/nor/ocl.c b/src/flash/nor/ocl.c index 57d9efa..6e3ad1c 100644 --- a/src/flash/nor/ocl.c +++ b/src/flash/nor/ocl.c @@ -22,7 +22,7 @@ #endif #include "ocl.h" -#include "flash.h" +#include <flash/flash.h> #include <target/embeddedice.h> diff --git a/src/flash/nor/pic32mx.h b/src/flash/nor/pic32mx.h index 92f40c2..b33e831 100644 --- a/src/flash/nor/pic32mx.h +++ b/src/flash/nor/pic32mx.h @@ -26,7 +26,7 @@ #ifndef PIC32MX_H #define PIC32MX_H -#include "flash.h" +#include <flash/flash.h> struct pic32mx_flash_bank { diff --git a/src/flash/nor/stellaris.h b/src/flash/nor/stellaris.h index 949a346..85b709c 100644 --- a/src/flash/nor/stellaris.h +++ b/src/flash/nor/stellaris.h @@ -20,7 +20,7 @@ #ifndef STELLARIS_FLASH_H #define STELLARIS_FLASH_H -#include "flash.h" +#include <flash/flash.h> struct stellaris_flash_bank { diff --git a/src/flash/nor/stm32x.h b/src/flash/nor/stm32x.h index 6cd047e..b6e00ed 100644 --- a/src/flash/nor/stm32x.h +++ b/src/flash/nor/stm32x.h @@ -23,7 +23,7 @@ #ifndef STM32X_H #define STM32X_H -#include "flash.h" +#include <flash/flash.h> struct stm32x_options { diff --git a/src/flash/nor/str7x.h b/src/flash/nor/str7x.h index 81af0f1..4daafb7 100644 --- a/src/flash/nor/str7x.h +++ b/src/flash/nor/str7x.h @@ -23,7 +23,7 @@ #ifndef STR7X_H #define STR7X_H -#include "flash.h" +#include <flash/flash.h> struct str7x_flash_bank { diff --git a/src/flash/nor/str9x.h b/src/flash/nor/str9x.h index c9d5152..29adecf 100644 --- a/src/flash/nor/str9x.h +++ b/src/flash/nor/str9x.h @@ -23,7 +23,7 @@ #ifndef STR9X_H #define STR9X_H -#include "flash.h" +#include <flash/flash.h> struct str9x_flash_bank { diff --git a/src/flash/nor/str9xpec.h b/src/flash/nor/str9xpec.h index 1d5ce94..cb2ac78 100644 --- a/src/flash/nor/str9xpec.h +++ b/src/flash/nor/str9xpec.h @@ -23,7 +23,7 @@ #ifndef STR9XPEC_H #define STR9XPEC_H -#include "flash.h" +#include <flash/flash.h> #include <jtag/jtag.h> struct str9xpec_flash_controller diff --git a/src/flash/nor/tms470.h b/src/flash/nor/tms470.h index f275e51..b2fea1b 100644 --- a/src/flash/nor/tms470.h +++ b/src/flash/nor/tms470.h @@ -20,7 +20,7 @@ #ifndef TMS470_DOT_H #define TMS470_DOT_H -#include "flash.h" +#include <flash/flash.h> struct tms470_flash_bank { diff --git a/src/server/gdb_server.c b/src/server/gdb_server.c index 9185233..40380a8 100644 --- a/src/server/gdb_server.c +++ b/src/server/gdb_server.c @@ -31,7 +31,7 @@ #include <target/target_request.h> #include <target/register.h> #include "server.h" -#include "flash.h" +#include <flash/flash.h> #include "gdb_server.h" #include <target/image.h> #include <jtag/jtag.h> commit eac262e5d2a56e470e3d13becd646a135aa187c5 Author: Zachary T Welch <zw...@su...> Date: Thu Dec 3 04:14:54 2009 -0800 change #include "arm_nandio.h" to <flash/arm_nandio.h> Changes from the flat namespace to heirarchical one. Instead of writing: #include "arm_nandio.h" the following form should be used. #include <flash/arm_nandio.h> The exception is from .c files in the same directory. diff --git a/src/flash/nand/davinci.c b/src/flash/nand/davinci.c index 72cd378..40be36d 100644 --- a/src/flash/nand/davinci.c +++ b/src/flash/nand/davinci.c @@ -28,7 +28,7 @@ #include "config.h" #endif -#include "arm_nandio.h" +#include <flash/arm_nandio.h> enum ecc { diff --git a/src/flash/nand/orion.c b/src/flash/nand/orion.c index 0f08fe4..436151f 100644 --- a/src/flash/nand/orion.c +++ b/src/flash/nand/orion.c @@ -26,7 +26,7 @@ #include "config.h" #endif -#include "arm_nandio.h" +#include <flash/arm_nandio.h> #include <target/armv4_5.h> commit 7a4f4457e5713eab8537a723ed10474287377225 Author: Zachary T Welch <zw...@su...> Date: Thu Dec 3 04:14:52 2009 -0800 change #include "trace.h" to <target/trace.h> Changes from the flat namespace to heirarchical one. Instead of writing: #include "trace.h" the following form should be used. #include <target/trace.h> The exception is from .c files in the same directory. diff --git a/src/target/etm.h b/src/target/etm.h index 60e4ea7..656e04b 100644 --- a/src/target/etm.h +++ b/src/target/etm.h @@ -23,7 +23,7 @@ #ifndef ETM_H #define ETM_H -#include "trace.h" +#include <target/trace.h> #include <target/arm_jtag.h> struct image; diff --git a/src/target/xscale.h b/src/target/xscale.h index c083b06..6f81178 100644 --- a/src/target/xscale.h +++ b/src/target/xscale.h @@ -25,7 +25,7 @@ #include <target/armv4_5.h> #include <target/armv4_5_mmu.h> -#include "trace.h" +#include <target/trace.h> #define XSCALE_COMMON_MAGIC 0x58534341 commit 5a94612148940db460252f2ad68585d96ee71415 Author: Zachary T Welch <zw...@su...> Date: Thu Dec 3 04:14:51 2009 -0800 change #include "target_request.h" to <target/target_request.h> Changes from the flat namespace to heirarchical one. Instead of writing: #include "target_request.h" the following form should be used. #include <target/target_request.h> The exception is from .c files in the same directory. diff --git a/src/server/gdb_server.c b/src/server/gdb_server.c index 3129401..9185233 100644 --- a/src/server/gdb_server.c +++ b/src/server/gdb_server.c @@ -28,7 +28,7 @@ #endif #include <target/breakpoints.h> -#include "target_request.h" +#include <target/target_request.h> #include <target/register.h> #include "server.h" #include "flash.h" diff --git a/src/server/telnet_server.c b/src/server/telnet_server.c index 8a86efa..929c1c1 100644 --- a/src/server/telnet_server.c +++ b/src/server/telnet_server.c @@ -28,7 +28,7 @@ #endif #include "telnet_server.h" -#include "target_request.h" +#include <target/target_request.h> static unsigned short telnet_port = 4444; commit c6dd6a576d0b680f67ad9fd8af12fb342b26c83d Author: Zachary T Welch <zw...@su...> Date: Thu Dec 3 04:14:51 2009 -0800 change #include "target.h" to <target/target.h> Changes from the flat namespace to heirarchical one. Instead of writing: #include "target.h" the following form should be used. #include <target/target.h> The exception is from .c files in the same directory. diff --git a/src/flash/flash.h b/src/flash/flash.h index fea7372..5e31c48 100644 --- a/src/flash/flash.h +++ b/src/flash/flash.h @@ -26,7 +26,7 @@ #ifndef FLASH_H #define FLASH_H -#include "target.h" +#include <target/target.h> #include <helper/log.h> struct image; diff --git a/src/flash/mflash.c b/src/flash/mflash.c index 63e71db..aa02e15 100644 --- a/src/flash/mflash.c +++ b/src/flash/mflash.c @@ -22,7 +22,7 @@ #endif #include "mflash.h" -#include "target.h" +#include <target/target.h> #include <helper/time_support.h> #include <helper/fileio.h> #include <helper/log.h> diff --git a/src/helper/command.c b/src/helper/command.c index d657668..76050ef 100644 --- a/src/helper/command.c +++ b/src/helper/command.c @@ -36,7 +36,7 @@ #endif // @todo the inclusion of target.h here is a layering violation -#include "target.h" +#include <target/target.h> #include "command.h" #include "configuration.h" #include "log.h" diff --git a/src/server/httpd.c b/src/server/httpd.c index b346ca2..9554ff0 100644 --- a/src/server/httpd.c +++ b/src/server/httpd.c @@ -26,7 +26,7 @@ #endif #include "telnet_server.h" -#include "target.h" +#include <target/target.h> #include <microhttpd.h> #include <pthread.h> diff --git a/src/server/server.c b/src/server/server.c index 0f977a7..2f4bfb0 100644 --- a/src/server/server.c +++ b/src/server/server.c @@ -28,7 +28,7 @@ #endif #include "server.h" -#include "target.h" +#include <target/target.h> #include "openocd.h" #include "tcl_server.h" #include "telnet_server.h" diff --git a/src/target/armv4_5.h b/src/target/armv4_5.h index 9b6237b..6c83c3b 100644 --- a/src/target/armv4_5.h +++ b/src/target/armv4_5.h @@ -26,7 +26,7 @@ #ifndef ARMV4_5_H #define ARMV4_5_H -#include "target.h" +#include <target/target.h> #include <helper/command.h> diff --git a/src/target/mips32.h b/src/target/mips32.h index ee5bd42..98186af 100644 --- a/src/target/mips32.h +++ b/src/target/mips32.h @@ -23,7 +23,7 @@ #ifndef MIPS32_H #define MIPS32_H -#include "target.h" +#include <target/target.h> #include <target/mips32_pracc.h> commit fa43bdff54a2f42e7c5a77304d8d1ffb3fe75ea5 Author: Zachary T Welch <zw...@su...> Date: Thu Dec 3 04:14:50 2009 -0800 change #include "register.h" to <target/register.h> Changes from the flat namespace to heirarchical one. Instead of writing: #include "register.h" the following form should be used. #include <target/register.h> The exception is from .c files in the same directory. diff --git a/src/server/gdb_server.c b/src/server/gdb_server.c index cd8c46c..3129401 100644 --- a/src/server/gdb_server.c +++ b/src/server/gdb_server.c @@ -29,7 +29,7 @@ #include <target/breakpoints.h> #include "target_request.h" -#include "register.h" +#include <target/register.h> #include "server.h" #include "flash.h" #include "gdb_server.h" commit aaf948a6be72a92aef286c01f6902505364e8152 Author: Zachary T Welch <zw...@su...> Date: Thu Dec 3 04:14:49 2009 -0800 change #include "mips_ejtag.h" to <target/mips_ejtag.h> Changes from the flat namespace to heirarchical one. Instead of writing: #include "mips_ejtag.h" the following form should be used. #include <target/mips_ejtag.h> The exception is from .c files in the same directory. diff --git a/src/target/mips32_dmaacc.h b/src/target/mips32_dmaacc.h index c1aa07d..e614c12 100644 --- a/src/target/mips32_dmaacc.h +++ b/src/target/mips32_dmaacc.h @@ -25,7 +25,7 @@ #ifndef MIPS32_DMAACC_H #define MIPS32_DMAACC_H -#include "mips_ejtag.h" +#include <target/mips_ejtag.h> #define EJTAG_CTRL_DMA_BYTE 0x00000000 #define EJTAG_CTRL_DMA_HALFWORD 0x00000080 diff --git a/src/target/mips32_pracc.h b/src/target/mips32_pracc.h index 5d1cf3d..eceea5d 100644 --- a/src/target/mips32_pracc.h +++ b/src/target/mips32_pracc.h @@ -22,7 +22,7 @@ #ifndef MIPS32_PRACC_H #define MIPS32_PRACC_H -#include "mips_ejtag.h" +#include <target/mips_ejtag.h> #define MIPS32_PRACC_TEXT 0xFF200200 //#define MIPS32_PRACC_STACK 0xFF2FFFFC commit 36e53978b91c124fb7388d795856fa01ab138dc5 Author: Zachary T Welch <zw...@su...> Date: Thu Dec 3 04:14:49 2009 -0800 change #include "mips32_pracc.h" to <target/mips32_pracc.h> Changes from the flat namespace to heirarchical one. Instead of writing: #include "mips32_pracc.h" the following form should be used. #include <target/mips32_pracc.h> The exception is from .c files in the same directory. diff --git a/src/target/mips32.h b/src/target/mips32.h index 7d1928e..ee5bd42 100644 --- a/src/target/mips32.h +++ b/src/target/mips32.h @@ -24,7 +24,7 @@ #define MIPS32_H #include "target.h" -#include "mips32_pracc.h" +#include <target/mips32_pracc.h> #define MIPS32_COMMON_MAGIC 0xB320B320 commit a8880f0b5ab7f5c9d4d3b031fd487caac766b99f Author: Zachary T Welch <zw...@su...> Date: Thu Dec 3 04:14:48 2009 -0800 change #include "mips32.h" to <target/mips32.h> Changes from the flat namespace to heirarchical one. Instead of writing: #include "mips32.h" the following form should be used. #include <target/mips32.h> The exception is from .c files in the same directory. diff --git a/src/flash/nor/pic32mx.c b/src/flash/nor/pic32mx.c index 9bb6c97..d2289b2 100644 --- a/src/flash/nor/pic32mx.c +++ b/src/flash/nor/pic32mx.c @@ -28,7 +28,7 @@ #endif #include "pic32mx.h" -#include "mips32.h" +#include <target/mips32.h> static commit 7da02a8330d48f05f1ea9af93adb572f083aa728 Author: Zachary T Welch <zw...@su...> Date: Thu Dec 3 04:14:47 2009 -0800 change #include "image.h" to <target/image.h> Changes from the flat namespace to heirarchical one. Instead of writing: #include "image.h" the following form should be used. #include <target/image.h> The exception is from .c files in the same directory. diff --git a/src/flash/flash.c b/src/flash/flash.c index e910e42..d16949d 100644 --- a/src/flash/flash.c +++ b/src/flash/flash.c @@ -29,7 +29,7 @@ #include "flash.h" #include "common.h" -#include "image.h" +#include <target/image.h> #include <helper/time_support.h> static int flash_write_unlock(struct target *target, struct image *image, uint32_t *written, int erase, bool unlock); diff --git a/src/flash/nor/ecos.c b/src/flash/nor/ecos.c index ca8f3f5..81223b6 100644 --- a/src/flash/nor/ecos.c +++ b/src/flash/nor/ecos.c @@ -23,7 +23,7 @@ #include "flash.h" #include <target/embeddedice.h> -#include "image.h" +#include <target/image.h> #include <target/algorithm.h> diff --git a/src/flash/nor/faux.c b/src/flash/nor/faux.c index caec2c7..124ca3e 100644 --- a/src/flash/nor/faux.c +++ b/src/flash/nor/faux.c @@ -22,7 +22,7 @@ #endif #include "flash.h" -#include "image.h" +#include <target/image.h> #include "../hello.h" diff --git a/src/flash/nor/lpc2900.c b/src/flash/nor/lpc2900.c index cf74679..c1fefd7 100644 --- a/src/flash/nor/lpc2900.c +++ b/src/flash/nor/lpc2900.c @@ -23,7 +23,7 @@ #endif -#include "image.h" +#include <target/image.h> #include "flash.h" #include <helper/binarybuffer.h> #include <target/armv4_5.h> diff --git a/src/server/gdb_server.c b/src/server/gdb_server.c index 5cda21e..cd8c46c 100644 --- a/src/server/gdb_server.c +++ b/src/server/gdb_server.c @@ -33,7 +33,7 @@ #include "server.h" #include "flash.h" #include "gdb_server.h" -#include "image.h" +#include <target/image.h> #include <jtag/jtag.h> commit 0241b1e1054e7d3d187c0a41c7ffefab321b6b67 Author: Zachary T Welch <zw...@su...> Date: Thu Dec 3 04:14:46 2009 -0800 change #include "etm.h" to <target/etm.h> Changes from the flat namespace to heirarchical one. Instead of writing: #include "etm.h" the following form should be used. #include <target/etm.h> The exception is from .c files in the same directory. diff --git a/src/target/etm_dummy.h b/src/target/etm_dummy.h index 2673e4f..95980f8 100644 --- a/src/target/etm_dummy.h +++ b/src/target/etm_dummy.h @@ -20,7 +20,7 @@ #ifndef ETM_DUMMY_H #define ETM_DUMMY_H -#include "etm.h" +#include <target/etm.h> extern struct etm_capture_driver etm_dummy_capture_driver; diff --git a/src/target/oocd_trace.h b/src/target/oocd_trace.h index 8234b65..7c334f2 100644 --- a/src/target/oocd_trace.h +++ b/src/target/oocd_trace.h @@ -20,7 +20,7 @@ #ifndef OOCD_TRACE_H #define OOCD_TRACE_H -#include "etm.h" +#include <target/etm.h> #include <termios.h> commit 1650ab3a22d62c834126138f253643031c8418ba Author: Zachary T Welch <zw...@su...> Date: Thu Dec 3 04:14:45 2009 -0800 change #include "embeddedice.h" to <target/embeddedice.h> Changes from the flat namespace to heirarchical one. Instead of writing: #include "embeddedice.h" the following form should be used. #include <target/embeddedice.h> The exception is from .c files in the same directory. diff --git a/src/flash/nor/ecos.c b/src/flash/nor/ecos.c index f689e15..ca8f3f5 100644 --- a/src/flash/nor/ecos.c +++ b/src/flash/nor/ecos.c @@ -22,7 +22,7 @@ #endif #include "flash.h" -#include "embeddedice.h" +#include <target/embeddedice.h> #include "image.h" #include <target/algorithm.h> diff --git a/src/flash/nor/ocl.c b/src/flash/nor/ocl.c index 388395f..57d9efa 100644 --- a/src/flash/nor/ocl.c +++ b/src/flash/nor/ocl.c @@ -23,7 +23,7 @@ #include "ocl.h" #include "flash.h" -#include "embeddedice.h" +#include <target/embeddedice.h> struct ocl_priv diff --git a/src/jtag/minidummy/minidummy.c b/src/jtag/minidummy/minidummy.c index 8ada579..e60e832 100644 --- a/src/jtag/minidummy/minidummy.c +++ b/src/jtag/minidummy/minidummy.c @@ -20,7 +20,7 @@ #include "config.h" #endif -#include "embeddedice.h" +#include <target/embeddedice.h> #include <jtag/minidriver.h> #include <jtag/interface.h> diff --git a/src/jtag/zy1000/zy1000.c b/src/jtag/zy1000/zy1000.c index ca70b2b..5b6e4ea 100644 --- a/src/jtag/zy1000/zy1000.c +++ b/src/jtag/zy1000/zy1000.c @@ -20,7 +20,7 @@ #include "config.h" #endif -#include "embeddedice.h" +#include <target/embeddedice.h> #include <jtag/minidriver.h> #include <jtag/interface.h> #include "zy1000_version.h" diff --git a/src/target/arm7tdmi.h b/src/target/arm7tdmi.h index b6bbe59..ce771e2 100644 --- a/src/target/arm7tdmi.h +++ b/src/target/arm7tdmi.h @@ -23,7 +23,7 @@ #ifndef ARM7TDMI_H #define ARM7TDMI_H -#include "embeddedice.h" +#include <target/embeddedice.h> int arm7tdmi_init_arch_info(struct target *target, struct arm7_9_common *arm7_9, struct jtag_tap *tap); diff --git a/src/target/arm9tdmi.h b/src/target/arm9tdmi.h index aff9fc5..ea43690 100644 --- a/src/target/arm9tdmi.h +++ b/src/target/arm9tdmi.h @@ -23,7 +23,7 @@ #ifndef ARM9TDMI_H #define ARM9TDMI_H -#include "embeddedice.h" +#include <target/embeddedice.h> int arm9tdmi_init_target(struct command_context *cmd_ctx, struct target *target); commit 26e4fac57e2e022409b63a444928a41399a0a76b Author: Zachary T Welch <zw...@su...> Date: Thu Dec 3 04:14:44 2009 -0800 change #include "breakpoints.h" to <target/breakpoints.h> Changes from the flat namespace to heirarchical one. Instead of writing: #include "breakpoints.h" the following form should be used. #include <target/breakpoints.h> The exception is from .c files in the same directory. diff --git a/src/server/gdb_server.c b/src/server/gdb_server.c index ef8d7f2..5cda21e 100644 --- a/src/server/gdb_server.c +++ b/src/server/gdb_server.c @@ -27,7 +27,7 @@ #include "config.h" #endif -#include "breakpoints.h" +#include <target/breakpoints.h> #include "target_request.h" #include "register.h" #include "server.h" commit 54063d72945e1022def8ad9b46dc61564eee1f22 Author: Zachary T Welch <zw...@su...> Date: Thu Dec 3 04:14:44 2009 -0800 change #include "avrt.h" to <target/avrt.h> Changes from the flat namespace to heirarchical one. Instead of writing: #include "avrt.h" the following form should be used. #include <target/avrt.h> The exception is from .c files in the same directory. diff --git a/src/flash/nor/avrf.c b/src/flash/nor/avrf.c index 687dd4b..2bc4438 100644 --- a/src/flash/nor/avrf.c +++ b/src/flash/nor/avrf.c @@ -22,7 +22,7 @@ #endif #include "avrf.h" -#include "avrt.h" +#include <target/avrt.h> #include "flash.h" commit f52a5968604ae0dffc5b93e745724f850a416282 Author: Zachary T Welch <zw...@su...> Date: Thu Dec 3 04:14:43 2009 -0800 change #include "armv7m.h" to <target/armv7m.h> Changes from the flat namespace to heirarchical one. Instead of writing: #include "armv7m.h" the following form should be used. #include <target/armv7m.h> The exception is from .c files in the same directory. diff --git a/src/flash/nor/lpc2000.c b/src/flash/nor/lpc2000.c index 9479a9f..295e3e7 100644 --- a/src/flash/nor/lpc2000.c +++ b/src/flash/nor/lpc2000.c @@ -26,7 +26,7 @@ #endif #include "lpc2000.h" -#include "armv7m.h" +#include <target/armv7m.h> #include <helper/binarybuffer.h> #include <target/algorithm.h> diff --git a/src/flash/nor/stellaris.c b/src/flash/nor/stellaris.c index 90b0ac6..f0028ea 100644 --- a/src/flash/nor/stellaris.c +++ b/src/flash/nor/stellaris.c @@ -29,7 +29,7 @@ #endif #include "stellaris.h" -#include "armv7m.h" +#include <target/armv7m.h> #include <helper/binarybuffer.h> #include <target/algorithm.h> diff --git a/src/flash/nor/stm32x.c b/src/flash/nor/stm32x.c index 581b650..3792547 100644 --- a/src/flash/nor/stm32x.c +++ b/src/flash/nor/stm32x.c @@ -25,7 +25,7 @@ #endif #include "stm32x.h" -#include "armv7m.h" +#include <target/armv7m.h> #include <helper/binarybuffer.h> #include <target/algorithm.h> diff --git a/src/target/cortex_m3.h b/src/target/cortex_m3.h index 7ce8901..c31c3f5 100644 --- a/src/target/cortex_m3.h +++ b/src/target/cortex_m3.h @@ -26,7 +26,7 @@ #ifndef CORTEX_M3_H #define CORTEX_M3_H -#include "armv7m.h" +#include <target/armv7m.h> #define CORTEX_M3_COMMON_MAGIC 0x1A451A45 commit a1c40f5120bd45f98974fd73d1cdaa10c674f09c Author: Zachary T Welch <zw...@su...> Date: Thu Dec 3 04:14:43 2009 -0800 change #include "armv7a.h" to <target/armv7a.h> Changes from the flat namespace to heirarchical one. Instead of writing: #include "armv7a.h" the following form should be used. #include <target/armv7a.h> The exception is from .c files in the same directory. diff --git a/src/target/cortex_a8.h b/src/target/cortex_a8.h index 87db23e..adffe93 100644 --- a/src/target/cortex_a8.h +++ b/src/target/cortex_a8.h @@ -29,7 +29,7 @@ #ifndef CORTEX_A8_H #define CORTEX_A8_H -#include "armv7a.h" +#include <target/armv7a.h> extern char* cortex_a8_state_strings[]; commit 377c5504b9cd040aa986d0927ab8aa49032b8584 Author: Zachary T Welch <zw...@su...> Date: Thu Dec 3 04:14:42 2009 -0800 change #include "armv4_5_mmu.h" to <target/armv4_5_mmu.h> Changes from the flat namespace to heirarchical one. Instead of writing: #include "armv4_5_mmu.h" the following form should be used. #include <target/armv4_5_mmu.h> The exception is from .c files in the same directory. diff --git a/src/target/arm720t.h b/src/target/arm720t.h index d78c07e..b13cff8 100644 --- a/src/target/arm720t.h +++ b/src/target/arm720t.h @@ -21,7 +21,7 @@ #define ARM720T_H #include <target/arm7tdmi.h> -#include "armv4_5_mmu.h" +#include <target/armv4_5_mmu.h> #define ARM720T_COMMON_MAGIC 0xa720a720 diff --git a/src/target/arm920t.h b/src/target/arm920t.h index 97d0261..0eb14fc 100644 --- a/src/target/arm920t.h +++ b/src/target/arm920t.h @@ -21,7 +21,7 @@ #define ARM920T_H #include <target/arm9tdmi.h> -#include "armv4_5_mmu.h" +#include <target/armv4_5_mmu.h> #define ARM920T_COMMON_MAGIC 0xa920a920 diff --git a/src/target/arm926ejs.h b/src/target/arm926ejs.h index 9202fc6..604ab08 100644 --- a/src/target/arm926ejs.h +++ b/src/target/arm926ejs.h @@ -21,7 +21,7 @@ #define ARM926EJS_H #include <target/arm9tdmi.h> -#include "armv4_5_mmu.h" +#include <target/armv4_5_mmu.h> #define ARM926EJS_COMMON_MAGIC 0xa926a926 diff --git a/src/target/armv7a.h b/src/target/armv7a.h index 6872b38..0d5da86 100644 --- a/src/target/armv7a.h +++ b/src/target/armv7a.h @@ -21,7 +21,7 @@ #include <target/arm_adi_v5.h> #include <target/armv4_5.h> -#include "armv4_5_mmu.h" +#include <target/armv4_5_mmu.h> #include <target/armv4_5_cache.h> #include <target/arm_dpm.h> diff --git a/src/target/xscale.h b/src/target/xscale.h index 9e19f45..c083b06 100644 --- a/src/target/xscale.h +++ b/src/target/xscale.h @@ -24,7 +24,7 @@ #define XSCALE_H #include <target/armv4_5.h> -#include "armv4_5_mmu.h" +#include <target/armv4_5_mmu.h> #include "trace.h" #define XSCALE_COMMON_MAGIC 0x58534341 commit 56adfadb5de436ea627dc04a537917318317fd01 Author: Zachary T Welch <zw...@su...> Date: Thu Dec 3 04:14:42 2009 -0800 change #include "armv4_5_cache.h" to <target/armv4_5_cache.h> Changes from the flat namespace to heirarchical one. Instead of writing: #include "armv4_5_cache.h" the following form should be used. #include <target/armv4_5_cache.h> The exception is from .c files in the same directory. diff --git a/src/target/armv4_5_mmu.h b/src/target/armv4_5_mmu.h index 6b9ed34..428a373 100644 --- a/src/target/armv4_5_mmu.h +++ b/src/target/armv4_5_mmu.h @@ -20,7 +20,7 @@ #ifndef ARMV4_5_MMU_H #define ARMV4_5_MMU_H -#include "armv4_5_cache.h" +#include <target/armv4_5_cache.h> struct target; diff --git a/src/target/armv7a.h b/src/target/armv7a.h index da8ccdf..6872b38 100644 --- a/src/target/armv7a.h +++ b/src/target/armv7a.h @@ -22,7 +22,7 @@ #include <target/arm_adi_v5.h> #include <target/armv4_5.h> #include "armv4_5_mmu.h" -#include "armv4_5_cache.h" +#include <target/armv4_5_cache.h> #include <target/arm_dpm.h> enum commit ddea03304310e1342ee127fc7e6507bbfb237ae4 Author: Zachary T Welch <zw...@su...> Date: Thu Dec 3 04:14:42 2009 -0800 change #include "armv4_5.h" to <target/armv4_5.h> Changes from the flat namespace to heirarchical one. Instead of writing: #include "armv4_5.h" the following form should be used. #include <target/armv4_5.h> The exception is from .c files in the same directory. diff --git a/src/flash/arm_nandio.c b/src/flash/arm_nandio.c index 4647c79..fdf2109 100644 --- a/src/flash/arm_nandio.c +++ b/src/flash/arm_nandio.c @@ -25,7 +25,7 @@ #endif #include "arm_nandio.h" -#include "armv4_5.h" +#include <target/armv4_5.h> #include <target/algorithm.h> /** diff --git a/src/flash/nand/orion.c b/src/flash/nand/orion.c index 77a03f2..0f08fe4 100644 --- a/src/flash/nand/orion.c +++ b/src/flash/nand/orion.c @@ -27,7 +27,7 @@ #endif #include "arm_nandio.h" -#include "armv4_5.h" +#include <target/armv4_5.h> struct orion_nand_controller diff --git a/src/flash/nor/aduc702x.c b/src/flash/nor/aduc702x.c index 402da1f..a8d76ce 100644 --- a/src/flash/nor/aduc702x.c +++ b/src/flash/nor/aduc702x.c @@ -24,7 +24,7 @@ #endif #include "flash.h" -#include "armv4_5.h" +#include <target/armv4_5.h> #include <helper/binarybuffer.h> #include <helper/time_support.h> #include <target/algorithm.h> diff --git a/src/flash/nor/cfi.c b/src/flash/nor/cfi.c index 043d742..61b5d4c 100644 --- a/src/flash/nor/cfi.c +++ b/src/flash/nor/cfi.c @@ -25,7 +25,7 @@ #include "cfi.h" #include "non_cfi.h" -#include "armv4_5.h" +#include <target/armv4_5.h> #include <helper/binarybuffer.h> #include <target/algorithm.h> diff --git a/src/flash/nor/lpc2900.c b/src/flash/nor/lpc2900.c index 9cbb9e4..cf74679 100644 --- a/src/flash/nor/lpc2900.c +++ b/src/flash/nor/lpc2900.c @@ -26,7 +26,7 @@ #include "image.h" #include "flash.h" #include <helper/binarybuffer.h> -#include "armv4_5.h" +#include <target/armv4_5.h> #include <target/algorithm.h> diff --git a/src/flash/nor/str7x.c b/src/flash/nor/str7x.c index 4da3f07..c5a1c34 100644 --- a/src/flash/nor/str7x.c +++ b/src/flash/nor/str7x.c @@ -25,7 +25,7 @@ #endif #include "str7x.h" -#include "armv4_5.h" +#include <target/armv4_5.h> #include <helper/binarybuffer.h> #include <target/algorithm.h> diff --git a/src/target/arm11.h b/src/target/arm11.h index fd14720..b118e1c 100644 --- a/src/target/arm11.h +++ b/src/target/arm11.h @@ -23,7 +23,7 @@ #ifndef ARM11_H #define ARM11_H -#include "armv4_5.h" +#include <target/armv4_5.h> #include <target/arm_dpm.h> #define ARM11_TAP_DEFAULT TAP_INVALID diff --git a/src/target/arm7_9_common.h b/src/target/arm7_9_common.h index 9cf8b41..7555bec 100644 --- a/src/target/arm7_9_common.h +++ b/src/target/arm7_9_common.h @@ -29,7 +29,7 @@ #ifndef ARM7_9_COMMON_H #define ARM7_9_COMMON_H -#include "armv4_5.h" +#include <target/armv4_5.h> #include <target/arm_jtag.h> #define ARM7_9_COMMON_MAGIC 0x0a790a79 /**< */ diff --git a/src/target/armv7a.h b/src/target/armv7a.h index 9158d78..da8ccdf 100644 --- a/src/target/armv7a.h +++ b/src/target/armv7a.h @@ -20,7 +20,7 @@ #define ARMV7A_H #include <target/arm_adi_v5.h> -#include "armv4_5.h" +#include <target/armv4_5.h> #include "armv4_5_mmu.h" #include "armv4_5_cache.h" #include <target/arm_dpm.h> diff --git a/src/target/armv7m.h b/src/target/armv7m.h index 46871e1..353860a 100644 --- a/src/target/armv7m.h +++ b/src/target/armv7m.h @@ -27,7 +27,7 @@ #define ARMV7M_COMMON_H #include <target/arm_adi_v5.h> -#include "armv4_5.h" +#include <target/armv4_5.h> /* define for enabling armv7 gdb workarounds */ #if 1 diff --git a/src/target/xscale.h b/src/target/xscale.h index 0a70ecb..9e19f45 100644 --- a/src/target/xscale.h +++ b/src/target/xscale.h @@ -23,7 +23,7 @@ #ifndef XSCALE_H #define XSCALE_H -#include "armv4_5.h" +#include <target/armv4_5.h> #include "armv4_5_mmu.h" #include "trace.h" commit 15accefbe284cfa0c4735ecb5ae3d2127ac8cfff Author: Zachary T Welch <zw...@su...> Date: Thu Dec 3 04:14:41 2009 -0800 change #include "arm_jtag.h" to <target/arm_jtag.h> Changes from the flat namespace to heirarchical one. Instead of writing: #include "arm_jtag.h" the following form should be used. #include <target/arm_jtag.h> The exception is from .c files in the same directory. diff --git a/src/target/arm7_9_common.h b/src/target/arm7_9_common.h index d43eaa6..9cf8b41 100644 --- a/src/target/arm7_9_common.h +++ b/src/target/arm7_9_common.h @@ -30,7 +30,7 @@ #define ARM7_9_COMMON_H #include "armv4_5.h" -#include "arm_jtag.h" +#include <target/arm_jtag.h> #define ARM7_9_COMMON_MAGIC 0x0a790a79 /**< */ diff --git a/src/target/arm_adi_v5.h b/src/target/arm_adi_v5.h index a78193c..c268f96 100644 --- a/src/target/arm_adi_v5.h +++ b/src/target/arm_adi_v5.h @@ -23,7 +23,7 @@ #ifndef ARM_ADI_V5_H #define ARM_ADI_V5_H -#include "arm_jtag.h" +#include <target/arm_jtag.h> #define DAP_IR_DPACC 0xA #define DAP_IR_APACC 0xB diff --git a/src/target/etm.h b/src/target/etm.h index c8da794..60e4ea7 100644 --- a/src/target/etm.h +++ b/src/target/etm.h @@ -24,7 +24,7 @@ #define ETM_H #include "trace.h" -#include "arm_jtag.h" +#include <target/arm_jtag.h> struct image; commit 98eea5680b491a26812214ddfeeafb3f088b94aa Author: Zachary T Welch <zw...@su...> Date: Thu Dec 3 04:14:40 2009 -0800 change #include "arm_dpm.h" to <target/arm_dpm.h> Changes from the flat namespace to heirarchical one. Instead of writing: #include "arm_dpm.h" the following form should be used. #include <target/arm_dpm.h> The exception is from .c files in the same directory. diff --git a/src/target/arm11.h b/src/target/arm11.h index cd52896..fd14720 100644 --- a/src/target/arm11.h +++ b/src/target/arm11.h @@ -24,7 +24,7 @@ #define ARM11_H #include "armv4_5.h" -#include "arm_dpm.h" +#include <target/arm_dpm.h> #define ARM11_TAP_DEFAULT TAP_INVALID diff --git a/src/target/armv7a.h b/src/target/armv7a.h index 2bd261a..9158d78 100644 --- a/src/target/armv7a.h +++ b/src/target/armv7a.h @@ -23,7 +23,7 @@ #include "armv4_5.h" #include "armv4_5_mmu.h" #include "armv4_5_cache.h" -#include "arm_dpm.h" +#include <target/arm_dpm.h> enum { commit 0c1bc6703cc76b61d352477af9a796dcab28adcd Author: Zachary T Welch <zw...@su...> Date: Thu Dec 3 04:14:39 2009 -0800 change #include "arm_adi_v5.h" to <target/arm_adi_v5.h> Changes from the flat namespace to heirarchical one. Instead of writing: #include "arm_adi_v5.h" the following form should be used. #include <target/arm_adi_v5.h> The exception is from .c files in the same directory. diff --git a/src/target/armv7a.h b/src/target/armv7a.h index 6ccf3e2..2bd261a 100644 --- a/src/target/armv7a.h +++ b/src/target/armv7a.h @@ -19,7 +19,7 @@ #ifndef ARMV7A_H #define ARMV7A_H -#include "arm_adi_v5.h" +#include <target/arm_adi_v5.h> #include "armv4_5.h" #include "armv4_5_mmu.h" #include "armv4_5_cache.h" diff --git a/src/target/armv7m.h b/src/target/armv7m.h index 7299bdf..46871e1 10064... [truncated message content] |
From: Øyvind H. <go...@us...> - 2009-12-03 10:15:59
|
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 a976ce2dd4d3d6f0e851a5903494805ea60133f4 (commit) from 879a04cc6bc2bdf62b19b974524e1f15f2c9da8e (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 a976ce2dd4d3d6f0e851a5903494805ea60133f4 Author: Nicolas Pitre <ni...@fl...> Date: Thu Dec 3 02:06:10 2009 -0500 feroceon.c should be part of ARM7_9_SRC The Feroceon and Dragonite cores are similar to the ARM926 and ARM966 cores respectively. Signed-off-by: Nicolas Pitre <ni...@ma...> diff --git a/src/target/Makefile.am b/src/target/Makefile.am index cb473a3..6d2b76d 100644 --- a/src/target/Makefile.am +++ b/src/target/Makefile.am @@ -58,11 +58,11 @@ ARM7_9_SRC = \ arm9tdmi.c \ arm920t.c \ arm966e.c \ - arm926ejs.c + arm926ejs.c \ + feroceon.c ARM_MISC_SRC = \ fa526.c \ - feroceon.c \ xscale.c ARMV6_SRC = \ ----------------------------------------------------------------------- Summary of changes: src/target/Makefile.am | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: Zach W. <zw...@us...> - 2009-12-03 08:50:56
|
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 879a04cc6bc2bdf62b19b974524e1f15f2c9da8e (commit) via 865efd828a267992db0f2a92a731c5ce23a34236 (commit) via fe9228a32db930be297d4d3b35ffb94d6de1b9ab (commit) via e1ec02bb055fa356b058dddc0a15710e0fdc9870 (commit) from d5e4e23f9a5b1074cd298d5386e638a9fa78b1ad (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 879a04cc6bc2bdf62b19b974524e1f15f2c9da8e Author: Zachary T Welch <zw...@su...> Date: Wed Dec 2 17:30:33 2009 -0800 remove #if HAVE_JTAG_INTERFACE_H from minidriver.h Adds two "minidriver_imp.h" files, so the right one is allowed to be "#included" by the Makefile logic. diff --git a/src/jtag/Makefile.am b/src/jtag/Makefile.am index c735897..421987c 100644 --- a/src/jtag/Makefile.am +++ b/src/jtag/Makefile.am @@ -11,6 +11,9 @@ libjtag_la_LIBADD = if MINIDRIVER +# for minidriver_imp.h +AM_CPPFLAGS += -I$(srcdir)/minidriver + if ZY1000 DRIVERFILES += zy1000/zy1000.c AM_CPPFLAGS += -I$(srcdir)/zy1000 @@ -27,6 +30,9 @@ DRIVERFILES += commands.c SUBDIRS += drivers libjtag_la_LIBADD += $(top_builddir)/src/jtag/drivers/libocdjtagdrivers.la +# for minidriver_imp.h +AM_CPPFLAGS += -I$(srcdir)/drivers + endif # endif // MINIDRIVER @@ -43,6 +49,7 @@ noinst_HEADERS = \ interfaces.h \ minidriver.h \ jtag.h \ + minidriver/minidriver_imp.h \ minidummy/jtag_minidriver.h EXTRA_DIST = startup.tcl diff --git a/src/jtag/drivers/Makefile.am b/src/jtag/drivers/Makefile.am index 0a007b4..15fbae3 100644 --- a/src/jtag/drivers/Makefile.am +++ b/src/jtag/drivers/Makefile.am @@ -65,6 +65,7 @@ endif noinst_HEADERS = \ bitbang.h \ bitq.h \ + minidriver_imp.h \ rlink.h \ rlink_dtc_cmd.h \ rlink_ep1_cmd.h \ diff --git a/src/jtag/drivers/minidriver_imp.h b/src/jtag/drivers/minidriver_imp.h new file mode 100644 index 0000000..f60580c --- /dev/null +++ b/src/jtag/drivers/minidriver_imp.h @@ -0,0 +1,47 @@ +/*************************************************************************** + * Copyright (C) 2005 by Dominic Rath <Dom...@gm...> * + * Copyright (C) 2007,2008 Ãyvind Harboe <oyv...@zy...> * + * Copyright (C) 2009 Zachary T Welch <zw...@su...> * + * * + * 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 * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef MINIDRIVER_IMP_H +#define MINIDRIVER_IMP_H + +#include "commands.h" + +static inline void interface_jtag_alloc_in_value32(struct scan_field *field) +{ + field->in_value = (uint8_t *)cmd_queue_alloc(4); +} + +static inline void interface_jtag_add_scan_check_alloc(struct scan_field *field) +{ + unsigned num_bytes = DIV_ROUND_UP(field->num_bits, 8); + field->in_value = (uint8_t *)cmd_queue_alloc(num_bytes); +} + +void interface_jtag_add_dr_out(struct jtag_tap* tap, + int num_fields, const int* num_bits, const uint32_t* value, + tap_state_t end_state); + +void interface_jtag_add_callback(jtag_callback1_t f, jtag_callback_data_t data0); + +void interface_jtag_add_callback4(jtag_callback_t f, jtag_callback_data_t data0, + jtag_callback_data_t data1, jtag_callback_data_t data2, + jtag_callback_data_t data3); + +#endif // MINIDRIVER_IMP_H diff --git a/src/jtag/minidriver.h b/src/jtag/minidriver.h index 392a190..ea780fa 100644 --- a/src/jtag/minidriver.h +++ b/src/jtag/minidriver.h @@ -26,13 +26,14 @@ #ifndef MINIDRIVER_H #define MINIDRIVER_H -/* @page jtagminidriver JTAG Mini-Driver +/** + * @page jtagminidriver JTAG Mini-Driver * * The JTAG minidriver interface allows the definition of alternate * interface functions, instead of the built-in asynchronous driver * module that is used by the standard JTAG interface drivers. * - * In addtion to the functions defined in the c minidriver.h file, the + * In addtion to the functions defined in the @c minidriver.h file, the * @c jtag_minidriver.h file must declare the following functions (or * define static inline versions of them): * - jtag_add_callback @@ -44,54 +45,9 @@ * - default_interface_jtag_execute_queue() */ -#ifdef HAVE_JTAG_MINIDRIVER_H - -#include "jtag_minidriver.h" - -static inline void interface_jtag_alloc_in_value32(struct scan_field *field) -{ - field->in_value = field->intmp; -} - -static inline void interface_jtag_add_scan_check_alloc(struct scan_field *field) -{ - /* We're executing this synchronously, so try to use local storage. */ - if (field->num_bits > 32) - { - unsigned num_bytes = DIV_ROUND_UP(field->num_bits, 8); - field->in_value = (uint8_t *)malloc(num_bytes); - field->allocated = 1; - } - else - field->in_value = field->intmp; -} - -#else - -#include "commands.h" - -static inline void interface_jtag_alloc_in_value32(struct scan_field *field) -{ - field->in_value = (uint8_t *)cmd_queue_alloc(4); -} - -static inline void interface_jtag_add_scan_check_alloc(struct scan_field *field) -{ - unsigned num_bytes = DIV_ROUND_UP(field->num_bits, 8); - field->in_value = (uint8_t *)cmd_queue_alloc(num_bytes); -} - -void interface_jtag_add_dr_out(struct jtag_tap* tap, - int num_fields, const int* num_bits, const uint32_t* value, - tap_state_t end_state); - -void interface_jtag_add_callback(jtag_callback1_t f, jtag_callback_data_t data0); - -void interface_jtag_add_callback4(jtag_callback_t f, jtag_callback_data_t data0, - jtag_callback_data_t data1, jtag_callback_data_t data2, - jtag_callback_data_t data3); - -#endif +// this header will be provided by the minidriver implementation, +// and it may provide additional declarations that must be defined. +#include "minidriver_imp.h" int interface_jtag_add_ir_scan( int num_fields, const struct scan_field* fields, diff --git a/src/jtag/minidriver/minidriver_imp.h b/src/jtag/minidriver/minidriver_imp.h new file mode 100644 index 0000000..e371514 --- /dev/null +++ b/src/jtag/minidriver/minidriver_imp.h @@ -0,0 +1,44 @@ +/*************************************************************************** + * Copyright (C) 2005 by Dominic Rath <Dom...@gm...> * + * Copyright (C) 2007,2008 Ãyvind Harboe <oyv...@zy...> * + * Copyright (C) 2009 Zachary T Welch <zw...@su...> * + * * + * 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 * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef MINIDRIVER_IMP_H +#define MINIDRIVER_IMP_H + +#include "jtag_minidriver.h" + +static inline void interface_jtag_alloc_in_value32(struct scan_field *field) +{ + field->in_value = field->intmp; +} + +static inline void interface_jtag_add_scan_check_alloc(struct scan_field *field) +{ + /* We're executing this synchronously, so try to use local storage. */ + if (field->num_bits > 32) + { + unsigned num_bytes = DIV_ROUND_UP(field->num_bits, 8); + field->in_value = (uint8_t *)malloc(num_bytes); + field->allocated = 1; + } + else + field->in_value = field->intmp; +} + +#endif // MINIDRIVER_IMP_H commit 865efd828a267992db0f2a92a731c5ce23a34236 Author: Zachary T Welch <zw...@su...> Date: Wed Dec 2 17:18:05 2009 -0800 move jtag drivers to src/jtag/drivers Moves JTAG interface drivers to src/jtag/drivers/, Adds src/jtag/drivers/Makefile.am. Builds libocdjtagdrivers.la. Flattens the rlink driver files into the drivers/ directory, adding the 'rlink_' prefix or '.rlink' suffix as appropriate. diff --git a/configure.in b/configure.in index 7b2b4af..5020ed6 100644 --- a/configure.in +++ b/configure.in @@ -1117,6 +1117,7 @@ AC_OUTPUT(dnl src/Makefile dnl src/helper/Makefile dnl src/jtag/Makefile dnl + src/jtag/drivers/Makefile dnl src/xsvf/Makefile dnl src/svf/Makefile dnl src/target/Makefile dnl diff --git a/src/jtag/Makefile.am b/src/jtag/Makefile.am index 5254a2b..c735897 100644 --- a/src/jtag/Makefile.am +++ b/src/jtag/Makefile.am @@ -5,7 +5,9 @@ AM_CPPFLAGS = \ METASOURCES = AUTO noinst_LTLIBRARIES = libjtag.la +SUBDIRS = DRIVERFILES = +libjtag_la_LIBADD = if MINIDRIVER @@ -20,63 +22,14 @@ endif else -# Standard Driver: common files -DRIVERFILES += driver.c commands.c +DRIVERFILES += commands.c -if USB -DRIVERFILES += usb_common.c -endif - -if BITBANG -DRIVERFILES += bitbang.c -endif -if PARPORT -DRIVERFILES += parport.c -endif -if DUMMY -DRIVERFILES += dummy.c -endif -if FT2232_DRIVER -DRIVERFILES += ft2232.c -endif -if AMTJTAGACCEL -DRIVERFILES += amt_jtagaccel.c -endif -if EP93XX -DRIVERFILES += ep93xx.c -endif -if AT91RM9200 -DRIVERFILES += at91rm9200.c -endif -if GW16012 -DRIVERFILES += gw16012.c -endif -if BITQ -DRIVERFILES += bitq.c -endif -if PRESTO_DRIVER -DRIVERFILES += presto.c -endif -if USBPROG -DRIVERFILES += usbprog.c -endif -if JLINK -DRIVERFILES += jlink.c -endif -if RLINK -DRIVERFILES += rlink/rlink.c rlink/rlink_speed_table.c -endif -if VSLLINK -DRIVERFILES += vsllink.c -endif -if ARMJTAGEW -DRIVERFILES += arm-jtag-ew.c -endif +SUBDIRS += drivers +libjtag_la_LIBADD += $(top_builddir)/src/jtag/drivers/libocdjtagdrivers.la endif # endif // MINIDRIVER - libjtag_la_SOURCES = \ core.c \ interface.c \ @@ -85,19 +38,12 @@ libjtag_la_SOURCES = \ $(DRIVERFILES) noinst_HEADERS = \ + commands.h \ interface.h \ interfaces.h \ - commands.h \ minidriver.h \ - bitbang.h \ jtag.h \ - bitq.h \ - rlink/dtc_cmd.h \ - rlink/ep1_cmd.h \ - rlink/rlink.h \ - rlink/st7.h \ - minidummy/jtag_minidriver.h \ - usb_common.h + minidummy/jtag_minidriver.h EXTRA_DIST = startup.tcl diff --git a/src/jtag/Makefile.am b/src/jtag/drivers/Makefile.am similarity index 56% copy from src/jtag/Makefile.am copy to src/jtag/drivers/Makefile.am index 5254a2b..0a007b4 100644 --- a/src/jtag/Makefile.am +++ b/src/jtag/drivers/Makefile.am @@ -1,27 +1,16 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/src/helper \ - -I$(top_srcdir)/src/target + -I$(top_srcdir)/src/jtag -METASOURCES = AUTO -noinst_LTLIBRARIES = libjtag.la +noinst_LTLIBRARIES = libocdjtagdrivers.la -DRIVERFILES = - -if MINIDRIVER - -if ZY1000 -DRIVERFILES += zy1000/zy1000.c -AM_CPPFLAGS += -I$(srcdir)/zy1000 -endif -if MINIDRIVER_DUMMY -DRIVERFILES += minidummy/minidummy.c commands.c -AM_CPPFLAGS += -I$(srcdir)/minidummy -endif +libocdjtagdrivers_la_SOURCES = \ + $(DRIVERFILES) -else +DRIVERFILES = # Standard Driver: common files -DRIVERFILES += driver.c commands.c +DRIVERFILES += driver.c if USB DRIVERFILES += usb_common.c @@ -64,7 +53,7 @@ if JLINK DRIVERFILES += jlink.c endif if RLINK -DRIVERFILES += rlink/rlink.c rlink/rlink_speed_table.c +DRIVERFILES += rlink.c rlink_speed_table.c endif if VSLLINK DRIVERFILES += vsllink.c @@ -73,32 +62,13 @@ if ARMJTAGEW DRIVERFILES += arm-jtag-ew.c endif -endif -# endif // MINIDRIVER - - -libjtag_la_SOURCES = \ - core.c \ - interface.c \ - interfaces.c \ - tcl.c \ - $(DRIVERFILES) - noinst_HEADERS = \ - interface.h \ - interfaces.h \ - commands.h \ - minidriver.h \ bitbang.h \ - jtag.h \ bitq.h \ - rlink/dtc_cmd.h \ - rlink/ep1_cmd.h \ - rlink/rlink.h \ - rlink/st7.h \ - minidummy/jtag_minidriver.h \ + rlink.h \ + rlink_dtc_cmd.h \ + rlink_ep1_cmd.h \ + rlink_st7.h \ usb_common.h -EXTRA_DIST = startup.tcl - MAINTAINERCLEANFILES = $(srcdir)/Makefile.in diff --git a/src/jtag/rlink/Makefile b/src/jtag/drivers/Makefile.rlink similarity index 100% rename from src/jtag/rlink/Makefile rename to src/jtag/drivers/Makefile.rlink diff --git a/src/jtag/amt_jtagaccel.c b/src/jtag/drivers/amt_jtagaccel.c similarity index 100% rename from src/jtag/amt_jtagaccel.c rename to src/jtag/drivers/amt_jtagaccel.c diff --git a/src/jtag/arm-jtag-ew.c b/src/jtag/drivers/arm-jtag-ew.c similarity index 100% rename from src/jtag/arm-jtag-ew.c rename to src/jtag/drivers/arm-jtag-ew.c diff --git a/src/jtag/at91rm9200.c b/src/jtag/drivers/at91rm9200.c similarity index 100% rename from src/jtag/at91rm9200.c rename to src/jtag/drivers/at91rm9200.c diff --git a/src/jtag/bitbang.c b/src/jtag/drivers/bitbang.c similarity index 100% rename from src/jtag/bitbang.c rename to src/jtag/drivers/bitbang.c diff --git a/src/jtag/bitbang.h b/src/jtag/drivers/bitbang.h similarity index 100% rename from src/jtag/bitbang.h rename to src/jtag/drivers/bitbang.h diff --git a/src/jtag/bitq.c b/src/jtag/drivers/bitq.c similarity index 100% rename from src/jtag/bitq.c rename to src/jtag/drivers/bitq.c diff --git a/src/jtag/bitq.h b/src/jtag/drivers/bitq.h similarity index 100% rename from src/jtag/bitq.h rename to src/jtag/drivers/bitq.h diff --git a/src/jtag/driver.c b/src/jtag/drivers/driver.c similarity index 100% rename from src/jtag/driver.c rename to src/jtag/drivers/driver.c diff --git a/src/jtag/dummy.c b/src/jtag/drivers/dummy.c similarity index 100% rename from src/jtag/dummy.c rename to src/jtag/drivers/dummy.c diff --git a/src/jtag/ep93xx.c b/src/jtag/drivers/ep93xx.c similarity index 100% rename from src/jtag/ep93xx.c rename to src/jtag/drivers/ep93xx.c diff --git a/src/jtag/ft2232.c b/src/jtag/drivers/ft2232.c similarity index 100% rename from src/jtag/ft2232.c rename to src/jtag/drivers/ft2232.c diff --git a/src/jtag/gw16012.c b/src/jtag/drivers/gw16012.c similarity index 100% rename from src/jtag/gw16012.c rename to src/jtag/drivers/gw16012.c diff --git a/src/jtag/jlink.c b/src/jtag/drivers/jlink.c similarity index 100% rename from src/jtag/jlink.c rename to src/jtag/drivers/jlink.c diff --git a/src/jtag/parport.c b/src/jtag/drivers/parport.c similarity index 100% rename from src/jtag/parport.c rename to src/jtag/drivers/parport.c diff --git a/src/jtag/presto.c b/src/jtag/drivers/presto.c similarity index 100% rename from src/jtag/presto.c rename to src/jtag/drivers/presto.c diff --git a/src/jtag/rlink/rlink.c b/src/jtag/drivers/rlink.c similarity index 99% rename from src/jtag/rlink/rlink.c rename to src/jtag/drivers/rlink.c index bb33ad8..a039080 100644 --- a/src/jtag/rlink/rlink.c +++ b/src/jtag/drivers/rlink.c @@ -31,9 +31,9 @@ #include "interface.h" #include "commands.h" #include "rlink.h" -#include "st7.h" -#include "ep1_cmd.h" -#include "dtc_cmd.h" +#include "rlink_st7.h" +#include "rlink_ep1_cmd.h" +#include "rlink_dtc_cmd.h" #include "usb_common.h" diff --git a/src/jtag/rlink/rlink.h b/src/jtag/drivers/rlink.h similarity index 100% rename from src/jtag/rlink/rlink.h rename to src/jtag/drivers/rlink.h diff --git a/src/jtag/rlink/call.m4 b/src/jtag/drivers/rlink_call.m4 similarity index 100% rename from src/jtag/rlink/call.m4 rename to src/jtag/drivers/rlink_call.m4 diff --git a/src/jtag/rlink/dtc_cmd.h b/src/jtag/drivers/rlink_dtc_cmd.h similarity index 100% rename from src/jtag/rlink/dtc_cmd.h rename to src/jtag/drivers/rlink_dtc_cmd.h diff --git a/src/jtag/rlink/ep1_cmd.h b/src/jtag/drivers/rlink_ep1_cmd.h similarity index 100% rename from src/jtag/rlink/ep1_cmd.h rename to src/jtag/drivers/rlink_ep1_cmd.h diff --git a/src/jtag/rlink/init.m4 b/src/jtag/drivers/rlink_init.m4 similarity index 100% rename from src/jtag/rlink/init.m4 rename to src/jtag/drivers/rlink_init.m4 diff --git a/src/jtag/rlink/rlink_speed_table.c b/src/jtag/drivers/rlink_speed_table.c similarity index 99% rename from src/jtag/rlink/rlink_speed_table.c rename to src/jtag/drivers/rlink_speed_table.c index 2ef62ee..fa40fe8 100644 --- a/src/jtag/rlink/rlink_speed_table.c +++ b/src/jtag/drivers/rlink_speed_table.c @@ -4,7 +4,7 @@ #endif #include "rlink.h" -#include "st7.h" +#include "rlink_st7.h" static const uint8_t dtc_64[] = { 0, 2, 68, 84, 67, 2, 13, 160, 176, 151, 147, 182, 141, 152, 177, 129, 148, diff --git a/src/jtag/rlink/st7.h b/src/jtag/drivers/rlink_st7.h similarity index 100% rename from src/jtag/rlink/st7.h rename to src/jtag/drivers/rlink_st7.h diff --git a/src/jtag/usb_common.c b/src/jtag/drivers/usb_common.c similarity index 100% rename from src/jtag/usb_common.c rename to src/jtag/drivers/usb_common.c diff --git a/src/jtag/usb_common.h b/src/jtag/drivers/usb_common.h similarity index 100% rename from src/jtag/usb_common.h rename to src/jtag/drivers/usb_common.h diff --git a/src/jtag/usbprog.c b/src/jtag/drivers/usbprog.c similarity index 100% rename from src/jtag/usbprog.c rename to src/jtag/drivers/usbprog.c diff --git a/src/jtag/vsllink.c b/src/jtag/drivers/vsllink.c similarity index 100% rename from src/jtag/vsllink.c rename to src/jtag/drivers/vsllink.c commit fe9228a32db930be297d4d3b35ffb94d6de1b9ab Author: Zachary T Welch <zw...@su...> Date: Wed Dec 2 15:54:15 2009 -0800 move nor drivers to src/flash/nor Moves NOR flash drivers to 'src/flash/nor/'. Adds 'src/flash/nor/Makefile.am'. Builds 'libocdflashnor.la'. diff --git a/configure.in b/configure.in index 3680cac..7b2b4af 100644 --- a/configure.in +++ b/configure.in @@ -1122,6 +1122,7 @@ AC_OUTPUT(dnl src/target/Makefile dnl src/server/Makefile dnl src/flash/Makefile dnl + src/flash/nor/Makefile dnl src/flash/nand/Makefile dnl src/pld/Makefile dnl doc/Makefile dnl diff --git a/src/flash/Makefile.am b/src/flash/Makefile.am index 353fcf1..54a5116 100644 --- a/src/flash/Makefile.am +++ b/src/flash/Makefile.am @@ -1,4 +1,5 @@ SUBDIRS = \ + nor \ nand AM_CPPFLAGS = \ @@ -9,66 +10,24 @@ AM_CPPFLAGS = \ METASOURCES = AUTO noinst_LTLIBRARIES = libflash.la libflash_la_SOURCES = \ - $(FLASH_SRCS) \ - $(NAND_SRCS) \ - mflash.c - -libflash_la_LIBADD = \ - $(top_builddir)/src/flash/nand/libocdflashnand.la - -FLASH_SRCS = \ common.c \ - cfi.c \ - non_cfi.c \ - faux.c \ - $(FLASH_DEVICES_SRCS) \ - flash.c - -FLASH_DEVICES_SRCS = \ - aduc702x.c \ - at91sam3.c \ - at91sam7.c \ - avrf.c \ - ecos.c \ - lpc2000.c \ - lpc288x.c \ - lpc2900.c \ - ocl.c \ - pic32mx.c \ - stellaris.c \ - stm32x.c \ - str7x.c \ - str9x.c \ - str9xpec.c \ - tms470.c - -NAND_SRCS = \ + flash.c \ arm_nandio.c \ nand_ecc.c \ nand_ecc_kw.c \ - nand.c + nand.c \ + mflash.c + +libflash_la_LIBADD = \ + $(top_builddir)/src/flash/nor/libocdflashnor.la \ + $(top_builddir)/src/flash/nand/libocdflashnand.la noinst_HEADERS = \ arm_nandio.h \ - at91sam7.h \ - at91sam3.h \ - avrf.h \ - cfi.h \ common.h \ flash.h \ - lpc2000.h \ - lpc288x.h \ mflash.h \ - non_cfi.h \ - nand.h \ - ocl.h \ - pic32mx.h \ - stellaris.h \ - stm32x.h \ - str7x.h \ - str9x.h \ - str9xpec.h \ - tms470.h + nand.h EXTRA_DIST = startup.tcl diff --git a/src/flash/nor/Makefile.am b/src/flash/nor/Makefile.am new file mode 100644 index 0000000..d2d9998 --- /dev/null +++ b/src/flash/nor/Makefile.am @@ -0,0 +1,46 @@ +AM_CPPFLAGS = \ + -I$(top_srcdir)/src/helper \ + -I$(top_srcdir)/src/jtag \ + -I$(top_srcdir)/src/flash \ + -I$(top_srcdir)/src/target + +noinst_LTLIBRARIES = libocdflashnor.la +libocdflashnor_la_SOURCES = \ + aduc702x.c \ + at91sam3.c \ + at91sam7.c \ + avrf.c \ + cfi.c \ + ecos.c \ + faux.c \ + lpc2000.c \ + lpc288x.c \ + lpc2900.c \ + non_cfi.c \ + ocl.c \ + pic32mx.c \ + stellaris.c \ + stm32x.c \ + str7x.c \ + str9x.c \ + str9xpec.c \ + tms470.c + +noinst_HEADERS = \ + at91sam7.h \ + at91sam3.h \ + avrf.h \ + cfi.h \ + lpc2000.h \ + lpc288x.h \ + non_cfi.h \ + ocl.h \ + pic32mx.h \ + stellaris.h \ + stm32x.h \ + str7x.h \ + str9x.h \ + str9xpec.h \ + tms470.h + +MAINTAINERCLEANFILES = $(srcdir)/Makefile.in diff --git a/src/flash/aduc702x.c b/src/flash/nor/aduc702x.c similarity index 100% rename from src/flash/aduc702x.c rename to src/flash/nor/aduc702x.c diff --git a/src/flash/at91sam3.c b/src/flash/nor/at91sam3.c similarity index 100% rename from src/flash/at91sam3.c rename to src/flash/nor/at91sam3.c diff --git a/src/flash/at91sam3.h b/src/flash/nor/at91sam3.h similarity index 100% rename from src/flash/at91sam3.h rename to src/flash/nor/at91sam3.h diff --git a/src/flash/at91sam7.c b/src/flash/nor/at91sam7.c similarity index 100% rename from src/flash/at91sam7.c rename to src/flash/nor/at91sam7.c diff --git a/src/flash/at91sam7.h b/src/flash/nor/at91sam7.h similarity index 100% rename from src/flash/at91sam7.h rename to src/flash/nor/at91sam7.h diff --git a/src/flash/avrf.c b/src/flash/nor/avrf.c similarity index 100% rename from src/flash/avrf.c rename to src/flash/nor/avrf.c diff --git a/src/flash/avrf.h b/src/flash/nor/avrf.h similarity index 100% rename from src/flash/avrf.h rename to src/flash/nor/avrf.h diff --git a/src/flash/cfi.c b/src/flash/nor/cfi.c similarity index 100% rename from src/flash/cfi.c rename to src/flash/nor/cfi.c diff --git a/src/flash/cfi.h b/src/flash/nor/cfi.h similarity index 100% rename from src/flash/cfi.h rename to src/flash/nor/cfi.h diff --git a/src/flash/ecos.c b/src/flash/nor/ecos.c similarity index 100% rename from src/flash/ecos.c rename to src/flash/nor/ecos.c diff --git a/src/flash/faux.c b/src/flash/nor/faux.c similarity index 100% rename from src/flash/faux.c rename to src/flash/nor/faux.c diff --git a/src/flash/lpc2000.c b/src/flash/nor/lpc2000.c similarity index 100% rename from src/flash/lpc2000.c rename to src/flash/nor/lpc2000.c diff --git a/src/flash/lpc2000.h b/src/flash/nor/lpc2000.h similarity index 100% rename from src/flash/lpc2000.h rename to src/flash/nor/lpc2000.h diff --git a/src/flash/lpc288x.c b/src/flash/nor/lpc288x.c similarity index 100% rename from src/flash/lpc288x.c rename to src/flash/nor/lpc288x.c diff --git a/src/flash/lpc288x.h b/src/flash/nor/lpc288x.h similarity index 100% rename from src/flash/lpc288x.h rename to src/flash/nor/lpc288x.h diff --git a/src/flash/lpc2900.c b/src/flash/nor/lpc2900.c similarity index 100% rename from src/flash/lpc2900.c rename to src/flash/nor/lpc2900.c diff --git a/src/flash/non_cfi.c b/src/flash/nor/non_cfi.c similarity index 100% rename from src/flash/non_cfi.c rename to src/flash/nor/non_cfi.c diff --git a/src/flash/non_cfi.h b/src/flash/nor/non_cfi.h similarity index 100% rename from src/flash/non_cfi.h rename to src/flash/nor/non_cfi.h diff --git a/src/flash/ocl.c b/src/flash/nor/ocl.c similarity index 100% rename from src/flash/ocl.c rename to src/flash/nor/ocl.c diff --git a/src/flash/ocl.h b/src/flash/nor/ocl.h similarity index 100% rename from src/flash/ocl.h rename to src/flash/nor/ocl.h diff --git a/src/flash/pic32mx.c b/src/flash/nor/pic32mx.c similarity index 100% rename from src/flash/pic32mx.c rename to src/flash/nor/pic32mx.c diff --git a/src/flash/pic32mx.h b/src/flash/nor/pic32mx.h similarity index 100% rename from src/flash/pic32mx.h rename to src/flash/nor/pic32mx.h diff --git a/src/flash/stellaris.c b/src/flash/nor/stellaris.c similarity index 100% rename from src/flash/stellaris.c rename to src/flash/nor/stellaris.c diff --git a/src/flash/stellaris.h b/src/flash/nor/stellaris.h similarity index 100% rename from src/flash/stellaris.h rename to src/flash/nor/stellaris.h diff --git a/src/flash/stm32x.c b/src/flash/nor/stm32x.c similarity index 100% rename from src/flash/stm32x.c rename to src/flash/nor/stm32x.c diff --git a/src/flash/stm32x.h b/src/flash/nor/stm32x.h similarity index 100% rename from src/flash/stm32x.h rename to src/flash/nor/stm32x.h diff --git a/src/flash/str7x.c b/src/flash/nor/str7x.c similarity index 100% rename from src/flash/str7x.c rename to src/flash/nor/str7x.c diff --git a/src/flash/str7x.h b/src/flash/nor/str7x.h similarity index 100% rename from src/flash/str7x.h rename to src/flash/nor/str7x.h diff --git a/src/flash/str9x.c b/src/flash/nor/str9x.c similarity index 100% rename from src/flash/str9x.c rename to src/flash/nor/str9x.c diff --git a/src/flash/str9x.h b/src/flash/nor/str9x.h similarity index 100% rename from src/flash/str9x.h rename to src/flash/nor/str9x.h diff --git a/src/flash/str9xpec.c b/src/flash/nor/str9xpec.c similarity index 100% rename from src/flash/str9xpec.c rename to src/flash/nor/str9xpec.c diff --git a/src/flash/str9xpec.h b/src/flash/nor/str9xpec.h similarity index 100% rename from src/flash/str9xpec.h rename to src/flash/nor/str9xpec.h diff --git a/src/flash/tms470.c b/src/flash/nor/tms470.c similarity index 100% rename from src/flash/tms470.c rename to src/flash/nor/tms470.c diff --git a/src/flash/tms470.h b/src/flash/nor/tms470.h similarity index 100% rename from src/flash/tms470.h rename to src/flash/nor/tms470.h commit e1ec02bb055fa356b058dddc0a15710e0fdc9870 Author: Zachary T Welch <zw...@su...> Date: Tue Dec 1 22:37:11 2009 -0800 move nand drivers to src/flash/nand/ Moves NAND drivers to src/flash/nand/. Adds src/flash/nand/Makefile.am. Builds libocdflashnand.la. diff --git a/configure.in b/configure.in index dbddcb2..3680cac 100644 --- a/configure.in +++ b/configure.in @@ -1122,6 +1122,7 @@ AC_OUTPUT(dnl src/target/Makefile dnl src/server/Makefile dnl src/flash/Makefile dnl + src/flash/nand/Makefile dnl src/pld/Makefile dnl doc/Makefile dnl ) diff --git a/src/flash/Makefile.am b/src/flash/Makefile.am index 94cc86e..353fcf1 100644 --- a/src/flash/Makefile.am +++ b/src/flash/Makefile.am @@ -1,3 +1,6 @@ +SUBDIRS = \ + nand + AM_CPPFLAGS = \ -I$(top_srcdir)/src/helper \ -I$(top_srcdir)/src/jtag \ @@ -10,6 +13,9 @@ libflash_la_SOURCES = \ $(NAND_SRCS) \ mflash.c +libflash_la_LIBADD = \ + $(top_builddir)/src/flash/nand/libocdflashnand.la + FLASH_SRCS = \ common.c \ cfi.c \ @@ -40,22 +46,8 @@ NAND_SRCS = \ arm_nandio.c \ nand_ecc.c \ nand_ecc_kw.c \ - $(NAND_DEVICES_SRCS) \ nand.c -NAND_DEVICES_SRCS = \ - nonce_nand.c \ - davinci_nand.c \ - lpc3180_nand_controller.c \ - mx3_nand.c \ - orion_nand.c \ - s3c24xx_nand.c \ - s3c2410_nand.c \ - s3c2412_nand.c \ - s3c2440_nand.c \ - s3c2443_nand.c - - noinst_HEADERS = \ arm_nandio.h \ at91sam7.h \ @@ -66,9 +58,7 @@ noinst_HEADERS = \ flash.h \ lpc2000.h \ lpc288x.h \ - lpc3180_nand_controller.h \ mflash.h \ - mx3_nand.h \ non_cfi.h \ nand.h \ ocl.h \ @@ -78,9 +68,7 @@ noinst_HEADERS = \ str7x.h \ str9x.h \ str9xpec.h \ - tms470.h \ - s3c24xx_nand.h \ - s3c24xx_regs_nand.h + tms470.h EXTRA_DIST = startup.tcl diff --git a/src/flash/nand/Makefile.am b/src/flash/nand/Makefile.am new file mode 100644 index 0000000..e95717e --- /dev/null +++ b/src/flash/nand/Makefile.am @@ -0,0 +1,27 @@ +AM_CPPFLAGS = \ + -I$(top_srcdir)/src/flash \ + -I$(top_srcdir)/src/helper \ + -I$(top_srcdir)/src/jtag \ + -I$(top_srcdir)/src/target + +noinst_LTLIBRARIES = libocdflashnand.la + +libocdflashnand_la_SOURCES = \ + nonce.c \ + davinci.c \ + lpc3180.c \ + mx3.c \ + orion.c \ + s3c24xx.c \ + s3c2410.c \ + s3c2412.c \ + s3c2440.c \ + s3c2443.c + +noinst_HEADERS = \ + lpc3180.h \ + mx3.h \ + s3c24xx.h \ + s3c24xx_regs.h + +MAINTAINERCLEANFILES = $(srcdir)/Makefile.in diff --git a/src/flash/davinci_nand.c b/src/flash/nand/davinci.c similarity index 100% rename from src/flash/davinci_nand.c rename to src/flash/nand/davinci.c diff --git a/src/flash/lpc3180_nand_controller.c b/src/flash/nand/lpc3180.c similarity index 99% rename from src/flash/lpc3180_nand_controller.c rename to src/flash/nand/lpc3180.c index 146c843..031e6b1 100644 --- a/src/flash/lpc3180_nand_controller.c +++ b/src/flash/nand/lpc3180.c @@ -21,7 +21,7 @@ #include "config.h" #endif -#include "lpc3180_nand_controller.h" +#include "lpc3180.h" #include "nand.h" static int lpc3180_reset(struct nand_device *nand); diff --git a/src/flash/lpc3180_nand_controller.h b/src/flash/nand/lpc3180.h similarity index 100% rename from src/flash/lpc3180_nand_controller.h rename to src/flash/nand/lpc3180.h diff --git a/src/flash/mx3_nand.c b/src/flash/nand/mx3.c similarity index 99% rename from src/flash/mx3_nand.c rename to src/flash/nand/mx3.c index 1dc4fcb..21577a6 100644 --- a/src/flash/mx3_nand.c +++ b/src/flash/nand/mx3.c @@ -35,7 +35,7 @@ get_next_halfword_from_sram_buffer() not tested #include "config.h" #endif -#include "mx3_nand.h" +#include "mx3.h" static const char target_not_halted_err_msg[] = "target must be halted to use mx3 NAND flash controller"; diff --git a/src/flash/mx3_nand.h b/src/flash/nand/mx3.h similarity index 100% rename from src/flash/mx3_nand.h rename to src/flash/nand/mx3.h diff --git a/src/flash/nonce_nand.c b/src/flash/nand/nonce.c similarity index 100% rename from src/flash/nonce_nand.c rename to src/flash/nand/nonce.c diff --git a/src/flash/orion_nand.c b/src/flash/nand/orion.c similarity index 100% rename from src/flash/orion_nand.c rename to src/flash/nand/orion.c diff --git a/src/flash/s3c2410_nand.c b/src/flash/nand/s3c2410.c similarity index 99% rename from src/flash/s3c2410_nand.c rename to src/flash/nand/s3c2410.c index ca50c99..3c391bc 100644 --- a/src/flash/s3c2410_nand.c +++ b/src/flash/nand/s3c2410.c @@ -28,7 +28,7 @@ #include "config.h" #endif -#include "s3c24xx_nand.h" +#include "s3c24xx.h" NAND_DEVICE_COMMAND_HANDLER(s3c2410_nand_device_command) { diff --git a/src/flash/s3c2412_nand.c b/src/flash/nand/s3c2412.c similarity index 99% rename from src/flash/s3c2412_nand.c rename to src/flash/nand/s3c2412.c index acc6d99..5784305 100644 --- a/src/flash/s3c2412_nand.c +++ b/src/flash/nand/s3c2412.c @@ -28,7 +28,7 @@ #include "config.h" #endif -#include "s3c24xx_nand.h" +#include "s3c24xx.h" NAND_DEVICE_COMMAND_HANDLER(s3c2412_nand_device_command) { diff --git a/src/flash/s3c2440_nand.c b/src/flash/nand/s3c2440.c similarity index 99% rename from src/flash/s3c2440_nand.c rename to src/flash/nand/s3c2440.c index 556f6f1..d1a421e 100644 --- a/src/flash/s3c2440_nand.c +++ b/src/flash/nand/s3c2440.c @@ -28,7 +28,7 @@ #include "config.h" #endif -#include "s3c24xx_nand.h" +#include "s3c24xx.h" NAND_DEVICE_COMMAND_HANDLER(s3c2440_nand_device_command) diff --git a/src/flash/s3c2443_nand.c b/src/flash/nand/s3c2443.c similarity index 99% rename from src/flash/s3c2443_nand.c rename to src/flash/nand/s3c2443.c index 311bb69..d341477 100644 --- a/src/flash/s3c2443_nand.c +++ b/src/flash/nand/s3c2443.c @@ -28,7 +28,7 @@ #include "config.h" #endif -#include "s3c24xx_nand.h" +#include "s3c24xx.h" NAND_DEVICE_COMMAND_HANDLER(s3c2443_nand_device_command) diff --git a/src/flash/s3c24xx_nand.c b/src/flash/nand/s3c24xx.c similarity index 99% rename from src/flash/s3c24xx_nand.c rename to src/flash/nand/s3c24xx.c index 1a2ece7..d305b22 100644 --- a/src/flash/s3c24xx_nand.c +++ b/src/flash/nand/s3c24xx.c @@ -28,7 +28,7 @@ #include "config.h" #endif -#include "s3c24xx_nand.h" +#include "s3c24xx.h" S3C24XX_DEVICE_COMMAND() diff --git a/src/flash/s3c24xx_nand.h b/src/flash/nand/s3c24xx.h similarity index 99% rename from src/flash/s3c24xx_nand.h rename to src/flash/nand/s3c24xx.h index fad33a0..38057b2 100644 --- a/src/flash/s3c24xx_nand.h +++ b/src/flash/nand/s3c24xx.h @@ -28,7 +28,7 @@ */ #include "nand.h" -#include "s3c24xx_regs_nand.h" +#include "s3c24xx_regs.h" struct s3c24xx_nand_controller { diff --git a/src/flash/s3c24xx_regs_nand.h b/src/flash/nand/s3c24xx_regs.h similarity index 100% rename from src/flash/s3c24xx_regs_nand.h rename to src/flash/nand/s3c24xx_regs.h ----------------------------------------------------------------------- Summary of changes: configure.in | 3 + src/flash/Makefile.am | 75 +++----------------- src/flash/nand/Makefile.am | 27 +++++++ src/flash/{davinci_nand.c => nand/davinci.c} | 0 .../{lpc3180_nand_controller.c => nand/lpc3180.c} | 2 +- .../{lpc3180_nand_controller.h => nand/lpc3180.h} | 0 src/flash/{mx3_nand.c => nand/mx3.c} | 2 +- src/flash/{mx3_nand.h => nand/mx3.h} | 0 src/flash/{nonce_nand.c => nand/nonce.c} | 0 src/flash/{orion_nand.c => nand/orion.c} | 0 src/flash/{s3c2410_nand.c => nand/s3c2410.c} | 2 +- src/flash/{s3c2412_nand.c => nand/s3c2412.c} | 2 +- src/flash/{s3c2440_nand.c => nand/s3c2440.c} | 2 +- src/flash/{s3c2443_nand.c => nand/s3c2443.c} | 2 +- src/flash/{s3c24xx_nand.c => nand/s3c24xx.c} | 2 +- src/flash/{s3c24xx_nand.h => nand/s3c24xx.h} | 2 +- .../{s3c24xx_regs_nand.h => nand/s3c24xx_regs.h} | 0 src/flash/nor/Makefile.am | 46 ++++++++++++ src/flash/{ => nor}/aduc702x.c | 0 src/flash/{ => nor}/at91sam3.c | 0 src/flash/{ => nor}/at91sam3.h | 0 src/flash/{ => nor}/at91sam7.c | 0 src/flash/{ => nor}/at91sam7.h | 0 src/flash/{ => nor}/avrf.c | 0 src/flash/{ => nor}/avrf.h | 0 src/flash/{ => nor}/cfi.c | 0 src/flash/{ => nor}/cfi.h | 0 src/flash/{ => nor}/ecos.c | 0 src/flash/{ => nor}/faux.c | 0 src/flash/{ => nor}/lpc2000.c | 0 src/flash/{ => nor}/lpc2000.h | 0 src/flash/{ => nor}/lpc288x.c | 0 src/flash/{ => nor}/lpc288x.h | 0 src/flash/{ => nor}/lpc2900.c | 0 src/flash/{ => nor}/non_cfi.c | 0 src/flash/{ => nor}/non_cfi.h | 0 src/flash/{ => nor}/ocl.c | 0 src/flash/{ => nor}/ocl.h | 0 src/flash/{ => nor}/pic32mx.c | 0 src/flash/{ => nor}/pic32mx.h | 0 src/flash/{ => nor}/stellaris.c | 0 src/flash/{ => nor}/stellaris.h | 0 src/flash/{ => nor}/stm32x.c | 0 src/flash/{ => nor}/stm32x.h | 0 src/flash/{ => nor}/str7x.c | 0 src/flash/{ => nor}/str7x.h | 0 src/flash/{ => nor}/str9x.c | 0 src/flash/{ => nor}/str9x.h | 0 src/flash/{ => nor}/str9xpec.c | 0 src/flash/{ => nor}/str9xpec.h | 0 src/flash/{ => nor}/tms470.c | 0 src/flash/{ => nor}/tms470.h | 0 src/jtag/Makefile.am | 73 ++++---------------- src/jtag/{ => drivers}/Makefile.am | 53 +++----------- .../{rlink/Makefile => drivers/Makefile.rlink} | 0 src/jtag/{ => drivers}/amt_jtagaccel.c | 0 src/jtag/{ => drivers}/arm-jtag-ew.c | 0 src/jtag/{ => drivers}/at91rm9200.c | 0 src/jtag/{ => drivers}/bitbang.c | 0 src/jtag/{ => drivers}/bitbang.h | 0 src/jtag/{ => drivers}/bitq.c | 0 src/jtag/{ => drivers}/bitq.h | 0 src/jtag/{ => drivers}/driver.c | 0 src/jtag/{ => drivers}/dummy.c | 0 src/jtag/{ => drivers}/ep93xx.c | 0 src/jtag/{ => drivers}/ft2232.c | 0 src/jtag/{ => drivers}/gw16012.c | 0 src/jtag/{ => drivers}/jlink.c | 0 .../drivers/minidriver_imp.h} | 32 ++++++--- src/jtag/{ => drivers}/parport.c | 0 src/jtag/{ => drivers}/presto.c | 0 src/jtag/{rlink => drivers}/rlink.c | 6 +- src/jtag/{rlink => drivers}/rlink.h | 0 src/jtag/{rlink/call.m4 => drivers/rlink_call.m4} | 0 .../{rlink/dtc_cmd.h => drivers/rlink_dtc_cmd.h} | 0 .../{rlink/ep1_cmd.h => drivers/rlink_ep1_cmd.h} | 0 src/jtag/{rlink/init.m4 => drivers/rlink_init.m4} | 0 src/jtag/{rlink => drivers}/rlink_speed_table.c | 2 +- src/jtag/{rlink/st7.h => drivers/rlink_st7.h} | 0 src/jtag/{ => drivers}/usb_common.c | 0 src/jtag/{ => drivers}/usb_common.h | 0 src/jtag/{ => drivers}/usbprog.c | 0 src/jtag/{ => drivers}/vsllink.c | 0 src/jtag/minidriver.h | 56 ++------------- .../minidriver/minidriver_imp.h} | 29 +++++--- 85 files changed, 173 insertions(+), 245 deletions(-) create mode 100644 src/flash/nand/Makefile.am rename src/flash/{davinci_nand.c => nand/davinci.c} (100%) rename src/flash/{lpc3180_nand_controller.c => nand/lpc3180.c} (99%) rename src/flash/{lpc3180_nand_controller.h => nand/lpc3180.h} (100%) rename src/flash/{mx3_nand.c => nand/mx3.c} (99%) rename src/flash/{mx3_nand.h => nand/mx3.h} (100%) rename src/flash/{nonce_nand.c => nand/nonce.c} (100%) rename src/flash/{orion_nand.c => nand/orion.c} (100%) rename src/flash/{s3c2410_nand.c => nand/s3c2410.c} (99%) rename src/flash/{s3c2412_nand.c => nand/s3c2412.c} (99%) rename src/flash/{s3c2440_nand.c => nand/s3c2440.c} (99%) rename src/flash/{s3c2443_nand.c => nand/s3c2443.c} (99%) rename src/flash/{s3c24xx_nand.c => nand/s3c24xx.c} (99%) rename src/flash/{s3c24xx_nand.h => nand/s3c24xx.h} (99%) rename src/flash/{s3c24xx_regs_nand.h => nand/s3c24xx_regs.h} (100%) create mode 100644 src/flash/nor/Makefile.am rename src/flash/{ => nor}/aduc702x.c (100%) rename src/flash/{ => nor}/at91sam3.c (100%) rename src/flash/{ => nor}/at91sam3.h (100%) rename src/flash/{ => nor}/at91sam7.c (100%) rename src/flash/{ => nor}/at91sam7.h (100%) rename src/flash/{ => nor}/avrf.c (100%) rename src/flash/{ => nor}/avrf.h (100%) rename src/flash/{ => nor}/cfi.c (100%) rename src/flash/{ => nor}/cfi.h (100%) rename src/flash/{ => nor}/ecos.c (100%) rename src/flash/{ => nor}/faux.c (100%) rename src/flash/{ => nor}/lpc2000.c (100%) rename src/flash/{ => nor}/lpc2000.h (100%) rename src/flash/{ => nor}/lpc288x.c (100%) rename src/flash/{ => nor}/lpc288x.h (100%) rename src/flash/{ => nor}/lpc2900.c (100%) rename src/flash/{ => nor}/non_cfi.c (100%) rename src/flash/{ => nor}/non_cfi.h (100%) rename src/flash/{ => nor}/ocl.c (100%) rename src/flash/{ => nor}/ocl.h (100%) rename src/flash/{ => nor}/pic32mx.c (100%) rename src/flash/{ => nor}/pic32mx.h (100%) rename src/flash/{ => nor}/stellaris.c (100%) rename src/flash/{ => nor}/stellaris.h (100%) rename src/flash/{ => nor}/stm32x.c (100%) rename src/flash/{ => nor}/stm32x.h (100%) rename src/flash/{ => nor}/str7x.c (100%) rename src/flash/{ => nor}/str7x.h (100%) rename src/flash/{ => nor}/str9x.c (100%) rename src/flash/{ => nor}/str9x.h (100%) rename src/flash/{ => nor}/str9xpec.c (100%) rename src/flash/{ => nor}/str9xpec.h (100%) rename src/flash/{ => nor}/tms470.c (100%) rename src/flash/{ => nor}/tms470.h (100%) copy src/jtag/{ => drivers}/Makefile.am (56%) rename src/jtag/{rlink/Makefile => drivers/Makefile.rlink} (100%) rename src/jtag/{ => drivers}/amt_jtagaccel.c (100%) rename src/jtag/{ => drivers}/arm-jtag-ew.c (100%) rename src/jtag/{ => drivers}/at91rm9200.c (100%) rename src/jtag/{ => drivers}/bitbang.c (100%) rename src/jtag/{ => drivers}/bitbang.h (100%) rename src/jtag/{ => drivers}/bitq.c (100%) rename src/jtag/{ => drivers}/bitq.h (100%) rename src/jtag/{ => drivers}/driver.c (100%) rename src/jtag/{ => drivers}/dummy.c (100%) rename src/jtag/{ => drivers}/ep93xx.c (100%) rename src/jtag/{ => drivers}/ft2232.c (100%) rename src/jtag/{ => drivers}/gw16012.c (100%) rename src/jtag/{ => drivers}/jlink.c (100%) copy src/{server/httpd_stubs.c => jtag/drivers/minidriver_imp.h} (58%) rename src/jtag/{ => drivers}/parport.c (100%) rename src/jtag/{ => drivers}/presto.c (100%) rename src/jtag/{rlink => drivers}/rlink.c (99%) rename src/jtag/{rlink => drivers}/rlink.h (100%) rename src/jtag/{rlink/call.m4 => drivers/rlink_call.m4} (100%) rename src/jtag/{rlink/dtc_cmd.h => drivers/rlink_dtc_cmd.h} (100%) rename src/jtag/{rlink/ep1_cmd.h => drivers/rlink_ep1_cmd.h} (100%) rename src/jtag/{rlink/init.m4 => drivers/rlink_init.m4} (100%) rename src/jtag/{rlink => drivers}/rlink_speed_table.c (99%) rename src/jtag/{rlink/st7.h => drivers/rlink_st7.h} (100%) rename src/jtag/{ => drivers}/usb_common.c (100%) rename src/jtag/{ => drivers}/usb_common.h (100%) rename src/jtag/{ => drivers}/usbprog.c (100%) rename src/jtag/{ => drivers}/vsllink.c (100%) copy src/{server/httpd_stubs.c => jtag/minidriver/minidriver_imp.h} (65%) hooks/post-receive -- Main OpenOCD repository |
From: David B. <dbr...@us...> - 2009-12-03 08:09:19
|
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 d5e4e23f9a5b1074cd298d5386e638a9fa78b1ad (commit) via f0c3e7011f9a829b518770247d143b1ac612f0f1 (commit) via 62dd15d78f57d56310bb3cb1bfc9b8995cb69668 (commit) via 7e18d96d03e39ef55c0b1d420b53247a29fef24b (commit) via 6ec5b9c674489b4bd257c41142f100401c8d2025 (commit) via 1d29440a9c6a7ceb933a4aa407387cc7d9f8bdb2 (commit) via c2af99d4717837761b6df750e1fe75797c910b23 (commit) from b123fd3cd9a11b2dfb79025fb137696135f5f898 (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 d5e4e23f9a5b1074cd298d5386e638a9fa78b1ad Author: David Brownell <dbr...@us...> Date: Wed Dec 2 22:57:08 2009 -0800 ARM11: don't expose DSCR Remove the remaining extra copy of DSCR, and the register cache of which it was a part. That cache wasn't a very safe, or even necessary, idea; it was essentialy letting debugger-private state be manipulated by Tcl code that couldn't know how to do it right. This makes the "reg" output of an ARM11 resemble what most other ARM cores produce ... forward motion in the "make ARM11 work like the rest of the ARM cores" Jihad! diff --git a/src/target/arm11.c b/src/target/arm11.c index 5bbf465..44c9ad3 100644 --- a/src/target/arm11.c +++ b/src/target/arm11.c @@ -46,41 +46,8 @@ static uint32_t arm11_vcr = 0; static bool arm11_config_step_irq_enable = false; static bool arm11_config_hardware_step = false; -enum arm11_regtype -{ - /* debug regs */ - ARM11_REGISTER_DSCR, -}; - - -struct arm11_reg_defs -{ - char * name; - uint32_t num; - int gdb_num; - enum arm11_regtype type; -}; - -/* update arm11_regcache_ids when changing this */ -static const struct arm11_reg_defs arm11_reg_defs[] = -{ - /* Debug Registers */ - {"dscr", 0, -1, ARM11_REGISTER_DSCR}, -}; - -enum arm11_regcache_ids -{ - ARM11_RC_DSCR, - - ARM11_RC_MAX, -}; - static int arm11_step(struct target *target, int current, uint32_t address, int handle_breakpoints); -/* helpers */ -static int arm11_build_reg_cache(struct target *target); -static int arm11_set_reg(struct reg *reg, uint8_t *buf); -static int arm11_get_reg(struct reg *reg); /** Check and if necessary take control of the system @@ -127,11 +94,6 @@ static int arm11_check_init(struct arm11_common *arm11) return ERROR_OK; } - - -#define R(x) \ - (arm11->reg_values[ARM11_RC_##x]) - /** * Save processor state. This is called after a HALT instruction * succeeds, and on other occasions the processor enters debug mode @@ -148,17 +110,8 @@ static int arm11_debug_entry(struct arm11_common *arm11) /* REVISIT entire cache should already be invalid !!! */ register_cache_invalidate(arm11->arm.core_cache); - for (size_t i = 0; i < ARRAY_SIZE(arm11->reg_values); i++) - { - arm11->reg_list[i].valid = 1; - arm11->reg_list[i].dirty = 0; - } - /* See e.g. ARM1136 TRM, "14.8.4 Entering Debug state" */ - /* Save DSCR */ - R(DSCR) = arm11->dscr; - /* maybe save wDTR (pending DCC write to debug SW, e.g. libdcc) */ arm11->is_wdtr_saved = !!(arm11->dscr & ARM11_DSCR_WDTR_FULL); if (arm11->is_wdtr_saved) @@ -336,11 +289,9 @@ static int arm11_leave_debug_state(struct arm11_common *arm11, bool bpwp) register_cache_invalidate(arm11->arm.core_cache); /* restore DSCR */ - - arm11_write_DSCR(arm11, R(DSCR)); + arm11_write_DSCR(arm11, arm11->dscr); /* maybe restore rDTR */ - if (arm11->is_rdtr_saved) { arm11_add_debug_SCAN_N(arm11, 0x05, ARM11_TAP_DEFAULT); @@ -722,9 +673,10 @@ static int arm11_step(struct target *target, int current, if (arm11_config_step_irq_enable) - R(DSCR) &= ~ARM11_DSCR_INTERRUPTS_DISABLE; /* should be redundant */ + /* this disable should be redundant ... */ + arm11->dscr &= ~ARM11_DSCR_INTERRUPTS_DISABLE; else - R(DSCR) |= ARM11_DSCR_INTERRUPTS_DISABLE; + arm11->dscr |= ARM11_DSCR_INTERRUPTS_DISABLE; CHECK_RETVAL(arm11_leave_debug_state(arm11, handle_breakpoints)); @@ -769,8 +721,8 @@ static int arm11_step(struct target *target, int current, /* save state */ CHECK_RETVAL(arm11_debug_entry(arm11)); - /* restore default state */ - R(DSCR) &= ~ARM11_DSCR_INTERRUPTS_DISABLE; + /* restore default state */ + arm11->dscr &= ~ARM11_DSCR_INTERRUPTS_DISABLE; } @@ -1199,12 +1151,7 @@ static int arm11_init_target(struct command_context *cmd_ctx, struct target *target) { /* Initialize anything we can set up without talking to the target */ - - /* REVISIT do we really want such a debug-registers-only cache? - * If we do, it should probably be handled purely by the DPM code, - * so it works identically on the v7a/v7r cores. - */ - return arm11_build_reg_cache(target); + return ERROR_OK; } /* talk to the target and set things up */ @@ -1309,117 +1256,6 @@ static int arm11_examine(struct target *target) } -/** Load a register that is marked !valid in the register cache */ -static int arm11_get_reg(struct reg *reg) -{ - struct arm11_reg_state *r = reg->arch_info; - struct target *target = r->target; - - if (target->state != TARGET_HALTED) - { - LOG_WARNING("target was not halted"); - return ERROR_TARGET_NOT_HALTED; - } - - /** \todo TODO: Check this. We assume that all registers are fetched at debug entry. */ - -#if 0 - struct arm11_common *arm11 = target_to_arm11(target); - const struct arm11_reg_defs *arm11_reg_info = arm11_reg_defs + ((struct arm11_reg_state *)reg->arch_info)->def_index; -#endif - - return ERROR_OK; -} - -/** Change a value in the register cache */ -static int arm11_set_reg(struct reg *reg, uint8_t *buf) -{ - struct arm11_reg_state *r = reg->arch_info; - struct target *target = r->target; - struct arm11_common *arm11 = target_to_arm11(target); -// const struct arm11_reg_defs *arm11_reg_info = arm11_reg_defs + ((struct arm11_reg_state *)reg->arch_info)->def_index; - - arm11->reg_values[((struct arm11_reg_state *)reg->arch_info)->def_index] = buf_get_u32(buf, 0, 32); - reg->valid = 1; - reg->dirty = 1; - - return ERROR_OK; -} - -static const struct reg_arch_type arm11_reg_type = { - .get = arm11_get_reg, - .set = arm11_set_reg, -}; - -static int arm11_build_reg_cache(struct target *target) -{ - struct arm11_common *arm11 = target_to_arm11(target); - struct reg_cache *cache; - struct reg *reg_list; - struct arm11_reg_state *arm11_reg_states; - - cache = calloc(1, sizeof *cache); - reg_list = calloc(ARM11_REGCACHE_COUNT, sizeof *reg_list); - arm11_reg_states = calloc(ARM11_REGCACHE_COUNT, - sizeof *arm11_reg_states); - if (!cache || !reg_list || !arm11_reg_states) { - free(cache); - free(reg_list); - free(arm11_reg_states); - return ERROR_FAIL; - } - - arm11->reg_list = reg_list; - - /* build cache for some of the debug registers */ - cache->name = "arm11 debug registers"; - cache->reg_list = reg_list; - cache->num_regs = ARM11_REGCACHE_COUNT; - - struct reg_cache **cache_p = register_get_last_cache_p(&target->reg_cache); - (*cache_p) = cache; - - arm11->core_cache = cache; - - size_t i; - - /* Not very elegant assertion */ - if (ARM11_REGCACHE_COUNT != ARRAY_SIZE(arm11->reg_values) || - ARM11_REGCACHE_COUNT != ARRAY_SIZE(arm11_reg_defs) || - ARM11_REGCACHE_COUNT != ARM11_RC_MAX) - { - LOG_ERROR("BUG: arm11->reg_values inconsistent (%d %u %u %d)", - ARM11_REGCACHE_COUNT, - (unsigned) ARRAY_SIZE(arm11->reg_values), - (unsigned) ARRAY_SIZE(arm11_reg_defs), - ARM11_RC_MAX); - /* FIXME minimally, use a build_bug_on(X) mechanism; - * runtime exit() here is bad! - */ - exit(-1); - } - - for (i = 0; i < ARM11_REGCACHE_COUNT; i++) - { - struct reg * r = reg_list + i; - const struct arm11_reg_defs * rd = arm11_reg_defs + i; - struct arm11_reg_state * rs = arm11_reg_states + i; - - r->name = rd->name; - r->size = 32; - r->value = (uint8_t *)(arm11->reg_values + i); - r->dirty = 0; - r->valid = 0; - r->type = &arm11_reg_type; - r->arch_info = rs; - - rs->def_index = i; - rs->target = target; - } - - return ERROR_OK; -} - /* FIXME all these BOOL_WRAPPER things should be modifying * per-instance state, not shared state; ditto the vector * catch register support. Scan chains with multiple cores diff --git a/src/target/arm11.h b/src/target/arm11.h index 1cc09e1..cd52896 100644 --- a/src/target/arm11.h +++ b/src/target/arm11.h @@ -26,8 +26,6 @@ #include "armv4_5.h" #include "arm_dpm.h" -#define ARM11_REGCACHE_COUNT 1 - #define ARM11_TAP_DEFAULT TAP_INVALID #define CHECK_RETVAL(action) \ @@ -69,18 +67,6 @@ struct arm11_common bool simulate_reset_on_next_halt; /**< Perform cleanups of the ARM state on next halt */ - /** \name Shadow registers to save debug state */ - /*@{*/ - - struct reg * reg_list; /**< target register list */ - uint32_t reg_values[ARM11_REGCACHE_COUNT]; /**< data for registers */ - - /*@}*/ - - - // GA - struct reg_cache *core_cache; - struct arm_jtag jtag_info; }; commit f0c3e7011f9a829b518770247d143b1ac612f0f1 Author: David Brownell <dbr...@us...> Date: Wed Dec 2 22:57:08 2009 -0800 ARM11: store a clean copy of DSCR Just store a clean copy of DSCR in the per-CPU struct, so we trivially pass a pointer to a recent copy. This replaces the previous "last_dscr" and cleans up most of the related calling conventions ... but it doesn't remove the other DSCR copy. diff --git a/src/target/arm11.c b/src/target/arm11.c index 6080086..5bbf465 100644 --- a/src/target/arm11.c +++ b/src/target/arm11.c @@ -86,33 +86,24 @@ static int arm11_get_reg(struct reg *reg); /** Check and if necessary take control of the system * * \param arm11 Target state variable. - * \param dscr If the current DSCR content is - * available a pointer to a word holding the - * DSCR can be passed. Otherwise use NULL. */ -static int arm11_check_init(struct arm11_common *arm11, uint32_t *dscr) +static int arm11_check_init(struct arm11_common *arm11) { - uint32_t dscr_local_tmp_copy; + CHECK_RETVAL(arm11_read_DSCR(arm11)); + LOG_DEBUG("DSCR %08x", (unsigned) arm11->dscr); - if (!dscr) - { - dscr = &dscr_local_tmp_copy; - - CHECK_RETVAL(arm11_read_DSCR(arm11, dscr)); - } - - if (!(*dscr & ARM11_DSCR_MODE_SELECT)) + if (!(arm11->dscr & ARM11_DSCR_MODE_SELECT)) { LOG_DEBUG("Bringing target into debug mode"); - *dscr |= ARM11_DSCR_MODE_SELECT; /* Halt debug-mode */ - arm11_write_DSCR(arm11, *dscr); + arm11->dscr |= ARM11_DSCR_MODE_SELECT; /* Halt debug-mode */ + arm11_write_DSCR(arm11, arm11->dscr); /* add further reset initialization here */ arm11->simulate_reset_on_next_halt = true; - if (*dscr & ARM11_DSCR_CORE_HALTED) + if (arm11->dscr & ARM11_DSCR_CORE_HALTED) { /** \todo TODO: this needs further scrutiny because * arm11_debug_entry() never gets called. (WHY NOT?) @@ -122,7 +113,7 @@ static int arm11_check_init(struct arm11_common *arm11, uint32_t *dscr) arm11->arm.target->state = TARGET_HALTED; arm11->arm.target->debug_reason = - arm11_get_DSCR_debug_reason(*dscr); + arm11_get_DSCR_debug_reason(arm11->dscr); } else { @@ -144,14 +135,15 @@ static int arm11_check_init(struct arm11_common *arm11, uint32_t *dscr) /** * Save processor state. This is called after a HALT instruction * succeeds, and on other occasions the processor enters debug mode - * (breakpoint, watchpoint, etc). + * (breakpoint, watchpoint, etc). Caller has updated arm11->dscr. */ -static int arm11_debug_entry(struct arm11_common *arm11, uint32_t dscr) +static int arm11_debug_entry(struct arm11_common *arm11) { int retval; arm11->arm.target->state = TARGET_HALTED; - arm11->arm.target->debug_reason = arm11_get_DSCR_debug_reason(dscr); + arm11->arm.target->debug_reason = + arm11_get_DSCR_debug_reason(arm11->dscr); /* REVISIT entire cache should already be invalid !!! */ register_cache_invalidate(arm11->arm.core_cache); @@ -165,10 +157,10 @@ static int arm11_debug_entry(struct arm11_common *arm11, uint32_t dscr) /* See e.g. ARM1136 TRM, "14.8.4 Entering Debug state" */ /* Save DSCR */ - R(DSCR) = dscr; + R(DSCR) = arm11->dscr; - /* Save wDTR */ - arm11->is_wdtr_saved = !!(dscr & ARM11_DSCR_WDTR_FULL); + /* maybe save wDTR (pending DCC write to debug SW, e.g. libdcc) */ + arm11->is_wdtr_saved = !!(arm11->dscr & ARM11_DSCR_WDTR_FULL); if (arm11->is_wdtr_saved) { arm11_add_debug_SCAN_N(arm11, 0x05, ARM11_TAP_DEFAULT); @@ -183,6 +175,7 @@ static int arm11_debug_entry(struct arm11_common *arm11, uint32_t dscr) arm11_setup_field(arm11, 1, NULL, NULL, chain5_fields + 2); arm11_add_dr_scan_vc(ARRAY_SIZE(chain5_fields), chain5_fields, TAP_DRPAUSE); + } /* DSCR: set ARM11_DSCR_EXECUTE_ARM_INSTRUCTION_ENABLE @@ -191,11 +184,9 @@ static int arm11_debug_entry(struct arm11_common *arm11, uint32_t dscr) * but not to issue ITRs. ARM1136 seems to require this to issue * ITR's as well... */ - uint32_t new_dscr = dscr | ARM11_DSCR_EXECUTE_ARM_INSTRUCTION_ENABLE; - /* this executes JTAG queue: */ - - arm11_write_DSCR(arm11, new_dscr); + arm11_write_DSCR(arm11, ARM11_DSCR_EXECUTE_ARM_INSTRUCTION_ENABLE + | arm11->dscr); /* From the spec: @@ -243,8 +234,8 @@ static int arm11_debug_entry(struct arm11_common *arm11, uint32_t dscr) if (retval != ERROR_OK) return retval; - /* maybe save rDTR */ - arm11->is_rdtr_saved = !!(dscr & ARM11_DSCR_RDTR_FULL); + /* maybe save rDTR (pending DCC read from debug SW, e.g. libdcc) */ + arm11->is_rdtr_saved = !!(arm11->dscr & ARM11_DSCR_RDTR_FULL); if (arm11->is_rdtr_saved) { /* MRC p14,0,R0,c0,c5,0 (move rDTR -> r0 (-> wDTR -> local var)) */ @@ -302,11 +293,9 @@ static int arm11_leave_debug_state(struct arm11_common *arm11, bool bpwp) /* spec says clear wDTR and rDTR; we assume they are clear as otherwise our programming would be sloppy */ { - uint32_t DSCR; - - CHECK_RETVAL(arm11_read_DSCR(arm11, &DSCR)); + CHECK_RETVAL(arm11_read_DSCR(arm11)); - if (DSCR & (ARM11_DSCR_RDTR_FULL | ARM11_DSCR_WDTR_FULL)) + if (arm11->dscr & (ARM11_DSCR_RDTR_FULL | ARM11_DSCR_WDTR_FULL)) { /* The wDTR/rDTR two registers that are used to send/receive data to/from @@ -315,7 +304,8 @@ static int arm11_leave_debug_state(struct arm11_common *arm11, bool bpwp) registers hold data that was written by one side (CPU or JTAG) and not read out by the other side. */ - LOG_ERROR("wDTR/rDTR inconsistent (DSCR %08" PRIx32 ")", DSCR); + LOG_ERROR("wDTR/rDTR inconsistent (DSCR %08x)", + (unsigned) arm11->dscr); return ERROR_FAIL; } } @@ -380,22 +370,17 @@ static int arm11_poll(struct target *target) { int retval; struct arm11_common *arm11 = target_to_arm11(target); - uint32_t dscr; - - CHECK_RETVAL(arm11_read_DSCR(arm11, &dscr)); - LOG_DEBUG("DSCR %08" PRIx32 "", dscr); + CHECK_RETVAL(arm11_check_init(arm11)); - CHECK_RETVAL(arm11_check_init(arm11, &dscr)); - - if (dscr & ARM11_DSCR_CORE_HALTED) + if (arm11->dscr & ARM11_DSCR_CORE_HALTED) { if (target->state != TARGET_HALTED) { enum target_state old_state = target->state; LOG_DEBUG("enter TARGET_HALTED"); - retval = arm11_debug_entry(arm11, dscr); + retval = arm11_debug_entry(arm11); if (retval != ERROR_OK) return retval; @@ -459,14 +444,13 @@ static int arm11_halt(struct target *target) CHECK_RETVAL(jtag_execute_queue()); - uint32_t dscr; int i = 0; while (1) { - CHECK_RETVAL(arm11_read_DSCR(arm11, &dscr)); + CHECK_RETVAL(arm11_read_DSCR(arm11)); - if (dscr & ARM11_DSCR_CORE_HALTED) + if (arm11->dscr & ARM11_DSCR_CORE_HALTED) break; @@ -488,7 +472,7 @@ static int arm11_halt(struct target *target) enum target_state old_state = target->state; - arm11_debug_entry(arm11, dscr); + arm11_debug_entry(arm11); CHECK_RETVAL( target_call_event_callbacks(target, @@ -590,13 +574,11 @@ static int arm11_resume(struct target *target, int current, int i = 0; while (1) { - uint32_t dscr; - - CHECK_RETVAL(arm11_read_DSCR(arm11, &dscr)); + CHECK_RETVAL(arm11_read_DSCR(arm11)); - LOG_DEBUG("DSCR %08" PRIx32 "", dscr); + LOG_DEBUG("DSCR %08x", (unsigned) arm11->dscr); - if (dscr & ARM11_DSCR_CORE_RESTARTED) + if (arm11->dscr & ARM11_DSCR_CORE_RESTARTED) break; @@ -753,16 +735,16 @@ static int arm11_step(struct target *target, int current, /* wait for halt */ int i = 0; - uint32_t dscr; while (1) { - CHECK_RETVAL(arm11_read_DSCR(arm11, &dscr)); + const uint32_t mask = ARM11_DSCR_CORE_RESTARTED + | ARM11_DSCR_CORE_HALTED; - LOG_DEBUG("DSCR %08" PRIx32 "e", dscr); + CHECK_RETVAL(arm11_read_DSCR(arm11)); + LOG_DEBUG("DSCR %08x e", (unsigned) arm11->dscr); - if ((dscr & (ARM11_DSCR_CORE_RESTARTED | ARM11_DSCR_CORE_HALTED)) == - (ARM11_DSCR_CORE_RESTARTED | ARM11_DSCR_CORE_HALTED)) + if ((arm11->dscr & mask) == mask) break; long long then = 0; @@ -785,7 +767,7 @@ static int arm11_step(struct target *target, int current, arm11_sc7_clear_vbw(arm11); /* save state */ - CHECK_RETVAL(arm11_debug_entry(arm11, dscr)); + CHECK_RETVAL(arm11_debug_entry(arm11)); /* restore default state */ R(DSCR) &= ~ARM11_DSCR_INTERRUPTS_DISABLE; @@ -804,7 +786,7 @@ static int arm11_assert_reset(struct target *target) int retval; struct arm11_common *arm11 = target_to_arm11(target); - retval = arm11_check_init(arm11, NULL); + retval = arm11_check_init(arm11); if (retval != ERROR_OK) return retval; @@ -1303,7 +1285,7 @@ static int arm11_examine(struct target *target) * as suggested by the spec. */ - retval = arm11_check_init(arm11, NULL); + retval = arm11_check_init(arm11); if (retval != ERROR_OK) return retval; diff --git a/src/target/arm11.h b/src/target/arm11.h index 56feb2e..1cc09e1 100644 --- a/src/target/arm11.h +++ b/src/target/arm11.h @@ -59,8 +59,7 @@ struct arm11_common size_t wrp; /**< Number of Watchpoint Register Pairs from DIDR */ size_t free_brps; /**< Number of breakpoints allocated */ - uint32_t last_dscr; /**< Last retrieved DSCR value; - Use only for debug message generation */ + uint32_t dscr; /**< Last retrieved DSCR value. */ uint32_t saved_rdtr; uint32_t saved_wdtr; diff --git a/src/target/arm11_dbgtap.c b/src/target/arm11_dbgtap.c index 7fd5e3a..7e1e9cb 100644 --- a/src/target/arm11_dbgtap.c +++ b/src/target/arm11_dbgtap.c @@ -214,19 +214,20 @@ static void arm11_add_debug_INST(struct arm11_common * arm11, arm11_add_dr_scan_vc(ARRAY_SIZE(itr), itr, state == ARM11_TAP_DEFAULT ? TAP_IDLE : state); } -/** Read the Debug Status and Control Register (DSCR) - * - * same as CP14 c1 +/** + * Read and save the Debug Status and Control Register (DSCR). * * \param arm11 Target state variable. - * \param value DSCR content - * \return Error status + * \return Error status; arm11->dscr is updated on success. * - * \remarks This is a stand-alone function that executes the JTAG command queue. + * \remarks This is a stand-alone function that executes the JTAG + * command queue. It does not require the ARM11 debug TAP to be + * in any particular state. */ -int arm11_read_DSCR(struct arm11_common * arm11, uint32_t *value) +int arm11_read_DSCR(struct arm11_common *arm11) { int retval; + retval = arm11_add_debug_SCAN_N(arm11, 0x01, ARM11_TAP_DEFAULT); if (retval != ERROR_OK) return retval; @@ -242,14 +243,12 @@ int arm11_read_DSCR(struct arm11_common * arm11, uint32_t *value) CHECK_RETVAL(jtag_execute_queue()); - if (arm11->last_dscr != dscr) + if (arm11->dscr != dscr) JTAG_DEBUG("DSCR = %08x (OLD %08x)", (unsigned) dscr, - (unsigned) arm11->last_dscr); - - arm11->last_dscr = dscr; + (unsigned) arm11->dscr); - *value = dscr; + arm11->dscr = dscr; return ERROR_OK; } @@ -282,9 +281,9 @@ int arm11_write_DSCR(struct arm11_common * arm11, uint32_t dscr) JTAG_DEBUG("DSCR <= %08x (OLD %08x)", (unsigned) dscr, - (unsigned) arm11->last_dscr); + (unsigned) arm11->dscr); - arm11->last_dscr = dscr; + arm11->dscr = dscr; return ERROR_OK; } diff --git a/src/target/arm11_dbgtap.h b/src/target/arm11_dbgtap.h index 2203361..fa19744 100644 --- a/src/target/arm11_dbgtap.h +++ b/src/target/arm11_dbgtap.h @@ -11,7 +11,7 @@ void arm11_add_IR(struct arm11_common *arm11, uint8_t instr, tap_state_t state); int arm11_add_debug_SCAN_N(struct arm11_common *arm11, uint8_t chain, tap_state_t state); -int arm11_read_DSCR(struct arm11_common *arm11, uint32_t *dscr); +int arm11_read_DSCR(struct arm11_common *arm11); int arm11_write_DSCR(struct arm11_common *arm11, uint32_t dscr); enum target_debug_reason arm11_get_DSCR_debug_reason(uint32_t dscr); commit 62dd15d78f57d56310bb3cb1bfc9b8995cb69668 Author: David Brownell <dbr...@us...> Date: Wed Dec 2 22:57:07 2009 -0800 ARM11: don't expose WDTR Don't expose the WDTR register through the register cache any more. If anyone wants Tcl scripts to be able to use DCC based communication with app code in the target, this wouldn't do it. Bugfix: don't trust the Tcl-accessible version of DSCR to flag whether WDTR needs to be restored when resuming. diff --git a/src/target/arm11.c b/src/target/arm11.c index d08911e..6080086 100644 --- a/src/target/arm11.c +++ b/src/target/arm11.c @@ -50,7 +50,6 @@ enum arm11_regtype { /* debug regs */ ARM11_REGISTER_DSCR, - ARM11_REGISTER_WDTR, }; @@ -67,13 +66,11 @@ static const struct arm11_reg_defs arm11_reg_defs[] = { /* Debug Registers */ {"dscr", 0, -1, ARM11_REGISTER_DSCR}, - {"wdtr", 0, -1, ARM11_REGISTER_WDTR}, }; enum arm11_regcache_ids { ARM11_RC_DSCR, - ARM11_RC_WDTR, ARM11_RC_MAX, }; @@ -171,8 +168,8 @@ static int arm11_debug_entry(struct arm11_common *arm11, uint32_t dscr) R(DSCR) = dscr; /* Save wDTR */ - - if (dscr & ARM11_DSCR_WDTR_FULL) + arm11->is_wdtr_saved = !!(dscr & ARM11_DSCR_WDTR_FULL); + if (arm11->is_wdtr_saved) { arm11_add_debug_SCAN_N(arm11, 0x05, ARM11_TAP_DEFAULT); @@ -180,17 +177,13 @@ static int arm11_debug_entry(struct arm11_common *arm11, uint32_t dscr) struct scan_field chain5_fields[3]; - arm11_setup_field(arm11, 32, NULL, &R(WDTR), chain5_fields + 0); + arm11_setup_field(arm11, 32, NULL, + &arm11->saved_wdtr, chain5_fields + 0); arm11_setup_field(arm11, 1, NULL, NULL, chain5_fields + 1); arm11_setup_field(arm11, 1, NULL, NULL, chain5_fields + 2); arm11_add_dr_scan_vc(ARRAY_SIZE(chain5_fields), chain5_fields, TAP_DRPAUSE); } - else - { - arm11->reg_list[ARM11_RC_WDTR].valid = 0; - } - /* DSCR: set ARM11_DSCR_EXECUTE_ARM_INSTRUCTION_ENABLE * @@ -328,14 +321,15 @@ static int arm11_leave_debug_state(struct arm11_common *arm11, bool bpwp) } /* maybe restore original wDTR */ - if ((R(DSCR) & ARM11_DSCR_WDTR_FULL) || arm11->reg_list[ARM11_RC_WDTR].dirty) + if (arm11->is_wdtr_saved) { retval = arm11_run_instr_data_prepare(arm11); if (retval != ERROR_OK) return retval; /* MCR p14,0,R0,c0,c5,0 */ - retval = arm11_run_instr_data_to_core_via_r0(arm11, 0xee000e15, R(WDTR)); + retval = arm11_run_instr_data_to_core_via_r0(arm11, + 0xee000e15, arm11->saved_wdtr); if (retval != ERROR_OK) return retval; diff --git a/src/target/arm11.h b/src/target/arm11.h index cde6c78..56feb2e 100644 --- a/src/target/arm11.h +++ b/src/target/arm11.h @@ -26,7 +26,7 @@ #include "armv4_5.h" #include "arm_dpm.h" -#define ARM11_REGCACHE_COUNT 2 +#define ARM11_REGCACHE_COUNT 1 #define ARM11_TAP_DEFAULT TAP_INVALID @@ -63,8 +63,11 @@ struct arm11_common Use only for debug message generation */ uint32_t saved_rdtr; + uint32_t saved_wdtr; bool is_rdtr_saved; + bool is_wdtr_saved; + bool simulate_reset_on_next_halt; /**< Perform cleanups of the ARM state on next halt */ /** \name Shadow registers to save debug state */ commit 7e18d96d03e39ef55c0b1d420b53247a29fef24b Author: David Brownell <dbr...@us...> Date: Wed Dec 2 22:57:07 2009 -0800 ARM11: don't expose RDTR Don't expose the RDTR register through the register cache any more. If anyone wants Tcl scripts to be able to use DCC based communication with app code in the target, this wouldn't do it. Bugfix: don't trust the Tcl-accessible version of DSCR to flag whether RDTR needs to be restored when resuming. diff --git a/src/target/arm11.c b/src/target/arm11.c index 65ec47f..d08911e 100644 --- a/src/target/arm11.c +++ b/src/target/arm11.c @@ -51,7 +51,6 @@ enum arm11_regtype /* debug regs */ ARM11_REGISTER_DSCR, ARM11_REGISTER_WDTR, - ARM11_REGISTER_RDTR, }; @@ -69,14 +68,12 @@ static const struct arm11_reg_defs arm11_reg_defs[] = /* Debug Registers */ {"dscr", 0, -1, ARM11_REGISTER_DSCR}, {"wdtr", 0, -1, ARM11_REGISTER_WDTR}, - {"rdtr", 0, -1, ARM11_REGISTER_RDTR}, }; enum arm11_regcache_ids { ARM11_RC_DSCR, ARM11_RC_WDTR, - ARM11_RC_RDTR, ARM11_RC_MAX, }; @@ -254,20 +251,15 @@ static int arm11_debug_entry(struct arm11_common *arm11, uint32_t dscr) return retval; /* maybe save rDTR */ - - /* check rDTRfull in DSCR */ - - if (dscr & ARM11_DSCR_RDTR_FULL) + arm11->is_rdtr_saved = !!(dscr & ARM11_DSCR_RDTR_FULL); + if (arm11->is_rdtr_saved) { /* MRC p14,0,R0,c0,c5,0 (move rDTR -> r0 (-> wDTR -> local var)) */ - retval = arm11_run_instr_data_from_core_via_r0(arm11, 0xEE100E15, &R(RDTR)); + retval = arm11_run_instr_data_from_core_via_r0(arm11, + 0xEE100E15, &arm11->saved_rdtr); if (retval != ERROR_OK) return retval; } - else - { - arm11->reg_list[ARM11_RC_RDTR].valid = 0; - } /* REVISIT Now that we've saved core state, there's may also * be MMU and cache state to care about ... @@ -365,7 +357,7 @@ static int arm11_leave_debug_state(struct arm11_common *arm11, bool bpwp) /* maybe restore rDTR */ - if (R(DSCR) & ARM11_DSCR_RDTR_FULL || arm11->reg_list[ARM11_RC_RDTR].dirty) + if (arm11->is_rdtr_saved) { arm11_add_debug_SCAN_N(arm11, 0x05, ARM11_TAP_DEFAULT); @@ -376,7 +368,8 @@ static int arm11_leave_debug_state(struct arm11_common *arm11, bool bpwp) uint8_t Ready = 0; /* ignored */ uint8_t Valid = 0; /* ignored */ - arm11_setup_field(arm11, 32, &R(RDTR), NULL, chain5_fields + 0); + arm11_setup_field(arm11, 32, &arm11->saved_rdtr, + NULL, chain5_fields + 0); arm11_setup_field(arm11, 1, &Ready, NULL, chain5_fields + 1); arm11_setup_field(arm11, 1, &Valid, NULL, chain5_fields + 2); diff --git a/src/target/arm11.h b/src/target/arm11.h index e5c92de..cde6c78 100644 --- a/src/target/arm11.h +++ b/src/target/arm11.h @@ -26,7 +26,7 @@ #include "armv4_5.h" #include "arm_dpm.h" -#define ARM11_REGCACHE_COUNT 3 +#define ARM11_REGCACHE_COUNT 2 #define ARM11_TAP_DEFAULT TAP_INVALID @@ -62,6 +62,9 @@ struct arm11_common uint32_t last_dscr; /**< Last retrieved DSCR value; Use only for debug message generation */ + uint32_t saved_rdtr; + + bool is_rdtr_saved; bool simulate_reset_on_next_halt; /**< Perform cleanups of the ARM state on next halt */ /** \name Shadow registers to save debug state */ commit 6ec5b9c674489b4bd257c41142f100401c8d2025 Author: David Brownell <dbr...@us...> Date: Wed Dec 2 22:57:07 2009 -0800 ARM11: streamline debug entry Streamline arm11_on_enter_debug_state() entry: - It should handle the standard updates: * target->debug_reason * target->state - Don't waste time re-reading DSCR; just pass it in Also rename the routine to "arm11_debug_entry()", matching the convention used elsewhere in OpenOCD. diff --git a/src/target/arm11.c b/src/target/arm11.c index 1a3e979..65ec47f 100644 --- a/src/target/arm11.c +++ b/src/target/arm11.c @@ -81,7 +81,6 @@ enum arm11_regcache_ids ARM11_RC_MAX, }; -static int arm11_on_enter_debug_state(struct arm11_common *arm11); static int arm11_step(struct target *target, int current, uint32_t address, int handle_breakpoints); /* helpers */ @@ -122,7 +121,7 @@ static int arm11_check_init(struct arm11_common *arm11, uint32_t *dscr) if (*dscr & ARM11_DSCR_CORE_HALTED) { /** \todo TODO: this needs further scrutiny because - * arm11_on_enter_debug_state() never gets properly called. + * arm11_debug_entry() never gets called. (WHY NOT?) * As a result we don't read the actual register states from * the target. */ @@ -148,16 +147,18 @@ static int arm11_check_init(struct arm11_common *arm11, uint32_t *dscr) #define R(x) \ (arm11->reg_values[ARM11_RC_##x]) -/** Save processor state. - * - * This is called when the HALT instruction has succeeded - * or on other occasions that stop the processor. - * - */ -static int arm11_on_enter_debug_state(struct arm11_common *arm11) +/** + * Save processor state. This is called after a HALT instruction + * succeeds, and on other occasions the processor enters debug mode + * (breakpoint, watchpoint, etc). + */ +static int arm11_debug_entry(struct arm11_common *arm11, uint32_t dscr) { int retval; + arm11->arm.target->state = TARGET_HALTED; + arm11->arm.target->debug_reason = arm11_get_DSCR_debug_reason(dscr); + /* REVISIT entire cache should already be invalid !!! */ register_cache_invalidate(arm11->arm.core_cache); @@ -170,11 +171,11 @@ static int arm11_on_enter_debug_state(struct arm11_common *arm11) /* See e.g. ARM1136 TRM, "14.8.4 Entering Debug state" */ /* Save DSCR */ - CHECK_RETVAL(arm11_read_DSCR(arm11, &R(DSCR))); + R(DSCR) = dscr; /* Save wDTR */ - if (R(DSCR) & ARM11_DSCR_WDTR_FULL) + if (dscr & ARM11_DSCR_WDTR_FULL) { arm11_add_debug_SCAN_N(arm11, 0x05, ARM11_TAP_DEFAULT); @@ -200,7 +201,7 @@ static int arm11_on_enter_debug_state(struct arm11_common *arm11) * but not to issue ITRs. ARM1136 seems to require this to issue * ITR's as well... */ - uint32_t new_dscr = R(DSCR) | ARM11_DSCR_EXECUTE_ARM_INSTRUCTION_ENABLE; + uint32_t new_dscr = dscr | ARM11_DSCR_EXECUTE_ARM_INSTRUCTION_ENABLE; /* this executes JTAG queue: */ @@ -256,7 +257,7 @@ static int arm11_on_enter_debug_state(struct arm11_common *arm11) /* check rDTRfull in DSCR */ - if (R(DSCR) & ARM11_DSCR_RDTR_FULL) + if (dscr & ARM11_DSCR_RDTR_FULL) { /* MRC p14,0,R0,c0,c5,0 (move rDTR -> r0 (-> wDTR -> local var)) */ retval = arm11_run_instr_data_from_core_via_r0(arm11, 0xEE100E15, &R(RDTR)); @@ -407,9 +408,7 @@ static int arm11_poll(struct target *target) enum target_state old_state = target->state; LOG_DEBUG("enter TARGET_HALTED"); - target->state = TARGET_HALTED; - target->debug_reason = arm11_get_DSCR_debug_reason(dscr); - retval = arm11_on_enter_debug_state(arm11); + retval = arm11_debug_entry(arm11, dscr); if (retval != ERROR_OK) return retval; @@ -474,8 +473,8 @@ static int arm11_halt(struct target *target) CHECK_RETVAL(jtag_execute_queue()); uint32_t dscr; - int i = 0; + while (1) { CHECK_RETVAL(arm11_read_DSCR(arm11, &dscr)); @@ -500,12 +499,9 @@ static int arm11_halt(struct target *target) i++; } - arm11_on_enter_debug_state(arm11); - enum target_state old_state = target->state; - target->state = TARGET_HALTED; - target->debug_reason = arm11_get_DSCR_debug_reason(dscr); + arm11_debug_entry(arm11, dscr); CHECK_RETVAL( target_call_event_callbacks(target, @@ -770,10 +766,10 @@ static int arm11_step(struct target *target, int current, /* wait for halt */ int i = 0; + uint32_t dscr; + while (1) { - uint32_t dscr; - CHECK_RETVAL(arm11_read_DSCR(arm11, &dscr)); LOG_DEBUG("DSCR %08" PRIx32 "e", dscr); @@ -802,14 +798,13 @@ static int arm11_step(struct target *target, int current, arm11_sc7_clear_vbw(arm11); /* save state */ - CHECK_RETVAL(arm11_on_enter_debug_state(arm11)); + CHECK_RETVAL(arm11_debug_entry(arm11, dscr)); /* restore default state */ R(DSCR) &= ~ARM11_DSCR_INTERRUPTS_DISABLE; } - // target->state = TARGET_HALTED; target->debug_reason = DBG_REASON_SINGLESTEP; CHECK_RETVAL(target_call_event_callbacks(target, TARGET_EVENT_HALTED)); commit 1d29440a9c6a7ceb933a4aa407387cc7d9f8bdb2 Author: David Brownell <dbr...@us...> Date: Wed Dec 2 22:57:07 2009 -0800 ARM11: remove arm11->target Don't need/want arm11->target; we have arm11->arm.target instead. Also remove some unused watchpoint stuff. diff --git a/src/target/arm11.c b/src/target/arm11.c index 5053414..1a3e979 100644 --- a/src/target/arm11.c +++ b/src/target/arm11.c @@ -127,13 +127,14 @@ static int arm11_check_init(struct arm11_common *arm11, uint32_t *dscr) * the target. */ - arm11->target->state = TARGET_HALTED; - arm11->target->debug_reason = arm11_get_DSCR_debug_reason(*dscr); + arm11->arm.target->state = TARGET_HALTED; + arm11->arm.target->debug_reason = + arm11_get_DSCR_debug_reason(*dscr); } else { - arm11->target->state = TARGET_RUNNING; - arm11->target->debug_reason = DBG_REASON_NOTHALTED; + arm11->arm.target->state = TARGET_RUNNING; + arm11->arm.target->debug_reason = DBG_REASON_NOTHALTED; } arm11_sc7_clear_vbw(arm11); @@ -1221,8 +1222,6 @@ static int arm11_target_create(struct target *target, Jim_Interp *interp) armv4_5_init_arch_info(target, &arm11->arm); - arm11->target = target; - arm11->jtag_info.tap = target->tap; arm11->jtag_info.scann_size = 5; arm11->jtag_info.scann_instr = ARM11_SCAN_N; @@ -1313,7 +1312,6 @@ static int arm11_examine(struct target *target) /** \todo TODO: reserve one brp slot if we allow breakpoints during step */ arm11->free_brps = arm11->brp; - arm11->free_wrps = arm11->wrp; LOG_DEBUG("IDCODE %08" PRIx32 " IMPLEMENTOR %02x DIDR %08" PRIx32, device_id, implementor, didr); @@ -1350,7 +1348,8 @@ static int arm11_examine(struct target *target) /** Load a register that is marked !valid in the register cache */ static int arm11_get_reg(struct reg *reg) { - struct target * target = ((struct arm11_reg_state *)reg->arch_info)->target; + struct arm11_reg_state *r = reg->arch_info; + struct target *target = r->target; if (target->state != TARGET_HALTED) { @@ -1371,7 +1370,8 @@ static int arm11_get_reg(struct reg *reg) /** Change a value in the register cache */ static int arm11_set_reg(struct reg *reg, uint8_t *buf) { - struct target *target = ((struct arm11_reg_state *)reg->arch_info)->target; + struct arm11_reg_state *r = reg->arch_info; + struct target *target = r->target; struct arm11_common *arm11 = target_to_arm11(target); // const struct arm11_reg_defs *arm11_reg_info = arm11_reg_defs + ((struct arm11_reg_state *)reg->arch_info)->def_index; diff --git a/src/target/arm11.h b/src/target/arm11.h index c3f4e86..e5c92de 100644 --- a/src/target/arm11.h +++ b/src/target/arm11.h @@ -51,18 +51,13 @@ enum arm11_debug_version struct arm11_common { struct arm arm; - struct target * target; /**< Reference back to the owner */ /** Debug module state. */ struct arm_dpm dpm; - /** \name Processor type detection */ - /*@{*/ - size_t brp; /**< Number of Breakpoint Register Pairs from DIDR */ size_t wrp; /**< Number of Watchpoint Register Pairs from DIDR */ - - /*@}*/ + size_t free_brps; /**< Number of breakpoints allocated */ uint32_t last_dscr; /**< Last retrieved DSCR value; Use only for debug message generation */ @@ -77,8 +72,6 @@ struct arm11_common /*@}*/ - size_t free_brps; /**< keep track of breakpoints allocated by arm11_add_breakpoint() */ - size_t free_wrps; /**< keep track of breakpoints allocated by arm11_add_watchpoint() */ // GA struct reg_cache *core_cache; diff --git a/src/target/arm11_dbgtap.c b/src/target/arm11_dbgtap.c index 6ce308e..7fd5e3a 100644 --- a/src/target/arm11_dbgtap.c +++ b/src/target/arm11_dbgtap.c @@ -85,7 +85,7 @@ int arm11_add_dr_scan_vc(int num_fields, struct scan_field *fields, tap_state_t */ void arm11_setup_field(struct arm11_common * arm11, int num_bits, void * out_data, void * in_data, struct scan_field * field) { - field->tap = arm11->target->tap; + field->tap = arm11->arm.target->tap; field->num_bits = num_bits; field->out_value = out_data; field->in_value = in_data; @@ -102,8 +102,7 @@ void arm11_setup_field(struct arm11_common * arm11, int num_bits, void * out_dat */ void arm11_add_IR(struct arm11_common * arm11, uint8_t instr, tap_state_t state) { - struct jtag_tap *tap; - tap = arm11->target->tap; + struct jtag_tap *tap = arm11->arm.target->tap; if (buf_get_u32(tap->cur_instr, 0, 5) == instr) { commit c2af99d4717837761b6df750e1fe75797c910b23 Author: David Brownell <dbr...@us...> Date: Wed Dec 2 22:57:07 2009 -0800 ARM DPM: tweak initialization Move the initial breakpoint/watchpoint disable calls to arm_dpm_initialize(), and start using that routine. This split helps with arm11 support. diff --git a/src/target/arm11.c b/src/target/arm11.c index 605e741..5053414 100644 --- a/src/target/arm11.c +++ b/src/target/arm11.c @@ -1330,10 +1330,8 @@ static int arm11_examine(struct target *target) /* Build register cache "late", after target_init(), since we * want to know if this core supports Secure Monitor mode. */ - if (!target_was_examined(target)) { - arm11_dpm_init(arm11, didr); - retval = arm_dpm_setup(&arm11->dpm); - } + if (!target_was_examined(target)) + retval = arm11_dpm_init(arm11, didr); /* ETM on ARM11 still uses original scanchain 6 access mode */ if (arm11->arm.etm && !target_was_examined(target)) { diff --git a/src/target/arm11_dbgtap.c b/src/target/arm11_dbgtap.c index cfcb5bf..6ce308e 100644 --- a/src/target/arm11_dbgtap.c +++ b/src/target/arm11_dbgtap.c @@ -1022,10 +1022,11 @@ static int arm11_dpm_instr_read_data_r0(struct arm_dpm *dpm, opcode, data); } - -void arm11_dpm_init(struct arm11_common *arm11, uint32_t didr) +/** Set up high-level debug module utilities */ +int arm11_dpm_init(struct arm11_common *arm11, uint32_t didr) { struct arm_dpm *dpm = &arm11->dpm; + int retval; dpm->arm = &arm11->arm; @@ -1039,4 +1040,12 @@ void arm11_dpm_init(struct arm11_common *arm11, uint32_t didr) dpm->instr_read_data_dcc = arm11_dpm_instr_read_data_dcc; dpm->instr_read_data_r0 = arm11_dpm_instr_read_data_r0; + + retval = arm_dpm_setup(dpm); + if (retval != ERROR_OK) + return retval; + + retval = arm_dpm_initialize(dpm); + + return retval; } diff --git a/src/target/arm11_dbgtap.h b/src/target/arm11_dbgtap.h index 8b6a206..2203361 100644 --- a/src/target/arm11_dbgtap.h +++ b/src/target/arm11_dbgtap.h @@ -60,7 +60,6 @@ void arm11_sc7_set_vcr(struct arm11_common *arm11, uint32_t value); int arm11_read_memory_word(struct arm11_common *arm11, uint32_t address, uint32_t *result); -/* Set up high-level debug module utilities */ -void arm11_dpm_init(struct arm11_common *arm11, uint32_t didr); +int arm11_dpm_init(struct arm11_common *arm11, uint32_t didr); #endif // ARM11_DBGTAP_H diff --git a/src/target/arm_dpm.c b/src/target/arm_dpm.c index 7c09e06..434c63e 100644 --- a/src/target/arm_dpm.c +++ b/src/target/arm_dpm.c @@ -807,18 +807,6 @@ int arm_dpm_setup(struct arm_dpm *dpm) return ERROR_FAIL; } - /* Disable all breakpoints and watchpoints at startup. */ - if (dpm->bpwp_disable) { - unsigned i; - - for (i = 0; i < dpm->nbp; i++) - (void) dpm->bpwp_disable(dpm, i); - for (i = 0; i < dpm->nwp; i++) - (void) dpm->bpwp_disable(dpm, 16 + i); - } else - LOG_WARNING("%s: can't disable breakpoints and watchpoints", - target_name(target)); - LOG_INFO("%s: hardware has %d breakpoints, %d watchpoints", target_name(target), dpm->nbp, dpm->nwp); @@ -835,6 +823,17 @@ int arm_dpm_setup(struct arm_dpm *dpm) */ int arm_dpm_initialize(struct arm_dpm *dpm) { - /* FIXME -- nothing yet */ + /* Disable all breakpoints and watchpoints at startup. */ + if (dpm->bpwp_disable) { + unsigned i; + + for (i = 0; i < dpm->nbp; i++) + (void) dpm->bpwp_disable(dpm, i); + for (i = 0; i < dpm->nwp; i++) + (void) dpm->bpwp_disable(dpm, 16 + i); + } else + LOG_WARNING("%s: can't disable breakpoints and watchpoints", + target_name(dpm->arm->target)); + return ERROR_OK; } diff --git a/src/target/arm_dpm.h b/src/target/arm_dpm.h index 191f465..c284144 100644 --- a/src/target/arm_dpm.h +++ b/src/target/arm_dpm.h @@ -129,7 +129,7 @@ struct arm_dpm { }; int arm_dpm_setup(struct arm_dpm *dpm); -int arm_dpm_reinitialize(struct arm_dpm *dpm); +int arm_dpm_initialize(struct arm_dpm *dpm); int arm_dpm_read_current_registers(struct arm_dpm *); int arm_dpm_write_dirty_registers(struct arm_dpm *, bool bpwp); diff --git a/src/target/cortex_a8.c b/src/target/cortex_a8.c index 5f2de76..9ca072e 100644 --- a/src/target/cortex_a8.c +++ b/src/target/cortex_a8.c @@ -523,6 +523,7 @@ static int cortex_a8_bpwp_disable(struct arm_dpm *dpm, unsigned index) static int cortex_a8_dpm_setup(struct cortex_a8_common *a8, uint32_t didr) { struct arm_dpm *dpm = &a8->armv7a_common.dpm; + int retval; dpm->arm = &a8->armv7a_common.armv4_5_common; dpm->didr = didr; @@ -540,7 +541,11 @@ static int cortex_a8_dpm_setup(struct cortex_a8_common *a8, uint32_t didr) dpm->bpwp_enable = cortex_a8_bpwp_enable; dpm->bpwp_disable = cortex_a8_bpwp_disable; - return arm_dpm_setup(dpm); + retval = arm_dpm_setup(dpm); + if (retval == ERROR_OK) + retval = arm_dpm_initialize(dpm); + + return retval; } ----------------------------------------------------------------------- Summary of changes: src/target/arm11.c | 350 ++++++++++----------------------------------- src/target/arm11.h | 30 +--- src/target/arm11_dbgtap.c | 45 ++++--- src/target/arm11_dbgtap.h | 5 +- src/target/arm_dpm.c | 25 ++-- src/target/arm_dpm.h | 2 +- src/target/cortex_a8.c | 7 +- 7 files changed, 128 insertions(+), 336 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: Zach W. <zw...@us...> - 2009-12-03 07:50:40
|
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 b123fd3cd9a11b2dfb79025fb137696135f5f898 (commit) from f4a1070dcf6b303cb980d89c5b342cf52b0397c4 (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 b123fd3cd9a11b2dfb79025fb137696135f5f898 Author: Zachary T Welch <zw...@su...> Date: Wed Dec 2 22:32:08 2009 -0800 fix configure problem when building w/o USB If building OpenOCD without any USB drivers, a warning would appear because $build_usb is never set to a sane default. This fixes it. diff --git a/configure.in b/configure.in index 9cb2b0f..dbddcb2 100644 --- a/configure.in +++ b/configure.in @@ -979,6 +979,7 @@ enum ftdi_chip_type x = TYPE_2232H; fi # check for usb.h when a driver will require it +build_usb=no if test $build_jlink = yes -o $build_vsllink = yes -o $build_usbprog = yes -o \ $build_rlink = yes -o $build_armjtagew = yes then ----------------------------------------------------------------------- Summary of changes: configure.in | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: Zach W. <zw...@us...> - 2009-12-03 03:51:23
|
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 f4a1070dcf6b303cb980d89c5b342cf52b0397c4 (commit) from 4c43afce852b1ed6bff544bed6d28cce3d366886 (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 f4a1070dcf6b303cb980d89c5b342cf52b0397c4 Author: Zachary T Welch <zw...@su...> Date: Wed Dec 2 18:24:27 2009 -0800 adding files required for distribution Add headers missing from Makefile rules to pass 'make distcheck'. These were included in the tree but were not added with those commits. diff --git a/src/Makefile.am b/src/Makefile.am index 913118f..2033752 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -18,6 +18,7 @@ libopenocd_la_SOURCES = \ startup_tcl.c noinst_HEADERS = \ + hello.h \ openocd.h diff --git a/src/target/Makefile.am b/src/target/Makefile.am index d00b0e4..cb473a3 100644 --- a/src/target/Makefile.am +++ b/src/target/Makefile.am @@ -111,6 +111,7 @@ noinst_HEADERS = \ arm926ejs.h \ arm966e.h \ arm11.h \ + arm11_dbgtap.h \ armv4_5.h \ armv4_5_mmu.h \ armv4_5_cache.h \ ----------------------------------------------------------------------- Summary of changes: src/Makefile.am | 1 + src/target/Makefile.am | 1 + 2 files changed, 2 insertions(+), 0 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: Zach W. <zw...@us...> - 2009-12-03 01:20: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 4c43afce852b1ed6bff544bed6d28cce3d366886 (commit) from a79b76d893ca5c3b8144b2098c88f516052d72fe (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 4c43afce852b1ed6bff544bed6d28cce3d366886 Author: Zachary T Welch <zw...@su...> Date: Wed Dec 2 16:12:10 2009 -0800 fix 'target init' command registration The command handler registration was put at the top level, rather than as a subcommand. Move it to where it belongs. diff --git a/src/target/target.c b/src/target/target.c index 4013442..9a605f3 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -4591,6 +4591,12 @@ static int jim_target_count(Jim_Interp *interp, int argc, Jim_Obj *const *argv) static const struct command_registration target_subcommand_handlers[] = { { + .name = "init", + .mode = COMMAND_CONFIG, + .handler = &handle_target_init_command, + .help = "initialize targets", + }, + { .name = "create", .mode = COMMAND_ANY, .jim_handler = &jim_target_create, @@ -4804,12 +4810,6 @@ COMMAND_HANDLER(handle_fast_load_command) static const struct command_registration target_command_handlers[] = { { - .name = "init", - .mode = COMMAND_CONFIG, - .handler = &handle_target_init_command, - .help = "initialize targets", - }, - { .name = "targets", .handler = &handle_targets_command, .mode = COMMAND_ANY, ----------------------------------------------------------------------- Summary of changes: src/target/target.c | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: David B. <dbr...@us...> - 2009-12-03 00:25:46
|
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 a79b76d893ca5c3b8144b2098c88f516052d72fe (commit) from 6ec526e706483cd2de6c8de4bafa885522a782cd (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 a79b76d893ca5c3b8144b2098c88f516052d72fe Author: David Brownell <dbr...@us...> Date: Wed Dec 2 15:24:14 2009 -0800 stubs: buildfix The new stubs for httpd and ioutil gave errors like: ioutil_stubs.c: In function âioutil_initâ: ioutil_stubs.c:27: error: implicit declaration of function âLOG_DEBUGâ ioutil_stubs.c:28: error: âERROR_OKâ undeclared (first use in this function) ioutil_stubs.c:28: error: (Each undeclared identifier is reported only once ioutil_stubs.c:28: error: for each function it appears in.) Fix. Signed-off-by: David Brownell <dbr...@us...> diff --git a/src/helper/ioutil_stubs.c b/src/helper/ioutil_stubs.c index 1171a6f..3cd9f97 100644 --- a/src/helper/ioutil_stubs.c +++ b/src/helper/ioutil_stubs.c @@ -21,6 +21,7 @@ #include <config.h> #endif #include "ioutil.h" +#include "log.h" int ioutil_init(struct command_context *cmd_ctx) { diff --git a/src/server/httpd_stubs.c b/src/server/httpd_stubs.c index 0a63362..6c289af 100644 --- a/src/server/httpd_stubs.c +++ b/src/server/httpd_stubs.c @@ -21,6 +21,7 @@ #include <config.h> #endif #include "httpd.h" +#include "log.h" int httpd_start(struct command_context *cmd_ctx) { ----------------------------------------------------------------------- Summary of changes: src/helper/ioutil_stubs.c | 1 + src/server/httpd_stubs.c | 1 + 2 files changed, 2 insertions(+), 0 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: Zach W. <zw...@us...> - 2009-12-02 22:32: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 6ec526e706483cd2de6c8de4bafa885522a782cd (commit) via eaf10f69de969652d03742809b9c970158b90719 (commit) via 34654359a918edae10ca7dd7ebc0a487fdf609a4 (commit) from 62fbb0f545213f8a813819f319e20fee8a859319 (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 6ec526e706483cd2de6c8de4bafa885522a782cd Author: Zachary T Welch <zw...@su...> Date: Tue Dec 1 19:58:32 2009 -0800 remove #if BUILD_HTTPD Add httpd_stubs.c to provide no-op implementations of httpd_start() and httpd_stop(). Allows these routines to be called unconditionally and ensures the libocdserver ABI remains unchanged regardless of whether this feature was built-in or not. Prints a DEBUG message when the stub implementation is included. diff --git a/configure.in b/configure.in index 1a4299d..9cb2b0f 100644 --- a/configure.in +++ b/configure.in @@ -614,12 +614,6 @@ else AC_DEFINE(BUILD_ZY1000, 0, [0 if you don't want ZY1000.]) fi -if test $build_httpd = yes; then - AC_DEFINE(BUILD_HTTPD, 1, [1 if you want httpd.]) -else - AC_DEFINE(BUILD_HTTPD, 0, [0 if you don't want httpd.]) -fi - if test $build_at91rm9200 = yes; then build_bitbang=yes AC_DEFINE(BUILD_AT91RM9200, 1, [1 if you want at91rm9200.]) diff --git a/src/openocd.c b/src/openocd.c index 1f45837..9a08019 100644 --- a/src/openocd.c +++ b/src/openocd.c @@ -244,10 +244,8 @@ int openocd_main(int argc, char *argv[]) if (ret != ERROR_OK) return EXIT_FAILURE; -#if BUILD_HTTPD if (httpd_start(cmd_ctx) != ERROR_OK) return EXIT_FAILURE; -#endif ret = server_init(cmd_ctx); if (ERROR_OK != ret) @@ -266,9 +264,7 @@ int openocd_main(int argc, char *argv[]) server_quit(); -#if BUILD_HTTPD httpd_stop(); -#endif unregister_all_commands(cmd_ctx, NULL); diff --git a/src/server/Makefile.am b/src/server/Makefile.am index b47b8d0..989a682 100644 --- a/src/server/Makefile.am +++ b/src/server/Makefile.am @@ -14,6 +14,7 @@ libserver_la_SOURCES = server.c telnet_server.c gdb_server.c if HTTPD libserver_la_SOURCES += httpd.c else +libserver_la_SOURCES += httpd_stubs.c if !ECOSBOARD libserver_la_SOURCES += server_stubs.c endif diff --git a/src/server/httpd_stubs.c b/src/server/httpd_stubs.c new file mode 100644 index 0000000..0a63362 --- /dev/null +++ b/src/server/httpd_stubs.c @@ -0,0 +1,32 @@ +/*************************************************************************** + * Copyright (C) 2009 Zachary T Welch <zw...@su...> * + * * + * 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 * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif +#include "httpd.h" + +int httpd_start(struct command_context *cmd_ctx) +{ + LOG_DEBUG("libocdserver was built without HTTPD support"); + return ERROR_OK; +} +void httpd_stop(void) +{ +} commit eaf10f69de969652d03742809b9c970158b90719 Author: Zachary T Welch <zw...@su...> Date: Tue Dec 1 19:52:00 2009 -0800 remove BUILD_IOUTIL symbol Add ioutil_stubs.c to provide an empty ioutil_init() routine. Add ioutil.h to prevent applications from needing to declare it. Allows unconditionally calling that function during startup, and the resulting libocdhelper library API is now more stable. Prints a DEBUG message when the stub implementation is included. diff --git a/configure.in b/configure.in index 81e4326..1a4299d 100644 --- a/configure.in +++ b/configure.in @@ -614,12 +614,6 @@ else AC_DEFINE(BUILD_ZY1000, 0, [0 if you don't want ZY1000.]) fi -if test $build_ioutil = yes; then - AC_DEFINE(BUILD_IOUTIL, 1, [1 if you want ioutils.]) -else - AC_DEFINE(BUILD_IOUTIL, 0, [0 if you don't want ioutils.]) -fi - if test $build_httpd = yes; then AC_DEFINE(BUILD_HTTPD, 1, [1 if you want httpd.]) else diff --git a/src/ecosboard.c b/src/ecosboard.c index dcd497c..cfb5765 100644 --- a/src/ecosboard.c +++ b/src/ecosboard.c @@ -23,6 +23,7 @@ #include "types.h" #include "jtag.h" +#include "ioutil.h" #include "configuration.h" #include "xsvf.h" #include "svf.h" @@ -942,8 +943,6 @@ static int add_default_dirs(void) return ERROR_OK; } -int ioutil_init(struct command_context *cmd_ctx); - int main(int argc, char *argv[]) { /* ramblockdevice will be the same address every time. The deflate app uses a buffer 16mBytes out, so we @@ -1080,13 +1079,8 @@ int main(int argc, char *argv[]) command_set_output_handler(cmd_ctx, configuration_output_handler, NULL); command_context_mode(cmd_ctx, COMMAND_CONFIG); -#if BUILD_IOUTIL if (ioutil_init(cmd_ctx) != ERROR_OK) - { return EXIT_FAILURE; - } -#endif - #ifdef CYGPKG_PROFILE_GPROF COMMAND_REGISTER(cmd_ctx, NULL, "ecosboard_profile", eCosBoard_handle_eCosBoard_profile_command, diff --git a/src/helper/Makefile.am b/src/helper/Makefile.am index 22b3c33..01e805e 100644 --- a/src/helper/Makefile.am +++ b/src/helper/Makefile.am @@ -27,6 +27,8 @@ libhelper_la_SOURCES = \ if IOUTIL libhelper_la_SOURCES += ioutil.c +else +libhelper_la_SOURCES += ioutil_stubs.c endif libhelper_la_CFLAGS = @@ -38,6 +40,7 @@ endif noinst_HEADERS = \ binarybuffer.h \ configuration.h \ + ioutil.h \ types.h \ log.h \ command.h \ diff --git a/src/helper/ioutil.h b/src/helper/ioutil.h new file mode 100644 index 0000000..855ae55 --- /dev/null +++ b/src/helper/ioutil.h @@ -0,0 +1,27 @@ +/*************************************************************************** + * Copyright (C) 2009 Zachary T Welch <zw...@su...> * + * * + * 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 * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#ifndef HELPER_IOUTILS_H +#define HELPER_IOUTILS_H + +struct command_context; + +int ioutil_init(struct command_context *cmd_ctx); + +#endif // HELPER_IOUTILS_H diff --git a/src/helper/ioutil_stubs.c b/src/helper/ioutil_stubs.c new file mode 100644 index 0000000..1171a6f --- /dev/null +++ b/src/helper/ioutil_stubs.c @@ -0,0 +1,29 @@ +/*************************************************************************** + * Copyright (C) 2009 Zachary T Welch <zw...@su...> * + * * + * 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 * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif +#include "ioutil.h" + +int ioutil_init(struct command_context *cmd_ctx) +{ + LOG_DEBUG("libocdhelper was built without I/O utility support"); + return ERROR_OK; +} diff --git a/src/openocd.c b/src/openocd.c index 2043a92..1f45837 100644 --- a/src/openocd.c +++ b/src/openocd.c @@ -30,6 +30,7 @@ #include "openocd.h" #include "jtag.h" +#include "ioutil.h" #include "configuration.h" #include "xsvf.h" #include "svf.h" @@ -85,8 +86,6 @@ static int log_target_callback_event_handler(struct target *target, enum target_ return ERROR_OK; } -int ioutil_init(struct command_context *cmd_ctx); - static bool init_at_startup = true; COMMAND_HANDLER(handle_noinit_command) @@ -227,12 +226,8 @@ int openocd_main(int argc, char *argv[]) cmd_ctx = setup_command_handler(NULL); -#if BUILD_IOUTIL if (ioutil_init(cmd_ctx) != ERROR_OK) - { return EXIT_FAILURE; - } -#endif LOG_OUTPUT("For bug reports, read\n\t" "http://openocd.berlios.de/doc/doxygen/bugs.html" commit 34654359a918edae10ca7dd7ebc0a487fdf609a4 Author: Zachary T Welch <zw...@su...> Date: Tue Dec 1 19:41:16 2009 -0800 remove #if logic for openocd_sleep_*lude Adds server_stubs.c to hold these routines, using automake logic to ensure it gets included under the right conditions. diff --git a/src/openocd.c b/src/openocd.c index 12bcf44..2043a92 100644 --- a/src/openocd.c +++ b/src/openocd.c @@ -215,20 +215,6 @@ struct command_context *setup_command_handler(Jim_Interp *interp) return cmd_ctx; } -#if !BUILD_HTTPD && !BUILD_ECOSBOARD -/* implementations of OpenOCD that uses multithreading needs to know when - * OpenOCD is sleeping. No-op in vanilla OpenOCD - */ -void openocd_sleep_prelude(void) -{ -} - -void openocd_sleep_postlude(void) -{ -} -#endif - - /* normally this is the main() function entry, but if OpenOCD is linked * into application, then this fn will not be invoked, but rather that * application will have it's own implementation of main(). */ diff --git a/src/openocd.h b/src/openocd.h index a91d46f..e43f156 100644 --- a/src/openocd.h +++ b/src/openocd.h @@ -31,11 +31,6 @@ */ int openocd_main(int argc, char *argv[]); -/// used by the server_loop() function in src/server/server.c -void openocd_sleep_prelude(void); -/// used by the server_loop() function in src/server/server.c -void openocd_sleep_postlude(void); - /// provides a hard-coded command environment setup extern const char openocd_startup_tcl[]; diff --git a/src/server/Makefile.am b/src/server/Makefile.am index 95fb519..b47b8d0 100644 --- a/src/server/Makefile.am +++ b/src/server/Makefile.am @@ -13,6 +13,10 @@ libserver_la_SOURCES = server.c telnet_server.c gdb_server.c if HTTPD libserver_la_SOURCES += httpd.c +else +if !ECOSBOARD +libserver_la_SOURCES += server_stubs.c +endif endif noinst_HEADERS += httpd.h diff --git a/src/server/server.h b/src/server/server.h index 173de95..e632bf1 100644 --- a/src/server/server.h +++ b/src/server/server.h @@ -82,6 +82,15 @@ int server_loop(struct command_context *command_context); int server_register_commands(struct command_context *context); /** + * Used by server_loop(), defined in server_stubs.c, httpd.c, or ecosboard.c + */ +void openocd_sleep_prelude(void); +/** + * Used by server_loop(), defined in server_stubs.c, httpd.c, or ecosboard.c + */ +void openocd_sleep_postlude(void); + +/** * Defines an extended command handler function declaration to enable * access to (and manipulation of) the server port number. * Call server_port like a normal COMMAND_HANDLER with an extra @a out parameter diff --git a/src/openocd.h b/src/server/server_stubs.c similarity index 62% copy from src/openocd.h copy to src/server/server_stubs.c index a91d46f..dcddec0 100644 --- a/src/openocd.h +++ b/src/server/server_stubs.c @@ -1,6 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005 by Dominic Rath <Dom...@gm...> * - * Copyright (C) 2009 by Zachary T Welch <zw...@su...> * + * Copyright (C) 2009 Zachary T Welch <zw...@su...> * * * * 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 * @@ -18,25 +17,16 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#ifndef OPENOCD_H -#define OPENOCD_H - -/** - * Different applications can define this entry point to override - * the default openocd main function. On most systems, this will be - * defined in src/openocd.c. - * @param argc normally passed from main() - * @param argv normally passed from main() - * @returns return code for main() - */ -int openocd_main(int argc, char *argv[]); - -/// used by the server_loop() function in src/server/server.c -void openocd_sleep_prelude(void); -/// used by the server_loop() function in src/server/server.c -void openocd_sleep_postlude(void); - -/// provides a hard-coded command environment setup -extern const char openocd_startup_tcl[]; - +#ifdef HAVE_CONFIG_H +#include <config.h> #endif +#include "server.h" + +void openocd_sleep_prelude(void) +{ + // no-op +} +void openocd_sleep_postlude(void) +{ + // no-op +} ----------------------------------------------------------------------- Summary of changes: configure.in | 12 ------------ src/ecosboard.c | 8 +------- src/helper/Makefile.am | 3 +++ src/{server/httpd.h => helper/ioutil.h} | 9 ++++----- src/{server/httpd.h => helper/ioutil_stubs.c} | 17 +++++++++-------- src/openocd.c | 25 +------------------------ src/openocd.h | 5 ----- src/server/Makefile.am | 5 +++++ src/server/{httpd.h => httpd_stubs.c} | 20 ++++++++++++-------- src/server/server.h | 9 +++++++++ src/server/{httpd.h => server_stubs.c} | 20 ++++++++++++-------- 11 files changed, 56 insertions(+), 77 deletions(-) copy src/{server/httpd.h => helper/ioutil.h} (89%) copy src/{server/httpd.h => helper/ioutil_stubs.c} (87%) copy src/server/{httpd.h => httpd_stubs.c} (86%) copy src/server/{httpd.h => server_stubs.c} (87%) hooks/post-receive -- Main OpenOCD repository |
From: Zach W. <zw...@us...> - 2009-12-02 22:29: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 62fbb0f545213f8a813819f319e20fee8a859319 (commit) via e03f3c57a52b36eac18a673fd3515b5ebac3f08d (commit) via ac1887c703d0d5ae83c513df61127f59e44a0469 (commit) via 37201c019ffc6b806aa61bf2eb8fc18c58083f02 (commit) via 1de0b9d351313f186433f4d71d31241c95665cbf (commit) via 747f8af672026f9778c6272ab48405d93b41acad (commit) via 682910fdc24c8ae970b3cd1e5b4ff7042e0522be (commit) from 55eeea7fceb67f29c9a43eeb7993c70214157343 (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 62fbb0f545213f8a813819f319e20fee8a859319 Author: Zachary T Welch <zw...@su...> Date: Mon Nov 30 18:45:38 2009 -0800 target: factor init to 'target init' Adds 'target init' command handler, called as part of 'init'. diff --git a/src/openocd.c b/src/openocd.c index 79a30e7..12bcf44 100644 --- a/src/openocd.c +++ b/src/openocd.c @@ -111,11 +111,9 @@ COMMAND_HANDLER(handle_init_command) initialized = 1; - command_context_mode(CMD_CTX, COMMAND_EXEC); - - if (target_init(CMD_CTX) != ERROR_OK) + retval = command_run_line(CMD_CTX, "target init"); + if (ERROR_OK != retval) return ERROR_FAIL; - LOG_DEBUG("target init complete"); if ((retval = jtag_interface_init(CMD_CTX)) != ERROR_OK) { @@ -126,7 +124,6 @@ COMMAND_HANDLER(handle_init_command) /* Try to initialize & examine the JTAG chain at this point, but * continue startup regardless */ - command_context_mode(CMD_CTX, COMMAND_CONFIG); if (command_run_line(CMD_CTX, "jtag init") == ERROR_OK) { command_context_mode(CMD_CTX, COMMAND_EXEC); diff --git a/src/target/target.c b/src/target/target.c index abf8bfd..4013442 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -787,6 +787,23 @@ int target_init(struct command_context *cmd_ctx) return ERROR_OK; } +COMMAND_HANDLER(handle_target_init_command) +{ + if (CMD_ARGC != 0) + return ERROR_COMMAND_SYNTAX_ERROR; + + static bool target_initialized = false; + if (target_initialized) + { + LOG_INFO("'target init' has already been called"); + return ERROR_OK; + } + target_initialized = true; + + LOG_DEBUG("Initializing targets..."); + return target_init(CMD_CTX); +} + int target_register_event_callback(int (*callback)(struct target *target, enum target_event event, void *priv), void *priv) { struct target_event_callback **callbacks_p = &target_event_callbacks; @@ -4787,6 +4804,12 @@ COMMAND_HANDLER(handle_fast_load_command) static const struct command_registration target_command_handlers[] = { { + .name = "init", + .mode = COMMAND_CONFIG, + .handler = &handle_target_init_command, + .help = "initialize targets", + }, + { .name = "targets", .handler = &handle_targets_command, .mode = COMMAND_ANY, commit e03f3c57a52b36eac18a673fd3515b5ebac3f08d Author: Zachary T Welch <zw...@su...> Date: Mon Nov 30 18:27:23 2009 -0800 target: factor target_init() into pieces Moves body of target initialization loop into a helper function, cleaning up its visual flow in the process. diff --git a/src/target/target.c b/src/target/target.c index 88931b5..abf8bfd 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -681,94 +681,109 @@ err_write_phys_memory(struct target *target, uint32_t address, static int handle_target(void *priv); -int target_init(struct command_context *cmd_ctx) +static int target_init_one(struct command_context *cmd_ctx, + struct target *target) { - struct target *target; - int retval; + target_reset_examined(target); - for (target = all_targets; target; target = target->next) { - struct target_type *type = target->type; + struct target_type *type = target->type; + if (type->examine == NULL) + type->examine = default_examine; - target_reset_examined(target); - if (target->type->examine == NULL) - { - target->type->examine = default_examine; - } + int retval = type->init_target(cmd_ctx, target); + if (ERROR_OK != retval) + { + LOG_ERROR("target '%s' init failed", target_name(target)); + return retval; + } - if ((retval = target->type->init_target(cmd_ctx, target)) != ERROR_OK) - { - LOG_ERROR("target '%s' init failed", target_name(target)); - return retval; - } + /** + * @todo get rid of those *memory_imp() methods, now that all + * callers are using target_*_memory() accessors ... and make + * sure the "physical" paths handle the same issues. + */ + /* a non-invasive way(in terms of patches) to add some code that + * runs before the type->write/read_memory implementation + */ + type->write_memory_imp = target->type->write_memory; + type->write_memory = target_write_memory_imp; + type->read_memory_imp = target->type->read_memory; + type->read_memory = target_read_memory_imp; - /** - * @todo get rid of those *memory_imp() methods, now that all - * callers are using target_*_memory() accessors ... and make - * sure the "physical" paths handle the same issues. - */ + type->soft_reset_halt_imp = target->type->soft_reset_halt; + type->soft_reset_halt = target_soft_reset_halt_imp; - /* a non-invasive way(in terms of patches) to add some code that - * runs before the type->write/read_memory implementation - */ - target->type->write_memory_imp = target->type->write_memory; - target->type->write_memory = target_write_memory_imp; - target->type->read_memory_imp = target->type->read_memory; - target->type->read_memory = target_read_memory_imp; - target->type->soft_reset_halt_imp = target->type->soft_reset_halt; - target->type->soft_reset_halt = target_soft_reset_halt_imp; - target->type->run_algorithm_imp = target->type->run_algorithm; - target->type->run_algorithm = target_run_algorithm_imp; - - /* Sanity-check MMU support ... stub in what we must, to help - * implement it in stages, but warn if we need to do so. - */ - if (type->mmu) { - if (type->write_phys_memory == NULL) { - LOG_ERROR("type '%s' is missing %s", - type->name, - "write_phys_memory"); - type->write_phys_memory = err_write_phys_memory; - } - if (type->read_phys_memory == NULL) { - LOG_ERROR("type '%s' is missing %s", - type->name, - "read_phys_memory"); - type->read_phys_memory = err_read_phys_memory; - } - if (type->virt2phys == NULL) { - LOG_ERROR("type '%s' is missing %s", - type->name, - "virt2phys"); - type->virt2phys = identity_virt2phys; - } + type->run_algorithm_imp = target->type->run_algorithm; + type->run_algorithm = target_run_algorithm_imp; + /* Sanity-check MMU support ... stub in what we must, to help + * implement it in stages, but warn if we need to do so. + */ + if (type->mmu) + { + if (type->write_phys_memory == NULL) + { + LOG_ERROR("type '%s' is missing write_phys_memory", + type->name); + type->write_phys_memory = err_write_phys_memory; + } + if (type->read_phys_memory == NULL) + { + LOG_ERROR("type '%s' is missing read_phys_memory", + type->name); + type->read_phys_memory = err_read_phys_memory; + } + if (type->virt2phys == NULL) + { + LOG_ERROR("type '%s' is missing virt2phys", type->name); + type->virt2phys = identity_virt2phys; + } + } + else + { /* Make sure no-MMU targets all behave the same: make no * distinction between physical and virtual addresses, and * ensure that virt2phys() is always an identity mapping. */ - } else { - if (type->write_phys_memory - || type->read_phys_memory - || type->virt2phys) - LOG_WARNING("type '%s' has broken MMU hooks", - type->name); - - type->mmu = no_mmu; - type->write_phys_memory = type->write_memory; - type->read_phys_memory = type->read_memory; - type->virt2phys = identity_virt2phys; + if (type->write_phys_memory || type->read_phys_memory + || type->virt2phys) + { + LOG_WARNING("type '%s' has bad MMU hooks", type->name); } + + type->mmu = no_mmu; + type->write_phys_memory = type->write_memory; + type->read_phys_memory = type->read_memory; + type->virt2phys = identity_virt2phys; } + return ERROR_OK; +} - if (all_targets) +int target_init(struct command_context *cmd_ctx) +{ + struct target *target; + int retval; + + for (target = all_targets; target; target = target->next) { - if ((retval = target_register_user_commands(cmd_ctx)) != ERROR_OK) - return retval; - if ((retval = target_register_timer_callback(&handle_target, 100, 1, cmd_ctx->interp)) != ERROR_OK) + retval = target_init_one(cmd_ctx, target); + if (ERROR_OK != retval) return retval; } + if (!all_targets) + return ERROR_OK; + + retval = target_register_user_commands(cmd_ctx); + if (ERROR_OK != retval) + return retval; + + retval = target_register_timer_callback(&handle_target, + 100, 1, cmd_ctx->interp); + if (ERROR_OK != retval) + return retval; + return ERROR_OK; } commit ac1887c703d0d5ae83c513df61127f59e44a0469 Author: Zachary T Welch <zw...@su...> Date: Mon Nov 30 18:30:38 2009 -0800 jtag: factor init into 'jtag init' Adds 'jtag init' command handler, which can be called as part of a fine-grained 'init' process. diff --git a/src/jtag/tcl.c b/src/jtag/tcl.c index 68bb21e..cc89080 100644 --- a/src/jtag/tcl.c +++ b/src/jtag/tcl.c @@ -808,8 +808,31 @@ static int jim_jtag_names(Jim_Interp *interp, int argc, Jim_Obj *const *argv) return JIM_OK; } +COMMAND_HANDLER(handle_jtag_init_command) +{ + if (CMD_ARGC != 0) + return ERROR_COMMAND_SYNTAX_ERROR; + + static bool jtag_initialized = false; + if (jtag_initialized) + { + LOG_INFO("'jtag init' has already been called"); + return ERROR_OK; + } + jtag_initialized = true; + + LOG_DEBUG("Initializing jtag devices..."); + return jtag_init(CMD_CTX); +} + static const struct command_registration jtag_subcommand_handlers[] = { { + .name = "init", + .mode = COMMAND_CONFIG, + .handler = &handle_jtag_init_command, + .help = "initialize jtag scan chain", + }, + { .name = "interface", .mode = COMMAND_ANY, .jim_handler = &jim_jtag_interface, diff --git a/src/openocd.c b/src/openocd.c index aaa4531..79a30e7 100644 --- a/src/openocd.c +++ b/src/openocd.c @@ -126,16 +126,18 @@ COMMAND_HANDLER(handle_init_command) /* Try to initialize & examine the JTAG chain at this point, but * continue startup regardless */ - if (jtag_init(CMD_CTX) == ERROR_OK) + command_context_mode(CMD_CTX, COMMAND_CONFIG); + if (command_run_line(CMD_CTX, "jtag init") == ERROR_OK) { - LOG_DEBUG("jtag init complete"); - if (target_examine() == ERROR_OK) - { - LOG_DEBUG("jtag examine complete"); - } + command_context_mode(CMD_CTX, COMMAND_EXEC); + LOG_DEBUG("Examining targets..."); + if (target_examine() != ERROR_OK) + LOG_DEBUG("target examination failed"); + command_context_mode(CMD_CTX, COMMAND_CONFIG); } + else + LOG_WARNING("jtag initialization failed; try 'jtag init' again."); - command_context_mode(CMD_CTX, COMMAND_CONFIG); if (command_run_line(CMD_CTX, "flash init") != ERROR_OK) return ERROR_FAIL; commit 37201c019ffc6b806aa61bf2eb8fc18c58083f02 Author: Zachary T Welch <zw...@su...> Date: Mon Nov 30 17:38:02 2009 -0800 flash: factor init to 'flash init' Split flash initialiation into 'flash init', called from 'init'. diff --git a/src/flash/flash.c b/src/flash/flash.c index 7023ef9..1e5ac9a 100644 --- a/src/flash/flash.c +++ b/src/flash/flash.c @@ -1375,6 +1375,23 @@ int flash_init_drivers(struct command_context *cmd_ctx) return register_commands(cmd_ctx, parent, flash_exec_command_handlers); } +COMMAND_HANDLER(handle_flash_init_command) +{ + if (CMD_ARGC != 0) + return ERROR_COMMAND_SYNTAX_ERROR; + + static bool flash_initialized = false; + if (flash_initialized) + { + LOG_INFO("'flash init' has already been called"); + return ERROR_OK; + } + flash_initialized = true; + + LOG_DEBUG("Initializing flash devices..."); + return flash_init_drivers(CMD_CTX); +} + static const struct command_registration flash_config_command_handlers[] = { { .name = "bank", @@ -1387,6 +1404,12 @@ static const struct command_registration flash_config_command_handlers[] = { "using the specified NOR flash driver.", }, { + .name = "init", + .mode = COMMAND_CONFIG, + .handler = &handle_flash_init_command, + .help = "initialize flash devices", + }, + { .name = "banks", .mode = COMMAND_ANY, .jim_handler = &jim_flash_banks, diff --git a/src/openocd.c b/src/openocd.c index ff35f87..aaa4531 100644 --- a/src/openocd.c +++ b/src/openocd.c @@ -135,11 +135,10 @@ COMMAND_HANDLER(handle_init_command) } } - if (flash_init_drivers(CMD_CTX) != ERROR_OK) + command_context_mode(CMD_CTX, COMMAND_CONFIG); + if (command_run_line(CMD_CTX, "flash init") != ERROR_OK) return ERROR_FAIL; - LOG_DEBUG("flash init complete"); - command_context_mode(CMD_CTX, COMMAND_CONFIG); if (command_run_line(CMD_CTX, "mflash init") != ERROR_OK) return ERROR_FAIL; commit 1de0b9d351313f186433f4d71d31241c95665cbf Author: Zachary T Welch <zw...@su...> Date: Mon Nov 30 17:32:56 2009 -0800 mflash: factor init to 'mflash init' Splits mflash initialiation to 'mflash init', called from 'init'. diff --git a/src/flash/mflash.c b/src/flash/mflash.c index 03a56e2..8f42aa6 100644 --- a/src/flash/mflash.c +++ b/src/flash/mflash.c @@ -1304,6 +1304,23 @@ int mflash_init_drivers(struct command_context *cmd_ctx) return register_commands(cmd_ctx, NULL, mflash_exec_command_handlers); } +COMMAND_HANDLER(handle_mflash_init_command) +{ + if (CMD_ARGC != 0) + return ERROR_COMMAND_SYNTAX_ERROR; + + static bool mflash_initialized = false; + if (mflash_initialized) + { + LOG_INFO("'mflash init' has already been called"); + return ERROR_OK; + } + mflash_initialized = true; + + LOG_DEBUG("Initializing mflash devices..."); + return mflash_init_drivers(CMD_CTX); +} + COMMAND_HANDLER(mg_bank_cmd) { struct target *target; @@ -1352,6 +1369,12 @@ static const struct command_registration mflash_config_command_handlers[] = { .help = "configure a mflash device bank", .usage = "<soc> <base> <RST pin> <target #>", }, + { + .name = "init", + .mode = COMMAND_CONFIG, + .handler = &handle_mflash_init_command, + .help = "initialize mflash devices", + }, COMMAND_REGISTRATION_DONE }; static const struct command_registration mflash_command_handler[] = { diff --git a/src/openocd.c b/src/openocd.c index 1026379..ff35f87 100644 --- a/src/openocd.c +++ b/src/openocd.c @@ -139,11 +139,10 @@ COMMAND_HANDLER(handle_init_command) return ERROR_FAIL; LOG_DEBUG("flash init complete"); - if (mflash_init_drivers(CMD_CTX) != ERROR_OK) + command_context_mode(CMD_CTX, COMMAND_CONFIG); + if (command_run_line(CMD_CTX, "mflash init") != ERROR_OK) return ERROR_FAIL; - LOG_DEBUG("mflash init complete"); - command_context_mode(CMD_CTX, COMMAND_CONFIG); if (command_run_line(CMD_CTX, "nand init") != ERROR_OK) return ERROR_FAIL; commit 747f8af672026f9778c6272ab48405d93b41acad Author: Zachary T Welch <zw...@su...> Date: Mon Nov 30 17:27:21 2009 -0800 nand: factor init to 'nand init' Split NAND initialization into 'nand init', which gets called from the main 'init' command. diff --git a/src/flash/nand.c b/src/flash/nand.c index 94cec8d..1c8c0c8 100644 --- a/src/flash/nand.c +++ b/src/flash/nand.c @@ -281,6 +281,9 @@ COMMAND_HANDLER(handle_nand_device_command) return CALL_COMMAND_HANDLER(handle_nand_list_drivers); } + +COMMAND_HANDLER(handle_nand_init_command); + static const struct command_registration nand_config_command_handlers[] = { { .name = "device", @@ -294,6 +297,12 @@ static const struct command_registration nand_config_command_handlers[] = { .mode = COMMAND_ANY, .help = "lists available NAND drivers", }, + { + .name = "init", + .mode = COMMAND_CONFIG, + .handler = &handle_nand_init_command, + .help = "initialize NAND devices", + }, COMMAND_REGISTRATION_DONE }; static const struct command_registration nand_command_handlers[] = { @@ -1794,3 +1803,20 @@ int nand_init(struct command_context *cmd_ctx) struct command *parent = command_find_in_context(cmd_ctx, "nand"); return register_commands(cmd_ctx, parent, nand_exec_command_handlers); } + +COMMAND_HANDLER(handle_nand_init_command) +{ + if (CMD_ARGC != 0) + return ERROR_COMMAND_SYNTAX_ERROR; + + static bool nand_initialized = false; + if (nand_initialized) + { + LOG_INFO("'nand init' has already been called"); + return ERROR_OK; + } + nand_initialized = true; + + LOG_DEBUG("Initializing NAND devices..."); + return nand_init(CMD_CTX); +} diff --git a/src/openocd.c b/src/openocd.c index 777e630..1026379 100644 --- a/src/openocd.c +++ b/src/openocd.c @@ -143,11 +143,10 @@ COMMAND_HANDLER(handle_init_command) return ERROR_FAIL; LOG_DEBUG("mflash init complete"); - if (nand_init(CMD_CTX) != ERROR_OK) + command_context_mode(CMD_CTX, COMMAND_CONFIG); + if (command_run_line(CMD_CTX, "nand init") != ERROR_OK) return ERROR_FAIL; - LOG_DEBUG("NAND init complete"); - command_context_mode(CMD_CTX, COMMAND_CONFIG); if (command_run_line(CMD_CTX, "pld init") != ERROR_OK) return ERROR_FAIL; command_context_mode(CMD_CTX, COMMAND_EXEC); commit 682910fdc24c8ae970b3cd1e5b4ff7042e0522be Author: Zachary T Welch <zw...@su...> Date: Mon Nov 30 17:20:18 2009 -0800 pld: factor init to 'pld init' Split PLD initialization into 'pld init', which gets called from 'init'. diff --git a/src/openocd.c b/src/openocd.c index 44e0292..777e630 100644 --- a/src/openocd.c +++ b/src/openocd.c @@ -147,9 +147,10 @@ COMMAND_HANDLER(handle_init_command) return ERROR_FAIL; LOG_DEBUG("NAND init complete"); - if (pld_init(CMD_CTX) != ERROR_OK) + command_context_mode(CMD_CTX, COMMAND_CONFIG); + if (command_run_line(CMD_CTX, "pld init") != ERROR_OK) return ERROR_FAIL; - LOG_DEBUG("pld init complete"); + command_context_mode(CMD_CTX, COMMAND_EXEC); /* initialize telnet subsystem */ gdb_target_add_all(all_targets); diff --git a/src/pld/pld.c b/src/pld/pld.c index 24afd07..df7ac0d 100644 --- a/src/pld/pld.c +++ b/src/pld/pld.c @@ -213,6 +213,23 @@ int pld_init(struct command_context *cmd_ctx) return register_commands(cmd_ctx, parent, pld_exec_command_handlers); } +COMMAND_HANDLER(handle_pld_init_command) +{ + if (CMD_ARGC != 0) + return ERROR_COMMAND_SYNTAX_ERROR; + + static bool pld_initialized = false; + if (pld_initialized) + { + LOG_INFO("'pld init' has already been called"); + return ERROR_OK; + } + pld_initialized = true; + + LOG_DEBUG("Initializing PLDs..."); + return pld_init(CMD_CTX); +} + static const struct command_registration pld_config_command_handlers[] = { { .name = "device", @@ -221,6 +238,12 @@ static const struct command_registration pld_config_command_handlers[] = { .help = "configure a PLD device", .usage = "<driver> ...", }, + { + .name = "init", + .mode = COMMAND_CONFIG, + .handler = &handle_pld_init_command, + .help = "initialize PLD devices", + }, COMMAND_REGISTRATION_DONE }; static const struct command_registration pld_command_handler[] = { ----------------------------------------------------------------------- Summary of changes: src/flash/flash.c | 23 +++++++ src/flash/mflash.c | 23 +++++++ src/flash/nand.c | 26 ++++++++ src/jtag/tcl.c | 23 +++++++ src/openocd.c | 33 +++++----- src/pld/pld.c | 23 +++++++ src/target/target.c | 176 +++++++++++++++++++++++++++++++-------------------- 7 files changed, 240 insertions(+), 87 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: David B. <dbr...@us...> - 2009-12-02 20:45:48
|
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 55eeea7fceb67f29c9a43eeb7993c70214157343 (commit) via 03c103d56a3937069a4a6abd02cffabe2f3a6641 (commit) from d84fead487b120774e18c03664a0a361616429fc (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 55eeea7fceb67f29c9a43eeb7993c70214157343 Author: David Brownell <dbr...@us...> Date: Wed Dec 2 11:31:32 2009 -0800 ARMv7a/Cortex-A8: report watchpoint trigger insn Save and display the address of the instruction which triggered the watchpoint. Because of pipelining, that's well behind the PC value when debug entry completes. (Example in a subroutine that had been returned from...) Remove unused A8 stuff, mostly watchpoint hooks from the header. Signed-off-by: David Brownell <dbr...@us...> diff --git a/src/target/arm_dpm.c b/src/target/arm_dpm.c index f94fcc4..7c09e06 100644 --- a/src/target/arm_dpm.c +++ b/src/target/arm_dpm.c @@ -736,6 +736,23 @@ static int dpm_remove_watchpoint(struct target *target, struct watchpoint *wp) return retval; } +void arm_dpm_report_wfar(struct arm_dpm *dpm, uint32_t addr) +{ + switch (dpm->arm->core_state) { + case ARMV4_5_STATE_ARM: + addr -= 8; + break; + case ARMV4_5_STATE_THUMB: + case ARM_STATE_THUMB_EE: + addr -= 4; + break; + case ARMV4_5_STATE_JAZELLE: + /* ?? */ + break; + } + dpm->wp_pc = addr; +} + /*----------------------------------------------------------------------*/ /* diff --git a/src/target/arm_dpm.h b/src/target/arm_dpm.h index 5d665a8..191f465 100644 --- a/src/target/arm_dpm.h +++ b/src/target/arm_dpm.h @@ -122,6 +122,9 @@ struct arm_dpm { struct dpm_bp *dbp; struct dpm_wp *dwp; + /** Address of the instruction which triggered a watchpoint. */ + uint32_t wp_pc; + // FIXME -- read/write DCSR methods and symbols }; @@ -131,4 +134,6 @@ int arm_dpm_reinitialize(struct arm_dpm *dpm); int arm_dpm_read_current_registers(struct arm_dpm *); int arm_dpm_write_dirty_registers(struct arm_dpm *, bool bpwp); +void arm_dpm_report_wfar(struct arm_dpm *, uint32_t wfar); + #endif /* __ARM_DPM_H */ diff --git a/src/target/armv7a.c b/src/target/armv7a.c index e23208f..06bc748 100644 --- a/src/target/armv7a.c +++ b/src/target/armv7a.c @@ -113,6 +113,9 @@ int armv7a_arch_state(struct target *target) if (armv4_5->core_mode == ARMV4_5_MODE_ABT) armv7a_show_fault_registers(target); + else if (target->debug_reason == DBG_REASON_WATCHPOINT) + LOG_USER("Watchpoint triggered at PC %#08x", + (unsigned) armv7a->dpm.wp_pc); return ERROR_OK; } diff --git a/src/target/cortex_a8.c b/src/target/cortex_a8.c index a289d96..5f2de76 100644 --- a/src/target/cortex_a8.c +++ b/src/target/cortex_a8.c @@ -772,7 +772,7 @@ static int cortex_a8_resume(struct target *target, int current, static int cortex_a8_debug_entry(struct target *target) { int i; - uint32_t regfile[16], pc, cpsr, dscr; + uint32_t regfile[16], wfar, cpsr, dscr; int retval = ERROR_OK; struct working_area *regfile_working_area = NULL; struct cortex_a8_common *cortex_a8 = target_to_cortex_a8(target); @@ -811,9 +811,12 @@ static int cortex_a8_debug_entry(struct target *target) case 2: /* asynch watchpoint */ case 10: /* precise watchpoint */ target->debug_reason = DBG_REASON_WATCHPOINT; - /* REVISIT could collect WFAR later, to see just - * which instruction triggered the watchpoint. - */ + + /* save address of faulting instruction */ + retval = mem_ap_read_atomic_u32(swjdp, + armv7a->debug_base + CPUDBG_WFAR, + &wfar); + arm_dpm_report_wfar(&armv7a->dpm, wfar); break; default: target->debug_reason = DBG_REASON_UNDEFINED; @@ -841,7 +844,6 @@ static int cortex_a8_debug_entry(struct target *target) /* read Current PSR */ cortex_a8_dap_read_coreregister_u32(target, &cpsr, 16); - pc = regfile[15]; dap_ap_select(swjdp, swjdp_debugap); LOG_DEBUG("cpsr: %8.8" PRIx32, cpsr); @@ -892,10 +894,7 @@ static int cortex_a8_debug_entry(struct target *target) if (armv7a->post_debug_entry) armv7a->post_debug_entry(target); - - return retval; - } static void cortex_a8_post_debug_entry(struct target *target) @@ -1527,20 +1526,7 @@ static int cortex_a8_examine_first(struct target *target) cortex_a8->brp_list[i].BRPn = i; } - /* Setup Watchpoint Register Pairs */ - cortex_a8->wrp_num = ((didr >> 28) & 0x0F) + 1; - cortex_a8->wrp_num_available = cortex_a8->wrp_num; - cortex_a8->wrp_list = calloc(cortex_a8->wrp_num, sizeof(struct cortex_a8_wrp)); - for (i = 0; i < cortex_a8->wrp_num; i++) - { - cortex_a8->wrp_list[i].used = 0; - cortex_a8->wrp_list[i].type = 0; - cortex_a8->wrp_list[i].value = 0; - cortex_a8->wrp_list[i].control = 0; - cortex_a8->wrp_list[i].WRPn = i; - } - LOG_DEBUG("Configured %i hw breakpoint pairs and %i hw watchpoint pairs", - cortex_a8->brp_num , cortex_a8->wrp_num); + LOG_DEBUG("Configured %i hw breakpoints", cortex_a8->brp_num); target_set_examined(target); return ERROR_OK; diff --git a/src/target/cortex_a8.h b/src/target/cortex_a8.h index 3b2c8b1..87db23e 100644 --- a/src/target/cortex_a8.h +++ b/src/target/cortex_a8.h @@ -54,15 +54,6 @@ struct cortex_a8_brp uint8_t BRPn; }; -struct cortex_a8_wrp -{ - int used; - int type; - uint32_t value; - uint32_t control; - uint8_t WRPn; -}; - struct cortex_a8_common { int common_magic; @@ -70,29 +61,16 @@ struct cortex_a8_common /* Context information */ uint32_t cpudbg_dscr; - uint32_t nvic_dfsr; /* Debug Fault Status Register - shows reason for debug halt */ - uint32_t nvic_icsr; /* Interrupt Control State Register - shows active and pending IRQ */ /* Saved cp15 registers */ uint32_t cp15_control_reg; - uint32_t cp15_aux_control_reg; /* Breakpoint register pairs */ int brp_num_context; int brp_num; int brp_num_available; -// int brp_enabled; struct cortex_a8_brp *brp_list; - /* Watchpoint register pairs */ - int wrp_num; - int wrp_num_available; - struct cortex_a8_wrp *wrp_list; - - /* Interrupts */ - int intlinesnum; - uint32_t *intsetenable; - /* Use cortex_a8_read_regs_through_mem for fast register reads */ int fast_reg_read; commit 03c103d56a3937069a4a6abd02cffabe2f3a6641 Author: David Brownell <dbr...@us...> Date: Wed Dec 2 11:31:32 2009 -0800 ARM: label SP and LR correctly Except for USR/SYS mode, the labels for the shadowed SP and LR registers were reversed. LR is r14; SP is r13. Fix. This would not affect GDB users; GDB references are positional. Only folk working directly with OpenOCD register values would have noticed this bug. Signed-off-by: David Brownell <dbr...@us...> diff --git a/src/target/armv4_5.c b/src/target/armv4_5.c index d047b1b..9419344 100644 --- a/src/target/armv4_5.c +++ b/src/target/armv4_5.c @@ -281,20 +281,20 @@ static const struct { { .name = "r11_fiq", .cookie = 11, .mode = ARMV4_5_MODE_FIQ, }, { .name = "r12_fiq", .cookie = 12, .mode = ARMV4_5_MODE_FIQ, }, - { .name = "lr_fiq", .cookie = 13, .mode = ARMV4_5_MODE_FIQ, }, - { .name = "sp_fiq", .cookie = 14, .mode = ARMV4_5_MODE_FIQ, }, + { .name = "sp_fiq", .cookie = 13, .mode = ARMV4_5_MODE_FIQ, }, + { .name = "lr_fiq", .cookie = 14, .mode = ARMV4_5_MODE_FIQ, }, - { .name = "lr_irq", .cookie = 13, .mode = ARMV4_5_MODE_IRQ, }, - { .name = "sp_irq", .cookie = 14, .mode = ARMV4_5_MODE_IRQ, }, + { .name = "sp_irq", .cookie = 13, .mode = ARMV4_5_MODE_IRQ, }, + { .name = "lr_irq", .cookie = 14, .mode = ARMV4_5_MODE_IRQ, }, - { .name = "lr_svc", .cookie = 13, .mode = ARMV4_5_MODE_SVC, }, - { .name = "sp_svc", .cookie = 14, .mode = ARMV4_5_MODE_SVC, }, + { .name = "sp_svc", .cookie = 13, .mode = ARMV4_5_MODE_SVC, }, + { .name = "lr_svc", .cookie = 14, .mode = ARMV4_5_MODE_SVC, }, - { .name = "lr_abt", .cookie = 13, .mode = ARMV4_5_MODE_ABT, }, - { .name = "sp_abt", .cookie = 14, .mode = ARMV4_5_MODE_ABT, }, + { .name = "sp_abt", .cookie = 13, .mode = ARMV4_5_MODE_ABT, }, + { .name = "lr_abt", .cookie = 14, .mode = ARMV4_5_MODE_ABT, }, - { .name = "lr_und", .cookie = 13, .mode = ARMV4_5_MODE_UND, }, - { .name = "sp_und", .cookie = 14, .mode = ARMV4_5_MODE_UND, }, + { .name = "sp_und", .cookie = 13, .mode = ARMV4_5_MODE_UND, }, + { .name = "lr_und", .cookie = 14, .mode = ARMV4_5_MODE_UND, }, { .name = "cpsr", .cookie = 16, .mode = ARMV4_5_MODE_ANY, }, { .name = "spsr_fiq", .cookie = 16, .mode = ARMV4_5_MODE_FIQ, }, @@ -303,8 +303,8 @@ static const struct { { .name = "spsr_abt", .cookie = 16, .mode = ARMV4_5_MODE_ABT, }, { .name = "spsr_und", .cookie = 16, .mode = ARMV4_5_MODE_UND, }, - { .name = "lr_mon", .cookie = 13, .mode = ARM_MODE_MON, }, - { .name = "sp_mon", .cookie = 14, .mode = ARM_MODE_MON, }, + { .name = "sp_mon", .cookie = 13, .mode = ARM_MODE_MON, }, + { .name = "lr_mon", .cookie = 14, .mode = ARM_MODE_MON, }, { .name = "spsr_mon", .cookie = 16, .mode = ARM_MODE_MON, }, }; ----------------------------------------------------------------------- Summary of changes: src/target/arm_dpm.c | 17 +++++++++++++++++ src/target/arm_dpm.h | 5 +++++ src/target/armv4_5.c | 24 ++++++++++++------------ src/target/armv7a.c | 3 +++ src/target/cortex_a8.c | 30 ++++++++---------------------- src/target/cortex_a8.h | 22 ---------------------- 6 files changed, 45 insertions(+), 56 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: Øyvind H. <go...@us...> - 2009-12-02 12:47:24
|
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 d84fead487b120774e18c03664a0a361616429fc (commit) from f4b52e1ceb2818d7a388c7aa0a3a7ab9b78f68be (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 d84fead487b120774e18c03664a0a361616429fc Author: Ãyvind Harboe <oyv...@zy...> Date: Wed Dec 2 12:45:12 2009 +0100 zy1000: keep up with startup refactoring work. keep up with server_init() introduction. Signed-off-by: Ãyvind Harboe <oyv...@zy...> diff --git a/src/ecosboard.c b/src/ecosboard.c index 36e807e..dcd497c 100644 --- a/src/ecosboard.c +++ b/src/ecosboard.c @@ -1113,6 +1113,11 @@ int main(int argc, char *argv[]) command_run_linef(cmd_ctx, "script /rom/openocd.cfg"); + int ret; + ret = server_init(cmd_ctx); + if (ERROR_OK != ret) + return EXIT_FAILURE; + /* we MUST always run the init command as it will launch telnet sessions */ command_run_line(cmd_ctx, "init"); ----------------------------------------------------------------------- Summary of changes: src/ecosboard.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: David B. <dbr...@us...> - 2009-12-02 06:48:26
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via f4b52e1ceb2818d7a388c7aa0a3a7ab9b78f68be (commit) via 66ca84b58114ad73b5843f62f9f5fbead1126fca (commit) via 1c7d3d200c6f20d4bb689176373368cd497d797f (commit) from a65e75ea34153a8d0a0fe0b07497ad75c5726ab6 (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 f4b52e1ceb2818d7a388c7aa0a3a7ab9b78f68be Author: David Brownell <dbr...@us...> Date: Tue Dec 1 21:47:45 2009 -0800 Cortex-A8: basic watchpoint support Actually this should handle both breakpoints and watchpoints ... but the DPM framework only handles watchpoints for now. Works on Beagle. Signed-off-by: David Brownell <dbr...@us...> diff --git a/src/target/cortex_a8.c b/src/target/cortex_a8.c index 81402d7..a289d96 100644 --- a/src/target/cortex_a8.c +++ b/src/target/cortex_a8.c @@ -460,6 +460,66 @@ static int cortex_a8_instr_read_data_r0(struct arm_dpm *dpm, return cortex_a8_read_dcc(a8, data, &dscr); } +static int cortex_a8_bpwp_enable(struct arm_dpm *dpm, unsigned index, + uint32_t addr, uint32_t control) +{ + struct cortex_a8_common *a8 = dpm_to_a8(dpm); + uint32_t vr = a8->armv7a_common.debug_base; + uint32_t cr = a8->armv7a_common.debug_base; + int retval; + + switch (index) { + case 0 ... 15: /* breakpoints */ + vr += CPUDBG_BVR_BASE; + cr += CPUDBG_BCR_BASE; + break; + case 16 ... 31: /* watchpoints */ + vr += CPUDBG_WVR_BASE; + cr += CPUDBG_WCR_BASE; + index -= 16; + break; + default: + return ERROR_FAIL; + } + vr += 4 * index; + cr += 4 * index; + + LOG_DEBUG("A8: bpwp enable, vr %08x cr %08x", + (unsigned) vr, (unsigned) cr); + + retval = cortex_a8_dap_write_memap_register_u32(dpm->arm->target, + vr, addr); + if (retval != ERROR_OK) + return retval; + retval = cortex_a8_dap_write_memap_register_u32(dpm->arm->target, + cr, control); + return retval; +} + +static int cortex_a8_bpwp_disable(struct arm_dpm *dpm, unsigned index) +{ + struct cortex_a8_common *a8 = dpm_to_a8(dpm); + uint32_t cr; + + switch (index) { + case 0 ... 15: + cr = a8->armv7a_common.debug_base + CPUDBG_BCR_BASE; + break; + case 16 ... 31: + cr = a8->armv7a_common.debug_base + CPUDBG_WCR_BASE; + index -= 16; + break; + default: + return ERROR_FAIL; + } + cr += 4 * index; + + LOG_DEBUG("A8: bpwp disable, cr %08x", (unsigned) cr); + + /* clear control register */ + return cortex_a8_dap_write_memap_register_u32(dpm->arm->target, cr, 0); +} + static int cortex_a8_dpm_setup(struct cortex_a8_common *a8, uint32_t didr) { struct arm_dpm *dpm = &a8->armv7a_common.dpm; @@ -477,6 +537,9 @@ static int cortex_a8_dpm_setup(struct cortex_a8_common *a8, uint32_t didr) dpm->instr_read_data_dcc = cortex_a8_instr_read_data_dcc; dpm->instr_read_data_r0 = cortex_a8_instr_read_data_r0; + dpm->bpwp_enable = cortex_a8_bpwp_enable; + dpm->bpwp_disable = cortex_a8_bpwp_disable; + return arm_dpm_setup(dpm); } @@ -745,6 +808,7 @@ static int cortex_a8_debug_entry(struct target *target) case 5: /* vector catch */ target->debug_reason = DBG_REASON_BREAKPOINT; break; + case 2: /* asynch watchpoint */ case 10: /* precise watchpoint */ target->debug_reason = DBG_REASON_WATCHPOINT; /* REVISIT could collect WFAR later, to see just @@ -1276,6 +1340,8 @@ static int cortex_a8_write_memory(struct target *target, uint32_t address, * * For both ICache and DCache, walk all cache lines in the * address range. Cortex-A8 has fixed 64 byte line length. + * + * REVISIT per ARMv7, these may trigger watchpoints ... */ /* invalidate I-Cache */ commit 66ca84b58114ad73b5843f62f9f5fbead1126fca Author: David Brownell <dbr...@us...> Date: Tue Dec 1 21:47:45 2009 -0800 ARM: core DPM support for watchpoints This is a NOP unless the underlying core exposes two new methods, and neither of the two cores using this (ARM11xx, Cortex-A8) do so yet. This patch only updates those cores so they pass a flag saying whether or not to update breakpoint and watchpoint status before resuming; and removing some now-needless anti-segfault code from ARM11. Cortex-A8 didn't have that code ... yes, it segfaulted when setting watchpoints. NOTE: this uses a slightly different strategy for setting/clearing breakpoints than the ARM7/ARM9/etc code uses. It leaves them alone unless it's *got* to change something, to speed halt/resume cycles (including single stepping). ALSO NOTE: this under-delivers for Cortex-A8, where regions with size up to 2 GBytes can be watched ... it handles watchpoints which ARM11 can also handle (size 1/2/4 bytes). Should get fixed later. Signed-off-by: David Brownell <dbr...@us...> diff --git a/src/target/arm11.c b/src/target/arm11.c index fd9b465..605e741 100644 --- a/src/target/arm11.c +++ b/src/target/arm11.c @@ -293,12 +293,11 @@ static int arm11_on_enter_debug_state(struct arm11_common *arm11) return ERROR_OK; } -/** Restore processor state - * - * This is called in preparation for the RESTART function. - * - */ -static int arm11_leave_debug_state(struct arm11_common *arm11) +/** + * Restore processor state. This is called in preparation for + * the RESTART function. + */ +static int arm11_leave_debug_state(struct arm11_common *arm11, bool bpwp) { int retval; @@ -354,7 +353,7 @@ static int arm11_leave_debug_state(struct arm11_common *arm11) /* restore CPSR, PC, and R0 ... after flushing any modified * registers. */ - retval = arm_dpm_write_dirty_registers(&arm11->dpm); + retval = arm_dpm_write_dirty_registers(&arm11->dpm, bpwp); register_cache_invalidate(arm11->arm.core_cache); @@ -598,7 +597,7 @@ static int arm11_resume(struct target *target, int current, arm11_sc7_set_vcr(arm11, arm11_vcr); } - arm11_leave_debug_state(arm11); + arm11_leave_debug_state(arm11, handle_breakpoints); arm11_add_IR(arm11, ARM11_RESTART, TAP_IDLE); @@ -762,7 +761,7 @@ static int arm11_step(struct target *target, int current, R(DSCR) |= ARM11_DSCR_INTERRUPTS_DISABLE; - CHECK_RETVAL(arm11_leave_debug_state(arm11)); + CHECK_RETVAL(arm11_leave_debug_state(arm11, handle_breakpoints)); arm11_add_IR(arm11, ARM11_RESTART, TAP_IDLE); @@ -1203,22 +1202,6 @@ static int arm11_remove_breakpoint(struct target *target, return ERROR_OK; } -static int arm11_add_watchpoint(struct target *target, - struct watchpoint *watchpoint) -{ - LOG_WARNING("Not implemented: %s", __func__); - - return ERROR_FAIL; -} - -static int arm11_remove_watchpoint(struct target *target, - struct watchpoint *watchpoint) -{ - LOG_WARNING("Not implemented: %s", __func__); - - return ERROR_FAIL; -} - static int arm11_target_create(struct target *target, Jim_Interp *interp) { struct arm11_common *arm11; @@ -1605,8 +1588,6 @@ struct target_type arm11_target = { .add_breakpoint = arm11_add_breakpoint, .remove_breakpoint = arm11_remove_breakpoint, - .add_watchpoint = arm11_add_watchpoint, - .remove_watchpoint = arm11_remove_watchpoint, .run_algorithm = armv4_5_run_algorithm, diff --git a/src/target/arm_dpm.c b/src/target/arm_dpm.c index 127f87b..f94fcc4 100644 --- a/src/target/arm_dpm.c +++ b/src/target/arm_dpm.c @@ -25,6 +25,8 @@ #include "arm_dpm.h" #include "jtag.h" #include "register.h" +#include "breakpoints.h" +#include "target_type.h" /** @@ -34,6 +36,8 @@ * implementation differences between cores like ARM1136 and Cortex-A8. */ +/*----------------------------------------------------------------------*/ + /* * Coprocessor support */ @@ -85,6 +89,8 @@ static int dpm_mcr(struct target *target, int cpnum, return retval; } +/*----------------------------------------------------------------------*/ + /* * Register access utilities */ @@ -178,7 +184,7 @@ static int dpm_write_reg(struct arm_dpm *dpm, struct reg *r, unsigned regnum) switch (regnum) { case 0 ... 14: - /* load register from DCC: "MCR p14, 0, Rnum, c0, c5, 0" */ + /* load register from DCC: "MRC p14, 0, Rnum, c0, c5, 0" */ retval = dpm->instr_write_data_dcc(dpm, ARMV4_5_MRC(14, 0, regnum, 0, 5, 0), value); @@ -256,6 +262,11 @@ int arm_dpm_read_current_registers(struct arm_dpm *dpm) /* NOTE: SPSR ignored (if it's even relevant). */ + /* REVISIT the debugger can trigger various exceptions. See the + * ARMv7A architecture spec, section C5.7, for more info about + * what defenses are needed; v6 debug has the most issues. + */ + fail: /* (void) */ dpm->finish(dpm); return retval; @@ -264,8 +275,11 @@ fail: /** * Writes all modified core registers for all processor modes. In normal * operation this is called on exit from halting debug state. + * + * @param bpwp: true ensures breakpoints and watchpoints are set, + * false ensures they are cleared */ -int arm_dpm_write_dirty_registers(struct arm_dpm *dpm) +int arm_dpm_write_dirty_registers(struct arm_dpm *dpm, bool bpwp) { struct arm *arm = dpm->arm; struct reg_cache *cache = arm->core_cache; @@ -276,6 +290,53 @@ int arm_dpm_write_dirty_registers(struct arm_dpm *dpm) if (retval != ERROR_OK) goto done; + /* enable/disable watchpoints */ + for (unsigned i = 0; i < dpm->nwp; i++) { + struct dpm_wp *dwp = dpm->dwp + i; + struct watchpoint *wp = dwp->wp; + bool disable; + + /* Avoid needless I/O ... leave watchpoints alone + * unless they're removed, or need updating because + * of single-stepping or running debugger code. + */ + if (!wp) { + if (!dwp->dirty) + continue; + dwp->dirty = false; + /* removed or startup; we must disable it */ + disable = true; + } else if (bpwp) { + if (!dwp->dirty) + continue; + /* disabled, but we must set it */ + dwp->dirty = disable = false; + wp->set = true; + } else { + if (!wp->set) + continue; + /* set, but we must temporarily disable it */ + dwp->dirty = disable = true; + wp->set = false; + } + + if (disable) + retval = dpm->bpwp_disable(dpm, 16 + i); + else + retval = dpm->bpwp_enable(dpm, 16 + i, + wp->address, dwp->control); + + if (retval != ERROR_OK) + LOG_ERROR("%s: can't %s HW watchpoint %d", + target_name(arm->target), + disable ? "disable" : "enable", + i); + } + + /* NOTE: writes to breakpoint and watchpoint registers might + * be queued, and need (efficient/batched) flushing later. + */ + /* Scan the registers until we find one that's both dirty and * eligible for flushing. Flush that and everything else that * shares the same core mode setting. Typically this won't @@ -399,6 +460,13 @@ static enum armv4_5_mode dpm_mapmode(struct arm *arm, return ARMV4_5_MODE_ANY; } + +/* + * Standard ARM register accessors ... there are three methods + * in "struct arm", to support individual read/write and bulk read + * of registers. + */ + static int arm_dpm_read_core_reg(struct target *target, struct reg *r, int regnum, enum armv4_5_mode mode) { @@ -544,9 +612,141 @@ done: return retval; } + +/*----------------------------------------------------------------------*/ + +/* + * Breakpoint and Watchpoint support. + * + * Hardware {break,watch}points are usually left active, to minimize + * debug entry/exit costs. When they are set or cleared, it's done in + * batches. Also, DPM-conformant hardware can update debug registers + * regardless of whether the CPU is running or halted ... though that + * fact isn't currently leveraged. + */ + +static int dpm_watchpoint_setup(struct arm_dpm *dpm, unsigned index, + struct watchpoint *wp) +{ + uint32_t addr = wp->address; + uint32_t control; + + /* this hardware doesn't support data value matching or masking */ + if (wp->value || wp->mask != ~(uint32_t)0) { + LOG_DEBUG("watchpoint values and masking not supported"); + return ERROR_TARGET_RESOURCE_NOT_AVAILABLE; + } + + control = (1 << 0) /* enable */ + | (3 << 1); /* both user and privileged access */ + + switch (wp->rw) { + case WPT_READ: + control |= 1 << 3; + break; + case WPT_WRITE: + control |= 2 << 3; + break; + case WPT_ACCESS: + control |= 3 << 3; + break; + } + + /* Match 1, 2, or all 4 byte addresses in this word. + * + * FIXME: v7 hardware allows lengths up to 2 GB, and has eight + * byte address select bits. Support larger wp->length, if addr + * is suitably aligned. + */ + switch (wp->length) { + case 1: + control |= (1 << (addr & 3)) << 5; + addr &= ~3; + break; + case 2: + /* require 2-byte alignment */ + if (!(addr & 1)) { + control |= (3 << (addr & 2)) << 5; + break; + } + /* FALL THROUGH */ + case 4: + /* require 4-byte alignment */ + if (!(addr & 3)) { + control |= 0xf << 5; + break; + } + /* FALL THROUGH */ + default: + LOG_DEBUG("bad watchpoint length or alignment"); + return ERROR_INVALID_ARGUMENTS; + } + + /* other control bits: + * bits 9:12 == 0 ... only checking up to four byte addresses (v7 only) + * bits 15:14 == 0 ... both secure and nonsecure states (v6.1+ only) + * bit 20 == 0 ... not linked to a context ID + * bit 28:24 == 0 ... not ignoring N LSBs (v7 only) + */ + + dpm->dwp[index].wp = wp; + dpm->dwp[index].control = control; + dpm->dwp[index].dirty = true; + + /* hardware is updated in write_dirty_registers() */ + return ERROR_OK; +} + + +static int dpm_add_watchpoint(struct target *target, struct watchpoint *wp) +{ + struct arm *arm = target_to_arm(target); + struct arm_dpm *dpm = arm->dpm; + int retval = ERROR_TARGET_RESOURCE_NOT_AVAILABLE; + + if (dpm->bpwp_enable) { + for (unsigned i = 0; i < dpm->nwp; i++) { + if (!dpm->dwp[i].wp) { + retval = dpm_watchpoint_setup(dpm, i, wp); + break; + } + } + } + + return retval; +} + +static int dpm_remove_watchpoint(struct target *target, struct watchpoint *wp) +{ + struct arm *arm = target_to_arm(target); + struct arm_dpm *dpm = arm->dpm; + int retval = ERROR_INVALID_ARGUMENTS; + + for (unsigned i = 0; i < dpm->nwp; i++) { + if (dpm->dwp[i].wp == wp) { + dpm->dwp[i].wp = NULL; + dpm->dwp[i].dirty = true; + + /* hardware is updated in write_dirty_registers() */ + retval = ERROR_OK; + break; + } + } + + return retval; +} + +/*----------------------------------------------------------------------*/ + +/* + * Setup and management support. + */ + /** * Hooks up this DPM to its associated target; call only once. * Initially this only covers the register cache. + * + * Oh, and watchpoints. Yeah. */ int arm_dpm_setup(struct arm_dpm *dpm) { @@ -556,6 +756,7 @@ int arm_dpm_setup(struct arm_dpm *dpm) arm->dpm = dpm; + /* register access setup */ arm->full_context = arm_dpm_full_context; arm->read_core_reg = arm_dpm_read_core_reg; arm->write_core_reg = arm_dpm_write_core_reg; @@ -566,9 +767,48 @@ int arm_dpm_setup(struct arm_dpm *dpm) *register_get_last_cache_p(&target->reg_cache) = cache; + /* coprocessor access setup */ arm->mrc = dpm_mrc; arm->mcr = dpm_mcr; + /* breakpoint and watchpoint setup */ + target->type->add_watchpoint = dpm_add_watchpoint; + target->type->remove_watchpoint = dpm_remove_watchpoint; + + /* FIXME add breakpoint support */ + /* FIXME add vector catch support */ + + dpm->nbp = 1 + ((dpm->didr >> 24) & 0xf); + dpm->dbp = calloc(dpm->nbp, sizeof *dpm->dbp); + + dpm->nwp = 1 + ((dpm->didr >> 28) & 0xf); + dpm->dwp = calloc(dpm->nwp, sizeof *dpm->dwp); + + if (!dpm->dbp || !dpm->dwp) { + free(dpm->dbp); + free(dpm->dwp); + return ERROR_FAIL; + } + + /* Disable all breakpoints and watchpoints at startup. */ + if (dpm->bpwp_disable) { + unsigned i; + + for (i = 0; i < dpm->nbp; i++) + (void) dpm->bpwp_disable(dpm, i); + for (i = 0; i < dpm->nwp; i++) + (void) dpm->bpwp_disable(dpm, 16 + i); + } else + LOG_WARNING("%s: can't disable breakpoints and watchpoints", + target_name(target)); + + LOG_INFO("%s: hardware has %d breakpoints, %d watchpoints", + target_name(target), dpm->nbp, dpm->nwp); + + /* REVISIT ... and some of those breakpoints could match + * execution context IDs... + */ + return ERROR_OK; } diff --git a/src/target/arm_dpm.h b/src/target/arm_dpm.h index 67ce218..5d665a8 100644 --- a/src/target/arm_dpm.h +++ b/src/target/arm_dpm.h @@ -31,6 +31,26 @@ * registers are compatible. */ +struct dpm_bp { + struct breakpoint *bp; + /* bp->address == breakpoint value register + * control == breakpoint control register + */ + uint32_t control; + /* true if hardware state needs flushing */ + bool dirty; +}; + +struct dpm_wp { + struct watchpoint *wp; + /* wp->address == watchpoint value register + * control == watchpoint control register + */ + uint32_t control; + /* true if hardware state needs flushing */ + bool dirty; +}; + /** * This wraps an implementation of DPM primitives. Each interface * provider supplies a structure like this, which is the glue between @@ -74,9 +94,33 @@ struct arm_dpm { int (*instr_read_data_r0)(struct arm_dpm *, uint32_t opcode, uint32_t *data); - // FIXME -- add breakpoint support - - // FIXME -- add watchpoint support (including context-sensitive ones) + /* BREAKPOINT/WATCHPOINT SUPPORT */ + + /** + * Enables one breakpoint or watchpoint by writing to the + * hardware registers. The specified breakpoint/watchpoint + * must currently be disabled. Indices 0..15 are used for + * breakpoints; indices 16..31 are for watchpoints. + */ + int (*bpwp_enable)(struct arm_dpm *, unsigned index, + uint32_t addr, uint32_t control); + + /** + * Disables one breakpoint or watchpoint by clearing its + * hardware control registers. Indices are the same ones + * accepted by bpwp_enable(). + */ + int (*bpwp_disable)(struct arm_dpm *, unsigned index); + + /* The breakpoint and watchpoint arrays are private to the + * DPM infrastructure. There are nbp indices in the dbp + * array. There are nwp indices in the dwp array. + */ + + unsigned nbp; + unsigned nwp; + struct dpm_bp *dbp; + struct dpm_wp *dwp; // FIXME -- read/write DCSR methods and symbols }; @@ -85,6 +129,6 @@ int arm_dpm_setup(struct arm_dpm *dpm); int arm_dpm_reinitialize(struct arm_dpm *dpm); int arm_dpm_read_current_registers(struct arm_dpm *); -int arm_dpm_write_dirty_registers(struct arm_dpm *); +int arm_dpm_write_dirty_registers(struct arm_dpm *, bool bpwp); #endif /* __ARM_DPM_H */ diff --git a/src/target/cortex_a8.c b/src/target/cortex_a8.c index e312e54..81402d7 100644 --- a/src/target/cortex_a8.c +++ b/src/target/cortex_a8.c @@ -41,7 +41,7 @@ static int cortex_a8_poll(struct target *target); static int cortex_a8_debug_entry(struct target *target); -static int cortex_a8_restore_context(struct target *target); +static int cortex_a8_restore_context(struct target *target, bool bpwp); static int cortex_a8_set_breakpoint(struct target *target, struct breakpoint *breakpoint, uint8_t matchmode); static int cortex_a8_unset_breakpoint(struct target *target, @@ -602,11 +602,7 @@ static int cortex_a8_resume(struct target *target, int current, dap_ap_select(swjdp, swjdp_debugap); if (!debug_execution) - { target_free_all_working_areas(target); -// cortex_m3_enable_breakpoints(target); -// cortex_m3_enable_watchpoints(target); - } #if 0 if (debug_execution) @@ -661,7 +657,7 @@ static int cortex_a8_resume(struct target *target, int current, armv4_5->core_cache->reg_list[15].dirty = 1; armv4_5->core_cache->reg_list[15].valid = 1; - cortex_a8_restore_context(target); + cortex_a8_restore_context(target, handle_breakpoints); #if 0 /* the front-end may request us not to handle breakpoints */ @@ -952,7 +948,7 @@ static int cortex_a8_step(struct target *target, int current, uint32_t address, return ERROR_OK; } -static int cortex_a8_restore_context(struct target *target) +static int cortex_a8_restore_context(struct target *target, bool bpwp) { struct armv7a_common *armv7a = target_to_armv7a(target); @@ -961,7 +957,7 @@ static int cortex_a8_restore_context(struct target *target) if (armv7a->pre_restore_context) armv7a->pre_restore_context(target); - arm_dpm_write_dirty_registers(&armv7a->dpm); + arm_dpm_write_dirty_registers(&armv7a->dpm, bpwp); if (armv7a->post_restore_context) armv7a->post_restore_context(target); commit 1c7d3d200c6f20d4bb689176373368cd497d797f Author: David Brownell <dbr...@us...> Date: Tue Dec 1 20:39:58 2009 -0800 ARMv7a: move constants out of Cortex-A8 header These are architecturally defined, not core-specific. Signed-off-by: David Brownell <dbr...@us...> diff --git a/src/target/armv7a.h b/src/target/armv7a.h index ee0d2ac..6ccf3e2 100644 --- a/src/target/armv7a.h +++ b/src/target/armv7a.h @@ -77,6 +77,53 @@ target_to_armv7a(struct target *target) armv4_5_common); } +/* register offsets from armv7a.debug_base */ + +/* See ARMv7a arch spec section C10.2 */ +#define CPUDBG_DIDR 0x000 + +/* See ARMv7a arch spec section C10.3 */ +#define CPUDBG_WFAR 0x018 +/* PCSR at 0x084 -or- 0x0a0 -or- both ... based on flags in DIDR */ +#define CPUDBG_DSCR 0x088 +#define CPUDBG_DRCR 0x090 +#define CPUDBG_PRCR 0x310 +#define CPUDBG_PRSR 0x314 + +/* See ARMv7a arch spec section C10.4 */ +#define CPUDBG_DTRRX 0x080 +#define CPUDBG_ITR 0x084 +#define CPUDBG_DTRTX 0x08c + +/* See ARMv7a arch spec section C10.5 */ +#define CPUDBG_BVR_BASE 0x100 +#define CPUDBG_BCR_BASE 0x140 +#define CPUDBG_WVR_BASE 0x180 +#define CPUDBG_WCR_BASE 0x1C0 +#define CPUDBG_VCR 0x01C + +/* See ARMv7a arch spec section C10.6 */ +#define CPUDBG_OSLAR 0x300 +#define CPUDBG_OSLSR 0x304 +#define CPUDBG_OSSRR 0x308 +#define CPUDBG_ECR 0x024 + +/* See ARMv7a arch spec section C10.7 */ +#define CPUDBG_DSCCR 0x028 + +/* See ARMv7a arch spec section C10.8 */ +#define CPUDBG_AUTHSTATUS 0xFB8 + +/* DSCR bit numbers (See ARMv7a arch spec section 12.4.5) */ +#define DSCR_CORE_HALTED 0 +#define DSCR_CORE_RESTARTED 1 +#define DSCR_EXT_INT_EN 13 +#define DSCR_HALT_DBG_MODE 14 +#define DSCR_MON_DBG_MODE 15 +#define DSCR_INSTR_COMP 24 +#define DSCR_DTR_TX_FULL 29 +#define DSCR_DTR_RX_FULL 30 + struct armv7a_algorithm { int common_magic; diff --git a/src/target/cortex_a8.h b/src/target/cortex_a8.h index 1cb0e57..3b2c8b1 100644 --- a/src/target/cortex_a8.h +++ b/src/target/cortex_a8.h @@ -35,50 +35,16 @@ extern char* cortex_a8_state_strings[]; #define CORTEX_A8_COMMON_MAGIC 0x411fc082 -#define CPUID 0x54011D00 -/* Debug Control Block */ -#define CPUDBG_DIDR 0x000 -#define CPUDBG_WFAR 0x018 -#define CPUDBG_VCR 0x01C -#define CPUDBG_ECR 0x024 -#define CPUDBG_DSCCR 0x028 -#define CPUDBG_DTRRX 0x080 -#define CPUDBG_ITR 0x084 -#define CPUDBG_DSCR 0x088 -#define CPUDBG_DTRTX 0x08c -#define CPUDBG_DRCR 0x090 -#define CPUDBG_BVR_BASE 0x100 -#define CPUDBG_BCR_BASE 0x140 -#define CPUDBG_WVR_BASE 0x180 -#define CPUDBG_WCR_BASE 0x1C0 - -#define CPUDBG_OSLAR 0x300 -#define CPUDBG_OSLSR 0x304 -#define CPUDBG_OSSRR 0x308 - -#define CPUDBG_PRCR 0x310 -#define CPUDBG_PRSR 0x314 - +/* See Cortex-A8 TRM section 12.5 */ #define CPUDBG_CPUID 0xD00 #define CPUDBG_CTYPR 0xD04 #define CPUDBG_TTYPR 0xD0C #define CPUDBG_LOCKACCESS 0xFB0 #define CPUDBG_LOCKSTATUS 0xFB4 -#define CPUDBG_AUTHSTATUS 0xFB8 #define BRP_NORMAL 0 #define BRP_CONTEXT 1 -/* DSCR Bit offset */ -#define DSCR_CORE_HALTED 0 -#define DSCR_CORE_RESTARTED 1 -#define DSCR_EXT_INT_EN 13 -#define DSCR_HALT_DBG_MODE 14 -#define DSCR_MON_DBG_MODE 15 -#define DSCR_INSTR_COMP 24 -#define DSCR_DTR_TX_FULL 29 -#define DSCR_DTR_RX_FULL 30 - struct cortex_a8_brp { int used; ----------------------------------------------------------------------- Summary of changes: src/target/arm11.c | 35 ++------ src/target/arm_dpm.c | 244 +++++++++++++++++++++++++++++++++++++++++++++++- src/target/arm_dpm.h | 52 ++++++++++- src/target/armv7a.h | 47 +++++++++ src/target/cortex_a8.c | 78 ++++++++++++++-- src/target/cortex_a8.h | 36 +------- 6 files changed, 416 insertions(+), 76 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: David B. <dbr...@us...> - 2009-12-01 10:11:18
|
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 a65e75ea34153a8d0a0fe0b07497ad75c5726ab6 (commit) from 48edd58c3941c562a5a7ea78432a28e72108bbe4 (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 a65e75ea34153a8d0a0fe0b07497ad75c5726ab6 Author: David Brownell <dbr...@us...> Date: Tue Dec 1 01:09:10 2009 -0800 Tcl and doc: update to match new 'arm mcr ...' etc Make them match the C code. Signed-off-by: David Brownell <dbr...@us...> diff --git a/NEWS b/NEWS index b7eb0f0..1af1331 100644 --- a/NEWS +++ b/NEWS @@ -15,6 +15,8 @@ Target Layer: - recognize TrustZone "Secure Monitor" mode - "arm regs" command output changed - register names use "sp" not "r13" + - add top-level "mcr" and "mrc" commands, replacing + various core-specific operations ARM11 - Preliminary ETM and ETB hookup - accelerated "flash erase_check" diff --git a/doc/openocd.texi b/doc/openocd.texi index ea30092..7e23211 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -1524,7 +1524,7 @@ proc setc15 @{regs value@} @{ echo [format "set p15 0x%04x, 0x%08x" $regs $value] - mcr 15 [expr ($regs>>12)&0x7] \ + arm mcr 15 [expr ($regs>>12)&0x7] \ [expr ($regs>>0)&0xf] [expr ($regs>>4)&0xf] \ [expr ($regs>>8)&0x7] $value @} @@ -5609,6 +5609,24 @@ with a handful of exceptions. ThumbEE disassembly currently has no explicit support. @end deffn +@deffn Command {arm mcr} pX op1 CRn CRm op2 value +Write @var{value} to a coprocessor @var{pX} register +passing parameters @var{CRn}, +@var{CRm}, opcodes @var{opc1} and @var{opc2}, +and using the MCR instruction. +(Parameter sequence matches the ARM instruction, but omits +an ARM register.) +@end deffn + +@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. +Returns the result so it can be manipulated by Jim scripts. +(Parameter sequence matches the ARM instruction, but omits +an ARM register.) +@end deffn + @deffn Command {arm reg} Display a table of all banked core registers, fetching the current value from every core mode if necessary. diff --git a/tcl/board/csb732.cfg b/tcl/board/csb732.cfg index 9022faf..cad38e2 100644 --- a/tcl/board/csb732.cfg +++ b/tcl/board/csb732.cfg @@ -19,13 +19,13 @@ proc csb732_init { } { # We assume the interpreter latency is enough. # Allow access to all coprocessors - mcr 15 0 15 1 0 0x2001 + arm mcr 15 0 15 1 0 0x2001 # Disable MMU, caches, write buffer - mcr 15 0 1 0 0 0x78 + arm mcr 15 0 1 0 0 0x78 # Grant manager access to all domains - mcr 15 0 3 0 0 0xFFFFFFFF + arm mcr 15 0 3 0 0 0xFFFFFFFF # Set ARM clock to 532 MHz, AHB to 133 MHz mww 0x53F80004 0x1000 diff --git a/tcl/board/dm355evm.cfg b/tcl/board/dm355evm.cfg index 2c8bea8..db47b8d 100644 --- a/tcl/board/dm355evm.cfg +++ b/tcl/board/dm355evm.cfg @@ -182,7 +182,7 @@ proc dm355evm_init {} { ######################## # turn on icache - set I bit in cp15 register c1 - mcr 15 0 0 1 0 0x00051078 + arm mcr 15 0 0 1 0 0x00051078 } # NAND -- socket has two chipselects, MT29F16G08FAA puts 1GByte on each one. diff --git a/tcl/board/openrd.cfg b/tcl/board/openrd.cfg index 12cc79e..6371eff 100644 --- a/tcl/board/openrd.cfg +++ b/tcl/board/openrd.cfg @@ -29,7 +29,7 @@ proc openrd_init { } { jtag_reset 0 0 wait_halt - mcr 15 0 0 1 0 0x00052078 + arm mcr 15 0 0 1 0 0x00052078 mww 0xD0001400 0x43000C30 # DDR SDRAM Configuration Register mww 0xD0001404 0x37543000 # Dunit Control Low Register diff --git a/tcl/board/sheevaplug.cfg b/tcl/board/sheevaplug.cfg index 9267eb9..b843213 100644 --- a/tcl/board/sheevaplug.cfg +++ b/tcl/board/sheevaplug.cfg @@ -29,7 +29,7 @@ proc sheevaplug_init { } { jtag_reset 0 0 wait_halt - mcr 15 0 0 1 0 0x00052078 + arm mcr 15 0 0 1 0 0x00052078 mww 0xD0001400 0x43000C30 # DDR SDRAM Configuration Register mww 0xD0001404 0x39543000 # Dunit Control Low Register diff --git a/tcl/target/c100helper.tcl b/tcl/target/c100helper.tcl index 54fe07f..9658871 100644 --- a/tcl/target/c100helper.tcl +++ b/tcl/target/c100helper.tcl @@ -436,22 +436,22 @@ proc initC100 {} { # */ # mov r0, #0 # mcr p15, 0, r0, c7, c7, 0 /* flush v3/v4 cache */ - mcr 15 0 7 7 0 0x0 + arm mcr 15 0 7 7 0 0x0 # mcr p15, 0, r0, c8, c7, 0 /* flush v4 TLB */ - mcr 15 0 8 7 0 0x0 + arm mcr 15 0 8 7 0 0x0 # /* # * disable MMU stuff and caches # */ # mrc p15, 0, r0, c1, c0, 0 - mrc 15 0 1 0 0 + arm mrc 15 0 1 0 0 # bic r0, r0, #0x00002300 @ clear bits 13, 9:8 (--V- --RS) # bic r0, r0, #0x00000087 @ clear bits 7, 2:0 (B--- -CAM) # orr r0, r0, #0x00000002 @ set bit 2 (A) Align # orr r0, r0, #0x00001000 @ set bit 12 (I) I-Cache # orr r0, r0, #0x00400000 @ set bit 22 (U) # mcr p15, 0, r0, c1, c0, 0 - mcr 15 0 1 0 0 0x401002 + arm mcr 15 0 1 0 0 0x401002 # This is from bsp_init() in u-boot/boards/mindspeed/ooma-darwin/board.c # APB init # // Setting APB Bus Wait states to 1, set post write diff --git a/tcl/target/imx.cfg b/tcl/target/imx.cfg index bfcc652..547ec56 100644 --- a/tcl/target/imx.cfg +++ b/tcl/target/imx.cfg @@ -10,7 +10,7 @@ proc setc15 {regs value} { echo [format "set p15 0x%04x, 0x%08x" $regs $value] - mcr 15 [expr ($regs>>12)&0x7] [expr ($regs>>0)&0xf] [expr ($regs>>4)&0xf] [expr ($regs>>8)&0x7] $value + arm mcr 15 [expr ($regs>>12)&0x7] [expr ($regs>>0)&0xf] [expr ($regs>>4)&0xf] [expr ($regs>>8)&0x7] $value } ----------------------------------------------------------------------- Summary of changes: NEWS | 2 ++ doc/openocd.texi | 20 +++++++++++++++++++- tcl/board/csb732.cfg | 6 +++--- tcl/board/dm355evm.cfg | 2 +- tcl/board/openrd.cfg | 2 +- tcl/board/sheevaplug.cfg | 2 +- tcl/target/c100helper.tcl | 8 ++++---- tcl/target/imx.cfg | 2 +- 8 files changed, 32 insertions(+), 12 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: Øyvind H. <go...@us...> - 2009-12-01 10:09: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 48edd58c3941c562a5a7ea78432a28e72108bbe4 (commit) from 445da543d8db868466dcef7e23f75b3c2b54bc72 (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 48edd58c3941c562a5a7ea78432a28e72108bbe4 Author: Ãyvind Harboe <oyv...@zy...> Date: Tue Dec 1 10:03:15 2009 +0100 target: at91eb40a.cfg is a board, not a target. Also updated to use target name when creating flash and set jtag_khz to 16000. Signed-off-by: Ãyvind Harboe <oyv...@zy...> diff --git a/tcl/target/at91eb40a.cfg b/tcl/board/at91eb40a.cfg similarity index 92% rename from tcl/target/at91eb40a.cfg rename to tcl/board/at91eb40a.cfg index e78ccea..62d3c9c 100644 --- a/tcl/target/at91eb40a.cfg +++ b/tcl/board/at91eb40a.cfg @@ -43,7 +43,7 @@ arm7_9 dcc_downloads enable #flash driver set _FLASHNAME $_CHIPNAME.flash -flash bank $_FLASHNAME ecosflash 0x01000000 0x200000 2 2 0 ecos/at91eb40a.elf +flash bank $_FLASHNAME ecosflash 0x01000000 0x200000 2 2 $_TARGETNAME ecos/at91eb40a.elf # required for usable performance. Used for lots of # other things than flash programming. @@ -60,3 +60,6 @@ $_TARGETNAME configure -event reset-init { mww 0xffff0010 0x100 mww 0xffff0034 0x100 } + +# This target is pretty snappy... +jtag_khz 16000 ----------------------------------------------------------------------- Summary of changes: tcl/{target => board}/at91eb40a.cfg | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) rename tcl/{target => board}/at91eb40a.cfg (92%) hooks/post-receive -- Main OpenOCD repository |
From: Øyvind H. <go...@us...> - 2009-12-01 09:56:14
|
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 445da543d8db868466dcef7e23f75b3c2b54bc72 (commit) via 5576a6240a103879e1a8d9d4c2b6ff4aee0d23fa (commit) from 63dc352876259562948b5d814de197ba534897b9 (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 445da543d8db868466dcef7e23f75b3c2b54bc72 Author: Ãyvind Harboe <oyv...@zy...> Date: Tue Dec 1 08:42:53 2009 +0100 zy1000: keep up with latest changes to command handling Keep up with Jim Tcl interpreter creation cleanup. Signed-off-by: Ãyvind Harboe <oyv...@zy...> diff --git a/src/ecosboard.c b/src/ecosboard.c index 5588934..36e807e 100644 --- a/src/ecosboard.c +++ b/src/ecosboard.c @@ -80,6 +80,7 @@ #include <unistd.h> #include <stdio.h> +#include <openocd.h> #ifdef CYGPKG_HAL_NIOS2 #define ZY1000_SER_DEV "/dev/uart_0" @@ -505,8 +506,6 @@ static void zylinjtag_startNetwork(void) cyg_httpd_init_tcl_interpreter(); - interp = httpstate.jim_interp; - Jim_CreateCommand(httpstate.jim_interp, "log", zylinjtag_Jim_Command_log, NULL, NULL); Jim_CreateCommand(httpstate.jim_interp, "zy1000_reboot", @@ -933,8 +932,6 @@ bool logAllToSerial = false; int boolParam(char *var); -struct command_context *setup_command_handler(void); - static const char *zylin_config_dir="/config/settings"; static int add_default_dirs(void) @@ -1078,7 +1075,8 @@ int main(int argc, char *argv[]) /* initialize commandline interface */ struct command_context * cmd_ctx; - cmd_ctx = setup_command_handler(); + struct command_context *setup_command_handler(Jim_Interp *interp); + cmd_ctx = setup_command_handler(httpstate.jim_interp); command_set_output_handler(cmd_ctx, configuration_output_handler, NULL); command_context_mode(cmd_ctx, COMMAND_CONFIG); @@ -1095,7 +1093,7 @@ int main(int argc, char *argv[]) COMMAND_ANY, NULL); #endif - Jim_CreateCommand(interp, "uart", zylinjtag_Jim_Command_uart, NULL, NULL); + Jim_CreateCommand(httpstate.jim_interp, "uart", zylinjtag_Jim_Command_uart, NULL, NULL); log_init(); diff --git a/src/jtag/zy1000/zy1000.c b/src/jtag/zy1000/zy1000.c index 115b3be..07d840f 100644 --- a/src/jtag/zy1000/zy1000.c +++ b/src/jtag/zy1000/zy1000.c @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2007-2008 by Ãyvind Harboe * + * Copyright (C) 2007-2009 by Ãyvind Harboe * * * * 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 * commit 5576a6240a103879e1a8d9d4c2b6ff4aee0d23fa Author: Ãyvind Harboe <oyv...@zy...> Date: Tue Dec 1 08:41:41 2009 +0100 command: the Jim interpreter can now be provided rather than created In embedded hosts, the Jim interpreter can come from the existing context rather than be created by OpenOCD. Signed-off-by: Ãyvind Harboe <oyv...@zy...> diff --git a/src/helper/command.c b/src/helper/command.c index dcad6a1..d657668 100644 --- a/src/helper/command.c +++ b/src/helper/command.c @@ -1272,7 +1272,7 @@ static const struct command_registration command_builtin_handlers[] = { COMMAND_REGISTRATION_DONE }; -struct command_context* command_init(const char *startup_tcl) +struct command_context* command_init(const char *startup_tcl, Jim_Interp *interp) { struct command_context* context = malloc(sizeof(struct command_context)); const char *HostOs; @@ -1284,14 +1284,18 @@ struct command_context* command_init(const char *startup_tcl) context->output_handler_priv = NULL; #if !BUILD_ECOSBOARD - Jim_InitEmbedded(); - /* Create an interpreter */ - context->interp = Jim_CreateInterp(); - /* Add all the Jim core commands */ - Jim_RegisterCoreCommands(context->interp); + /* Create a jim interpreter if we were not handed one */ + if (interp == NULL) + { + Jim_InitEmbedded(); + /* Create an interpreter */ + interp = Jim_CreateInterp(); + /* Add all the Jim core commands */ + Jim_RegisterCoreCommands(interp); + } #endif + context->interp = interp; - Jim_Interp *interp = context->interp; #if defined(_MSC_VER) /* WinXX - is generic, the forward * looking problem is this: diff --git a/src/helper/command.h b/src/helper/command.h index 611db87..8d68c18 100644 --- a/src/helper/command.h +++ b/src/helper/command.h @@ -323,9 +323,11 @@ void command_set_output_handler(struct command_context* context, int command_context_mode(struct command_context *context, enum command_mode mode); /** - * Creates a new command context using the startup TCL provided. + * Creates a new command context using the startup TCL provided and + * the existing Jim interpreter, if any. If interp == NULL, then command_init + * creates a command interpreter. */ -struct command_context* command_init(const char *startup_tcl); +struct command_context* command_init(const char *startup_tcl, Jim_Interp *interp); /** * Creates a copy of an existing command context. This does not create * a deep copy of the command list, so modifications in one context will diff --git a/src/openocd.c b/src/openocd.c index 22d4582..44e0292 100644 --- a/src/openocd.c +++ b/src/openocd.c @@ -188,14 +188,14 @@ static const struct command_registration openocd_command_handlers[] = { struct command_context *global_cmd_ctx; /* NB! this fn can be invoked outside this file for non PC hosted builds */ -struct command_context *setup_command_handler(void) +struct command_context *setup_command_handler(Jim_Interp *interp) { log_init(); LOG_DEBUG("log_init: complete"); struct command_context *cmd_ctx; - global_cmd_ctx = cmd_ctx = command_init(openocd_startup_tcl); + global_cmd_ctx = cmd_ctx = command_init(openocd_startup_tcl, interp); register_commands(cmd_ctx, NULL, openocd_command_handlers); /* register subsystem commands */ @@ -242,7 +242,7 @@ int openocd_main(int argc, char *argv[]) /* initialize commandline interface */ struct command_context *cmd_ctx; - cmd_ctx = setup_command_handler(); + cmd_ctx = setup_command_handler(NULL); #if BUILD_IOUTIL if (ioutil_init(cmd_ctx) != ERROR_OK) ----------------------------------------------------------------------- Summary of changes: src/ecosboard.c | 10 ++++------ src/helper/command.c | 18 +++++++++++------- src/helper/command.h | 6 ++++-- src/jtag/zy1000/zy1000.c | 2 +- src/openocd.c | 6 +++--- 5 files changed, 23 insertions(+), 19 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: David B. <dbr...@us...> - 2009-12-01 09:50: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 63dc352876259562948b5d814de197ba534897b9 (commit) via 5949a3b3a55d987008b63b80af42c08601babb75 (commit) via 563d937c3c6a7080998baa2313d66ae184b820ac (commit) via 177bbd8891ae737ea7f8c0791a6236f72cedee40 (commit) via 209a0197f0c79442a2314199170a957c36c0ddb6 (commit) via fb984a477d526b742855bfe0ab07f4dced3b9323 (commit) from 51e9b25c9ae3478989940f925a36d78364d88764 (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 63dc352876259562948b5d814de197ba534897b9 Author: David Brownell <dbr...@us...> Date: Tue Dec 1 00:49:16 2009 -0800 ARM11: remove previous mcr()/mrc() methods We don't need this code, now that the DPM code handles it. Signed-off-by: David Brownell <dbr...@us...> diff --git a/src/target/arm11.c b/src/target/arm11.c index 30dbedb..fd9b465 100644 --- a/src/target/arm11.c +++ b/src/target/arm11.c @@ -1219,13 +1219,6 @@ static int arm11_remove_watchpoint(struct target *target, return ERROR_FAIL; } -static int arm11_mrc(struct target *target, int cpnum, - uint32_t op1, uint32_t op2, - uint32_t CRn, uint32_t CRm, uint32_t *value); -static int arm11_mcr(struct target *target, int cpnum, - uint32_t op1, uint32_t op2, uint32_t CRn, - uint32_t CRm, uint32_t value); - static int arm11_target_create(struct target *target, Jim_Interp *interp) { struct arm11_common *arm11; @@ -1245,9 +1238,6 @@ static int arm11_target_create(struct target *target, Jim_Interp *interp) armv4_5_init_arch_info(target, &arm11->arm); - arm11->arm.mrc = arm11_mrc; - arm11->arm.mcr = arm11_mcr; - arm11->target = target; arm11->jtag_info.tap = target->tap; @@ -1520,71 +1510,6 @@ COMMAND_HANDLER(arm11_handle_vcr) return ERROR_OK; } -static const uint32_t arm11_coproc_instruction_limits[] = -{ - 15, /* coprocessor */ - 7, /* opcode 1 */ - 15, /* CRn */ - 15, /* CRm */ - 7, /* opcode 2 */ - 0xFFFFFFFF, /* value */ -}; - -static int arm11_mrc_inner(struct target *target, int cpnum, - uint32_t op1, uint32_t op2, uint32_t CRn, uint32_t CRm, - uint32_t *value, bool read) -{ - int retval; - struct arm11_common *arm11 = target_to_arm11(target); - - if (target->state != TARGET_HALTED) - { - LOG_ERROR("Target not halted"); - return ERROR_FAIL; - } - - uint32_t instr = 0xEE000010 | - (cpnum << 8) | - (op1 << 21) | - (CRn << 16) | - (CRm << 0) | - (op2 << 5); - - if (read) - instr |= 0x00100000; - - retval = arm11_run_instr_data_prepare(arm11); - if (retval != ERROR_OK) - return retval; - - if (read) - { - retval = arm11_run_instr_data_from_core_via_r0(arm11, instr, value); - if (retval != ERROR_OK) - return retval; - } - else - { - retval = arm11_run_instr_data_to_core_via_r0(arm11, instr, *value); - if (retval != ERROR_OK) - return retval; - } - - return arm11_run_instr_data_finish(arm11); -} - -static int arm11_mrc(struct target *target, int cpnum, - uint32_t op1, uint32_t op2, uint32_t CRn, uint32_t CRm, uint32_t *value) -{ - return arm11_mrc_inner(target, cpnum, op1, op2, CRn, CRm, value, true); -} - -static int arm11_mcr(struct target *target, int cpnum, - uint32_t op1, uint32_t op2, uint32_t CRn, uint32_t CRm, uint32_t value) -{ - return arm11_mrc_inner(target, cpnum, op1, op2, CRn, CRm, &value, false); -} - static const struct command_registration arm11_mw_command_handlers[] = { { .name = "burst", commit 5949a3b3a55d987008b63b80af42c08601babb75 Author: David Brownell <dbr...@us...> Date: Tue Dec 1 00:49:11 2009 -0800 Cortex-A8: remove previous mcr()/mrc() methods We don't need this code, now that the DPM code handles it. Neither do we need the ARMv7-A CP15 operations; remove their remnants too. And disable a mostly-needless diagnostic. Signed-off-by: David Brownell <dbr...@us...> diff --git a/src/target/armv7a.h b/src/target/armv7a.h index f843f03..ee0d2ac 100644 --- a/src/target/armv7a.h +++ b/src/target/armv7a.h @@ -62,13 +62,6 @@ struct armv7a_common /* Cache and Memory Management Unit */ struct armv4_5_mmu_common armv4_5_mmu; - int (*read_cp15)(struct target *target, - uint32_t op1, uint32_t op2, - uint32_t CRn, uint32_t CRm, uint32_t *value); - int (*write_cp15)(struct target *target, - uint32_t op1, uint32_t op2, - uint32_t CRn, uint32_t CRm, uint32_t value); - int (*examine_debug_reason)(struct target *target); void (*post_debug_entry)(struct target *target); diff --git a/src/target/cortex_a8.c b/src/target/cortex_a8.c index 9ce6b2b..e312e54 100644 --- a/src/target/cortex_a8.c +++ b/src/target/cortex_a8.c @@ -159,97 +159,6 @@ static int cortex_a8_read_regs_through_mem(struct target *target, uint32_t addre return retval; } -static int cortex_a8_read_cp(struct target *target, uint32_t *value, uint8_t CP, - uint8_t op1, uint8_t CRn, uint8_t CRm, uint8_t op2) -{ - int retval; - struct armv7a_common *armv7a = target_to_armv7a(target); - struct swjdp_common *swjdp = &armv7a->swjdp_info; - uint32_t dscr = 0; - - /* MRC(...) to read coprocessor register into r0 */ - cortex_a8_exec_opcode(target, ARMV4_5_MRC(CP, op1, 0, CRn, CRm, op2), - &dscr); - - /* Move R0 to DTRTX */ - cortex_a8_exec_opcode(target, ARMV4_5_MCR(14, 0, 0, 0, 5, 0), - &dscr); - - /* Read DCCTX */ - retval = mem_ap_read_atomic_u32(swjdp, - armv7a->debug_base + CPUDBG_DTRTX, value); - - return retval; -} - -static int cortex_a8_write_cp(struct target *target, uint32_t value, - uint8_t CP, uint8_t op1, uint8_t CRn, uint8_t CRm, uint8_t op2) -{ - int retval; - uint32_t dscr; - struct armv7a_common *armv7a = target_to_armv7a(target); - struct swjdp_common *swjdp = &armv7a->swjdp_info; - - LOG_DEBUG("CP%i, CRn %i, value 0x%08" PRIx32, CP, CRn, value); - - /* Check that DCCRX is not full */ - retval = mem_ap_read_atomic_u32(swjdp, - armv7a->debug_base + CPUDBG_DSCR, &dscr); - if (dscr & (1 << DSCR_DTR_RX_FULL)) - { - LOG_ERROR("DSCR_DTR_RX_FULL, dscr 0x%08" PRIx32, dscr); - /* Clear DCCRX with MCR(p14, 0, Rd, c0, c5, 0), opcode 0xEE000E15 */ - cortex_a8_exec_opcode(target, ARMV4_5_MRC(14, 0, 0, 0, 5, 0), - &dscr); - } - - /* Write DTRRX ... sets DSCR.DTRRXfull but exec_opcode() won't care */ - retval = mem_ap_write_u32(swjdp, - armv7a->debug_base + CPUDBG_DTRRX, value); - - /* Move DTRRX to r0 */ - cortex_a8_exec_opcode(target, ARMV4_5_MRC(14, 0, 0, 0, 5, 0), &dscr); - - /* MCR(...) to write r0 to coprocessor */ - return cortex_a8_exec_opcode(target, - ARMV4_5_MCR(CP, op1, 0, CRn, CRm, op2), - &dscr); -} - -static int cortex_a8_read_cp15(struct target *target, uint32_t op1, uint32_t op2, - uint32_t CRn, uint32_t CRm, uint32_t *value) -{ - return cortex_a8_read_cp(target, value, 15, op1, CRn, CRm, op2); -} - -static int cortex_a8_write_cp15(struct target *target, uint32_t op1, uint32_t op2, - uint32_t CRn, uint32_t CRm, uint32_t value) -{ - return cortex_a8_write_cp(target, value, 15, op1, CRn, CRm, op2); -} - -static int cortex_a8_mrc(struct target *target, int cpnum, uint32_t op1, uint32_t op2, uint32_t CRn, uint32_t CRm, uint32_t *value) -{ - if (cpnum!=15) - { - LOG_ERROR("Only cp15 is supported"); - return ERROR_FAIL; - } - return cortex_a8_read_cp15(target, op1, op2, CRn, CRm, value); -} - -static int cortex_a8_mcr(struct target *target, int cpnum, uint32_t op1, uint32_t op2, uint32_t CRn, uint32_t CRm, uint32_t value) -{ - if (cpnum!=15) - { - LOG_ERROR("Only cp15 is supported"); - return ERROR_FAIL; - } - return cortex_a8_write_cp15(target, op1, op2, CRn, CRm, value); -} - - - static int cortex_a8_dap_read_coreregister_u32(struct target *target, uint32_t *value, int regnum) { @@ -421,7 +330,7 @@ static int cortex_a8_read_dcc(struct cortex_a8_common *a8, uint32_t *data, retval = mem_ap_read_atomic_u32(swjdp, a8->armv7a_common.debug_base + CPUDBG_DTRTX, data); - LOG_DEBUG("read DCC 0x%08" PRIx32, *data); + //LOG_DEBUG("read DCC 0x%08" PRIx32, *data); if (dscr_p) *dscr_p = dscr; @@ -1612,9 +1521,6 @@ static int cortex_a8_init_arch_info(struct target *target, cortex_a8->common_magic = CORTEX_A8_COMMON_MAGIC; armv4_5->arch_info = armv7a; - armv4_5->mrc = cortex_a8_mrc, - armv4_5->mcr = cortex_a8_mcr, - /* prepare JTAG information for the new target */ cortex_a8->jtag_info.tap = tap; cortex_a8->jtag_info.scann_size = 4; @@ -1645,8 +1551,6 @@ static int cortex_a8_init_arch_info(struct target *target, // armv7a->armv4_5_mmu.enable_mmu_caches = armv7a_enable_mmu_caches; armv7a->armv4_5_mmu.has_tiny_pages = 1; armv7a->armv4_5_mmu.mmu_enabled = 0; - armv7a->read_cp15 = cortex_a8_read_cp15; - armv7a->write_cp15 = cortex_a8_write_cp15; // arm7_9->handle_target_request = cortex_a8_handle_target_request; commit 563d937c3c6a7080998baa2313d66ae184b820ac Author: David Brownell <dbr...@us...> Date: Tue Dec 1 00:49:04 2009 -0800 ARM: implement mrc()/mcr() as DPM ops Instead of having separate ARM11 and Cortex-A8 implementations of this code, have one shared implementation which just builds on the existing "run instruction via R0" support. This enables followup patches to remove that now-unused code from those two drivers. (Patches to move the "mrc" and "mcr" code into "struct arm" are due too ... MIPS and other cores do not support those ARM-specific concepts.) Signed-off-by: David Brownell <dbr...@us...> diff --git a/src/target/arm_dpm.c b/src/target/arm_dpm.c index b8107d7..127f87b 100644 --- a/src/target/arm_dpm.c +++ b/src/target/arm_dpm.c @@ -34,6 +34,61 @@ * implementation differences between cores like ARM1136 and Cortex-A8. */ +/* + * Coprocessor support + */ + +/* Read coprocessor */ +static int dpm_mrc(struct target *target, int cpnum, + uint32_t op1, uint32_t op2, uint32_t CRn, uint32_t CRm, + uint32_t *value) +{ + struct arm *arm = target_to_arm(target); + struct arm_dpm *dpm = arm->dpm; + int retval; + + retval = dpm->prepare(dpm); + if (retval != ERROR_OK) + return retval; + + LOG_DEBUG("MRC p%d, %d, r0, c%d, c%d, %d", cpnum, op1, CRn, CRm, op2); + + /* read coprocessor register into R0; return via DCC */ + retval = dpm->instr_read_data_r0(dpm, + ARMV4_5_MRC(cpnum, op1, 0, CRn, CRm, op2), + value); + + /* (void) */ dpm->finish(dpm); + return retval; +} + +static int dpm_mcr(struct target *target, int cpnum, + uint32_t op1, uint32_t op2, uint32_t CRn, uint32_t CRm, + uint32_t value) +{ + struct arm *arm = target_to_arm(target); + struct arm_dpm *dpm = arm->dpm; + int retval; + + retval = dpm->prepare(dpm); + if (retval != ERROR_OK) + return retval; + + LOG_DEBUG("MCR p%d, %d, r0, c%d, c%d, %d", cpnum, op1, CRn, CRm, op2); + + /* read DCC into r0; then write coprocessor register from R0 */ + retval = dpm->instr_write_data_r0(dpm, + ARMV4_5_MCR(cpnum, op1, 0, CRn, CRm, op2), + value); + + /* (void) */ dpm->finish(dpm); + return retval; +} + +/* + * Register access utilities + */ + /* Toggles between recorded core mode (USR, SVC, etc) and a temporary one. * Routines *must* restore the original mode before returning!! */ @@ -510,6 +565,10 @@ int arm_dpm_setup(struct arm_dpm *dpm) return ERROR_FAIL; *register_get_last_cache_p(&target->reg_cache) = cache; + + arm->mrc = dpm_mrc; + arm->mcr = dpm_mcr; + return ERROR_OK; } commit 177bbd8891ae737ea7f8c0791a6236f72cedee40 Author: David Brownell <dbr...@us...> Date: Tue Dec 1 00:48:53 2009 -0800 target: "mcr" and "mrc" are ARM-specific Switch "mrc" and "mcr" commands to be toplevel ARM operations, as they should initially have been. Correct the usage message for both commands: it matches ARM documentation (as one wants!) instead of reordering them to match the funky mrc() and mcr() method usage (sigh). For Cortex-A8: restore a line that got accidentally dropped, so the secure monitor mode shadow registers will show again. Signed-off-by: David Brownell <dbr...@us...> diff --git a/src/target/arm11.c b/src/target/arm11.c index daba3b8..30dbedb 100644 --- a/src/target/arm11.c +++ b/src/target/arm11.c @@ -1219,6 +1219,13 @@ static int arm11_remove_watchpoint(struct target *target, return ERROR_FAIL; } +static int arm11_mrc(struct target *target, int cpnum, + uint32_t op1, uint32_t op2, + uint32_t CRn, uint32_t CRm, uint32_t *value); +static int arm11_mcr(struct target *target, int cpnum, + uint32_t op1, uint32_t op2, uint32_t CRn, + uint32_t CRm, uint32_t value); + static int arm11_target_create(struct target *target, Jim_Interp *interp) { struct arm11_common *arm11; @@ -1238,6 +1245,9 @@ static int arm11_target_create(struct target *target, Jim_Interp *interp) armv4_5_init_arch_info(target, &arm11->arm); + arm11->arm.mrc = arm11_mrc; + arm11->arm.mcr = arm11_mcr; + arm11->target = target; arm11->jtag_info.tap = target->tap; @@ -1679,7 +1689,4 @@ struct target_type arm11_target = { .target_create = arm11_target_create, .init_target = arm11_init_target, .examine = arm11_examine, - - .mrc = arm11_mrc, - .mcr = arm11_mcr, }; diff --git a/src/target/arm720t.c b/src/target/arm720t.c index bae2561..d900d8a 100644 --- a/src/target/arm720t.c +++ b/src/target/arm720t.c @@ -378,11 +378,24 @@ static int arm720t_init_target(struct command_context *cmd_ctx, struct target *t return arm7tdmi_init_target(cmd_ctx, target); } +/* FIXME remove forward decls */ +static int arm720t_mrc(struct target *target, int cpnum, + uint32_t op1, uint32_t op2, + uint32_t CRn, uint32_t CRm, + uint32_t *value); +static int arm720t_mcr(struct target *target, int cpnum, + uint32_t op1, uint32_t op2, + uint32_t CRn, uint32_t CRm, + uint32_t value); + static int arm720t_init_arch_info(struct target *target, struct arm720t_common *arm720t, struct jtag_tap *tap) { struct arm7_9_common *arm7_9 = &arm720t->arm7_9_common; + arm7_9->armv4_5_common.mrc = arm720t_mrc; + arm7_9->armv4_5_common.mcr = arm720t_mcr; + arm7tdmi_init_arch_info(target, arm7_9, tap); arm720t->common_magic = ARM720T_COMMON_MAGIC; @@ -556,6 +569,4 @@ struct target_type arm720t_target = .target_create = arm720t_target_create, .init_target = arm720t_init_target, .examine = arm7_9_examine, - .mrc = arm720t_mrc, - .mcr = arm720t_mcr, }; diff --git a/src/target/arm920t.c b/src/target/arm920t.c index e6c2eed..17e7a55 100644 --- a/src/target/arm920t.c +++ b/src/target/arm920t.c @@ -624,10 +624,23 @@ int arm920t_soft_reset_halt(struct target *target) return ERROR_OK; } +/* FIXME remove forward decls */ +static int arm920t_mrc(struct target *target, int cpnum, + uint32_t op1, uint32_t op2, + uint32_t CRn, uint32_t CRm, + uint32_t *value); +static int arm920t_mcr(struct target *target, int cpnum, + uint32_t op1, uint32_t op2, + uint32_t CRn, uint32_t CRm, + uint32_t value); + int arm920t_init_arch_info(struct target *target, struct arm920t_common *arm920t, struct jtag_tap *tap) { struct arm7_9_common *arm7_9 = &arm920t->arm7_9_common; + arm7_9->armv4_5_common.mrc = arm920t_mrc; + arm7_9->armv4_5_common.mcr = arm920t_mcr; + /* initialize arm7/arm9 specific info (including armv4_5) */ arm9tdmi_init_arch_info(target, arm7_9, tap); @@ -1452,6 +1465,4 @@ struct target_type arm920t_target = .target_create = arm920t_target_create, .init_target = arm9tdmi_init_target, .examine = arm7_9_examine, - .mrc = arm920t_mrc, - .mcr = arm920t_mcr, }; diff --git a/src/target/arm926ejs.c b/src/target/arm926ejs.c index 408ede9..ca420aa 100644 --- a/src/target/arm926ejs.c +++ b/src/target/arm926ejs.c @@ -673,6 +673,9 @@ int arm926ejs_init_arch_info(struct target *target, struct arm926ejs_common *arm { struct arm7_9_common *arm7_9 = &arm926ejs->arm7_9_common; + arm7_9->armv4_5_common.mrc = arm926ejs_mrc; + arm7_9->armv4_5_common.mcr = arm926ejs_mcr; + /* initialize arm7/arm9 specific info (including armv4_5) */ arm9tdmi_init_arch_info(target, arm7_9, tap); @@ -822,6 +825,4 @@ struct target_type arm926ejs_target = .read_phys_memory = arm926ejs_read_phys_memory, .write_phys_memory = arm926ejs_write_phys_memory, - .mrc = arm926ejs_mrc, - .mcr = arm926ejs_mcr, }; diff --git a/src/target/armv4_5.c b/src/target/armv4_5.c index b5e33ff..d047b1b 100644 --- a/src/target/armv4_5.c +++ b/src/target/armv4_5.c @@ -790,6 +790,137 @@ usage: return retval; } +static int jim_mcrmrc(Jim_Interp *interp, int argc, Jim_Obj *const *argv) +{ + struct command_context *context; + struct target *target; + struct arm *arm; + int retval; + + context = Jim_GetAssocData(interp, "context"); + if (context == NULL) { + LOG_ERROR("%s: no command context", __func__); + return JIM_ERR; + } + target = get_current_target(context); + if (target == NULL) { + LOG_ERROR("%s: no current target", __func__); + return JIM_ERR; + } + if (!target_was_examined(target)) { + LOG_ERROR("%s: not yet examined", target_name(target)); + return JIM_ERR; + } + arm = target_to_arm(target); + if (!is_arm(arm)) { + LOG_ERROR("%s: not an ARM", target_name(target)); + return JIM_ERR; + } + + if ((argc < 6) || (argc > 7)) { + /* FIXME use the command name to verify # params... */ + LOG_ERROR("%s: wrong number of arguments", __func__); + return JIM_ERR; + } + + int cpnum; + uint32_t op1; + uint32_t op2; + uint32_t CRn; + uint32_t CRm; + uint32_t value; + long l; + + /* NOTE: parameter sequence matches ARM instruction set usage: + * MCR pNUM, op1, rX, CRn, CRm, op2 ; write CP from rX + * MRC pNUM, op1, rX, CRn, CRm, op2 ; read CP into rX + * The "rX" is necessarily omitted; it uses Tcl mechanisms. + */ + retval = Jim_GetLong(interp, argv[1], &l); + if (retval != JIM_OK) + return retval; + if (l & ~0xf) { + LOG_ERROR("%s: %s %d out of range", __func__, + "coprocessor", (int) l); + return JIM_ERR; + } + cpnum = l; + + retval = Jim_GetLong(interp, argv[2], &l); + if (retval != JIM_OK) + return retval; + if (l & ~0x7) { + LOG_ERROR("%s: %s %d out of range", __func__, + "op1", (int) l); + return JIM_ERR; + } + op1 = l; + + retval = Jim_GetLong(interp, argv[3], &l); + if (retval != JIM_OK) + return retval; + if (l & ~0xf) { + LOG_ERROR("%s: %s %d out of range", __func__, + "CRn", (int) l); + return JIM_ERR; + } + CRn = l; + + retval = Jim_GetLong(interp, argv[4], &l); + if (retval != JIM_OK) + return retval; + if (l & ~0xf) { + LOG_ERROR("%s: %s %d out of range", __func__, + "CRm", (int) l); + return JIM_ERR; + } + CRm = l; + + retval = Jim_GetLong(interp, argv[5], &l); + if (retval != JIM_OK) + return retval; + if (l & ~0x7) { + LOG_ERROR("%s: %s %d out of range", __func__, + "op2", (int) l); + return JIM_ERR; + } + op2 = l; + + value = 0; + + /* FIXME don't assume "mrc" vs "mcr" from the number of params; + * that could easily be a typo! Check both... + * + * FIXME change the call syntax here ... simplest to just pass + * the MRC() or MCR() instruction to be executed. That will also + * let us support the "mrc2" and "mcr2" opcodes (toggling one bit) + * if that's ever needed. + */ + if (argc == 7) { + retval = Jim_GetLong(interp, argv[6], &l); + if (retval != JIM_OK) { + return retval; + } + value = l; + + /* NOTE: parameters reordered! */ + // ARMV4_5_MCR(cpnum, op1, 0, CRn, CRm, op2) + retval = arm->mcr(target, cpnum, op1, op2, CRn, CRm, value); + if (retval != ERROR_OK) + return JIM_ERR; + } else { + /* NOTE: parameters reordered! */ + // ARMV4_5_MRC(cpnum, op1, 0, CRn, CRm, op2) + retval = arm->mrc(target, cpnum, op1, op2, CRn, CRm, &value); + if (retval != ERROR_OK) + return JIM_ERR; + + Jim_SetResult(interp, Jim_NewIntObj(interp, value)); + } + + return JIM_OK; +} + static const struct command_registration arm_exec_command_handlers[] = { { .name = "reg", @@ -811,6 +942,20 @@ static const struct command_registration arm_exec_command_handlers[] = { .usage = "<address> [<count> ['thumb']]", .help = "disassemble instructions ", }, + { + .name = "mcr", + .mode = COMMAND_EXEC, + .jim_handler = &jim_mcrmrc, + .help = "write coprocessor register", + .usage = "cpnum op1 CRn op2 CRm value", + }, + { + .name = "mrc", + .jim_handler = &jim_mcrmrc, + .help = "read coprocessor register", + .usage = "cpnum op1 CRn op2 CRm", + }, + COMMAND_REGISTRATION_DONE }; const struct command_registration arm_command_handlers[] = { @@ -1252,6 +1397,24 @@ static int arm_full_context(struct target *target) return retval; } +static int arm_default_mrc(struct target *target, int cpnum, + uint32_t op1, uint32_t op2, + uint32_t CRn, uint32_t CRm, + uint32_t *value) +{ + LOG_ERROR("%s doesn't implement MRC", target_type_name(target)); + return ERROR_FAIL; +} + +static int arm_default_mcr(struct target *target, int cpnum, + uint32_t op1, uint32_t op2, + uint32_t CRn, uint32_t CRm, + uint32_t value) +{ + LOG_ERROR("%s doesn't implement MCR", target_type_name(target)); + return ERROR_FAIL; +} + int armv4_5_init_arch_info(struct target *target, struct arm *armv4_5) { target->arch_info = armv4_5; @@ -1267,5 +1430,10 @@ int armv4_5_init_arch_info(struct target *target, struct arm *armv4_5) if (!armv4_5->full_context && armv4_5->read_core_reg) armv4_5->full_context = arm_full_context; + if (!armv4_5->mrc) + armv4_5->mrc = arm_default_mrc; + if (!armv4_5->mcr) + armv4_5->mcr = arm_default_mcr; + return ERROR_OK; } diff --git a/src/target/armv4_5.h b/src/target/armv4_5.h index 822d143..7229a6c 100644 --- a/src/target/armv4_5.h +++ b/src/target/armv4_5.h @@ -112,11 +112,26 @@ struct arm /** Handle for the Embedded Trace Module, if one is present. */ struct etm_context *etm; + /* FIXME all these methods should take "struct arm *" not target */ + int (*full_context)(struct target *target); int (*read_core_reg)(struct target *target, struct reg *reg, int num, enum armv4_5_mode mode); int (*write_core_reg)(struct target *target, struct reg *reg, int num, enum armv4_5_mode mode, uint32_t value); + + /** Read coprocessor register. */ + int (*mrc)(struct target *target, int cpnum, + uint32_t op1, uint32_t op2, + uint32_t CRn, uint32_t CRm, + uint32_t *value); + + /* Write coprocessor register. */ + int (*mcr)(struct target *target, int cpnum, + uint32_t op1, uint32_t op2, + uint32_t CRn, uint32_t CRm, + uint32_t value); + void *arch_info; }; diff --git a/src/target/cortex_a8.c b/src/target/cortex_a8.c index 652efa9..9ce6b2b 100644 --- a/src/target/cortex_a8.c +++ b/src/target/cortex_a8.c @@ -936,7 +936,7 @@ static void cortex_a8_post_debug_entry(struct target *target) int retval; /* MRC p15,0,<Rt>,c1,c0,0 ; Read CP15 System Control Register */ - retval = target->type->mrc(target, 15, + retval = armv7a->armv4_5_common.mrc(target, 15, 0, 0, /* op1, op2 */ 1, 0, /* CRn, CRm */ &cortex_a8->cp15_control_reg); @@ -947,7 +947,7 @@ static void cortex_a8_post_debug_entry(struct target *target) uint32_t cache_type_reg; /* MRC p15,0,<Rt>,c0,c0,1 ; Read CP15 Cache Type Register */ - retval = target->type->mrc(target, 15, + retval = armv7a->armv4_5_common.mrc(target, 15, 0, 1, /* op1, op2 */ 0, 0, /* CRn, CRm */ &cache_type_reg); @@ -1535,6 +1535,7 @@ static int cortex_a8_examine_first(struct target *target) LOG_DEBUG("ttypr = 0x%08" PRIx32, ttypr); LOG_DEBUG("didr = 0x%08" PRIx32, didr); + armv7a->armv4_5_common.core_type = ARM_MODE_MON; cortex_a8_dpm_setup(cortex_a8, didr); /* Setup Breakpoint Register Pairs */ @@ -1611,6 +1612,9 @@ static int cortex_a8_init_arch_info(struct target *target, cortex_a8->common_magic = CORTEX_A8_COMMON_MAGIC; armv4_5->arch_info = armv7a; + armv4_5->mrc = cortex_a8_mrc, + armv4_5->mcr = cortex_a8_mcr, + /* prepare JTAG information for the new target */ cortex_a8->jtag_info.tap = tap; cortex_a8->jtag_info.scann_size = 4; @@ -1626,7 +1630,6 @@ static int cortex_a8_init_arch_info(struct target *target, cortex_a8->fast_reg_read = 0; - /* register arch-specific functions */ armv7a->examine_debug_reason = NULL; @@ -1752,6 +1755,4 @@ struct target_type cortexa8_target = { .target_create = cortex_a8_target_create, .init_target = cortex_a8_init_target, .examine = cortex_a8_examine, - .mrc = cortex_a8_mrc, - .mcr = cortex_a8_mcr, }; diff --git a/src/target/target.c b/src/target/target.c index 31734b8..88931b5 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -44,8 +44,6 @@ #include "jtag.h" -static int jim_mcrmrc(Jim_Interp *interp, 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); @@ -665,84 +663,6 @@ static void target_reset_examined(struct target *target) target->examined = false; } - - -static int default_mrc(struct target *target, int cpnum, uint32_t op1, uint32_t op2, uint32_t CRn, uint32_t CRm, uint32_t *value) -{ - LOG_ERROR("Not implemented: %s", __func__); - return ERROR_FAIL; -} - -static int default_mcr(struct target *target, int cpnum, uint32_t op1, uint32_t op2, uint32_t CRn, uint32_t CRm, uint32_t value) -{ - LOG_ERROR("Not implemented: %s", __func__); - return ERROR_FAIL; -} - -static int arm_cp_check(struct target *target, int cpnum, uint32_t op1, uint32_t op2, uint32_t CRn, uint32_t CRm) -{ - /* basic check */ - if (!target_was_examined(target)) - { - LOG_ERROR("Target not examined yet"); - return ERROR_FAIL; - } - - if ((cpnum <0) || (cpnum > 15)) - { - LOG_ERROR("Illegal co-processor %d", cpnum); - return ERROR_FAIL; - } - - if (op1 > 7) - { - LOG_ERROR("Illegal op1"); - return ERROR_FAIL; - } - - if (op2 > 7) - { - LOG_ERROR("Illegal op2"); - return ERROR_FAIL; - } - - if (CRn > 15) - { - LOG_ERROR("Illegal CRn"); - return ERROR_FAIL; - } - - if (CRm > 15) - { - LOG_ERROR("Illegal CRm"); - return ERROR_FAIL; - } - - return ERROR_OK; -} - -int target_mrc(struct target *target, int cpnum, uint32_t op1, uint32_t op2, uint32_t CRn, uint32_t CRm, uint32_t *value) -{ - int retval; - - retval = arm_cp_check(target, cpnum, op1, op2, CRn, CRm); - if (retval != ERROR_OK) - return retval; - - return target->type->mrc(target, cpnum, op1, op2, CRn, CRm, value); -} - -int target_mcr(struct target *target, int cpnum, uint32_t op1, uint32_t op2, uint32_t CRn, uint32_t CRm, uint32_t value) -{ - int retval; - - retval = arm_cp_check(target, cpnum, op1, op2, CRn, CRm); - if (retval != ERROR_OK) - return retval; - - return target->type->mcr(target, cpnum, op1, op2, CRn, CRm, value); -} - static int err_read_phys_memory(struct target *target, uint32_t address, uint32_t size, uint32_t count, uint8_t *buffer) @@ -781,39 +701,6 @@ int target_init(struct command_context *cmd_ctx) return retval; } - /** - * @todo MCR/MRC are ARM-specific; don't require them in - * all targets, or for ARMs without coprocessors. - */ - if (target->type->mcr == NULL) - { - target->type->mcr = default_mcr; - } else - { - const struct command_registration mcr_cmd = { - .name = "mcr", - .mode = COMMAND_EXEC, - .jim_handler = &jim_mcrmrc, - .help = "write coprocessor", - .usage = "<cpnum> <op1> <op2> <CRn> <CRm> <value>", - }; - register_command(cmd_ctx, NULL, &mcr_cmd); - } - - if (target->type->mrc == NULL) - { - target->type->mrc = default_mrc; - } else - { - const struct command_registration mrc_cmd = { - .name = "mrc", - .jim_handler = &jim_mcrmrc, - .help = "read coprocessor", - .usage = "<cpnum> <op1> <op2> <CRn> <CRm>", - }; - register_command(cmd_ctx, NULL, &mrc_cmd); - } - /** * @todo get rid of those *memory_imp() methods, now that all @@ -4883,92 +4770,6 @@ COMMAND_HANDLER(handle_fast_load_command) return retval; } -static int jim_mcrmrc(Jim_Interp *interp, int argc, Jim_Obj *const *argv) -{ - struct command_context *context; - struct target *target; - int retval; - - context = Jim_GetAssocData(interp, "context"); - if (context == NULL) { - LOG_ERROR("array2mem: no command context"); - return JIM_ERR; - } - target = get_current_target(context); - if (target == NULL) { - LOG_ERROR("array2mem: no current target"); - return JIM_ERR; - } - - if ((argc < 6) || (argc > 7)) - { - return JIM_ERR; - } - - int cpnum; - uint32_t op1; - uint32_t op2; - uint32_t CRn; - uint32_t CRm; - uint32_t value; - - int e; - long l; - e = Jim_GetLong(interp, argv[1], &l); - if (e != JIM_OK) { - return e; - } - cpnum = l; - - e = Jim_GetLong(interp, argv[2], &l); - if (e != JIM_OK) { - return e; - } - op1 = l; - - e = Jim_GetLong(interp, argv[3], &l); - if (e != JIM_OK) { - return e; - } - CRn = l; - - e = Jim_GetLong(interp, argv[4], &l); - if (e != JIM_OK) { - return e; - } - CRm = l; - - e = Jim_GetLong(interp, argv[5], &l); - if (e != JIM_OK) { - return e; - } - op2 = l; - - value = 0; - - if (argc == 7) - { - e = Jim_GetLong(interp, argv[6], &l); - if (e != JIM_OK) { - return e; - } - value = l; - - retval = target_mcr(target, cpnum, op1, op2, CRn, CRm, value); - if (retval != ERROR_OK) - return JIM_ERR; - } else - { - retval = target_mrc(target, cpnum, op1, op2, CRn, CRm, &value); - if (retval != ERROR_OK) - return JIM_ERR; - - Jim_SetResult(interp, Jim_NewIntObj(interp, value)); - } - - return JIM_OK; -} - static const struct command_registration target_command_handlers[] = { { .name = "targets", diff --git a/src/target/target_type.h b/src/target/target_type.h index d141608..15cf66b 100644 --- a/src/target/target_type.h +++ b/src/target/target_type.h @@ -213,11 +213,6 @@ struct target_type int (*mmu)(struct target *target, int *enabled); - /* Read coprocessor - arm specific. Default implementation returns error. */ - int (*mrc)(struct target *target, int cpnum, uint32_t op1, uint32_t op2, uint32_t CRn, uint32_t CRm, uint32_t *value); - - /* Write coprocessor. Default implementation returns error. */ - int (*mcr)(struct target *target, int cpnum, uint32_t op1, uint32_t op2, uint32_t CRn, uint32_t CRm, uint32_t value); }; #endif // TARGET_TYPE_H commit 209a0197f0c79442a2314199170a957c36c0ddb6 Author: David Brownell <dbr...@us...> Date: Tue Dec 1 00:48:40 2009 -0800 ARMv7-A: stop using CP15 ops The ARMv7-A code uses read_cp15() to access fault registers. Instead, use DPM operations directly, passing in the relevant MRC instructions. This eliminates per-operation overhead (though it'll be hard to observe, this is uncommon) and helps eliminate read_cp15(). Signed-off-by: David Brownell <dbr...@us...> diff --git a/src/target/armv7a.c b/src/target/armv7a.c index 3d94329..e23208f 100644 --- a/src/target/armv7a.c +++ b/src/target/armv7a.c @@ -38,17 +38,48 @@ static void armv7a_show_fault_registers(struct target *target) { uint32_t dfsr, ifsr, dfar, ifar; struct armv7a_common *armv7a = target_to_armv7a(target); - - armv7a->read_cp15(target, 0, 0, 5, 0, &dfsr); - armv7a->read_cp15(target, 0, 1, 5, 0, &ifsr); - armv7a->read_cp15(target, 0, 0, 6, 0, &dfar); - armv7a->read_cp15(target, 0, 2, 6, 0, &ifar); + struct arm_dpm *dpm = armv7a->armv4_5_common.dpm; + int retval; + + retval = dpm->prepare(dpm); + if (retval != ERROR_OK) + return; + + /* ARMV4_5_MRC(cpnum, op1, r0, CRn, CRm, op2) */ + + /* c5/c0 - {data, instruction} fault status registers */ + retval = dpm->instr_read_data_r0(dpm, + ARMV4_5_MRC(15, 0, 0, 5, 0, 0), + &dfsr); + if (retval != ERROR_OK) + goto done; + + retval = dpm->instr_read_data_r0(dpm, + ARMV4_5_MRC(15, 0, 0, 5, 0, 1), + &ifsr); + if (retval != ERROR_OK) + goto done; + + /* c6/c0 - {data, instruction} fault address registers */ + retval = dpm->instr_read_data_r0(dpm, + ARMV4_5_MRC(15, 0, 0, 6, 0, 0), + &dfar); + if (retval != ERROR_OK) + goto done; + + retval = dpm->instr_read_data_r0(dpm, + ARMV4_5_MRC(15, 0, 0, 6, 0, 2), + &ifar); + if (retval != ERROR_OK) + goto done; LOG_USER("Data fault registers DFSR: %8.8" PRIx32 ", DFAR: %8.8" PRIx32, dfsr, dfar); LOG_USER("Instruction fault registers IFSR: %8.8" PRIx32 ", IFAR: %8.8" PRIx32, ifsr, ifar); +done: + /* (void) */ dpm->finish(dpm); } int armv7a_arch_state(struct target *target) commit fb984a477d526b742855bfe0ab07f4dced3b9323 Author: David Brownell <dbr...@us...> Date: Tue Dec 1 00:48:40 2009 -0800 Cortex-A8: stop using CP15 ops There were two chunks of Cortex-A8 code which called the ARMv7-A CP15 operations; get rid of them, helping prepare to remove those methods completely: - post_debug_entry() can use the mrc() method to read its two registers. - write_memory() can use dpm->instr_write_data_r0() to flush the ICache and DCache ... doing it this way is actually faster since it reduces per-write overhead. Note that the mrc() method parameters are re-ordered with respect to the ARM instruction documentation, so that part can be confusing. Cleaned up the layout and comments in those areas a bit. Signed-off-by: David Brownell <dbr...@us...> diff --git a/src/target/cortex_a8.c b/src/target/cortex_a8.c index 8402081..652efa9 100644 --- a/src/target/cortex_a8.c +++ b/src/target/cortex_a8.c @@ -933,19 +933,26 @@ static void cortex_a8_post_debug_entry(struct target *target) { struct cortex_a8_common *cortex_a8 = target_to_cortex_a8(target); struct armv7a_common *armv7a = &cortex_a8->armv7a_common; + int retval; -// cortex_a8_read_cp(target, &cp15_control_register, 15, 0, 1, 0, 0); - /* examine cp15 control reg */ - armv7a->read_cp15(target, 0, 0, 1, 0, &cortex_a8->cp15_control_reg); - jtag_execute_queue(); + /* MRC p15,0,<Rt>,c1,c0,0 ; Read CP15 System Control Register */ + retval = target->type->mrc(target, 15, + 0, 0, /* op1, op2 */ + 1, 0, /* CRn, CRm */ + &cortex_a8->cp15_control_reg); LOG_DEBUG("cp15_control_reg: %8.8" PRIx32, cortex_a8->cp15_control_reg); if (armv7a->armv4_5_mmu.armv4_5_cache.ctype == -1) { uint32_t cache_type_reg; - /* identify caches */ - armv7a->read_cp15(target, 0, 1, 0, 0, &cache_type_reg); - jtag_execute_queue(); + + /* MRC p15,0,<Rt>,c0,c0,1 ; Read CP15 Cache Type Register */ + retval = target->type->mrc(target, 15, + 0, 1, /* op1, op2 */ + 0, 0, /* CRn, CRm */ + &cache_type_reg); + LOG_DEBUG("cp15 cache type: %8.8x", (unsigned) cache_type_reg); + /* FIXME the armv4_4 cache info DOES NOT APPLY to Cortex-A8 */ armv4_5_identify_cache(cache_type_reg, &armv7a->armv4_5_mmu.armv4_5_cache); @@ -1350,25 +1357,55 @@ static int cortex_a8_write_memory(struct target *target, uint32_t address, } } + /* REVISIT this op is generic ARMv7-A/R stuff */ if (retval == ERROR_OK && target->state == TARGET_HALTED) { - /* The Cache handling will NOT work with MMU active, the wrong addresses will be invalidated */ + struct arm_dpm *dpm = armv7a->armv4_5_common.dpm; + + retval = dpm->prepare(dpm); + if (retval != ERROR_OK) + return retval; + + /* The Cache handling will NOT work with MMU active, the + * wrong addresses will be invalidated! + * + * For both ICache and DCache, walk all cache lines in the + * address range. Cortex-A8 has fixed 64 byte line length. + */ + /* invalidate I-Cache */ if (armv7a->armv4_5_mmu.armv4_5_cache.i_cache_enabled) { - /* Invalidate ICache single entry with MVA, repeat this for all cache - lines in the address range, Cortex-A8 has fixed 64 byte line length */ - /* Invalidate Cache single entry with MVA to PoU */ - for (uint32_t cacheline=address; cacheline<address+size*count; cacheline+=64) - armv7a->write_cp15(target, 0, 1, 7, 5, cacheline); /* I-Cache to PoU */ + /* ICIMVAU - Invalidate Cache single entry + * with MVA to PoU + * MCR p15, 0, r0, c7, c5, 1 + */ + for (uint32_t cacheline = address; + cacheline < address + size * count; + cacheline += 64) { + retval = dpm->instr_write_data_r0(dpm, + ARMV4_5_MCR(15, 0, 0, 7, 5, 1), + cacheline); + } } + /* invalidate D-Cache */ if (armv7a->armv4_5_mmu.armv4_5_cache.d_u_cache_enabled) { - /* Invalidate Cache single entry with MVA to PoC */ - for (uint32_t cacheline=address; cacheline<address+size*count; cacheline+=64) - armv7a->write_cp15(target, 0, 1, 7, 6, cacheline); /* U/D cache to PoC */ + /* DCIMVAC - Invalidate data Cache line + * with MVA to PoC + * MCR p15, 0, r0, c7, c6, 1 + */ + for (uint32_t cacheline = address; + cacheline < address + size * count; + cacheline += 64) { + retval = dpm->instr_write_data_r0(dpm, + ARMV4_5_MCR(15, 0, 0, 7, 6, 1), + cacheline); + } } + + /* (void) */ dpm->finish(dpm); } return retval; ----------------------------------------------------------------------- Summary of changes: src/target/arm11.c | 68 ---------------- src/target/arm720t.c | 15 +++- src/target/arm920t.c | 15 +++- src/target/arm926ejs.c | 5 +- src/target/arm_dpm.c | 59 ++++++++++++++ src/target/armv4_5.c | 168 ++++++++++++++++++++++++++++++++++++++ src/target/armv4_5.h | 15 ++++ src/target/armv7a.c | 39 ++++++++- src/target/armv7a.h | 7 -- src/target/cortex_a8.c | 168 +++++++++++++-------------------------- src/target/target.c | 199 ---------------------------------------------- src/target/target_type.h | 5 - 12 files changed, 361 insertions(+), 402 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: Øyvind H. <go...@us...> - 2009-12-01 07:53: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 51e9b25c9ae3478989940f925a36d78364d88764 (commit) from 330733eadf76ea87ee8714ed7958f174b1be21db (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 51e9b25c9ae3478989940f925a36d78364d88764 Author: Ãyvind Harboe <oyv...@zy...> Date: Mon Nov 30 09:13:56 2009 +0100 main: invoke jtag_interface_quit() explicitly There is no particular reason to invoke jtag_interface_quit() on the atexit() handler, it just makes the code more obtuse and stops other legitimate usage of atexit(). Signed-off-by: Ãyvind Harboe <oyv...@zy...> diff --git a/src/openocd.c b/src/openocd.c index 1be209a..22d4582 100644 --- a/src/openocd.c +++ b/src/openocd.c @@ -60,10 +60,6 @@ COMMAND_HANDLER(handle_version_command) return ERROR_OK; } -static void exit_handler(void) -{ - jtag_interface_quit(); -} static int log_target_callback_event_handler(struct target *target, enum target_event event, void *priv) { @@ -115,8 +111,6 @@ COMMAND_HANDLER(handle_init_command) initialized = 1; - atexit(exit_handler); - command_context_mode(CMD_CTX, COMMAND_EXEC); if (target_init(CMD_CTX) != ERROR_OK) @@ -303,5 +297,7 @@ int openocd_main(int argc, char *argv[]) /* free commandline interface */ command_done(cmd_ctx); + jtag_interface_quit(); + return ret; } ----------------------------------------------------------------------- Summary of changes: src/openocd.c | 8 ++------ 1 files changed, 2 insertions(+), 6 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: Zach W. <zw...@us...> - 2009-12-01 05:58:59
|
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 330733eadf76ea87ee8714ed7958f174b1be21db (commit) from 892604bc7e6b332cf3b0bf6c2586cbd0f54ec8ef (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 330733eadf76ea87ee8714ed7958f174b1be21db Author: Zachary T Welch <zw...@su...> Date: Sat Nov 28 16:29:41 2009 -0800 improve command prohibition error report Ensures that the correct information gets displayed, depending on the mode of the command being denied. Fixes misreporting all commands as needing to run "before 'init'". diff --git a/src/helper/command.c b/src/helper/command.c index 9b9c5ec..dcad6a1 100644 --- a/src/helper/command.c +++ b/src/helper/command.c @@ -565,8 +565,16 @@ static int run_command(struct command_context *context, { if (!command_can_run(context, c)) { - /* Config commands can not run after the config stage */ - LOG_ERROR("The '%s' command must be used before 'init'.", c->name); + /* Many commands may be run only before/after 'init' */ + const char *when; + switch (c->mode) { + case COMMAND_CONFIG: when = "before"; break; + case COMMAND_EXEC: when = "after"; break; + // handle the impossible with humor; it guarantees a bug report! + default: when = "if Cthulhu is summoned by"; break; + } + LOG_ERROR("The '%s' command must be used %s 'init'.", + c->name, when); return ERROR_FAIL; } ----------------------------------------------------------------------- Summary of changes: src/helper/command.c | 12 ++++++++++-- 1 files changed, 10 insertions(+), 2 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: David B. <dbr...@us...> - 2009-12-01 04:14: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 892604bc7e6b332cf3b0bf6c2586cbd0f54ec8ef (commit) via da7c202b5751c1420be6725c6eb456a2f723ba74 (commit) from 8fc5a9a5e90ba1c7580e9d883aed0d790e594c8e (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 892604bc7e6b332cf3b0bf6c2586cbd0f54ec8ef Author: David Brownell <dbr...@us...> Date: Mon Nov 30 19:14:19 2009 -0800 XScale: restore_context() cleanup Clean up two aspects to this routine: bad naming, since it doesn't restore the context, just the banked registers; and excess indentation for the bulk of the code. Also make some of its call sites stash the function's return code; someday they should use it for error checking. Signed-off-by: David Brownell <dbr...@us...> diff --git a/src/target/xscale.c b/src/target/xscale.c index 0680c52..ccb1de5 100644 --- a/src/target/xscale.c +++ b/src/target/xscale.c @@ -62,7 +62,7 @@ static int xscale_resume(struct target *, int current, uint32_t address, int handle_breakpoints, int debug_execution); static int xscale_debug_entry(struct target *); -static int xscale_restore_context(struct target *); +static int xscale_restore_banked(struct target *); static int xscale_get_reg(struct reg *reg); static int xscale_set_reg(struct reg *reg, uint8_t *buf); static int xscale_set_breakpoint(struct target *, struct breakpoint *); @@ -1251,7 +1251,7 @@ static int xscale_resume(struct target *target, int current, xscale_enable_single_step(target, next_pc); /* restore banked registers */ - xscale_restore_context(target); + retval = xscale_restore_banked(target); /* send resume request (command 0x30 or 0x31) * clean the trace buffer if it is to be enabled (0x62) */ @@ -1296,7 +1296,7 @@ static int xscale_resume(struct target *target, int current, xscale_enable_watchpoints(target); /* restore banked registers */ - xscale_restore_context(target); + retval = xscale_restore_banked(target); /* send resume request (command 0x30 or 0x31) * clean the trace buffer if it is to be enabled (0x62) */ @@ -1371,7 +1371,7 @@ static int xscale_step_inner(struct target *target, int current, return retval; /* restore banked registers */ - if ((retval = xscale_restore_context(target)) != ERROR_OK) + if ((retval = xscale_restore_banked(target)) != ERROR_OK) return retval; /* send resume request (command 0x30 or 0x31) @@ -1755,7 +1755,7 @@ static int xscale_full_context(struct target *target) return ERROR_OK; } -static int xscale_restore_context(struct target *target) +static int xscale_restore_banked(struct target *target) { struct arm *armv4_5 = target_to_armv4_5(target); @@ -1774,8 +1774,8 @@ static int xscale_restore_context(struct target *target) */ for (i = 1; i < 7; i++) { - int dirty = 0; enum armv4_5_mode mode = armv4_5_number_to_mode(i); + struct reg *r; if (mode == ARMV4_5_MODE_USR) continue; @@ -1785,7 +1785,7 @@ static int xscale_restore_context(struct target *target) { if (ARMV4_5_CORE_REG_MODE(armv4_5->core_cache, mode, j).dirty) - dirty = 1; + goto dirty; } /* if not USR/SYS, check if the SPSR needs to be written */ @@ -1793,43 +1793,35 @@ static int xscale_restore_context(struct target *target) { if (ARMV4_5_CORE_REG_MODE(armv4_5->core_cache, mode, 16).dirty) - dirty = 1; + goto dirty; } - /* is there anything to flush for this mode? */ - if (dirty) - { - uint32_t tmp_cpsr; - struct reg *r; - - /* command 0x1: "send banked registers" */ - xscale_send_u32(target, 0x1); + /* there's nothing to flush for this mode */ + continue; - tmp_cpsr = 0x0; - tmp_cpsr |= mode; - tmp_cpsr |= 0xc0; /* I/F bits */ +dirty: + /* command 0x1: "send banked registers" */ + xscale_send_u32(target, 0x1); - /* send CPSR for desired mode */ - xscale_send_u32(target, tmp_cpsr); + /* send CPSR for desired mode */ + xscale_send_u32(target, mode | 0xc0 /* I/F bits */); - /* send banked registers, r8 to r14, and spsr if not in USR/SYS mode */ - for (j = 8; j <= 14; j++) - { - r = &ARMV4_5_CORE_REG_MODE(armv4_5->core_cache, - mode, j); - xscale_send_u32(target, - buf_get_u32(r->value, 0, 32)); - r->dirty = false; - } + /* send r8 to r14/lr ... only FIQ needs more than r13..r14, + * but this protocol doesn't understand that nuance. + */ + for (j = 8; j <= 14; j++) { + r = &ARMV4_5_CORE_REG_MODE(armv4_5->core_cache, + mode, j); + xscale_send_u32(target, buf_get_u32(r->value, 0, 32)); + r->dirty = false; + } - if (mode != ARMV4_5_MODE_SYS) - { - r = &ARMV4_5_CORE_REG_MODE(armv4_5->core_cache, - mode, 16); - xscale_send_u32(target, - buf_get_u32(r->value, 0, 32)); - r->dirty = false; - } + /* send spsr if not in USR/SYS mode */ + if (mode != ARMV4_5_MODE_SYS) { + r = &ARMV4_5_CORE_REG_MODE(armv4_5->core_cache, + mode, 16); + xscale_send_u32(target, buf_get_u32(r->value, 0, 32)); + r->dirty = false; } } commit da7c202b5751c1420be6725c6eb456a2f723ba74 Author: David Brownell <dbr...@us...> Date: Mon Nov 30 19:14:19 2009 -0800 XScale: context restore, cleanup/bugfix This "loop over all registers" routine shared the same mess as full_context() in terms of dozens of needless number_to_mode() calls. Fix that, and comments, with related cleanup. The misnamed xscale_restore_context() had a related bug. It was restoring the *WRONG REGISTERS* ... always from whatever the current mode was, instead of using the copy from whichever register bank it was trying to restore. (But it marked the intended register as having been restored...) Fixed that. Signed-off-by: David Brownell <dbr...@us...> diff --git a/src/target/xscale.c b/src/target/xscale.c index bf5d0af..0680c52 100644 --- a/src/target/xscale.c +++ b/src/target/xscale.c @@ -1768,37 +1768,45 @@ static int xscale_restore_context(struct target *target) } /* iterate through processor modes (FIQ, IRQ, SVC, ABT, UND and SYS) - * we can't enter User mode on an XScale (unpredictable), - * but User shares registers with SYS - */ + * and check if any banked registers need to be written. Ignore + * USR mode (number 0) in favor of SYS; we can't enter User mode on + * an XScale (unpredictable), but they share all registers. + */ for (i = 1; i < 7; i++) { int dirty = 0; + enum armv4_5_mode mode = armv4_5_number_to_mode(i); - /* check if there are invalid registers in the current mode - */ + if (mode == ARMV4_5_MODE_USR) + continue; + + /* check if there are dirty registers in this mode */ for (j = 8; j <= 14; j++) { - if (ARMV4_5_CORE_REG_MODE(armv4_5->core_cache, armv4_5_number_to_mode(i), j).dirty == 1) + if (ARMV4_5_CORE_REG_MODE(armv4_5->core_cache, + mode, j).dirty) dirty = 1; } /* if not USR/SYS, check if the SPSR needs to be written */ - if ((armv4_5_number_to_mode(i) != ARMV4_5_MODE_USR) && (armv4_5_number_to_mode(i) != ARMV4_5_MODE_SYS)) + if (mode != ARMV4_5_MODE_SYS) { - if (ARMV4_5_CORE_REG_MODE(armv4_5->core_cache, armv4_5_number_to_mode(i), 16).dirty == 1) + if (ARMV4_5_CORE_REG_MODE(armv4_5->core_cache, + mode, 16).dirty) dirty = 1; } + /* is there anything to flush for this mode? */ if (dirty) { uint32_t tmp_cpsr; + struct reg *r; - /* send banked registers */ + /* command 0x1: "send banked registers" */ xscale_send_u32(target, 0x1); tmp_cpsr = 0x0; - tmp_cpsr |= armv4_5_number_to_mode(i); + tmp_cpsr |= mode; tmp_cpsr |= 0xc0; /* I/F bits */ /* send CPSR for desired mode */ @@ -1807,14 +1815,20 @@ static int xscale_restore_context(struct target *target) /* send banked registers, r8 to r14, and spsr if not in USR/SYS mode */ for (j = 8; j <= 14; j++) { - xscale_send_u32(target, buf_get_u32(ARMV4_5_CORE_REG_MODE(armv4_5->core_cache, armv4_5->core_mode, j).value, 0, 32)); - ARMV4_5_CORE_REG_MODE(armv4_5->core_cache, armv4_5_number_to_mode(i), j).dirty = 0; + r = &ARMV4_5_CORE_REG_MODE(armv4_5->core_cache, + mode, j); + xscale_send_u32(target, + buf_get_u32(r->value, 0, 32)); + r->dirty = false; } - if ((armv4_5_number_to_mode(i) != ARMV4_5_MODE_USR) && (armv4_5_number_to_mode(i) != ARMV4_5_MODE_SYS)) + if (mode != ARMV4_5_MODE_SYS) { - xscale_send_u32(target, buf_get_u32(ARMV4_5_CORE_REG_MODE(armv4_5->core_cache, armv4_5->core_mode, 16).value, 0, 32)); - ARMV4_5_CORE_REG_MODE(armv4_5->core_cache, armv4_5_number_to_mode(i), 16).dirty = 0; + r = &ARMV4_5_CORE_REG_MODE(armv4_5->core_cache, + mode, 16); + xscale_send_u32(target, + buf_get_u32(r->value, 0, 32)); + r->dirty = false; } } } ----------------------------------------------------------------------- Summary of changes: src/target/xscale.c | 82 +++++++++++++++++++++++++++----------------------- 1 files changed, 44 insertions(+), 38 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: Zach W. <zw...@us...> - 2009-12-01 01:37: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 8fc5a9a5e90ba1c7580e9d883aed0d790e594c8e (commit) via cbc894ed7b07f7eea34acfea62c728bdf182918f (commit) via 7b2906de246bc37af99d432b3edf12e9f5f63521 (commit) via 8e8a359af2a5ab3cc7c795e147aa0ca3ec06288f (commit) via e1ee27026569a94e58648d9825dc000dd53130d1 (commit) from be65f497f5f50d6d037295d5f466db5314f99de1 (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 8fc5a9a5e90ba1c7580e9d883aed0d790e594c8e Author: Zachary T Welch <zw...@su...> Date: Sun Nov 29 18:50:48 2009 -0800 remove interp global variable! Finish removing references to the 'interp' global variable from the command module, encapsulating all reference via command_context. Eliminates use of the global entirely, so it can be removed. Hurrah! diff --git a/src/helper/command.c b/src/helper/command.c index 607693c..9b9c5ec 100644 --- a/src/helper/command.c +++ b/src/helper/command.c @@ -47,7 +47,6 @@ /* nice short description of source file */ #define __THIS__FILE__ "command.c" -Jim_Interp *interp = NULL; static int run_command(struct command_context *context, struct command *c, const char *words[], unsigned num_words); @@ -159,7 +158,7 @@ static const char **script_command_args_alloc( return words; } -static struct command_context *current_command_context(void) +static struct command_context *current_command_context(Jim_Interp *interp) { /* grab the command context from the associated data */ struct command_context *cmd_ctx = Jim_GetAssocData(interp, "context"); @@ -188,7 +187,7 @@ static int script_command_run(Jim_Interp *interp, if (capture) state = command_log_capture_start(interp); - struct command_context *cmd_ctx = current_command_context(); + struct command_context *cmd_ctx = current_command_context(interp); int retval = run_command(cmd_ctx, c, (const char **)words, nwords); command_log_capture_finish(state); @@ -327,8 +326,10 @@ command_new_error: static int command_unknown(Jim_Interp *interp, int argc, Jim_Obj *const *argv); -static int register_command_handler(struct command *c) +static int register_command_handler(struct command_context *cmd_ctx, + struct command *c) { + Jim_Interp *interp = cmd_ctx->interp; const char *ocd_name = alloc_printf("ocd_%s", c->name); if (NULL == ocd_name) return JIM_ERR; @@ -377,11 +378,11 @@ struct command* register_command(struct command_context *context, int retval = ERROR_OK; if (NULL != cr->jim_handler && NULL == parent) { - retval = Jim_CreateCommand(interp, cr->name, + retval = Jim_CreateCommand(context->interp, cr->name, cr->jim_handler, cr->jim_handler_data, NULL); } else if (NULL != cr->handler || NULL != parent) - retval = register_command_handler(command_root(c)); + retval = register_command_handler(context, command_root(c)); if (ERROR_OK != retval) { @@ -615,6 +616,7 @@ int command_run_line(struct command_context *context, char *line) * happen when the Jim Tcl interpreter is provided by eCos for * instance. */ + Jim_Interp *interp = context->interp; Jim_DeleteAssocData(interp, "context"); retcode = Jim_SetAssocData(interp, "context", NULL, context); if (retcode == JIM_OK) @@ -977,7 +979,7 @@ static int command_unknown(Jim_Interp *interp, int argc, Jim_Obj *const *argv) } script_debug(interp, cmd_name, argc, argv); - struct command_context *cmd_ctx = current_command_context(); + struct command_context *cmd_ctx = current_command_context(interp); struct command *c = cmd_ctx->commands; int remaining = command_unknown_find(argc, argv, c, &c, true); // if nothing could be consumed, then it's really an unknown command @@ -1021,7 +1023,7 @@ static int command_unknown(Jim_Interp *interp, int argc, Jim_Obj *const *argv) static int jim_command_mode(Jim_Interp *interp, int argc, Jim_Obj *const *argv) { - struct command_context *cmd_ctx = current_command_context(); + struct command_context *cmd_ctx = current_command_context(interp); enum command_mode mode; if (argc > 1) { @@ -1054,7 +1056,7 @@ static int jim_command_type(Jim_Interp *interp, int argc, Jim_Obj *const *argv) if (1 == argc) return JIM_ERR; - struct command_context *cmd_ctx = current_command_context(); + struct command_context *cmd_ctx = current_command_context(interp); struct command *c = cmd_ctx->commands; int remaining = command_unknown_find(argc - 1, argv + 1, c, &c, true); // if nothing could be consumed, then it's an unknown command @@ -1276,11 +1278,12 @@ struct command_context* command_init(const char *startup_tcl) #if !BUILD_ECOSBOARD Jim_InitEmbedded(); /* Create an interpreter */ - interp = context->interp = Jim_CreateInterp(); + context->interp = Jim_CreateInterp(); /* Add all the Jim core commands */ - Jim_RegisterCoreCommands(interp); + Jim_RegisterCoreCommands(context->interp); #endif + Jim_Interp *interp = context->interp; #if defined(_MSC_VER) /* WinXX - is generic, the forward * looking problem is this: @@ -1347,17 +1350,16 @@ int command_context_mode(struct command_context *cmd_ctx, enum command_mode mode return ERROR_OK; } -void process_jim_events(void) +void process_jim_events(struct command_context *cmd_ctx) { #if !BUILD_ECOSBOARD static int recursion = 0; + if (recursion) + return; - if (!recursion) - { - recursion++; - Jim_ProcessEvents (interp, JIM_ALL_EVENTS | JIM_DONT_WAIT); - recursion--; - } + recursion++; + Jim_ProcessEvents(cmd_ctx->interp, JIM_ALL_EVENTS | JIM_DONT_WAIT); + recursion--; #endif } diff --git a/src/helper/command.h b/src/helper/command.h index f27364e..611db87 100644 --- a/src/helper/command.h +++ b/src/helper/command.h @@ -351,7 +351,7 @@ int command_run_linef(struct command_context *context, const char *format, ...) __attribute__ ((format (PRINTF_ATTRIBUTE_FORMAT, 2, 3))); void command_output_text(struct command_context *context, const char *data); -void process_jim_events(void); +void process_jim_events(struct command_context *cmd_ctx); #define ERROR_COMMAND_CLOSE_CONNECTION (-600) #define ERROR_COMMAND_SYNTAX_ERROR (-601) diff --git a/src/server/server.c b/src/server/server.c index a02d4a5..0f977a7 100644 --- a/src/server/server.c +++ b/src/server/server.c @@ -386,7 +386,7 @@ int server_loop(struct command_context *command_context) } target_call_timer_callbacks(); - process_jim_events (); + process_jim_events(command_context); if (retval == 0) { commit cbc894ed7b07f7eea34acfea62c728bdf182918f Author: Zachary T Welch <zw...@su...> Date: Sun Nov 29 18:39:13 2009 -0800 command output capture: do not use interp global Adds a log_capture_state structure to pass to the log capture callback used by the command module. Ensures that the capture occurs in the proper context. diff --git a/src/helper/command.c b/src/helper/command.c index 5df4a45..607693c 100644 --- a/src/helper/command.c +++ b/src/helper/command.c @@ -52,30 +52,50 @@ Jim_Interp *interp = NULL; static int run_command(struct command_context *context, struct command *c, const char *words[], unsigned num_words); +struct log_capture_state { + Jim_Interp *interp; + Jim_Obj *output; +}; + static void tcl_output(void *privData, const char *file, unsigned line, const char *function, const char *string) { - Jim_Obj *tclOutput = (Jim_Obj *)privData; - Jim_AppendString(interp, tclOutput, string, strlen(string)); + struct log_capture_state *state = (struct log_capture_state *)privData; + Jim_AppendString(state->interp, state->output, string, strlen(string)); } -static Jim_Obj *command_log_capture_start(Jim_Interp *interp) +static struct log_capture_state *command_log_capture_start(Jim_Interp *interp) { /* capture log output and return it. A garbage collect can * happen, so we need a reference count to this object */ Jim_Obj *tclOutput = Jim_NewStringObj(interp, "", 0); if (NULL == tclOutput) return NULL; + + struct log_capture_state *state = malloc(sizeof(*state)); + if (NULL == state) + return NULL; + + state->interp = interp; Jim_IncrRefCount(tclOutput); - log_add_callback(tcl_output, tclOutput); - return tclOutput; + state->output = tclOutput; + + log_add_callback(tcl_output, state); + + return state; } -static void command_log_capture_finish(Jim_Interp *interp, Jim_Obj *tclOutput) +static void command_log_capture_finish(struct log_capture_state *state) { - log_remove_callback(tcl_output, tclOutput); - Jim_SetResult(interp, tclOutput); - Jim_DecrRefCount(interp, tclOutput); + if (NULL == state) + return; + + log_remove_callback(tcl_output, state); + + Jim_SetResult(state->interp, state->output); + Jim_DecrRefCount(state->interp, state->output); + + free(state); } static int command_retval_set(Jim_Interp *interp, int retval) @@ -164,15 +184,14 @@ static int script_command_run(Jim_Interp *interp, if (NULL == words) return JIM_ERR; - Jim_Obj *tclOutput = NULL; + struct log_capture_state *state = NULL; if (capture) - tclOutput = command_log_capture_start(interp); + state = command_log_capture_start(interp); struct command_context *cmd_ctx = current_command_context(); int retval = run_command(cmd_ctx, c, (const char **)words, nwords); - if (capture) - command_log_capture_finish(interp, tclOutput); + command_log_capture_finish(state); script_command_args_free(words, nwords); return command_retval_set(interp, retval); @@ -804,12 +823,12 @@ static int jim_capture(Jim_Interp *interp, int argc, Jim_Obj *const *argv) if (argc != 2) return JIM_ERR; - Jim_Obj *tclOutput = command_log_capture_start(interp); + struct log_capture_state *state = command_log_capture_start(interp); const char *str = Jim_GetString(argv[1], NULL); int retcode = Jim_Eval_Named(interp, str, __THIS__FILE__, __LINE__); - command_log_capture_finish(interp, tclOutput); + command_log_capture_finish(state); return retcode; } commit 7b2906de246bc37af99d432b3edf12e9f5f63521 Author: Zachary T Welch <zw...@su...> Date: Sun Nov 29 18:27:45 2009 -0800 do not extern 'interp' from command.c Adds 'interp' field to command_context, chasing the few remaining references to the global variable outside of the command module. diff --git a/src/helper/command.c b/src/helper/command.c index 319f081..5df4a45 100644 --- a/src/helper/command.c +++ b/src/helper/command.c @@ -1257,7 +1257,7 @@ struct command_context* command_init(const char *startup_tcl) #if !BUILD_ECOSBOARD Jim_InitEmbedded(); /* Create an interpreter */ - interp = Jim_CreateInterp(); + interp = context->interp = Jim_CreateInterp(); /* Add all the Jim core commands */ Jim_RegisterCoreCommands(interp); #endif diff --git a/src/helper/command.h b/src/helper/command.h index 0723596..f27364e 100644 --- a/src/helper/command.h +++ b/src/helper/command.h @@ -59,6 +59,7 @@ typedef int (*command_output_handler_t)(struct command_context *context, struct command_context { + Jim_Interp *interp; enum command_mode mode; struct command *commands; int current_target; @@ -359,8 +360,6 @@ void process_jim_events(void); #define ERROR_COMMAND_ARGUMENT_OVERFLOW (-604) #define ERROR_COMMAND_ARGUMENT_UNDERFLOW (-605) -extern Jim_Interp *interp; - int parse_ulong(const char *str, unsigned long *ul); int parse_ullong(const char *str, unsigned long long *ul); diff --git a/src/jtag/core.c b/src/jtag/core.c index 211b9d5..9230cc2 100644 --- a/src/jtag/core.c +++ b/src/jtag/core.c @@ -1535,7 +1535,7 @@ int jtag_init(struct command_context *cmd_ctx) if ((retval = jtag_execute_queue()) != ERROR_OK) return retval; - if (Jim_Eval_Named(interp, "jtag_init", __FILE__, __LINE__) != JIM_OK) + if (Jim_Eval_Named(cmd_ctx->interp, "jtag_init", __FILE__, __LINE__) != JIM_OK) return ERROR_FAIL; return ERROR_OK; diff --git a/src/openocd.c b/src/openocd.c index 2a65b4d..1be209a 100644 --- a/src/openocd.c +++ b/src/openocd.c @@ -277,7 +277,7 @@ int openocd_main(int argc, char *argv[]) return EXIT_FAILURE; #endif - ret = server_init(); + ret = server_init(cmd_ctx); if (ERROR_OK != ret) return EXIT_FAILURE; diff --git a/src/server/httpd.c b/src/server/httpd.c index 9fa5879..b346ca2 100644 --- a/src/server/httpd.c +++ b/src/server/httpd.c @@ -180,6 +180,7 @@ httpd_Jim_Command_formfetch(Jim_Interp *interp, struct httpd_request { int post; + Jim_Interp *interp; struct MHD_PostProcessor *postprocessor; //Jim_Obj *dict; @@ -208,7 +209,8 @@ static void request_completed(void *cls, struct MHD_Connection *connection, } /* append to said key in dictionary */ -static void append_key(struct httpd_request *r, const char *key, +static void append_key(Jim_Interp *interp, + struct httpd_request *r, const char *key, const char *data, size_t off, size_t size) { Jim_Obj *keyObj = Jim_NewStringObj(interp, key, -1); @@ -259,7 +261,7 @@ static int iterate_post(void *con_cls, enum MHD_ValueKind kind, { struct httpd_request *r = (struct httpd_request*) con_cls; - append_key(r, key, data, off, size); + append_key(r->interp, r, key, data, off, size); return MHD_YES; } @@ -268,12 +270,13 @@ static int record_arg(void *cls, enum MHD_ValueKind kind, const char *key, const char *value) { struct httpd_request *r = (struct httpd_request*) cls; - append_key(r, key, value, 0, strlen(value)); + append_key(r->interp, r, key, value, 0, strlen(value)); return MHD_YES; } -static int handle_request(struct MHD_Connection * connection, const char * url) +static int handle_request(Jim_Interp *interp, + struct MHD_Connection * connection, const char * url) { struct MHD_Response * response; @@ -358,6 +361,7 @@ static int ahc_echo_inner(void * cls, struct MHD_Connection * connection, const char * url, const char * method, const char * version, const char * upload_data, size_t * upload_data_size, void ** ptr) { + Jim_Interp *interp = (Jim_Interp *)cls; int post = 0; if (0 == strcmp(method, "POST")) @@ -384,7 +388,7 @@ static int ahc_echo_inner(void * cls, struct MHD_Connection * connection, memset(*ptr, 0, sizeof(struct httpd_request)); r = (struct httpd_request *) *ptr; - + r->interp = interp; r->post = post; Jim_SetVariableStr(interp, "httppostdata", Jim_NewDictObj(interp, NULL, 0)); @@ -437,7 +441,7 @@ static int ahc_echo_inner(void * cls, struct MHD_Connection * connection, url="index.tcl"; const char *file_name = alloc_printf("%s/%s", httpd_dir, url); - int result = handle_request(connection, file_name); + int result = handle_request(interp, connection, file_name); free((void *)file_name); return result; } @@ -487,7 +491,7 @@ int httpd_start(struct command_context *cmd_ctx) int port = 8888; LOG_USER("Launching httpd server on port %d", port); d = MHD_start_daemon(MHD_USE_SELECT_INTERNALLY, port, NULL, NULL, - &ahc_echo, NULL, /* could be data for handler, but we only have a single handler, use global variables instead */ + &ahc_echo, cmd_ctx->interp, MHD_OPTION_NOTIFY_COMPLETED, request_completed, NULL, /* Closure... what's that??? */ MHD_OPTION_END); if (d == NULL) diff --git a/src/server/server.c b/src/server/server.c index 256c590..a02d4a5 100644 --- a/src/server/server.c +++ b/src/server/server.c @@ -487,7 +487,7 @@ void sig_handler(int sig) { } #endif -int server_init(void) +int server_init(struct command_context *cmd_ctx) { #ifdef _WIN32 WORD wVersionRequested; @@ -518,7 +518,7 @@ int server_init(void) signal(SIGABRT, sig_handler); #endif - int ret = tcl_init(); + int ret = tcl_init(cmd_ctx); if (ERROR_OK != ret) return ret; diff --git a/src/server/server.h b/src/server/server.h index 5e86281..173de95 100644 --- a/src/server/server.h +++ b/src/server/server.h @@ -74,7 +74,7 @@ int add_service(char *name, enum connection_type type, unsigned short port, input_handler_t in_handler, connection_closed_handler_t close_handler, void *priv); -int server_init(void); +int server_init(struct command_context *cmd_ctx); int server_quit(void); int server_loop(struct command_context *command_context); diff --git a/src/server/tcl_server.c b/src/server/tcl_server.c index 22469a4..0824768 100644 --- a/src/server/tcl_server.c +++ b/src/server/tcl_server.c @@ -81,6 +81,7 @@ static int tcl_new_connection(struct connection *connection) static int tcl_input(struct connection *connection) { + Jim_Interp *interp = (Jim_Interp *)connection->priv; int retval; int i; ssize_t rlen; @@ -156,7 +157,7 @@ static int tcl_closed(struct connection *connection) return ERROR_OK; } -int tcl_init(void) +int tcl_init(struct command_context *cmd_ctx) { int retval; @@ -166,7 +167,9 @@ int tcl_init(void) return ERROR_OK; } - retval = add_service("tcl", CONNECTION_TCP, tcl_port, 1, tcl_new_connection, tcl_input, tcl_closed, NULL); + retval = add_service("tcl", CONNECTION_TCP, tcl_port, 1, + &tcl_new_connection, &tcl_input, + &tcl_closed, cmd_ctx->interp); return retval; } diff --git a/src/server/tcl_server.h b/src/server/tcl_server.h index 1f6ba62..e0d7b16 100644 --- a/src/server/tcl_server.h +++ b/src/server/tcl_server.h @@ -22,7 +22,7 @@ #include "server.h" -int tcl_init(void); +int tcl_init(struct command_context *cmd_ctx); int tcl_register_commands(struct command_context *cmd_ctx); #endif /* _TCL_SERVER_H_ */ diff --git a/src/target/target.c b/src/target/target.c index 4297258..31734b8 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -449,12 +449,12 @@ int target_process_reset(struct command_context *cmd_ctx, enum target_reset_mode jtag_poll_set_enabled(false); sprintf(buf, "ocd_process_reset %s", n->name); - retval = Jim_Eval(interp, buf); + retval = Jim_Eval(cmd_ctx->interp, buf); jtag_poll_set_enabled(save_poll); if (retval != JIM_OK) { - Jim_PrintErrorMessage(interp); + Jim_PrintErrorMessage(cmd_ctx->interp); return ERROR_FAIL; } @@ -759,6 +759,8 @@ err_write_phys_memory(struct target *target, uint32_t address, return ERROR_FAIL; } +static int handle_target(void *priv); + int target_init(struct command_context *cmd_ctx) { struct target *target; @@ -876,7 +878,7 @@ int target_init(struct command_context *cmd_ctx) { if ((retval = target_register_user_commands(cmd_ctx)) != ERROR_OK) return retval; - if ((retval = target_register_timer_callback(handle_target, 100, 1, NULL)) != ERROR_OK) + if ((retval = target_register_timer_callback(&handle_target, 100, 1, cmd_ctx->interp)) != ERROR_OK) return retval; } @@ -1796,8 +1798,9 @@ static void target_call_event_callbacks_all(enum target_event e) { } /* process target state changes */ -int handle_target(void *priv) +static int handle_target(void *priv) { + Jim_Interp *interp = (Jim_Interp *)priv; int retval = ERROR_OK; /* we do not want to recurse here... */ diff --git a/src/target/target.h b/src/target/target.h index af4727c..3e30714 100644 --- a/src/target/target.h +++ b/src/target/target.h @@ -251,7 +251,6 @@ int target_register_commands(struct command_context *cmd_ctx); int target_register_user_commands(struct command_context *cmd_ctx); int target_init(struct command_context *cmd_ctx); int target_examine(void); -int handle_target(void *priv); int target_process_reset(struct command_context *cmd_ctx, enum target_reset_mode reset_mode); commit 8e8a359af2a5ab3cc7c795e147aa0ca3ec06288f Author: Zachary T Welch <zw...@su...> Date: Sun Nov 29 18:21:59 2009 -0800 target: avoid using interp global variable Adds 'interp' to target_event_action structure to avoid using the global variable of the same name. diff --git a/src/target/target.c b/src/target/target.c index 3a84040..4297258 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -3524,9 +3524,9 @@ void target_handle_event(struct target *target, enum target_event e) e, Jim_Nvp_value2name_simple(nvp_target_event, e)->name, Jim_GetString(teap->body, NULL)); - if (Jim_EvalObj(interp, teap->body) != JIM_OK) + if (Jim_EvalObj(teap->interp, teap->body) != JIM_OK) { - Jim_PrintErrorMessage(interp); + Jim_PrintErrorMessage(teap->interp); } } } @@ -3668,9 +3668,10 @@ static int target_configure(Jim_GetOptInfo *goi, struct target *target) replace = false; } teap->event = n->value; + teap->interp = goi->interp; Jim_GetOpt_Obj(goi, &o); if (teap->body) { - Jim_DecrRefCount(interp, teap->body); + Jim_DecrRefCount(teap->interp, teap->body); } teap->body = Jim_DuplicateObj(goi->interp, o); /* @@ -3718,7 +3719,7 @@ static int target_configure(Jim_GetOptInfo *goi, struct target *target) goto no_params; } } - Jim_SetResult(interp, Jim_NewIntObj(goi->interp, target->working_area_virt)); + Jim_SetResult(goi->interp, Jim_NewIntObj(goi->interp, target->working_area_virt)); /* loop for more */ break; @@ -3736,7 +3737,7 @@ static int target_configure(Jim_GetOptInfo *goi, struct target *target) goto no_params; } } - Jim_SetResult(interp, Jim_NewIntObj(goi->interp, target->working_area_phys)); + Jim_SetResult(goi->interp, Jim_NewIntObj(goi->interp, target->working_area_phys)); /* loop for more */ break; @@ -3753,7 +3754,7 @@ static int target_configure(Jim_GetOptInfo *goi, struct target *target) goto no_params; } } - Jim_SetResult(interp, Jim_NewIntObj(goi->interp, target->working_area_size)); + Jim_SetResult(goi->interp, Jim_NewIntObj(goi->interp, target->working_area_size)); /* loop for more */ break; @@ -3771,7 +3772,7 @@ static int target_configure(Jim_GetOptInfo *goi, struct target *target) goto no_params; } } - Jim_SetResult(interp, Jim_NewIntObj(goi->interp, target->backup_working_area)); + Jim_SetResult(goi->interp, Jim_NewIntObj(goi->interp, target->backup_working_area)); /* loop for more e*/ break; @@ -3838,7 +3839,7 @@ static int target_configure(Jim_GetOptInfo *goi, struct target *target) goto no_params; } } - Jim_SetResultString(interp, target->tap->dotted_name, -1); + Jim_SetResultString(goi->interp, target->tap->dotted_name, -1); /* loop for more e*/ break; } @@ -4486,7 +4487,7 @@ static int target_create(Jim_GetOptInfo *goi) if (target->tap == NULL) { - Jim_SetResultString(interp, "-chain-position required when creating target", -1); + Jim_SetResultString(goi->interp, "-chain-position required when creating target", -1); e = JIM_ERR; } diff --git a/src/target/target.h b/src/target/target.h index 009ec17..af4727c 100644 --- a/src/target/target.h +++ b/src/target/target.h @@ -222,6 +222,7 @@ enum target_event struct target_event_action { enum target_event event; + Jim_Interp *interp; struct Jim_Obj *body; int has_percent; struct target_event_action *next; commit e1ee27026569a94e58648d9825dc000dd53130d1 Author: Zachary T Welch <zw...@su...> Date: Sun Nov 29 18:08:13 2009 -0800 jtag: avoid using interp global variable Adds 'interp' field to jtag_tap_event_action structure to avoid using the global variable of same name. diff --git a/src/jtag/jtag.h b/src/jtag/jtag.h index d4fafa3..ee96775 100644 --- a/src/jtag/jtag.h +++ b/src/jtag/jtag.h @@ -209,9 +209,14 @@ enum jtag_event { struct jtag_tap_event_action { - enum jtag_event event; - Jim_Obj* body; - struct jtag_tap_event_action* next; + /// The event for which this action will be triggered. + enum jtag_event event; + /// The interpreter to use for evaluating the @c body. + Jim_Interp *interp; + /// Contains a script to 'eval' when the @c event is triggered. + Jim_Obj *body; + // next action in linked list + struct jtag_tap_event_action *next; }; /** diff --git a/src/jtag/tcl.c b/src/jtag/tcl.c index 7ec7fa4..68bb21e 100644 --- a/src/jtag/tcl.c +++ b/src/jtag/tcl.c @@ -341,8 +341,9 @@ static int jtag_tap_configure_event(Jim_GetOptInfo *goi, struct jtag_tap * tap) if (!found) jteap = calloc(1, sizeof(*jteap)); else if (NULL != jteap->body) - Jim_DecrRefCount(interp, jteap->body); + Jim_DecrRefCount(goi->interp, jteap->body); + jteap->interp = goi->interp; jteap->event = n->value; Jim_Obj *o; @@ -359,6 +360,7 @@ static int jtag_tap_configure_event(Jim_GetOptInfo *goi, struct jtag_tap * tap) } else if (found) { + jteap->interp = goi->interp; Jim_SetResult(goi->interp, Jim_DuplicateObj(goi->interp, jteap->body)); } @@ -616,9 +618,9 @@ static void jtag_tap_handle_event(struct jtag_tap *tap, enum jtag_event e) tap->dotted_name, e, nvp->name, Jim_GetString(jteap->body, NULL)); - if (Jim_EvalObj(interp, jteap->body) != JIM_OK) + if (Jim_EvalObj(jteap->interp, jteap->body) != JIM_OK) { - Jim_PrintErrorMessage(interp); + Jim_PrintErrorMessage(jteap->interp); continue; } ----------------------------------------------------------------------- Summary of changes: src/helper/command.c | 87 +++++++++++++++++++++++++++++------------------ src/helper/command.h | 5 +-- src/jtag/core.c | 2 +- src/jtag/jtag.h | 11 ++++-- src/jtag/tcl.c | 8 +++-- src/openocd.c | 2 +- src/server/httpd.c | 18 ++++++---- src/server/server.c | 6 ++-- src/server/server.h | 2 +- src/server/tcl_server.c | 7 +++- src/server/tcl_server.h | 2 +- src/target/target.c | 30 +++++++++------- src/target/target.h | 2 +- 13 files changed, 110 insertions(+), 72 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: Zach W. <zw...@us...> - 2009-12-01 01:37:15
|
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 be65f497f5f50d6d037295d5f466db5314f99de1 (commit) via 5dd6457d2c06caed01d4b75ecf1415afc68b48ea (commit) via 3d204ec66a840849372ab4c0ec4526a6f8557106 (commit) via bc9ae740730efacc2daa3ecbdb0ee75601ec18df (commit) from c0630d8a58c525e09aa938c7a50d4c99d39a93a3 (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 be65f497f5f50d6d037295d5f466db5314f99de1 Author: Zachary T Welch <zw...@su...> Date: Sun Nov 29 16:48:40 2009 -0800 fix foo command group help messages Splits the old help strings to provide proper usage as well. diff --git a/src/hello.c b/src/hello.c index 2e5c928..cfd6e2f 100644 --- a/src/hello.c +++ b/src/hello.c @@ -58,19 +58,22 @@ static const struct command_registration foo_command_handlers[] = { .name = "bar", .handler = &handle_foo_command, .mode = COMMAND_ANY, - .help = "<address> [enable|disable] - an example command", + .usage = "<address> [enable|disable]", + .help = "an example command", }, { .name = "baz", .handler = &handle_foo_command, .mode = COMMAND_ANY, - .help = "<address> [enable|disable] - a sample command", + .usage = "<address> [enable|disable]", + .help = "a sample command", }, { .name = "flag", .handler = &handle_flag_command, .mode = COMMAND_ANY, - .help = "[on|off] - set a flag", + .usage = "[on|off]", + .help = "set a flag", }, COMMAND_REGISTRATION_DONE }; commit 5dd6457d2c06caed01d4b75ecf1415afc68b48ea Author: Zachary T Welch <zw...@su...> Date: Sun Nov 29 16:32:06 2009 -0800 make syntax errors respond with 'usage' The 'help' text will become more verbose, so its entire text will be far more than desired when you only borked your syntax. The usage still allows the commands to be looked up for more help. diff --git a/src/helper/command.c b/src/helper/command.c index 6031ce6..319f081 100644 --- a/src/helper/command.c +++ b/src/helper/command.c @@ -562,7 +562,7 @@ static int run_command(struct command_context *context, /* Print help for command */ char *full_name = command_name(c, ' '); if (NULL != full_name) { - command_run_linef(context, "help %s", full_name); + command_run_linef(context, "usage %s", full_name); free(full_name); } else retval = -ENOMEM; @@ -980,10 +980,10 @@ static int command_unknown(Jim_Interp *interp, int argc, Jim_Obj *const *argv) } else { - c = command_find(cmd_ctx->commands, "help"); + c = command_find(cmd_ctx->commands, "usage"); if (NULL == c) { - LOG_ERROR("unknown command, but help is missing too"); + LOG_ERROR("unknown command, but usage is missing too"); return JIM_ERR; } count = argc - remaining; diff --git a/src/helper/startup.tcl b/src/helper/startup.tcl index dda89c8..d1c73ef 100644 --- a/src/helper/startup.tcl +++ b/src/helper/startup.tcl @@ -25,7 +25,7 @@ proc ocd_bouncer {name args} { set errmsg "Command handler execution failed" } } else {if {$type == "group"} { - catch {eval ocd_help $name $args} + catch {eval ocd_usage $name $args} set errmsg [format "%s: command requires more arguments" \ [concat $name " " $args]] } else { commit 3d204ec66a840849372ab4c0ec4526a6f8557106 Author: Zachary T Welch <zw...@su...> Date: Sun Nov 29 16:30:00 2009 -0800 move improperly located documentation Somehow, the comment block for command handlers ended up associated with the output_handler. Move it to the command_handler_t declaration. diff --git a/src/helper/command.h b/src/helper/command.h index 72c5647..0723596 100644 --- a/src/helper/command.h +++ b/src/helper/command.h @@ -62,20 +62,6 @@ struct command_context enum command_mode mode; struct command *commands; int current_target; - /* Execute a command. - * - * If the command fails, it *MUST* return a value != ERROR_OK - * (many commands break this rule, patches welcome!) - * - * This is *especially* important for commands such as writing - * to flash or verifying memory. The reason is that those commands - * can be used by programs to determine if the operation succeded - * or not. If the operation failed, then a program can try - * an alternative approach. - * - * Returning ERROR_COMMAND_SYNTAX_ERROR will have the effect of - * printing out the syntax of the command. - */ command_output_handler_t output_handler; void *output_handler_priv; }; @@ -166,7 +152,23 @@ struct command_invocation { #define CMD_DATA CMD_CURRENT->jim_handler_data -/// The type signature for commands' handler functions. +/** + * The type signature for command handling functions. They are + * usually registered as part of command_registration, providing + * a high-level means for executing a command. + * + * If the command fails, it *MUST* return a value != ERROR_OK + * (many commands break this rule, patches welcome!) + * + * This is *especially* important for commands such as writing + * to flash or verifying memory. The reason is that those commands + * can be used by programs to determine if the operation succeded + * or not. If the operation failed, then a program can try + * an alternative approach. + * + * Returning ERROR_COMMAND_SYNTAX_ERROR will have the effect of + * printing out the syntax of the command. + */ typedef __COMMAND_HANDLER((*command_handler_t)); struct command commit bc9ae740730efacc2daa3ecbdb0ee75601ec18df Author: Zachary T Welch <zw...@su...> Date: Sun Nov 29 15:58:16 2009 -0800 improve command_done() API and docs command_done() does not need to return an error, but it needed Doxygen comment. Provide some for copy_command_context as well. Note: this audit revealed some potential bugs with the command context implementation. There was a reason that commands were added at the end of the list. Shallow copying of command_context means that the list is shared between them. And commands added at the top-level before the pre-existing commands will not be available in the shared context as they were before. Yikes! Fortunately, this does not seem to occur in general use, as 'add_help_text' gets registered in startup.tcl and claims the first slot in my own test cases. Thus, it seems that we have been masking the issue for now, but it shows the need for further architectural improvement in the core command module. diff --git a/src/helper/command.c b/src/helper/command.c index ac7c8d8..6031ce6 100644 --- a/src/helper/command.c +++ b/src/helper/command.c @@ -683,12 +683,12 @@ struct command_context* copy_command_context(struct command_context* context) return copy_context; } -int command_done(struct command_context *context) +void command_done(struct command_context *cmd_ctx) { - free(context); - context = NULL; + if (NULL == cmd_ctx) + return; - return ERROR_OK; + free(cmd_ctx); } /* find full path to file */ diff --git a/src/helper/command.h b/src/helper/command.h index 2d33484..72c5647 100644 --- a/src/helper/command.h +++ b/src/helper/command.h @@ -316,7 +316,6 @@ void command_set_handler_data(struct command *c, void *p); void command_set_output_handler(struct command_context* context, command_output_handler_t output_handler, void *priv); -struct command_context* copy_command_context(struct command_context* context); int command_context_mode(struct command_context *context, enum command_mode mode); @@ -324,7 +323,21 @@ int command_context_mode(struct command_context *context, enum command_mode mode * Creates a new command context using the startup TCL provided. */ struct command_context* command_init(const char *startup_tcl); -int command_done(struct command_context *context); +/** + * Creates a copy of an existing command context. This does not create + * a deep copy of the command list, so modifications in one context will + * affect all shared contexts. The caller must track reference counting + * and ensure the commands are freed before destroying the last instance. + * @param cmd_ctx The command_context that will be copied. + * @returns A new command_context with the same state as the original. + */ +struct command_context* copy_command_context(struct command_context* cmd_ctx); +/** + * Frees the resources associated with a command context. The commands + * are not removed, so unregister_all_commands() must be called first. + * @param cmd_ctx The command_context that will be destroyed. + */ +void command_done(struct command_context *context); void command_print(struct command_context *context, const char *format, ...) __attribute__ ((format (PRINTF_ATTRIBUTE_FORMAT, 2, 3))); ----------------------------------------------------------------------- Summary of changes: src/hello.c | 9 +++++-- src/helper/command.c | 14 ++++++------ src/helper/command.h | 49 +++++++++++++++++++++++++++++++---------------- src/helper/startup.tcl | 2 +- 4 files changed, 46 insertions(+), 28 deletions(-) hooks/post-receive -- Main OpenOCD repository |