summaryrefslogtreecommitdiff
path: root/src/southbridge/amd
diff options
context:
space:
mode:
authorFurquan Shaikh <furquan@chromium.org>2017-05-18 14:58:49 -0700
committerFurquan Shaikh <furquan@google.com>2017-05-24 04:43:04 +0200
commit12eca76469670d444897e67368a0d0a70787ad52 (patch)
tree350ad5f91d68279e294a52d551f5767a25a1e56c /src/southbridge/amd
parent2cd03f1696024d00a86865dbb7b6c14b5a7129a9 (diff)
southbridge/amd: 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: I2a789cff40fb0e6bd6d84565531d847afb3f8bed Signed-off-by: Furquan Shaikh <furquan@chromium.org> Reviewed-on: https://review.coreboot.org/19780 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-by: Philippe Mathieu-Daudé <philippe.mathieu.daude@gmail.com>
Diffstat (limited to 'src/southbridge/amd')
-rw-r--r--src/southbridge/amd/agesa/hudson/spi.c16
-rw-r--r--src/southbridge/amd/cimx/sb800/spi.c16
-rw-r--r--src/southbridge/amd/sb700/spi.c16
3 files changed, 27 insertions, 21 deletions
diff --git a/src/southbridge/amd/agesa/hudson/spi.c b/src/southbridge/amd/agesa/hudson/spi.c
index 1afe3e0ded..71fddc629d 100644
--- a/src/southbridge/amd/agesa/hudson/spi.c
+++ b/src/southbridge/amd/agesa/hudson/spi.c
@@ -167,10 +167,12 @@ static const struct spi_ctrlr spi_ctrlr = {
.deduct_cmd_len = true,
};
-int spi_setup_slave(unsigned int bus, unsigned int cs, struct spi_slave *slave)
-{
- slave->bus = bus;
- slave->cs = cs;
- slave->ctrlr = &spi_ctrlr;
- return 0;
-}
+const struct spi_ctrlr_buses spi_ctrlr_bus_map[] = {
+ {
+ .ctrlr = &spi_ctrlr,
+ .bus_start = 0,
+ .bus_end = 0,
+ },
+};
+
+const size_t spi_ctrlr_bus_map_count = ARRAY_SIZE(spi_ctrlr_bus_map);
diff --git a/src/southbridge/amd/cimx/sb800/spi.c b/src/southbridge/amd/cimx/sb800/spi.c
index a6649251d1..f2d62144ee 100644
--- a/src/southbridge/amd/cimx/sb800/spi.c
+++ b/src/southbridge/amd/cimx/sb800/spi.c
@@ -158,10 +158,12 @@ static const struct spi_ctrlr spi_ctrlr = {
.deduct_cmd_len = true,
};
-int spi_setup_slave(unsigned int bus, unsigned int cs, struct spi_slave *slave)
-{
- slave->bus = bus;
- slave->cs = cs;
- slave->ctrlr = &spi_ctrlr;
- return 0;
-}
+const struct spi_ctrlr_buses spi_ctrlr_bus_map[] = {
+ {
+ .ctrlr = &spi_ctrlr,
+ .bus_start = 0,
+ .bus_end = 0,
+ },
+};
+
+const size_t spi_ctrlr_bus_map_count = ARRAY_SIZE(spi_ctrlr_bus_map);
diff --git a/src/southbridge/amd/sb700/spi.c b/src/southbridge/amd/sb700/spi.c
index 9731896803..df44c0475d 100644
--- a/src/southbridge/amd/sb700/spi.c
+++ b/src/southbridge/amd/sb700/spi.c
@@ -120,10 +120,12 @@ static const struct spi_ctrlr spi_ctrlr = {
.deduct_cmd_len = true,
};
-int spi_setup_slave(unsigned int bus, unsigned int cs, struct spi_slave *slave)
-{
- slave->bus = bus;
- slave->cs = cs;
- slave->ctrlr = &spi_ctrlr;
- return 0;
-}
+const struct spi_ctrlr_buses spi_ctrlr_bus_map[] = {
+ {
+ .ctrlr = &spi_ctrlr,
+ .bus_start = 0,
+ .bus_end = 0,
+ },
+};
+
+const size_t spi_ctrlr_bus_map_count = ARRAY_SIZE(spi_ctrlr_bus_map);