[PATCH 0/2] mtd: fsl-quadspi: add support to create dynamic LUT entry

Yogesh Gaur yogeshnarayan.gaur at nxp.com
Thu Jan 4 03:12:12 PST 2018


fsl-quadspi.c driver creates different LUT entries for various cmds like
read, write, erase, readid etc. These entries are created statically when
driver gets intiliazed.

To support various cmds e.g. different read cmds like SPINOR_OP_READ,
SPINOR_OP_READ_4B, SPINOR_OP_READ_FAST_4B, SPINOR_OP_READ_FAST,
SPINOR_OP_READ_1_1_2, SPINOR_OP_READ_1_2_2 etc driver needs to
have different LUT entries for different cmds.

FSL QUADSPI controller has limitation in number of LUT entries, max 16.
Also different flash devices can run on different cmds.

Thus to have support for different flash devices, this patch-set adds
support to create LUT entry in run-time based on the exact cmnd requested.
Information like cmnd opcode, protocol info, dummy bit info etc required
for creating LUT entries parsed from instance of passed 'struct spi_nor'.

Also update read capabilities as 1-4-4.

Tested with "S25FS512S" flash and have checked read, write, erase
functionality using mtd_debug utility.
For read have checked hwcaps as SNOR_HWCAPS_READ_FAST,
SNOR_HWCAPS_READ_1_2_2 and SNOR_HWCAPS_READ_1_4_4
i.e. read cmds SPINOR_OP_READ_FAST_4B [0x0c],
SPINOR_OP_READ_1_2_2_4B [0xbc] and SPINOR_OP_READ_1_4_4_4B [0xec]

Yogesh Gaur (2):
  mtd: fsl-quadspi: update hwcaps read capabilities as READ_1_4_4
  mtd: fsl-quadspi: add support to create dynamic LUT entry

 drivers/mtd/spi-nor/fsl-quadspi.c | 292 ++++++++++++++++++++------------------
 1 file changed, 157 insertions(+), 135 deletions(-)

-- 
1.9.1




More information about the linux-mtd mailing list