Changeset 4 for trunk/kernel/drivers/soclib/soclib_iob.c
- Timestamp:
- Apr 26, 2017, 2:10:21 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/drivers/soclib/soclib_iob.c
r1 r4 27 27 #include <soclib_iob.h> 28 28 29 ///////////////////////////////////// 30 void soclib_iob_init( xptr_t iox_xp)29 /////////////////////////////////////// 30 void soclib_iob_init( chdev_t * chdev ) 31 31 { 32 // get IOX device cluster and local pointer33 cxy_t iox_cxy = GET_CXY( iox_xp );34 device_t * iox_ptr = (device_t *)GET_PTR( iox_xp );35 36 // get extended pointer on SOCLIB_IOB base_xp segment37 xptr_t base_xp = (xptr_t)hal_remote_lwd( XPTR( iox_cxy , &iox_ptr->base ) );38 39 32 // desactivate IOMMU 40 hal_remote_sw( base_xp+ (IOB_IOMMU_ACTIVE<<2) , 0 );33 hal_remote_sw( chdev->base + (IOB_IOMMU_ACTIVE<<2) , 0 ); 41 34 } 42 35 43 36 //////////////////////////////////////////// 44 void soclib_iob_set_active( xptr_t io x_xp,37 void soclib_iob_set_active( xptr_t iob_xp, 45 38 uint32_t value ) 46 39 { 47 40 // get IOX device cluster and local pointer 48 cxy_t iox_cxy = GET_CXY( iox_xp );49 device_t * iox_ptr = (device_t *)GET_PTR( iox_xp );41 cxy_t iob_cxy = GET_CXY( iob_xp ); 42 chdev_t * iob_ptr = (chdev_t *)GET_PTR( iob_xp ); 50 43 51 44 // get extended pointer on SOCLIB_IOB base_xp segment 52 xptr_t base_xp = (xptr_t)hal_remote_lwd( XPTR( io x_cxy , &iox_ptr->base ) );45 xptr_t base_xp = (xptr_t)hal_remote_lwd( XPTR( iob_cxy , &iob_ptr->base ) ); 53 46 54 47 // set ACTIVE register … … 57 50 58 51 ////////////////////////////////////////// 59 void soclib_iob_set_ptpr( xptr_t io x_xp,52 void soclib_iob_set_ptpr( xptr_t iob_xp, 60 53 uint32_t value ) 61 54 { 62 55 // get IOX device cluster and local pointer 63 cxy_t iox_cxy = GET_CXY( iox_xp );64 device_t * iox_ptr = (device_t *)GET_PTR( iox_xp );56 cxy_t iob_cxy = GET_CXY( iob_xp ); 57 chdev_t * iob_ptr = (chdev_t *)GET_PTR( iob_xp ); 65 58 66 59 // get extended pointer on SOCLIB_IOB base_xp segment 67 xptr_t base_xp = (xptr_t)hal_remote_lwd( XPTR( io x_cxy , &iox_ptr->base ) );60 xptr_t base_xp = (xptr_t)hal_remote_lwd( XPTR( iob_cxy , &iob_ptr->base ) ); 68 61 69 62 // set PTPR register … … 72 65 73 66 /////////////////////////////////////////// 74 void soclib_iob_inval_page( xptr_t io x_xp,67 void soclib_iob_inval_page( xptr_t iob_xp, 75 68 vpn_t vpn ) 76 69 { 77 70 // get IOX device cluster and local pointer 78 cxy_t iox_cxy = GET_CXY( iox_xp );79 device_t * iox_ptr = (device_t *)GET_PTR( iox_xp );71 cxy_t iob_cxy = GET_CXY( iob_xp ); 72 chdev_t * iob_ptr = (chdev_t *)GET_PTR( iob_xp ); 80 73 81 74 // get extended pointer on SOCLIB_IOB base_xp segment 82 xptr_t base_xp = (xptr_t)hal_remote_lwd( XPTR( io x_cxy , &iox_ptr->base ) );75 xptr_t base_xp = (xptr_t)hal_remote_lwd( XPTR( iob_cxy , &iob_ptr->base ) ); 83 76 84 77 // invalidate TLB entry … … 87 80 88 81 ////////////////////////////////////////////// 89 uint32_t soclib_iob_get_bvar( xptr_t io x_xp )82 uint32_t soclib_iob_get_bvar( xptr_t iob_xp ) 90 83 { 91 84 // get IOX device cluster and local pointer 92 cxy_t iox_cxy = GET_CXY( iox_xp );93 device_t * iox_ptr = (device_t *)GET_PTR( iox_xp );85 cxy_t iob_cxy = GET_CXY( iob_xp ); 86 chdev_t * iob_ptr = (chdev_t *)GET_PTR( iob_xp ); 94 87 95 88 // get extended pointer on SOCLIB_IOB base_xp segment 96 xptr_t base_xp = (xptr_t)hal_remote_lwd( XPTR( io x_cxy , &iox_ptr->base ) );89 xptr_t base_xp = (xptr_t)hal_remote_lwd( XPTR( iob_cxy , &iob_ptr->base ) ); 97 90 98 91 // get BVAR register … … 101 94 102 95 /////////////////////////////////////////////// 103 uint32_t soclib_iob_get_srcid( xptr_t io x_xp )96 uint32_t soclib_iob_get_srcid( xptr_t iob_xp ) 104 97 { 105 98 // get IOX device cluster and local pointer 106 cxy_t iox_cxy = GET_CXY( iox_xp );107 device_t * iox_ptr = (device_t *)GET_PTR( iox_xp );99 cxy_t iob_cxy = GET_CXY( iob_xp ); 100 chdev_t * iob_ptr = (chdev_t *)GET_PTR( iob_xp ); 108 101 109 102 // get extended pointer on SOCLIB_IOB base_xp segment 110 xptr_t base_xp = (xptr_t)hal_remote_lwd( XPTR( io x_cxy , &iox_ptr->base ) );103 xptr_t base_xp = (xptr_t)hal_remote_lwd( XPTR( iob_cxy , &iob_ptr->base ) ); 111 104 112 105 // get BVAR register … … 115 108 116 109 /////////////////////////////////////////////// 117 uint32_t soclib_iob_get_error( xptr_t io x_xp )110 uint32_t soclib_iob_get_error( xptr_t iob_xp ) 118 111 { 119 112 // get IOX device cluster and local pointer 120 cxy_t iox_cxy = GET_CXY( iox_xp );121 device_t * iox_ptr = (device_t *)GET_PTR( iox_xp );113 cxy_t iob_cxy = GET_CXY( iob_xp ); 114 chdev_t * iob_ptr = (chdev_t *)GET_PTR( iob_xp ); 122 115 123 116 // get extended pointer on SOCLIB_IOB base_xp segment 124 xptr_t base_xp = (xptr_t)hal_remote_lwd( XPTR( io x_cxy , &iox_ptr->base ) );117 xptr_t base_xp = (xptr_t)hal_remote_lwd( XPTR( iob_cxy , &iob_ptr->base ) ); 125 118 126 119 // get BVAR register
Note: See TracChangeset
for help on using the changeset viewer.