source: rtems/c/src/lib/libbsp/arm/tms570/startup/bspreset.c @ 74c4facd

4.115
Last change on this file since 74c4facd was 74c4facd, checked in by Joel Sherrill <joel.sherrill@…>, on 04/14/15 at 15:08:37

tms570/startup/bspreset.c: Add include <bsp/bootcard.h> to fix warning

  • Property mode set to 100644
File size: 994 bytes
Line 
1/**
2 * @file bspreset.c
3 *
4 * @ingroup tms570
5 *
6 * @brief Reset code.
7 */
8
9/*
10 * Copyright (c) 2015 Taller Technologies.
11 *
12 * @author Martin Galvan <martin.galvan@tallertechnologies.com>
13 *
14 * The license and distribution terms for this file may be
15 * found in the file LICENSE in this distribution or at
16 * http://www.rtems.org/license/LICENSE.
17 */
18
19#include <bsp.h>
20#include <bsp/bootcard.h>
21#include <bsp/tms570.h>
22#include <bsp/start.h>
23
24static void handle_esm_errors(uint32_t esm_irq_channel)
25{
26   /* ESMR3 errors don't generate interrupts. */
27   if (esm_irq_channel < 0x20u) {
28     ESMSR1 = 1 << esm_irq_channel;
29   } else if (esm_irq_channel < 0x40u) {
30     ESMSR2 = 1 << (esm_irq_channel - 32u);
31   } else if (esm_irq_channel < 0x60u) {
32     ESMSR4 = 1 << (esm_irq_channel - 64u);
33   }
34}
35
36void bsp_reset(void)
37{
38   uint32_t esm_irq_channel = ESMIOFFHR - 1;
39
40   if (esm_irq_channel) {
41     handle_esm_errors(esm_irq_channel);
42   }
43
44   /* Reset the board */
45   SYSECR = SYSECR_RESET;
46}
Note: See TracBrowser for help on using the repository browser.