Skip to contentSkip to conversation

memory: omap-gpmc: Add AM64 SoC support

PATCH Applied Roger Quadros 5 participants 16 messages Dec 21, 2021 – May 13, 2022

Subsystems (5)
lore
Share & tools
lore

Roger Quadros

author maintainer
#0 lore raw

v4 cover memory: omap-gpmc: Add AM64 SoC support

Hi,

TI's AM64 SoC contains one GPMC module. Add driver support for it.

cheers,
-roger

Changelog:
v4
- move compatible match table to header file so it can be used by GPMC driver even when NAND driver is not enabled or as a module. GPMC driver is always enabled as built-in.
- Select OMAP_GPMC driver from MTD_NAND_OMAP2 driver config as OMAP_GPMC is not essential for ARCH_K3 boot.

v3
- use compatible match table for checking for NAND controller node in GPMC driver.

v2
- update DT binding doc to make reg-names and power-domains property required only for specific SoC.

Roger Quadros (4):
dt-bindings: memory-controllers: ti,gpmc: Add compatible for AM64
memory: omap-gpmc: Add support for GPMC on AM64 SoC
memory: omap-gpmc: Use a compatible match table when checking for NAND
controller
mtd: rawnand: omap2: Select GPMC device driver for ARCH_K3

 .../bindings/memory-controllers/ti,gpmc.yaml  | 23 +++++++++-
 drivers/memory/omap-gpmc.c                    | 46 ++++++++++++++-----
 drivers/mtd/nand/raw/Kconfig                  |  1 +
 drivers/mtd/nand/raw/omap2.c                  |  5 +-
 include/linux/platform_data/mtd-nand-omap2.h  |  9 +++-
 5 files changed, 67 insertions(+), 17 deletions(-)
Signature · 1 line
2.17.1
author maintainer
#1 lore raw

PATCH v4 1/4 dt-bindings: memory-controllers: ti,gpmc: Add compatible for AM64

AM64 SoC contains the GPMC module. Add compatible for it.

Newer SoCs don't necessarily map GPMC data region at the same place as legacy SoCs. Add reg-names "data", to provide this information to the device driver.

---
 .../bindings/memory-controllers/ti,gpmc.yaml  | 23 ++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/memory-controllers/ti,gpmc.yaml +22 -1
index 25b42d68f9b3..64dc9d398d9a 100644
@@ -23,13 +23,20 @@ properties:
     items:
       - enum:
           - ti,am3352-gpmc
+          - ti,am64-gpmc
           - ti,omap2420-gpmc
           - ti,omap2430-gpmc
           - ti,omap3430-gpmc
           - ti,omap4430-gpmc
 
   reg:
-    maxItems: 1
+    minItems: 1
+    maxItems: 2
+
+  reg-names:
+    items:
+      - const: cfg
+      - const: data
 
   interrupts:
     maxItems: 1
@@ -44,6 +51,9 @@ properties:
     items:
       - const: fck
 
+  power-domains:
+    maxItems: 1
+
   dmas:
     items:
       - description: DMA channel for GPMC NAND prefetch
@@ -133,6 +143,17 @@ required:
   - "#address-cells"
   - "#size-cells"
 
+allOf:
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: ti,am64-gpmc
+    then:
+      required:
+        - reg-names
+        - power-domains
+
 additionalProperties: false
 
 examples:
Signature · 1 line
2.17.1
author maintainer
#2 lore raw

PATCH v4 2/4 memory: omap-gpmc: Add support for GPMC on AM64 SoC

In reply to Roger Quadros

The TI's AM64 SoC has the GPMC module. Add compatible for it.

Traditionally GPMC external addresses have always been mapped to first 1GB physical address. However newer platforms, can have it mapped at different locations. Support this address provision via device tree.

---
 drivers/memory/omap-gpmc.c | 40 ++++++++++++++++++++++++++++----------
 1 file changed, 30 insertions(+), 10 deletions(-)
drivers/memory/omap-gpmc.c +30 -10
index be0858bff4d3..624153048182 100644
@@ -237,6 +237,7 @@ struct gpmc_device {
 	struct omap3_gpmc_regs context;
 	int nirqs;
 	unsigned int is_suspended:1;
+	struct resource *data;
 };
 
 static struct irq_domain *gpmc_irq_domain;
@@ -1456,12 +1457,18 @@ static void gpmc_mem_exit(void)
 	}
 }
 
-static void gpmc_mem_init(void)
+static void gpmc_mem_init(struct gpmc_device *gpmc)
 {
 	int cs;
 
-	gpmc_mem_root.start = GPMC_MEM_START;
-	gpmc_mem_root.end = GPMC_MEM_END;
+	if (!gpmc->data) {
+		/* All legacy devices have same data IO window */
+		gpmc_mem_root.start = GPMC_MEM_START;
+		gpmc_mem_root.end = GPMC_MEM_END;
+	} else {
+		gpmc_mem_root.start = gpmc->data->start;
+		gpmc_mem_root.end = gpmc->data->end;
+	}
 
 	/* Reserve all regions that has been set up by bootloader */
 	for (cs = 0; cs < gpmc_cs_num; cs++) {
@@ -1888,6 +1895,7 @@ static const struct of_device_id gpmc_dt_ids[] = {
 	{ .compatible = "ti,omap3430-gpmc" },	/* omap3430 & omap3630 */
 	{ .compatible = "ti,omap4430-gpmc" },	/* omap4430 & omap4460 & omap543x */
 	{ .compatible = "ti,am3352-gpmc" },	/* am335x devices */
+	{ .compatible = "ti,am64-gpmc" },
 	{ }
 };
 
@@ -2502,13 +2510,25 @@ static int gpmc_probe(struct platform_device *pdev)
 	gpmc->dev = &pdev->dev;
 	platform_set_drvdata(pdev, gpmc);
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (!res)
-		return -ENOENT;
+	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "cfg");
+	if (!res) {
+		/* legacy DT */
+		gpmc_base = devm_platform_ioremap_resource(pdev, 0);
+		if (IS_ERR(gpmc_base))
+			return PTR_ERR(gpmc_base);
+	} else {
+		gpmc_base = devm_ioremap_resource(&pdev->dev, res);
+		if (IS_ERR(gpmc_base))
+			return PTR_ERR(gpmc_base);
+
+		res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "data");
+		if (!res) {
+			dev_err(&pdev->dev, "couldn't get data reg resource\n");
+			return -ENOENT;
+		}
 
-	gpmc_base = devm_ioremap_resource(&pdev->dev, res);
-	if (IS_ERR(gpmc_base))
-		return PTR_ERR(gpmc_base);
+		gpmc->data = res;
+	}
 
 	res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
 	if (!res) {
@@ -2562,7 +2582,7 @@ static int gpmc_probe(struct platform_device *pdev)
 	dev_info(gpmc->dev, "GPMC revision %d.%d\n", GPMC_REVISION_MAJOR(l),
 		 GPMC_REVISION_MINOR(l));
 
-	gpmc_mem_init();
+	gpmc_mem_init(gpmc);
 	rc = gpmc_gpio_init(gpmc);
 	if (rc)
 		goto gpio_init_failed;
Signature · 1 line
2.17.1
author maintainer
#3 lore raw

PATCH v4 3/4 memory: omap-gpmc: Use a compatible match table when checking for NAND controller

In reply to Roger Quadros

As more compatibles can be added to the GPMC NAND controller driver use a compatible match table.

---
 drivers/memory/omap-gpmc.c                   | 6 +++++-
 drivers/mtd/nand/raw/omap2.c                 | 5 +----
 include/linux/platform_data/mtd-nand-omap2.h | 9 ++++++++-
 3 files changed, 14 insertions(+), 6 deletions(-)
drivers/memory/omap-gpmc.c +5 -1
index 624153048182..d19ffc895e5b 100644
@@ -2091,6 +2091,7 @@ static int gpmc_probe_generic_child(struct platform_device *pdev,
 	u32 val;
 	struct gpio_desc *waitpin_desc = NULL;
 	struct gpmc_device *gpmc = platform_get_drvdata(pdev);
+	bool is_nand = false;
 
 	if (of_property_read_u32(child, "reg", &cs) < 0) {
 		dev_err(&pdev->dev, "%pOF has no 'reg' property\n",
@@ -2183,7 +2184,10 @@ static int gpmc_probe_generic_child(struct platform_device *pdev,
 		}
 	}
 
-	if (of_device_is_compatible(child, "ti,omap2-nand")) {
+	if (of_match_node(omap_nand_ids, child))
+		is_nand = true;
+
+	if (is_nand) {
 		/* NAND specific setup */
 		val = 8;
 		of_property_read_u32(child, "nand-bus-width", &val);
drivers/mtd/nand/raw/omap2.c +1 -4
index b26d4947af02..e6dd8b4cf0d2 100644
@@ -2352,10 +2352,7 @@ static int omap_nand_remove(struct platform_device *pdev)
 	return ret;
 }
 
-static const struct of_device_id omap_nand_ids[] = {
-	{ .compatible = "ti,omap2-nand", },
-	{},
-};
+/* omap_nand_ids defined in linux/platform_data/mtd-nand-omap2.h */
 MODULE_DEVICE_TABLE(of, omap_nand_ids);
 
 static struct platform_driver omap_nand_driver = {
include/linux/platform_data/mtd-nand-omap2.h +8 -1
index de6ada739121..92f011805ad4 100644
@@ -7,6 +7,7 @@
 #define	_MTD_NAND_OMAP2_H
 
 #include <linux/mtd/partitions.h>
+#include <linux/mod_devicetable.h>
 
 #define	GPMC_BCH_NUM_REMAINDER	8
 
@@ -61,4 +62,10 @@ struct gpmc_nand_regs {
 	void __iomem	*gpmc_bch_result5[GPMC_BCH_NUM_REMAINDER];
 	void __iomem	*gpmc_bch_result6[GPMC_BCH_NUM_REMAINDER];
 };
-#endif
+
+static const struct of_device_id omap_nand_ids[] = {
+	{ .compatible = "ti,omap2-nand", },
+	{},
+};
+
+#endif /* _MTD_NAND_OMAP2_H */
Signature · 1 line
2.17.1
author maintainer
#4 lore raw

Re: [PATCH v4 3/4] memory: omap-gpmc: Use a compatible match table when checking for NAND controller

Hi Miquel,

Quoted 8 lines · Roger Quadros

As more compatibles can be added to the GPMC NAND controller driver use a compatible match table.

---
 drivers/memory/omap-gpmc.c                   | 6 +++++-
 drivers/mtd/nand/raw/omap2.c                 | 5 +----

Will need your Ack for this one as well. Thanks :)

Quoted 2 lines
 include/linux/platform_data/mtd-nand-omap2.h | 9 ++++++++-
 3 files changed, 14 insertions(+), 6 deletions(-)

cheers,
-roger

Quoted 66 lines
drivers/memory/omap-gpmc.c +5 -1
index 624153048182..d19ffc895e5b 100644
@@ -2091,6 +2091,7 @@ static int gpmc_probe_generic_child(struct platform_device *pdev,
 	u32 val;
 	struct gpio_desc *waitpin_desc = NULL;
 	struct gpmc_device *gpmc = platform_get_drvdata(pdev);
+	bool is_nand = false;
 
 	if (of_property_read_u32(child, "reg", &cs) < 0) {
 		dev_err(&pdev->dev, "%pOF has no 'reg' property\n",
@@ -2183,7 +2184,10 @@ static int gpmc_probe_generic_child(struct platform_device *pdev,
 		}
 	}
 
-	if (of_device_is_compatible(child, "ti,omap2-nand")) {
+	if (of_match_node(omap_nand_ids, child))
+		is_nand = true;
+
+	if (is_nand) {
 		/* NAND specific setup */
 		val = 8;
 		of_property_read_u32(child, "nand-bus-width", &val);
drivers/mtd/nand/raw/omap2.c +1 -4
index b26d4947af02..e6dd8b4cf0d2 100644
@@ -2352,10 +2352,7 @@ static int omap_nand_remove(struct platform_device *pdev)
 	return ret;
 }
 
-static const struct of_device_id omap_nand_ids[] = {
-	{ .compatible = "ti,omap2-nand", },
-	{},
-};
+/* omap_nand_ids defined in linux/platform_data/mtd-nand-omap2.h */
 MODULE_DEVICE_TABLE(of, omap_nand_ids);
 
 static struct platform_driver omap_nand_driver = {
include/linux/platform_data/mtd-nand-omap2.h +8 -1
index de6ada739121..92f011805ad4 100644
@@ -7,6 +7,7 @@
 #define	_MTD_NAND_OMAP2_H
 
 #include <linux/mtd/partitions.h>
+#include <linux/mod_devicetable.h>
 
 #define	GPMC_BCH_NUM_REMAINDER	8
 
@@ -61,4 +62,10 @@ struct gpmc_nand_regs {
 	void __iomem	*gpmc_bch_result5[GPMC_BCH_NUM_REMAINDER];
 	void __iomem	*gpmc_bch_result6[GPMC_BCH_NUM_REMAINDER];
 };
-#endif
+
+static const struct of_device_id omap_nand_ids[] = {
+	{ .compatible = "ti,omap2-nand", },
+	{},
+};
+
+#endif /* _MTD_NAND_OMAP2_H */
maintainer Acked-by
#5 lore raw

Re: [PATCH v4 3/4] memory: omap-gpmc: Use a compatible match table when checking for NAND controller

Hi Roger,

[email protected] wrote on Tue, 21 Dec 2021 22:01:28 +0200:

Quoted 38 lines

Hi Miquel,

Quoted 8 lines · Roger Quadros

As more compatibles can be added to the GPMC NAND controller driver use a compatible match table.

---
 drivers/memory/omap-gpmc.c                   | 6 +++++-
 drivers/mtd/nand/raw/omap2.c                 | 5 +----  

Will need your Ack for this one as well. Thanks :)

Quoted 2 lines
 include/linux/platform_data/mtd-nand-omap2.h | 9 ++++++++-
 3 files changed, 14 insertions(+), 6 deletions(-)  

cheers,
-roger

Quoted 17 lines
drivers/memory/omap-gpmc.c +1 -0
index 624153048182..d19ffc895e5b 100644
@@ -2091,6 +2091,7 @@ static int gpmc_probe_generic_child(struct platform_device *pdev,
 	u32 val;
 	struct gpio_desc *waitpin_desc = NULL;
 	struct gpmc_device *gpmc = platform_get_drvdata(pdev);
+	bool is_nand = false;
 
 	if (of_property_read_u32(child, "reg", &cs) < 0) {
 		dev_err(&pdev->dev, "%pOF has no 'reg' property\n",
@@ -2183,7 +2184,10 @@ static int gpmc_probe_generic_child(struct platform_device *pdev,
 		}
 	}
 
Quoted 5 lines

drivers/memory/omap-gpmc.c static int gpmc_probe_generic_child(struct platform_device *pdev, · line 2190

Quoted 5 lines
drivers/memory/omap-gpmc.c +4 -1
-	if (of_device_is_compatible(child, "ti,omap2-nand")) {
+	if (of_match_node(omap_nand_ids, child))
+		is_nand = true;
+
+	if (is_nand) {

nitpick: why this intermediate variable?

Otherwise for the NAND bits:

Quoted 31 lines
Quoted 31 lines
drivers/memory/omap-gpmc.c +0 -0
 		/* NAND specific setup */
 		val = 8;
 		of_property_read_u32(child, "nand-bus-width", &val);
drivers/mtd/nand/raw/omap2.c +1 -4
index b26d4947af02..e6dd8b4cf0d2 100644
@@ -2352,10 +2352,7 @@ static int omap_nand_remove(struct platform_device *pdev)
 	return ret;
 }
 
-static const struct of_device_id omap_nand_ids[] = {
-	{ .compatible = "ti,omap2-nand", },
-	{},
-};
+/* omap_nand_ids defined in linux/platform_data/mtd-nand-omap2.h */
 MODULE_DEVICE_TABLE(of, omap_nand_ids);
 
 static struct platform_driver omap_nand_driver = {
include/linux/platform_data/mtd-nand-omap2.h +1 -0
index de6ada739121..92f011805ad4 100644
@@ -7,6 +7,7 @@
 #define	_MTD_NAND_OMAP2_H
 
 #include <linux/mtd/partitions.h>
+#include <linux/mod_devicetable.h>
 
 #define	GPMC_BCH_NUM_REMAINDER	8
 
Quoted 13 lines

include/linux/platform_data/mtd-nand-omap2.h struct gpmc_nand_regs { · line 71

Quoted 13 lines
include/linux/platform_data/mtd-nand-omap2.h +7 -1
@@ -61,4 +62,10 @@ struct gpmc_nand_regs {
 	void __iomem	*gpmc_bch_result5[GPMC_BCH_NUM_REMAINDER];
 	void __iomem	*gpmc_bch_result6[GPMC_BCH_NUM_REMAINDER];
 };
-#endif
+
+static const struct of_device_id omap_nand_ids[] = {
+	{ .compatible = "ti,omap2-nand", },
+	{},
+};
+
+#endif /* _MTD_NAND_OMAP2_H */

Thanks,
Miquèl

#6 lore raw

Re: [PATCH v4 3/4] memory: omap-gpmc: Use a compatible match table when checking for NAND controller

Quoted 42 lines · Miquel Raynal

Hi Roger,

[email protected] wrote on Tue, 21 Dec 2021 22:01:28 +0200:

Quoted 38 lines

Hi Miquel,

Quoted 8 lines · Roger Quadros

As more compatibles can be added to the GPMC NAND controller driver use a compatible match table.

---
 drivers/memory/omap-gpmc.c                   | 6 +++++-
 drivers/mtd/nand/raw/omap2.c                 | 5 +----  

Will need your Ack for this one as well. Thanks :)

Quoted 2 lines
 include/linux/platform_data/mtd-nand-omap2.h | 9 ++++++++-
 3 files changed, 14 insertions(+), 6 deletions(-)  

cheers,
-roger

Quoted 17 lines
drivers/memory/omap-gpmc.c +1 -0
index 624153048182..d19ffc895e5b 100644
@@ -2091,6 +2091,7 @@ static int gpmc_probe_generic_child(struct platform_device *pdev,
 	u32 val;
 	struct gpio_desc *waitpin_desc = NULL;
 	struct gpmc_device *gpmc = platform_get_drvdata(pdev);
+	bool is_nand = false;
 
 	if (of_property_read_u32(child, "reg", &cs) < 0) {
 		dev_err(&pdev->dev, "%pOF has no 'reg' property\n",
@@ -2183,7 +2184,10 @@ static int gpmc_probe_generic_child(struct platform_device *pdev,
 		}
 	}
 
Quoted 8 lines
Quoted 5 lines

drivers/memory/omap-gpmc.c static int gpmc_probe_generic_child(struct platform_device *pdev, · line 2190

Quoted 5 lines
drivers/memory/omap-gpmc.c +4 -1
-	if (of_device_is_compatible(child, "ti,omap2-nand")) {
+	if (of_match_node(omap_nand_ids, child))
+		is_nand = true;
+
+	if (is_nand) {

nitpick: why this intermediate variable?

Indeed, it looks useless. I think it is left-over from previous version. I will remove it while applying.

Best regards,
Krzysztof

author maintainer
#7 lore raw

Re: [PATCH v4 3/4] memory: omap-gpmc: Use a compatible match table when checking for NAND controller

Quoted 52 lines · Krzysztof Kozlowski
Quoted 42 lines · Miquel Raynal

Hi Roger,

[email protected] wrote on Tue, 21 Dec 2021 22:01:28 +0200:

Quoted 38 lines

Hi Miquel,

Quoted 8 lines · Roger Quadros

As more compatibles can be added to the GPMC NAND controller driver use a compatible match table.

---
 drivers/memory/omap-gpmc.c                   | 6 +++++-
 drivers/mtd/nand/raw/omap2.c                 | 5 +----  

Will need your Ack for this one as well. Thanks :)

Quoted 2 lines
 include/linux/platform_data/mtd-nand-omap2.h | 9 ++++++++-
 3 files changed, 14 insertions(+), 6 deletions(-)  

cheers,
-roger

Quoted 17 lines
drivers/memory/omap-gpmc.c +1 -0
index 624153048182..d19ffc895e5b 100644
@@ -2091,6 +2091,7 @@ static int gpmc_probe_generic_child(struct platform_device *pdev,
 	u32 val;
 	struct gpio_desc *waitpin_desc = NULL;
 	struct gpmc_device *gpmc = platform_get_drvdata(pdev);
+	bool is_nand = false;
 
 	if (of_property_read_u32(child, "reg", &cs) < 0) {
 		dev_err(&pdev->dev, "%pOF has no 'reg' property\n",
@@ -2183,7 +2184,10 @@ static int gpmc_probe_generic_child(struct platform_device *pdev,
 		}
 	}
 
Quoted 8 lines
Quoted 5 lines

drivers/memory/omap-gpmc.c static int gpmc_probe_generic_child(struct platform_device *pdev, · line 2190

Quoted 5 lines
drivers/memory/omap-gpmc.c +4 -1
-	if (of_device_is_compatible(child, "ti,omap2-nand")) {
+	if (of_match_node(omap_nand_ids, child))
+		is_nand = true;
+
+	if (is_nand) {

nitpick: why this intermediate variable?

Quoted 2 lines

Indeed, it looks useless. I think it is left-over from previous version. I will remove it while applying.

You are right. Thanks for saving me a re-spin Krzysztof :)

cheers,
-roger

author maintainer
#8 lore raw

PATCH v4 4/4 mtd: rawnand: omap2: Select GPMC device driver for ARCH_K3

In reply to Roger Quadros

The GPMC device driver is required for NAND controller to work on K3 Architecture. Select it if required.

---
 drivers/mtd/nand/raw/Kconfig | 1 +
 1 file changed, 1 insertion(+)
drivers/mtd/nand/raw/Kconfig +1 -0
index 67b7cb67c030..587f20c6184f 100644
@@ -42,6 +42,7 @@ config MTD_NAND_OMAP2
 	tristate "OMAP2, OMAP3, OMAP4 and Keystone NAND controller"
 	depends on ARCH_OMAP2PLUS || ARCH_KEYSTONE || COMPILE_TEST
 	depends on HAS_IOMEM
+	select OMAP_GPMC if ARCH_K3
 	help
 	  Support for NAND flash on Texas Instruments OMAP2, OMAP3, OMAP4
 	  and Keystone platforms.
Signature · 1 line
2.17.1
maintainer Acked-by on v4 4/4
#9 lore raw

Re: [PATCH v4 4/4] mtd: rawnand: omap2: Select GPMC device driver for ARCH_K3

Hi Roger,

[email protected] wrote on Tue, 21 Dec 2021 15:17:57 +0200:

Quoted 14 lines

The GPMC device driver is required for NAND controller to work on K3 Architecture. Select it if required.

---
 drivers/mtd/nand/raw/Kconfig | 1 +
 1 file changed, 1 insertion(+)
drivers/mtd/nand/raw/Kconfig +0 -0
index 67b7cb67c030..587f20c6184f 100644

drivers/mtd/nand/raw/Kconfig config MTD_NAND_OMAP2 · line 45

Quoted 4 lines
drivers/mtd/nand/raw/Kconfig +1 -0
@@ -42,6 +42,7 @@ config MTD_NAND_OMAP2
 	tristate "OMAP2, OMAP3, OMAP4 and Keystone NAND controller"
 	depends on ARCH_OMAP2PLUS || ARCH_KEYSTONE || COMPILE_TEST
 	depends on HAS_IOMEM
+	select OMAP_GPMC if ARCH_K3

drivers/mtd/nand/raw/Kconfig config MTD_NAND_OMAP2 · line 48

Quoted 3 lines
drivers/mtd/nand/raw/Kconfig +0 -0
 	help
 	  Support for NAND flash on Texas Instruments OMAP2, OMAP3, OMAP4
 	  and Keystone platforms.

Thanks,
Miquèl

#10 lore raw

Re: [PATCH v4 4/4] mtd: rawnand: omap2: Select GPMC device driver for ARCH_K3

Quoted 13 lines · Miquel Raynal

Hi Roger,

[email protected] wrote on Tue, 21 Dec 2021 15:17:57 +0200:

Quoted 9 lines

The GPMC device driver is required for NAND controller to work on K3 Architecture. Select it if required.

---
 drivers/mtd/nand/raw/Kconfig | 1 +
 1 file changed, 1 insertion(+)
Quoted 12 lines

drivers/mtd/nand/raw/Kconfig config MTD_NAND_OMAP2 · line 45

Quoted 9 lines
drivers/mtd/nand/raw/Kconfig +1 -0
index 67b7cb67c030..587f20c6184f 100644
@@ -42,6 +42,7 @@ config MTD_NAND_OMAP2
 	tristate "OMAP2, OMAP3, OMAP4 and Keystone NAND controller"
 	depends on ARCH_OMAP2PLUS || ARCH_KEYSTONE || COMPILE_TEST
 	depends on HAS_IOMEM
+	select OMAP_GPMC if ARCH_K3

This patch looks actually independent. Miquel, do you want me to take it via memory controller drivers tree (like three other patches)?

Best regards,
Krzysztof

maintainer
#11 lore raw

Re: [PATCH v4 4/4] mtd: rawnand: omap2: Select GPMC device driver for ARCH_K3

Hi Krzysztof,

[email protected] wrote on Wed, 22 Dec 2021 12:50:18 +0100:

Quoted 27 lines · Miquel Raynal
Quoted 13 lines

Hi Roger,

[email protected] wrote on Tue, 21 Dec 2021 15:17:57 +0200:

Quoted 9 lines

The GPMC device driver is required for NAND controller to work on K3 Architecture. Select it if required.

---
 drivers/mtd/nand/raw/Kconfig | 1 +
 1 file changed, 1 insertion(+)
Quoted 12 lines

drivers/mtd/nand/raw/Kconfig config MTD_NAND_OMAP2 · line 45

Quoted 9 lines
drivers/mtd/nand/raw/Kconfig +1 -0
index 67b7cb67c030..587f20c6184f 100644
@@ -42,6 +42,7 @@ config MTD_NAND_OMAP2
 	tristate "OMAP2, OMAP3, OMAP4 and Keystone NAND controller"
 	depends on ARCH_OMAP2PLUS || ARCH_KEYSTONE || COMPILE_TEST
 	depends on HAS_IOMEM
+	select OMAP_GPMC if ARCH_K3  
Quoted 2 lines

This patch looks actually independent. Miquel, do you want me to take it via memory controller drivers tree (like three other patches)?

Yes please, you can take it in your tree, I don't expect any conflicts in this area.

Thanks,
Miquèl

#12 lore raw
In reply to Roger Quadros
Quoted 13 lines · Roger Quadros

TI's AM64 SoC contains one GPMC module. Add driver support for it.

cheers,
-roger

Changelog:
v4
- move compatible match table to header file so it can be used by GPMC driver even when NAND driver is not enabled or as a module. GPMC driver is always enabled as built-in.
- Select OMAP_GPMC driver from MTD_NAND_OMAP2 driver config as OMAP_GPMC is not essential for ARCH_K3 boot.

Quoted 1 line

[...]

Applied, thanks!

[1/4] dt-bindings: memory-controllers: ti,gpmc: Add compatible for AM64

      commit: 4892242784786f3cbaa3b79ea03f8b0c145f6cfd
[2/4] memory: omap-gpmc: Add support for GPMC on AM64 SoC
      commit: 7e58accf4547b75070e5cc1e04f97e890d7f719a
[3/4] memory: omap-gpmc: Use a compatible match table when checking for NAND controller
      commit: f2f8115fe8b390af27d013411045bd712a812103
[4/4] mtd: rawnand: omap2: Select GPMC device driver for ARCH_K3
      commit: 5784260892e5b808e1317843f71d4b787ad1f4b7

Best regards,

Signature · 1 line
Krzysztof Kozlowski <[email protected]>
#13 lore raw
In reply to Roger Quadros

Hello,

Le 21/12/2021 à 14:17, Roger Quadros a écrit :

Quoted 3 lines

Hi,

TI's AM64 SoC contains one GPMC module. Add driver support for it.

What's the status of the GPMC interface on K3 architecture, especially for AM65, AM62 and other Jacinto 7 CPU devices ?

TI currently don't recommend to use it for now even if there are still some GPMC use case with FPGA devices:

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/994191/am6442-am64x-gpmc-support

This patch series add omap-gpmc support for AM64 Soc but as of kernel 5.18-rc2, there is no devicetree using ti,am64-gpmc.

This patch seems missing (at least):
https://git.ti.com/cgit/ti-linux-kernel/ti-linux-kernel/commit/?h=ti-linux-5.10.y&id=55c102a75d399896c7396229cd687bf97afb5cf6

Thanks!

Best regards,
Romain

Quoted 34 lines

cheers,
-roger

Changelog:
v4
- move compatible match table to header file so it can be used by GPMC driver even when NAND driver is not enabled or as a module. GPMC driver is always enabled as built-in.
- Select OMAP_GPMC driver from MTD_NAND_OMAP2 driver config as OMAP_GPMC is not essential for ARCH_K3 boot.

v3
- use compatible match table for checking for NAND controller node in GPMC driver.

v2
- update DT binding doc to make reg-names and power-domains property required only for specific SoC.

Roger Quadros (4):
dt-bindings: memory-controllers: ti,gpmc: Add compatible for AM64
memory: omap-gpmc: Add support for GPMC on AM64 SoC
memory: omap-gpmc: Use a compatible match table when checking for NAND
controller
mtd: rawnand: omap2: Select GPMC device driver for ARCH_K3

 .../bindings/memory-controllers/ti,gpmc.yaml  | 23 +++++++++-
 drivers/memory/omap-gpmc.c                    | 46 ++++++++++++++-----
 drivers/mtd/nand/raw/Kconfig                  |  1 +
 drivers/mtd/nand/raw/omap2.c                  |  5 +-
 include/linux/platform_data/mtd-nand-omap2.h  |  9 +++-
 5 files changed, 67 insertions(+), 17 deletions(-)
#14 lore raw
Quoted 13 lines · Romain Naour

Hello,

Le 21/12/2021 à 14:17, Roger Quadros a écrit :

Quoted 3 lines

Hi,

TI's AM64 SoC contains one GPMC module. Add driver support for it.

What's the status of the GPMC interface on K3 architecture, especially for AM65, AM62 and other Jacinto 7 CPU devices ?

TI currently don't recommend to use it for now even if there are still some GPMC use case with FPGA devices:

Quoted 7 lines

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/994191/am6442-am64x-gpmc-support

This patch series add omap-gpmc support for AM64 Soc but as of kernel 5.18-rc2, there is no devicetree using ti,am64-gpmc.

This patch seems missing (at least):
https://git.ti.com/cgit/ti-linux-kernel/ti-linux-kernel/commit/?h=ti-linux-5.10.y&id=55c102a75d399896c7396229cd687bf97afb5cf6

It's not how LKML development process works - driver changes has to be sent first and then DT changes as they accepted by different maintainers and through different trees.

Quoted 41 lines

Thanks!

Best regards,
Romain

Quoted 34 lines

cheers,
-roger

Changelog:
v4
- move compatible match table to header file so it can be used by GPMC driver even when NAND driver is not enabled or as a module. GPMC driver is always enabled as built-in.
- Select OMAP_GPMC driver from MTD_NAND_OMAP2 driver config as OMAP_GPMC is not essential for ARCH_K3 boot.

v3
- use compatible match table for checking for NAND controller node in GPMC driver.

v2
- update DT binding doc to make reg-names and power-domains property required only for specific SoC.

Roger Quadros (4):
dt-bindings: memory-controllers: ti,gpmc: Add compatible for AM64
memory: omap-gpmc: Add support for GPMC on AM64 SoC
memory: omap-gpmc: Use a compatible match table when checking for NAND
controller
mtd: rawnand: omap2: Select GPMC device driver for ARCH_K3

  .../bindings/memory-controllers/ti,gpmc.yaml  | 23 +++++++++-
  drivers/memory/omap-gpmc.c                    | 46 ++++++++++++++-----
  drivers/mtd/nand/raw/Kconfig                  |  1 +
  drivers/mtd/nand/raw/omap2.c                  |  5 +-
  include/linux/platform_data/mtd-nand-omap2.h  |  9 +++-
  5 files changed, 67 insertions(+), 17 deletions(-)
Signature · 2 lines
Best regards,
Grygorii, Ukraine
#15 lore raw

Hi,

Le 15/04/2022 à 15:06, Grygorii Strashko a écrit :

Quoted 22 lines · Romain Naour
Quoted 19 lines

Hello,

Le 21/12/2021 à 14:17, Roger Quadros a écrit :

Quoted 3 lines

Hi,

TI's AM64 SoC contains one GPMC module. Add driver support for it.

What's the status of the GPMC interface on K3 architecture, especially for AM65, AM62 and other Jacinto 7 CPU devices ?

TI currently don't recommend to use it for now even if there are still some GPMC use case with FPGA devices:

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/994191/am6442-am64x-gpmc-support

This patch series add omap-gpmc support for AM64 Soc but as of kernel 5.18-rc2, there is no devicetree using ti,am64-gpmc.

Quoted 7 lines
Quoted 3 lines

This patch seems missing (at least):
https://git.ti.com/cgit/ti-linux-kernel/ti-linux-kernel/commit/?h=ti-linux-5.10.y&id=55c102a75d399896c7396229cd687bf97afb5cf6

It's not how LKML development process works - driver changes has to be sent first and then DT changes  as they accepted by different maintainers and through different trees.

Ok, I understand.

DT changes are still under review [1] and are not yet merged in 5.18-rc6.

Sorry for the noise.

[1] https://lkml.org/lkml/2022/2/4/320

Best regards,
Romain

Quoted 43 lines
Quoted 42 lines

Thanks!

Best regards,
Romain

Quoted 34 lines

cheers,
-roger

Changelog:
v4
- move compatible match table to header file so it can be used by GPMC driver even when NAND driver is not enabled or as a module. GPMC driver is always enabled as built-in.
- Select OMAP_GPMC driver from MTD_NAND_OMAP2 driver config as OMAP_GPMC is not essential for ARCH_K3 boot.

v3
- use compatible match table for checking for NAND controller node in GPMC driver.

v2
- update DT binding doc to make reg-names and power-domains property required only for specific SoC.

Roger Quadros (4):
   dt-bindings: memory-controllers: ti,gpmc: Add compatible for AM64
   memory: omap-gpmc: Add support for GPMC on AM64 SoC
   memory: omap-gpmc: Use a compatible match table when checking for NAND controller
   mtd: rawnand: omap2: Select GPMC device driver for ARCH_K3

  .../bindings/memory-controllers/ti,gpmc.yaml  | 23 +++++++++- drivers/memory/omap-gpmc.c                    | 46 ++++++++++++++----- drivers/mtd/nand/raw/Kconfig                  |  1 + drivers/mtd/nand/raw/omap2.c                  |  5 +- include/linux/platform_data/mtd-nand-omap2.h  |  9 +++-

  5 files changed, 67 insertions(+), 17 deletions(-)