Fix of_data copying for CONFIG_OF_FLAT_TREE-using boards
authorAndy Fleming <afleming@freescale.com>
Wed, 15 Aug 2007 22:30:56 +0000 (17:30 -0500)
committerWolfgang Denk <wd@denx.de>
Thu, 16 Aug 2007 10:10:56 +0000 (12:10 +0200)
The fix, "Fix where the #ifdef CFG_BOOTMAPSZ is placed"
neglected to *also* put the code inside the similar #ifdef
for CONFIG_OF_FLAT_TREE.

Signed-off-by: Andy Fleming <afleming@freescale.com>
common/cmd_bootm.c

index df1d0380d4affdcfe06cda3a6c93ef512781533d..90e3f8b9afe465608468a9c7629b5a6e21d809d9 100644 (file)
@@ -987,6 +987,15 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag,
 #endif
 #endif /* CONFIG_OF_LIBFDT */
 #if defined(CONFIG_OF_FLAT_TREE)
+#ifdef CFG_BOOTMAPSZ
+       /*
+        * The blob must be within CFG_BOOTMAPSZ,
+        * so we flag it to be copied if it is not.
+        */
+       if (of_flat_tree >= (char *)CFG_BOOTMAPSZ)
+               of_data = of_flat_tree;
+#endif
+
        /* move of_flat_tree if needed */
        if (of_data) {
                ulong of_start, of_len;