aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMiquel Raynal <miquel.raynal@bootlin.com>2025-01-10 15:45:24 +0100
committerMiquel Raynal <miquel.raynal@bootlin.com>2025-01-15 19:23:47 +0100
commit7ce0d16d5802bfde4209e52ee8ad644ca1eab423 (patch)
tree94fa029c4b14702b3b7cb9e3d17d4346f18fc221
parentmtd: spinand: Create distinct fast and slow read from cache variants (diff)
downloadwireguard-linux-7ce0d16d5802bfde4209e52ee8ad644ca1eab423.tar.xz
wireguard-linux-7ce0d16d5802bfde4209e52ee8ad644ca1eab423.zip
mtd: spinand: Add an optional frequency to read from cache macros
While the SPINAND_PAGE_READ_FROM_CACHE_FAST_OP macro is supposed to be able to run at the flash highest supported frequency, it is not the case of the regular read from cache, which may be limited in terms of maximum frequency. Add an optional argument to this macro, which will be used to set the maximum frequency, if any. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Diffstat (limited to '')
-rw-r--r--include/linux/mtd/spinand.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/linux/mtd/spinand.h b/include/linux/mtd/spinand.h
index 0d80fa9400d5..2f5cce23b3ec 100644
--- a/include/linux/mtd/spinand.h
+++ b/include/linux/mtd/spinand.h
@@ -62,11 +62,12 @@
SPI_MEM_OP_NO_DUMMY, \
SPI_MEM_OP_NO_DATA)
-#define SPINAND_PAGE_READ_FROM_CACHE_OP(addr, ndummy, buf, len) \
+#define SPINAND_PAGE_READ_FROM_CACHE_OP(addr, ndummy, buf, len, ...) \
SPI_MEM_OP(SPI_MEM_OP_CMD(0x03, 1), \
SPI_MEM_OP_ADDR(2, addr, 1), \
SPI_MEM_OP_DUMMY(ndummy, 1), \
- SPI_MEM_OP_DATA_IN(len, buf, 1))
+ SPI_MEM_OP_DATA_IN(len, buf, 1), \
+ __VA_OPT__(SPI_MEM_OP_MAX_FREQ(__VA_ARGS__)))
#define SPINAND_PAGE_READ_FROM_CACHE_FAST_OP(addr, ndummy, buf, len) \
SPI_MEM_OP(SPI_MEM_OP_CMD(0x0b, 1), \