aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/include
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2012-01-11 22:57:41 -0500
committerPaul Mundt <lethal@linux-sh.org>2012-01-11 22:57:41 -0500
commit9d14070f656addddce3d63fd483de46930b51850 (patch)
treea8767c2547dd2b6f49974503a5169d8c08de00e9 /arch/sh/include
parent9f06cf38eca57e279b4c78e465e19f10c2f78174 (diff)
parenta319add1e24c43d285b781332cfa532405466650 (diff)
Merge branch 'sh/hwblk' into sh-latest
Diffstat (limited to 'arch/sh/include')
-rw-r--r--arch/sh/include/asm/device.h1
-rw-r--r--arch/sh/include/asm/hwblk.h75
-rw-r--r--arch/sh/include/cpu-sh4/cpu/sh7722.h13
-rw-r--r--arch/sh/include/cpu-sh4/cpu/sh7723.h3
-rw-r--r--arch/sh/include/cpu-sh4/cpu/sh7724.h3
5 files changed, 7 insertions, 88 deletions
diff --git a/arch/sh/include/asm/device.h b/arch/sh/include/asm/device.h
index 783ecdc64e25..a1c9c0daec10 100644
--- a/arch/sh/include/asm/device.h
+++ b/arch/sh/include/asm/device.h
@@ -15,5 +15,4 @@ int platform_resource_setup_memory(struct platform_device *pdev,
15void plat_early_device_setup(void); 15void plat_early_device_setup(void);
16 16
17struct pdev_archdata { 17struct pdev_archdata {
18 int hwblk_id;
19}; 18};
diff --git a/arch/sh/include/asm/hwblk.h b/arch/sh/include/asm/hwblk.h
deleted file mode 100644
index e29461bbe84d..000000000000
--- a/arch/sh/include/asm/hwblk.h
+++ /dev/null
@@ -1,75 +0,0 @@
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_CNT_USAGE 0
8#define HWBLK_CNT_IDLE 1
9#define HWBLK_CNT_DEVICES 2
10#define HWBLK_CNT_NR 3
11
12#define HWBLK_AREA_FLAG_PARENT (1 << 0) /* valid parent */
13
14#define HWBLK_AREA(_flags, _parent) \
15{ \
16 .flags = _flags, \
17 .parent = _parent, \
18}
19
20struct hwblk_area {
21 int cnt[HWBLK_CNT_NR];
22 unsigned char parent;
23 unsigned char flags;
24};
25
26#define HWBLK(_mstp, _bit, _area) \
27{ \
28 .mstp = (void __iomem *)_mstp, \
29 .bit = _bit, \
30 .area = _area, \
31}
32
33struct hwblk {
34 void __iomem *mstp;
35 unsigned char bit;
36 unsigned char area;
37 int cnt[HWBLK_CNT_NR];
38};
39
40struct hwblk_info {
41 struct hwblk_area *areas;
42 int nr_areas;
43 struct hwblk *hwblks;
44 int nr_hwblks;
45};
46
47#if !defined(CONFIG_CPU_SUBTYPE_SH7722) && \
48 !defined(CONFIG_CPU_SUBTYPE_SH7723) && \
49 !defined(CONFIG_CPU_SUBTYPE_SH7724)
50/* Should be defined by processor-specific code */
51int arch_hwblk_init(void);
52int arch_hwblk_sleep_mode(void);
53
54int hwblk_register(struct hwblk_info *info);
55int hwblk_init(void);
56
57void hwblk_enable(struct hwblk_info *info, int hwblk);
58void hwblk_disable(struct hwblk_info *info, int hwblk);
59
60void hwblk_cnt_inc(struct hwblk_info *info, int hwblk, int cnt);
61void hwblk_cnt_dec(struct hwblk_info *info, int hwblk, int cnt);
62
63/* allow clocks to enable and disable hardware blocks */
64#define SH_HWBLK_CLK(_hwblk, _parent, _flags) \
65[_hwblk] = { \
66 .parent = _parent, \
67 .arch_flags = _hwblk, \
68 .flags = _flags, \
69}
70
71int sh_hwblk_clk_register(struct clk *clks, int nr);
72#else
73#define hwblk_init() 0
74#endif
75#endif /* __ASM_SH_HWBLK_H */
diff --git a/arch/sh/include/cpu-sh4/cpu/sh7722.h b/arch/sh/include/cpu-sh4/cpu/sh7722.h
index bd0622788d64..3bb74e534d0f 100644
--- a/arch/sh/include/cpu-sh4/cpu/sh7722.h
+++ b/arch/sh/include/cpu-sh4/cpu/sh7722.h
@@ -222,14 +222,11 @@ enum {
222}; 222};
223 223
224enum { 224enum {
225 HWBLK_UNKNOWN = 0, 225 HWBLK_URAM, HWBLK_XYMEM,
226 HWBLK_TLB, HWBLK_IC, HWBLK_OC, HWBLK_URAM, HWBLK_XYMEM, 226 HWBLK_TMU, HWBLK_CMT, HWBLK_RWDT, HWBLK_FLCTL,
227 HWBLK_INTC, HWBLK_DMAC, HWBLK_SHYWAY, HWBLK_HUDI, 227 HWBLK_SCIF0, HWBLK_SCIF1, HWBLK_SCIF2, HWBLK_IIC, HWBLK_RTC,
228 HWBLK_UBC, HWBLK_TMU, HWBLK_CMT, HWBLK_RWDT, HWBLK_FLCTL, 228 HWBLK_SDHI, HWBLK_KEYSC,
229 HWBLK_SCIF0, HWBLK_SCIF1, HWBLK_SCIF2, HWBLK_SIO, 229 HWBLK_USBF, HWBLK_2DG, HWBLK_SIU, HWBLK_VOU,
230 HWBLK_SIOF0, HWBLK_SIOF1, HWBLK_IIC, HWBLK_RTC,
231 HWBLK_TPU, HWBLK_IRDA, HWBLK_SDHI, HWBLK_SIM, HWBLK_KEYSC,
232 HWBLK_TSIF, HWBLK_USBF, HWBLK_2DG, HWBLK_SIU, HWBLK_VOU,
233 HWBLK_JPU, HWBLK_BEU, HWBLK_CEU, HWBLK_VEU, HWBLK_VPU, 230 HWBLK_JPU, HWBLK_BEU, HWBLK_CEU, HWBLK_VEU, HWBLK_VPU,
234 HWBLK_LCDC, 231 HWBLK_LCDC,
235 HWBLK_NR, 232 HWBLK_NR,
diff --git a/arch/sh/include/cpu-sh4/cpu/sh7723.h b/arch/sh/include/cpu-sh4/cpu/sh7723.h
index 9b36fae72324..6fae50cb1e94 100644
--- a/arch/sh/include/cpu-sh4/cpu/sh7723.h
+++ b/arch/sh/include/cpu-sh4/cpu/sh7723.h
@@ -266,10 +266,9 @@ enum {
266}; 266};
267 267
268enum { 268enum {
269 HWBLK_UNKNOWN = 0,
270 HWBLK_TLB, HWBLK_IC, HWBLK_OC, HWBLK_L2C, HWBLK_ILMEM, HWBLK_FPU, 269 HWBLK_TLB, HWBLK_IC, HWBLK_OC, HWBLK_L2C, HWBLK_ILMEM, HWBLK_FPU,
271 HWBLK_INTC, HWBLK_DMAC0, HWBLK_SHYWAY, 270 HWBLK_INTC, HWBLK_DMAC0, HWBLK_SHYWAY,
272 HWBLK_HUDI, HWBLK_DBG, HWBLK_UBC, HWBLK_SUBC, 271 HWBLK_HUDI, HWBLK_UBC,
273 HWBLK_TMU0, HWBLK_CMT, HWBLK_RWDT, HWBLK_DMAC1, HWBLK_TMU1, 272 HWBLK_TMU0, HWBLK_CMT, HWBLK_RWDT, HWBLK_DMAC1, HWBLK_TMU1,
274 HWBLK_FLCTL, 273 HWBLK_FLCTL,
275 HWBLK_SCIF0, HWBLK_SCIF1, HWBLK_SCIF2, 274 HWBLK_SCIF0, HWBLK_SCIF1, HWBLK_SCIF2,
diff --git a/arch/sh/include/cpu-sh4/cpu/sh7724.h b/arch/sh/include/cpu-sh4/cpu/sh7724.h
index 36ce466cbf07..38859f96d4e5 100644
--- a/arch/sh/include/cpu-sh4/cpu/sh7724.h
+++ b/arch/sh/include/cpu-sh4/cpu/sh7724.h
@@ -268,10 +268,9 @@ enum {
268}; 268};
269 269
270enum { 270enum {
271 HWBLK_UNKNOWN = 0,
272 HWBLK_TLB, HWBLK_IC, HWBLK_OC, HWBLK_RSMEM, HWBLK_ILMEM, HWBLK_L2C, 271 HWBLK_TLB, HWBLK_IC, HWBLK_OC, HWBLK_RSMEM, HWBLK_ILMEM, HWBLK_L2C,
273 HWBLK_FPU, HWBLK_INTC, HWBLK_DMAC0, HWBLK_SHYWAY, 272 HWBLK_FPU, HWBLK_INTC, HWBLK_DMAC0, HWBLK_SHYWAY,
274 HWBLK_HUDI, HWBLK_DBG, HWBLK_UBC, 273 HWBLK_HUDI, HWBLK_UBC,
275 HWBLK_TMU0, HWBLK_CMT, HWBLK_RWDT, HWBLK_DMAC1, HWBLK_TMU1, 274 HWBLK_TMU0, HWBLK_CMT, HWBLK_RWDT, HWBLK_DMAC1, HWBLK_TMU1,
276 HWBLK_SCIF0, HWBLK_SCIF1, HWBLK_SCIF2, HWBLK_SCIF3, 275 HWBLK_SCIF0, HWBLK_SCIF1, HWBLK_SCIF2, HWBLK_SCIF3,
277 HWBLK_SCIF4, HWBLK_SCIF5, HWBLK_MSIOF0, HWBLK_MSIOF1, 276 HWBLK_SCIF4, HWBLK_SCIF5, HWBLK_MSIOF0, HWBLK_MSIOF1,