summaryrefslogtreecommitdiffstats
path: root/bsps/arm/imx/start/bspreset.c
diff options
context:
space:
mode:
Diffstat (limited to 'bsps/arm/imx/start/bspreset.c')
-rw-r--r--bsps/arm/imx/start/bspreset.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/bsps/arm/imx/start/bspreset.c b/bsps/arm/imx/start/bspreset.c
new file mode 100644
index 0000000000..c3c9f69566
--- /dev/null
+++ b/bsps/arm/imx/start/bspreset.c
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2017 embedded brains GmbH. All rights reserved.
+ *
+ * embedded brains GmbH
+ * Dornierstr. 4
+ * 82178 Puchheim
+ * Germany
+ * <info@embedded-brains.de>
+ *
+ * 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/bootcard.h>
+#include <bsp.h>
+#include <arm/freescale/imx/imx_wdogreg.h>
+
+void bsp_reset(void)
+{
+ volatile uint16_t *pcr;
+
+ imx_uart_console_drain();
+
+ pcr = (volatile uint16_t *) 0x30280000;
+ *pcr = WDOG_CR_WDE;
+ *pcr = WDOG_CR_WDE;
+ *pcr = WDOG_CR_WDE;
+
+ while (true) {
+ /* Wait */
+ }
+}