source: rtems/c/src/lib/libbsp/arm/tms570/hwinit/init_esm.c @ bd7f099

5
Last change on this file since bd7f099 was 29430a3, checked in by Pavel Pisa <pisa@…>, on 09/22/16 at 07:50:59

arm/tms570: include hardware initialization and selftest based on Ti HalCoGen? generated files.

The configuration is specific for TMS570LS3137 based HDK.
Pins configuration can be easily changed in

rtems/c/src/lib/libbsp/arm/tms570/hwinit/init_pinmux.c

file.

The list tms570_selftest_par_list in the file

rtems/c/src/lib/libbsp/arm/tms570/hwinit/bspstarthooks-hwinit.c

specifies peripherals which health status is examined
by parity self-test at BSP start-up. It can be easily
modified for other TMS570 family members variants same
as the selection of other tests in bspstarthooks-hwinit.c.

  • Property mode set to 100644
File size: 1.3 KB
Line 
1/**
2 * @file init_esm.c
3 *
4 * @ingroup tms570
5 *
6 * @brief Error signaling module initialization
7 */
8
9#include <stdint.h>
10#include <bsp/tms570.h>
11#include "tms570_hwinit.h"
12
13/**
14 * @brief Error signaling module initialization (HCG:esmInit)
15 *
16 */
17void tms570_esm_init( void )
18{
19  /** - Disable error pin channels */
20  TMS570_ESM.DEPAPR1 = 0xFFFFFFFFU;
21  TMS570_ESM.IEPCR4 = 0xFFFFFFFFU;
22
23  /** - Disable interrupts */
24  TMS570_ESM.IECR1 = 0xFFFFFFFFU;
25  TMS570_ESM.IECR4 = 0xFFFFFFFFU;
26
27  /** - Clear error status flags */
28  TMS570_ESM.SR[0U] = 0xFFFFFFFFU;
29  TMS570_ESM.SR[1U] = 0xFFFFFFFFU;
30  TMS570_ESM.SSR2   = 0xFFFFFFFFU;
31  TMS570_ESM.SR[2U] = 0xFFFFFFFFU;
32  TMS570_ESM.SR4    = 0xFFFFFFFFU;
33
34  /** - Setup LPC preload */
35  TMS570_ESM.LTCPR = 16384U - 1U;
36
37  /** - Reset error pin */
38  if (TMS570_ESM.EPSR == 0U) {
39    TMS570_ESM.EKR = 0x00000005U;
40  } else {
41    TMS570_ESM.EKR = 0x00000000U;
42  }
43
44  /** - Clear interrupt level */
45  TMS570_ESM.ILCR1 = 0xFFFFFFFFU;
46  TMS570_ESM.ILCR4 = 0xFFFFFFFFU;
47
48  /** - Set interrupt level */
49  TMS570_ESM.ILSR1 = 0x00000000;
50
51  TMS570_ESM.ILSR4 = 0x00000000;
52
53  /** - Enable error pin channels */
54  TMS570_ESM.EEPAPR1 = 0x00000000;
55
56  TMS570_ESM.IEPSR4 = 0x00000000;
57
58  /** - Enable interrupts */
59  TMS570_ESM.IESR1 = 0x00000000;
60
61  TMS570_ESM.IESR4 = 0x00000000;
62}
Note: See TracBrowser for help on using the repository browser.