u-boot/arch/arm
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
..
cpu arm: armv7: add us timer for bootstage 2016-12-09 08:39:10 -05:00
dts socfpga: add support for Terasic DE1-SoC board 2016-12-06 01:45:56 +01:00
imx-common imx: make ipu's di configurable 2016-11-29 16:33:21 +01:00
include Revert "Merge branch 'master' of git://www.denx.de/git/u-boot-microblaze" 2016-12-09 07:56:54 -05:00
lib libfdt: replace ARCH_FIXUP_FDT with ARCH_FIXUP_FDT_MEMORY 2016-12-02 20:54:34 -07:00
mach-at91 arm, at91: add icache support 2016-10-28 18:37:13 +02:00
mach-bcm283x ARM: bcm283x: Implement EFI RTS reset_system 2016-11-28 20:15:19 -05:00
mach-davinci davinci: omapl138_lcdk: configure ddr2 2016-12-03 13:21:14 -05:00
mach-exynos arm: exynos7420: remove custome low level init function 2016-11-22 11:40:24 -08:00
mach-highbank ARM: highbank: move SoC sources to mach-highbank 2015-02-21 08:23:51 -05:00
mach-integrator integrator: switch to DM serial port 2015-08-12 20:47:49 -04:00
mach-keystone ARM: K2G: DDR3: Fix up priv ID for MPU 2016-12-03 13:21:10 -05:00
mach-kirkwood arm: kirkwood: add support for Synology DS109 board 2016-10-09 10:55:32 +02:00
mach-meson arm: Disable HVC PSCI calls by default 2016-10-18 09:08:08 +02:00
mach-mvebu arm64: mvebu: Restrict memory size to a usable maximum 2016-12-05 13:34:33 +01:00
mach-omap2 ARM: OMAP4+: Add support for getting pbias info from board 2016-12-04 13:54:51 -05:00
mach-orion5x Use correct spelling of "U-Boot" 2016-02-06 12:00:59 +01:00
mach-rmobile armv8: Support loading 32-bit OS in AArch32 execution state 2016-11-22 11:40:24 -08:00
mach-rockchip rockchip: Add support for veyron-minnie (ASUS Chromebook Flip) 2016-11-25 17:59:32 -07:00
mach-s5pc1xx arm: s5pc1xx: move SoC to mach-s5pc1xx 2015-11-30 17:17:01 +09:00
mach-snapdragon drivers/sysreset: group sysreset drivers 2016-08-12 09:22:17 -04:00
mach-socfpga qts-filter.sh: strip DOS line endings and handle continuation lines 2016-12-06 01:45:57 +01:00
mach-stm32 Revert "stm32: Change USART port to USART6 for stm32f746 discovery board" 2016-07-21 15:38:13 -04:00
mach-sunxi sunxi: A64: enable USB support 2016-10-30 11:38:04 +01:00
mach-tegra Merge branch 'master' of git://git.denx.de/u-boot-tegra 2016-11-08 10:36:57 -05:00
mach-uniphier ARM: uniphier: update DRAM init code for LD11 SoC 2016-10-29 17:24:30 +09:00
mach-versatile arm: Remove versatileab board 2015-09-11 15:01:25 -04:00
mach-zynq zynq: nand: Runtime detection of nand buswidth through slcr 2016-11-15 15:27:51 +01:00
thumb1/include/asm/proc-armv arm: support Thumb-1 with CONFIG_SYS_THUMB_BUILD 2015-11-10 15:03:48 +01:00
config.mk TI: Remove CONFIG_OMAP_COMMON in favor of CONFIG_ARCH_OMAP2 2016-11-21 14:07:29 -05:00
Kconfig ARM: socfpga: Add boot0 hook to prevent SPL corruption 2016-12-06 01:45:56 +01:00
Kconfig.debug arm: debug: add Kconfig entries for lowlevel debug 2014-10-26 22:23:12 +01:00
Makefile arm: Introduce arch/arm/mach-omap2 for OMAP2 derivative platforms 2016-11-21 14:07:29 -05:00