* [PATCH 1/4] ARM: OMAP2+: Always build in board-generic
2013-09-20 17:38 [PATCH 0/4] Clean up legacy platform data handling for omaps for v3.13 Tony Lindgren
@ 2013-09-20 17:38 ` Tony Lindgren
2013-09-20 17:38 ` [PATCH 2/4] ARM: OMAP2+: Add quirk support for legacy platform data init Tony Lindgren
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ messages in thread
From: Tony Lindgren @ 2013-09-20 17:38 UTC (permalink / raw)
To: linux-arm-kernel
We are moving to device tree based booting, so board-generic
should always be built.
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
arch/arm/mach-omap2/Kconfig | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index b5fb5f7..f6a1db1 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -94,6 +94,7 @@ config ARCH_OMAP2PLUS
select GENERIC_CLOCKEVENTS
select GENERIC_IRQ_CHIP
select HAVE_CLK
+ select MACH_OMAP_GENERIC
select OMAP_DM_TIMER
select PINCTRL
select PROC_DEVICETREE if PROC_FS
@@ -187,16 +188,11 @@ config OMAP_PACKAGE_CUS
config OMAP_PACKAGE_CBP
bool
-comment "OMAP Board Type"
+comment "OMAP Legacy Platform Data Board Type"
depends on ARCH_OMAP2PLUS
config MACH_OMAP_GENERIC
- bool "Generic OMAP2+ board"
- depends on ARCH_OMAP2PLUS
- default y
- help
- Support for generic TI OMAP2+ boards using Flattened Device Tree.
- More information at Documentation/devicetree
+ bool
config MACH_OMAP2_TUSB6010
bool
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/4] ARM: OMAP2+: Add quirk support for legacy platform data init
2013-09-20 17:38 [PATCH 0/4] Clean up legacy platform data handling for omaps for v3.13 Tony Lindgren
2013-09-20 17:38 ` [PATCH 1/4] ARM: OMAP2+: Always build in board-generic Tony Lindgren
@ 2013-09-20 17:38 ` Tony Lindgren
2013-09-20 17:38 ` [PATCH 3/4] ARM: OMAP2+: Use pdata quirk support for board-generic.c Tony Lindgren
2013-09-20 17:38 ` [PATCH 4/4] ARM: OMAP2+: Use pdata quirks for wl12xx legacy init Tony Lindgren
3 siblings, 0 replies; 6+ messages in thread
From: Tony Lindgren @ 2013-09-20 17:38 UTC (permalink / raw)
To: linux-arm-kernel
We want to drop the board-*.c files but keep things working.
Let's make it a bit easier to support legacy platform data
init with quirks. This also keeps board-generic.c clean from
board specific hacks.
For now, the quirks table is empty, that is populated
in the later patches.
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
arch/arm/mach-omap2/Makefile | 2 +-
arch/arm/mach-omap2/board-generic.c | 1 +
arch/arm/mach-omap2/common.h | 2 ++
arch/arm/mach-omap2/pdata-quirks.c | 39 +++++++++++++++++++++++++++++++++++
4 files changed, 43 insertions(+), 1 deletion(-)
create mode 100644 arch/arm/mach-omap2/pdata-quirks.c
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index afb457c..f8d4a1b 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -233,7 +233,7 @@ obj-y += drm.o
endif
# Specific board support
-obj-$(CONFIG_MACH_OMAP_GENERIC) += board-generic.o
+obj-$(CONFIG_MACH_OMAP_GENERIC) += board-generic.o pdata-quirks.o
obj-$(CONFIG_MACH_OMAP_H4) += board-h4.o
obj-$(CONFIG_MACH_OMAP_2430SDP) += board-2430sdp.o
obj-$(CONFIG_MACH_OMAP3_BEAGLE) += board-omap3beagle.o
diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c
index 39c7838..022b0df 100644
--- a/arch/arm/mach-omap2/board-generic.c
+++ b/arch/arm/mach-omap2/board-generic.c
@@ -56,6 +56,7 @@ static void __init omap_generic_init(void)
omap_sdrc_init(NULL, NULL);
of_platform_populate(NULL, omap_dt_match_table, NULL, NULL);
+ pdata_quirks_init();
/*
* HACK: call display setup code for selected boards to enable omapdss.
diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h
index 4a5684b..fd059e0 100644
--- a/arch/arm/mach-omap2/common.h
+++ b/arch/arm/mach-omap2/common.h
@@ -288,6 +288,8 @@ static inline void omap4_cpu_resume(void)
#endif
+void pdata_quirks_init(void);
+
struct omap_sdrc_params;
extern void omap_sdrc_init(struct omap_sdrc_params *sdrc_cs0,
struct omap_sdrc_params *sdrc_cs1);
diff --git a/arch/arm/mach-omap2/pdata-quirks.c b/arch/arm/mach-omap2/pdata-quirks.c
new file mode 100644
index 0000000..e605199
--- /dev/null
+++ b/arch/arm/mach-omap2/pdata-quirks.c
@@ -0,0 +1,39 @@
+/*
+ * Legacy platform_data quirks
+ *
+ * Copyright (C) 2013 Texas Instruments
+ *
+ * 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.
+ */
+#include <linux/clk.h>
+#include <linux/init.h>
+#include <linux/kernel.h>
+
+#include "common.h"
+#include "common-board-devices.h"
+#include "dss-common.h"
+
+struct pdata_init {
+ const char *compatible;
+ void (*fn)(void);
+};
+
+static struct pdata_init pdata_quirks[] __initdata = {
+ { /* sentinel */ },
+};
+
+void __init pdata_quirks_init(void)
+{
+ struct pdata_init *quirks = pdata_quirks;
+
+ while (quirks->compatible) {
+ if (of_machine_is_compatible(quirks->compatible)) {
+ if (quirks->fn)
+ quirks->fn();
+ break;
+ }
+ quirks++;
+ }
+}
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 3/4] ARM: OMAP2+: Use pdata quirk support for board-generic.c
2013-09-20 17:38 [PATCH 0/4] Clean up legacy platform data handling for omaps for v3.13 Tony Lindgren
2013-09-20 17:38 ` [PATCH 1/4] ARM: OMAP2+: Always build in board-generic Tony Lindgren
2013-09-20 17:38 ` [PATCH 2/4] ARM: OMAP2+: Add quirk support for legacy platform data init Tony Lindgren
@ 2013-09-20 17:38 ` Tony Lindgren
2013-09-20 17:38 ` [PATCH 4/4] ARM: OMAP2+: Use pdata quirks for wl12xx legacy init Tony Lindgren
3 siblings, 0 replies; 6+ messages in thread
From: Tony Lindgren @ 2013-09-20 17:38 UTC (permalink / raw)
To: linux-arm-kernel
Let's use platform data quirk support for board-generic.c.
This removes all board specific hacks out of board-generic.c.
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
arch/arm/mach-omap2/board-generic.c | 32 ---------------------------
arch/arm/mach-omap2/pdata-quirks.c | 41 +++++++++++++++++++++++++++++++++++
2 files changed, 41 insertions(+), 32 deletions(-)
diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c
index 022b0df..a66575f 100644
--- a/arch/arm/mach-omap2/board-generic.c
+++ b/arch/arm/mach-omap2/board-generic.c
@@ -15,13 +15,10 @@
#include <linux/of_irq.h>
#include <linux/of_platform.h>
#include <linux/irqdomain.h>
-#include <linux/clk.h>
#include <asm/mach/arch.h>
#include "common.h"
-#include "common-board-devices.h"
-#include "dss-common.h"
#if !(defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3))
#define intc_of_init NULL
@@ -36,41 +33,12 @@ static struct of_device_id omap_dt_match_table[] __initdata = {
{ }
};
-/*
- * Create alias for USB host PHY clock.
- * Remove this when clock phandle can be provided via DT
- */
-static void __init legacy_init_ehci_clk(char *clkname)
-{
- int ret;
-
- ret = clk_add_alias("main_clk", NULL, clkname, NULL);
- if (ret) {
- pr_err("%s:Failed to add main_clk alias to %s :%d\n",
- __func__, clkname, ret);
- }
-}
-
static void __init omap_generic_init(void)
{
omap_sdrc_init(NULL, NULL);
of_platform_populate(NULL, omap_dt_match_table, NULL, NULL);
pdata_quirks_init();
-
- /*
- * HACK: call display setup code for selected boards to enable omapdss.
- * This will be removed when omapdss supports DT.
- */
- if (of_machine_is_compatible("ti,omap4-panda")) {
- omap4_panda_display_init_of();
- legacy_init_ehci_clk("auxclk3_ck");
-
- }
- else if (of_machine_is_compatible("ti,omap4-sdp"))
- omap_4430sdp_display_init_of();
- else if (of_machine_is_compatible("ti,omap5-uevm"))
- legacy_init_ehci_clk("auxclk1_ck");
}
#ifdef CONFIG_SOC_OMAP2420
diff --git a/arch/arm/mach-omap2/pdata-quirks.c b/arch/arm/mach-omap2/pdata-quirks.c
index e605199..648d957 100644
--- a/arch/arm/mach-omap2/pdata-quirks.c
+++ b/arch/arm/mach-omap2/pdata-quirks.c
@@ -20,7 +20,48 @@ struct pdata_init {
void (*fn)(void);
};
+/*
+ * Create alias for USB host PHY clock.
+ * Remove this when clock phandle can be provided via DT
+ */
+static void __init __used legacy_init_ehci_clk(char *clkname)
+{
+ int ret;
+
+ ret = clk_add_alias("main_clk", NULL, clkname, NULL);
+ if (ret)
+ pr_err("%s:Failed to add main_clk alias to %s :%d\n",
+ __func__, clkname, ret);
+}
+
+#ifdef CONFIG_ARCH_OMAP4
+static void __init omap4_sdp_legacy_init(void)
+{
+ omap_4430sdp_display_init_of();
+}
+
+static void __init omap4_panda_legacy_init(void)
+{
+ omap4_panda_display_init_of();
+ legacy_init_ehci_clk("auxclk3_ck");
+}
+#endif
+
+#ifdef CONFIG_SOC_OMAP5
+static void __init omap5_uevm_legacy_init(void)
+{
+ legacy_init_ehci_clk("auxclk1_ck");
+}
+#endif
+
static struct pdata_init pdata_quirks[] __initdata = {
+#ifdef CONFIG_ARCH_OMAP4
+ { "ti,omap4-sdp", omap4_sdp_legacy_init, },
+ { "ti,omap4-panda", omap4_panda_legacy_init, },
+#endif
+#ifdef CONFIG_SOC_OMAP5
+ { "ti,omap5-uevm", omap5_uevm_legacy_init, },
+#endif
{ /* sentinel */ },
};
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 4/4] ARM: OMAP2+: Use pdata quirks for wl12xx legacy init
2013-09-20 17:38 [PATCH 0/4] Clean up legacy platform data handling for omaps for v3.13 Tony Lindgren
` (2 preceding siblings ...)
2013-09-20 17:38 ` [PATCH 3/4] ARM: OMAP2+: Use pdata quirk support for board-generic.c Tony Lindgren
@ 2013-09-20 17:38 ` Tony Lindgren
2013-09-25 23:26 ` Tony Lindgren
3 siblings, 1 reply; 6+ messages in thread
From: Tony Lindgren @ 2013-09-20 17:38 UTC (permalink / raw)
To: linux-arm-kernel
Let's use the platform data quirk support for wl12xx
and move the board specific code out of devices.c.
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
arch/arm/mach-omap2/devices.c | 38 ------------------------------------
arch/arm/mach-omap2/pdata-quirks.c | 31 +++++++++++++++++++++++++++++
2 files changed, 31 insertions(+), 38 deletions(-)
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index 5c5315b..5336c75 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -19,7 +19,6 @@
#include <linux/of.h>
#include <linux/pinctrl/machine.h>
#include <linux/platform_data/omap4-keypad.h>
-#include <linux/wl12xx.h>
#include <linux/platform_data/mailbox-omap.h>
#include <asm/mach-types.h>
@@ -475,40 +474,6 @@ static void omap_init_vout(void)
static inline void omap_init_vout(void) {}
#endif
-#if IS_ENABLED(CONFIG_WL12XX)
-
-static struct wl12xx_platform_data wl12xx __initdata;
-
-void __init omap_init_wl12xx_of(void)
-{
- int ret;
-
- if (!of_have_populated_dt())
- return;
-
- if (of_machine_is_compatible("ti,omap4-sdp")) {
- wl12xx.board_ref_clock = WL12XX_REFCLOCK_26;
- wl12xx.board_tcxo_clock = WL12XX_TCXOCLOCK_26;
- wl12xx.irq = gpio_to_irq(53);
- } else if (of_machine_is_compatible("ti,omap4-panda")) {
- wl12xx.board_ref_clock = WL12XX_REFCLOCK_38;
- wl12xx.irq = gpio_to_irq(53);
- } else {
- return;
- }
-
- ret = wl12xx_set_platform_data(&wl12xx);
- if (ret) {
- pr_err("error setting wl12xx data: %d\n", ret);
- return;
- }
-}
-#else
-static inline void omap_init_wl12xx_of(void)
-{
-}
-#endif
-
/*-------------------------------------------------------------------------*/
static int __init omap2_init_devices(void)
@@ -531,9 +496,6 @@ static int __init omap2_init_devices(void)
omap_init_sham();
omap_init_aes();
omap_init_rng();
- } else {
- /* These can be removed when bindings are done */
- omap_init_wl12xx_of();
}
omap_init_sti();
omap_init_vout();
diff --git a/arch/arm/mach-omap2/pdata-quirks.c b/arch/arm/mach-omap2/pdata-quirks.c
index 648d957..52b4bc3 100644
--- a/arch/arm/mach-omap2/pdata-quirks.c
+++ b/arch/arm/mach-omap2/pdata-quirks.c
@@ -8,8 +8,10 @@
* published by the Free Software Foundation.
*/
#include <linux/clk.h>
+#include <linux/gpio.h>
#include <linux/init.h>
#include <linux/kernel.h>
+#include <linux/wl12xx.h>
#include "common.h"
#include "common-board-devices.h"
@@ -34,16 +36,45 @@ static void __init __used legacy_init_ehci_clk(char *clkname)
__func__, clkname, ret);
}
+#if IS_ENABLED(CONFIG_WL12XX)
+
+static struct wl12xx_platform_data wl12xx __initdata;
+
+static void __init __used legacy_init_wl12xx(unsigned ref_clock,
+ unsigned tcxo_clock,
+ int gpio)
+{
+ int res;
+
+ wl12xx.board_ref_clock = ref_clock;
+ wl12xx.board_tcxo_clock = tcxo_clock;
+ wl12xx.irq = gpio_to_irq(gpio);
+
+ res = wl12xx_set_platform_data(&wl12xx);
+ if (res) {
+ pr_err("error setting wl12xx data: %d\n", res);
+ return;
+ }
+}
+#else
+static inline void omap_init_wl12xx_of(void)
+{
+}
+#endif
+
#ifdef CONFIG_ARCH_OMAP4
static void __init omap4_sdp_legacy_init(void)
{
omap_4430sdp_display_init_of();
+ legacy_init_wl12xx(WL12XX_REFCLOCK_26,
+ WL12XX_TCXOCLOCK_26, 53);
}
static void __init omap4_panda_legacy_init(void)
{
omap4_panda_display_init_of();
legacy_init_ehci_clk("auxclk3_ck");
+ legacy_init_wl12xx(WL12XX_REFCLOCK_38, 0, 53);
}
#endif
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 4/4] ARM: OMAP2+: Use pdata quirks for wl12xx legacy init
2013-09-20 17:38 ` [PATCH 4/4] ARM: OMAP2+: Use pdata quirks for wl12xx legacy init Tony Lindgren
@ 2013-09-25 23:26 ` Tony Lindgren
0 siblings, 0 replies; 6+ messages in thread
From: Tony Lindgren @ 2013-09-25 23:26 UTC (permalink / raw)
To: linux-arm-kernel
* Tony Lindgren <tony@atomide.com> [130920 10:46]:
> --- a/arch/arm/mach-omap2/pdata-quirks.c
> +++ b/arch/arm/mach-omap2/pdata-quirks.c
> +#if IS_ENABLED(CONFIG_WL12XX)
> +
> +static struct wl12xx_platform_data wl12xx __initdata;
> +
> +static void __init __used legacy_init_wl12xx(unsigned ref_clock,
> + unsigned tcxo_clock,
> + int gpio)
> +{
> + int res;
> +
> + wl12xx.board_ref_clock = ref_clock;
> + wl12xx.board_tcxo_clock = tcxo_clock;
> + wl12xx.irq = gpio_to_irq(gpio);
> +
> + res = wl12xx_set_platform_data(&wl12xx);
> + if (res) {
> + pr_err("error setting wl12xx data: %d\n", res);
> + return;
> + }
> +}
> +#else
> +static inline void omap_init_wl12xx_of(void)
> +{
> +}
> +#endif
> +
This should be legacy_init_wl12xx(unsigned ref_clock,
unsigned tcxo_clock, int gpio) instead of just
omap_init_wl12xx_of(void).
I've updated the patch and pushed this series to
omap-for-v3.13/quirk.
Regards,
Tony
^ permalink raw reply [flat|nested] 6+ messages in thread