* [PATCH] mtd: spi-nor: xmc: Add XM25QH128C identification
@ 2026-07-18 21:38 Fabio Estevam
2026-07-20 6:45 ` Michael Walle
0 siblings, 1 reply; 5+ messages in thread
From: Fabio Estevam @ 2026-07-18 21:38 UTC (permalink / raw)
To: pratyush
Cc: mwalle, takahiro.kuwano, miquel.raynal, richard, vigneshr, heiko,
linux-mtd, Fabio Estevam
From: Fabio Estevam <festevam@nabladev.com>
The XMC XM25QH128C is a 128-Mbit SPI NOR flash with JEDEC ID
20 40 18.
Add its identification entry. The device provides valid SFDP data, so
its parameters continue to be initialized entirely from SFDP.
The flash is populated on the Firefly ROC-RK3399-PC Plus board.
Signed-off-by: Fabio Estevam <festevam@nabladev.com>
---
Tested on a Firefly ROC-RK3399-PC Plus using the
"rockchip,rk3399-spi" controller at 30 MHz.
root@rk3399-station-p1:~# cat /sys/bus/spi/devices/spi1.0/spi-nor/partname
XM25QH128C
root@rk3399-station-p1:~# cat /sys/bus/spi/devices/spi1.0/spi-nor/jedec_id
204018
root@rk3399-station-p1:~# cat /sys/bus/spi/devices/spi1.0/spi-nor/manufacturer
xmc
root@rk3399-station-p1:~# hexdump -Cv /sys/bus/spi/devices/spi1.0/spi-nor/sfdp
00000000 53 46 44 50 06 01 02 ff 00 06 01 10 30 00 00 ff |SFDP........0...|
00000010 20 00 01 04 d0 00 00 ff 84 00 01 02 c0 00 00 ff | ...............|
00000020 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
00000030 e5 20 f1 ff ff ff ff 07 44 eb 08 6b 08 3b 42 bb |. ......D..k.;B.|
00000040 fe ff ff ff ff ff 00 ff ff ff 40 eb 0c 20 0f 52 |..........@.. .R|
00000050 10 d8 00 ff 24 02 06 01 82 a7 03 cd cc a1 06 35 |....$..........5|
00000060 7a 75 7a 75 f7 a9 d5 5c 19 f6 4d ff e9 10 c0 80 |zuzu...\..M.....|
00000070 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
00000080 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
00000090 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
000000a0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
000000b0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
000000c0 00 00 f0 ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
000000d0 00 36 00 23 9f f9 77 64 00 e8 ff ff ff ff ff ff |.6.#..wd........|
000000e0
root@rk3399-station-p1:~# sha256sum /sys/bus/spi/devices/spi1.0/spi-nor/sfdp
c027b82ebfdf18e455c6366a9d57602b36f2956d4307b770954544918102d9b3 /sys/bus/spi/devices/spi1.0/spi-nor/sfdp
drivers/mtd/spi-nor/xmc.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/mtd/spi-nor/xmc.c b/drivers/mtd/spi-nor/xmc.c
index d5a06054b0dd..06bb8caf8927 100644
--- a/drivers/mtd/spi-nor/xmc.c
+++ b/drivers/mtd/spi-nor/xmc.c
@@ -19,6 +19,9 @@ static const struct flash_info xmc_nor_parts[] = {
.name = "XM25QH128A",
.size = SZ_16M,
.no_sfdp_flags = SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ,
+ }, {
+ .id = SNOR_ID(0x20, 0x40, 0x18),
+ .name = "XM25QH128C",
},
};
--
2.43.0
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] mtd: spi-nor: xmc: Add XM25QH128C identification
2026-07-18 21:38 [PATCH] mtd: spi-nor: xmc: Add XM25QH128C identification Fabio Estevam
@ 2026-07-20 6:45 ` Michael Walle
2026-07-20 18:43 ` Fabio Estevam
0 siblings, 1 reply; 5+ messages in thread
From: Michael Walle @ 2026-07-20 6:45 UTC (permalink / raw)
To: Fabio Estevam, pratyush
Cc: takahiro.kuwano, miquel.raynal, richard, vigneshr, heiko,
linux-mtd, Fabio Estevam
[-- Attachment #1.1: Type: text/plain, Size: 2359 bytes --]
On Sat Jul 18, 2026 at 11:38 PM CEST, Fabio Estevam wrote:
> From: Fabio Estevam <festevam@nabladev.com>
>
> The XMC XM25QH128C is a 128-Mbit SPI NOR flash with JEDEC ID
> 20 40 18.
>
> Add its identification entry. The device provides valid SFDP data, so
> its parameters continue to be initialized entirely from SFDP.
So why do you need an entry? We don't add .names on new entries.
> The flash is populated on the Firefly ROC-RK3399-PC Plus board.
>
> Signed-off-by: Fabio Estevam <festevam@nabladev.com>
> ---
> Tested on a Firefly ROC-RK3399-PC Plus using the
> "rockchip,rk3399-spi" controller at 30 MHz.
>
> root@rk3399-station-p1:~# cat /sys/bus/spi/devices/spi1.0/spi-nor/partname
> XM25QH128C
> root@rk3399-station-p1:~# cat /sys/bus/spi/devices/spi1.0/spi-nor/jedec_id
> 204018
> root@rk3399-station-p1:~# cat /sys/bus/spi/devices/spi1.0/spi-nor/manufacturer
> xmc
> root@rk3399-station-p1:~# hexdump -Cv /sys/bus/spi/devices/spi1.0/spi-nor/sfdp
> 00000000 53 46 44 50 06 01 02 ff 00 06 01 10 30 00 00 ff |SFDP........0...|
> 00000010 20 00 01 04 d0 00 00 ff 84 00 01 02 c0 00 00 ff | ...............|
> 00000020 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
> 00000030 e5 20 f1 ff ff ff ff 07 44 eb 08 6b 08 3b 42 bb |. ......D..k.;B.|
> 00000040 fe ff ff ff ff ff 00 ff ff ff 40 eb 0c 20 0f 52 |..........@.. .R|
> 00000050 10 d8 00 ff 24 02 06 01 82 a7 03 cd cc a1 06 35 |....$..........5|
> 00000060 7a 75 7a 75 f7 a9 d5 5c 19 f6 4d ff e9 10 c0 80 |zuzu...\..M.....|
> 00000070 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
> 00000080 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
> 00000090 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
> 000000a0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
> 000000b0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
> 000000c0 00 00 f0 ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
> 000000d0 00 36 00 23 9f f9 77 64 00 e8 ff ff ff ff ff ff |.6.#..wd........|
> 000000e0
Thanks!
> root@rk3399-station-p1:~# sha256sum /sys/bus/spi/devices/spi1.0/spi-nor/sfdp
> c027b82ebfdf18e455c6366a9d57602b36f2956d4307b770954544918102d9b3 /sys/bus/spi/devices/spi1.0/spi-nor/sfdp
-michael
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 297 bytes --]
[-- Attachment #2: Type: text/plain, Size: 144 bytes --]
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] mtd: spi-nor: xmc: Add XM25QH128C identification
2026-07-20 6:45 ` Michael Walle
@ 2026-07-20 18:43 ` Fabio Estevam
2026-07-21 8:47 ` Michael Walle
0 siblings, 1 reply; 5+ messages in thread
From: Fabio Estevam @ 2026-07-20 18:43 UTC (permalink / raw)
To: Michael Walle
Cc: Fabio Estevam, pratyush, takahiro.kuwano, miquel.raynal, richard,
vigneshr, heiko, linux-mtd
On Monday, July 20, 2026 03:45 -03, "Michael Walle" <mwalle@kernel.org> wrote:
> So why do you need an entry? We don't add .names on new entries.
Currently, I see:
root@rk3399-station-p1:~# cat /sys/bus/spi/devices/spi1.0/spi-nor/partname
spi-nor-generic
root@rk3399-station-p1:~# cat /sys/bus/spi/devices/spi1.0/spi-nor/jedec_id
204018204018
root@rk3399-station-p1:~# cat /sys/bus/spi/devices/spi1.0/spi-nor/manufacturer
cat: /sys/bus/spi/devices/spi1.0/spi-nor/manufacturer: No such file or directory
root@rk3399-station-p1:~#
After this patch:
root@rk3399-station-p1:~# cat /sys/bus/spi/devices/spi1.0/spi-nor/partname
XM25QH128C
root@rk3399-station-p1:~# cat /sys/bus/spi/devices/spi1.0/spi-nor/jedec_id
204018
root@rk3399-station-p1:~# cat /sys/bus/spi/devices/spi1.0/spi-nor/manufacturer
xmc
The advantage of this patch is to provide the partname and manufacturer entries for userspace.
If this is not wanted, feel free to discard this change.
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] mtd: spi-nor: xmc: Add XM25QH128C identification
2026-07-20 18:43 ` Fabio Estevam
@ 2026-07-21 8:47 ` Michael Walle
2026-07-21 12:05 ` Fabio Estevam
0 siblings, 1 reply; 5+ messages in thread
From: Michael Walle @ 2026-07-21 8:47 UTC (permalink / raw)
To: Fabio Estevam
Cc: Fabio Estevam, pratyush, takahiro.kuwano, miquel.raynal, richard,
vigneshr, heiko, linux-mtd
[-- Attachment #1.1: Type: text/plain, Size: 1423 bytes --]
Hi Fabio,
On Mon Jul 20, 2026 at 8:43 PM CEST, Fabio Estevam wrote:
> On Monday, July 20, 2026 03:45 -03, "Michael Walle" <mwalle@kernel.org> wrote:
>
>> So why do you need an entry? We don't add .names on new entries.
>
> Currently, I see:
>
> root@rk3399-station-p1:~# cat /sys/bus/spi/devices/spi1.0/spi-nor/partname
> spi-nor-generic
> root@rk3399-station-p1:~# cat /sys/bus/spi/devices/spi1.0/spi-nor/jedec_id
> 204018204018
> root@rk3399-station-p1:~# cat /sys/bus/spi/devices/spi1.0/spi-nor/manufacturer
> cat: /sys/bus/spi/devices/spi1.0/spi-nor/manufacturer: No such file or directory
> root@rk3399-station-p1:~#
>
> After this patch:
>
> root@rk3399-station-p1:~# cat /sys/bus/spi/devices/spi1.0/spi-nor/partname
> XM25QH128C
> root@rk3399-station-p1:~# cat /sys/bus/spi/devices/spi1.0/spi-nor/jedec_id
> 204018
> root@rk3399-station-p1:~# cat /sys/bus/spi/devices/spi1.0/spi-nor/manufacturer
> xmc
>
> The advantage of this patch is to provide the partname and manufacturer entries for userspace.
Yeah I get that, but since vendors tend to reuse their flash ids for
different parts, the part name is useless (and probably wrong) most
of the time. The idea was to just expose the id nowadays and if you
really need the flash part name, it's the duty of an userspace
application to figure that out.
-michael
>
> If this is not wanted, feel free to discard this change.
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 297 bytes --]
[-- Attachment #2: Type: text/plain, Size: 144 bytes --]
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] mtd: spi-nor: xmc: Add XM25QH128C identification
2026-07-21 8:47 ` Michael Walle
@ 2026-07-21 12:05 ` Fabio Estevam
0 siblings, 0 replies; 5+ messages in thread
From: Fabio Estevam @ 2026-07-21 12:05 UTC (permalink / raw)
To: Michael Walle
Cc: Fabio Estevam, pratyush, takahiro.kuwano, miquel.raynal, richard,
vigneshr, heiko, linux-mtd
Hi Michael,
On Tuesday, July 21, 2026 05:47 -03, "Michael Walle" <mwalle@kernel.org> wrote:
> Yeah I get that, but since vendors tend to reuse their flash ids for
> different parts, the part name is useless (and probably wrong) most
> of the time. The idea was to just expose the id nowadays and if you
> really need the flash part name, it's the duty of an userspace
> application to figure that out.
This makes sense. Thanks for the explanation.
Let's ignore this patch then.
Thanks
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-07-21 12:05 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-18 21:38 [PATCH] mtd: spi-nor: xmc: Add XM25QH128C identification Fabio Estevam
2026-07-20 6:45 ` Michael Walle
2026-07-20 18:43 ` Fabio Estevam
2026-07-21 8:47 ` Michael Walle
2026-07-21 12:05 ` Fabio Estevam
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox