mirror of
https://github.com/ipxe/ipxe
synced 2025-12-26 09:32:33 +03:00
[spi] Add address-length autodetection to the SPI bit-bashing code
Several SPI chips will respond to an SPI read command with a dummy zero bit immediately prior to the first real data bit. This can be used to autodetect the address length, provided that the command length and data length are already known, and that the MISO data line is tied high. Tested-by: Thomas Miletich <thomas.miletich@gmail.com> Debugged-by: Thomas Miletich <thomas.miletich@gmail.com>
This commit is contained in:
@@ -45,6 +45,7 @@ extern int threewire_read ( struct nvs_device *nvs, unsigned int address,
|
||||
void *data, size_t len );
|
||||
extern int threewire_write ( struct nvs_device *nvs, unsigned int address,
|
||||
const void *data, size_t len );
|
||||
extern int threewire_detect_address_len ( struct spi_device *device );
|
||||
|
||||
/**
|
||||
* @defgroup tdevs Three-wire device types
|
||||
|
||||
Reference in New Issue
Block a user