diff options
Diffstat (limited to 'arch/m68k/platform/coldfire/m532x.c')
-rw-r--r-- | arch/m68k/platform/coldfire/m532x.c | 139 |
1 files changed, 138 insertions, 1 deletions
diff --git a/arch/m68k/platform/coldfire/m532x.c b/arch/m68k/platform/coldfire/m532x.c index 21d6cb1c7004..4819a44991ed 100644 --- a/arch/m68k/platform/coldfire/m532x.c +++ b/arch/m68k/platform/coldfire/m532x.c | |||
@@ -27,6 +27,143 @@ | |||
27 | #include <asm/mcfuart.h> | 27 | #include <asm/mcfuart.h> |
28 | #include <asm/mcfdma.h> | 28 | #include <asm/mcfdma.h> |
29 | #include <asm/mcfwdebug.h> | 29 | #include <asm/mcfwdebug.h> |
30 | #include <asm/mcfclk.h> | ||
31 | |||
32 | /***************************************************************************/ | ||
33 | |||
34 | DEFINE_CLK(0, "flexbus", 2, MCF_CLK); | ||
35 | DEFINE_CLK(0, "mcfcan.0", 8, MCF_CLK); | ||
36 | DEFINE_CLK(0, "fec.0", 12, MCF_CLK); | ||
37 | DEFINE_CLK(0, "edma", 17, MCF_CLK); | ||
38 | DEFINE_CLK(0, "intc.0", 18, MCF_CLK); | ||
39 | DEFINE_CLK(0, "intc.1", 19, MCF_CLK); | ||
40 | DEFINE_CLK(0, "iack.0", 21, MCF_CLK); | ||
41 | DEFINE_CLK(0, "mcfi2c.0", 22, MCF_CLK); | ||
42 | DEFINE_CLK(0, "mcfqspi.0", 23, MCF_CLK); | ||
43 | DEFINE_CLK(0, "mcfuart.0", 24, MCF_BUSCLK); | ||
44 | DEFINE_CLK(0, "mcfuart.1", 25, MCF_BUSCLK); | ||
45 | DEFINE_CLK(0, "mcfuart.2", 26, MCF_BUSCLK); | ||
46 | DEFINE_CLK(0, "mcftmr.0", 28, MCF_CLK); | ||
47 | DEFINE_CLK(0, "mcftmr.1", 29, MCF_CLK); | ||
48 | DEFINE_CLK(0, "mcftmr.2", 30, MCF_CLK); | ||
49 | DEFINE_CLK(0, "mcftmr.3", 31, MCF_CLK); | ||
50 | |||
51 | DEFINE_CLK(0, "mcfpit.0", 32, MCF_CLK); | ||
52 | DEFINE_CLK(0, "mcfpit.1", 33, MCF_CLK); | ||
53 | DEFINE_CLK(0, "mcfpit.2", 34, MCF_CLK); | ||
54 | DEFINE_CLK(0, "mcfpit.3", 35, MCF_CLK); | ||
55 | DEFINE_CLK(0, "mcfpwm.0", 36, MCF_CLK); | ||
56 | DEFINE_CLK(0, "mcfeport.0", 37, MCF_CLK); | ||
57 | DEFINE_CLK(0, "mcfwdt.0", 38, MCF_CLK); | ||
58 | DEFINE_CLK(0, "sys.0", 40, MCF_BUSCLK); | ||
59 | DEFINE_CLK(0, "gpio.0", 41, MCF_BUSCLK); | ||
60 | DEFINE_CLK(0, "mcfrtc.0", 42, MCF_CLK); | ||
61 | DEFINE_CLK(0, "mcflcd.0", 43, MCF_CLK); | ||
62 | DEFINE_CLK(0, "mcfusb-otg.0", 44, MCF_CLK); | ||
63 | DEFINE_CLK(0, "mcfusb-host.0", 45, MCF_CLK); | ||
64 | DEFINE_CLK(0, "sdram.0", 46, MCF_CLK); | ||
65 | DEFINE_CLK(0, "ssi.0", 47, MCF_CLK); | ||
66 | DEFINE_CLK(0, "pll.0", 48, MCF_CLK); | ||
67 | |||
68 | DEFINE_CLK(1, "mdha.0", 32, MCF_CLK); | ||
69 | DEFINE_CLK(1, "skha.0", 33, MCF_CLK); | ||
70 | DEFINE_CLK(1, "rng.0", 34, MCF_CLK); | ||
71 | |||
72 | struct clk *mcf_clks[] = { | ||
73 | &__clk_0_2, /* flexbus */ | ||
74 | &__clk_0_8, /* mcfcan.0 */ | ||
75 | &__clk_0_12, /* fec.0 */ | ||
76 | &__clk_0_17, /* edma */ | ||
77 | &__clk_0_18, /* intc.0 */ | ||
78 | &__clk_0_19, /* intc.1 */ | ||
79 | &__clk_0_21, /* iack.0 */ | ||
80 | &__clk_0_22, /* mcfi2c.0 */ | ||
81 | &__clk_0_23, /* mcfqspi.0 */ | ||
82 | &__clk_0_24, /* mcfuart.0 */ | ||
83 | &__clk_0_25, /* mcfuart.1 */ | ||
84 | &__clk_0_26, /* mcfuart.2 */ | ||
85 | &__clk_0_28, /* mcftmr.0 */ | ||
86 | &__clk_0_29, /* mcftmr.1 */ | ||
87 | &__clk_0_30, /* mcftmr.2 */ | ||
88 | &__clk_0_31, /* mcftmr.3 */ | ||
89 | |||
90 | &__clk_0_32, /* mcfpit.0 */ | ||
91 | &__clk_0_33, /* mcfpit.1 */ | ||
92 | &__clk_0_34, /* mcfpit.2 */ | ||
93 | &__clk_0_35, /* mcfpit.3 */ | ||
94 | &__clk_0_36, /* mcfpwm.0 */ | ||
95 | &__clk_0_37, /* mcfeport.0 */ | ||
96 | &__clk_0_38, /* mcfwdt.0 */ | ||
97 | &__clk_0_40, /* sys.0 */ | ||
98 | &__clk_0_41, /* gpio.0 */ | ||
99 | &__clk_0_42, /* mcfrtc.0 */ | ||
100 | &__clk_0_43, /* mcflcd.0 */ | ||
101 | &__clk_0_44, /* mcfusb-otg.0 */ | ||
102 | &__clk_0_45, /* mcfusb-host.0 */ | ||
103 | &__clk_0_46, /* sdram.0 */ | ||
104 | &__clk_0_47, /* ssi.0 */ | ||
105 | &__clk_0_48, /* pll.0 */ | ||
106 | |||
107 | &__clk_1_32, /* mdha.0 */ | ||
108 | &__clk_1_33, /* skha.0 */ | ||
109 | &__clk_1_34, /* rng.0 */ | ||
110 | NULL, | ||
111 | }; | ||
112 | |||
113 | static struct clk * const enable_clks[] __initconst = { | ||
114 | &__clk_0_2, /* flexbus */ | ||
115 | &__clk_0_18, /* intc.0 */ | ||
116 | &__clk_0_19, /* intc.1 */ | ||
117 | &__clk_0_21, /* iack.0 */ | ||
118 | &__clk_0_24, /* mcfuart.0 */ | ||
119 | &__clk_0_25, /* mcfuart.1 */ | ||
120 | &__clk_0_26, /* mcfuart.2 */ | ||
121 | |||
122 | &__clk_0_32, /* mcfpit.0 */ | ||
123 | &__clk_0_33, /* mcfpit.1 */ | ||
124 | &__clk_0_37, /* mcfeport.0 */ | ||
125 | &__clk_0_40, /* sys.0 */ | ||
126 | &__clk_0_41, /* gpio.0 */ | ||
127 | &__clk_0_46, /* sdram.0 */ | ||
128 | &__clk_0_48, /* pll.0 */ | ||
129 | }; | ||
130 | |||
131 | static struct clk * const disable_clks[] __initconst = { | ||
132 | &__clk_0_8, /* mcfcan.0 */ | ||
133 | &__clk_0_12, /* fec.0 */ | ||
134 | &__clk_0_17, /* edma */ | ||
135 | &__clk_0_22, /* mcfi2c.0 */ | ||
136 | &__clk_0_23, /* mcfqspi.0 */ | ||
137 | &__clk_0_28, /* mcftmr.0 */ | ||
138 | &__clk_0_29, /* mcftmr.1 */ | ||
139 | &__clk_0_30, /* mcftmr.2 */ | ||
140 | &__clk_0_31, /* mcftmr.3 */ | ||
141 | &__clk_0_34, /* mcfpit.2 */ | ||
142 | &__clk_0_35, /* mcfpit.3 */ | ||
143 | &__clk_0_36, /* mcfpwm.0 */ | ||
144 | &__clk_0_38, /* mcfwdt.0 */ | ||
145 | &__clk_0_42, /* mcfrtc.0 */ | ||
146 | &__clk_0_43, /* mcflcd.0 */ | ||
147 | &__clk_0_44, /* mcfusb-otg.0 */ | ||
148 | &__clk_0_45, /* mcfusb-host.0 */ | ||
149 | &__clk_0_47, /* ssi.0 */ | ||
150 | &__clk_1_32, /* mdha.0 */ | ||
151 | &__clk_1_33, /* skha.0 */ | ||
152 | &__clk_1_34, /* rng.0 */ | ||
153 | }; | ||
154 | |||
155 | |||
156 | static void __init m532x_clk_init(void) | ||
157 | { | ||
158 | unsigned i; | ||
159 | |||
160 | /* make sure these clocks are enabled */ | ||
161 | for (i = 0; i < ARRAY_SIZE(enable_clks); ++i) | ||
162 | __clk_init_enabled(enable_clks[i]); | ||
163 | /* make sure these clocks are disabled */ | ||
164 | for (i = 0; i < ARRAY_SIZE(disable_clks); ++i) | ||
165 | __clk_init_disabled(disable_clks[i]); | ||
166 | } | ||
30 | 167 | ||
31 | /***************************************************************************/ | 168 | /***************************************************************************/ |
32 | 169 | ||
@@ -73,8 +210,8 @@ void __init config_BSP(char *commandp, int size) | |||
73 | memset(commandp, 0, size); | 210 | memset(commandp, 0, size); |
74 | } | 211 | } |
75 | #endif | 212 | #endif |
76 | |||
77 | mach_sched_init = hw_timer_init; | 213 | mach_sched_init = hw_timer_init; |
214 | m532x_clk_init(); | ||
78 | m532x_uarts_init(); | 215 | m532x_uarts_init(); |
79 | m532x_fec_init(); | 216 | m532x_fec_init(); |
80 | #if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI) | 217 | #if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI) |