2 * Copyright 2010-2011 Calxeda, Inc.
3 * Based on localtimer.c, Copyright (C) 2002 ARM Ltd.
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms and conditions of the GNU General Public License,
7 * version 2, as published by the Free Software Foundation.
9 * This program is distributed in the hope it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 * You should have received a copy of the GNU General Public License along with
15 * this program. If not, see <http://www.gnu.org/licenses/>.
17 #include <linux/init.h>
18 #include <linux/clockchips.h>
20 #include <linux/of_address.h>
21 #include <linux/of_irq.h>
23 #include <asm/smp_twd.h>
26 * Setup the local clock events for a CPU.
28 int __cpuinit local_timer_setup(struct clock_event_device *evt)
30 struct device_node *np;
32 np = of_find_compatible_node(NULL, NULL, "arm,smp-twd");
34 twd_base = of_iomap(np, 0);
37 evt->irq = irq_of_parse_and_map(np, 0);