linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/3] Add support for Fujitsu MB85RS128TY
@ 2024-12-03 10:38 Jonas Rebmann
  2024-12-03 10:38 ` [PATCH v3 1/3] mtd: mchp48l640: make WEL behaviour configurable Jonas Rebmann
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Jonas Rebmann @ 2024-12-03 10:38 UTC (permalink / raw)
  To: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Heiko Schocher
  Cc: linux-mtd, linux-kernel, devicetree, David Jander, kernel,
	Jonas Rebmann, Krzysztof Kozlowski

The Fujitsu MB85RS128TY FRAM chips behave almost identically to the
Microchip 48L640. This series adds their support to the mchp48l640
driver.

Signed-off-by: Jonas Rebmann <jre@pengutronix.de>
---
Changes in v3:
- Alphabetically sort compatible list
- Link to v2: https://lore.kernel.org/r/20241203-mb85rs128ty-v2-0-42df3e7ff147@pengutronix.de

Changes in v2:
- Correct dt schema in Documentation/devicetree/bindings/mtd/microchip,mchp48l640.yaml
- Link to v1: https://lore.kernel.org/r/20241202-mb85rs128ty-v1-0-a660b6490dc8@pengutronix.de

---
David Jander (2):
      mtd: mchp48l640: make WEL behaviour configurable
      mtd: mchp48l640: add support for Fujitsu MB85RS128TY FRAM

Jonas Rebmann (1):
      dt-bindings: mtd: mchp48l640 add mb85rs128ty compatible

 .../bindings/mtd/microchip,mchp48l640.yaml         |  5 ++--
 drivers/mtd/devices/mchp48l640.c                   | 28 +++++++++++++++++++---
 2 files changed, 28 insertions(+), 5 deletions(-)
---
base-commit: 7af08b57bcb9ebf78675c50069c54125c0a8b795
change-id: 20241129-mb85rs128ty-659e81900957

Best regards,
-- 
Jonas Rebmann <jre@pengutronix.de>


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v3 1/3] mtd: mchp48l640: make WEL behaviour configurable
  2024-12-03 10:38 [PATCH v3 0/3] Add support for Fujitsu MB85RS128TY Jonas Rebmann
@ 2024-12-03 10:38 ` Jonas Rebmann
  2024-12-03 10:38 ` [PATCH v3 2/3] dt-bindings: mtd: mchp48l640 add mb85rs128ty compatible Jonas Rebmann
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Jonas Rebmann @ 2024-12-03 10:38 UTC (permalink / raw)
  To: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Heiko Schocher
  Cc: linux-mtd, linux-kernel, devicetree, David Jander, kernel,
	Jonas Rebmann

From: David Jander <david@protonic.nl>

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 <david@protonic.nl>
Reviewed-by: Heiko Schocher <hs@denx.de>
Signed-off-by: Jonas Rebmann <jre@pengutronix.de>
---
 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/mchp48l640.c
index f576e6a890e859e7d20aeeb2ede4ca0acf4850fc..4cdd24aaed416fc7e40a8060b5c7eaf6684fc6d5 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;
 };
 
 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;
 
-	ret = mchp48l640_waitforbit(flash, MCHP48L640_STATUS_WEL, false);
-	if (ret)
-		goto fail;
+	if (flash->caps->auto_disable_wel) {
+		ret = mchp48l640_waitforbit(flash, MCHP48L640_STATUS_WEL, false);
+		if (ret)
+			goto fail;
+	} else {
+		ret = mchp48l640_write_prepare(flash, false);
+		if (ret)
+			goto fail;
+	}
 
 	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 = {
 	.size = SZ_8K,
 	.page_size = 32,
+	.auto_disable_wel = true,
 };
 
 static int mchp48l640_probe(struct spi_device *spi)

-- 
2.39.5


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v3 2/3] dt-bindings: mtd: mchp48l640 add mb85rs128ty compatible
  2024-12-03 10:38 [PATCH v3 0/3] Add support for Fujitsu MB85RS128TY Jonas Rebmann
  2024-12-03 10:38 ` [PATCH v3 1/3] mtd: mchp48l640: make WEL behaviour configurable Jonas Rebmann
@ 2024-12-03 10:38 ` Jonas Rebmann
  2024-12-03 10:38 ` [PATCH v3 3/3] mtd: mchp48l640: add support for Fujitsu MB85RS128TY FRAM Jonas Rebmann
  2024-12-05 10:46 ` [PATCH v3 0/3] Add support for Fujitsu MB85RS128TY Miquel Raynal
  3 siblings, 0 replies; 5+ messages in thread
From: Jonas Rebmann @ 2024-12-03 10:38 UTC (permalink / raw)
  To: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Heiko Schocher
  Cc: linux-mtd, linux-kernel, devicetree, David Jander, kernel,
	Jonas Rebmann, Krzysztof Kozlowski

Add a compatible string to support Fujitsu MB85RS128TY.

Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Jonas Rebmann <jre@pengutronix.de>
---
 Documentation/devicetree/bindings/mtd/microchip,mchp48l640.yaml | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/mtd/microchip,mchp48l640.yaml b/Documentation/devicetree/bindings/mtd/microchip,mchp48l640.yaml
index 0ff32bd00bf6aee279fa78c624d8d47c6162f7f1..5c6b628c608d82515c7efd5dc74dfb8469894bef 100644
--- a/Documentation/devicetree/bindings/mtd/microchip,mchp48l640.yaml
+++ b/Documentation/devicetree/bindings/mtd/microchip,mchp48l640.yaml
@@ -16,8 +16,9 @@ description: |
 
 properties:
   compatible:
-    items:
-      - const: microchip,48l640
+    enum:
+      - fujitsu,mb85rs128ty
+      - microchip,48l640
 
   reg:
     maxItems: 1

-- 
2.39.5


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v3 3/3] mtd: mchp48l640: add support for Fujitsu MB85RS128TY FRAM
  2024-12-03 10:38 [PATCH v3 0/3] Add support for Fujitsu MB85RS128TY Jonas Rebmann
  2024-12-03 10:38 ` [PATCH v3 1/3] mtd: mchp48l640: make WEL behaviour configurable Jonas Rebmann
  2024-12-03 10:38 ` [PATCH v3 2/3] dt-bindings: mtd: mchp48l640 add mb85rs128ty compatible Jonas Rebmann
@ 2024-12-03 10:38 ` Jonas Rebmann
  2024-12-05 10:46 ` [PATCH v3 0/3] Add support for Fujitsu MB85RS128TY Miquel Raynal
  3 siblings, 0 replies; 5+ messages in thread
From: Jonas Rebmann @ 2024-12-03 10:38 UTC (permalink / raw)
  To: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Heiko Schocher
  Cc: linux-mtd, linux-kernel, devicetree, David Jander, kernel,
	Jonas Rebmann

From: David Jander <david@protonic.nl>

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 <david@protonic.nl>
Reviewed-by: Heiko Schocher <hs@denx.de>
Signed-off-by: Jonas Rebmann <jre@pengutronix.de>
---
 drivers/mtd/devices/mchp48l640.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/drivers/mtd/devices/mchp48l640.c b/drivers/mtd/devices/mchp48l640.c
index 4cdd24aaed416fc7e40a8060b5c7eaf6684fc6d5..7584d0ba93969d79ba3d9c7a97bc63bd0e5ef327 100644
--- a/drivers/mtd/devices/mchp48l640.c
+++ b/drivers/mtd/devices/mchp48l640.c
@@ -303,6 +303,12 @@ static const struct mchp48_caps mchp48l640_caps = {
 	.auto_disable_wel = true,
 };
 
+static const struct mchp48_caps mb85rs128ty_caps = {
+	.size = SZ_16K,
+	.page_size = 256,
+	.auto_disable_wel = 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[] = {
 		.compatible = "microchip,48l640",
 		.data = &mchp48l640_caps,
 	},
+	{
+		.compatible = "fujitsu,mb85rs128ty",
+		.data = &mb85rs128ty_caps,
+	},
 	{}
 };
 MODULE_DEVICE_TABLE(of, mchp48l640_of_table);
@@ -370,6 +380,10 @@ static const struct spi_device_id mchp48l640_spi_ids[] = {
 		.name = "48l640",
 		.driver_data = (kernel_ulong_t)&mchp48l640_caps,
 	},
+	{
+		.name = "mb85rs128ty",
+		.driver_data = (kernel_ulong_t)&mb85rs128ty_caps,
+	},
 	{}
 };
 MODULE_DEVICE_TABLE(spi, mchp48l640_spi_ids);

-- 
2.39.5


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v3 0/3] Add support for Fujitsu MB85RS128TY
  2024-12-03 10:38 [PATCH v3 0/3] Add support for Fujitsu MB85RS128TY Jonas Rebmann
                   ` (2 preceding siblings ...)
  2024-12-03 10:38 ` [PATCH v3 3/3] mtd: mchp48l640: add support for Fujitsu MB85RS128TY FRAM Jonas Rebmann
@ 2024-12-05 10:46 ` Miquel Raynal
  3 siblings, 0 replies; 5+ messages in thread
From: Miquel Raynal @ 2024-12-05 10:46 UTC (permalink / raw)
  To: Jonas Rebmann
  Cc: Richard Weinberger, Vignesh Raghavendra, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Heiko Schocher, linux-mtd,
	linux-kernel, devicetree, David Jander, kernel,
	Krzysztof Kozlowski

On 03/12/2024 at 11:38:34 +01, Jonas Rebmann <jre@pengutronix.de> wrote:

> The Fujitsu MB85RS128TY FRAM chips behave almost identically to the
> Microchip 48L640. This series adds their support to the mchp48l640
> driver.
>
> Signed-off-by: Jonas Rebmann <jre@pengutronix.de>

Series applied to mtd/next.

Thanks,
Miquèl

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-12-05 10:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-03 10:38 [PATCH v3 0/3] Add support for Fujitsu MB85RS128TY Jonas Rebmann
2024-12-03 10:38 ` [PATCH v3 1/3] mtd: mchp48l640: make WEL behaviour configurable Jonas Rebmann
2024-12-03 10:38 ` [PATCH v3 2/3] dt-bindings: mtd: mchp48l640 add mb85rs128ty compatible Jonas Rebmann
2024-12-03 10:38 ` [PATCH v3 3/3] mtd: mchp48l640: add support for Fujitsu MB85RS128TY FRAM Jonas Rebmann
2024-12-05 10:46 ` [PATCH v3 0/3] Add support for Fujitsu MB85RS128TY Miquel Raynal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).