summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSam Nelson2015-11-17 05:34:28 -0600
committerSam Nelson2015-11-25 09:28:27 -0600
commitac1a8c0190af10cc34ac3c978f7fd9a490d7f68c (patch)
treeb4bb10529c372d0e10985948eaa886f871f87639
parent66ae15047eb1cd77c7892a235aa0477f557d021c (diff)
downloadmpm-transport-ac1a8c0190af10cc34ac3c978f7fd9a490d7f68c.tar.gz
mpm-transport-ac1a8c0190af10cc34ac3c978f7fd9a490d7f68c.tar.xz
mpm-transport-ac1a8c0190af10cc34ac3c978f7fd9a490d7f68c.zip
transport: Update to build without SRIO and Hyplnk for certain devices
- Some devices do not support the peripherals SRIO or hyperlink. So adding options to build without SRIO and/or Hyperlink. - Includes makefile and source code update Signed-off-by: Sam Nelson <sam.nelson@ti.com>
-rwxr-xr-xMakefile9
-rwxr-xr-xsrc/transport/Makefile35
-rwxr-xr-xsrc/transport/mpm_transport.c83
-rwxr-xr-xsrc/transport/test/Makefile12
4 files changed, 126 insertions, 13 deletions
diff --git a/Makefile b/Makefile
index 751eb06..3bb38b0 100755
--- a/Makefile
+++ b/Makefile
@@ -112,10 +112,13 @@ sysroot_install:
112installbin: 112installbin:
113 install -d $(INSTALL_BIN_BASE_DIR) 113 install -d $(INSTALL_BIN_BASE_DIR)
114 install -c -m 755 $(BASE_DIR)/src/transport/test/sharedmem/mpm_transport_test.out $(INSTALL_BIN_BASE_DIR)/mpm_transport_test.out 114 install -c -m 755 $(BASE_DIR)/src/transport/test/sharedmem/mpm_transport_test.out $(INSTALL_BIN_BASE_DIR)/mpm_transport_test.out
115 install -c -m 755 $(BASE_DIR)/src/transport/test/qmss/qmss_arm_mt/mpm_transport_qmss_arm_mt.out $(INSTALL_BIN_BASE_DIR)/mpm_transport_qmss_arm_mt.out
116ifeq ($(SRIO_TRANSPORT),true)
117 install -c -m 755 $(BASE_DIR)/src/transport/test/srio/srio_arm_mt/mpm_transport_srio_arm_mt.out $(INSTALL_BIN_BASE_DIR)/mpm_transport_srio_arm_mt.out
118endif
119ifeq ($(HYPLNK_TRANSPORT),true)
115 install -c -m 755 $(BASE_DIR)/src/transport/test/hyplnk/hyplnk_loopback/mpm_transport_hyplnk_loopback.out $(INSTALL_BIN_BASE_DIR)/mpm_transport_hyplnk_loopback.out 120 install -c -m 755 $(BASE_DIR)/src/transport/test/hyplnk/hyplnk_loopback/mpm_transport_hyplnk_loopback.out $(INSTALL_BIN_BASE_DIR)/mpm_transport_hyplnk_loopback.out
116 install -c -m 755 $(BASE_DIR)/src/transport/test/hyplnk/hyplnk_remote/mpm_transport_hyplnk_remote.out $(INSTALL_BIN_BASE_DIR)/mpm_transport_hyplnk_remote.out 121 install -c -m 755 $(BASE_DIR)/src/transport/test/hyplnk/hyplnk_remote/mpm_transport_hyplnk_remote.out $(INSTALL_BIN_BASE_DIR)/mpm_transport_hyplnk_remote.out
117 install -c -m 755 $(BASE_DIR)/src/transport/test/hyplnk/hyplnk_loopback_dma/mpm_transport_hyplnk_loopback_dma.out $(INSTALL_BIN_BASE_DIR)/mpm_transport_hyplnk_loopback_dma.out 122 install -c -m 755 $(BASE_DIR)/src/transport/test/hyplnk/hyplnk_loopback_dma/mpm_transport_hyplnk_loopback_dma.out $(INSTALL_BIN_BASE_DIR)/mpm_transport_hyplnk_loopback_dma.out
118 install -c -m 755 $(BASE_DIR)/src/transport/test/hyplnk/hyplnk_loopback64/mpm_transport_hyplnk_loopback64.out $(INSTALL_BIN_BASE_DIR)/mpm_transport_hyplnk_loopback64.out 123 install -c -m 755 $(BASE_DIR)/src/transport/test/hyplnk/hyplnk_loopback64/mpm_transport_hyplnk_loopback64.out $(INSTALL_BIN_BASE_DIR)/mpm_transport_hyplnk_loopback64.out
119 install -c -m 755 $(BASE_DIR)/src/transport/test/qmss/qmss_arm_mt/mpm_transport_qmss_arm_mt.out $(INSTALL_BIN_BASE_DIR)/mpm_transport_qmss_arm_mt.out 124endif
120 install -c -m 755 $(BASE_DIR)/src/transport/test/srio/srio_arm_mt/mpm_transport_srio_arm_mt.out $(INSTALL_BIN_BASE_DIR)/mpm_transport_srio_arm_mt.out
121
diff --git a/src/transport/Makefile b/src/transport/Makefile
index 6786757..16e9434 100755
--- a/src/transport/Makefile
+++ b/src/transport/Makefile
@@ -61,25 +61,52 @@ RM_OBJ = $(RM_DIR)/mpm_transport_rm_osal.o $(RM_DIR)/mpm_transport_rm.o
61FW_DIR = $(MPM_UTILS)/fw_mem 61FW_DIR = $(MPM_UTILS)/fw_mem
62FW_OBJ = $(FW_DIR)/fw_mem_allocator.o $(FW_DIR)/fw_mem_allocator_osal.o 62FW_OBJ = $(FW_DIR)/fw_mem_allocator.o $(FW_DIR)/fw_mem_allocator_osal.o
63 63
64MPMTRANSPORT_OBJS = mpm_transport.o $(MPMTRANSPORT_SHAREDMEM_OBJS) $(cJSON_OBJ) $(SERDES_OBJ) $(EDMA3_OBJ) $(KEYSTONE_MMAP_OBJ) $(UIO_OBJ) $(RM_OBJ) $(FW_OBJ) $(MPMTRANSPORT_HYPLNK_OBJS) $(MPMTRANSPORT_QMSS_OBJS) $(MPMTRANSPORT_SRIO_OBJS) 64MPMTRANSPORT_OBJS = mpm_transport.o $(MPMTRANSPORT_SHAREDMEM_OBJS) $(cJSON_OBJ) $(SERDES_OBJ) $(EDMA3_OBJ) $(KEYSTONE_MMAP_OBJ) $(UIO_OBJ) $(RM_OBJ) $(FW_OBJ) $(MPMTRANSPORT_QMSS_OBJS)
65MPMTRANSPORT_SHAREDMEM_OBJS = sharedmem/mpm_transport_sharedmem.o 65
66ifeq ($(HYPLNK_TRANSPORT),true)
67MPMTRANSPORT_OBJS += $(MPMTRANSPORT_HYPLNK_OBJS)
68endif
69
70ifeq ($(SRIO_TRANSPORT),true)
71MPMTRANSPORT_OBJS += $(MPMTRANSPORT_SRIO_OBJS)
72endif
73
74MPMTRANSPORT_SHAREDMEM_OBJS = sharedmem/mpm_transport_sharedmem.o
75
76ifeq ($(HYPLNK_TRANSPORT),true)
66MPMTRANSPORT_HYPLNK_OBJS = hyplnk/mpm_transport_hyplnk.o hyplnk/mpm_transport_hyplnk_interface.o 77MPMTRANSPORT_HYPLNK_OBJS = hyplnk/mpm_transport_hyplnk.o hyplnk/mpm_transport_hyplnk_interface.o
78endif
67MPMTRANSPORT_QMSS_OBJS = qmss/mpm_transport_qmss_interface.o qmss/mpm_transport_qmss.o qmss/mpm_transport_qmss_osal.o 79MPMTRANSPORT_QMSS_OBJS = qmss/mpm_transport_qmss_interface.o qmss/mpm_transport_qmss.o qmss/mpm_transport_qmss_osal.o
80ifeq ($(SRIO_TRANSPORT),true)
68MPMTRANSPORT_SRIO_OBJS = srio/mpm_transport_srio.o srio/mpm_transport_srio_osal.o 81MPMTRANSPORT_SRIO_OBJS = srio/mpm_transport_srio.o srio/mpm_transport_srio_osal.o
82endif
69MPMTRANSPORT_OBJS_SO = $(patsubst %.o, %.so, $(MPMTRANSPORT_OBJS)) 83MPMTRANSPORT_OBJS_SO = $(patsubst %.o, %.so, $(MPMTRANSPORT_OBJS))
70 84
71MPMTRANSPORT_TEST_DIR = test 85MPMTRANSPORT_TEST_DIR = test
72 86
73TIME_PROFILE_DIR = $(MPM_UTILS)/time_profile 87TIME_PROFILE_DIR = $(MPM_UTILS)/time_profile
74 88
75MPMTRANSPORT_INC = -I. -I$(MPM_INC) -I$(MPM_UTILS) -I./sharedmem -I./hyplnk -I./qmss -I./srio 89MPMTRANSPORT_INC = -I. -I$(MPM_INC) -I$(MPM_UTILS) -I./sharedmem -I./qmss
90ifeq ($(SRIO_TRANSPORT),true)
91MPMTRANSPORT_INC += -I./srio
92endif
93ifeq ($(HYPLNK_TRANSPORT),true)
94MPMTRANSPORT_INC += -I./hyplnk
95endif
96
76EDMA3_INC = -I$(EDMA3_DIR) 97EDMA3_INC = -I$(EDMA3_DIR)
77KEYSTONE_MMAP_INC = -I$(KEYSTONE_MMAP_DIR) 98KEYSTONE_MMAP_INC = -I$(KEYSTONE_MMAP_DIR)
78UIO_INC = -I$(UIO_DIR) 99UIO_INC = -I$(UIO_DIR)
79RM_INC = -I$(RM_DIR) 100RM_INC = -I$(RM_DIR)
80FW_INC = -I$(FW_DIR) 101FW_INC = -I$(FW_DIR)
81TIME_PROFILE_INC = -I$(TIME_PROFILE_DIR) 102TIME_PROFILE_INC = -I$(TIME_PROFILE_DIR)
82PERIPHERAL_LIBS = -lhyplnk_device -ledma3 -ledma3rm -lkeystonemmap -lrm -lqmss_device -lcppi_device -lsrio -lticmem 103PERIPHERAL_LIBS = -ledma3 -ledma3rm -lkeystonemmap -lrm -lqmss_device -lcppi_device -lticmem
104ifeq ($(HYPLNK_TRANSPORT),true)
105PERIPHERAL_LIBS += -lhyplnk_device
106endif
107ifeq ($(SRIO_TRANSPORT),true)
108PERIPHERAL_LIBS += -lsrio
109endif
83 110
84VPATH += $(DEVKIT_INC)/$(SERDES_DIR) $(DEVKIT_INC)/ti/sdo/edma3/drv/sample/src/platforms/ 111VPATH += $(DEVKIT_INC)/$(SERDES_DIR) $(DEVKIT_INC)/ti/sdo/edma3/drv/sample/src/platforms/
85 112
diff --git a/src/transport/mpm_transport.c b/src/transport/mpm_transport.c
index 9ac9f10..9e7f4df 100755
--- a/src/transport/mpm_transport.c
+++ b/src/transport/mpm_transport.c
@@ -45,9 +45,13 @@
45#include "cJSON/cJSON.h" 45#include "cJSON/cJSON.h"
46#include "mpm_transport_cfg.h" 46#include "mpm_transport_cfg.h"
47#include "mpm_transport_sharedmem.h" 47#include "mpm_transport_sharedmem.h"
48#include "mpm_transport_hyplnk.h"
49#include "mpm_transport_qmss.h" 48#include "mpm_transport_qmss.h"
49#ifdef HYPLNK_TRANSPORT
50#include "mpm_transport_hyplnk.h"
51#endif
52#ifdef SRIO_TRANSPORT
50#include "mpm_transport_srio.h" 53#include "mpm_transport_srio.h"
54#endif
51 55
52#define DEFAULT_CONFIG_FILE_NAME "/etc/mpm/mpm_config.json" 56#define DEFAULT_CONFIG_FILE_NAME "/etc/mpm/mpm_config.json"
53 57
@@ -150,6 +154,7 @@ int json_get_mmap_info (cJSON *json, char *map_name, mpm_transport_cfg_t *sp, in
150 } 154 }
151 strncpy(mmap->devicename, sege->valuestring, MPM_MAX_NAME_LENGTH); 155 strncpy(mmap->devicename, sege->valuestring, MPM_MAX_NAME_LENGTH);
152 } 156 }
157#ifdef HYPLNK_TRANSPORT
153 if (sp->transport == hyperlink) { 158 if (sp->transport == hyperlink) {
154 /* This section to be moved to hyplnk directory */ 159 /* This section to be moved to hyplnk directory */
155 sege = cJSON_GetObjectItem(segp, "devicename"); 160 sege = cJSON_GetObjectItem(segp, "devicename");
@@ -165,6 +170,7 @@ int json_get_mmap_info (cJSON *json, char *map_name, mpm_transport_cfg_t *sp, in
165 } 170 }
166 strncpy(mmap->devicename, sege->valuestring, MPM_MAX_NAME_LENGTH); 171 strncpy(mmap->devicename, sege->valuestring, MPM_MAX_NAME_LENGTH);
167 } 172 }
173#endif
168 174
169 break; 175 break;
170 } 176 }
@@ -334,9 +340,13 @@ int json_get_mpax_info (cJSON *json, char *mpax_name, mpm_transport_cfg_t *sp)
334 340
335int json_get_transport_info (cJSON *json, char *transport_name, mpm_transport_cfg_t *sp) 341int json_get_transport_info (cJSON *json, char *transport_name, mpm_transport_cfg_t *sp)
336{ 342{
337 mpm_transport_hyplnk_t * hypInfo;
338 mpm_transport_qmss_t *qmInfo; 343 mpm_transport_qmss_t *qmInfo;
344#ifdef HYPLNK_TRANSPORT
345 mpm_transport_hyplnk_t * hypInfo;
346#endif
347#ifdef SRIO_TRANSPORT
339 mpm_transport_srio_t *srioInfo; 348 mpm_transport_srio_t *srioInfo;
349#endif
340 cJSON * segs; 350 cJSON * segs;
341 cJSON * segp; 351 cJSON * segp;
342 cJSON * sege; 352 cJSON * sege;
@@ -471,6 +481,7 @@ int json_get_transport_info (cJSON *json, char *transport_name, mpm_transport_cf
471 481
472 sp->td = (void *) qmInfo; 482 sp->td = (void *) qmInfo;
473 break; 483 break;
484#ifdef SRIO_TRANSPORT
474 case srio: 485 case srio:
475 srioInfo = malloc(sizeof(mpm_transport_srio_t)); 486 srioInfo = malloc(sizeof(mpm_transport_srio_t));
476 if (!srioInfo) { 487 if (!srioInfo) {
@@ -517,7 +528,8 @@ int json_get_transport_info (cJSON *json, char *transport_name, mpm_transport_cf
517 528
518 sp->td = (void *) srioInfo; 529 sp->td = (void *) srioInfo;
519 break; 530 break;
520 531#endif
532#ifdef HYPLNK_TRANSPORT
521 case hyperlink: 533 case hyperlink:
522 hypInfo = calloc(1, sizeof(mpm_transport_hyplnk_t)); 534 hypInfo = calloc(1, sizeof(mpm_transport_hyplnk_t));
523 if (!hypInfo) { 535 if (!hypInfo) {
@@ -694,6 +706,7 @@ int json_get_transport_info (cJSON *json, char *transport_name, mpm_transport_cf
694 } 706 }
695 sp->td = (void *) hypInfo; 707 sp->td = (void *) hypInfo;
696 break; 708 break;
709#endif
697 default: 710 default:
698 break; 711 break;
699 } 712 }
@@ -782,9 +795,11 @@ int json_manage_descriptors (cJSON *json, char *q_name, mpm_transport_cfg_t *sp,
782 case qmss: 795 case qmss:
783 *qHnd = mpm_transport_qmss_init_desc(sp, q_name, &descParams); 796 *qHnd = mpm_transport_qmss_init_desc(sp, q_name, &descParams);
784 break; 797 break;
798#ifdef SRIO_TRANSPORT
785 case srio: 799 case srio:
786 *qHnd = mpm_transport_srio_init_desc(sp, q_name, &descParams); 800 *qHnd = mpm_transport_srio_init_desc(sp, q_name, &descParams);
787 break; 801 break;
802#endif
788 default: 803 default:
789 break; 804 break;
790 } 805 }
@@ -805,9 +820,11 @@ int json_get_and_init_qmss (cJSON *json, mpm_transport_cfg_t *sp)
805 case qmss: 820 case qmss:
806 strncpy(regionName, ((mpm_transport_qmss_t *) sp->td)->regionName, MPM_MAX_NAME_LENGTH); 821 strncpy(regionName, ((mpm_transport_qmss_t *) sp->td)->regionName, MPM_MAX_NAME_LENGTH);
807 break; 822 break;
823#ifdef SRIO_TRANSPORT
808 case srio: 824 case srio:
809 strncpy(regionName, ((mpm_transport_srio_t *) sp->td)->regionName, MPM_MAX_NAME_LENGTH); 825 strncpy(regionName, ((mpm_transport_srio_t *) sp->td)->regionName, MPM_MAX_NAME_LENGTH);
810 break; 826 break;
827#endif
811 default: 828 default:
812 break; 829 break;
813 } 830 }
@@ -894,12 +911,14 @@ int json_get_and_init_qmss (cJSON *json, mpm_transport_cfg_t *sp)
894 return (-1); 911 return (-1);
895 } 912 }
896 break; 913 break;
914#ifdef SRIO_TRANSPORT
897 case srio: 915 case srio:
898 if (mpm_transport_srio_insert_mem_region(sp, &regionParams)) { 916 if (mpm_transport_srio_insert_mem_region(sp, &regionParams)) {
899 mpm_printf(1, "Error inserting memory region!\n"); 917 mpm_printf(1, "Error inserting memory region!\n");
900 return (-1); 918 return (-1);
901 } 919 }
902 break; 920 break;
921#endif
903 default: 922 default:
904 break; 923 break;
905 } 924 }
@@ -1116,12 +1135,14 @@ mpm_transport_h mpm_transport_open(char *slave_name, mpm_transport_open_t *cfg)
1116 goto close_n_exit; 1135 goto close_n_exit;
1117 } 1136 }
1118 break; 1137 break;
1138#ifdef HYPLNK_TRANSPORT
1119 case hyperlink: 1139 case hyperlink:
1120 if (mpm_transport_hyplnk_open(sp, cfg)) { 1140 if (mpm_transport_hyplnk_open(sp, cfg)) {
1121 mpm_printf(1, "hyplnk open failed\n"); 1141 mpm_printf(1, "hyplnk open failed\n");
1122 goto close_n_exit; 1142 goto close_n_exit;
1123 } 1143 }
1124 break; 1144 break;
1145#endif
1125 case qmss: 1146 case qmss:
1126 if (mpm_transport_qmss_init(sp, cfg)) { 1147 if (mpm_transport_qmss_init(sp, cfg)) {
1127 mpm_printf(1, "error initializing for qmss\n"); 1148 mpm_printf(1, "error initializing for qmss\n");
@@ -1154,6 +1175,7 @@ mpm_transport_h mpm_transport_open(char *slave_name, mpm_transport_open_t *cfg)
1154 goto close_n_exit; 1175 goto close_n_exit;
1155 } 1176 }
1156 break; 1177 break;
1178#ifdef SRIO_TRANSPORT
1157 case srio: 1179 case srio:
1158 if (mpm_transport_srio_init(sp, cfg)) { 1180 if (mpm_transport_srio_init(sp, cfg)) {
1159 mpm_printf(1, "error initializing for srio\n"); 1181 mpm_printf(1, "error initializing for srio\n");
@@ -1186,6 +1208,7 @@ mpm_transport_h mpm_transport_open(char *slave_name, mpm_transport_open_t *cfg)
1186 goto close_n_exit; 1208 goto close_n_exit;
1187 } 1209 }
1188 break; 1210 break;
1211#endif
1189 default: 1212 default:
1190 mpm_printf(1, "unsupported transport %d\n", sp->transport); 1213 mpm_printf(1, "unsupported transport %d\n", sp->transport);
1191 goto close_n_exit; 1214 goto close_n_exit;
@@ -1223,12 +1246,14 @@ int mpm_transport_read(mpm_transport_h h, uint32_t addr, uint32_t length, char *
1223 return -1; 1246 return -1;
1224 } 1247 }
1225 break; 1248 break;
1249#ifdef HYPLNK_TRANSPORT
1226 case hyperlink: 1250 case hyperlink:
1227 if (mpm_transport_hyplnk_read(sp, addr, length, buf, cfg)) { 1251 if (mpm_transport_hyplnk_read(sp, addr, length, buf, cfg)) {
1228 mpm_printf(1, "hyplnk read failed\n"); 1252 mpm_printf(1, "hyplnk read failed\n");
1229 return -1; 1253 return -1;
1230 } 1254 }
1231 break; 1255 break;
1256#endif
1232 default: 1257 default:
1233 mpm_printf(1, "unsupported transport %d\n", sp->transport); 1258 mpm_printf(1, "unsupported transport %d\n", sp->transport);
1234 return -1; 1259 return -1;
@@ -1248,12 +1273,14 @@ int mpm_transport_read64(mpm_transport_h h, uint64_t addr, uint32_t length, char
1248 return -1; 1273 return -1;
1249 } 1274 }
1250 switch (sp->transport) { 1275 switch (sp->transport) {
1276#ifdef HYPLNK_TRANSPORT
1251 case hyperlink: 1277 case hyperlink:
1252 if (mpm_transport_hyplnk_read64(sp, addr, length, buf, cfg)) { 1278 if (mpm_transport_hyplnk_read64(sp, addr, length, buf, cfg)) {
1253 mpm_printf(1, "hyplnk read failed\n"); 1279 mpm_printf(1, "hyplnk read failed\n");
1254 return -1; 1280 return -1;
1255 } 1281 }
1256 break; 1282 break;
1283#endif
1257 case shared_memory: 1284 case shared_memory:
1258 default: 1285 default:
1259 mpm_printf(1, "unsupported transport %d\n", sp->transport); 1286 mpm_printf(1, "unsupported transport %d\n", sp->transport);
@@ -1278,6 +1305,7 @@ mpm_transport_trans_h mpm_transport_get_initiate(mpm_transport_h h, uint32_t fro
1278 case shared_memory: 1305 case shared_memory:
1279 mpm_printf(1, "shared_mem dma functions not supported\n"); 1306 mpm_printf(1, "shared_mem dma functions not supported\n");
1280 break; 1307 break;
1308#ifdef HYPLNK_TRANSPORT
1281 case hyperlink: 1309 case hyperlink:
1282 tp = mpm_transport_hyplnk_get_initiate(sp, from_addr, to_addr, length, is_blocking, cfg); 1310 tp = mpm_transport_hyplnk_get_initiate(sp, from_addr, to_addr, length, is_blocking, cfg);
1283 if (tp == NULL) 1311 if (tp == NULL)
@@ -1287,6 +1315,7 @@ mpm_transport_trans_h mpm_transport_get_initiate(mpm_transport_h h, uint32_t fro
1287 else 1315 else
1288 mpm_printf(2, "got key: 0x%08x\n",tp->key); 1316 mpm_printf(2, "got key: 0x%08x\n",tp->key);
1289 break; 1317 break;
1318#endif
1290 default: 1319 default:
1291 mpm_printf(1, "unsupported transport %d\n", sp->transport); 1320 mpm_printf(1, "unsupported transport %d\n", sp->transport);
1292 } 1321 }
@@ -1305,12 +1334,14 @@ int mpm_transport_write64(mpm_transport_h h, uint64_t addr, uint32_t length, cha
1305 return -1; 1334 return -1;
1306 } 1335 }
1307 switch (sp->transport) { 1336 switch (sp->transport) {
1337#ifdef HYPLNK_TRANSPORT
1308 case hyperlink: 1338 case hyperlink:
1309 if (mpm_transport_hyplnk_write64(sp, addr, length, buf, cfg)) { 1339 if (mpm_transport_hyplnk_write64(sp, addr, length, buf, cfg)) {
1310 mpm_printf(1, "hyplnk write64 failed\n"); 1340 mpm_printf(1, "hyplnk write64 failed\n");
1311 return -1; 1341 return -1;
1312 } 1342 }
1313 break; 1343 break;
1344#endif
1314 case shared_memory: 1345 case shared_memory:
1315 default: 1346 default:
1316 mpm_printf(1, "unsupported transport %d\n", sp->transport); 1347 mpm_printf(1, "unsupported transport %d\n", sp->transport);
@@ -1337,12 +1368,14 @@ int mpm_transport_write(mpm_transport_h h, uint32_t addr, uint32_t length, char
1337 return -1; 1368 return -1;
1338 } 1369 }
1339 break; 1370 break;
1371#ifdef HYPLNK_TRANSPORT
1340 case hyperlink: 1372 case hyperlink:
1341 if (mpm_transport_hyplnk_write(sp, addr, length, buf, cfg)) { 1373 if (mpm_transport_hyplnk_write(sp, addr, length, buf, cfg)) {
1342 mpm_printf(1, "hyplnk write failed\n"); 1374 mpm_printf(1, "hyplnk write failed\n");
1343 return -1; 1375 return -1;
1344 } 1376 }
1345 break; 1377 break;
1378#endif
1346 default: 1379 default:
1347 mpm_printf(1, "unsupported transport %d\n", sp->transport); 1380 mpm_printf(1, "unsupported transport %d\n", sp->transport);
1348 return -1; 1381 return -1;
@@ -1366,6 +1399,7 @@ mpm_transport_trans_h mpm_transport_put_initiate(mpm_transport_h h, uint32_t to_
1366 case shared_memory: 1399 case shared_memory:
1367 mpm_printf(1, "shared_mem dma functions not supported\n"); 1400 mpm_printf(1, "shared_mem dma functions not supported\n");
1368 break; 1401 break;
1402#ifdef HYPLNK_TRANSPORT
1369 case hyperlink: 1403 case hyperlink:
1370 tp = mpm_transport_hyplnk_put_initiate(sp, to_addr, from_addr, length, is_blocking, cfg); 1404 tp = mpm_transport_hyplnk_put_initiate(sp, to_addr, from_addr, length, is_blocking, cfg);
1371 if (tp == NULL) 1405 if (tp == NULL)
@@ -1375,6 +1409,7 @@ mpm_transport_trans_h mpm_transport_put_initiate(mpm_transport_h h, uint32_t to_
1375 else 1409 else
1376 mpm_printf(2, "got key: 0x%08x\n",tp->key); 1410 mpm_printf(2, "got key: 0x%08x\n",tp->key);
1377 break; 1411 break;
1412#endif
1378 default: 1413 default:
1379 mpm_printf(1, "unsupported transport %d\n", sp->transport); 1414 mpm_printf(1, "unsupported transport %d\n", sp->transport);
1380 } 1415 }
@@ -1399,6 +1434,7 @@ mpm_transport_trans_h mpm_transport_get_initiate_linked(mpm_transport_h h,
1399 case shared_memory: 1434 case shared_memory:
1400 mpm_printf(1, "shared_mem dma functions not supported\n"); 1435 mpm_printf(1, "shared_mem dma functions not supported\n");
1401 break; 1436 break;
1437#ifdef HYPLNK_TRANSPORT
1402 case hyperlink: 1438 case hyperlink:
1403 tp = mpm_transport_hyplnk_get_initiate_linked(sp, num_links, from_addr, 1439 tp = mpm_transport_hyplnk_get_initiate_linked(sp, num_links, from_addr,
1404 to_addr, length, is_blocking, cfg); 1440 to_addr, length, is_blocking, cfg);
@@ -1409,6 +1445,7 @@ mpm_transport_trans_h mpm_transport_get_initiate_linked(mpm_transport_h h,
1409 else 1445 else
1410 mpm_printf(2, "got key: 0x%08x\n",tp->key); 1446 mpm_printf(2, "got key: 0x%08x\n",tp->key);
1411 break; 1447 break;
1448#endif
1412 default: 1449 default:
1413 mpm_printf(1, "unsupported transport %d\n", sp->transport); 1450 mpm_printf(1, "unsupported transport %d\n", sp->transport);
1414 } 1451 }
@@ -1431,6 +1468,7 @@ mpm_transport_trans_h mpm_transport_put_initiate_linked(mpm_transport_h h, uint3
1431 case shared_memory: 1468 case shared_memory:
1432 mpm_printf(1, "shared_mem dma functions not supported\n"); 1469 mpm_printf(1, "shared_mem dma functions not supported\n");
1433 break; 1470 break;
1471#ifdef HYPLNK_TRANSPORT
1434 case hyperlink: 1472 case hyperlink:
1435 tp = mpm_transport_hyplnk_put_initiate_linked(sp, num_links, to_addr, from_addr, length, is_blocking, cfg); 1473 tp = mpm_transport_hyplnk_put_initiate_linked(sp, num_links, to_addr, from_addr, length, is_blocking, cfg);
1436 if (tp == NULL) 1474 if (tp == NULL)
@@ -1440,6 +1478,7 @@ mpm_transport_trans_h mpm_transport_put_initiate_linked(mpm_transport_h h, uint3
1440 else 1478 else
1441 mpm_printf(2, "got key: 0x%08x\n",tp->key); 1479 mpm_printf(2, "got key: 0x%08x\n",tp->key);
1442 break; 1480 break;
1481#endif
1443 default: 1482 default:
1444 mpm_printf(1, "unsupported transport %d\n", sp->transport); 1483 mpm_printf(1, "unsupported transport %d\n", sp->transport);
1445 } 1484 }
@@ -1465,9 +1504,11 @@ int mpm_transport_transfer_check(mpm_transport_h h, mpm_transport_trans_h th)
1465 case shared_memory: 1504 case shared_memory:
1466 mpm_printf(1, "shared_mem dma functions not supported\n"); 1505 mpm_printf(1, "shared_mem dma functions not supported\n");
1467 break; 1506 break;
1507#ifdef HYPLNK_TRANSPORT
1468 case hyperlink: 1508 case hyperlink:
1469 ret = mpm_transport_hyplnk_transfer_check(sp, th); 1509 ret = mpm_transport_hyplnk_transfer_check(sp, th);
1470 break; 1510 break;
1511#endif
1471 default: 1512 default:
1472 mpm_printf(1, "unsupported transport %d\n", sp->transport); 1513 mpm_printf(1, "unsupported transport %d\n", sp->transport);
1473 return -1; 1514 return -1;
@@ -1489,9 +1530,11 @@ void *mpm_transport_mmap(mpm_transport_h h, uint32_t addr, uint32_t length, mpm_
1489 case shared_memory: 1530 case shared_memory:
1490 return (mpm_transport_sharedmem_mmap(sp, addr, length, cfg)); 1531 return (mpm_transport_sharedmem_mmap(sp, addr, length, cfg));
1491 break; 1532 break;
1533#ifdef HYPLNK_TRANSPORT
1492 case hyperlink: 1534 case hyperlink:
1493 return (mpm_transport_hyplnk_mmap(sp, addr, length, cfg)); 1535 return (mpm_transport_hyplnk_mmap(sp, addr, length, cfg));
1494 break; 1536 break;
1537#endif
1495 default: 1538 default:
1496 mpm_printf(1, "unsupported transport %d\n", sp->transport); 1539 mpm_printf(1, "unsupported transport %d\n", sp->transport);
1497 } 1540 }
@@ -1509,9 +1552,11 @@ void *mpm_transport_mmap64(mpm_transport_h h, uint64_t addr, uint32_t length, mp
1509 return MAP_FAILED; 1552 return MAP_FAILED;
1510 } 1553 }
1511 switch (sp->transport) { 1554 switch (sp->transport) {
1555#ifdef HYPLNK_TRANSPORT
1512 case hyperlink: 1556 case hyperlink:
1513 return (mpm_transport_hyplnk_mmap64(sp, addr, length, cfg)); 1557 return (mpm_transport_hyplnk_mmap64(sp, addr, length, cfg));
1514 break; 1558 break;
1559#endif
1515 case shared_memory: 1560 case shared_memory:
1516 default: 1561 default:
1517 mpm_printf(1, "unsupported transport %d\n", sp->transport); 1562 mpm_printf(1, "unsupported transport %d\n", sp->transport);
@@ -1533,9 +1578,11 @@ uint32_t mpm_transport_phys_map(mpm_transport_h h, uint32_t addr, uint32_t lengt
1533 case shared_memory: 1578 case shared_memory:
1534 mpm_printf(1, "shared_mem does not support phys map\n"); 1579 mpm_printf(1, "shared_mem does not support phys map\n");
1535 break; 1580 break;
1581#ifdef HYPLNK_TRANSPORT
1536 case hyperlink: 1582 case hyperlink:
1537 return (mpm_transport_hyplnk_phys_map(sp, addr, length, cfg)); 1583 return (mpm_transport_hyplnk_phys_map(sp, addr, length, cfg));
1538 break; 1584 break;
1585#endif
1539 default: 1586 default:
1540 mpm_printf(1, "unsupported transport %d\n", sp->transport); 1587 mpm_printf(1, "unsupported transport %d\n", sp->transport);
1541 } 1588 }
@@ -1559,12 +1606,14 @@ int mpm_transport_munmap(mpm_transport_h h, void *va, uint32_t length)
1559 return -1; 1606 return -1;
1560 } 1607 }
1561 break; 1608 break;
1609#ifdef HYPLNK_TRANSPORT
1562 case hyperlink: 1610 case hyperlink:
1563 if (mpm_transport_hyplnk_munmap(sp, va, length)) { 1611 if (mpm_transport_hyplnk_munmap(sp, va, length)) {
1564 mpm_printf(1, "shm munmap failed\n"); 1612 mpm_printf(1, "shm munmap failed\n");
1565 return -1; 1613 return -1;
1566 } 1614 }
1567 break; 1615 break;
1616#endif
1568 default: 1617 default:
1569 mpm_printf(1, "unsupported transport %d\n", sp->transport); 1618 mpm_printf(1, "unsupported transport %d\n", sp->transport);
1570 return -1; 1619 return -1;
@@ -1584,13 +1633,14 @@ int mpm_transport_munmap64(mpm_transport_h h, void *va, uint32_t length)
1584 } 1633 }
1585 switch (sp->transport) { 1634 switch (sp->transport) {
1586 1635
1636#ifdef HYPLNK_TRANSPORT
1587 case hyperlink: 1637 case hyperlink:
1588 if (mpm_transport_hyplnk_munmap64(sp, va, length)) { 1638 if (mpm_transport_hyplnk_munmap64(sp, va, length)) {
1589 mpm_printf(1, "shm munmap failed\n"); 1639 mpm_printf(1, "shm munmap failed\n");
1590 return -1; 1640 return -1;
1591 } 1641 }
1592 break; 1642 break;
1593 1643#endif
1594 case shared_memory: 1644 case shared_memory:
1595 default: 1645 default:
1596 mpm_printf(1, "unsupported transport %d\n", sp->transport); 1646 mpm_printf(1, "unsupported transport %d\n", sp->transport);
@@ -1613,15 +1663,19 @@ void mpm_transport_close(mpm_transport_h h)
1613 case shared_memory: 1663 case shared_memory:
1614 mpm_transport_sharedmem_close(sp); 1664 mpm_transport_sharedmem_close(sp);
1615 break; 1665 break;
1666#ifdef HYPLNK_TRANSPORT
1616 case hyperlink: 1667 case hyperlink:
1617 mpm_transport_hyplnk_close(sp); 1668 mpm_transport_hyplnk_close(sp);
1618 break; 1669 break;
1670#endif
1619 case qmss: 1671 case qmss:
1620 mpm_transport_qmss_close(sp); 1672 mpm_transport_qmss_close(sp);
1621 break; 1673 break;
1674#ifdef SRIO_TRANSPORT
1622 case srio: 1675 case srio:
1623 mpm_transport_srio_close(sp); 1676 mpm_transport_srio_close(sp);
1624 break; 1677 break;
1678#endif
1625 default: 1679 default:
1626 mpm_printf(1, "unsupported transport %d\n", sp->transport); 1680 mpm_printf(1, "unsupported transport %d\n", sp->transport);
1627 return; 1681 return;
@@ -1644,9 +1698,11 @@ uint32_t mpm_transport_phys_map64(mpm_transport_h h, uint64_t addr, uint32_t len
1644 case shared_memory: 1698 case shared_memory:
1645 mpm_printf(1, "shared_mem does not support phys map\n"); 1699 mpm_printf(1, "shared_mem does not support phys map\n");
1646 break; 1700 break;
1701#ifdef HYPLNK_TRANSPORT
1647 case hyperlink: 1702 case hyperlink:
1648 return (mpm_transport_hyplnk_phys_map64(sp, addr, length, cfg)); 1703 return (mpm_transport_hyplnk_phys_map64(sp, addr, length, cfg));
1649 break; 1704 break;
1705#endif
1650 default: 1706 default:
1651 mpm_printf(1, "unsupported transport %d\n", sp->transport); 1707 mpm_printf(1, "unsupported transport %d\n", sp->transport);
1652 } 1708 }
@@ -1669,6 +1725,7 @@ mpm_transport_trans_h mpm_transport_get_initiate64(mpm_transport_h h, uint64_t f
1669 case shared_memory: 1725 case shared_memory:
1670 mpm_printf(1, "shared_mem dma functions not supported\n"); 1726 mpm_printf(1, "shared_mem dma functions not supported\n");
1671 break; 1727 break;
1728#ifdef HYPLNK_TRANSPORT
1672 case hyperlink: 1729 case hyperlink:
1673 tp = mpm_transport_hyplnk_get_initiate64(sp, from_addr, to_addr, length, is_blocking, cfg); 1730 tp = mpm_transport_hyplnk_get_initiate64(sp, from_addr, to_addr, length, is_blocking, cfg);
1674 if (tp == NULL) 1731 if (tp == NULL)
@@ -1678,6 +1735,7 @@ mpm_transport_trans_h mpm_transport_get_initiate64(mpm_transport_h h, uint64_t f
1678 else 1735 else
1679 mpm_printf(2, "got key: 0x%08x\n",tp->key); 1736 mpm_printf(2, "got key: 0x%08x\n",tp->key);
1680 break; 1737 break;
1738#endif
1681 default: 1739 default:
1682 mpm_printf(1, "unsupported transport %d\n", sp->transport); 1740 mpm_printf(1, "unsupported transport %d\n", sp->transport);
1683 } 1741 }
@@ -1700,6 +1758,7 @@ mpm_transport_trans_h mpm_transport_put_initiate64(mpm_transport_h h, uint64_t t
1700 case shared_memory: 1758 case shared_memory:
1701 mpm_printf(1, "shared_mem dma functions not supported\n"); 1759 mpm_printf(1, "shared_mem dma functions not supported\n");
1702 break; 1760 break;
1761#ifdef HYPLNK_TRANSPORT
1703 case hyperlink: 1762 case hyperlink:
1704 tp = mpm_transport_hyplnk_put_initiate64(sp, to_addr, from_addr, length, is_blocking, cfg); 1763 tp = mpm_transport_hyplnk_put_initiate64(sp, to_addr, from_addr, length, is_blocking, cfg);
1705 if (tp == NULL) 1764 if (tp == NULL)
@@ -1709,6 +1768,7 @@ mpm_transport_trans_h mpm_transport_put_initiate64(mpm_transport_h h, uint64_t t
1709 else 1768 else
1710 mpm_printf(2, "got key: 0x%08x\n",tp->key); 1769 mpm_printf(2, "got key: 0x%08x\n",tp->key);
1711 break; 1770 break;
1771#endif
1712 default: 1772 default:
1713 mpm_printf(1, "unsupported transport %d\n", sp->transport); 1773 mpm_printf(1, "unsupported transport %d\n", sp->transport);
1714 } 1774 }
@@ -1800,12 +1860,15 @@ int mpm_transport_peripheral_enable(char *slave_name, mpm_transport_open_t *cfg)
1800 mpm_printf(2, "No special routine needed to enable shared_memory\n"); 1860 mpm_printf(2, "No special routine needed to enable shared_memory\n");
1801 goto close_n_exit; 1861 goto close_n_exit;
1802 break; 1862 break;
1863
1864#ifdef HYPLNK_TRANSPORT
1803 case hyperlink: 1865 case hyperlink:
1804 if ((retval = mpm_transport_hyplnk_enable_peripheral(sp, cfg))) { 1866 if ((retval = mpm_transport_hyplnk_enable_peripheral(sp, cfg))) {
1805 mpm_printf(1, "hyplnk peripheral enable failed\n"); 1867 mpm_printf(1, "hyplnk peripheral enable failed\n");
1806 goto close_n_exit; 1868 goto close_n_exit;
1807 } 1869 }
1808 break; 1870 break;
1871#endif
1809 default: 1872 default:
1810 mpm_printf(1, "unsupported transport %d\n", sp->transport); 1873 mpm_printf(1, "unsupported transport %d\n", sp->transport);
1811 goto close_n_exit; 1874 goto close_n_exit;
@@ -1892,12 +1955,14 @@ int mpm_transport_peripheral_disable(char *slave_name)
1892 mpm_printf(2, "No special routine needed to disable shared_memory\n"); 1955 mpm_printf(2, "No special routine needed to disable shared_memory\n");
1893 goto close_n_exit; 1956 goto close_n_exit;
1894 break; 1957 break;
1958#ifdef HYPLNK_TRANSPORT
1895 case hyperlink: 1959 case hyperlink:
1896 if ((retval = mpm_transport_hyplnk_disable_peripheral(sp))) { 1960 if ((retval = mpm_transport_hyplnk_disable_peripheral(sp))) {
1897 mpm_printf(1, "hyplnk peripheral disable failed\n"); 1961 mpm_printf(1, "hyplnk peripheral disable failed\n");
1898 goto close_n_exit; 1962 goto close_n_exit;
1899 } 1963 }
1900 break; 1964 break;
1965#endif
1901 default: 1966 default:
1902 mpm_printf(1, "unsupported transport %d\n", sp->transport); 1967 mpm_printf(1, "unsupported transport %d\n", sp->transport);
1903 goto close_n_exit; 1968 goto close_n_exit;
@@ -1940,9 +2005,11 @@ int mpm_transport_get_event_fd(mpm_transport_h transport_handle, uint32_t event_
1940 return -1; 2005 return -1;
1941 } 2006 }
1942 switch (sp->transport) { 2007 switch (sp->transport) {
2008#ifdef HYPLNK_TRANSPORT
1943 case hyperlink: 2009 case hyperlink:
1944 event_fd = mpm_transport_hyplnk_get_event_fd(sp, event_bitmap); 2010 event_fd = mpm_transport_hyplnk_get_event_fd(sp, event_bitmap);
1945 break; 2011 break;
2012#endif
1946 default: 2013 default:
1947 mpm_printf(1, "unsupported transport %d\n", sp->transport); 2014 mpm_printf(1, "unsupported transport %d\n", sp->transport);
1948 return -1; 2015 return -1;
@@ -1975,11 +2042,13 @@ int mpm_transport_read_and_ack_interrupt_event (mpm_transport_h transport_handle
1975 2042
1976 /* Read and Clear interrupt event with the peripheral*/ 2043 /* Read and Clear interrupt event with the peripheral*/
1977 switch (sp->transport) { 2044 switch (sp->transport) {
2045#ifdef HYPLNK_TRANSPORT
1978 case hyperlink: 2046 case hyperlink:
1979 retval = 2047 retval =
1980 mpm_transport_hyplnk_read_and_ack_interrupt_event 2048 mpm_transport_hyplnk_read_and_ack_interrupt_event
1981 (sp, event_bitmap, reported_event_bitmap); 2049 (sp, event_bitmap, reported_event_bitmap);
1982 break; 2050 break;
2051#endif
1983 default: 2052 default:
1984 mpm_printf(1, "unsupported transport %d\n", sp->transport); 2053 mpm_printf(1, "unsupported transport %d\n", sp->transport);
1985 return -1; 2054 return -1;
@@ -2123,11 +2192,13 @@ int mpm_transport_generate_interrupt_event (mpm_transport_h transport_handle,
2123 2192
2124 /* Read and Clear interrupt event with the peripheral*/ 2193 /* Read and Clear interrupt event with the peripheral*/
2125 switch (sp->transport) { 2194 switch (sp->transport) {
2195#ifdef HYPLNK_TRANSPORT
2126 case hyperlink: 2196 case hyperlink:
2127 retval = 2197 retval =
2128 mpm_transport_hyplnk_generate_interrupt_event 2198 mpm_transport_hyplnk_generate_interrupt_event
2129 (sp, event_bitmap); 2199 (sp, event_bitmap);
2130 break; 2200 break;
2201#endif
2131 default: 2202 default:
2132 mpm_printf(1, "unsupported transport %d\n", sp->transport); 2203 mpm_printf(1, "unsupported transport %d\n", sp->transport);
2133 return -1; 2204 return -1;
@@ -2154,9 +2225,11 @@ int mpm_transport_packet_send(mpm_transport_h h, char **buf, int *len, mpm_trans
2154 case qmss: 2225 case qmss:
2155 ret = mpm_transport_qmss_packet_send(sp, buf, len, addr_info, cfg); 2226 ret = mpm_transport_qmss_packet_send(sp, buf, len, addr_info, cfg);
2156 break; 2227 break;
2228#ifdef SRIO_TRANSPORT
2157 case srio: 2229 case srio:
2158 ret = mpm_transport_srio_packet_send(sp, buf, len, addr_info, cfg); 2230 ret = mpm_transport_srio_packet_send(sp, buf, len, addr_info, cfg);
2159 break; 2231 break;
2232#endif
2160 default: 2233 default:
2161 mpm_printf(1, "mpm_transport_packet_send: unsupported transport %d\n", sp->transport); 2234 mpm_printf(1, "mpm_transport_packet_send: unsupported transport %d\n", sp->transport);
2162 ret = -1; 2235 ret = -1;
@@ -2190,9 +2263,11 @@ int mpm_transport_packet_recv(mpm_transport_h h, char **buf, int *len,
2190 case qmss: 2263 case qmss:
2191 ret = mpm_transport_qmss_packet_recv(sp, buf, len, cfg); 2264 ret = mpm_transport_qmss_packet_recv(sp, buf, len, cfg);
2192 break; 2265 break;
2266#ifdef SRIO_TRANSPORT
2193 case srio: 2267 case srio:
2194 ret = mpm_transport_srio_packet_recv(sp, buf, len, src_addr, cfg); 2268 ret = mpm_transport_srio_packet_recv(sp, buf, len, src_addr, cfg);
2195 break; 2269 break;
2270#endif
2196 default: 2271 default:
2197 mpm_printf(1, "mpm_transport_packet_recv: unsupported transport %d\n", sp->transport); 2272 mpm_printf(1, "mpm_transport_packet_recv: unsupported transport %d\n", sp->transport);
2198 ret = -1; 2273 ret = -1;
diff --git a/src/transport/test/Makefile b/src/transport/test/Makefile
index 970255a..3f7e787 100755
--- a/src/transport/test/Makefile
+++ b/src/transport/test/Makefile
@@ -40,12 +40,20 @@ all: tests
40 40
41tests: 41tests:
42 make -C $(MPMTRANSPORT_TEST_SHAREDMEM) 42 make -C $(MPMTRANSPORT_TEST_SHAREDMEM)
43 make -C $(MPMTRANSPORT_TEST_HYPLNK)
44 make -C $(MPMTRANSPORT_TEST_QMSS) 43 make -C $(MPMTRANSPORT_TEST_QMSS)
44ifeq ($(HYPLNK_TRANSPORT),true)
45 make -C $(MPMTRANSPORT_TEST_HYPLNK)
46endif
47ifeq ($(SRIO_TRANSPORT),true)
45 make -C $(MPMTRANSPORT_TEST_SRIO) 48 make -C $(MPMTRANSPORT_TEST_SRIO)
49endif
46 50
47clean: 51clean:
48 make -C $(MPMTRANSPORT_TEST_SHAREDMEM) clean 52 make -C $(MPMTRANSPORT_TEST_SHAREDMEM) clean
49 make -C $(MPMTRANSPORT_TEST_HYPLNK) clean
50 make -C $(MPMTRANSPORT_TEST_QMSS) clean 53 make -C $(MPMTRANSPORT_TEST_QMSS) clean
54ifeq ($(HYPLNK_TRANSPORT),true)
55 make -C $(MPMTRANSPORT_TEST_HYPLNK) clean
56endif
57ifeq ($(SRIO_TRANSPORT),true)
51 make -C $(MPMTRANSPORT_TEST_SRIO) clean 58 make -C $(MPMTRANSPORT_TEST_SRIO) clean
59endif