[coreboot-gerrit] Change in coreboot[master]: soc/broadcom/cygnus: Move spi driver to use spi_bus_map
Furquan Shaikh (Code Review)
gerrit at coreboot.org
Wed May 24 04:39:36 CEST 2017
Furquan Shaikh has submitted this change and it was merged. ( https://review.coreboot.org/19773 )
Change subject: soc/broadcom/cygnus: Move spi driver to use spi_bus_map
......................................................................
soc/broadcom/cygnus: Move spi driver to use spi_bus_map
This is in preparation to get rid of the strong spi_setup_slave
implemented by different platforms.
BUG=b:38430839
Change-Id: I48b242dd6226e392ed0f403051843b3ae02cd9a4
Signed-off-by: Furquan Shaikh <furquan at chromium.org>
Reviewed-on: https://review.coreboot.org/19773
Tested-by: build bot (Jenkins) <no-reply at coreboot.org>
Reviewed-by: Aaron Durbin <adurbin at chromium.org>
Reviewed-by: Philippe Mathieu-Daudé <philippe.mathieu.daude at gmail.com>
---
M src/soc/broadcom/cygnus/spi.c
1 file changed, 20 insertions(+), 13 deletions(-)
Approvals:
Aaron Durbin: Looks good to me, approved
Philippe Mathieu-Daudé: Looks good to me, but someone else must approve
build bot (Jenkins): Verified
diff --git a/src/soc/broadcom/cygnus/spi.c b/src/soc/broadcom/cygnus/spi.c
index fde21ba..37d7c2a 100644
--- a/src/soc/broadcom/cygnus/spi.c
+++ b/src/soc/broadcom/cygnus/spi.c
@@ -275,22 +275,10 @@
return 0;
}
-static const struct spi_ctrlr spi_ctrlr = {
- .claim_bus = spi_ctrlr_claim_bus,
- .release_bus = spi_ctrlr_release_bus,
- .xfer = spi_ctrlr_xfer,
- .xfer_vector = spi_xfer_two_vectors,
- .max_xfer_size = 65535,
-};
-
-int spi_setup_slave(unsigned int bus, unsigned int cs, struct spi_slave *slave)
+static int spi_ctrlr_setup(const struct spi_slave *slave)
{
struct qspi_priv *priv = &qspi_slave;
unsigned int spbr;
-
- slave->bus = bus;
- slave->cs = cs;
- slave->ctrlr = &spi_ctrlr;
priv->max_hz = QSPI_MAX_HZ;
priv->spi_mode = QSPI_MODE;
@@ -319,3 +307,22 @@
return 0;
}
+
+static const struct spi_ctrlr spi_ctrlr = {
+ .setup = spi_ctrlr_setup,
+ .claim_bus = spi_ctrlr_claim_bus,
+ .release_bus = spi_ctrlr_release_bus,
+ .xfer = spi_ctrlr_xfer,
+ .xfer_vector = spi_xfer_two_vectors,
+ .max_xfer_size = 65535,
+};
+
+const struct spi_ctrlr_buses spi_ctrlr_bus_map[] = {
+ {
+ .ctrlr = &spi_ctrlr,
+ .bus_start = CONFIG_BOOT_DEVICE_SPI_FLASH_BUS,
+ .bus_end = CONFIG_BOOT_DEVICE_SPI_FLASH_BUS,
+ },
+};
+
+const size_t spi_ctrlr_bus_map_count = ARRAY_SIZE(spi_ctrlr_bus_map);
--
To view, visit https://review.coreboot.org/19773
To unsubscribe, visit https://review.coreboot.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I48b242dd6226e392ed0f403051843b3ae02cd9a4
Gerrit-PatchSet: 6
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Owner: Furquan Shaikh <furquan at google.com>
Gerrit-Reviewer: Aaron Durbin <adurbin at chromium.org>
Gerrit-Reviewer: Duncan Laurie <dlaurie at chromium.org>
Gerrit-Reviewer: Furquan Shaikh <furquan at google.com>
Gerrit-Reviewer: Paul Menzel <paulepanter at users.sourceforge.net>
Gerrit-Reviewer: Philippe Mathieu-Daudé <philippe.mathieu.daude at gmail.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply at coreboot.org>
More information about the coreboot-gerrit
mailing list