From: Magnus Damm Date: Tue, 25 Nov 2008 13:01:39 +0000 Subject: [PATCH 7/8] sh: timer rewrite V2, sh7343 support Message-Id: <20081125130139.8590.21422.sendpatchset@rx1.opensource.se> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-sh@vger.kernel.org From: Magnus Damm Add CMT and TMU devices and use the new timer code V2 on sh7343. Signed-off-by: Magnus Damm --- arch/sh/Kconfig | 1 arch/sh/kernel/cpu/sh4a/setup-sh7343.c | 45 ++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) --- 0010/arch/sh/Kconfig +++ work/arch/sh/Kconfig 2008-11-25 21:12:12.000000000 +0900 @@ -350,6 +350,7 @@ config CPU_SUBTYPE_SHX3 config CPU_SUBTYPE_SH7343 bool "Support SH7343 processor" select CPU_SH4AL_DSP + select SH_TIMER config CPU_SUBTYPE_SH7722 bool "Support SH7722 processor" --- 0001/arch/sh/kernel/cpu/sh4a/setup-sh7343.c +++ work/arch/sh/kernel/cpu/sh4a/setup-sh7343.c 2008-11-25 21:16:01.000000000 +0900 @@ -12,6 +12,7 @@ #include #include #include +#include #include static struct resource iic0_resources[] = { @@ -292,3 +293,47 @@ void __init plat_irq_setup(void) { register_intc_controller(&intc_desc); } + +static struct sh_timer_config timers[] = { + { + .type = SH_TIMER_TYPE_CMT, + .name = "CMT", + .base = 0x044a0000, + .channel_offset = 0x60, + .timer_bit = 5, + .clk = "cmt0", + .irq = 104, + }, + { + .type = SH_TIMER_TYPE_TMU, + .name = "TMU0", + .base = 0xffd80004, + .channel_offset = 0x04, + .timer_bit = 0, + .clk = "tmu0", + .irq = 16, + }, + { + .type = SH_TIMER_TYPE_TMU, + .name = "TMU1", + .base = 0xffd80004, + .channel_offset = 0x10, + .timer_bit = 1, + .clk = "tmu0", + .irq = 17, + }, + { + .type = SH_TIMER_TYPE_TMU, + .name = "TMU2", + .base = 0xffd80004, + .channel_offset = 0x1c, + .timer_bit = 2, + .clk = "tmu0", + .irq = 18, + } +}; + +void __init plat_timer_setup(void) +{ + sh_timer_register(timers, ARRAY_SIZE(timers)); +}