From mboxrd@z Thu Jan 1 00:00:00 1970 From: Cedric VINCENT Date: Wed, 6 Jul 2005 11:52:10 +0200 Subject: [U-Boot-Users] Re: Why exceptions are enabled before exception vector code is copied In-Reply-To: <20050706085932.2D77A353A6A@atlas.denx.de> References: <20050706085932.2D77A353A6A@atlas.denx.de> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de > 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.