ac18e960ce
SWIM is implemented by (ab)using the HLA API. This was acceptable
when OpenOCD code did not provided a clear separation between
transports and related APIs. Still today SWIM in OpenOCD is only
supported by STLink, so the decision to re-use the HLA API was the
simpler way to implement it.
After commit efd1d64222
("adapter: switch from struct
jtag_interface to adapter_driver") the transports API are better
split and SWIM can be implemented as a separate set of API. This
would open the possibility to extend OpenOCD for other adapters
that provide SWIM, e.g. versaloon, or through SPI emulation [1].
Introduce a new set of files swim.[ch] to handle the SWIM API.
Beside the API that almost match the transport low-level data
communication (system_reset, read_mem, write_mem), add a further
API reconnect. Today, inside HLA STLink code, the reconnect is
implemented by hacking the HLA API state(). Please notice that
due to this hack the return type is incorrect; stlink_usb_state()
returns ERROR_OK in SWIM mode, while its return type is enum
target_state. Ignore the type mismatch and still call the HLA API
state in the new SWIM API reconnect. Further commit will fix it.
[1] http://kuku.eu.org/?projects/stm8spi/stm8spi
Change-Id: I52018e1e2200cbd41af8e5031f7b35dc761b61d6
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5528
Tested-by: jenkins
74 lines
1.4 KiB
Makefile
74 lines
1.4 KiB
Makefile
noinst_LTLIBRARIES += %D%/libjtag.la
|
|
|
|
JTAG_SRCS = %D%/commands.c
|
|
%C%_libjtag_la_LIBADD =
|
|
|
|
BUILT_SOURCES += %D%/minidriver_imp.h
|
|
CLEANFILES += %D%/minidriver_imp.h
|
|
|
|
if MINIDRIVER
|
|
|
|
if ZY1000
|
|
JTAG_SRCS += %D%/zy1000/zy1000.c
|
|
JTAG_MINIDRIVER_DIR = %D%/zy1000
|
|
endif
|
|
if MINIDRIVER_DUMMY
|
|
JTAG_SRCS += %D%/minidummy/minidummy.c
|
|
JTAG_MINIDRIVER_DIR = %D%/minidummy
|
|
endif
|
|
|
|
MINIDRIVER_IMP_DIR = %D%/minidriver
|
|
|
|
%D%/jtag_minidriver.h: $(JTAG_MINIDRIVER_DIR)/jtag_minidriver.h
|
|
cp $< $@
|
|
|
|
BUILT_SOURCES += %D%/jtag_minidriver.h
|
|
|
|
CLEANFILES += %D%/jtag_minidriver.h
|
|
|
|
else
|
|
|
|
MINIDRIVER_IMP_DIR = %D%/drivers
|
|
|
|
if HLADAPTER
|
|
include %D%/hla/Makefile.am
|
|
%C%_libjtag_la_LIBADD += $(top_builddir)/%D%/hla/libocdhla.la
|
|
endif
|
|
|
|
if AICE
|
|
include %D%/aice/Makefile.am
|
|
%C%_libjtag_la_LIBADD += $(top_builddir)/%D%/aice/libocdaice.la
|
|
endif
|
|
|
|
include %D%/drivers/Makefile.am
|
|
%C%_libjtag_la_LIBADD += $(top_builddir)/%D%/drivers/libocdjtagdrivers.la
|
|
|
|
endif
|
|
# endif // MINIDRIVER
|
|
|
|
%D%/minidriver_imp.h: $(MINIDRIVER_IMP_DIR)/minidriver_imp.h
|
|
cp $< $@
|
|
|
|
|
|
%C%_libjtag_la_SOURCES = \
|
|
%D%/adapter.c \
|
|
%D%/core.c \
|
|
%D%/interface.c \
|
|
%D%/interfaces.c \
|
|
%D%/tcl.c \
|
|
%D%/swim.c \
|
|
%D%/commands.h \
|
|
%D%/driver.h \
|
|
%D%/interface.h \
|
|
%D%/interfaces.h \
|
|
%D%/minidriver.h \
|
|
%D%/jtag.h \
|
|
%D%/minidriver/minidriver_imp.h \
|
|
%D%/minidummy/jtag_minidriver.h \
|
|
%D%/swd.h \
|
|
%D%/swim.h \
|
|
%D%/tcl.h \
|
|
$(JTAG_SRCS)
|
|
|
|
STARTUP_TCL_SRCS += %D%/startup.tcl
|