From 7ec80ddf0455ff3854a5ca524952d91b5eb676b2 Mon Sep 17 00:00:00 2001 From: wanzongshun Date: Wed, 3 Dec 2008 03:55:38 +0100 Subject: [ARM] 5338/1: Add Nuvoton W90P910 Platform support Add Nuvoton W90X900 ARM9 plat support to linux arm tree, Now, this patch include only W90P910 EVB of W90P910 CPU, Its driver is nothing. Signed-off-by: Wan ZongShun Signed-off-by: Russell King --- arch/arm/mach-w90x900/time.c | 80 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 arch/arm/mach-w90x900/time.c (limited to 'arch/arm/mach-w90x900/time.c') diff --git a/arch/arm/mach-w90x900/time.c b/arch/arm/mach-w90x900/time.c new file mode 100644 index 00000000000..3a69e381f31 --- /dev/null +++ b/arch/arm/mach-w90x900/time.c @@ -0,0 +1,80 @@ +/* + * linux/arch/arm/mach-w90x900/time.c + * + * Based on linux/arch/arm/plat-s3c24xx/time.c by Ben Dooks + * + * Copyright (c) 2008 Nuvoton technology corporation + * All rights reserved. + * + * Wan ZongShun + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include + +static unsigned long w90x900_gettimeoffset(void) +{ + return 0; +} + +/*IRQ handler for the timer*/ + +static irqreturn_t +w90x900_timer_interrupt(int irq, void *dev_id) +{ + timer_tick(); + __raw_writel(0x01, REG_TISR); /* clear TIF0 */ + return IRQ_HANDLED; +} + +static struct irqaction w90x900_timer_irq = { + .name = "w90x900 Timer Tick", + .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL, + .handler = w90x900_timer_interrupt, +}; + +/*Set up timer reg.*/ + +static void w90x900_timer_setup(void) +{ + __raw_writel(0, REG_TCSR0); + __raw_writel(0, REG_TCSR1); + __raw_writel(0, REG_TCSR2); + __raw_writel(0, REG_TCSR3); + __raw_writel(0, REG_TCSR4); + __raw_writel(0x1F, REG_TISR); + __raw_writel(15000000/(100 * 100), REG_TICR0); + __raw_writel(0x68000063, REG_TCSR0); +} + +static void __init w90x900_timer_init(void) +{ + w90x900_timer_setup(); + setup_irq(IRQ_TIMER0, &w90x900_timer_irq); +} + +struct sys_timer w90x900_timer = { + .init = w90x900_timer_init, + .offset = w90x900_gettimeoffset, + .resume = w90x900_timer_setup +}; -- cgit v1.2.3-70-g09d2