The code for the remote target specification for the OpenRISC Remote
JTAG protocol is found in the gdb
sub-directory. remote-or1k.c
contains the target
definition. The low-level interface is found in
or1k-jtag.c
with a shared header in
or1k-jtagh
.
The low-level interface is abstracted to a set of OpenRISC 1000
specific functions relating to the behavior of the target. Two
implementations are provided (in or1k-jtag.c
),
one for targets connected directly through the host's parallel port,
and one for targets connected over TCP/IP using the OpenRISC 1000
Remote JTAG Protocol.
void or1k_jtag_init (char *args); void or1k_jtag_close (); ULONGEST or1k_jtag_read_spr (unsigned int sprnum); void or1k_jtag_write_spr (unsigned int sprnum, ULONGEST data); int or1k_jtag_read_mem (CORE_ADDR addr, gdb_byte *bdata, int len); int or1k_jtag_write_mem (CORE_ADDR addr, const gdb_byte *bdata, int len); void or1k_jtag_stall (); void or1k_jtag_unstall (); void or1k_jtag_wait (int fast);
The choice of which implementation to use is determined by the
argument to or1k_jtag_init
.
or1k_jtag_init
and
or1k_jtag_close
. Initialize and close a
connection to the target. or1k_jtag_init
is
passed an argument string with the address of the target (either a
local device or a remote TCP/IP port address). An optional second
argument, reset
can be provided to indicate the
target should be reset once connected.
or1k_jtag_read_spr
and
or1k_jtag_write_spr
. Read or write a special
purpose register.
or1k_jtag_read_mem
and
or1k_jtag_write_mem
. Read or write a block of
memory.
or1k_jtag_stall
and
or1k_jtag_unstall
. Stall or unstall the target.
or1k_jtag_wait
. Wait for the target to stall.
The binaries for the remote target interface
(remote-or1k.o
and
or1k-jtag.o
) are added to the
configure.tgt
file for the OpenRISC targets. As
noted in Section 4.2, this only specifies
binaries, so dependencies on headers cannot be captured. To do this
requires editing the Makefile.in
.