summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/powerpc/gen83xx/startup/bspreset.c
blob: fa4edf6f93a006025e791fae4cdc14219761baf0 (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
34
/*
 * Copyright (c) 2008
 * Embedded Brains GmbH
 * Obere Lagerstr. 30
 * D-82178 Puchheim
 * Germany
 * rtems@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.com/license/LICENSE.
 */

#include <bsp.h>
#include <bsp/bootcard.h>

void bsp_reset(void)
{
  _ISR_Set_level( 0 );

  /* Set Reset Protection Register (RPR) to "RSTE" */
  mpc83xx.res.rpr = 0x52535445;

  /*
   * Wait for Control Register Enabled in the
   * Reset Control Enable Register (RCER).
   */
  while (mpc83xx.res.rcer != 0x00000001) {
    /* Wait */
  }

  /* Set Software Hard Reset in the Reset Control Register (RCR) */
  mpc83xx.res.rcr = 0x00000002;
}