aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/include/asm/hwblk.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sh/include/asm/hwblk.h')
-rw-r--r--arch/sh/include/asm/hwblk.h61
1 files changed, 61 insertions, 0 deletions
diff --git a/arch/sh/include/asm/hwblk.h b/arch/sh/include/asm/hwblk.h
new file mode 100644
index 00000000000..51a46f49663
--- /dev/null
+++ b/arch/sh/include/asm/hwblk.h
@@ -0,0 +1,61 @@
1#ifndef __ASM_SH_HWBLK_H
2#define __ASM_SH_HWBLK_H
3
4#include <asm/clock.h>
5#include <asm/io.h>
6
7#define HWBLK_AREA_FLAG_PARENT (1 << 0) /* valid parent */
8
9#define HWBLK_AREA(_flags, _parent) \
10{ \
11 .flags = _flags, \
12 .parent = _parent, \
13}
14
15struct hwblk_area {
16 unsigned long cnt;
17 unsigned char parent;
18 unsigned char flags;
19};
20
21#define HWBLK(_mstp, _bit, _area) \
22{ \
23 .mstp = (void __iomem *)_mstp, \
24 .bit = _bit, \
25 .area = _area, \
26}
27
28struct hwblk {
29 void __iomem *mstp;
30 unsigned char bit;
31 unsigned char area;
32 unsigned long cnt;
33};
34
35struct hwblk_info {
36 struct hwblk_area *areas;
37 int nr_areas;
38 struct hwblk *hwblks;
39 int nr_hwblks;
40};
41
42/* Should be defined by processor-specific code */
43int arch_hwblk_init(void);
44int arch_hwblk_sleep_mode(void);
45
46int hwblk_register(struct hwblk_info *info);
47int hwblk_init(void);
48
49/* allow clocks to enable and disable hardware blocks */
50#define SH_HWBLK_CLK(_name, _id, _parent, _hwblk, _flags) \
51{ \
52 .name = _name, \
53 .id = _id, \
54 .parent = _parent, \
55 .arch_flags = _hwblk, \
56 .flags = _flags, \
57}
58
59int sh_hwblk_clk_register(struct clk *clks, int nr);
60
61#endif /* __ASM_SH_HWBLK_H */