From 3f2546b2ef55b661fd8dd69682b38992225e86f6 Mon Sep 17 00:00:00 2001 From: fishsoupisgood Date: Mon, 29 Apr 2019 01:17:54 +0100 Subject: Initial import of qemu-2.4.1 --- roms/u-boot/arch/arm/cpu/armv7/highbank/Makefile | 8 ++++++ roms/u-boot/arch/arm/cpu/armv7/highbank/timer.c | 34 ++++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 roms/u-boot/arch/arm/cpu/armv7/highbank/Makefile create mode 100644 roms/u-boot/arch/arm/cpu/armv7/highbank/timer.c (limited to 'roms/u-boot/arch/arm/cpu/armv7/highbank') 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 +#include +#include + +#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; + +} -- cgit v1.2.3