diff options
author | Freddie Chopin <freddie.chopin@gmail.com> | 2012-02-03 20:37:45 +0100 |
---|---|---|
committer | Peter Stuge <peter@stuge.se> | 2012-02-09 18:09:02 +0000 |
commit | 4db24acb931304355f59560789c5d92b99fb2962 (patch) | |
tree | 31a02af5e4aca34391477c8d4e382c4b992f8b87 /src/target/startup.tcl | |
parent | 394dcc8e34dd4aa8864cce1d42e29d99d0640740 (diff) | |
download | riscv-openocd-4db24acb931304355f59560789c5d92b99fb2962.zip riscv-openocd-4db24acb931304355f59560789c5d92b99fb2962.tar.gz riscv-openocd-4db24acb931304355f59560789c5d92b99fb2962.tar.bz2 |
Add init_board procedure executed after init_targets
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>
Diffstat (limited to 'src/target/startup.tcl')
-rw-r--r-- | src/target/startup.tcl | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/target/startup.tcl b/src/target/startup.tcl index 425e1ec..02cefb0 100644 --- a/src/target/startup.tcl +++ b/src/target/startup.tcl @@ -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 {} { +} |