Changeset 283 for branch/giet_vm_ioc_drivers/giet_xml
- Timestamp:
- Jan 31, 2014, 11:35:57 AM (11 years ago)
- Location:
- branch
- Files:
-
- 1 added
- 3 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
branch/giet_vm_ioc_drivers/giet_xml/mapping_info.h
r267 r283 120 120 }; 121 121 122 enum periphSubtype 123 { 124 PERIPH_SUBTYPE_BDV = 0, 125 PERIPH_SUBTYPE_HBA = 1, 126 PERIPH_SUBTYPE_SPI = 2, 127 128 PERIPH_SUBTYPE_MAX_VALUE = 3, 129 }; 122 130 123 131 enum mwmrPortDirection … … 319 327 { 320 328 unsigned int type; 329 unsigned int subtype; // periph specialization 321 330 unsigned int psegid; // pseg index in cluster 322 331 unsigned int channels; // number of channels -
branch/giet_vm_ioc_drivers/giet_xml/xml_driver.c
r263 r283 74 74 "TTY", 75 75 "XCU", 76 }; 77 78 const char * periph_subtype[] = 79 { 80 "BDV", 81 "HBA", 82 "SPI", 76 83 }; 77 84 … … 306 313 { 307 314 fprintf(fpout, " <periph type = \"%s\" ", periph_type[periph[periph_id].type]); 315 316 if (periph[periph_id].subtype < PERIPH_SUBTYPE_MAX_VALUE) 317 fprintf(fpout, " subtype = \"%s\" ", periph_subtype[periph[periph_id].subtype]); 318 308 319 fprintf(fpout, " psegname = \"%s\" ", pseg[periph[periph_id].psegid].name); 309 320 fprintf(fpout, " channels = \"%d\" />\n", periph[periph_id].channels); -
branch/giet_vm_ioc_drivers/giet_xml/xml_parser.c
r281 r283 123 123 unsigned int use_iob = 0; // using IOB component 124 124 unsigned int use_xcu = 0; // using XCU (not ICU) 125 126 // These variables define the IOC peripheral subtype 125 127 unsigned int use_hba = 0; // using HBA 128 unsigned int use_bdv = 0; // using SoCLIB block device 129 unsigned int use_spi = 0; // using SD Card-SPI 126 130 127 131 … … 1253 1257 unsigned int error = 0; 1254 1258 1259 // initialize peripheral subtype 1260 periph[periph_index]->subtype = 0xFFFFFFFF; 1261 1255 1262 // The CMA, FBF, HBA, IOB, IOC, NIC, ROM, SIM, TTY, peripherals are not 1256 1263 // replicated in all clusters but can be replicated in two clusters (fault tolerance) … … 1337 1344 { 1338 1345 periph[periph_index]->type = PERIPH_TYPE_IOC; 1346 1339 1347 if (header->ioc_cluster == 0xFFFFFFFF) 1340 1348 { … … 1347 1355 else 1348 1356 { 1349 error = 1; 1357 printf("[XML ERROR] At most two copies for non replicated " 1358 "peripheral\n"); 1359 exit(1); 1360 } 1361 1362 str = getStringValue(reader, "subtype", &ok); 1363 1364 if (!ok) 1365 { 1366 printf("[XML ERROR] IOC peripheral needs a subtype parameter: " 1367 "BDV, HBA or SPI\n"); 1368 exit(1); 1369 } 1370 1371 if (strcmp(str, "BDV") == 0) 1372 { 1373 periph[periph_index]->subtype = PERIPH_SUBTYPE_BDV; 1374 use_bdv = 1; 1375 } 1376 else if (strcmp(str, "HBA") == 0) 1377 { 1378 periph[periph_index]->subtype = PERIPH_SUBTYPE_HBA; 1379 1380 if (use_hba == 0) 1381 { 1382 use_hba = 1; 1383 hba_channels = periph[periph_index]->channels; 1384 } 1385 else 1386 { 1387 assert( (hba_channels == periph[periph_index]->channels) && 1388 "[XML ERROR] unconsistent non replicated peripheral"); 1389 } 1390 } 1391 else if (strcmp(str, "SPI") == 0) 1392 { 1393 periph[periph_index]->subtype = PERIPH_SUBTYPE_SPI; 1394 use_spi = 1; 1395 } 1396 else 1397 { 1398 printf("[XML ERROR] illegal subtype for IOC peripheral\n"); 1399 exit(1); 1350 1400 } 1351 1401 } … … 2567 2617 def_int_write(fdout, "USE_IOB ", use_iob); 2568 2618 def_int_write(fdout, "USE_HBA ", use_hba); 2619 def_int_write(fdout, "USE_BDV ", use_bdv); 2620 def_int_write(fdout, "USE_SPI ", use_spi); 2569 2621 2570 2622 file_write(fdout, "\n");
Note: See TracChangeset
for help on using the changeset viewer.