diff options
author | Suresh Gupta <suresh.gupta@nxp.com> | 2017-04-25 07:38:48 (GMT) |
---|---|---|
committer | Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com> | 2017-07-18 08:45:31 (GMT) |
commit | 9e38f605ce31100940db5b67bf39a8a9b4ee4264 (patch) | |
tree | e7335606c645e6179a0ff80780e2bc6bf8c04219 | |
parent | bf256a699070575d5c2282ddcdbb1515fab9f9a8 (diff) | |
download | u-boot-9e38f605ce31100940db5b67bf39a8a9b4ee4264.tar.xz |
spi: fsl_qspi: Add 4bytes address support
The QSPI support the direct 4bytes address command for flash
read/write/erase.
And the address can cover the whole QSPI memory space.
signed-off-by: Yuan Yao <yao.yuan@nxp.com>
-rw-r--r-- | drivers/spi/fsl_qspi.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/spi/fsl_qspi.c b/drivers/spi/fsl_qspi.c index e61c67b..117f3fa 100644 --- a/drivers/spi/fsl_qspi.c +++ b/drivers/spi/fsl_qspi.c @@ -25,7 +25,9 @@ DECLARE_GLOBAL_DATA_PTR; #define TX_BUFFER_SIZE 0x40 #endif -#define OFFSET_BITS_MASK GENMASK(23, 0) +#define OFFSET_BITS_MASK ((FSL_QSPI_FLASH_SIZE > SZ_16M) ? \ + GENMASK(27, 0) : GENMASK(23, 0)) + #define FLASH_STATUS_WEL 0x02 @@ -760,7 +762,10 @@ int qspi_xfer(struct fsl_qspi_priv *priv, unsigned int bitlen, if (dout) { if (flags & SPI_XFER_BEGIN) { priv->cur_seqid = *(u8 *)dout; - memcpy(&txbuf, dout, 4); + if (FSL_QSPI_FLASH_SIZE > SZ_16M && bytes > 4) + memcpy(&txbuf, dout + 1, 4); + else + memcpy(&txbuf, dout, 4); } if (flags == SPI_XFER_END) { |