diff options
author | Tom Rini <trini@konsulko.com> | 2018-07-13 09:05:05 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2018-07-13 14:47:04 -0400 |
commit | 914bb7ea2f9373fa59285ff77a95df73848c8f66 (patch) | |
tree | f27ecab47f71990f91fbe0daad932ab0c5fce726 /arch/arm/mach-socfpga/timer_s10.c | |
parent | f2df46e5d9388987c2084a39f05f2ad32801b3b0 (diff) | |
parent | aa529663368e97663d7ec16d6997cb69a2dd8afb (diff) |
Merge branch 'master' of git://git.denx.de/u-boot-socfpga
- Update SPDX tag in arch/arm/mach-socfpga/spl_a10.c
Signed-off-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'arch/arm/mach-socfpga/timer_s10.c')
-rw-r--r-- | arch/arm/mach-socfpga/timer_s10.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/arch/arm/mach-socfpga/timer_s10.c b/arch/arm/mach-socfpga/timer_s10.c new file mode 100644 index 00000000000..57237892c34 --- /dev/null +++ b/arch/arm/mach-socfpga/timer_s10.c @@ -0,0 +1,26 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2017-2018 Intel Corporation <www.intel.com> + * + */ + +#include <common.h> +#include <asm/io.h> +#include <asm/arch/timer.h> + +/* + * Timer initialization + */ +int timer_init(void) +{ + int enable = 0x3; /* timer enable + output signal masked */ + int loadval = ~0; + + /* enable system counter */ + writel(enable, SOCFPGA_GTIMER_SEC_ADDRESS); + /* enable processor pysical counter */ + asm volatile("msr cntp_ctl_el0, %0" : : "r" (enable)); + asm volatile("msr cntp_tval_el0, %0" : : "r" (loadval)); + + return 0; +} |