Ignore:
Timestamp:
Jan 31, 2014, 11:35:57 AM (10 years ago)
Author:
cfuguet
Message:

Introducing branch to test ioc drivers before merging on trunk

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  
    120120};
    121121
     122enum 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};
    122130
    123131enum mwmrPortDirection
     
    319327{
    320328    unsigned int    type;         
     329    unsigned int    subtype;         // periph specialization
    321330    unsigned int    psegid;          // pseg index in cluster
    322331    unsigned int    channels;        // number of channels
  • branch/giet_vm_ioc_drivers/giet_xml/xml_driver.c

    r263 r283  
    7474        "TTY",
    7575        "XCU",
     76    };
     77
     78    const char * periph_subtype[] =
     79    {
     80        "BDV",
     81        "HBA",
     82        "SPI",
    7683    };
    7784
     
    306313        {
    307314            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
    308319            fprintf(fpout, " psegname = \"%s\" ", pseg[periph[periph_id].psegid].name);
    309320            fprintf(fpout, " channels = \"%d\" />\n",  periph[periph_id].channels);
  • branch/giet_vm_ioc_drivers/giet_xml/xml_parser.c

    r281 r283  
    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
     
    12531257        unsigned int error = 0;
    12541258
     1259        // initialize peripheral subtype
     1260        periph[periph_index]->subtype = 0xFFFFFFFF;
     1261
    12551262        // The CMA, FBF, HBA, IOB, IOC, NIC, ROM, SIM, TTY, peripherals are not
    12561263        // replicated in all clusters but can be replicated in two clusters (fault tolerance)
     
    13371344        {
    13381345            periph[periph_index]->type = PERIPH_TYPE_IOC;
     1346
    13391347            if (header->ioc_cluster == 0xFFFFFFFF)
    13401348            {
     
    13471355            else
    13481356            {
    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);
    13501400            }
    13511401        }
     
    25672617    def_int_write(fdout, "USE_IOB           ", use_iob);
    25682618    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);
    25692621
    25702622    file_write(fdout, "\n");
Note: See TracChangeset for help on using the changeset viewer.