openwrt-6.x/package/boot/uboot-mediatek/patches/280-image-fdt-save-name-of-FIT-configuration-in-chosen-node.patch
Daniel Golle 011ba05fd3 uboot-mediatek: update to U-Boot v2025.10
The most relevant change is the removal of the empty board_init()
functions by u-boot/u-boot@70a4d1fa1d, which makes many patches not
apply anymore and also requires most board defconfigs to be updated
by adding "# CONFIG_BOARD_INIT is not set" to them.

Also some config symbols have been renamed and downstream boards
had to be adapted accordingly:

u-boot/u-boot@0fd9a3480a ("env: Rename OVERWRITE_ETHADDR_ONCE to
                            ENV_OVERWRITE_ETHADDR_ONCE")

u-boot/u-boot@5fb88fa725 ("env: Rename SYS_REDUNDAND_ENVIRONMENT to
                            ENV_REDUNDANT")

u-boot/u-boot@123682c765 ("env: Rename SYS_RELOC_GD_ENV_ADDR to
                            ENV_RELOC_GD_ENV_ADDR")

u-boot/u-boot@0f44d5549e ("env: Rename SYS_MMC_ENV_DEV to
                            ENV_MMC_DEVICE_INDEX")

u-boot/u-boot@31617b880a ("env: Rename SYS_MMC_ENV_PART to
                            ENV_MMC_EMMC_HW_PARTITION")

u-boot/u-boot@ffc4914703 ("env: Rename ENV_MMC_PARTITION to
                            ENV_MMC_SW_PARTITION")

u-boot/u-boot@fb5235239a ("env: Rename DEFAULT_ENV_FILE to
                            ENV_DEFAULT_ENV_TEXT_FILE")

(also renamed USE_DEFAULT_ENV_FILE to USE_ENV_DEFAULT_ENV_TEXT_FILE)

Remove upstreamed patches:
 * 001-mtd-spinand-winbond-add-Winbond-W25N04KV-flash-suppo.patch
   u-boot/u-boot@fe37fb8214

 * 002-mtd-spinand-gigadevice-sync-supported-chips-with-lin.patch
   u-boot/u-boot@506ceddffd

 * 003-net-mediatek-correct-the-AN8855-TPID-value-in-port-i.patch
   u-boot/u-boot@70db2be9fb

 * 004-01-serial-mediatek-fix-register-names-and-offsets.patch
   u-boot/u-boot@6e15d3f91a

 * 004-02-serial-mediatek-enable-baudrate-accuracy-compensatio.patch
   u-boot/u-boot@6952209ef2

 * 005-clk-mediatek-add-dummy-clk-enable-disable-ops-for-ap.patch
   u-boot/u-boot@1bf2121297

 * 006-env-Fix-possible-out-of-bound-access-in-env_do_env_s.patch
   u-boot/u-boot@0ffd456516

 * 130-01-env-mtd-add-the-missing-put_mtd_device.patch
   u-boot/u-boot@39ae954b04

 * 130-02-env-mtd-initialize-saved_buf-pointer.patch
   u-boot/u-boot@7e842bd331

 * 170-cmd-bootmenu-permit-to-select-bootmenu-entry-with.patch
   u-boot/u-boot@8c986521c3

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2025-10-10 16:35:58 +01:00

32 lines
1.1 KiB
Diff

From 5f2d5915f8ea4785bc2b8a26955e176a7898c15b Mon Sep 17 00:00:00 2001
From: Daniel Golle <daniel@makrotopia.org>
Date: Tue, 12 Apr 2022 21:00:43 +0100
Subject: [PATCH] image-fdt: save name of FIT configuration in '/chosen' node
It can be useful for the OS (Linux) to know which configuration has
been chosen by U-Boot when launching a FIT image.
Store the name of the FIT configuration node used in a new string
property called 'u-boot,bootconf' in the '/chosen' node in device tree.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
---
boot/image-fdt.c | 6 ++++++
1 file changed, 6 insertions(+)
--- a/boot/image-fdt.c
+++ b/boot/image-fdt.c
@@ -631,6 +631,12 @@ int image_setup_libfdt(struct bootm_head
images->fit_uname_cfg,
strlen(images->fit_uname_cfg) + 1, 1);
+ /* Store name of configuration node as u-boot,bootconf in /chosen node */
+ if (images->fit_uname_cfg)
+ fdt_find_and_setprop(blob, "/chosen", "u-boot,bootconf",
+ images->fit_uname_cfg,
+ strlen(images->fit_uname_cfg) + 1, 1);
+
/* Update ethernet nodes */
fdt_fixup_ethernet(blob);
#if IS_ENABLED(CONFIG_CMD_PSTORE)