mirror of
				https://review.coreboot.org/flashrom.git
				synced 2025-10-31 05:10:41 +01:00 
			
		
		
		
	Revert "ft2232_spi: Enhance csgpiol parameter for FT2232"
This reverts commit ba6575de82.
Technically, the only thing that is wrong here is the lack of docu-
mentation (manpage update). However, as this change was succeeded by
a regressing fixup patch, it seems likely that the meaning of the
`csgpiol` parameter was just misunderstood and these changes were
not what the author intended.
Change-Id: I460237b9d275b1cd1d8a069f852d17dea393b14e
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/55694
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
			
			
This commit is contained in:
		
							
								
								
									
										40
									
								
								ft2232_spi.c
									
									
									
									
									
								
							
							
						
						
									
										40
									
								
								ft2232_spi.c
									
									
									
									
									
								
							| @@ -88,17 +88,10 @@ static const struct dev_entry devs_ft2232spi[] = { | |||||||
|  |  | ||||||
| /* The variables cs_bits and pindir store the values for the "set data bits low byte" MPSSE command that | /* The variables cs_bits and pindir store the values for the "set data bits low byte" MPSSE command that | ||||||
|  * sets the initial state and the direction of the I/O pins. The pin offsets are as follows: |  * sets the initial state and the direction of the I/O pins. The pin offsets are as follows: | ||||||
|  * TCK/SK is bit 0. |  * SCK is bit 0. | ||||||
|  * TDI/DO is bit 1. |  * DO  is bit 1. | ||||||
|  * TDO/DI is bit 2. |  * DI  is bit 2. | ||||||
|  * TMS/CS is bit 3. |  * CS  is bit 3. | ||||||
|  * GPIOL0 is bit 4. |  | ||||||
|  * GPIOL1 is bit 5. |  | ||||||
|  * GPIOL2 is bit 6. |  | ||||||
|  * GPIOL3 is bit 7. |  | ||||||
|  * |  | ||||||
|  * The pin signal direction bit offsets follow the same order; 0 means that |  | ||||||
|  * pin at the matching bit index is an input, 1 means pin is an output. |  | ||||||
|  * |  * | ||||||
|  * The default values (set below in ft2232_spi_init) are used for most devices: |  * The default values (set below in ft2232_spi_init) are used for most devices: | ||||||
|  *  value: 0x08  CS=high, DI=low, DO=low, SK=low |  *  value: 0x08  CS=high, DI=low, DO=low, SK=low | ||||||
| @@ -459,24 +452,19 @@ static int ft2232_spi_init(void) | |||||||
| 	} | 	} | ||||||
| 	free(arg); | 	free(arg); | ||||||
|  |  | ||||||
| 	/* Allows setting multiple GPIOL states, for example: csgpiol=012 */ |  | ||||||
| 	arg = extract_programmer_param("csgpiol"); | 	arg = extract_programmer_param("csgpiol"); | ||||||
| 	if (arg) { | 	if (arg) { | ||||||
| 		unsigned int ngpios = strlen(arg); | 		char *endptr; | ||||||
| 		for (unsigned int i = 0; i <= ngpios; i++) { | 		unsigned int temp = strtoul(arg, &endptr, 10); | ||||||
| 			int temp = arg[i] - '0'; | 		if (*endptr || endptr == arg || temp > 3) { | ||||||
| 			if (ngpios == 0 || (ngpios != i && (temp < 0 || temp > 3))) { | 			msg_perr("Error: Invalid GPIOL specified: \"%s\".\n" | ||||||
| 				msg_perr("Error: Invalid GPIOLs specified: \"%s\".\n" | 				 "Valid values are between 0 and 3.\n", arg); | ||||||
| 					 "Valid values are numbers between 0 and 3. " | 			free(arg); | ||||||
| 					 "Multiple GPIOLs can be specified.\n", arg); | 			return -2; | ||||||
| 				free(arg); |  | ||||||
| 				return -2; |  | ||||||
| 			} else { |  | ||||||
| 				unsigned int pin = temp + 4; |  | ||||||
| 				cs_bits |= 1 << pin; |  | ||||||
| 				pindir |= 1 << pin; |  | ||||||
| 			} |  | ||||||
| 		} | 		} | ||||||
|  | 		unsigned int pin = temp + 4; | ||||||
|  | 		cs_bits |= 1 << pin; | ||||||
|  | 		pindir |= 1 << pin; | ||||||
| 	} | 	} | ||||||
| 	free(arg); | 	free(arg); | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Nico Huber
					Nico Huber