From bee3551e00046678e300e5ba1392443f30cbe45a Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sat, 17 Dec 2022 18:41:13 +0100 Subject: Revert "Revert "cmd: pxe_utils: Check fdtcontroladdr in label_boot"" This reverts commit ed6251187afabf811a5fd49a44ebd61c53c7b378. Superseded by "cmd: pxe_utils: Limit fdtcontroladdr usage to non-fitImage" which is less heavy-handed approach and retains part of the original behavior for non-fitImage. Signed-off-by: Marek Vasut Acked-by: Neil Armstrong --- boot/pxe_utils.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'boot') diff --git a/boot/pxe_utils.c b/boot/pxe_utils.c index 96528aa14c0..8133006875f 100644 --- a/boot/pxe_utils.c +++ b/boot/pxe_utils.c @@ -616,7 +616,10 @@ static int label_boot(struct pxe_context *ctx, struct pxe_label *label) * Scenario 2: If there is an fdt_addr specified, pass it along to * bootm, and adjust argc appropriately. * - * Scenario 3: fdt blob is not available. + * Scenario 3: If there is an fdtcontroladdr specified, pass it along to + * bootm, and adjust argc appropriately. + * + * Scenario 4: fdt blob is not available. */ bootm_argv[3] = env_get("fdt_addr_r"); @@ -721,6 +724,9 @@ static int label_boot(struct pxe_context *ctx, struct pxe_label *label) if (!bootm_argv[3]) bootm_argv[3] = env_get("fdt_addr"); + if (!bootm_argv[3]) + bootm_argv[3] = env_get("fdtcontroladdr"); + if (bootm_argv[3]) { if (!bootm_argv[2]) bootm_argv[2] = "-"; -- cgit v1.3.1 From 519e6641dbdd46907feac094ccd032743f4174b0 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Wed, 14 Dec 2022 07:45:18 +0100 Subject: cmd: pxe_utils: Limit fdtcontroladdr usage to non-fitImage Commit d5ba6188dfb ("cmd: pxe_utils: Check fdtcontroladdr in label_boot") forces '$fdtcontroladdr' DT address as a third parameter of bootm command even if the PXE transfer pulls in a fitImage which contains configuration node with its own DT that is preferrable to be passed to Linux. Limit the $fdtcontroladdr fallback utilization to non-fitImages, since it is highly likely a fitImage would come with its own DT, while single-file images do need a separate DT. Fixes: d5ba6188dfb ("cmd: pxe_utils: Check fdtcontroladdr in label_boot") Signed-off-by: Marek Vasut Reviewed-by: Quentin Schulz Tested-by: Quentin Schulz Reviewed-by: Simon Glass Reviewed-by: Peter Hoyes Tested-by: Peter Hoyes Reviewed-by: Neil Armstrong --- boot/pxe_utils.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'boot') diff --git a/boot/pxe_utils.c b/boot/pxe_utils.c index 8133006875f..099aa2f4bc7 100644 --- a/boot/pxe_utils.c +++ b/boot/pxe_utils.c @@ -617,7 +617,7 @@ static int label_boot(struct pxe_context *ctx, struct pxe_label *label) * bootm, and adjust argc appropriately. * * Scenario 3: If there is an fdtcontroladdr specified, pass it along to - * bootm, and adjust argc appropriately. + * bootm, and adjust argc appropriately, unless the image type is fitImage. * * Scenario 4: fdt blob is not available. */ @@ -724,7 +724,10 @@ static int label_boot(struct pxe_context *ctx, struct pxe_label *label) if (!bootm_argv[3]) bootm_argv[3] = env_get("fdt_addr"); - if (!bootm_argv[3]) + kernel_addr_r = genimg_get_kernel_addr(kernel_addr); + buf = map_sysmem(kernel_addr_r, 0); + + if (!bootm_argv[3] && genimg_get_format(buf) != IMAGE_FORMAT_FIT) bootm_argv[3] = env_get("fdtcontroladdr"); if (bootm_argv[3]) { @@ -733,8 +736,6 @@ static int label_boot(struct pxe_context *ctx, struct pxe_label *label) bootm_argc = 4; } - kernel_addr_r = genimg_get_kernel_addr(kernel_addr); - buf = map_sysmem(kernel_addr_r, 0); /* Try bootm for legacy and FIT format image */ if (genimg_get_format(buf) != IMAGE_FORMAT_INVALID && IS_ENABLED(CONFIG_CMD_BOOTM)) -- cgit v1.3.1