[PATCH] bootm: Support get entry when setup.bin were not found
牛 志宏
Zone.Niuzh at hotmail.com
Wed Apr 23 08:42:57 CEST 2025
This extends the bootm command to allow get entry when setup.bin ware not found on x86/x86_64.
Signed-off-by: Niu Zhihong <zone.niuzh at hotmail.com>
---
boot/bootm.c | 18 +++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)
diff --git a/boot/bootm.c b/boot/bootm.c
index f5cbb10f0d1..50bc590009b 100644
--- a/boot/bootm.c
+++ b/boot/bootm.c
@@ -401,9 +401,21 @@ static int bootm_find_os(const char *cmd_name, const char *addr_fit)
ulong len;
ret = boot_get_setup(&images, IH_ARCH_I386, &images.ep, &len);
- if (ret < 0 && ret != -ENOENT) {
- puts("Could not find a valid setup.bin for x86\n");
- return 1;
+ if (ret < 0 ) {
+ if (ret != -ENOENT) {
+ puts("Could not find a valid setup.bin for x86\n");
+ return 1;
+ }
+#if CONFIG_IS_ENABLED(FIT)
+ if (images.fit_uname_os) {
+ ret = fit_image_get_entry(images.fit_hdr_os,
+ images.fit_noffset_os, &images.ep);
+ if (ret) {
+ puts("Can't get entry point property!\n");
+ return 1;
+ }
+ }
+#endif
}
/* Kernel entry point is the setup.bin */
} else if (images.legacy_hdr_valid) {
--
2.39.5 (Apple Git-154)
More information about the U-Boot
mailing list