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

4.11
Last change on this file since 49c1d25d was 49c1d25d, checked in by Premysl Houdek <kom541000@…>, on 07/17/15 at 15:04:06

bsp/tms570 Use bitfields instead of hard-coded values

Signed-off-by: Premysl Houdek <kom541000@…>

  • Property mode set to 100644
File size: 1.4 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  uint32_t temp = 0;
39
40  memcpy((void*)vec_overlay_start, bsp_start_vector_table_begin, 64);
41
42  TMS570_POM.GLBCTRL = 0;
43
44  for ( i = 0; i < TMS570_POM_REGIONS; ++i ) {
45    TMS570_POM.REG[i].REGSIZE = TMS570_POM_REGSIZE_SIZE(TMS570_POM_REGSIZE_DISABLED);
46  }
47
48  TMS570_POM.REG[0].PROGSTART = TMS570_POM_PROGSTART_STARTADDRESS(0);
49  TMS570_POM.REG[0].OVLSTART = TMS570_POM_OVLSTART_STARTADDRESS(vec_overlay_start);
50  TMS570_POM.REG[0].REGSIZE = TMS570_POM_REGSIZE_SIZE(TMS570_POM_REGSIZE_64B);
51  TMS570_POM.GLBCTRL = TMS570_POM_GLBCTRL_ON_OFF(0xa) |
52                       TMS570_POM_GLBCTRL_ETO(0xa) |
53                       (TMS570_POM_GLBCTRL_OTADDR(~0) & vec_overlay_start);
54}
Note: See TracBrowser for help on using the repository browser.