[U-Boot] Interrupt issue about bootvx command

Hi Wolfgang,
vxWorks needs all interrupt to be disabled before it's boot up, while u-boot sometimes enables them. Recently, I'm facing this kind of problem about booting up vxWorks through bootvx command. So, I added a patch to the common/cmd_elf.c to disable all interrupts before run into vxWorks image. This patch is now working fine on my board. So I think maybe it will be helpful for others.
The following is my patch :
commit 66768801bb10477ca8431b284d1738dcf3a834b8 Author: Ke Pan pppeterpppan@gmail.com Date: Wed Oct 12 09:50:44 2011 +0800
common/cmd_elf : Disable interrupts before boot vxWorks
The vxWorks needs all interrupts to be disabled before its boot.
diff --git a/common/cmd_elf.c b/common/cmd_elf.c index bf32612..7fc5ef5 100644 --- a/common/cmd_elf.c +++ b/common/cmd_elf.c @@ -229,6 +229,9 @@ int do_bootvx (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) printf ("## Using bootline (@ 0x%lx): %s\n", bootaddr, (char *) bootaddr); printf ("## Starting vxWorks at 0x%08lx ...\n", addr); + printf ("## Disableing interrupts ...\n"); + + disable_interrupts();
((void (*)(void)) addr) ();

Dear Peter Pan,
In message CAGQXtZG4F9dVScMU2Eej6TSteVcRWeHETEP8vfATNeWn0V76qQ@mail.gmail.com you wrote:
vxWorks needs all interrupt to be disabled before it's boot up, while u-boot sometimes enables them.
In which configuration / on which board have you run your tests?
Recently, I'm facing this kind of problem about booting up vxWorks through bootvx command. So, I added a patch to the common/cmd_elf.c to disable all interrupts before run into vxWorks image. This patch is now working fine on my board. So I think maybe it will be helpful for others.
The following is my patch :
Checkpatch says: total: 2 errors, 3 warnings, 10 lines checked
Please see http://www.denx.de/wiki/U-Boot/Patches ; then clean up and resubmit.
Thanks.
Best regards,
Wolfgang Denk

Hi Wolfgang,
This is a customized board, which is very similar with Freescale's P1020RDB (which is p1_p2_rdb in u-boot), only we replace the process with a compatible one-core version. And the board support files are mostly copied from the p1_p2_rdb.
And the following is my updated patch. My git does not have "git send-mail" supported, so I have to paste the formatted commit below. Sorry for that.
From 9758bc34e8459c8b906029105e41fe8adf9e79ca Mon Sep 17 00:00:00 2001
From: Ke Pan pppeterpppan@gmail.com Date: Thu, 13 Oct 2011 10:34:23 +0800 Subject: [PATCH] common/cmd_elf : Disable interrupts before boot vxWorks
The vxWorks needs all interrupts to be disabled before its boot. --- common/cmd_elf.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/common/cmd_elf.c b/common/cmd_elf.c index bf32612..a5ef9b4 100644 --- a/common/cmd_elf.c +++ b/common/cmd_elf.c @@ -228,6 +228,8 @@ int do_bootvx (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
printf ("## Using bootline (@ 0x%lx): %s\n", bootaddr, (char *) bootaddr); + printf("## Disableing interrupts ...\n"); + disable_interrupts(); printf ("## Starting vxWorks at 0x%08lx ...\n", addr);
((void (*)(void)) addr) ();

Dear Peter Pan,
please stop top posting / full quoting.
In message CAGQXtZFp6oE_BjQGd6SSDAYk7kkg4-dy_1==LNK2Snh5h1Gfmg@mail.gmail.com you wrote:
And the following is my updated patch. My git does not have "git send-mail" supported, so I have to paste the formatted commit below. Sorry for that.
Well, you'd better spend the time installing a full-featured version of git.
From 9758bc34e8459c8b906029105e41fe8adf9e79ca Mon Sep 17 00:00:00 2001 From: Ke Pan pppeterpppan@gmail.com Date: Thu, 13 Oct 2011 10:34:23 +0800 Subject: [PATCH] common/cmd_elf : Disable interrupts before boot vxWorks
The vxWorks needs all interrupts to be disabled before its boot.
Hm... And what exactly was not clear about the following statement:
Checkpatch says: total: 2 errors, 3 warnings, 10 lines checked
Please see http://www.denx.de/wiki/U-Boot/Patches ; then clean up and resubmit.
- Your commit message is mixed with text that belongs to the comment section only.
- Your SoB line is still missing
- There is a typo in "Disableing"; actually you should get rid of this printf().
Are there any testers out there? I don't want to take this untested, and I don't have any VxWorks anywhere around... (nor any other proprietary code :-)
Best regards,
Wolfgang Denk

Hi Wolfgang,
I've installed the git-email packet now, but I can not make it work. The "Unable to initialize SMTP properly" always pop up. T_T This is the first time I send any patch to the community, sorry for the incontinence.
This is tested on our board, and I think at least for any Freescale E500v2 core based board, this patch is needed. The TCR[DIE] is set in function interrupt_init_cpu of mpc85xx/interrupts.c, which enables decrementer interrupts.
The following is my patch. I've changed the printf to a comment.
Subject: [PATCH] common/cmd_elf : Disable interrupts before bootup vxWorks
vxWorks needs all interrupts to be disabled before bootup. Signed-off-by: Ke Pan pppeterpppan@gmail.com --- common/cmd_elf.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/common/cmd_elf.c b/common/cmd_elf.c index bf32612..7a7a6bb 100644 --- a/common/cmd_elf.c +++ b/common/cmd_elf.c @@ -230,6 +230,8 @@ int do_bootvx (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) (char *) bootaddr); printf ("## Starting vxWorks at 0x%08lx ...\n", addr);
+ /* Disable all interrupts before boot up vxWorks */ + disable_interrupts(); ((void (*)(void)) addr) ();
puts ("## vxWorks terminated\n");

Dear Peter Pan,
In message CAGQXtZEXL+psHAL2RgcimeQo_CQdTw13agSRDT5fQ4tmkmzAjQ@mail.gmail.com you wrote:
I've installed the git-email packet now, but I can not make it work. The "Unable to initialize SMTP properly" always pop up. T_T This is the first time I send any patch to the community, sorry for the incontinence.
This is tested on our board, and I think at least for any Freescale E500v2 core based board, this patch is needed. The TCR[DIE] is set in function interrupt_init_cpu of mpc85xx/interrupts.c, which enables decrementer interrupts.
The following is my patch. I've changed the printf to a comment.
We've been through a number of iterations now. Your technical problems aside, I don't understand why you cannot follow simple instructions.
I pointed you at http://www.denx.de/wiki/U-Boot/Patches ; there you can read:
* In the message body, include a description of your changes. - For bug fixes: a description of the bug and how your patch fixes this bug. Please try to include a way of demonstrating that the patch actually fixes something. - For new features: a description of the feature and your implementation. - Additional comments which you don't want included in U-Boot's history can be included below the first "---" in the message body.
Do you think above text should become part of the commit message? Probably not. So why don't you treat it as "Additional comments which you don't want included in U-Boot's history"?
Subject: [PATCH] common/cmd_elf : Disable interrupts before bootup vxWorks
vxWorks needs all interrupts to be disabled before bootup. Signed-off-by: Ke Pan pppeterpppan@gmail.com
Here is the place where such comments should go...
And when reposting a patch, you are supposed to follow the steps described here: http://www.denx.de/wiki/view/U-Boot/Patches#Sending_updated_patch_versions
common/cmd_elf.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/common/cmd_elf.c b/common/cmd_elf.c index bf32612..7a7a6bb 100644 --- a/common/cmd_elf.c +++ b/common/cmd_elf.c @@ -230,6 +230,8 @@ int do_bootvx (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) (char *) bootaddr); printf ("## Starting vxWorks at 0x%08lx ...\n", addr);
/* Disable all interrupts before boot up vxWorks */
disable_interrupts(); ((void (*)(void)) addr) ();
puts ("## vxWorks terminated\n");
Finally, as I wrote before, I would like to see some additional feedback for other VxWorks users.
Any testers around?
Best regards,
Wolfgang Denk

Hallo,
i am out of office at the moment, so i can not test, but i have tracked all my vxWorks start problems down to cache issues, even if they look like irq issues at a first glance, but disabling the irq's may not harm.
Adding the boot parameter and a cache flush makes much more sense for me.
I will come with a formal patch later next week.
Kind regards
Reinhard
-----Original-Nachricht-----
Von: Wolfgang Denk wd@denx.de
An: Peter Pan pppeterpppan@gmail.com
Cc: u-boot@lists.denx.de
Betreff: Re: [U-Boot] Interrupt issue about bootvx command
Datum: Fri, 14 Oct 2011 22:46:28 +0200
Dear Peter Pan,
In message CAGQXtZEXL+psHAL2RgcimeQo_CQdTw13agSRDT5fQ4tmkmzAjQ@mail.gmail.com you wrote:
>
> I've installed the git-email packet now, but I can not make it work.
> The "Unable to initialize SMTP properly" always pop up. T_T
> This is the first time I send any patch to the community, sorry for
> the incontinence.
>
> This is tested on our board, and I think at least for any Freescale
> E500v2 core based board, this patch is needed. The TCR[DIE] is set in
> function interrupt_init_cpu of mpc85xx/interrupts.c, which enables
> decrementer interrupts.
>
> The following is my patch. I've changed the printf to a comment.
We've been through a number of iterations now. Your technical
problems aside, I don't understand why you cannot follow simple
instructions.
I pointed you at http://www.denx.de/wiki/U-Boot/Patches ; there you
can read:
* In the message body, include a description of your changes.
- For bug fixes: a description of the bug and how your
patch fixes this bug. Please try to include a way of
demonstrating that the patch actually fixes something.
- For new features: a description of the feature and your
implementation.
- Additional comments which you don't want included in
U-Boot's history can be included below the first "---" in
the message body.
Do you think above text should become part of the commit message?
Probably not. So why don't you treat it as "Additional comments which
you don't want included in U-Boot's history"?
>
> Subject: [PATCH] common/cmd_elf : Disable interrupts before bootup vxWorks
>
> vxWorks needs all interrupts to be disabled before bootup.
> Signed-off-by: Ke Pan pppeterpppan@gmail.com
> ---
Here is the place where such comments should go...
And when reposting a patch, you are supposed to follow the steps
described here:
http://www.denx.de/wiki/view/U-Boot/Patches#Sending_updated_patch_versions
> common/cmd_elf.c | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/common/cmd_elf.c b/common/cmd_elf.c
> index bf32612..7a7a6bb 100644
> --- a/common/cmd_elf.c
> +++ b/common/cmd_elf.c
> @@ -230,6 +230,8 @@ int do_bootvx (cmd_tbl_t *cmdtp, int flag, int
> argc, char * const argv[])
> (char *) bootaddr);
> printf ("## Starting vxWorks at 0x%08lx ...n", addr);
>
> + /* Disable all interrupts before boot up vxWorks */
> + disable_interrupts();
> ((void (*)(void)) addr) ();
>
> puts ("## vxWorks terminatedn");
Finally, as I wrote before, I would like to see some additional
feedback for other VxWorks users.
Any testers around?
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@denx.de
Computers are not intelligent. They only think they are.
_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
participants (3)
-
Peter Pan
-
Reinhard.Arlt@t-online.de
-
Wolfgang Denk