
Override the default go/boote handlers as we want to disable both data and instruction cache before executing external programs (since Blackfin cache handling requires a software handler in U-Boot which may be overwritten).
Signed-off-by: Mike Frysinger vapier@gentoo.org --- lib_blackfin/Makefile | 2 +- lib_blackfin/{bootm.c => boot.c} | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletions(-) rename lib_blackfin/{bootm.c => boot.c} (80%)
diff --git a/lib_blackfin/Makefile b/lib_blackfin/Makefile index 3617104..879c37f 100644 --- a/lib_blackfin/Makefile +++ b/lib_blackfin/Makefile @@ -37,7 +37,7 @@ SOBJS-y += memmove.o SOBJS-y += memset.o
COBJS-y += board.o -COBJS-y += bootm.o +COBJS-y += boot.o COBJS-y += cache.o COBJS-y += muldi3.o COBJS-y += post.o diff --git a/lib_blackfin/bootm.c b/lib_blackfin/boot.c similarity index 80% rename from lib_blackfin/bootm.c rename to lib_blackfin/boot.c index ef4b112..5ea4afb 100644 --- a/lib_blackfin/bootm.c +++ b/lib_blackfin/boot.c @@ -77,3 +77,23 @@ void do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], if (images->autostart) do_reset (cmdtp, flag, argc, argv); } + +unsigned long do_go_exec(ulong (*entry)(int, char *[]), int argc, char *argv[]) +{ + int d = dcache_status(); + int i = icache_status(); + + dcache_disable(); + icache_disable(); + + int ret = entry(argc, argv); + + if (d) dcache_enable(); + if (i) icache_enable(); + + return ret; +} +unsigned long do_bootelf_exec(ulong (*entry)(int, char *[]), int argc, char *argv[]) +{ + return do_go_exec(entry, argc, argv); +}