]> rtime.felk.cvut.cz Git - pes-rpp/rpp-lib.git/commitdiff
Move platform specific source files to platform specific directories
authorMichal Horn <michal@apartman.cz>
Tue, 14 Apr 2015 18:43:30 +0000 (20:43 +0200)
committerMichal Horn <michal@apartman.cz>
Tue, 14 Apr 2015 18:43:30 +0000 (20:43 +0200)
17 files changed:
Debug/GNUmakefile
Makefile
Makefile.config [new file with mode: 0644]
Makefile.var
rpp/src/drv/_tms570_rpp/adc.c [moved from rpp/src/drv/adc.c with 99% similarity]
rpp/src/hal/_tms570_rpp/gpio_def.c [moved from rpp/src/hal/gpio_tms570_def.c with 100% similarity]
rpp/src/hal/_tms570_rpp/port_def.c [moved from rpp/src/hal/port_def.c with 98% similarity]
rpp/src/hal/gpio.c [moved from rpp/src/hal/gpio_tms570.c with 97% similarity]
rpp/src/hal/pom_vect_remap.c
rpp/src/hal/port_gpio.c
rpp/src/rpp/_tms570_rpp/adc.c [moved from rpp/src/rpp/adc.c with 100% similarity]
rpp/src/rpp/_tms570_rpp/rpp.c [moved from rpp/src/rpp/rpp.c with 100% similarity]
rpp/src/sys/_tms570_rpp/notification.c [moved from rpp/src/sys/notification.c with 100% similarity]
rpp/src/sys/_tms570_rpp/sys_pinmux.c [moved from rpp/src/sys/sys_pinmux.c with 99% similarity]
rpp/src/sys/_tms570_rpp/sys_startup.c [moved from rpp/src/sys/sys_startup.c with 100% similarity]
rpp/src/sys/_tms570_rpp/ti_drv_adc.c [moved from rpp/src/sys/ti_drv_adc.c with 100% similarity]
rpp/src/sys/system.c

index 75db468e06b7bd2ddcb8bc075caca354a9dbd60a..9c639232ada15603f3c5a6cd8abc8542117034f9 100644 (file)
@@ -25,7 +25,7 @@ include ../common.mk
 CC=$(ARM_COMPILER_DIR)/bin/armcl
 AR=$(ARM_COMPILER_DIR)/bin/armar
 
-rpp_lib_CFLAGS = -mv7R4 --code_state=32 --float_support=VFPv3D16 --abi=eabi -g -O0 --gcc       \
+rpp_lib_CFLAGS = -mv7R4 --code_state=32 --float_support=VFPv3D16 --abi=eabi $(TARGET_CFLAGS) -g -O0 --gcc      \
                -I$(ARM_COMPILER_DIR)/include $(rpp_lib_INCLUDES:%=-I../%)              \
                --diag_warning=225 --display_error_number --diag_wrap=off               \
                --gen_func_subsections=on --enum_type=packed
index e839f00026059caae9b60b294e6dbf1cc8acc138..e4fa5a9c976f13bdcdf2bc41da67e92360fa43a0 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -12,6 +12,8 @@
 # Abstract:
 #       This makefile tries to build all RPP projects in this repository.
 
+include Makefile.config
+
 SUBDIRS = Debug POSIX apps/rpp-test-suite/Debug apps/rpp-test-suite/POSIX
 
 subdir-targets = $(SUBDIRS:%=subdir-%)
diff --git a/Makefile.config b/Makefile.config
new file mode 100644 (file)
index 0000000..cac23ab
--- /dev/null
@@ -0,0 +1,2 @@
+TARGET=tms570_rpp
+TARGET_CFLAGS=-DTARGET_TMS570_RPP
index f1e905affe1b185c7690e2a8b5846fe1e68ae609..b11a6a532497564cb6b4a9d02f729a56d22f69cc 100644 (file)
@@ -12,6 +12,8 @@
 # Abstract:
 #      Definitions of variables used by Makefile 
 
+include $(dir $(lastword $(MAKEFILE_LIST)))Makefile.config
+
 rpp_lib_OS ?= 7.0.2_tms570
 
 rpp_lib_SOURCES =                                                              \
@@ -31,7 +33,7 @@ rpp_lib_SOURCES_6.0.4_posix += \
        os/$(rpp_lib_OS)/src/rpp/sci_posix.c
 
 rpp_lib_SOURCES +=                                                             \
-       rpp/src/rpp/adc.c                                               \
+       rpp/src/rpp/_$(TARGET)/adc.c                            \
        rpp/src/rpp/can.c                                               \
        rpp/src/rpp/dac.c                                               \
        rpp/src/rpp/din.c                                               \
@@ -43,14 +45,14 @@ rpp_lib_SOURCES +=                                                          \
        rpp/src/rpp/lin.c                                               \
        rpp/src/rpp/lout.c                                              \
        rpp/src/rpp/mout.c                                              \
-       rpp/src/rpp/rpp.c                                               \
+       rpp/src/rpp/_$(TARGET)/rpp.c                            \
        rpp/src/rpp/sci.c                                               \
        rpp/src/rpp/sdc.c                                               \
        rpp/src/rpp/sdr.c
        
 
 rpp_lib_SOURCES_7.0.2_tms570 +=                                        \
-       rpp/src/drv/adc.c                                               \
+       rpp/src/drv/_$(TARGET)/adc.c                            \
        rpp/src/drv/dac.c                                               \
        rpp/src/drv/din.c                                               \
        rpp/src/drv/emac.c                                              \
@@ -61,10 +63,10 @@ rpp_lib_SOURCES_7.0.2_tms570 +=                                     \
        rpp/src/drv/lout.c                                              \
        rpp/src/drv/mout.c                                              \
        rpp/src/drv/sci.c                                               \
-       rpp/src/hal/gpio_tms570.c                               \
-       rpp/src/hal/gpio_tms570_def.c                   \
+       rpp/src/hal/gpio.c                                              \
+       rpp/src/hal/_$(TARGET)/gpio_def.c               \
        rpp/src/hal/pom_vect_remap.c                            \
-       rpp/src/hal/port_def.c                                  \
+       rpp/src/hal/_$(TARGET)/port_def.c               \
        rpp/src/hal/port_gpio.c                                 \
        rpp/src/hal/port_spi.c                                  \
        rpp/src/hal/spi.c                                               \
@@ -75,14 +77,14 @@ rpp_lib_SOURCES_7.0.2_tms570 +=                                     \
        rpp/src/sys/asm/sys_intvecs.asm                 \
        rpp/src/sys/asm/sys_mpu.asm                             \
        rpp/src/sys/asm/sys_pmu.asm                             \
-       rpp/src/sys/notification.c                              \
+       rpp/src/sys/_$(TARGET)/notification.c   \
        rpp/src/sys/phy_dp83848h.c                              \
        rpp/src/sys/sys_phantom.c                               \
-       rpp/src/sys/sys_pinmux.c                                        \
+       rpp/src/sys/_$(TARGET)/sys_pinmux.c             \
        rpp/src/sys/sys_selftest.c                              \
-       rpp/src/sys/sys_startup.c                               \
+       rpp/src/sys/_$(TARGET)/sys_startup.c            \
        rpp/src/sys/system.c                                            \
-       rpp/src/sys/ti_drv_adc.c                                        \
+       rpp/src/sys/_$(TARGET)/ti_drv_adc.c             \
        rpp/src/sys/ti_drv_dma.c                                        \
        rpp/src/sys/ti_drv_dmm.c                                        \
        rpp/src/sys/ti_drv_emac.c                               \
similarity index 99%
rename from rpp/src/drv/adc.c
rename to rpp/src/drv/_tms570_rpp/adc.c
index 2585938a45c699cb7066c3ffbe4dde865ceb9070..480daf740b706e049c1841376d10567893032580 100644 (file)
@@ -18,7 +18,7 @@
  */
 
 
-#include "drv/adc.h"
+#include "drv/drv.h"
 
 // Binary semaphore for ADC1 GRP1 conversion (AIN)
 xSemaphoreHandle adcSemaphore_ADC1GRP1;
similarity index 98%
rename from rpp/src/hal/port_def.c
rename to rpp/src/hal/_tms570_rpp/port_def.c
index 94f6e4d3b03be106d483035e4a45f050af78fc15..9b099b5a61c92e7819f87752ed31fbddefb0b317 100644 (file)
  *      Get and set value function are defined for each port style (ADC, SPI, GPIO) in separated files.
  */
 
-//#include "hal/port_def.h"
-// Cannot include upper layer
-//#include "drv_adc.h"
-//#include "hal/port_spi.h"
-//#include "hal/port_gpio.h"
 #include "hal/hal.h"
 
 // Lists of pins assigned to the ports
similarity index 97%
rename from rpp/src/hal/gpio_tms570.c
rename to rpp/src/hal/gpio.c
index d1e466e1df6c75c13ae9a647cf6b797680c51dc5..5a7ec123b89561b0ae0243761c8810977d03a684 100644 (file)
@@ -8,18 +8,17 @@
  * document, and communication of its contents is not permitted
  * without prior written authorization.
  *
- * File : hal_gpio_tms570.c
+ * File : gpio.c
  *
  * Abstract:
  *         This file contains gpio pin configuration functions.
  *      Some additional function for setting and getting pin values, getting
  *      descriptors etc. are defined in header file as inline functions.
  *
- *      Each pin is defined by its descriptor defined in hal_gpio_tms570_def. The descriptor can be obtained
+ *      Each pin is defined by its descriptor defined in hal_gpio_platform_def. The descriptor can be obtained
  *      by hal_gpio_get_pin_dsc by giving a pin name as an argument.
  */
 
-//#include "hal/gpio_tms570.h"
 #include "hal/hal.h"
 
 /**
index c5d6afc8404a9ec659d66f282e49723a8c54336e..9d49b2364fa25a9b90e97684fe165b6b7ce40adb 100644 (file)
 #include <stdint.h>
 #include <sys/ti_drv_pom.h>
 
-#define TMS570_POM_REGIONS 32
-#define TMS570_POM_SIZE_DISABLED 0
-#define TMS570_POM_REGADDRMASK    ((1<<23)-1)
-#define TMS570_POM_GLBCTRL_ENABLE 0x000000a0a
+#define POM_REGIONS 32
+#define POM_SIZE_DISABLED 0
+#define POM_REGADDRMASK    ((1<<23)-1)
+#define POM_GLBCTRL_ENABLE 0x000000a0a
 #define ARM_MAX_EXCEPTIONS 8
 
 #pragma DATA_ALIGN(pom_vector_overlay, 64)
@@ -60,7 +60,7 @@ void pom_set_cpu_exception_handler(int cpu_exception, uint32_t target_addr)
  *
  * @retval Void
  */
-void tms570_pom_vectors_remap(void)
+void pom_vectors_remap(void)
 {
        int i;
        uint32_t vec_overlay_start = (uint32_t)pom_vector_overlay;
@@ -76,14 +76,14 @@ void tms570_pom_vectors_remap(void)
        pom_vector_overlay[7] = 0xe51ff1b0;
 
 
-       for ( i = 0; i < TMS570_POM_REGIONS; ++i ) {
-               pomREG->POMRGNCONF_ST[i].POMREGSIZE_UL = TMS570_POM_SIZE_DISABLED;
+       for ( i = 0; i < POM_REGIONS; ++i ) {
+               pomREG->POMRGNCONF_ST[i].POMREGSIZE_UL = POM_SIZE_DISABLED;
        }
 
-       pomREG->POMRGNCONF_ST[0].POMPROGSTART_UL = 0x0 & TMS570_POM_REGADDRMASK;
-       pomREG->POMRGNCONF_ST[0].POMOVLSTART_UL = vec_overlay_start & TMS570_POM_REGADDRMASK;
+       pomREG->POMRGNCONF_ST[0].POMPROGSTART_UL = 0x0 & POM_REGADDRMASK;
+       pomREG->POMRGNCONF_ST[0].POMOVLSTART_UL = vec_overlay_start & POM_REGADDRMASK;
        pomREG->POMRGNCONF_ST[0].POMREGSIZE_UL = SIZE_64BYTES;
 
-       pomREG->POMGLBCTRL_UL = TMS570_POM_GLBCTRL_ENABLE |
-                                                       (vec_overlay_start & ~TMS570_POM_REGADDRMASK);
+       pomREG->POMGLBCTRL_UL = POM_GLBCTRL_ENABLE |
+                                                       (vec_overlay_start & ~POM_REGADDRMASK);
 }
index 24a82c56418eb8f4b402e64f76274b358fca937f..79e990ede0b3dee4674d388e5dc4a9ab4ba0dff2 100644 (file)
@@ -14,8 +14,6 @@
  *         This file contains getter and setter functions for GPIO port type.
  */
 
-//#include "hal/port_gpio.h"
-//#include "hal/gpio_tms570.h"
 #include "hal/hal.h"
 
 /**
similarity index 99%
rename from rpp/src/sys/sys_pinmux.c
rename to rpp/src/sys/_tms570_rpp/sys_pinmux.c
index 7370a3ce4a88fe0ff35b155c9385815dba25b3cf..d0465fff1f4951b328b43f0c94a34ff73d493027 100644 (file)
@@ -9,7 +9,7 @@
 
 /* Include Files */
 
-#include "sys/sys_pinmux.h"
+#include "sys/_tms570_rpp/sys_pinmux.h"
 
 #define PINMUX_SET(REG, BALLID, MUX)                                \
                 pinMuxReg->PINMUX##REG = (pinMuxReg->PINMUX##REG & PINMUX_BALL_##BALLID##_MASK) | (PINMUX_BALL_##BALLID##_##MUX)
index d8806a76663cf618363df69225f66af08d25fd47..6902784207b2f8121721fc58b15190a286ae3f84 100644 (file)
@@ -65,7 +65,7 @@ void setupPLL(void)
     systemREG1->PLLCTL2 =  0x00000000U
                         | (255U << 22U)
                         | (7U << 12U)
-                        | ((2U - 1U)<< 9U)
+                        | ((RPP_PLL1_CLK_OUT_DIV - 1U)<< 9U)
                         |  61U;
 
     /** @b Initialize @b Pll2: */
@@ -159,6 +159,7 @@ void mapClocks(void)
     /** - Diable / Enable clock domain */
     systemREG1->CDDIS = (FALSE << 4 ) |        /* VCLKA1 ON - Periph clock domain for CAN1-3 */
                         (FALSE << 5 ) |        /* VCLKA2 ON - Periph clock domain for CAN1-3 */
+                        (FALSE << 6 ) | /* RTICLK1 OFF - Real Time Interrupt clock domain */
                         (FALSE << 8 ) |        /* VCLK3 ON - Periph clock domain for EMIF, EMAC, USB */
                         (FALSE  << 10) |       /* VCLKA3 OFF - Periph clock domain for EMAC */
                         (FALSE  << 11) ;       /* VCLKA4 OFF - */
@@ -199,10 +200,10 @@ void mapClocks(void)
     systemREG1->VCLKASRC = (RPP_VCLKA2_CLK_SRC << 8U)
                           |  RPP_VCLKA1_CLK_SRC;
 
-    systemREG2->VCLKACON1 = ((RPP_VCLKA4_CLK_DIV-1) << 24)
+    systemREG2->VCLKACON1 = (RPP_VCLKA4_CLK_DIV-1) << 24
                            | RPP_VCLKA4_DIV_OUT_DIS << 20U
-                           | (RPP_VCLKA4_CLK_SRC << 16)
-                           | ((RPP_VCLKA3_CLK_DIV-1) << 8)
+                           | RPP_VCLKA4_CLK_SRC << 16
+                           | (RPP_VCLKA3_CLK_DIV-1) << 8
                            | RPP_VCLKA3_DIV_OUT_DIS << 4U
                            | RPP_VCLKA3_CLK_SRC;
 }