We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 3089d12 + 5387b09 commit 582e3c9Copy full SHA for 582e3c9
drivers/timer/orion-timer.c
@@ -23,15 +23,19 @@ struct orion_timer_priv {
23
24
#define MVEBU_TIMER_FIXED_RATE_25MHZ 25000000
25
26
-static bool early_init_done __section(".data") = false;
+static bool early_init_done(void *base)
27
+{
28
+ if (readl(base + TIMER_CTRL) & TIMER0_EN)
29
+ return true;
30
+ return false;
31
+}
32
33
/* Common functions for early (boot) and DM based timer */
34
static void orion_timer_init(void *base, enum input_clock_type type)
35
{
36
/* Only init the timer once */
- if (early_init_done)
37
+ if (early_init_done(base))
38
return;
- early_init_done = true;
39
40
writel(~0, base + TIMER0_VAL);
41
writel(~0, base + TIMER0_RELOAD);
0 commit comments