]> git.samba.org - sfrench/cifs-2.6.git/commit
mtd: rawnand: Access SDR and NV-DDR timings through a common macro
authorMiquel Raynal <miquel.raynal@bootlin.com>
Wed, 5 May 2021 21:37:41 +0000 (23:37 +0200)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Wed, 26 May 2021 08:43:54 +0000 (10:43 +0200)
commitd7a773e8812bcf7a5412e4baebc6eb1c11242551
tree02cd55f67063aabbebe49a0b04655f33249c8f89
parentfee9c6d8f098f7054f97ec1dbcfb42a2a3238f23
mtd: rawnand: Access SDR and NV-DDR timings through a common macro

Most timings related to the bus timings are different between SDR and
NV-DDR. However, we identified 9 individual timings which are more
related to the NAND chip internals. These are common between the two
interface types. Fortunately, only these common timings are being shared
through the NAND core and its ->exec_op() interface, which allows the
writing of a simple macro checking the interface type and depending on
it, returning either the relevant SDR timing or the NV-DDR timing. This
is the purpose of the NAND_COMMON_TIMING_PS() macro.

As all this is evaluated at build time, one will immediately be notified
in case a non common timing is being accessed through this macro.

Two handy macros are also inserted at the same time, which use
PSEC_TO_NSEC or PSEC_TO_MSEC so that it is very easy to return timings
in milli-, nano- or pico-seconds, as usually requested by the internal
API.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20210505213750.257417-14-miquel.raynal@bootlin.com
drivers/mtd/nand/raw/nand_base.c
include/linux/mtd/rawnand.h