xilinx: common: change bootm_size to not go beyond ram_top
PATCH v2 1/1 xilinx: common: change bootm_size to not go beyond ram_top
The available ram can be limited by ram_top as that depends on the reserved memory nodes provided by the device-tree (via board_get_usable_ram_top), so make sure to respect ram_top when setting up bootm_size to avoid overlapping reserved memory regions (e.g. memory used by OP-TEE).
The same logic is available in env_get_bootm_size when bootm_size is not defined by the default environment.
---
Change in v2:
- Declare bootm_size based on ram top and base
board/xilinx/common/board.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
board/xilinx/common/board.c +1 -1
@@ -377,7 +377,7 @@ int board_late_init_xilinx(void)u32 ret =0 ;int i, id, macid =0 ;struct xilinx_board_description *desc; -phys_size_t bootm_size = gd->ram_size; +phys_size_t bootm_size = gd->ram_top - gd->ram_base;if (!CONFIG_IS_ENABLED (MICROBLAZE )) {ulong scriptaddr;
Signature · 1 line
2.34.1
Michal Simek
AppliedQuoted 23 lines · Ricardo Salveti
The available ram can be limited by
ram_topas that depends on the reserved memory nodes provided by the device-tree (viaboard_get_usable_ram_top), so make sure to respectram_topwhen setting upbootm_sizeto avoid overlapping reserved memory regions (e.g. memory used by OP-TEE).The same logic is available in
env_get_bootm_sizewhenbootm_sizeis not defined by the default environment.Signed-off-by Ricardo Salveti <[email protected]>---
Change in v2:
- Declarebootm_sizebased on ram top and baseboard/xilinx/common/board.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)board/xilinx/common/board.c +0
-0
board/xilinx/common/board.c int board_late_init_xilinx(void) · line 383
Quoted 8 lines
board/xilinx/common/board.c +1
-1@@ -377,7 +377,7 @@ int board_late_init_xilinx(void)u32 ret =0 ;int i, id, macid =0 ;struct xilinx_board_description *desc; -phys_size_t bootm_size = gd->ram_size; +phys_size_t bootm_size = gd->ram_top - gd->ram_base;if (!CONFIG_IS_ENABLED (MICROBLAZE )) {ulong scriptaddr;
Applied.
M