All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] vxworks: Add CONFIG_VXWORKS_PREBOOT
@ 2009-09-23  6:22 Niklaus Giger
  2009-09-23 11:39 ` Tom
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Niklaus Giger @ 2009-09-23  6:22 UTC (permalink / raw)
  To: u-boot

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.

Signed-off-by: Niklaus Giger <niklaus.giger@netstal.com>
---
 common/cmd_elf.c  |    4 ++++
 include/vxworks.h |    4 ++++
 2 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/common/cmd_elf.c b/common/cmd_elf.c
index bf7dd63..4e36680 100644
--- a/common/cmd_elf.c
+++ b/common/cmd_elf.c
@@ -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");
diff --git a/include/vxworks.h b/include/vxworks.h
index 1633904..df2b580 100644
--- a/include/vxworks.h
+++ b/include/vxworks.h
@@ -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
-- 
1.6.3.3

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

* [U-Boot] [PATCH] vxworks: Add CONFIG_VXWORKS_PREBOOT
  2009-09-23  6:22 [U-Boot] [PATCH] vxworks: Add CONFIG_VXWORKS_PREBOOT Niklaus Giger
@ 2009-09-23 11:39 ` Tom
  2009-09-23 12:48   ` Niklaus Giger
  2009-09-23 12:56 ` Stefan Roese
  2009-09-23 13:02 ` Wolfgang Denk
  2 siblings, 1 reply; 6+ messages in thread
From: Tom @ 2009-09-23 11:39 UTC (permalink / raw)
  To: u-boot

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.
> 
> Signed-off-by: Niklaus Giger <niklaus.giger@netstal.com>
> ---
>  common/cmd_elf.c  |    4 ++++
>  include/vxworks.h |    4 ++++
>  2 files changed, 8 insertions(+), 0 deletions(-)
> 
> diff --git a/common/cmd_elf.c b/common/cmd_elf.c
> index bf7dd63..4e36680 100644
> --- a/common/cmd_elf.c
> +++ b/common/cmd_elf.c
> @@ -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");
> diff --git a/include/vxworks.h b/include/vxworks.h
> index 1633904..df2b580 100644
> --- a/include/vxworks.h
> +++ b/include/vxworks.h
> @@ -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

>  #endif

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

* [U-Boot] [PATCH] vxworks: Add CONFIG_VXWORKS_PREBOOT
  2009-09-23 11:39 ` Tom
@ 2009-09-23 12:48   ` Niklaus Giger
  2009-09-23 13:00     ` Tom
  0 siblings, 1 reply; 6+ messages in thread
From: Niklaus Giger @ 2009-09-23 12:48 UTC (permalink / raw)
  To: u-boot

Am Mittwoch 23 September 2009 13:39:55 schrieb Tom:
> 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.
<..>
> >  	puts ("## vxWorks terminated\n");
> > diff --git a/include/vxworks.h b/include/vxworks.h
> > index 1633904..df2b580 100644
> > --- a/include/vxworks.h
> > +++ b/include/vxworks.h
> > @@ -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 ?
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
> 
> Tom
> 
> >  #endif
> 
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
> 

-- 
Niklaus Giger
Netstal Maschinen AG
CH-8752 Naefels

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

* [U-Boot] [PATCH] vxworks: Add CONFIG_VXWORKS_PREBOOT
  2009-09-23  6:22 [U-Boot] [PATCH] vxworks: Add CONFIG_VXWORKS_PREBOOT Niklaus Giger
  2009-09-23 11:39 ` Tom
@ 2009-09-23 12:56 ` Stefan Roese
  2009-09-23 13:02 ` Wolfgang Denk
  2 siblings, 0 replies; 6+ messages in thread
From: Stefan Roese @ 2009-09-23 12:56 UTC (permalink / raw)
  To: u-boot

Hi Niklas,

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.
> 
> Signed-off-by: Niklaus Giger <niklaus.giger@netstal.com>
> ---
>  common/cmd_elf.c  |    4 ++++
>  include/vxworks.h |    4 ++++
>  2 files changed, 8 insertions(+), 0 deletions(-)
> 
> diff --git a/common/cmd_elf.c b/common/cmd_elf.c
> index bf7dd63..4e36680 100644
> --- a/common/cmd_elf.c
> +++ b/common/cmd_elf.c
> @@ -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

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

* [U-Boot] [PATCH] vxworks: Add CONFIG_VXWORKS_PREBOOT
  2009-09-23 12:48   ` Niklaus Giger
@ 2009-09-23 13:00     ` Tom
  0 siblings, 0 replies; 6+ messages in thread
From: Tom @ 2009-09-23 13:00 UTC (permalink / raw)
  To: u-boot

Niklaus Giger wrote:
> Am Mittwoch 23 September 2009 13:39:55 schrieb Tom:
>> 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.
> <..>
>>>  	puts ("## vxWorks terminated\n");
>>> diff --git a/include/vxworks.h b/include/vxworks.h
>>> index 1633904..df2b580 100644
>>> --- a/include/vxworks.h
>>> +++ b/include/vxworks.h
>>> @@ -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 ?
> 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? 
> 

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


> Best regards
> 
> Niklaus
>> Tom
>>
>>>  #endif
>> _______________________________________________
>> U-Boot mailing list
>> U-Boot at lists.denx.de
>> http://lists.denx.de/mailman/listinfo/u-boot
>>
> 

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

* [U-Boot] [PATCH] vxworks: Add CONFIG_VXWORKS_PREBOOT
  2009-09-23  6:22 [U-Boot] [PATCH] vxworks: Add CONFIG_VXWORKS_PREBOOT Niklaus Giger
  2009-09-23 11:39 ` Tom
  2009-09-23 12:56 ` Stefan Roese
@ 2009-09-23 13:02 ` Wolfgang Denk
  2 siblings, 0 replies; 6+ messages in thread
From: Wolfgang Denk @ 2009-09-23 13:02 UTC (permalink / raw)
  To: u-boot

Dear Niklaus Giger,

In message <1253686958-30716-1-git-send-email-niklaus.giger@netstal.com> you 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.
> 
> Signed-off-by: Niklaus Giger <niklaus.giger@netstal.com>
> ---
>  common/cmd_elf.c  |    4 ++++
>  include/vxworks.h |    4 ++++
>  2 files changed, 8 insertions(+), 0 deletions(-)
> 
> diff --git a/common/cmd_elf.c b/common/cmd_elf.c
> index bf7dd63..4e36680 100644
> --- a/common/cmd_elf.c
> +++ b/common/cmd_elf.c
> @@ -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". 

>  	puts ("## vxWorks terminated\n");
> diff --git a/include/vxworks.h b/include/vxworks.h
> index 1633904..df2b580 100644
> --- a/include/vxworks.h
> +++ b/include/vxworks.h
> @@ -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

-- 
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_

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

end of thread, other threads:[~2009-09-23 13:02 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-23  6:22 [U-Boot] [PATCH] vxworks: Add CONFIG_VXWORKS_PREBOOT Niklaus Giger
2009-09-23 11:39 ` Tom
2009-09-23 12:48   ` Niklaus Giger
2009-09-23 13:00     ` Tom
2009-09-23 12:56 ` Stefan Roese
2009-09-23 13:02 ` Wolfgang Denk

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.