[PATCH 08/10] riscv: Call bootm_final()

Simon Glass sjg at chromium.org
Wed Jan 7 01:31:25 CET 2026


From: Simon Glass <sjg at chromium.org>

Make use of this function, adding some pieces needed by RISC-V

Drop the udc_disconnect() from EFI_LOADER since it is now done in
bootm_final()

Signed-off-by: Simon Glass <sjg at chromium.org>
Signed-off-by: Simon Glass <simon.glass at canonical.com>
---

 arch/riscv/lib/bootm.c        | 22 +---------------------
 boot/bootm_final.c            |  9 ++++++++-
 lib/efi_loader/efi_boottime.c |  2 --
 3 files changed, 9 insertions(+), 24 deletions(-)

diff --git a/arch/riscv/lib/bootm.c b/arch/riscv/lib/bootm.c
index 35403e03ab0..bd47275b52e 100644
--- a/arch/riscv/lib/bootm.c
+++ b/arch/riscv/lib/bootm.c
@@ -32,27 +32,7 @@ DECLARE_GLOBAL_DATA_PTR;
  */
 static void announce_and_cleanup(int fake)
 {
-	printf("\nStarting kernel ...%s\n\n", fake ?
-		"(fake run for tracing)" : "");
-	bootstage_mark_name(BOOTSTAGE_ID_BOOTM_HANDOFF, "start_kernel");
-#ifdef CONFIG_BOOTSTAGE_FDT
-	bootstage_fdt_add_report();
-#endif
-#if CONFIG_IS_ENABLED(BOOTSTAGE_REPORT)
-	bootstage_report();
-#endif
-
-#ifdef CONFIG_USB_DEVICE
-	udc_disconnect();
-#endif
-
-	/*
-	 * Call remove function of all devices with a removal flag set.
-	 * This may be useful for last-stage operations, like cancelling
-	 * of DMA operation or releasing device internal buffers.
-	 */
-	dm_remove_devices_active();
-
+	bootm_final(fake);
 	cleanup_before_linux();
 }
 
diff --git a/boot/bootm_final.c b/boot/bootm_final.c
index 7077702d8c7..7f069877d06 100644
--- a/boot/bootm_final.c
+++ b/boot/bootm_final.c
@@ -7,17 +7,24 @@
 
 #include <bootm.h>
 #include <bootstage.h>
+#include <usb.h>
 #include <dm/root.h>
 
 void bootm_final(enum bootm_final_t flags)
 {
-	printf("\nStarting kernel ...\n\n");
+	printf("\nStarting kernel ...%s\n\n", flags & BOOTM_FINAL_FAKE ?
+		"(fake run for tracing)" : "");
 
 	bootstage_mark_name(BOOTSTAGE_ID_BOOTM_HANDOFF, "start_kernel");
 
+	if (IS_ENABLED(CONFIG_BOOTSTAGE_FDT) && IS_ENABLED(CONFIG_CMD_FDT))
+		bootstage_fdt_add_report();
 	if (IS_ENABLED(CONFIG_BOOTSTAGE_REPORT))
 		bootstage_report();
 
+	if (IS_ENABLED(CONFIG_USB_DEVICE))
+		udc_disconnect();
+
 	/*
 	 * Call remove function of all devices with a removal flag set.
 	 * This may be useful for last-stage operations, like cancelling
diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c
index 13d0d4dbe88..0bc66ee61a8 100644
--- a/lib/efi_loader/efi_boottime.c
+++ b/lib/efi_loader/efi_boottime.c
@@ -2238,8 +2238,6 @@ static efi_status_t EFIAPI efi_exit_boot_services(efi_handle_t image_handle,
 
 	if (!efi_st_keep_devices) {
 		bootm_disable_interrupts();
-		if (IS_ENABLED(CONFIG_DM_ETH))
-			eth_halt();
 		board_quiesce_devices();
 		bootm_final(0);
 	}
-- 
2.43.0



More information about the U-Boot mailing list