Patchwork [U-Boot,2/4] blackfin: x86: bootm: Handle PREP stage of bootm

login
register
mail settings
Submitter Simon Glass
Date July 11, 2013, 6:08 a.m.
Message ID <1373522891-7677-3-git-send-email-sjg@chromium.org>
Download mbox | patch
Permalink /patch/258314/
State Accepted
Delegated to: Tom Rini
Headers show

Comments

Simon Glass - July 11, 2013, 6:08 a.m.
The OS function is now always called with the PREP stage. Adjust the
remaining bootm OS functions to deal with this correctly.

Signed-off-by: Simon Glass <sjg@chromium.org>
---
 arch/blackfin/lib/boot.c |  2 ++
 arch/x86/lib/bootm.c     |  2 ++
 common/cmd_bootm.c       | 16 ++++++++++++++++
 3 files changed, 20 insertions(+)
Sughosh Ganu - July 12, 2013, 8:28 a.m.
On Wed Jul 10, 2013 at 11:08:09PM -0700, Simon Glass wrote:
> The OS function is now always called with the PREP stage. Adjust the
> remaining bootm OS functions to deal with this correctly.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
>  arch/blackfin/lib/boot.c |  2 ++
>  arch/x86/lib/bootm.c     |  2 ++
>  common/cmd_bootm.c       | 16 ++++++++++++++++
>  3 files changed, 20 insertions(+)
> 
> diff --git a/arch/blackfin/lib/boot.c b/arch/blackfin/lib/boot.c
> index 768a882..5644d58 100644
> --- a/arch/blackfin/lib/boot.c
> +++ b/arch/blackfin/lib/boot.c
> @@ -42,6 +42,8 @@ int do_bootm_linux(int flag, int argc, char * const argv[], bootm_headers_t *ima
>  	int	(*appl) (char *cmdline);
>  	char	*cmdline;
>  
> +	if (flag & BOOTM_STATE_OS_PREP)
> +		return 0;
>  	if ((flag != 0) && (flag != BOOTM_STATE_OS_GO))
>  		return 1;

Minor nit; A blank line between the two if conditions would be
good. Applies for all the hunks in this patch.

-sughosh

Patch

diff --git a/arch/blackfin/lib/boot.c b/arch/blackfin/lib/boot.c
index 768a882..5644d58 100644
--- a/arch/blackfin/lib/boot.c
+++ b/arch/blackfin/lib/boot.c
@@ -42,6 +42,8 @@  int do_bootm_linux(int flag, int argc, char * const argv[], bootm_headers_t *ima
 	int	(*appl) (char *cmdline);
 	char	*cmdline;
 
+	if (flag & BOOTM_STATE_OS_PREP)
+		return 0;
 	if ((flag != 0) && (flag != BOOTM_STATE_OS_GO))
 		return 1;
 
diff --git a/arch/x86/lib/bootm.c b/arch/x86/lib/bootm.c
index 0d3250c..b84e35a 100644
--- a/arch/x86/lib/bootm.c
+++ b/arch/x86/lib/bootm.c
@@ -48,6 +48,8 @@  int do_bootm_linux(int flag, int argc, char * const argv[],
 	size_t		len;
 #endif
 
+	if (flag & BOOTM_STATE_OS_PREP)
+		return 0;
 	if ((flag != 0) && (flag != BOOTM_STATE_OS_GO))
 		return 1;
 
diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c
index 7a7c760..075e7dc 100644
--- a/common/cmd_bootm.c
+++ b/common/cmd_bootm.c
@@ -1473,6 +1473,8 @@  static int do_bootm_netbsd(int flag, int argc, char * const argv[],
 	char *consdev;
 	char *cmdline;
 
+	if (flag & BOOTM_STATE_OS_PREP)
+		return 0;
 	if ((flag != 0) && (flag != BOOTM_STATE_OS_GO))
 		return 1;
 
@@ -1552,6 +1554,8 @@  static int do_bootm_lynxkdi(int flag, int argc, char * const argv[],
 {
 	image_header_t *hdr = &images->legacy_hdr_os_copy;
 
+	if (flag & BOOTM_STATE_OS_PREP)
+		return 0;
 	if ((flag != 0) && (flag != BOOTM_STATE_OS_GO))
 		return 1;
 
@@ -1574,6 +1578,8 @@  static int do_bootm_rtems(int flag, int argc, char * const argv[],
 {
 	void (*entry_point)(bd_t *);
 
+	if (flag & BOOTM_STATE_OS_PREP)
+		return 0;
 	if ((flag != 0) && (flag != BOOTM_STATE_OS_GO))
 		return 1;
 
@@ -1607,6 +1613,8 @@  static int do_bootm_ose(int flag, int argc, char * const argv[],
 {
 	void (*entry_point)(void);
 
+	if (flag & BOOTM_STATE_OS_PREP)
+		return 0;
 	if ((flag != 0) && (flag != BOOTM_STATE_OS_GO))
 		return 1;
 
@@ -1641,6 +1649,8 @@  static int do_bootm_plan9(int flag, int argc, char * const argv[],
 	void (*entry_point)(void);
 	char *s;
 
+	if (flag & BOOTM_STATE_OS_PREP)
+		return 0;
 	if ((flag != 0) && (flag != BOOTM_STATE_OS_GO))
 		return 1;
 
@@ -1688,6 +1698,8 @@  static int do_bootm_vxworks(int flag, int argc, char * const argv[],
 {
 	char str[80];
 
+	if (flag & BOOTM_STATE_OS_PREP)
+		return 0;
 	if ((flag != 0) && (flag != BOOTM_STATE_OS_GO))
 		return 1;
 
@@ -1711,6 +1723,8 @@  static int do_bootm_qnxelf(int flag, int argc, char * const argv[],
 	char *local_args[2];
 	char str[16];
 
+	if (flag & BOOTM_STATE_OS_PREP)
+		return 0;
 	if ((flag != 0) && (flag != BOOTM_STATE_OS_GO))
 		return 1;
 
@@ -1736,6 +1750,8 @@  static int do_bootm_integrity(int flag, int argc, char * const argv[],
 {
 	void (*entry_point)(void);
 
+	if (flag & BOOTM_STATE_OS_PREP)
+		return 0;
 	if ((flag != 0) && (flag != BOOTM_STATE_OS_GO))
 		return 1;