or1k: remove unnecessary endianness byte swaps

Since adbg_wb_burst_write and adbg_wb_burst_read functions already
operate on correct endianness there is no point of swapping bytes
in or1k_jtag_read_cpu and or1k_jtag_write_cpu functions in
or1k_jtag_adv.c file only to be swapped again where they are used.

Endiannes byte swaps for dbg_if are moved to or1k_jtag_read_cpu and
or1k_jtag_write_cpu functions in or1k_jtag.c.

Signed-off-by: Marek Czerski <ma.czerski@gmail.com>
Signed-off-by: Franck Jullien <franck.jullien@gmail.com>
or1k.c: or1k_jtag_read_regs used to save register context

adv_debug_sys has burst mode which can be used in
or1k_jtag_read_regs function. This mode makes reading
whole set of registers at once much faster than reading
one at a time.

Signed-off-by: Marek Czerski <ma.czerski@gmail.com>
Signed-off-by: Franck Jullien <franck.jullien@gmail.com>
or1k: multiple reads/writes to/from cpu

or1k_jtag_read_cpu and or1k_jtag_write_cpu functions
can now perform multiple word operations.

- adv_debug_sys uses burst mode.
- dbg_if just reads/writes registers in a loop.

Signed-off-by: Marek Czerski <ma.czerski@gmail.com>
Signed-off-by: Franck Jullien <franck.jullien@gmail.com>
or1k_jtag_adv.c: add const qualifier

- Added const qualifier to data pointer in
adbg_wb_burst_write function since it does not change
the data.

- Casts cleanup: no more needed to cast to (void *)

Signed-off-by: Marek Czerski <ma.czerski@gmail.com>
Signed-off-by: Franck Jullien <franck.jullien@gmail.com>
or1k_jtag_adv.c: burst mode for cpu registers set

reading and writing register set is now performed with
burst operation.

TODO: if sr, npc and ppc would be in sequence in
or1k_core_reg structure (in terms of cpu bus address)
calls to or1k_jtag_read_cpu in or1k_jtag_read_regs and
or1k_jtag_write_cpu in or1k_jtag_write_regs could be
reduced to just two (first 32 registers, second 3 registers)

Signed-off-by: Marek Czerski <ma.czerski@gmail.com>
Signed-off-by: Franck Jullien <franck.jullien@gmail.com>
or1k.c: access to debug unit registers grouped

or1k_resume_or_step: instead of reading and writing
couple of times, it can be just one burst read and one
burst write.

Signed-off-by: Marek Czerski <ma.czerski@gmail.com>
Signed-off-by: Franck Jullien <franck.jullien@gmail.com>
or1k_resume_or_step: removed second write to npc reg

It appears that it is just redundant write.

Signed-off-by: Marek Czerski <ma.czerski@gmail.com>
Signed-off-by: Franck Jullien <franck.jullien@gmail.com>
or1k.c: corrected behaviour while stepping

- While single stepping we can't assume that cpu will be stalled
so quickly. After unstall, or1k_poll must be invoked to check if
cpu is stalled.

- When stepping we execute user code so parameter debug_execution
for or1k_resume_or_step function must be set to 0.

Signed-off-by: Marek Czerski <ma.czerski@gmail.com>
Signed-off-by: Franck Jullien <franck.jullien@gmail.com>
skeletal implementation of or1k_checksum_memory

added skeletal implementation of or1k_checksum_memory
(compare-sections executed from gdb will crash OpenOCD
withaout it)

Signed-off-by: Marek Czerski <ma.czerski@gmail.com>
Signed-off-by: Franck Jullien <franck.jullien@gmail.com>
or1k_jtag_adv.c: removed burst transfer size limit

Removed limit for word_count in adbg_wb_burst_write and
adbg_wb_burst_read.

Signed-off-by: Marek Czerski <ma.czerski@gmail.com>
Signed-off-by: Franck Jullien <franck.jullien@gmail.com>