mirror of
https://github.com/linux-sunxi/u-boot-sunxi.git
synced 2024-02-12 11:16:03 +08:00
bootm: qnx: Disable data cache before booting QNX image
Instead of disabling the data cache in the bootelf command, disabling it in the do_bootm_qnxelf function. Some ELF binary might want the cache enabled. Signed-off-by: Emmanuel Vadot <manu@bidouilliste.com>
This commit is contained in:
11
cmd/elf.c
11
cmd/elf.c
@ -109,23 +109,12 @@ static unsigned long do_bootelf_exec(ulong (*entry)(int, char * const[]),
|
|||||||
{
|
{
|
||||||
unsigned long ret;
|
unsigned long ret;
|
||||||
|
|
||||||
/*
|
|
||||||
* QNX images require the data cache is disabled.
|
|
||||||
* Data cache is already flushed, so just turn it off.
|
|
||||||
*/
|
|
||||||
int dcache = dcache_status();
|
|
||||||
if (dcache)
|
|
||||||
dcache_disable();
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* pass address parameter as argv[0] (aka command name),
|
* pass address parameter as argv[0] (aka command name),
|
||||||
* and all remaining args
|
* and all remaining args
|
||||||
*/
|
*/
|
||||||
ret = entry(argc, argv);
|
ret = entry(argc, argv);
|
||||||
|
|
||||||
if (dcache)
|
|
||||||
dcache_enable();
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -353,6 +353,7 @@ static int do_bootm_qnxelf(int flag, int argc, char * const argv[],
|
|||||||
{
|
{
|
||||||
char *local_args[2];
|
char *local_args[2];
|
||||||
char str[16];
|
char str[16];
|
||||||
|
int dcache;
|
||||||
|
|
||||||
if (flag != BOOTM_STATE_OS_GO)
|
if (flag != BOOTM_STATE_OS_GO)
|
||||||
return 0;
|
return 0;
|
||||||
@ -367,8 +368,19 @@ static int do_bootm_qnxelf(int flag, int argc, char * const argv[],
|
|||||||
sprintf(str, "%lx", images->ep); /* write entry-point into string */
|
sprintf(str, "%lx", images->ep); /* write entry-point into string */
|
||||||
local_args[0] = argv[0];
|
local_args[0] = argv[0];
|
||||||
local_args[1] = str; /* and provide it via the arguments */
|
local_args[1] = str; /* and provide it via the arguments */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* QNX images require the data cache is disabled.
|
||||||
|
*/
|
||||||
|
dcache = dcache_status();
|
||||||
|
if (dcache)
|
||||||
|
dcache_disable();
|
||||||
|
|
||||||
do_bootelf(NULL, 0, 2, local_args);
|
do_bootelf(NULL, 0, 2, local_args);
|
||||||
|
|
||||||
|
if (dcache)
|
||||||
|
dcache_enable();
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user