summaryrefslogtreecommitdiffstats
path: root/ft2232_spi.c
diff options
context:
space:
mode:
authorNico Huber <nico.h@gmx.de>2021-06-20 14:35:34 +0200
committerNico Huber <nico.h@gmx.de>2021-06-25 12:49:49 +0000
commit6518cf352d65330efdb8e30358a35a250d4222ba (patch)
tree944e0ef713a227a4f15be103819853b9e8bad4f3 /ft2232_spi.c
parent98bcd6d103d70a29ad6571cd0bfb6bf1a157c3e7 (diff)
downloadflashrom-6518cf352d65330efdb8e30358a35a250d4222ba.tar.gz
flashrom-6518cf352d65330efdb8e30358a35a250d4222ba.tar.bz2
flashrom-6518cf352d65330efdb8e30358a35a250d4222ba.zip
Revert "ft2232_spi.c: Generalize GPIOL pin control"
This reverts commit 3207844ec0b5dc16f9ae9ee45294213dbf6d060b. It used the `cs_bits` variable for its own purpose (not CS) which was only possible because the `cs_bits` semantics were broken earlier. It also lacks an update to the manpage. Change-Id: I4a95317b1cf1fc6df9471d0cfb8a6a8f40964fe3 Signed-off-by: Nico Huber <nico.h@gmx.de> Reviewed-on: https://review.coreboot.org/c/flashrom/+/55692 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Diffstat (limited to 'ft2232_spi.c')
-rw-r--r--ft2232_spi.c44
1 files changed, 1 insertions, 43 deletions
diff --git a/ft2232_spi.c b/ft2232_spi.c
index 3757a2440..78bf0fc6d 100644
--- a/ft2232_spi.c
+++ b/ft2232_spi.c
@@ -459,7 +459,7 @@ static int ft2232_spi_init(void)
}
free(arg);
- /* Allows setting multiple GPIOL pins to high, for example: csgpiol=012 */
+ /* Allows setting multiple GPIOL states, for example: csgpiol=012 */
arg = extract_programmer_param("csgpiol");
if (arg) {
unsigned int ngpios = strlen(arg);
@@ -480,48 +480,6 @@ static int ft2232_spi_init(void)
}
free(arg);
- /* Allows setting GPIOL pins high, low or input (high-z) */
- arg = extract_programmer_param("gpiol");
- if (arg) {
- int ok = 0;
- if (strlen(arg) == 4) {
- ok = 1;
- for (int i = 0; i < 4; i++) {
- unsigned int pin = i + 4;
- switch (toupper(arg[i])) {
- case 'H':
- cs_bits |= 1 << pin;
- pindir |= 1 << pin;
- break;
- case 'L':
- cs_bits &= ~(1 << pin);
- pindir |= 1 << pin;
- break;
- case 'Z':
- pindir &= ~(1 << pin);
- break;
- case 'X':
- break;
- default:
- ok = 0;
- }
- }
- }
- if (!ok) {
- msg_perr("Error: Invalid GPIOLs specified: \"%s\".\n"
- "Valid values are 4 character strings of H, L, Z and X.\n"
- " H - Set GPIOL output high\n"
- " L - Set GPIOL output low\n"
- " Z - Set GPIOL as input (high impedance)\n"
- " X - Leave as programmer default\n"
- "Example: gpiol=LZXH drives GPIOL 0 low, and GPIOL 3 high, sets GPIOL 1\n"
- "to an input and leaves GPIOL 2 set according to the programmer type.\n", arg);
- free(arg);
- return -2;
- }
- }
- free(arg);
-
msg_pdbg("Using device type %s %s ",
get_ft2232_vendorname(ft2232_vid, ft2232_type),
get_ft2232_devicename(ft2232_vid, ft2232_type));