summaryrefslogtreecommitdiff
path: root/arch/arm/mach-imx/localtimer.c
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2011-11-02 05:46:55 +0400
committerArnd Bergmann <arnd@arndb.de>2011-11-02 05:46:55 +0400
commitabc3f126ac736280c68db6472eb0040ddf6e1b1f (patch)
tree4e3333cde6da6c49dcd81920410bf5a33055f03a /arch/arm/mach-imx/localtimer.c
parentb8df0ea26ac17c9a073f235c7fdfbdd1851b59ea (diff)
parent8bcb97659656042f3132b2814b19709856aa1335 (diff)
downloadlinux-abc3f126ac736280c68db6472eb0040ddf6e1b1f.tar.xz
Merge branch 'imx/imx6q' into next/soc
Conflicts: Documentation/devicetree/bindings/arm/fsl.txt arch/arm/Kconfig arch/arm/Kconfig.debug arch/arm/plat-mxc/include/mach/common.h
Diffstat (limited to 'arch/arm/mach-imx/localtimer.c')
-rw-r--r--arch/arm/mach-imx/localtimer.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/arch/arm/mach-imx/localtimer.c b/arch/arm/mach-imx/localtimer.c
new file mode 100644
index 000000000000..3a163515d41f
--- /dev/null
+++ b/arch/arm/mach-imx/localtimer.c
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2011 Freescale Semiconductor, Inc.
+ * Copyright 2011 Linaro Ltd.
+ *
+ * The code contained herein is licensed under the GNU General Public
+ * License. You may obtain a copy of the GNU General Public License
+ * Version 2 or later at the following locations:
+ *
+ * http://www.opensource.org/licenses/gpl-license.html
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+
+#include <linux/init.h>
+#include <linux/clockchips.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
+#include <asm/smp_twd.h>
+
+/*
+ * Setup the local clock events for a CPU.
+ */
+int __cpuinit local_timer_setup(struct clock_event_device *evt)
+{
+ struct device_node *np;
+
+ np = of_find_compatible_node(NULL, NULL, "arm,smp-twd");
+ if (!twd_base) {
+ twd_base = of_iomap(np, 0);
+ WARN_ON(!twd_base);
+ }
+ evt->irq = irq_of_parse_and_map(np, 0);
+ twd_timer_setup(evt);
+
+ return 0;
+}