Ignore:
Timestamp:
Aug 16, 2012, 6:36:16 PM (12 years ago)
Author:
alain
Message:

Several bugs have been fixed to support TSAR multi-cluster architecture
such as the "tsarv4-generic_mmu" platform.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/sys/drivers.c

    r205 r207  
    231231    _get_lock(&_tty_put_lock);
    232232    _puts("\n[GIET ERROR] TTY index too large for task ");
    233     _putw( task_id );
     233    _putd( task_id );
    234234    _puts(" on processor ");
    235     _putw( proc_id );
     235    _putd( proc_id );
    236236    _puts("\n");
    237237    _release_lock(&_tty_put_lock);
     
    316316////////////////////////////////////////////////////////////////////////////////
    317317unsigned int _tty_get_char( unsigned int        tty_id,
    318                             char*           buffer )
     318                            unsigned char*  buffer )
    319319{
    320320    // checking argument
     
    731731//////////////////////////////////////////////////////////////////////////////////
    732732unsigned int _dma_reset_irq( unsigned int       cluster_id,
    733                              unsigned int       local_id )
     733                             unsigned int       channel_id )
    734734{
    735735    // parameters checking
    736736    if ( cluster_id >= NB_CLUSTERS ) return 1;
    737     if ( local_id >= NB_DMAS_MAX )  return 1;
     737    if ( channel_id >= NB_DMAS_MAX ) return 1;
    738738
    739739    // compute DMA base address
     
    741741                                  (cluster_id * (unsigned)CLUSTER_SIZE) );
    742742
    743     dma_address[local_id*DMA_SPAN + DMA_RESET] = 0;                     
     743    dma_address[channel_id*DMA_SPAN + DMA_RESET] = 0;                   
    744744    return 0;
    745745}
     
    748748//////////////////////////////////////////////////////////////////////////////////
    749749unsigned int _dma_get_status( unsigned int      cluster_id,
    750                               unsigned int      local_id,
     750                              unsigned int      channel_id,
    751751                              unsigned int* status )
    752752{
    753753    // parameters checking
    754754    if ( cluster_id >= NB_CLUSTERS ) return 1;
    755     if ( local_id >= NB_DMAS_MAX )  return 1;
     755    if ( channel_id >= NB_DMAS_MAX ) return 1;
    756756
    757757    // compute DMA base address
    758758    unsigned int*       dma_address = (unsigned int*)( (char*)&seg_dma_base +
    759759                                  (cluster_id * (unsigned)CLUSTER_SIZE) );
    760    
    761     *status = dma_address[local_id*DMA_SPAN + DMA_LEN];
     760
     761    *status = dma_address[channel_id*DMA_SPAN + DMA_LEN];
    762762    return 0;
    763763}
     
    839839// - user_vaddr : virtual base address of the memory buffer.
    840840// - length     : number of bytes to be transfered.
    841 // The memory buffer must be mapped in user address space and word-aligned.
     841// The user buffer must be mapped in user address space and word-aligned.
    842842// The user buffer length must be multiple of 4 bytes.
    843843// Me must compute the physical base addresses for both the frame buffer
    844844// and the user buffer before programming the DMA transfer.
    845 // The GIET being fully static, we don't need to split the transfer in 4Kbytes
     845// The GIET being fully static, we don't need to split the transfer in 4 Kbytes
    846846// pages, because the user buffer is contiguous in physical space.
    847847// Returns 0 if success, > 0 if error.
     
    871871    {
    872872        _get_lock(&_tty_put_lock);
    873         _puts("[GIET ERROR] in _fbdma_access() : user buffer not word aligned\n");
     873        _puts("\n[GIET ERROR] in _fbdma_access() : user buffer not word aligned\n");
    874874        _release_lock(&_tty_put_lock);
    875875        return 1;
     
    880880
    881881    // compute frame buffer pbase address
    882     unsigned int fb_vaddr = (unsigned int)&seg_fbf_base + offset;
     882    unsigned int fb_vaddr = (unsigned int)&seg_fbf_base +
     883                            (CLUSTER_IO_ID * (unsigned int)CLUSTER_SIZE) + offset;
    883884
    884885    ko = _v2p_translate( (page_table_t*)user_ptab,
     
    891892    {
    892893        _get_lock(&_tty_put_lock);
    893         _puts("[GIET ERROR] in _fbdma_access() : frame buffer unmapped\n");
     894        _puts("\n[GIET ERROR] in _fbdma_access() : frame buffer unmapped\n");
    894895        _release_lock(&_tty_put_lock);
    895896        return 2;
     
    906907    {
    907908        _get_lock(&_tty_put_lock);
    908         _puts("[GIET ERROR] in _fbdma_access() : user buffer unmapped\n");
     909        _puts("\n[GIET ERROR] in _fbdma_access() : user buffer unmapped\n");
    909910        _release_lock(&_tty_put_lock);
    910911        return 3;
     
    920921    {
    921922        _get_lock(&_tty_put_lock);
    922         _puts("[GIET ERROR] in _fbdma_access() : user buffer not writable\n");
     923        _puts("\n[GIET ERROR] in _fbdma_access() : user buffer not writable\n");
    923924        _release_lock(&_tty_put_lock);
    924925        return 5;
Note: See TracChangeset for help on using the changeset viewer.