From nobody Mon Jun 15 14:00:02 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 00EE03ACA7A; Fri, 10 Apr 2026 17:41:18 +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=1775842880; cv=none; b=ODOeh0KgQcSrX0RhlrmVasDneOIj5f0CHP2397WKuHZlbdBKSKu6oBiyZW8mtNzc552T+8czB7oYpFDpQpMyVjEhQPp6rIkkcH/DntzkyXnzMstdt+kKnXyibX5J9Tqtvh/2XkhYbN+3grNnBLKdwkAwobQACMLBrEzO15kjuo4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775842880; c=relaxed/simple; bh=sanbJOvhkoyHWzuJ2bZpEVZZm2Hzp/7V9o49waG+1RQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=dJg51iZIb/obWXL2vJia6bSiqgcmRZgfeR/vS+Ek9Qgq5w7jg1L3HxH/fbHivx6/EMf6gNxkVWP+cEDllRiUi8GTnTSMfZsdiMsIcwEVzTI8BHiGKnXgumbdHkqOA0wKKMvh3v2OPPPJMwOZGRxAuaGO3bGMqMWjL2d0pzg0urA= 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=xCTfkMry; 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="xCTfkMry" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id 26D914E429B3; Fri, 10 Apr 2026 17:41:17 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id F3378603F0; Fri, 10 Apr 2026 17:41:16 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id F281010450082; Fri, 10 Apr 2026 19:41:14 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1775842876; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=KwQcWNOtwSww1tE4Ej8T9s6pqrHBg9EZ9z5kc47zF+c=; b=xCTfkMrymL7P7nBQyGQfECaGcvz4IFCFaydu29//TvtvzOMR/p6/NZbHpKfUoI+rHF5seq E4svM5ZGM/TArGt1N8OV6wV7MxYQ0JtdS/FWVjtqgGScjfOghwarKUM1qPmAXkVQfGAyfj pYHHo+XGDhKl6bLmGj9Ot9FtHjcD0LqFLqSYVhzyvBYHNqBwugPMtTHstiVI8LylpKLbA0 TKxV/3dGFRzOG/aghhRLcIMxR8sIRwKKWg83mYfjDIqr1tqrEMLY6VswGCPc6tfZ6mJ8/M buMw+mygFJzGPeDkrrNU1mUd1FRe8Xh8Bnbn3fM9t7QqDd1v/rW5389uFSRJtw== From: Miquel Raynal Date: Fri, 10 Apr 2026 19:41:01 +0200 Subject: [PATCH 1/5] spi: cadence-qspi: Revert the filtering of certain opcodes in ODTR 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: <20260410-winbond-6-19-rc1-oddr-v1-1-2ac4827a3868@bootlin.com> References: <20260410-winbond-6-19-rc1-oddr-v1-0-2ac4827a3868@bootlin.com> In-Reply-To: <20260410-winbond-6-19-rc1-oddr-v1-0-2ac4827a3868@bootlin.com> To: Mark Brown , Richard Weinberger , Vignesh Raghavendra , Pratyush Yadav Cc: Steam Lin , Thomas Petazzoni , linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, Miquel Raynal X-Mailer: b4 0.14.3 X-Last-TLS-Session-Version: TLSv1.3 I got mislead while analyzing the driver by the fact that the second opcode byte was in all cases smashed: if (op->cmd.dtr) opcode =3D op->cmd.opcode >> 8; else opcode =3D op->cmd.opcode; While at a first glance this doesn't let a chance to the second byte to be shifted out on the bus, this is actually the second step of an initialization, where the byte being apparently "ignored" in DTR mode has already been written in a dedicated "extended opcode" register. As such, the comment and the extra check that I proposed were entirely wrong, remove them. Fixes: bee085476d27 ("spi: cadence-qspi: Make sure we filter out unsupporte= d ops") Signed-off-by: Miquel Raynal --- My apologies for this mistake. Until now I never had to deal with "non repeated" opcodes. Now that I do, I realize that this was wrong. --- drivers/spi/spi-cadence-quadspi.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/spi/spi-cadence-quadspi.c b/drivers/spi/spi-cadence-qu= adspi.c index 649ff55333f0..87e49d913591 100644 --- a/drivers/spi/spi-cadence-quadspi.c +++ b/drivers/spi/spi-cadence-quadspi.c @@ -1538,10 +1538,6 @@ static bool cqspi_supports_mem_op(struct spi_mem *me= m, if (op->data.nbytes && op->data.buswidth !=3D 8) return false; =20 - /* A single opcode is supported, it will be repeated */ - if ((op->cmd.opcode >> 8) !=3D (op->cmd.opcode & 0xFF)) - return false; - if (cqspi->is_rzn1) return false; } else if (!all_false) { --=20 2.53.0 From nobody Mon Jun 15 14:00:02 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 C985E3DFC8E for ; Fri, 10 Apr 2026 17:41: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=1775842881; cv=none; b=dwuBxDg5bYrsI6TjdjRZ7glSJxAgNEdxeR5XAAoLwfAy6aD+1wMlEHc37dNbQEOZBWQ+0sh9MEo+hLbADxg+AX8aVQ8Jepd0ZS59akIOeY+TiSvcCsK7MkIOQitEwCiS02yXChaURsOE3xeTVPVHW0hfsGJV09UCn5HuNbnfnU0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775842881; c=relaxed/simple; bh=DxNUiAV8QQbcL1W9BD88f5w8fzduKyF8UwyVtXxgIH8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=S7QgrDBwjDE6f8IgR5nGte2khRLwWS0zshaGP70IP5WWo60jQe4nTXDjqa3TOHSQyJJNgZZlWO3enXGH45N4TG2U5PedGe/JKjepeUgYfFLO4ED/XR9GRmitIvYTontPBIN4TWoMcF0hs9XjVIYR5t1A9OAHs2OPTMMdxjLSTSo= 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=COUm0kju; 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="COUm0kju" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id 881AF4E429B4; Fri, 10 Apr 2026 17:41:18 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 5EF95603F0; Fri, 10 Apr 2026 17:41:18 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 7639510450087; Fri, 10 Apr 2026 19:41:16 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1775842877; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=2AC6qYaca5YIbXnwFi4AJhlPo8WH9aZ0yyO5uwUoPUg=; b=COUm0kju/z4kounke5nkPkUbc2iDip1hKvyMU9ThOfb6jduocKZ2+iRGdV+IO541mLXQMO TY3rpGKID5axBXVIDek0Qzn8Kf9r3c2WLVvyyYruFCFh/wHmfQFvcsS68VcJWQ3+0LMTxk Gr0NgenSplV/EfP3kQ4JpnwAEG1dd8kyk5S/dvJPp6LZlW01B5yc4U3xLuh7zpcUz3CBaD fLCx+FCFGe1wWNq1p38QrLiQ/J/o0GzLn6JiJYikU+gYqDzcxpaPLFdv/kfvJgUEe7ezEE xja0RYFQugTkG4MtV60mj6sdqbSW1OOECiF8gqZ9O/s/fTsrcqFL4RXvAfm1xw== From: Miquel Raynal Date: Fri, 10 Apr 2026 19:41:02 +0200 Subject: [PATCH 2/5] spi: spi-mem: Add a packed command operation 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: <20260410-winbond-6-19-rc1-oddr-v1-2-2ac4827a3868@bootlin.com> References: <20260410-winbond-6-19-rc1-oddr-v1-0-2ac4827a3868@bootlin.com> In-Reply-To: <20260410-winbond-6-19-rc1-oddr-v1-0-2ac4827a3868@bootlin.com> To: Mark Brown , Richard Weinberger , Vignesh Raghavendra , Pratyush Yadav Cc: Steam Lin , Thomas Petazzoni , linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, Miquel Raynal X-Mailer: b4 0.14.3 X-Last-TLS-Session-Version: TLSv1.3 Instead of repeating the command opcode twice, some flash devices try to pack command and address bits. In this case, the second opcode byte being sent (LSB) is free to be used. The input data must be ANDed to only provide the relevant bits. Signed-off-by: Miquel Raynal --- include/linux/spi/spi-mem.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/linux/spi/spi-mem.h b/include/linux/spi/spi-mem.h index 5774e554c0f0..f54c708f4c50 100644 --- a/include/linux/spi/spi-mem.h +++ b/include/linux/spi/spi-mem.h @@ -28,6 +28,14 @@ .dtr =3D true, \ } =20 +#define SPI_MEM_DTR_OP_PACKED_CMD(__opcode, __addr, __buswidth) \ + { \ + .nbytes =3D 2, \ + .opcode =3D __opcode << 8 | __addr, \ + .buswidth =3D __buswidth, \ + .dtr =3D true, \ + } + #define SPI_MEM_OP_ADDR(__nbytes, __val, __buswidth) \ { \ .nbytes =3D __nbytes, \ --=20 2.53.0 From nobody Mon Jun 15 14:00:02 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 DC1643E3C7D for ; Fri, 10 Apr 2026 17:41:26 +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=1775842888; cv=none; b=Lr91jgezOntd8W5RXtRES1VeWf6QrmjhB0VL1zlFAPu2lz4nUM/NMlOjNfFkIPBsOxOGp1kCPSI/a2c+JsjC1i+VpX8nK1vNuaDjpw+2bvyrwcItTdXwC0uAZiU7EUiS3SMxEvTPXA0/g0HwNpJkY1gn7BCi2qjJWzYO83LAK5I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775842888; c=relaxed/simple; bh=oRg4xD7giSktolVfRvNHB4EUWqhqb/UUkZKmOAf3l9k=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=IWLqsNKV/ermuyKdxdMNz3C3g8IGK6c9rTl3Y8eezpnnEsqLU6Vc3/KCIEE/ndeP+SWrZ/sOCPHN1satJAQvHYaz9J4CXbo5+pQ5sVE0mxECEfgpMgYlEbwqDyneH5/21zeAJ6a6LjeowEXn7FYXOJlYRElb3Lq2MlVBL2kAxD8= 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=bLI7mquF; 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="bLI7mquF" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id B98CC1A326B; Fri, 10 Apr 2026 17:41:19 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 8FD18603F0; Fri, 10 Apr 2026 17:41:19 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id D786D10450085; Fri, 10 Apr 2026 19:41:17 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1775842878; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=5i86694lMeG7kylMxcMPx4GdJDrXhoBS7Gx4ntdJ5OQ=; b=bLI7mquFFWnVp00o0oHH9cqiMpthDSACGYJeebI0hLpcQCvNo7uVlnTPmUmFHK7l+sVuuP tQgBdTH7L3PiJ0lfkgyvZEhuSwS8bfW+cJNQdE7z9EJXSP9mmxtfoZHoQlHli44dxzZK4N UM+E7obF/bgroHUjwk4CXeHzovUTAEY/lg2KRivohSdJBCwtehx6czR6GhbVElqR3ZsFQL 4JUrdsWiugGhSZsoudEmLJYpS+bZO3p+xacV9NwFiIonpNOU/uTJC9h1XotpNw7PQf4kgL ptdS3bJl4C6Xfi1sKFzg3gvtwQRCb/oV4+Hq34id0DGzve7r3LdkGEmypYLMow== From: Miquel Raynal Date: Fri, 10 Apr 2026 19:41:03 +0200 Subject: [PATCH 3/5] mtd: spinand: Add support for packed read data ODTR commands 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: <20260410-winbond-6-19-rc1-oddr-v1-3-2ac4827a3868@bootlin.com> References: <20260410-winbond-6-19-rc1-oddr-v1-0-2ac4827a3868@bootlin.com> In-Reply-To: <20260410-winbond-6-19-rc1-oddr-v1-0-2ac4827a3868@bootlin.com> To: Mark Brown , Richard Weinberger , Vignesh Raghavendra , Pratyush Yadav Cc: Steam Lin , Thomas Petazzoni , linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, Miquel Raynal X-Mailer: b4 0.14.3 X-Last-TLS-Session-Version: TLSv1.3 Some devices stuff address bits in the double byte opcode (in place of the repeated byte) in order to be able to increase the size of the devices, without adding extra address bytes. Create a flag to identify those devices. When the flag is set, use the "packed" variant for the read data operation. Signed-off-by: Miquel Raynal --- drivers/mtd/nand/spi/core.c | 24 +++++++++++++++++++++--- include/linux/mtd/spinand.h | 7 +++++++ 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c index 66c90419f6d5..96154f359e1a 100644 --- a/drivers/mtd/nand/spi/core.c +++ b/drivers/mtd/nand/spi/core.c @@ -100,6 +100,17 @@ spinand_fill_page_read_op(struct spinand_device *spina= nd, u64 addr) return op; } =20 +static struct spi_mem_op +spinand_fill_page_read_packed_op(struct spinand_device *spinand, u64 addr) +{ + struct spi_mem_op op =3D spinand->op_templates->page_read; + + op.cmd.opcode |=3D addr >> 16; + op.addr.val =3D addr & 0xFFFF; + + return op; +} + struct spi_mem_op spinand_fill_prog_exec_op(struct spinand_device *spinand, u64 addr) { @@ -453,7 +464,10 @@ static int spinand_load_page_op(struct spinand_device = *spinand, { struct nand_device *nand =3D spinand_to_nand(spinand); unsigned int row =3D nanddev_pos_to_row(nand, &req->pos); - struct spi_mem_op op =3D SPINAND_OP(spinand, page_read, row); + bool packed =3D spinand->flags & SPINAND_ODTR_PACKED_PAGE_READ; + struct spi_mem_op op =3D packed ? + SPINAND_OP(spinand, page_read_packed, row) : + SPINAND_OP(spinand, page_read, row); =20 return spi_mem_exec_op(spinand->spimem, &op); } @@ -1489,9 +1503,13 @@ static int spinand_init_odtr_instruction_set(struct = spinand_device *spinand) if (!spi_mem_supports_op(spinand->spimem, &tmpl->blk_erase)) return -EOPNOTSUPP; =20 - tmpl->page_read =3D (struct spi_mem_op)SPINAND_PAGE_READ_8D_8D_0_OP(0); - if (!spi_mem_supports_op(spinand->spimem, &tmpl->page_read)) + if (spinand->flags & SPINAND_ODTR_PACKED_PAGE_READ) + tmpl->page_read =3D (struct spi_mem_op)SPINAND_PAGE_READ_PACKED_8D_8D_0_= OP(0); + else + tmpl->page_read =3D (struct spi_mem_op)SPINAND_PAGE_READ_8D_8D_0_OP(0); + if (!spi_mem_supports_op(spinand->spimem, &tmpl->page_read)) { return -EOPNOTSUPP; + } =20 tmpl->prog_exec =3D (struct spi_mem_op)SPINAND_PROG_EXEC_8D_8D_0_OP(0); if (!spi_mem_supports_op(spinand->spimem, &tmpl->prog_exec)) diff --git a/include/linux/mtd/spinand.h b/include/linux/mtd/spinand.h index 6a024cf1c53a..f2f80103649d 100644 --- a/include/linux/mtd/spinand.h +++ b/include/linux/mtd/spinand.h @@ -290,6 +290,12 @@ SPI_MEM_OP_NO_DUMMY, \ SPI_MEM_OP_NO_DATA) =20 +#define SPINAND_PAGE_READ_PACKED_8D_8D_0_OP(addr) \ + SPI_MEM_OP(SPI_MEM_DTR_OP_PACKED_CMD(0x13, addr >> 16, 8), \ + SPI_MEM_DTR_OP_ADDR(2, addr & 0xffff, 8), \ + SPI_MEM_OP_NO_DUMMY, \ + SPI_MEM_OP_NO_DATA) + #define SPINAND_PAGE_READ_FROM_CACHE_8D_8D_8D_OP(addr, ndummy, buf, len, f= req) \ SPI_MEM_OP(SPI_MEM_DTR_OP_RPT_CMD(0x9d, 8), \ SPI_MEM_DTR_OP_ADDR(2, addr, 8), \ @@ -482,6 +488,7 @@ struct spinand_ecc_info { #define SPINAND_HAS_PROG_PLANE_SELECT_BIT BIT(2) #define SPINAND_HAS_READ_PLANE_SELECT_BIT BIT(3) #define SPINAND_NO_RAW_ACCESS BIT(4) +#define SPINAND_ODTR_PACKED_PAGE_READ BIT(5) =20 /** * struct spinand_ondie_ecc_conf - private SPI-NAND on-die ECC engine stru= cture --=20 2.53.0 From nobody Mon Jun 15 14:00:02 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 30A31350D7F for ; Fri, 10 Apr 2026 17:41:21 +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=1775842883; cv=none; b=KRiRWi9/7Fgd77lcpzEDah09fQDyLTr+yMT6wTzm+GK5MOcTunZ7sBnpOTvuWjTNJqLuR/nzfKe5GPqTPFO8umh8MdLJvbxGZsg8fjJr1CJmrK0Pn2I73FUua6wVolj7s4QvcqwA0n8iM+8p5v1pwA9i4Cwfs58rNWForrSenW8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775842883; c=relaxed/simple; bh=w5j83Yxg1BUvrGYayXPEbnuDSb8c7L/2/ix+FqlhFYk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=C+0V+Vf5Y4s3AT/Eb3EHbVK227Oq9k19z9jB/aK9+9/1evZUKw63EvxzUaGHTZfC4yDQM7ys6OABgYQdqfe7yDPxV/5ubOFEDXJqxkBRUbrLYkoPJ3aUtWPXvFTGkJud0ytTNydX+T5ndeF3P+y5UViNXgihEQI3aiWOu4fQM9o= 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=RfbMYEke; 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="RfbMYEke" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id 31006C5C1A8 for ; Fri, 10 Apr 2026 17:41:56 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id E8A51603F0; Fri, 10 Apr 2026 17:41:20 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 226AD10450081; Fri, 10 Apr 2026 19:41:19 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1775842880; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=bAVqa4MQXm7GdlPrbv7BpQQFj39D/pUUubDLu72NyMI=; b=RfbMYEke9rGFR7c6cTZKWElMdomfmM05zlbY+k17DJCJH7/CHnvw4PBCpRfKwCjg923VFT 7FmYoYGOKFpc9xwdIhQbJjA3Rn4FqyZ/n5JCp8fwB4nDc+4qtKkNNL/NAhb7+WXmXWxzvu Wr4hcn1mUK+xklrhfwEBHdRpwA9uVMqo9RaW8kIL+Mv42JiKef4fCnn7YUCed/gALp+hPX wSpXuoPvjGIl8VOkYcdXbNvRnjJb3IgUlNDWf28HiPfqDnvyuXOVm/KddBhMFC2EO3OVTR rtiXEC2anYAt9mQkaXRZws/AjqFNJ5SsxdGzf9lNcj7oynpsgVQ6/z8d6LVXfg== From: Miquel Raynal Date: Fri, 10 Apr 2026 19:41:04 +0200 Subject: [PATCH 4/5] mtd: spinand: winbond: Set the packed page read flag to W35N02/04JW 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: <20260410-winbond-6-19-rc1-oddr-v1-4-2ac4827a3868@bootlin.com> References: <20260410-winbond-6-19-rc1-oddr-v1-0-2ac4827a3868@bootlin.com> In-Reply-To: <20260410-winbond-6-19-rc1-oddr-v1-0-2ac4827a3868@bootlin.com> To: Mark Brown , Richard Weinberger , Vignesh Raghavendra , Pratyush Yadav Cc: Steam Lin , Thomas Petazzoni , linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, Miquel Raynal X-Mailer: b4 0.14.3 X-Last-TLS-Session-Version: TLSv1.3 Both W35N02JW and W35N04JW diverge from W35N01JW when it comes to the "data read" operation in ODTR mode. In order to stuff more address bits (up to 18), the second command byte is replaced by the most significant address bits, keeping the number of address bytes to 2. Fixes: 44a2f49b9bdc ("mtd: spinand: winbond: W35N octal DTR support") Signed-off-by: Miquel Raynal --- drivers/mtd/nand/spi/winbond.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/mtd/nand/spi/winbond.c b/drivers/mtd/nand/spi/winbond.c index 6dfd0dcc8ee7..a3fca8a1cff1 100644 --- a/drivers/mtd/nand/spi/winbond.c +++ b/drivers/mtd/nand/spi/winbond.c @@ -515,7 +515,7 @@ static const struct spinand_info winbond_spinand_table[= ] =3D { SPINAND_INFO_OP_VARIANTS(&read_cache_octal_variants, &write_cache_octal_variants, &update_cache_octal_variants), - 0, + SPINAND_ODTR_PACKED_PAGE_READ, SPINAND_INFO_VENDOR_OPS(&winbond_w35_ops), SPINAND_ECCINFO(&w35n01jw_ooblayout, NULL), SPINAND_CONFIGURE_CHIP(w35n0xjw_vcr_cfg)), @@ -526,7 +526,7 @@ static const struct spinand_info winbond_spinand_table[= ] =3D { SPINAND_INFO_OP_VARIANTS(&read_cache_octal_variants, &write_cache_octal_variants, &update_cache_octal_variants), - 0, + SPINAND_ODTR_PACKED_PAGE_READ, SPINAND_INFO_VENDOR_OPS(&winbond_w35_ops), SPINAND_ECCINFO(&w35n01jw_ooblayout, NULL), SPINAND_CONFIGURE_CHIP(w35n0xjw_vcr_cfg)), --=20 2.53.0 From nobody Mon Jun 15 14:00:02 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 7D4FB3E3C73 for ; Fri, 10 Apr 2026 17:41:23 +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=1775842884; cv=none; b=lhuX+T3zP5StPQ/5Tm7ASkSDAZuUJBSaFyenUOOKIVFVLUXqkS/TM2DTvv7Yef9CalvMZLuWR2cD3pjAI+uNr0YTqEsod00PaJ9TnLzM26dGhPVhSj2l2EV8GBIQlEt7Zi8W+kI2iww+7iJjh0/l3dqhhBaouvGNMBT4MEEPHOQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775842884; c=relaxed/simple; bh=DJbex3xS/bQ4FcMq9cHTcUH6TP2zJFTZIIzzT/4C8L0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=a6kj5pCMM1VCWVz5W7WunwcbNFANMQjaF3j+fugua8RMT0ANKnVBA92sZNDLKA5AHGuePnI6A7gDoeU5mZOnQCtNsAsl5r2LOFeZd1hBQInaYWpZ1pGyVrwIDixofrnHPGVOsJLt8LmsFwgiaWEZ4bvNSHKTnhkViEDsLJcRZAQ= 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=Ep5+M9HS; 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="Ep5+M9HS" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id 427B24E429B3; Fri, 10 Apr 2026 17:41:22 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 11EE7603F0; Fri, 10 Apr 2026 17:41:22 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 6E68C10450082; Fri, 10 Apr 2026 19:41:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1775842881; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=6cCsRdWer/xoQr7FKNryl+BMiMzpUL7o1CHo+cPuu2k=; b=Ep5+M9HSLHRDyXiart+fWuti+USarJuRC0e2PDVSq+djwVJ6Oh+zRrsL0e5uwaGwE239dD bOK4GJnkoif2eeCOt6hVLaEYEn/9peMDHTJsqxi0ln/DzLdPKkygB46wM+NnJvxu3LlHWy AHRsosfbC0a+zgPP4eocSgaDMwJT9Pc0ovX/3QiP83dsmNdrn2l4X8dVJ6VUZxXK0EnOV1 VmeZKLrYauSeHDu/6I7R5/IabzaOu6gNfLZJIlFE9lUHM2lx6Bth2k5Yvkvt2j31M04oVv xOqO73DY8Dtm+YloPGf5w5EpES9vWbMbNksoBu9PirNe16o4Ci7Nx7XhQoKCxQ== From: Miquel Raynal Date: Fri, 10 Apr 2026 19:41:05 +0200 Subject: [PATCH 5/5] mtd: spinand: winbond: Fix ODTR write VCR on W35NxxJW 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: <20260410-winbond-6-19-rc1-oddr-v1-5-2ac4827a3868@bootlin.com> References: <20260410-winbond-6-19-rc1-oddr-v1-0-2ac4827a3868@bootlin.com> In-Reply-To: <20260410-winbond-6-19-rc1-oddr-v1-0-2ac4827a3868@bootlin.com> To: Mark Brown , Richard Weinberger , Vignesh Raghavendra , Pratyush Yadav Cc: Steam Lin , Thomas Petazzoni , linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, Miquel Raynal X-Mailer: b4 0.14.3 X-Last-TLS-Session-Version: TLSv1.3 In most scenarios this variant is actually unused (VCR is written in SSDR mode), but we need to provide an octal variant. The address is 24 bits but is sent over 4 bytes MSB first. This means we need to shift the register address by one extra byte for the address to be correct. I didn't catch this initially because the volatile register region is 256 bytes wide, so the write-then-read procedure did work with the small register addresses I was using at that time: 0 and 1. Fixes: 44a2f49b9bdc ("mtd: spinand: winbond: W35N octal DTR support") Signed-off-by: Miquel Raynal --- drivers/mtd/nand/spi/winbond.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mtd/nand/spi/winbond.c b/drivers/mtd/nand/spi/winbond.c index a3fca8a1cff1..269fc587c5fe 100644 --- a/drivers/mtd/nand/spi/winbond.c +++ b/drivers/mtd/nand/spi/winbond.c @@ -99,7 +99,7 @@ static SPINAND_OP_VARIANTS(update_cache_variants, =20 #define SPINAND_WINBOND_WRITE_VCR_8D_8D_8D(reg, buf) \ SPI_MEM_OP(SPI_MEM_DTR_OP_RPT_CMD(0x81, 8), \ - SPI_MEM_DTR_OP_ADDR(4, reg, 8), \ + SPI_MEM_DTR_OP_ADDR(4, reg << 8, 8), \ SPI_MEM_OP_NO_DUMMY, \ SPI_MEM_DTR_OP_DATA_OUT(2, buf, 8)) =20 --=20 2.53.0