linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RESEND 0/2] ARM: davinci: improve the nand clock lookup
@ 2017-01-13 10:00 Bartosz Golaszewski
  2017-01-13 10:00 ` [PATCH RESEND 1/2] memory: aemif: allow passing device lookup table as platform data Bartosz Golaszewski
  2017-01-13 10:00 ` [PATCH RESEND 2/2] ARM: da850: add the nand dev_id to the clock lookup table Bartosz Golaszewski
  0 siblings, 2 replies; 8+ messages in thread
From: Bartosz Golaszewski @ 2017-01-13 10:00 UTC (permalink / raw)
  To: Sekhar Nori, Kevin Hilman, Russell King, Santosh Shilimkar,
	Greg Kroah-Hartman
  Cc: LKML, arm-soc, Bartosz Golaszewski

Hi Greg,

Santosh acked patch 1/2, but suggested that it go through your tree.
Can you pick it up for 4.11?

Sekhar, will you pick up patch 2/2 for the davinci tree or should it
go together with 1/2?

---------

This is a follow-up to the series fixing the da850 clocks.

Instead of having a half-measure of leaving out the dev_id from the
clock lookup table, make the aemif driver capable of accessing it
over platform data.

Tested with da850-lcdk.

Bartosz Golaszewski (2):
  memory: aemif: allow passing device lookup table as platform data
  ARM: da850: add the nand dev_id to the clock lookup table

 arch/arm/mach-davinci/da850.c          | 10 +---------
 arch/arm/mach-davinci/da8xx-dt.c       | 12 +++++++++++-
 drivers/memory/ti-aemif.c              |  8 +++++++-
 include/linux/platform_data/ti-aemif.h | 23 +++++++++++++++++++++++
 4 files changed, 42 insertions(+), 11 deletions(-)
 create mode 100644 include/linux/platform_data/ti-aemif.h

-- 
2.9.3

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

* [PATCH RESEND 1/2] memory: aemif: allow passing device lookup table as platform data
  2017-01-13 10:00 [PATCH RESEND 0/2] ARM: davinci: improve the nand clock lookup Bartosz Golaszewski
@ 2017-01-13 10:00 ` Bartosz Golaszewski
  2017-01-13 16:36   ` Santosh Shilimkar
  2017-01-13 10:00 ` [PATCH RESEND 2/2] ARM: da850: add the nand dev_id to the clock lookup table Bartosz Golaszewski
  1 sibling, 1 reply; 8+ messages in thread
From: Bartosz Golaszewski @ 2017-01-13 10:00 UTC (permalink / raw)
  To: Sekhar Nori, Kevin Hilman, Russell King, Santosh Shilimkar,
	Greg Kroah-Hartman
  Cc: LKML, arm-soc, Bartosz Golaszewski

TI aemif driver creates its own subnodes of the device tree in order
to guarantee that all child devices are probed after the AEMIF timing
parameters are configured.

Some devices (e.g. da850) use struct of_dev_auxdata for clock lookup
but nodes created from within the aemif driver can't access the lookup
table.

Create a platform data structure that holds a pointer to
of_dev_auxdata so that we can use it with of_platform_populate().

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Acked-by: Sekhar Nori <nsekhar@ti.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
---
 drivers/memory/ti-aemif.c              |  8 +++++++-
 include/linux/platform_data/ti-aemif.h | 23 +++++++++++++++++++++++
 2 files changed, 30 insertions(+), 1 deletion(-)
 create mode 100644 include/linux/platform_data/ti-aemif.h

diff --git a/drivers/memory/ti-aemif.c b/drivers/memory/ti-aemif.c
index a579a0f..22c1aee 100644
--- a/drivers/memory/ti-aemif.c
+++ b/drivers/memory/ti-aemif.c
@@ -20,6 +20,7 @@
 #include <linux/of.h>
 #include <linux/of_platform.h>
 #include <linux/platform_device.h>
+#include <linux/platform_data/ti-aemif.h>
 
 #define TA_SHIFT	2
 #define RHOLD_SHIFT	4
@@ -335,6 +336,8 @@ static int aemif_probe(struct platform_device *pdev)
 	struct device_node *np = dev->of_node;
 	struct device_node *child_np;
 	struct aemif_device *aemif;
+	struct aemif_platform_data *pdata;
+	struct of_dev_auxdata *dev_lookup;
 
 	if (np == NULL)
 		return 0;
@@ -343,6 +346,9 @@ static int aemif_probe(struct platform_device *pdev)
 	if (!aemif)
 		return -ENOMEM;
 
+	pdata = dev_get_platdata(&pdev->dev);
+	dev_lookup = pdata ? pdata->dev_lookup : NULL;
+
 	platform_set_drvdata(pdev, aemif);
 
 	aemif->clk = devm_clk_get(dev, NULL);
@@ -390,7 +396,7 @@ static int aemif_probe(struct platform_device *pdev)
 	 * parameters are set.
 	 */
 	for_each_available_child_of_node(np, child_np) {
-		ret = of_platform_populate(child_np, NULL, NULL, dev);
+		ret = of_platform_populate(child_np, NULL, dev_lookup, dev);
 		if (ret < 0)
 			goto error;
 	}
diff --git a/include/linux/platform_data/ti-aemif.h b/include/linux/platform_data/ti-aemif.h
new file mode 100644
index 0000000..ac72e11
--- /dev/null
+++ b/include/linux/platform_data/ti-aemif.h
@@ -0,0 +1,23 @@
+/*
+ * TI DaVinci AEMIF platform glue.
+ *
+ * Copyright (C) 2017 BayLibre SAS
+ *
+ * Author:
+ *   Bartosz Golaszewski <bgolaszewski@baylibre.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#ifndef __TI_DAVINCI_AEMIF_DATA_H__
+#define __TI_DAVINCI_AEMIF_DATA_H__
+
+#include <linux/of_platform.h>
+
+struct aemif_platform_data {
+	struct of_dev_auxdata *dev_lookup;
+};
+
+#endif /* __TI_DAVINCI_AEMIF_DATA_H__ */
-- 
2.9.3

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

* [PATCH RESEND 2/2] ARM: da850: add the nand dev_id to the clock lookup table
  2017-01-13 10:00 [PATCH RESEND 0/2] ARM: davinci: improve the nand clock lookup Bartosz Golaszewski
  2017-01-13 10:00 ` [PATCH RESEND 1/2] memory: aemif: allow passing device lookup table as platform data Bartosz Golaszewski
@ 2017-01-13 10:00 ` Bartosz Golaszewski
  2017-01-20 13:46   ` Sekhar Nori
  1 sibling, 1 reply; 8+ messages in thread
From: Bartosz Golaszewski @ 2017-01-13 10:00 UTC (permalink / raw)
  To: Sekhar Nori, Kevin Hilman, Russell King, Santosh Shilimkar,
	Greg Kroah-Hartman
  Cc: LKML, arm-soc, Bartosz Golaszewski

The aemif driver can now access struct of_dev_auxdata (using platform
data).

Add the device id to the clock lookup table for the nand clock and
create a separate lookup table for aemif subnodes.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 arch/arm/mach-davinci/da850.c    | 10 +---------
 arch/arm/mach-davinci/da8xx-dt.c | 12 +++++++++++-
 2 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/arch/arm/mach-davinci/da850.c b/arch/arm/mach-davinci/da850.c
index 55f6e11..7475f02 100644
--- a/arch/arm/mach-davinci/da850.c
+++ b/arch/arm/mach-davinci/da850.c
@@ -557,15 +557,7 @@ static struct clk_lookup da850_clks[] = {
 	CLK("da830-mmc.0",	NULL,		&mmcsd0_clk),
 	CLK("da830-mmc.1",	NULL,		&mmcsd1_clk),
 	CLK("ti-aemif",		NULL,		&aemif_clk),
-	/*
-	 * The only user of this clock is davinci_nand and it get's it through
-	 * con_id. The nand node itself is created from within the aemif
-	 * driver to guarantee that it's probed after the aemif timing
-	 * parameters are configured. of_dev_auxdata is not accessible from
-	 * the aemif driver and can't be passed to of_platform_populate(). For
-	 * that reason we're leaving the dev_id here as NULL.
-	 */
-	CLK(NULL,		"aemif",	&aemif_nand_clk),
+	CLK("davinci-nand.0",	"aemif",	&aemif_nand_clk),
 	CLK("ohci-da8xx",	"usb11",	&usb11_clk),
 	CLK("musb-da8xx",	"usb20",	&usb20_clk),
 	CLK("spi_davinci.0",	NULL,		&spi0_clk),
diff --git a/arch/arm/mach-davinci/da8xx-dt.c b/arch/arm/mach-davinci/da8xx-dt.c
index 9ee44da..06205fe 100644
--- a/arch/arm/mach-davinci/da8xx-dt.c
+++ b/arch/arm/mach-davinci/da8xx-dt.c
@@ -11,6 +11,7 @@
 #include <linux/of_irq.h>
 #include <linux/of_platform.h>
 #include <linux/irqdomain.h>
+#include <linux/platform_data/ti-aemif.h>
 
 #include <asm/mach/arch.h>
 
@@ -18,6 +19,15 @@
 #include "cp_intc.h"
 #include <mach/da8xx.h>
 
+static struct of_dev_auxdata da850_aemif_auxdata_lookup[] = {
+	OF_DEV_AUXDATA("ti,davinci-nand", 0x62000000, "davinci-nand.0", NULL),
+	{}
+};
+
+static struct aemif_platform_data aemif_data = {
+	.dev_lookup = da850_aemif_auxdata_lookup,
+};
+
 static struct of_dev_auxdata da850_auxdata_lookup[] __initdata = {
 	OF_DEV_AUXDATA("ti,davinci-i2c", 0x01c22000, "i2c_davinci.1", NULL),
 	OF_DEV_AUXDATA("ti,davinci-i2c", 0x01e28000, "i2c_davinci.2", NULL),
@@ -37,7 +47,7 @@ static struct of_dev_auxdata da850_auxdata_lookup[] __initdata = {
 	OF_DEV_AUXDATA("ti,davinci-dm6467-emac", 0x01e20000, "davinci_emac.1",
 		       NULL),
 	OF_DEV_AUXDATA("ti,da830-mcasp-audio", 0x01d00000, "davinci-mcasp.0", NULL),
-	OF_DEV_AUXDATA("ti,da850-aemif", 0x68000000, "ti-aemif", NULL),
+	OF_DEV_AUXDATA("ti,da850-aemif", 0x68000000, "ti-aemif", &aemif_data),
 	OF_DEV_AUXDATA("ti,da850-tilcdc", 0x01e13000, "da8xx_lcdc.0", NULL),
 	OF_DEV_AUXDATA("ti,da830-ohci", 0x01e25000, "ohci-da8xx", NULL),
 	OF_DEV_AUXDATA("ti,da830-musb", 0x01e00000, "musb-da8xx", NULL),
-- 
2.9.3

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

* Re: [PATCH RESEND 1/2] memory: aemif: allow passing device lookup table as platform data
  2017-01-13 10:00 ` [PATCH RESEND 1/2] memory: aemif: allow passing device lookup table as platform data Bartosz Golaszewski
@ 2017-01-13 16:36   ` Santosh Shilimkar
  0 siblings, 0 replies; 8+ messages in thread
From: Santosh Shilimkar @ 2017-01-13 16:36 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Bartosz Golaszewski, Sekhar Nori, Kevin Hilman, Russell King,
	LKML, arm-soc

Hi Greg,

On 1/13/2017 2:00 AM, Bartosz Golaszewski wrote:
> TI aemif driver creates its own subnodes of the device tree in order
> to guarantee that all child devices are probed after the AEMIF timing
> parameters are configured.
>
> Some devices (e.g. da850) use struct of_dev_auxdata for clock lookup
> but nodes created from within the aemif driver can't access the lookup
> table.
>
> Create a platform data structure that holds a pointer to
> of_dev_auxdata so that we can use it with of_platform_populate().
>
> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> Acked-by: Sekhar Nori <nsekhar@ti.com>
> Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
> ---
Can you please take this one patch via your driver core ?

Regards,
Santosh

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

* Re: [PATCH RESEND 2/2] ARM: da850: add the nand dev_id to the clock lookup table
  2017-01-13 10:00 ` [PATCH RESEND 2/2] ARM: da850: add the nand dev_id to the clock lookup table Bartosz Golaszewski
@ 2017-01-20 13:46   ` Sekhar Nori
  2017-01-23 15:17     ` Sekhar Nori
  0 siblings, 1 reply; 8+ messages in thread
From: Sekhar Nori @ 2017-01-20 13:46 UTC (permalink / raw)
  To: Bartosz Golaszewski, Kevin Hilman, Russell King,
	Santosh Shilimkar, Greg Kroah-Hartman
  Cc: LKML, arm-soc

On Friday 13 January 2017 03:30 PM, Bartosz Golaszewski wrote:
> The aemif driver can now access struct of_dev_auxdata (using platform
> data).
> 
> Add the device id to the clock lookup table for the nand clock and
> create a separate lookup table for aemif subnodes.
> 
> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>

Applied to v4.11/soc

Thanks,
Sekhar

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

* Re: [PATCH RESEND 2/2] ARM: da850: add the nand dev_id to the clock lookup table
  2017-01-20 13:46   ` Sekhar Nori
@ 2017-01-23 15:17     ` Sekhar Nori
  2017-01-23 15:32       ` Bartosz Golaszewski
  0 siblings, 1 reply; 8+ messages in thread
From: Sekhar Nori @ 2017-01-23 15:17 UTC (permalink / raw)
  To: Bartosz Golaszewski, Kevin Hilman, Russell King,
	Santosh Shilimkar, Greg Kroah-Hartman
  Cc: LKML, arm-soc

On Friday 20 January 2017 07:16 PM, Sekhar Nori wrote:
> On Friday 13 January 2017 03:30 PM, Bartosz Golaszewski wrote:
>> The aemif driver can now access struct of_dev_auxdata (using platform
>> data).
>>
>> Add the device id to the clock lookup table for the nand clock and
>> create a separate lookup table for aemif subnodes.
>>
>> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> 
> Applied to v4.11/soc

I forgot that this has a build dependency with 1/2. Instead of creating
a dependency with Greg's tree, I think I will send it for v4.12. This is
a clean-up and does not add a new feature from a user's perspective so I
hope thats okay.

Thanks,
Sekhar

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

* Re: [PATCH RESEND 2/2] ARM: da850: add the nand dev_id to the clock lookup table
  2017-01-23 15:17     ` Sekhar Nori
@ 2017-01-23 15:32       ` Bartosz Golaszewski
  2017-01-23 15:59         ` Sekhar Nori
  0 siblings, 1 reply; 8+ messages in thread
From: Bartosz Golaszewski @ 2017-01-23 15:32 UTC (permalink / raw)
  To: Sekhar Nori
  Cc: Kevin Hilman, Russell King, Santosh Shilimkar,
	Greg Kroah-Hartman, LKML, arm-soc

2017-01-23 16:17 GMT+01:00 Sekhar Nori <nsekhar@ti.com>:
> On Friday 20 January 2017 07:16 PM, Sekhar Nori wrote:
>> On Friday 13 January 2017 03:30 PM, Bartosz Golaszewski wrote:
>>> The aemif driver can now access struct of_dev_auxdata (using platform
>>> data).
>>>
>>> Add the device id to the clock lookup table for the nand clock and
>>> create a separate lookup table for aemif subnodes.
>>>
>>> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
>>
>> Applied to v4.11/soc
>
> I forgot that this has a build dependency with 1/2. Instead of creating
> a dependency with Greg's tree, I think I will send it for v4.12. This is
> a clean-up and does not add a new feature from a user's perspective so I
> hope thats okay.
>
> Thanks,
> Sekhar

Hi Sekhar,

Greg picked up both patches - 1/2 is already in char-misc-next[1].

Thanks,
Bartosz

[1] https://git.kernel.org/cgit/linux/kernel/git/gregkh/char-misc.git/commit/?h=char-misc-next&id=d8e22fb4ccace71731193d3cf85d08e238b6e4f9

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

* Re: [PATCH RESEND 2/2] ARM: da850: add the nand dev_id to the clock lookup table
  2017-01-23 15:32       ` Bartosz Golaszewski
@ 2017-01-23 15:59         ` Sekhar Nori
  0 siblings, 0 replies; 8+ messages in thread
From: Sekhar Nori @ 2017-01-23 15:59 UTC (permalink / raw)
  To: Bartosz Golaszewski
  Cc: Kevin Hilman, Russell King, Santosh Shilimkar,
	Greg Kroah-Hartman, LKML, arm-soc

On Monday 23 January 2017 09:02 PM, Bartosz Golaszewski wrote:
> 2017-01-23 16:17 GMT+01:00 Sekhar Nori <nsekhar@ti.com>:
>> On Friday 20 January 2017 07:16 PM, Sekhar Nori wrote:
>>> On Friday 13 January 2017 03:30 PM, Bartosz Golaszewski wrote:
>>>> The aemif driver can now access struct of_dev_auxdata (using platform
>>>> data).
>>>>
>>>> Add the device id to the clock lookup table for the nand clock and
>>>> create a separate lookup table for aemif subnodes.
>>>>
>>>> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
>>>
>>> Applied to v4.11/soc
>>
>> I forgot that this has a build dependency with 1/2. Instead of creating
>> a dependency with Greg's tree, I think I will send it for v4.12. This is
>> a clean-up and does not add a new feature from a user's perspective so I
>> hope thats okay.
>>
>> Thanks,
>> Sekhar
> 
> Hi Sekhar,
> 
> Greg picked up both patches - 1/2 is already in char-misc-next[1].

Alright. I did not notice any merge conflicts between this and what I
plan to queue so I guess we are okay.

Thanks
Sekhar

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

end of thread, other threads:[~2017-01-23 15:59 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-13 10:00 [PATCH RESEND 0/2] ARM: davinci: improve the nand clock lookup Bartosz Golaszewski
2017-01-13 10:00 ` [PATCH RESEND 1/2] memory: aemif: allow passing device lookup table as platform data Bartosz Golaszewski
2017-01-13 16:36   ` Santosh Shilimkar
2017-01-13 10:00 ` [PATCH RESEND 2/2] ARM: da850: add the nand dev_id to the clock lookup table Bartosz Golaszewski
2017-01-20 13:46   ` Sekhar Nori
2017-01-23 15:17     ` Sekhar Nori
2017-01-23 15:32       ` Bartosz Golaszewski
2017-01-23 15:59         ` Sekhar Nori

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).