Patchwork [U-Boot,06/15] x86: Provide a function to clean up just before booting a zimage

login
register
mail settings
Submitter Simon Glass
Date Oct. 24, 2012, 4:04 a.m.
Message ID <1351051486-6980-7-git-send-email-sjg@chromium.org>
Download mbox | patch
Permalink /patch/193653/
State Accepted, archived
Delegated to: Simon Glass
Headers show

Comments

Simon Glass - Oct. 24, 2012, 4:04 a.m.
From: Stefan Reinauer <reinauer@chromium.org>

This function can be used by boards which want to do some clean-up
before booting a zImage.

Signed-off-by: Stefan Reinauer <reinauer@chromium.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
---
 arch/x86/lib/zimage.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

Patch

diff --git a/arch/x86/lib/zimage.c b/arch/x86/lib/zimage.c
index 1d6a0ed..a1366a1 100644
--- a/arch/x86/lib/zimage.c
+++ b/arch/x86/lib/zimage.c
@@ -39,6 +39,7 @@ 
 #ifdef CONFIG_SYS_COREBOOT_
 #include <asm/arch/timestamp.h>
 #endif
+#include <linux/compiler.h>
 
 /*
  * Memory lay-out:
@@ -282,8 +283,18 @@  int setup_zimage(struct boot_params *setup_base, char *cmd_line, int auto_boot,
 	return 0;
 }
 
+/*
+ * Implement a weak default function for boards that optionally
+ * need to clean up the system before jumping to the kernel.
+ */
+__weak void board_final_cleanup(void)
+{
+}
+
 void boot_zimage(void *setup_base, void *load_address)
 {
+	board_final_cleanup();
+
 	printf("\nStarting kernel ...\n\n");
 #ifdef CONFIG_SYS_COREBOOT_
 	timestamp_add_now(TS_U_BOOT_START_KERNEL);