Changeset ec8f3cb in rtems for c/src/lib/libbsp/arm/tms570


Ignore:
Timestamp:
Mar 26, 2015, 8:16:38 PM (5 years ago)
Author:
Martin Galvan <martin.galvan@…>
Branches:
4.11, master
Children:
a300920d
Parents:
89fffa6
git-author:
Martin Galvan <martin.galvan@…> (03/26/15 20:16:38)
git-committer:
Sebastian Huber <sebastian.huber@…> (03/31/15 05:57:04)
Message:

TMS570: Add board reset code to bsp_reset

Location:
c/src/lib/libbsp/arm/tms570
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/arm/tms570/include/tms570.h

    r89fffa6 rec8f3cb  
    88
    99/*
    10  * Copyright (c) 2014 Premysl Houdek <kom541000@gmail.com>
     10 * Copyright (c) 2015 Taller Technologies.
    1111 *
    12  * Google Summer of Code 2014 at
    13  * Czech Technical University in Prague
    14  * Zikova 1903/4
    15  * 166 36 Praha 6
    16  * Czech Republic
    17  *
    18  * Based on LPC24xx and LPC1768 BSP
     12 * @author Martin Galvan <martin.galvan@tallertechnologies.com>
    1913 *
    2014 * The license and distribution terms for this file may be
     
    2620#define LIBBSP_ARM_TMS570_H
    2721
     22#define SYSECR (*(uint32_t *)0xFFFFFFE0u) /* System Exception Control Register */
     23#define ESMIOFFHR (*(uint32_t *)0xFFFFF528) /* ESM Interrupt Offset High Register */
     24#define ESMSR1 (*(uint32_t *)0xFFFFF518u) /* ESM Status Register 1 */
     25#define ESMSR2 (*(uint32_t *)0xFFFFF51Cu) /* ESM Status Register 2 */
     26#define ESMSR3 (*(uint32_t *)0xFFFFF520u) /* ESM Status Register 3 */
     27#define ESMSR4 (*(uint32_t *)0xFFFFF558u) /* ESM Status Register 4 */
     28
     29#define SYSECR_RESET 0x80000u
     30
    2831#endif /* LIBBSP_ARM_TMS570_H */
  • c/src/lib/libbsp/arm/tms570/startup/bspreset.c

    r89fffa6 rec8f3cb  
    88
    99/*
    10  * Copyright (c) 2014 Premysl Houdek <kom541000@gmail.com>
     10 * Copyright (c) 2015 Taller Technologies.
    1111 *
    12  * Google Summer of Code 2014 at
    13  * Czech Technical University in Prague
    14  * Zikova 1903/4
    15  * 166 36 Praha 6
    16  * Czech Republic
    17  *
    18  * Based on LPC24xx and LPC1768 BSP
     12 * @author Martin Galvan <martin.galvan@tallertechnologies.com>
    1913 *
    2014 * The license and distribution terms for this file may be
     
    2317 */
    2418
    25 #include <rtems.h>
    26 
    27 #include <bsp/bootcard.h>
     19#include <bsp.h>
    2820#include <bsp/tms570.h>
    2921#include <bsp/start.h>
    3022
    31 BSP_START_TEXT_SECTION __attribute__( ( flatten ) ) void bsp_reset( void )
     23static void handle_esm_errors(uint32_t esm_irq_channel)
    3224{
    33   while ( true ) {
    34     /* Do nothing */
     25  /* ESMR3 errors don't generate interrupts. */
     26  if (esm_irq_channel < 0x20u) {
     27    ESMSR1 = 1 << esm_irq_channel;
     28  } else if (esm_irq_channel < 0x40u) {
     29    ESMSR2 = 1 << (esm_irq_channel - 32u);
     30  } else if (esm_irq_channel < 0x60u) {
     31    ESMSR4 = 1 << (esm_irq_channel - 64u);
    3532  }
    3633}
     34
     35void bsp_reset(void)
     36{
     37  uint32_t esm_irq_channel = ESMIOFFHR - 1;
     38
     39  if (esm_irq_channel) {
     40    handle_esm_errors(esm_irq_channel);
     41  }
     42
     43  /* Reset the board */
     44  SYSECR = SYSECR_RESET;
     45}
Note: See TracChangeset for help on using the changeset viewer.