summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2026-03-18 18:36:50 -0600
committerTom Rini <[email protected]>2026-03-18 18:36:50 -0600
commiteb00c710508d09b2a3b9aca75dd18280f1304703 (patch)
treef91864725bde06d16a7243e0a539b28b03c0f125 /include
parent28608c808774a39ec47d31353b141db547136e58 (diff)
parentdc88ac7681084b2aff8c3c4e1bb3e861451489a3 (diff)
Merge patch series "bootm: Clean up arch-specific, pre-OS clean-up"
Simon Glass <[email protected]> says: Each arch does something slightly different before booting the OS. Some archs even do different things depending on the CPU type. It is quite hard to know what actually happens in the final milliseconds before the OS boot. This series attempts to start cleaning up U-Boot in this area. The basic intent is to create a new bootm_final() function which can be called by all archs. It provides some flags for a couple of necessary variations but otherwise it is generic. All architectures are converted over to use this new function. board_quiesce_devices() is moved into bootm_final() so that all archs benefit from it. This series fixes a bug in device_remove() is fixed where removing a parent with specialised flags (e.g. DM_REMOVE_ACTIVE_ALL) could leave children activated, since they do not match the flags. This fixes is needed to avoid bootm_final() causing test failures on sandbox. Future work could take this a little further: - Convert EFI loader to use the same function - Improve comments for cleanup_before_linux() across architectures - Support fake-run tracing on all archs Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'include')
-rw-r--r--include/bootm.h10
-rw-r--r--include/bootstage.h8
2 files changed, 18 insertions, 0 deletions
diff --git a/include/bootm.h b/include/bootm.h
index 4060cec7fc0..f6958be751a 100644
--- a/include/bootm.h
+++ b/include/bootm.h
@@ -321,4 +321,14 @@ void zimage_dump(struct boot_params *base_ptr, bool show_cmdline);
*/
int bootm_boot_start(ulong addr, const char *cmdline);
+/**
+ * bootm_final() - Announce and do cleanup before boot
+ *
+ * This performs the common pre-boot steps: printing the "Starting kernel"
+ * message, recording bootstage data, and removing active devices.
+ *
+ * @flag: Boot state flags (BOOTM_STATE_OS_FAKE_GO prints a fake-run message)
+ */
+void bootm_final(int flag);
+
#endif
diff --git a/include/bootstage.h b/include/bootstage.h
index 528d0ca0614..62fb99110f0 100644
--- a/include/bootstage.h
+++ b/include/bootstage.h
@@ -435,6 +435,14 @@ static inline uint32_t bootstage_accum(enum bootstage_id id)
return 0;
}
+static inline void bootstage_report(void)
+{
+}
+
+static inline void bootstage_fdt_add_report(void)
+{
+}
+
static inline int bootstage_stash(void *base, int size)
{
return 0; /* Pretend to succeed */