Commit 9866fea4 authored by Sergei Miroshnichenko's avatar Sergei Miroshnichenko

RM#1380 stm32: qspi: Fix the write command for MT25Q

Return the configurable command for programming, as MT25Q doesn't
support the default SPINOR_OP_PP_4B command.
parent ba0e4e12
......@@ -439,7 +439,7 @@ static int write_page(struct stm32_qspi_priv *priv, u32 address, const u8 *buf,
writel(size - 1, &priv->regs->dlr);
writel(QSPI_CCR_FMODE_INDIRECT_WRITE
| SPINOR_OP_PP_4B
| CONFIG_STM32_QSPI_FAST_PROGRAM_CMD
| QSPI_CCR_IMODE_SINGLE_LINE
| QSPI_CCR_ADMODE_FOUR_LINES
| QSPI_CCR_ADSIZE_FOUR_BYTES
......
......@@ -107,7 +107,7 @@
* MT25Q Flash specific configs
*/
#define CONFIG_STM32_QSPI_FAST_READ_DUMMY_CYCLES 6
#define CONFIG_STM32_QSPI_FAST_PROGRAM_CMD 0x38
#define CONFIG_STM32_QSPI_FAST_PROGRAM_CMD 0x3e /* SPINOR_OP_FAST_PROG_4B */
#define CONFIG_STM32_QSPI_64KB_ERASE_TYP_TIME_MS 150
#define CONFIG_STM32_QSPI_256B_PROGRAM_TYP_TIME_US 350
......
......@@ -53,7 +53,7 @@
#define SPINOR_OP_RDCR 0x35 /* Read configuration register */
#define SPINOR_OP_RDFSR 0x70 /* Read flag status register */
#define SPINOR_OP_FAST_PROGRAM 0x38 /* EXTENDED QUAD INPUT FAST PROGRAM */
#define SPINOR_OP_FAST_PROG 0x38 /* EXTENDED QUAD INPUT FAST PROGRAM */
#define SPINOR_OP_FAST_READ 0xEB /* QUAD INPUT/OUTPUT FAST READ */
/* 4-byte address opcodes - used on Spansion and some Macronix flashes. */
......@@ -63,6 +63,7 @@
#define SPINOR_OP_READ4_1_1_4 0x6c /* Read data bytes (Quad SPI) */
#define SPINOR_OP_PP_4B 0x12 /* Page program (up to 256 bytes) */
#define SPINOR_OP_SE_4B 0xdc /* Sector erase (usually 64KiB) */
#define SPINOR_OP_FAST_PROG_4B 0x3e /* EXTENDED QUAD INPUT FAST PROGRAM */
#define SPINOR_OP_FAST_READ_4B 0xec /* QUAD INPUT/OUTPUT FAST READ */
/* Used for SST flashes only. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment