mtd: spi-nor: xmc: Add XM25QH128C identification
Subsystems (2)
PATCH 1/1 mtd: spi-nor: xmc: Add XM25QH128C identification
From: Fabio Estevam <[email protected]>
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.
---
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(+)
drivers/mtd/spi-nor/xmc.c +3 -0
@@ -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", }, };
Signature · 6 lines
2.43.0 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/
Michael Walle
maintainerQuoted 7 lines · Fabio Estevam
From: Fabio Estevam <[email protected]>
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.
Quoted 21 lines
The flash is populated on the Firefly ROC-RK3399-PC Plus board.
Signed-off-by Fabio Estevam <[email protected]>---
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.....|
Quoted 8 lines
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!
Quoted 2 lines
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
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
Quoted 1 line · Michael Walle
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/
Michael Walle
maintainerHi Fabio,
Quoted 16 lines · Fabio Estevam
Quoted 1 line · Michael Walle
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:
Quoted 8 lines
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 xmcThe 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
Quoted 2 lines
If this is not wanted, feel free to discard this change.
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
Hi Michael,
Quoted 5 lines · Michael Walle
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/