Add init_board procedure executed after init_targets
authorFreddie Chopin <freddie.chopin@gmail.com>
Fri, 3 Feb 2012 19:37:45 +0000 (20:37 +0100)
committerPeter Stuge <peter@stuge.se>
Thu, 9 Feb 2012 18:09:02 +0000 (18:09 +0000)
This adds init_board procedure that behaves exactly the same as
init_targets - it can be overriden by "next level" scripts. This
procedure is executed after init_targets, allowing common stuff (jtag
chain, memory, flash, ...) to be configured in target script (via
init_target) and leaving rest (like additional memory, reset
configuration, reset-init handlers, ...) to be done in init_board.

This makes init_targets scheme more complete and easier to use - current
board scripts will not need new init_targets, because everything can be
"packed" in init_boards. Moreover it solves the problem of variables
being set in init_targets (executed after init), which were not
accessible by "linear" scripts (parsed before init). All that has to be
done is to enclose all code in board config file in init_board
procedure.

Change-Id: I0736b1ff9873a687966407d62b58ccf29a8e597b
Signed-off-by: Freddie Chopin <freddie.chopin@gmail.com>
Reviewed-on: http://openocd.zylin.com/427
Reviewed-by: Chris Morgan <chmorgan@gmail.com>
Tested-by: jenkins
Reviewed-by: Peter Stuge <peter@stuge.se>
src/target/startup.tcl
src/target/target.c

index 425e1ecfb0df3ec2457d3d89a8c86de36c2800e6..02cefb09b23a1b83413083a39979b89393395d5b 100644 (file)
@@ -159,3 +159,7 @@ proc armv4_5 params {
 # By default(classic) the config scripts will set up the target configuration
 proc init_targets {} {
 }
+
+# Additionally board config scripts can define a procedure init_board that will be executed after init and init_targets
+proc init_board {} {
+}
index 5b2117df71b44b47b7d325eec0ac824972052d51..f8326ea72b0800362140dab39aaccb2bac1b2ce4 100644 (file)
@@ -1033,6 +1033,10 @@ COMMAND_HANDLER(handle_target_init_command)
        if (ERROR_OK != retval)
                return retval;
 
+       retval = command_run_line(CMD_CTX, "init_board");
+       if (ERROR_OK != retval)
+               return retval;
+
        LOG_DEBUG("Initializing targets...");
        return target_init(CMD_CTX);
 }

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)