All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] board/BuR/kwb: implement board-specific do_go_exec to form vxWorks bootline
@ 2015-09-28  8:33 Hannes Schmelzer
  2015-09-28  9:06 ` Bin Meng
  0 siblings, 1 reply; 10+ messages in thread
From: Hannes Schmelzer @ 2015-09-28  8:33 UTC (permalink / raw)
  To: u-boot

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 <oe5hpm@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

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2015-09-29  6:10 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-28  8:33 [U-Boot] [PATCH] board/BuR/kwb: implement board-specific do_go_exec to form vxWorks bootline Hannes Schmelzer
2015-09-28  9:06 ` Bin Meng
2015-09-28  9:17   ` Hannes Schmelzer
2015-09-28  9:20     ` Bin Meng
2015-09-28  9:28       ` [U-Boot] Antwort: Re: " Hannes Schmelzer
2015-09-28 10:08         ` [U-Boot] " Bin Meng
2015-09-28 10:12           ` Hannes Schmelzer
2015-09-28 10:13             ` Bin Meng
     [not found]               ` <56091F9A.5050506@schmelzer.or.at>
     [not found]                 ` <CAEUhbmXsXKV_TjxawYckT2+H6x1XqO2BN7DrCrQq3QrKvaLP7Q@mail.gmail.com>
     [not found]                   ` <CAEUhbmUBdTr=fLiHtpZjEJXjOOqTuBFJeX0O2Ambk9CANj_=Cw@mail.gmail.com>
2015-09-29  5:58                     ` Hannes Schmelzer
2015-09-29  6:10                       ` Bin Meng

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.