summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/arm/imx/startup/bspreset.c
blob: 5e2cf3912ab42c43345ecfdf4982a1ac33bd54a6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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_SRS;
  *pcr &= ~WDOG_CR_SRS;
  *pcr &= ~WDOG_CR_SRS;

  while (true) {
    /* Wait */
  }
}