* [U-Boot-Users] Why exceptions are enabled before exception vector code is copied
@ 2005-07-06 7:45 Cedric VINCENT
2005-07-06 8:04 ` [U-Boot-Users] " Wolfgang Denk
0 siblings, 1 reply; 7+ messages in thread
From: Cedric VINCENT @ 2005-07-06 7:45 UTC (permalink / raw)
To: u-boot
Dear Wolfgang.
Can I ask you why exceptions are enabled before exception vector code
is copied to the low RAM pages ? (I am talking about U-Boot/PPC)
On my board, U-Boot crashes before relocation (when debugging) since
Xilinx Microprocessor Debugger (XMD) makes a spurious "Machine Check
Exception". For other reasons, such an exception could arrived before
u-boot starts.
Finally, it is a bug or a very strange coding behaviour...
Cedric VINCENT.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot-Users] Re: Why exceptions are enabled before exception vector code is copied
2005-07-06 7:45 [U-Boot-Users] Why exceptions are enabled before exception vector code is copied Cedric VINCENT
@ 2005-07-06 8:04 ` Wolfgang Denk
2005-07-06 8:53 ` Cedric VINCENT
0 siblings, 1 reply; 7+ messages in thread
From: Wolfgang Denk @ 2005-07-06 8:04 UTC (permalink / raw)
To: u-boot
In message <c8f10050706004556bcca54@mail.gmail.com> you wrote:
>
> Can I ask you why exceptions are enabled before exception vector code
> is copied to the low RAM pages ? (I am talking about U-Boot/PPC)
No exceptions are supposed to happen until then.
> On my board, U-Boot crashes before relocation (when debugging) since
> Xilinx Microprocessor Debugger (XMD) makes a spurious "Machine Check
> Exception". For other reasons, such an exception could arrived before
> u-boot starts.
Well, then fix this problem. What do you suggest hoiw such a
situation should be handled while running from flash?
> Finally, it is a bug or a very strange coding behaviour...
It does not happen on other systems.
Best regards,
Wolfgang Denk
--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The universe does not have laws - it has habits, and habits can be
broken.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot-Users] Re: Why exceptions are enabled before exception vector code is copied
2005-07-06 8:04 ` [U-Boot-Users] " Wolfgang Denk
@ 2005-07-06 8:53 ` Cedric VINCENT
2005-07-06 8:59 ` Wolfgang Denk
0 siblings, 1 reply; 7+ messages in thread
From: Cedric VINCENT @ 2005-07-06 8:53 UTC (permalink / raw)
To: u-boot
> No exceptions are supposed to happen until then.
> What do you suggest hoiw such a
> situation should be handled while running from flash?
There is no reason to enable them before exception vector code is
copied. So exceptions should be enabled *after* exception vector code
is copied.
> It does not happen on other systems.
The spurious "Machine Check Excpetion" is well known on Virtex/PPC.
Most Xilinx FPGA boards are affected (tested on Virtex-II Pro and
Virtex 4).
regards, Cedric VINCENT.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot-Users] Re: Why exceptions are enabled before exception vector code is copied
2005-07-06 8:53 ` Cedric VINCENT
@ 2005-07-06 8:59 ` Wolfgang Denk
2005-07-06 9:52 ` Cedric VINCENT
0 siblings, 1 reply; 7+ messages in thread
From: Wolfgang Denk @ 2005-07-06 8:59 UTC (permalink / raw)
To: u-boot
In message <c8f1005070601532cb85bff@mail.gmail.com> you wrote:
> > No exceptions are supposed to happen until then.
>
> > What do you suggest hoiw such a
> > situation should be handled while running from flash?
>
> There is no reason to enable them before exception vector code is
> copied. So exceptions should be enabled *after* exception vector code
> is copied.
Feel free to submit a patch.
But what would happen in your case of a Machine Check? What do you
suggest to recover from that?
Best regards,
Wolfgang Denk
--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The optimum committee has no members.
- Norman Augustine
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot-Users] Re: Why exceptions are enabled before exception vector code is copied
2005-07-06 8:59 ` Wolfgang Denk
@ 2005-07-06 9:52 ` Cedric VINCENT
2005-07-06 13:50 ` Cedric VINCENT
0 siblings, 1 reply; 7+ messages in thread
From: Cedric VINCENT @ 2005-07-06 9:52 UTC (permalink / raw)
To: u-boot
> Feel free to submit a patch.
OK, maybe the next week.
> But what would happen in your case of a Machine Check? What do you
> suggest to recover from that?
When this spurious "Machine Check Exception" occured, the MSR didn't
contain any known causes. Maybe the function "MachineCheckException"
(from cpu/ppc4xx/traps.c) may be modified with something like this :
---------
#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
if (debugger_exception_handler && (*debugger_exception_handler)(regs))
return;
#endif
+ #if defined(CONFIG_USE_XMD)
+ if( SPURIOUS_MCE == (regs->msr & 0x000F0000) )
+ return;
+ #endif
printf("Machine check in kernel mode.\n");
printf("Caused by (from msr): ");
printf("regs %p ",regs);
switch( regs->msr & 0x000F0000) {
---------
where CONFIG_USE_XMD is a macro (to use with care !) defined by user
when he uses XMD (during debugging stage) and SPURIOUS_MCE is the MSR
unknown cause.
This (ugly) stuff makes sense to enable exception after relocation. I
didn't test this, since I disable Machine Check Exception when
debugging my Virtex Board. Maybe it will not work (if this spurious
exception occured more than once). I will try to test next week.
Regards,
Cedric VINCENT.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot-Users] Re: Why exceptions are enabled before exception vector code is copied
2005-07-06 9:52 ` Cedric VINCENT
@ 2005-07-06 13:50 ` Cedric VINCENT
2006-03-13 11:24 ` Wolfgang Denk
0 siblings, 1 reply; 7+ messages in thread
From: Cedric VINCENT @ 2005-07-06 13:50 UTC (permalink / raw)
To: u-boot
Here comes a patch to enable exceptions after exceptions vector code
is copied (i.e after relocation). I tested it with my board (PPC 405),
I also changed 440 and IOP480 target but without testing...
I run the MAKEALL script : there are no errors, warnings was not due
to this patch.
CHANGELOG : * cpu/ppc4xx/start.S : exceptions are enabled after relocation.
About XMD, as I thought the spurious exception comes infinitely... So
there is no easy way to fix it. If you apply this patch (this is an
easy way to detect this spurious exception), you should add at the end
of doc/README.ml300 :
========================
6. Warning
----------
It was reported that XMD makes (sometimes) a spurious "Machine Check Exception".
When debugging, if you are sure that this exception doesn't come from
your system,
comment this line into cpu/ppc4xx/start.S :
addi r7,r0,0x1000 /* set ME bit (Machine Exceptions) */
========================
Regards,
Cedric VINCENT
-------------- next part --------------
A non-text attachment was scrubbed...
Name: u-boot_exception.diff
Type: application/octet-stream
Size: 2467 bytes
Desc: not available
Url : http://lists.denx.de/pipermail/u-boot/attachments/20050706/1b1e86c7/attachment.obj
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot-Users] Re: Why exceptions are enabled before exception vector code is copied
2005-07-06 13:50 ` Cedric VINCENT
@ 2006-03-13 11:24 ` Wolfgang Denk
0 siblings, 0 replies; 7+ messages in thread
From: Wolfgang Denk @ 2006-03-13 11:24 UTC (permalink / raw)
To: u-boot
In message <c8f1005070606506c278f6b@mail.gmail.com> you wrote:
>
> Here comes a patch to enable exceptions after exceptions vector code
> is copied (i.e after relocation). I tested it with my board (PPC 405),
> I also changed 440 and IOP480 target but without testing...
>
> I run the MAKEALL script : there are no errors, warnings was not due
> to this patch.
>
> CHANGELOG : * cpu/ppc4xx/start.S : exceptions are enabled after relocation.
Added, thanks.
Best regards,
Wolfgang Denk
--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Backed up the system lately?
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2006-03-13 11:24 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-06 7:45 [U-Boot-Users] Why exceptions are enabled before exception vector code is copied Cedric VINCENT
2005-07-06 8:04 ` [U-Boot-Users] " Wolfgang Denk
2005-07-06 8:53 ` Cedric VINCENT
2005-07-06 8:59 ` Wolfgang Denk
2005-07-06 9:52 ` Cedric VINCENT
2005-07-06 13:50 ` Cedric VINCENT
2006-03-13 11:24 ` Wolfgang Denk
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox