Back to home page

LXR

 
 

    


File indexing completed on 2025-05-11 08:23:05

0001 /*
0002  *  Copyright (c) 2002 by Jay Monkman <jtm@smoothsmoothie.com>
0003  *
0004  *  The license and distribution terms for this file may be
0005  *  found in the file LICENSE in this distribution or at
0006  *  http://www.rtems.org/license/LICENSE.
0007  */
0008 
0009 #include <bsp.h>
0010 #include <bsp/bootcard.h>
0011 
0012 void bsp_reset( rtems_fatal_source source, rtems_fatal_code code )
0013 {
0014   (void) source;
0015   (void) code;
0016 
0017 #if ON_SKYEYE == 1
0018   #define SKYEYE_MAGIC_ADDRESS (*(volatile unsigned int *)(0xb0000000))
0019 
0020   SKYEYE_MAGIC_ADDRESS = 0xff;
0021 #else
0022   /* TODO: This code was initially copied from the gp32 BSP. That BSP has
0023    * been obsoleted and removed but this code may still benefit from being
0024    * in a shared place.
0025    */
0026   rtems_interrupt_level level;
0027 
0028   rtems_interrupt_disable(level);
0029   (void) level;
0030   /* disable mmu, invalide i-cache and call swi #4 */
0031   __asm__ volatile(""
0032     "mrc    p15,0,r0,c1,c0,0  \n"
0033     "bic    r0,r0,#1          \n"
0034     "mcr    p15,0,r0,c1,c0,0  \n"
0035     "nop                      \n"
0036     "nop                      \n"
0037     "nop                      \n"
0038     "nop                      \n"
0039     "nop                      \n"
0040     "mov    r0,#0             \n"
0041     "MCR    p15,0,r0,c7,c5,0  \n"
0042     "nop                      \n"
0043     "nop                      \n"
0044     "nop                      \n"
0045     "nop                      \n"
0046     "nop                      \n"
0047     "swi    #4                "
0048     :
0049     :
0050     : "r0"
0051   );
0052   /* we should be back in bios now */
0053 #endif
0054 
0055   RTEMS_UNREACHABLE();
0056 }