linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Pass n900 MMC slot names in pdata for legacy user space
@ 2016-04-26 23:46 Tony Lindgren
  2016-04-26 23:46 ` [PATCH 1/2] ARM: OMAP2+: n900 needs MMC slot names " Tony Lindgren
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Tony Lindgren @ 2016-04-26 23:46 UTC (permalink / raw)
  To: linux-arm-kernel

Hi all,

N900 needs the MMC slot names to work. Let's pass them in pdata
for now to remove the last remaining blocker for removing omap3
legacy booting support for v4.8.

Then when we have a generic DT binding for the slot names, we
can use that assuming it will work for the n900 legacy user space.

Regards,

Tony


Tony Lindgren (2):
  ARM: OMAP2+: n900 needs MMC slot names for legacy user space
  mmc: omap_hsmmc: Check if MMC slot name is passed in pdata

 arch/arm/mach-omap2/pdata-quirks.c | 7 +++++++
 drivers/mmc/host/omap_hsmmc.c      | 6 +++++-
 2 files changed, 12 insertions(+), 1 deletion(-)

-- 
2.8.1

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

* [PATCH 1/2] ARM: OMAP2+: n900 needs MMC slot names for legacy user space
  2016-04-26 23:46 [PATCH 0/2] Pass n900 MMC slot names in pdata for legacy user space Tony Lindgren
@ 2016-04-26 23:46 ` Tony Lindgren
  2016-04-27  8:48   ` Ulf Hansson
  2016-05-02  7:05   ` Pavel Machek
  2016-04-26 23:46 ` [PATCH 2/2] mmc: omap_hsmmc: Check if MMC slot name is passed in pdata Tony Lindgren
  2016-04-28 20:33 ` [PATCH 0/2] Pass n900 MMC slot names in pdata for legacy user space Ivaylo Dimitrov
  2 siblings, 2 replies; 9+ messages in thread
From: Tony Lindgren @ 2016-04-26 23:46 UTC (permalink / raw)
  To: linux-arm-kernel

Let's pass the slot names in pdata like the legacy code does.
Once we have a generic DT binding for the slot names we can
switch to that.

Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 arch/arm/mach-omap2/pdata-quirks.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/arch/arm/mach-omap2/pdata-quirks.c b/arch/arm/mach-omap2/pdata-quirks.c
index a935d28..cfaf45f 100644
--- a/arch/arm/mach-omap2/pdata-quirks.c
+++ b/arch/arm/mach-omap2/pdata-quirks.c
@@ -21,6 +21,7 @@
 #include <linux/regulator/fixed.h>
 
 #include <linux/platform_data/pinctrl-single.h>
+#include <linux/platform_data/hsmmc-omap.h>
 #include <linux/platform_data/iommu-omap.h>
 #include <linux/platform_data/wkup_m3.h>
 #include <linux/platform_data/pwm_omap_dmtimer.h>
@@ -35,6 +36,8 @@
 #include "soc.h"
 #include "hsmmc.h"
 
+static struct __maybe_unused omap_hsmmc_platform_data mmc_pdata[2];
+
 struct pdata_init {
 	const char *compatible;
 	void (*fn)(void);
@@ -271,6 +274,8 @@ static struct platform_device omap3_rom_rng_device = {
 static void __init nokia_n900_legacy_init(void)
 {
 	hsmmc2_internal_input_clk();
+	mmc_pdata[0].name = "external";
+	mmc_pdata[1].name = "internal";
 
 	if (omap_type() == OMAP2_DEVICE_TYPE_SEC) {
 		if (IS_ENABLED(CONFIG_ARM_ERRATA_430973)) {
@@ -497,6 +502,8 @@ static struct of_dev_auxdata omap_auxdata_lookup[] __initdata = {
 	OF_DEV_AUXDATA("ti,omap3-padconf", 0x48002a00, "48002a00.pinmux", &pcs_pdata),
 	OF_DEV_AUXDATA("ti,omap2-iommu", 0x5d000000, "5d000000.mmu",
 		       &omap3_iommu_pdata),
+	OF_DEV_AUXDATA("ti,omap3-hsmmc", 0x4809c000, "4809c000.mmc", &mmc_pdata[0]),
+	OF_DEV_AUXDATA("ti,omap3-hsmmc", 0x480b4000, "480b4000.mmc", &mmc_pdata[1]),
 	/* Only on am3517 */
 	OF_DEV_AUXDATA("ti,davinci_mdio", 0x5c030000, "davinci_mdio.0", NULL),
 	OF_DEV_AUXDATA("ti,am3517-emac", 0x5c000000, "davinci_emac.0",
-- 
2.8.1

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

* [PATCH 2/2] mmc: omap_hsmmc: Check if MMC slot name is passed in pdata
  2016-04-26 23:46 [PATCH 0/2] Pass n900 MMC slot names in pdata for legacy user space Tony Lindgren
  2016-04-26 23:46 ` [PATCH 1/2] ARM: OMAP2+: n900 needs MMC slot names " Tony Lindgren
@ 2016-04-26 23:46 ` Tony Lindgren
  2016-04-27  8:52   ` Ulf Hansson
  2016-04-28 20:33 ` [PATCH 0/2] Pass n900 MMC slot names in pdata for legacy user space Ivaylo Dimitrov
  2 siblings, 1 reply; 9+ messages in thread
From: Tony Lindgren @ 2016-04-26 23:46 UTC (permalink / raw)
  To: linux-arm-kernel

The legacy user space for n900 relies on the MMC slot names.
Let's check if those are passed in pdata and use them.

Then when we have a generic MMC slot name binding we can
switch to use that assuming it works for the n900 legacy
user space too.

As this makes the DT booting compatible with legacy booting,
we should be able to start dropping omap3 legacy booting
support in v4.8.

Cc: Ulf Hansson <ulf.hansson@linaro.org>
Cc: Kishon Vijay Abraham I <kishon@ti.com>
Cc: linux-mmc at vger.kernel.org
Signed-off-by: Tony Lindgren <tony@atomide.com>
---

Ulf, this is safe to pick separately to the MMC tree if it looks
acceptable to you.


 drivers/mmc/host/omap_hsmmc.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index e9d75c6..3563321 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -1946,13 +1946,17 @@ MODULE_DEVICE_TABLE(of, omap_mmc_of_match);
 
 static struct omap_hsmmc_platform_data *of_get_hsmmc_pdata(struct device *dev)
 {
-	struct omap_hsmmc_platform_data *pdata;
+	struct omap_hsmmc_platform_data *pdata, *legacy;
 	struct device_node *np = dev->of_node;
 
 	pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
 	if (!pdata)
 		return ERR_PTR(-ENOMEM); /* out of memory */
 
+	legacy = dev_get_platdata(dev);
+	if (legacy && legacy->name)
+		pdata->name = legacy->name;
+
 	if (of_find_property(np, "ti,dual-volt", NULL))
 		pdata->controller_flags |= OMAP_HSMMC_SUPPORTS_DUAL_VOLT;
 
-- 
2.8.1

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

* [PATCH 1/2] ARM: OMAP2+: n900 needs MMC slot names for legacy user space
  2016-04-26 23:46 ` [PATCH 1/2] ARM: OMAP2+: n900 needs MMC slot names " Tony Lindgren
@ 2016-04-27  8:48   ` Ulf Hansson
  2016-04-27 14:17     ` Tony Lindgren
  2016-05-02  7:05   ` Pavel Machek
  1 sibling, 1 reply; 9+ messages in thread
From: Ulf Hansson @ 2016-04-27  8:48 UTC (permalink / raw)
  To: linux-arm-kernel

On 27 April 2016 at 01:46, Tony Lindgren <tony@atomide.com> wrote:
> Let's pass the slot names in pdata like the legacy code does.
> Once we have a generic DT binding for the slot names we can
> switch to that.

I am not sure we ever will get a DT binding accepted for the slot
name. It seem far from being a HW description. :-)

Instead, the long term and proper solution, is to enable userspace to
be able to use UUID/PARTID instead.

Until that happens, I guess this will have to do.

Kind regards
Uffe

>
> Signed-off-by: Tony Lindgren <tony@atomide.com>
> ---
>  arch/arm/mach-omap2/pdata-quirks.c | 7 +++++++
>  1 file changed, 7 insertions(+)
>
> diff --git a/arch/arm/mach-omap2/pdata-quirks.c b/arch/arm/mach-omap2/pdata-quirks.c
> index a935d28..cfaf45f 100644
> --- a/arch/arm/mach-omap2/pdata-quirks.c
> +++ b/arch/arm/mach-omap2/pdata-quirks.c
> @@ -21,6 +21,7 @@
>  #include <linux/regulator/fixed.h>
>
>  #include <linux/platform_data/pinctrl-single.h>
> +#include <linux/platform_data/hsmmc-omap.h>
>  #include <linux/platform_data/iommu-omap.h>
>  #include <linux/platform_data/wkup_m3.h>
>  #include <linux/platform_data/pwm_omap_dmtimer.h>
> @@ -35,6 +36,8 @@
>  #include "soc.h"
>  #include "hsmmc.h"
>
> +static struct __maybe_unused omap_hsmmc_platform_data mmc_pdata[2];
> +
>  struct pdata_init {
>         const char *compatible;
>         void (*fn)(void);
> @@ -271,6 +274,8 @@ static struct platform_device omap3_rom_rng_device = {
>  static void __init nokia_n900_legacy_init(void)
>  {
>         hsmmc2_internal_input_clk();
> +       mmc_pdata[0].name = "external";
> +       mmc_pdata[1].name = "internal";
>
>         if (omap_type() == OMAP2_DEVICE_TYPE_SEC) {
>                 if (IS_ENABLED(CONFIG_ARM_ERRATA_430973)) {
> @@ -497,6 +502,8 @@ static struct of_dev_auxdata omap_auxdata_lookup[] __initdata = {
>         OF_DEV_AUXDATA("ti,omap3-padconf", 0x48002a00, "48002a00.pinmux", &pcs_pdata),
>         OF_DEV_AUXDATA("ti,omap2-iommu", 0x5d000000, "5d000000.mmu",
>                        &omap3_iommu_pdata),
> +       OF_DEV_AUXDATA("ti,omap3-hsmmc", 0x4809c000, "4809c000.mmc", &mmc_pdata[0]),
> +       OF_DEV_AUXDATA("ti,omap3-hsmmc", 0x480b4000, "480b4000.mmc", &mmc_pdata[1]),
>         /* Only on am3517 */
>         OF_DEV_AUXDATA("ti,davinci_mdio", 0x5c030000, "davinci_mdio.0", NULL),
>         OF_DEV_AUXDATA("ti,am3517-emac", 0x5c000000, "davinci_emac.0",
> --
> 2.8.1
>

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

* [PATCH 2/2] mmc: omap_hsmmc: Check if MMC slot name is passed in pdata
  2016-04-26 23:46 ` [PATCH 2/2] mmc: omap_hsmmc: Check if MMC slot name is passed in pdata Tony Lindgren
@ 2016-04-27  8:52   ` Ulf Hansson
  2016-04-27 14:17     ` Tony Lindgren
  0 siblings, 1 reply; 9+ messages in thread
From: Ulf Hansson @ 2016-04-27  8:52 UTC (permalink / raw)
  To: linux-arm-kernel

On 27 April 2016 at 01:46, Tony Lindgren <tony@atomide.com> wrote:
> The legacy user space for n900 relies on the MMC slot names.
> Let's check if those are passed in pdata and use them.
>
> Then when we have a generic MMC slot name binding we can
> switch to use that assuming it works for the n900 legacy
> user space too.

I dropped this section, because I don't think it will happen.

>
> As this makes the DT booting compatible with legacy booting,
> we should be able to start dropping omap3 legacy booting
> support in v4.8.
>
> Cc: Ulf Hansson <ulf.hansson@linaro.org>
> Cc: Kishon Vijay Abraham I <kishon@ti.com>
> Cc: linux-mmc at vger.kernel.org
> Signed-off-by: Tony Lindgren <tony@atomide.com>

Thanks, applied for next!

Kind regards
Uffe

> ---
>
> Ulf, this is safe to pick separately to the MMC tree if it looks
> acceptable to you.
>
>
>  drivers/mmc/host/omap_hsmmc.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
> index e9d75c6..3563321 100644
> --- a/drivers/mmc/host/omap_hsmmc.c
> +++ b/drivers/mmc/host/omap_hsmmc.c
> @@ -1946,13 +1946,17 @@ MODULE_DEVICE_TABLE(of, omap_mmc_of_match);
>
>  static struct omap_hsmmc_platform_data *of_get_hsmmc_pdata(struct device *dev)
>  {
> -       struct omap_hsmmc_platform_data *pdata;
> +       struct omap_hsmmc_platform_data *pdata, *legacy;
>         struct device_node *np = dev->of_node;
>
>         pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
>         if (!pdata)
>                 return ERR_PTR(-ENOMEM); /* out of memory */
>
> +       legacy = dev_get_platdata(dev);
> +       if (legacy && legacy->name)
> +               pdata->name = legacy->name;
> +
>         if (of_find_property(np, "ti,dual-volt", NULL))
>                 pdata->controller_flags |= OMAP_HSMMC_SUPPORTS_DUAL_VOLT;
>
> --
> 2.8.1
>

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

* [PATCH 1/2] ARM: OMAP2+: n900 needs MMC slot names for legacy user space
  2016-04-27  8:48   ` Ulf Hansson
@ 2016-04-27 14:17     ` Tony Lindgren
  0 siblings, 0 replies; 9+ messages in thread
From: Tony Lindgren @ 2016-04-27 14:17 UTC (permalink / raw)
  To: linux-arm-kernel

* Ulf Hansson <ulf.hansson@linaro.org> [160427 01:50]:
> On 27 April 2016 at 01:46, Tony Lindgren <tony@atomide.com> wrote:
> > Let's pass the slot names in pdata like the legacy code does.
> > Once we have a generic DT binding for the slot names we can
> > switch to that.
> 
> I am not sure we ever will get a DT binding accepted for the slot
> name. It seem far from being a HW description. :-)

Hmm it does describe where on the the device the MMC is
located though as in "external" or "internal".

> Instead, the long term and proper solution, is to enable userspace to
> be able to use UUID/PARTID instead.

OK.

> Until that happens, I guess this will have to do.

Yeah especially as that has been working with the legacy booting
for years.

Regards,

Tony

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

* [PATCH 2/2] mmc: omap_hsmmc: Check if MMC slot name is passed in pdata
  2016-04-27  8:52   ` Ulf Hansson
@ 2016-04-27 14:17     ` Tony Lindgren
  0 siblings, 0 replies; 9+ messages in thread
From: Tony Lindgren @ 2016-04-27 14:17 UTC (permalink / raw)
  To: linux-arm-kernel

* Ulf Hansson <ulf.hansson@linaro.org> [160427 01:53]:
> On 27 April 2016 at 01:46, Tony Lindgren <tony@atomide.com> wrote:
> > The legacy user space for n900 relies on the MMC slot names.
> > Let's check if those are passed in pdata and use them.
> >
> > Then when we have a generic MMC slot name binding we can
> > switch to use that assuming it works for the n900 legacy
> > user space too.
> 
> I dropped this section, because I don't think it will happen.

Yeah fine with me.

> Thanks, applied for next!

Thanks!

Tony

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

* [PATCH 0/2] Pass n900 MMC slot names in pdata for legacy user space
  2016-04-26 23:46 [PATCH 0/2] Pass n900 MMC slot names in pdata for legacy user space Tony Lindgren
  2016-04-26 23:46 ` [PATCH 1/2] ARM: OMAP2+: n900 needs MMC slot names " Tony Lindgren
  2016-04-26 23:46 ` [PATCH 2/2] mmc: omap_hsmmc: Check if MMC slot name is passed in pdata Tony Lindgren
@ 2016-04-28 20:33 ` Ivaylo Dimitrov
  2 siblings, 0 replies; 9+ messages in thread
From: Ivaylo Dimitrov @ 2016-04-28 20:33 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

On 27.04.2016 02:46, Tony Lindgren wrote:
> Hi all,
>
> N900 needs the MMC slot names to work. Let's pass them in pdata
> for now to remove the last remaining blocker for removing omap3
> legacy booting support for v4.8.
>
> Then when we have a generic DT binding for the slot names, we
> can use that assuming it will work for the n900 legacy user space.
>
> Regards,
>
> Tony
>
>
> Tony Lindgren (2):
>    ARM: OMAP2+: n900 needs MMC slot names for legacy user space
>    mmc: omap_hsmmc: Check if MMC slot name is passed in pdata
>
>   arch/arm/mach-omap2/pdata-quirks.c | 7 +++++++
>   drivers/mmc/host/omap_hsmmc.c      | 6 +++++-
>   2 files changed, 12 insertions(+), 1 deletion(-)
>

For both patches, you may add:

Tested-by: Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>

Thanks,
Ivo

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

* [PATCH 1/2] ARM: OMAP2+: n900 needs MMC slot names for legacy user space
  2016-04-26 23:46 ` [PATCH 1/2] ARM: OMAP2+: n900 needs MMC slot names " Tony Lindgren
  2016-04-27  8:48   ` Ulf Hansson
@ 2016-05-02  7:05   ` Pavel Machek
  1 sibling, 0 replies; 9+ messages in thread
From: Pavel Machek @ 2016-05-02  7:05 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue 2016-04-26 16:46:22, Tony Lindgren wrote:
> Let's pass the slot names in pdata like the legacy code does.
> Once we have a generic DT binding for the slot names we can
> switch to that.
> 
> Signed-off-by: Tony Lindgren <tony@atomide.com>

Acked-by: Pavel Machek <pavel@ucw.cz>

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

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

end of thread, other threads:[~2016-05-02  7:05 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-26 23:46 [PATCH 0/2] Pass n900 MMC slot names in pdata for legacy user space Tony Lindgren
2016-04-26 23:46 ` [PATCH 1/2] ARM: OMAP2+: n900 needs MMC slot names " Tony Lindgren
2016-04-27  8:48   ` Ulf Hansson
2016-04-27 14:17     ` Tony Lindgren
2016-05-02  7:05   ` Pavel Machek
2016-04-26 23:46 ` [PATCH 2/2] mmc: omap_hsmmc: Check if MMC slot name is passed in pdata Tony Lindgren
2016-04-27  8:52   ` Ulf Hansson
2016-04-27 14:17     ` Tony Lindgren
2016-04-28 20:33 ` [PATCH 0/2] Pass n900 MMC slot names in pdata for legacy user space Ivaylo Dimitrov

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