Changeset 440 for trunk/hal/tsar_mips32/drivers/soclib_bdv.c
- Timestamp:
- May 3, 2018, 5:51:22 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/hal/tsar_mips32/drivers/soclib_bdv.c
r438 r440 66 66 // get client thread cluster and local pointer 67 67 cxy_t th_cxy = GET_CXY( th_xp ); 68 thread_t * th_ptr = (thread_t *)GET_PTR( th_xp );68 thread_t * th_ptr = GET_PTR( th_xp ); 69 69 70 70 // get command arguments and extended pointer on IOC device … … 91 91 // get IOC device cluster and local pointer 92 92 cxy_t ioc_cxy = GET_CXY( ioc_xp ); 93 chdev_t * ioc_ptr = (chdev_t *)GET_PTR( ioc_xp ); 94 95 // get extended pointer on SOCLIB-BDV peripheral 96 xptr_t bdv_xp = hal_remote_lw( XPTR( ioc_cxy , &ioc_ptr->base ) ); 97 98 // get SOCLIB_BDV device cluster and local pointer 99 cxy_t bdv_cxy = GET_CXY( bdv_xp ); 100 uint32_t * bdv_ptr = (uint32_t *)GET_PTR( bdv_xp ); 93 chdev_t * ioc_ptr = GET_PTR( ioc_xp ); 94 95 // 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 ) ); 97 cxy_t seg_cxy = GET_CXY( seg_xp ); 98 uint32_t * seg_ptr = GET_PTR( seg_xp ); 101 99 102 100 // split buffer address in two 32 bits words … … 110 108 111 109 // set SOCLIB_BDV registers to start one I/O operation 112 hal_remote_sw( XPTR( bdv_cxy , bdv_ptr + BDV_IRQ_ENABLE_REG ) , 1 );113 hal_remote_sw( XPTR( bdv_cxy , bdv_ptr + BDV_BUFFER_REG ) , buf_lsb );114 hal_remote_sw( XPTR( bdv_cxy , bdv_ptr + BDV_BUFFER_EXT_REG ) , buf_msb );115 hal_remote_sw( XPTR( bdv_cxy , bdv_ptr + BDV_LBA_REG ) , lba );116 hal_remote_sw( XPTR( bdv_cxy , bdv_ptr + BDV_COUNT_REG ) , count );117 hal_remote_sw( XPTR( bdv_cxy , bdv_ptr + BDV_OP_REG ) , op );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 ); 118 116 119 117 // waiting policy depends on the command type … … 126 124 while (1) 127 125 { 128 status = hal_remote_lw( XPTR( bdv_cxy , bdv_ptr + BDV_STATUS_REG ) );126 status = hal_remote_lw( XPTR( seg_cxy , seg_ptr + BDV_STATUS_REG ) ); 129 127 130 128 if( status == BDV_READ_SUCCESS ) // successfully completed
Note: See TracChangeset
for help on using the changeset viewer.