From nobody Fri Dec 19 14:24:48 2025 Received: from smtpout-03.galae.net (smtpout-03.galae.net [185.246.85.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 77F3A2C15B0 for ; Wed, 5 Nov 2025 17:27:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.85.4 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762363651; cv=none; b=n5VUVWuV8sbk5oeS3h11PtDDCZ2mGcXE1HBvtbJmkTnUMgw/JmwXy3NdjhKpEQfMsdM348nC4kyfxxXCZFTzDMGL5HQRPHnCOOC+BlTjsHNlZqIleEmcsmi/27foEUFd9gSAenpYMCiK7dovEL2B3co4w0d0d9GS8Ezm92tYpfg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762363651; c=relaxed/simple; bh=PDHeyhSFkN1NE5+EzQZsoHUN6DwdZBzqYeRRH3/Hpe8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=oEDqmfeq7cvce4YZ5iw+95IDNGrFD7uFJU4VqDvlDYlwCvtsePuwFNreH13rZEfk81NWHEd1hC1H1NjpOj+IywS7iL/1pxbv6snOGv2Y3zY2Klrov1V7SIKjHKYwO2TRm3xpja02Eoz3hz0vACh3KC0/FV/mTu5VyYsuRy0OB4A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=sowDF5Kj; arc=none smtp.client-ip=185.246.85.4 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="sowDF5Kj" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id A755B4E4153F; Wed, 5 Nov 2025 17:27:26 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 7CA1160693; Wed, 5 Nov 2025 17:27:26 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id AC08310B5046E; Wed, 5 Nov 2025 18:27:24 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1762363645; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=hE30IJHBPucIqGUOi/BeIDKqU3CP+dx4/YEUzSuHQ7I=; b=sowDF5KjSpJ7lYzwvGGw8b3wrOelf21WJzudwb519RJJhdkU8bh+zuy20ZW8SdTLZnx5s1 r86FO7gqQwf+vF6xG5NhdJ5zkXvi/nCBeXaZl+VvCaXyKStPdF2zKDefnus2L+a9zU0CCP maMb+5v6+c3mAp3exncq6gR5q6D1MsCzIno7G8Yg8Y9RcX+1Lp8dDUpceZ8Ifp4n4gFObD Arb07iphhTEBOG+HNKvI6l7cxfdRtQ0lvzCNW/EDWWdbGpI4bX1bD/3LrPFfosCuZ2/ggA z8YeZBMTC9eiLolm9MeBFJgQlv25rsIwiyAQO5H7AIxS8ALLVq//VapuNwlAeA== From: Miquel Raynal Date: Wed, 05 Nov 2025 18:27:00 +0100 Subject: [PATCH 1/6] mtd: spi-nor: winbond: Add support for W25Q01NWxxIQ chips Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251105-winbond-v6-18-rc1-spi-nor-v1-1-42cc9fb46e1b@bootlin.com> References: <20251105-winbond-v6-18-rc1-spi-nor-v1-0-42cc9fb46e1b@bootlin.com> In-Reply-To: <20251105-winbond-v6-18-rc1-spi-nor-v1-0-42cc9fb46e1b@bootlin.com> To: Tudor Ambarus , Pratyush Yadav , Michael Walle , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra Cc: Thomas Petazzoni , Steam Lin , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org X-Mailer: b4 0.14.2 X-Last-TLS-Session-Version: TLSv1.3 This chip must be described as none of the block protection information are discoverable. This chip supports 4 bits plus the top/bottom addressing capability to identify the protected blocks. Cc: stable@vger.kernel.org Signed-off-by: Miquel Raynal Reviewed-by: Michael Walle --- $ cat /sys/bus/spi/devices/spi0.0/spi-nor/partname cat: can't open '/sys/bus/spi/devices/spi0.0/spi-nor/partname': No such file or directory $ cat /sys/bus/spi/devices/spi0.0/spi-nor/jedec_id ef6021 $ cat /sys/bus/spi/devices/spi0.0/spi-nor/manufacturer winbond $ xxd -p /sys/bus/spi/devices/spi0.0/spi-nor/sfdp 53464450060101ff00060110800000ff84000102d00000ffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffe520fbffffffff3f44eb086b083b42bbfeffffffffff 0000ffff40eb0c200f5210d800003652b50082ea14e2e96376337a757a75 f7bdd55c19f75dffe970f9a5ffffffffffffffffffffffffffffffffff0a f0ff21ffdcff $ sha256sum /sys/bus/spi/devices/spi0.0/spi-nor/sfdp d70b64bfa72dad202ff6881f92676b3a79b1e634b60653cd15f1820b7f3acaea /sys/bus/spi /devices/spi0.0/spi-nor/sfdp $ cat /sys/kernel/debug/spi-nor/spi0.0/capabilities Supported read modes by the flash 1S-1S-1S opcode 0x13 mode cycles 0 dummy cycles 0 1S-1S-2S opcode 0x3c mode cycles 0 dummy cycles 8 1S-2S-2S opcode 0xbc mode cycles 2 dummy cycles 2 1S-1S-4S opcode 0x6c mode cycles 0 dummy cycles 8 1S-4S-4S opcode 0xec mode cycles 2 dummy cycles 4 4S-4S-4S opcode 0xec mode cycles 2 dummy cycles 0 Supported page program modes by the flash 1S-1S-1S opcode 0x12 1S-1S-4S opcode 0x34 $ cat /sys/kernel/debug/spi-nor/spi0.0/params name (null) id ef 60 21 00 00 00 size 128 MiB write size 1 page size 256 address nbytes 4 flags HAS_SR_TB | 4B_OPCODES | HAS_4BAIT | HAS_LOCK | HAS_16BIT_SR | HAS_S= R_TB_BIT6 | HAS_4BIT_BP | SOFT_RESET | NO_WP opcodes read 0xec dummy cycles 6 erase 0xdc program 0x34 8D extension none protocols read 1S-4S-4S write 1S-1S-4S register 1S-1S-1S erase commands 21 (4.00 KiB) [1] dc (64.0 KiB) [3] c7 (128 MiB) sector map region (in hex) | erase mask | overlaid ------------------+------------+--------- 00000000-07ffffff | [ 3] | no $ dd if=3D/dev/urandom of=3D./spi_test bs=3D1M count=3D2 2+0 records in 2+0 records out $ mtd_debug erase /dev/mtd0 0 2097152 Erased 2097152 bytes from address 0x00000000 in flash $ mtd_debug read /dev/mtd0 0 2097152 spi_read Copied 2097152 bytes from address 0x00000000 in flash to spi_read $ hexdump spi_read 0000000 ffff ffff ffff ffff ffff ffff ffff ffff * 0200000 $ sha256sum spi_read 4bda3a28f4ffe603c0ec1258c0034d65a1a0d35ab7bd523a834608adabf03cc5 spi_read $ mtd_debug write /dev/mtd0 0 2097152 spi_test Copied 2097152 bytes from spi_test to address 0x00000000 in flash $ mtd_debug read /dev/mtd0 0 2097152 spi_read Copied 2097152 bytes from address 0x00000000 in flash to spi_read $ sha256sum spi* 743a6228f6b523c54ee6670aac049b28b5ba5b70341815d50e5cb5a21d59cb8b spi_read 743a6228f6b523c54ee6670aac049b28b5ba5b70341815d50e5cb5a21d59cb8b spi_test $ mtd_debug erase /dev/mtd0 0 2097152 Erased 2097152 bytes from address 0x00000000 in flash $ mtd_debug read /dev/mtd0 0 2097152 spi_read Copied 2097152 bytes from address 0x00000000 in flash to spi_read $ sha256sum spi* 4bda3a28f4ffe603c0ec1258c0034d65a1a0d35ab7bd523a834608adabf03cc5 spi_read 743a6228f6b523c54ee6670aac049b28b5ba5b70341815d50e5cb5a21d59cb8b spi_test $ mtd_debug info /dev/mtd0 mtd.type =3D MTD_NORFLASH mtd.flags =3D MTD_CAP_NORFLASH mtd.size =3D 134217728 (128M) mtd.erasesize =3D 65536 (64K) mtd.writesize =3D 1 mtd.oobsize =3D 0 regions =3D 0 --- drivers/mtd/spi-nor/winbond.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/mtd/spi-nor/winbond.c b/drivers/mtd/spi-nor/winbond.c index 63a93c9eb9174b073e19c41eeada33b23a99b184..a13a1201eae92233091dde644d5= 90baa57e97046 100644 --- a/drivers/mtd/spi-nor/winbond.c +++ b/drivers/mtd/spi-nor/winbond.c @@ -343,6 +343,10 @@ static const struct flash_info winbond_nor_parts[] =3D= { .id =3D SNOR_ID(0xef, 0x80, 0x20), .name =3D "w25q512nwm", .otp =3D SNOR_OTP(256, 3, 0x1000, 0x1000), + }, { + /* W25Q01NWxxIQ */ + .id =3D SNOR_ID(0xef, 0x60, 0x21), + .flags =3D SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB | SPI_NOR_TB_SR_BIT6 | SPI_= NOR_4BIT_BP, }, }; =20 --=20 2.51.0 From nobody Fri Dec 19 14:24:48 2025 Received: from smtpout-04.galae.net (smtpout-04.galae.net [185.171.202.116]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3F2043009DD for ; Wed, 5 Nov 2025 17:27:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.171.202.116 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762363651; cv=none; b=fp+LXgPmIEYEZnZleEQ6qjBswi0oyUfebDYNAQ1SnFKLho3sxpequuuek7wRCocF1E0eWH2hWfRq1itn547LyIMJX0+4sUq4+QKamDiv9nxujmIFJKmEKtuqPNcHQVYEbTCqcbhOnEsBd8pJ8lkKVPZQb8qwCYfDmx1/dadrn9s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762363651; c=relaxed/simple; bh=qI2DNXrKlZW9Os0KvlW7/iuslM+6wJk/KayLdCCbiRY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=kZubLE1TFuVjd+WRAOjjZsezJ0EJ8scJpaUFF1MuRaLhcNSB0+3Sj0tNnm3DG84a+qLKuxZIycIa8q5r44R0fyOzNJ1UBBkcyx8gxyBvtoYa4EuJXFMcZlV8kVnW4Ph4U7oHhdcUHbvKUOwY9E1odahHy5Pmf9eGMlnc2q6+t1Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=Ieje6ZAr; arc=none smtp.client-ip=185.171.202.116 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="Ieje6ZAr" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id B1FE3C0E63C; Wed, 5 Nov 2025 17:27:06 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id B1E3F60693; Wed, 5 Nov 2025 17:27:27 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id F16F010B50A78; Wed, 5 Nov 2025 18:27:25 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1762363647; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=RpAQM7b8Qix65CMI/sBmP05P46NUJ0wMgmRJ/77M2f4=; b=Ieje6ZArOtDrNr9myXRx80Rdu+BsDqjTzqSmxKpm9f0BpB7n2QCcLCODmdofF0NJtXgguM rJL4w0OM626xA2mwirk3nzXVfCrBPAtmC5//6wO8BS150xf1/apGEaz3Z+JN/7FUeKBvWD Zp9rLmY5AXpsgcTpWd5rEYJAD1i6Z7X1zcrf6ib9j0CJtRgBXtyN/lzfXBDGLKcnyVeRye YVU0uGd1PArMMfOudEFGacfAGhER7KXy+sh6zuS5G0yptmhgxON6jybTTqFYztuBj03wdM hB0dj6ZSRuKbVjS3UPpSNvzKZ7VfABBvxBzBk5/TPt3FsLIsZ9ft04THYxXc3w== From: Miquel Raynal Date: Wed, 05 Nov 2025 18:27:01 +0100 Subject: [PATCH 2/6] mtd: spi-nor: winbond: Add support for W25Q01NWxxIM chips Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251105-winbond-v6-18-rc1-spi-nor-v1-2-42cc9fb46e1b@bootlin.com> References: <20251105-winbond-v6-18-rc1-spi-nor-v1-0-42cc9fb46e1b@bootlin.com> In-Reply-To: <20251105-winbond-v6-18-rc1-spi-nor-v1-0-42cc9fb46e1b@bootlin.com> To: Tudor Ambarus , Pratyush Yadav , Michael Walle , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra Cc: Thomas Petazzoni , Steam Lin , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org X-Mailer: b4 0.14.2 X-Last-TLS-Session-Version: TLSv1.3 These chips must be described as none of the block protection information are discoverable. This chip supports 4 bits plus the top/bottom addressing capability to identify the protected blocks. Cc: stable@vger.kernel.org Signed-off-by: Miquel Raynal Reviewed-by: Michael Walle --- $ cat /sys/bus/spi/devices/spi0.0/spi-nor/partname cat: can't open '/sys/bus/spi/devices/spi0.0/spi-nor/partname': No such fil= e or directory $ cat /sys/bus/spi/devices/spi0.0/spi-nor/jedec_id ef8021 $ cat /sys/bus/spi/devices/spi0.0/spi-nor/manufacturer winbond $ xxd -p /sys/bus/spi/devices/spi0.0/spi-nor/sfdp 53464450060101ff00060110800000ff84000102d00000ffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffe520fbffffffff3f44eb086b083b42bbfeffffffffff 0000ffff40eb0c200f5210d800003652b50082ea14e2e96376337a757a75 f7bdd55c19f75dffe970f9a5ffffffffffffffffffffffffffffffffff0a f0ff21ffdcff $ sha256sum /sys/bus/spi/devices/spi0.0/spi-nor/sfdp d70b64bfa72dad202ff6881f92676b3a79b1e634b60653cd15f1820b7f3acaea /sys/bus/= spi/devices/spi0.0/spi-nor/sfdp $ cat /sys/kernel/debug/spi-nor/spi0.0/capabilities Supported read modes by the flash 1S-1S-1S opcode 0x13 mode cycles 0 dummy cycles 0 1S-1S-2S opcode 0x3c mode cycles 0 dummy cycles 8 1S-2S-2S opcode 0xbc mode cycles 2 dummy cycles 2 1S-1S-4S opcode 0x6c mode cycles 0 dummy cycles 8 1S-4S-4S opcode 0xec mode cycles 2 dummy cycles 4 4S-4S-4S opcode 0xec mode cycles 2 dummy cycles 0 Supported page program modes by the flash 1S-1S-1S opcode 0x12 1S-1S-4S opcode 0x34 $ cat /sys/kernel/debug/spi-nor/spi0.0/params name (null) id ef 80 21 00 00 00 size 128 MiB write size 1 page size 256 address nbytes 4 flags HAS_SR_TB | 4B_OPCODES | HAS_4BAIT | HAS_LOCK | HAS_16BIT_SR | HAS_S= R_TB_BIT6 | HAS_4BIT_BP | SOFT_RESET | NO_WP opcodes read 0xec dummy cycles 6 erase 0xdc program 0x34 8D extension none protocols read 1S-4S-4S write 1S-1S-4S register 1S-1S-1S erase commands 21 (4.00 KiB) [1] dc (64.0 KiB) [3] c7 (128 MiB) sector map region (in hex) | erase mask | overlaid ------------------+------------+--------- 00000000-07ffffff | [ 3] | no $ dd if=3D/dev/urandom of=3D./spi_test bs=3D1M count=3D2 2+0 records in 2+0 records out $ mtd_debug erase /dev/mtd0 0 2097152 Erased 2097152 bytes from address 0x00000000 in flash $ mtd_debug read /dev/mtd0 0 2097152 spi_read Copied 2097152 bytes from address 0x00000000 in flash to spi_read $ hexdump spi_read 0000000 ffff ffff ffff ffff ffff ffff ffff ffff * 0200000 $ sha256sum spi_read 4bda3a28f4ffe603c0ec1258c0034d65a1a0d35ab7bd523a834608adabf03cc5 spi_read $ mtd_debug write /dev/mtd0 0 2097152 spi_test Copied 2097152 bytes from spi_test to address 0x00000000 in flash $ mtd_debug read /dev/mtd0 0 2097152 spi_read Copied 2097152 bytes from address 0x00000000 in flash to spi_read $ sha256sum spi* 900fef48fdac362ce15d4608acfd9d733b514751423ae8d26e94036531198fb8 spi_read 900fef48fdac362ce15d4608acfd9d733b514751423ae8d26e94036531198fb8 spi_test $ mtd_debug erase /dev/mtd0 0 2097152 Erased 2097152 bytes from address 0x00000000 in flash $ mtd_debug read /dev/mtd0 0 2097152 spi_read Copied 2097152 bytes from address 0x00000000 in flash to spi_read $ sha256sum spi* 4bda3a28f4ffe603c0ec1258c0034d65a1a0d35ab7bd523a834608adabf03cc5 spi_read 900fef48fdac362ce15d4608acfd9d733b514751423ae8d26e94036531198fb8 spi_test $ mtd_debug info /dev/mtd0 mtd.type =3D MTD_NORFLASH mtd.flags =3D MTD_CAP_NORFLASH mtd.size =3D 134217728 (128M) mtd.erasesize =3D 65536 (64K) mtd.writesize =3D 1 mtd.oobsize =3D 0 regions =3D 0 --- drivers/mtd/spi-nor/winbond.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/mtd/spi-nor/winbond.c b/drivers/mtd/spi-nor/winbond.c index a13a1201eae92233091dde644d590baa57e97046..580c9cb37958136e7e9fbc71152= de55ab008812e 100644 --- a/drivers/mtd/spi-nor/winbond.c +++ b/drivers/mtd/spi-nor/winbond.c @@ -347,6 +347,10 @@ static const struct flash_info winbond_nor_parts[] =3D= { /* W25Q01NWxxIQ */ .id =3D SNOR_ID(0xef, 0x60, 0x21), .flags =3D SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB | SPI_NOR_TB_SR_BIT6 | SPI_= NOR_4BIT_BP, + }, { + /* W25Q01NWxxIM */ + .id =3D SNOR_ID(0xef, 0x80, 0x21), + .flags =3D SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB | SPI_NOR_TB_SR_BIT6 | SPI_= NOR_4BIT_BP, }, }; =20 --=20 2.51.0 From nobody Fri Dec 19 14:24:48 2025 Received: from smtpout-03.galae.net (smtpout-03.galae.net [185.246.85.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9F44B334C25 for ; Wed, 5 Nov 2025 17:27:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.85.4 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762363652; cv=none; b=ppz/BTCBHiLmM9JDh1z2lljo29ep4kSo4djr3C5OAYZdMuqNp4FM11D3RsOS9lqHg4eT1nTLnSIt6v4cBg7UZulT1JI85h3dLI/EFpS0WJc2BE3fZN8i3wV6rUsSfaEIi5JgipauFh/Azxj6e7K+0puet848BGC2UgXSJD3d540= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762363652; c=relaxed/simple; bh=eThQIE/jvXOT4DOWR+X/o1T5PCOa2qjzsppR3EBwd9M=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=kFkp3M4Odc08rFCHodq32xVhzpG0fkoVZdbJuMxXlBIIkma2ktosu1eq0jnKGwOPry6FnqeUM57yv+pPgtXFBjbZ+dhcGDchLDaz30Am/5wl5h/2ieoW1UivmTMWnQcfJZs/8nXKF2PzO2mK0YuW0Yp0LBZIN8qsrPgUpT1jg7w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=hHxBlpEQ; arc=none smtp.client-ip=185.246.85.4 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="hHxBlpEQ" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id 2DB074E4153C; Wed, 5 Nov 2025 17:27:29 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 051C860693; Wed, 5 Nov 2025 17:27:29 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 585CC10B50864; Wed, 5 Nov 2025 18:27:27 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1762363648; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=wwGaYNz99ZwGjnDc7GOe6i79irbzdaxgzSs6VbSV9+E=; b=hHxBlpEQnkUHEjmN2EBgImPfeIdn4+Qi9TRm9IAgZo6jimne/zYs9HeX2P2eg0+O5QmNXg jjFmXewAyaUnL0lVHXoYRY2oUJNPEjzlxAuUkerLIxikcUnT8hLNy5A9iB6HJFPIxGOQYI yGc0ubbmATflDupMpAlev74SrLkkfjcJEYjpUl+w729Fxdb0LiV9hktve/LvYlbIaKcy9h vQlLK5NLuluDWyYTPL9UQxmBZceYmdYIETJFq7ZMMNpUnHyZtwxULK1fVUYCCZe1nCY6pA syF0lYcHNiM94pseYh+uScMBTkMl0fOdAO8UNq9Loe0TtAeTxZscDmVXyfKQHw== From: Miquel Raynal Date: Wed, 05 Nov 2025 18:27:02 +0100 Subject: [PATCH 3/6] mtd: spi-nor: winbond: Add support for W25Q02NWxxIM chips Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251105-winbond-v6-18-rc1-spi-nor-v1-3-42cc9fb46e1b@bootlin.com> References: <20251105-winbond-v6-18-rc1-spi-nor-v1-0-42cc9fb46e1b@bootlin.com> In-Reply-To: <20251105-winbond-v6-18-rc1-spi-nor-v1-0-42cc9fb46e1b@bootlin.com> To: Tudor Ambarus , Pratyush Yadav , Michael Walle , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra Cc: Thomas Petazzoni , Steam Lin , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org X-Mailer: b4 0.14.2 X-Last-TLS-Session-Version: TLSv1.3 These chips must be described as none of the block protection information are discoverable. This chip supports 4 bits plus the top/bottom addressing capability to identify the protected blocks. Cc: stable@vger.kernel.org Signed-off-by: Miquel Raynal Reviewed-by: Michael Walle --- $ cat /sys/bus/spi/devices/spi0.0/spi-nor/partname cat: can't open '/sys/bus/spi/devices/spi0.0/spi-nor/partname': No such fil= e or directory $ cat /sys/bus/spi/devices/spi0.0/spi-nor/jedec_id ef8022 $ cat /sys/bus/spi/devices/spi0.0/spi-nor/manufacturer winbond $ xxd -p /sys/bus/spi/devices/spi0.0/spi-nor/sfdp 53464450060101ff00060110800000ff84000102d00000ff03000102f000 00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffe520fbffffffff7f44eb086b083b42bbfeffffffffff 0000ffff40eb0c200f5210d800003652b50082ea14e2e96376337a757a75 f7a2d55c199148ffe970f8a1ffffffffffffffffffffffffffffffffff0a f0ff21ffdcff $ sha256sum /sys/bus/spi/devices/spi0.0/spi-nor/sfdp 679145368f2188ac975ec3f4c9b691e7e250147c13b6f18a28a9192700925d95 /sys/bus/= spi/devices/spi0.0/spi-nor/sfdp $ cat /sys/kernel/debug/spi-nor/spi0.0/params name (null) id ef 80 22 00 00 00 size 256 MiB write size 1 page size 256 address nbytes 4 flags HAS_SR_TB | 4B_OPCODES | HAS_4BAIT | HAS_LOCK | HAS_16BIT_SR | NO_RE= AD_CR | HAS_SR_TB_BIT6 | HAS_4BIT_BP | SOFT_RESET | NO_WP opcodes read 0xec dummy cycles 6 erase 0xdc program 0x34 8D extension none protocols read 1S-4S-4S write 1S-1S-4S register 1S-1S-1S erase commands 21 (4.00 KiB) [1] dc (64.0 KiB) [3] c7 (256 MiB) sector map region (in hex) | erase mask | overlaid ------------------+------------+--------- 00000000-0fffffff | [ 3] | no $ cat /sys/kernel/debug/spi-nor/spi0.0/capabilities Supported read modes by the flash 1S-1S-1S opcode 0x13 mode cycles 0 dummy cycles 0 1S-1S-2S opcode 0x3c mode cycles 0 dummy cycles 8 1S-2S-2S opcode 0xbc mode cycles 2 dummy cycles 2 1S-1S-4S opcode 0x6c mode cycles 0 dummy cycles 8 1S-4S-4S opcode 0xec mode cycles 2 dummy cycles 4 4S-4S-4S opcode 0xec mode cycles 2 dummy cycles 0 Supported page program modes by the flash 1S-1S-1S opcode 0x12 1S-1S-4S opcode 0x34 $ dd if=3D/dev/urandom of=3D./spi_test bs=3D1M count=3D2 2+0 records in 2+0 records out $ mtd_debug erase /dev/mtd0 0 2097152 Erased 2097152 bytes from address 0x00000000 in flash $ mtd_debug read /dev/mtd0 0 2097152 spi_read Copied 2097152 bytes from address 0x00000000 in flash to spi_read $ hexdump spi_read 0000000 ffff ffff ffff ffff ffff ffff ffff ffff * 0200000 $ sha256sum spi_read 4bda3a28f4ffe603c0ec1258c0034d65a1a0d35ab7bd523a834608adabf03cc5 spi_read $ mtd_debug write /dev/mtd0 0 2097152 spi_test Copied 2097152 bytes from spi_test to address 0x00000000 in flash $ mtd_debug read /dev/mtd0 0 2097152 spi_read Copied 2097152 bytes from address 0x00000000 in flash to spi_read $ sha256sum spi* 5cff8d15609f3eab8d8008699191d5418da5b346e4f98ab67d5d89702b584042 spi_read 5cff8d15609f3eab8d8008699191d5418da5b346e4f98ab67d5d89702b584042 spi_test $ mtd_debug erase /dev/mtd0 0 2097152 Erased 2097152 bytes from address 0x00000000 in flash $ mtd_debug read /dev/mtd0 0 2097152 spi_read Copied 2097152 bytes from address 0x00000000 in flash to spi_read $ sha256sum spi* 4bda3a28f4ffe603c0ec1258c0034d65a1a0d35ab7bd523a834608adabf03cc5 spi_read 5cff8d15609f3eab8d8008699191d5418da5b346e4f98ab67d5d89702b584042 spi_test $ mtd_debug info /dev/mtd0 mtd.type =3D MTD_NORFLASH mtd.flags =3D MTD_CAP_NORFLASH mtd.size =3D 268435456 (256M) mtd.erasesize =3D 65536 (64K) mtd.writesize =3D 1 mtd.oobsize =3D 0 regions =3D 0 --- drivers/mtd/spi-nor/winbond.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/mtd/spi-nor/winbond.c b/drivers/mtd/spi-nor/winbond.c index 580c9cb37958136e7e9fbc71152de55ab008812e..a65cbbccbbac64c83227c8158ff= 85abfa3441868 100644 --- a/drivers/mtd/spi-nor/winbond.c +++ b/drivers/mtd/spi-nor/winbond.c @@ -351,6 +351,10 @@ static const struct flash_info winbond_nor_parts[] =3D= { /* W25Q01NWxxIM */ .id =3D SNOR_ID(0xef, 0x80, 0x21), .flags =3D SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB | SPI_NOR_TB_SR_BIT6 | SPI_= NOR_4BIT_BP, + }, { + /* W25Q02NWxxIM */ + .id =3D SNOR_ID(0xef, 0x80, 0x22), + .flags =3D SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB | SPI_NOR_TB_SR_BIT6 | SPI_= NOR_4BIT_BP, }, }; =20 --=20 2.51.0 From nobody Fri Dec 19 14:24:48 2025 Received: from smtpout-02.galae.net (smtpout-02.galae.net [185.246.84.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EFBC833A000; Wed, 5 Nov 2025 17:27:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.84.56 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762363653; cv=none; b=ZAOjZLfxhkdCFz7pB+jJDlAFt4sP3nDhkXly6zJ7G3HZkjq1X+Lm0flDiNS7nHEhJ8CqjCrNJRB//kuLyJ02djQUDZERJ6GcMF8WDf8FtHYD4ER0D9XawFpQDWBlLimb0eYQZQ4Wddq1j23RCfN57YPW3ghMBioQ4We3BKYZDV4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762363653; c=relaxed/simple; bh=tGO2kgsXQe//qcx2Nw4bXMT9zrKWeUfu6t8Kgzqm9cw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=JCqXCEyw2IN06nXpqqSOzE+8YzOO+ztKXW3RaXgx+eWKnBFUnmEwJrKykppQi+/edjSXTKWJnRhyQj+9zAh5QlpSS2SKOm7iYF8Ru2VR6LZGFJ7H90HiypauD3ownROmQzpdlZV6Yv9zdKc0QzF7ggT3oR4z0anEr4/UJZcuDr4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=1vlJoEoC; arc=none smtp.client-ip=185.246.84.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="1vlJoEoC" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id 82CF31A18C6; Wed, 5 Nov 2025 17:27:30 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 5327A60693; Wed, 5 Nov 2025 17:27:30 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 9CFDE10B50A77; Wed, 5 Nov 2025 18:27:28 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1762363649; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=wJ40tELRwlfdzsxlDdza2G/jyyYMbFpPSrFFQEx532o=; b=1vlJoEoCgQUpBhp/0awSNb5kDoJH1iWIoAn3JNdzg9/j34C8mKAV0lsYA3pqptWOOK53YA RxRnsxImC1kNcy+/wYI0ehjlU8/s7LsxmTJtjSK5h1AbocjmXrLvSPRWUvKaaKI9AW7hx8 hUIVcYFzBUUEZYdW6nqyx0H+c6a/0g4A9tAH0pLYLvNIwOdRahJByMKOR8n3o9azy3Vz8B K1cIvbjFcyTyqo8NOoozuZdEilKRbUxOt41w3kFYzydcB6Msc2i7znalkS/c64mw3+nP0g joF6sJWEsnnnQ6H7HsoWEi8QF9mj4LxbJE9fQqkJrGgSyoo8dqkQb4kv2yJgBw== From: Miquel Raynal Date: Wed, 05 Nov 2025 18:27:03 +0100 Subject: [PATCH 4/6] mtd: spi-nor: winbond: Add support for W25H512NWxxAM chips Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251105-winbond-v6-18-rc1-spi-nor-v1-4-42cc9fb46e1b@bootlin.com> References: <20251105-winbond-v6-18-rc1-spi-nor-v1-0-42cc9fb46e1b@bootlin.com> In-Reply-To: <20251105-winbond-v6-18-rc1-spi-nor-v1-0-42cc9fb46e1b@bootlin.com> To: Tudor Ambarus , Pratyush Yadav , Michael Walle , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra Cc: Thomas Petazzoni , Steam Lin , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org X-Mailer: b4 0.14.2 X-Last-TLS-Session-Version: TLSv1.3 These chips must be described as none of the block protection information are discoverable. This chip supports 4 bits plus the top/bottom addressing capability to identify the protected blocks. Cc: stable@vger.kernel.org Signed-off-by: Miquel Raynal Reviewed-by: Michael Walle --- $ cat /sys/bus/spi/devices/spi0.0/spi-nor/partname cat: can't open '/sys/bus/spi/devices/spi0.0/spi-nor/partname': No such fil= e or directory $ cat /sys/bus/spi/devices/spi0.0/spi-nor/jedec_id efa020 $ cat /sys/bus/spi/devices/spi0.0/spi-nor/manufacturer winbond $ xxd -p /sys/bus/spi/devices/spi0.0/spi-nor/sfdp 53464450060101ff00060110800000ff84000102d00000ffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffe520fbffffffff1f44eb086b083b42bbfeffffffffff 0000ffff40eb0c200f5210d800003302a60081e714d9e96376337a757a75 f7bdd55c19f75dffe970f9a5ffffffffffffffffffffffffffffffffff0a f0ff21ffdcff $ sha256sum /sys/bus/spi/devices/spi0.0/spi-nor/sfdp 07b7eff0cc6e637cbe3282c0ee75bd23e0da622ca26319238c07bcb4d677fb34 /sys/bus/= spi/devices/spi0.0/spi-nor/sfdp $ cat /sys/kernel/debug/spi-nor/spi0.0/params name (null) id ef a0 20 00 00 00 size 64.0 MiB write size 1 page size 256 address nbytes 4 flags HAS_SR_TB | 4B_OPCODES | HAS_4BAIT | HAS_LOCK | HAS_16BIT_SR | HAS_S= R_TB_BIT6 | HAS_4BIT_BP | SOFT_RESET | NO_WP opcodes read 0xec dummy cycles 6 erase 0xdc program 0x34 8D extension none protocols read 1S-4S-4S write 1S-1S-4S register 1S-1S-1S erase commands 21 (4.00 KiB) [1] dc (64.0 KiB) [3] c7 (64.0 MiB) sector map region (in hex) | erase mask | overlaid ------------------+------------+--------- 00000000-03ffffff | [ 3] | no $ cat /sys/kernel/debug/spi-nor/spi0.0/capabilities Supported read modes by the flash 1S-1S-1S opcode 0x13 mode cycles 0 dummy cycles 0 1S-1S-2S opcode 0x3c mode cycles 0 dummy cycles 8 1S-2S-2S opcode 0xbc mode cycles 2 dummy cycles 2 1S-1S-4S opcode 0x6c mode cycles 0 dummy cycles 8 1S-4S-4S opcode 0xec mode cycles 2 dummy cycles 4 4S-4S-4S opcode 0xec mode cycles 2 dummy cycles 0 Supported page program modes by the flash 1S-1S-1S opcode 0x12 1S-1S-4S opcode 0x34 $ dd if=3D/dev/urandom of=3D./spi_test bs=3D1M count=3D2 2+0 records in 2+0 records out $ mtd_debug erase /dev/mtd0 0 2097152 Erased 2097152 bytes from address 0x00000000 in flash $ mtd_debug read /dev/mtd0 0 2097152 spi_read Copied 2097152 bytes from address 0x00000000 in flash to spi_read $ hexdump spi_read 0000000 ffff ffff ffff ffff ffff ffff ffff ffff * 0200000 $ sha256sum spi_read 4bda3a28f4ffe603c0ec1258c0034d65a1a0d35ab7bd523a834608adabf03cc5 spi_read $ mtd_debug write /dev/mtd0 0 2097152 spi_test Copied 2097152 bytes from spi_test to address 0x00000000 in flash $ mtd_debug read /dev/mtd0 0 2097152 spi_read Copied 2097152 bytes from address 0x00000000 in flash to spi_read $ sha256sum spi* 40a9f42f218c8f909eb9f13e5edb964be55d5a962a91ad54f6b1dcf51ca637ad spi_read 40a9f42f218c8f909eb9f13e5edb964be55d5a962a91ad54f6b1dcf51ca637ad spi_test $ mtd_debug erase /dev/mtd0 0 2097152 Erased 2097152 bytes from address 0x00000000 in flash $ mtd_debug read /dev/mtd0 0 2097152 spi_read Copied 2097152 bytes from address 0x00000000 in flash to spi_read $ sha256sum spi* 4bda3a28f4ffe603c0ec1258c0034d65a1a0d35ab7bd523a834608adabf03cc5 spi_read 40a9f42f218c8f909eb9f13e5edb964be55d5a962a91ad54f6b1dcf51ca637ad spi_test $ mtd_debug info /dev/mtd0 mtd.type =3D MTD_NORFLASH mtd.flags =3D MTD_CAP_NORFLASH mtd.size =3D 67108864 (64M) mtd.erasesize =3D 65536 (64K) mtd.writesize =3D 1 mtd.oobsize =3D 0 regions =3D 0 --- drivers/mtd/spi-nor/winbond.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/mtd/spi-nor/winbond.c b/drivers/mtd/spi-nor/winbond.c index a65cbbccbbac64c83227c8158ff85abfa3441868..781ca0abfcdca2dc883e33bfa5c= 164623cf0905d 100644 --- a/drivers/mtd/spi-nor/winbond.c +++ b/drivers/mtd/spi-nor/winbond.c @@ -355,6 +355,10 @@ static const struct flash_info winbond_nor_parts[] =3D= { /* W25Q02NWxxIM */ .id =3D SNOR_ID(0xef, 0x80, 0x22), .flags =3D SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB | SPI_NOR_TB_SR_BIT6 | SPI_= NOR_4BIT_BP, + }, { + /* W25H512NWxxAM */ + .id =3D SNOR_ID(0xef, 0xa0, 0x20), + .flags =3D SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB | SPI_NOR_TB_SR_BIT6 | SPI_= NOR_4BIT_BP, }, }; =20 --=20 2.51.0 From nobody Fri Dec 19 14:24:48 2025 Received: from smtpout-04.galae.net (smtpout-04.galae.net [185.171.202.116]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 706D733C535 for ; Wed, 5 Nov 2025 17:27:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.171.202.116 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762363655; cv=none; b=VAGGK56h2NfztRHo6M/jJZrNG63/VaI1mr0gOCNXVimk75I9tx5jUPH04R2mWZR48teRUDhdVR4IjlVBj4tvUN/Plz2+CGKTNyqj8+ZlfPVr8GG0DZdyiH60fbylOHBvTQbCf7YAeDS3r9zu4IJQE7W2G5enWSnEIULpKvG+RNU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762363655; c=relaxed/simple; bh=maq1m12iQatR8a1b5wVM2as7+yXN9heZd/OrbMLbvpk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=pP2w50VXOfmyDyKibnqicsbSoHrtJpNMrfFPYp4ic4rv7bp6UL8/HD3EwiyLoDiF2x3QjAcLnGAiiHf7dXOwAWJwAUAsa5UqdIq/0riLXU0yFyxxQmxjLklucIXCHJAPki1J35l+esS6zHTV5+OOvdSBwOiwitS9BaZPK3U+YG0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=S3/K3cNg; arc=none smtp.client-ip=185.171.202.116 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="S3/K3cNg" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id D1B6FC0E63B; Wed, 5 Nov 2025 17:27:10 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id D12EE60693; Wed, 5 Nov 2025 17:27:31 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 153EA10B50A78; Wed, 5 Nov 2025 18:27:29 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1762363651; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=CGieSf4sf5PwIa6l1gS6GefuQmbm4k5Nc8IQbv6zCok=; b=S3/K3cNg0YEJRdK7CBYcE3BG/lu/+2KuZDrUpqIRoM4yqK2+uB1tM9LIIb6nyQY9VrMvyE b1EomsmH9oMQ3wad+9ju4qK5QZKBJ1tsOZvajlBlVHvJZSnP4INIG+QClClVpmMBAJ6G+L sM7MjGlB+a3iHL6XOMKsi0XWIlHkv3U97UXJ7aAokNq1JcBcw83brY64gTVZW1W/flx3VD l6gOzyagkFwRZ9FUciy0mC8IWoaSRFsg75ARqu9H7/HokRrCHeN/tdsd7inb4ABQZXQvXU loSuq5eB4sACsMrMuyxcQy84M7qIxJ/0nDQWTmGXNUbPuvTEapDLX8/Z6I+U9A== From: Miquel Raynal Date: Wed, 05 Nov 2025 18:27:04 +0100 Subject: [PATCH 5/6] mtd: spi-nor: winbond: Add support for W25H01NWxxAM chips Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251105-winbond-v6-18-rc1-spi-nor-v1-5-42cc9fb46e1b@bootlin.com> References: <20251105-winbond-v6-18-rc1-spi-nor-v1-0-42cc9fb46e1b@bootlin.com> In-Reply-To: <20251105-winbond-v6-18-rc1-spi-nor-v1-0-42cc9fb46e1b@bootlin.com> To: Tudor Ambarus , Pratyush Yadav , Michael Walle , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra Cc: Thomas Petazzoni , Steam Lin , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org X-Mailer: b4 0.14.2 X-Last-TLS-Session-Version: TLSv1.3 These chips must be described as none of the block protection information are discoverable. This chip supports 4 bits plus the top/bottom addressing capability to identify the protected blocks. Cc: stable@vger.kernel.org Signed-off-by: Miquel Raynal Reviewed-by: Michael Walle --- $ cat /sys/bus/spi/devices/spi0.0/spi-nor/partname cat: can't open '/sys/bus/spi/devices/spi0.0/spi-nor/partname': No such fil= e or directory $ cat /sys/bus/spi/devices/spi0.0/spi-nor/jedec_id efa021 $ cat /sys/bus/spi/devices/spi0.0/spi-nor/manufacturer winbond $ xxd -p /sys/bus/spi/devices/spi0.0/spi-nor/sfdp 53464450060101ff00060110800000ff84000102d00000ffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffe520fbffffffff3f44eb086b083b42bbfeffffffffff 0000ffff40eb0c200f5210d800003652b50082ea14e2e96376337a757a75 f7bdd55c19f75dffe970f9a5ffffffffffffffffffffffffffffffffff0a f0ff21ffdcff $ sha256sum /sys/bus/spi/devices/spi0.0/spi-nor/sfdp d70b64bfa72dad202ff6881f92676b3a79b1e634b60653cd15f1820b7f3acaea /sys/bus/= spi/devices/spi0.0/spi-nor/sfdp $ cat /sys/kernel/debug/spi-nor/spi0.0/params name (null) id ef a0 21 00 00 00 size 128 MiB write size 1 page size 256 address nbytes 4 flags HAS_SR_TB | 4B_OPCODES | HAS_4BAIT | HAS_LOCK | HAS_16BIT_SR | HAS_S= R_TB_BIT6 | HAS_4BIT_BP | SOFT_RESET | NO_WP opcodes read 0xec dummy cycles 6 erase 0xdc program 0x34 8D extension none protocols read 1S-4S-4S write 1S-1S-4S register 1S-1S-1S erase commands 21 (4.00 KiB) [1] dc (64.0 KiB) [3] c7 (128 MiB) sector map region (in hex) | erase mask | overlaid ------------------+------------+--------- 00000000-07ffffff | [ 3] | no $ cat /sys/kernel/debug/spi-nor/spi0.0/capabilities Supported read modes by the flash 1S-1S-1S opcode 0x13 mode cycles 0 dummy cycles 0 1S-1S-2S opcode 0x3c mode cycles 0 dummy cycles 8 1S-2S-2S opcode 0xbc mode cycles 2 dummy cycles 2 1S-1S-4S opcode 0x6c mode cycles 0 dummy cycles 8 1S-4S-4S opcode 0xec mode cycles 2 dummy cycles 4 4S-4S-4S opcode 0xec mode cycles 2 dummy cycles 0 Supported page program modes by the flash 1S-1S-1S opcode 0x12 1S-1S-4S opcode 0x34 $ dd if=3D/dev/urandom of=3D./spi_test bs=3D1M count=3D2 2+0 records in 2+0 records out $ mtd_debug erase /dev/mtd0 0 2097152 Erased 2097152 bytes from address 0x00000000 in flash $ mtd_debug read /dev/mtd0 0 2097152 spi_read Copied 2097152 bytes from address 0x00000000 in flash to spi_read $ hexdump spi_read 0000000 ffff ffff ffff ffff ffff ffff ffff ffff * 0200000 $ sha256sum spi_read 4bda3a28f4ffe603c0ec1258c0034d65a1a0d35ab7bd523a834608adabf03cc5 spi_read $ mtd_debug write /dev/mtd0 0 2097152 spi_test Copied 2097152 bytes from spi_test to address 0x00000000 in flash $ mtd_debug read /dev/mtd0 0 2097152 spi_read Copied 2097152 bytes from address 0x00000000 in flash to spi_read $ sha256sum spi* a2cab5130668ecf92f4da32cbc2ab7be5e6db03ff36972775822f56e324d5122 spi_read a2cab5130668ecf92f4da32cbc2ab7be5e6db03ff36972775822f56e324d5122 spi_test $ mtd_debug erase /dev/mtd0 0 2097152 Erased 2097152 bytes from address 0x00000000 in flash $ mtd_debug read /dev/mtd0 0 2097152 spi_read Copied 2097152 bytes from address 0x00000000 in flash to spi_read $ sha256sum spi* 4bda3a28f4ffe603c0ec1258c0034d65a1a0d35ab7bd523a834608adabf03cc5 spi_read a2cab5130668ecf92f4da32cbc2ab7be5e6db03ff36972775822f56e324d5122 spi_test $ mtd_debug info /dev/mtd0 mtd.type =3D MTD_NORFLASH mtd.flags =3D MTD_CAP_NORFLASH mtd.size =3D 134217728 (128M) mtd.erasesize =3D 65536 (64K) mtd.writesize =3D 1 mtd.oobsize =3D 0 regions =3D 0 --- drivers/mtd/spi-nor/winbond.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/mtd/spi-nor/winbond.c b/drivers/mtd/spi-nor/winbond.c index 781ca0abfcdca2dc883e33bfa5c164623cf0905d..338e44db506a819b15e21f312c0= 6ec13e6d37d28 100644 --- a/drivers/mtd/spi-nor/winbond.c +++ b/drivers/mtd/spi-nor/winbond.c @@ -359,6 +359,10 @@ static const struct flash_info winbond_nor_parts[] =3D= { /* W25H512NWxxAM */ .id =3D SNOR_ID(0xef, 0xa0, 0x20), .flags =3D SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB | SPI_NOR_TB_SR_BIT6 | SPI_= NOR_4BIT_BP, + }, { + /* W25H01NWxxAM */ + .id =3D SNOR_ID(0xef, 0xa0, 0x21), + .flags =3D SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB | SPI_NOR_TB_SR_BIT6 | SPI_= NOR_4BIT_BP, }, }; =20 --=20 2.51.0 From nobody Fri Dec 19 14:24:48 2025 Received: from smtpout-02.galae.net (smtpout-02.galae.net [185.246.84.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0622733F38A; Wed, 5 Nov 2025 17:27:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.84.56 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762363656; cv=none; b=YGroMJvQLetqEhptUUqM77NQIJ3ZfzUeJV4xmRixIekAWFZg1l60D8/UjIb4DoXvTYog2RnmtcqJUgof0PsSC8NdVc3nyGFtG0WYEnBhQiGXV8P6bqQ/JbyqCxmO2MSxtsGNsRZViWFZCOCpQYgIPXX/c6Cm+L3DJrq9hyrBf5E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762363656; c=relaxed/simple; bh=/hd2rwzqq6wvo/9MrKI9Mzxj6DBYw3Osq4cAgFsgCRA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=mDo18tf426KO95jBUf4knAcjCcJYgtzyL1gPyhddqzUJDA7eCVpUpS+A5AdGXsL1jPxrnSkoyynZXZsr5QE8Z30fEWzYSOmT1x39yUy28lGjOqa5RmefdzTElc1zIF+7kSlIUEms2KeV3PLa0xViSX0mN5HCaK0ZzcspKG9my5E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=UbUavsTz; arc=none smtp.client-ip=185.246.84.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="UbUavsTz" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id 775141A18C9; Wed, 5 Nov 2025 17:27:33 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 4C87F60693; Wed, 5 Nov 2025 17:27:33 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 785DC10B50A99; Wed, 5 Nov 2025 18:27:31 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1762363652; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=/zPU0XqUL+X2RIpZhgDNsA5zIXOFJQTkFZ56bH7HEnA=; b=UbUavsTzOP9h0/HnnUKMJcTUiUfxtqZW2iTmzlxwOY8/3C/FvuuJvXIf7XFIFVPcRMK5hD xO0DUuUwddMuzN04xMRsZhPr4yzFGPClXEqbtMlK5vYU2K1Da1ZTM9hklb3townoHY1za7 uia+0hUiSU+YKtYWt2C9hqtX38WxEP1liwsLg5jLaw2i0r2J2wgFTPSYUsU077irN7lHKq 4Cpa5RjXjCR4ErF4CfFfNuUUBKdOGrvrmagW0n+Q1O++bpzaRitvxq1Tmgv+d/hfWzNZKF tnvFatIdKTqRZDYYkO2rjq4A/9uJ696oXkOGflwV2LiSbvAzME9ErbIlaiMq+g== From: Miquel Raynal Date: Wed, 05 Nov 2025 18:27:05 +0100 Subject: [PATCH 6/6] mtd: spi-nor: winbond: Add support for W25H02NWxxAM chips Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251105-winbond-v6-18-rc1-spi-nor-v1-6-42cc9fb46e1b@bootlin.com> References: <20251105-winbond-v6-18-rc1-spi-nor-v1-0-42cc9fb46e1b@bootlin.com> In-Reply-To: <20251105-winbond-v6-18-rc1-spi-nor-v1-0-42cc9fb46e1b@bootlin.com> To: Tudor Ambarus , Pratyush Yadav , Michael Walle , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra Cc: Thomas Petazzoni , Steam Lin , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org X-Mailer: b4 0.14.2 X-Last-TLS-Session-Version: TLSv1.3 These chips must be described as none of the block protection information are discoverable. This chip supports 4 bits plus the top/bottom addressing capability to identify the protected blocks. Cc: stable@vger.kernel.org Signed-off-by: Miquel Raynal Reviewed-by: Michael Walle --- $ cat /sys/bus/spi/devices/spi0.0/spi-nor/partname cat: can't open '/sys/bus/spi/devices/spi0.0/spi-nor/partname': No such fil= e or directory $ cat /sys/bus/spi/devices/spi0.0/spi-nor/jedec_id efa022 $ cat /sys/bus/spi/devices/spi0.0/spi-nor/manufacturer winbond $ xxd -p /sys/bus/spi/devices/spi0.0/spi-nor/sfdp 53464450060101ff00060110800000ff84000102d00000ff03000102f000 00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffe520fbffffffff7f44eb086b083b42bbfeffffffffff 0000ffff40eb0c200f5210d800003652b50082ea14e2e96376337a757a75 f7a2d55c199148ffe970f8a1ffffffffffffffffffffffffffffffffff0a f0ff21ffdcff $ sha256sum /sys/bus/spi/devices/spi0.0/spi-nor/sfdp 679145368f2188ac975ec3f4c9b691e7e250147c13b6f18a28a9192700925d95 /sys/bus/= spi/devices/spi0.0/spi-nor/sfdp $ cat /sys/kernel/debug/spi-nor/spi0.0/params name (null) id ef a0 22 00 00 00 size 256 MiB write size 1 page size 256 address nbytes 4 flags HAS_SR_TB | 4B_OPCODES | HAS_4BAIT | HAS_LOCK | HAS_16BIT_SR | NO_RE= AD_CR | HAS_SR_TB_BIT6 | HAS_4BIT_BP | SOFT_RESET | NO_WP opcodes read 0xec dummy cycles 6 erase 0xdc program 0x34 8D extension none protocols read 1S-4S-4S write 1S-1S-4S register 1S-1S-1S erase commands 21 (4.00 KiB) [1] dc (64.0 KiB) [3] c7 (256 MiB) sector map region (in hex) | erase mask | overlaid ------------------+------------+--------- 00000000-0fffffff | [ 3] | no $ cat /sys/kernel/debug/spi-nor/spi0.0/capabilities Supported read modes by the flash 1S-1S-1S opcode 0x13 mode cycles 0 dummy cycles 0 1S-1S-2S opcode 0x3c mode cycles 0 dummy cycles 8 1S-2S-2S opcode 0xbc mode cycles 2 dummy cycles 2 1S-1S-4S opcode 0x6c mode cycles 0 dummy cycles 8 1S-4S-4S opcode 0xec mode cycles 2 dummy cycles 4 4S-4S-4S opcode 0xec mode cycles 2 dummy cycles 0 Supported page program modes by the flash 1S-1S-1S opcode 0x12 1S-1S-4S opcode 0x34 $ dd if=3D/dev/urandom of=3D./spi_test bs=3D1M count=3D2 2+0 records in 2+0 records out $ mtd_debug erase /dev/mtd0 0 2097152 Erased 2097152 bytes from address 0x00000000 in flash $ mtd_debug read /dev/mtd0 0 2097152 spi_read Copied 2097152 bytes from address 0x00000000 in flash to spi_read $ hexdump spi_read 0000000 ffff ffff ffff ffff ffff ffff ffff ffff * 0200000 $ sha256sum spi_read 4bda3a28f4ffe603c0ec1258c0034d65a1a0d35ab7bd523a834608adabf03cc5 spi_read $ mtd_debug write /dev/mtd0 0 2097152 spi_test Copied 2097152 bytes from spi_test to address 0x00000000 in flash $ mtd_debug read /dev/mtd0 0 2097152 spi_read Copied 2097152 bytes from address 0x00000000 in flash to spi_read $ sha256sum spi* 0f59f02ed36e0c9a0c075787e27175d3428ac008be71c2322dcaf9000ef1e324 spi_read 0f59f02ed36e0c9a0c075787e27175d3428ac008be71c2322dcaf9000ef1e324 spi_test $ mtd_debug erase /dev/mtd0 0 2097152 mtd_debug read /dev/mtd0 0 2097152 spi_read Erased 2097152 bytes from address 0x00000000 in flash $ mtd_debug read /dev/mtd0 0 2097152 spi_read sha256sum spi* Copied 2097152 bytes from address 0x00000000 in flash to spi_read $ sha256sum spi* 4bda3a28f4ffe603c0ec1258c0034d65a1a0d35ab7bd523a834608adabf03cc5 spi_read 0f59f02ed36e0c9a0c075787e27175d3428ac008be71c2322dcaf9000ef1e324 spi_test $ mtd_debug info /dev/mtd0 mtd.type =3D MTD_NORFLASH mtd.flags =3D MTD_CAP_NORFLASH mtd.size =3D 268435456 (256M) mtd.erasesize =3D 65536 (64K) mtd.writesize =3D 1 mtd.oobsize =3D 0 regions =3D 0 --- drivers/mtd/spi-nor/winbond.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/mtd/spi-nor/winbond.c b/drivers/mtd/spi-nor/winbond.c index 338e44db506a819b15e21f312c06ec13e6d37d28..fb855fe44733db5664c200520d1= 9a6be33edc323 100644 --- a/drivers/mtd/spi-nor/winbond.c +++ b/drivers/mtd/spi-nor/winbond.c @@ -363,6 +363,10 @@ static const struct flash_info winbond_nor_parts[] =3D= { /* W25H01NWxxAM */ .id =3D SNOR_ID(0xef, 0xa0, 0x21), .flags =3D SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB | SPI_NOR_TB_SR_BIT6 | SPI_= NOR_4BIT_BP, + }, { + /* W25H02NWxxAM */ + .id =3D SNOR_ID(0xef, 0xa0, 0x22), + .flags =3D SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB | SPI_NOR_TB_SR_BIT6 | SPI_= NOR_4BIT_BP, }, }; =20 --=20 2.51.0