summaryrefslogtreecommitdiff
path: root/arch/microblaze/lib
diff options
context:
space:
mode:
authorJohn Rigby <john.rigby@linaro.org>2010-10-13 13:57:34 -0600
committerWolfgang Denk <wd@denx.de>2010-10-18 22:52:10 +0200
commit5a75e121075a63f312ae07409477b6f686840a93 (patch)
treeed3bf92da428f7cec1cdc1a5689deae6d38ce7ae /arch/microblaze/lib
parenta6bd9e83abc811d5cade88cb5e7caf93b4f7abe1 (diff)
downloadu-boot-imx-5a75e121075a63f312ae07409477b6f686840a93.zip
u-boot-imx-5a75e121075a63f312ae07409477b6f686840a93.tar.gz
u-boot-imx-5a75e121075a63f312ae07409477b6f686840a93.tar.bz2
FDT: only call boot_get_fdt from generic code
All arches except nios2 and microblaze call boot_get_fdt from bootm_start in common/cmd_bootm.c. Having nios2 and microblaze do so as well removes code from their respective do_bootm_linux routines and allows removal of a nasty ifdef from bootm_start. In the case where boot_get_fdt returns an error bootm_start returns and the platform specific do_bootm_linux routines will never get called. Also only check argv[3] for an fdt addr if argc > 3 first. This is already the case for nios2. Signed-off-by: John Rigby <john.rigby@linaro.org> CC: Scott McNutt <smcnutt@psyent.com> CC: Michal Simek <monstr@monstr.eu> CC: Thomas Chou <thomas@wytron.com.tw> Acked-by: Wolfgang Denk <wd@denx.de> Acked-by: Michal Simek <monstr@monstr.eu> Tested-by: Thomas Chou <thomas@wytron.com.tw>
Diffstat (limited to 'arch/microblaze/lib')
-rw-r--r--arch/microblaze/lib/bootm.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/arch/microblaze/lib/bootm.c b/arch/microblaze/lib/bootm.c
index 8e2c6d8..9f6d6d6 100644
--- a/arch/microblaze/lib/bootm.c
+++ b/arch/microblaze/lib/bootm.c
@@ -46,12 +46,9 @@ int do_bootm_linux(int flag, int argc, char * const argv[], bootm_headers_t *ima
char *of_flat_tree = NULL;
#if defined(CONFIG_OF_LIBFDT)
- ulong of_size = 0;
-
- /* find flattened device tree */
- ret = boot_get_fdt (flag, argc, argv, images, &of_flat_tree, &of_size);
- if (ret)
- return 1;
+ /* did generic code already find a device tree? */
+ if (images->ft_len)
+ of_flat_tree = images->ft_addr;
#endif
theKernel = (void (*)(char *, ulong, ulong))images->ep;
@@ -64,9 +61,8 @@ int do_bootm_linux(int flag, int argc, char * const argv[], bootm_headers_t *ima
show_boot_progress (15);
- if (!(ulong) of_flat_tree)
- of_flat_tree = (char *)simple_strtoul (argv[3], NULL, 16);
-
+ if (!of_flat_tree && argc > 3)
+ of_flat_tree = (char *)simple_strtoul(argv[3], NULL, 16);
#ifdef DEBUG
printf ("## Transferring control to Linux (at address 0x%08lx) " \
"ramdisk 0x%08lx, FDT 0x%08lx...\n",