tangled
alpha
login
or
join now
tjh.dev
/
kernel
1
fork
atom
Linux kernel mirror (for testing)
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel
os
linux
1
fork
atom
overview
issues
pulls
pipelines
Merge branch 'sh/hwblk' into sh-latest
Paul Mundt
14 years ago
9d14070f
9f06cf38
+8
-494
18 changed files
expand all
collapse all
unified
split
arch
sh
boards
mach-ap325rxa
setup.c
mach-ecovec24
setup.c
mach-kfr2r09
setup.c
mach-migor
setup.c
mach-se
7722
setup.c
7724
setup.c
include
asm
device.h
hwblk.h
cpu-sh4
cpu
sh7722.h
sh7723.h
sh7724.h
kernel
cpu
Makefile
hwblk.c
sh4a
setup-sh7722.c
setup-sh7723.c
setup-sh7724.c
shmobile
cpuidle.c
time.c
-12
arch/sh/boards/mach-ap325rxa/setup.c
reviewed
···
249
249
.dev = {
250
250
.platform_data = &lcdc_info,
251
251
},
252
252
-
.archdata = {
253
253
-
.hwblk_id = HWBLK_LCDC,
254
254
-
},
255
252
};
256
253
257
254
static void camera_power(int val)
···
421
424
.dev = {
422
425
.platform_data = &sh_mobile_ceu_info,
423
426
},
424
424
-
.archdata = {
425
425
-
.hwblk_id = HWBLK_CEU,
426
426
-
},
427
427
};
428
428
429
429
static struct resource sdhi0_cn3_resources[] = {
···
448
454
.dev = {
449
455
.platform_data = &sdhi0_cn3_data,
450
456
},
451
451
-
.archdata = {
452
452
-
.hwblk_id = HWBLK_SDHI0,
453
453
-
},
454
457
};
455
458
456
459
static struct resource sdhi1_cn7_resources[] = {
···
474
483
.resource = sdhi1_cn7_resources,
475
484
.dev = {
476
485
.platform_data = &sdhi1_cn7_data,
477
477
-
},
478
478
-
.archdata = {
479
479
-
.hwblk_id = HWBLK_SDHI1,
480
486
},
481
487
};
482
488
-36
arch/sh/boards/mach-ecovec24/setup.c
reviewed
···
156
156
},
157
157
.num_resources = ARRAY_SIZE(sh_eth_resources),
158
158
.resource = sh_eth_resources,
159
159
-
.archdata = {
160
160
-
.hwblk_id = HWBLK_ETHER,
161
161
-
},
162
159
};
163
160
164
161
/* USB0 host */
···
275
278
},
276
279
.num_resources = ARRAY_SIZE(usbhs_resources),
277
280
.resource = usbhs_resources,
278
278
-
.archdata = {
279
279
-
.hwblk_id = HWBLK_USB1,
280
280
-
},
281
281
};
282
282
283
283
/* LCDC */
···
360
366
.dev = {
361
367
.platform_data = &lcdc_info,
362
368
},
363
363
-
.archdata = {
364
364
-
.hwblk_id = HWBLK_LCDC,
365
365
-
},
366
369
};
367
370
368
371
/* CEU0 */
···
391
400
.dev = {
392
401
.platform_data = &sh_mobile_ceu0_info,
393
402
},
394
394
-
.archdata = {
395
395
-
.hwblk_id = HWBLK_CEU0,
396
396
-
},
397
403
};
398
404
399
405
/* CEU1 */
···
421
433
.resource = ceu1_resources,
422
434
.dev = {
423
435
.platform_data = &sh_mobile_ceu1_info,
424
424
-
},
425
425
-
.archdata = {
426
426
-
.hwblk_id = HWBLK_CEU1,
427
436
},
428
437
};
429
438
···
475
490
.resource = keysc_resources,
476
491
.dev = {
477
492
.platform_data = &keysc_info,
478
478
-
},
479
479
-
.archdata = {
480
480
-
.hwblk_id = HWBLK_KEYSC,
481
493
},
482
494
};
483
495
···
550
568
.dev = {
551
569
.platform_data = &sdhi0_info,
552
570
},
553
553
-
.archdata = {
554
554
-
.hwblk_id = HWBLK_SDHI0,
555
555
-
},
556
571
};
557
572
558
573
#if !defined(CONFIG_MMC_SH_MMCIF) && !defined(CONFIG_MMC_SH_MMCIF_MODULE)
···
586
607
.id = 1,
587
608
.dev = {
588
609
.platform_data = &sdhi1_info,
589
589
-
},
590
590
-
.archdata = {
591
591
-
.hwblk_id = HWBLK_SDHI1,
592
610
},
593
611
};
594
612
#endif /* CONFIG_MMC_SH_MMCIF */
···
652
676
},
653
677
.num_resources = ARRAY_SIZE(msiof0_resources),
654
678
.resource = msiof0_resources,
655
655
-
.archdata = {
656
656
-
.hwblk_id = HWBLK_MSIOF0,
657
657
-
},
658
679
};
659
680
660
681
#endif
···
791
818
.dev = {
792
819
.platform_data = &fsi_info,
793
820
},
794
794
-
.archdata = {
795
795
-
.hwblk_id = HWBLK_SPU, /* FSI needs SPU hwblk */
796
796
-
},
797
821
};
798
822
799
823
/* IrDA */
···
852
882
.dev = {
853
883
.platform_data = &sh_vou_pdata,
854
884
},
855
855
-
.archdata = {
856
856
-
.hwblk_id = HWBLK_VOU,
857
857
-
},
858
885
};
859
886
860
887
#if defined(CONFIG_MMC_SH_MMCIF) || defined(CONFIG_MMC_SH_MMCIF_MODULE)
···
903
936
},
904
937
.num_resources = ARRAY_SIZE(sh_mmcif_resources),
905
938
.resource = sh_mmcif_resources,
906
906
-
.archdata = {
907
907
-
.hwblk_id = HWBLK_MMC,
908
908
-
},
909
939
};
910
940
#endif
911
941
-12
arch/sh/boards/mach-kfr2r09/setup.c
reviewed
···
122
122
.dev = {
123
123
.platform_data = &kfr2r09_sh_keysc_info,
124
124
},
125
125
-
.archdata = {
126
126
-
.hwblk_id = HWBLK_KEYSC,
127
127
-
},
128
125
};
129
126
130
127
static const struct fb_videomode kfr2r09_lcdc_modes[] = {
···
188
191
.dev = {
189
192
.platform_data = &kfr2r09_sh_lcdc_info,
190
193
},
191
191
-
.archdata = {
192
192
-
.hwblk_id = HWBLK_LCDC,
193
193
-
},
194
194
};
195
195
196
196
static struct r8a66597_platdata kfr2r09_usb0_gadget_data = {
···
247
253
.resource = kfr2r09_ceu_resources,
248
254
.dev = {
249
255
.platform_data = &sh_mobile_ceu_info,
250
250
-
},
251
251
-
.archdata = {
252
252
-
.hwblk_id = HWBLK_CEU0,
253
256
},
254
257
};
255
258
···
367
376
.resource = kfr2r09_sh_sdhi0_resources,
368
377
.dev = {
369
378
.platform_data = &sh7724_sdhi0_data,
370
370
-
},
371
371
-
.archdata = {
372
372
-
.hwblk_id = HWBLK_SDHI0,
373
379
},
374
380
};
375
381
-12
arch/sh/boards/mach-migor/setup.c
reviewed
···
99
99
.dev = {
100
100
.platform_data = &sh_keysc_info,
101
101
},
102
102
-
.archdata = {
103
103
-
.hwblk_id = HWBLK_KEYSC,
104
104
-
},
105
102
};
106
103
107
104
static struct mtd_partition migor_nor_flash_partitions[] =
···
297
300
.dev = {
298
301
.platform_data = &sh_mobile_lcdc_info,
299
302
},
300
300
-
.archdata = {
301
301
-
.hwblk_id = HWBLK_LCDC,
302
302
-
},
303
303
};
304
304
305
305
static struct clk *camera_clk;
···
384
390
.dev = {
385
391
.platform_data = &sh_mobile_ceu_info,
386
392
},
387
387
-
.archdata = {
388
388
-
.hwblk_id = HWBLK_CEU,
389
389
-
},
390
393
};
391
394
392
395
static struct resource sdhi_cn9_resources[] = {
···
411
420
.resource = sdhi_cn9_resources,
412
421
.dev = {
413
422
.platform_data = &sh7724_sdhi_data,
414
414
-
},
415
415
-
.archdata = {
416
416
-
.hwblk_id = HWBLK_SDHI,
417
423
},
418
424
};
419
425
-3
arch/sh/boards/mach-se/7722/setup.c
reviewed
···
127
127
.dev = {
128
128
.platform_data = &sh_keysc_info,
129
129
},
130
130
-
.archdata = {
131
131
-
.hwblk_id = HWBLK_KEYSC,
132
132
-
},
133
130
};
134
131
135
132
static struct platform_device *se7722_devices[] __initdata = {
-30
arch/sh/boards/mach-se/7724/setup.c
reviewed
···
210
210
.dev = {
211
211
.platform_data = &lcdc_info,
212
212
},
213
213
-
.archdata = {
214
214
-
.hwblk_id = HWBLK_LCDC,
215
215
-
},
216
213
};
217
214
218
215
/* CEU0 */
···
240
243
.resource = ceu0_resources,
241
244
.dev = {
242
245
.platform_data = &sh_mobile_ceu0_info,
243
243
-
},
244
244
-
.archdata = {
245
245
-
.hwblk_id = HWBLK_CEU0,
246
246
},
247
247
};
248
248
···
272
278
.dev = {
273
279
.platform_data = &sh_mobile_ceu1_info,
274
280
},
275
275
-
.archdata = {
276
276
-
.hwblk_id = HWBLK_CEU1,
277
277
-
},
278
281
};
279
282
280
283
/* FSI */
···
300
309
.resource = fsi_resources,
301
310
.dev = {
302
311
.platform_data = &fsi_info,
303
303
-
},
304
304
-
.archdata = {
305
305
-
.hwblk_id = HWBLK_SPU, /* FSI needs SPU hwblk */
306
312
},
307
313
};
308
314
···
343
355
.dev = {
344
356
.platform_data = &keysc_info,
345
357
},
346
346
-
.archdata = {
347
347
-
.hwblk_id = HWBLK_KEYSC,
348
348
-
},
349
358
};
350
359
351
360
/* SH Eth */
···
371
386
},
372
387
.num_resources = ARRAY_SIZE(sh_eth_resources),
373
388
.resource = sh_eth_resources,
374
374
-
.archdata = {
375
375
-
.hwblk_id = HWBLK_ETHER,
376
376
-
},
377
389
};
378
390
379
391
static struct r8a66597_platdata sh7724_usb0_host_data = {
···
400
418
},
401
419
.num_resources = ARRAY_SIZE(sh7724_usb0_host_resources),
402
420
.resource = sh7724_usb0_host_resources,
403
403
-
.archdata = {
404
404
-
.hwblk_id = HWBLK_USB0,
405
405
-
},
406
421
};
407
422
408
423
static struct r8a66597_platdata sh7724_usb1_gadget_data = {
···
458
479
.dev = {
459
480
.platform_data = &sh7724_sdhi0_data,
460
481
},
461
461
-
.archdata = {
462
462
-
.hwblk_id = HWBLK_SDHI0,
463
463
-
},
464
482
};
465
483
466
484
static struct resource sdhi1_cn8_resources[] = {
···
486
510
.resource = sdhi1_cn8_resources,
487
511
.dev = {
488
512
.platform_data = &sh7724_sdhi1_data,
489
489
-
},
490
490
-
.archdata = {
491
491
-
.hwblk_id = HWBLK_SDHI1,
492
513
},
493
514
};
494
515
···
548
575
.resource = sh_vou_resources,
549
576
.dev = {
550
577
.platform_data = &sh_vou_pdata,
551
551
-
},
552
552
-
.archdata = {
553
553
-
.hwblk_id = HWBLK_VOU,
554
578
},
555
579
};
556
580
-1
arch/sh/include/asm/device.h
reviewed
···
15
15
void plat_early_device_setup(void);
16
16
17
17
struct pdev_archdata {
18
18
-
int hwblk_id;
19
18
};
-75
arch/sh/include/asm/hwblk.h
reviewed
···
1
1
-
#ifndef __ASM_SH_HWBLK_H
2
2
-
#define __ASM_SH_HWBLK_H
3
3
-
4
4
-
#include <asm/clock.h>
5
5
-
#include <asm/io.h>
6
6
-
7
7
-
#define HWBLK_CNT_USAGE 0
8
8
-
#define HWBLK_CNT_IDLE 1
9
9
-
#define HWBLK_CNT_DEVICES 2
10
10
-
#define HWBLK_CNT_NR 3
11
11
-
12
12
-
#define HWBLK_AREA_FLAG_PARENT (1 << 0) /* valid parent */
13
13
-
14
14
-
#define HWBLK_AREA(_flags, _parent) \
15
15
-
{ \
16
16
-
.flags = _flags, \
17
17
-
.parent = _parent, \
18
18
-
}
19
19
-
20
20
-
struct hwblk_area {
21
21
-
int cnt[HWBLK_CNT_NR];
22
22
-
unsigned char parent;
23
23
-
unsigned char flags;
24
24
-
};
25
25
-
26
26
-
#define HWBLK(_mstp, _bit, _area) \
27
27
-
{ \
28
28
-
.mstp = (void __iomem *)_mstp, \
29
29
-
.bit = _bit, \
30
30
-
.area = _area, \
31
31
-
}
32
32
-
33
33
-
struct hwblk {
34
34
-
void __iomem *mstp;
35
35
-
unsigned char bit;
36
36
-
unsigned char area;
37
37
-
int cnt[HWBLK_CNT_NR];
38
38
-
};
39
39
-
40
40
-
struct hwblk_info {
41
41
-
struct hwblk_area *areas;
42
42
-
int nr_areas;
43
43
-
struct hwblk *hwblks;
44
44
-
int nr_hwblks;
45
45
-
};
46
46
-
47
47
-
#if !defined(CONFIG_CPU_SUBTYPE_SH7722) && \
48
48
-
!defined(CONFIG_CPU_SUBTYPE_SH7723) && \
49
49
-
!defined(CONFIG_CPU_SUBTYPE_SH7724)
50
50
-
/* Should be defined by processor-specific code */
51
51
-
int arch_hwblk_init(void);
52
52
-
int arch_hwblk_sleep_mode(void);
53
53
-
54
54
-
int hwblk_register(struct hwblk_info *info);
55
55
-
int hwblk_init(void);
56
56
-
57
57
-
void hwblk_enable(struct hwblk_info *info, int hwblk);
58
58
-
void hwblk_disable(struct hwblk_info *info, int hwblk);
59
59
-
60
60
-
void hwblk_cnt_inc(struct hwblk_info *info, int hwblk, int cnt);
61
61
-
void hwblk_cnt_dec(struct hwblk_info *info, int hwblk, int cnt);
62
62
-
63
63
-
/* allow clocks to enable and disable hardware blocks */
64
64
-
#define SH_HWBLK_CLK(_hwblk, _parent, _flags) \
65
65
-
[_hwblk] = { \
66
66
-
.parent = _parent, \
67
67
-
.arch_flags = _hwblk, \
68
68
-
.flags = _flags, \
69
69
-
}
70
70
-
71
71
-
int sh_hwblk_clk_register(struct clk *clks, int nr);
72
72
-
#else
73
73
-
#define hwblk_init() 0
74
74
-
#endif
75
75
-
#endif /* __ASM_SH_HWBLK_H */
+5
-8
arch/sh/include/cpu-sh4/cpu/sh7722.h
reviewed
···
222
222
};
223
223
224
224
enum {
225
225
-
HWBLK_UNKNOWN = 0,
226
226
-
HWBLK_TLB, HWBLK_IC, HWBLK_OC, HWBLK_URAM, HWBLK_XYMEM,
227
227
-
HWBLK_INTC, HWBLK_DMAC, HWBLK_SHYWAY, HWBLK_HUDI,
228
228
-
HWBLK_UBC, HWBLK_TMU, HWBLK_CMT, HWBLK_RWDT, HWBLK_FLCTL,
229
229
-
HWBLK_SCIF0, HWBLK_SCIF1, HWBLK_SCIF2, HWBLK_SIO,
230
230
-
HWBLK_SIOF0, HWBLK_SIOF1, HWBLK_IIC, HWBLK_RTC,
231
231
-
HWBLK_TPU, HWBLK_IRDA, HWBLK_SDHI, HWBLK_SIM, HWBLK_KEYSC,
232
232
-
HWBLK_TSIF, HWBLK_USBF, HWBLK_2DG, HWBLK_SIU, HWBLK_VOU,
225
225
+
HWBLK_URAM, HWBLK_XYMEM,
226
226
+
HWBLK_TMU, HWBLK_CMT, HWBLK_RWDT, HWBLK_FLCTL,
227
227
+
HWBLK_SCIF0, HWBLK_SCIF1, HWBLK_SCIF2, HWBLK_IIC, HWBLK_RTC,
228
228
+
HWBLK_SDHI, HWBLK_KEYSC,
229
229
+
HWBLK_USBF, HWBLK_2DG, HWBLK_SIU, HWBLK_VOU,
233
230
HWBLK_JPU, HWBLK_BEU, HWBLK_CEU, HWBLK_VEU, HWBLK_VPU,
234
231
HWBLK_LCDC,
235
232
HWBLK_NR,
+1
-2
arch/sh/include/cpu-sh4/cpu/sh7723.h
reviewed
···
266
266
};
267
267
268
268
enum {
269
269
-
HWBLK_UNKNOWN = 0,
270
269
HWBLK_TLB, HWBLK_IC, HWBLK_OC, HWBLK_L2C, HWBLK_ILMEM, HWBLK_FPU,
271
270
HWBLK_INTC, HWBLK_DMAC0, HWBLK_SHYWAY,
272
272
-
HWBLK_HUDI, HWBLK_DBG, HWBLK_UBC, HWBLK_SUBC,
271
271
+
HWBLK_HUDI, HWBLK_UBC,
273
272
HWBLK_TMU0, HWBLK_CMT, HWBLK_RWDT, HWBLK_DMAC1, HWBLK_TMU1,
274
273
HWBLK_FLCTL,
275
274
HWBLK_SCIF0, HWBLK_SCIF1, HWBLK_SCIF2,
+1
-2
arch/sh/include/cpu-sh4/cpu/sh7724.h
reviewed
···
268
268
};
269
269
270
270
enum {
271
271
-
HWBLK_UNKNOWN = 0,
272
271
HWBLK_TLB, HWBLK_IC, HWBLK_OC, HWBLK_RSMEM, HWBLK_ILMEM, HWBLK_L2C,
273
272
HWBLK_FPU, HWBLK_INTC, HWBLK_DMAC0, HWBLK_SHYWAY,
274
274
-
HWBLK_HUDI, HWBLK_DBG, HWBLK_UBC,
273
273
+
HWBLK_HUDI, HWBLK_UBC,
275
274
HWBLK_TMU0, HWBLK_CMT, HWBLK_RWDT, HWBLK_DMAC1, HWBLK_TMU1,
276
275
HWBLK_SCIF0, HWBLK_SCIF1, HWBLK_SCIF2, HWBLK_SCIF3,
277
276
HWBLK_SCIF4, HWBLK_SCIF5, HWBLK_MSIOF0, HWBLK_MSIOF1,
-3
arch/sh/kernel/cpu/Makefile
reviewed
···
19
19
obj-$(CONFIG_SH_CLK_CPG_LEGACY) += clock-cpg.o
20
20
21
21
obj-y += irq/ init.o clock.o fpu.o proc.o
22
22
-
ifneq ($(CONFIG_CPU_SUBTYPE_SH7722)$(CONFIG_CPU_SUBTYPE_SH7723)$(CONFIG_CPU_SUBTYPE_SH7724),y)
23
23
-
obj-y += hwblk.o
24
24
-
endif
-159
arch/sh/kernel/cpu/hwblk.c
reviewed
···
1
1
-
#include <linux/clk.h>
2
2
-
#include <linux/compiler.h>
3
3
-
#include <linux/io.h>
4
4
-
#include <linux/spinlock.h>
5
5
-
#include <asm/suspend.h>
6
6
-
#include <asm/hwblk.h>
7
7
-
#include <asm/clock.h>
8
8
-
9
9
-
static DEFINE_SPINLOCK(hwblk_lock);
10
10
-
11
11
-
static void hwblk_area_mod_cnt(struct hwblk_info *info,
12
12
-
int area, int counter, int value, int goal)
13
13
-
{
14
14
-
struct hwblk_area *hap = info->areas + area;
15
15
-
16
16
-
hap->cnt[counter] += value;
17
17
-
18
18
-
if (hap->cnt[counter] != goal)
19
19
-
return;
20
20
-
21
21
-
if (hap->flags & HWBLK_AREA_FLAG_PARENT)
22
22
-
hwblk_area_mod_cnt(info, hap->parent, counter, value, goal);
23
23
-
}
24
24
-
25
25
-
26
26
-
static int __hwblk_mod_cnt(struct hwblk_info *info, int hwblk,
27
27
-
int counter, int value, int goal)
28
28
-
{
29
29
-
struct hwblk *hp = info->hwblks + hwblk;
30
30
-
31
31
-
hp->cnt[counter] += value;
32
32
-
if (hp->cnt[counter] == goal)
33
33
-
hwblk_area_mod_cnt(info, hp->area, counter, value, goal);
34
34
-
35
35
-
return hp->cnt[counter];
36
36
-
}
37
37
-
38
38
-
static void hwblk_mod_cnt(struct hwblk_info *info, int hwblk,
39
39
-
int counter, int value, int goal)
40
40
-
{
41
41
-
unsigned long flags;
42
42
-
43
43
-
spin_lock_irqsave(&hwblk_lock, flags);
44
44
-
__hwblk_mod_cnt(info, hwblk, counter, value, goal);
45
45
-
spin_unlock_irqrestore(&hwblk_lock, flags);
46
46
-
}
47
47
-
48
48
-
void hwblk_cnt_inc(struct hwblk_info *info, int hwblk, int counter)
49
49
-
{
50
50
-
hwblk_mod_cnt(info, hwblk, counter, 1, 1);
51
51
-
}
52
52
-
53
53
-
void hwblk_cnt_dec(struct hwblk_info *info, int hwblk, int counter)
54
54
-
{
55
55
-
hwblk_mod_cnt(info, hwblk, counter, -1, 0);
56
56
-
}
57
57
-
58
58
-
void hwblk_enable(struct hwblk_info *info, int hwblk)
59
59
-
{
60
60
-
struct hwblk *hp = info->hwblks + hwblk;
61
61
-
unsigned long tmp;
62
62
-
unsigned long flags;
63
63
-
int ret;
64
64
-
65
65
-
spin_lock_irqsave(&hwblk_lock, flags);
66
66
-
67
67
-
ret = __hwblk_mod_cnt(info, hwblk, HWBLK_CNT_USAGE, 1, 1);
68
68
-
if (ret == 1) {
69
69
-
tmp = __raw_readl(hp->mstp);
70
70
-
tmp &= ~(1 << hp->bit);
71
71
-
__raw_writel(tmp, hp->mstp);
72
72
-
}
73
73
-
74
74
-
spin_unlock_irqrestore(&hwblk_lock, flags);
75
75
-
}
76
76
-
77
77
-
void hwblk_disable(struct hwblk_info *info, int hwblk)
78
78
-
{
79
79
-
struct hwblk *hp = info->hwblks + hwblk;
80
80
-
unsigned long tmp;
81
81
-
unsigned long flags;
82
82
-
int ret;
83
83
-
84
84
-
spin_lock_irqsave(&hwblk_lock, flags);
85
85
-
86
86
-
ret = __hwblk_mod_cnt(info, hwblk, HWBLK_CNT_USAGE, -1, 0);
87
87
-
if (ret == 0) {
88
88
-
tmp = __raw_readl(hp->mstp);
89
89
-
tmp |= 1 << hp->bit;
90
90
-
__raw_writel(tmp, hp->mstp);
91
91
-
}
92
92
-
93
93
-
spin_unlock_irqrestore(&hwblk_lock, flags);
94
94
-
}
95
95
-
96
96
-
struct hwblk_info *hwblk_info;
97
97
-
98
98
-
int __init hwblk_register(struct hwblk_info *info)
99
99
-
{
100
100
-
hwblk_info = info;
101
101
-
return 0;
102
102
-
}
103
103
-
104
104
-
int __init __weak arch_hwblk_init(void)
105
105
-
{
106
106
-
return 0;
107
107
-
}
108
108
-
109
109
-
int __weak arch_hwblk_sleep_mode(void)
110
110
-
{
111
111
-
return SUSP_SH_SLEEP;
112
112
-
}
113
113
-
114
114
-
int __init hwblk_init(void)
115
115
-
{
116
116
-
return arch_hwblk_init();
117
117
-
}
118
118
-
119
119
-
/* allow clocks to enable and disable hardware blocks */
120
120
-
static int sh_hwblk_clk_enable(struct clk *clk)
121
121
-
{
122
122
-
if (!hwblk_info)
123
123
-
return -ENOENT;
124
124
-
125
125
-
hwblk_enable(hwblk_info, clk->arch_flags);
126
126
-
return 0;
127
127
-
}
128
128
-
129
129
-
static void sh_hwblk_clk_disable(struct clk *clk)
130
130
-
{
131
131
-
if (hwblk_info)
132
132
-
hwblk_disable(hwblk_info, clk->arch_flags);
133
133
-
}
134
134
-
135
135
-
static struct clk_ops sh_hwblk_clk_ops = {
136
136
-
.enable = sh_hwblk_clk_enable,
137
137
-
.disable = sh_hwblk_clk_disable,
138
138
-
.recalc = followparent_recalc,
139
139
-
};
140
140
-
141
141
-
int __init sh_hwblk_clk_register(struct clk *clks, int nr)
142
142
-
{
143
143
-
struct clk *clkp;
144
144
-
int ret = 0;
145
145
-
int k;
146
146
-
147
147
-
for (k = 0; !ret && (k < nr); k++) {
148
148
-
clkp = clks + k;
149
149
-
150
150
-
/* skip over clocks using hwblk 0 (HWBLK_UNKNOWN) */
151
151
-
if (!clkp->arch_flags)
152
152
-
continue;
153
153
-
154
154
-
clkp->ops = &sh_hwblk_clk_ops;
155
155
-
ret |= clk_register(clkp);
156
156
-
}
157
157
-
158
158
-
return ret;
159
159
-
}
-36
arch/sh/kernel/cpu/sh4a/setup-sh7722.c
reviewed
···
173
173
.dev = {
174
174
.platform_data = &dma_platform_data,
175
175
},
176
176
-
.archdata = {
177
177
-
.hwblk_id = HWBLK_DMAC,
178
178
-
},
179
176
};
180
177
181
178
/* Serial */
···
261
264
.id = -1,
262
265
.num_resources = ARRAY_SIZE(rtc_resources),
263
266
.resource = rtc_resources,
264
264
-
.archdata = {
265
265
-
.hwblk_id = HWBLK_RTC,
266
266
-
},
267
267
};
268
268
269
269
static struct m66592_platdata usbf_platdata = {
···
291
297
},
292
298
.num_resources = ARRAY_SIZE(usbf_resources),
293
299
.resource = usbf_resources,
294
294
-
.archdata = {
295
295
-
.hwblk_id = HWBLK_USBF,
296
296
-
},
297
300
};
298
301
299
302
static struct resource iic_resources[] = {
···
312
321
.id = 0, /* "i2c0" clock */
313
322
.num_resources = ARRAY_SIZE(iic_resources),
314
323
.resource = iic_resources,
315
315
-
.archdata = {
316
316
-
.hwblk_id = HWBLK_IIC,
317
317
-
},
318
324
};
319
325
320
326
static struct uio_info vpu_platform_data = {
···
340
352
},
341
353
.resource = vpu_resources,
342
354
.num_resources = ARRAY_SIZE(vpu_resources),
343
343
-
.archdata = {
344
344
-
.hwblk_id = HWBLK_VPU,
345
345
-
},
346
355
};
347
356
348
357
static struct uio_info veu_platform_data = {
···
368
383
},
369
384
.resource = veu_resources,
370
385
.num_resources = ARRAY_SIZE(veu_resources),
371
371
-
.archdata = {
372
372
-
.hwblk_id = HWBLK_VEU,
373
373
-
},
374
386
};
375
387
376
388
static struct uio_info jpu_platform_data = {
···
396
414
},
397
415
.resource = jpu_resources,
398
416
.num_resources = ARRAY_SIZE(jpu_resources),
399
399
-
.archdata = {
400
400
-
.hwblk_id = HWBLK_JPU,
401
401
-
},
402
417
};
403
418
404
419
static struct sh_timer_config cmt_platform_data = {
···
425
446
},
426
447
.resource = cmt_resources,
427
448
.num_resources = ARRAY_SIZE(cmt_resources),
428
428
-
.archdata = {
429
429
-
.hwblk_id = HWBLK_CMT,
430
430
-
},
431
449
};
432
450
433
451
static struct sh_timer_config tmu0_platform_data = {
···
453
477
},
454
478
.resource = tmu0_resources,
455
479
.num_resources = ARRAY_SIZE(tmu0_resources),
456
456
-
.archdata = {
457
457
-
.hwblk_id = HWBLK_TMU,
458
458
-
},
459
480
};
460
481
461
482
static struct sh_timer_config tmu1_platform_data = {
···
481
508
},
482
509
.resource = tmu1_resources,
483
510
.num_resources = ARRAY_SIZE(tmu1_resources),
484
484
-
.archdata = {
485
485
-
.hwblk_id = HWBLK_TMU,
486
486
-
},
487
511
};
488
512
489
513
static struct sh_timer_config tmu2_platform_data = {
···
508
538
},
509
539
.resource = tmu2_resources,
510
540
.num_resources = ARRAY_SIZE(tmu2_resources),
511
511
-
.archdata = {
512
512
-
.hwblk_id = HWBLK_TMU,
513
513
-
},
514
541
};
515
542
516
543
static struct siu_platform siu_platform_data = {
···
538
571
},
539
572
.resource = siu_resources,
540
573
.num_resources = ARRAY_SIZE(siu_resources),
541
541
-
.archdata = {
542
542
-
.hwblk_id = HWBLK_SIU,
543
543
-
},
544
574
};
545
575
546
576
static struct platform_device *sh7722_devices[] __initdata = {
-39
arch/sh/kernel/cpu/sh4a/setup-sh7723.c
reviewed
···
158
158
},
159
159
.resource = vpu_resources,
160
160
.num_resources = ARRAY_SIZE(vpu_resources),
161
161
-
.archdata = {
162
162
-
.hwblk_id = HWBLK_VPU,
163
163
-
},
164
161
};
165
162
166
163
static struct uio_info veu0_platform_data = {
···
186
189
},
187
190
.resource = veu0_resources,
188
191
.num_resources = ARRAY_SIZE(veu0_resources),
189
189
-
.archdata = {
190
190
-
.hwblk_id = HWBLK_VEU2H0,
191
191
-
},
192
192
};
193
193
194
194
static struct uio_info veu1_platform_data = {
···
214
220
},
215
221
.resource = veu1_resources,
216
222
.num_resources = ARRAY_SIZE(veu1_resources),
217
217
-
.archdata = {
218
218
-
.hwblk_id = HWBLK_VEU2H1,
219
219
-
},
220
223
};
221
224
222
225
static struct sh_timer_config cmt_platform_data = {
···
243
252
},
244
253
.resource = cmt_resources,
245
254
.num_resources = ARRAY_SIZE(cmt_resources),
246
246
-
.archdata = {
247
247
-
.hwblk_id = HWBLK_CMT,
248
248
-
},
249
255
};
250
256
251
257
static struct sh_timer_config tmu0_platform_data = {
···
271
283
},
272
284
.resource = tmu0_resources,
273
285
.num_resources = ARRAY_SIZE(tmu0_resources),
274
274
-
.archdata = {
275
275
-
.hwblk_id = HWBLK_TMU0,
276
276
-
},
277
286
};
278
287
279
288
static struct sh_timer_config tmu1_platform_data = {
···
299
314
},
300
315
.resource = tmu1_resources,
301
316
.num_resources = ARRAY_SIZE(tmu1_resources),
302
302
-
.archdata = {
303
303
-
.hwblk_id = HWBLK_TMU0,
304
304
-
},
305
317
};
306
318
307
319
static struct sh_timer_config tmu2_platform_data = {
···
326
344
},
327
345
.resource = tmu2_resources,
328
346
.num_resources = ARRAY_SIZE(tmu2_resources),
329
329
-
.archdata = {
330
330
-
.hwblk_id = HWBLK_TMU0,
331
331
-
},
332
347
};
333
348
334
349
static struct sh_timer_config tmu3_platform_data = {
···
353
374
},
354
375
.resource = tmu3_resources,
355
376
.num_resources = ARRAY_SIZE(tmu3_resources),
356
356
-
.archdata = {
357
357
-
.hwblk_id = HWBLK_TMU1,
358
358
-
},
359
377
};
360
378
361
379
static struct sh_timer_config tmu4_platform_data = {
···
380
404
},
381
405
.resource = tmu4_resources,
382
406
.num_resources = ARRAY_SIZE(tmu4_resources),
383
383
-
.archdata = {
384
384
-
.hwblk_id = HWBLK_TMU1,
385
385
-
},
386
407
};
387
408
388
409
static struct sh_timer_config tmu5_platform_data = {
···
407
434
},
408
435
.resource = tmu5_resources,
409
436
.num_resources = ARRAY_SIZE(tmu5_resources),
410
410
-
.archdata = {
411
411
-
.hwblk_id = HWBLK_TMU1,
412
412
-
},
413
437
};
414
438
415
439
static struct resource rtc_resources[] = {
···
437
467
.id = -1,
438
468
.num_resources = ARRAY_SIZE(rtc_resources),
439
469
.resource = rtc_resources,
440
440
-
.archdata = {
441
441
-
.hwblk_id = HWBLK_RTC,
442
442
-
},
443
470
};
444
471
445
472
static struct r8a66597_platdata r8a66597_data = {
···
466
499
},
467
500
.num_resources = ARRAY_SIZE(sh7723_usb_host_resources),
468
501
.resource = sh7723_usb_host_resources,
469
469
-
.archdata = {
470
470
-
.hwblk_id = HWBLK_USB,
471
471
-
},
472
502
};
473
503
474
504
static struct resource iic_resources[] = {
···
487
523
.id = 0, /* "i2c0" clock */
488
524
.num_resources = ARRAY_SIZE(iic_resources),
489
525
.resource = iic_resources,
490
490
-
.archdata = {
491
491
-
.hwblk_id = HWBLK_IIC,
492
492
-
},
493
526
};
494
527
495
528
static struct platform_device *sh7723_devices[] __initdata = {
-60
arch/sh/kernel/cpu/sh4a/setup-sh7724.c
reviewed
···
275
275
.dev = {
276
276
.platform_data = &dma_platform_data,
277
277
},
278
278
-
.archdata = {
279
279
-
.hwblk_id = HWBLK_DMAC0,
280
280
-
},
281
278
};
282
279
283
280
static struct platform_device dma1_device = {
···
284
287
.num_resources = ARRAY_SIZE(sh7724_dmae1_resources),
285
288
.dev = {
286
289
.platform_data = &dma_platform_data,
287
287
-
},
288
288
-
.archdata = {
289
289
-
.hwblk_id = HWBLK_DMAC1,
290
290
},
291
291
};
292
292
···
428
434
.id = -1,
429
435
.num_resources = ARRAY_SIZE(rtc_resources),
430
436
.resource = rtc_resources,
431
431
-
.archdata = {
432
432
-
.hwblk_id = HWBLK_RTC,
433
433
-
},
434
437
};
435
438
436
439
/* I2C0 */
···
450
459
.id = 0, /* "i2c0" clock */
451
460
.num_resources = ARRAY_SIZE(iic0_resources),
452
461
.resource = iic0_resources,
453
453
-
.archdata = {
454
454
-
.hwblk_id = HWBLK_IIC0,
455
455
-
},
456
462
};
457
463
458
464
/* I2C1 */
···
472
484
.id = 1, /* "i2c1" clock */
473
485
.num_resources = ARRAY_SIZE(iic1_resources),
474
486
.resource = iic1_resources,
475
475
-
.archdata = {
476
476
-
.hwblk_id = HWBLK_IIC1,
477
477
-
},
478
487
};
479
488
480
489
/* VPU */
···
501
516
},
502
517
.resource = vpu_resources,
503
518
.num_resources = ARRAY_SIZE(vpu_resources),
504
504
-
.archdata = {
505
505
-
.hwblk_id = HWBLK_VPU,
506
506
-
},
507
519
};
508
520
509
521
/* VEU0 */
···
530
548
},
531
549
.resource = veu0_resources,
532
550
.num_resources = ARRAY_SIZE(veu0_resources),
533
533
-
.archdata = {
534
534
-
.hwblk_id = HWBLK_VEU0,
535
535
-
},
536
551
};
537
552
538
553
/* VEU1 */
···
559
580
},
560
581
.resource = veu1_resources,
561
582
.num_resources = ARRAY_SIZE(veu1_resources),
562
562
-
.archdata = {
563
563
-
.hwblk_id = HWBLK_VEU1,
564
564
-
},
565
583
};
566
584
567
585
/* BEU0 */
···
588
612
},
589
613
.resource = beu0_resources,
590
614
.num_resources = ARRAY_SIZE(beu0_resources),
591
591
-
.archdata = {
592
592
-
.hwblk_id = HWBLK_BEU0,
593
593
-
},
594
615
};
595
616
596
617
/* BEU1 */
···
617
644
},
618
645
.resource = beu1_resources,
619
646
.num_resources = ARRAY_SIZE(beu1_resources),
620
620
-
.archdata = {
621
621
-
.hwblk_id = HWBLK_BEU1,
622
622
-
},
623
647
};
624
648
625
649
static struct sh_timer_config cmt_platform_data = {
···
646
676
},
647
677
.resource = cmt_resources,
648
678
.num_resources = ARRAY_SIZE(cmt_resources),
649
649
-
.archdata = {
650
650
-
.hwblk_id = HWBLK_CMT,
651
651
-
},
652
679
};
653
680
654
681
static struct sh_timer_config tmu0_platform_data = {
···
674
707
},
675
708
.resource = tmu0_resources,
676
709
.num_resources = ARRAY_SIZE(tmu0_resources),
677
677
-
.archdata = {
678
678
-
.hwblk_id = HWBLK_TMU0,
679
679
-
},
680
710
};
681
711
682
712
static struct sh_timer_config tmu1_platform_data = {
···
702
738
},
703
739
.resource = tmu1_resources,
704
740
.num_resources = ARRAY_SIZE(tmu1_resources),
705
705
-
.archdata = {
706
706
-
.hwblk_id = HWBLK_TMU0,
707
707
-
},
708
741
};
709
742
710
743
static struct sh_timer_config tmu2_platform_data = {
···
729
768
},
730
769
.resource = tmu2_resources,
731
770
.num_resources = ARRAY_SIZE(tmu2_resources),
732
732
-
.archdata = {
733
733
-
.hwblk_id = HWBLK_TMU0,
734
734
-
},
735
771
};
736
772
737
773
···
757
799
},
758
800
.resource = tmu3_resources,
759
801
.num_resources = ARRAY_SIZE(tmu3_resources),
760
760
-
.archdata = {
761
761
-
.hwblk_id = HWBLK_TMU1,
762
762
-
},
763
802
};
764
803
765
804
static struct sh_timer_config tmu4_platform_data = {
···
784
829
},
785
830
.resource = tmu4_resources,
786
831
.num_resources = ARRAY_SIZE(tmu4_resources),
787
787
-
.archdata = {
788
788
-
.hwblk_id = HWBLK_TMU1,
789
789
-
},
790
832
};
791
833
792
834
static struct sh_timer_config tmu5_platform_data = {
···
811
859
},
812
860
.resource = tmu5_resources,
813
861
.num_resources = ARRAY_SIZE(tmu5_resources),
814
814
-
.archdata = {
815
815
-
.hwblk_id = HWBLK_TMU1,
816
816
-
},
817
862
};
818
863
819
864
/* JPU */
···
840
891
},
841
892
.resource = jpu_resources,
842
893
.num_resources = ARRAY_SIZE(jpu_resources),
843
843
-
.archdata = {
844
844
-
.hwblk_id = HWBLK_JPU,
845
845
-
},
846
894
};
847
895
848
896
/* SPU2DSP0 */
···
869
923
},
870
924
.resource = spu0_resources,
871
925
.num_resources = ARRAY_SIZE(spu0_resources),
872
872
-
.archdata = {
873
873
-
.hwblk_id = HWBLK_SPU,
874
874
-
},
875
926
};
876
927
877
928
/* SPU2DSP1 */
···
898
955
},
899
956
.resource = spu1_resources,
900
957
.num_resources = ARRAY_SIZE(spu1_resources),
901
901
-
.archdata = {
902
902
-
.hwblk_id = HWBLK_SPU,
903
903
-
},
904
958
};
905
959
906
960
static struct platform_device *sh7724_devices[] __initdata = {
+1
-2
arch/sh/kernel/cpu/shmobile/cpuidle.c
reviewed
···
17
17
#include <linux/export.h>
18
18
#include <asm/suspend.h>
19
19
#include <asm/uaccess.h>
20
20
-
#include <asm/hwblk.h>
21
20
22
21
static unsigned long cpuidle_mode[] = {
23
22
SUSP_SH_SLEEP, /* regular sleep mode */
···
28
29
struct cpuidle_driver *drv,
29
30
int index)
30
31
{
31
31
-
unsigned long allowed_mode = arch_hwblk_sleep_mode();
32
32
+
unsigned long allowed_mode = SUSP_SH_SLEEP;
32
33
ktime_t before, after;
33
34
int requested_state = index;
34
35
int allowed_state;
-2
arch/sh/kernel/time.c
reviewed
···
21
21
#include <linux/smp.h>
22
22
#include <linux/rtc.h>
23
23
#include <asm/clock.h>
24
24
-
#include <asm/hwblk.h>
25
24
#include <asm/rtc.h>
26
25
27
26
/* Dummy RTC ops */
···
109
110
if (board_time_init)
110
111
board_time_init();
111
112
112
112
-
hwblk_init();
113
113
clk_init();
114
114
115
115
late_time_init = sh_late_time_init;