summaryrefslogtreecommitdiffstats
path: root/arch/arm/cpu/armv7
diff options
context:
space:
mode:
authorPatrick Delaunay <patrick.delaunay@st.com>2019-04-18 17:32:46 +0200
committerPatrice Chotard <patrice.chotard@st.com>2019-05-23 11:36:47 +0200
commitc596877ee6e8f235b6d6a8e0d4a9366ce086a3ed (patch)
tree7d5ebb157acfe66052cc63ad39ae98bca1986f02 /arch/arm/cpu/armv7
parent3419982bc39f667a4b364fad6a36c1b5e7e9115b (diff)
downloadu-boot-c596877ee6e8f235b6d6a8e0d4a9366ce086a3ed.tar.gz
u-boot-c596877ee6e8f235b6d6a8e0d4a9366ce086a3ed.tar.xz
u-boot-c596877ee6e8f235b6d6a8e0d4a9366ce086a3ed.zip
armv7: timer: init timer with bootstage
In initf_bootstage() we call bootstage_mark_name() which ends up calling timer_get_us() before timer_init(); that cause crash for stm32mp1. This patch solve the issue without changing the initialization sequence. See also commit 97d20f69f53e ("Enable CONFIG_TIMER_EARLY with bootstage") for other solution when DM is activated for TIMER. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Diffstat (limited to 'arch/arm/cpu/armv7')
-rw-r--r--arch/arm/cpu/armv7/arch_timer.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/arm/cpu/armv7/arch_timer.c b/arch/arm/cpu/armv7/arch_timer.c
index 3db31c0209..5de63053d5 100644
--- a/arch/arm/cpu/armv7/arch_timer.c
+++ b/arch/arm/cpu/armv7/arch_timer.c
@@ -49,6 +49,9 @@ unsigned long long get_ticks(void)
ulong timer_get_boot_us(void)
{
+ if (!gd->arch.timer_rate_hz)
+ timer_init();
+
return lldiv(get_ticks(), gd->arch.timer_rate_hz / 1000000);
}