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

Introducing branch to test ioc drivers before merging on trunk

Location:
branch
Files:
1 added
1 edited
1 copied

Legend:

Unmodified
Added
Removed
  • branch/giet_vm_ioc_drivers/giet_drivers/hba_driver.c

    r258 r283  
    124124{
    125125    volatile unsigned int* hba_address;
    126     hba_address = (unsigned int*)(&seg_hba_base) + (HBA_SPAN*channel);
     126    hba_address = (unsigned int*)(&seg_ioc_base) + (HBA_SPAN*channel);
    127127
    128128    if( channel >= NB_HBA_CHANNELS )
     
    146146{
    147147    volatile unsigned int* hba_address;
    148     hba_address = (unsigned int*)(&seg_hba_base) + (HBA_SPAN*channel);
     148    hba_address = (unsigned int*)(&seg_ioc_base) + (HBA_SPAN*channel);
    149149
    150150    if( channel >= NB_HBA_CHANNELS )
     
    214214
    215215    // get hba device address
    216     hba_address = (unsigned int*)(&seg_hba_base) + (HBA_SPAN * channel_id);
     216    hba_address = (unsigned int*)(&seg_ioc_base) + (HBA_SPAN * channel_id);
    217217
    218218    // get command list status
     
    434434}
    435435//////////////////////////////////////////////////////////////////
    436 // This function initializes for a given channel (k)
     436// This function initializes for a given channel
    437437// - the HBA hardware registers,
    438438// - the command list pointer,
     
    440440// - the command tables physical addresses array,
    441441//////////////////////////////////////////////////////////////////
    442 void _hba_init( unsigned int k )  // k == channel_index
     442void _hba_init( unsigned int channel )
    443443{
    444444    unsigned int ppn;
     
    452452
    453453    // HBA registers
    454     unsigned int*  hba_address = (unsigned int*)(&seg_hba_base) + (HBA_SPAN*k);
    455     hba_address = (unsigned int*)&seg_hba_base + HBA_SPAN * k;
    456 
    457     hba_address[HBA_PXCLB]  = (unsigned int)(&hba_cmd_list[k]);
     454    unsigned int*  hba_address;
     455    hba_address = (unsigned int*)&seg_ioc_base + HBA_SPAN * channel;
     456
     457    hba_address[HBA_PXCLB]  = (unsigned int)(&hba_cmd_list[channel]);
    458458    hba_address[HBA_PXCLBU] = 0;
    459459    hba_address[HBA_PXIE]   = 0x40000001;
     
    463463
    464464    // command list pointer       
    465     hba_cmd_slot[k] = 0;
     465    hba_cmd_slot[channel] = 0;
    466466
    467467    // Command list physical addresse
    468     vbase = (unsigned int)(&hba_cmd_list[k]);
     468    vbase = (unsigned int)(&hba_cmd_list[channel]);
    469469    fail = _v2p_translate( (page_table_t*)pt,
    470470                           vbase>>12,
     
    478478        _exit();
    479479    }
    480     hba_cmd_list_paddr[k] = ((paddr_t)ppn) | (vbase & 0xFFF);
     480    hba_cmd_list_paddr[channel] = ((paddr_t)ppn) | (vbase & 0xFFF);
    481481
    482482    // Command tables physical addresses
    483483    for( c=0 ; c<32 ; c++ )
    484484    {
    485         vbase = (unsigned int)(&hba_cmd_table[k][c]);
     485        vbase = (unsigned int)(&hba_cmd_table[channel][c]);
    486486        fail = _v2p_translate( (page_table_t*)pt,
    487487                               vbase>>12,
     
    495495            _exit();
    496496        }
    497         hba_cmd_table_paddr[k][c] = ((paddr_t)ppn) | (vbase & 0xFFF);
     497        hba_cmd_table_paddr[channel][c] = ((paddr_t)ppn) | (vbase & 0xFFF);
    498498    }
    499499}
Note: See TracChangeset for help on using the changeset viewer.