adapter: Rework parallel port driver
Make the driver more flexible and define adapter-specific configurations in Tcl instead of C using the adapter GPIO subsystem. The rework also includes coding style fixes and improvements of the documentation. All modifications are done such that backwards compatibility is ensured. Tested with Olimex ARM-JTAG cable [1] and APM32F103 target device on Linux and FreeBSD. The driver works on Linux using direct I/O and PPDEV. On FreeBSD, only PPDEV works. The build with direct I/O already failed before the patch. This problem will be fixed in a subsequent patch. The patch is not tested on Windows because there is no documentation for it. [1] https://www.olimex.com/Products/ARM/JTAG/ARM-JTAG/ Change-Id: Ib671d52a919eaf2959cf6365f2c8004257ae074c Signed-off-by: Marc Schink <dev@zapb.de> Reviewed-on: https://review.openocd.org/c/openocd/+/8943 Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Tested-by: jenkins
This commit is contained in:
committed by
Antonio Borneo
parent
3bec165e25
commit
7bc74de62d
26
tcl/interface/parport/altium.cfg
Normal file
26
tcl/interface/parport/altium.cfg
Normal file
@@ -0,0 +1,26 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# Altium Universal JTAG cable. Set the cable to Xilinx Mode and wire to target as follows:
|
||||
#
|
||||
# HARD TCK - Target TCK
|
||||
# HARD TMS - Target TMS
|
||||
# HARD TDI - Target TDI
|
||||
# HARD TDO - Target TDO
|
||||
# SOFT TCK - Target TRST
|
||||
# SOFT TDI - Target SRST
|
||||
|
||||
adapter driver parport
|
||||
|
||||
adapter gpio tdo 13 -exit-inactive
|
||||
adapter gpio trst 7 -active-high -exit-inactive
|
||||
adapter gpio tms 4 -exit-inactive
|
||||
adapter gpio tck 3 -exit-inactive
|
||||
adapter gpio tdi 2 -exit-inactive
|
||||
adapter gpio srst 9 -active-high -exit-inactive
|
||||
adapter gpio led 5 -exit-inactive
|
||||
|
||||
# Non-JTAG signal that is only necessary for the functionality of the adapter.
|
||||
# For details, refer to the documentation of the adapter.
|
||||
adapter gpio user0 6 -init-active -exit-inactive
|
||||
|
||||
transport select jtag
|
||||
16
tcl/interface/parport/amt-wiggler-old.cfg
Normal file
16
tcl/interface/parport/amt-wiggler-old.cfg
Normal file
@@ -0,0 +1,16 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
adapter driver parport
|
||||
|
||||
adapter gpio tdo 11 -active-low -exit-inactive
|
||||
adapter gpio trst 2 -exit-inactive
|
||||
adapter gpio tms 3 -exit-inactive
|
||||
adapter gpio tck 4 -exit-inactive
|
||||
adapter gpio tdi 5 -exit-inactive
|
||||
adapter gpio srst 6 -exit-inactive
|
||||
|
||||
# Non-JTAG signal that is only necessary for the functionality of the adapter.
|
||||
# For details, refer to the documentation of the adapter.
|
||||
adapter gpio user0 9 -init-active -exit-active
|
||||
|
||||
transport select jtag
|
||||
16
tcl/interface/parport/arm-jtag.cfg
Normal file
16
tcl/interface/parport/arm-jtag.cfg
Normal file
@@ -0,0 +1,16 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
adapter driver parport
|
||||
|
||||
adapter gpio tdo 11 -active-low -exit-inactive
|
||||
adapter gpio trst 2 -exit-inactive
|
||||
adapter gpio tms 3 -exit-inactive
|
||||
adapter gpio tck 4 -exit-inactive
|
||||
adapter gpio tdi 5 -exit-inactive
|
||||
adapter gpio srst 6 -active-high -exit-inactive
|
||||
|
||||
# Non-JTAG signal that is only necessary for the functionality of the adapter.
|
||||
# For details, refer to the documentation of the adapter.
|
||||
adapter gpio user0 9 -init-active -exit-active
|
||||
|
||||
transport select jtag
|
||||
12
tcl/interface/parport/aspo.cfg
Normal file
12
tcl/interface/parport/aspo.cfg
Normal file
@@ -0,0 +1,12 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
adapter driver parport
|
||||
|
||||
adapter gpio tdo 13 -exit-inactive
|
||||
adapter gpio trst 2 -init-active -exit-active
|
||||
adapter gpio tms 4 -active-low -exit-active
|
||||
adapter gpio tck 5 -exit-inactive
|
||||
adapter gpio tdi 3 -active-low -init-active -exit-active
|
||||
adapter gpio srst 6 -init-active -exit-active
|
||||
|
||||
transport select jtag
|
||||
10
tcl/interface/parport/chameleon.cfg
Normal file
10
tcl/interface/parport/chameleon.cfg
Normal file
@@ -0,0 +1,10 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
adapter driver parport
|
||||
|
||||
adapter gpio tdo 11 -active-low -exit-inactive
|
||||
adapter gpio tms 4 -exit-inactive
|
||||
adapter gpio tck 2 -exit-inactive
|
||||
adapter gpio tdi 3 -exit-inactive
|
||||
|
||||
transport select jtag
|
||||
@@ -1,17 +1,16 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#
|
||||
# Xilinx Parallel Cable III 'DLC 5' (and various clones)
|
||||
#
|
||||
# http://www.xilinx.com/itp/xilinx4/data/docs/pac/appendixb.html
|
||||
#
|
||||
|
||||
if { [info exists PARPORTADDR] } {
|
||||
set _PARPORTADDR $PARPORTADDR
|
||||
} else {
|
||||
set _PARPORTADDR 0
|
||||
}
|
||||
|
||||
adapter driver parport
|
||||
parport port $_PARPORTADDR
|
||||
parport cable dlc5
|
||||
|
||||
adapter gpio tdo 13 -exit-inactive
|
||||
adapter gpio tms 4 -exit-inactive
|
||||
adapter gpio tck 3 -exit-inactive
|
||||
adapter gpio tdi 2 -exit-inactive
|
||||
|
||||
# Non-JTAG signal that is only necessary for the functionality of the adapter.
|
||||
# For details, refer to the documentation of the adapter.
|
||||
adapter gpio user0 6 -init-active -exit-active
|
||||
|
||||
transport select jtag
|
||||
|
||||
12
tcl/interface/parport/flashlink.cfg
Normal file
12
tcl/interface/parport/flashlink.cfg
Normal file
@@ -0,0 +1,12 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
adapter driver parport
|
||||
|
||||
adapter gpio tdo 12 -active-low -exit-inactive
|
||||
adapter gpio trst 6 -exit-inactive
|
||||
adapter gpio tms 3 -exit-inactive
|
||||
adapter gpio tck 2 -exit-inactive
|
||||
adapter gpio tdi 4 -exit-inactive
|
||||
adapter gpio srst 7 -exit-inactive
|
||||
|
||||
transport select jtag
|
||||
12
tcl/interface/parport/lattice.cfg
Normal file
12
tcl/interface/parport/lattice.cfg
Normal file
@@ -0,0 +1,12 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
adapter driver parport
|
||||
|
||||
adapter gpio tdo 10 -exit-inactive
|
||||
adapter gpio trst 6 -active-high -init-active -exit-active
|
||||
adapter gpio tms 4 -exit-inactive
|
||||
adapter gpio tck 3 -exit-inactive
|
||||
adapter gpio tdi 2 -exit-inactive
|
||||
adapter gpio srst 5 -active-high -init-active -exit-active
|
||||
|
||||
transport select jtag
|
||||
11
tcl/interface/parport/triton.cfg
Normal file
11
tcl/interface/parport/triton.cfg
Normal file
@@ -0,0 +1,11 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
adapter driver parport
|
||||
|
||||
adapter gpio tdo 11 -active-low -exit-inactive
|
||||
adapter gpio trst 5 -active-high -exit-inactive
|
||||
adapter gpio tms 4 -exit-inactive
|
||||
adapter gpio tck 2 -exit-inactive
|
||||
adapter gpio tdi 3 -exit-inactive
|
||||
|
||||
transport select jtag
|
||||
16
tcl/interface/parport/wiggler-ntrst-inverted.cfg
Normal file
16
tcl/interface/parport/wiggler-ntrst-inverted.cfg
Normal file
@@ -0,0 +1,16 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
adapter driver parport
|
||||
|
||||
adapter gpio tdo 11 -active-low -exit-inactive
|
||||
adapter gpio trst 6 -exit-inactive
|
||||
adapter gpio tms 3 -exit-inactive
|
||||
adapter gpio tck 4 -exit-inactive
|
||||
adapter gpio tdi 5 -exit-inactive
|
||||
adapter gpio srst 2 -exit-inactive
|
||||
|
||||
# Non-JTAG signal that is only necessary for the functionality of the adapter.
|
||||
# For details, refer to the documentation of the adapter.
|
||||
adapter gpio user0 9 -init-active -exit-active
|
||||
|
||||
transport select jtag
|
||||
@@ -1,21 +1,16 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#
|
||||
# Parallel port wiggler (many clones available) on port 0x378
|
||||
#
|
||||
# Addresses: 0x378/LPT1 or 0x278/LPT2 ...
|
||||
#
|
||||
|
||||
if { [info exists PARPORTADDR] } {
|
||||
set _PARPORTADDR $PARPORTADDR
|
||||
} else {
|
||||
if {$tcl_platform(platform) eq "windows"} {
|
||||
set _PARPORTADDR 0x378
|
||||
} {
|
||||
set _PARPORTADDR 0
|
||||
}
|
||||
}
|
||||
|
||||
adapter driver parport
|
||||
parport port $_PARPORTADDR
|
||||
parport cable wiggler
|
||||
|
||||
adapter gpio tdo 11 -active-low -exit-inactive
|
||||
adapter gpio trst 6 -active-high -exit-inactive
|
||||
adapter gpio tms 3 -exit-inactive
|
||||
adapter gpio tck 4 -exit-inactive
|
||||
adapter gpio tdi 5 -exit-inactive
|
||||
adapter gpio srst 2 -exit-inactive
|
||||
|
||||
# Non-JTAG signal that is only necessary for the functionality of the adapter.
|
||||
# For details, refer to the documentation of the adapter.
|
||||
adapter gpio user0 9 -init-active -exit-active
|
||||
|
||||
transport select jtag
|
||||
|
||||
17
tcl/interface/parport/wiggler2.cfg
Normal file
17
tcl/interface/parport/wiggler2.cfg
Normal file
@@ -0,0 +1,17 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
adapter driver parport
|
||||
|
||||
adapter gpio tdo 11 -active-low -exit-inactive
|
||||
adapter gpio trst 6 -active-high -exit-inactive
|
||||
adapter gpio tms 3 -exit-inactive
|
||||
adapter gpio tck 4 -exit-inactive
|
||||
adapter gpio tdi 5 -exit-inactive
|
||||
adapter gpio srst 2 -exit-inactive
|
||||
adapter gpio led 7 -exit-inactive
|
||||
|
||||
# Non-JTAG signal that is only necessary for the functionality of the adapter.
|
||||
# For details, refer to the documentation of the adapter.
|
||||
adapter gpio user0 9 -init-active -exit-inactive
|
||||
|
||||
transport select jtag
|
||||
Reference in New Issue
Block a user