Skip to contentSkip to conversation

vxworks: Add CONFIG_VXWORKS_PREBOOT

PATCH Superseded Niklaus Giger 5 participants 6 messages Sep 23, 2009

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vxworks: Add CONFIG_VXWORKS_PREBOOT

The option CONFIG_VXWORKS_PREBOOT allows a board specific vxworks_preboot to be run just before jumping into the vxWorks images. This can be used to alter a register which is used differently by U-boot and vxWorks.

---
 common/cmd_elf.c  |    4 ++++
 include/vxworks.h |    4 ++++
 2 files changed, 8 insertions(+), 0 deletions(-)
common/cmd_elf.c +4 -0
index bf7dd63..4e36680 100644
@@ -213,6 +213,10 @@ int do_bootvx (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 			(char *) bootaddr);
 	printf ("## Starting vxWorks at 0x%08lx ...\n", addr);
 
+#ifdef CONFIG_VXWORKS_PREBOOT
+    vxworks_preboot();
+#endif
+
 	((void (*)(void)) addr) ();
 
 	puts ("## vxWorks terminated\n");
include/vxworks.h +4 -0
index 1633904..df2b580 100644
@@ -50,4 +50,8 @@ int do_bootvx(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
 #define CONFIG_SYS_VXWORKS_SERVERNAME	"srv"
 #endif
 
+#ifdef CONFIG_VXWORKS_PREBOOT
+    void vxworks_preboot(void);
+#endif
+
 #endif
Signature · 1 line
1.6.3.3
#1 lore raw

PATCH 1/1 vxworks: Add CONFIG_VXWORKS_PREBOOT

Quoted 31 lines · Niklaus Giger

The option CONFIG_VXWORKS_PREBOOT allows a board specific vxworks_preboot to be run just before jumping into the vxWorks images. This can be used to alter a register which is used differently by U-boot and vxWorks.

---
 common/cmd_elf.c  |    4 ++++
 include/vxworks.h |    4 ++++
 2 files changed, 8 insertions(+), 0 deletions(-)
common/cmd_elf.c +4 -0
index bf7dd63..4e36680 100644
@@ -213,6 +213,10 @@ int do_bootvx (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 			(char *) bootaddr);
 	printf ("## Starting vxWorks at 0x%08lx ...\n", addr);
 
+#ifdef CONFIG_VXWORKS_PREBOOT
+    vxworks_preboot();
+#endif
+
 	((void (*)(void)) addr) ();
 
 	puts ("## vxWorks terminated\n");
include/vxworks.h +0 -0
index 1633904..df2b580 100644

include/vxworks.h int do_bootvx(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); · line 56

Quoted 7 lines
include/vxworks.h +4 -0
@@ -50,4 +50,8 @@ int do_bootvx(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
 #define CONFIG_SYS_VXWORKS_SERVERNAME	"srv"
 #endif
 
+#ifdef CONFIG_VXWORKS_PREBOOT
+    void vxworks_preboot(void);
+#endif
+

Where is vxworks_preboot defined ?

Tom

Quoted 1 line
include/vxworks.h +0 -0
 #endif
#2 lore raw

PATCH 1/1 vxworks: Add CONFIG_VXWORKS_PREBOOT

Am Mittwoch 23 September 2009 13:39:55 schrieb Tom:

Quoted 5 lines
Quoted 4 lines · Niklaus Giger

The option CONFIG_VXWORKS_PREBOOT allows a board specific vxworks_preboot to be run just before jumping into the vxWorks images. This can be used to alter a register which is used differently by U-boot and vxWorks.

<..>

Quoted 9 lines
Quoted 9 lines
common/cmd_elf.c +0 -0
 	puts ("## vxWorks terminated\n");
include/vxworks.h +0 -0
index 1633904..df2b580 100644
@@ -50,4 +50,8 @@ int do_bootvx(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
 #define CONFIG_SYS_VXWORKS_SERVERNAME	"srv"
 #endif
 
Quoted 6 lines

include/vxworks.h int do_bootvx(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); · line 56

Quoted 4 lines
include/vxworks.h +4 -0
+#ifdef CONFIG_VXWORKS_PREBOOT
+    void vxworks_preboot(void);
+#endif
+

Where is vxworks_preboot defined ?

This patch should only give the basis for its use.

I use it in one of my Netstal boards MCU25. Patch will come soon, as I am cleaning them up at the moment. But the relevant snippet is here:

board/netstal/mcu25/mcu25.c

void vxworks_preboot(void) {
    if (sys_install_requested())
        mtdcr(CPC0_CR1, CPCO_CR1_USE_EXTERNAL);
}

Is this okay for you? Or do you have more questions?

Best regards

Niklaus

Quoted 10 lines

Tom

include/vxworks.h int do_bootvx(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); · line 57

Quoted 1 line
include/vxworks.h +0 -0
 #endif

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

Signature · 3 lines
Niklaus Giger
Netstal Maschinen AG
CH-8752 Naefels
#3 lore raw

PATCH 1/1 vxworks: Add CONFIG_VXWORKS_PREBOOT

Quoted 26 lines · Niklaus Giger

Am Mittwoch 23 September 2009 13:39:55 schrieb Tom:

Quoted 5 lines
Quoted 4 lines · Niklaus Giger

The option CONFIG_VXWORKS_PREBOOT allows a board specific vxworks_preboot to be run just before jumping into the vxWorks images. This can be used to alter a register which is used differently by U-boot and vxWorks.

<..>

Quoted 9 lines
Quoted 9 lines
common/cmd_elf.c +0 -0
 	puts ("## vxWorks terminated\n");
include/vxworks.h +0 -0
index 1633904..df2b580 100644
@@ -50,4 +50,8 @@ int do_bootvx(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
 #define CONFIG_SYS_VXWORKS_SERVERNAME	"srv"
 #endif
 
Quoted 5 lines

include/vxworks.h int do_bootvx(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); · line 56

Quoted 4 lines
include/vxworks.h +4 -0
+#ifdef CONFIG_VXWORKS_PREBOOT
+    void vxworks_preboot(void);
+#endif
+

Where is vxworks_preboot defined ?

This patch should only give the basis for its use.

I use it in one of my Netstal boards MCU25. Patch will come soon, as I am cleaning them up at the moment. But the relevant snippet is here:

Quoted 9 lines

board/netstal/mcu25/mcu25.c

void vxworks_preboot(void) {
    if (sys_install_requested())
        mtdcr(CPC0_CR1, CPCO_CR1_USE_EXTERNAL);
}

Is this okay for you? Or do you have more questions?

This is a good change.

IMO, it would be better if this patch was included with your upcoming changes as the context of its use would be clear and it would eliminate that the possibility that this change happened without follow-up changes.

Tom

Quoted 12 lines

Best regards

Niklaus

Quoted 8 lines

Tom

include/vxworks.h int do_bootvx(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); · line 57

Quoted 1 line
include/vxworks.h +0 -0
 #endif

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

#4 lore raw

PATCH 1/1 vxworks: Add CONFIG_VXWORKS_PREBOOT

In reply to Niklaus Giger

Hi Niklas,

Quoted 16 lines · On Wednesday 23 September 2009 08:22:38 Niklaus Giger wrote:

The option CONFIG_VXWORKS_PREBOOT allows a board specific vxworks_preboot to be run just before jumping into the vxWorks images. This can be used to alter a register which is used differently by U-boot and vxWorks.

---
 common/cmd_elf.c  |    4 ++++
 include/vxworks.h |    4 ++++
 2 files changed, 8 insertions(+), 0 deletions(-)
common/cmd_elf.c +0 -0
index bf7dd63..4e36680 100644

common/cmd_elf.c int do_bootvx (cmd_tbl_t *cmdtp, int flag, int argc, · line 218

Quoted 6 lines
common/cmd_elf.c +3 -0
@@ -213,6 +213,10 @@ int do_bootvx (cmd_tbl_t *cmdtp, int flag, int argc,
 char *argv[]) (char *) bootaddr);
 	printf ("## Starting vxWorks at 0x%08lx ...\n", addr);
 
+#ifdef CONFIG_VXWORKS_PREBOOT
+    vxworks_preboot();
+#endif

We could get rid of this #ifdef by using an empty weak default function for this.

And it seems that you have an indentation problem here.

Cheers,
Stefan

--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: office at denx.de

#5 lore raw

PATCH 1/1 vxworks: Add CONFIG_VXWORKS_PREBOOT

In reply to Niklaus Giger

Dear Niklaus Giger,

Quoted 16 lines · In message <[email protected]> you…

The option CONFIG_VXWORKS_PREBOOT allows a board specific vxworks_preboot to be run just before jumping into the vxWorks images. This can be used to alter a register which is used differently by U-boot and vxWorks.

---
 common/cmd_elf.c  |    4 ++++
 include/vxworks.h |    4 ++++
 2 files changed, 8 insertions(+), 0 deletions(-)
common/cmd_elf.c +0 -0
index bf7dd63..4e36680 100644

common/cmd_elf.c int do_bootvx (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) · line 219

Quoted 7 lines
common/cmd_elf.c +4 -0
@@ -213,6 +213,10 @@ int do_bootvx (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 			(char *) bootaddr);
 	printf ("## Starting vxWorks at 0x%08lx ...\n", addr);
 
+#ifdef CONFIG_VXWORKS_PREBOOT
+    vxworks_preboot();
+#endif
+

Please move that function before the printf "## Starting vxWorks".

include/vxworks.h int do_bootvx(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); · line 55

Quoted 12 lines
common/cmd_elf.c +0 -0
 	puts ("## vxWorks terminated\n");
include/vxworks.h +3 -0
index 1633904..df2b580 100644
@@ -50,4 +50,8 @@ int do_bootvx(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
 #define CONFIG_SYS_VXWORKS_SERVERNAME	"srv"
 #endif
 
+#ifdef CONFIG_VXWORKS_PREBOOT
+    void vxworks_preboot(void);
+#endif

Please make this a function returning int, and return (and handle) a proper return code, so we can deal with error situations.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Drun'? 'm not drun'! You woudn' dare call m' drun' if I was sober!
                                     - Terry Pratchett, _Men at Arms_