aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2013-09-25 18:44:39 -0400
committerTony Lindgren <tony@atomide.com>2013-09-25 18:44:39 -0400
commit3e7a318530c3d536972e9a2bb44e0ce0c16eaa4e (patch)
tree9060eab9a327d78b1e9474e3839bab00fc0b3514
parent6a08e1e6f7fafa2fa5fb6a129c4c8d9c29f11b62 (diff)
ARM: OMAP2+: Use pdata quirk support for board-generic.c
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>
-rw-r--r--arch/arm/mach-omap2/board-generic.c32
-rw-r--r--arch/arm/mach-omap2/pdata-quirks.c41
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 022b0df94e0d..a66575f33973 100644
--- a/arch/arm/mach-omap2/board-generic.c
+++ b/arch/arm/mach-omap2/board-generic.c
@@ -15,13 +15,10 @@
15#include <linux/of_irq.h> 15#include <linux/of_irq.h>
16#include <linux/of_platform.h> 16#include <linux/of_platform.h>
17#include <linux/irqdomain.h> 17#include <linux/irqdomain.h>
18#include <linux/clk.h>
19 18
20#include <asm/mach/arch.h> 19#include <asm/mach/arch.h>
21 20
22#include "common.h" 21#include "common.h"
23#include "common-board-devices.h"
24#include "dss-common.h"
25 22
26#if !(defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)) 23#if !(defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3))
27#define intc_of_init NULL 24#define intc_of_init NULL
@@ -36,41 +33,12 @@ static struct of_device_id omap_dt_match_table[] __initdata = {
36 { } 33 { }
37}; 34};
38 35
39/*
40 * Create alias for USB host PHY clock.
41 * Remove this when clock phandle can be provided via DT
42 */
43static void __init legacy_init_ehci_clk(char *clkname)
44{
45 int ret;
46
47 ret = clk_add_alias("main_clk", NULL, clkname, NULL);
48 if (ret) {
49 pr_err("%s:Failed to add main_clk alias to %s :%d\n",
50 __func__, clkname, ret);
51 }
52}
53
54static void __init omap_generic_init(void) 36static void __init omap_generic_init(void)
55{ 37{
56 omap_sdrc_init(NULL, NULL); 38 omap_sdrc_init(NULL, NULL);
57 39
58 of_platform_populate(NULL, omap_dt_match_table, NULL, NULL); 40 of_platform_populate(NULL, omap_dt_match_table, NULL, NULL);
59 pdata_quirks_init(); 41 pdata_quirks_init();
60
61 /*
62 * HACK: call display setup code for selected boards to enable omapdss.
63 * This will be removed when omapdss supports DT.
64 */
65 if (of_machine_is_compatible("ti,omap4-panda")) {
66 omap4_panda_display_init_of();
67 legacy_init_ehci_clk("auxclk3_ck");
68
69 }
70 else if (of_machine_is_compatible("ti,omap4-sdp"))
71 omap_4430sdp_display_init_of();
72 else if (of_machine_is_compatible("ti,omap5-uevm"))
73 legacy_init_ehci_clk("auxclk1_ck");
74} 42}
75 43
76#ifdef CONFIG_SOC_OMAP2420 44#ifdef CONFIG_SOC_OMAP2420
diff --git a/arch/arm/mach-omap2/pdata-quirks.c b/arch/arm/mach-omap2/pdata-quirks.c
index e6051998f929..648d9573aaea 100644
--- a/arch/arm/mach-omap2/pdata-quirks.c
+++ b/arch/arm/mach-omap2/pdata-quirks.c
@@ -20,7 +20,48 @@ struct pdata_init {
20 void (*fn)(void); 20 void (*fn)(void);
21}; 21};
22 22
23/*
24 * Create alias for USB host PHY clock.
25 * Remove this when clock phandle can be provided via DT
26 */
27static void __init __used legacy_init_ehci_clk(char *clkname)
28{
29 int ret;
30
31 ret = clk_add_alias("main_clk", NULL, clkname, NULL);
32 if (ret)
33 pr_err("%s:Failed to add main_clk alias to %s :%d\n",
34 __func__, clkname, ret);
35}
36
37#ifdef CONFIG_ARCH_OMAP4
38static void __init omap4_sdp_legacy_init(void)
39{
40 omap_4430sdp_display_init_of();
41}
42
43static void __init omap4_panda_legacy_init(void)
44{
45 omap4_panda_display_init_of();
46 legacy_init_ehci_clk("auxclk3_ck");
47}
48#endif
49
50#ifdef CONFIG_SOC_OMAP5
51static void __init omap5_uevm_legacy_init(void)
52{
53 legacy_init_ehci_clk("auxclk1_ck");
54}
55#endif
56
23static struct pdata_init pdata_quirks[] __initdata = { 57static struct pdata_init pdata_quirks[] __initdata = {
58#ifdef CONFIG_ARCH_OMAP4
59 { "ti,omap4-sdp", omap4_sdp_legacy_init, },
60 { "ti,omap4-panda", omap4_panda_legacy_init, },
61#endif
62#ifdef CONFIG_SOC_OMAP5
63 { "ti,omap5-uevm", omap5_uevm_legacy_init, },
64#endif
24 { /* sentinel */ }, 65 { /* sentinel */ },
25}; 66};
26 67