diff options
author | Chao Xie <chao.xie@marvell.com> | 2014-10-30 22:13:53 -0400 |
---|---|---|
committer | Michael Turquette <mturquette@linaro.org> | 2014-11-12 19:34:30 -0500 |
commit | d41ef54027cc6e0697e5b77d7da393998bed7ee4 (patch) | |
tree | d28672ff212f09803a8e3171058c8df36e897457 /arch/arm/mach-mmp | |
parent | 51454eb46c02eb087b9beb1b895b765394f6e374 (diff) |
arm: mmp: Make use of the DT supported clock
Change the dtsi and dts file, soc initialization code to make
use of DT support clock.
So now in the code we do only need call of_clk_init to initialize
the clocks.
Signed-off-by: Chao Xie <chao.xie@marvell.com>
Acked-by: Haojian Zhuang <haojian.zhuang@gmail.com>
Signed-off-by: Michael Turquette <mturquette@linaro.org>
Diffstat (limited to 'arch/arm/mach-mmp')
-rw-r--r-- | arch/arm/mach-mmp/Kconfig | 12 | ||||
-rw-r--r-- | arch/arm/mach-mmp/mmp-dt.c | 57 | ||||
-rw-r--r-- | arch/arm/mach-mmp/mmp2-dt.c | 26 |
3 files changed, 33 insertions, 62 deletions
diff --git a/arch/arm/mach-mmp/Kconfig b/arch/arm/mach-mmp/Kconfig index ebdba87b9671..fdbfadf00c84 100644 --- a/arch/arm/mach-mmp/Kconfig +++ b/arch/arm/mach-mmp/Kconfig | |||
@@ -86,11 +86,12 @@ config MACH_GPLUGD | |||
86 | 86 | ||
87 | config MACH_MMP_DT | 87 | config MACH_MMP_DT |
88 | bool "Support MMP (ARMv5) platforms from device tree" | 88 | bool "Support MMP (ARMv5) platforms from device tree" |
89 | select CPU_PXA168 | ||
90 | select CPU_PXA910 | ||
91 | select USE_OF | 89 | select USE_OF |
92 | select PINCTRL | 90 | select PINCTRL |
93 | select PINCTRL_SINGLE | 91 | select PINCTRL_SINGLE |
92 | select COMMON_CLK | ||
93 | select ARCH_HAS_RESET_CONTROLLER | ||
94 | select CPU_MOHAWK | ||
94 | help | 95 | help |
95 | Include support for Marvell MMP2 based platforms using | 96 | Include support for Marvell MMP2 based platforms using |
96 | the device tree. Needn't select any other machine while | 97 | the device tree. Needn't select any other machine while |
@@ -99,10 +100,12 @@ config MACH_MMP_DT | |||
99 | config MACH_MMP2_DT | 100 | config MACH_MMP2_DT |
100 | bool "Support MMP2 (ARMv7) platforms from device tree" | 101 | bool "Support MMP2 (ARMv7) platforms from device tree" |
101 | depends on !CPU_MOHAWK | 102 | depends on !CPU_MOHAWK |
102 | select CPU_MMP2 | ||
103 | select USE_OF | 103 | select USE_OF |
104 | select PINCTRL | 104 | select PINCTRL |
105 | select PINCTRL_SINGLE | 105 | select PINCTRL_SINGLE |
106 | select COMMON_CLK | ||
107 | select ARCH_HAS_RESET_CONTROLLER | ||
108 | select CPU_PJ4 | ||
106 | help | 109 | help |
107 | Include support for Marvell MMP2 based platforms using | 110 | Include support for Marvell MMP2 based platforms using |
108 | the device tree. | 111 | the device tree. |
@@ -111,21 +114,18 @@ endmenu | |||
111 | 114 | ||
112 | config CPU_PXA168 | 115 | config CPU_PXA168 |
113 | bool | 116 | bool |
114 | select COMMON_CLK | ||
115 | select CPU_MOHAWK | 117 | select CPU_MOHAWK |
116 | help | 118 | help |
117 | Select code specific to PXA168 | 119 | Select code specific to PXA168 |
118 | 120 | ||
119 | config CPU_PXA910 | 121 | config CPU_PXA910 |
120 | bool | 122 | bool |
121 | select COMMON_CLK | ||
122 | select CPU_MOHAWK | 123 | select CPU_MOHAWK |
123 | help | 124 | help |
124 | Select code specific to PXA910 | 125 | Select code specific to PXA910 |
125 | 126 | ||
126 | config CPU_MMP2 | 127 | config CPU_MMP2 |
127 | bool | 128 | bool |
128 | select COMMON_CLK | ||
129 | select CPU_PJ4 | 129 | select CPU_PJ4 |
130 | help | 130 | help |
131 | Select code specific to MMP2. MMP2 is ARMv7 compatible. | 131 | Select code specific to MMP2. MMP2 is ARMv7 compatible. |
diff --git a/arch/arm/mach-mmp/mmp-dt.c b/arch/arm/mach-mmp/mmp-dt.c index cca529ceecb7..b2296c9309b8 100644 --- a/arch/arm/mach-mmp/mmp-dt.c +++ b/arch/arm/mach-mmp/mmp-dt.c | |||
@@ -11,63 +11,42 @@ | |||
11 | 11 | ||
12 | #include <linux/irqchip.h> | 12 | #include <linux/irqchip.h> |
13 | #include <linux/of_platform.h> | 13 | #include <linux/of_platform.h> |
14 | #include <linux/clk-provider.h> | ||
14 | #include <asm/mach/arch.h> | 15 | #include <asm/mach/arch.h> |
15 | #include <asm/mach/time.h> | 16 | #include <asm/mach/time.h> |
17 | #include <asm/hardware/cache-tauros2.h> | ||
16 | 18 | ||
17 | #include "common.h" | 19 | #include "common.h" |
18 | 20 | ||
19 | extern void __init mmp_dt_init_timer(void); | 21 | extern void __init mmp_dt_init_timer(void); |
20 | 22 | ||
21 | static const struct of_dev_auxdata pxa168_auxdata_lookup[] __initconst = { | 23 | static const char *pxa168_dt_board_compat[] __initdata = { |
22 | OF_DEV_AUXDATA("mrvl,mmp-uart", 0xd4017000, "pxa2xx-uart.0", NULL), | 24 | "mrvl,pxa168-aspenite", |
23 | OF_DEV_AUXDATA("mrvl,mmp-uart", 0xd4018000, "pxa2xx-uart.1", NULL), | 25 | NULL, |
24 | OF_DEV_AUXDATA("mrvl,mmp-uart", 0xd4026000, "pxa2xx-uart.2", NULL), | ||
25 | OF_DEV_AUXDATA("mrvl,mmp-twsi", 0xd4011000, "pxa2xx-i2c.0", NULL), | ||
26 | OF_DEV_AUXDATA("mrvl,mmp-twsi", 0xd4025000, "pxa2xx-i2c.1", NULL), | ||
27 | OF_DEV_AUXDATA("marvell,mmp-gpio", 0xd4019000, "mmp-gpio", NULL), | ||
28 | OF_DEV_AUXDATA("mrvl,mmp-rtc", 0xd4010000, "sa1100-rtc", NULL), | ||
29 | {} | ||
30 | }; | 26 | }; |
31 | 27 | ||
32 | static const struct of_dev_auxdata pxa910_auxdata_lookup[] __initconst = { | 28 | static const char *pxa910_dt_board_compat[] __initdata = { |
33 | OF_DEV_AUXDATA("mrvl,mmp-uart", 0xd4017000, "pxa2xx-uart.0", NULL), | 29 | "mrvl,pxa910-dkb", |
34 | OF_DEV_AUXDATA("mrvl,mmp-uart", 0xd4018000, "pxa2xx-uart.1", NULL), | 30 | NULL, |
35 | OF_DEV_AUXDATA("mrvl,mmp-uart", 0xd4036000, "pxa2xx-uart.2", NULL), | ||
36 | OF_DEV_AUXDATA("mrvl,mmp-twsi", 0xd4011000, "pxa2xx-i2c.0", NULL), | ||
37 | OF_DEV_AUXDATA("mrvl,mmp-twsi", 0xd4037000, "pxa2xx-i2c.1", NULL), | ||
38 | OF_DEV_AUXDATA("marvell,mmp-gpio", 0xd4019000, "mmp-gpio", NULL), | ||
39 | OF_DEV_AUXDATA("mrvl,mmp-rtc", 0xd4010000, "sa1100-rtc", NULL), | ||
40 | {} | ||
41 | }; | 31 | }; |
42 | 32 | ||
43 | static void __init pxa168_dt_init(void) | 33 | static void __init mmp_init_time(void) |
44 | { | ||
45 | of_platform_populate(NULL, of_default_bus_match_table, | ||
46 | pxa168_auxdata_lookup, NULL); | ||
47 | } | ||
48 | |||
49 | static void __init pxa910_dt_init(void) | ||
50 | { | 34 | { |
51 | of_platform_populate(NULL, of_default_bus_match_table, | 35 | #ifdef CONFIG_CACHE_TAUROS2 |
52 | pxa910_auxdata_lookup, NULL); | 36 | tauros2_init(0); |
37 | #endif | ||
38 | mmp_dt_init_timer(); | ||
39 | of_clk_init(NULL); | ||
53 | } | 40 | } |
54 | 41 | ||
55 | static const char *mmp_dt_board_compat[] __initdata = { | ||
56 | "mrvl,pxa168-aspenite", | ||
57 | "mrvl,pxa910-dkb", | ||
58 | NULL, | ||
59 | }; | ||
60 | |||
61 | DT_MACHINE_START(PXA168_DT, "Marvell PXA168 (Device Tree Support)") | 42 | DT_MACHINE_START(PXA168_DT, "Marvell PXA168 (Device Tree Support)") |
62 | .map_io = mmp_map_io, | 43 | .map_io = mmp_map_io, |
63 | .init_time = mmp_dt_init_timer, | 44 | .init_time = mmp_init_time, |
64 | .init_machine = pxa168_dt_init, | 45 | .dt_compat = pxa168_dt_board_compat, |
65 | .dt_compat = mmp_dt_board_compat, | ||
66 | MACHINE_END | 46 | MACHINE_END |
67 | 47 | ||
68 | DT_MACHINE_START(PXA910_DT, "Marvell PXA910 (Device Tree Support)") | 48 | DT_MACHINE_START(PXA910_DT, "Marvell PXA910 (Device Tree Support)") |
69 | .map_io = mmp_map_io, | 49 | .map_io = mmp_map_io, |
70 | .init_time = mmp_dt_init_timer, | 50 | .init_time = mmp_init_time, |
71 | .init_machine = pxa910_dt_init, | 51 | .dt_compat = pxa910_dt_board_compat, |
72 | .dt_compat = mmp_dt_board_compat, | ||
73 | MACHINE_END | 52 | MACHINE_END |
diff --git a/arch/arm/mach-mmp/mmp2-dt.c b/arch/arm/mach-mmp/mmp2-dt.c index 023cb453f157..998c0f533abc 100644 --- a/arch/arm/mach-mmp/mmp2-dt.c +++ b/arch/arm/mach-mmp/mmp2-dt.c | |||
@@ -12,29 +12,22 @@ | |||
12 | #include <linux/io.h> | 12 | #include <linux/io.h> |
13 | #include <linux/irqchip.h> | 13 | #include <linux/irqchip.h> |
14 | #include <linux/of_platform.h> | 14 | #include <linux/of_platform.h> |
15 | #include <linux/clk-provider.h> | ||
15 | #include <asm/mach/arch.h> | 16 | #include <asm/mach/arch.h> |
16 | #include <asm/mach/time.h> | 17 | #include <asm/mach/time.h> |
18 | #include <asm/hardware/cache-tauros2.h> | ||
17 | 19 | ||
18 | #include "common.h" | 20 | #include "common.h" |
19 | 21 | ||
20 | extern void __init mmp_dt_init_timer(void); | 22 | extern void __init mmp_dt_init_timer(void); |
21 | 23 | ||
22 | static const struct of_dev_auxdata mmp2_auxdata_lookup[] __initconst = { | 24 | static void __init mmp_init_time(void) |
23 | OF_DEV_AUXDATA("mrvl,mmp-uart", 0xd4030000, "pxa2xx-uart.0", NULL), | ||
24 | OF_DEV_AUXDATA("mrvl,mmp-uart", 0xd4017000, "pxa2xx-uart.1", NULL), | ||
25 | OF_DEV_AUXDATA("mrvl,mmp-uart", 0xd4018000, "pxa2xx-uart.2", NULL), | ||
26 | OF_DEV_AUXDATA("mrvl,mmp-uart", 0xd4016000, "pxa2xx-uart.3", NULL), | ||
27 | OF_DEV_AUXDATA("mrvl,mmp-twsi", 0xd4011000, "pxa2xx-i2c.0", NULL), | ||
28 | OF_DEV_AUXDATA("mrvl,mmp-twsi", 0xd4025000, "pxa2xx-i2c.1", NULL), | ||
29 | OF_DEV_AUXDATA("marvell,mmp-gpio", 0xd4019000, "mmp2-gpio", NULL), | ||
30 | OF_DEV_AUXDATA("mrvl,mmp-rtc", 0xd4010000, "sa1100-rtc", NULL), | ||
31 | {} | ||
32 | }; | ||
33 | |||
34 | static void __init mmp2_dt_init(void) | ||
35 | { | 25 | { |
36 | of_platform_populate(NULL, of_default_bus_match_table, | 26 | #ifdef CONFIG_CACHE_TAUROS2 |
37 | mmp2_auxdata_lookup, NULL); | 27 | tauros2_init(0); |
28 | #endif | ||
29 | mmp_dt_init_timer(); | ||
30 | of_clk_init(NULL); | ||
38 | } | 31 | } |
39 | 32 | ||
40 | static const char *mmp2_dt_board_compat[] __initdata = { | 33 | static const char *mmp2_dt_board_compat[] __initdata = { |
@@ -44,7 +37,6 @@ static const char *mmp2_dt_board_compat[] __initdata = { | |||
44 | 37 | ||
45 | DT_MACHINE_START(MMP2_DT, "Marvell MMP2 (Device Tree Support)") | 38 | DT_MACHINE_START(MMP2_DT, "Marvell MMP2 (Device Tree Support)") |
46 | .map_io = mmp_map_io, | 39 | .map_io = mmp_map_io, |
47 | .init_time = mmp_dt_init_timer, | 40 | .init_time = mmp_init_time, |
48 | .init_machine = mmp2_dt_init, | ||
49 | .dt_compat = mmp2_dt_board_compat, | 41 | .dt_compat = mmp2_dt_board_compat, |
50 | MACHINE_END | 42 | MACHINE_END |