diff options
-rw-r--r-- | drivers/mtd/devices/st_spi_fsm.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/mtd/devices/st_spi_fsm.c b/drivers/mtd/devices/st_spi_fsm.c index 06e6a5282044..9d1edf05701a 100644 --- a/drivers/mtd/devices/st_spi_fsm.c +++ b/drivers/mtd/devices/st_spi_fsm.c | |||
@@ -411,6 +411,28 @@ static struct stfsm_seq stfsm_seq_erase_sector = { | |||
411 | SEQ_CFG_STARTSEQ), | 411 | SEQ_CFG_STARTSEQ), |
412 | }; | 412 | }; |
413 | 413 | ||
414 | static int stfsm_n25q_en_32bit_addr_seq(struct stfsm_seq *seq) | ||
415 | { | ||
416 | seq->seq_opc[0] = (SEQ_OPC_PADS_1 | SEQ_OPC_CYCLES(8) | | ||
417 | SEQ_OPC_OPCODE(FLASH_CMD_EN4B_ADDR)); | ||
418 | seq->seq_opc[1] = (SEQ_OPC_PADS_1 | SEQ_OPC_CYCLES(8) | | ||
419 | SEQ_OPC_OPCODE(FLASH_CMD_WREN) | | ||
420 | SEQ_OPC_CSDEASSERT); | ||
421 | |||
422 | seq->seq[0] = STFSM_INST_CMD2; | ||
423 | seq->seq[1] = STFSM_INST_CMD1; | ||
424 | seq->seq[2] = STFSM_INST_WAIT; | ||
425 | seq->seq[3] = STFSM_INST_STOP; | ||
426 | |||
427 | seq->seq_cfg = (SEQ_CFG_PADS_1 | | ||
428 | SEQ_CFG_ERASE | | ||
429 | SEQ_CFG_READNOTWRITE | | ||
430 | SEQ_CFG_CSDEASSERT | | ||
431 | SEQ_CFG_STARTSEQ); | ||
432 | |||
433 | return 0; | ||
434 | } | ||
435 | |||
414 | static inline int stfsm_is_idle(struct stfsm *fsm) | 436 | static inline int stfsm_is_idle(struct stfsm *fsm) |
415 | { | 437 | { |
416 | return readl(fsm->base + SPI_FAST_SEQ_STA) & 0x10; | 438 | return readl(fsm->base + SPI_FAST_SEQ_STA) & 0x10; |