]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - keystone-rtos/netapi.git/commitdiff
HPLIB changes to support device specific libraries
authorTinku Mannan <tmannan@ti.com>
Wed, 30 Apr 2014 17:47:37 +0000 (13:47 -0400)
committerTinku Mannan <tmannan@ti.com>
Wed, 30 Apr 2014 17:47:37 +0000 (13:47 -0400)
12 files changed:
ti/runtime/hplib/build/Makefile
ti/runtime/hplib/hplib_vm.h
ti/runtime/hplib/makefile_armv7
ti/runtime/hplib/src/hplib_loc.h
ti/runtime/hplib/src/hplib_vm.c
ti/runtime/hplib/test/bmAllocTest.c
ti/runtime/hplib/test/build/Makefile
ti/runtime/hplib/test/hplibmod_test.c
ti/runtime/hplib/test/pmutest.c
ti/runtime/hplib/test/shmtest.c
ti/runtime/hplib/test/synchtest.c
ti/runtime/hplib/test/synchtest2.c

index dd238de799aa12d0f33f3dc1511cbdf9287c62aa..8505310fa098d6b040f74255a6f4060f491a65d2 100755 (executable)
@@ -71,7 +71,7 @@ COMMONSRCC = \
 #COMMONSRCC +=  osal.c
 #endif
 
-CFLAGS+= $(DEBUG_FLAG) -I. -I $(SRCDIR) -I$(PDK_INSTALL_PATH) -I$(TRANS_SDK_INSTALL_PATH) -I$(CPPI_INC_DIR) -D__LINUX_USER_SPACE -pthread -D _GNU_SOURCE -DPDK_VERSION=$(PDK_VERSION)
+CFLAGS+= $(DEBUG_FLAG) $(CSL_DEVICE) -I. -I $(SRCDIR) -I$(PDK_INSTALL_PATH) -I$(TRANS_SDK_INSTALL_PATH) -I$(CPPI_INC_DIR) -D__LINUX_USER_SPACE -pthread -D _GNU_SOURCE -DPDK_VERSION=$(PDK_VERSION)
 
 
 # Make Rule for the COMMONSRC Files
@@ -156,6 +156,7 @@ clean:
        rm -rf $(ARMV7OBJDIR_NO_OSAL)
        rm -rf $(ARMV7OBJDIR_NO_OSAL_SO)
        rm -f $(ARMV7LIBDIR)/libhplib_$(DEVICE).*
+       rm -f $(ARMV7LIBDIR)/libhplib-no-osal_$(DEVICE).*
 
 module:
        -@echo compiling $< ...
index 1d8bc08e43ac4d6f1e859755a3e8d1f0e645106c..98c2a0909d5dae51389c03ded763df9e379ad83e 100755 (executable)
@@ -189,16 +189,12 @@ typedef struct hplib_memPoolAttr_Tag
  *     number of memory pools being initialized
  *  @param[in] mempool_attr
  *      @ref HPLIB_MemPool_Attr_T
- *  @param[in] p_device_cfg
- *      @ref hplib_globalDeviceConfigParams_t
  *  @retval
  *      1 == Success, -1== Failure.
  */
 int hplib_vmInit(hplib_virtualAddrInfo_T *hplib_vmaddr,
                  int num_pools,
-                 hplib_memPoolAttr_T *mempool_attr,
-                 hplib_globalDeviceConfigParams_t *p_device_cfg);
-
+                 hplib_memPoolAttr_T *mempool_attr);
 /**
  *  @b Description
  *  @n
index 4a795f0f9c08768d924359927b9160af45aff29a..3b0ee35b3a990c9e81160f8c5af7781d3951e917 100755 (executable)
@@ -54,6 +54,20 @@ ifndef MAKE
 export MAKE = make
 endif
 
+
+ifeq ($(DEVICE), k2h)
+export CSL_DEVICE = -DDEVICE_K2H
+endif
+ifeq  ($(DEVICE), k2k)
+export CSL_DEVICE = -DDEVICE_K2K
+endif
+ifeq ($(DEVICE), k2l)
+export CSL_DEVICE = -DDEVICE_K2L
+endif
+ifeq ($(DEVICE), k2e)
+export CSL_DEVICE = -DDEVICE_K2E
+endif
+
 # PHONY Targets
 .PHONY: all clean lib tests examples install installbin
 
index eaba03612fe6a75d5d9423c37c77b5a382d2eeaa..38981adabbeb94e65fa95502f0c4b4078b7354f2 100755 (executable)
@@ -67,8 +67,21 @@ extern "C" {
 #define NETCP_CFG_BASE_ADDR  CSL_PA_SS_CFG_REGS
 #define PASS_CFG_BLK_SZ (1*1024*1024)
 #define SRIO_CFG_BLK_SZ (132*1024)
+#else
+
+#if defined(DEVICE_K2E) || defined(DEVICE_K2L)
+#define QMSS_CFG_BLK_SZ (0x00200000)
+#define PASS_CFG_BLK_SZ (16*1024*1024)
+#define QMSS_DATA_BLK_SZ (0x00100000)
+#else
+#define QMSS_CFG_BLK_SZ (1*1024*1024)
+#define PASS_CFG_BLK_SZ (1*1024*1024)
+#define QMSS_DATA_BLK_SZ (0x60000)
 #endif
 
+#endif
+
+
 typedef uint16_t HPLIB_BOOL_T;
 
 #define  HPLIB_TRUE  1
index d77a50293ee3e24cb5369efa96367fcab93425aa..68fb396daa5ffb957a629a3a598566d63fd1422c 100755 (executable)
@@ -382,8 +382,7 @@ hplib_RetValue hplib_initMallocArea(int pool_id)
  ********************************************************************/
 hplib_RetValue hplib_vmInit(hplib_virtualAddrInfo_T *hplib_vmaddr,
                             int num_pools,
-                            hplib_memPoolAttr_T *mempool_attr,
-                            hplib_globalDeviceConfigParams_t *p_device_cfg)
+                            hplib_memPoolAttr_T *mempool_attr)
 {
     int i;
     
@@ -440,8 +439,7 @@ hplib_RetValue hplib_vmInit(hplib_virtualAddrInfo_T *hplib_vmaddr,
     /* Create virtual memory maps for peripherals */
     /* QMSS CFG Regs */
     hplib_vmaddr->qmssCfgVaddr =
-        hplib_VM_MemMap((void*)p_device_cfg->cslQmssCfgBase,
-                               p_device_cfg->qmssCfgBlkSz);
+        hplib_VM_MemMap((void*)CSL_QMSS_CFG_BASE, QMSS_CFG_BLK_SZ);
     if (!hplib_vmaddr->qmssCfgVaddr)
     {
         hplib_Log("hplib_vmInit: Failed to map QMSS CFG registers\n");
@@ -451,7 +449,7 @@ hplib_RetValue hplib_vmInit(hplib_virtualAddrInfo_T *hplib_vmaddr,
     /*QMSS DATA Regs */
     hplib_vmaddr->qmssDataVaddr =
         (void *) hplib_utilGetVaOfBufferArea(HPLIBMOD_MMAP_QM_DATA_REG_MEM_OFFSET,
-                                             p_device_cfg->qmssDataBlkSz);
+                                             QMSS_DATA_BLK_SZ);
 
     if (!hplib_vmaddr->qmssDataVaddr)
     {
@@ -462,8 +460,9 @@ hplib_RetValue hplib_vmInit(hplib_virtualAddrInfo_T *hplib_vmaddr,
 
     /* PASS CFG Regs */
     hplib_vmaddr->passCfgVaddr =
-            hplib_VM_MemMap((void*)p_device_cfg->cslNetCpCfgRegs,
-                                   p_device_cfg->netcpCfgBlkSz);
+            hplib_VM_MemMap((void*)CSL_NETCP_CFG_REGS,
+                                   //p_device_cfg->netcpCfgBlkSz
+                                   PASS_CFG_BLK_SZ);
 
     if (!hplib_vmaddr->passCfgVaddr)
     {
index 2b242ff49c9ee7e814c0e93b916f48ea33170aec..0ec6eaa879f047bc6ee76efa319912c6c8c8553f 100755 (executable)
 #include <sys/syscall.h>
 #include <sys/sysinfo.h>
 
-
-#if defined(DEVICE_K2H)
-#include <ti/runtime/hplib/device/k2h/src/hplib_device.c>
-#elif defined (DEVICE_K2K)
-#include <ti/runtime/hplib/device/k2k/src/hplib_device.c>
-#elif defined (DEVICE_K2L)
-#include <ti/runtime/hplib/device/k2l/src/hplib_device.c>
-#elif defined (DEVICE_K2E)
-#include <ti/runtime/hplib/device/k2e/src/hplib_device.c>
-#else /*Default */
-#include <ti/runtime/hplib/device/k2h/src/hplib_device.c>
-#endif /* Device */
-
 hplib_memPoolAttr_T netapi_VM_MempoolAttr[HPLIB_MAX_MEM_POOLS];
 hplib_virtualAddrInfo_T netapi_VM_VirtAddr[HPLIB_MAX_MEM_POOLS];
 
@@ -93,8 +80,7 @@ static void* thread_routineM(void* arg)
 
     hplib_vmInit(&netapi_VM_VirtAddr[0],
                   1,
-                  &netapi_VM_MempoolAttr[0],
-                  &hplibDeviceGblCfgParam);
+                  &netapi_VM_MempoolAttr[0]);
     hplib_initMallocArea(0);
     poolHdr = (hplib_VirtMemPoolheader_T*) memPoolAddr[0].memStart;
     for (i=0;i < MAX_ALLOCS;i ++)
@@ -146,9 +132,7 @@ static void* thread_routineP(void* arg)
 
     hplib_vmInit(&netapi_VM_VirtAddr[0],
                   1,
-                  &netapi_VM_MempoolAttr[0],
-                  &hplibDeviceGblCfgParam);
-
+                  &netapi_VM_MempoolAttr[0]);
     printf("awake now: doing allocs\n");
     poolHdr = (hplib_VirtMemPoolheader_T*) memPoolAddr[0].memStart;
     printf("MapInfo: after allocs, totalAllocatedBytes: %d\n", 
index 64cc58954bc5558501a0edf98ed24c6d67f6b8e5..2be8c849e2dbbc28309140e9185bb966cb8fc005 100755 (executable)
@@ -41,20 +41,6 @@ ifdef CROSS_TOOL_INSTALL_PATH
 endif
 
 
-ifeq ($(DEVICE), k2h)
-CSL_DEVICE = -DDEVICE_K2H
-endif
-ifeq  ($(DEVICE), k2k)
-CSL_DEVICE = -DDEVICE_K2K
-endif
-ifeq ($(DEVICE), k2l)
-CSL_DEVICE = -DDEVICE_K2L
-endif
-ifeq ($(DEVICE), k2e)
-CSL_DEVICE = -DDEVICE_K2E
-endif
-
-
 CFLAGS+= $(DEBUG_FLAG) -I../ -I. -I$(PDK_INSTALL_PATH) -I$(TRANS_SDK_INSTALL_PATH) -I$(QMSS_INC_DIR) -I$(CPPI_INC_DIR) $(CSL_DEVICE) -D__ARMv7 -D_VIRTUAL_ADDR_SUPPORT -D__LINUX_USER_SPACE -D_LITTLE_ENDIAN=1 -DMAKEFILE_BUILD -pthread -D _GNU_SOURCE
 
 # Linker options, commenting out INTERNALLINKDEFS
index 9e55601eb7a89eb6c7bb775448e054e64ae81862..b04632f2c48822f91d70deb550090889f3705dd2 100755 (executable)
 #include "hplibmod.h"
 #include "hplib_util.h"
 
-#if defined(DEVICE_K2H)
-#include <ti/runtime/hplib/device/k2h/src/hplib_device.c>
-#elif defined (DEVICE_K2K)
-#include <ti/runtime/hplib/device/k2k/src/hplib_device.c>
-#elif defined (DEVICE_K2L)
-#include <ti/runtime/hplib/device/k2l/src/hplib_device.c>
-#elif defined (DEVICE_K2E)
-#include <ti/runtime/hplib/device/k2e/src/hplib_device.c>
-#else /*Default */
-#include <ti/runtime/hplib/device/k2h/src/hplib_device.c>
-#endif /* Device */
-
-
 #define timing_start hplib_mUtilGetPmuCCNT
-
 #define timing_stop hplib_mUtilGetPmuCCNT
 
 //#define AVOID_MMAP
index 754237659699d74b4d05da5b8c4a1ab10b5e65f5..c84347e12f19dcce452c354411eb6dcb5c47b8cb 100755 (executable)
 #include <errno.h>
 #include "hplib.h"
 
-#if defined(DEVICE_K2H)
-#include <ti/runtime/hplib/device/k2h/src/hplib_device.c>
-#elif defined (DEVICE_K2K)
-#include <ti/runtime/hplib/device/k2k/src/hplib_device.c>
-#elif defined (DEVICE_K2L)
-#include <ti/runtime/hplib/device/k2l/src/hplib_device.c>
-#elif defined (DEVICE_K2E)
-#include <ti/runtime/hplib/device/k2e/src/hplib_device.c>
-#else /*Default */
-#include <ti/runtime/hplib/device/k1/src/hplib_device.c>
-#endif /* Device */
-
-
-
 //usefull events
 #define PMU_IFR 0x1  //instruction fetch causing refill of I cache
 #define PMU_IFT 0x2 //instruction fetch causing refill of TLB
index d30b86a61491c01f4008f092324f07bd48be7f64..e4e5adb61d25c6497c83ddb25047d67d3f0823f1 100755 (executable)
 #include <errno.h>
 #include "hplib.h"
 
-#if defined(DEVICE_K2H)
-#include <ti/runtime/hplib/device/k2h/src/hplib_device.c>
-#elif defined (DEVICE_K2K)
-#include <ti/runtime/hplib/device/k2k/src/hplib_device.c>
-#elif defined (DEVICE_K2L)
-#include <ti/runtime/hplib/device/k2l/src/hplib_device.c>
-#elif defined (DEVICE_K2E)
-#include <ti/runtime/hplib/device/k2e/src/hplib_device.c>
-#else /*Default */
-#include <ti/runtime/hplib/device/k2h/src/hplib_device.c>
-#endif /* Device */
-
-
 #define SHM_SIZE 65536
  char * p= NULL;
 int * pi=NULL;
index dfff9452774d8cd9c642c36576fb2c3a2326b4bf..95ff080abdd8aa892d988986aaea75751d342932 100755 (executable)
 #include <errno.h>
 #include "hplib.h"
 
-#if defined(DEVICE_K2H)
-#include <ti/runtime/hplib/device/k2h/src/hplib_device.c>
-#elif defined (DEVICE_K2K)
-#include <ti/runtime/hplib/device/k2k/src/hplib_device.c>
-#elif defined (DEVICE_K2L)
-#include <ti/runtime/hplib/device/k2l/src/hplib_device.c>
-#elif defined (DEVICE_K2E)
-#include <ti/runtime/hplib/device/k2e/src/hplib_device.c>
-#else /*Default */
-#include <ti/runtime/hplib/device/k1/src/hplib_device.c>
-#endif /* Device */
-
-
 #define timing_start hplib_mUtilGetPmuCCNT
 #define timing_stop hplib_mUtilGetPmuCCNT
 
index 5e5ed6e28afc94e453c4cd92fb8ecd35932280c0..02fb0de93ed95f9d74b9d921497a12939f148f43 100755 (executable)
 #include <errno.h>
 #include "hplib.h"
 
-#if defined(DEVICE_K2H)
-#include <ti/runtime/hplib/device/k2h/src/hplib_device.c>
-#elif defined (DEVICE_K2K)
-#include <ti/runtime/hplib/device/k2k/src/hplib_device.c>
-#elif defined (DEVICE_K2L)
-#include <ti/runtime/hplib/device/k2l/src/hplib_device.c>
-#elif defined (DEVICE_K2E)
-#include <ti/runtime/hplib/device/k2e/src/hplib_device.c>
-#else /*Default */
-#include <ti/runtime/hplib/device/k2h/src/hplib_device.c>
-#endif /* Device */
 
 //#define INC_TO 1000000 // one million.
 #define INC_TO 10000 // one million...