x86: Move the bootm state for zimage into cmd/
Rather than holding the state in the implementation code, move it to the
command code. The state is now passed to the implementation functions
and can there (with future work) be pass in from bootstd, without going
through the commands.
Signed-off-by: Simon Glass <sjg@chromium.org>
diff --git a/arch/x86/include/asm/zimage.h b/arch/x86/include/asm/zimage.h
index b592057..4ed6d8d 100644
--- a/arch/x86/include/asm/zimage.h
+++ b/arch/x86/include/asm/zimage.h
@@ -10,6 +10,8 @@
#include <asm/bootparam.h>
#include <asm/e820.h>
+struct bootm_info;
+
/* linux i386 zImage/bzImage header. Offsets relative to
* the start of the image */
@@ -42,8 +44,6 @@
ZBOOT_STATE_COUNT = 5,
};
-extern struct bootm_info bmi;
-
/**
* zboot_load() - Load a zimage
*
@@ -51,21 +51,21 @@
*
* Return: 0 if OK, -ve on error
*/
-int zboot_load(void);
+int zboot_load(struct bootm_info *bmi);
/**
* zboot_setup() - Set up the zboot image reeady for booting
*
* Return: 0 if OK, -ve on error
*/
-int zboot_setup(void);
+int zboot_setup(struct bootm_info *bmi);
/**
* zboot_go() - Start the image
*
* Return: 0 if OK, -ve on error
*/
-int zboot_go(void);
+int zboot_go(struct bootm_info *bmi);
/**
* load_zimage() - Load a zImage or bzImage
@@ -104,6 +104,7 @@
*
* Record information about a zimage so it can be booted
*
+ * @bmi: Bootm information
* @bzimage_addr: Address of the bzImage to boot
* @bzimage_size: Size of the bzImage, or 0 to detect this
* @initrd_addr: Address of the initial ramdisk, or 0 if none
@@ -114,14 +115,17 @@
* @cmdline: Environment variable containing the 'override' command line, or
* NULL to use the one in the setup block
*/
-void zboot_start(ulong bzimage_addr, ulong bzimage_size, ulong initrd_addr,
- ulong initrd_size, ulong base_addr, const char *cmdline);
+void zboot_start(struct bootm_info *bmi, ulong bzimage_addr, ulong bzimage_size,
+ ulong initrd_addr, ulong initrd_size, ulong base_addr,
+ const char *cmdline);
/**
* zboot_info() - Show simple info about a zimage
*
- * Shows wherer the kernel was loaded and also the setup base
+ * Shows where the kernel was loaded and also the setup base
+ *
+ * @bmi: Bootm information
*/
-void zboot_info(void);
+void zboot_info(struct bootm_info *bmi);
#endif