u-boot/arch/arm
Andre Przywara 5776610e9e sunxi: store DRAM size in SPL header
At the moment we rely on the infamous get_ram_size() function to learn
the actual DRAM size in U-Boot proper. This function has two issues:
1) It only works if the DRAM size is a power of two. We start to see
boards which have 3GB of (usable) DRAM, so this does not fit anymore.
2) As U-Boot has no notion of reserved memory so far, it will happily
ride through the DRAM, possibly stepping on secure-only memory. This
could be a region of DRAM reserved for OP-TEE or some other secure
payload, for instance. It will most likely crash in that case.

As the SPL DRAM init routine has very accurate knowledge of the actual
DRAM size, lets propagate this wisdom to U-Boot proper.
We re-purpose a currently reserved word in our SPL header for that.
The SPL itself stores the detected DRAM size there, and bumps the SPL
header version number in that case. U-Boot proper checks for a valid
SPL header and a high enough version number, then uses the DRAM size
from there. If the SPL header field is not sufficient, we fall back to
the old DRAM scanning routine.

Part of the DRAM might be present and probed by SPL, but not accessible
by the CPU. They're restricted in the main U-Boot binary, when accessing
the DRAM size from SPL header.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
Reviewed-by: Jagan Teki <jagan@openedev.com>
2018-10-29 20:41:15 +05:30
..
cpu arm: lpc32xx: remove phantom CONFIG_LPC32XX_SDRAM_ config option 2018-10-19 12:56:58 -04:00
dts ARM: dts: rmobile: Build -u-boot variants of DTs 2018-10-18 20:38:27 +02:00
include sunxi: store DRAM size in SPL header 2018-10-29 20:41:15 +05:30
lib Patch queue for efi - 2018-10-17 2018-10-17 07:20:52 -04:00
mach-aspeed regmap: change regmap_init_mem() to take ofnode instead udevice 2018-05-07 15:49:51 -04:00
mach-at91 arm: remove prototype for get_timer_masked 2018-10-10 13:35:09 -04:00
mach-bcm283x efi_loader: Convert runtime reset from switch to if statements 2018-06-14 10:52:14 +02:00
mach-bcmstb board: arm: Add support for Broadcom BCM7260 2018-09-10 21:19:31 -04:00
mach-davinci gpio: da8xx: Push generic defines of gpio.h out of mach-davinci 2018-10-10 13:35:03 -04:00
mach-exynos Kconfig: Sort bool, default, select and imply options 2018-07-30 07:18:48 -04:00
mach-highbank SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
mach-imx arm: remove prototype for get_timer_masked 2018-10-10 13:35:09 -04:00
mach-integrator
mach-k3 arm: K3: am654: Add support for getting boot mode 2018-10-10 13:35:08 -04:00
mach-keystone SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
mach-kirkwood Convert CONFIG_MII et al to Kconfig 2018-08-17 13:03:54 -04:00
mach-meson ARM: meson: Add Khadas VIM2 board support 2018-10-10 13:32:40 -04:00
mach-mvebu ARM: mach-mvebu: handle fall-back to UART boot 2018-09-19 08:59:26 +02:00
mach-omap2 ARM: mach-omap2: Kconfig: Make SYS_MPUCLK dependent on AM33XX 2018-10-19 14:16:32 -04:00
mach-orion5x arm: remove prototype for get_timer_masked 2018-10-10 13:35:09 -04:00
mach-owl board: Add uCRobotics Bubblegum-96 board support 2018-07-09 15:25:23 -04:00
mach-qemu Kconfig: Sort bool, default, select and imply options 2018-07-30 07:18:48 -04:00
mach-rmobile ARM: rmobile: Drop PRR syscon driver 2018-10-18 20:38:27 +02:00
mach-rockchip rockchip: make_fit_atf: make python3 compatible 2018-10-04 21:15:46 +02:00
mach-s5pc1xx SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
mach-snapdragon db410c: serial# env using msm board serial 2018-09-30 13:00:35 -04:00
mach-socfpga arm: socfpga: stratix10: add sgmii in phymode setup 2018-10-03 12:56:50 +02:00
mach-sti
mach-stm32 mach-stm32: Set MPU SDRAM size to 512MB for STM32F7/H7 2018-10-06 14:09:41 -04:00
mach-stm32mp stm32mp1: activate MISC support in SPL 2018-07-20 15:55:05 -04:00
mach-sunxi sunxi: add Kconfig option for the maximum accessible DRAM 2018-10-29 20:41:15 +05:30
mach-tegra ARM: tegra: reserve unmapped RAM so EFI doesn't use it 2018-09-23 21:55:29 +02:00
mach-uniphier mtd: move NAND files into a raw/ subdirectory 2018-09-20 20:10:49 +05:30
mach-versal arm64: versal: Add Xilinx Versal Virtual QEMU board 2018-10-16 16:53:24 +02:00
mach-versatile SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
mach-zynq Kconfig: Move config SYS_MALLOC_LEN to Kconfig for zynq 2018-08-06 08:44:35 +02:00
mach-zynqmp-r5 arm: zynqmp: Add ZynqMP minimal R5 support 2018-05-11 09:38:23 +02:00
thumb1/include/asm/proc-armv SPDX: Convert a few files that were missed before 2018-05-10 20:38:35 -04:00
config.mk efi_loader: Rename sections to allow for implicit data 2018-07-25 14:57:44 +02:00
Kconfig arm: lpc32xx: add CONFIG_ARCH_LPC32XX build option 2018-10-19 12:56:58 -04:00
Kconfig.debug
Makefile arm64: versal: Add support for new Xilinx Versal ACAPs 2018-10-16 16:53:21 +02:00