swd: Introducing and implementing interface_bitbang

Introducing and implementing interface_bitbang infrastructure to
operate (read/write) on predefined interface_signal port pins (port
pin masks to be precise).

Change-Id: I9d1beb9b5f32d28ab2c833c21c0d69690381ddd0
Signed-off-by: Tomek CEDRO <cederom@tlen.pl>
swd: Added comment that src/target/adi_v5_swd.c should be removed

Added comment that src/target/adi_v5_swd.c should be removed and its
functionality should be only provided by arm_adi_v5.c (target part)
and the transport swd (transport part).

Change-Id: If5136700420163a9d3dea1ad8dfe3094790668dd
Signed-off-by: Tomek CEDRO <cederom@tlen.pl>
swd: Small file rename.

When proper source code directory structure is implemented filenames
need no prefix, I guess :-)

Change-Id: Ib77e2a362a35c886d7ce8efb745bb1c813e61b72
Signed-off-by: Tomek CEDRO <cederom@tlen.pl>
swd: Added interface configuration file for SWD-mode KT-LINK dongle.

Change-Id: I1a19d810e38d7c85ef5eed9d11fd2a8fc19801d0
Signed-off-by: Tomek CEDRO <cederom@tlen.pl>
swd: Bigger updates in Transport infrastructure

Functions renames to contain more consistent prefix oocd_transport_,
source code updates that was depending on these functions.

IMPORTANT: existing suspicious SWD implementation transport was
renamed to OLDSWD so if you want to use old swd drivers please rename
your transport to oldswd, it will be removed when transport work is
finished. Updated STLINK transport as well.

Change-Id: I41a07f51c1c43e466ed78f5bada76e4d2ca3bbb8
Signed-off-by: Tomek CEDRO <cederom@tlen.pl>
swd: Added CTX void pointer

swd: Added CTX void pointer to to hold context for arm dap specific
operations.

Change-Id: I5e5414b2ab083719f13f5b5b2862fde3ba43a434
Signed-off-by: Tomek CEDRO <cederom@tlen.pl>
swd: Added ft2232_swd to available interfaces to use.

Change-Id: I4a88074d5a51f102b879618afea5b3cd214078f1
Signed-off-by: Tomek CEDRO <cederom@tlen.pl>
swd: Introducing ktlink_swd layout for ft2232 driver.

Updated configuration files to use ktlink_jtag.

IMPORTANT: old layout was renamed to ktlink_jtag, please update your
configurations if necessary!

Change-Id: I46a658398820074ca47e6b73a51ce87d0c79559b
Signed-off-by: Tomek CEDRO <cederom@tlen.pl>
swd: Minor reorganization of includes in transport.

Header file should only contain self declarations, no other includes.

Change-Id: I9b6e443f7c44a767b241587819126bb895ee3a2f
Signed-off-by: Tomek CEDRO <cederom@tlen.pl>
swd: Initialization is marked as initialized

Initialization is marked as initialized after all initializations are
done, not before. When something goes wrong and the function cannot
handle errors user still can change the parameters and try to
reinitialize environment.

Change-Id: I04cd8bf892ff42f57567b4b5b3bd6ddeaa3406aa
Signed-off-by: Tomek CEDRO <cederom@tlen.pl>
swd: Moved Transport registration

Moved Transport registration from constructor-like functions into one
function oocd_transport_register_all() that is executed at program
startup. Registration ivocation can be moved, but contructor functions
caused totally unpredictable behavior on program linking time...

Change-Id: I8501046952ced75a95fcadd8f6645f3d5ea5c371
Signed-off-by: Tomek CEDRO <cederom@tlen.pl>
swd: Small reorganization of log/debug messages.

No functional changes.

Change-Id: I2dc561c11ddd6f6d98c50df018aa6e40a302f48f
Signed-off-by: Tomek CEDRO <cederom@tlen.pl>
swd: Introduce 'Interface Features'

To keep Interface API small, compact and readable, but versatile and
extensible at the same time 'Interface Features' are introduced.
Interface Features is a dynamic list of user definable driver
extensions that can provide additional functionalities to the
interface driver. Intelligent drivers can expose their hardware
specific operations this way, while generic drivers can get additional
applications with use of external libraries that will generate
additional features (ie. LibSWD for SWD support).

Change-Id: Ibfa72b4906d854572dfeb365d28bc41e0b6c3538
Signed-off-by: Tomek CEDRO <cederom@tlen.pl>
swd: Added LibSWD to autoconf and automake scripts.

The --disable-internal-libswd configure switch can disable build of
internal libswd submodule just in the same way as JimTCL integration
works. LibSWD submodule is also added to build and link process.

Change-Id: I53ff3659548c855352fd96c51496c744e41718e8
Signed-off-by: Tomek CEDRO <cederom@tlen.pl>
swd: Introducing SWD Transport files

Introducing SWD Transport files: core, libswd bridge, tcl interface.
Not yet part of the build.

Change-Id: I330193a0841fce91bbbfc972edc39a430ca0ea47
Signed-off-by: Tomek CEDRO <cederom@tlen.pl>
swd: Change transport mechanism

WARNING! This is a very big and serious change to internals and
TRANSPORT system of the OpenOCD. It changes Transport mechanism. It
makes SWD work, at least on IDCODE detection level.

Change-Id: Ieef90f09df089aa16f985d81f6bd5c51ccac27eb
Signed-off-by: Tomek CEDRO <cederom@tlen.pl>
swd: Separated MEM-AP for JTAG and SWD

SWD is the transport neutral trial to read from ARM MEM-AP, JTAG is
left for backward compatibility.

Change-Id: I5e6766f3f258d9b2d4cb08bb3169a66a789bfe1c
Signed-off-by: Tomek CEDRO <cederom@tlen.pl>
swd: Minor changes in transport log messages

Minor changes in transport log messages for better readability.

Change-Id: I0362f96a130a24fa749e18d820f2724b5e6bbf2b
Signed-off-by: Tomek CEDRO <cederom@tlen.pl>
swd: Added tcl/target/stm32f1x-swd.cfg

Added tcl/target/stm32f1x-swd.cfg for easy SWD testing of STM32F1x
target with KT-LINK interface.

Change-Id: I4ce5e5d820c83ab9955e6335f724574544956f75
Signed-off-by: Tomek CEDRO <cederom@tlen.pl>
swd: Added contrib/helloworlds

Added contrib/helloworlds to share example binary programs to test
various targets. Simple
contrib/helloworlds/arm/arm-cortex-m3/stm32primer2/toggle.{hex,bin}
was added to blink the LCD backlight and test Stm32Primer2.

Change-Id: I0baab1a0c854452c33ad463e9863b0234b15bde0
Signed-off-by: Tomek CEDRO <cederom@tlen.pl>