[PATCH 14/22] mtd: rawnand: Handle the double bytes in NV-DDR mode

Miquel Raynal miquel.raynal at bootlin.com
Wed May 26 02:04:20 PDT 2021


On Wed, 2021-05-05 at 21:37:42 UTC, Miquel Raynal wrote:
> 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 at bootlin.com>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next.

Miquel



More information about the linux-mtd mailing list