vxworks: Add CONFIG_VXWORKS_PREBOOT
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
@@ -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
@@ -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
PATCH 1/1 vxworks: Add CONFIG_VXWORKS_PREBOOT
Quoted 31 lines · Niklaus Giger
The option
CONFIG_VXWORKS_PREBOOTallows a board specificvxworks_prebootto 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.Signed-off-by Niklaus Giger <[email protected]>--- common/cmd_elf.c | 4 ++++ include/vxworks.h | 4 ++++ 2 files changed, 8 insertions(+), 0 deletions(-)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 + ((void (*)(void )) addr) ();puts ("## vxWorks terminated\n" );include/vxworks.h +0
-0
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
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_PREBOOTallows a board specificvxworks_prebootto 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
-0puts ("## vxWorks terminated\n" );include/vxworks.h +0
-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
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_prebootdefined ?
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
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_PREBOOTallows a board specificvxworks_prebootto 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
-0puts ("## vxWorks terminated\n" );include/vxworks.h +0
-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 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_prebootdefined ?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.cvoid 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
PATCH 1/1 vxworks: Add CONFIG_VXWORKS_PREBOOT
In reply to Niklaus GigerHi Niklas,
Quoted 16 lines · On Wednesday 23 September 2009 08:22:38 Niklaus Giger wrote:
The option
CONFIG_VXWORKS_PREBOOTallows a board specificvxworks_prebootto 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.Signed-off-by Niklaus Giger <[email protected]>--- common/cmd_elf.c | 4 ++++ include/vxworks.h | 4 ++++ 2 files changed, 8 insertions(+), 0 deletions(-)common/cmd_elf.c +0
-0
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
PATCH 1/1 vxworks: Add CONFIG_VXWORKS_PREBOOT
In reply to Niklaus GigerDear Niklaus Giger,
Quoted 16 lines · In message <[email protected]> you…
The option
CONFIG_VXWORKS_PREBOOTallows a board specificvxworks_prebootto 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.Signed-off-by Niklaus Giger <[email protected]>--- common/cmd_elf.c | 4 ++++ include/vxworks.h | 4 ++++ 2 files changed, 8 insertions(+), 0 deletions(-)common/cmd_elf.c +0
-0
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
-0puts ("## vxWorks terminated\n" );include/vxworks.h +3
-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
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_