summaryrefslogtreecommitdiffstats
path: root/src/soc/qualcomm/sdm845/spi.c
diff options
context:
space:
mode:
authorMukesh Savaliya <msavaliy@codeaurora.org>2018-05-11 07:41:33 -0700
committerPatrick Georgi <pgeorgi@google.com>2018-12-05 14:09:59 +0000
commitb02452b490321d27a014c8a3421a474fc6689a92 (patch)
tree691177cbe9c4dce730e01d95253dc370ad953278 /src/soc/qualcomm/sdm845/spi.c
parent03f05cff2f9441cb20e78158e32160ec2e833350 (diff)
downloadcoreboot-b02452b490321d27a014c8a3421a474fc6689a92.tar.gz
coreboot-b02452b490321d27a014c8a3421a474fc6689a92.tar.bz2
coreboot-b02452b490321d27a014c8a3421a474fc6689a92.zip
sdm845: Add SPI-NOR flash driver
TEST=build & run Change-Id: Ie404faf37617d2ad792310709ca2063f9a372076 Signed-off-by: Mukesh Savaliya <msavaliy@codeaurora.org> Reviewed-on: https://review.coreboot.org/c/25392 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
Diffstat (limited to 'src/soc/qualcomm/sdm845/spi.c')
-rw-r--r--src/soc/qualcomm/sdm845/spi.c29
1 files changed, 7 insertions, 22 deletions
diff --git a/src/soc/qualcomm/sdm845/spi.c b/src/soc/qualcomm/sdm845/spi.c
index c04b15d3c822..e276e1d214a8 100644
--- a/src/soc/qualcomm/sdm845/spi.c
+++ b/src/soc/qualcomm/sdm845/spi.c
@@ -15,35 +15,20 @@
#include <spi-generic.h>
#include <spi_flash.h>
-
-static int spi_ctrlr_claim_bus(const struct spi_slave *slave)
-{
- return 0;
-}
-
-static void spi_ctrlr_release_bus(const struct spi_slave *slave)
-{
-
-}
-
-static int spi_ctrlr_xfer(const struct spi_slave *slave, const void *dout,
- size_t bytes_out, void *din, size_t bytes_in)
-{
- return 0;
-}
+#include <soc/qspi.h>
static const struct spi_ctrlr spi_ctrlr = {
- .claim_bus = spi_ctrlr_claim_bus,
- .release_bus = spi_ctrlr_release_bus,
- .xfer = spi_ctrlr_xfer,
- .max_xfer_size = 65535,
+ .claim_bus = sdm845_claim_bus,
+ .release_bus = sdm845_release_bus,
+ .xfer = sdm845_xfer,
+ .max_xfer_size = QSPI_MAX_PACKET_COUNT,
};
const struct spi_ctrlr_buses spi_ctrlr_bus_map[] = {
{
.ctrlr = &spi_ctrlr,
- .bus_start = 0,
- .bus_end = 0,
+ .bus_start = CONFIG_BOOT_DEVICE_SPI_FLASH_BUS,
+ .bus_end = CONFIG_BOOT_DEVICE_SPI_FLASH_BUS,
},
};