From nobody Mon Jun 8 11:05:06 2026 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 710DD3EA946 for ; Fri, 29 May 2026 15:22:44 +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=1780068166; cv=none; b=m+SfHa4go0EHbZXnp9GeWd1+/IPDAUN/JEDk1V9r8lc9reP00PJOx/MEt5J7gvmOoMO6iNu32EVvXEzQ8GC7ctTjPoCnT8Q1dRQijcEYuMSTVusJ58zNuntsHMjsWjMb+5IfWRO6Nn32+ko144UVRkMFCop8cUw5zPYusynsG2Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780068166; c=relaxed/simple; bh=H/1KwxRxA9MJgrHJEZfpPrdJAU4vrr9x4kW9dEn/F1A=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Xw7P+Ze/x++ep1DY3zbfzFFqoRKYIqgE2utTKWdnUDmq3nyG305bHhBqzoWIymcItsYyBYLtJ2ztSGJUlt8OVY4qD3ZEvoAoxdqQxOj+M1H+USFQJGsUsQ7SUU3Lb27LGi1gad0ZbEaF3IbbXFnx4jOPGmCSbsTDx98Gy+fuaqY= 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=vayz5YRQ; 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="vayz5YRQ" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id 6A592C6245F; Fri, 29 May 2026 15:22:43 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id B0DA0601FA; Fri, 29 May 2026 15:22:42 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 0182810888CC5; Fri, 29 May 2026 17:22:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1780068161; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=ZU/k+2Vyb6Md2GIit6Y8Yowf9rqXg158F9Peho0B7Tw=; b=vayz5YRQNe/R/l5tGvrkX4obBKo1IZb0nA5WLVISwPlGZT5J8DPWYMuxHn8x0Y9AuaKbAO VGpTpnSVN7yr2bhmea+cwO5aOsR92hkFeV3RLhWZ8eKJTJvv0K+EIhP+SgscBDvSd3szU6 ZyoZyH1W33Nb6FvvOUilAHsQ79xaAxDpFjHN/KeOM6KuAg0jziTCqxg2U7Pqh+xo6OUGAb 1T9Qd2JZQERQt/8FaLkackZNCLXX2FGuafSPiYGh3NdopTLUC8Nc3uA+OvvOadric5a8Rk d9gXHznaCZQl7Filo6QfUy5E2fnUK0QZOxWun8QuVgECETJ4lYbPA492QnfSAg== From: Miquel Raynal Date: Fri, 29 May 2026 17:22:21 +0200 Subject: [PATCH 01/30] mtd: spi-nor: winbond: Move W25Q01NW to its right place 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: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-1-87e5d3122244@bootlin.com> References: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-0-87e5d3122244@bootlin.com> In-Reply-To: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-0-87e5d3122244@bootlin.com> To: Pratyush Yadav , Michael Walle , Takahiro Kuwano , Richard Weinberger , Vignesh Raghavendra Cc: Thomas Petazzoni , Steam Lin , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Miquel Raynal X-Mailer: b4 0.14.3 X-Last-TLS-Session-Version: TLSv1.3 Chips are sorted by families, and inside the families, by density. The second ID byte indicates the family, the third indicates the density. Move W25Q01NW to the right place. Signed-off-by: Miquel Raynal --- drivers/mtd/spi-nor/winbond.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/mtd/spi-nor/winbond.c b/drivers/mtd/spi-nor/winbond.c index 8ebdbcec0b3f..662a022d36e7 100644 --- a/drivers/mtd/spi-nor/winbond.c +++ b/drivers/mtd/spi-nor/winbond.c @@ -300,6 +300,12 @@ static const struct flash_info winbond_nor_parts[] =3D= { .id =3D SNOR_ID(0xef, 0x60, 0x20), .name =3D "w25q512nwq", .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 | SPI_NOR_HAS_CMP, + .fixups =3D &winbond_rdcr_fixup, }, { .id =3D SNOR_ID(0xef, 0x70, 0x15), .name =3D "w25q16jv-im/jm", @@ -365,12 +371,6 @@ 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 | SPI_NOR_HAS_CMP, - .fixups =3D &winbond_rdcr_fixup, }, { /* W25Q01NWxxIM */ .id =3D SNOR_ID(0xef, 0x80, 0x21), --=20 2.53.0 From nobody Mon Jun 8 11:05:06 2026 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 19A423EBF0C for ; Fri, 29 May 2026 15:22:45 +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=1780068167; cv=none; b=tIgYo1P90jsGhEgQGNasTFdGa34veRlcUrwiUTH8WRjlN1wo9itDfRTkZbvHI21mxumdVCIo+k7VBvtTCJ/FOlxyWz2G5abl/maJt/u0//phQD/QOZ0m30HkWtgXytNb/4eMTIs/QyHQ6l/TrPqlLXumSCNexkAjvbJjT1VOfR8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780068167; c=relaxed/simple; bh=CFAAKq1Jk2JmL/etD80DneskD1/xAuNjQ0AqStTGg90=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=TnMfrMaYQKL08ffd34RQuRpIYOPC4YjKRR+C+yTB7JWlp1yGvj6JW9D6I5p1Ag1vt9/UCNwxO+LSqmkQNnTIugw3CKoQzaqaAbCp5kjT8ypyWkDBf73/VYvsiOW4GQExj8azopTBlqvCQKMca/73JGRxzk6Dk8E/6xvMFg3HDZY= 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=IyST4XOb; 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="IyST4XOb" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id 67B374E42D90; Fri, 29 May 2026 15:22:44 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 37F1B601FA; Fri, 29 May 2026 15:22:44 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 4444E10888CCE; Fri, 29 May 2026 17:22:42 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1780068163; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=4Y9TlqfU0Z0fyu+XO5hTI39zjYuD6nXwQm3tYZOcRa4=; b=IyST4XObi+yOrdnSEpIdkGlPl/IUy2ocERGMgSUI+ua2IysKfpoYDnqCZMjJ+zjGlpIsGI 7jk1glsUJu5sNnQjv3GOrAADiZgTg3gplRYLd0JXcigFarz2NSFJuOY7Jdnpo8ScUk7CJS Dxcvwp9XFhC8m+oXl5NQ8FDxzs3HYi4drAtRxjyOZT57koT0jGv54EY9iV5Ta+uYvZ9K0U BJ4RhqMffE1YuN8cryrxjIBaZ9wCZxX0baHbCQFGGWL0hIf0vHurgdheMHM29knzZ00iJi asD4IKzOHQyzh/4hxP1WegD/a1QFfn0mv/42V9QRlwpfXF/LCunxdmNa3/lIHw== From: Miquel Raynal Date: Fri, 29 May 2026 17:22:22 +0200 Subject: [PATCH 02/30] mtd: spi-nor: winbond: Normalize names 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: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-2-87e5d3122244@bootlin.com> References: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-0-87e5d3122244@bootlin.com> In-Reply-To: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-0-87e5d3122244@bootlin.com> To: Pratyush Yadav , Michael Walle , Takahiro Kuwano , Richard Weinberger , Vignesh Raghavendra Cc: Thomas Petazzoni , Steam Lin , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Miquel Raynal X-Mailer: b4 0.14.3 X-Last-TLS-Session-Version: TLSv1.3 Winbond chips cannot just be named eg. "W25Q02JV". There are always more letters after that name, some of them matter. - W is the Winbond prefix - 25Q is the type of device -> 25Q indicates a quad capable SPI NOR -> 25H indicates an automotive grade chip - 02J is the density -> in this case 2Gib - V is the voltage -> V means 3.3V -> W means 1.8V - The next letters (either 2 or 3 letters) are completely irrelevant for the software and purely indicate the hardware package. - The penultimate letter is the temperature grade -> I for Industrial grade -> J means "above" industrial - Q, N or M indicate factory states (like QE=3D1) and also the DTR capability. -> Q and N typically have the same IDs -> M chips typically have a different ID As a result, W25Q01NWxxIQ is irrelevant and would better be named W25Q01NW-Q, W25Q02JV is irrelevant and would better be named W25Q02JV-M, etc. Make that list uniform before adding more IDs/names. Signed-off-by: Miquel Raynal --- drivers/mtd/spi-nor/winbond.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/mtd/spi-nor/winbond.c b/drivers/mtd/spi-nor/winbond.c index 662a022d36e7..03e59ff3228f 100644 --- a/drivers/mtd/spi-nor/winbond.c +++ b/drivers/mtd/spi-nor/winbond.c @@ -301,7 +301,7 @@ static const struct flash_info winbond_nor_parts[] =3D { .name =3D "w25q512nwq", .otp =3D SNOR_OTP(256, 3, 0x1000, 0x1000), }, { - /* W25Q01NWxxIQ */ + /* W25Q01NW-Q */ .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 | SPI_NOR_HAS_CMP, @@ -334,7 +334,7 @@ static const struct flash_info winbond_nor_parts[] =3D { .id =3D SNOR_ID(0xef, 0x70, 0x19), .name =3D "w25q256jvm", }, { - /* W25Q02JV */ + /* W25Q02JV-M */ .id =3D SNOR_ID(0xef, 0x70, 0x22), .fixups =3D &winbond_nor_multi_die_fixups, }, { @@ -372,28 +372,28 @@ static const struct flash_info winbond_nor_parts[] = =3D { .name =3D "w25q512nwm", .otp =3D SNOR_OTP(256, 3, 0x1000, 0x1000), }, { - /* W25Q01NWxxIM */ + /* W25Q01NW-M */ .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 | SPI_NOR_HAS_CMP, }, { - /* W25Q02NWxxIM */ + /* W25Q02NW-M */ .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 | SPI_NOR_HAS_CMP, .fixups =3D &winbond_rdcr_fixup, }, { - /* W25H512NWxxAM */ + /* W25H512NW-M */ .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 | SPI_NOR_HAS_CMP, }, { - /* W25H01NWxxAM */ + /* W25H01NW-M */ .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 | SPI_NOR_HAS_CMP, }, { - /* W25H02NWxxAM */ + /* W25H02NW-M */ .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 | SPI_NOR_HAS_CMP, --=20 2.53.0 From nobody Mon Jun 8 11:05:06 2026 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 3C28C3EE1D3 for ; Fri, 29 May 2026 15:22:46 +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=1780068171; cv=none; b=ro8zSYvHjnM9nWuOFoD7V3chD1Vu/epLpyzMSLtm6glabZDncws4WnMNFNLw6MAlIUjdSDuOU4LX2NS+B+jC/9vmRSGVM0FDRfLywbqcV9vyKsyVtS59Id/gjtGyyRW+88Rb3sFMA1ySiZk9qxjSE6f6bs12MfTZufaR6dDZsSM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780068171; c=relaxed/simple; bh=BL/mzXB21DP8ZkYvI+HFdcB5ZrKvvBoZTnmkiFRuhrY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=g9EjvuYLsx64355rYhJnOc9hk1Adq1kB5avwciBzMaJBYNAhYyUlQx4fhBd6FpTz8pmjRfnUhWaRArWxgUG31iguHEKxBd7GrCUYXRgXMAGmGfeFDNNHJ55Wpdwgs7JG/qTnMlyEZ1tJ6B2BFWP37ONn4fg72Qt8v67w8pgEBQE= 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=fxl2prEZ; 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="fxl2prEZ" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id 6006FC6245E; Fri, 29 May 2026 15:22:46 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id A72C5601FA; Fri, 29 May 2026 15:22:45 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id BC09F10888CC6; Fri, 29 May 2026 17:22:43 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1780068164; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=4603I4ihlZsGX1G8Lhkbss5U3n9JjlCt8i/a76TLe2k=; b=fxl2prEZX6WbQQFwYPr1N1BY20iVXB8q3TmqlsQucOWQjJSUJAA6z2m35hrq34ZCzkhSt4 vhBP6H0nzj3A99/7Sn3Misl6vwTP+QfQjFtkVXvVYygz7vh9pG7HKyb8Pq4YlmW4DLqoGc 91v8niHLJQnnfvA6/SU59iLdZkE58fkMsHplHkavd4gEicLeuU2yciJRQqe9roL5H7WLS8 OqATvCg2mzyfzEi08tbMi4v+bHbw9rB99FNv27cP3Zqvvwnddoh580sW33MvEPzp7jYNsJ qy4GRlFtoQ5/fQwBnHhFay3xkITHG0ne3TJgTLiqJ8qNwbI7IXB/JtuKjOEqTw== From: Miquel Raynal Date: Fri, 29 May 2026 17:22:23 +0200 Subject: [PATCH 03/30] mtd: spi-nor: winbond: Stop filling the .name entry 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: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-3-87e5d3122244@bootlin.com> References: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-0-87e5d3122244@bootlin.com> In-Reply-To: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-0-87e5d3122244@bootlin.com> To: Pratyush Yadav , Michael Walle , Takahiro Kuwano , Richard Weinberger , Vignesh Raghavendra Cc: Thomas Petazzoni , Steam Lin , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Miquel Raynal X-Mailer: b4 0.14.3 X-Last-TLS-Session-Version: TLSv1.3 This is a legacy field, it is often incorrectly filled and will soon become very incorrect due to IDs being reused. Replace the names with a comment above the entry with the newly instated naming scheme to indicate what chips are covered by each entry. Signed-off-by: Miquel Raynal --- I've been focusing on several chip families, but not all of them. I do not have enough information about the oldest chips at the moment to cleanup *all* IDs, but I am nevertheless trying to make a major cleaning step here. --- drivers/mtd/spi-nor/winbond.c | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/drivers/mtd/spi-nor/winbond.c b/drivers/mtd/spi-nor/winbond.c index 03e59ff3228f..b4088fc5fde9 100644 --- a/drivers/mtd/spi-nor/winbond.c +++ b/drivers/mtd/spi-nor/winbond.c @@ -218,36 +218,36 @@ static const struct flash_info winbond_nor_parts[] = =3D { .size =3D SZ_1M, .no_sfdp_flags =3D SECT_4K, }, { + /* W25Q32JV-Q/N */ .id =3D SNOR_ID(0xef, 0x40, 0x16), - .name =3D "w25q32", .size =3D SZ_4M, .no_sfdp_flags =3D SECT_4K, }, { + /* W25Q64JV-Q/N */ .id =3D SNOR_ID(0xef, 0x40, 0x17), - .name =3D "w25q64", .size =3D SZ_8M, .no_sfdp_flags =3D SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ, }, { + /* W25Q128JV-Q/N */ .id =3D SNOR_ID(0xef, 0x40, 0x18), /* Flavors w/ and w/o SFDP. */ - .name =3D "w25q128", .size =3D SZ_16M, .flags =3D SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB, .no_sfdp_flags =3D SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ, .fixups =3D &w25q128_fixups, }, { + /* W25Q256JV-Q/N */ .id =3D SNOR_ID(0xef, 0x40, 0x19), - .name =3D "w25q256", .size =3D SZ_32M, .no_sfdp_flags =3D SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ, .fixups =3D &w25q256_fixups, }, { + /* W25Q512JV-Q/N */ .id =3D SNOR_ID(0xef, 0x40, 0x20), - .name =3D "w25q512jvq", .size =3D SZ_64M, .no_sfdp_flags =3D SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ, }, { - /* W25Q01JV */ + /* W25Q01JV-Q/N */ .id =3D SNOR_ID(0xef, 0x40, 0x21), .fixups =3D &winbond_nor_multi_die_fixups, }, { @@ -285,54 +285,54 @@ static const struct flash_info winbond_nor_parts[] = =3D { .flags =3D SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB, .no_sfdp_flags =3D SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ, }, { + /* W25Q128FW-G/Q, W25Q128JW-Q/N */ .id =3D SNOR_ID(0xef, 0x60, 0x18), - .name =3D "w25q128fw", .size =3D SZ_16M, .flags =3D SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB, .no_sfdp_flags =3D SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ, }, { + /* W25Q256JW-Q/N */ .id =3D SNOR_ID(0xef, 0x60, 0x19), - .name =3D "w25q256jw", .size =3D SZ_32M, .flags =3D SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB | SPI_NOR_TB_SR_BIT6 | SPI_= NOR_4BIT_BP, .no_sfdp_flags =3D SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ, }, { + /* W25Q512NW-Q/N */ .id =3D SNOR_ID(0xef, 0x60, 0x20), - .name =3D "w25q512nwq", .otp =3D SNOR_OTP(256, 3, 0x1000, 0x1000), }, { - /* W25Q01NW-Q */ + /* W25Q01NW-Q/N */ .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 | SPI_NOR_HAS_CMP, .fixups =3D &winbond_rdcr_fixup, }, { + /* W25Q16JV-M */ .id =3D SNOR_ID(0xef, 0x70, 0x15), - .name =3D "w25q16jv-im/jm", .size =3D SZ_2M, .flags =3D SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB, .no_sfdp_flags =3D SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ, }, { + /* W25Q32JV-M */ .id =3D SNOR_ID(0xef, 0x70, 0x16), - .name =3D "w25q32jv", .size =3D SZ_4M, .flags =3D SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB, .no_sfdp_flags =3D SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ, }, { + /* W25Q64JV-M */ .id =3D SNOR_ID(0xef, 0x70, 0x17), - .name =3D "w25q64jvm", .size =3D SZ_8M, .flags =3D SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB, .no_sfdp_flags =3D SECT_4K, }, { + /* W25Q128JV-M */ .id =3D SNOR_ID(0xef, 0x70, 0x18), - .name =3D "w25q128jv", .size =3D SZ_16M, .flags =3D SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB, .no_sfdp_flags =3D SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ, }, { + /* W25Q256JV-M */ .id =3D SNOR_ID(0xef, 0x70, 0x19), - .name =3D "w25q256jvm", }, { /* W25Q02JV-M */ .id =3D SNOR_ID(0xef, 0x70, 0x22), @@ -343,33 +343,33 @@ static const struct flash_info winbond_nor_parts[] = =3D { .size =3D SZ_64M, .no_sfdp_flags =3D SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ, }, { + /* W25Q32JW-M */ .id =3D SNOR_ID(0xef, 0x80, 0x16), - .name =3D "w25q32jwm", .size =3D SZ_4M, .flags =3D SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB, .no_sfdp_flags =3D SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ, .otp =3D SNOR_OTP(256, 3, 0x1000, 0x1000), }, { + /* W25Q64JW-M */ .id =3D SNOR_ID(0xef, 0x80, 0x17), - .name =3D "w25q64jwm", .size =3D SZ_8M, .flags =3D SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB, .no_sfdp_flags =3D SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ, }, { + /* W25Q128JW-M */ .id =3D SNOR_ID(0xef, 0x80, 0x18), - .name =3D "w25q128jwm", .size =3D SZ_16M, .flags =3D SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB, .no_sfdp_flags =3D SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ, }, { + /* W25Q256JW-M */ .id =3D SNOR_ID(0xef, 0x80, 0x19), - .name =3D "w25q256jwm", .size =3D SZ_32M, .flags =3D SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB | SPI_NOR_TB_SR_BIT6 | SPI_= NOR_4BIT_BP, .no_sfdp_flags =3D SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ, }, { + /* W25Q512NW-M */ .id =3D SNOR_ID(0xef, 0x80, 0x20), - .name =3D "w25q512nwm", .otp =3D SNOR_OTP(256, 3, 0x1000, 0x1000), }, { /* W25Q01NW-M */ --=20 2.53.0 From nobody Mon Jun 8 11:05:06 2026 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 D82E03EFFA7 for ; Fri, 29 May 2026 15:22:48 +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=1780068170; cv=none; b=Em5KjO2dVbe9Lb6bxKDi/jcTrwyxQWAYQTLTxMZH+z//WmzYCf6SF2nQrNBprYJS0AJSAae8KQNM8j8ttIS+gPbM/8vHY/NSgTz093z9HptztuAFB6tTCEGnYCF4NOExirb+f5imox1Q0JMJezsFeAFOae+i17TuYDomn7aemaY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780068170; c=relaxed/simple; bh=TwvwHiGzns3UdI2Z3ybTgTVZPxs2AdnO+pAx4ZlvjDw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=k43PADYh/0Vj4AovqdxWtokxWPsfxoKyCOFEohCcK1r8NfBR9OO3leWjRAGWWjFyLTItPUpdvTqn9nxD/UBH6cdNl3X1UC8dSLt5nVYPCmIbLKn7/fXlxTBfclftpwP+Zt/kPYEmXbjB4LINKP19lDVu02ARjKkekkADlkU/7q8= 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=lOCqB7wE; 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="lOCqB7wE" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id 72A651A373E; Fri, 29 May 2026 15:22:47 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 427C0601FA; Fri, 29 May 2026 15:22:47 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 5200210888CC5; Fri, 29 May 2026 17:22:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1780068166; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=zfcbHM1I+Z/L5dUZI06zqivIBztBH0ONPJKZ+7bVeME=; b=lOCqB7wE1j60fsyUmJVuC8kV5mJ0Ipw6kDUBIO5S6DRmrDft4wberfBXijZxP4C5LHPFNl Pj2joHdiTmzHCFCL2+2gZreGUlZWptkGh+dRAhX7FiJYaB8o4cssTvZ3wX/aVyr583tO6L MIggtdAFjgZxq/xDZiRlZ4rOHc1heWOmE32UVveKk7ke3Lo3IbAPRVOoYuEsa+1QJg51jn X5Y7iw1I6BQEIbApaw21OSe+vSFMA4ZAw501RXURNtjnu5pslBFXjX2iEih7mmRXG4yaPO nMrQL0LSVvT9MeT8l3k7fL9QhpCaWsMxa9XgVs2z9rI/XztT7LXuaBCdCHW1Gw== From: Miquel Raynal Date: Fri, 29 May 2026 17:22:24 +0200 Subject: [PATCH 04/30] mtd: spi-nor: winbond: Make the RDCR fixup Winbond wide 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: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-4-87e5d3122244@bootlin.com> References: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-0-87e5d3122244@bootlin.com> In-Reply-To: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-0-87e5d3122244@bootlin.com> To: Pratyush Yadav , Michael Walle , Takahiro Kuwano , Richard Weinberger , Vignesh Raghavendra Cc: Thomas Petazzoni , Steam Lin , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Miquel Raynal X-Mailer: b4 0.14.3 X-Last-TLS-Session-Version: TLSv1.3 The top level paragraph of the QER field in the JESD216B mentions: "In this standard, [...] Status register 2 refers to the byte read using instruction 35h. Status register 2 is the second byte transferred in a Write Status (01h) command. [...]" Value 100b, named in Linux BFPT_DWORD15_QER_SR2_BIT1_NO_RD, does not mention anything about reads and only brings details about writes. This has been interpreted in the spi-nor core by the absence of read capability, but there is no explicit reason for that, except that there were probably some very old chips which didn't support command 35h. All quad capable Winbond chips carry a CMP SWP bit in SR2. SR2 is readable with command 35h. In practice, all Winbond families but the W25X family have support for this feature, so re-enable it Winbond-wide in a late vendor fixup, except for the {EF, 30, xx} family. Signed-off-by: Miquel Raynal --- drivers/mtd/spi-nor/winbond.c | 37 ++++++++++++++----------------------- 1 file changed, 14 insertions(+), 23 deletions(-) diff --git a/drivers/mtd/spi-nor/winbond.c b/drivers/mtd/spi-nor/winbond.c index b4088fc5fde9..4300f0419f13 100644 --- a/drivers/mtd/spi-nor/winbond.c +++ b/drivers/mtd/spi-nor/winbond.c @@ -73,26 +73,6 @@ static const struct spi_nor_fixups w25q256_fixups =3D { .post_bfpt =3D w25q256_post_bfpt_fixups, }; =20 -static int -winbond_rdcr_post_bfpt_fixup(struct spi_nor *nor, - const struct sfdp_parameter_header *bfpt_header, - const struct sfdp_bfpt *bfpt) -{ - /* - * W25H02NW, unlike its W25H512NW nor W25H01NW cousins, improperly sets - * the QE BFPT configuration bits, indicating a non readable CR. This is - * both incorrect and impractical, as the chip features a CMP bit for its - * locking scheme that lays in the Control Register, and needs to be read. - */ - nor->flags &=3D ~SNOR_F_NO_READ_CR; - - return 0; -} - -static const struct spi_nor_fixups winbond_rdcr_fixup =3D { - .post_bfpt =3D winbond_rdcr_post_bfpt_fixup, -}; - /** * winbond_nor_select_die() - Set active die. * @nor: pointer to 'struct spi_nor'. @@ -305,7 +285,6 @@ static const struct flash_info winbond_nor_parts[] =3D { .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 | SPI_NOR_HAS_CMP, - .fixups =3D &winbond_rdcr_fixup, }, { /* W25Q16JV-M */ .id =3D SNOR_ID(0xef, 0x70, 0x15), @@ -381,7 +360,6 @@ static const struct flash_info winbond_nor_parts[] =3D { .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 | SPI_NOR_HAS_CMP, - .fixups =3D &winbond_rdcr_fixup, }, { /* W25H512NW-M */ .id =3D SNOR_ID(0xef, 0xa0, 0x20), @@ -397,7 +375,6 @@ static const struct flash_info winbond_nor_parts[] =3D { .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 | SPI_NOR_HAS_CMP, - .fixups =3D &winbond_rdcr_fixup, }, }; =20 @@ -490,6 +467,20 @@ static int winbond_nor_late_init(struct spi_nor *nor) */ params->set_4byte_addr_mode =3D winbond_nor_set_4byte_addr_mode; =20 + /* + * All W25Q/W25H chips do set the BFPT_DWORD15_QER_SR2_BIT1_NO_RD bit in + * their SFDP tables. The historical spi-nor assumption in this case has + * been to declare CR reads as unsupported, whereas the Jedec + * specification doesn't clearly state that. In practice, all these + * chips do support reading back the CR, which is needed for SWP support, + * so make sure that capability remains enabled (needed for SWP). + * In practice, only exclude the old W25X family (JEDEC ID: EF 30 xx) + * which actually does not support this feature. + */ + if (nor->info->id->bytes[0] =3D=3D 0xef && + nor->info->id->bytes[1] > 0x30) + nor->flags &=3D ~SNOR_F_NO_READ_CR; + return 0; } =20 --=20 2.53.0 From nobody Mon Jun 8 11:05:06 2026 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 510D53F0745 for ; Fri, 29 May 2026 15:22:50 +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=1780068171; cv=none; b=aPbOP4HNc0bcOp3PuOkOfyx9d9jwfQe+8OlQwbHqdhYu3wOPVT1KxctKfPdyp/XO9gxhOz1KSo5PyoR7wCwO0zQYth0INOXm3+1rpfQnC/KzvfM1RcGf098MA0UBK3qN0vNQhGPgZwTSzzKIqp4It9i/4QY80GmNbA5ift8xD6s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780068171; c=relaxed/simple; bh=e/zj9h7dKbwGGEbNtE4d54NLdU+xfFSopV8W5+pc3jc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=DD8L7AvkAX44Ewr55q4fZMvWY39CAzD2jdHgz0gblXHNB73Ar/zrundR/jcTiKDFgtJ+pNKwBzthN8INIXjAkFvmjeafgrH/pQ6Rs/XKAdxL2TNOp0sJy1khPV8VaRs1Gf5E+Tl3euDyIgMMA8zD8cndWgQRF8xnBKFB88xgL+A= 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=p4CkG2hd; 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="p4CkG2hd" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id CC05D4E42D92; Fri, 29 May 2026 15:22:48 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id A250A601FA; Fri, 29 May 2026 15:22:48 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id DBFF210888CD5; Fri, 29 May 2026 17:22:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1780068167; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=5zhdANzp5DoAG55BOQ7zmeZdLYq6QkMMT4qZ1lxHZHY=; b=p4CkG2hdupfiuqfStVHk2Mybd8xHUcwVVN5pCqQaVKSo5nlgDOQEaDJq4KobGNYz1SK5al 6BaCyEly3fNDi8BGO8vru1TiHt11AY4vJ/CWV2x0Igbk3NvFMHNIWFe6u0wGL1vcstwvwE n8yTnyBe5xhr3Km39OuGrytyFE7fAYiSQEdAyHkzUinn0YEyLyIfw96jmwR2UkloRJ+X/Y IRjR1jYGePNNYN2L9hJZkx0w58HWZR7tGq9LzivmIKZi16+N07cslm1QwdYJ9mNlFPuoPx EOHDSe25s3uQ9iP2FjAsaPraFSRH92vDsOs+BdG5bfRCJloN8hV+1A/On0eDdQ== From: Miquel Raynal Date: Fri, 29 May 2026 17:22:25 +0200 Subject: [PATCH 05/30] mtd: spi-nor: winbond: W25Q32JV-Q/N: Drop redundant data 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: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-5-87e5d3122244@bootlin.com> References: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-0-87e5d3122244@bootlin.com> In-Reply-To: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-0-87e5d3122244@bootlin.com> To: Pratyush Yadav , Michael Walle , Takahiro Kuwano , Richard Weinberger , Vignesh Raghavendra Cc: Thomas Petazzoni , Steam Lin , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Miquel Raynal X-Mailer: b4 0.14.3 X-Last-TLS-Session-Version: TLSv1.3 This chip has correct SFDP support, all fields are correctly filled so we can drop them from the table: $ cat /sys/kernel/debug/spi-nor/spi0.0/params name (null) id ef 40 16 00 00 00 size 4.00 MiB write size 1 page size 256 address nbytes 3 flags HAS_SR_TB | HAS_LOCK | HAS_16BIT_SR | NO_READ_CR | SOFT_RESET | NO_W= P | HAS_SR2_CMP_BIT6 [...] erase commands 20 (4.00 KiB) [1] 52 (32.0 KiB) [2] d8 (64.0 KiB) [3] c7 (4.00 MiB) Signed-off-by: Miquel Raynal --- $ cat /sys/bus/spi/devices/spi0.0/spi-nor/jedec_id ef4016 $ cat /sys/bus/spi/devices/spi0.0/spi-nor/manufacturer winbond $ xxd -p /sys/bus/spi/devices/spi0.0/spi-nor/sfdp 53464450050100ff00050110800000ffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffe520f9ffffffff0144eb086b083b42bbfeffffffffff 0000ffff40eb0c200f5210d800003602a60082ea14c2e96376337a757a75 f7a2d55c19f74dffe930f880 $ sha256sum /sys/bus/spi/devices/spi0.0/spi-nor/sfdp e002d5482ce24cecf678c171745e3e90b7fb6cb588739ca63151ed333b09b35a /sys/bus/= spi/devices/spi0.0/spi-nor/sfdp $ cat /sys/kernel/debug/spi-nor/spi0.0/params name (null) id ef 40 16 00 00 00 size 4.00 MiB write size 1 page size 256 address nbytes 3 flags HAS_SR_TB | HAS_LOCK | HAS_16BIT_SR | NO_READ_CR | SOFT_RESET | NO_W= P | HAS_SR2_CMP_BIT6 opcodes read 0xeb dummy cycles 6 erase 0xd8 program 0x02 8D extension none protocols read 1S-4S-4S write 1S-1S-1S register 1S-1S-1S erase commands 20 (4.00 KiB) [1] 52 (32.0 KiB) [2] d8 (64.0 KiB) [3] c7 (4.00 MiB) sector map region (in hex) | erase mask | overlaid ------------------+------------+--------- 00000000-003fffff | [ 3] | no locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-003fffff | unlocked | 64 $ cat /sys/kernel/debug/spi-nor/spi0.0/capabilities Supported read modes by the flash 1S-1S-1S opcode 0x03 mode cycles 0 dummy cycles 0 1S-1S-2S opcode 0x3b mode cycles 0 dummy cycles 8 1S-2S-2S opcode 0xbb mode cycles 2 dummy cycles 2 1S-1S-4S opcode 0x6b mode cycles 0 dummy cycles 8 1S-4S-4S opcode 0xeb mode cycles 2 dummy cycles 4 4S-4S-4S opcode 0xeb mode cycles 2 dummy cycles 0 Supported page program modes by the flash 1S-1S-1S opcode 0x02 --- drivers/mtd/spi-nor/winbond.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/mtd/spi-nor/winbond.c b/drivers/mtd/spi-nor/winbond.c index 4300f0419f13..524c4ae565c2 100644 --- a/drivers/mtd/spi-nor/winbond.c +++ b/drivers/mtd/spi-nor/winbond.c @@ -200,8 +200,6 @@ static const struct flash_info winbond_nor_parts[] =3D { }, { /* W25Q32JV-Q/N */ .id =3D SNOR_ID(0xef, 0x40, 0x16), - .size =3D SZ_4M, - .no_sfdp_flags =3D SECT_4K, }, { /* W25Q64JV-Q/N */ .id =3D SNOR_ID(0xef, 0x40, 0x17), --=20 2.53.0 From nobody Mon Jun 8 11:05:06 2026 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 D34083F1656 for ; Fri, 29 May 2026 15:22:51 +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=1780068173; cv=none; b=azsJXTm/N5VEXw6O7DPHxEtjjZofXcXTaiY2j2TgpjK8SQck1RM21Kb/QZmjjsYH7Dmi1dMmjVcuByKfVUD7a5AdIu9aIt57sdxCALX3g/EInwNnBuJybhHcU13WY+/VuhwjsQuN1jMSH2TZyyYosC1h27Dw4b5F2/WnLcFHxqM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780068173; c=relaxed/simple; bh=se6zAnOntFhHLqPQZF5OowrV6S/kr65XrA6sF0FF270=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=m6wh2JVARjFd916iQ2HsK9qnCPxWrHoefXPvrd1BY8Z29r0YHIw1quhgxpDndmQhCstl0IiFezhVShDsPHkKgkfgmSu0xQFtAYeHSgq+d67bYyXE+Zp/XITwNTrkfDDWKTAt6fgrK4anzju0n+/DyN91Yx1FpF93kdDWTDwGwww= 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=NDe3ULo5; 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="NDe3ULo5" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id EB685C62463; Fri, 29 May 2026 15:22:50 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 3DBA9601FA; Fri, 29 May 2026 15:22:50 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 5AEFB10888CC6; Fri, 29 May 2026 17:22:48 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1780068169; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=vrgkCO3iqvp4wL4zD0GWyxCiOVOrtVsdCb/sm7DYDoo=; b=NDe3ULo5662aGpeCgTe39HSHM9TF2lxZFFx/pF/inPYPufTt/U92/CD8rzJFS4rh5OJOuM /eU7Oe6DWXw+jXwN2w/mwkOYUYRbrBUN0NgM8WyEF1N4Fu0eBwNqzprqSuAA3GY3Etrf// ygcNCWmaTmOStv8zZiAZERJA6IkQjQ4cvWnHJCDuRk7pw7P41w63SX0UL+MRt4T1JBlmBK HDjk0bT3RvwDnvnKa7iaL2t+oBg+6mBSPZmeCGx5PjDdW2+r9DW8/SGEeHFNEYdjaCJAtZ P8t4lfDn2hCu+ZycDGTN7c/Od7obM6OwQWScyizMwINq16s1pNcVbKnzGbmACA== From: Miquel Raynal Date: Fri, 29 May 2026 17:22:26 +0200 Subject: [PATCH 06/30] mtd: spi-nor: winbond: W25Q64JV-Q/N: Drop redundant data 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: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-6-87e5d3122244@bootlin.com> References: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-0-87e5d3122244@bootlin.com> In-Reply-To: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-0-87e5d3122244@bootlin.com> To: Pratyush Yadav , Michael Walle , Takahiro Kuwano , Richard Weinberger , Vignesh Raghavendra Cc: Thomas Petazzoni , Steam Lin , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Miquel Raynal X-Mailer: b4 0.14.3 X-Last-TLS-Session-Version: TLSv1.3 This chip has correct SFDP support, all fields are correctly filled so we can drop them from the table: $ cat /sys/kernel/debug/spi-nor/spi0.0/params name (null) id ef 40 17 00 00 00 size 8.00 MiB write size 1 page size 256 address nbytes 3 flags HAS_16BIT_SR | SOFT_RESET | NO_WP opcodes read 0xeb dummy cycles 6 erase 0xd8 program 0x02 8D extension none protocols read 1S-4S-4S write 1S-1S-1S register 1S-1S-1S erase commands 20 (4.00 KiB) [1] 52 (32.0 KiB) [2] d8 (64.0 KiB) [3] c7 (8.00 MiB) sector map region (in hex) | erase mask | overlaid ------------------+------------+--------- 00000000-007fffff | [ 3] | no $ cat /sys/kernel/debug/spi-nor/spi0.0/capabilities Supported read modes by the flash 1S-1S-1S opcode 0x03 mode cycles 0 dummy cycles 0 1S-1S-2S opcode 0x3b mode cycles 0 dummy cycles 8 1S-2S-2S opcode 0xbb mode cycles 2 dummy cycles 2 1S-1S-4S opcode 0x6b mode cycles 0 dummy cycles 8 1S-4S-4S opcode 0xeb mode cycles 2 dummy cycles 4 4S-4S-4S opcode 0xeb mode cycles 2 dummy cycles 0 Supported page program modes by the flash 1S-1S-1S opcode 0x02 Signed-off-by: Miquel Raynal --- $ cat /sys/bus/spi/devices/spi0.0/spi-nor/jedec_id ef4017 $ cat /sys/bus/spi/devices/spi0.0/spi-nor/manufacturer winbond $ xxd -p /sys/bus/spi/devices/spi0.0/spi-nor/sfdp 53464450050100ff00050110800000ffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffe520f9ffffffff0344eb086b083b42bbfeffffffffff 0000ffff40eb0c200f5210d800003602a60082ea14c4e96376337a757a75 f7a2d55c19f74dffe930f880 $ sha256sum /sys/bus/spi/devices/spi0.0/spi-nor/sfdp ad4c59a94e6205cf237f8734d01ca45d67d34ed35404b364595ff420b6259d32 /sys/bus/= spi/devices/spi0.0/spi-nor/sfdp $ cat /sys/kernel/debug/spi-nor/spi0.0/params name (null) id ef 40 17 00 00 00 size 8.00 MiB write size 1 page size 256 address nbytes 3 flags HAS_16BIT_SR | SOFT_RESET | NO_WP opcodes read 0xeb dummy cycles 6 erase 0xd8 program 0x02 8D extension none protocols read 1S-4S-4S write 1S-1S-1S register 1S-1S-1S erase commands 20 (4.00 KiB) [1] 52 (32.0 KiB) [2] d8 (64.0 KiB) [3] c7 (8.00 MiB) sector map region (in hex) | erase mask | overlaid ------------------+------------+--------- 00000000-007fffff | [ 3] | no $ cat /sys/kernel/debug/spi-nor/spi0.0/capabilities Supported read modes by the flash 1S-1S-1S opcode 0x03 mode cycles 0 dummy cycles 0 1S-1S-2S opcode 0x3b mode cycles 0 dummy cycles 8 1S-2S-2S opcode 0xbb mode cycles 2 dummy cycles 2 1S-1S-4S opcode 0x6b mode cycles 0 dummy cycles 8 1S-4S-4S opcode 0xeb mode cycles 2 dummy cycles 4 4S-4S-4S opcode 0xeb mode cycles 2 dummy cycles 0 Supported page program modes by the flash 1S-1S-1S opcode 0x02 --- drivers/mtd/spi-nor/winbond.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/mtd/spi-nor/winbond.c b/drivers/mtd/spi-nor/winbond.c index 524c4ae565c2..738303821857 100644 --- a/drivers/mtd/spi-nor/winbond.c +++ b/drivers/mtd/spi-nor/winbond.c @@ -203,8 +203,6 @@ static const struct flash_info winbond_nor_parts[] =3D { }, { /* W25Q64JV-Q/N */ .id =3D SNOR_ID(0xef, 0x40, 0x17), - .size =3D SZ_8M, - .no_sfdp_flags =3D SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ, }, { /* W25Q128JV-Q/N */ .id =3D SNOR_ID(0xef, 0x40, 0x18), --=20 2.53.0 From nobody Mon Jun 8 11:05:06 2026 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 44DC93F2118 for ; Fri, 29 May 2026 15:22:53 +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=1780068174; cv=none; b=rUymBfZIQNHVkVKuXDeFg4EAHpHi3HC0N/ph/u+FxJA2j8OjPmBcb00b6Txx4xP2aJnwYIrp8i/oWE8SbIaiIzmsfj7fXJ+gShLwoDTlD2jWRcEafXVSqO+rGlP4XAu4Ki+6OpsacF/M8eUZVZ858arOUk7sKWQqP3lHt1rXXNE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780068174; c=relaxed/simple; bh=zCqLUdWn+BpECiScQ8XI3PAELHvWigY/Gco8vSlu2D4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=IgxUyT/Etd4cPATyzDSxrlwW8JVo+akZ56giHU1nZGfPhdK5gW+ZM3mYJniWFEsDae3rBttGMMwPttccuwElDs/UInCA0E7YJhgmmZKKWajWjHAmDLokNP/cEmui73NinPzbRKGFUV4b1cbO+dC06hBnUjmVZfUQNZP4ppEQbQI= 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=bg3C4SkV; 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="bg3C4SkV" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id EEC424E42D8D; Fri, 29 May 2026 15:22:51 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id C47B5601FA; Fri, 29 May 2026 15:22:51 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id EEF4910888CCE; Fri, 29 May 2026 17:22:49 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1780068171; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=5gqAbwXc04rZkUwIPY6UpUHkBBlpxjR6ZMkHnXjSr3Q=; b=bg3C4SkVTgyqPHT0VFKQ9K9CJxhzLXkZ1g33dyGv84Tp1hvCit1MDsZoMwRdO6xMPkricQ r1ba6DQs3LkyGcFmTxGgUi1PsodR05Nkc59Ek/5Psm4/rDFg0h8iSkiLmT5xoAGNyFDk5+ /RBgmEDMBNY3YZvTapWdJ1koyjJUrRN2C1IZpk9yWbmfrxFN5Ie9Iq6ZtFglOiI1qCh1X1 327t8zqviVzP4qdIquPsn+9Xn6M2cFl49avP7xe/cpElnYk6UWp01T6FnCjSMQ7S+Bh+o7 3A2Bv4MWeB5WA4rrAzDX5xovXJED02vkrUgqWdgHNpXC5Dmjl2LLIi4U2eozsA== From: Miquel Raynal Date: Fri, 29 May 2026 17:22:27 +0200 Subject: [PATCH 07/30] mtd: spi-nor: winbond: W25Q512JV-Q/N: Drop redundant data 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: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-7-87e5d3122244@bootlin.com> References: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-0-87e5d3122244@bootlin.com> In-Reply-To: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-0-87e5d3122244@bootlin.com> To: Pratyush Yadav , Michael Walle , Takahiro Kuwano , Richard Weinberger , Vignesh Raghavendra Cc: Thomas Petazzoni , Steam Lin , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Miquel Raynal X-Mailer: b4 0.14.3 X-Last-TLS-Session-Version: TLSv1.3 This chip has correct SFDP support, all fields are correctly filled so we can drop them from the table: name (null) id ef 40 20 00 00 00 size 64.0 MiB write size 1 page size 256 address nbytes 4 flags 4B_OPCODES | HAS_4BAIT | HAS_16BIT_SR | NO_READ_CR | SOFT_RESET | NO= _WP [...] 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) [...] $ 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 Signed-off-by: Miquel Raynal --- ef4020 winbond 53464450060101ff00060110800000ff84000102d00000ff03000102f000 00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffe520fbffffffff1f44eb086b083b42bbfeffffffffff 0000ffff40eb0c200f5210d800003602a60082ea14e2e96376337a757a75 f7a2d55c19f74dffe970f9a5ffffffffffffffffffffffffffffffffff0a f0ff21ffdcff f41674a6c3742a42d31d3007d4d4b725c166ddb4e4566d1c347d29ed29855ef0 /sys/bus/= spi/devices/spi0.0/spi-nor/sfdp name (null) id ef 40 20 00 00 00 size 64.0 MiB write size 1 page size 256 address nbytes 4 flags 4B_OPCODES | HAS_4BAIT | HAS_16BIT_SR | NO_READ_CR | 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 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 --- drivers/mtd/spi-nor/winbond.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/mtd/spi-nor/winbond.c b/drivers/mtd/spi-nor/winbond.c index 738303821857..8fc74cba0ee0 100644 --- a/drivers/mtd/spi-nor/winbond.c +++ b/drivers/mtd/spi-nor/winbond.c @@ -220,8 +220,6 @@ static const struct flash_info winbond_nor_parts[] =3D { }, { /* W25Q512JV-Q/N */ .id =3D SNOR_ID(0xef, 0x40, 0x20), - .size =3D SZ_64M, - .no_sfdp_flags =3D SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ, }, { /* W25Q01JV-Q/N */ .id =3D SNOR_ID(0xef, 0x40, 0x21), --=20 2.53.0 From nobody Mon Jun 8 11:05:06 2026 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 AFCD23F20E9 for ; Fri, 29 May 2026 15:22:54 +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=1780068176; cv=none; b=qnpqvJMzwzjuMf6RtNg85bsXOghu9DoK52cVDKvQ87UhiPPwJWFZK646ie8FnmuYsgd8YxE665bG+8kdq1uRrugK9vmTn2Cp2zTk+cPnkPr5Q8TaQJ67smNnimG8iSfgJx2NXHzyp/U+zTW7O29nlELY35GNH7HmEsBfqAUJIZ8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780068176; c=relaxed/simple; bh=PCOnRQd42JCibz4k4iE3aqBxFgt9w/cRCb78Zaif8IY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=rezzm71vpXreRqzSl3KHR60GoxzY5M6bDkW0dyKD/ov1OJcRMlLMapH6jXRC0KEhWi7BVkMyOjrvR7o+5AZ5X6VgzZwFflEJ9wW16fKTlWKHGzK9739RiPhvsCgBPCnlR7x+isaa1EMesuSS7xKRldoKzCwg6DF7TFn5VbvVKIM= 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=mUjTOv8G; 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="mUjTOv8G" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id 72E844E42D90; Fri, 29 May 2026 15:22:53 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 41A22601FA; Fri, 29 May 2026 15:22:53 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 6BBCB10888CD8; Fri, 29 May 2026 17:22:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1780068172; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=jkLfRViKrH3MbRnV8xlPVgD6yI6I+WJsDs/Cywyi/OE=; b=mUjTOv8GvGOYGCzvEJmTXlpyRnARr856hmYoBntm/wSi0f7gglNJlvG+sOl0DdlGg/VdQ0 MLYsoK7UIjeUJXkmEzw4rhknsxpjxnxMgGLu7yPIidgOCnwO4vMD6GM7CqrYYg9MawNmV4 sRRb0vyirtiZ+XkZFZxyvpJr3k+q960J49Kg9Tln1Tm4r/M4mCnkaqLMNQRNZhMlYHV7py rb/iA76sdRVldDDf2ov2a9VW64EhVT4R6GfRE59NNsaP2HMDdUaNbcjpUffok32feYcQep fa9v/qehAca7T0rWyZ1CPUDhQoc2aQQtnxdJRX43iYsOPzNxPmcAXE2TZ1IpLQ== From: Miquel Raynal Date: Fri, 29 May 2026 17:22:28 +0200 Subject: [PATCH 08/30] mtd: spi-nor: winbond: W25Q32JV-Q/N: Add quad page program capability 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: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-8-87e5d3122244@bootlin.com> References: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-0-87e5d3122244@bootlin.com> In-Reply-To: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-0-87e5d3122244@bootlin.com> To: Pratyush Yadav , Michael Walle , Takahiro Kuwano , Richard Weinberger , Vignesh Raghavendra Cc: Thomas Petazzoni , Steam Lin , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Miquel Raynal X-Mailer: b4 0.14.3 X-Last-TLS-Session-Version: TLSv1.3 The benefit is not massive @25MHz, yet it is a supported feature of the chip which is already handled by a flag, so let's enable it and earn that little 1% write throughput. Before: $ flash_speed /dev/mtd0 -d -c10 eraseblock write speed is 560 KiB/s page write speed is 540 KiB/s 2 page write speed is 550 KiB/s After: eraseblock write speed is 578 KiB/s page write speed is 557 KiB/s 2 page write speed is 567 KiB/s Signed-off-by: Miquel Raynal --- $ cat /sys/kernel/debug/spi-nor/spi0.0/capabilities Supported read modes by the flash 1S-1S-1S opcode 0x03 mode cycles 0 dummy cycles 0 1S-1S-2S opcode 0x3b mode cycles 0 dummy cycles 8 1S-2S-2S opcode 0xbb mode cycles 2 dummy cycles 2 1S-1S-4S opcode 0x6b mode cycles 0 dummy cycles 8 1S-4S-4S opcode 0xeb mode cycles 2 dummy cycles 4 4S-4S-4S opcode 0xeb mode cycles 2 dummy cycles 0 Supported page program modes by the flash 1S-1S-1S opcode 0x02 1S-1S-4S opcode 0x32 $ 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* 83e7d587bce3b2031c82939839cc1fbcf62b8939b35882d176f207b0722d0dba spi_read 83e7d587bce3b2031c82939839cc1fbcf62b8939b35882d176f207b0722d0dba 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 83e7d587bce3b2031c82939839cc1fbcf62b8939b35882d176f207b0722d0dba spi_test --- drivers/mtd/spi-nor/winbond.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/mtd/spi-nor/winbond.c b/drivers/mtd/spi-nor/winbond.c index 8fc74cba0ee0..7a8e3cbdd6a4 100644 --- a/drivers/mtd/spi-nor/winbond.c +++ b/drivers/mtd/spi-nor/winbond.c @@ -200,6 +200,7 @@ static const struct flash_info winbond_nor_parts[] =3D { }, { /* W25Q32JV-Q/N */ .id =3D SNOR_ID(0xef, 0x40, 0x16), + .flags =3D SPI_NOR_QUAD_PP, }, { /* W25Q64JV-Q/N */ .id =3D SNOR_ID(0xef, 0x40, 0x17), --=20 2.53.0 From nobody Mon Jun 8 11:05:06 2026 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 0072F3F4DD3 for ; Fri, 29 May 2026 15:22:55 +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=1780068177; cv=none; b=hdTnVio4q3iYFQLjvT//FukKJwgPN8gR/5KwbApQNJtDbFJEJr3LOxfChIuEJO0s3ACISiq9iDJZHu+02cQIqo+X7M+jCIgsTPEryqCsrlrfWqfI6IF6IQxHyiYR9DcbXlq9seGLuJZ+Tw17yGoFOXXUrxvkZ2bzRdp+U+ztoPo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780068177; c=relaxed/simple; bh=GrvDzB4F4zWi8y8BI+WxuqLLaogzxgGf+iVkr0qTN7M=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=nEgiO2a/h9ISLrh0R9Qf20QLAKNIQmnkZlaRS9dRNMHM+CQyl8c8A9qNEbnQ1tkljVhqu8tl4TgjKPtkdKC6yeD7uxoLD0oXpqifNvlcu3CbBKp7b/0jHCcZXto7p8l1/r3AJ+7YD7WIc9+Nb7dezVJ9P4R1Nqdl8tYLBWbU7y4= 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=2lBzU5Mo; 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="2lBzU5Mo" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id 6D159C6245F; Fri, 29 May 2026 15:22:55 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id B4099601FA; Fri, 29 May 2026 15:22:54 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 286E410888CDA; Fri, 29 May 2026 17:22:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1780068174; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=ceVgiWO8hrEHRXZ8WIqZCZWHo1Shn1Gp3ZMrr5u3hng=; b=2lBzU5MoCfF33JscxvqouRgcev5cPuFh4+00NcH8QFTydCbnyrdY4TR6o7cwiW1XuAR03M YyfJ+CFLOCQp4UAOi1mnFk8pv2qtXyLrCblCqNwQ1CyLhcS6c0+B14ux3iUPr5HM0RkPou fVNtiWBWTnbQTqPx/xhLo6obWla1QEcgC8fwGQs4VKesGlHSLXE1wmj8b95l21XOdvKtyG 3oXdm+YR/W06c91lDQ4fae3xl1VO3EOK7ooNPtyogkoEg3gPxc8ie5hdAecin6t5c3W2E/ aB8oopkoB9fjg0UOIbbazq3JkDkttxlA/PtA6xKSRKiIO9DbsFcFQJwy/487Kw== From: Miquel Raynal Date: Fri, 29 May 2026 17:22:29 +0200 Subject: [PATCH 09/30] mtd: spi-nor: winbond: W25Q64JV-Q/N: Add quad page program capability 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: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-9-87e5d3122244@bootlin.com> References: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-0-87e5d3122244@bootlin.com> In-Reply-To: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-0-87e5d3122244@bootlin.com> To: Pratyush Yadav , Michael Walle , Takahiro Kuwano , Richard Weinberger , Vignesh Raghavendra Cc: Thomas Petazzoni , Steam Lin , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Miquel Raynal X-Mailer: b4 0.14.3 X-Last-TLS-Session-Version: TLSv1.3 The benefit is not massive @25MHz, yet it is a supported feature of the chip which is already handled by a flag, so let's enable it and earn that little 1% write throughput. Before: $ flash_speed /dev/mtd0 -dc10 eraseblock write speed is 539 KiB/s page write speed is 535 KiB/s 2 page write speed is 536 KiB/s After: $ flash_speed /dev/mtd0 -dc10 eraseblock write speed is 556 KiB/s page write speed is 549 KiB/s 2 page write speed is 552 KiB/s Signed-off-by: Miquel Raynal --- $ cat /sys/kernel/debug/spi-nor/spi0.0/params name (null) id ef 40 17 00 00 00 size 8.00 MiB write size 1 page size 256 address nbytes 3 flags HAS_16BIT_SR | SOFT_RESET | NO_WP opcodes read 0xeb dummy cycles 6 erase 0xd8 program 0x32 8D extension none protocols read 1S-4S-4S write 1S-1S-4S register 1S-1S-1S erase commands 20 (4.00 KiB) [1] 52 (32.0 KiB) [2] d8 (64.0 KiB) [3] c7 (8.00 MiB) sector map region (in hex) | erase mask | overlaid ------------------+------------+--------- 00000000-007fffff | [ 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 mtd_debug read /dev/mtd0 0 2097152 spi_readErased 2097152 bytes from addres= s 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* 36667197a637b731cc2068022138e6963a9499ce9b0ddda1a1585f7f5ebe66ff spi_read 36667197a637b731cc2068022138e6963a9499ce9b0ddda1a1585f7f5ebe66ff 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 36667197a637b731cc2068022138e6963a9499ce9b0ddda1a1585f7f5ebe66ff spi_test --- drivers/mtd/spi-nor/winbond.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/mtd/spi-nor/winbond.c b/drivers/mtd/spi-nor/winbond.c index 7a8e3cbdd6a4..6f496be03e46 100644 --- a/drivers/mtd/spi-nor/winbond.c +++ b/drivers/mtd/spi-nor/winbond.c @@ -204,6 +204,7 @@ static const struct flash_info winbond_nor_parts[] =3D { }, { /* W25Q64JV-Q/N */ .id =3D SNOR_ID(0xef, 0x40, 0x17), + .flags =3D SPI_NOR_QUAD_PP, }, { /* W25Q128JV-Q/N */ .id =3D SNOR_ID(0xef, 0x40, 0x18), --=20 2.53.0 From nobody Mon Jun 8 11:05:06 2026 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 876713F58C2 for ; Fri, 29 May 2026 15:22:57 +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=1780068178; cv=none; b=EpjzLXYkl4ln9YGAw2ftMUykrttw9QUwq0vsSJBU7ywWwhG3uoGNTFg/JAAu9L+tKcB0VQIsaIws2w/IDtv5IcUqlqlkg2MjZpVdI39io7IpdrXoIL0ClmiCfOJe51ZHWW4a0vEi9IcnNufEYg0QU/Ey3+CKbkN04g8YIFzGwdE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780068178; c=relaxed/simple; bh=FZgh8THuf70lr/zhflxtRYfwxicB3GVpZtqHGVNDvlM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=qlp/B14y+Lt7kZezgJV+eTzOMTr9UHeEyhnaSwol8RFRUtdA1SrpIQlxZ01Dav0gdw+FvpsGbnNJ7sRH9HD5R8GlwFSiGrsHlnwyZuwy3QNH3qY6GFl+KcHYKP/+jTP/jQgXL/PnwRAM+rYsnM8Dk/g1/GzbSiZn7PEeXnze4FM= 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=W5DUUkzc; 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="W5DUUkzc" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id 1ED71C6245E; Fri, 29 May 2026 15:22:57 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 64B53601FA; Fri, 29 May 2026 15:22:56 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 6206710888CDC; Fri, 29 May 2026 17:22:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1780068175; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=onS4CQ2vIKDoSLFnC5TilinZG8A+/eW+Qk1/ZJ1lR8c=; b=W5DUUkzcQuDObdNHbkLwY1d4pxTKlxaHGrrmlIgB//3QsSjYpgk2XMrFVumBXWQ/D+qHCx wzw/VDsD85okUb8BFkzjawo+eyr8tOLzduyWPhKL/A2iDE5/LY2H9lxZjt5nTxgmvohM4X a7T5PBIlVeiPsQuDSlP1bn3lQu0VZQJeGcbt4g0drMq618kKTRs5sHOqciuqSankbs1+KF 60vsrJS37vgeFTWHoA+lZm7c+Z6HAIPof6ttVQm0S8fgXc/W77K2xGPSYAXVRIccZBJPar r2S3J8mbFHiyiSNGIj6evhY405sbbzg6DhG8dMsFroSoWfNR4K0xRwBXCCyvPw== From: Miquel Raynal Date: Fri, 29 May 2026 17:22:30 +0200 Subject: [PATCH 10/30] mtd: spi-nor: winbond: W25Q128JV-Q/N: Add quad page program capability 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: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-10-87e5d3122244@bootlin.com> References: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-0-87e5d3122244@bootlin.com> In-Reply-To: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-0-87e5d3122244@bootlin.com> To: Pratyush Yadav , Michael Walle , Takahiro Kuwano , Richard Weinberger , Vignesh Raghavendra Cc: Thomas Petazzoni , Steam Lin , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Miquel Raynal X-Mailer: b4 0.14.3 X-Last-TLS-Session-Version: TLSv1.3 The benefit is massive @25MHz, yet this feature is not advertized because these chips do not implement the 4BAIT table. Flag the quad page program capability manually. Before: $ flash_speed /dev/mtd0 -dc10 eraseblock write speed is 536 KiB/s page write speed is 532 KiB/s 2 page write speed is 532 KiB/s After: $ flash_speed /dev/mtd0 -dc10 eraseblock write speed is 3047 KiB/s page write speed is 2935 KiB/s 2 page write speed is 2962 KiB/s Signed-off-by: Miquel Raynal --- + 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_read spi_test c2712b5617a588f8bba4b8fc7af62f6ca5e2356577681b23544d1a93540ecd1d spi_read c2712b5617a588f8bba4b8fc7af62f6ca5e2356577681b23544d1a93540ecd1d 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_read spi_test 4bda3a28f4ffe603c0ec1258c0034d65a1a0d35ab7bd523a834608adabf03cc5 spi_read c2712b5617a588f8bba4b8fc7af62f6ca5e2356577681b23544d1a93540ecd1d spi_test --- drivers/mtd/spi-nor/winbond.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mtd/spi-nor/winbond.c b/drivers/mtd/spi-nor/winbond.c index 6f496be03e46..07ab66a9e6c0 100644 --- a/drivers/mtd/spi-nor/winbond.c +++ b/drivers/mtd/spi-nor/winbond.c @@ -210,7 +210,7 @@ static const struct flash_info winbond_nor_parts[] =3D { .id =3D SNOR_ID(0xef, 0x40, 0x18), /* Flavors w/ and w/o SFDP. */ .size =3D SZ_16M, - .flags =3D SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB, + .flags =3D SPI_NOR_QUAD_PP | SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB, .no_sfdp_flags =3D SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ, .fixups =3D &w25q128_fixups, }, { --=20 2.53.0 From nobody Mon Jun 8 11:05:06 2026 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 941B13F7875 for ; Fri, 29 May 2026 15:22:59 +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=1780068181; cv=none; b=GKOiwdqXjayI7YiA5pPCx1TeZKSqX4M31yct9n8XPWqcYuVOYodPAm/3J4Cu15Sn7/JyzkO9mfvksZwHGmXqzx3FnQfCURFs73IUDtKaXakF6wgTlo5e/nMV4CD9syu2KeVVsPX/pFtDJusTCGRbkmJfnNFtC7FGUbHYnek5OtA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780068181; c=relaxed/simple; bh=L6J7vzHw1KjSf81NPH4L1dP8AQrAQqQAWnUGWrYFx5Y=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=YpaEHkH1AGy1hXuQXSO19FMkpnH0Si5KJZJnpmjKxiIgaUzeIeGEE+MdUmJ6+d5FtnEc8zQAFwkNsOb9OJ63OJSkzliQOP2GTSxkWNfORvIxdYDb1R1KUXx67lLlDy/lF1XXNJ7G9Q3pfY2n8TVox10T83cPkbJH8C+fgLK68ZM= 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=fDigKD3d; 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="fDigKD3d" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id 225EB1A373A; Fri, 29 May 2026 15:22:58 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id ED744601FA; Fri, 29 May 2026 15:22:57 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 1D5AC10888CDE; Fri, 29 May 2026 17:22:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1780068177; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=dToNlV7lKlbJitk+MoySfRp169WXo7A+wMWV0kymOH4=; b=fDigKD3d4kAlGIPMFsHx6k7fABJ4Jnp8zNO7zGALytwD/63oXEjX4Sf6Yg1td8S/U6+7fg 5WCWQPcKqKqrRNWXh9CZWb/K8d3EJu9ca423Zc9u6/cBEvym/JAX5jBe40877oI0q58uWS w+eSYeR9YiqjDf1L4pS6RIL9U7LTV3DAYsC+AwxHLsiEgBos/mvSSwaRe/vLkkftxS4P+d j2LbU+2PnxOlXMrHI2f7F4qqli/fKsguivQY+Updc8hvQOs3jnCP8MLUJ3KiA/9fa9L90F umRz+EueoYn3RG4+CyyjDpNaSKFCzZPX2KwUYFPrDwZZ129MXxlB3TU9uzEZGg== From: Miquel Raynal Date: Fri, 29 May 2026 17:22:31 +0200 Subject: [PATCH 11/30] mtd: spi-nor: winbond: W25Q32JV-Q/N: Fill locking information 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: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-11-87e5d3122244@bootlin.com> References: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-0-87e5d3122244@bootlin.com> In-Reply-To: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-0-87e5d3122244@bootlin.com> To: Pratyush Yadav , Michael Walle , Takahiro Kuwano , Richard Weinberger , Vignesh Raghavendra Cc: Thomas Petazzoni , Steam Lin , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Miquel Raynal X-Mailer: b4 0.14.3 X-Last-TLS-Session-Version: TLSv1.3 The SFDP table does not advertize the locking capabilities of the device, flag these capabilities. Signed-off-by: Miquel Raynal --- $ alias show_sectors=3D'grep -A4 "locked sectors" /sys/kernel/debug/spi-nor= /spi0.0 /params' $ flash_lock -u /dev/mtd0 $ flash_lock -i /dev/mtd0 Device: /dev/mtd0 Start: 0 Len: 0x400000 Lock status: unlocked Return code: 0 $ mtd_debug erase /dev/mtd0 0 2097152 Erased 2097152 bytes from address 0x00000000 in flash $ 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* 6d7c114421890dfa12e1824aa351d4490815a9c0ceb9c2e7981073106a11fc71 spi_read 6d7c114421890dfa12e1824aa351d4490815a9c0ceb9c2e7981073106a11fc71 spi_test $ show_sectors locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-003fffff | unlocked | 64 $ flash_lock -l /dev/mtd0 $ flash_lock -i /dev/mtd0 Device: /dev/mtd0 Start: 0 Len: 0x400000 Lock status: locked Return code: 1 $ 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* 6d7c114421890dfa12e1824aa351d4490815a9c0ceb9c2e7981073106a11fc71 spi_read 6d7c114421890dfa12e1824aa351d4490815a9c0ceb9c2e7981073106a11fc71 spi_test $ dd if=3D/dev/urandom of=3D./spi_test2 bs=3D1M count=3D2 2+0 records in 2+0 records out $ mtd_debug write /dev/mtd0 0 2097152 spi_test2 Copied 2097152 bytes from spi_test2 to address 0x00000000 in flash $ mtd_debug read /dev/mtd0 0 2097152 spi_read2 Copied 2097152 bytes from address 0x00000000 in flash to spi_read2 $ sha256sum spi* 6d7c114421890dfa12e1824aa351d4490815a9c0ceb9c2e7981073106a11fc71 spi_read 6d7c114421890dfa12e1824aa351d4490815a9c0ceb9c2e7981073106a11fc71 spi_read2 6d7c114421890dfa12e1824aa351d4490815a9c0ceb9c2e7981073106a11fc71 spi_test 5b69b16c88c3ae48213c359d2f9fd7f0583e513dabb224b3404bc93a5e173253 spi_test2 $ show_sectors locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-003fffff | locked | 64 $ flash_lock -u /dev/mtd0 $ size=3D$(cat /sys/class/mtd/mtd0/size) $ nblocks=3D$(grep unlocked /sys/kernel/debug/spi-nor/spi0.0/params | sed -= e 's/.* unlocked | //') $ $ bs=3D$(($size / $nblocks)) $ flash_lock -u /dev/mtd0 $ flash_lock -l /dev/mtd0 $(($size - (2 * $bs))) 2 # last two $ show_sectors locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-003dffff | unlocked | 62 003e0000-003fffff | locked | 2 $ flash_lock -u /dev/mtd0 $(($size - (2 * $bs))) 1 # last one $ show_sectors locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-003effff | unlocked | 63 003f0000-003fffff | locked | 1 $ flash_lock -u /dev/mtd0 $ all_but_one=3D$((($size / $bs) - 1)) $ flash_lock -l /dev/mtd0 $bs $all_but_one # all but the first $ show_sectors locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-0000ffff | unlocked | 1 00010000-003fffff | locked | 63 $ flash_lock -u /dev/mtd0 $bs 1 # all but the two first $ show_sectors locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-0001ffff | unlocked | 2 00020000-003fffff | locked | 62 $ flash_lock -u /dev/mtd0 $ flash_lock -l /dev/mtd0 0 $all_but_one # same from the other side $ show_sectors locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-003effff | locked | 63 003f0000-003fffff | unlocked | 1 $ flash_lock -u /dev/mtd0 $(($size - (2 * $bs))) 1 # all but two $ show_sectors locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-003dffff | locked | 62 003e0000-003fffff | unlocked | 2 --- drivers/mtd/spi-nor/winbond.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mtd/spi-nor/winbond.c b/drivers/mtd/spi-nor/winbond.c index 07ab66a9e6c0..e6dca2493357 100644 --- a/drivers/mtd/spi-nor/winbond.c +++ b/drivers/mtd/spi-nor/winbond.c @@ -200,7 +200,7 @@ static const struct flash_info winbond_nor_parts[] =3D { }, { /* W25Q32JV-Q/N */ .id =3D SNOR_ID(0xef, 0x40, 0x16), - .flags =3D SPI_NOR_QUAD_PP, + .flags =3D SPI_NOR_QUAD_PP | SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB | SPI_NOR= _HAS_CMP, }, { /* W25Q64JV-Q/N */ .id =3D SNOR_ID(0xef, 0x40, 0x17), --=20 2.53.0 From nobody Mon Jun 8 11:05:06 2026 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 56E173F8707 for ; Fri, 29 May 2026 15:23:00 +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=1780068181; cv=none; b=k9AC5U2KD335v6gCcbxRf8Fm3Fz/oHH9t0eBaFsHTg0vmMzy5Rix+aTpVCrhgAVsCZKL9aitbsrEuT1ljewt6XfpIPenJHQ6WCRR7rfVQ1H48P4JoYceuDijv2SgTK1jPMP6piwepKq/CmM7G2yjMza7MuAne+QnWfAzKXWM1/E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780068181; c=relaxed/simple; bh=dTxALz2KaIEyJeoAjXbV+1Omogw/ukWN7PRq1bsWmcI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=cNxDcKSeSeb2oCP7kzRgI5/bNGn8DQm121vGIJCIkp0Ls2gQezwfT6165Yre7jB4xZbkF3pZOQl/vjUKMWG1o3oRnpMNvvFLH3Ei56qoqcigBDrxdiLzfh07zb+eRVPmAlPBDWdIBPrChJDB3atgjWKRORhx7qFYe6Ty5nXGxF0= 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=cYNkkz9N; 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="cYNkkz9N" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id 05F8EC6245E; Fri, 29 May 2026 15:23:00 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 4C53E601FA; Fri, 29 May 2026 15:22:59 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 953DF10888CDF; Fri, 29 May 2026 17:22:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1780068178; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=GZJCk3dQT6dl15wDQGosf0NAgm9UdTVBowq5+HSV7c0=; b=cYNkkz9N33FuspzyHl6MQF0A5mUujyFGIpqbCsuMtXmX4ppgX7W49t6fxCj5MJW965OGYp lHzGiFT1eq3rMsWpZ+2F/nUDiptJzCAjkGHI6yq6iPluqofmtGWwsps7UCy2w/IlhIoDkm u3JZ7dR1dp+D4IXEK4CDZFd2eixLVKyDc1zHYqks/sJAw+NcrerEwAZ6DjOfdr98C+Av3b 1TAbXgs4dolYAesrI8H5K5ObKMOE3NT4UqAJrjHgg6phsuk6GgHLPV0HLqfaYq/gpcGtyp Y07eZWm4NhOdPNNxxh/Qt3iGLBA5kq6mCbp49+0ZO0ApG9iFRtUnl+RVsnf26g== From: Miquel Raynal Date: Fri, 29 May 2026 17:22:32 +0200 Subject: [PATCH 12/30] mtd: spi-nor: winbond: W25Q64JV-Q/N: Fill locking information 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: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-12-87e5d3122244@bootlin.com> References: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-0-87e5d3122244@bootlin.com> In-Reply-To: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-0-87e5d3122244@bootlin.com> To: Pratyush Yadav , Michael Walle , Takahiro Kuwano , Richard Weinberger , Vignesh Raghavendra Cc: Thomas Petazzoni , Steam Lin , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Miquel Raynal X-Mailer: b4 0.14.3 X-Last-TLS-Session-Version: TLSv1.3 The SFDP table does not advertize the locking capabilities of the device, flag these capabilities. Signed-off-by: Miquel Raynal --- + dd 'if=3D/dev/urandom' 'of=3D./spi_test' 'bs=3D1M' 'count=3D2' 2+0 records in 2+0 records out + alias 'show_sectors=3Dgrep -A4 "locked sectors" /sys/kernel/debug/spi-nor= /spi0.0/params' + flash_lock -u /dev/mtd0 + flash_lock -i /dev/mtd0 Device: /dev/mtd0 Start: 0 Len: 0x800000 Lock status: unlocked Return code: 0 + mtd_debug erase /dev/mtd0 0 2097152 Erased 2097152 bytes from address 0x00000000 in flash + 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_read spi_test a4ad2c0352f71d61f64ed9cabb705edc84ac1f1be079619550cd18c70db707ce spi_read a4ad2c0352f71d61f64ed9cabb705edc84ac1f1be079619550cd18c70db707ce spi_test + grep -A4 'locked sectors' /sys/kernel/debug/spi-nor/spi0.0/params locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-007fffff | unlocked | 64 + flash_lock -l /dev/mtd0 + flash_lock -i /dev/mtd0 Device: /dev/mtd0 Start: 0 Len: 0x800000 Lock status: locked Return code: 1 + 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_read spi_test a4ad2c0352f71d61f64ed9cabb705edc84ac1f1be079619550cd18c70db707ce spi_read a4ad2c0352f71d61f64ed9cabb705edc84ac1f1be079619550cd18c70db707ce spi_test + dd 'if=3D/dev/urandom' 'of=3D./spi_test2' 'bs=3D1M' 'count=3D2' 2+0 records in 2+0 records out + mtd_debug write /dev/mtd0 0 2097152 spi_test2 Copied 2097152 bytes from spi_test2 to address 0x00000000 in flash + mtd_debug read /dev/mtd0 0 2097152 spi_read2 Copied 2097152 bytes from address 0x00000000 in flash to spi_read2 + sha256sum spi_read spi_read2 spi_test spi_test2 a4ad2c0352f71d61f64ed9cabb705edc84ac1f1be079619550cd18c70db707ce spi_read a4ad2c0352f71d61f64ed9cabb705edc84ac1f1be079619550cd18c70db707ce spi_read2 a4ad2c0352f71d61f64ed9cabb705edc84ac1f1be079619550cd18c70db707ce spi_test b12f8258bf0374eb5c55e659fc430df7a6016d3c0dca2dc04ef1fe82f61d7f67 spi_test2 + grep -A4 'locked sectors' /sys/kernel/debug/spi-nor/spi0.0/params locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-007fffff | locked | 64 + flash_lock -u /dev/mtd0 + cat /sys/class/mtd/mtd0/size + size=3D8388608 + cat /sys/class/mtd/mtd0/erasesize + bs=3D65536 + grep unlocked /sys/kernel/debug/spi-nor/spi0.0/params + sed -e 's/.*unlocked | //' + nsectors=3D64 + ss=3D131072 + bps=3D2 + flash_lock -u /dev/mtd0 + flash_lock -l /dev/mtd0 8126464 4 + grep -A4 'locked sectors' /sys/kernel/debug/spi-nor/spi0.0/params locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-007bffff | unlocked | 62 007c0000-007fffff | locked | 2 + flash_lock -u /dev/mtd0 8126464 2 + grep -A4 'locked sectors' /sys/kernel/debug/spi-nor/spi0.0/params locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-007dffff | unlocked | 63 007e0000-007fffff | locked | 1 + flash_lock -u /dev/mtd0 + flash_lock -l /dev/mtd0 -8388608 256 flash_lock: invalid option -- '8' Utility to lock, unlock, or check the lock status of the flash. Default action: lock Usage: flash_lock [options] [--] [offset [block count]] Options: -h --help Display this help and exit -V --version Display version information and exit -i --islocked Check if flash region is locked -l --lock Lock a region of flash -u --unlock Unlock a region of flash MTD device node or 'mtd:' If offset is not specified, it defaults to 0. If block count is not specified, it defaults to all blocks. A block count of -1 means all blocks. + grep -A4 'locked sectors' /sys/kernel/debug/spi-nor/spi0.0/params locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-007fffff | unlocked | 64 + flash_lock -u /dev/mtd0 + flash_lock -l /dev/mtd0 0 4 + grep -A4 'locked sectors' /sys/kernel/debug/spi-nor/spi0.0/params locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-0003ffff | locked | 2 00040000-007fffff | unlocked | 62 + flash_lock -u /dev/mtd0 131072 2 + grep -A4 'locked sectors' /sys/kernel/debug/spi-nor/spi0.0/params locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-0001ffff | locked | 1 00020000-007fffff | unlocked | 63 + all_but_one=3D126 + flash_lock -u /dev/mtd0 + flash_lock -l /dev/mtd0 131072 126 + grep -A4 'locked sectors' /sys/kernel/debug/spi-nor/spi0.0/params locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-0001ffff | unlocked | 1 00020000-007fffff | locked | 63 + flash_lock -u /dev/mtd0 131072 2 + grep -A4 'locked sectors' /sys/kernel/debug/spi-nor/spi0.0/params locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-0003ffff | unlocked | 2 00040000-007fffff | locked | 62 + flash_lock -u /dev/mtd0 + flash_lock -l /dev/mtd0 0 126 + grep -A4 'locked sectors' /sys/kernel/debug/spi-nor/spi0.0/params locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-007dffff | locked | 63 007e0000-007fffff | unlocked | 1 + flash_lock -u /dev/mtd0 8126464 2 + grep -A4 'locked sectors' /sys/kernel/debug/spi-nor/spi0.0/params locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-007bffff | locked | 62 007c0000-007fffff | unlocked | 2 --- drivers/mtd/spi-nor/winbond.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mtd/spi-nor/winbond.c b/drivers/mtd/spi-nor/winbond.c index e6dca2493357..979ad8bacae2 100644 --- a/drivers/mtd/spi-nor/winbond.c +++ b/drivers/mtd/spi-nor/winbond.c @@ -204,7 +204,7 @@ static const struct flash_info winbond_nor_parts[] =3D { }, { /* W25Q64JV-Q/N */ .id =3D SNOR_ID(0xef, 0x40, 0x17), - .flags =3D SPI_NOR_QUAD_PP, + .flags =3D SPI_NOR_QUAD_PP | SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB | SPI_NOR= _HAS_CMP, }, { /* W25Q128JV-Q/N */ .id =3D SNOR_ID(0xef, 0x40, 0x18), --=20 2.53.0 From nobody Mon Jun 8 11:05:06 2026 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 565443F8ED8 for ; Fri, 29 May 2026 15:23:02 +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=1780068184; cv=none; b=vGIIDG7K+8adXpBkaYNtuWFOXgF937NS0a3sZqcjXfBD/9V8Us/O7wMmfzLN7cOtdS0dfjLMyg60KQNm/4JUzAH1DfG10RlyzHlzeFc6hs6C05g/qetletNPoPUh86KCXvzoXq6IdIxStSQtRDXcGHSowL3GcHRujXS8lwpDhAo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780068184; c=relaxed/simple; bh=YlfDq7o/lJ9ApXsQ7hl1/UwC5aP+yc04qE0pPKgcxTA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Pq12RWgiTZpTYoNEMa4lGRwuEjn7vD/lTueC883gXERB2Ab7OP+mdjHytLDYl9ly1f3B6kwCU6bEzCvmKb+iM+fDwY3cF7ivPOT9L3CEqLVOqzqbpH4fOsMqjVKnCgNPWKKN1k5eQ8utEzBcxMOC0h/+15EvbUaiDSTCe45Aqpg= 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=AqSQXoST; 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="AqSQXoST" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id 1B1311A373C; Fri, 29 May 2026 15:23:01 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id E4C7D601FA; Fri, 29 May 2026 15:23:00 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 1094010888CDD; Fri, 29 May 2026 17:22:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1780068180; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=jWDshms4Xgiy/aD8OmaxuCnDMJJM8qehrcMhn9NDSVg=; b=AqSQXoSTxoMklMchqikNCG9ZctGxqv0uYUP4UGi2S8SW3Jp7Yan8zFNTRQOfRWNNmw5k5t S6KvAPS6Eumwara76kTdeKz06A6efrlKWzO0ixDJOx/Co+lPY4fUt5YZhMVL9fI+AzGdRL vfvmfmpD1SswG2FHDEk9zNuTs9MzF2wsos0PZszn7WVbYULLjhNLWkMkLl3yHuKjWliQ1O mK8H2R81KgyUm7A7JQIgM2cttpq2CIxTrtFHfg6vhHJEia3ioiabQC/X1c2ocE0B8tr551 DvkZRg/SL5hDixsXk2XqEiSXrldMKGKXPtgaQMlGLl6fByRtuIhpMCt5nopGkw== From: Miquel Raynal Date: Fri, 29 May 2026 17:22:33 +0200 Subject: [PATCH 13/30] mtd: spi-nor: winbond: W25Q128JV-Q/N: Fill locking information 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: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-13-87e5d3122244@bootlin.com> References: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-0-87e5d3122244@bootlin.com> In-Reply-To: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-0-87e5d3122244@bootlin.com> To: Pratyush Yadav , Michael Walle , Takahiro Kuwano , Richard Weinberger , Vignesh Raghavendra Cc: Thomas Petazzoni , Steam Lin , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Miquel Raynal X-Mailer: b4 0.14.3 X-Last-TLS-Session-Version: TLSv1.3 The SFDP table does not advertize the CMP locking capabilities of the device, flag it. Signed-off-by: Miquel Raynal --- $ flash_lock -u /dev/mtd0 $ flash_lock -l /dev/mtd0 $ss $all_but_one # all but the first $ show_sectors locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-0003ffff | unlocked | 1 00040000-00ffffff | locked | 63 $ flash_lock -u /dev/mtd0 $ss $(($ss / $bs)) # all but the two first $ show_sectors locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-0007ffff | unlocked | 2 00080000-00ffffff | locked | 62 $ flash_lock -u /dev/mtd0 $ flash_lock -l /dev/mtd0 0 $all_but_one # same from the other side $ show_sectors locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-00fbffff | locked | 63 00fc0000-00ffffff | unlocked | 1 $ flash_lock -u /dev/mtd0 $(($size - (2 * $ss))) $(($ss / $bs)) # all but t= wo $ show_sectors locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-00f7ffff | locked | 62 00f80000-00ffffff | unlocked | 2 --- drivers/mtd/spi-nor/winbond.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mtd/spi-nor/winbond.c b/drivers/mtd/spi-nor/winbond.c index 979ad8bacae2..3eb3f32e8b22 100644 --- a/drivers/mtd/spi-nor/winbond.c +++ b/drivers/mtd/spi-nor/winbond.c @@ -210,7 +210,7 @@ static const struct flash_info winbond_nor_parts[] =3D { .id =3D SNOR_ID(0xef, 0x40, 0x18), /* Flavors w/ and w/o SFDP. */ .size =3D SZ_16M, - .flags =3D SPI_NOR_QUAD_PP | SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB, + .flags =3D SPI_NOR_QUAD_PP | SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB | SPI_NOR= _HAS_CMP, .no_sfdp_flags =3D SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ, .fixups =3D &w25q128_fixups, }, { --=20 2.53.0 From nobody Mon Jun 8 11:05:06 2026 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 5EFD5367F36 for ; Fri, 29 May 2026 15:23:04 +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=1780068185; cv=none; b=M140fO4BJLEvPh9hScT3JfvpHYaoYignPP0zO+74xHH92DYbUhb2Ap9kbibXnA+mFXKs+xWnk46MPWfH1BWDnqmXyApJg/2FQyPlwDkGBnuZKZMh0a5IhzpaYz8YPkSLvhleLbmcB2IX3LdrF77VHj1aJz/ndaJZwOyqGbRxOV0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780068185; c=relaxed/simple; bh=ytisXm4Cdf0ixPCBbNlMzOSsHfTXiQ7JGEPP0DYxkx4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=SfzQHxvDXU6/skeAIAFItuOeb0TfOWFpnLu3eRsAFYe9MF1CVPXlUhirEklkDxZevXMFcyA4284qdFIMMElx/0oYrDy26rE/ZDgSUWB6SL2qf8N4ma1hqQaLhXwNsBTJgNE3CXqEDFYXNzKKGC+YSuDsarUAh/8m13LyvirstKY= 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=gdJyecEh; 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="gdJyecEh" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id 4E2931A373A; Fri, 29 May 2026 15:23:03 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 2298D601FA; Fri, 29 May 2026 15:23:03 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 6E35B10888CE1; Fri, 29 May 2026 17:23:00 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1780068182; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=XCLIcbntrulIE3DzIpWWzCQJq6qdAjfo/g+E9I90xk0=; b=gdJyecEhlQZ/y6Ohzr3QMy0jLRiFN1t5PVxbV9LqNKZlIwWhLgKXtiQNgQtoY2Zvmj98Bh zVJsmQaqnPWKJ2qTXZllxBZFg8tUrZXkXW6w0355ho9p7gjxye9Ca5CWHXnamA62ZY+nKR shd4r9hUBf9OQamEqt68shZKcvLjm8mxUtZcHaOk/cqL1N3qWc63xhftU/cFyiirrvyrhu mQERXjmFCeCKvQqlwMDjgGaHaVXv2wQmfdwZBUQ6rAz+8i5RxxGImU8dKzfckTEM3Fx8vp Ac/AaHGzKxIej7hvVh2DypWnnI+ozm8MZGlV5xwths+nqQBlU9DBivkqIYC7NQ== From: Miquel Raynal Date: Fri, 29 May 2026 17:22:34 +0200 Subject: [PATCH 14/30] mtd: spi-nor: winbond: W25Q512JV-Q/N: Fill locking information 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: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-14-87e5d3122244@bootlin.com> References: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-0-87e5d3122244@bootlin.com> In-Reply-To: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-0-87e5d3122244@bootlin.com> To: Pratyush Yadav , Michael Walle , Takahiro Kuwano , Richard Weinberger , Vignesh Raghavendra Cc: Thomas Petazzoni , Steam Lin , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Miquel Raynal X-Mailer: b4 0.14.3 X-Last-TLS-Session-Version: TLSv1.3 The SFDP table does not advertize the locking capabilities of the device, flag these capabilities. Signed-off-by: Miquel Raynal --- $ dd if=3D/dev/urandom of=3D./spi_test bs=3D1M count=3D2 2+0 records in 2+0 records out $ sha256sum spi_test 090febbfd471d60250b2c6166939335012ad84207ab29b6657fcf62e8fc21fa4 spi_test $ mtd_debug erase /dev/mtd0 0 2097152 Erased 2097152 bytes from address 0x00000000 in flash $ 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* 090febbfd471d60250b2c6166939335012ad84207ab29b6657fcf62e8fc21fa4 spi_read 090febbfd471d60250b2c6166939335012ad84207ab29b6657fcf62e8fc21fa4 spi_test $ show_sectors locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-03ffffff | unlocked | 1024 $ flash_lock -l /dev/mtd0 $ flash_lock -i /dev/mtd0 Device: /dev/mtd0 Start: 0 Len: 0x4000000 Lock status: locked Return code: 1 $ 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* 090febbfd471d60250b2c6166939335012ad84207ab29b6657fcf62e8fc21fa4 spi_read 090febbfd471d60250b2c6166939335012ad84207ab29b6657fcf62e8fc21fa4 spi_test $ dd if=3D/dev/urandom of=3D./spi_test2 bs=3D1M count=3D2 2+0 records in 2+0 records out $ mtd_debug write /dev/mtd0 0 2097152 spi_test2 Copied 2097152 bytes from spi_test2 to address 0x00000000 in flash $ mtd_debug read /dev/mtd0 0 2097152 spi_read2 Copied 2097152 bytes from address 0x00000000 in flash to spi_read2 $ sha256sum spi* 090febbfd471d60250b2c6166939335012ad84207ab29b6657fcf62e8fc21fa4 spi_read 090febbfd471d60250b2c6166939335012ad84207ab29b6657fcf62e8fc21fa4 spi_read2 090febbfd471d60250b2c6166939335012ad84207ab29b6657fcf62e8fc21fa4 spi_test 0236e30ff05676c4bcc80b55aa0ebf4747630e0ae3360e025c9e0c2509402a6b spi_test2 $ show_sectors locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-03ffffff | locked | 1024 $ flash_lock -u /dev/mtd0 $ $ size=3D$(cat /sys/class/mtd/mtd0/size) $ nblocks=3D$(grep unlocked /sys/kernel/debug/spi-nor/spi0.0/params | sed -= e 's/.* unlocked | //') $ $ bs=3D$(($size / $nblocks)) $ $ flash_lock -u /dev/mtd0 $ flash_lock -l /dev/mtd0 $(($size - (2 * $bs))) 2 # last two $ show_sectors locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-03fdffff | unlocked | 1022 03fe0000-03ffffff | locked | 2 $ flash_lock -u /dev/mtd0 $(($size - (2 * $bs))) 1 # last one $ show_sectors locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-03feffff | unlocked | 1023 03ff0000-03ffffff | locked | 1 $ flash_lock -u /dev/mtd0 $ flash_lock -l /dev/mtd0 $(($size - (2**7 * $bs))) $((2**7)) $ show_sectors locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-037fffff | unlocked | 896 03800000-03ffffff | locked | 128 $ flash_lock -u /dev/mtd0 $ flash_lock -l /dev/mtd0 0 2 # first two $ show_sectors locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-0001ffff | locked | 2 00020000-03ffffff | unlocked | 1022 $ flash_lock -u /dev/mtd0 $bs 1 # first one $ show_sectors locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-0000ffff | locked | 1 00010000-03ffffff | unlocked | 1023 $ all_but_one=3D$((($size / $bs) - 1)) $ flash_lock -u /dev/mtd0 $ flash_lock -l /dev/mtd0 $bs $all_but_one # all but the first $ show_sectors locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-0000ffff | unlocked | 1 00010000-03ffffff | locked | 1023 $ flash_lock -u /dev/mtd0 $bs 1 # all but the two first $ show_sectors locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-0001ffff | unlocked | 2 00020000-03ffffff | locked | 1022 $ flash_lock -u /dev/mtd0 $ flash_lock -l /dev/mtd0 0 $all_but_one # same from the other side $ show_sectors locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-03feffff | locked | 1023 03ff0000-03ffffff | unlocked | 1 $ flash_lock -u /dev/mtd0 $(($size - (2 * $bs))) 1 # all but two $ show_sectors locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-03fdffff | locked | 1022 03fe0000-03ffffff | unlocked | 2 --- drivers/mtd/spi-nor/winbond.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/mtd/spi-nor/winbond.c b/drivers/mtd/spi-nor/winbond.c index 3eb3f32e8b22..2e5b488818c8 100644 --- a/drivers/mtd/spi-nor/winbond.c +++ b/drivers/mtd/spi-nor/winbond.c @@ -222,6 +222,8 @@ static const struct flash_info winbond_nor_parts[] =3D { }, { /* W25Q512JV-Q/N */ .id =3D SNOR_ID(0xef, 0x40, 0x20), + .flags =3D SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB | SPI_NOR_TB_SR_BIT6 | + SPI_NOR_4BIT_BP | SPI_NOR_HAS_CMP, }, { /* W25Q01JV-Q/N */ .id =3D SNOR_ID(0xef, 0x40, 0x21), --=20 2.53.0 From nobody Mon Jun 8 11:05:06 2026 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 23AB63FA5F9 for ; Fri, 29 May 2026 15:23:06 +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=1780068187; cv=none; b=Dfqwbp9uhGLDniBZ8qYUA6O9J4FAFVh+MWSX/G8eUrwoOJKzQnLzR8JfOJFwBL0CAmrggmr2buymm5zupJDMPx0VtJuVDKzOYUCEm7TziV00lJLbAGF+BL6idyZTZpN1ta0XMOVSJtfMpFS9mPTKbyEjfGKegi6FIoc1UjauVFI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780068187; c=relaxed/simple; bh=5KdMqPK7fyl5FQ2TyxeRdG1tQqnTZRbJ3eum3jRZxOk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Se+M2UDpCcFuVwLRQr2Aa4QBbW1gfo1VcY/aKcgpdSdTt+zfDC4vcsa30YZx6JfEjOQrbAwBt3KZaPK2JoZD0vEMLc5obO6OitasysGFdJ3t3LmrReNIoAtUx2kgXsdmr6xyHl4kvA2pYhUDJ482gBAk9LTurExc5UJfeWaq5Pw= 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=iung1BEL; 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="iung1BEL" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id E86DE1A373B; Fri, 29 May 2026 15:23:04 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id B6BE0601FA; Fri, 29 May 2026 15:23:04 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id C037610888CE3; Fri, 29 May 2026 17:23:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1780068183; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=D5jczl0qGRzSCzn4a6hChSQ6TAQEY2VXW68BluQrbuw=; b=iung1BELORHYoAgYEMDa1Z2ISSbnaxUKiZFX5GKGCmu/BNMf24mmYtq+YUuQxQEOQ3BqdC czH9l4wSXINkaq984kSUisvKiYNtwdhqyeE7kSxZh4rmwZxVkBHtGgRhmDkX+gHch5ktWm AGV/pn+0K8oVU2knjCXdvI6Y0Xv+0AgsFyTEKOtLW9qt9/xnTkbnwKlngJbXyv4/saWdgM WXf0KV9crJ/A9WhgSg6Pq2fI7SgjNynGDZi2b+l8wpUG7eE0akOQU5CJCFTfMrPbP1nINA ztiYQERQO1zpnpbxvmgJ37Lw7i8YbgbZyE7ZpgBYUA5XUuFh1elPi5oHI1X9Tw== From: Miquel Raynal Date: Fri, 29 May 2026 17:22:35 +0200 Subject: [PATCH 15/30] mtd: spi-nor: winbond: W25Q01JV-Q/N: Fill locking information 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: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-15-87e5d3122244@bootlin.com> References: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-0-87e5d3122244@bootlin.com> In-Reply-To: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-0-87e5d3122244@bootlin.com> To: Pratyush Yadav , Michael Walle , Takahiro Kuwano , Richard Weinberger , Vignesh Raghavendra Cc: Thomas Petazzoni , Steam Lin , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Miquel Raynal X-Mailer: b4 0.14.3 X-Last-TLS-Session-Version: TLSv1.3 The SFDP table does not advertize the locking capabilities of the device, flag these capabilities. Signed-off-by: Miquel Raynal --- $ cat /sys/bus/spi/devices/spi0.0/spi-nor/manufacturer winbond $ cat /sys/bus/spi/devices/spi0.0/spi-nor/jedec_id ef4021 $ xxd -p /sys/bus/spi/devices/spi0.0/spi-nor/sfdp 53464450060101ff00060110800000ff84000102d00000ff03000102f000 00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffe520fbffffffff3f44eb086b083b42bbfeffffffffff 0000ffff40eb0c200f5210d800003602a60082ea14e2e96376337a757a75 f7a2d55c19f74dffe970f9a5ffffffffffffffffffffffffffffffffff0a f0ff21ffdcff $ sha256sum /sys/bus/spi/devices/spi0.0/spi-nor/sfdp c733cf105c5f05ed23ad3a32c2a72c1a09d4b895c628db52e645a8a457dfc7d6 /sys/bus/= spi/devices/spi0.0/spi-nor/sfdp $ sha256sum /sys/bus/spi/devices/spi0.0/spi-nor/ jedec_id manufacturer sfdp $ sha256sum /sys/kernel/debug/spi-nor/spi0.0/capabilities 6204c70963ab07f9865d051b888679ce34ad3a9f167fbbd4a2a6e0c3d0ce4cdf /sys/kern= el/debug/spi-nor/spi0.0/capabilities $ 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 40 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 | NO_RE= AD_CR | HAS_SR_TB_BIT6 | HAS_4BIT_BP | SOFT_RESET | NO_WP | HAS_SR2_CMP_BIT6 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 locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-07ffffff | unlocked | 2048 $ dd if=3D/dev/urandom of=3D./spi_test bs=3D1M count=3D2 2+0 records in 2+0 records out $ flash_lock -u /dev/mtd0 $ flash_lock -i /dev/mtd0 Device: /dev/mtd0 Start: 0 Len: 0x8000000 Lock status: unlocked Return code: 0 $ mtd_debug erase /dev/mtd0 0 2097152 Erased 2097152 bytes from address 0x00000000 in flash $ 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* 3fa6e836be5a072bd2d4ae538559dce20b14c5827ccc0cf6df783c0c35a4a83f spi_read 3fa6e836be5a072bd2d4ae538559dce20b14c5827ccc0cf6df783c0c35a4a83f spi_test $ show_sectors locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-07ffffff | unlocked | 2048 $ flash_lock -l /dev/mtd0 $ flash_lock -i /dev/mtd0 Device: /dev/mtd0 Start: 0 Len: 0x8000000 Lock status: locked Return code: 1 $ 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* 3fa6e836be5a072bd2d4ae538559dce20b14c5827ccc0cf6df783c0c35a4a83f spi_read 3fa6e836be5a072bd2d4ae538559dce20b14c5827ccc0cf6df783c0c35a4a83f spi_test $ dd if=3D/dev/urandom of=3D./spi_test2 bs=3D1M count=3D2 2+0 records in 2+0 records out $ mtd_debug write /dev/mtd0 0 2097152 spi_test2 Copied 2097152 bytes from spi_test2 to address 0x00000000 in flash $ mtd_debug read /dev/mtd0 0 2097152 spi_read2 Copied 2097152 bytes from address 0x00000000 in flash to spi_read2 $ sha256sum spi* 3fa6e836be5a072bd2d4ae538559dce20b14c5827ccc0cf6df783c0c35a4a83f spi_read 3fa6e836be5a072bd2d4ae538559dce20b14c5827ccc0cf6df783c0c35a4a83f spi_read2 3fa6e836be5a072bd2d4ae538559dce20b14c5827ccc0cf6df783c0c35a4a83f spi_test 367809dbdff878d023d3a1a8526a6382759a3ec78aa6289d18577d15f013d44f spi_test2 $ show_sectors locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-07ffffff | locked | 2048 $ flash_lock -u /dev/mtd0 $ nsectors=3D$(grep unlocked /sys/kernel/debug/spi-nor/spi0.0/params | sed = -e 's/. *unlocked | //') $ ss=3D$(($size / $nsectors)) $ bps=3D$(($ss / $bs)) $ flash_lock -u /dev/mtd0 $ flash_lock -l /dev/mtd0 $(($size - (2 * $ss))) $((2 * $bps)) # last two $ show_sectors locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-07fdffff | unlocked | 2046 07fe0000-07ffffff | locked | 2 $ flash_lock -u /dev/mtd0 $(($size - (2 * $ss))) $((1 * $bps)) # last one $ show_sectors locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-07feffff | unlocked | 2047 07ff0000-07ffffff | locked | 1 $ flash_lock -u /dev/mtd0 $ flash_lock -l /dev/mtd0 $(($size - (2**7 * $ss))) $((2**7 * $bps)) $ show_sectors locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-077fffff | unlocked | 1920 07800000-07ffffff | locked | 128 $ flash_lock -u /dev/mtd0 $ flash_lock -l /dev/mtd0 0 $((2 * $bps)) # first two $ show_sectors locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-0001ffff | locked | 2 00020000-07ffffff | unlocked | 2046 $ flash_lock -u /dev/mtd0 $ss $((1 * $bps)) # first one $ show_sectors locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-0000ffff | locked | 1 00010000-07ffffff | unlocked | 2047 $ flash_lock -l /dev/mtd0 $ss $all_but_one # all but the first $ show_sectors locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-0000ffff | unlocked | 1 00010000-07ffffff | locked | 2047 $ flash_lock -u /dev/mtd0 $ss $(($ss / $bs)) # all but the two first $ show_sectors locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-0001ffff | unlocked | 2 00020000-07ffffff | locked | 2046 $ flash_lock -u /dev/mtd0 $ flash_lock -l /dev/mtd0 0 $all_but_one # same from the other side $ show_sectors locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-07feffff | locked | 2047 07ff0000-07ffffff | unlocked | 1 $ flash_lock -u /dev/mtd0 $(($size - (2 * $ss))) $(($ss / $bs)) # all but t= wo $ show_sectors locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-07fdffff | locked | 2046 07fe0000-07ffffff | unlocked | 2 --- drivers/mtd/spi-nor/winbond.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/mtd/spi-nor/winbond.c b/drivers/mtd/spi-nor/winbond.c index 2e5b488818c8..f1c86d4ba216 100644 --- a/drivers/mtd/spi-nor/winbond.c +++ b/drivers/mtd/spi-nor/winbond.c @@ -227,6 +227,8 @@ static const struct flash_info winbond_nor_parts[] =3D { }, { /* W25Q01JV-Q/N */ .id =3D SNOR_ID(0xef, 0x40, 0x21), + .flags =3D SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB | SPI_NOR_TB_SR_BIT6 | + SPI_NOR_4BIT_BP | SPI_NOR_HAS_CMP, .fixups =3D &winbond_nor_multi_die_fixups, }, { .id =3D SNOR_ID(0xef, 0x50, 0x12), --=20 2.53.0 From nobody Mon Jun 8 11:05:06 2026 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 D78DA3FB04E for ; Fri, 29 May 2026 15:23:07 +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=1780068189; cv=none; b=qp/Ku2J8YhPayPzuSMCnqSMgAHX0eQCQcCq+x0XabRFzAuKuk09G8SWyel+uYd8g3pJwc0UXjV4wJ5c5cqQykEV+3gTnhTJk6oVi7A6pJ050FiI04y/9uneQn+X/21C+gZE5x3OlaCY95d711odgXqYv9cq1YZT6qXQNkY7Ot7Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780068189; c=relaxed/simple; bh=E2JuOoHQ0lXTatOq3suPkKpihgzzgpTjpn6Y4caMwbA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=b56UuK3jZ06Nl8K92zeTQi1AZPFWFIp5f7bj6nVzJobjnZ5xNivcdJqsLFCqP9O6x8s6cQmkL85D8hPqA0JDLDDEHhXojWqS5UKeOY8g2rJltlpMS1kPmc6la2gOR9r6lxW3asKpB/JYLr1TrUF3GztmxTOAI9b9mnySLUZkNjQ= 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=2MY3PZ1W; 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="2MY3PZ1W" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id 95AF41A373A; Fri, 29 May 2026 15:23:06 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 6AABA601FA; Fri, 29 May 2026 15:23:06 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 5690E10888CE0; Fri, 29 May 2026 17:23:04 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1780068185; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=/HrouIUKoj7zD4ihUvwRB94wsKe3pbN1HJCcrdXdDyY=; b=2MY3PZ1WyOHMeyWB7nPOYAl8qbQ4OsPON4JTi0LSZQ7yOiuk+2oiaz5fp5hOa7CIlGg43U rLEsEGC+A1ePWENhypdSbuFabZxxR0j/j6kwLJllJdmrXZLI3td7jUlMKwfYic97irXNTk aXAvUf5Lun/Oi8zooJdAvbmOnQDIws7CUwmiwmHfusEd+Z7BZZ2XZLBUXBbSc0lUhdyDXE EGTPxUEzVG8bhsMxe0bo4tsa3tUiFhI9I2w0Zu77HFfQnv5nb16f2+u2NuQUTESPBnQ2q2 nlSHBGkFmBUhPhxlJt0VOuua3Fmcp/F6hi3JHiFf1g8ZpU7bB4sq9A4jQpLVPA== From: Miquel Raynal Date: Fri, 29 May 2026 17:22:36 +0200 Subject: [PATCH 16/30] mtd: spi-nor: winbond: W25Q32JV-M: Drop redundant data 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: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-16-87e5d3122244@bootlin.com> References: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-0-87e5d3122244@bootlin.com> In-Reply-To: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-0-87e5d3122244@bootlin.com> To: Pratyush Yadav , Michael Walle , Takahiro Kuwano , Richard Weinberger , Vignesh Raghavendra Cc: Thomas Petazzoni , Steam Lin , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Miquel Raynal X-Mailer: b4 0.14.3 X-Last-TLS-Session-Version: TLSv1.3 This chip has correct SFDP support, all fields are correctly filled so we can drop them from the table. Signed-off-by: Miquel Raynal --- + cat /sys/bus/spi/devices/spi0.0/spi-nor/jedec_id ef7016 + cat /sys/bus/spi/devices/spi0.0/spi-nor/manufacturer winbond + xxd -p /sys/bus/spi/devices/spi0.0/spi-nor/sfdp 53464450050100ff00050110800000ffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffe520f9ffffffff0144eb086b083b42bbfeffffffffff 0000ffff40eb0c200f5210d800003602a60082ea14c2e96376337a757a75 f7a2d55c19f74dffe930f880 + sha256sum /sys/bus/spi/devices/spi0.0/spi-nor/sfdp e002d5482ce24cecf678c171745e3e90b7fb6cb588739ca63151ed333b09b35a /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 0x03 mode cycles 0 dummy cycles 0 1S-1S-2S opcode 0x3b mode cycles 0 dummy cycles 8 1S-2S-2S opcode 0xbb mode cycles 2 dummy cycles 2 1S-1S-4S opcode 0x6b mode cycles 0 dummy cycles 8 1S-4S-4S opcode 0xeb mode cycles 2 dummy cycles 4 4S-4S-4S opcode 0xeb mode cycles 2 dummy cycles 0 Supported page program modes by the flash 1S-1S-1S opcode 0x02 1S-1S-4S opcode 0x32 + cat /sys/kernel/debug/spi-nor/spi0.0/params name (null) id ef 70 16 00 00 00 size 4.00 MiB write size 1 page size 256 address nbytes 3 flags HAS_SR_TB | HAS_LOCK | HAS_16BIT_SR | NO_READ_CR | SOFT_RESET | NO_WP opcodes read 0xeb dummy cycles 6 erase 0xd8 program 0x32 8D extension none protocols read 1S-4S-4S write 1S-1S-4S register 1S-1S-1S erase commands 20 (4.00 KiB) [1] 52 (32.0 KiB) [2] d8 (64.0 KiB) [3] c7 (4.00 MiB) sector map region (in hex) | erase mask | overlaid ------------------+------------+--------- 00000000-003fffff | [ 3] | no locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-003fffff | unlocked | 64 + 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_read spi_test 2cefe25fab06d6fa7a84391045f015e65b29cd917216a327bf3121b35ca3d450 spi_read 2cefe25fab06d6fa7a84391045f015e65b29cd917216a327bf3121b35ca3d450 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_read spi_test 4bda3a28f4ffe603c0ec1258c0034d65a1a0d35ab7bd523a834608adabf03cc5 spi_read 2cefe25fab06d6fa7a84391045f015e65b29cd917216a327bf3121b35ca3d450 spi_test + mtd_debug info /dev/mtd0 mtd.type =3D MTD_NORFLASH mtd.flags =3D MTD_CAP_NORFLASH mtd.size =3D 4194304 (4M) mtd.erasesize =3D 65536 (64K) mtd.writesize =3D 1 mtd.oobsize =3D 0 regions =3D 0 + alias 'show_sectors=3Dgrep -A4 "locked sectors" /sys/kernel/debug/spi-nor= /spi0.0/params' + flash_lock -u /dev/mtd0 + flash_lock -i /dev/mtd0 Device: /dev/mtd0 Start: 0 Len: 0x400000 Lock status: unlocked Return code: 0 + mtd_debug erase /dev/mtd0 0 2097152 Erased 2097152 bytes from address 0x00000000 in flash + 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_read spi_test 2cefe25fab06d6fa7a84391045f015e65b29cd917216a327bf3121b35ca3d450 spi_read 2cefe25fab06d6fa7a84391045f015e65b29cd917216a327bf3121b35ca3d450 spi_test + grep -A4 'locked sectors' /sys/kernel/debug/spi-nor/spi0.0/params locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-003fffff | unlocked | 64 + flash_lock -l /dev/mtd0 + flash_lock -i /dev/mtd0 Device: /dev/mtd0 Start: 0 Len: 0x400000 Lock status: locked Return code: 1 + 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_read spi_test 2cefe25fab06d6fa7a84391045f015e65b29cd917216a327bf3121b35ca3d450 spi_read 2cefe25fab06d6fa7a84391045f015e65b29cd917216a327bf3121b35ca3d450 spi_test + dd 'if=3D/dev/urandom' 'of=3D./spi_test2' 'bs=3D1M' 'count=3D2' 2+0 records in 2+0 records out + mtd_debug write /dev/mtd0 0 2097152 spi_test2 Copied 2097152 bytes from spi_test2 to address 0x00000000 in flash + mtd_debug read /dev/mtd0 0 2097152 spi_read2 Copied 2097152 bytes from address 0x00000000 in flash to spi_read2 + sha256sum spi_read spi_read2 spi_test spi_test2 2cefe25fab06d6fa7a84391045f015e65b29cd917216a327bf3121b35ca3d450 spi_read 2cefe25fab06d6fa7a84391045f015e65b29cd917216a327bf3121b35ca3d450 spi_read2 2cefe25fab06d6fa7a84391045f015e65b29cd917216a327bf3121b35ca3d450 spi_test 1263fc3dceb68412ef7597acad3415e34ea558070de1d2fe2d78030b75f062d1 spi_test2 + grep -A4 'locked sectors' /sys/kernel/debug/spi-nor/spi0.0/params locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-003fffff | locked | 64 + flash_lock -u /dev/mtd0 + cat /sys/class/mtd/mtd0/size + size=3D4194304 + cat /sys/class/mtd/mtd0/erasesize + bs=3D65536 + grep unlocked /sys/kernel/debug/spi-nor/spi0.0/params + sed -e 's/.*unlocked | //' + nsectors=3D64 + ss=3D65536 + bps=3D1 + flash_lock -u /dev/mtd0 + flash_lock -l /dev/mtd0 4063232 2 + grep -A4 'locked sectors' /sys/kernel/debug/spi-nor/spi0.0/params locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-003dffff | unlocked | 62 003e0000-003fffff | locked | 2 + flash_lock -u /dev/mtd0 4063232 1 + grep -A4 'locked sectors' /sys/kernel/debug/spi-nor/spi0.0/params locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-003effff | unlocked | 63 003f0000-003fffff | locked | 1 + flash_lock -u /dev/mtd0 + grep -A4 'locked sectors' /sys/kernel/debug/spi-nor/spi0.0/params locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-003fffff | unlocked | 64 + flash_lock -u /dev/mtd0 + flash_lock -l /dev/mtd0 0 2 + grep -A4 'locked sectors' /sys/kernel/debug/spi-nor/spi0.0/params locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-0001ffff | locked | 2 00020000-003fffff | unlocked | 62 + flash_lock -u /dev/mtd0 65536 1 + grep -A4 'locked sectors' /sys/kernel/debug/spi-nor/spi0.0/params locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-0000ffff | locked | 1 00010000-003fffff | unlocked | 63 --- drivers/mtd/spi-nor/winbond.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/mtd/spi-nor/winbond.c b/drivers/mtd/spi-nor/winbond.c index f1c86d4ba216..51244625b318 100644 --- a/drivers/mtd/spi-nor/winbond.c +++ b/drivers/mtd/spi-nor/winbond.c @@ -294,9 +294,7 @@ static const struct flash_info winbond_nor_parts[] =3D { }, { /* W25Q32JV-M */ .id =3D SNOR_ID(0xef, 0x70, 0x16), - .size =3D SZ_4M, .flags =3D SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB, - .no_sfdp_flags =3D SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ, }, { /* W25Q64JV-M */ .id =3D SNOR_ID(0xef, 0x70, 0x17), --=20 2.53.0 From nobody Mon Jun 8 11:05:06 2026 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 AC0783FC5AC for ; Fri, 29 May 2026 15:23:09 +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=1780068191; cv=none; b=ss21Ic32DP72ZdvlDyQXgzlzf3hLUwDQCnp3+wdqYg7YCMazC177Ufu7hZ8kpohWcum0sL95vb8b22WrZDwLb4vf5jNpEOydOgqrmf7z3wanuO4ILrApxIP7/iRteEmBkQdt/G/v6xkSTZ/0DnrdB5yGTzw0ymZTLDqrI716oYI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780068191; c=relaxed/simple; bh=OtqAmBNk8MIE5ObA6cQP17XdPsCpCGvg7Fee5p+o90g=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=UNAK+fYtM3UYyU4c5tcj1IwFb9gs2t3qpl8uwR5YrIE8iiXS+Nc+uMcCY1s8TzsKWxRmqg1FY7DAZphi4O4jU1GdDTODFFZBQNKCj9bMRLmJspCd8i5WCXmz1zDBoh0Yl6qGiiVRDNIo63egObXYnYp3/N6wnqU3GX01OmY4UJs= 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=yffProkO; 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="yffProkO" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id 5B1EE4E42D8D; Fri, 29 May 2026 15:23:08 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 31042601FA; Fri, 29 May 2026 15:23:08 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 12A6710888CE4; Fri, 29 May 2026 17:23:05 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1780068187; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=DFu6ec/+7hU4FYLK5uqOocg19Kxitx7SnRHWoE+4/ws=; b=yffProkOZaV4pHcBXIKp5BUAE5zXyZPbU+fxvlWAOGjnqwPpI0tYHNPLaNcxC2ecdH5Mwq aaQmwncsFF/RBAR3FitDo9wgY26aSqHG67nlRz6DASK6zd6k4fMQTVxbl0QElwLv2On/i8 ZAzv3VAr3jsSWVZy2PxlJJo7OS+vExxwAT2Kd3rGBO1AXSARB8lyLyQChh1InxwVrU0tT+ zBavOETa9cdbk04KhZf4YB96GIT5Qzy8s4iZIAgGtDNCnrye51+3rStFp49JIfcQZQIxkS VusczfQ71CsL0A+AyG5CXU2fjTjTLyIj6ayJy5CjGjvh8n3PDnynPdIIbYzDWg== From: Miquel Raynal Date: Fri, 29 May 2026 17:22:37 +0200 Subject: [PATCH 17/30] mtd: spi-nor: winbond: W25Q64JV-M: Drop redundant data 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: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-17-87e5d3122244@bootlin.com> References: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-0-87e5d3122244@bootlin.com> In-Reply-To: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-0-87e5d3122244@bootlin.com> To: Pratyush Yadav , Michael Walle , Takahiro Kuwano , Richard Weinberger , Vignesh Raghavendra Cc: Thomas Petazzoni , Steam Lin , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Miquel Raynal X-Mailer: b4 0.14.3 X-Last-TLS-Session-Version: TLSv1.3 This chip has correct SFDP support, all fields are correctly filled so we can drop them from the table: $ cat /sys/kernel/debug/spi-nor/spi0.0/params name (null) id ef 70 17 00 00 00 size 8.00 MiB write size 1 page size 256 address nbytes 3 flags HAS_SR_TB | HAS_LOCK | HAS_16BIT_SR | SOFT_RESET | NO_WP opcodes read 0xeb dummy cycles 6 erase 0xd8 program 0x02 8D extension none protocols read 1S-4S-4S write 1S-1S-1S register 1S-1S-1S erase commands 20 (4.00 KiB) [1] 52 (32.0 KiB) [2] d8 (64.0 KiB) [3] c7 (8.00 MiB) sector map region (in hex) | erase mask | overlaid ------------------+------------+--------- 00000000-007fffff | [ 3] | no locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-003fffff | locked | 32 00400000-007fffff | unlocked | 32 $ cat /sys/kernel/debug/spi-nor/spi0.0/capabilities Supported read modes by the flash 1S-1S-1S opcode 0x03 mode cycles 0 dummy cycles 0 1S-1S-2S opcode 0x3b mode cycles 0 dummy cycles 8 1S-2S-2S opcode 0xbb mode cycles 2 dummy cycles 2 1S-1S-4S opcode 0x6b mode cycles 0 dummy cycles 8 1S-4S-4S opcode 0xeb mode cycles 2 dummy cycles 4 4S-4S-4S opcode 0xeb mode cycles 2 dummy cycles 0 Supported page program modes by the flash 1S-1S-1S opcode 0x02 Signed-off-by: Miquel Raynal --- $ cat /sys/bus/spi/devices/spi0.0/spi-nor/jedec_id ef7017 $ cat /sys/bus/spi/devices/spi0.0/spi-nor/manufacturer winbond $ xxd -p /sys/bus/spi/devices/spi0.0/spi-nor/sfdp 53464450050100ff00050110800000ffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffe520f9ffffffff0344eb086b083b42bbfeffffffffff 0000ffff40eb0c200f5210d800003602a60082ea14c4e96376337a757a75 f7a2d55c19f74dffe930f880 $ sha256sum /sys/bus/spi/devices/spi0.0/spi-nor/sfdp ad4c59a94e6205cf237f8734d01ca45d67d34ed35404b364595ff420b6259d32 /sys/bus/= spi/devices/spi0.0/spi-nor/sfdp $ cat /sys/kernel/debug/spi-nor/spi0.0/params name (null) id ef 70 17 00 00 00 size 8.00 MiB write size 1 page size 256 address nbytes 3 flags HAS_SR_TB | HAS_LOCK | HAS_16BIT_SR | SOFT_RESET | NO_WP opcodes read 0xeb dummy cycles 6 erase 0xd8 program 0x02 8D extension none protocols read 1S-4S-4S write 1S-1S-1S register 1S-1S-1S erase commands 20 (4.00 KiB) [1] 52 (32.0 KiB) [2] d8 (64.0 KiB) [3] c7 (8.00 MiB) sector map region (in hex) | erase mask | overlaid ------------------+------------+--------- 00000000-007fffff | [ 3] | no locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-003fffff | locked | 32 00400000-007fffff | unlocked | 32 $ cat /sys/kernel/debug/spi-nor/spi0.0/capabilities Supported read modes by the flash 1S-1S-1S opcode 0x03 mode cycles 0 dummy cycles 0 1S-1S-2S opcode 0x3b mode cycles 0 dummy cycles 8 1S-2S-2S opcode 0xbb mode cycles 2 dummy cycles 2 1S-1S-4S opcode 0x6b mode cycles 0 dummy cycles 8 1S-4S-4S opcode 0xeb mode cycles 2 dummy cycles 4 4S-4S-4S opcode 0xeb mode cycles 2 dummy cycles 0 Supported page program modes by the flash 1S-1S-1S opcode 0x02 --- drivers/mtd/spi-nor/winbond.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/mtd/spi-nor/winbond.c b/drivers/mtd/spi-nor/winbond.c index 51244625b318..6b996897f419 100644 --- a/drivers/mtd/spi-nor/winbond.c +++ b/drivers/mtd/spi-nor/winbond.c @@ -298,9 +298,7 @@ static const struct flash_info winbond_nor_parts[] =3D { }, { /* W25Q64JV-M */ .id =3D SNOR_ID(0xef, 0x70, 0x17), - .size =3D SZ_8M, .flags =3D SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB, - .no_sfdp_flags =3D SECT_4K, }, { /* W25Q128JV-M */ .id =3D SNOR_ID(0xef, 0x70, 0x18), --=20 2.53.0 From nobody Mon Jun 8 11:05:06 2026 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 6CEDD3FCB33 for ; Fri, 29 May 2026 15:23:11 +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=1780068192; cv=none; b=aAO3WuCmayw4YEFDxZRgzNcNjOOFhzCDLI1ec9s5cqyWhPzEp7I9T3Y+dhT495cK/2JmAlYv6NOIKwM1ZFrj4vZyHsipaphWMHMvUuGqCsMJ3DXRKpVFy2qgUK6GdpQT8YvKd+kGYx/bohXraj4NiMfskzCDGq6ecZxpBR6k6eE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780068192; c=relaxed/simple; bh=8Npmls+oRts+301mjqFyeF+z00MNjNJsmWC/MtHBcWY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=n+/JfYBnwv/4JdmkaB1HLaELcvC8kT0BA+jVW95Nn45q3bQZGPufNNCkJTgcsQK4ecPgN/HK8lXm0PeDK3AD5lRURuAdsPSs6GnGjmKWh4h7gg0Ni7BsD/tUeb6P7zpCi/bOozDLJmUnmd7cqLQ23BvRrTlYueJLo5zz3DZUMuE= 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=SrJdJ3Yu; 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="SrJdJ3Yu" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id 101591A373B; Fri, 29 May 2026 15:23:10 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id D9052601FA; Fri, 29 May 2026 15:23:09 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id C2B5010888CE2; Fri, 29 May 2026 17:23:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1780068189; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=FZMxfYBRe1DAoA8o0xAJDtjvumxrdZtF9dw7n5c/Zds=; b=SrJdJ3YuUSvUlNg9I+d7NWywb5WMHjTSR5QTnGhJAwTsF6IZbUvhAaOkQ2aJeqLYx2IPGG Lo+RY3/BIOUk75cvOLd00GIjjbxTaV+5wfNSScWo3/mUU8QsfTn8saHG5YuvcgKLmqscwO eUtxQ1MqTooHUbR965R0FfbCOGcB/7sau2GtHsfMQcenOASdpA+3xdOFDzW9JSI8gMZ58e OTArFAfdzeK3XutzHkkpaX3HXHzmIjo6uJfKZy+4o15eNzsMBvScLGTctUP6Jejry5tIua a2LVTWhDu97y3x15fa2wk0FaWvt8h7ZnDLUawBcgrcca8fGxWnuNj95qca4syw== From: Miquel Raynal Date: Fri, 29 May 2026 17:22:38 +0200 Subject: [PATCH 18/30] mtd: spi-nor: winbond: W25Q128JV-M: Drop redundant data 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: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-18-87e5d3122244@bootlin.com> References: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-0-87e5d3122244@bootlin.com> In-Reply-To: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-0-87e5d3122244@bootlin.com> To: Pratyush Yadav , Michael Walle , Takahiro Kuwano , Richard Weinberger , Vignesh Raghavendra Cc: Thomas Petazzoni , Steam Lin , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Miquel Raynal X-Mailer: b4 0.14.3 X-Last-TLS-Session-Version: TLSv1.3 This chip has correct SFDP support, all fields are correctly filled so we can drop them from the table: $ cat /sys/kernel/debug/spi-nor/spi0.0/params name (null) id ef 70 18 00 00 00 size 16.0 MiB write size 1 page size 256 address nbytes 3 flags HAS_SR_TB | HAS_LOCK | HAS_16BIT_SR | SOFT_RESET | NO_WP opcodes read 0xeb dummy cycles 6 erase 0xd8 program 0x02 8D extension none protocols read 1S-4S-4S write 1S-1S-1S register 1S-1S-1S erase commands 20 (4.00 KiB) [1] 52 (32.0 KiB) [2] d8 (64.0 KiB) [3] c7 (16.0 MiB) sector map region (in hex) | erase mask | overlaid ------------------+------------+--------- 00000000-00ffffff | [ 3] | no locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-00ffffff | unlocked | 64 $ cat /sys/kernel/debug/spi-nor/spi0.0/capabilities Supported read modes by the flash 1S-1S-1S opcode 0x03 mode cycles 0 dummy cycles 0 1S-1S-2S opcode 0x3b mode cycles 0 dummy cycles 8 1S-2S-2S opcode 0xbb mode cycles 2 dummy cycles 2 1S-1S-4S opcode 0x6b mode cycles 0 dummy cycles 8 1S-4S-4S opcode 0xeb mode cycles 2 dummy cycles 4 4S-4S-4S opcode 0xeb mode cycles 2 dummy cycles 0 Supported page program modes by the flash 1S-1S-1S opcode 0x02 Signed-off-by: Miquel Raynal --- + cat /sys/bus/spi/devices/spi0.0/spi-nor/jedec_id ef7018 + cat /sys/bus/spi/devices/spi0.0/spi-nor/manufacturer winbond + xxd -p /sys/bus/spi/devices/spi0.0/spi-nor/sfdp 53464450050100ff00050110800000ffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffe520f9ffffffff0744eb086b083b42bbfeffffffffff 0000ffff40eb0c200f5210d800003602a60082ea14c9e96376337a757a75 f7a2d55c19f74dffe930f880 + sha256sum /sys/bus/spi/devices/spi0.0/spi-nor/sfdp 42d15275dcef0dc920342e2c75d7bc2d20b1ba90579a37dd8bdf9e7bc10ffd94 /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 0x03 mode cycles 0 dummy cycles 0 1S-1S-2S opcode 0x3b mode cycles 0 dummy cycles 8 1S-2S-2S opcode 0xbb mode cycles 2 dummy cycles 2 1S-1S-4S opcode 0x6b mode cycles 0 dummy cycles 8 1S-4S-4S opcode 0xeb mode cycles 2 dummy cycles 4 4S-4S-4S opcode 0xeb mode cycles 2 dummy cycles 0 Supported page program modes by the flash 1S-1S-1S opcode 0x02 + cat /sys/kernel/debug/spi-nor/spi0.0/params name (null) id ef 70 18 00 00 00 size 16.0 MiB write size 1 page size 256 address nbytes 3 flags HAS_SR_TB | HAS_LOCK | HAS_16BIT_SR | SOFT_RESET | NO_WP opcodes read 0xeb dummy cycles 6 erase 0xd8 program 0x02 8D extension none protocols read 1S-4S-4S write 1S-1S-1S register 1S-1S-1S erase commands 20 (4.00 KiB) [1] 52 (32.0 KiB) [2] d8 (64.0 KiB) [3] c7 (16.0 MiB) sector map region (in hex) | erase mask | overlaid ------------------+------------+--------- 00000000-00ffffff | [ 3] | no locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-00ffffff | unlocked | 64 + 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_read spi_test 5ca640e6e1097c52d196add2de1f770834dc6cf9e4b1b660fd3586d6eb2ea0f1 spi_read 5ca640e6e1097c52d196add2de1f770834dc6cf9e4b1b660fd3586d6eb2ea0f1 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_read spi_test 4bda3a28f4ffe603c0ec1258c0034d65a1a0d35ab7bd523a834608adabf03cc5 spi_read 5ca640e6e1097c52d196add2de1f770834dc6cf9e4b1b660fd3586d6eb2ea0f1 spi_test + mtd_debug info /dev/mtd0 mtd.type =3D MTD_NORFLASH mtd.flags =3D MTD_CAP_NORFLASH mtd.size =3D 16777216 (16M) mtd.erasesize =3D 65536 (64K) mtd.writesize =3D 1 mtd.oobsize =3D 0 regions =3D 0 --- drivers/mtd/spi-nor/winbond.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/mtd/spi-nor/winbond.c b/drivers/mtd/spi-nor/winbond.c index 6b996897f419..78a31e71d3f1 100644 --- a/drivers/mtd/spi-nor/winbond.c +++ b/drivers/mtd/spi-nor/winbond.c @@ -302,9 +302,7 @@ static const struct flash_info winbond_nor_parts[] =3D { }, { /* W25Q128JV-M */ .id =3D SNOR_ID(0xef, 0x70, 0x18), - .size =3D SZ_16M, .flags =3D SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB, - .no_sfdp_flags =3D SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ, }, { /* W25Q256JV-M */ .id =3D SNOR_ID(0xef, 0x70, 0x19), --=20 2.53.0 From nobody Mon Jun 8 11:05:06 2026 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 E56F23FDC0A for ; Fri, 29 May 2026 15:23:12 +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=1780068194; cv=none; b=lifVZch/bClNvHrwGA+uh0SuEfzZB1sBDd4Bl6J7mQ1ctVcquqNLZi4ekcjceAZ6OvhQFxXthwVY1RWw57fTFG0oAbmai4wIo0QQ2iutSRWPjeDjwDVxgIF9h9eCvnquD/wtFdlEMrbHuyz5UNd+QGczZeudngtIZOgSDXwTYpg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780068194; c=relaxed/simple; bh=g3XDS4j2MS2/NZyLqrQW35GmRd/lSGmNTPm5MzXDZ+M=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=mLaPfyo767YfzFvzWA0WIQTQg2HnVSztSJPwz77jq9Gh8SOXKRrXxeDSk8vMEtYCmxFvyEEdlRmKLfCtwC973+rgUc84U1iecPpzQQV/YtM4NPoJ9znWPCvxpX07eezeQTu8Rd00JRvS0gFpcFD/P4BV0qVijYV6N45DMbnqfQs= 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=IX9kFRUX; 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="IX9kFRUX" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id 816B2C6245E; Fri, 29 May 2026 15:23:12 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id C6852601FA; Fri, 29 May 2026 15:23:11 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 7D90D10888CC5; Fri, 29 May 2026 17:23:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1780068191; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=+5qy+Wx8CuCVygHaFLnoRc3bI1wnl8rQeTR5ZK1q+LI=; b=IX9kFRUXqa2/+7ncT+IrgXCPUKWnM8ZxT9ejZBgTVKylJsbArlnJ0N7E8CIiePLVJuKIp0 yOJm2+wyeWShTfEJl0ddhuT72Mrd7erIXm6Lg1fzsWtCj5n6SbZbTwRUNxgSi2QjocMVJE zyvdiB0vj8axh/qzh4eSnyZ3E5fDmwpgpv8uU8iB+wM2rB/cquLBxCG7tiRx+4rf/O8sdk jBU+bWddKoYts/EMLGPK9rTicpOhQ9cFrUo5Lrv4cl6yUQT72cFNevyzIc1bSlasLUP8X7 VEa2O3tyeaVEElbkztEti3NVN7eCitCL5ZK4AlzyD6TNbDMiB/vl/3YPFak1Mw== From: Miquel Raynal Date: Fri, 29 May 2026 17:22:39 +0200 Subject: [PATCH 19/30] mtd: spi-nor: winbond: W25Q32JV-M: Add quad page program capability 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: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-19-87e5d3122244@bootlin.com> References: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-0-87e5d3122244@bootlin.com> In-Reply-To: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-0-87e5d3122244@bootlin.com> To: Pratyush Yadav , Michael Walle , Takahiro Kuwano , Richard Weinberger , Vignesh Raghavendra Cc: Thomas Petazzoni , Steam Lin , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Miquel Raynal X-Mailer: b4 0.14.3 X-Last-TLS-Session-Version: TLSv1.3 This chip does not advertise it correctly but it supports 1-1-4 page programs. Before: $ flash_speed /dev/mtd0 -d -c10 eraseblock write speed is 2612 KiB/s page write speed is 2509 KiB/s 2 page write speed is 2560 KiB/s After: $ flash_speed /dev/mtd0 -c10 -d eraseblock write speed is 3033 KiB/s page write speed is 2895 KiB/s 2 page write speed is 2976 KiB/s Signed-off-by: Miquel Raynal --- drivers/mtd/spi-nor/winbond.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mtd/spi-nor/winbond.c b/drivers/mtd/spi-nor/winbond.c index 78a31e71d3f1..7286d50b0c53 100644 --- a/drivers/mtd/spi-nor/winbond.c +++ b/drivers/mtd/spi-nor/winbond.c @@ -294,7 +294,7 @@ static const struct flash_info winbond_nor_parts[] =3D { }, { /* W25Q32JV-M */ .id =3D SNOR_ID(0xef, 0x70, 0x16), - .flags =3D SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB, + .flags =3D SPI_NOR_QUAD_PP | SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB, }, { /* W25Q64JV-M */ .id =3D SNOR_ID(0xef, 0x70, 0x17), --=20 2.53.0 From nobody Mon Jun 8 11:05:06 2026 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 C76C63FE674 for ; Fri, 29 May 2026 15:23:14 +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=1780068196; cv=none; b=pkvGypJlc37jORyCxHG4B+YBpnK3LA900GvfqTMvbf+pGwJsB6y/ziP2wB3wLl+/YCd6rBWcMwfvgrCXtUHJezs88FIF1SGqUxUQUaVByutY8FhRgHIxFXXy+whmB8PtooqLvCo0/tHzycQ/PyRccSbyohDsNj4cEbK/iZaKyyQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780068196; c=relaxed/simple; bh=ISyxDAeoSmHLwlXv01IGxoe+pFF2DGJJtqDminUN/fI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=EtHFmNs4oZVmBCj28iI7EzqwdZVmDmSAaTIMuaX6PUxQ39vkZmmWVTL097+d0U4avn6fgb8J5IAlO8jaM+qHWLyH6Zit3+yY3s6W1oiBXyplF+Phd0oX5t2LROf1UjARmuljYVBF6ZpaHSSR3YEAxdmreeqwlEVOkEHkQ0p4Dvc= 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=wfnCZraz; 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="wfnCZraz" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id 8084B4E42D8C; Fri, 29 May 2026 15:23:13 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 5724E601FA; Fri, 29 May 2026 15:23:13 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 57F3910888CC6; Fri, 29 May 2026 17:23:11 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1780068192; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=96aW/BDfkWbXKkmDS7E6FScicE34ZCz/baGTVqGIQOI=; b=wfnCZrazZMyokNzyzLJDzlLAj1gC4M2rCwp2hBFzQm6FXeXGeFaneastvicMMQLQGYODQP XsQms9NTZ1SVsDhjk889dKQepom2BYLxxlokadT76p0OnlE1lHdFE+W1xWF0DDAw+oxkLu deSXfNO0lMRPcPxS7MMdTZA5LFwwjHcnpV7vxa973nIqkOepjH4HNwcrQSKLSXLOoeysz+ FIndgu+gaZsu1gRoky7bOGuAocAfjsf6B4B0IUn836E4plfRABx6Ty6cgCsfnJryGzGWWM c+845Hn9gNMXHHHpO6NypjKpymhjm7Yq30e4VgD91UlwVBJ1NfmpobdNQbcpRw== From: Miquel Raynal Date: Fri, 29 May 2026 17:22:40 +0200 Subject: [PATCH 20/30] mtd: spi-nor: winbond: W25Q64JV-M: Add quad page program capability 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: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-20-87e5d3122244@bootlin.com> References: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-0-87e5d3122244@bootlin.com> In-Reply-To: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-0-87e5d3122244@bootlin.com> To: Pratyush Yadav , Michael Walle , Takahiro Kuwano , Richard Weinberger , Vignesh Raghavendra Cc: Thomas Petazzoni , Steam Lin , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Miquel Raynal X-Mailer: b4 0.14.3 X-Last-TLS-Session-Version: TLSv1.3 The benefit is massive @25MHz, but the chip does not implement the 4BAIT table to advertize this capability, so enable it manually:. Before: $ flash_speed /dev/mtd0 -dc10 eraseblock write speed is 558 KiB/s page write speed is 553 KiB/s 2 page write speed is 555 KiB/s After: $ flash_speed /dev/mtd0 -dc10 eraseblock write speed is 3047 KiB/s page write speed is 2909 KiB/s 2 page write speed is 2976 KiB/s Signed-off-by: Miquel Raynal --- $ cat /sys/kernel/debug/spi-nor/spi0.0/params name (null) id ef 70 17 00 00 00 size 8.00 MiB write size 1 page size 256 address nbytes 3 flags HAS_SR_TB | HAS_LOCK | HAS_16BIT_SR | SOFT_RESET | NO_WP opcodes read 0xeb dummy cycles 6 erase 0xd8 program 0x32 8D extension none protocols read 1S-4S-4S write 1S-1S-4S register 1S-1S-1S erase commands 20 (4.00 KiB) [1] 52 (32.0 KiB) [2] d8 (64.0 KiB) [3] c7 (8.00 MiB) sector map region (in hex) | erase mask | overlaid ------------------+------------+--------- 00000000-007fffff | [ 3] | no locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-007fffff | unlocked | 64 $ cat /sys/kernel/debug/spi-nor/spi0.0/capabilities Supported read modes by the flash 1S-1S-1S opcode 0x03 mode cycles 0 dummy cycles 0 1S-1S-2S opcode 0x3b mode cycles 0 dummy cycles 8 1S-2S-2S opcode 0xbb mode cycles 2 dummy cycles 2 1S-1S-4S opcode 0x6b mode cycles 0 dummy cycles 8 1S-4S-4S opcode 0xeb mode cycles 2 dummy cycles 4 4S-4S-4S opcode 0xeb mode cycles 2 dummy cycles 0 Supported page program modes by the flash 1S-1S-1S opcode 0x02 1S-1S-4S opcode 0x32 $ 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 mtd_debug read /dev/mtd0 0 2097152 spi_read 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* d79c3f7b40646d437eff15309c5250e8ee203f805b9d13d8ad8a7019f0dd69f8 spi_read d79c3f7b40646d437eff15309c5250e8ee203f805b9d13d8ad8a7019f0dd69f8 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 d79c3f7b40646d437eff15309c5250e8ee203f805b9d13d8ad8a7019f0dd69f8 spi_test --- drivers/mtd/spi-nor/winbond.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mtd/spi-nor/winbond.c b/drivers/mtd/spi-nor/winbond.c index 7286d50b0c53..3715e269cb7f 100644 --- a/drivers/mtd/spi-nor/winbond.c +++ b/drivers/mtd/spi-nor/winbond.c @@ -298,7 +298,7 @@ static const struct flash_info winbond_nor_parts[] =3D { }, { /* W25Q64JV-M */ .id =3D SNOR_ID(0xef, 0x70, 0x17), - .flags =3D SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB, + .flags =3D SPI_NOR_QUAD_PP | SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB, }, { /* W25Q128JV-M */ .id =3D SNOR_ID(0xef, 0x70, 0x18), --=20 2.53.0 From nobody Mon Jun 8 11:05:06 2026 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 2707F3BE15E for ; Fri, 29 May 2026 15:23:16 +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=1780068197; cv=none; b=cKZyvWGuKLrPosmFaORKzJiMpgwm6CdtI+ciuGE1wpuqohcidaRzu2fNu7nZ9nM5IjOaqpj/S9OXIFOjiC9DtHwNC/DrWsXWYPz76pcwSAmqfjD9kd31zFvPHM/KvexObevIMbhEuWlv1vbFJeY4pgZ5fDMYCmw+Baiv8UCVmR0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780068197; c=relaxed/simple; bh=jRpCfH5KDwUSiGWumieZjSc6H6Zqz8iDAiR/6l4jcj0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=OIRjar4v1XGcrs0HYD88gp0RrblHQQPqmEySby8b6lXWUxTku8yne1TAnzs16S7snHBY9xYFS0DJ7+WkzID5yMML6DAIAln1Sr05ZzeRle6b0ijaJXQy0bQZq6HW+O1O74pv8yL9mg1s+MxZroymTcK2sU4PkMPk+mEuDYn14MA= 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=O/PWxj4U; 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="O/PWxj4U" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id 1616E1A373B; Fri, 29 May 2026 15:23:15 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id DED9C601FA; Fri, 29 May 2026 15:23:14 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 1032710888CCE; Fri, 29 May 2026 17:23:12 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1780068194; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=e7PYvw/mcdWD1pSzU5NrKhgjpHMePQN/D/onC8gCFqM=; b=O/PWxj4UA+LPsaoauxl4TeiTvRZMohyVEVHApY0skxaSj6Trl9BQSltShW2sZWh69YhDUK mkGQq6eVlWT+6/i/smbWW344cI/DmhprK8tvALhZ6okUAlKYr8Xj4en0nNsS+by2MkKenE nDMNmSNNfS8kabhAT9OdnJm/39IGtaBEy/zk8+2DQNOPmcwDKpPj45pFDiwOBjCq9ITg91 sf8HW6gZ+TNNAcjZckIny1IdDyOGCe74FEXTz1YQbfn7ay5JDo0aah3ZGTUL92vspzjjy2 kXJYmf/QiiHmP3Znb+MJZEz9/vEyxeGcNg8iLUT+hF4VOTUng0uneNk9NZUzSg== From: Miquel Raynal Date: Fri, 29 May 2026 17:22:41 +0200 Subject: [PATCH 21/30] mtd: spi-nor: winbond: W25Q128JV-M: Add quad page program capability 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: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-21-87e5d3122244@bootlin.com> References: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-0-87e5d3122244@bootlin.com> In-Reply-To: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-0-87e5d3122244@bootlin.com> To: Pratyush Yadav , Michael Walle , Takahiro Kuwano , Richard Weinberger , Vignesh Raghavendra Cc: Thomas Petazzoni , Steam Lin , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Miquel Raynal X-Mailer: b4 0.14.3 X-Last-TLS-Session-Version: TLSv1.3 This chip does not advertise it correctly but it supports 1-1-4 page programs, add the flag manually: Before: $ flash_speed /dev/mtd0 -d -c10 eraseblock write speed is 553 KiB/s page write speed is 548 KiB/s 2 page write speed is 550 KiB/s After: $ flash_speed /dev/mtd0 -c10 -d eraseblock write speed is 1628 KiB/s page write speed is 1600 KiB/s 2 page write speed is 1612 KiB/s Signed-off-by: Miquel Raynal --- + 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_read spi_test e30cacd4f9d230b2fc4ae12851797332d9baf8456520872161f79379c80ea2b0 spi_read e30cacd4f9d230b2fc4ae12851797332d9baf8456520872161f79379c80ea2b0 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_read spi_test 4bda3a28f4ffe603c0ec1258c0034d65a1a0d35ab7bd523a834608adabf03cc5 spi_read e30cacd4f9d230b2fc4ae12851797332d9baf8456520872161f79379c80ea2b0 spi_test --- drivers/mtd/spi-nor/winbond.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mtd/spi-nor/winbond.c b/drivers/mtd/spi-nor/winbond.c index 3715e269cb7f..695e1b2fddf5 100644 --- a/drivers/mtd/spi-nor/winbond.c +++ b/drivers/mtd/spi-nor/winbond.c @@ -302,7 +302,7 @@ static const struct flash_info winbond_nor_parts[] =3D { }, { /* W25Q128JV-M */ .id =3D SNOR_ID(0xef, 0x70, 0x18), - .flags =3D SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB, + .flags =3D SPI_NOR_QUAD_PP | SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB, }, { /* W25Q256JV-M */ .id =3D SNOR_ID(0xef, 0x70, 0x19), --=20 2.53.0 From nobody Mon Jun 8 11:05:06 2026 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 0A0E4400DF8 for ; Fri, 29 May 2026 15:23:17 +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=1780068199; cv=none; b=jec0R9VJF802BzIKwFlBzaorTfu/jIFYMQVZbnfNJRGYBlXlWMAoGuF0XCSgc274fBsyfL3V7kiqmkbN3x662PoNmFF4YylgWybA2uYqpmBFYnHhva+eCsUTI7TKUMTBdtqZotv12xf37vhyrJaMVGwdY01L2NYdzcAEOUbbbf4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780068199; c=relaxed/simple; bh=W6rhaD+izrElq5AR8LUVXnSFw74G5bGPe51n9yAZK9g=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=lHFW9ORog27itb3p6z2ghlm7rdJtZt8/ErjviR5I2GbmS+HQnCamDewsXGUrgJbaybMONSNwP4RM6QIB/HL7NJVjvWlSshFBPjkSVVY+L8J25IlnKLNmmi3nZIHN4kR5DpKS6TKGwi+DxsEAuVvfHT3dhD1jDSIgt5NLmcPmHVI= 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=oaAvNtfg; 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="oaAvNtfg" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id BA8F54E42D8C for ; Fri, 29 May 2026 15:23:16 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 90C22601FA; Fri, 29 May 2026 15:23:16 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 724AC10888CD5; Fri, 29 May 2026 17:23:14 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1780068195; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=SDvokfTIPWUatqs0QzMoAwfRl2Y0zLuzitRT1hbf4nU=; b=oaAvNtfgKv+pFa/gQYMNh6pqkmS6Ei7lv2ouND3ySFUFOIJup5SwYcoHgiHGjw14kCvn5W QaW8JUBsb8OKMob5JiUdneC9GiFZvWGYQh9yudyOTbYMZgG0518vtgMN/D4+QE8+gpwHoW uvYebwKiB+zL8TJEAgnNmc34rf0pOAeDRknRoATahmucqFLQyd78ihIxA3E3FEeborap0j u8QhdMDu+mpvqRqgC01fqRD8BLXHQphRiaolP/WQaPP/2IqtmPc1JuYBQf9e+z3ZwJS/oC 7UhnUWM4sfoW1xaAgyFCmV8+zfE6F+gQ99wKMLtRm2E5JTWJfDF1ddmiOQmVxQ== From: Miquel Raynal Date: Fri, 29 May 2026 17:22:42 +0200 Subject: [PATCH 22/30] mtd: spi-nor: winbond: W25Q32JV-M: Fill locking information 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: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-22-87e5d3122244@bootlin.com> References: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-0-87e5d3122244@bootlin.com> In-Reply-To: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-0-87e5d3122244@bootlin.com> To: Pratyush Yadav , Michael Walle , Takahiro Kuwano , Richard Weinberger , Vignesh Raghavendra Cc: Thomas Petazzoni , Steam Lin , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Miquel Raynal X-Mailer: b4 0.14.3 X-Last-TLS-Session-Version: TLSv1.3 The SFDP table does not advertize the locking capabilities of the device, flag the missing CMP capability. Signed-off-by: Miquel Raynal --- + dd 'if=3D/dev/urandom' 'of=3D./spi_test' 'bs=3D1M' 'count=3D2' [ 34.621251] random: crng init done 2+0 records in 2+0 records out + alias 'show_sectors=3Dgrep -A4 "locked sectors" /sys/kernel/debug/spi-nor= /spi0.0/params' + flash_lock -u /dev/mtd0 + flash_lock -i /dev/mtd0 Device: /dev/mtd0 Start: 0 Len: 0x400000 Lock status: unlocked Return code: 0 + mtd_debug erase /dev/mtd0 0 2097152 Erased 2097152 bytes from address 0x00000000 in flash + 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_read spi_test a3d9042b2e8085f39ebdefbabee5d3bc8baed5217f2a51510bd523db1b147395 spi_read a3d9042b2e8085f39ebdefbabee5d3bc8baed5217f2a51510bd523db1b147395 spi_test + grep -A4 'locked sectors' /sys/kernel/debug/spi-nor/spi0.0/params locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-003fffff | unlocked | 64 + flash_lock -l /dev/mtd0 + flash_lock -i /dev/mtd0 Device: /dev/mtd0 Start: 0 Len: 0x400000 Lock status: locked Return code: 1 + 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_read spi_test a3d9042b2e8085f39ebdefbabee5d3bc8baed5217f2a51510bd523db1b147395 spi_read a3d9042b2e8085f39ebdefbabee5d3bc8baed5217f2a51510bd523db1b147395 spi_test + dd 'if=3D/dev/urandom' 'of=3D./spi_test2' 'bs=3D1M' 'count=3D2' 2+0 records in 2+0 records out + mtd_debug write /dev/mtd0 0 2097152 spi_test2 Copied 2097152 bytes from spi_test2 to address 0x00000000 in flash + mtd_debug read /dev/mtd0 0 2097152 spi_read2 Copied 2097152 bytes from address 0x00000000 in flash to spi_read2 + sha256sum spi_read spi_read2 spi_test spi_test2 a3d9042b2e8085f39ebdefbabee5d3bc8baed5217f2a51510bd523db1b147395 spi_read a3d9042b2e8085f39ebdefbabee5d3bc8baed5217f2a51510bd523db1b147395 spi_read2 a3d9042b2e8085f39ebdefbabee5d3bc8baed5217f2a51510bd523db1b147395 spi_test bcf94096d25ce535e4b920f876d53420e6d8d917d0d14dd766b5f8c3d6f40475 spi_test2 + grep -A4 'locked sectors' /sys/kernel/debug/spi-nor/spi0.0/params locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-003fffff | locked | 64 + flash_lock -u /dev/mtd0 + cat /sys/class/mtd/mtd0/size + size=3D4194304 + cat /sys/class/mtd/mtd0/erasesize + bs=3D65536 + grep unlocked /sys/kernel/debug/spi-nor/spi0.0/params + sed -e 's/.*unlocked | //' + nsectors=3D64 + ss=3D65536 + bps=3D1 + flash_lock -u /dev/mtd0 + flash_lock -l /dev/mtd0 4063232 2 + grep -A4 'locked sectors' /sys/kernel/debug/spi-nor/spi0.0/params locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-003dffff | unlocked | 62 003e0000-003fffff | locked | 2 + flash_lock -u /dev/mtd0 4063232 1 + grep -A4 'locked sectors' /sys/kernel/debug/spi-nor/spi0.0/params locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-003effff | unlocked | 63 003f0000-003fffff | locked | 1 /* Skipping BP3 test */ + flash_lock -u /dev/mtd0 + flash_lock -l /dev/mtd0 0 2 + grep -A4 'locked sectors' /sys/kernel/debug/spi-nor/spi0.0/params locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-0001ffff | locked | 2 00020000-003fffff | unlocked | 62 + flash_lock -u /dev/mtd0 65536 1 + grep -A4 'locked sectors' /sys/kernel/debug/spi-nor/spi0.0/params locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-0000ffff | locked | 1 00010000-003fffff | unlocked | 63 + all_but_one=3D63 + flash_lock -u /dev/mtd0 + flash_lock -l /dev/mtd0 65536 63 + grep -A4 'locked sectors' /sys/kernel/debug/spi-nor/spi0.0/params locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-0000ffff | unlocked | 1 00010000-003fffff | locked | 63 + flash_lock -u /dev/mtd0 65536 1 + grep -A4 'locked sectors' /sys/kernel/debug/spi-nor/spi0.0/params locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-0001ffff | unlocked | 2 00020000-003fffff | locked | 62 + flash_lock -u /dev/mtd0 + flash_lock -l /dev/mtd0 0 63 + grep -A4 'locked sectors' /sys/kernel/debug/spi-nor/spi0.0/params locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-003effff | locked | 63 003f0000-003fffff | unlocked | 1 + flash_lock -u /dev/mtd0 4063232 1 + grep -A4 'locked sectors' /sys/kernel/debug/spi-nor/spi0.0/params locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-003dffff | locked | 62 003e0000-003fffff | unlocked | 2 --- drivers/mtd/spi-nor/winbond.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mtd/spi-nor/winbond.c b/drivers/mtd/spi-nor/winbond.c index 695e1b2fddf5..524ef7b00257 100644 --- a/drivers/mtd/spi-nor/winbond.c +++ b/drivers/mtd/spi-nor/winbond.c @@ -294,7 +294,7 @@ static const struct flash_info winbond_nor_parts[] =3D { }, { /* W25Q32JV-M */ .id =3D SNOR_ID(0xef, 0x70, 0x16), - .flags =3D SPI_NOR_QUAD_PP | SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB, + .flags =3D SPI_NOR_QUAD_PP | SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB | SPI_NOR= _HAS_CMP, }, { /* W25Q64JV-M */ .id =3D SNOR_ID(0xef, 0x70, 0x17), --=20 2.53.0 From nobody Mon Jun 8 11:05:06 2026 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 5533B401A10 for ; Fri, 29 May 2026 15:23:19 +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=1780068200; cv=none; b=aymPALXZxxiEvtzMpspvUnJQKyLLhU0MNubIl23/UUtCw8eZNnfYRwjABTiD5dQk0j+lOle/btxMnJMA6ObHE9ISfEogMQ04A3vj/p0+8xZ+oHsfKmCS2dA1Fx3foqxvVJowSU1Prs7abap3q2DyOVrQh33DxV/klAsJs+/AtHY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780068200; c=relaxed/simple; bh=eaXFptTsWOvtPnky2PozQmUJRYF5XqBy9dPi633sBco=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Cq7kGxfNViRvJD3OUZmEa9Oa+wUlpZTM9T+HynG3rRsUZiVPpw+wqUhVLzO8hMcUMmEF+ZQrgscHwBQ+hDN5SqCwoNrd1uVnZikSTgSkiI2kRdnyQTC/JW2eqC1vOFsJocilC0SjFkW/BcRjhu+qL3cC3Fg33Er7aDprOz3rh80= 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=l98JxSK8; 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="l98JxSK8" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id 39B974E42D90 for ; Fri, 29 May 2026 15:23:18 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 09FF0601FA; Fri, 29 May 2026 15:23:18 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 1F54D10888CD8; Fri, 29 May 2026 17:23:16 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1780068197; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=mJNkTkWvjTYpVPywgnrDgahdfFL22QDrgsNKflW4bh4=; b=l98JxSK8NTPKeicl5xJtthMWf6Y+fCczHBN068WGvgdEVSWyd92EpgcHJWD2HqNWw2LiJi dPqc0phMX4Az6nt9K7hRqrdtGZUAghRbDlE440GEP/uQDoVIkiItkz/qVGQxX1J0UlH5WG y0FkB2TlqZvfmpZCDURd1E2KyOrIY1BIHjPRaCz3IYzAV7fCYAxDk2sgKArI3dLXhn/Ek/ 1cJjIViWd8O4g5MvDr42WifUk9PhrdpmyyQYrK8v+PamDopsQ78gqtIUUMQRaI+PmqKwyg pCzRZzrRdS4ObtTvIgnNYfpx25Dju1oXSEVn0PFMOeMcJV/hJtm2JQL/WiQGaQ== From: Miquel Raynal Date: Fri, 29 May 2026 17:22:43 +0200 Subject: [PATCH 23/30] mtd: spi-nor: winbond: W25Q64JV-M: Fill locking information 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: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-23-87e5d3122244@bootlin.com> References: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-0-87e5d3122244@bootlin.com> In-Reply-To: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-0-87e5d3122244@bootlin.com> To: Pratyush Yadav , Michael Walle , Takahiro Kuwano , Richard Weinberger , Vignesh Raghavendra Cc: Thomas Petazzoni , Steam Lin , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Miquel Raynal X-Mailer: b4 0.14.3 X-Last-TLS-Session-Version: TLSv1.3 The SFDP table does not advertize the locking capabilities of the device, flag these capabilities. Signed-off-by: Miquel Raynal --- + dd 'if=3D/dev/urandom' 'of=3D./spi_test' 'bs=3D1M' 'count=3D2' 2+0 records in 2+0 records out + alias 'show_sectors=3Dgrep -A4 "locked sectors" /sys/kernel/debug/spi-nor= /spi0.0/params' + flash_lock -u /dev/mtd0 + flash_lock -i /dev/mtd0 Device: /dev/mtd0 Start: 0 Len: 0x800000 Lock status: unlocked Return code: 0 + mtd_debug erase /dev/mtd0 0 2097152 Erased 2097152 bytes from address 0x00000000 in flash + 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_read spi_test f358338956920defcf811679166ade6f25eeee00abe29dda49932536591fb4d1 spi_read f358338956920defcf811679166ade6f25eeee00abe29dda49932536591fb4d1 spi_test + grep -A4 'locked sectors' /sys/kernel/debug/spi-nor/spi0.0/params locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-007fffff | unlocked | 64 + flash_lock -l /dev/mtd0 + flash_lock -i /dev/mtd0 Device: /dev/mtd0 Start: 0 Len: 0x800000 Lock status: locked Return code: 1 + 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_read spi_test f358338956920defcf811679166ade6f25eeee00abe29dda49932536591fb4d1 spi_read f358338956920defcf811679166ade6f25eeee00abe29dda49932536591fb4d1 spi_test + dd 'if=3D/dev/urandom' 'of=3D./spi_test2' 'bs=3D1M' 'count=3D2' 2+0 records in 2+0 records out + mtd_debug write /dev/mtd0 0 2097152 spi_test2 Copied 2097152 bytes from spi_test2 to address 0x00000000 in flash + mtd_debug read /dev/mtd0 0 2097152 spi_read2 Copied 2097152 bytes from address 0x00000000 in flash to spi_read2 + sha256sum spi_read spi_read2 spi_test spi_test2 f358338956920defcf811679166ade6f25eeee00abe29dda49932536591fb4d1 spi_read f358338956920defcf811679166ade6f25eeee00abe29dda49932536591fb4d1 spi_read2 f358338956920defcf811679166ade6f25eeee00abe29dda49932536591fb4d1 spi_test 6ba881af6f5901f7ca55322d45a7cee2ec69900cfdfc348141c3c5b1e51f676b spi_test2 + grep -A4 'locked sectors' /sys/kernel/debug/spi-nor/spi0.0/params locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-007fffff | locked | 64 + flash_lock -u /dev/mtd0 + cat /sys/class/mtd/mtd0/size + size=3D8388608 + cat /sys/class/mtd/mtd0/erasesize + bs=3D65536 + grep unlocked /sys/kernel/debug/spi-nor/spi0.0/params + sed -e 's/.*unlocked | //' + nsectors=3D64 + ss=3D131072 + bps=3D2 + flash_lock -u /dev/mtd0 + flash_lock -l /dev/mtd0 8126464 4 + grep -A4 'locked sectors' /sys/kernel/debug/spi-nor/spi0.0/params locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-007bffff | unlocked | 62 007c0000-007fffff | locked | 2 + flash_lock -u /dev/mtd0 8126464 2 + grep -A4 'locked sectors' /sys/kernel/debug/spi-nor/spi0.0/params locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-007dffff | unlocked | 63 007e0000-007fffff | locked | 1 /* Skipping BP3 test */ + flash_lock -u /dev/mtd0 + flash_lock -l /dev/mtd0 0 4 + grep -A4 'locked sectors' /sys/kernel/debug/spi-nor/spi0.0/params locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-0003ffff | locked | 2 00040000-007fffff | unlocked | 62 + flash_lock -u /dev/mtd0 131072 2 + grep -A4 'locked sectors' /sys/kernel/debug/spi-nor/spi0.0/params locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-0001ffff | locked | 1 00020000-007fffff | unlocked | 63 + all_but_one=3D126 + flash_lock -u /dev/mtd0 + flash_lock -l /dev/mtd0 131072 126 + grep -A4 'locked sectors' /sys/kernel/debug/spi-nor/spi0.0/params locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-0001ffff | unlocked | 1 00020000-007fffff | locked | 63 + flash_lock -u /dev/mtd0 131072 2 + grep -A4 'locked sectors' /sys/kernel/debug/spi-nor/spi0.0/params locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-0003ffff | unlocked | 2 00040000-007fffff | locked | 62 + flash_lock -u /dev/mtd0 + flash_lock -l /dev/mtd0 0 126 + grep -A4 'locked sectors' /sys/kernel/debug/spi-nor/spi0.0/params locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-007dffff | locked | 63 007e0000-007fffff | unlocked | 1 + flash_lock -u /dev/mtd0 8126464 2 + grep -A4 'locked sectors' /sys/kernel/debug/spi-nor/spi0.0/params locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-007bffff | locked | 62 007c0000-007fffff | unlocked | 2 --- drivers/mtd/spi-nor/winbond.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mtd/spi-nor/winbond.c b/drivers/mtd/spi-nor/winbond.c index 524ef7b00257..dc04a3c9d660 100644 --- a/drivers/mtd/spi-nor/winbond.c +++ b/drivers/mtd/spi-nor/winbond.c @@ -298,7 +298,7 @@ static const struct flash_info winbond_nor_parts[] =3D { }, { /* W25Q64JV-M */ .id =3D SNOR_ID(0xef, 0x70, 0x17), - .flags =3D SPI_NOR_QUAD_PP | SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB, + .flags =3D SPI_NOR_QUAD_PP | SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB | SPI_NOR= _HAS_CMP, }, { /* W25Q128JV-M */ .id =3D SNOR_ID(0xef, 0x70, 0x18), --=20 2.53.0 From nobody Mon Jun 8 11:05:06 2026 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 010DE4028E6 for ; Fri, 29 May 2026 15:23:20 +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=1780068202; cv=none; b=DfE6+eX/RpT35ZZQ6qjvsafUmsPuDiLvRDQ62owRA3jGijqmtrL3lcxhB8KhEP5FuvtCFCHW2D6Nuw5kH+vsroF1AGR3QKOE19sMRgihbxzefay209mUGVMVW6/Nwf8Niy2NgwZcXrWqHygXGxEALYYleXIil/zpzF8G9yEX4CE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780068202; c=relaxed/simple; bh=Km1e3YPwvQk5g/FR2d7cfcaN14Xg4z+jGpAzFrL9bes=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=kJfB/ShqAmY4mAZjGg7WA5sKmCWvbSyy7747Z0BpafJDntW4IlCgYRaOHoE9mbRS59quyjrBqOYkiYDAzfrom28SjDdqktO0MXlTyazVW23HrRV61L0pKyuMr8JAzOWhOt9SJWZQGw5SFUDGlsqn8egjSPyIF9aNecgKMta8SGU= 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=vf0GIlc6; 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="vf0GIlc6" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id B7C704E42D8C; Fri, 29 May 2026 15:23:19 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 8DBE7601FA; Fri, 29 May 2026 15:23:19 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id B227010888CDA; Fri, 29 May 2026 17:23:17 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1780068198; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=znK1XEoQRu+oJbhZU2Kyirmad337y+Uw/DU1VT27AV0=; b=vf0GIlc6m7Bkas6g9Kv+hjktEw95jPWm8+VbhhxelRyMLlE1KGqWSCg11k4iV5tpaNA2BP TPudXi44xT4Yi9ODcHnrLyIGyZhiW8jJcChNHKU2o6Yw3OrzlSc0o1vfU3T3WZIamu3e/K v84F1SG0J6Lr2cPWqVZd9CJ9e7qZRn3pZCo0FuqelolKJJpAyRnHGrRDdxJXdbaXz8D5+F k+TqOBnwSg0LVXRWxCgSvtNEI7ph9OrOdBPrA8LjB5vMsXR7kEicoU9/Ldi7ONhzVIBpkW 6I3655EQkqbUtGQDTXDnXbcZUSK0lYMcPIGeEvE5vmoTOFHP3wXK1DAdFB83DA== From: Miquel Raynal Date: Fri, 29 May 2026 17:22:44 +0200 Subject: [PATCH 24/30] mtd: spi-nor: winbond: W25Q128JV-M: Fill locking information 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: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-24-87e5d3122244@bootlin.com> References: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-0-87e5d3122244@bootlin.com> In-Reply-To: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-0-87e5d3122244@bootlin.com> To: Pratyush Yadav , Michael Walle , Takahiro Kuwano , Richard Weinberger , Vignesh Raghavendra Cc: Thomas Petazzoni , Steam Lin , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Miquel Raynal X-Mailer: b4 0.14.3 X-Last-TLS-Session-Version: TLSv1.3 The SFDP table does not advertize the locking capabilities of the device, flag these capabilities. Signed-off-by: Miquel Raynal --- + alias 'show_sectors=3Dgrep -A4 "locked sectors" /sys/kernel/debug/spi-nor= /spi0.0/params' + flash_lock -u /dev/mtd0 + flash_lock -i /dev/mtd0 Device: /dev/mtd0 Start: 0 Len: 0x1000000 Lock status: unlocked Return code: 0 + mtd_debug erase /dev/mtd0 0 2097152 Erased 2097152 bytes from address 0x00000000 in flash + 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_read spi_test e30cacd4f9d230b2fc4ae12851797332d9baf8456520872161f79379c80ea2b0 spi_read e30cacd4f9d230b2fc4ae12851797332d9baf8456520872161f79379c80ea2b0 spi_test + grep -A4 'locked sectors' /sys/kernel/debug/spi-nor/spi0.0/params locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-00ffffff | unlocked | 64 + flash_lock -l /dev/mtd0 + flash_lock -i /dev/mtd0 Device: /dev/mtd0 Start: 0 Len: 0x1000000 Lock status: locked Return code: 1 + 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_read spi_test e30cacd4f9d230b2fc4ae12851797332d9baf8456520872161f79379c80ea2b0 spi_read e30cacd4f9d230b2fc4ae12851797332d9baf8456520872161f79379c80ea2b0 spi_test + dd 'if=3D/dev/urandom' 'of=3D./spi_test2' 'bs=3D1M' 'count=3D2' 2+0 records in 2+0 records out + mtd_debug write /dev/mtd0 0 2097152 spi_test2 Copied 2097152 bytes from spi_test2 to address 0x00000000 in flash + mtd_debug read /dev/mtd0 0 2097152 spi_read2 Copied 2097152 bytes from address 0x00000000 in flash to spi_read2 + sha256sum spi_read spi_read2 spi_test spi_test2 e30cacd4f9d230b2fc4ae12851797332d9baf8456520872161f79379c80ea2b0 spi_read e30cacd4f9d230b2fc4ae12851797332d9baf8456520872161f79379c80ea2b0 spi_read2 e30cacd4f9d230b2fc4ae12851797332d9baf8456520872161f79379c80ea2b0 spi_test c9d2a381c868b43a44563b0e36e2556b3095acf94f6dad8f259c85eab536363e spi_test2 + grep -A4 'locked sectors' /sys/kernel/debug/spi-nor/spi0.0/params locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-00ffffff | locked | 64 + flash_lock -u /dev/mtd0 + cat /sys/class/mtd/mtd0/size + size=3D16777216 + cat /sys/class/mtd/mtd0/erasesize + bs=3D65536 + grep unlocked /sys/kernel/debug/spi-nor/spi0.0/params + sed -e 's/.*unlocked | //' + nsectors=3D64 + ss=3D262144 + bps=3D4 + flash_lock -u /dev/mtd0 + flash_lock -l /dev/mtd0 16252928 8 + grep -A4 'locked sectors' /sys/kernel/debug/spi-nor/spi0.0/params locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-00f7ffff | unlocked | 62 00f80000-00ffffff | locked | 2 + flash_lock -u /dev/mtd0 16252928 4 + grep -A4 'locked sectors' /sys/kernel/debug/spi-nor/spi0.0/params locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-00fbffff | unlocked | 63 00fc0000-00ffffff | locked | 1 /* Skipping BP3 */ + flash_lock -u /dev/mtd0 + flash_lock -l /dev/mtd0 0 8 + grep -A4 'locked sectors' /sys/kernel/debug/spi-nor/spi0.0/params locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-0007ffff | locked | 2 00080000-00ffffff | unlocked | 62 + flash_lock -u /dev/mtd0 262144 4 + grep -A4 'locked sectors' /sys/kernel/debug/spi-nor/spi0.0/params locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-0003ffff | locked | 1 00040000-00ffffff | unlocked | 63 + all_but_one=3D252 + flash_lock -u /dev/mtd0 + flash_lock -l /dev/mtd0 262144 252 + grep -A4 'locked sectors' /sys/kernel/debug/spi-nor/spi0.0/params locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-0003ffff | unlocked | 1 00040000-00ffffff | locked | 63 + flash_lock -u /dev/mtd0 262144 4 + grep -A4 'locked sectors' /sys/kernel/debug/spi-nor/spi0.0/params locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-0007ffff | unlocked | 2 00080000-00ffffff | locked | 62 + flash_lock -u /dev/mtd0 + flash_lock -l /dev/mtd0 0 252 + grep -A4 'locked sectors' /sys/kernel/debug/spi-nor/spi0.0/params locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-00fbffff | locked | 63 00fc0000-00ffffff | unlocked | 1 + flash_lock -u /dev/mtd0 16252928 4 + grep -A4 'locked sectors' /sys/kernel/debug/spi-nor/spi0.0/params locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-00f7ffff | locked | 62 00f80000-00ffffff | unlocked | 2 --- drivers/mtd/spi-nor/winbond.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mtd/spi-nor/winbond.c b/drivers/mtd/spi-nor/winbond.c index dc04a3c9d660..e245ac44a5fe 100644 --- a/drivers/mtd/spi-nor/winbond.c +++ b/drivers/mtd/spi-nor/winbond.c @@ -302,7 +302,7 @@ static const struct flash_info winbond_nor_parts[] =3D { }, { /* W25Q128JV-M */ .id =3D SNOR_ID(0xef, 0x70, 0x18), - .flags =3D SPI_NOR_QUAD_PP | SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB, + .flags =3D SPI_NOR_QUAD_PP | SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB | SPI_NOR= _HAS_CMP, }, { /* W25Q256JV-M */ .id =3D SNOR_ID(0xef, 0x70, 0x19), --=20 2.53.0 From nobody Mon Jun 8 11:05:06 2026 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 68797403146 for ; Fri, 29 May 2026 15:23:22 +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=1780068203; cv=none; b=dZdEurHnvgOJzNZueubmWWvN/3YfD9e2I23KiaByVCRktOFLf5kjQqRMqu8/W9IWZBJJIKbZ8LAwzt9nZ4toBuCOueql5SQ0UzkJFcLjeQCAXqua9Q1P2TSzH7j8p6z97ULmSyHMl/f5iXLRVvqg4vxOu/T1Pk3KoA7QLUKOPsU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780068203; c=relaxed/simple; bh=fG6iQREh1qldFUyaiJcALVd2iB44uhZrBH7mjAR+QWU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Q/TPM5/sEF05ChlCxuXFUKhrkblbxlhihGS5tEWQ3L+UxZqFo6ZQNcWCh0be31nUL9p1Bx9KVOm7qNA18ydlmRkDHFOf4mfJyAUP96Y8C9nCB0DvdzVeb849gAVR+3E4XrVDp/GbBevx7EqEVk2xlcV9Xu2CSs2YXHAKoYa+6TE= 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=1NGln4f5; 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="1NGln4f5" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id 434711A373A; Fri, 29 May 2026 15:23:21 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 11BD8601FA; Fri, 29 May 2026 15:23:21 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 6AF0E10888CE5; Fri, 29 May 2026 17:23:19 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1780068200; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=f6dvFVL9UFhtpsWCnQjh+rAcj9fbT0uXdwxPQ34FN0Q=; b=1NGln4f5bQHrkSEEJYscMlaIgzSR7SyjGE4v4OJvxPmhnfvJT1ju4o4dIL5OzTm3YVX2sb TPotRB0Ak3P++8+VpPJEQztReuNNjepUWNMe1aga432gpQcfR7raU9BwPpX3gU9eTrBoZq 73XdgvILKNsKZGsGDJQmWicAFhYAkuHX0kK3G4XsFb7JXGfdbdjjqFolIqZ7hy62/681Cp cPkcCxRxdDO8kccwaCyLj7sQBxjZ9hGBMWF/3SjdihUx5GZjPGmvbZPVr477olqinriIju NASrDnYpeWcZOXQAoiAEvbRaHtjuB5AaVGmeMWxZ7Y9UzjJD1B3r2e5TgFZoWw== From: Miquel Raynal Date: Fri, 29 May 2026 17:22:45 +0200 Subject: [PATCH 25/30] mtd: spi-nor: winbond: W25Q02JV-M: Fill locking information 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: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-25-87e5d3122244@bootlin.com> References: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-0-87e5d3122244@bootlin.com> In-Reply-To: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-0-87e5d3122244@bootlin.com> To: Pratyush Yadav , Michael Walle , Takahiro Kuwano , Richard Weinberger , Vignesh Raghavendra Cc: Thomas Petazzoni , Steam Lin , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Miquel Raynal X-Mailer: b4 0.14.3 X-Last-TLS-Session-Version: TLSv1.3 The SFDP table is pretty complete except for the locking capabilities which must be filled manually. Signed-off-by: Miquel Raynal --- + alias 'show_sectors=3Dgrep -A4 "locked sectors" /sys/kernel/debug/spi-nor= /spi0.0/params' + flash_lock -u /dev/mtd0 + flash_lock -i /dev/mtd0 Device: /dev/mtd0 Start: 0 Len: 0x10000000 Lock status: unlocked Return code: 0 + mtd_debug erase /dev/mtd0 0 2097152 Erased 2097152 bytes from address 0x00000000 in flash + 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_read spi_test 8370dfccafceea1f6961d138d3412ce61dca4c7826d4775d3562acef2b10e3c6 spi_read 8370dfccafceea1f6961d138d3412ce61dca4c7826d4775d3562acef2b10e3c6 spi_test + grep -A4 'locked sectors' /sys/kernel/debug/spi-nor/spi0.0/params locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-0fffffff | unlocked | 4096 + flash_lock -l /dev/mtd0 + flash_lock -i /dev/mtd0 Device: /dev/mtd0 Start: 0 Len: 0x10000000 Lock status: locked Return code: 1 + 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_read spi_test 8370dfccafceea1f6961d138d3412ce61dca4c7826d4775d3562acef2b10e3c6 spi_read 8370dfccafceea1f6961d138d3412ce61dca4c7826d4775d3562acef2b10e3c6 spi_test + dd 'if=3D/dev/urandom' 'of=3D./spi_test2' 'bs=3D1M' 'count=3D2' 2+0 records in 2+0 records out + mtd_debug write /dev/mtd0 0 2097152 spi_test2 Copied 2097152 bytes from spi_test2 to address 0x00000000 in flash + mtd_debug read /dev/mtd0 0 2097152 spi_read2 Copied 2097152 bytes from address 0x00000000 in flash to spi_read2 + sha256sum spi_read spi_read2 spi_test spi_test2 8370dfccafceea1f6961d138d3412ce61dca4c7826d4775d3562acef2b10e3c6 spi_read 8370dfccafceea1f6961d138d3412ce61dca4c7826d4775d3562acef2b10e3c6 spi_read2 8370dfccafceea1f6961d138d3412ce61dca4c7826d4775d3562acef2b10e3c6 spi_test e61267bbd0864dfe7e67a8bfc0875a23308d98c7297fcf5a813830532f48c06f spi_test2 + grep -A4 'locked sectors' /sys/kernel/debug/spi-nor/spi0.0/params locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-0fffffff | locked | 4096 + flash_lock -u /dev/mtd0 + cat /sys/class/mtd/mtd0/size + size=3D268435456 + cat /sys/class/mtd/mtd0/erasesize + bs=3D65536 + grep unlocked /sys/kernel/debug/spi-nor/spi0.0/params + sed -e 's/.*unlocked | //' + nsectors=3D4096 + ss=3D65536 + bps=3D1 + flash_lock -u /dev/mtd0 + flash_lock -l /dev/mtd0 268304384 2 + grep -A4 'locked sectors' /sys/kernel/debug/spi-nor/spi0.0/params locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-0ffdffff | unlocked | 4094 0ffe0000-0fffffff | locked | 2 + flash_lockk uu /dev/mtd0 268304384 1 + grep -A4 'locked sectors' /sys/kernel/debug/spi-nor/spi0.0/params locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-0ffeffff | unlocked | 4095 0fff0000-0fffffff | locked | 1 + flash_lock -u /dev/mtd0 + flash_lock -l /dev/mtd0 260046848 128 + grep -A4 'locked sectors' /sys/kernel/debug/spi-nor/spi0.0/params locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-0f7fffff | unlocked | 3968 0f800000-0fffffff | locked | 128 + flash_lock -u /dev/mtd0 + flash_lock -l /dev/mtd0 0 2 + grep -A4 'locked sectors' /sys/kernel/debug/spi-nor/spi0.0/params locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-0001ffff | locked | 2 00020000-0fffffff | unlocked | 4094 + flash_lock -u /dev/mtd0 65536 1 + grep -A4 'locked sectors' /sys/kernel/debug/spi-nor/spi0.0/params locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-0000ffff | locked | 1 00010000-0fffffff | unlocked | 4095 + all_but_one=3D4095 + flash_lock -u /dev/mtd0 + flash_lock -l /dev/mtd0 65536 4095 + grep -A4 'locked sectors' /sys/kernel/debug/spi-nor/spi0.0/params locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-0000ffff | unlocked | 1 00010000-0fffffff | locked | 4095 + flassh__llock u /dev/mtd0 65536 1 + grep -A4 'locked sectors' /sys/kernel/debug/spi-nor/spi0.0/params locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-0001ffff | unlocked | 2 00020000-0fffffff | locked | 4094 + flash_lock -u /dev/mtd0 + flash_lock -l /dev/mtd0 0 4095 + grep -A4 'locked sectors' /sys/kernel/debug/spi-nor/spi0.0/params locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-0ffeffff | locked | 4095 0fff0000-0fffffff | unlocked | 1 + flash_lock -u /dev/mtd0 268304384 1 + grep -A4 'locked sectors' /sys/kernel/debug/spi-nor/spi0.0/params locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-0ffdffff | locked | 4094 0ffe0000-0fffffff | unlocked | 2 --- drivers/mtd/spi-nor/winbond.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/mtd/spi-nor/winbond.c b/drivers/mtd/spi-nor/winbond.c index e245ac44a5fe..ff409fbc2d38 100644 --- a/drivers/mtd/spi-nor/winbond.c +++ b/drivers/mtd/spi-nor/winbond.c @@ -309,6 +309,8 @@ static const struct flash_info winbond_nor_parts[] =3D { }, { /* W25Q02JV-M */ .id =3D SNOR_ID(0xef, 0x70, 0x22), + .flags =3D SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB | SPI_NOR_TB_SR_BIT6 | + SPI_NOR_4BIT_BP | SPI_NOR_HAS_CMP, .fixups =3D &winbond_nor_multi_die_fixups, }, { .id =3D SNOR_ID(0xef, 0x71, 0x19), --=20 2.53.0 From nobody Mon Jun 8 11:05:06 2026 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 A1FF9404889 for ; Fri, 29 May 2026 15:23:24 +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=1780068206; cv=none; b=OdKnc8vaimyaYFCJV6xa7nt43i81QckyPoz7CZWvxjuyxMrV94qFleM+HlyP354oXaDnMF2EtPjAnMEKkbkSGYOxOYh36JYk6T7YWzmDUzLmAzoCrUgRxewlWlGwTnm3T4WBF6qprO8wbsB2waD69Qr2bfby0NZeDNqf6tDvbKw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780068206; c=relaxed/simple; bh=KFh5OYDbxN15zFEoI4zAJp4JRMQQmzy4JwivNtVX9mA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=jFJM9R+k9SO/5noLWqxoNcYxIOR+564sVVy4JH8Crohi1+03TdjxrTe3y8xSsL59Jbf3IF1gExnzhznGxY1rQJvLZ89im5BZQSgzZZOzkgQ6D+Iouqxj9ByrLJ5N40YWxQsKNfrO+TFncSQRunF8cf9ZeUiba8n+VTP9gvLwl6Q= 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=GaXWs179; 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="GaXWs179" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id 2EB84C6245E; Fri, 29 May 2026 15:23:24 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 754F5601FA; Fri, 29 May 2026 15:23:23 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id EB5D010888CE6; Fri, 29 May 2026 17:23:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1780068202; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=HcFdc0gPopoV+aqqXUCI258tPcoJ1e6EdDpiF/eeKgY=; b=GaXWs1794B4Qf4o86HZM89Lnu0wwjqlzFJuqiGTix3H0GR26P7Uj3BOGDrLVnn+DOKGwMe EgzzdNLLt4LogbuREEIcPmC0b0q87BKn37bMx/rySMFmPXH3KLnZCi5EvvWs4cUyNKvmH8 UJuiJJol0iXMGnm1v/WLj2+nRK063+C25bKbxuK1nymvFaJTU7Z9Tb/UsyzHAugr+hUiSY qDSRr0/zYAaWxqINVXfk/d4KlcIqBB3Ju8sRSj7WQjjV/1SaMhcdWjdkVEfX4owUe6F+h3 oTFNgoSj6EOX43/sNDJEl0j6RhYenGCpCLjcoZanjVi3e6COt/qTLVKlz+knlw== From: Miquel Raynal Date: Fri, 29 May 2026 17:22:46 +0200 Subject: [PATCH 26/30] mtd: spi-nor: winbond: W25Q512JV-M: New chip 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: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-26-87e5d3122244@bootlin.com> References: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-0-87e5d3122244@bootlin.com> In-Reply-To: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-0-87e5d3122244@bootlin.com> To: Pratyush Yadav , Michael Walle , Takahiro Kuwano , Richard Weinberger , Vignesh Raghavendra Cc: Thomas Petazzoni , Steam Lin , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Miquel Raynal X-Mailer: b4 0.14.3 X-Last-TLS-Session-Version: TLSv1.3 Add support for W25Q512JV-M. It is a 3.3V chip with usual dual/quad capabilities. The SFDP table is pretty complete except for the locking capabilities which must be filled manually. Signed-off-by: Miquel Raynal --- + 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 ef7020 + 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 ffffffffffffffffe520fbffffffff1f44eb086b083b42bbfeffffffffff 0000ffff40eb0c200f5210d800003602a60082ea14e2e96376337a757a75 f7a2d55c19f74dffe970f9a5ffffffffffffffffffffffffffffffffff0a f0ff21ffdcff + sha256sum /sys/bus/spi/devices/spi0.0/spi-nor/sfdp f41674a6c3742a42d31d3007d4d4b725c166ddb4e4566d1c347d29ed29855ef0 /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 70 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 | HAS_SR2_CMP_BIT6 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 locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-03ffffff | unlocked | 1024 + dd 'if=3D/dev/urandom' 'of=3D./spi_test' 'bs=3D1M' 'count=3D2' [ 53.198369] random: crng init done 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_read spi_test f27c6b54ce92a46104f2fd43fc2d6d1353099a6a125591b47a615d3d61171a86 spi_read f27c6b54ce92a46104f2fd43fc2d6d1353099a6a125591b47a615d3d61171a86 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_read spi_test 4bda3a28f4ffe603c0ec1258c0034d65a1a0d35ab7bd523a834608adabf03cc5 spi_read f27c6b54ce92a46104f2fd43fc2d6d1353099a6a125591b47a615d3d61171a86 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 + alias 'show_sectors=3Dgrep -A4 "locked sectors" /sys/kernel/debug/spi-nor= /spi0.0/params' + flash_lock -u /dev/mtd0 + flash_lock -i /dev/mtd0 Device: /dev/mtd0 Start: 0 Len: 0x4000000 Lock status: unlocked Return code: 0 + mtd_debug erase /dev/mtd0 0 2097152 Erased 2097152 bytes from address 0x00000000 in flash + 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_read spi_test f27c6b54ce92a46104f2fd43fc2d6d1353099a6a125591b47a615d3d61171a86 spi_read f27c6b54ce92a46104f2fd43fc2d6d1353099a6a125591b47a615d3d61171a86 spi_test + grep -A4 'locked sectors' /sys/kernel/debug/spi-nor/spi0.0/params locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-03ffffff | unlocked | 1024 + flash_lock -l /dev/mtd0 + flash_lock -i /dev/mtd0 Device: /dev/mtd0 Start: 0 Len: 0x4000000 Lock status: locked Return code: 1 + 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_read spi_test f27c6b54ce92a46104f2fd43fc2d6d1353099a6a125591b47a615d3d61171a86 spi_read f27c6b54ce92a46104f2fd43fc2d6d1353099a6a125591b47a615d3d61171a86 spi_test + dd 'if=3D/dev/urandom' 'of=3D./spi_test2' 'bs=3D1M' 'count=3D2' 2+0 records in 2+0 records out + mtd_debug write /dev/mtd0 0 2097152 spi_test2 Copied 2097152 bytes from spi_test2 to address 0x00000000 in flash + mtd_debug read /dev/mtd0 0 2097152 spi_read2 Copied 2097152 bytes from address 0x00000000 in flash to spi_read2 + sha256sum spi_read spi_read2 spi_test spi_test2 f27c6b54ce92a46104f2fd43fc2d6d1353099a6a125591b47a615d3d61171a86 spi_read f27c6b54ce92a46104f2fd43fc2d6d1353099a6a125591b47a615d3d61171a86 spi_read2 f27c6b54ce92a46104f2fd43fc2d6d1353099a6a125591b47a615d3d61171a86 spi_test 44db7586d798437868d29ea31ac1fa1e64d1b81337721d0d811776dad47110f3 spi_test2 + grep -A4 'locked sectors' /sys/kernel/debug/spi-nor/spi0.0/params locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-03ffffff | locked | 1024 + flash_lock -u /dev/mtd0 + cat /sys/class/mtd/mtd0/size + size=3D67108864 + cat /sys/class/mtd/mtd0/erasesize + bs=3D65536 + grep unlocked /sys/kernel/debug/spi-nor/spi0.0/params + sed -e 's/.*unlocked | //' + nsectors=3D1024 + ss=3D65536 + bps=3D1 + flash_lock -u /dev/mtd0 + flash_lock -l /dev/mtd0 66977792 2 + grep -A4 'locked sectors' /sys/kernel/debug/spi-nor/spi0.0/params locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-03fdffff | unlocked | 1022 03fe0000-03ffffff | locked | 2 + flash_lock -u /dev/mtd0 66977792 1 + grep -A4 'locked sectors' /sys/kernel/debug/spi-nor/spi0.0/params locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-03feffff | unlocked | 1023 03ff0000-03ffffff | locked | 1 + flash_lock -u /dev/mtd0 + flash_lock -l /dev/mtd0 58720256 128 + grep -A4 'locked sectors' /sys/kernel/debug/spi-nor/spi0.0/params locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-037fffff | unlocked | 896 03800000-03ffffff | locked | 128 + flash_lock -u /dev/mtd0 + flash_lock -l /dev/mtd0 0 2 + grep -A4 'locked sectors' /sys/kernel/debug/spi-nor/spi0.0/params locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-0001ffff | locked | 2 00020000-03ffffff | unlocked | 1022 + flash_lock -u /dev/mtd0 65536 1 + grep -A4 'locked sectors' /sys/kernel/debug/spi-nor/spi0.0/params locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-0000ffff | locked | 1 00010000-03ffffff | unlocked | 1023 + all_but_one=3D1023 + flash_lock -u /dev/mtd0 + flash_lock -l /dev/mtd0 65536 1023 + grep -A4 'locked sectors' /sys/kernel/debug/spi-nor/spi0.0/params locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-0000ffff | unlocked | 1 00010000-03ffffff | locked | 1023 + flash_lock -u /dev/mtd0 65536 1 + grep -A4 'locked sectors' /sys/kernel/debug/spi-nor/spi0.0/params locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-0001ffff | unlocked | 2 00020000-03ffffff | locked | 1022 + flash_lock -u /dev/mtd0 + flash_lock -l /dev/mtd0 0 1023 + grep -A4 'locked sectors' /sys/kernel/debug/spi-nor/spi0.0/params locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-03feffff | locked | 1023 03ff0000-03ffffff | unlocked | 1 + flash_lock -u /dev/mtd0 66977792 1 + grep -A4 'locked sectors' /sys/kernel/debug/spi-nor/spi0.0/params locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-03fdffff | locked | 1022 03fe0000-03ffffff | unlocked | 2 + flash_speed /dev/mtd0 -dc10 not NAND flash, assume page size is 512 bytes. scanning for bad eraseblocks scanned 10 eraseblocks, 0 are bad testing eraseblock write speed eraseblock write speed is 437 KiB/s testing eraseblock read speed eraseblock read speed is 1560 KiB/s testing page write speed page write speed is 434 KiB/s testing page read speed page read speed is 1457 KiB/s testing 2 page write speed 2 page write speed is 435 KiB/s testing 2 page read speed 2 page read speed is 1498 KiB/s Testing erase speed erase speed is 257 KiB/s Testing 2x multi-block erase speed 2x multi-block erase speed is 257 KiB/s Testing 4x multi-block erase speed 4x multi-block erase speed is 257 KiB/s Testing 8x multi-block erase speed 8x multi-block erase speed is 254 KiB/s Testing 16x multi-block erase speed 16x multi-block erase speed is 255 KiB/s Testing 32x multi-block erase speed 32x multi-block erase speed is 255 KiB/s Testing 64x multi-block erase speed 64x multi-block erase speed is 253 KiB/s finished --- drivers/mtd/spi-nor/winbond.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/mtd/spi-nor/winbond.c b/drivers/mtd/spi-nor/winbond.c index ff409fbc2d38..fa842e841804 100644 --- a/drivers/mtd/spi-nor/winbond.c +++ b/drivers/mtd/spi-nor/winbond.c @@ -306,6 +306,11 @@ static const struct flash_info winbond_nor_parts[] =3D= { }, { /* W25Q256JV-M */ .id =3D SNOR_ID(0xef, 0x70, 0x19), + }, { + /* W25Q512JV-M */ + .id =3D SNOR_ID(0xef, 0x70, 0x20), + .flags =3D SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB | SPI_NOR_TB_SR_BIT6 | + SPI_NOR_4BIT_BP | SPI_NOR_HAS_CMP, }, { /* W25Q02JV-M */ .id =3D SNOR_ID(0xef, 0x70, 0x22), --=20 2.53.0 From nobody Mon Jun 8 11:05:06 2026 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 1673640756C for ; Fri, 29 May 2026 15:23:26 +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=1780068207; cv=none; b=e34JUyHirxQRAMnsM6lXqrjWVyYhlNMt/b3ylTcFl4zEsbNVZEsPSlmZBrBX/OYcyU+1RsNRQA/OHCMW/AyKMwjYV2cTzHv1HeQEkY6YOcgh9xLNNaW45lqsx3v1Ylssl7fZHx2v7LD7AEHfWnAvCiUGXR4xoTLMl2g5wEcIFBU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780068207; c=relaxed/simple; bh=3MFYW78cdijD64CURqB0SnhMyPdVOyukonX6eVxIkcY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=IrfumveHQCEfhSgSthMl05S1p0wgl8gSlYintRniV5HfGBSBb893bnkEeYqSK+wGqXB+NXH1ZMeAemtrFOo4dq+wzu0yY5yD9P07G4wUJ4cFkcxqLZiPsJaONpqZcUnQDaTXoQ3sA5vOGEGe8L0lhEHncM+UG+JdHcCQEK4qsVA= 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=lNNfxPq5; 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="lNNfxPq5" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id B8A48C62462; Fri, 29 May 2026 15:23:25 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 0AF3E601FA; Fri, 29 May 2026 15:23:25 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 0C3A010888CDC; Fri, 29 May 2026 17:23:22 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1780068204; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=qlWWyGvzUgQy+AKR69b9LqNs8ZCcvfMCxoNLIl5u09k=; b=lNNfxPq58Cj7zHF5xOJMdKrTMj56g/HdaBZzHEkSgmRoKxrOdn9qO9z55B5pGpJzYowcQA 48EyEshuMmyI/xCk9mLgF0oCqqT5meqnOmVaZfVK1QfdZkk3bKX3tVtFpxHviDhaiEeVYb Q6gr2tF6sjeu+ycytMyX/0Kg6Mqd26zP/fIDSqnjMGotlaGBXwRJ56l6UoD78j/2TDQomS SXLTfI8o3UGDIJIMfaiAPx3YY8g4nlKiUHR2LbB4dwSW5PLEcfG12uglUMUlPQqGS1wAYH utypfgoKL6OiQgbHGri9agQPZ8YY/6M92Qz8X5MDJGUjONDQy02hxTK/PBTKmg== From: Miquel Raynal Date: Fri, 29 May 2026 17:22:47 +0200 Subject: [PATCH 27/30] mtd: spi-nor: winbond: W25Q01JV-M: New chip 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: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-27-87e5d3122244@bootlin.com> References: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-0-87e5d3122244@bootlin.com> In-Reply-To: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-0-87e5d3122244@bootlin.com> To: Pratyush Yadav , Michael Walle , Takahiro Kuwano , Richard Weinberger , Vignesh Raghavendra Cc: Thomas Petazzoni , Steam Lin , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Miquel Raynal X-Mailer: b4 0.14.3 X-Last-TLS-Session-Version: TLSv1.3 Add support for W25Q01JV-M. It is a 3.3V chip with usual dual/quad capabilities. The SFDP table is pretty complete except for the locking capabilities which must be filled manually. Signed-off-by: Miquel Raynal --- + cat /sys/bus/spi/devices/spi0.0/spi-nor/jedec_id ef7021 + 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 ffffffffffffffffe520fbffffffff3f44eb086b083b42bbfeffffffffff 0000ffff40eb0c200f5210d800003602a60082ea14e2e96376337a757a75 f7a2d55c19f74dffe970f9a5ffffffffffffffffffffffffffffffffff0a f0ff21ffdcff + sha256sum /sys/bus/spi/devices/spi0.0/spi-nor/sfdp c733cf105c5f05ed23ad3a32c2a72c1a09d4b895c628db52e645a8a457dfc7d6 /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 70 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 | HAS_SR2_CMP_BIT6 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 locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-07ffffff | unlocked | 2048 + 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_read spi_test 7ccac32f903edeaed4e7c6355a91c2e6dfc95dd007069c9f22ea2b9d45f5ce35 spi_read 7ccac32f903edeaed4e7c6355a91c2e6dfc95dd007069c9f22ea2b9d45f5ce35 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_read spi_test 4bda3a28f4ffe603c0ec1258c0034d65a1a0d35ab7bd523a834608adabf03cc5 spi_read 7ccac32f903edeaed4e7c6355a91c2e6dfc95dd007069c9f22ea2b9d45f5ce35 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 + alias 'show_sectors=3Dgrep -A4 "locked sectors" /sys/kernel/debug/spi-nor= /spi0.0/params' + flash_lock -u /dev/mtd0 + flash_lock -i /dev/mtd0 Device: /dev/mtd0 Start: 0 Len: 0x8000000 Lock status: unlocked Return code: 0 + mtd_debug erase /dev/mtd0 0 2097152 Erased 2097152 bytes from address 0x00000000 in flash + 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_read spi_test 7ccac32f903edeaed4e7c6355a91c2e6dfc95dd007069c9f22ea2b9d45f5ce35 spi_read 7ccac32f903edeaed4e7c6355a91c2e6dfc95dd007069c9f22ea2b9d45f5ce35 spi_test + grep -A4 'locked sectors' /sys/kernel/debug/spi-nor/spi0.0/params locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-07ffffff | unlocked | 2048 + flash_lock -l /dev/mtd0 + flash_lock -i /dev/mtd0 Device: /dev/mtd0 Start: 0 Len: 0x8000000 Lock status: locked Return code: 1 + 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_read spi_test 7ccac32f903edeaed4e7c6355a91c2e6dfc95dd007069c9f22ea2b9d45f5ce35 spi_read 7ccac32f903edeaed4e7c6355a91c2e6dfc95dd007069c9f22ea2b9d45f5ce35 spi_test + dd 'if=3D/dev/urandom' 'of=3D./spi_test2' 'bs=3D1M' 'count=3D2' 2+0 records in 2+0 records out + mtd_debug write /dev/mtd0 0 2097152 spi_test2 Copied 2097152 bytes from spi_test2 to address 0x00000000 in flash + mtd_debug read /dev/mtd0 0 2097152 spi_read2 Copied 2097152 bytes from address 0x00000000 in flash to spi_read2 + sha256sum spi_read spi_read2 spi_test spi_test2 7ccac32f903edeaed4e7c6355a91c2e6dfc95dd007069c9f22ea2b9d45f5ce35 spi_read 7ccac32f903edeaed4e7c6355a91c2e6dfc95dd007069c9f22ea2b9d45f5ce35 spi_read2 7ccac32f903edeaed4e7c6355a91c2e6dfc95dd007069c9f22ea2b9d45f5ce35 spi_test 43870da5d2b9fcb8fe0a6a96350b87da1e9423fe9f9e2f039bf363e68916ae0d spi_test2 + grep -A4 'locked sectors' /sys/kernel/debug/spi-nor/spi0.0/params locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-07ffffff | locked | 2048 + flash_lock -u /dev/mtd0 + cat /sys/class/mtd/mtd0/size + size=3D134217728 + cat /sys/class/mtd/mtd0/erasesize + bs=3D65536 + grep unlocked /sys/kernel/debug/spi-nor/spi0.0/params + sed -e 's/.*unlocked | //' + nsectors=3D2048 + ss=3D65536 + bps=3D1 + flash_lock -u /dev/mtd0 + flash_lock -l /dev/mtd0 134086656 2 + grep -A4 'locked sectors' /sys/kernel/debug/spi-nor/spi0.0/params locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-07fdffff | unlocked | 2046 07fe0000-07ffffff | locked | 2 + flash_lock -u /dev/mtd0 134086656 1 + grep -A4 'locked sectors' /sys/kernel/debug/spi-nor/spi0.0/params locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-07feffff | unlocked | 2047 07ff0000-07ffffff | locked | 1 + flash_lock -u /dev/mtd0 + flash_lock -l /dev/mtd0 125829120 128 + grep -A4 'locked sectors' /sys/kernel/debug/spi-nor/spi0.0/params locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-077fffff | unlocked | 1920 07800000-07ffffff | locked | 128 + flash_lock -u /dev/mtd0 + flash_lock -l /dev/mtd0 0 2 + grep -A4 'locked sectors' /sys/kernel/debug/spi-nor/spi0.0/params locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-0001ffff | locked | 2 00020000-07ffffff | unlocked | 2046 + flash_lock -u /dev/mtd0 65536 1 + grep -A4 'locked sectors' /sys/kernel/debug/spi-nor/spi0.0/params locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-0000ffff | locked | 1 00010000-07ffffff | unlocked | 2047 + all_but_one=3D2047 + flash_lock -u /dev/mtd0 + flash_lock -l /dev/mtd0 65536 2047 + grep -A4 'locked sectors' /sys/kernel/debug/spi-nor/spi0.0/params locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-0000ffff | unlocked | 1 00010000-07ffffff | locked | 2047 + flash_lock -u /dev/mtd0 65536 1 + grep -A4 'locked sectors' /sys/kernel/debug/spi-nor/spi0.0/params locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-0001ffff | unlocked | 2 00020000-07ffffff | locked | 2046 + flash_lock -u /dev/mtd0 + flash_lock -l /dev/mtd0 0 2047 + grep -A4 'locked sectors' /sys/kernel/debug/spi-nor/spi0.0/params locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-07feffff | locked | 2047 07ff0000-07ffffff | unlocked | 1 + flash_lock -u /dev/mtd0 134086656 1 + grep -A4 'locked sectors' /sys/kernel/debug/spi-nor/spi0.0/params locked sectors region (in hex) | status | #sectors ------------------+----------+--------- 00000000-07fdffff | locked | 2046 07fe0000-07ffffff | unlocked | 2 --- drivers/mtd/spi-nor/winbond.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/mtd/spi-nor/winbond.c b/drivers/mtd/spi-nor/winbond.c index fa842e841804..1e5ad4e3ef7a 100644 --- a/drivers/mtd/spi-nor/winbond.c +++ b/drivers/mtd/spi-nor/winbond.c @@ -311,6 +311,12 @@ static const struct flash_info winbond_nor_parts[] =3D= { .id =3D SNOR_ID(0xef, 0x70, 0x20), .flags =3D SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB | SPI_NOR_TB_SR_BIT6 | SPI_NOR_4BIT_BP | SPI_NOR_HAS_CMP, + }, { + /* W25Q01JV-M */ + .id =3D SNOR_ID(0xef, 0x70, 0x21), + .flags =3D SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB | SPI_NOR_TB_SR_BIT6 | + SPI_NOR_4BIT_BP | SPI_NOR_HAS_CMP, + .fixups =3D &winbond_nor_multi_die_fixups, }, { /* W25Q02JV-M */ .id =3D SNOR_ID(0xef, 0x70, 0x22), --=20 2.53.0 From nobody Mon Jun 8 11:05:06 2026 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 1477C3EDAD5 for ; Fri, 29 May 2026 15:23:29 +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=1780068210; cv=none; b=C/raITU+KJ8+OCaHG1bVFUta8p9xRTdPMgGc/D74yNWz+w5XKC4I0LdX5f1Z4mpPQRbPNmlTXL9GikYA521orPZMOfo4Y9UaLRbnclFHEsdjIocewhNj1aDfpwYKgbRVA92HHitpAlKRhwfUb8KWpXC7iClZ9TuO4v3pKVZyahc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780068210; c=relaxed/simple; bh=18fiYchcYkOv+cOz/ArUwckwnMlIyla1W7obqi5di3M=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=sC5BbsXr5m2n2SYowE4ykRUDtq4js8zNX1ehdOsCXbjyquj5Ws+U/yqiG3CAhcE0VQSM2DcAkbekdSOQ0rfLrTzCJAeBtTa67nCERiX49fVhVxGHOj0P9Jw1rbygjwkDrkJuVF+h1PKhOWWUQ71QHb1aBXoZKujMGiXq+iyWfBs= 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=hzWoHYrV; 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="hzWoHYrV" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id E48451A371D; Fri, 29 May 2026 15:23:27 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id B9D86601FA; Fri, 29 May 2026 15:23:27 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 992C310888CE9; Fri, 29 May 2026 17:23:24 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1780068206; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=qVylc6gaM79n1hJEKNT6a+57VijXLpcOysJ/GUKa3jk=; b=hzWoHYrV5WIdHRskzjeXRDpmYQs4r4Iw53DLTIWZs6V2PgBEu0JzvDopn+trK8ZjQcP9wH PQKQ77r0LUt1IDs9KBW1CQu5Zldbg/9FcLB10/K5SU02/wXRQnrKeFQx21djZ5bI69p46b 2RwEVlVHPreEI7Eg1pLxTN0E1hLlekNZM97vQ5Dh+Cn1QSht3cq8jr3q8OipDTK96AkbXV LRhm3HgsVnuGthXpbRPibbAc16EcvnBsVUswx0xq52X5NSGFuco0X5OmNqCxqvWzko+src XAZO2MwDdhArgxcjqbanu4Of87F7YkAa5GQJ2s0Z82GukpRW0qSXvjOdtPlWPw== From: Miquel Raynal Date: Fri, 29 May 2026 17:22:48 +0200 Subject: [PATCH 28/30] mtd: spi-nor: winbond: W25QxxJV-Q/N/M: Drop redundant data 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: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-28-87e5d3122244@bootlin.com> References: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-0-87e5d3122244@bootlin.com> In-Reply-To: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-0-87e5d3122244@bootlin.com> To: Pratyush Yadav , Michael Walle , Takahiro Kuwano , Richard Weinberger , Vignesh Raghavendra Cc: Thomas Petazzoni , Steam Lin , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Miquel Raynal X-Mailer: b4 0.14.3 X-Last-TLS-Session-Version: TLSv1.3 I do not have any W25Q256JV-Q/N nor any W25Q16JV-M chips in hand, but all the other chips from the JV family have the same SFDP table, correctly advertizing the capabilities which are redundantly repeated in the table. We can reasonably expect that these chips follow the exact same rules, so drop that extra data. I am on purpose skipping the W25Q128JV-Q/N because there is also a Zetta clone that seem to share the same ID, and I have no idea how this chip works (add a small comment in the table about this). Signed-off-by: Miquel Raynal --- drivers/mtd/spi-nor/winbond.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/mtd/spi-nor/winbond.c b/drivers/mtd/spi-nor/winbond.c index 1e5ad4e3ef7a..c1dbdf7610fb 100644 --- a/drivers/mtd/spi-nor/winbond.c +++ b/drivers/mtd/spi-nor/winbond.c @@ -212,12 +212,11 @@ static const struct flash_info winbond_nor_parts[] = =3D { .size =3D SZ_16M, .flags =3D SPI_NOR_QUAD_PP | SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB | SPI_NOR= _HAS_CMP, .no_sfdp_flags =3D SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ, + /* Zetta clone */ .fixups =3D &w25q128_fixups, }, { /* W25Q256JV-Q/N */ .id =3D SNOR_ID(0xef, 0x40, 0x19), - .size =3D SZ_32M, - .no_sfdp_flags =3D SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ, .fixups =3D &w25q256_fixups, }, { /* W25Q512JV-Q/N */ @@ -288,9 +287,7 @@ static const struct flash_info winbond_nor_parts[] =3D { }, { /* W25Q16JV-M */ .id =3D SNOR_ID(0xef, 0x70, 0x15), - .size =3D SZ_2M, .flags =3D SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB, - .no_sfdp_flags =3D SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ, }, { /* W25Q32JV-M */ .id =3D SNOR_ID(0xef, 0x70, 0x16), --=20 2.53.0 From nobody Mon Jun 8 11:05:06 2026 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 EE0333EE1E9 for ; Fri, 29 May 2026 15:23: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=1780068212; cv=none; b=CcV/6OM6ryaHOKm9gXbbjSK01dHuTt7AsmilGJye5g9rwhBa3zNqPXLKIgjmwTwKLC0JdgKLiKf7HQO8kZId92PFnNr9SyUraW4KYlvt+EnQ13SUz+S2iUfnzxMBxauIOepvNYwVbC2se4QgDDQ3ENWz/VGzbyvH1WuEOWjIp1s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780068212; c=relaxed/simple; bh=ZJQkOS2avia5rQ5UtPa7AUnkaTlTzb4T1/ENqd413FI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=RIZSPJ6PC58gcgwXzxglAQq+3+7IphKB7/UEqYeOCnFL+5Fte9kuzPoy6ENADJvyBH8w8lOwXIpYNGe4svPP3BXBdzA71u1aqIEmA0dP41iPFCkaeEjROMq99+ylVC2AbtGw8Buc8j/ekFUTz3LJRE+B9iRTbrNJiDbOzt4usQM= 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=dyupbKuh; 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="dyupbKuh" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id 980334E42D91; Fri, 29 May 2026 15:23:29 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 66BC3601FA; Fri, 29 May 2026 15:23:29 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id EECA910888CED; Fri, 29 May 2026 17:23:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1780068208; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=IjSPN9VwA7YTilMOtm3qT0LxYXMmLRFNCUb/cFx9vIE=; b=dyupbKuhUdaU38QmR5yhxzGzKZ1Vj3uXEV8JxXnRQUbSywgQvtMhYqj6rbzofVHukznUQ2 aXNzrCNPcoSbYqb8xhRHCnTBZYZmvMbKsrx/aXyhH/jzNaDD4NYYeL3b6cxPVF42PnyQ45 J0urkOwq9gdovKBAb11MzTqq6s6H+UrBo3A1suxUzc1rMnxlBDpiT91ClHr3ChFmGVMtq2 Ga3rxh73FLpgOBEp2F8ckIT6DvN34LMHakkv+wQIrLEbrncE7UPGu+ghx/cEemWxlIreu9 tsKTCqbsqaHUmSnOaBquQjM/eBoVrdFySOcefGt1g5EdFNk+RKxFi8WWrGChug== From: Miquel Raynal Date: Fri, 29 May 2026 17:22:49 +0200 Subject: [PATCH 29/30] mtd: spi-nor: winbond: W25QxxJV-Q/N/M: Add quad page program capability 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: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-29-87e5d3122244@bootlin.com> References: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-0-87e5d3122244@bootlin.com> In-Reply-To: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-0-87e5d3122244@bootlin.com> To: Pratyush Yadav , Michael Walle , Takahiro Kuwano , Richard Weinberger , Vignesh Raghavendra Cc: Thomas Petazzoni , Steam Lin , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Miquel Raynal X-Mailer: b4 0.14.3 X-Last-TLS-Session-Version: TLSv1.3 I do not have any W25Q256JV-Q/N/M nor any W25Q16JV-M chips in hand, but all the chips with a density <=3D 256Mib are older revisions of the JV chips which do not yet implement the 4BAIT extension table, as such, they cannot advertise their quad page program capability. We can reasonably expect that these chips follow the exact same rules, so add the missing flag. Signed-off-by: Miquel Raynal --- drivers/mtd/spi-nor/winbond.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/mtd/spi-nor/winbond.c b/drivers/mtd/spi-nor/winbond.c index c1dbdf7610fb..08fbbc2b948b 100644 --- a/drivers/mtd/spi-nor/winbond.c +++ b/drivers/mtd/spi-nor/winbond.c @@ -217,6 +217,7 @@ static const struct flash_info winbond_nor_parts[] =3D { }, { /* W25Q256JV-Q/N */ .id =3D SNOR_ID(0xef, 0x40, 0x19), + .flags =3D SPI_NOR_QUAD_PP, .fixups =3D &w25q256_fixups, }, { /* W25Q512JV-Q/N */ @@ -287,7 +288,7 @@ static const struct flash_info winbond_nor_parts[] =3D { }, { /* W25Q16JV-M */ .id =3D SNOR_ID(0xef, 0x70, 0x15), - .flags =3D SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB, + .flags =3D SPI_NOR_QUAD_PP | SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB, }, { /* W25Q32JV-M */ .id =3D SNOR_ID(0xef, 0x70, 0x16), @@ -303,6 +304,7 @@ static const struct flash_info winbond_nor_parts[] =3D { }, { /* W25Q256JV-M */ .id =3D SNOR_ID(0xef, 0x70, 0x19), + .flags =3D SPI_NOR_QUAD_PP, }, { /* W25Q512JV-M */ .id =3D SNOR_ID(0xef, 0x70, 0x20), --=20 2.53.0 From nobody Mon Jun 8 11:05:06 2026 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 E184740FDAD for ; Fri, 29 May 2026 15:23:32 +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=1780068214; cv=none; b=lm1bIBhKKtSaCmg7dc3f3DRsfY9edLZEX9ZAXHMwjXg6sRf4u0O3QOn1Z6zLDBVBtTfNWqqQabJW3ehKdIWZCMsGDPFidPTBeqZpvTK2h3Mr+vbaSCGorT1lmqzEVkyU64Dfyn4468uc2ckwiXkiyezQTkG0fOVaIf4GRsIZRVI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780068214; c=relaxed/simple; bh=wkgy1jA31ksMx4Nw/l36FmeGvkOnHUUAYpaMHgB8aJw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ptBCvo1CXo69AIpA4mKj5/NZS8szQyZ7CNvCU0oxstyOfRNuoGi4eoDkR4yCdjokEJyLL5WOzD3maJICzst8Kv7kFrHZk15t+SVi/glu9+cl/GFwjEc6J/noPSn/AtVwGRen8lQIluUp0VE4IaxIjBMXbIHoHnJUopD2t3nx+MU= 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=apb0xNTP; 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="apb0xNTP" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id B69BF1A371D; Fri, 29 May 2026 15:23:31 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 8BD1C601FA; Fri, 29 May 2026 15:23:31 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 1529210888CEB; Fri, 29 May 2026 17:23:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1780068210; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=BTgqXR63Z1d93rEsy/odsH86lRVQmWyKMJAmdGQCFEw=; b=apb0xNTP6kqzDDqCnnHiE/GoW0smu5gbugOTlMDcPcF5WjajbOwrIkI3/oWFE+zbmsUxCR 7u0vk2IxqpDREKn5oirTizKai3gUmrpu2M1d7X0zIY4OtGmoPqou5ernMjM+XJy3IJl0B3 Fb2Rho+6cpFamZ+NYVVd2GStmfhRgSf/qUrgLshMyd7bmJNymt7BBkh+NOyHdQNRlDeOlY nAj5UE1YBwrzdGsz0BITxZfXZ69WwemVPHiHxccRr44rUKw71gC+dnkd4ZmkjoKcffCsBc Kp9F93V8vxofg5RdK5dRJRBmHDtyde9Hn3Jl0xkvp3nr1ar5f5WXd+OOSp4jtQ== From: Miquel Raynal Date: Fri, 29 May 2026 17:22:50 +0200 Subject: [PATCH 30/30] mtd: spi-nor: winbond: W25QxxJV-Q/N/M: Fill locking information 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: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-30-87e5d3122244@bootlin.com> References: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-0-87e5d3122244@bootlin.com> In-Reply-To: <20260529-winbond-v7-1-spi-nor-jv-cleanup-v1-0-87e5d3122244@bootlin.com> To: Pratyush Yadav , Michael Walle , Takahiro Kuwano , Richard Weinberger , Vignesh Raghavendra Cc: Thomas Petazzoni , Steam Lin , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Miquel Raynal X-Mailer: b4 0.14.3 X-Last-TLS-Session-Version: TLSv1.3 I do not have any W25Q256JV-Q/N/M nor any W25Q16JV-M chips in hand, but all the other chips from this family have the same locking pattern, so we can reasonably expect that these chips follow the exact same rules. Signed-off-by: Miquel Raynal --- drivers/mtd/spi-nor/winbond.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/mtd/spi-nor/winbond.c b/drivers/mtd/spi-nor/winbond.c index 08fbbc2b948b..60a7bb1f2ce4 100644 --- a/drivers/mtd/spi-nor/winbond.c +++ b/drivers/mtd/spi-nor/winbond.c @@ -217,7 +217,8 @@ static const struct flash_info winbond_nor_parts[] =3D { }, { /* W25Q256JV-Q/N */ .id =3D SNOR_ID(0xef, 0x40, 0x19), - .flags =3D SPI_NOR_QUAD_PP, + .flags =3D SPI_NOR_QUAD_PP | SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB | + SPI_NOR_TB_SR_BIT6 | SPI_NOR_4BIT_BP | SPI_NOR_HAS_CMP, .fixups =3D &w25q256_fixups, }, { /* W25Q512JV-Q/N */ @@ -288,7 +289,7 @@ static const struct flash_info winbond_nor_parts[] =3D { }, { /* W25Q16JV-M */ .id =3D SNOR_ID(0xef, 0x70, 0x15), - .flags =3D SPI_NOR_QUAD_PP | SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB, + .flags =3D SPI_NOR_QUAD_PP | SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB | SPI_NOR= _HAS_CMP, }, { /* W25Q32JV-M */ .id =3D SNOR_ID(0xef, 0x70, 0x16), @@ -304,7 +305,8 @@ static const struct flash_info winbond_nor_parts[] =3D { }, { /* W25Q256JV-M */ .id =3D SNOR_ID(0xef, 0x70, 0x19), - .flags =3D SPI_NOR_QUAD_PP, + .flags =3D SPI_NOR_QUAD_PP | SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB | + SPI_NOR_TB_SR_BIT6 | SPI_NOR_4BIT_BP | SPI_NOR_HAS_CMP, }, { /* W25Q512JV-M */ .id =3D SNOR_ID(0xef, 0x70, 0x20), --=20 2.53.0