Recent Modifications
======================================================================
+* Patch by Robert Kaiser <rob@sysgo.de>:
+
+ - flush caches before executing code that may have been downloaded
+ - fix bug request ID #589159: print_IPaddr bug
+
* Patch by David Müller <d.mueller@elsoft.ch>:
- fix some little bugs and typos in the code for the SMDK2410 eval board
cleanup_before_linux(bd);
+ /* flush caches before invoking (potentially downloaded) external code */
+ flush_all_caches();
theKernel(0, bd->bi_arch_number);
}
static int do_echo = 1;
#endif
+void flush_all_caches(void)
+{
+ /*
+ * flush all caches if they are enabled.
+ * this must be called prior to invoking
+ * code that has been copied/loaded.
+ */
+ if(dcache_status())
+ {
+ dcache_disable();
+ dcache_enable();
+ }
+ if(icache_status())
+ {
+ icache_disable();
+ icache_enable();
+ }
+}
+
#if (CONFIG_COMMANDS & CFG_CMD_BDI)
int do_bdinfo (cmd_tbl_t *cmdtp, bd_t *bd, int flag, int argc, char *argv[])
printf ("## Starting application at 0x%08lx ...\n", addr);
+ /*
+ * flush and invalidate caches: we might be invoking code
+ * that has been downloaded just before.
+ */
+ flush_all_caches();
+
/*
* pass address parameter as argv[0] (aka command name),
* and all remaining args
case IH_TYPE_STANDALONE:
appl = (int (*)(cmd_tbl_t *, bd_t *, int, int, char *[]))SWAP32(hdr->ih_ep);
+ /* flush caches before invoking (potentially downloaded) code */
+ flush_all_caches();
(*appl)(cmdtp, bd, flag, argc-1, &argv[1]);
/* just in case we return */
if (iflag)
#ifndef _CMD_BOOT_H
#define _CMD_BOOT_H
+void flush_all_caches(void);
+
#if (CONFIG_COMMANDS & CFG_CMD_BDI)
#define CMD_TBL_BDINFO MK_CMD_TBL_ENTRY( \
"bdinfo", 2, 1, 1, do_bdinfo, \
void print_IPaddr (IPaddr_t x)
{
- char tmp[12];
+ char tmp[16];
ip_to_string(x, tmp);