summaryrefslogtreecommitdiff
path: root/src/soc/rockchip
diff options
context:
space:
mode:
Diffstat (limited to 'src/soc/rockchip')
-rw-r--r--src/soc/rockchip/rk3288/spi.c8
-rw-r--r--src/soc/rockchip/rk3288/spi.h2
2 files changed, 3 insertions, 7 deletions
diff --git a/src/soc/rockchip/rk3288/spi.c b/src/soc/rockchip/rk3288/spi.c
index 844d692aa4..3fb7291085 100644
--- a/src/soc/rockchip/rk3288/spi.c
+++ b/src/soc/rockchip/rk3288/spi.c
@@ -33,7 +33,6 @@
struct rockchip_spi_slave {
struct spi_slave slave;
struct rockchip_spi *regs;
- unsigned int speed_hz;
unsigned int fifo_size;
};
@@ -47,13 +46,11 @@ static struct rockchip_spi_slave rockchip_spi_slaves[3] = {
.rw = SPI_READ_FLAG | SPI_WRITE_FLAG,
},
.regs = (void *)SPI0_BASE,
- .speed_hz = 9000000,
.fifo_size = 32,
},
{
.slave = {.bus = 1, .rw = SPI_READ_FLAG,},
.regs = (void *)SPI1_BASE,
- .speed_hz = 11000000,
.fifo_size = 32,
},
{
@@ -62,7 +59,6 @@ static struct rockchip_spi_slave rockchip_spi_slaves[3] = {
.rw = SPI_READ_FLAG | SPI_WRITE_FLAG,
},
.regs = (void *)SPI2_BASE,
- .speed_hz = 11000000,
.fifo_size = 32,
},
@@ -110,7 +106,7 @@ static void rockchip_spi_set_clk(struct rockchip_spi *regs, unsigned int hz)
writel(clk_div, &regs->baudr);
}
-void rockchip_spi_init(unsigned int bus)
+void rockchip_spi_init(unsigned int bus, unsigned int speed_hz)
{
struct rockchip_spi_slave *espi = &rockchip_spi_slaves[bus];
struct rockchip_spi *regs = espi->regs;
@@ -118,7 +114,7 @@ void rockchip_spi_init(unsigned int bus)
rkclk_configure_spi(bus, SPI_SRCCLK_HZ);
rockchip_spi_enable_chip(regs, 0);
- rockchip_spi_set_clk(regs, espi->speed_hz);
+ rockchip_spi_set_clk(regs, speed_hz);
/* Operation Mode */
ctrlr0 = (SPI_OMOD_MASTER << SPI_OMOD_OFFSET);
diff --git a/src/soc/rockchip/rk3288/spi.h b/src/soc/rockchip/rk3288/spi.h
index c6880c2b23..bba38ef075 100644
--- a/src/soc/rockchip/rk3288/spi.h
+++ b/src/soc/rockchip/rk3288/spi.h
@@ -199,6 +199,6 @@ check_member(rockchip_spi, rxdr, 0x800);
int initialize_rockchip_spi_cbfs_media(struct cbfs_media *media,
void *buffer_address,
size_t buffer_size);
-void rockchip_spi_init(unsigned int bus);
+void rockchip_spi_init(unsigned int bus, unsigned int speed_hz);
#endif