u-boot-brain/arch/arm/cpu/armv7
Patrick Delaunay 91558c8153 arm: armv7: add us timer for bootstage
solve issue when bootstage is used with armV7 generic timer
first call of timer_get_boot_us() use the function get_timer()
before timer initialization (arch.timer_rate_hz = 0)
=> div by 0

Commit-notes

When I activate bootstage on ARMV7 architecture with platform
using the generic armv7 timer defined in file
./arch/arm/cpu/armv7m/timer.c

I have a issue because gd->arch.timer_rate_hz = 0

For me the get_timer() function should not used before timer_init
(which initialize gd->arch.timer_rate_hz) at least for the ARMV7
timer.

But in the init sequence, the first bootstage fucntion is called
before timer_init and this function use the timer function.

For me it is a error in the generic init sequence :
mark_bootstage is called before timer_init.

static init_fnc_t init_sequence_f[] = {
....
    arch_cpu_init_dm,
    mark_bootstage,        /* need timer, go after init dm */
...
#if defined(CONFIG_ARM) || defined(CONFIG_MIPS) || \
        defined(CONFIG_BLACKFIN) || defined(CONFIG_NDS32) || \
        defined(CONFIG_SPARC)
    timer_init,        /* initialize timer */
#endif
.......

To solve the issue for all the paltform, we can move timer_init()
call just before mark_bootstage() in this array...

It should be ok for ARMV7 but I don't sure for other platform
impacted
- the other ARM platform or ARMV7 wich don't use generic timer
- MIPS BLACKFIN NDS32 or SPARC

and I don't sure of impact for other function called
(board_early_init_f for example....)

=> This patch solve issue only in timer armv7
   get_boot_us() can be called everytime without div by 0 issue
   (gd->arch.timer_rate_hz is not used)

END

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay73@gmail.com>
2016-12-09 08:39:10 -05:00
..
bcm235xx treewide: replace #include <asm/errno.h> with <linux/errno.h> 2016-09-23 17:55:42 -04:00
bcm281xx treewide: replace #include <asm/errno.h> with <linux/errno.h> 2016-09-23 17:55:42 -04:00
bcmcygnus arm: bcmcygnus: Add bcmcygnus u-architecture 2014-08-30 07:46:40 -04:00
bcmnsp arm: bcmnsp: Add bcmnsp u-architecture 2014-08-30 07:46:40 -04:00
iproc-common arm: iproc: Initial commit of iproc architecture code 2014-08-30 07:46:40 -04:00
kona-common board: arm:: Add support for Broadcom BCM23550 2016-06-13 08:56:02 -04:00
ls102xa armv7: ls1021a: Move SECURE_BOOT option to Kconfig 2016-12-02 12:38:41 -08:00
mx5 treewide: replace #include <asm/errno.h> with <linux/errno.h> 2016-09-23 17:55:42 -04:00
mx6 imx6: clock: Enable External Memory Interface [EIM] clock (eim_slow_clock) 2016-11-30 09:57:19 +01:00
mx7 treewide: replace #include <asm/errno.h> with <linux/errno.h> 2016-09-23 17:55:42 -04:00
s5p-common exynos: pwm: Add a driver for the exynos5 PWM 2016-05-25 13:25:18 +09:00
stv0991 stv0991: configure clock & pad muxing for qspi 2015-07-03 13:50:53 +05:30
sunxi ARM: Rework and correct barrier definitions 2016-08-05 07:23:57 -04:00
vf610 ARM: vf610: use strcpy for soc environment variable 2016-10-07 15:56:52 +02:00
arch_timer.c arm: armv7: add us timer for bootstage 2016-12-09 08:39:10 -05:00
cache_v7_asm.S arm: Replace v7_maint_dcache_all(ARMV7_DCACHE_INVAL_ALL) with asm code 2016-04-11 20:48:27 -04:00
cache_v7.c ARM: Rework and correct barrier definitions 2016-08-05 07:23:57 -04:00
config.mk ARM: move -march=* and -mtune= options to arch/arm/Makefile 2015-03-27 16:55:22 +01:00
cp15.c ARM: Introduce erratum workaround for 454179 2015-03-13 09:28:48 -04:00
cpu.c arm: Turn of d-cache before i-cache 2015-09-02 21:28:25 -06:00
Kconfig ARM: armv7: move ARMV7_PSCI_NR_CPUS to Kconfig 2016-09-07 08:48:54 -04:00
lowlevel_init.S ARM: Respect CONFIG_SPL_STACK define in lowlevel_init.S 2016-10-06 20:57:36 -04:00
Makefile arm: Introduce arch/arm/mach-omap2 for OMAP2 derivative platforms 2016-11-21 14:07:29 -05:00
nonsec_virt.S ARM: PSCI: Split out common stack setup code from psci_arch_init 2016-07-15 15:54:56 +02:00
psci-common.c ARM: Rework and correct barrier definitions 2016-08-05 07:23:57 -04:00
psci.S armv7: psci: cpu_off: flush D-Cache before disable D-Cache 2016-11-29 08:15:31 -05:00
start.S ARM: Introduce function to switch to hypervisor mode 2016-10-06 20:58:16 -04:00
syslib.c ARM: OMAP: hide custom bit manipulation function sr32() 2014-04-17 14:39:54 -04:00
virt-dt.c ARMv8/PSCI: Fixup the device tree for PSCI 2016-07-19 11:34:07 -07:00
virt-v7.c ARM: non-sec: flush code cacheline aligned 2016-08-12 09:22:15 -04:00