diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-04-22 15:38:55 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-04-23 15:18:43 +0200 |
commit | a62c75c1e384c2388e4c193d661183f5ac48a764 (patch) | |
tree | 20d1ff2373d52a41249eaebe8b394b5a19170a81 /bsps/arm/tms570/start/init_esm.c | |
parent | bsp/gen5200: Move bestcomm to bsps (diff) | |
download | rtems-a62c75c1e384c2388e4c193d661183f5ac48a764.tar.bz2 |
bsp/tms570: Move more start to bsps
This patch is a part of the BSP source reorganization.
Update #3285.
Diffstat (limited to 'bsps/arm/tms570/start/init_esm.c')
-rw-r--r-- | bsps/arm/tms570/start/init_esm.c | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/bsps/arm/tms570/start/init_esm.c b/bsps/arm/tms570/start/init_esm.c new file mode 100644 index 0000000000..23989d2026 --- /dev/null +++ b/bsps/arm/tms570/start/init_esm.c @@ -0,0 +1,62 @@ +/** + * @file init_esm.c + * + * @ingroup tms570 + * + * @brief Error signaling module initialization + */ + +#include <stdint.h> +#include <bsp/tms570.h> +#include "tms570_hwinit.h" + +/** + * @brief Error signaling module initialization (HCG:esmInit) + * + */ +void tms570_esm_init( void ) +{ + /** - Disable error pin channels */ + TMS570_ESM.DEPAPR1 = 0xFFFFFFFFU; + TMS570_ESM.IEPCR4 = 0xFFFFFFFFU; + + /** - Disable interrupts */ + TMS570_ESM.IECR1 = 0xFFFFFFFFU; + TMS570_ESM.IECR4 = 0xFFFFFFFFU; + + /** - Clear error status flags */ + TMS570_ESM.SR[0U] = 0xFFFFFFFFU; + TMS570_ESM.SR[1U] = 0xFFFFFFFFU; + TMS570_ESM.SSR2 = 0xFFFFFFFFU; + TMS570_ESM.SR[2U] = 0xFFFFFFFFU; + TMS570_ESM.SR4 = 0xFFFFFFFFU; + + /** - Setup LPC preload */ + TMS570_ESM.LTCPR = 16384U - 1U; + + /** - Reset error pin */ + if (TMS570_ESM.EPSR == 0U) { + TMS570_ESM.EKR = 0x00000005U; + } else { + TMS570_ESM.EKR = 0x00000000U; + } + + /** - Clear interrupt level */ + TMS570_ESM.ILCR1 = 0xFFFFFFFFU; + TMS570_ESM.ILCR4 = 0xFFFFFFFFU; + + /** - Set interrupt level */ + TMS570_ESM.ILSR1 = 0x00000000; + + TMS570_ESM.ILSR4 = 0x00000000; + + /** - Enable error pin channels */ + TMS570_ESM.EEPAPR1 = 0x00000000; + + TMS570_ESM.IEPSR4 = 0x00000000; + + /** - Enable interrupts */ + TMS570_ESM.IESR1 = 0x00000000; + + TMS570_ESM.IESR4 = 0x00000000; +} |