aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel/cpu/sh2a/setup-mxg.c
diff options
context:
space:
mode:
authorOlof Johansson <olof@lixom.net>2014-05-21 17:05:58 -0400
committerOlof Johansson <olof@lixom.net>2014-05-21 17:05:58 -0400
commit82711e7b46d80a6fd946166bd012b052d53b8ff4 (patch)
tree0dbfdd45542ab318e733a91724620ce9a6f79617 /arch/sh/kernel/cpu/sh2a/setup-mxg.c
parent91f0f06ccbd2a0648160aad6783b7da92e2880d7 (diff)
parentc17fcfbcc0f6b4f3cae761149e1a6108dd6750e7 (diff)
Merge tag 'renesas-clock-cleanup2-for-v3.16' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas into next/boards
Merge "Renesas SoC Clock Cleanups for v3.16" from Simon Horman: Work from Laurent Pinchart to switch all Renesas platforms to the new style CMT, MTU2 and TMU device platform data. This is in preparation for initialising these devices using DT on ARM Based Renesas SoCs. * tag 'renesas-clock-cleanup2-for-v3.16' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas: ARM: shmobile: r7s72100: Switch to new style MTU2 device sh: Switch to new style MTU2 device ARM: shmobile: r8a7779: Switch to new style TMU device ARM: shmobile: r8a7778: Switch to new style TMU device ARM: shmobile: r8a7740: Switch to new style TMU device ARM: shmobile: sh73a0: Switch to new style TMU device ARM: shmobile: sh7372: Switch to new style TMU device sh: Switch to new style TMU device ARM: shmobile: r8a7791: Switch to new style CMT device ARM: shmobile: r8a7790: Switch to new style CMT device ARM: shmobile: r8a7740: Switch to new style CMT device ARM: shmobile: r8a73a4: Switch to new style CMT device ARM: shmobile: sh73a0: Switch to new style CMT device ARM: shmobile: sh7372: Switch to new style CMT device sh: Switch to new style CMT device Signed-off-by: Olof Johansson <olof@lixom.net>
Diffstat (limited to 'arch/sh/kernel/cpu/sh2a/setup-mxg.c')
-rw-r--r--arch/sh/kernel/cpu/sh2a/setup-mxg.c98
1 files changed, 12 insertions, 86 deletions
diff --git a/arch/sh/kernel/cpu/sh2a/setup-mxg.c b/arch/sh/kernel/cpu/sh2a/setup-mxg.c
index 63e996f9a7ed..26fcdbd4127a 100644
--- a/arch/sh/kernel/cpu/sh2a/setup-mxg.c
+++ b/arch/sh/kernel/cpu/sh2a/setup-mxg.c
@@ -114,88 +114,18 @@ static struct intc_mask_reg mask_registers[] __initdata = {
114static DECLARE_INTC_DESC(intc_desc, "mxg", vectors, groups, 114static DECLARE_INTC_DESC(intc_desc, "mxg", vectors, groups,
115 mask_registers, prio_registers, NULL); 115 mask_registers, prio_registers, NULL);
116 116
117static struct sh_timer_config mtu2_0_platform_data = { 117static struct resource mtu2_resources[] = {
118 .channel_offset = -0x80, 118 DEFINE_RES_MEM(0xff801000, 0x400),
119 .timer_bit = 0, 119 DEFINE_RES_IRQ_NAMED(228, "tgi0a"),
120 .clockevent_rating = 200, 120 DEFINE_RES_IRQ_NAMED(234, "tgi1a"),
121 DEFINE_RES_IRQ_NAMED(240, "tgi2a"),
121}; 122};
122 123
123static struct resource mtu2_0_resources[] = { 124static struct platform_device mtu2_device = {
124 [0] = { 125 .name = "sh-mtu2",
125 .start = 0xff801300, 126 .id = -1,
126 .end = 0xff801326, 127 .resource = mtu2_resources,
127 .flags = IORESOURCE_MEM, 128 .num_resources = ARRAY_SIZE(mtu2_resources),
128 },
129 [1] = {
130 .start = 228,
131 .flags = IORESOURCE_IRQ,
132 },
133};
134
135static struct platform_device mtu2_0_device = {
136 .name = "sh_mtu2",
137 .id = 0,
138 .dev = {
139 .platform_data = &mtu2_0_platform_data,
140 },
141 .resource = mtu2_0_resources,
142 .num_resources = ARRAY_SIZE(mtu2_0_resources),
143};
144
145static struct sh_timer_config mtu2_1_platform_data = {
146 .channel_offset = -0x100,
147 .timer_bit = 1,
148 .clockevent_rating = 200,
149};
150
151static struct resource mtu2_1_resources[] = {
152 [0] = {
153 .start = 0xff801380,
154 .end = 0xff801390,
155 .flags = IORESOURCE_MEM,
156 },
157 [1] = {
158 .start = 234,
159 .flags = IORESOURCE_IRQ,
160 },
161};
162
163static struct platform_device mtu2_1_device = {
164 .name = "sh_mtu2",
165 .id = 1,
166 .dev = {
167 .platform_data = &mtu2_1_platform_data,
168 },
169 .resource = mtu2_1_resources,
170 .num_resources = ARRAY_SIZE(mtu2_1_resources),
171};
172
173static struct sh_timer_config mtu2_2_platform_data = {
174 .channel_offset = 0x80,
175 .timer_bit = 2,
176 .clockevent_rating = 200,
177};
178
179static struct resource mtu2_2_resources[] = {
180 [0] = {
181 .start = 0xff801000,
182 .end = 0xff80100a,
183 .flags = IORESOURCE_MEM,
184 },
185 [1] = {
186 .start = 240,
187 .flags = IORESOURCE_IRQ,
188 },
189};
190
191static struct platform_device mtu2_2_device = {
192 .name = "sh_mtu2",
193 .id = 2,
194 .dev = {
195 .platform_data = &mtu2_2_platform_data,
196 },
197 .resource = mtu2_2_resources,
198 .num_resources = ARRAY_SIZE(mtu2_2_resources),
199}; 129};
200 130
201static struct plat_sci_port scif0_platform_data = { 131static struct plat_sci_port scif0_platform_data = {
@@ -221,9 +151,7 @@ static struct platform_device scif0_device = {
221 151
222static struct platform_device *mxg_devices[] __initdata = { 152static struct platform_device *mxg_devices[] __initdata = {
223 &scif0_device, 153 &scif0_device,
224 &mtu2_0_device, 154 &mtu2_device,
225 &mtu2_1_device,
226 &mtu2_2_device,
227}; 155};
228 156
229static int __init mxg_devices_setup(void) 157static int __init mxg_devices_setup(void)
@@ -240,9 +168,7 @@ void __init plat_irq_setup(void)
240 168
241static struct platform_device *mxg_early_devices[] __initdata = { 169static struct platform_device *mxg_early_devices[] __initdata = {
242 &scif0_device, 170 &scif0_device,
243 &mtu2_0_device, 171 &mtu2_device,
244 &mtu2_1_device,
245 &mtu2_2_device,
246}; 172};
247 173
248void __init plat_early_device_setup(void) 174void __init plat_early_device_setup(void)