Changeset 4 for trunk/kernel/drivers/soclib/soclib_xcu.c
- Timestamp:
- Apr 26, 2017, 2:10:21 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/drivers/soclib/soclib_xcu.c
r1 r4 25 25 #include <hal_types.h> 26 26 #include <core.h> 27 #include < device.h>27 #include <chdev.h> 28 28 29 29 30 30 31 //////////////////////////////////// /32 void soclib_xcu_init( device_t * icu,33 lid_t 31 //////////////////////////////////// 32 void soclib_xcu_init( chdev_t * icu, 33 lid_t lid ) 34 34 { 35 35 // get local ICU segment base address … … 42 42 } 43 43 44 //////////////////////////////////////////// ///45 void soclib_xcu_disable_irq( xptr_t icu_xp,44 //////////////////////////////////////////// 45 void soclib_xcu_disable_irq( chdev_t * icu, 46 46 uint32_t mask, 47 47 uint32_t type, 48 48 lid_t lid ) 49 49 { 50 // get remote ICU cluster and local pointer 51 cxy_t icu_cxy = GET_CXY( icu_xp ); 52 device_t * icu_ptr = (device_t *)GET_PTR( icu_xp ); 50 // get XCU segment base address 51 uint32_t * base = (uint32_t *)GET_PTR( icu->base ); 53 52 54 // get remote XCU segment base address 55 xptr_t base = (xptr_t)hal_remote_lwd( XPTR( icu_cxy , &icu_ptr->base ) ); 56 57 // compute xptr on relevant XCU mask register 58 xptr_t reg_xp; 59 if ( type == WTI_TYPE ) reg_xp = base + ((XCU_MSK_WTI_DISABLE << 5 | lid)<<2); 60 else if( type == HWI_TYPE ) reg_xp = base + ((XCU_MSK_HWI_DISABLE << 5 | lid)<<2); 61 else reg_xp = base + ((XCU_MSK_PTI_DISABLE << 5 | lid)<<2); 62 63 // reset relevant XCU mask register 64 hal_remote_sw( reg_xp , mask ); 53 // write into register 54 if ( type == WTI_TYPE ) base[XCU_MSK_WTI_DISABLE << 5 | lid] = mask; 55 else if( type == HWI_TYPE ) base[XCU_MSK_HWI_DISABLE << 5 | lid] = mask; 56 else base[XCU_MSK_PTI_DISABLE << 5 | lid] = mask; 65 57 } 66 58 67 /////////////////////////////////////////// ///68 void soclib_xcu_enable_irq( xptr_t icu_xp,59 /////////////////////////////////////////// 60 void soclib_xcu_enable_irq( chdev_t * icu, 69 61 uint32_t mask, 70 62 uint32_t type, 71 63 lid_t lid ) 72 64 { 73 // get remote ICU cluster and local pointer 74 cxy_t icu_cxy = GET_CXY( icu_xp ); 75 device_t * icu_ptr = (device_t *)GET_PTR( icu_xp ); 65 // get XCU segment base address 66 uint32_t * base = (uint32_t *)GET_PTR( icu->base ); 76 67 77 // get remote XCU segment base address 78 xptr_t base = (xptr_t)hal_remote_lwd( XPTR( icu_cxy , &icu_ptr->base ) ); 79 80 // compute xptr on relevant XCU mask register 81 xptr_t reg_xp; 82 if ( type == WTI_TYPE ) reg_xp = base + ((XCU_MSK_WTI_ENABLE << 5 | lid)<<2); 83 else if( type == HWI_TYPE ) reg_xp = base + ((XCU_MSK_HWI_ENABLE << 5 | lid)<<2); 84 else reg_xp = base + ((XCU_MSK_PTI_ENABLE << 5 | lid)<<2); 85 86 // set relevant XCU mask register 87 hal_remote_sw( reg_xp , mask ); 68 // write into register 69 if ( type == WTI_TYPE ) base[XCU_MSK_WTI_ENABLE << 5 | lid] = mask; 70 else if( type == HWI_TYPE ) base[XCU_MSK_HWI_ENABLE << 5 | lid] = mask; 71 else base[XCU_MSK_PTI_ENABLE << 5 | lid] = mask; 88 72 } 89 73 90 ////////////////////////////////////////// /91 void soclib_xcu_set_period( device_t * icu,92 uint32_t 93 uint32_t 74 ////////////////////////////////////////// 75 void soclib_xcu_set_period( chdev_t * icu, 76 uint32_t index, 77 uint32_t period ) 94 78 { 95 79 // get local ICU segment base address … … 100 84 } 101 85 102 ///////////////////////////////////////////// /103 uint32_t soclib_xcu_ack_timer( device_t * icu,104 uint32_t 86 ///////////////////////////////////////////// 87 uint32_t soclib_xcu_ack_timer( chdev_t * icu, 88 uint32_t index ) 105 89 { 106 90 // get local ICU segment base address … … 111 95 } 112 96 113 /////////////////////////////////////////// ////114 void soclib_xcu_get_status( device_t* icu,97 /////////////////////////////////////////// 98 void soclib_xcu_get_status( chdev_t * icu, 115 99 lid_t lid, 116 100 uint32_t * hwi_status, … … 130 114 131 115 ///////////////////////////////////////// 132 void soclib_xcu_send_ipi( xptr_t xp_icu,116 void soclib_xcu_send_ipi( xptr_t icu_xp, 133 117 lid_t lid ) 134 118 { 135 119 // get target ICU device cluster and local pointer 136 cxy_t cxy_icu = GET_CXY( xp_icu);137 device_t * ptr_icu = (device_t *)GET_PTR( xp_icu);120 cxy_t cxy_icu = GET_CXY( icu_xp ); 121 chdev_t * ptr_icu = (chdev_t *)GET_PTR( icu_xp ); 138 122 139 123 // get extended pointer on target ICU segment base … … 148 132 149 133 ////////////////////////////////////////////// 150 uint32_t * soclib_xcu_wti_ptr( device_t* icu,134 uint32_t * soclib_xcu_wti_ptr( chdev_t * icu, 151 135 uint32_t index ) 152 136 {
Note: See TracChangeset
for help on using the changeset viewer.