summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/devices
diff options
context:
space:
mode:
authorLee Jones <lee.jones@linaro.org>2014-03-20 10:20:58 +0100
committerBrian Norris <computersforpeace@gmail.com>2014-03-20 12:17:19 +0100
commit30ca64f9f9db014755d632acffd0d2b507d7af6d (patch)
tree49a804ac569e09df3c355dcc6de17dc31c4f50e6 /drivers/mtd/devices
parentmtd: st_spi_fsm: Add the ability to read from a Serial Flash device (diff)
downloadlinux-30ca64f9f9db014755d632acffd0d2b507d7af6d.tar.xz
linux-30ca64f9f9db014755d632acffd0d2b507d7af6d.zip
mtd: st_spi_fsm: Write to Flash via the FSM FIFO
When we write data to the FIFO the FSM Controller subsequently writes that data out to the Serial Flash chip. Acked-by Angus Clark <angus.clark@st.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Diffstat (limited to 'drivers/mtd/devices')
-rw-r--r--drivers/mtd/devices/st_spi_fsm.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/mtd/devices/st_spi_fsm.c b/drivers/mtd/devices/st_spi_fsm.c
index b1a65c1359d5..58b8761dc30e 100644
--- a/drivers/mtd/devices/st_spi_fsm.c
+++ b/drivers/mtd/devices/st_spi_fsm.c
@@ -668,6 +668,20 @@ static void stfsm_read_fifo(struct stfsm *fsm, uint32_t *buf,
}
}
+static int stfsm_write_fifo(struct stfsm *fsm,
+ const uint32_t *buf, const uint32_t size)
+{
+ uint32_t words = size >> 2;
+
+ dev_dbg(fsm->dev, "writing %d bytes to FIFO\n", size);
+
+ BUG_ON((((uint32_t)buf) & 0x3) || (size & 0x3));
+
+ writesl(fsm->base + SPI_FAST_SEQ_DATA_REG, buf, words);
+
+ return size;
+}
+
static int stfsm_enter_32bit_addr(struct stfsm *fsm, int enter)
{
struct stfsm_seq *seq = &stfsm_seq_en_32bit_addr;