mirror of
https://github.com/smaeul/u-boot.git
synced 2025-10-13 20:36:02 +01:00
rockchip: sdram: Limit usable ram_top to max 4G
U-Boot only works correctly when it uses RAM below the 4G address boundary on Rockchip SoCs. Limit usable gd->ram_top to max 4G. Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
This commit is contained in:
parent
57ad1ed7e8
commit
356236126d
@ -487,7 +487,8 @@ int dram_init(void)
|
||||
|
||||
phys_addr_t board_get_usable_ram_top(phys_size_t total_size)
|
||||
{
|
||||
unsigned long top = CFG_SYS_SDRAM_BASE + SDRAM_MAX_SIZE;
|
||||
/* Make sure U-Boot only uses the space below the 4G address boundary */
|
||||
u64 top = min_t(u64, CFG_SYS_SDRAM_BASE + SDRAM_MAX_SIZE, SZ_4G);
|
||||
|
||||
return (gd->ram_top > top) ? top : gd->ram_top;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user