u-boot/arch/arm
Patrick Delaunay 7e8471cae5 arm: stm32mp: activate data cache in SPL and before relocation
Activate the data cache in SPL and in U-Boot before relocation.

In arch_cpu_init(), the function early_enable_caches() sets the early
TLB, early_tlb[] located .init section, and set cacheable:
- for SPL, all the SYSRAM
- for U-Boot, all the DDR

After relocation, the function enable_caches() (called by board_r)
reconfigures the MMU with new TLB location (reserved in
board_f.c::reserve_mmu) and re-enable the data cache.

This patch allows to reduce the execution time, particularly
- for the device tree parsing in U-Boot pre-reloc stage
  (dm_extended_scan_fd =>dm_scan_fdt)
- in I2C timing computation in SPL (stm32_i2c_choose_solution())

For example, the result on STM32MP157C-DK2 board is:
   1,6s gain for trusted boot chain with TF-A
   2,2s gain for basic boot chain with SPL

For information, as TLB is added in .data section, the binary size
increased and the SPL load time by ROM code increased (30ms on DK2).

But early malloc can't be used for TLB because arch_cpu_init()
is executed before the early poll initialization done in spl_common_init()
called by spl_early_init() So it too late for this use case.
And if I initialize the MMU and the cache after this function it is
too late, as dm_init_and_scan and fdt parsing is also called in
spl_common_init().

And .BSS can be used in board_init_f(): only stack and global can use
before BSS init done in board_init_r().

So .data is the better solution without hardcoded location but if you
have size issue for SPL you can deactivate cache for SPL only
(with CONFIG_SPL_SYS_DCACHE_OFF).

Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
2020-05-14 09:02:12 +02:00
..
cpu imx: imx8qm/qxp: Recover SPL data section for partition reboot 2020-05-10 20:55:20 +02:00
dts ARM: stm32: Hog GPIO PF7 high on DHCOM to unlock SPI NOR nWP 2020-05-14 09:02:12 +02:00
include imx: imx8qm/qxp: check whether m4 partition booted 2020-05-10 20:55:20 +02:00
lib cmd: cache: Fix non-cached memory cachability 2020-05-07 09:01:42 -04:00
mach-aspeed dm: core: Require users of devres to include the header 2020-02-05 19:33:46 -07:00
mach-at91 common: Move hang() to the same header as panic() 2020-01-24 23:06:49 +05:30
mach-bcm283x rpi4: Update memory map to accommodate scb devices 2020-01-29 18:30:33 +01:00
mach-bcmstb
mach-cortina board: presidio-asic: Add basic G3 engr. development board support 2020-02-07 16:16:01 -05:00
mach-davinci mach-davinci: Hard-code the default SPL_LDSCRIPT path 2020-03-16 18:54:18 -04:00
mach-exynos arm: exynos: Read default MMC device from XOM[7:5] pins 2020-01-28 09:54:05 +09:00
mach-highbank
mach-imx imx8: cpu: check resource owned after sid fail 2020-05-10 20:55:21 +02:00
mach-integrator
mach-k3 arm: K3: Increase default SYSFW image size allocation 2020-05-11 10:16:49 +05:30
mach-keystone common: Move hang() to the same header as panic() 2020-01-24 23:06:49 +05:30
mach-kirkwood common: Move reset_cpu() to the CPU header 2020-01-24 23:06:49 +05:30
mach-mediatek arm: mediatek: remove unused binman config 2020-03-10 17:08:13 -04:00
mach-meson phy: Use _nodev naming convention if non-device clients 2020-05-11 01:30:49 +05:30
mach-mvebu arm: mvebu: correct SPL boot configs for SPI/MMC 2020-04-22 14:28:15 +02:00
mach-omap2 spl: mmc: Rename spl_boot_mode() to spl_mmc_boot_mode() 2020-04-22 20:41:57 +08:00
mach-orion5x edminiv2: Move CONFIG_SPL_LDSCRIPT to defconfig 2020-03-16 18:54:18 -04:00
mach-owl arm: add support Actions Semi S700 2020-04-24 16:40:09 -04:00
mach-qemu qemu: don't allow to select 32- and 64-bit 2020-04-24 10:51:32 -04:00
mach-rmobile common: Move some cache and MMU functions out of common.h 2019-12-02 18:23:55 -05:00
mach-rockchip spl: mmc: Rename spl_boot_mode() to spl_mmc_boot_mode() 2020-04-22 20:41:57 +08:00
mach-s5pc1xx common: Move some cache and MMU functions out of common.h 2019-12-02 18:23:55 -05:00
mach-snapdragon mach-snapdragon: Fix overwriting last digit of serial number 2020-04-03 11:47:47 -04:00
mach-socfpga arm: socfpga: stratix10: Fix incorrect CLKMGR_S10_PERPLL_BYPASS offset 2020-04-27 09:14:52 +02:00
mach-sti
mach-stm32 mach-stm32: Fix MPU region size dedicated to SDRAM for STM32F4 2019-06-28 09:45:27 +02:00
mach-stm32mp arm: stm32mp: activate data cache in SPL and before relocation 2020-05-14 09:02:12 +02:00
mach-sunxi sunxi: SPL SPI: Add SPI boot support for the Allwinner H6 SoC 2020-03-18 18:12:04 +05:30
mach-tegra ARM: tegra: Add NVIDIA Jetson Nano Developer Kit support 2020-04-02 14:30:02 -07:00
mach-u8500 board: Add new Samsung "stemmy" board based on ST-Ericsson U8500 2020-01-22 17:47:57 -05:00
mach-uniphier spl: mmc: Rename spl_boot_mode() to spl_mmc_boot_mode() 2020-04-22 20:41:57 +08:00
mach-versal arm: asm/cache.c: Introduce arm_reserve_mmu 2020-04-24 15:17:14 -04:00
mach-versatile
mach-zynq ARM: zynq: Do not print message about boot device 2020-04-06 12:52:45 +02:00
mach-zynqmp arm: asm/cache.c: Introduce arm_reserve_mmu 2020-04-24 15:17:14 -04:00
mach-zynqmp-r5 common: Move reset_cpu() to the CPU header 2020-01-24 23:06:49 +05:30
thumb1/include/asm/proc-armv
config.mk
Kconfig arm: juno: enable USB 2020-05-07 09:01:42 -04:00
Kconfig.debug
Makefile arm: Add support for ST-Ericsson U8500 SoC 2020-01-22 17:47:57 -05:00