Skip to contentSkip to conversation

board/BuR/kwb: implement board-specific do_go_exec to form vxWorks bootline

PATCH New Hannes Schmelzer 4 participants 10 messages Sep 28, 2015 – Sep 29, 2015 3 messages not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 board/BuR/kwb: implement board-specific do_go_exec to form vxWorks bootline

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.

---

 board/BuR/kwb/board.c | 23 ++++++++++++++---------
 1 file changed, 14 insertions(+), 9 deletions(-)
board/BuR/kwb/board.c +14 -9
index 039ec20..703a474 100644
@@ -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 */
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/1 board/BuR/kwb: implement board-specific do_go_exec to form vxWorks bootline

Hi Hannes,

Quoted 9 lines · Hannes Schmelzer

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.

Quoted 5 lines

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

I don't understand the technical details here on this board, but can we use the generic 'bootvx' command to handle the VxWorks bootline?

Quoted 45 lines

---

 board/BuR/kwb/board.c | 23 ++++++++++++++---------
 1 file changed, 14 insertions(+), 9 deletions(-)
board/BuR/kwb/board.c +14 -10
index 039ec20..703a474 100644
@@ -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 */
--
Quoted 1 line

1.9.1

Regards,
Bin

#2 lore raw

PATCH 1/1 board/BuR/kwb: implement board-specific do_go_exec to form vxWorks bootline

Quoted 1 line

Hi Hannes,

Hi Bin,
thanks for reply.

Quoted 2 lines

On Mon, Sep 28, 2015 at 4:33 PM, Hannes Schmelzer <[email protected]>

Quoted 2 lines · wrote:
Quoted 2 lines

Since we don't have for sure a valid IP-setup during board_late_init(...) because it maybe allready stored in environment

or

Quoted 7 lines
Quoted 7 lines

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.

Quoted 8 lines
Quoted 5 lines

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

I don't understand the technical details here on this board, but can we use the generic 'bootvx' command to handle the VxWorks bootline?

At first i had a look to this, but unfortunately it is not useable for my case, because we are passing
serveral things more through the bootline to our vxWorks kernel. Especially o=... contains several information like framebuffer address, factory-settings address and so on.
Further we have FTP-Filesystem, so we pass additional arguments ( u=vxWorksFTP pw=vxWorks).

Quoted 6 lines
Quoted 6 lines

---

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

board/BuR/kwb/board.c int board_late_init(void) · line 282

Quoted 7 lines
board/BuR/kwb/board.c +0 -0
index 039ec20..703a474 100644
@@ -281,6 +281,19 @@ int board_late_init(void)
        } else {
                puts("ERROR: i2c_set_bus_speed failed! 

(scratchregister)\n");

Quoted 3 lines

board/BuR/kwb/board.c int board_late_init(void)

Quoted 3 lines
board/BuR/kwb/board.c +2 -0
        }
+       /*
+        * reset VBAR registers to its reset location, VxWorks 6.9.3.2 

does

Quoted 1 line

board/BuR/kwb/board.c int board_late_init(void) · line 286

Quoted 1 line
board/BuR/kwb/board.c +1 -0
+        * expect that vectors are there, original u-boot moves them 

to _start

Quoted 8 lines

board/BuR/kwb/board.c int board_late_init(void)

Quoted 8 lines
board/BuR/kwb/board.c +8 -0
+        */
+       __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,

Quoted 11 lines

board/BuR/kwb/board.c int board_late_init(void) · line 299

Quoted 11 lines
board/BuR/kwb/board.c +2 -2
+                                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

Quoted 1 line

board/BuR/kwb/board.c int board_late_init(void) · line 300

Quoted 1 line
board/BuR/kwb/board.c +0 -1
-        * expect that vectors are there, original u-boot moves them 

to _start

Quoted 5 lines
Quoted 5 lines
board/BuR/kwb/board.c +0 -5
-        */
-       __asm__("ldr r0,=0x20000");
-       __asm__("mcr p15, 0, r0, c12, c0, 0"); /* Set VBAR */
-
-       return 0;
Quoted 8 lines
Quoted 5 lines
board/BuR/kwb/board.c +1 -2
+       return entry(argc, argv);
 }
-#endif /* CONFIG_BOARD_LATE_INIT */
--

1.9.1

Regards,
Bin

best regards,
Hannes

#3 lore raw

PATCH 1/1 board/BuR/kwb: implement board-specific do_go_exec to form vxWorks bootline

Hi Hannes,

Quoted 26 lines · Hannes Schmelzer
Quoted 1 line

Hi Hannes,

Hi Bin,
thanks for reply.

Quoted 2 lines

On Mon, Sep 28, 2015 at 4:33 PM, Hannes Schmelzer <[email protected]>

Quoted 2 lines · wrote:
Quoted 2 lines

Since we don't have for sure a valid IP-setup during board_late_init(...) because it maybe allready stored in environment

or

Quoted 7 lines
Quoted 7 lines

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.

Quoted 8 lines
Quoted 5 lines

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

I don't understand the technical details here on this board, but can we use the generic 'bootvx' command to handle the VxWorks bootline?

Quoted 8 lines

At first i had a look to this, but unfortunately it is not useable for my case, because we are passing
serveral things more through the bootline to our vxWorks kernel. Especially o=... contains several information like framebuffer address, factory-settings address and so on.
Further we have FTP-Filesystem, so we pass additional arguments ( u=vxWorksFTP pw=vxWorks).

Could you please try this patch series [1] instead?

With that series, we can construct VxWorks bootline from U-Boot env. Like you can store your additional bootline info to U-Boot env variable "othbootargs", like

=> setenv othbootargs u=vxWorksFTP pw=vxWorks o=fb_addr=xxx factory_setting=yyy

[1] http://patchwork.ozlabs.org/patch/523276/

Regards,
Bin

#4 lore raw

[U-Boot] Antwort: Re: Re: [PATCH] board/BuR/kwb: implement board-specific do_go_exec to form vxWorks bootline

Quoted 1 line

Hi Hannes,

Hi,

Quoted 4 lines
Quoted 1 line · Hannes Schmelzer
Quoted 1 line

Hi Hannes,

Quoted 8 lines
Quoted 8 lines

Hi Bin,
thanks for reply.

Quoted 2 lines

On Mon, Sep 28, 2015 at 4:33 PM, Hannes Schmelzer <[email protected]>

Quoted 2 lines · wrote:
Quoted 2 lines

Since we don't have for sure a valid IP-setup during board_late_init(...) because it maybe allready stored in

environment

Quoted 6 lines
Quoted 6 lines

or

Quoted 5 lines
Quoted 5 lines

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

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

environment or defined through CONFIG_PREBOOT command.

To do this, we overload the __weak function "do_go_exec(...)" with

our

Quoted 9 lines
Quoted 9 lines
Quoted 7 lines
Quoted 4 lines

own and do the job.

I don't understand the technical details here on this board, but can we use the generic 'bootvx' command to handle the VxWorks bootline?

At first i had a look to this, but unfortunately it is not useable for

my

Quoted 3 lines
Quoted 3 lines

case, because we are passing
serveral things more through the bootline to our vxWorks kernel. Especially o=... contains several information like framebuffer

address,

Quoted 5 lines
Quoted 4 lines

factory-settings address and so on.
Further we have FTP-Filesystem, so we pass additional arguments ( u=vxWorksFTP pw=vxWorks).

Quoted 7 lines

Could you please try this patch series [1] instead?

With that series, we can construct VxWorks bootline from U-Boot env. Like you can store your additional bootline info to U-Boot env variable "othbootargs", like

=> setenv othbootargs u=vxWorksFTP pw=vxWorks o=fb_addr=xxx

factory_setting=yyy
I will have a closer look to this.
The framebuffer base is stored at this time in gd->fb_base

        sprintf(vxworksbootline,
                "%s h=%s e=%s:%s g=%s %s o=0x%08x;0x%08x;0x%08x;0x%08x",
                DEFAULT_BOOTLINE,
                getenv("serverip"),
                getenv("ipaddr"), getenv("netmask"),
                getenv("gatewayip"),
                VXWORKS_USER,
                (unsigned int) gd->fb_base-0x20,
                (u32)getenv_ulong("vx_memtop", 16, gd->fb_base-0x20),
                (u32)getenv_ulong("vx_romfsbase", 16, 0),
                (u32)getenv_ulong("vx_romfssize", 16, 0));

do you thank that i cal realize a bootline like this with current tools?

Quoted 6 lines

[1] http://patchwork.ozlabs.org/patch/523276/

Regards,
Bin

best regars,
Hannes

#5 lore raw

PATCH 1/1 board/BuR/kwb: implement board-specific do_go_exec to form vxWorks bootline

Hi Hannes,

Quoted 69 lines · Hannes Schmelzer
Quoted 1 line

Hi Hannes,

Hi,

Quoted 4 lines
Quoted 1 line · Hannes Schmelzer
Quoted 1 line

Hi Hannes,

Quoted 8 lines
Quoted 8 lines

Hi Bin,
thanks for reply.

Quoted 2 lines

On Mon, Sep 28, 2015 at 4:33 PM, Hannes Schmelzer <[email protected]>

Quoted 2 lines · wrote:
Quoted 2 lines

Since we don't have for sure a valid IP-setup during board_late_init(...) because it maybe allready stored in

environment

Quoted 6 lines
Quoted 6 lines

or

Quoted 5 lines
Quoted 5 lines

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

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

environment or defined through CONFIG_PREBOOT command.

To do this, we overload the __weak function "do_go_exec(...)" with

our

Quoted 9 lines
Quoted 9 lines
Quoted 7 lines
Quoted 4 lines

own and do the job.

I don't understand the technical details here on this board, but can we use the generic 'bootvx' command to handle the VxWorks bootline?

At first i had a look to this, but unfortunately it is not useable for

my

Quoted 3 lines
Quoted 3 lines

case, because we are passing
serveral things more through the bootline to our vxWorks kernel. Especially o=... contains several information like framebuffer

address,

Quoted 5 lines
Quoted 4 lines

factory-settings address and so on.
Further we have FTP-Filesystem, so we pass additional arguments ( u=vxWorksFTP pw=vxWorks).

Quoted 7 lines

Could you please try this patch series [1] instead?

With that series, we can construct VxWorks bootline from U-Boot env. Like you can store your additional bootline info to U-Boot env variable "othbootargs", like

=> setenv othbootargs u=vxWorksFTP pw=vxWorks o=fb_addr=xxx

factory_setting=yyy
I will have a closer look to this.
The framebuffer base is stored at this time in gd->fb_base

        sprintf(vxworksbootline,
                "%s h=%s e=%s:%s g=%s %s o=0x%08x;0x%08x;0x%08x;0x%08x",
                DEFAULT_BOOTLINE,
                getenv("serverip"),
                getenv("ipaddr"), getenv("netmask"),
                getenv("gatewayip"),
                VXWORKS_USER,
                (unsigned int) gd->fb_base-0x20,
                (u32)getenv_ulong("vx_memtop", 16, gd->fb_base-0x20),
                (u32)getenv_ulong("vx_romfsbase", 16, 0),
                (u32)getenv_ulong("vx_romfssize", 16, 0));
Quoted 2 lines

do you thank that i cal realize a bootline like this with current tools?

Yes, I think you can do something like setenv("othbootargs", addtional_bootlines) where addtional_bootlines holds the value for frame buffer address from gd->fb_base.

Quoted 4 lines
Quoted 4 lines

[1] http://patchwork.ozlabs.org/patch/523276/

Regards,
Bin

#6 lore raw

PATCH 1/1 board/BuR/kwb: implement board-specific do_go_exec to form vxWorks bootline

Quoted 1 line

Hi Hannes,

Hi,

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

Could you please try this patch series [1] instead?

With that series, we can construct VxWorks bootline from U-Boot env. Like you can store your additional bootline info to U-Boot env variable "othbootargs", like

Quoted 7 lines
Quoted 7 lines
Quoted 1 line

=> setenv othbootargs u=vxWorksFTP pw=vxWorks o=fb_addr=xxx

factory_setting=yyy
I will have a closer look to this.
The framebuffer base is stored at this time in gd->fb_base

        sprintf(vxworksbootline,
                "%s h=%s e=%s:%s g=%s %s 

o=0x%08x;0x%08x;0x%08x;0x%08x",

Quoted 11 lines
Quoted 11 lines
                DEFAULT_BOOTLINE,
                getenv("serverip"),
                getenv("ipaddr"), getenv("netmask"),
                getenv("gatewayip"),
                VXWORKS_USER,
                (unsigned int) gd->fb_base-0x20,
                (u32)getenv_ulong("vx_memtop", 16, gd->fb_base-0x20),
                (u32)getenv_ulong("vx_romfsbase", 16, 0),
                (u32)getenv_ulong("vx_romfssize", 16, 0));

do you thank that i cal realize a bootline like this with current

tools?

Quoted 5 lines
Quoted 1 line

Yes, I think you can do something like setenv("othbootargs", addtional_bootlines) where addtional_bootlines holds the value for frame buffer address from gd->fb_base.

OK, the plan would be:

a) setup some othbootargs out from board.c (because gd->fb_base isn't accessible through cli)
b) call bootvx instead go ... to start vxWorks kernel

right?

Quoted 3 lines

Regards,
Bin

regards,
Hannes

#7 lore raw

PATCH 1/1 board/BuR/kwb: implement board-specific do_go_exec to form vxWorks bootline

Hi Hannes,

Quoted 36 lines · Hannes Schmelzer
Quoted 1 line

Hi Hannes,

Hi,

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

Could you please try this patch series [1] instead?

With that series, we can construct VxWorks bootline from U-Boot env. Like you can store your additional bootline info to U-Boot env variable "othbootargs", like

Quoted 7 lines
Quoted 7 lines
Quoted 1 line

=> setenv othbootargs u=vxWorksFTP pw=vxWorks o=fb_addr=xxx

factory_setting=yyy
I will have a closer look to this.
The framebuffer base is stored at this time in gd->fb_base

        sprintf(vxworksbootline,
                "%s h=%s e=%s:%s g=%s %s

o=0x%08x;0x%08x;0x%08x;0x%08x",

Quoted 11 lines
Quoted 11 lines
                DEFAULT_BOOTLINE,
                getenv("serverip"),
                getenv("ipaddr"), getenv("netmask"),
                getenv("gatewayip"),
                VXWORKS_USER,
                (unsigned int) gd->fb_base-0x20,
                (u32)getenv_ulong("vx_memtop", 16, gd->fb_base-0x20),
                (u32)getenv_ulong("vx_romfsbase", 16, 0),
                (u32)getenv_ulong("vx_romfssize", 16, 0));

do you thank that i cal realize a bootline like this with current

tools?

Quoted 5 lines
Quoted 1 line

Yes, I think you can do something like setenv("othbootargs", addtional_bootlines) where addtional_bootlines holds the value for frame buffer address from gd->fb_base.

Quoted 8 lines

OK, the plan would be:

a) setup some othbootargs out from board.c (because gd->fb_base isn't accessible through cli)
b) call bootvx instead go ... to start vxWorks kernel

right?

Yes, that's correct.

Regards,
Bin

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): CAEUhbmXsXKV_TjxawYckT2+H6x1XqO2BN7DrCrQq3QrKvaLP7Q@mail.gmail.com

A message that is not in the archive (sent off-list or not yet received): CAEUhbmUBdTr=fLiHtpZjEJXjOOqTuBFJeX0O2Ambk9CANj_=Cw@mail.gmail.com

#11 lore raw

PATCH 1/1 board/BuR/kwb: implement board-specific do_go_exec to form vxWorks bootline

Hi Bin,

works now well.
Also the thing with bootvx and the bootline works fine.

I will send some v2 of my patch today.

many thanks and best regards,
Hannes

Quoted 35 lines · Bin Meng

Hi Hannes,

Quoted 21 lines · Bin Meng

Hi Hannes,

Quoted 17 lines · Hannes Schmelzer

Hi Bin,

i am not able to apply your patch from
http://patchwork.ozlabs.org/patch/523289/
to most current master.

schmelzerh at hpm-debian ~/work/u-boot $ git am U-Boot-v2-01-13-Reorder-defconfigs-with-savedefconfig.patch
Applying: Reorder defconfigs with 'savedefconfig'
error: patch failed: configs/e2220-1170_defconfig:9
error: configs/e2220-1170_defconfig: patch does not apply
error: patch failed: configs/p2371-0000_defconfig:9
error: configs/p2371-0000_defconfig: patch does not apply
error: patch failed: configs/p2571_defconfig:9
error: configs/p2571_defconfig: patch does not apply Patch failed at 0001 Reorder defconfigs with 'savedefconfig'

Quoted 4 lines
Quoted 2 lines

maybe you've to rebase your working branch.

Sorry. Yes, I forgot to rebase. Will send a new patch soon.

The patch#1 has been merged into u-boot/master. Please apply patch 2-13 on top of latest mainline in the series and have a try.

Regards,
Bin

#12 lore raw

PATCH 1/1 board/BuR/kwb: implement board-specific do_go_exec to form vxWorks bootline

Hi Hannes,

Quoted 4 lines · Hannes Schmelzer

Hi Bin,

works now well.
Also the thing with bootvx and the bootline works fine.

Great to hear! Maybe you can add a 'Tested-by' tag to my series if you like.

Quoted 42 lines

I will send some v2 of my patch today.

many thanks and best regards,
Hannes

Quoted 34 lines · Bin Meng

Hi Hannes,

Quoted 23 lines · Bin Meng

Hi Hannes,

Quoted 18 lines · Hannes Schmelzer

Hi Bin,

i am not able to apply your patch from
http://patchwork.ozlabs.org/patch/523289/
to most current master.

schmelzerh at hpm-debian ~/work/u-boot $ git am U-Boot-v2-01-13-Reorder-defconfigs-with-savedefconfig.patch
Applying: Reorder defconfigs with 'savedefconfig'
error: patch failed: configs/e2220-1170_defconfig:9
error: configs/e2220-1170_defconfig: patch does not apply
error: patch failed: configs/p2371-0000_defconfig:9
error: configs/p2371-0000_defconfig: patch does not apply
error: patch failed: configs/p2571_defconfig:9
error: configs/p2571_defconfig: patch does not apply Patch failed at 0001 Reorder defconfigs with 'savedefconfig'

Quoted 4 lines
Quoted 2 lines

maybe you've to rebase your working branch.

Sorry. Yes, I forgot to rebase. Will send a new patch soon.

The patch#1 has been merged into u-boot/master. Please apply patch 2-13 on top of latest mainline in the series and have a try.

Regards,
Bin