* [PATCH v4 0/4] memory: omap-gpmc: Add AM64 SoC support
@ 2021-12-21 13:17 Roger Quadros
2021-12-21 13:17 ` [PATCH v4 1/4] dt-bindings: memory-controllers: ti,gpmc: Add compatible for AM64 Roger Quadros
` (4 more replies)
0 siblings, 5 replies; 13+ messages in thread
From: Roger Quadros @ 2021-12-21 13:17 UTC (permalink / raw)
To: krzysztof.kozlowski, miquel.raynal, tony
Cc: robh, kishon, nm, vigneshr, linux-mtd, linux-omap, linux-kernel,
devicetree, Roger Quadros
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(-)
--
2.17.1
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH v4 1/4] dt-bindings: memory-controllers: ti,gpmc: Add compatible for AM64
2021-12-21 13:17 [PATCH v4 0/4] memory: omap-gpmc: Add AM64 SoC support Roger Quadros
@ 2021-12-21 13:17 ` Roger Quadros
2021-12-21 13:17 ` [PATCH v4 2/4] memory: omap-gpmc: Add support for GPMC on AM64 SoC Roger Quadros
` (3 subsequent siblings)
4 siblings, 0 replies; 13+ messages in thread
From: Roger Quadros @ 2021-12-21 13:17 UTC (permalink / raw)
To: krzysztof.kozlowski, miquel.raynal, tony
Cc: robh, kishon, nm, vigneshr, linux-mtd, linux-omap, linux-kernel,
devicetree, Roger Quadros
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.
Signed-off-by: Roger Quadros <rogerq@kernel.org>
Reviewed-by: Rob Herring <robh@kernel.org>
---
.../bindings/memory-controllers/ti,gpmc.yaml | 23 ++++++++++++++++++-
1 file changed, 22 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/memory-controllers/ti,gpmc.yaml b/Documentation/devicetree/bindings/memory-controllers/ti,gpmc.yaml
index 25b42d68f9b3..64dc9d398d9a 100644
--- a/Documentation/devicetree/bindings/memory-controllers/ti,gpmc.yaml
+++ b/Documentation/devicetree/bindings/memory-controllers/ti,gpmc.yaml
@@ -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:
--
2.17.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH v4 2/4] memory: omap-gpmc: Add support for GPMC on AM64 SoC
2021-12-21 13:17 [PATCH v4 0/4] memory: omap-gpmc: Add AM64 SoC support Roger Quadros
2021-12-21 13:17 ` [PATCH v4 1/4] dt-bindings: memory-controllers: ti,gpmc: Add compatible for AM64 Roger Quadros
@ 2021-12-21 13:17 ` Roger Quadros
2021-12-21 13:17 ` [PATCH v4 3/4] memory: omap-gpmc: Use a compatible match table when checking for NAND controller Roger Quadros
` (2 subsequent siblings)
4 siblings, 0 replies; 13+ messages in thread
From: Roger Quadros @ 2021-12-21 13:17 UTC (permalink / raw)
To: krzysztof.kozlowski, miquel.raynal, tony
Cc: robh, kishon, nm, vigneshr, linux-mtd, linux-omap, linux-kernel,
devicetree, 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.
Signed-off-by: Roger Quadros <rogerq@kernel.org>
---
drivers/memory/omap-gpmc.c | 40 ++++++++++++++++++++++++++++----------
1 file changed, 30 insertions(+), 10 deletions(-)
diff --git a/drivers/memory/omap-gpmc.c b/drivers/memory/omap-gpmc.c
index be0858bff4d3..624153048182 100644
--- a/drivers/memory/omap-gpmc.c
+++ b/drivers/memory/omap-gpmc.c
@@ -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;
--
2.17.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH v4 3/4] memory: omap-gpmc: Use a compatible match table when checking for NAND controller
2021-12-21 13:17 [PATCH v4 0/4] memory: omap-gpmc: Add AM64 SoC support Roger Quadros
2021-12-21 13:17 ` [PATCH v4 1/4] dt-bindings: memory-controllers: ti,gpmc: Add compatible for AM64 Roger Quadros
2021-12-21 13:17 ` [PATCH v4 2/4] memory: omap-gpmc: Add support for GPMC on AM64 SoC Roger Quadros
@ 2021-12-21 13:17 ` Roger Quadros
2021-12-21 20:01 ` Roger Quadros
2021-12-21 13:17 ` [PATCH v4 4/4] mtd: rawnand: omap2: Select GPMC device driver for ARCH_K3 Roger Quadros
2021-12-22 15:52 ` [PATCH v4 0/4] memory: omap-gpmc: Add AM64 SoC support Krzysztof Kozlowski
4 siblings, 1 reply; 13+ messages in thread
From: Roger Quadros @ 2021-12-21 13:17 UTC (permalink / raw)
To: krzysztof.kozlowski, miquel.raynal, tony
Cc: robh, kishon, nm, vigneshr, linux-mtd, linux-omap, linux-kernel,
devicetree, Roger Quadros
As more compatibles can be added to the GPMC NAND controller driver
use a compatible match table.
Cc: Miquel Raynal <miquel.raynal@bootlin.com>
Signed-off-by: Roger Quadros <rogerq@kernel.org>
---
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(-)
diff --git a/drivers/memory/omap-gpmc.c b/drivers/memory/omap-gpmc.c
index 624153048182..d19ffc895e5b 100644
--- a/drivers/memory/omap-gpmc.c
+++ b/drivers/memory/omap-gpmc.c
@@ -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);
diff --git a/drivers/mtd/nand/raw/omap2.c b/drivers/mtd/nand/raw/omap2.c
index b26d4947af02..e6dd8b4cf0d2 100644
--- a/drivers/mtd/nand/raw/omap2.c
+++ b/drivers/mtd/nand/raw/omap2.c
@@ -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 = {
diff --git a/include/linux/platform_data/mtd-nand-omap2.h b/include/linux/platform_data/mtd-nand-omap2.h
index de6ada739121..92f011805ad4 100644
--- a/include/linux/platform_data/mtd-nand-omap2.h
+++ b/include/linux/platform_data/mtd-nand-omap2.h
@@ -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 */
--
2.17.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH v4 4/4] mtd: rawnand: omap2: Select GPMC device driver for ARCH_K3
2021-12-21 13:17 [PATCH v4 0/4] memory: omap-gpmc: Add AM64 SoC support Roger Quadros
` (2 preceding siblings ...)
2021-12-21 13:17 ` [PATCH v4 3/4] memory: omap-gpmc: Use a compatible match table when checking for NAND controller Roger Quadros
@ 2021-12-21 13:17 ` Roger Quadros
2021-12-21 13:49 ` Miquel Raynal
2021-12-22 15:52 ` [PATCH v4 0/4] memory: omap-gpmc: Add AM64 SoC support Krzysztof Kozlowski
4 siblings, 1 reply; 13+ messages in thread
From: Roger Quadros @ 2021-12-21 13:17 UTC (permalink / raw)
To: krzysztof.kozlowski, miquel.raynal, tony
Cc: robh, kishon, nm, vigneshr, linux-mtd, linux-omap, linux-kernel,
devicetree, Roger Quadros
The GPMC device driver is required for NAND controller
to work on K3 Architecture. Select it if required.
Cc: Miquel Raynal <miquel.raynal@bootlin.com>
Signed-off-by: Roger Quadros <rogerq@kernel.org>
---
drivers/mtd/nand/raw/Kconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/mtd/nand/raw/Kconfig b/drivers/mtd/nand/raw/Kconfig
index 67b7cb67c030..587f20c6184f 100644
--- a/drivers/mtd/nand/raw/Kconfig
+++ b/drivers/mtd/nand/raw/Kconfig
@@ -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.
--
2.17.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [PATCH v4 4/4] mtd: rawnand: omap2: Select GPMC device driver for ARCH_K3
2021-12-21 13:17 ` [PATCH v4 4/4] mtd: rawnand: omap2: Select GPMC device driver for ARCH_K3 Roger Quadros
@ 2021-12-21 13:49 ` Miquel Raynal
2021-12-22 11:50 ` Krzysztof Kozlowski
0 siblings, 1 reply; 13+ messages in thread
From: Miquel Raynal @ 2021-12-21 13:49 UTC (permalink / raw)
To: Roger Quadros
Cc: krzysztof.kozlowski, tony, robh, kishon, nm, vigneshr, linux-mtd,
linux-omap, linux-kernel, devicetree
Hi Roger,
rogerq@kernel.org wrote on Tue, 21 Dec 2021 15:17:57 +0200:
> The GPMC device driver is required for NAND controller
> to work on K3 Architecture. Select it if required.
>
> Cc: Miquel Raynal <miquel.raynal@bootlin.com>
> Signed-off-by: Roger Quadros <rogerq@kernel.org>
> ---
> drivers/mtd/nand/raw/Kconfig | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/mtd/nand/raw/Kconfig b/drivers/mtd/nand/raw/Kconfig
> index 67b7cb67c030..587f20c6184f 100644
> --- a/drivers/mtd/nand/raw/Kconfig
> +++ b/drivers/mtd/nand/raw/Kconfig
> @@ -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
Acked-by: Miquel Raynal <miquel.raynal@bootlin.com>
> help
> Support for NAND flash on Texas Instruments OMAP2, OMAP3, OMAP4
> and Keystone platforms.
Thanks,
Miquèl
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v4 3/4] memory: omap-gpmc: Use a compatible match table when checking for NAND controller
2021-12-21 13:17 ` [PATCH v4 3/4] memory: omap-gpmc: Use a compatible match table when checking for NAND controller Roger Quadros
@ 2021-12-21 20:01 ` Roger Quadros
2021-12-22 14:18 ` Miquel Raynal
0 siblings, 1 reply; 13+ messages in thread
From: Roger Quadros @ 2021-12-21 20:01 UTC (permalink / raw)
To: krzysztof.kozlowski, miquel.raynal, tony
Cc: robh, kishon, nm, vigneshr, linux-mtd, linux-omap, linux-kernel,
devicetree
Hi Miquel,
On 21/12/2021 15:17, Roger Quadros wrote:
> As more compatibles can be added to the GPMC NAND controller driver
> use a compatible match table.
>
> Cc: Miquel Raynal <miquel.raynal@bootlin.com>
> Signed-off-by: Roger Quadros <rogerq@kernel.org>
> ---
> drivers/memory/omap-gpmc.c | 6 +++++-
> drivers/mtd/nand/raw/omap2.c | 5 +----
Will need your Ack for this one as well. Thanks :)
> include/linux/platform_data/mtd-nand-omap2.h | 9 ++++++++-
> 3 files changed, 14 insertions(+), 6 deletions(-)
cheers,
-roger
>
> diff --git a/drivers/memory/omap-gpmc.c b/drivers/memory/omap-gpmc.c
> index 624153048182..d19ffc895e5b 100644
> --- a/drivers/memory/omap-gpmc.c
> +++ b/drivers/memory/omap-gpmc.c
> @@ -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);
> diff --git a/drivers/mtd/nand/raw/omap2.c b/drivers/mtd/nand/raw/omap2.c
> index b26d4947af02..e6dd8b4cf0d2 100644
> --- a/drivers/mtd/nand/raw/omap2.c
> +++ b/drivers/mtd/nand/raw/omap2.c
> @@ -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 = {
> diff --git a/include/linux/platform_data/mtd-nand-omap2.h b/include/linux/platform_data/mtd-nand-omap2.h
> index de6ada739121..92f011805ad4 100644
> --- a/include/linux/platform_data/mtd-nand-omap2.h
> +++ b/include/linux/platform_data/mtd-nand-omap2.h
> @@ -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 */
>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v4 4/4] mtd: rawnand: omap2: Select GPMC device driver for ARCH_K3
2021-12-21 13:49 ` Miquel Raynal
@ 2021-12-22 11:50 ` Krzysztof Kozlowski
2021-12-22 14:19 ` Miquel Raynal
0 siblings, 1 reply; 13+ messages in thread
From: Krzysztof Kozlowski @ 2021-12-22 11:50 UTC (permalink / raw)
To: Miquel Raynal, Roger Quadros
Cc: tony, robh, kishon, nm, vigneshr, linux-mtd, linux-omap,
linux-kernel, devicetree
On 21/12/2021 14:49, Miquel Raynal wrote:
> Hi Roger,
>
> rogerq@kernel.org wrote on Tue, 21 Dec 2021 15:17:57 +0200:
>
>> The GPMC device driver is required for NAND controller
>> to work on K3 Architecture. Select it if required.
>>
>> Cc: Miquel Raynal <miquel.raynal@bootlin.com>
>> Signed-off-by: Roger Quadros <rogerq@kernel.org>
>> ---
>> drivers/mtd/nand/raw/Kconfig | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/mtd/nand/raw/Kconfig b/drivers/mtd/nand/raw/Kconfig
>> index 67b7cb67c030..587f20c6184f 100644
>> --- a/drivers/mtd/nand/raw/Kconfig
>> +++ b/drivers/mtd/nand/raw/Kconfig
>> @@ -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
>
> Acked-by: Miquel Raynal <miquel.raynal@bootlin.com>
>
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
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v4 3/4] memory: omap-gpmc: Use a compatible match table when checking for NAND controller
2021-12-21 20:01 ` Roger Quadros
@ 2021-12-22 14:18 ` Miquel Raynal
2021-12-22 15:49 ` Krzysztof Kozlowski
0 siblings, 1 reply; 13+ messages in thread
From: Miquel Raynal @ 2021-12-22 14:18 UTC (permalink / raw)
To: Roger Quadros
Cc: krzysztof.kozlowski, tony, robh, kishon, nm, vigneshr, linux-mtd,
linux-omap, linux-kernel, devicetree
Hi Roger,
rogerq@kernel.org wrote on Tue, 21 Dec 2021 22:01:28 +0200:
> Hi Miquel,
>
> On 21/12/2021 15:17, Roger Quadros wrote:
> > As more compatibles can be added to the GPMC NAND controller driver
> > use a compatible match table.
> >
> > Cc: Miquel Raynal <miquel.raynal@bootlin.com>
> > Signed-off-by: Roger Quadros <rogerq@kernel.org>
> > ---
> > drivers/memory/omap-gpmc.c | 6 +++++-
> > drivers/mtd/nand/raw/omap2.c | 5 +----
>
> Will need your Ack for this one as well. Thanks :)
>
>
> > include/linux/platform_data/mtd-nand-omap2.h | 9 ++++++++-
> > 3 files changed, 14 insertions(+), 6 deletions(-)
>
> cheers,
> -roger
>
> >
> > diff --git a/drivers/memory/omap-gpmc.c b/drivers/memory/omap-gpmc.c
> > index 624153048182..d19ffc895e5b 100644
> > --- a/drivers/memory/omap-gpmc.c
> > +++ b/drivers/memory/omap-gpmc.c
> > @@ -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) {
nitpick: why this intermediate variable?
Otherwise for the NAND bits:
Acked-by: Miquel Raynal <miquel.raynal@bootlin.com>
> > /* NAND specific setup */
> > val = 8;
> > of_property_read_u32(child, "nand-bus-width", &val);
> > diff --git a/drivers/mtd/nand/raw/omap2.c b/drivers/mtd/nand/raw/omap2.c
> > index b26d4947af02..e6dd8b4cf0d2 100644
> > --- a/drivers/mtd/nand/raw/omap2.c
> > +++ b/drivers/mtd/nand/raw/omap2.c
> > @@ -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 = {
> > diff --git a/include/linux/platform_data/mtd-nand-omap2.h b/include/linux/platform_data/mtd-nand-omap2.h
> > index de6ada739121..92f011805ad4 100644
> > --- a/include/linux/platform_data/mtd-nand-omap2.h
> > +++ b/include/linux/platform_data/mtd-nand-omap2.h
> > @@ -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 */
> >
Thanks,
Miquèl
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v4 4/4] mtd: rawnand: omap2: Select GPMC device driver for ARCH_K3
2021-12-22 11:50 ` Krzysztof Kozlowski
@ 2021-12-22 14:19 ` Miquel Raynal
0 siblings, 0 replies; 13+ messages in thread
From: Miquel Raynal @ 2021-12-22 14:19 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: Roger Quadros, tony, robh, kishon, nm, vigneshr, linux-mtd,
linux-omap, linux-kernel, devicetree
Hi Krzysztof,
krzysztof.kozlowski@canonical.com wrote on Wed, 22 Dec 2021 12:50:18
+0100:
> On 21/12/2021 14:49, Miquel Raynal wrote:
> > Hi Roger,
> >
> > rogerq@kernel.org wrote on Tue, 21 Dec 2021 15:17:57 +0200:
> >
> >> The GPMC device driver is required for NAND controller
> >> to work on K3 Architecture. Select it if required.
> >>
> >> Cc: Miquel Raynal <miquel.raynal@bootlin.com>
> >> Signed-off-by: Roger Quadros <rogerq@kernel.org>
> >> ---
> >> drivers/mtd/nand/raw/Kconfig | 1 +
> >> 1 file changed, 1 insertion(+)
> >>
> >> diff --git a/drivers/mtd/nand/raw/Kconfig b/drivers/mtd/nand/raw/Kconfig
> >> index 67b7cb67c030..587f20c6184f 100644
> >> --- a/drivers/mtd/nand/raw/Kconfig
> >> +++ b/drivers/mtd/nand/raw/Kconfig
> >> @@ -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
> >
> > Acked-by: Miquel Raynal <miquel.raynal@bootlin.com>
> >
>
> 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
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v4 3/4] memory: omap-gpmc: Use a compatible match table when checking for NAND controller
2021-12-22 14:18 ` Miquel Raynal
@ 2021-12-22 15:49 ` Krzysztof Kozlowski
2021-12-22 17:04 ` Roger Quadros
0 siblings, 1 reply; 13+ messages in thread
From: Krzysztof Kozlowski @ 2021-12-22 15:49 UTC (permalink / raw)
To: Miquel Raynal, Roger Quadros
Cc: tony, robh, kishon, nm, vigneshr, linux-mtd, linux-omap,
linux-kernel, devicetree
On 22/12/2021 15:18, Miquel Raynal wrote:
> Hi Roger,
>
> rogerq@kernel.org wrote on Tue, 21 Dec 2021 22:01:28 +0200:
>
>> Hi Miquel,
>>
>> On 21/12/2021 15:17, Roger Quadros wrote:
>>> As more compatibles can be added to the GPMC NAND controller driver
>>> use a compatible match table.
>>>
>>> Cc: Miquel Raynal <miquel.raynal@bootlin.com>
>>> Signed-off-by: Roger Quadros <rogerq@kernel.org>
>>> ---
>>> drivers/memory/omap-gpmc.c | 6 +++++-
>>> drivers/mtd/nand/raw/omap2.c | 5 +----
>>
>> Will need your Ack for this one as well. Thanks :)
>>
>>
>>> include/linux/platform_data/mtd-nand-omap2.h | 9 ++++++++-
>>> 3 files changed, 14 insertions(+), 6 deletions(-)
>>
>> cheers,
>> -roger
>>
>>>
>>> diff --git a/drivers/memory/omap-gpmc.c b/drivers/memory/omap-gpmc.c
>>> index 624153048182..d19ffc895e5b 100644
>>> --- a/drivers/memory/omap-gpmc.c
>>> +++ b/drivers/memory/omap-gpmc.c
>>> @@ -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) {
>
> 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
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v4 0/4] memory: omap-gpmc: Add AM64 SoC support
2021-12-21 13:17 [PATCH v4 0/4] memory: omap-gpmc: Add AM64 SoC support Roger Quadros
` (3 preceding siblings ...)
2021-12-21 13:17 ` [PATCH v4 4/4] mtd: rawnand: omap2: Select GPMC device driver for ARCH_K3 Roger Quadros
@ 2021-12-22 15:52 ` Krzysztof Kozlowski
4 siblings, 0 replies; 13+ messages in thread
From: Krzysztof Kozlowski @ 2021-12-22 15:52 UTC (permalink / raw)
To: tony, miquel.raynal, Roger Quadros
Cc: Krzysztof Kozlowski, linux-mtd, robh, linux-omap, linux-kernel,
nm, vigneshr, kishon, devicetree
On Tue, 21 Dec 2021 15:17:53 +0200, Roger Quadros wrote:
> 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.
>
> [...]
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,
--
Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v4 3/4] memory: omap-gpmc: Use a compatible match table when checking for NAND controller
2021-12-22 15:49 ` Krzysztof Kozlowski
@ 2021-12-22 17:04 ` Roger Quadros
0 siblings, 0 replies; 13+ messages in thread
From: Roger Quadros @ 2021-12-22 17:04 UTC (permalink / raw)
To: Krzysztof Kozlowski, Miquel Raynal
Cc: tony, robh, kishon, nm, vigneshr, linux-mtd, linux-omap,
linux-kernel, devicetree
On 22/12/2021 17:49, Krzysztof Kozlowski wrote:
> On 22/12/2021 15:18, Miquel Raynal wrote:
>> Hi Roger,
>>
>> rogerq@kernel.org wrote on Tue, 21 Dec 2021 22:01:28 +0200:
>>
>>> Hi Miquel,
>>>
>>> On 21/12/2021 15:17, Roger Quadros wrote:
>>>> As more compatibles can be added to the GPMC NAND controller driver
>>>> use a compatible match table.
>>>>
>>>> Cc: Miquel Raynal <miquel.raynal@bootlin.com>
>>>> Signed-off-by: Roger Quadros <rogerq@kernel.org>
>>>> ---
>>>> drivers/memory/omap-gpmc.c | 6 +++++-
>>>> drivers/mtd/nand/raw/omap2.c | 5 +----
>>>
>>> Will need your Ack for this one as well. Thanks :)
>>>
>>>
>>>> include/linux/platform_data/mtd-nand-omap2.h | 9 ++++++++-
>>>> 3 files changed, 14 insertions(+), 6 deletions(-)
>>>
>>> cheers,
>>> -roger
>>>
>>>>
>>>> diff --git a/drivers/memory/omap-gpmc.c b/drivers/memory/omap-gpmc.c
>>>> index 624153048182..d19ffc895e5b 100644
>>>> --- a/drivers/memory/omap-gpmc.c
>>>> +++ b/drivers/memory/omap-gpmc.c
>>>> @@ -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) {
>>
>> nitpick: why this intermediate variable?
>>
>
> 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
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2021-12-22 17:04 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-21 13:17 [PATCH v4 0/4] memory: omap-gpmc: Add AM64 SoC support Roger Quadros
2021-12-21 13:17 ` [PATCH v4 1/4] dt-bindings: memory-controllers: ti,gpmc: Add compatible for AM64 Roger Quadros
2021-12-21 13:17 ` [PATCH v4 2/4] memory: omap-gpmc: Add support for GPMC on AM64 SoC Roger Quadros
2021-12-21 13:17 ` [PATCH v4 3/4] memory: omap-gpmc: Use a compatible match table when checking for NAND controller Roger Quadros
2021-12-21 20:01 ` Roger Quadros
2021-12-22 14:18 ` Miquel Raynal
2021-12-22 15:49 ` Krzysztof Kozlowski
2021-12-22 17:04 ` Roger Quadros
2021-12-21 13:17 ` [PATCH v4 4/4] mtd: rawnand: omap2: Select GPMC device driver for ARCH_K3 Roger Quadros
2021-12-21 13:49 ` Miquel Raynal
2021-12-22 11:50 ` Krzysztof Kozlowski
2021-12-22 14:19 ` Miquel Raynal
2021-12-22 15:52 ` [PATCH v4 0/4] memory: omap-gpmc: Add AM64 SoC support Krzysztof Kozlowski
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).