Ignore:
Timestamp:
Oct 5, 2018, 12:08:35 AM (6 years ago)
Author:
alain
Message:

Introduction of the soclib_mty driver for the TSAR-LETI architecture.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/hal/tsar_mips32/drivers/soclib_bdv.c

    r492 r570  
    2828#include <printk.h>
    2929#include <thread.h>
    30 #include <spinlock.h>
    3130
    3231///////////////////////////////////////
     
    4544
    4645    // get block_size and block_count 
    47         uint32_t block_size = hal_remote_lw( XPTR( bdv_cxy , bdv_ptr + BDV_BLOCK_SIZE_REG ) );
    48         uint32_t block_count = hal_remote_lw( XPTR( bdv_cxy , bdv_ptr + BDV_SIZE_REG ) );
     46        uint32_t block_size = hal_remote_l32( XPTR( bdv_cxy , bdv_ptr + BDV_BLOCK_SIZE_REG ) );
     47        uint32_t block_count = hal_remote_l32( XPTR( bdv_cxy , bdv_ptr + BDV_SIZE_REG ) );
    4948
    5049    // set IOC device descriptor extension
     
    6968
    7069    // get command arguments and extended pointer on IOC device
    71     cmd_type =         hal_remote_lw ( XPTR( th_cxy , &th_ptr->ioc_cmd.type   ) );
    72     lba      =         hal_remote_lw ( XPTR( th_cxy , &th_ptr->ioc_cmd.lba    ) );
    73     count    =         hal_remote_lw ( XPTR( th_cxy , &th_ptr->ioc_cmd.count  ) );
    74     buf_xp   = (xptr_t)hal_remote_lwd( XPTR( th_cxy , &th_ptr->ioc_cmd.buf_xp ) );
    75     ioc_xp   = (xptr_t)hal_remote_lwd( XPTR( th_cxy , &th_ptr->ioc_cmd.dev_xp ) );
     70    cmd_type =         hal_remote_l32 ( XPTR( th_cxy , &th_ptr->ioc_cmd.type   ) );
     71    lba      =         hal_remote_l32 ( XPTR( th_cxy , &th_ptr->ioc_cmd.lba    ) );
     72    count    =         hal_remote_l32 ( XPTR( th_cxy , &th_ptr->ioc_cmd.count  ) );
     73    buf_xp   = (xptr_t)hal_remote_l64( XPTR( th_cxy , &th_ptr->ioc_cmd.buf_xp ) );
     74    ioc_xp   = (xptr_t)hal_remote_l64( XPTR( th_cxy , &th_ptr->ioc_cmd.dev_xp ) );
    7675
    7776#if DEBUG_HAL_IOC_RX
     
    9493
    9594    // get cluster and pointers for SOCLIB-BDV peripheral segment base
    96     xptr_t     seg_xp  = (xptr_t)hal_remote_lwd( XPTR( ioc_cxy , &ioc_ptr->base ) );
     95    xptr_t     seg_xp  = (xptr_t)hal_remote_l64( XPTR( ioc_cxy , &ioc_ptr->base ) );
    9796    cxy_t      seg_cxy = GET_CXY( seg_xp );
    9897    uint32_t * seg_ptr = GET_PTR( seg_xp );
     
    108107
    109108    // set SOCLIB_BDV registers to start one I/O operation
    110     hal_remote_sw( XPTR( seg_cxy , seg_ptr + BDV_IRQ_ENABLE_REG ) , 1       );
    111     hal_remote_sw( XPTR( seg_cxy , seg_ptr + BDV_BUFFER_REG     ) , buf_lsb );
    112     hal_remote_sw( XPTR( seg_cxy , seg_ptr + BDV_BUFFER_EXT_REG ) , buf_msb );
    113     hal_remote_sw( XPTR( seg_cxy , seg_ptr + BDV_LBA_REG        ) , lba     );
    114     hal_remote_sw( XPTR( seg_cxy , seg_ptr + BDV_COUNT_REG      ) , count   );
    115     hal_remote_sw( XPTR( seg_cxy , seg_ptr + BDV_OP_REG         ) , op      );
     109    hal_remote_s32( XPTR( seg_cxy , seg_ptr + BDV_IRQ_ENABLE_REG ) , 1       );
     110    hal_remote_s32( XPTR( seg_cxy , seg_ptr + BDV_BUFFER_REG     ) , buf_lsb );
     111    hal_remote_s32( XPTR( seg_cxy , seg_ptr + BDV_BUFFER_EXT_REG ) , buf_msb );
     112    hal_remote_s32( XPTR( seg_cxy , seg_ptr + BDV_LBA_REG        ) , lba     );
     113    hal_remote_s32( XPTR( seg_cxy , seg_ptr + BDV_COUNT_REG      ) , count   );
     114    hal_remote_s32( XPTR( seg_cxy , seg_ptr + BDV_OP_REG         ) , op      );
    116115
    117116    // waiting policy  depends on the command type
     
    124123        while (1)
    125124        {
    126             status = hal_remote_lw( XPTR( seg_cxy , seg_ptr + BDV_STATUS_REG ) );
     125            status = hal_remote_l32( XPTR( seg_cxy , seg_ptr + BDV_STATUS_REG ) );
    127126
    128127            if( status == BDV_READ_SUCCESS ) // successfully completed
    129128            {
    130                 hal_remote_sw( XPTR( th_cxy , &th_ptr->ioc_cmd.error ) , 0 );
     129                hal_remote_s32( XPTR( th_cxy , &th_ptr->ioc_cmd.error ) , 0 );
    131130                break;
    132131            }
     
    137136            else                            // error reported
    138137            {
    139                 hal_remote_sw( XPTR( th_cxy , &th_ptr->ioc_cmd.error ) , 1 );
     138                hal_remote_s32( XPTR( th_cxy , &th_ptr->ioc_cmd.error ) , 1 );
    140139                break;
    141140            }
     
    174173    // get extended pointer on client thread
    175174    xptr_t root = XPTR( local_cxy , &chdev->wait_root );
    176     xptr_t client_xp = XLIST_FIRST_ELEMENT( root , thread_t , wait_list );
     175    xptr_t client_xp = XLIST_FIRST( root , thread_t , wait_list );
    177176
    178177    // get extended pointer on server thread
     
    184183
    185184    // get command type
    186     uint32_t   cmd_type = hal_remote_lw( XPTR( client_cxy , &client_ptr->ioc_cmd.type ) );
     185    uint32_t   cmd_type = hal_remote_l32( XPTR( client_cxy , &client_ptr->ioc_cmd.type ) );
    187186   
    188187    // get SOCLIB_BDV device cluster and local pointer
     
    191190
    192191    // get BDV status register and acknowledge IRQ
    193         uint32_t status = hal_remote_lw( XPTR( bdv_cxy , bdv_ptr + BDV_STATUS_REG ) );   
     192        uint32_t status = hal_remote_l32( XPTR( bdv_cxy , bdv_ptr + BDV_STATUS_REG ) );   
    194193
    195194    if( cmd_type == IOC_READ )
     
    223222
    224223    // set operation status in command
    225     hal_remote_sw( XPTR( client_cxy , &client_ptr->ioc_cmd.error ) , error );
     224    hal_remote_s32( XPTR( client_cxy , &client_ptr->ioc_cmd.error ) , error );
    226225
    227226    // unblock server thread
Note: See TracChangeset for help on using the changeset viewer.