From: Matthew McClintock <msm@freescale.com>
Date: Tue, 22 Aug 2006 14:31:59 +0000 (-0500)
Subject: Fix disable_of booting
X-Git-Tag: v2025.01-rc5-pxa1908~22941^2~3^2~36
X-Git-Url: http://git.dujemihanovic.xyz/html/static/gitweb.css?a=commitdiff_plain;h=5de62c47a8628b3da4d73f7c07027f32a3342d40;p=u-boot.git

Fix disable_of booting

Signed-off-by: Matthew McClintock <msm@freescale.com>
---

diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c
index f980659f7b..652d8431da 100644
--- a/common/cmd_bootm.c
+++ b/common/cmd_bootm.c
@@ -737,7 +737,7 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag,
 	}
 
 #ifdef CONFIG_OF_FLAT_TREE
-	if(argc >= 3) {
+	if(argc > 3) {
 		of_flat_tree = (char *) simple_strtoul(argv[3], NULL, 16);
 		hdr = (image_header_t *)of_flat_tree;
 
@@ -802,6 +802,9 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag,
 		}
 		printf ("   Booting using flat device tree at 0x%x\n",
 				of_flat_tree);
+	} else if(getenv("disable_of") == NULL) {
+		printf ("ERROR: bootm needs flat device tree as third argument\n");
+		return;
 	}
 #endif
 	if (!data) {