2022-07-13 21:36:45

by Jae Hyun Yoo

[permalink] [raw]
Subject: [PATCH v2] mtd: spi-nor: winbond: add support for W25Q512NW-IQ

Add support for Winbond W25Q512NW-IQ/IN

Signed-off-by: Jae Hyun Yoo <[email protected]>
Link: https://www.winbond.com/resource-files/W25Q512NW%20RevB%2007192021.pdf
Reviewed-by: Cédric Le Goater <[email protected]>
---
Changes in v2:
* Refined commit message (Michael)

Test result on AST2600 SoC's SPI controller:
$ cat /sys/bus/platform/devices/1e620000.spi/spi_master/spi0/spi0.1/spi-nor/jedec_id
ef6020

$ cat /sys/bus/platform/devices/1e620000.spi/spi_master/spi0/spi0.1/spi-nor/manufacturer
winbond

$ cat /sys/bus/platform/devices/1e620000.spi/spi_master/spi0/spi0.1/spi-nor/partname
w25q512nwq

$ hexdump /sys/bus/platform/devices/1e620000.spi/spi_master/spi0/spi0.1/spi-nor/sfdp
0000000 4653 5044 0106 ff01 0600 1001 0080 ff00
0000010 0084 0201 00d0 ff00 ffff ffff ffff ffff
0000020 ffff ffff ffff ffff ffff ffff ffff ffff
*
0000080 20e5 fffb ffff 1fff eb44 6b08 3b08 bb42
0000090 fffe ffff ffff 0000 ffff eb40 200c 520f
00000a0 d810 0000 0233 00a6 e781 d914 63e9 3376
00000b0 757a 757a bdf7 5cd5 f719 ff5d 70e9 a5f9
00000c0 ffff ffff ffff ffff ffff ffff ffff ffff
00000d0 0aff fff0 ff21 ffdc
00000d8

$ flash_otp_info -u /dev/mtd0
Number of OTP user blocks on /dev/mtd0: 3
block 0: offset = 0x0000 size = 256 bytes [unlocked]
block 1: offset = 0x0100 size = 256 bytes [unlocked]
block 2: offset = 0x0200 size = 256 bytes [unlocked]

$ flash_otp_dump -u /dev/mtd0 0x2d0
OTP user data for /dev/mtd0
0x02d0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
0x02e0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
0x02f0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff

$ echo -n otp test | flash_otp_write -u /dev/mtd0 0x2d0
Writing OTP user data on /dev/mtd0 at offset 0x2d0
Wrote 8 bytes of OTP user data

$ flash_otp_dump -u /dev/mtd0 0x2d0
OTP user data for /dev/mtd0
0x02d0: 6f 74 70 20 74 65 73 74 ff ff ff ff ff ff ff ff
0x02e0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
0x02f0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff

$ flash_otp_erase -u /dev/mtd0 0x200 0x100

$ flash_otp_dump -u /dev/mtd0 0x2d0
OTP user data for /dev/mtd0
0x02d0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
0x02e0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
0x02f0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff

drivers/mtd/spi-nor/winbond.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/mtd/spi-nor/winbond.c b/drivers/mtd/spi-nor/winbond.c
index ffaa24055259..d6f1a3b7267e 100644
--- a/drivers/mtd/spi-nor/winbond.c
+++ b/drivers/mtd/spi-nor/winbond.c
@@ -133,6 +133,9 @@ static const struct flash_info winbond_nor_parts[] = {
{ "w25m512jv", INFO(0xef7119, 0, 64 * 1024, 1024)
NO_SFDP_FLAGS(SECT_4K | SPI_NOR_QUAD_READ |
SPI_NOR_DUAL_READ) },
+ { "w25q512nwq", INFO(0xef6020, 0, 64 * 1024, 1024)
+ PARSE_SFDP
+ OTP_INFO(256, 3, 0x1000, 0x1000) },
{ "w25q512nwm", INFO(0xef8020, 0, 64 * 1024, 1024)
PARSE_SFDP
OTP_INFO(256, 3, 0x1000, 0x1000) },
--
2.25.1


2022-07-14 07:48:00

by Michael Walle

[permalink] [raw]
Subject: Re: [PATCH v2] mtd: spi-nor: winbond: add support for W25Q512NW-IQ

Hi,

thanks for the update.

Am 2022-07-13 23:12, schrieb Jae Hyun Yoo:
> Add support for Winbond W25Q512NW-IQ/IN
>
> Signed-off-by: Jae Hyun Yoo <[email protected]>
> Link:
> https://www.winbond.com/resource-files/W25Q512NW%20RevB%2007192021.pdf
> Reviewed-by: Cédric Le Goater <[email protected]>
> ---
> Changes in v2:
> * Refined commit message (Michael)
>
> Test result on AST2600 SoC's SPI controller:
> $ cat
> /sys/bus/platform/devices/1e620000.spi/spi_master/spi0/spi0.1/spi-nor/jedec_id
> ef6020
>
> $ cat
> /sys/bus/platform/devices/1e620000.spi/spi_master/spi0/spi0.1/spi-nor/manufacturer
> winbond
>
> $ cat
> /sys/bus/platform/devices/1e620000.spi/spi_master/spi0/spi0.1/spi-nor/partname
> w25q512nwq
>
> $ hexdump
> /sys/bus/platform/devices/1e620000.spi/spi_master/spi0/spi0.1/spi-nor/sfdp
> 0000000 4653 5044 0106 ff01 0600 1001 0080 ff00
> 0000010 0084 0201 00d0 ff00 ffff ffff ffff ffff
> 0000020 ffff ffff ffff ffff ffff ffff ffff ffff
> *
> 0000080 20e5 fffb ffff 1fff eb44 6b08 3b08 bb42
> 0000090 fffe ffff ffff 0000 ffff eb40 200c 520f
> 00000a0 d810 0000 0233 00a6 e781 d914 63e9 3376
> 00000b0 757a 757a bdf7 5cd5 f719 ff5d 70e9 a5f9
> 00000c0 ffff ffff ffff ffff ffff ffff ffff ffff
> 00000d0 0aff fff0 ff21 ffdc
> 00000d8

md5sum of this file is missing.

For the record: there is still an ongoing discussion on the v1 of
this patch.

-michael

2022-07-14 14:15:15

by Jae Hyun Yoo

[permalink] [raw]
Subject: Re: [PATCH v2] mtd: spi-nor: winbond: add support for W25Q512NW-IQ

On 7/14/2022 12:37 AM, Michael Walle wrote:
> Hi,
>
> thanks for the update.
>
> Am 2022-07-13 23:12, schrieb Jae Hyun Yoo:
>> Add support for Winbond W25Q512NW-IQ/IN
>>
>> Signed-off-by: Jae Hyun Yoo <[email protected]>
>> Link:
>> https://www.winbond.com/resource-files/W25Q512NW%20RevB%2007192021.pdf
>> Reviewed-by: Cédric Le Goater <[email protected]>
>> ---
>> Changes in v2:
>>  * Refined commit message (Michael)
>>
>> Test result on AST2600 SoC's SPI controller:
>> $ cat
>> /sys/bus/platform/devices/1e620000.spi/spi_master/spi0/spi0.1/spi-nor/jedec_id
>>
>> ef6020
>>
>> $ cat
>> /sys/bus/platform/devices/1e620000.spi/spi_master/spi0/spi0.1/spi-nor/manufacturer
>>
>> winbond
>>
>> $ cat
>> /sys/bus/platform/devices/1e620000.spi/spi_master/spi0/spi0.1/spi-nor/partname
>>
>> w25q512nwq
>>
>> $ hexdump
>> /sys/bus/platform/devices/1e620000.spi/spi_master/spi0/spi0.1/spi-nor/sfdp
>>
>> 0000000 4653 5044 0106 ff01 0600 1001 0080 ff00
>> 0000010 0084 0201 00d0 ff00 ffff ffff ffff ffff
>> 0000020 ffff ffff ffff ffff ffff ffff ffff ffff
>> *
>> 0000080 20e5 fffb ffff 1fff eb44 6b08 3b08 bb42
>> 0000090 fffe ffff ffff 0000 ffff eb40 200c 520f
>> 00000a0 d810 0000 0233 00a6 e781 d914 63e9 3376
>> 00000b0 757a 757a bdf7 5cd5 f719 ff5d 70e9 a5f9
>> 00000c0 ffff ffff ffff ffff ffff ffff ffff ffff
>> 00000d0 0aff fff0 ff21 ffdc
>> 00000d8
>
> md5sum of this file is missing.

Sure. I'll add md5sum of sfdp in v3.

Thanks,
Jae

> For the record: there is still an ongoing discussion on the v1 of
> this patch.
>
> -michael