Changeset 76 for trunk/hal/x86_64/drivers/soclib_iob.c
- Timestamp:
- Jun 27, 2017, 2:07:55 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/hal/x86_64/drivers/soclib_iob.c
r75 r76 27 27 #include <soclib_iob.h> 28 28 29 ///////////////////////////////////////30 29 void soclib_iob_init( chdev_t * chdev ) 31 30 { 32 // desactivate IOMMU 33 hal_remote_sw( chdev->base + (IOB_IOMMU_ACTIVE<<2) , 0 ); 31 34 32 } 35 33 36 ////////////////////////////////////////////37 34 void soclib_iob_set_active( xptr_t iob_xp, 38 35 uint32_t value ) 39 36 { 40 // get IOX device cluster and local pointer41 cxy_t iob_cxy = GET_CXY( iob_xp );42 chdev_t * iob_ptr = (chdev_t *)GET_PTR( iob_xp );43 37 44 // get extended pointer on SOCLIB_IOB base_xp segment45 xptr_t base_xp = (xptr_t)hal_remote_lwd( XPTR( iob_cxy , &iob_ptr->base ) );46 47 // set ACTIVE register48 hal_remote_sw( base_xp + (IOB_IOMMU_ACTIVE<<2) , value );49 38 } 50 39 51 //////////////////////////////////////////52 40 void soclib_iob_set_ptpr( xptr_t iob_xp, 53 41 uint32_t value ) 54 42 { 55 // get IOX device cluster and local pointer56 cxy_t iob_cxy = GET_CXY( iob_xp );57 chdev_t * iob_ptr = (chdev_t *)GET_PTR( iob_xp );58 43 59 // get extended pointer on SOCLIB_IOB base_xp segment60 xptr_t base_xp = (xptr_t)hal_remote_lwd( XPTR( iob_cxy , &iob_ptr->base ) );61 62 // set PTPR register63 hal_remote_sw( base_xp + (IOB_IOMMU_PTPR<<2) , value );64 44 } 65 45 66 ///////////////////////////////////////////67 46 void soclib_iob_inval_page( xptr_t iob_xp, 68 47 vpn_t vpn ) 69 48 { 70 // get IOX device cluster and local pointer71 cxy_t iob_cxy = GET_CXY( iob_xp );72 chdev_t * iob_ptr = (chdev_t *)GET_PTR( iob_xp );73 49 74 // get extended pointer on SOCLIB_IOB base_xp segment75 xptr_t base_xp = (xptr_t)hal_remote_lwd( XPTR( iob_cxy , &iob_ptr->base ) );76 77 // invalidate TLB entry78 hal_remote_sw( base_xp + (IOB_INVAL_PTE<<2) , vpn );79 50 } 80 51 81 //////////////////////////////////////////////82 52 uint32_t soclib_iob_get_bvar( xptr_t iob_xp ) 83 53 { 84 // get IOX device cluster and local pointer 85 cxy_t iob_cxy = GET_CXY( iob_xp ); 86 chdev_t * iob_ptr = (chdev_t *)GET_PTR( iob_xp ); 87 88 // get extended pointer on SOCLIB_IOB base_xp segment 89 xptr_t base_xp = (xptr_t)hal_remote_lwd( XPTR( iob_cxy , &iob_ptr->base ) ); 90 91 // get BVAR register 92 return hal_remote_lw( base_xp + (IOB_IOMMU_BVAR<<2) ); 54 return 0; 93 55 } 94 56 95 ///////////////////////////////////////////////96 57 uint32_t soclib_iob_get_srcid( xptr_t iob_xp ) 97 58 { 98 // get IOX device cluster and local pointer 99 cxy_t iob_cxy = GET_CXY( iob_xp ); 100 chdev_t * iob_ptr = (chdev_t *)GET_PTR( iob_xp ); 101 102 // get extended pointer on SOCLIB_IOB base_xp segment 103 xptr_t base_xp = (xptr_t)hal_remote_lwd( XPTR( iob_cxy , &iob_ptr->base ) ); 104 105 // get BVAR register 106 return hal_remote_lw( base_xp + (IOB_IOMMU_SRCID<<2) ); 59 return 0; 107 60 } 108 61 109 ///////////////////////////////////////////////110 62 uint32_t soclib_iob_get_error( xptr_t iob_xp ) 111 63 { 112 // get IOX device cluster and local pointer 113 cxy_t iob_cxy = GET_CXY( iob_xp ); 114 chdev_t * iob_ptr = (chdev_t *)GET_PTR( iob_xp ); 115 116 // get extended pointer on SOCLIB_IOB base_xp segment 117 xptr_t base_xp = (xptr_t)hal_remote_lwd( XPTR( iob_cxy , &iob_ptr->base ) ); 118 119 // get BVAR register 120 return hal_remote_lw( base_xp + (IOB_IOMMU_ERROR<<2) ); 64 return 0; 121 65 } 122 66 123 124 // Local Variables:125 // tab-width: 4126 // c-basic-offset: 4127 // c-file-offsets:((innamespace . 0)(inline-open . 0))128 // indent-tabs-mode: nil129 // End:130 // vim: filetype=c:expandtab:shiftwidth=4:tabstop=4:softtabstop=4131
Note: See TracChangeset
for help on using the changeset viewer.