From 80e092decd7a2b3806f7de6569dccf70a6c3b50d Mon Sep 17 00:00:00 2001 From: Vignesh Raghavendra Date: Mon, 20 Feb 2023 10:03:08 +0530 Subject: mach-k3: common: Allow overriding boot_fit via env Currently, code doesn't take into account the fact that user may have overriden boot_fit value via env using saveenv. Check if boot_fit is already set before overriding based on SoC type. This allows users to boot signed fitImage or regular kernel Image and dtbs consistently without needing to stop at U-Boot prompt and overriding the variable each time. Signed-off-by: Vignesh Raghavendra --- arch/arm/mach-k3/common.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-k3/common.c b/arch/arm/mach-k3/common.c index 77e1ed9419..e4a825365c 100644 --- a/arch/arm/mach-k3/common.c +++ b/arch/arm/mach-k3/common.c @@ -628,8 +628,10 @@ int misc_init_r(void) } /* Default FIT boot on non-GP devices */ - if (get_device_type() != K3_DEVICE_TYPE_GP) - env_set("boot_fit", "1"); + if (get_device_type() != K3_DEVICE_TYPE_GP) { + if (!env_get("boot_fit")) + env_set("boot_fit", "1"); + } return 0; } -- cgit v1.2.3