source: rtems/c/src/lib/libbsp/arm/tms570/pom/tms570-pom.c @ 9588946

4.115
Last change on this file since 9588946 was 4407ee6, checked in by Premysl Houdek <kom541000@…>, on 08/20/14 at 15:24:23

BSP for TMS570LS31x Hercules Development Kit from TI (TMS570LS3137)

Included variants:

tms570ls3137_hdk_intram - place code and data into internal SRAM
tms570ls3137_hdk_sdram - place code into external SDRAM and data to SRAM
tms570ls3137_hdk - variant prepared for stand-alone RTEMS aplication

stored and running directly from flash. Not working yet.

Chip initialization code not included in BSP.
External startup generated by TI's HalCoGen? was used for
testing and debugging.

More information about TMS570 BSP can be found at

http://www.rtems.org/wiki/index.php/Tms570

Patch version 2

  • most of the formatting suggestion applied.
  • BSP converted to use clock shell
  • console driver "set attributes" tested. Baudrate change working

Patch version 3

  • more formatting changes.
  • removed leftover defines and test functions

Todo:

refactor header files (name register fields)

  • Property mode set to 100644
File size: 1.2 KB
Line 
1/**
2 * @file tms570-pom.c
3 *
4 * @ingroup tms570
5 *
6 * @brief TMS570 Parameter Overlay Module functions definitions.
7 */
8
9 /*
10 * Copyright (c) 2014 Pavel Pisa <pisa@cmp.felk.cvut.cz>
11 *
12 * Czech Technical University in Prague
13 * Zikova 1903/4
14 * 166 36 Praha 6
15 * Czech Republic
16 *
17 * The license and distribution terms for this file may be
18 * found in the file LICENSE in this distribution or at
19 * http://www.rtems.org/license/LICENSE.
20 */
21
22#include <stdint.h>
23#include <bsp/tms570-pom.h>
24#include <bsp/linker-symbols.h>
25#include <bsp.h>
26
27/**
28 * @brief remaps vector table
29 *
30 * transfer the rtems start vector table to address 0x0
31 *
32 * @retval Void
33 */
34void tms570_pom_remap(void)
35{
36  int i;
37  uint32_t vec_overlay_start = 0x08000000;
38
39  memcpy((void*)vec_overlay_start, bsp_start_vector_table_begin, 64);
40
41  TMS570_POM.GLBCTRL = 0;
42
43  for ( i = 0; i < TMS570_POM_REGIONS; ++i ) {
44    TMS570_POM.REG[i].REGSIZE = TMS570_POM_REGSIZE_DISABLED;
45  }
46
47  TMS570_POM.REG[0].PROGSTART = 0x0 & TMS570_POM_REGADDRMASK;
48  TMS570_POM.REG[0].OVLSTART = vec_overlay_start & TMS570_POM_REGADDRMASK;
49  TMS570_POM.REG[0].REGSIZE = TMS570_POM_REGSIZE_64B;
50
51  TMS570_POM.GLBCTRL = TMS570_POM_GLBCTRL_ENABLE |
52                       (vec_overlay_start & ~TMS570_POM_REGADDRMASK);
53}
Note: See TracBrowser for help on using the repository browser.