From nobody Mon Feb 9 05:19:41 2026 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (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 02A1A1DA11B for ; Mon, 2 Dec 2024 16:35:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733157344; cv=none; b=TxiXaen/FKyQNW4hp4rf56aPEwgiW+w1mCA3EYP0Uaah/JznPwarvbcfbh0l47DsO0f4wjyNLJjfgnesTxvpjI35yoJAAzSKyq1+SwbjIMO5iZBrstsCI1IikVVUEZQ/OTeMpBTTstmnZs1xqCm/cwce7r0DZMzQ8W6uMd2xcEg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733157344; c=relaxed/simple; bh=vzVYWqRuvJ/DR32lne+6U8YOTfeeJ6uP4kuNCyeLjfI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=okbrkVcK7iO9s6w7Rwhsj7raDcukFeqbz4yy+zKTfdu8bFHUAeNJgZ/qHN/IuW44QHKu/hhndsAwWfx7Fk9V+gkJqLa2+eyNaj/DsCT/eLZQMRHI9uEelwBfn+qgrF7gZgKBbHUeoMsoIf9AwXzsn84bvD9m/HLcw0ff05LiZ2U= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from dude04.red.stw.pengutronix.de ([2a0a:edc0:0:1101:1d::ac]) by metis.whiteo.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1tI9Od-0004Mi-5y; Mon, 02 Dec 2024 17:35:39 +0100 From: Jonas Rebmann Date: Mon, 02 Dec 2024 17:35:20 +0100 Subject: [PATCH 1/3] mtd: mchp48l640: make WEL behaviour configurable 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: <20241202-mb85rs128ty-v1-1-a660b6490dc8@pengutronix.de> References: <20241202-mb85rs128ty-v1-0-a660b6490dc8@pengutronix.de> In-Reply-To: <20241202-mb85rs128ty-v1-0-a660b6490dc8@pengutronix.de> To: Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Heiko Schocher Cc: linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, David Jander , kernel@pengutronix.de, Jonas Rebmann X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1701; i=jre@pengutronix.de; h=from:subject:message-id; bh=YnwbiJO7X9hCHNnU39mclSYSZ2iVlKIANZV6k28zZuk=; b=owGbwMvMwCF2ZcYT3onnbjcwnlZLYkj3fXiTQyJWdanbbz0NQ9+fXg7zEnbl5J62kLRiYXDYn nKsN3pvRykLgxgHg6yYIkusmpyCkLH/dbNKu1iYOaxMIEMYuDgFYCJ9Hxh+MX/JexrEXuhscKij ZjdLEb9oXd1ayUNHt1yf2HNf/qL+AkaGe/ODy2ZNWvgk/dKuZ/KiL0UWtm1b4dm+bs11ic/7tdR vcgMA X-Developer-Key: i=jre@pengutronix.de; a=openpgp; fpr=0B7B750D5D3CD21B3B130DE8B61515E135CD49B5 X-SA-Exim-Connect-IP: 2a0a:edc0:0:1101:1d::ac X-SA-Exim-Mail-From: jre@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org From: David Jander The 48L640 resets the WEL bit (the Write Enable Latch bit in the status register) to zero on the completion of write operations. In preparation to support chips behaving differently, introduce .auto_disable_wel capability, and, if it's missing, explicitly reset the WEL bit after writes. Signed-off-by: David Jander Signed-off-by: Jonas Rebmann --- drivers/mtd/devices/mchp48l640.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/mtd/devices/mchp48l640.c b/drivers/mtd/devices/mchp48l= 640.c index f576e6a890e859e7d20aeeb2ede4ca0acf4850fc..4cdd24aaed416fc7e40a8060b5c= 7eaf6684fc6d5 100644 --- a/drivers/mtd/devices/mchp48l640.c +++ b/drivers/mtd/devices/mchp48l640.c @@ -27,6 +27,7 @@ struct mchp48_caps { unsigned int size; unsigned int page_size; + bool auto_disable_wel; }; =20 struct mchp48l640_flash { @@ -194,9 +195,15 @@ static int mchp48l640_write_page(struct mtd_info *mtd,= loff_t to, size_t len, else goto fail; =20 - ret =3D mchp48l640_waitforbit(flash, MCHP48L640_STATUS_WEL, false); - if (ret) - goto fail; + if (flash->caps->auto_disable_wel) { + ret =3D mchp48l640_waitforbit(flash, MCHP48L640_STATUS_WEL, false); + if (ret) + goto fail; + } else { + ret =3D mchp48l640_write_prepare(flash, false); + if (ret) + goto fail; + } =20 kfree(cmd); return 0; @@ -293,6 +300,7 @@ static int mchp48l640_read(struct mtd_info *mtd, loff_t= from, size_t len, static const struct mchp48_caps mchp48l640_caps =3D { .size =3D SZ_8K, .page_size =3D 32, + .auto_disable_wel =3D true, }; =20 static int mchp48l640_probe(struct spi_device *spi) --=20 2.39.5 From nobody Mon Feb 9 05:19:41 2026 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (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 029C51DA11A for ; Mon, 2 Dec 2024 16:35:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733157343; cv=none; b=NEYrF3ZvWvHOr0yqACG3UMOdH+XixiH9n0kAkMbsbRRFFrieNQcjSB34itot7DzvRAGLxXYRE7KLKcA6UMAzVX88ebbuO7o4+Hgc8yZWXKxBH7OBmXPLHxaRojDnErDjK2Y9+V2eZoPzqIeQgvwgMDvkbOMBCGRz1uu15UTOPBw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733157343; c=relaxed/simple; bh=lTe9FWRo2ZCa3rPujY1of3rChZ8Z3D7OPHWZ5cq3rFA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=QCJ98eTsdd++6+TexGc7bdmyauidnborj/n4GD17UmRYX7yILz+4Eq5ggkBc7uz24ovS+EmuuzKvg3UHx9KUOUrGKszCWEpvig19pCZTphgwh9u4x4xmw1Oy6ExVqUnP1ZODyyWZXAFqU/Or9aznIUmFvi1Oi7JTNJE/T2XNc2I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from dude04.red.stw.pengutronix.de ([2a0a:edc0:0:1101:1d::ac]) by metis.whiteo.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1tI9Od-0004Mi-7e; Mon, 02 Dec 2024 17:35:39 +0100 From: Jonas Rebmann Date: Mon, 02 Dec 2024 17:35:21 +0100 Subject: [PATCH 2/3] dt-bindings: mtd: mchp48l640 add mb85rs128ty compatible 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: <20241202-mb85rs128ty-v1-2-a660b6490dc8@pengutronix.de> References: <20241202-mb85rs128ty-v1-0-a660b6490dc8@pengutronix.de> In-Reply-To: <20241202-mb85rs128ty-v1-0-a660b6490dc8@pengutronix.de> To: Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Heiko Schocher Cc: linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, David Jander , kernel@pengutronix.de, Jonas Rebmann X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=781; i=jre@pengutronix.de; h=from:subject:message-id; bh=lTe9FWRo2ZCa3rPujY1of3rChZ8Z3D7OPHWZ5cq3rFA=; b=owGbwMvMwCF2ZcYT3onnbjcwnlZLYkj3fXgzSD2bc0Le6u+xjdkL6qItJ8mGnmTa9Kr7kHBmy +WzW3OsOkpZGMQ4GGTFFFli1eQUhIz9r5tV2sXCzGFlAhnCwMUpABOZI8/wm2VW8rpy7rNWX88X /58hLXvK47ZymHpleFZbdnv1o68dhxn+e9UfYOjxjdh68vaBU69fX2btl95QcUFa6cdD5WXCCpx 1fAA= X-Developer-Key: i=jre@pengutronix.de; a=openpgp; fpr=0B7B750D5D3CD21B3B130DE8B61515E135CD49B5 X-SA-Exim-Connect-IP: 2a0a:edc0:0:1101:1d::ac X-SA-Exim-Mail-From: jre@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Add a compatible string to support Fujitsu MB85RS128TY. Signed-off-by: Jonas Rebmann --- Documentation/devicetree/bindings/mtd/microchip,mchp48l640.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/mtd/microchip,mchp48l640.yam= l b/Documentation/devicetree/bindings/mtd/microchip,mchp48l640.yaml index 0ff32bd00bf6aee279fa78c624d8d47c6162f7f1..973f06b665dbbcb9ea1090418eb= 18fbe2285acef 100644 --- a/Documentation/devicetree/bindings/mtd/microchip,mchp48l640.yaml +++ b/Documentation/devicetree/bindings/mtd/microchip,mchp48l640.yaml @@ -18,6 +18,7 @@ properties: compatible: items: - const: microchip,48l640 + - const: fujitsu,mb85rs128ty =20 reg: maxItems: 1 --=20 2.39.5 From nobody Mon Feb 9 05:19:41 2026 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (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 029291DA116 for ; Mon, 2 Dec 2024 16:35:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733157343; cv=none; b=JwnFRkk2b8StzO8VyjjCvpbXO1Y0NVdfe8NOxAyxDR7styYUmLhPVB1hkrvR3ZkIFMqceCHNmkCOApjbhIquxNP6f3/NbcwDD0lv82nb2RRZYlnogOrb1oJZuffASftZIb7ezb4mi3q5qK8PiMXUCMJ+aET7WmuXc6MPIRHurMA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733157343; c=relaxed/simple; bh=4Znxh2vezX6ykUQvILB+ITgVuJR4RNnDtKVTVonUfCM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=TldyM/EWuhJNALuTRVDIA2cSeN2FXj3wcs6JSi39gG9uifcA6+2AeQi/CXUPIkdYA0uWn1SLouXrWO60fzp5yqklBrqunU5WdDLzRHgArGdlKB4KgfNs9aTxpX6wPln5TZ4q9YK1izXZfm31zkgHoBshSGNGA/erd64m5MVhy10= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from dude04.red.stw.pengutronix.de ([2a0a:edc0:0:1101:1d::ac]) by metis.whiteo.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1tI9Od-0004Mi-9G; Mon, 02 Dec 2024 17:35:39 +0100 From: Jonas Rebmann Date: Mon, 02 Dec 2024 17:35:22 +0100 Subject: [PATCH 3/3] mtd: mchp48l640: add support for Fujitsu MB85RS128TY FRAM 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: <20241202-mb85rs128ty-v1-3-a660b6490dc8@pengutronix.de> References: <20241202-mb85rs128ty-v1-0-a660b6490dc8@pengutronix.de> In-Reply-To: <20241202-mb85rs128ty-v1-0-a660b6490dc8@pengutronix.de> To: Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Heiko Schocher Cc: linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, David Jander , kernel@pengutronix.de, Jonas Rebmann X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1626; i=jre@pengutronix.de; h=from:subject:message-id; bh=Urh+tFnbGE+nh11saAIXFyyQDAFGEwL1Wkf7BzXgzas=; b=owGbwMvMwCF2ZcYT3onnbjcwnlZLYkj3fXgzdP6VVf5/r4Q8v5EWVvvFfdKX60tZebdavct8c m2d32pmho5SFgYxDgZZMUWWWDU5BSFj/+tmlXaxMHNYmUCGMHBxCsBEPi5kZDj+7dDCEw6upvy1 zg66lTx/2/VXVdtVF/9IkDV3fdfr2MTwV1533eQ50pqf9Do0MkPDZjWyhR1cc23eqhldnhIPHJz jGAA= X-Developer-Key: i=jre@pengutronix.de; a=openpgp; fpr=0B7B750D5D3CD21B3B130DE8B61515E135CD49B5 X-SA-Exim-Connect-IP: 2a0a:edc0:0:1101:1d::ac X-SA-Exim-Mail-From: jre@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org From: David Jander The Fujitsu FRAM chips use the same command set as Microchip EERAM. The only differences are that the Fujitsu FRAM chips don't really have a page size limit, nor do they automatically reset the WEL bit. Signed-off-by: David Jander Signed-off-by: Jonas Rebmann --- drivers/mtd/devices/mchp48l640.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/mtd/devices/mchp48l640.c b/drivers/mtd/devices/mchp48l= 640.c index 4cdd24aaed416fc7e40a8060b5c7eaf6684fc6d5..7584d0ba93969d79ba3d9c7a97b= c63bd0e5ef327 100644 --- a/drivers/mtd/devices/mchp48l640.c +++ b/drivers/mtd/devices/mchp48l640.c @@ -303,6 +303,12 @@ static const struct mchp48_caps mchp48l640_caps =3D { .auto_disable_wel =3D true, }; =20 +static const struct mchp48_caps mb85rs128ty_caps =3D { + .size =3D SZ_16K, + .page_size =3D 256, + .auto_disable_wel =3D false, +}; + static int mchp48l640_probe(struct spi_device *spi) { struct mchp48l640_flash *flash; @@ -361,6 +367,10 @@ static const struct of_device_id mchp48l640_of_table[]= =3D { .compatible =3D "microchip,48l640", .data =3D &mchp48l640_caps, }, + { + .compatible =3D "fujitsu,mb85rs128ty", + .data =3D &mb85rs128ty_caps, + }, {} }; MODULE_DEVICE_TABLE(of, mchp48l640_of_table); @@ -370,6 +380,10 @@ static const struct spi_device_id mchp48l640_spi_ids[]= =3D { .name =3D "48l640", .driver_data =3D (kernel_ulong_t)&mchp48l640_caps, }, + { + .name =3D "mb85rs128ty", + .driver_data =3D (kernel_ulong_t)&mb85rs128ty_caps, + }, {} }; MODULE_DEVICE_TABLE(spi, mchp48l640_spi_ids); --=20 2.39.5