diff options
author | Salvador Arroyo <sarroyofdez@yahoo.es> | 2013-03-03 10:50:42 +0100 |
---|---|---|
committer | Freddie Chopin <freddie.chopin@gmail.com> | 2013-04-20 19:32:10 +0000 |
commit | 109f37c16176019b00b5a026c4e42cdfeafd2dfd (patch) | |
tree | 39e5c4f3e333aa16eb61e5a254f072e36c34eb97 /src/target/mips32_pracc.h | |
parent | 1936646fc260c907ad18fc4c798dbbfb93447e18 (diff) | |
download | riscv-openocd-109f37c16176019b00b5a026c4e42cdfeafd2dfd.zip riscv-openocd-109f37c16176019b00b5a026c4e42cdfeafd2dfd.tar.gz riscv-openocd-109f37c16176019b00b5a026c4e42cdfeafd2dfd.tar.bz2 |
mips: m4k alternate pracc code. Patch 1
This patch and the following patches define another way of doing processor access without the need to read back
the pracc address as needed in current pracc code.
Current pracc code is executed linearly and unconditionally. The processor starts execution at 0xff200200
and the fetch address is ever incremented by 4, including the last instruction in the delay slot of the branch to start.
Most of the processor accesses are fetch and some are store accesses.
After a previous patch regarding the way of restoring registers (reg8 and reg9), there are no load processor accesses.
The pracc address for a store depends only on the store instruction given before.
m4k core has a 5 stage pipeline and the memory access is done in the 3rth stage. This means that the store access
will not arrive immediately after a store instruction, it appears after another instruction enters the pipeline.
For reference: MD00249 mips32 m4k manual.
A new struct pracc_queue_info is defined to help each function in generating the code. The field pracc_list holds in the
lower half the list of instructions and in the upper half the store addressess, if any. In this way the list can be used by
current code or by the new one to generate the sequence of pracc accesses.
For every pracc access only one scan to register "all" is used by calling the new function mips_ejtag_add_scan_96().
This function does not call jtag_execute_queue(), all the scans needed can be queued before calling for execution.
The pracc bit is not checked before execution, is checked after the queue has been executed.
Without calling the wait function the code works much faster, but the scan frequency must be limited. For pic32mx
with core clock at 4Mhz works up to 600Khz and with 8Mhz up to 1200. To increase the scan frequency a delay
between scans is added by calling jtag_add_cloks().
A time delay in nano seconds is stored in scan_delay, a new field in ejtag_info, and a handler is provided for it.
A mode field is added to ejtag_info to hold the working mode. If a time delay of 2ms (2000000 ns) or higher is set,
current code is executed, if lower, new code is executed.
Initial default values are set in function mips32_init_arch_info. A reset does not change this settings.
Change-Id: I266bdb386b24744435b6e29d8489a68c0c15ff65
Signed-off-by: Salvador Arroyo <sarroyofdez@yahoo.es>
Reviewed-on: http://openocd.zylin.com/1193
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
Diffstat (limited to 'src/target/mips32_pracc.h')
-rw-r--r-- | src/target/mips32_pracc.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/target/mips32_pracc.h b/src/target/mips32_pracc.h index 8f208f5..04d909e 100644 --- a/src/target/mips32_pracc.h +++ b/src/target/mips32_pracc.h @@ -51,6 +51,14 @@ #define NEG16(v) (((~(v)) + 1) & 0xFFFF) /*#define NEG18(v) (((~(v)) + 1) & 0x3FFFF)*/ +struct pracc_queue_info { + int retval; + const int max_code; + int code_count; + int store_count; + uint32_t *pracc_list; /* Code and store addresses */ +}; + int mips32_pracc_read_mem(struct mips_ejtag *ejtag_info, uint32_t addr, int size, int count, void *buf); int mips32_pracc_write_mem(struct mips_ejtag *ejtag_info, |