swd: Extended ft2232_layout structure

Extended ft2232_layout structure with bitbang_deny field that will
define port pins that are not allowed to manipulate by user (i.e. to
avoid hardware damage). Minor comment updates.

Change-Id: I7e28986d56ad433070afacd21b3fbff6d365c091
Signed-off-by: Tomek CEDRO <cederom@tlen.pl>
swd: Added ft2232_transfer() and ft2232_bitbang() implementation.

New interface routines (interface signal handling) are now part of the
build process (required by ft2232 transfer and bitbang functions).
Extended ft2232 based jtag driver with existing ft2232_bitbang
function.

Change-Id: I2d1e68782f702d385a8a48964417b5046a88e7c4
Signed-off-by: Tomek CEDRO <cederom@tlen.pl>
swd: Added ft2232_interface_swd driver declaration

Added ft2232_interface_swd driver declaration with default transport
set to swd_only. It is based on existing ft2232 and jtag_interface. It
contains ft2232_transfer and ft2232_bitbang functions by default, thus
it will work only with ft2232 devices for now. This will be the first
interface type to work with LibSWD.

Change-Id: Ie06ac0430ed588423f32a904b102983ce224a062
Signed-off-by: Tomek CEDRO <cederom@tlen.pl>
swd: Small reorganization of interface includes.

interface/interface.h now includes jtag/interface.h until we separate
current openocd interface drivers from jtag specific code.

Change-Id: I5e6ff4ca465eec61710791e7be2a3ba99e989cc6
Signed-off-by: Tomek CEDRO <cederom@tlen.pl>
swd: Implemented TCL interface to interface_signal infrastructure.

Change-Id: Ia769d4c6366742147d73505ffa655bf0dae9d3b3
Signed-off-by: Tomek CEDRO <cederom@tlen.pl>
swd: Added example interface_signal for KT-LINK

Added example interface_signal LED,SRST,SRSTin definitions to KT-LINK
interface for testing.

Change-Id: Idc8432f0835b4c3c00875f29d6ba00b90df405b3
Signed-off-by: Tomek CEDRO <cederom@tlen.pl>
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>