Changeset 438 for trunk/hal/tsar_mips32/drivers
- Timestamp:
- Apr 4, 2018, 2:49:02 PM (7 years ago)
- Location:
- trunk/hal/tsar_mips32/drivers
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/hal/tsar_mips32/drivers/soclib_bdv.c
r437 r438 75 75 ioc_xp = (xptr_t)hal_remote_lwd( XPTR( th_cxy , &th_ptr->ioc_cmd.dev_xp ) ); 76 76 77 #if CONFIG_DEBUG_HAL_IOC_RX78 uint32_t cycle = (uint32_t)hal_get_cycles(); 79 if( ( CONFIG_DEBUG_HAL_IOC_RX < cycle) && (cmd_type != IOC_WRITE ) )77 #if DEBUG_HAL_IOC_RX 78 uint32_t cycle = (uint32_t)hal_get_cycles(); 79 if( (DEBUG_HAL_IOC_RX < cycle) && (cmd_type != IOC_WRITE ) ) 80 80 printk("\n[DBG] %s : thread %x enter for RX / cycle %d\n", 81 81 __FUNCTION__ , CURRENT_THREAD , cycle ); 82 82 #endif 83 83 84 #if CONFIG_DEBUG_HAL_IOC_TX85 uint32_t cycle = (uint32_t)hal_get_cycles(); 86 if( ( CONFIG_DEBUG_HAL_IOC_TX < cycle) && (cmd_type == IOC_WRITE) )84 #if DEBUG_HAL_IOC_TX 85 uint32_t cycle = (uint32_t)hal_get_cycles(); 86 if( (DEBUG_HAL_IOC_TX < cycle) && (cmd_type == IOC_WRITE) ) 87 87 printk("\n[DBG] %s : thread %x enter for TX / cycle %d\n", 88 88 __FUNCTION__ , CURRENT_THREAD , cycle ); … … 152 152 } 153 153 154 #if CONFIG_DEBUG_HAL_IOC_RX154 #if DEBUG_HAL_IOC_RX 155 155 cycle = (uint32_t)hal_get_cycles(); 156 if( ( CONFIG_DEBUG_HAL_IOC_RX < cycle) && (cmd_type != TXT_WRITE) )156 if( (DEBUG_HAL_IOC_RX < cycle) && (cmd_type != TXT_WRITE) ) 157 157 printk("\n[DBG] %s : thread %x exit after RX / cycle %d\n", 158 158 __FUNCTION__ , CURRENT_THREAD , cycle ); 159 159 #endif 160 160 161 #if CONFIG_DEBUG_HAL_IOC_TX161 #if DEBUG_HAL_IOC_TX 162 162 cycle = (uint32_t)hal_get_cycles(); 163 if( ( CONFIG_DEBUG_HAL_IOC_TX < cycle) && (cmd_type == TXT_WRITE) )163 if( (DEBUG_HAL_IOC_TX < cycle) && (cmd_type == TXT_WRITE) ) 164 164 printk("\n[DBG] %s : thread %x exit after TX / cycle %d\n", 165 165 __FUNCTION__ , CURRENT_THREAD , cycle ); … … 199 199 error = (status != BDV_READ_SUCCESS); 200 200 201 #if CONFIG_DEBUG_HAL_IOC_RX202 uint32_t cycle = (uint32_t)hal_get_cycles(); 203 if( CONFIG_DEBUG_HAL_IOC_RX < cycle )201 #if DEBUG_HAL_IOC_RX 202 uint32_t cycle = (uint32_t)hal_get_cycles(); 203 if( DEBUG_HAL_IOC_RX < cycle ) 204 204 printk("\n[DBG] %s : IOC_IRQ / RX transfer / client %x / server %x / cycle %d\n", 205 205 __FUNCTION__, client_ptr , chdev->server , cycle ); … … 211 211 error = (status != BDV_WRITE_SUCCESS); 212 212 213 #if CONFIG_DEBUG_HAL_IOC_TX214 uint32_t cycle = (uint32_t)hal_get_cycles(); 215 if( CONFIG_DEBUG_HAL_IOC_TX < cycle )213 #if DEBUG_HAL_IOC_TX 214 uint32_t cycle = (uint32_t)hal_get_cycles(); 215 if( DEBUG_HAL_IOC_TX < cycle ) 216 216 printk("\n[DBG] %s : IOC_IRQ / RX transfer / client %x / server %x / cycle %d\n", 217 217 __FUNCTION__, client_ptr , chdev->server , cycle ); -
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 ); -
trunk/hal/tsar_mips32/drivers/soclib_tty.c
r436 r438 30 30 #include <hal_special.h> 31 31 32 #if ( CONFIG_DEBUG_SYS_READ & 1)32 #if (DEBUG_SYS_READ & 1) 33 33 extern uint32_t enter_tty_cmd_read; 34 34 extern uint32_t exit_tty_cmd_read; … … 38 38 #endif 39 39 40 #if ( CONFIG_DEBUG_SYS_WRITE & 1)40 #if (DEBUG_SYS_WRITE & 1) 41 41 extern uint32_t enter_tty_cmd_write; 42 42 extern uint32_t exit_tty_cmd_write; … … 115 115 xptr_t error_xp = XPTR( th_cxy , &th_ptr->txt_cmd.error ); 116 116 117 #if ( CONFIG_DEBUG_SYS_READ & 1)117 #if (DEBUG_SYS_READ & 1) 118 118 if( type == TXT_READ) enter_tty_cmd_read = (uint32_t)hal_get_cycles(); 119 119 #endif 120 120 121 #if ( CONFIG_DEBUG_SYS_WRITE & 1)121 #if (DEBUG_SYS_WRITE & 1) 122 122 if( type == TXT_WRITE) enter_tty_cmd_write = (uint32_t)hal_get_cycles(); 123 123 #endif 124 124 125 #if CONFIG_DEBUG_HAL_TXT_RX125 #if DEBUG_HAL_TXT_RX 126 126 uint32_t cycle = (uint32_t)hal_get_cycles(); 127 if( ( CONFIG_DEBUG_HAL_TXT_RX < cycle) && (type == TXT_READ) )127 if( (DEBUG_HAL_TXT_RX < cycle) && (type == TXT_READ) ) 128 128 printk("\n[DBG] %s : thread %x enter for RX / cycle %d\n", 129 129 __FUNCTION__ , CURRENT_THREAD , cycle ); 130 130 #endif 131 131 132 #if CONFIG_DEBUG_HAL_TXT_TX132 #if DEBUG_HAL_TXT_TX 133 133 uint32_t cycle = (uint32_t)hal_get_cycles(); 134 if( ( CONFIG_DEBUG_HAL_TXT_TX < cycle) && (type == TXT_WRITE) )134 if( (DEBUG_HAL_TXT_TX < cycle) && (type == TXT_WRITE) ) 135 135 printk("\n[DBG] %s : thread %x enter for TX / cycle %d\n", 136 136 __FUNCTION__ , CURRENT_THREAD , cycle ); … … 238 238 } 239 239 240 #if CONFIG_DEBUG_HAL_TXT_RX240 #if DEBUG_HAL_TXT_RX 241 241 cycle = (uint32_t)hal_get_cycles(); 242 if( ( CONFIG_DEBUG_HAL_TXT_RX < cycle) && (type == TXT_READ) )242 if( (DEBUG_HAL_TXT_RX < cycle) && (type == TXT_READ) ) 243 243 printk("\n[DBG] %s : thread %x exit after RX / cycle %d\n", 244 244 __FUNCTION__ , CURRENT_THREAD , cycle ); 245 245 #endif 246 246 247 #if CONFIG_DEBUG_HAL_TXT_TX247 #if DEBUG_HAL_TXT_TX 248 248 cycle = (uint32_t)hal_get_cycles(); 249 if( ( CONFIG_DEBUG_HAL_TXT_TX < cycle) && (type == TXT_WRITE) )249 if( (DEBUG_HAL_TXT_TX < cycle) && (type == TXT_WRITE) ) 250 250 printk("\n[DBG] %s : thread %x exit after TX / cycle %d\n", 251 251 __FUNCTION__ , CURRENT_THREAD , cycle ); 252 252 #endif 253 253 254 #if ( CONFIG_DEBUG_SYS_READ & 1)254 #if (DEBUG_SYS_READ & 1) 255 255 if( type == TXT_READ ) exit_tty_cmd_read = (uint32_t)hal_get_cycles(); 256 256 #endif 257 257 258 #if ( CONFIG_DEBUG_SYS_WRITE & 1)258 #if (DEBUG_SYS_WRITE & 1) 259 259 if( type == TXT_WRITE ) exit_tty_cmd_write = (uint32_t)hal_get_cycles(); 260 260 #endif … … 288 288 server_lid = server->core->lid; 289 289 290 #if ( CONFIG_DEBUG_SYS_READ & 1)290 #if (DEBUG_SYS_READ & 1) 291 291 if( is_rx ) enter_tty_isr_read = (uint32_t)hal_get_cycles(); 292 292 #endif 293 293 294 #if ( CONFIG_DEBUG_SYS_WRITE & 1)294 #if (DEBUG_SYS_WRITE & 1) 295 295 if( is_rx == 0 ) enter_tty_isr_write = (uint32_t)hal_get_cycles(); 296 296 #endif 297 297 298 #if CONFIG_DEBUG_HAL_TXT_RX298 #if DEBUG_HAL_TXT_RX 299 299 uint32_t cycle = (uint32_t)hal_get_cycles(); 300 if( ( CONFIG_DEBUG_HAL_TXT_RX < cycle) && is_rx )300 if( (DEBUG_HAL_TXT_RX < cycle) && is_rx ) 301 301 printk("\n[DBG] %s : enter for RX / cycle %d\n", __FUNCTION__ , cycle ); 302 302 #endif 303 303 304 #if CONFIG_DEBUG_HAL_TXT_TX304 #if DEBUG_HAL_TXT_TX 305 305 uint32_t cycle = (uint32_t)hal_get_cycles(); 306 if( ( CONFIG_DEBUG_HAL_TXT_TX < cycle) && (is_rx == 0) )306 if( (DEBUG_HAL_TXT_TX < cycle) && (is_rx == 0) ) 307 307 printk("\n[DBG] %s : enter for TX / cycle %d\n", __FUNCTION__ , cycle ); 308 308 #endif … … 459 459 hal_fence(); 460 460 461 #if CONFIG_DEBUG_HAL_TXT_RX461 #if DEBUG_HAL_TXT_RX 462 462 cycle = (uint32_t)hal_get_cycles(); 463 if( ( CONFIG_DEBUG_HAL_TXT_RX < cycle) && is_rx )463 if( (DEBUG_HAL_TXT_RX < cycle) && is_rx ) 464 464 printk("\n[DBG] %s : exit after RX / cycle %d\n", __FUNCTION__, cycle ); 465 465 #endif 466 466 467 #if CONFIG_DEBUG_HAL_TXT_TX467 #if DEBUG_HAL_TXT_TX 468 468 cycle = (uint32_t)hal_get_cycles(); 469 if( ( CONFIG_DEBUG_HAL_TXT_TX < cycle) && (is_rx == 0) )469 if( (DEBUG_HAL_TXT_TX < cycle) && (is_rx == 0) ) 470 470 printk("\n[DBG] %s : exit after TX / cycle %d\n", __FUNCTION__, cycle ); 471 471 #endif 472 472 473 #if ( CONFIG_DEBUG_SYS_READ & 1)473 #if (DEBUG_SYS_READ & 1) 474 474 if( is_rx ) exit_tty_isr_read = (uint32_t)hal_get_cycles(); 475 475 #endif 476 476 477 #if ( CONFIG_DEBUG_SYS_WRITE & 1)477 #if (DEBUG_SYS_WRITE & 1) 478 478 if( is_rx == 0 ) exit_tty_isr_write = (uint32_t)hal_get_cycles(); 479 479 #endif
Note: See TracChangeset
for help on using the changeset viewer.