Since we don't have for sure a valid IP-setup during
board_late_init(...) because it maybe allready stored in environment or
not, we cannot form a proper vxWorks bootline at this place.

So we move to the way, forming the bootline just before
executing/launching vxWorks with "go <address>".
At this time we have a valid IP-setup for sure because it is either in
environment or defined through CONFIG_PREBOOT command.

To do this, we overload the __weak function "do_go_exec(...)" with our
own and do the job.

Signed-off-by: Hannes Schmelzer <oe5...@oevsv.at>

---

 board/BuR/kwb/board.c | 23 ++++++++++++++---------
 1 file changed, 14 insertions(+), 9 deletions(-)

diff --git a/board/BuR/kwb/board.c b/board/BuR/kwb/board.c
index 039ec20..703a474 100644
--- a/board/BuR/kwb/board.c
+++ b/board/BuR/kwb/board.c
@@ -281,6 +281,19 @@ int board_late_init(void)
        } else {
                puts("ERROR: i2c_set_bus_speed failed! (scratchregister)\n");
        }
+       /*
+        * reset VBAR registers to its reset location, VxWorks 6.9.3.2 does
+        * expect that vectors are there, original u-boot moves them to _start
+        */
+       __asm__("ldr r0,=0x20000");
+       __asm__("mcr p15, 0, r0, c12, c0, 0"); /* Set VBAR */
+
+       return 0;
+}
+#endif /* CONFIG_BOARD_LATE_INIT */
+unsigned long do_go_exec(ulong (*entry)(int, char * const []), int argc,
+                                char * const argv[])
+{
        /* setup vxworks bootline */
        char *vxworksbootline = (char *)VXWORKS_BOOTLINE;
        sprintf(vxworksbootline,
@@ -295,13 +308,5 @@ int board_late_init(void)
                (u32)getenv_ulong("vx_romfsbase", 16, 0),
                (u32)getenv_ulong("vx_romfssize", 16, 0));
 
-       /*
-        * reset VBAR registers to its reset location, VxWorks 6.9.3.2 does
-        * expect that vectors are there, original u-boot moves them to _start
-        */
-       __asm__("ldr r0,=0x20000");
-       __asm__("mcr p15, 0, r0, c12, c0, 0"); /* Set VBAR */
-
-       return 0;
+       return entry(argc, argv);
 }
-#endif /* CONFIG_BOARD_LATE_INIT */
-- 
1.9.1

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to