summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/lm32/milkymist/startup/bspclean.c
diff options
context:
space:
mode:
Diffstat (limited to 'c/src/lib/libbsp/lm32/milkymist/startup/bspclean.c')
-rw-r--r--c/src/lib/libbsp/lm32/milkymist/startup/bspclean.c61
1 files changed, 0 insertions, 61 deletions
diff --git a/c/src/lib/libbsp/lm32/milkymist/startup/bspclean.c b/c/src/lib/libbsp/lm32/milkymist/startup/bspclean.c
deleted file mode 100644
index b010292d06..0000000000
--- a/c/src/lib/libbsp/lm32/milkymist/startup/bspclean.c
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Milkymist shutdown routine
- */
-
-/*
- * COPYRIGHT (c) 2010 Sebastien Bourdeauducq
- *
- * 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>
-#include "../include/system_conf.h"
-
-static void reboot(void)
-{
- /* Writing to CSR_SYSTEM_ID causes a system reset */
- MM_WRITE(MM_SYSTEM_ID, 1);
-}
-
-static void icap_write(int val, unsigned int w)
-{
- while (!(MM_READ(MM_ICAP) & ICAP_READY));
- if (!val)
- w |= ICAP_CE|ICAP_WRITE;
- MM_WRITE(MM_ICAP, w);
-}
-
-static void reconf(void)
-{
- icap_write(0, 0xffff); /* dummy word */
- icap_write(0, 0xffff); /* dummy word */
- icap_write(0, 0xffff); /* dummy word */
- icap_write(0, 0xffff); /* dummy word */
- icap_write(1, 0xaa99); /* sync word part 1 */
- icap_write(1, 0x5566); /* sync word part 2 */
- icap_write(1, 0x30a1); /* write to command register */
- icap_write(1, 0x0000); /* null command */
- icap_write(1, 0x30a1); /* write to command register */
- icap_write(1, 0x000e); /* reboot command */
- icap_write(1, 0x2000); /* NOP */
- icap_write(1, 0x2000); /* NOP */
- icap_write(1, 0x2000); /* NOP */
- icap_write(1, 0x2000); /* NOP */
- icap_write(0, 0x1111); /* NULL */
- icap_write(0, 0xffff); /* dummy word */
-}
-
-void bsp_fatal_extension(
- rtems_fatal_source source,
- bool always_set_to_false,
- rtems_fatal_code error
-)
-{
- if (source == RTEMS_FATAL_SOURCE_EXIT && error)
- reconf();
- else
- reboot();
-}