aboutsummaryrefslogtreecommitdiff
path: root/drivers/timer/orion-timer.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2022-10-06 08:44:23 -0400
committerTom Rini <trini@konsulko.com>2022-10-06 08:44:23 -0400
commit2afa989fbecf25ea23902a9c480f179ba608785a (patch)
tree4d7dfaa06c49a01b573eb32ad48d780b546efc50 /drivers/timer/orion-timer.c
parent2d4591353452638132d711551fec3495b7644731 (diff)
parent3bb0458fa0ef127718ed1c47c33279f9ef03238d (diff)
Merge https://source.denx.de/u-boot/custodians/u-boot-marvell
- Kirkwood: remove km/keymile kirkwood boards (Holger) - mtd: nand: pxa3xx: simplify ECC hardware parameters (Chris) - tools: kwbimage: Verify maximal kwbimage header size (Pali) - mvebu: Add support for programming LD eFuse on Armada 385 (Pali) - mvebu: Misc timer improvements / cleanup (Stefan)
Diffstat (limited to 'drivers/timer/orion-timer.c')
-rw-r--r--drivers/timer/orion-timer.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/timer/orion-timer.c b/drivers/timer/orion-timer.c
index cd63ea9162..d0eab3ce78 100644
--- a/drivers/timer/orion-timer.c
+++ b/drivers/timer/orion-timer.c
@@ -28,6 +28,11 @@ static bool early_init_done __section(".data") = false;
/* Common functions for early (boot) and DM based timer */
static void orion_timer_init(void *base, enum input_clock_type type)
{
+ /* Only init the timer once */
+ if (early_init_done)
+ return;
+ early_init_done = true;
+
writel(~0, base + TIMER0_VAL);
writel(~0, base + TIMER0_RELOAD);
@@ -51,11 +56,6 @@ static uint64_t orion_timer_get_count(void *base)
/* Early (e.g. bootstage etc) timer functions */
static void notrace timer_early_init(void)
{
- /* Only init the timer once */
- if (early_init_done)
- return;
- early_init_done = true;
-
if (IS_ENABLED(CONFIG_ARCH_MVEBU))
orion_timer_init((void *)MVEBU_TIMER_BASE, INPUT_CLOCK_25MHZ);
else