summaryrefslogtreecommitdiffstats
path: root/bsps/arm/smdk2410/start/bspreset.c
diff options
context:
space:
mode:
Diffstat (limited to 'bsps/arm/smdk2410/start/bspreset.c')
-rw-r--r--bsps/arm/smdk2410/start/bspreset.c51
1 files changed, 51 insertions, 0 deletions
diff --git a/bsps/arm/smdk2410/start/bspreset.c b/bsps/arm/smdk2410/start/bspreset.c
new file mode 100644
index 0000000000..365a22f14f
--- /dev/null
+++ b/bsps/arm/smdk2410/start/bspreset.c
@@ -0,0 +1,51 @@
+/*
+ * 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.org/license/LICENSE.
+ */
+
+#include <bsp.h>
+#include <bsp/bootcard.h>
+
+void bsp_reset(void)
+{
+#if ON_SKYEYE == 1
+ #define SKYEYE_MAGIC_ADDRESS (*(volatile unsigned int *)(0xb0000000))
+
+ SKYEYE_MAGIC_ADDRESS = 0xff;
+#else
+ /* TODO: This code was initially copied from the gp32 BSP. That BSP has
+ * been obsoleted and removed but this code may still benefit from being
+ * in a shared place.
+ */
+ rtems_interrupt_level level;
+
+ (void) 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
+}