diff options
author | Paul Mundt <lethal@linux-sh.org> | 2012-01-11 22:57:41 -0500 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2012-01-11 22:57:41 -0500 |
commit | 9d14070f656addddce3d63fd483de46930b51850 (patch) | |
tree | a8767c2547dd2b6f49974503a5169d8c08de00e9 /arch/sh/kernel | |
parent | 9f06cf38eca57e279b4c78e465e19f10c2f78174 (diff) | |
parent | a319add1e24c43d285b781332cfa532405466650 (diff) |
Merge branch 'sh/hwblk' into sh-latest
Diffstat (limited to 'arch/sh/kernel')
-rw-r--r-- | arch/sh/kernel/cpu/Makefile | 3 | ||||
-rw-r--r-- | arch/sh/kernel/cpu/hwblk.c | 159 | ||||
-rw-r--r-- | arch/sh/kernel/cpu/sh4a/setup-sh7722.c | 36 | ||||
-rw-r--r-- | arch/sh/kernel/cpu/sh4a/setup-sh7723.c | 39 | ||||
-rw-r--r-- | arch/sh/kernel/cpu/sh4a/setup-sh7724.c | 60 | ||||
-rw-r--r-- | arch/sh/kernel/cpu/shmobile/cpuidle.c | 3 | ||||
-rw-r--r-- | arch/sh/kernel/time.c | 2 |
7 files changed, 1 insertions, 301 deletions
diff --git a/arch/sh/kernel/cpu/Makefile b/arch/sh/kernel/cpu/Makefile index 5366fdf8c56..fa58bfd30d8 100644 --- a/arch/sh/kernel/cpu/Makefile +++ b/arch/sh/kernel/cpu/Makefile | |||
@@ -19,6 +19,3 @@ obj-$(CONFIG_SH_ADC) += adc.o | |||
19 | obj-$(CONFIG_SH_CLK_CPG_LEGACY) += clock-cpg.o | 19 | obj-$(CONFIG_SH_CLK_CPG_LEGACY) += clock-cpg.o |
20 | 20 | ||
21 | obj-y += irq/ init.o clock.o fpu.o proc.o | 21 | obj-y += irq/ init.o clock.o fpu.o proc.o |
22 | ifneq ($(CONFIG_CPU_SUBTYPE_SH7722)$(CONFIG_CPU_SUBTYPE_SH7723)$(CONFIG_CPU_SUBTYPE_SH7724),y) | ||
23 | obj-y += hwblk.o | ||
24 | endif | ||
diff --git a/arch/sh/kernel/cpu/hwblk.c b/arch/sh/kernel/cpu/hwblk.c deleted file mode 100644 index 3e985aae5d9..00000000000 --- a/arch/sh/kernel/cpu/hwblk.c +++ /dev/null | |||
@@ -1,159 +0,0 @@ | |||
1 | #include <linux/clk.h> | ||
2 | #include <linux/compiler.h> | ||
3 | #include <linux/io.h> | ||
4 | #include <linux/spinlock.h> | ||
5 | #include <asm/suspend.h> | ||
6 | #include <asm/hwblk.h> | ||
7 | #include <asm/clock.h> | ||
8 | |||
9 | static DEFINE_SPINLOCK(hwblk_lock); | ||
10 | |||
11 | static void hwblk_area_mod_cnt(struct hwblk_info *info, | ||
12 | int area, int counter, int value, int goal) | ||
13 | { | ||
14 | struct hwblk_area *hap = info->areas + area; | ||
15 | |||
16 | hap->cnt[counter] += value; | ||
17 | |||
18 | if (hap->cnt[counter] != goal) | ||
19 | return; | ||
20 | |||
21 | if (hap->flags & HWBLK_AREA_FLAG_PARENT) | ||
22 | hwblk_area_mod_cnt(info, hap->parent, counter, value, goal); | ||
23 | } | ||
24 | |||
25 | |||
26 | static int __hwblk_mod_cnt(struct hwblk_info *info, int hwblk, | ||
27 | int counter, int value, int goal) | ||
28 | { | ||
29 | struct hwblk *hp = info->hwblks + hwblk; | ||
30 | |||
31 | hp->cnt[counter] += value; | ||
32 | if (hp->cnt[counter] == goal) | ||
33 | hwblk_area_mod_cnt(info, hp->area, counter, value, goal); | ||
34 | |||
35 | return hp->cnt[counter]; | ||
36 | } | ||
37 | |||
38 | static void hwblk_mod_cnt(struct hwblk_info *info, int hwblk, | ||
39 | int counter, int value, int goal) | ||
40 | { | ||
41 | unsigned long flags; | ||
42 | |||
43 | spin_lock_irqsave(&hwblk_lock, flags); | ||
44 | __hwblk_mod_cnt(info, hwblk, counter, value, goal); | ||
45 | spin_unlock_irqrestore(&hwblk_lock, flags); | ||
46 | } | ||
47 | |||
48 | void hwblk_cnt_inc(struct hwblk_info *info, int hwblk, int counter) | ||
49 | { | ||
50 | hwblk_mod_cnt(info, hwblk, counter, 1, 1); | ||
51 | } | ||
52 | |||
53 | void hwblk_cnt_dec(struct hwblk_info *info, int hwblk, int counter) | ||
54 | { | ||
55 | hwblk_mod_cnt(info, hwblk, counter, -1, 0); | ||
56 | } | ||
57 | |||
58 | void hwblk_enable(struct hwblk_info *info, int hwblk) | ||
59 | { | ||
60 | struct hwblk *hp = info->hwblks + hwblk; | ||
61 | unsigned long tmp; | ||
62 | unsigned long flags; | ||
63 | int ret; | ||
64 | |||
65 | spin_lock_irqsave(&hwblk_lock, flags); | ||
66 | |||
67 | ret = __hwblk_mod_cnt(info, hwblk, HWBLK_CNT_USAGE, 1, 1); | ||
68 | if (ret == 1) { | ||
69 | tmp = __raw_readl(hp->mstp); | ||
70 | tmp &= ~(1 << hp->bit); | ||
71 | __raw_writel(tmp, hp->mstp); | ||
72 | } | ||
73 | |||
74 | spin_unlock_irqrestore(&hwblk_lock, flags); | ||
75 | } | ||
76 | |||
77 | void hwblk_disable(struct hwblk_info *info, int hwblk) | ||
78 | { | ||
79 | struct hwblk *hp = info->hwblks + hwblk; | ||
80 | unsigned long tmp; | ||
81 | unsigned long flags; | ||
82 | int ret; | ||
83 | |||
84 | spin_lock_irqsave(&hwblk_lock, flags); | ||
85 | |||
86 | ret = __hwblk_mod_cnt(info, hwblk, HWBLK_CNT_USAGE, -1, 0); | ||
87 | if (ret == 0) { | ||
88 | tmp = __raw_readl(hp->mstp); | ||
89 | tmp |= 1 << hp->bit; | ||
90 | __raw_writel(tmp, hp->mstp); | ||
91 | } | ||
92 | |||
93 | spin_unlock_irqrestore(&hwblk_lock, flags); | ||
94 | } | ||
95 | |||
96 | struct hwblk_info *hwblk_info; | ||
97 | |||
98 | int __init hwblk_register(struct hwblk_info *info) | ||
99 | { | ||
100 | hwblk_info = info; | ||
101 | return 0; | ||
102 | } | ||
103 | |||
104 | int __init __weak arch_hwblk_init(void) | ||
105 | { | ||
106 | return 0; | ||
107 | } | ||
108 | |||
109 | int __weak arch_hwblk_sleep_mode(void) | ||
110 | { | ||
111 | return SUSP_SH_SLEEP; | ||
112 | } | ||
113 | |||
114 | int __init hwblk_init(void) | ||
115 | { | ||
116 | return arch_hwblk_init(); | ||
117 | } | ||
118 | |||
119 | /* allow clocks to enable and disable hardware blocks */ | ||
120 | static int sh_hwblk_clk_enable(struct clk *clk) | ||
121 | { | ||
122 | if (!hwblk_info) | ||
123 | return -ENOENT; | ||
124 | |||
125 | hwblk_enable(hwblk_info, clk->arch_flags); | ||
126 | return 0; | ||
127 | } | ||
128 | |||
129 | static void sh_hwblk_clk_disable(struct clk *clk) | ||
130 | { | ||
131 | if (hwblk_info) | ||
132 | hwblk_disable(hwblk_info, clk->arch_flags); | ||
133 | } | ||
134 | |||
135 | static struct clk_ops sh_hwblk_clk_ops = { | ||
136 | .enable = sh_hwblk_clk_enable, | ||
137 | .disable = sh_hwblk_clk_disable, | ||
138 | .recalc = followparent_recalc, | ||
139 | }; | ||
140 | |||
141 | int __init sh_hwblk_clk_register(struct clk *clks, int nr) | ||
142 | { | ||
143 | struct clk *clkp; | ||
144 | int ret = 0; | ||
145 | int k; | ||
146 | |||
147 | for (k = 0; !ret && (k < nr); k++) { | ||
148 | clkp = clks + k; | ||
149 | |||
150 | /* skip over clocks using hwblk 0 (HWBLK_UNKNOWN) */ | ||
151 | if (!clkp->arch_flags) | ||
152 | continue; | ||
153 | |||
154 | clkp->ops = &sh_hwblk_clk_ops; | ||
155 | ret |= clk_register(clkp); | ||
156 | } | ||
157 | |||
158 | return ret; | ||
159 | } | ||
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7722.c b/arch/sh/kernel/cpu/sh4a/setup-sh7722.c index 27af277cc63..8420d4bc8bf 100644 --- a/arch/sh/kernel/cpu/sh4a/setup-sh7722.c +++ b/arch/sh/kernel/cpu/sh4a/setup-sh7722.c | |||
@@ -173,9 +173,6 @@ struct platform_device dma_device = { | |||
173 | .dev = { | 173 | .dev = { |
174 | .platform_data = &dma_platform_data, | 174 | .platform_data = &dma_platform_data, |
175 | }, | 175 | }, |
176 | .archdata = { | ||
177 | .hwblk_id = HWBLK_DMAC, | ||
178 | }, | ||
179 | }; | 176 | }; |
180 | 177 | ||
181 | /* Serial */ | 178 | /* Serial */ |
@@ -264,9 +261,6 @@ static struct platform_device rtc_device = { | |||
264 | .id = -1, | 261 | .id = -1, |
265 | .num_resources = ARRAY_SIZE(rtc_resources), | 262 | .num_resources = ARRAY_SIZE(rtc_resources), |
266 | .resource = rtc_resources, | 263 | .resource = rtc_resources, |
267 | .archdata = { | ||
268 | .hwblk_id = HWBLK_RTC, | ||
269 | }, | ||
270 | }; | 264 | }; |
271 | 265 | ||
272 | static struct m66592_platdata usbf_platdata = { | 266 | static struct m66592_platdata usbf_platdata = { |
@@ -297,9 +291,6 @@ static struct platform_device usbf_device = { | |||
297 | }, | 291 | }, |
298 | .num_resources = ARRAY_SIZE(usbf_resources), | 292 | .num_resources = ARRAY_SIZE(usbf_resources), |
299 | .resource = usbf_resources, | 293 | .resource = usbf_resources, |
300 | .archdata = { | ||
301 | .hwblk_id = HWBLK_USBF, | ||
302 | }, | ||
303 | }; | 294 | }; |
304 | 295 | ||
305 | static struct resource iic_resources[] = { | 296 | static struct resource iic_resources[] = { |
@@ -321,9 +312,6 @@ static struct platform_device iic_device = { | |||
321 | .id = 0, /* "i2c0" clock */ | 312 | .id = 0, /* "i2c0" clock */ |
322 | .num_resources = ARRAY_SIZE(iic_resources), | 313 | .num_resources = ARRAY_SIZE(iic_resources), |
323 | .resource = iic_resources, | 314 | .resource = iic_resources, |
324 | .archdata = { | ||
325 | .hwblk_id = HWBLK_IIC, | ||
326 | }, | ||
327 | }; | 315 | }; |
328 | 316 | ||
329 | static struct uio_info vpu_platform_data = { | 317 | static struct uio_info vpu_platform_data = { |
@@ -352,9 +340,6 @@ static struct platform_device vpu_device = { | |||
352 | }, | 340 | }, |
353 | .resource = vpu_resources, | 341 | .resource = vpu_resources, |
354 | .num_resources = ARRAY_SIZE(vpu_resources), | 342 | .num_resources = ARRAY_SIZE(vpu_resources), |
355 | .archdata = { | ||
356 | .hwblk_id = HWBLK_VPU, | ||
357 | }, | ||
358 | }; | 343 | }; |
359 | 344 | ||
360 | static struct uio_info veu_platform_data = { | 345 | static struct uio_info veu_platform_data = { |
@@ -383,9 +368,6 @@ static struct platform_device veu_device = { | |||
383 | }, | 368 | }, |
384 | .resource = veu_resources, | 369 | .resource = veu_resources, |
385 | .num_resources = ARRAY_SIZE(veu_resources), | 370 | .num_resources = ARRAY_SIZE(veu_resources), |
386 | .archdata = { | ||
387 | .hwblk_id = HWBLK_VEU, | ||
388 | }, | ||
389 | }; | 371 | }; |
390 | 372 | ||
391 | static struct uio_info jpu_platform_data = { | 373 | static struct uio_info jpu_platform_data = { |
@@ -414,9 +396,6 @@ static struct platform_device jpu_device = { | |||
414 | }, | 396 | }, |
415 | .resource = jpu_resources, | 397 | .resource = jpu_resources, |
416 | .num_resources = ARRAY_SIZE(jpu_resources), | 398 | .num_resources = ARRAY_SIZE(jpu_resources), |
417 | .archdata = { | ||
418 | .hwblk_id = HWBLK_JPU, | ||
419 | }, | ||
420 | }; | 399 | }; |
421 | 400 | ||
422 | static struct sh_timer_config cmt_platform_data = { | 401 | static struct sh_timer_config cmt_platform_data = { |
@@ -446,9 +425,6 @@ static struct platform_device cmt_device = { | |||
446 | }, | 425 | }, |
447 | .resource = cmt_resources, | 426 | .resource = cmt_resources, |
448 | .num_resources = ARRAY_SIZE(cmt_resources), | 427 | .num_resources = ARRAY_SIZE(cmt_resources), |
449 | .archdata = { | ||
450 | .hwblk_id = HWBLK_CMT, | ||
451 | }, | ||
452 | }; | 428 | }; |
453 | 429 | ||
454 | static struct sh_timer_config tmu0_platform_data = { | 430 | static struct sh_timer_config tmu0_platform_data = { |
@@ -477,9 +453,6 @@ static struct platform_device tmu0_device = { | |||
477 | }, | 453 | }, |
478 | .resource = tmu0_resources, | 454 | .resource = tmu0_resources, |
479 | .num_resources = ARRAY_SIZE(tmu0_resources), | 455 | .num_resources = ARRAY_SIZE(tmu0_resources), |
480 | .archdata = { | ||
481 | .hwblk_id = HWBLK_TMU, | ||
482 | }, | ||
483 | }; | 456 | }; |
484 | 457 | ||
485 | static struct sh_timer_config tmu1_platform_data = { | 458 | static struct sh_timer_config tmu1_platform_data = { |
@@ -508,9 +481,6 @@ static struct platform_device tmu1_device = { | |||
508 | }, | 481 | }, |
509 | .resource = tmu1_resources, | 482 | .resource = tmu1_resources, |
510 | .num_resources = ARRAY_SIZE(tmu1_resources), | 483 | .num_resources = ARRAY_SIZE(tmu1_resources), |
511 | .archdata = { | ||
512 | .hwblk_id = HWBLK_TMU, | ||
513 | }, | ||
514 | }; | 484 | }; |
515 | 485 | ||
516 | static struct sh_timer_config tmu2_platform_data = { | 486 | static struct sh_timer_config tmu2_platform_data = { |
@@ -538,9 +508,6 @@ static struct platform_device tmu2_device = { | |||
538 | }, | 508 | }, |
539 | .resource = tmu2_resources, | 509 | .resource = tmu2_resources, |
540 | .num_resources = ARRAY_SIZE(tmu2_resources), | 510 | .num_resources = ARRAY_SIZE(tmu2_resources), |
541 | .archdata = { | ||
542 | .hwblk_id = HWBLK_TMU, | ||
543 | }, | ||
544 | }; | 511 | }; |
545 | 512 | ||
546 | static struct siu_platform siu_platform_data = { | 513 | static struct siu_platform siu_platform_data = { |
@@ -571,9 +538,6 @@ static struct platform_device siu_device = { | |||
571 | }, | 538 | }, |
572 | .resource = siu_resources, | 539 | .resource = siu_resources, |
573 | .num_resources = ARRAY_SIZE(siu_resources), | 540 | .num_resources = ARRAY_SIZE(siu_resources), |
574 | .archdata = { | ||
575 | .hwblk_id = HWBLK_SIU, | ||
576 | }, | ||
577 | }; | 541 | }; |
578 | 542 | ||
579 | static struct platform_device *sh7722_devices[] __initdata = { | 543 | static struct platform_device *sh7722_devices[] __initdata = { |
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7723.c b/arch/sh/kernel/cpu/sh4a/setup-sh7723.c index 3c2810d8f72..a188c9ea439 100644 --- a/arch/sh/kernel/cpu/sh4a/setup-sh7723.c +++ b/arch/sh/kernel/cpu/sh4a/setup-sh7723.c | |||
@@ -158,9 +158,6 @@ static struct platform_device vpu_device = { | |||
158 | }, | 158 | }, |
159 | .resource = vpu_resources, | 159 | .resource = vpu_resources, |
160 | .num_resources = ARRAY_SIZE(vpu_resources), | 160 | .num_resources = ARRAY_SIZE(vpu_resources), |
161 | .archdata = { | ||
162 | .hwblk_id = HWBLK_VPU, | ||
163 | }, | ||
164 | }; | 161 | }; |
165 | 162 | ||
166 | static struct uio_info veu0_platform_data = { | 163 | static struct uio_info veu0_platform_data = { |
@@ -189,9 +186,6 @@ static struct platform_device veu0_device = { | |||
189 | }, | 186 | }, |
190 | .resource = veu0_resources, | 187 | .resource = veu0_resources, |
191 | .num_resources = ARRAY_SIZE(veu0_resources), | 188 | .num_resources = ARRAY_SIZE(veu0_resources), |
192 | .archdata = { | ||
193 | .hwblk_id = HWBLK_VEU2H0, | ||
194 | }, | ||
195 | }; | 189 | }; |
196 | 190 | ||
197 | static struct uio_info veu1_platform_data = { | 191 | static struct uio_info veu1_platform_data = { |
@@ -220,9 +214,6 @@ static struct platform_device veu1_device = { | |||
220 | }, | 214 | }, |
221 | .resource = veu1_resources, | 215 | .resource = veu1_resources, |
222 | .num_resources = ARRAY_SIZE(veu1_resources), | 216 | .num_resources = ARRAY_SIZE(veu1_resources), |
223 | .archdata = { | ||
224 | .hwblk_id = HWBLK_VEU2H1, | ||
225 | }, | ||
226 | }; | 217 | }; |
227 | 218 | ||
228 | static struct sh_timer_config cmt_platform_data = { | 219 | static struct sh_timer_config cmt_platform_data = { |
@@ -252,9 +243,6 @@ static struct platform_device cmt_device = { | |||
252 | }, | 243 | }, |
253 | .resource = cmt_resources, | 244 | .resource = cmt_resources, |
254 | .num_resources = ARRAY_SIZE(cmt_resources), | 245 | .num_resources = ARRAY_SIZE(cmt_resources), |
255 | .archdata = { | ||
256 | .hwblk_id = HWBLK_CMT, | ||
257 | }, | ||
258 | }; | 246 | }; |
259 | 247 | ||
260 | static struct sh_timer_config tmu0_platform_data = { | 248 | static struct sh_timer_config tmu0_platform_data = { |
@@ -283,9 +271,6 @@ static struct platform_device tmu0_device = { | |||
283 | }, | 271 | }, |
284 | .resource = tmu0_resources, | 272 | .resource = tmu0_resources, |
285 | .num_resources = ARRAY_SIZE(tmu0_resources), | 273 | .num_resources = ARRAY_SIZE(tmu0_resources), |
286 | .archdata = { | ||
287 | .hwblk_id = HWBLK_TMU0, | ||
288 | }, | ||
289 | }; | 274 | }; |
290 | 275 | ||
291 | static struct sh_timer_config tmu1_platform_data = { | 276 | static struct sh_timer_config tmu1_platform_data = { |
@@ -314,9 +299,6 @@ static struct platform_device tmu1_device = { | |||
314 | }, | 299 | }, |
315 | .resource = tmu1_resources, | 300 | .resource = tmu1_resources, |
316 | .num_resources = ARRAY_SIZE(tmu1_resources), | 301 | .num_resources = ARRAY_SIZE(tmu1_resources), |
317 | .archdata = { | ||
318 | .hwblk_id = HWBLK_TMU0, | ||
319 | }, | ||
320 | }; | 302 | }; |
321 | 303 | ||
322 | static struct sh_timer_config tmu2_platform_data = { | 304 | static struct sh_timer_config tmu2_platform_data = { |
@@ -344,9 +326,6 @@ static struct platform_device tmu2_device = { | |||
344 | }, | 326 | }, |
345 | .resource = tmu2_resources, | 327 | .resource = tmu2_resources, |
346 | .num_resources = ARRAY_SIZE(tmu2_resources), | 328 | .num_resources = ARRAY_SIZE(tmu2_resources), |
347 | .archdata = { | ||
348 | .hwblk_id = HWBLK_TMU0, | ||
349 | }, | ||
350 | }; | 329 | }; |
351 | 330 | ||
352 | static struct sh_timer_config tmu3_platform_data = { | 331 | static struct sh_timer_config tmu3_platform_data = { |
@@ -374,9 +353,6 @@ static struct platform_device tmu3_device = { | |||
374 | }, | 353 | }, |
375 | .resource = tmu3_resources, | 354 | .resource = tmu3_resources, |
376 | .num_resources = ARRAY_SIZE(tmu3_resources), | 355 | .num_resources = ARRAY_SIZE(tmu3_resources), |
377 | .archdata = { | ||
378 | .hwblk_id = HWBLK_TMU1, | ||
379 | }, | ||
380 | }; | 356 | }; |
381 | 357 | ||
382 | static struct sh_timer_config tmu4_platform_data = { | 358 | static struct sh_timer_config tmu4_platform_data = { |
@@ -404,9 +380,6 @@ static struct platform_device tmu4_device = { | |||
404 | }, | 380 | }, |
405 | .resource = tmu4_resources, | 381 | .resource = tmu4_resources, |
406 | .num_resources = ARRAY_SIZE(tmu4_resources), | 382 | .num_resources = ARRAY_SIZE(tmu4_resources), |
407 | .archdata = { | ||
408 | .hwblk_id = HWBLK_TMU1, | ||
409 | }, | ||
410 | }; | 383 | }; |
411 | 384 | ||
412 | static struct sh_timer_config tmu5_platform_data = { | 385 | static struct sh_timer_config tmu5_platform_data = { |
@@ -434,9 +407,6 @@ static struct platform_device tmu5_device = { | |||
434 | }, | 407 | }, |
435 | .resource = tmu5_resources, | 408 | .resource = tmu5_resources, |
436 | .num_resources = ARRAY_SIZE(tmu5_resources), | 409 | .num_resources = ARRAY_SIZE(tmu5_resources), |
437 | .archdata = { | ||
438 | .hwblk_id = HWBLK_TMU1, | ||
439 | }, | ||
440 | }; | 410 | }; |
441 | 411 | ||
442 | static struct resource rtc_resources[] = { | 412 | static struct resource rtc_resources[] = { |
@@ -467,9 +437,6 @@ static struct platform_device rtc_device = { | |||
467 | .id = -1, | 437 | .id = -1, |
468 | .num_resources = ARRAY_SIZE(rtc_resources), | 438 | .num_resources = ARRAY_SIZE(rtc_resources), |
469 | .resource = rtc_resources, | 439 | .resource = rtc_resources, |
470 | .archdata = { | ||
471 | .hwblk_id = HWBLK_RTC, | ||
472 | }, | ||
473 | }; | 440 | }; |
474 | 441 | ||
475 | static struct r8a66597_platdata r8a66597_data = { | 442 | static struct r8a66597_platdata r8a66597_data = { |
@@ -499,9 +466,6 @@ static struct platform_device sh7723_usb_host_device = { | |||
499 | }, | 466 | }, |
500 | .num_resources = ARRAY_SIZE(sh7723_usb_host_resources), | 467 | .num_resources = ARRAY_SIZE(sh7723_usb_host_resources), |
501 | .resource = sh7723_usb_host_resources, | 468 | .resource = sh7723_usb_host_resources, |
502 | .archdata = { | ||
503 | .hwblk_id = HWBLK_USB, | ||
504 | }, | ||
505 | }; | 469 | }; |
506 | 470 | ||
507 | static struct resource iic_resources[] = { | 471 | static struct resource iic_resources[] = { |
@@ -523,9 +487,6 @@ static struct platform_device iic_device = { | |||
523 | .id = 0, /* "i2c0" clock */ | 487 | .id = 0, /* "i2c0" clock */ |
524 | .num_resources = ARRAY_SIZE(iic_resources), | 488 | .num_resources = ARRAY_SIZE(iic_resources), |
525 | .resource = iic_resources, | 489 | .resource = iic_resources, |
526 | .archdata = { | ||
527 | .hwblk_id = HWBLK_IIC, | ||
528 | }, | ||
529 | }; | 490 | }; |
530 | 491 | ||
531 | static struct platform_device *sh7723_devices[] __initdata = { | 492 | static struct platform_device *sh7723_devices[] __initdata = { |
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7724.c b/arch/sh/kernel/cpu/sh4a/setup-sh7724.c index 8d8a5512d57..4c671cfe68a 100644 --- a/arch/sh/kernel/cpu/sh4a/setup-sh7724.c +++ b/arch/sh/kernel/cpu/sh4a/setup-sh7724.c | |||
@@ -275,9 +275,6 @@ static struct platform_device dma0_device = { | |||
275 | .dev = { | 275 | .dev = { |
276 | .platform_data = &dma_platform_data, | 276 | .platform_data = &dma_platform_data, |
277 | }, | 277 | }, |
278 | .archdata = { | ||
279 | .hwblk_id = HWBLK_DMAC0, | ||
280 | }, | ||
281 | }; | 278 | }; |
282 | 279 | ||
283 | static struct platform_device dma1_device = { | 280 | static struct platform_device dma1_device = { |
@@ -288,9 +285,6 @@ static struct platform_device dma1_device = { | |||
288 | .dev = { | 285 | .dev = { |
289 | .platform_data = &dma_platform_data, | 286 | .platform_data = &dma_platform_data, |
290 | }, | 287 | }, |
291 | .archdata = { | ||
292 | .hwblk_id = HWBLK_DMAC1, | ||
293 | }, | ||
294 | }; | 288 | }; |
295 | 289 | ||
296 | /* Serial */ | 290 | /* Serial */ |
@@ -434,9 +428,6 @@ static struct platform_device rtc_device = { | |||
434 | .id = -1, | 428 | .id = -1, |
435 | .num_resources = ARRAY_SIZE(rtc_resources), | 429 | .num_resources = ARRAY_SIZE(rtc_resources), |
436 | .resource = rtc_resources, | 430 | .resource = rtc_resources, |
437 | .archdata = { | ||
438 | .hwblk_id = HWBLK_RTC, | ||
439 | }, | ||
440 | }; | 431 | }; |
441 | 432 | ||
442 | /* I2C0 */ | 433 | /* I2C0 */ |
@@ -459,9 +450,6 @@ static struct platform_device iic0_device = { | |||
459 | .id = 0, /* "i2c0" clock */ | 450 | .id = 0, /* "i2c0" clock */ |
460 | .num_resources = ARRAY_SIZE(iic0_resources), | 451 | .num_resources = ARRAY_SIZE(iic0_resources), |
461 | .resource = iic0_resources, | 452 | .resource = iic0_resources, |
462 | .archdata = { | ||
463 | .hwblk_id = HWBLK_IIC0, | ||
464 | }, | ||
465 | }; | 453 | }; |
466 | 454 | ||
467 | /* I2C1 */ | 455 | /* I2C1 */ |
@@ -484,9 +472,6 @@ static struct platform_device iic1_device = { | |||
484 | .id = 1, /* "i2c1" clock */ | 472 | .id = 1, /* "i2c1" clock */ |
485 | .num_resources = ARRAY_SIZE(iic1_resources), | 473 | .num_resources = ARRAY_SIZE(iic1_resources), |
486 | .resource = iic1_resources, | 474 | .resource = iic1_resources, |
487 | .archdata = { | ||
488 | .hwblk_id = HWBLK_IIC1, | ||
489 | }, | ||
490 | }; | 475 | }; |
491 | 476 | ||
492 | /* VPU */ | 477 | /* VPU */ |
@@ -516,9 +501,6 @@ static struct platform_device vpu_device = { | |||
516 | }, | 501 | }, |
517 | .resource = vpu_resources, | 502 | .resource = vpu_resources, |
518 | .num_resources = ARRAY_SIZE(vpu_resources), | 503 | .num_resources = ARRAY_SIZE(vpu_resources), |
519 | .archdata = { | ||
520 | .hwblk_id = HWBLK_VPU, | ||
521 | }, | ||
522 | }; | 504 | }; |
523 | 505 | ||
524 | /* VEU0 */ | 506 | /* VEU0 */ |
@@ -548,9 +530,6 @@ static struct platform_device veu0_device = { | |||
548 | }, | 530 | }, |
549 | .resource = veu0_resources, | 531 | .resource = veu0_resources, |
550 | .num_resources = ARRAY_SIZE(veu0_resources), | 532 | .num_resources = ARRAY_SIZE(veu0_resources), |
551 | .archdata = { | ||
552 | .hwblk_id = HWBLK_VEU0, | ||
553 | }, | ||
554 | }; | 533 | }; |
555 | 534 | ||
556 | /* VEU1 */ | 535 | /* VEU1 */ |
@@ -580,9 +559,6 @@ static struct platform_device veu1_device = { | |||
580 | }, | 559 | }, |
581 | .resource = veu1_resources, | 560 | .resource = veu1_resources, |
582 | .num_resources = ARRAY_SIZE(veu1_resources), | 561 | .num_resources = ARRAY_SIZE(veu1_resources), |
583 | .archdata = { | ||
584 | .hwblk_id = HWBLK_VEU1, | ||
585 | }, | ||
586 | }; | 562 | }; |
587 | 563 | ||
588 | /* BEU0 */ | 564 | /* BEU0 */ |
@@ -612,9 +588,6 @@ static struct platform_device beu0_device = { | |||
612 | }, | 588 | }, |
613 | .resource = beu0_resources, | 589 | .resource = beu0_resources, |
614 | .num_resources = ARRAY_SIZE(beu0_resources), | 590 | .num_resources = ARRAY_SIZE(beu0_resources), |
615 | .archdata = { | ||
616 | .hwblk_id = HWBLK_BEU0, | ||
617 | }, | ||
618 | }; | 591 | }; |
619 | 592 | ||
620 | /* BEU1 */ | 593 | /* BEU1 */ |
@@ -644,9 +617,6 @@ static struct platform_device beu1_device = { | |||
644 | }, | 617 | }, |
645 | .resource = beu1_resources, | 618 | .resource = beu1_resources, |
646 | .num_resources = ARRAY_SIZE(beu1_resources), | 619 | .num_resources = ARRAY_SIZE(beu1_resources), |
647 | .archdata = { | ||
648 | .hwblk_id = HWBLK_BEU1, | ||
649 | }, | ||
650 | }; | 620 | }; |
651 | 621 | ||
652 | static struct sh_timer_config cmt_platform_data = { | 622 | static struct sh_timer_config cmt_platform_data = { |
@@ -676,9 +646,6 @@ static struct platform_device cmt_device = { | |||
676 | }, | 646 | }, |
677 | .resource = cmt_resources, | 647 | .resource = cmt_resources, |
678 | .num_resources = ARRAY_SIZE(cmt_resources), | 648 | .num_resources = ARRAY_SIZE(cmt_resources), |
679 | .archdata = { | ||
680 | .hwblk_id = HWBLK_CMT, | ||
681 | }, | ||
682 | }; | 649 | }; |
683 | 650 | ||
684 | static struct sh_timer_config tmu0_platform_data = { | 651 | static struct sh_timer_config tmu0_platform_data = { |
@@ -707,9 +674,6 @@ static struct platform_device tmu0_device = { | |||
707 | }, | 674 | }, |
708 | .resource = tmu0_resources, | 675 | .resource = tmu0_resources, |
709 | .num_resources = ARRAY_SIZE(tmu0_resources), | 676 | .num_resources = ARRAY_SIZE(tmu0_resources), |
710 | .archdata = { | ||
711 | .hwblk_id = HWBLK_TMU0, | ||
712 | }, | ||
713 | }; | 677 | }; |
714 | 678 | ||
715 | static struct sh_timer_config tmu1_platform_data = { | 679 | static struct sh_timer_config tmu1_platform_data = { |
@@ -738,9 +702,6 @@ static struct platform_device tmu1_device = { | |||
738 | }, | 702 | }, |
739 | .resource = tmu1_resources, | 703 | .resource = tmu1_resources, |
740 | .num_resources = ARRAY_SIZE(tmu1_resources), | 704 | .num_resources = ARRAY_SIZE(tmu1_resources), |
741 | .archdata = { | ||
742 | .hwblk_id = HWBLK_TMU0, | ||
743 | }, | ||
744 | }; | 705 | }; |
745 | 706 | ||
746 | static struct sh_timer_config tmu2_platform_data = { | 707 | static struct sh_timer_config tmu2_platform_data = { |
@@ -768,9 +729,6 @@ static struct platform_device tmu2_device = { | |||
768 | }, | 729 | }, |
769 | .resource = tmu2_resources, | 730 | .resource = tmu2_resources, |
770 | .num_resources = ARRAY_SIZE(tmu2_resources), | 731 | .num_resources = ARRAY_SIZE(tmu2_resources), |
771 | .archdata = { | ||
772 | .hwblk_id = HWBLK_TMU0, | ||
773 | }, | ||
774 | }; | 732 | }; |
775 | 733 | ||
776 | 734 | ||
@@ -799,9 +757,6 @@ static struct platform_device tmu3_device = { | |||
799 | }, | 757 | }, |
800 | .resource = tmu3_resources, | 758 | .resource = tmu3_resources, |
801 | .num_resources = ARRAY_SIZE(tmu3_resources), | 759 | .num_resources = ARRAY_SIZE(tmu3_resources), |
802 | .archdata = { | ||
803 | .hwblk_id = HWBLK_TMU1, | ||
804 | }, | ||
805 | }; | 760 | }; |
806 | 761 | ||
807 | static struct sh_timer_config tmu4_platform_data = { | 762 | static struct sh_timer_config tmu4_platform_data = { |
@@ -829,9 +784,6 @@ static struct platform_device tmu4_device = { | |||
829 | }, | 784 | }, |
830 | .resource = tmu4_resources, | 785 | .resource = tmu4_resources, |
831 | .num_resources = ARRAY_SIZE(tmu4_resources), | 786 | .num_resources = ARRAY_SIZE(tmu4_resources), |
832 | .archdata = { | ||
833 | .hwblk_id = HWBLK_TMU1, | ||
834 | }, | ||
835 | }; | 787 | }; |
836 | 788 | ||
837 | static struct sh_timer_config tmu5_platform_data = { | 789 | static struct sh_timer_config tmu5_platform_data = { |
@@ -859,9 +811,6 @@ static struct platform_device tmu5_device = { | |||
859 | }, | 811 | }, |
860 | .resource = tmu5_resources, | 812 | .resource = tmu5_resources, |
861 | .num_resources = ARRAY_SIZE(tmu5_resources), | 813 | .num_resources = ARRAY_SIZE(tmu5_resources), |
862 | .archdata = { | ||
863 | .hwblk_id = HWBLK_TMU1, | ||
864 | }, | ||
865 | }; | 814 | }; |
866 | 815 | ||
867 | /* JPU */ | 816 | /* JPU */ |
@@ -891,9 +840,6 @@ static struct platform_device jpu_device = { | |||
891 | }, | 840 | }, |
892 | .resource = jpu_resources, | 841 | .resource = jpu_resources, |
893 | .num_resources = ARRAY_SIZE(jpu_resources), | 842 | .num_resources = ARRAY_SIZE(jpu_resources), |
894 | .archdata = { | ||
895 | .hwblk_id = HWBLK_JPU, | ||
896 | }, | ||
897 | }; | 843 | }; |
898 | 844 | ||
899 | /* SPU2DSP0 */ | 845 | /* SPU2DSP0 */ |
@@ -923,9 +869,6 @@ static struct platform_device spu0_device = { | |||
923 | }, | 869 | }, |
924 | .resource = spu0_resources, | 870 | .resource = spu0_resources, |
925 | .num_resources = ARRAY_SIZE(spu0_resources), | 871 | .num_resources = ARRAY_SIZE(spu0_resources), |
926 | .archdata = { | ||
927 | .hwblk_id = HWBLK_SPU, | ||
928 | }, | ||
929 | }; | 872 | }; |
930 | 873 | ||
931 | /* SPU2DSP1 */ | 874 | /* SPU2DSP1 */ |
@@ -955,9 +898,6 @@ static struct platform_device spu1_device = { | |||
955 | }, | 898 | }, |
956 | .resource = spu1_resources, | 899 | .resource = spu1_resources, |
957 | .num_resources = ARRAY_SIZE(spu1_resources), | 900 | .num_resources = ARRAY_SIZE(spu1_resources), |
958 | .archdata = { | ||
959 | .hwblk_id = HWBLK_SPU, | ||
960 | }, | ||
961 | }; | 901 | }; |
962 | 902 | ||
963 | static struct platform_device *sh7724_devices[] __initdata = { | 903 | static struct platform_device *sh7724_devices[] __initdata = { |
diff --git a/arch/sh/kernel/cpu/shmobile/cpuidle.c b/arch/sh/kernel/cpu/shmobile/cpuidle.c index 1cc257c9b1e..6d62eb40e75 100644 --- a/arch/sh/kernel/cpu/shmobile/cpuidle.c +++ b/arch/sh/kernel/cpu/shmobile/cpuidle.c | |||
@@ -17,7 +17,6 @@ | |||
17 | #include <linux/export.h> | 17 | #include <linux/export.h> |
18 | #include <asm/suspend.h> | 18 | #include <asm/suspend.h> |
19 | #include <asm/uaccess.h> | 19 | #include <asm/uaccess.h> |
20 | #include <asm/hwblk.h> | ||
21 | 20 | ||
22 | static unsigned long cpuidle_mode[] = { | 21 | static unsigned long cpuidle_mode[] = { |
23 | SUSP_SH_SLEEP, /* regular sleep mode */ | 22 | SUSP_SH_SLEEP, /* regular sleep mode */ |
@@ -29,7 +28,7 @@ static int cpuidle_sleep_enter(struct cpuidle_device *dev, | |||
29 | struct cpuidle_driver *drv, | 28 | struct cpuidle_driver *drv, |
30 | int index) | 29 | int index) |
31 | { | 30 | { |
32 | unsigned long allowed_mode = arch_hwblk_sleep_mode(); | 31 | unsigned long allowed_mode = SUSP_SH_SLEEP; |
33 | ktime_t before, after; | 32 | ktime_t before, after; |
34 | int requested_state = index; | 33 | int requested_state = index; |
35 | int allowed_state; | 34 | int allowed_state; |
diff --git a/arch/sh/kernel/time.c b/arch/sh/kernel/time.c index 8a0072de2bc..552c8fcf941 100644 --- a/arch/sh/kernel/time.c +++ b/arch/sh/kernel/time.c | |||
@@ -21,7 +21,6 @@ | |||
21 | #include <linux/smp.h> | 21 | #include <linux/smp.h> |
22 | #include <linux/rtc.h> | 22 | #include <linux/rtc.h> |
23 | #include <asm/clock.h> | 23 | #include <asm/clock.h> |
24 | #include <asm/hwblk.h> | ||
25 | #include <asm/rtc.h> | 24 | #include <asm/rtc.h> |
26 | 25 | ||
27 | /* Dummy RTC ops */ | 26 | /* Dummy RTC ops */ |
@@ -110,7 +109,6 @@ void __init time_init(void) | |||
110 | if (board_time_init) | 109 | if (board_time_init) |
111 | board_time_init(); | 110 | board_time_init(); |
112 | 111 | ||
113 | hwblk_init(); | ||
114 | clk_init(); | 112 | clk_init(); |
115 | 113 | ||
116 | late_time_init = sh_late_time_init; | 114 | late_time_init = sh_late_time_init; |