Patchwork [U-Boot,v2] bootvx: Clear and disable data cache, and call vxWorks with parameter.

login
register
mail settings
Submitter Reinhard Arlt
Date Nov. 18, 2011, 7:06 p.m.
Message ID <4EC6ACCC.5070709@esd.eu>
Download mbox | patch
Permalink /patch/126475/
State Accepted
Commit 6eee21daf3d1cabad8a4dfaf6641d8845ee7578a
Headers show

Comments

Reinhard Arlt - Nov. 18, 2011, 7:06 p.m.
From: Reinhard Arlt <reinhard.arlt@esd.eu>

This patch clear and disable the data cache for vxWorks.

The entry point sysInit(int) intended by Windriver to be called from
the vxWorks bootrom, a very small vxWorks system.
The routine is called by the go() handler in the bootrom, that clears
the cache from start of image to end of usable memory.

The PowerPC implementations only invalidates and disable the cache,
the ARM implementations also flush it.
  
U-Boot will be on the save side, if it disables the data cache before
calling vxWorks sysInit(int).

Signed-off-by: Reinhard Arlt <reinhard.arlt@esd.eu>

--
Mike Frysinger - Nov. 18, 2011, 7:58 p.m.
On Friday 18 November 2011 14:06:52 Reinhard Arlt wrote:
> U-Boot will be on the save side, if it disables the data cache before

s/save/safe/
-mike
Wolfgang Denk - March 18, 2012, 7:14 p.m.
Dear Reinhard Arlt,

In message <4EC6ACCC.5070709@esd.eu> you wrote:
> From: Reinhard Arlt <reinhard.arlt@esd.eu>
> 
> This patch clear and disable the data cache for vxWorks.
> 
> The entry point sysInit(int) intended by Windriver to be called from
> the vxWorks bootrom, a very small vxWorks system.
> The routine is called by the go() handler in the bootrom, that clears
> the cache from start of image to end of usable memory.
> 
> The PowerPC implementations only invalidates and disable the cache,
> the ARM implementations also flush it.
>   
> U-Boot will be on the save side, if it disables the data cache before
> calling vxWorks sysInit(int).
> 
> Signed-off-by: Reinhard Arlt <reinhard.arlt@esd.eu>

Applied, thanks.

Best regards,

Wolfgang Denk

Patch

diff --git a/common/cmd_elf.c b/common/cmd_elf.c
index 11ffc1b..8266bba 100644
--- a/common/cmd_elf.c
+++ b/common/cmd_elf.c
@@ -230,7 +230,8 @@  int do_bootvx (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 			(char *) bootaddr);
 	printf ("## Starting vxWorks at 0x%08lx ...\n", addr);
 
-	((void (*)(void)) addr) ();
+	dcache_disable();
+	((void (*)(int)) addr) (0);
 
 	puts ("## vxWorks terminated\n");
 	return 1;