From nobody Wed Dec 17 07:31:29 2025 Received: from mail-pj1-f45.google.com (mail-pj1-f45.google.com [209.85.216.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9A0E21C8637; Wed, 19 Mar 2025 09:48:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742377686; cv=none; b=XMUKPgoF3RYTd5B3UwCTQ1sWpU9gOafIJwGNS6DpQrwMwH+pA6rgzO/YfIgrE6lqMdgRkUWgqFW/j5m8WY40BZKFmQOVmPXIokV4BUXKfvcbv0N8+7dLAVNY9aAESvucVWxg7fLpZOitai2beXKGXxgE8iXXNiE3d+40Ka9luMY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742377686; c=relaxed/simple; bh=VktMu45HLVO/NWd1qA6YTia9Y5dgNUfWig8y5ndhO9I=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=QFDNO4U/L8yo+sKVtwfLY9uVD1XPcJ67bIDYxGBdCfrha09Sd8UM5NUCvIPFHP8ngaVWoHpf6CgalR1mHI6TsnUIX3VwKzKMrGuO494G2NoGe9u8VQR314qLVY/b9SudncOEh8FjS8UpWFn+318B2c6zDalZMlHEaTxR/OKYJvk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=YlE3rIsg; arc=none smtp.client-ip=209.85.216.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="YlE3rIsg" Received: by mail-pj1-f45.google.com with SMTP id 98e67ed59e1d1-300f92661fcso7018009a91.3; Wed, 19 Mar 2025 02:48:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1742377684; x=1742982484; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=jO5WZTMo+C5iTCX7S7g0gim47PztvreZd6gINV7Mu5Y=; b=YlE3rIsgDoXm2izP6g/B1KateKJtTX9BKpUZfGdSmTHAnONaO1H8eagjVF0wFice0r 0gl1ekUHOjPZ3NYJuA/dVtFNSrvHnR4GilVZK6Y8dKq+uFreJHQuGQZj3ByUAEhMzFK9 qdIgSrXC6k3XyNApwWApMLnsogef+wfdqmq8E1RCAw1lpeyU798QovvvirObzifgb3yW zk2a6taw4ckzwK97nYUKN2IReW+m1wc6/SzOqb7hDhz+jbX6pN7MM1mmf2nu9xWfP0OC T2eVAI8YrGtfJm0jq+qFwcEAqtpLv37HyyYQ5epU5rfh9ijdaTCm4QEQiOjN93LRW3Qf efww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742377684; x=1742982484; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jO5WZTMo+C5iTCX7S7g0gim47PztvreZd6gINV7Mu5Y=; b=eN9e/icCVohFnhs7eV78nfOg0X0jGPMZuA0V24h7gCFYdbavALtCdog2igqIhHCHmO 3CKsuNb6GxF3c8N8BTwszJ9pjKYyEkNJ9TCXOJ0cbs1ngLzsReOP3fYfgkVjH1MUDjPv M0CQJYiZNeTK8R0fkMM2t7OznYrETdq0gEh5Bj7eTgSI1Yt6j1JwoqAOWbZyhYCOwQRY qCgrOX9CNBLKwLahDAtCZE/PaTRVUKyYGfBx8d4EAa+g0MK3GlnHDq6HzKlhbZxd+a8t ZXWOJnu0ahop6xBOYVKdJBXwdIatP5vm0nMuu6b4ysBCrNOh5YqS32puG3JzJqD2wrC4 Tw2Q== X-Forwarded-Encrypted: i=1; AJvYcCU9nUEKOK9MYP359yca9Oh+ytrDGqEv+lbaQuD8d+618QIU91FCnIHjI0CBRCbH2iJj6iSlrgLJWnpI5sKj@vger.kernel.org, AJvYcCXSsQhbu3A6J5vLJyy3ZmkwkkuG3Ld0vHJK7XXTEHRASTIjMmy0mwoRyin5kzMabNeIIOqbySkZhsk6@vger.kernel.org X-Gm-Message-State: AOJu0YxrRE3I6lZNICUqsElT+du2yvBe+R7eEv/9v5y1Wm7M2/htz3ve +qwQfjahgcxRPw3L+pzaVVTb8wAeQDiHxlzcm0nBEvVKnK2JKmQZyuG0Tg== X-Gm-Gg: ASbGncucgfiUqcL3dDJobbVLvHUa5NqiSTCugZWQJv7BtL21G49BnFGkFwEiG15Uoe8 J4XI3YYWehOMQPjgzAKNk6aaMcFxOriHsX5YvlMdmsJS0BJVeMbLQf3Y/FdFznJDzvGlCOUVSd0 /o9yDvudjDz5nKMCS+T0/Bi3w+JJhE2P/AtxbjvIx2GXlah/0Jkr4Y03mKo6mYb6BYIuW9JlFz7 4n1a+AhHs8+Wza51igqRAZueUcGGMYbkdCQLV3Nm9hpKxgF1FDXogLqJP6AGq5vpvBP7cFHgXGr KxQSJsTpW/HI20TxN8EpRSzXuzZTgJBa9kSvFBsOQZuL13QKAPKh3vYRlnDR2MRxRbA1FzCAElf fnyWDtWdQoRISKqUajH2GbZWs65OUaws+k8xBzA== X-Google-Smtp-Source: AGHT+IHGVpw5pZ4oUibijuz5f/+swAD6+UTqPpA7k0Fjh56CPVAS60cjsY1TImQyPXPs20LFApE6UQ== X-Received: by 2002:a17:90b:38c9:b0:2ff:6e72:b8e9 with SMTP id 98e67ed59e1d1-301be204e98mr3374142a91.25.1742377683407; Wed, 19 Mar 2025 02:48:03 -0700 (PDT) Received: from ISCN5CG2520RPD.infineon.com (KD106168128197.ppp-bb.dion.ne.jp. [106.168.128.197]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-301bf589bccsm1103483a91.11.2025.03.19.02.47.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Mar 2025 02:48:03 -0700 (PDT) From: Takahiro Kuwano X-Google-Original-From: Takahiro Kuwano Date: Wed, 19 Mar 2025 18:47:43 +0900 Subject: [PATCH 1/3] dt-bindings: mtd: jedec,spi-nor: add optional rdid-dummy-ncycles 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: <20250319-snor-rdid-dummy-ncycles-v1-1-fbf64e4c226a@infineon.com> References: <20250319-snor-rdid-dummy-ncycles-v1-0-fbf64e4c226a@infineon.com> In-Reply-To: <20250319-snor-rdid-dummy-ncycles-v1-0-fbf64e4c226a@infineon.com> To: Tudor Ambarus , Pratyush Yadav , Michael Walle , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: linux-mtd@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Bacem Daassi , Takahiro Kuwano X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1742377674; l=1447; i=Takahiro.Kuwano@infineon.com; s=20250227; h=from:subject:message-id; bh=VktMu45HLVO/NWd1qA6YTia9Y5dgNUfWig8y5ndhO9I=; b=XvOo13JqixpDnCoEo8S6z9Y/baIU7177u9z0q4G4EUIT19h8F+RPtZzhwjNCtX37ffHAB1tia ObbMUd7FtVbCzagGduowO0iBzKpwbZJSykZW053bB/uxCJ7f8I7fCHN X-Developer-Key: i=Takahiro.Kuwano@infineon.com; a=ed25519; pk=aS8V9WLuMUkl0vmgD0xJU19ZajdJmuyFBnBfVj0dfDs= There are infineon flashes [1] that require 8 dummy cycles for the 1-1-1 Read ID command. Since the command is not covered by JESD216 or any other standard, introduce an optional "rdid-dummy-ncycles" DT property to allow flashes to be correctly identified. Link: https://www.infineon.com/dgdl/Infineon-CYRS17B512_512_MB_64_MB_SERIAL= _NOR_FLASH_SPI_QSPI_3-DataSheet-v07_00-EN.pdf?fileId=3D8ac78c8c8fc2dd9c0190= 0eee733d45f3 [1] Signed-off-by: Takahiro Kuwano --- Documentation/devicetree/bindings/mtd/jedec,spi-nor.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Documentation/devicetree/bindings/mtd/jedec,spi-nor.yaml b/Doc= umentation/devicetree/bindings/mtd/jedec,spi-nor.yaml index 335f8204aa1ebce3d2b4686b2a06d0ea3791667c..25abbe4f5d17f66215fa1af097d= 14de4a6ef776f 100644 --- a/Documentation/devicetree/bindings/mtd/jedec,spi-nor.yaml +++ b/Documentation/devicetree/bindings/mtd/jedec,spi-nor.yaml @@ -63,6 +63,12 @@ properties: it can not be detected at runtime. Refer to your chips' datasheet to= check if this is supported by your chip. =20 + rdid-dummy-ncycles: + $ref: /schemas/types.yaml#/definitions/uint32 + description: + Number of dummy cycles for the 1-1-1 Read ID command, if not zero. + The Read ID command is not covered by JESD216 or any other standard. + broken-flash-reset: type: boolean description: --=20 2.34.1 From nobody Wed Dec 17 07:31:29 2025 Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A77EF2580F2; Wed, 19 Mar 2025 09:48:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742377690; cv=none; b=arcyrVNeoLZNvxN7mAelfSAYf8VYX81KXY+DaqOgPklQKYu/PUhFR64fQg6bXdst35ZbE/JmycBRvPE1Wb8Mud33zVu2Fbenw+F44npcNW+2s4e2eX/bGt04Ra+L7kl4Ul+vg8CQoAfYCqGC7iZ4SwdtBeHaLWul76fA8kGEtbw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742377690; c=relaxed/simple; bh=ScfM3+8+EJIZU5+Lu3q329qWBAmdoTXsh4O0GU3+m3o=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=E6w8yxkjiyixg5XnXbTFvY6G8mket3XYwSXsOnh25dGUE94Mb7O9jniFrcCEItrNovWWXWp5bqP+PwnENufdeKCyQJKA2AmRAIiTeVpBwQWczdrnwLwbwssDgBvjxvv0k7qsiwy4iJiwferEHiFHcAJY2NGUTvgykl/xyWX5k+8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ERa7AVC1; arc=none smtp.client-ip=209.85.214.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ERa7AVC1" Received: by mail-pl1-f181.google.com with SMTP id d9443c01a7336-22435603572so107973595ad.1; Wed, 19 Mar 2025 02:48:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1742377688; x=1742982488; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=zAPU6J8SAHBswu5KPS/clGE6GclHv6M2l/Gea+md2MI=; b=ERa7AVC1fvc0Q+1fX+OGIgC0xSRxunXGFJcjdb8sH62Ldw02nb27xmr0MVDSkdiWgV t/Kvyoo4lc7dltZA/50OscwCYnKnnOqBwfGX8BjcEB4OvWM6nS1CyK/g3tipp+noCfw+ +P90dDaqD0kBcDH2ikyhgRtBXx922kU3Uxmyxaj4sbwHReW/wU2aeMnxy/qHOF91tob3 GU2zdlVtXpTMEpgSbVw0NzWytPyfS+vAvTXI+17EiDWbqQcFwuYwlgg9gO16+H7ijmYi 88oHSBR4USHRlYT8ik6Band/VgzeBxbntz18RXo4lu/htwNrb9JVMOKNZ6eP/IOfkAkS 6VuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742377688; x=1742982488; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zAPU6J8SAHBswu5KPS/clGE6GclHv6M2l/Gea+md2MI=; b=LRQNflx6YdECT8+xFd/TZwlFnLPvd9X4U6tp1E4hbIN8Goak/3m0r+HyFeNCQhSWHd ynK2eTNw5KeIO9QHgm38hMmgF1oQFmK/7drdKkS/S9kRR7EaJem53hZzW+SYIWz3i6/t vGVkO3C/RRMdJWnzTaByAlfgi9ijMJyelLY6D7KPClJtxskW0Ndmqp82NhBm3wCrErWd VLlBHbUnbg5aZeFE5Rvr2HEIh6aA96z87PXc2Z6zmFK2t1c4L6jKO2faKrOuNKcc05Yr qZx25tX8PcLlt9jINlQTCAmV4P8IRsoFNDxWnRIWGb+1FNS2bP6zG1Pm/hJulJm9SiLj xp6w== X-Forwarded-Encrypted: i=1; AJvYcCV/F58C994SpGP21vR4CZdLomHExo2KAXunvccAQ8/l7+lYopZJMQTPkN1N8X2USCmbtBks30LSOXm8@vger.kernel.org, AJvYcCV9oxBLKaKQ28HntbQ/UbZMOobtWsUAhFmtbII7Sio2kLs6260xGdilNft9OZUA4xvKAjI4CGlgN5BjFwrQ@vger.kernel.org X-Gm-Message-State: AOJu0YzuTmpRdHQfdX2nvdgPouVdAKEK9z/24Xz6P3ifoRn0VOu5lNhU F7aKAve9JrNZZL7VfRL0AvcNrT6Xb6PCE2ay1BJTqPGcYgGCzS/d0kIzYg== X-Gm-Gg: ASbGncuTNgzOVFyuhhVHMDm9LhHjfSoGHOU7ilU7j82JVwODl9Oq/qUjnFKE7+yEcyv wVLy1B8y/0rQpjLovDRizra4xgi0kVdxib27t0BxZ+2pf76DWBhaVETgOjAY9VwbEDH8ItzLrVL pr5zchZk9oWyZBTmUu6wukZc4r0RmS7tJfKIz7nB36ACN0BUNpbNO84eUVHd21bEMMsIEAlU3O8 CNpUDrPpIpgg6/kc7P3zf94rOIv1uwSDrTQGIN6FK+OHVsHVeOfllQKjPtDQGQ+t1iMmz/nsW16 NXiQZcKetnOH1HlA1hF6msrSUcGN8cKkOVJSrt0rTraE7kppVHtp/IUmiG/NBlZhIksYl/0olKa pcyZN+/dFSj+CnW4X2nAsP9PVClJGURxC5iaCTQ== X-Google-Smtp-Source: AGHT+IFwkCGCNCZFHxXbmd2VPJkFvQEuo4pfqxBeGBsinv3TRNIY+NeDJRgxareZ7PlpncQXBtU1wQ== X-Received: by 2002:a17:902:d2cc:b0:223:33cb:335f with SMTP id d9443c01a7336-2264980c709mr32228935ad.3.1742377687888; Wed, 19 Mar 2025 02:48:07 -0700 (PDT) Received: from ISCN5CG2520RPD.infineon.com (KD106168128197.ppp-bb.dion.ne.jp. [106.168.128.197]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-301bf589bccsm1103483a91.11.2025.03.19.02.48.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Mar 2025 02:48:07 -0700 (PDT) From: Takahiro Kuwano X-Google-Original-From: Takahiro Kuwano Date: Wed, 19 Mar 2025 18:47:44 +0900 Subject: [PATCH 2/3] mtd: spi-nor: use rdid-dummy-ncycles DT property 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: <20250319-snor-rdid-dummy-ncycles-v1-2-fbf64e4c226a@infineon.com> References: <20250319-snor-rdid-dummy-ncycles-v1-0-fbf64e4c226a@infineon.com> In-Reply-To: <20250319-snor-rdid-dummy-ncycles-v1-0-fbf64e4c226a@infineon.com> To: Tudor Ambarus , Pratyush Yadav , Michael Walle , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: linux-mtd@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Bacem Daassi , Takahiro Kuwano X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1742377674; l=1784; i=Takahiro.Kuwano@infineon.com; s=20250227; h=from:subject:message-id; bh=ScfM3+8+EJIZU5+Lu3q329qWBAmdoTXsh4O0GU3+m3o=; b=DIk+3FpIU2asCn6le4wKHaawnoXw5LZpljxg+BE5i1X19lXI0j/ynzbqbU9cWWjzai5dqTp9S dboNWFSfmjgA28hk3MPHZcUKUHwe13V4P5xFxpWREkvnVbm4g044gaD X-Developer-Key: i=Takahiro.Kuwano@infineon.com; a=ed25519; pk=aS8V9WLuMUkl0vmgD0xJU19ZajdJmuyFBnBfVj0dfDs= There are infineon flashes [1] that require 8 dummy cycles for the 1-1-1 Read ID command. Since the command is not covered by JESD216 or any other standard, get the number of dummy cycles from DT and use them to correctly identify the flash. Link: https://www.infineon.com/dgdl/Infineon-CYRS17B512_512_MB_64_MB_SERIAL= _NOR_FLASH_SPI_QSPI_3-DataSheet-v07_00-EN.pdf?fileId=3D8ac78c8c8fc2dd9c0190= 0eee733d45f3 [1] Signed-off-by: Takahiro Kuwano --- drivers/mtd/spi-nor/core.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c index 19eb98bd68210f41acd716635c02a8936678a385..6452ae6eecee3325b52cdcc2cc9= 703355951e0db 100644 --- a/drivers/mtd/spi-nor/core.c +++ b/drivers/mtd/spi-nor/core.c @@ -7,6 +7,7 @@ * Copyright (C) 2014, Freescale Semiconductor, Inc. */ =20 +#include #include #include #include @@ -16,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -2011,9 +2013,14 @@ static const struct flash_info *spi_nor_detect(struc= t spi_nor *nor) { const struct flash_info *info; u8 *id =3D nor->bouncebuf; + u32 ndummy =3D 0; int ret; =20 - ret =3D spi_nor_read_id(nor, 0, 0, id, nor->reg_proto); + if (!of_property_read_u32(nor->dev->of_node, "rdid-dummy-ncycles", + &ndummy)) + ndummy /=3D BITS_PER_BYTE; + + ret =3D spi_nor_read_id(nor, 0, ndummy, id, nor->reg_proto); if (ret) { dev_dbg(nor->dev, "error %d reading JEDEC ID\n", ret); return ERR_PTR(ret); --=20 2.34.1 From nobody Wed Dec 17 07:31:29 2025 Received: from mail-pj1-f42.google.com (mail-pj1-f42.google.com [209.85.216.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 23A9B259C8C; Wed, 19 Mar 2025 09:48:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742377694; cv=none; b=pUli7sOvZFlBJmUKcOJ/6ZhH7xn41+U0z+m+05qdc2VNkgfomQS+J/3laK0MW8g2ZBC39mjSKELXtaQ5nVqNxhLfsh4A4/GgtbUWvJ5zC73t2wvSv07gJm79e+KAVMhB3lWAvqNFY38UZOA2d0s3/fc1orAjz7hwyaKJwndo7YI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742377694; c=relaxed/simple; bh=oC9jr2u9u9kL8fmEU1SCe11rMhVquUDrj9AQX+3QGZI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=PQ3MGS6PAnKxL0r4EvqDmpecM8v5dVKttmrVaOH56404yKDd/SA9Ahs/yli6+VKHn0X0SPWzDb+erKptM5Qdir1q3wNQm+hPd+BZdwbyK1+7uneD6dg2PIeFyh+w6a6prtdlB6xjehYxlvSvVx/wlc0BAaOaHJN4uMi0OKIbdQQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=SJy7yxrU; arc=none smtp.client-ip=209.85.216.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="SJy7yxrU" Received: by mail-pj1-f42.google.com with SMTP id 98e67ed59e1d1-2ff6cf448b8so8983558a91.3; Wed, 19 Mar 2025 02:48:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1742377692; x=1742982492; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=KiTUzGwvFyFv761R//GGBbXNIZo/DnycRt14EYeHTgo=; b=SJy7yxrU/M1FyMxUiWCVLsd48I4guklUwqa/AJ2u/o7yP+lhuw3a3JS/UB1sR5wlmH nyEl2v69d8nVJw4ANdO5cs51hoj2cJXtxs47OMAyDlOZhhVoWp+bpu1IOFSpjp3D+jAh Q4PCx07pB8SRcn48LdsbvuEwKeWj6Ov2d589QuCG45rFDNy56iaG/qgZ12bSo7gaeHj4 RfXgQjJ9klUv6EWKqakSlB8152ZAI9cOb0XgMKdDav5Qa5xUIlLiPCMMpgs/gjib1Erg TNy1oSfgI7YsIKtffTBzL/XYFzBqcPvOKrkSIPSY/CfBIPmNaq7DeRuHKYaK20vnVzhP l6iA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742377692; x=1742982492; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KiTUzGwvFyFv761R//GGBbXNIZo/DnycRt14EYeHTgo=; b=a6FuaNHxTHOz1CX6ndVp/i7U6H9P4FYG96crn+11XbswrcLzdhvdJm/A0h0Ej887kf dA0hPY8l8Lcb+ZkghgJ65KWC2v2PfJ+7M4RogVDl5iFP0TAFyFPnFUSaFoP74TIsS3dp RO0ywPFcoE5kP65GV6KutUe+LDLoGhqMcl0zerE4Je9GEUqIqmu9fFuC8xJ83s7/wWHA GXgmEQ5bldLh57iD2JvxczlRzZJL/Dj4BD5HPoeus2XZZXRg+A7MykLHJdWKL5dyB45r joG9YSShOYj/dGroMwCBrkPvPwo7fRNnNl2zeHCn5RpzpflUH7rylMm2Ri8pAsru0J0j GEYA== X-Forwarded-Encrypted: i=1; AJvYcCW5KF6jaXxgxLl87JM1BhnGtBBUsc8NAzIu+sq89vxyzMMV3GFlAo8MktHFbBV3X1RekrKSd9GbRsSV@vger.kernel.org, AJvYcCWaOdTYahrU41Fr1h23fV3MbxdgAsimfduCHulpkQpmG/ziljVSQ2DzvEvEJmeVT0LK2UHoeD+VrdD8Otp+@vger.kernel.org X-Gm-Message-State: AOJu0Yx1q0PkzHwkr0LrF3LMbtQDCkHWTkkPAaZhj+TCDeWCd+dwE/XE ceHkXmn3mETaWH91xuZMX6HHWDoZ2Z6J78F8GEcQIRRI2kyc+eo2Ze3W/w== X-Gm-Gg: ASbGnctU8/wAth0r4PAiLtMmP0MTQyF3Jf2HFaFpNBo57Mt/ky1k//d2xT8DVDsahJc TnCWXPCgFGJ9nV9mq2whXIw3/6B72mb/qqLEhT23k+LO3mEkculTIvVxZJ6i+UtoLF27exVf6FI A3yJSbyJYJZTK032/Jzx91/GhetqCVVVs+dmeN62WORWM4RO1eHvjV/0PRzSvwOF/fsstlSrosi mwDXW4IzLgMWG2QoKq0ZeYwtBtOoJisxOKq8mezHDGDMMifW1pWAacRrG7NTD6ThvcQRMxzzNXS 2HtHnv3/m/nCfAgec29xZrnowJ8bojRVJ6k25YWT0eTYpm/+VFzp0WYscBfSdAt15Svn3Ontwzr yrY+q4bT99rKt8GWU8MeRho8gNuxHQSOf+9cMxA== X-Google-Smtp-Source: AGHT+IEin/jt2ASBEcMtODVnqqCgSCoRtBaLeGh0U/3tk7TLTthhHL8kXoEEhL0k2uSwLyJovIffMw== X-Received: by 2002:a17:90b:4a11:b0:2fe:b174:31fe with SMTP id 98e67ed59e1d1-301bde51a32mr3019875a91.2.1742377692348; Wed, 19 Mar 2025 02:48:12 -0700 (PDT) Received: from ISCN5CG2520RPD.infineon.com (KD106168128197.ppp-bb.dion.ne.jp. [106.168.128.197]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-301bf589bccsm1103483a91.11.2025.03.19.02.48.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Mar 2025 02:48:12 -0700 (PDT) From: Takahiro Kuwano X-Google-Original-From: Takahiro Kuwano Date: Wed, 19 Mar 2025 18:47:45 +0900 Subject: [PATCH 3/3] mtd: spi-nor: spansion: add support for CYRS17B512 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: <20250319-snor-rdid-dummy-ncycles-v1-3-fbf64e4c226a@infineon.com> References: <20250319-snor-rdid-dummy-ncycles-v1-0-fbf64e4c226a@infineon.com> In-Reply-To: <20250319-snor-rdid-dummy-ncycles-v1-0-fbf64e4c226a@infineon.com> To: Tudor Ambarus , Pratyush Yadav , Michael Walle , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: linux-mtd@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Bacem Daassi , Takahiro Kuwano X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1742377674; l=6571; i=Takahiro.Kuwano@infineon.com; s=20250227; h=from:subject:message-id; bh=oC9jr2u9u9kL8fmEU1SCe11rMhVquUDrj9AQX+3QGZI=; b=TVoDc7eh8RNj9bGWHNK0BXFWDvjHKkJETkqaH5rgr0BVxciS9BHCm8k6P8cnic04UzhJhw96c a84edkoKF/RAekTKOMVe2JIygSpOc0Q3j3yPei1yRrjT1d/HL00S4W/ X-Developer-Key: i=Takahiro.Kuwano@infineon.com; a=ed25519; pk=aS8V9WLuMUkl0vmgD0xJU19ZajdJmuyFBnBfVj0dfDs= Add device ID info and fixups to support Infineon CYRS17B512 flash. Although this flash has untypical features such as dummy cycles in RDID, inverted erase polarity, larger program page size with automatic page erase, and larger sector size, it supports basic flash commands including SFDP. Link: https://www.infineon.com/dgdl/Infineon-CYRS17B512_512_MB_64_MB_SERIAL= _NOR_FLASH_SPI_QSPI_3-DataSheet-v07_00-EN.pdf?fileId=3D8ac78c8c8fc2dd9c0190= 0eee733d45f3 Signed-off-by: Takahiro Kuwano --- Tested on Xilinx Zynq-7000 board and Infineon internal SPI controller. zynq> cat /sys/bus/spi/devices/spi0.0/spi-nor/jedec_id c1601a zynq> cat /sys/bus/spi/devices/spi0.0/spi-nor/manufacturer spansion zynq> xxd -p /sys/bus/spi/devices/spi0.0/spi-nor/sfdp 53464450080102ff00080114000300ff84080102500300ff8700011c5803 00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff fffffffffffffffffffffffffffffffffffff7ffe2ffffffff1f48eb086b fffffffffeffffffffffffffffff48eb142017d800ff00ffa028fdffb73f 84a2e0fb1fc4ffff7a75f7ffffff22f65dfff050f8a10000000000002c00 00000000f6fffffff30600fe21dcffff0000800000000000c0ffc3ebc0ff c3eb00650090066500b1006501950065019671650494716504d000000000 b02e000088a489aa71650393716503930000000000000000000000000000 0000000000000000000000000000000000000000000000000000716503d4 716503d400002020 zynq> md5sum /sys/bus/spi/devices/spi0.0/spi-nor/sfdp a2fec0f47c5aa119e21c3d50a173e2ba /sys/bus/spi/devices/spi0.0/spi-nor/sfdp zynq> 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-1S (fast read) opcode 0x0c mode cycles 8 dummy cycles 8 1S-1S-4S opcode 0x6c mode cycles 0 dummy cycles 8 1S-4S-4S opcode 0xec mode cycles 2 dummy cycles 8 4S-4S-4S opcode 0xec mode cycles 2 dummy cycles 8 Supported page program modes by the flash 1S-1S-1S opcode 0x12 1S-1S-4S opcode 0x34 zynq> cat /sys/kernel/debug/spi-nor/spi0.0/params name (null) id c1 60 1a 00 00 00 size 64.0 MiB write size 1 page size 2048 address nbytes 4 flags 4B_OPCODES | HAS_4BAIT | HAS_16BIT_SR | SOFT_RESET opcodes read 0xec dummy cycles 10 erase 0xdc program 0x34 8D extension repeat protocols read 1S-4S-4S write 1S-1S-4S register 1S-1S-1S erase commands 21 (1.00 MiB) [2] dc (8.00 MiB) [3] c7 (64.0 MiB) sector map region (in hex) | erase mask | overlaid ------------------+------------+---------- 00000000-03ffffff | [ 3] | no zynq> mtd_debug info /dev/mtd0 mtd.type =3D MTD_NORFLASH mtd.flags =3D MTD_CAP_NORFLASH mtd.size =3D 67108864 (64M) mtd.erasesize =3D 8388608 (8M) mtd.writesize =3D 1 mtd.oobsize =3D 0 regions =3D 0 zynq> ./test_spi_cyrs17b512.sh 8+0 records in 8+0 records out 8388608 bytes (8.0MB) copied, 0.308282 seconds, 26.0MB/s Erased 8388608 bytes from address 0x00000000 in flash Copied 8388608 bytes from address 0x00000000 in flash to spi_read 0000000 0000 0000 0000 0000 0000 0000 0000 0000 * 0800000 2daeb1f36095b44b318410b3f4e8b5d989dcc7bb023d1426c492dab0a3053e74 spi_read Copied 8388608 bytes from spi_test to address 0x00000000 in flash Copied 8388608 bytes from address 0x00000000 in flash to spi_read 8f8842585053d5200d7d80bc766dcf8bbe9f4fea08499c576f67ed631050b6c3 spi_read 8f8842585053d5200d7d80bc766dcf8bbe9f4fea08499c576f67ed631050b6c3 spi_test Erased 8388608 bytes from address 0x00000000 in flash Copied 8388608 bytes from address 0x00000000 in flash to spi_read 2daeb1f36095b44b318410b3f4e8b5d989dcc7bb023d1426c492dab0a3053e74 spi_read 8f8842585053d5200d7d80bc766dcf8bbe9f4fea08499c576f67ed631050b6c3 spi_test --- drivers/mtd/spi-nor/spansion.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/mtd/spi-nor/spansion.c b/drivers/mtd/spi-nor/spansion.c index bf08dbf5e7421f8725a9931e36acaf3f7348db42..5c9588b02b7e61f1b64e5dc61e5= c1f976ac58508 100644 --- a/drivers/mtd/spi-nor/spansion.c +++ b/drivers/mtd/spi-nor/spansion.c @@ -758,6 +758,18 @@ static const struct spi_nor_fixups s25fs_s_nor_fixups = =3D { .post_bfpt =3D s25fs_s_nor_post_bfpt_fixups, }; =20 +static int cyrs17b_late_init(struct spi_nor *nor) +{ + /* Fast Read requires mode cycles */ + nor->params->reads[SNOR_CMD_READ_FAST].num_mode_clocks =3D 8; + + return 0; +} + +static const struct spi_nor_fixups cyrs17b_fixups =3D { + .late_init =3D cyrs17b_late_init, +}; + static const struct flash_info spansion_nor_parts[] =3D { { .id =3D SNOR_ID(0x01, 0x02, 0x12), @@ -996,6 +1008,11 @@ static const struct flash_info spansion_nor_parts[] = =3D { .name =3D "s28hs02gt", .mfr_flags =3D USE_CLPEF, .fixups =3D &s28hx_t_fixups, + }, { + /* cyrs17b512 */ + .id =3D SNOR_ID(0xc1, 0x60, 0x1a), + .mfr_flags =3D USE_CLSR, + .fixups =3D &cyrs17b_fixups }, { .id =3D SNOR_ID(0xef, 0x40, 0x13), .name =3D "s25fl004k", --=20 2.34.1