diff options
author | Lee Jones <lee.jones@linaro.org> | 2014-03-20 05:20:58 -0400 |
---|---|---|
committer | Brian Norris <computersforpeace@gmail.com> | 2014-03-20 07:17:19 -0400 |
commit | 30ca64f9f9db014755d632acffd0d2b507d7af6d (patch) | |
tree | 49a804ac569e09df3c355dcc6de17dc31c4f50e6 /drivers/mtd/devices/st_spi_fsm.c | |
parent | e514f10578ede5b5b07213cfebb57a2907e13f65 (diff) |
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/st_spi_fsm.c')
-rw-r--r-- | drivers/mtd/devices/st_spi_fsm.c | 14 |
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, | |||
668 | } | 668 | } |
669 | } | 669 | } |
670 | 670 | ||
671 | static int stfsm_write_fifo(struct stfsm *fsm, | ||
672 | const uint32_t *buf, const uint32_t size) | ||
673 | { | ||
674 | uint32_t words = size >> 2; | ||
675 | |||
676 | dev_dbg(fsm->dev, "writing %d bytes to FIFO\n", size); | ||
677 | |||
678 | BUG_ON((((uint32_t)buf) & 0x3) || (size & 0x3)); | ||
679 | |||
680 | writesl(fsm->base + SPI_FAST_SEQ_DATA_REG, buf, words); | ||
681 | |||
682 | return size; | ||
683 | } | ||
684 | |||
671 | static int stfsm_enter_32bit_addr(struct stfsm *fsm, int enter) | 685 | static int stfsm_enter_32bit_addr(struct stfsm *fsm, int enter) |
672 | { | 686 | { |
673 | struct stfsm_seq *seq = &stfsm_seq_en_32bit_addr; | 687 | struct stfsm_seq *seq = &stfsm_seq_en_32bit_addr; |