X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;ds=inline;f=common%2Fcmd_elf.c;h=4683554040caaab119b5d4d6bda7799b279e3e66;hb=e175eacc87c3a9e4dad0799fee0e95732520afc7;hp=0e3d56f6bbb88ee0004f99f6ecb4b590bff59da7;hpb=f2b07ebd32e42a5b1126c98efc768ddb8908de62;p=u-boot diff --git a/common/cmd_elf.c b/common/cmd_elf.c index 0e3d56f6bb..4683554040 100644 --- a/common/cmd_elf.c +++ b/common/cmd_elf.c @@ -23,12 +23,25 @@ DECLARE_GLOBAL_DATA_PTR; #endif -#if (CONFIG_COMMANDS & CFG_CMD_ELF) - #ifndef MAX #define MAX(a,b) ((a) > (b) ? (a) : (b)) #endif +static inline void bootelf_setup(int argc, char *argv[]) +{ + /* + * QNX images require the data cache is disabled. + * Data cache is already flushed, so just turn it off. + */ + if (dcache_status ()) + dcache_disable (); + +#ifdef CONFIG_BLACKFIN + if (icache_status ()) + icache_disable (); +#endif +} + int valid_elf_image (unsigned long addr); unsigned long load_elf_image (unsigned long addr); @@ -55,12 +68,7 @@ int do_bootelf (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) printf ("## Starting application at 0x%08lx ...\n", addr); - /* - * QNX images require the data cache is disabled. - * Data cache is already flushed, so just turn it off. - */ - if (dcache_status ()) - dcache_disable (); + bootelf_setup(argc, argv); /* * pass address parameter as argv[0] (aka command name), @@ -101,7 +109,7 @@ int do_bootvx (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) else addr = simple_strtoul (argv[1], NULL, 16); -#if (CONFIG_COMMANDS & CFG_CMD_NET) +#if defined(CONFIG_CMD_NET) /* Check to see if we need to tftp the image ourselves before starting */ if ((argc == 2) && (strcmp (argv[1], "tftp") == 0)) { @@ -323,5 +331,3 @@ U_BOOT_CMD( "bootvx - Boot vxWorks from an ELF image\n", " [address] - load address of vxWorks ELF image.\n" ); - -#endif /* CFG_CMD_ELF */