[coreboot-gerrit] Change in coreboot[master]: soc/marvell/armada38x: Move spi driver to use spi_bus_map

Furquan Shaikh (Code Review) gerrit at coreboot.org
Fri May 19 01:03:30 CEST 2017


Furquan Shaikh has uploaded a new change for review. ( https://review.coreboot.org/19774 )

Change subject: soc/marvell/armada38x: Move spi driver to use spi_bus_map
......................................................................

soc/marvell/armada38x: 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: I795ecd825d03a3a915222da5e920bfd581567d5f
Signed-off-by: Furquan Shaikh <furquan at chromium.org>
---
M src/soc/marvell/armada38x/spi.c
1 file changed, 16 insertions(+), 8 deletions(-)


  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/74/19774/1

diff --git a/src/soc/marvell/armada38x/spi.c b/src/soc/marvell/armada38x/spi.c
index 47631f4..f7d1714 100644
--- a/src/soc/marvell/armada38x/spi.c
+++ b/src/soc/marvell/armada38x/spi.c
@@ -471,18 +471,26 @@
 	return ret;
 }
 
+static int spi_ctrlr_setup(const struct spi_slave *slave)
+{
+	mv_spi_sys_init(bus, cs, CONFIG_SF_DEFAULT_SPEED);
+	return 0;
+}
+
 static const spi_ctrlr spi_ctrlr = {
+	.setup = spi_ctrlr_setup,
 	.claim_bus = spi_ctrlr_claim_bus,
 	.release_bus = spi_ctrlr_release_bus,
 	.xfer = spi_ctrlr_xfer,
 	.max_xfer_size = SPI_CTRLR_DEFAULT_MAX_XFER_SIZE,
 };
 
-int spi_setup_slave(unsigned int bus, unsigned int cs, struct spi_slave *slave)
-{
-	slave->bus = bus;
-	slave->cs = cs;
-	slave->ctrlr = &spi_ctrlr;
-	mv_spi_sys_init(bus, cs, CONFIG_SF_DEFAULT_SPEED);
-	return 0;
-}
+const struct spi_ctrlr_buses spi_ctrlr_bus_map[] = {
+	{
+		.ctrlr = &spi_ctrlr,
+		.bus_start = 0,
+		.bus_end = 1,
+	},
+};
+
+const size_t spi_ctrlr_bus_map_count = ARRAY_SIZE(spi_ctrlr_bus_map);

-- 
To view, visit https://review.coreboot.org/19774
To unsubscribe, visit https://review.coreboot.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I795ecd825d03a3a915222da5e920bfd581567d5f
Gerrit-PatchSet: 1
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Owner: Furquan Shaikh <furquan at google.com>



More information about the coreboot-gerrit mailing list