summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorTakahiro Kuwano <[email protected]>2024-10-15 13:08:32 +0900
committerTom Rini <[email protected]>2024-10-15 08:57:49 -0600
commit88057dab2cde8710ccc95d12fb312184e0b023ca (patch)
treedbf1427de306ae36e5e63ee8e9a095cef09fd206 /include/linux
parent6d7a8bf8c03343868d858b1cdb2ab737aabfca66 (diff)
mtd: spi-nor: Allow flashes to specify MTD writesize
Some flashes like the Infineon SEMPER NOR flash family use ECC. Under this ECC scheme, multi-pass writes to an ECC block is not allowed. In other words, once data is programmed to an ECC block, it can't be programmed again without erasing it first. Upper layers like file systems need to be given this information so they do not cause error conditions on the flash by attempting multi-pass programming. This can be done by setting 'writesize' in 'struct mtd_info'. Set the default to 1 but allow flashes to modify it in fixup hooks. If more flashes show up with this constraint in the future it might be worth it to add it to 'struct flash_info', but for now increasing its size is not worth it. This patch replicates the following upstream linux commit: afd473e85827 ("mtd: spi-nor: core: Allow flashes to specify MTD writesize") Acked-by: Tudor Ambarus <[email protected]> Signed-off-by: Takahiro Kuwano <[email protected]>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/mtd/spi-nor.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/mtd/spi-nor.h b/include/linux/mtd/spi-nor.h
index 047e83e8463..1ae586b2e5f 100644
--- a/include/linux/mtd/spi-nor.h
+++ b/include/linux/mtd/spi-nor.h
@@ -457,6 +457,7 @@ enum spi_nor_pp_command_index {
struct spi_nor_flash_parameter {
u64 size;
+ u32 writesize;
u32 page_size;
u8 rdsr_dummy;
u8 rdsr_addr_nbytes;