diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2009-08-10 03:03:08 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2009-08-10 03:03:08 +0000 |
commit | 57bcaa29a7e46c01ff62cc9c582f67859182c567 (patch) | |
tree | efdfceab0c745458eec505fc16b8dfaee73d583a /c/src/lib/libbsp/arm/smdk2410/startup/bspreset.c | |
parent | 2009-08-09 Joel Sherrill <joel.sherrill@oarcorp.com> (diff) | |
download | rtems-57bcaa29a7e46c01ff62cc9c582f67859182c567.tar.bz2 |
2009-08-09 Joel Sherrill <joel.sherrill@oarcorp.com>
* Makefile.am, configure.ac: Add Skyeye reset device.
* startup/bspreset.c: New file.
Diffstat (limited to 'c/src/lib/libbsp/arm/smdk2410/startup/bspreset.c')
-rw-r--r-- | c/src/lib/libbsp/arm/smdk2410/startup/bspreset.c | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/c/src/lib/libbsp/arm/smdk2410/startup/bspreset.c b/c/src/lib/libbsp/arm/smdk2410/startup/bspreset.c new file mode 100644 index 0000000000..718958573f --- /dev/null +++ b/c/src/lib/libbsp/arm/smdk2410/startup/bspreset.c @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2002 by Jay Monkman <jtm@smoothsmoothie.com> + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.com/license/LICENSE. + * + * $Id$ + */ + +#include <bsp.h> + +void bsp_reset(void) +{ +#if ON_SKYEYE == 1 + #define SKYEYE_MAGIC_ADDRESS (*(volatile unsigned int *)(0xb0000000)) + + SKYEYE_MAGIC_ADDRESS = 0xff; +#else + /* XXX TODO this code is copied from gp32.. move it to a shared place */ + rtems_interrupt_level level; + rtems_interrupt_disable(level); + /* disable mmu, invalide i-cache and call swi #4 */ + asm volatile("" + "mrc p15,0,r0,c1,c0,0 \n" + "bic r0,r0,#1 \n" + "mcr p15,0,r0,c1,c0,0 \n" + "nop \n" + "nop \n" + "nop \n" + "nop \n" + "nop \n" + "mov r0,#0 \n" + "MCR p15,0,r0,c7,c5,0 \n" + "nop \n" + "nop \n" + "nop \n" + "nop \n" + "nop \n" + "swi #4 " + : + : + : "r0" + ); + /* we should be back in bios now */ +#endif +} |