aboutsummaryrefslogtreecommitdiffstats
path: root/roms/u-boot/arch/arm/cpu/armv7/highbank
diff options
context:
space:
mode:
authorfishsoupisgood <github@madingley.org>2019-04-29 01:17:54 +0100
committerfishsoupisgood <github@madingley.org>2019-05-27 03:43:43 +0100
commit3f2546b2ef55b661fd8dd69682b38992225e86f6 (patch)
tree65ca85f13617aee1dce474596800950f266a456c /roms/u-boot/arch/arm/cpu/armv7/highbank
downloadqemu-master.tar.gz
qemu-master.tar.bz2
qemu-master.zip
Initial import of qemu-2.4.1HEADmaster
Diffstat (limited to 'roms/u-boot/arch/arm/cpu/armv7/highbank')
-rw-r--r--roms/u-boot/arch/arm/cpu/armv7/highbank/Makefile8
-rw-r--r--roms/u-boot/arch/arm/cpu/armv7/highbank/timer.c34
2 files changed, 42 insertions, 0 deletions
diff --git a/roms/u-boot/arch/arm/cpu/armv7/highbank/Makefile b/roms/u-boot/arch/arm/cpu/armv7/highbank/Makefile
new file mode 100644
index 00000000..876099d9
--- /dev/null
+++ b/roms/u-boot/arch/arm/cpu/armv7/highbank/Makefile
@@ -0,0 +1,8 @@
+#
+# (C) Copyright 2000-2006
+# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+#
+# SPDX-License-Identifier: GPL-2.0+
+#
+
+obj-y := timer.o
diff --git a/roms/u-boot/arch/arm/cpu/armv7/highbank/timer.c b/roms/u-boot/arch/arm/cpu/armv7/highbank/timer.c
new file mode 100644
index 00000000..d56bf211
--- /dev/null
+++ b/roms/u-boot/arch/arm/cpu/armv7/highbank/timer.c
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2010-2011 Calxeda, Inc.
+ *
+ * Based on arm926ejs/mx27/timer.c
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#include <common.h>
+#include <asm/io.h>
+#include <asm/arch-armv7/systimer.h>
+
+#undef SYSTIMER_BASE
+#define SYSTIMER_BASE 0xFFF34000 /* Timer 0 and 1 base */
+
+static struct systimer *systimer_base = (struct systimer *)SYSTIMER_BASE;
+
+/*
+ * Start the timer
+ */
+int timer_init(void)
+{
+ /*
+ * Setup timer0
+ */
+ writel(0, &systimer_base->timer0control);
+ writel(SYSTIMER_RELOAD, &systimer_base->timer0load);
+ writel(SYSTIMER_RELOAD, &systimer_base->timer0value);
+ writel(SYSTIMER_EN | SYSTIMER_32BIT | SYSTIMER_PRESC_256,
+ &systimer_base->timer0control);
+
+ return 0;
+
+}