From e6e3b9d7b55ce2563f9da0b5991605f15bd38163 Mon Sep 17 00:00:00 2001 From: Ricardo Salveti Date: Thu, 20 Jan 2022 16:17:30 -0300 Subject: 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. Signed-off-by: Ricardo Salveti Link: https://lore.kernel.org/r/20220120191730.2009270-1-ricardo@foundries.io Signed-off-by: Michal Simek --- board/xilinx/common/board.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'board/xilinx/common/board.c') diff --git a/board/xilinx/common/board.c b/board/xilinx/common/board.c index 78a5d0efa86..6fce23197a4 100644 --- a/board/xilinx/common/board.c +++ b/board/xilinx/common/board.c @@ -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; -- cgit v1.2.3 From f063100593942a33d8bf40dbc95b4b44e417a368 Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Thu, 17 Feb 2022 14:28:38 +0100 Subject: xilinx: Enable OF_BOARD for zynq and zynqmp boards The commit 985503439762 ("fdt: Don't call board_fdt_blob_setup() without OF_BOARD") forced to enable OF_BOARD for platforms which provide DT externally. Zynq/ZynqMP boards are using this feature for a long time that's why there is a need to enable it by default. Also code expects to return error in case of error that's why also fill it. Signed-off-by: Michal Simek Link: https://lore.kernel.org/r/9f11bbffe2849f4da7d72712082d579262fe8fd8.1645104518.git.michal.simek@xilinx.com --- board/xilinx/common/board.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'board/xilinx/common/board.c') diff --git a/board/xilinx/common/board.c b/board/xilinx/common/board.c index 6fce23197a4..0068cb87926 100644 --- a/board/xilinx/common/board.c +++ b/board/xilinx/common/board.c @@ -319,7 +319,7 @@ __maybe_unused int xilinx_read_eeprom(void) return 0; } -#if defined(CONFIG_OF_BOARD) || defined(CONFIG_OF_SEPARATE) +#if defined(CONFIG_OF_BOARD) void *board_fdt_blob_setup(int *err) { void *fdt_blob; @@ -355,6 +355,7 @@ void *board_fdt_blob_setup(int *err) debug("DTB is also not passed via %p\n", fdt_blob); + *err = -EINVAL; return NULL; } #endif -- cgit v1.2.3