]> git.baikalelectronics.ru Git - uboot.git/commit
arm: stm32mp: Fix board_get_usable_ram_top() again
authorMarek Vasut <marex@denx.de>
Thu, 5 Jan 2023 01:22:22 +0000 (02:22 +0100)
committerPatrick Delaunay <patrick.delaunay@foss.st.com>
Fri, 6 Jan 2023 10:02:17 +0000 (11:02 +0100)
commit0efb8ff828b9e16389b71924d65c4d9781587a3b
tree492f45518ea4272de62dd40c5aba44bd32eb2baf
parent6b11926cb8854efae8d7538cbeeb93e845b5d1f0
arm: stm32mp: Fix board_get_usable_ram_top() again

Do not access gd->ram_size and assume this is actual valid RAM size. Since commit
9306ac3ce44 ("common/memsize.c: Fix get_effective_memsize() to check for overflow")
the RAM size may be less than gd->ram_size , call get_effective_memsize() to get
the limited value instead.

The aforementioned commit makes STM32MP15xx boards with 1 GiB of DRAM
at 0xc0000000 hang on boot, which is a grave defect.

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
arch/arm/mach-stm32mp/dram_init.c