source: rtems/bsps/arm/tms570/start/bspstart.c @ 350b07a0

5
Last change on this file since 350b07a0 was 9964895, checked in by Sebastian Huber <sebastian.huber@…>, on 04/20/18 at 08:35:35

bsps: Move startup files to bsps

Adjust build support files to new directory layout.

This patch is a part of the BSP source reorganization.

Update #3285.

  • Property mode set to 100644
File size: 2.1 KB
Line 
1/**
2 * @file bspstart.c
3 *
4 * @ingroup tms570
5 *
6 * @brief Startup code.
7 */
8
9/*
10 * Copyright (c) 2014 Premysl Houdek <kom541000@gmail.com>
11 *
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
19 *
20 * The license and distribution terms for this file may be
21 * found in the file LICENSE in this distribution or at
22 * http://www.rtems.org/license/LICENSE.
23 */
24
25#include <bsp.h>
26#include <bsp/tms570-pom.h>
27#include <bsp/irq-generic.h>
28#include <bsp/start.h>
29#include <bsp/bootcard.h>
30#include <bsp/linker-symbols.h>
31#include <rtems/endian.h>
32
33void bsp_start( void )
34{
35  void *need_remap_ptr;
36  unsigned int need_remap_int;
37
38  tms570_initialize_and_clear();
39
40  /*
41   * If RTEMS image does not start at address 0x00000000
42   * then first level exception table at memory begin has
43   * to be replaced to point to RTEMS handlers addresses.
44   *
45   * There is no VBAR or other option because Cortex-R
46   * does provides only fixed address 0x00000000 for exceptions
47   * (0xFFFF0000-0xFFFF001C alternative SCTLR.V = 1 cannot
48   * be used because target area corersponds to PMM peripheral
49   * registers on TMS570).
50   *
51   * Alternative is to use jumps over SRAM based trampolines
52   * but that is not compatible with
53   *   Check TCRAM1 ECC error detection logic
54   * which intentionally introduces data abort during startup
55   * to check SRAM and if exception processing goes through
56   * SRAM then it leads to CPU error halt.
57   *
58   * So use of POM to replace jumps to vectors target
59   * addresses seems to be the best option for now.
60   *
61   * The passing of linker symbol (represented as start address
62   * of global array) through dummy asm block ensures that C compiler
63   * cannot optimize comparison out on premise that reference cannot
64   * evaluate to NULL definition in standard.
65   */
66  need_remap_ptr = bsp_start_vector_table_begin;
67  asm volatile ("\n": "=r" (need_remap_int): "0" (need_remap_ptr));
68  if ( need_remap_int != 0 ) {
69    tms570_pom_remap();
70  }
71
72  /* Interrupts */
73  bsp_interrupt_initialize();
74
75}
Note: See TracBrowser for help on using the repository browser.