u-boot/arch/arm
Stephen Warren 5e0404ff85 board_f: fix noncached reservation calculation
The current code in reserve_noncached() has two issues:

1) The first update of gd->start_addr_sp always rounds down to a section
start. However, the equivalent calculation in cache.c:noncached_init()
always first rounds up to a section start, then subtracts a section size.
These two calculations differ if the initial value is already rounded to
section alignment.

2) The second update of gd->start_addr_sp subtracts exactly
CONFIG_SYS_NONCACHED_MEMORY, whereas the equivalent calculation in
cache.c:noncached_init() rounds the noncached size up to section
alignment before subtracting it. The two calculations differ if the
noncached region size is not a multiple of the MMU section size.

In practice, one/both of those issues causes a practical problem on
Jetson TX1; U-Boot triggers a synchronous abort during initialization,
likely due to overlapping use of some memory region.

This change fixes both these issues by duplicating the exact calculations
from noncached_init() into reserve_noncached().

However, this fix assumes that gd->start_addr_sp on entry to
reserve_noncached() exactly matches mem_malloc_start on entry to
noncached_init(). I haven't traced the code to see whether it absolutely
guarantees this in all (or indeed any!) cases. Consequently, I added some
comments in the hope that this condition will continue to be true.

Fixes: 5f7adb5b1c ("board_f: reserve noncached space below malloc area")
Cc: Vikas Manocha <vikas.manocha@st.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
2019-08-30 14:17:11 -04:00
..
cpu armv8: ls1028a: add icid setup for platform devices 2019-08-22 09:07:36 +05:30
dts stm32mp1: Add remoteproc support for m4 coprocessor 2019-08-27 11:19:23 +02:00
include Convert CONFIG_ARCH_CPU_INIT to Kconfig 2019-08-25 19:32:55 -04:00
lib board_f: fix noncached reservation calculation 2019-08-30 14:17:11 -04:00
mach-aspeed
mach-at91 Convert CONFIG_ARCH_CPU_INIT to Kconfig 2019-08-25 19:32:55 -04:00
mach-bcm283x watchdog: bcm2835_wdt: Remove unused BCM283x watchdog driver and its references 2019-08-05 11:50:06 +02:00
mach-bcmstb
mach-davinci env: Drop environment.h header file where not needed 2019-08-11 16:43:41 -04:00
mach-exynos CONFIG_SPL_SYS_[DI]CACHE_OFF: add 2019-05-18 08:15:35 -04:00
mach-highbank
mach-imx env: Drop environment.h header file where not needed 2019-08-11 16:43:41 -04:00
mach-integrator
mach-k3 arm: K3: sysfw-loader: Do not require full printf() for version info 2019-08-12 13:33:43 -04:00
mach-keystone arm: mach-keystone: Use appended original image size in image processing 2019-07-29 17:58:52 -04:00
mach-kirkwood env: Move env_get() to env.h 2019-08-11 16:43:41 -04:00
mach-mediatek board: mediatek: Add pumpkin board support 2019-07-29 09:32:11 -04:00
mach-meson - amlogic: add support for the SEI Robotic SEI510 2019-08-12 23:03:35 -04:00
mach-mvebu arm: mvebu: set 38x and 39x AVS on lower frequency 2019-07-11 10:58:03 +02:00
mach-omap2 ARM: DRA7: Fixup DPLL clock rate fixup logic for newer kernels 2019-08-20 11:46:38 -04:00
mach-orion5x
mach-owl
mach-qemu
mach-rmobile env: Move env_set() to env.h 2019-08-11 16:43:41 -04:00
mach-rockchip rockchip: rk3399: derive ethaddr from cpuid 2019-08-23 18:15:31 +08:00
mach-s5pc1xx CONFIG_SPL_SYS_[DI]CACHE_OFF: add 2019-05-18 08:15:35 -04:00
mach-snapdragon arm: mach-snapdragon: pinctrl: clarify gpio disable bit 2019-01-25 12:12:56 -05:00
mach-socfpga arm: socfpga: gen5: don't zero bss in board_init_f() 2019-08-15 08:50:02 +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 bsec: update after MISC u-class update 2019-08-27 11:19:23 +02:00
mach-sunxi sunxi: H6: Enable USB for existing boards 2019-07-16 17:13:15 +05:30
mach-tegra env: Drop environment.h header file where not needed 2019-08-11 16:43:41 -04:00
mach-uniphier env: Move env_set_ulong() to env.h 2019-08-11 16:43:41 -04:00
mach-versal arm64: versal: Move IOU_SWITCH_DIVISOR0 to Kconfig 2019-02-14 14:31:10 +01:00
mach-versatile
mach-zynq CONFIG_SPL_SYS_[DI]CACHE_OFF: add 2019-05-18 08:15:35 -04:00
mach-zynqmp arm64: zynqmp: spl: install a PMU firmware config object at runtime 2019-07-30 10:20:06 +02:00
mach-zynqmp-r5
thumb1/include/asm/proc-armv
config.mk
Kconfig stm32mp1: configs: imply CONFIG_OF_LIBFDT_OVERLAY 2019-08-27 09:36:56 +02:00
Kconfig.debug
Makefile arm: imx: build mach-imx for i.MX8 2019-01-28 20:35:47 +01:00