spi_flash: Make a deep copy of spi_slave structure
Commit 36b81af
(spi: Pass pointer to spi_slave structure in
spi_setup_slave) changes the way spi_setup_slave handles the spi_slave
structure. Instead of expecting spi controller drivers to maintain
spi_slave structure in CAR_GLOBAL/data section, caller is expected to
manage the spi_slave structure. This requires that spi_flash drivers
maintain spi_slave structure and flash probe function needs to make a
copy of the passed in spi_slave structure.
This change fixes the regression on Lenovo X230 and other mainboards.
Change-Id: I0ad971eecaf3bfe301e9f95badc043193cc27cab
Signed-off-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-on: https://review.coreboot.org/17728
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Iru Cai <mytbk920423@gmail.com>
This commit is contained in:
committed by
Furquan Shaikh
parent
d3d1f13599
commit
810e2cde30
@@ -32,7 +32,7 @@
|
||||
#define STATUS_WIP 0x01
|
||||
|
||||
/* Send a single-byte command to the device and read the response */
|
||||
int spi_flash_cmd(struct spi_slave *spi, u8 cmd, void *response, size_t len);
|
||||
int spi_flash_cmd(const struct spi_slave *spi, u8 cmd, void *response, size_t len);
|
||||
|
||||
int spi_flash_cmd_read_fast(const struct spi_flash *flash, u32 offset,
|
||||
size_t len, void *data);
|
||||
@@ -44,8 +44,8 @@ int spi_flash_cmd_read_slow(const struct spi_flash *flash, u32 offset,
|
||||
* Send a multi-byte command to the device followed by (optional)
|
||||
* data. Used for programming the flash array, etc.
|
||||
*/
|
||||
int spi_flash_cmd_write(struct spi_slave *spi, const u8 *cmd, size_t cmd_len,
|
||||
const void *data, size_t data_len);
|
||||
int spi_flash_cmd_write(const struct spi_slave *spi, const u8 *cmd,
|
||||
size_t cmd_len, const void *data, size_t data_len);
|
||||
|
||||
/* Send a command to the device and wait for some bit to clear itself. */
|
||||
int spi_flash_cmd_poll_bit(const struct spi_flash *flash, unsigned long timeout,
|
||||
|
Reference in New Issue
Block a user