Changeset 438 for trunk/hal/tsar_mips32/drivers/soclib_pic.c
- Timestamp:
- Apr 4, 2018, 2:49:02 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/hal/tsar_mips32/drivers/soclib_pic.c
r435 r438 130 130 &pti_status ); 131 131 132 #if CONFIG_DEBUG_HAL_IRQS132 #if DEBUG_HAL_IRQS 133 133 uint32_t cycle = (uint32_t)hal_get_cycles(); 134 if ( CONFIG_DEBUG_HAL_IRQS < cycle )134 if (DEBUG_HAL_IRQS < cycle ) 135 135 printk("\n[DBG] %s : core[%x,%d] enter / WTI = %x / HWI = %x / PTI = %x / cycle %d\n", 136 136 __FUNCTION__ , local_cxy , core->lid , wti_status , hwi_status , pti_status, cycle ); … … 143 143 index = wti_status - 1; 144 144 145 //////////////////////////////////////////////////////// 145 146 if( index < LOCAL_CLUSTER->cores_nr ) // it is an IPI 146 147 { 147 148 assert( (index == core->lid) , __FUNCTION__ , "illegal IPI index" ); 148 149 149 #if CONFIG_DEBUG_HAL_IRQS150 if ( CONFIG_DEBUG_HAL_IRQS < cycle )150 #if DEBUG_HAL_IRQS 151 if (DEBUG_HAL_IRQS < cycle ) 151 152 printk("\n[DBG] %s : core[%x,%d] received an IPI\n", __FUNCTION__ , local_cxy , core->lid ); 152 153 #endif 153 // acknowledge WTI(this require an XCU read)154 // acknowledge IRQ (this require an XCU read) 154 155 uint32_t ack = xcu_base[(XCU_WTI_REG << 5) | core->lid]; 155 156 156 157 // check RPC FIFO, and activate or create a RPC thread 157 158 // condition is always true, but we must use the ack value 158 159 if( ack + 1 ) rpc_check(); 159 160 } 160 else // it is an external device 161 //////////////////////////////////////////////////////////////// 162 else // it is an external IRQ 161 163 { 162 164 // get pointer on source chdev … … 171 173 172 174 // disable WTI in local XCU controller 173 uint32_t * base = soclib_pic_xcu_base(); 174 base[(XCU_MSK_WTI_DISABLE << 5) | core->lid] = 1 << core->lid; 175 xcu_base[(XCU_MSK_WTI_DISABLE << 5) | core->lid] = 1 << core->lid; 176 177 hal_fence(); 175 178 } 176 179 else // call relevant ISR 177 180 { 178 181 179 #if CONFIG_DEBUG_HAL_IRQS180 if ( CONFIG_DEBUG_HAL_IRQS < cycle )182 #if DEBUG_HAL_IRQS 183 if (DEBUG_HAL_IRQS < cycle ) 181 184 printk("\n[DBG] %s : core[%x,%d] received external WTI %d\n", 182 185 __FUNCTION__ , local_cxy , core->lid , index ); … … 188 191 } 189 192 190 if( hwi_status ) // pending HWI 193 ///////////////////////////////////////////////////////////// 194 if( hwi_status ) // It is an Internal IRQ 191 195 { 192 196 index = hwi_status - 1; … … 204 208 // disable HWI in local XCU controller 205 209 xcu_base[(XCU_MSK_HWI_DISABLE << 5) | core->lid] = 1 << core->lid; 210 211 hal_fence(); 206 212 } 207 213 else // call relevant ISR 208 214 { 209 215 210 #if CONFIG_DEBUG_HAL_IRQS211 if ( CONFIG_DEBUG_HAL_IRQS < cycle )216 #if DEBUG_HAL_IRQS 217 if (DEBUG_HAL_IRQS < cycle ) 212 218 printk("\n[DBG] %s : core[%x,%d] received HWI %d\n", 213 219 __FUNCTION__ , local_cxy , core->lid , index ); … … 217 223 } 218 224 } 219 220 if( pti_status ) // pending PTI225 /////////////////////////////////////////////////////// 226 if( pti_status ) // It is a Timer IRQ 221 227 { 222 228 index = pti_status - 1; … … 224 230 assert( (index == core->lid) , __FUNCTION__ , "unconsistent PTI index\n"); 225 231 226 #if CONFIG_DEBUG_HAL_IRQS227 if ( CONFIG_DEBUG_HAL_IRQS < cycle )232 #if DEBUG_HAL_IRQS 233 if (DEBUG_HAL_IRQS < cycle ) 228 234 printk("\n[DBG] %s : core[%x,%d] received PTI %d\n", 229 235 __FUNCTION__ , core->lid , local_cxy , index ); 230 236 #endif 231 // acknowledge PTI(this require a read access to XCU)237 // acknowledge IRQ (this require a read access to XCU) 232 238 uint32_t ack = xcu_base[(XCU_PTI_ACK << 5) | core->lid]; 233 239 … … 359 365 { 360 366 361 #if CONFIG_DEBUG_HAL_IRQS367 #if DEBUG_HAL_IRQS 362 368 uint32_t cycle = (uint32_t)hal_get_cycles(); 363 if( CONFIG_DEBUG_HAL_IRQS < cycle )369 if( DEBUG_HAL_IRQS < cycle ) 364 370 printk("\n[DBG] %s : thread %x enter for core[%x,%d] / cycle %d\n", 365 371 __FUNCTION__ , CURRENT_THREAD , local_cxy , lid , cycle ); … … 422 428 ((soclib_pic_core_t *)core->pic_extend)->wti_vector[wti_id] = src_chdev; 423 429 424 #if CONFIG_DEBUG_HAL_IRQS425 if( CONFIG_DEBUG_HAL_IRQS < cycle )430 #if DEBUG_HAL_IRQS 431 if( DEBUG_HAL_IRQS < cycle ) 426 432 printk("\n[DBG] %s : %s / channel = %d / rx = %d / hwi_id = %d / wti_id = %d / cluster = %x\n", 427 433 __FUNCTION__ , chdev_func_str( func ) , channel , is_rx , hwi_id , wti_id , local_cxy ); … … 444 450 ((soclib_pic_core_t *)core->pic_extend)->wti_vector[hwi_id] = src_chdev; 445 451 446 #if CONFIG_DEBUG_HAL_IRQS447 if( CONFIG_DEBUG_HAL_IRQS < cycle )452 #if DEBUG_HAL_IRQS 453 if( DEBUG_HAL_IRQS < cycle ) 448 454 printk("\n[DBG] %s : %s / channel = %d / hwi_id = %d / cluster = %x\n", 449 455 __FUNCTION__ , chdev_func_str( func ) , channel , hwi_id , local_cxy );
Note: See TracChangeset
for help on using the changeset viewer.