* [PATCH 0/2] mtd: spi-nor: spansion: Cleanup S25FS256S
@ 2026-09-14 4:50 Takahiro Kuwano via B4 Relay
2026-09-14 4:50 ` [PATCH 1/2] mtd: spi-nor: spansion: Remove s25fs256s0 Takahiro Kuwano via B4 Relay
2026-09-14 4:50 ` [PATCH 2/2] mtd: spi-nor: spansion: Assign .fixups to s25fs256s1 Takahiro Kuwano via B4 Relay
0 siblings, 2 replies; 6+ messages in thread
From: Takahiro Kuwano via B4 Relay @ 2026-09-14 4:50 UTC (permalink / raw)
To: Pratyush Yadav, Michael Walle, Miquel Raynal, Richard Weinberger,
Vignesh Raghavendra, Tudor Ambarus, Alexander Sverdlin
Cc: linux-mtd, linux-kernel, Takahiro Kuwano
This series cleans up the S25FS256S entries in the Spansion ID table.
Remove the invalid s25fs256s0 entry and assign the existing S25FS-S
fixups to s25fs256s1.
Signed-off-by: Takahiro Kuwano <takahiro.kuwano@infineon.com>
---
Takahiro Kuwano (2):
mtd: spi-nor: spansion: Remove s25fs256s0
mtd: spi-nor: spansion: Assign .fixups to s25fs256s1
drivers/mtd/spi-nor/spansion.c | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
---
base-commit: eb652d33da1b99c58a1465028b1336af5a3367c5
change-id: 20260911-s25fs256s-fixup-d97a584b1f69
Best regards,
--
Takahiro Kuwano <takahiro.kuwano@infineon.com>
^ permalink raw reply [flat|nested] 6+ messages in thread* [PATCH 1/2] mtd: spi-nor: spansion: Remove s25fs256s0 2026-09-14 4:50 [PATCH 0/2] mtd: spi-nor: spansion: Cleanup S25FS256S Takahiro Kuwano via B4 Relay @ 2026-09-14 4:50 ` Takahiro Kuwano via B4 Relay 2026-09-14 4:50 ` [PATCH 2/2] mtd: spi-nor: spansion: Assign .fixups to s25fs256s1 Takahiro Kuwano via B4 Relay 1 sibling, 0 replies; 6+ messages in thread From: Takahiro Kuwano via B4 Relay @ 2026-09-14 4:50 UTC (permalink / raw) To: Pratyush Yadav, Michael Walle, Miquel Raynal, Richard Weinberger, Vignesh Raghavendra, Tudor Ambarus, Alexander Sverdlin Cc: linux-mtd, linux-kernel, Takahiro Kuwano From: Takahiro Kuwano <takahiro.kuwano@infineon.com> The Spansion ID table lists s25fs256s0 and s25fs256s1 as variants distinguished by id[4] (0x00 for 256 KB sectors and 0x01 for 64 KB sectors), following an incorrect statement in the datasheet. The sector size of s25fs256s is configurable between 256 KB and 64 KB. The factory default is 64 KB, and id[4] is always 0x01 regardless of the configured sector size. Remove the invalid s25fs256s0 entry from the ID table. Fixes: 075fd6dff24a ("mtd: spi-nor: spansion: Differentiate between s25fl256s and s25fs256s") Signed-off-by: Takahiro Kuwano <takahiro.kuwano@infineon.com> --- drivers/mtd/spi-nor/spansion.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/drivers/mtd/spi-nor/spansion.c b/drivers/mtd/spi-nor/spansion.c index 6938fe26969c..6a62ca6f6451 100644 --- a/drivers/mtd/spi-nor/spansion.c +++ b/drivers/mtd/spi-nor/spansion.c @@ -873,13 +873,6 @@ static const struct flash_info spansion_nor_parts[] = { .sector_size = SZ_256K, .no_sfdp_flags = SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ, .mfr_flags = USE_CLSR, - }, { - .id = SNOR_ID(0x01, 0x02, 0x19, 0x4d, 0x00, 0x81), - .name = "s25fs256s0", - .size = SZ_32M, - .sector_size = SZ_256K, - .no_sfdp_flags = SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ, - .mfr_flags = USE_CLSR, }, { .id = SNOR_ID(0x01, 0x02, 0x19, 0x4d, 0x01, 0x80), .name = "s25fl256s1", -- 2.43.0 ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 2/2] mtd: spi-nor: spansion: Assign .fixups to s25fs256s1 2026-09-14 4:50 [PATCH 0/2] mtd: spi-nor: spansion: Cleanup S25FS256S Takahiro Kuwano via B4 Relay 2026-09-14 4:50 ` [PATCH 1/2] mtd: spi-nor: spansion: Remove s25fs256s0 Takahiro Kuwano via B4 Relay @ 2026-09-14 4:50 ` Takahiro Kuwano via B4 Relay 2026-09-14 6:33 ` Michael Walle 1 sibling, 1 reply; 6+ messages in thread From: Takahiro Kuwano via B4 Relay @ 2026-09-14 4:50 UTC (permalink / raw) To: Pratyush Yadav, Michael Walle, Miquel Raynal, Richard Weinberger, Vignesh Raghavendra, Tudor Ambarus, Alexander Sverdlin Cc: linux-mtd, linux-kernel, Takahiro Kuwano From: Takahiro Kuwano <takahiro.kuwano@infineon.com> s25fs256s1 has incorrect SFDP entries, like s25fs512s and s25fs128s1. Assign the common s25fs_s_nor_fixups to s25fs256s1 to fix its page size and sector map. Signed-off-by: Takahiro Kuwano <takahiro.kuwano@infineon.com> --- drivers/mtd/spi-nor/spansion.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/mtd/spi-nor/spansion.c b/drivers/mtd/spi-nor/spansion.c index 6a62ca6f6451..bc50881d5648 100644 --- a/drivers/mtd/spi-nor/spansion.c +++ b/drivers/mtd/spi-nor/spansion.c @@ -1148,6 +1148,7 @@ static const struct spi_nor_fixups spansion_nor_fixups = { static const struct spi_nor_fixup spansion_fixups[] = { { .fixups = &spansion_nor_fixups }, { .id = SNOR_ID(0x01, 0x02, 0x20, 0x4d, 0x00, 0x81), .fixups = &s25fs_s_nor_fixups }, + { .id = SNOR_ID(0x01, 0x02, 0x19, 0x4d, 0x01, 0x81), .fixups = &s25fs_s_nor_fixups }, { .id = SNOR_ID(0x01, 0x20, 0x18, 0x4d, 0x01, 0x81), .fixups = &s25fs_s_nor_fixups }, { .id = SNOR_ID(0x01, 0x60, 0x17), .fixup_flags = SPI_NOR_4B_OPCODES }, { .id = SNOR_ID(0x01, 0x60, 0x18), .fixup_flags = SPI_NOR_4B_OPCODES }, -- 2.43.0 ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] mtd: spi-nor: spansion: Assign .fixups to s25fs256s1 2026-09-14 4:50 ` [PATCH 2/2] mtd: spi-nor: spansion: Assign .fixups to s25fs256s1 Takahiro Kuwano via B4 Relay @ 2026-09-14 6:33 ` Michael Walle 2026-09-14 7:11 ` Takahiro.Kuwano 0 siblings, 1 reply; 6+ messages in thread From: Michael Walle @ 2026-09-14 6:33 UTC (permalink / raw) To: takahiro.kuwano, Pratyush Yadav, Miquel Raynal, Richard Weinberger, Vignesh Raghavendra, Tudor Ambarus, Alexander Sverdlin Cc: linux-mtd, linux-kernel On Mon Sep 14, 2026 at 6:50 AM CEST, Takahiro Kuwano via B4 Relay wrote: > From: Takahiro Kuwano <takahiro.kuwano@infineon.com> > > s25fs256s1 has incorrect SFDP entries, like s25fs512s and s25fs128s1. > Assign the common s25fs_s_nor_fixups to s25fs256s1 to fix its page size > and sector map. Do you have an SFDP dump by chance? I haven't found one on the list for this flash. -michael ^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [PATCH 2/2] mtd: spi-nor: spansion: Assign .fixups to s25fs256s1 2026-09-14 6:33 ` Michael Walle @ 2026-09-14 7:11 ` Takahiro.Kuwano 2026-09-14 9:37 ` Michael Walle 0 siblings, 1 reply; 6+ messages in thread From: Takahiro.Kuwano @ 2026-09-14 7:11 UTC (permalink / raw) To: mwalle, pratyush, miquel.raynal, richard, vigneshr, tudor.ambarus, alex Cc: linux-mtd, linux-kernel Hi Michael, > On Mon Sep 14, 2026 at 6:50 AM CEST, Takahiro Kuwano via B4 Relay wrote: > > From: Takahiro Kuwano <takahiro.kuwano@infineon.com> > > > > s25fs256s1 has incorrect SFDP entries, like s25fs512s and s25fs128s1. > > Assign the common s25fs_s_nor_fixups to s25fs256s1 to fix its page size > > and sector map. > > Do you have an SFDP dump by chance? I haven't found one on the list > for this flash. > Yes, but param tables are located beyond PAGE_SIZE(1000h)... zynq> cat /sys/bus/spi/devices/spi0.0/spi-nor/partname s25fs256s1 zynq> cat /sys/bus/spi/devices/spi0.0/spi-nor/jedec_id 0102194d0181 zynq> cat /sys/bus/spi/devices/spi0.0/spi-nor/manufacturer spansion zynq> hexdump /sys/bus/spi/devices/spi0.0/spi-nor/sfdp 0000000 4653 5044 0106 ff05 0000 0901 1090 ff00 0000010 0500 1001 1090 ff00 0600 1001 1090 ff00 0000020 0081 1a01 10d8 ff00 0084 0201 10d0 ff00 0000030 0101 5001 1000 0100 ffff ffff ffff ffff 0000040 ffff ffff ffff ffff ffff ffff ffff ffff * 0001000 Thanks, Takahiro ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] mtd: spi-nor: spansion: Assign .fixups to s25fs256s1 2026-09-14 7:11 ` Takahiro.Kuwano @ 2026-09-14 9:37 ` Michael Walle 0 siblings, 0 replies; 6+ messages in thread From: Michael Walle @ 2026-09-14 9:37 UTC (permalink / raw) To: Takahiro.Kuwano, pratyush, miquel.raynal, richard, vigneshr, tudor.ambarus, alex Cc: linux-mtd, linux-kernel [-- Attachment #1: Type: text/plain, Size: 1567 bytes --] Hi Takahiro, On Mon Sep 14, 2026 at 9:11 AM CEST, Takahiro.Kuwano wrote: > Hi Michael, > >> On Mon Sep 14, 2026 at 6:50 AM CEST, Takahiro Kuwano via B4 Relay wrote: >> > From: Takahiro Kuwano <takahiro.kuwano@infineon.com> >> > >> > s25fs256s1 has incorrect SFDP entries, like s25fs512s and s25fs128s1. >> > Assign the common s25fs_s_nor_fixups to s25fs256s1 to fix its page size >> > and sector map. >> >> Do you have an SFDP dump by chance? I haven't found one on the list >> for this flash. >> > > Yes, but param tables are located beyond PAGE_SIZE(1000h)... Could you test the following patch if that helps? --- a/drivers/mtd/spi-nor/sysfs.c +++ b/drivers/mtd/spi-nor/sysfs.c @@ -99,10 +99,26 @@ static umode_t spi_nor_sysfs_is_bin_visible(struct kobject *kobj, return 0; } +static size_t spi_nor_sysfs_bin_size(struct kobject *kobj, const struct bin_attribute *attr, int n) +{ + struct spi_device *spi = to_spi_device(kobj_to_dev(kobj)); + struct spi_mem *spimem = spi_get_drvdata(spi); + struct spi_nor *nor = spi_mem_get_drvdata(spimem); + struct sfdp *sfdp = nor->sfdp; + size_t sfdp_size = sfdp->num_dwords * sizeof(*sfdp->dwords); + + if (attr == &bin_attr_sfdp) + return sfdp_size; + + return 0; +} + + static const struct attribute_group spi_nor_sysfs_group = { .name = "spi-nor", .is_visible = spi_nor_sysfs_is_visible, .is_bin_visible = spi_nor_sysfs_is_bin_visible, + .bin_size = spi_nor_sysfs_bin_size, .attrs = spi_nor_sysfs_entries, .bin_attrs = spi_nor_sysfs_bin_entries, }; [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 297 bytes --] ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-09-14 9:37 UTC | newest] Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2026-09-14 4:50 [PATCH 0/2] mtd: spi-nor: spansion: Cleanup S25FS256S Takahiro Kuwano via B4 Relay 2026-09-14 4:50 ` [PATCH 1/2] mtd: spi-nor: spansion: Remove s25fs256s0 Takahiro Kuwano via B4 Relay 2026-09-14 4:50 ` [PATCH 2/2] mtd: spi-nor: spansion: Assign .fixups to s25fs256s1 Takahiro Kuwano via B4 Relay 2026-09-14 6:33 ` Michael Walle 2026-09-14 7:11 ` Takahiro.Kuwano 2026-09-14 9:37 ` Michael Walle
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®