diff options
author | Paul Mundt <lethal@linux-sh.org> | 2009-07-06 20:19:28 +0900 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2009-07-06 20:19:28 +0900 |
commit | 7119888df1fd115573616ae43747b2e823b0663e (patch) | |
tree | cfe0c769b4e7bf8323d1958c46590d6200516a29 /arch/sh/include/asm/hwblk.h | |
parent | c652d780c9cf7f860141de232b37160fe013feca (diff) | |
parent | 0f60bb25b4036d30fd795709be09626c58c52464 (diff) |
Merge branches 'sh/ftrace' and 'sh/cachetlb'
Diffstat (limited to 'arch/sh/include/asm/hwblk.h')
-rw-r--r-- | arch/sh/include/asm/hwblk.h | 61 |
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 @@ +#ifndef __ASM_SH_HWBLK_H +#define __ASM_SH_HWBLK_H + +#include <asm/clock.h> +#include <asm/io.h> + +#define HWBLK_AREA_FLAG_PARENT (1 << 0) /* valid parent */ + +#define HWBLK_AREA(_flags, _parent) \ +{ \ + .flags = _flags, \ + .parent = _parent, \ +} + +struct hwblk_area { + unsigned long cnt; + unsigned char parent; + unsigned char flags; +}; + +#define HWBLK(_mstp, _bit, _area) \ +{ \ + .mstp = (void __iomem *)_mstp, \ + .bit = _bit, \ + .area = _area, \ +} + +struct hwblk { + void __iomem *mstp; + unsigned char bit; + unsigned char area; + unsigned long cnt; +}; + +struct hwblk_info { + struct hwblk_area *areas; + int nr_areas; + struct hwblk *hwblks; + int nr_hwblks; +}; + +/* Should be defined by processor-specific code */ +int arch_hwblk_init(void); +int arch_hwblk_sleep_mode(void); + +int hwblk_register(struct hwblk_info *info); +int hwblk_init(void); + +/* allow clocks to enable and disable hardware blocks */ +#define SH_HWBLK_CLK(_name, _id, _parent, _hwblk, _flags) \ +{ \ + .name = _name, \ + .id = _id, \ + .parent = _parent, \ + .arch_flags = _hwblk, \ + .flags = _flags, \ +} + +int sh_hwblk_clk_register(struct clk *clks, int nr); + +#endif /* __ASM_SH_HWBLK_H */ |