Ignore:
Timestamp:
Feb 4, 2014, 2:16:37 AM (10 years ago)
Author:
cfuguet
Message:

Modifications on GIET-VM IOC driver:

  • Introducing new layer on the IOC driver. Every call to ioc_read, ioc_write, ioc_get_block_size or ioc_init

functions will call the specific driver of the used IOC
controller. Supported IOC controllers are (for now) :

  1. BDV (Soclib Block Device)
  2. HBA
  3. SPI (SDCARD - SPI controller)
  • All functions of IOC controllers drivers respect the same interface.
  • To specify the used IOC controller of the platform, a subtype field has been introduced on the map.xml file. This subtype field must be declared on the IOC periph instantiation. Available subtypes (for now) : BDV, HBA or SPI.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/giet_xml/xml_parser.c

    r287 r289  
    123123unsigned int use_iob          = 0; // using IOB component
    124124unsigned int use_xcu          = 0; // using XCU (not ICU)
     125
     126// These variables define the IOC peripheral subtype
    125127unsigned int use_hba          = 0; // using HBA
     128unsigned int use_bdv          = 0; // using SoCLIB block device
     129unsigned int use_spi          = 0; // using SD Card-SPI
    126130
    127131////////////////////////////////////////////////////////////////
     
    12521256        unsigned int error = 0;
    12531257
     1258        // initialize peripheral subtype
     1259        periph[periph_index]->subtype = 0xFFFFFFFF;
     1260
    12541261        // The CMA, FBF, HBA, IOB, IOC, NIC, ROM, SIM, TTY, peripherals are not
    12551262        // replicated in all clusters but can be replicated in two clusters (fault tolerance)
     
    12941301        }
    12951302        /////////////////////////////////
    1296         else if (strcmp(str, "HBA") == 0)
    1297         {
    1298             periph[periph_index]->type = PERIPH_TYPE_HBA;
    1299             use_hba = 1;
    1300             if (header->hba_cluster == 0xFFFFFFFF)
    1301             {
    1302                 header->hba_cluster  = cluster_index;
    1303                 hba_channels = periph[periph_index]->channels;
    1304             }
    1305             else if (header->hba_cluster_bis == 0xFFFFFFFF)
    1306             {
    1307                 header->hba_cluster_bis = cluster_index;
    1308                 assert( (hba_channels == periph[periph_index]->channels) &&
    1309                 "[XML ERROR] unconsistent non replicated peripheral");
    1310             }
    1311             else
    1312             {
    1313                 error = 1;
    1314             }
    1315         }
    1316         /////////////////////////////////
    13171303        else if (strcmp(str, "IOB") == 0)
    13181304        {
     
    13461332            else
    13471333            {
    1348                 error = 1;
     1334                printf("[XML ERROR] At most two copies for non replicated "
     1335                        "peripheral\n");
     1336                exit(1);
     1337            }
     1338
     1339            str = getStringValue(reader, "subtype", &ok);
     1340   
     1341            if (!ok)
     1342            {
     1343                printf("[XML ERROR] IOC peripheral needs a subtype parameter: "
     1344                       "BDV, HBA or SPI\n");
     1345                exit(1);
     1346            }
     1347
     1348            if (strcmp(str, "BDV") == 0)
     1349            {
     1350                periph[periph_index]->subtype = PERIPH_SUBTYPE_BDV;
     1351                use_bdv = 1;
     1352            }
     1353            else if (strcmp(str, "HBA") == 0)
     1354            {
     1355                periph[periph_index]->subtype = PERIPH_SUBTYPE_HBA;
     1356
     1357                if (use_hba == 0)
     1358                {
     1359                    use_hba      = 1;
     1360                    hba_channels = periph[periph_index]->channels;
     1361                }
     1362                else
     1363                {
     1364                    assert( (hba_channels == periph[periph_index]->channels) &&
     1365                    "[XML ERROR] unconsistent non replicated peripheral");
     1366                }
     1367            }
     1368            else if (strcmp(str, "SPI") == 0)
     1369            {
     1370                periph[periph_index]->subtype = PERIPH_SUBTYPE_SPI;
     1371                use_spi = 1;
     1372            }
     1373            else
     1374            {
     1375                printf("[XML ERROR] illegal subtype for IOC peripheral\n");
     1376                exit(1);
    13491377            }
    13501378        }
     
    23252353    header->fbf_cluster     = 0xFFFFFFFF;
    23262354    header->fbf_cluster_bis = 0xFFFFFFFF;
    2327 
    2328     header->hba_cluster     = 0xFFFFFFFF;
    2329     header->hba_cluster_bis = 0xFFFFFFFF;
    23302355
    23312356    header->iob_cluster     = 0xFFFFFFFF;
     
    25892614    def_int_write(fdout, "USE_IOB           ", use_iob);
    25902615    def_int_write(fdout, "USE_HBA           ", use_hba);
     2616    def_int_write(fdout, "USE_BDV           ", use_bdv);
     2617    def_int_write(fdout, "USE_SPI           ", use_spi);
    25912618
    25922619    file_write(fdout, "\n");
     
    27202747    ld_write(fdout, "seg_cma_base            ",   periph_vbase_array[PERIPH_TYPE_CMA]);
    27212748    ld_write(fdout, "seg_fbf_base            ",   periph_vbase_array[PERIPH_TYPE_FBF]);
    2722     ld_write(fdout, "seg_hba_base            ",   periph_vbase_array[PERIPH_TYPE_HBA]);
    27232749    ld_write(fdout, "seg_iob_base            ",   periph_vbase_array[PERIPH_TYPE_IOB]);
    27242750    ld_write(fdout, "seg_ioc_base            ",   periph_vbase_array[PERIPH_TYPE_IOC]);
Note: See TracChangeset for help on using the changeset viewer.