Changeset 283 for branch/giet_vm_ioc_drivers/giet_xml/xml_parser.c
- Timestamp:
- Jan 31, 2014, 11:35:57 AM (11 years ago)
- Location:
- branch
- Files:
-
- 1 added
- 1 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
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.