summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/nand/raw/nand_timings.c
diff options
context:
space:
mode:
authorMiquel Raynal <miquel.raynal@bootlin.com>2021-05-05 23:37:42 +0200
committerMiquel Raynal <miquel.raynal@bootlin.com>2021-05-26 10:43:56 +0200
commit09cdb237c3c8773921a7c265ce1cdd23818a3f14 (patch)
tree071ccf599bce3ad857fce7e46385e1dc7402bb0b /drivers/mtd/nand/raw/nand_timings.c
parentd7a773e8812bcf7a5412e4baebc6eb1c11242551 (diff)
downloadlinux-09cdb237c3c8773921a7c265ce1cdd23818a3f14.tar.bz2
mtd: rawnand: Handle the double bytes in NV-DDR mode
As explained in chapter "NV-DDR / NV-DDR2 / NV-DDR3 and Repeat Bytes" of the ONFI specification, with some commands (mainly the commands which do not transfer actual data) the data bytes are repeated twice and it is the responsibility of the receiver to discard them properly. The concerned commands are: SET_FEATURES, READ_ID, GET_FEATURES, READ_STATUS, READ_STATUS_ENHANCED, ODT_CONFIGURE. Hence, in the NAND core we are only impacted by the implementation of READ_ID, GET_FEATURES and READ_STATUS. The logic is the same for all: 2/ Check if it is relevant to read all data bytes twice. 1/ Allocate a buffer with twice the requested size (may be done statically). 2/ Update the instruction structure to read these extra bytes in the allocated buffer. 3/ Copy the even bytes into the original buffer. The performance hit is negligible on such small data transfers anyway and we don't really care about performances at this stage anyway. 4/ Free the allocated buffer, if any. Note: nand_data_read_op() is also impacted because it is theoretically possible to run the command/address cycles first, and, as another operation, do the data transfers. In this case we can easily identify the impacted commands because the force_8bit flag will be set (due to the same reason: their data does not go through the same pipeline). Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20210505213750.257417-15-miquel.raynal@bootlin.com
Diffstat (limited to 'drivers/mtd/nand/raw/nand_timings.c')
0 files changed, 0 insertions, 0 deletions