summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/arm/tms570/pom
diff options
context:
space:
mode:
authorPremysl Houdek <kom541000@gmail.com>2014-08-20 17:24:23 +0200
committerGedare Bloom <gedare@rtems.org>2014-08-20 13:44:23 -0400
commit4407ee675cb22e8bb870a76eafc590eb6e754315 (patch)
treeaf8b73c912e1011cd99d5c8966756c06a08bacfd /c/src/lib/libbsp/arm/tms570/pom
parentlpc24xx/lpc17xx: lpc24xx_pin_set_function() keep LPC4088 W type pin in digita... (diff)
downloadrtems-4407ee675cb22e8bb870a76eafc590eb6e754315.tar.bz2
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)
Diffstat (limited to 'c/src/lib/libbsp/arm/tms570/pom')
-rw-r--r--c/src/lib/libbsp/arm/tms570/pom/tms570-pom.c53
1 files changed, 53 insertions, 0 deletions
diff --git a/c/src/lib/libbsp/arm/tms570/pom/tms570-pom.c b/c/src/lib/libbsp/arm/tms570/pom/tms570-pom.c
new file mode 100644
index 0000000000..6514368e55
--- /dev/null
+++ b/c/src/lib/libbsp/arm/tms570/pom/tms570-pom.c
@@ -0,0 +1,53 @@
+/**
+ * @file tms570-pom.c
+ *
+ * @ingroup tms570
+ *
+ * @brief TMS570 Parameter Overlay Module functions definitions.
+ */
+
+ /*
+ * Copyright (c) 2014 Pavel Pisa <pisa@cmp.felk.cvut.cz>
+ *
+ * Czech Technical University in Prague
+ * Zikova 1903/4
+ * 166 36 Praha 6
+ * Czech Republic
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#include <stdint.h>
+#include <bsp/tms570-pom.h>
+#include <bsp/linker-symbols.h>
+#include <bsp.h>
+
+/**
+ * @brief remaps vector table
+ *
+ * transfer the rtems start vector table to address 0x0
+ *
+ * @retval Void
+ */
+void tms570_pom_remap(void)
+{
+ int i;
+ uint32_t vec_overlay_start = 0x08000000;
+
+ memcpy((void*)vec_overlay_start, bsp_start_vector_table_begin, 64);
+
+ TMS570_POM.GLBCTRL = 0;
+
+ for ( i = 0; i < TMS570_POM_REGIONS; ++i ) {
+ TMS570_POM.REG[i].REGSIZE = TMS570_POM_REGSIZE_DISABLED;
+ }
+
+ TMS570_POM.REG[0].PROGSTART = 0x0 & TMS570_POM_REGADDRMASK;
+ TMS570_POM.REG[0].OVLSTART = vec_overlay_start & TMS570_POM_REGADDRMASK;
+ TMS570_POM.REG[0].REGSIZE = TMS570_POM_REGSIZE_64B;
+
+ TMS570_POM.GLBCTRL = TMS570_POM_GLBCTRL_ENABLE |
+ (vec_overlay_start & ~TMS570_POM_REGADDRMASK);
+}