source: rtems/c/src/lib/libbsp/arm/imx/startup/bspreset.c @ 4438c4d8

Last change on this file since 4438c4d8 was 4438c4d8, checked in by Sebastian Huber <sebastian.huber@…>, on Nov 2, 2017 at 12:27:33 PM

bsp/imx: More robust and faster bsp_reset()

Update #3090.

  • Property mode set to 100644
File size: 653 bytes
Line 
1/*
2 * Copyright (c) 2017 embedded brains GmbH.  All rights reserved.
3 *
4 *  embedded brains GmbH
5 *  Dornierstr. 4
6 *  82178 Puchheim
7 *  Germany
8 *  <info@embedded-brains.de>
9 *
10 * The license and distribution terms for this file may be
11 * found in the file LICENSE in this distribution or at
12 * http://www.rtems.org/license/LICENSE.
13 */
14
15#include <bsp/bootcard.h>
16#include <bsp.h>
17#include <arm/freescale/imx/imx_wdogreg.h>
18
19void bsp_reset(void)
20{
21  volatile uint16_t *pcr;
22
23  imx_uart_console_drain();
24
25  pcr = (volatile uint16_t *) 0x30280000;
26  *pcr = WDOG_CR_WDE;
27  *pcr = WDOG_CR_WDE;
28  *pcr = WDOG_CR_WDE;
29
30  while (true) {
31    /* Wait */
32  }
33}
Note: See TracBrowser for help on using the repository browser.