From 59b559d7a39b590aecef583af58d123ff5876570 Mon Sep 17 00:00:00 2001 From: Srinidhi Kasagar Date: Thu, 12 Nov 2009 06:20:54 +0100 Subject: ARM: 5786/1: Introduce plat-nomadik, MTU code re-organization Introduce the plat-nomadik folder for ST-Ericsson machines including the existing nomadik 8815 architecture. This also moves the existing MTU (MultiTimerUnit) of nomadik 8815 to the proposed plat-nomadik and adds HAS_MTU. The patch has been re-based to 2.6.32-rc6 Signed-off-by: srinidhi kasagar Acked-by: Alessandro Rubini Signed-off-by: Russell King --- arch/arm/mach-nomadik/board-nhk8815.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'arch/arm/mach-nomadik/board-nhk8815.c') diff --git a/arch/arm/mach-nomadik/board-nhk8815.c b/arch/arm/mach-nomadik/board-nhk8815.c index 6bfd537d5af..116394484e7 100644 --- a/arch/arm/mach-nomadik/board-nhk8815.c +++ b/arch/arm/mach-nomadik/board-nhk8815.c @@ -25,11 +25,18 @@ #include #include #include + +#include + #include #include #include #include "clock.h" +/* Initial value for SRC control register: all timers use MXTAL/8 source */ +#define SRC_CR_INIT_MASK 0x00007fff +#define SRC_CR_INIT_VAL 0x2aaa8000 + /* These adresses span 16MB, so use three individual pages */ static struct resource nhk8815_nand_resources[] = { { @@ -239,6 +246,26 @@ static struct platform_device *nhk8815_platform_devices[] __initdata = { /* will add more devices */ }; +static void __init nomadik_timer_init(void) +{ + u32 src_cr; + + /* Configure timer sources in "system reset controller" ctrl reg */ + src_cr = readl(io_p2v(NOMADIK_SRC_BASE)); + src_cr &= SRC_CR_INIT_MASK; + src_cr |= SRC_CR_INIT_VAL; + writel(src_cr, io_p2v(NOMADIK_SRC_BASE)); + + /* Save global pointer to mtu, used by platform timer code */ + mtu_base = io_p2v(NOMADIK_MTU0_BASE); + + nmdk_timer_init(); +} + +static struct sys_timer nomadik_timer = { + .init = nomadik_timer_init, +}; + static void __init nhk8815_platform_init(void) { int i; -- cgit v1.2.3