adapter/parport: Add device file support

Allow to specify the parallel port by its device file. Deprecate port
number support but keep it for backward compatibility.

This is one necessary step to remove direct I/O support for the parallel
port driver.

While at it, consistently return ERROR_JTAG_INIT_FAILED in case of a
failure in parport_init().

Change-Id: Ie68087f05ece4b32ccab9d9bdfbf7e1a779e9031
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/9152
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
This commit is contained in:
Marc Schink
2025-08-17 17:09:12 +00:00
committed by Antonio Borneo
parent 39ed0b0bba
commit 910e6ba2f0
2 changed files with 73 additions and 29 deletions

View File

@@ -3217,11 +3217,12 @@ The pin direction is given in the following table.
@tab 2
@end multitable
@deffn {Config Command} {parport port} port_number
Configure the number of the parallel port.
@deffn {Config Command} {parport port} file
Specify the device file of the parallel port device.
The parallel port device file is usually @file{/dev/parportX} on Linux and @file{/dev/ppiX} on FreeBSD.
When using PPDEV to access the parallel port, use the number of the parallel port file @file{/dev/parport} (Linux) or @file{/dev/ppi} (FreeBSD).
The default port number is 0.
For legacy reason, the port number @var{X} can be specified instead of the device file.
@b{Note:} Using the port number is a deprecated feature and will be removed in the future.
When using direct I/O, the number is the I/O port number.
The default port number is 0x378 (LTP1).