spi_flash: Make a deep copy of spi_slave structure
commit810e2cde30035d0de691805041ffeeff57f68027
authorFurquan Shaikh <furquan@chromium.org>
Tue, 6 Dec 2016 04:32:24 +0000 (5 20:32 -0800)
committerFurquan Shaikh <furquan@google.com>
Tue, 6 Dec 2016 06:17:28 +0000 (6 07:17 +0100)
tree99706a026be4551118b334773ccb61a6f5772005
parentd3d1f13599a042bfd7ecb5f11f5a8a76853b7f88
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>
17 files changed:
src/drivers/spi/adesto.c
src/drivers/spi/amic.c
src/drivers/spi/atmel.c
src/drivers/spi/eon.c
src/drivers/spi/gigadevice.c
src/drivers/spi/macronix.c
src/drivers/spi/spansion.c
src/drivers/spi/spi_flash.c
src/drivers/spi/spi_flash_internal.h
src/drivers/spi/sst.c
src/drivers/spi/stmicro.c
src/drivers/spi/winbond.c
src/include/spi_flash.h
src/soc/intel/apollolake/spi.c
src/soc/intel/skylake/flash_controller.c
src/soc/mediatek/mt8173/flash_controller.c
src/southbridge/intel/common/spi.c