Changeset 205 for trunk/hal/tsar_mips32/drivers
- Timestamp:
- Jul 17, 2017, 11:41:25 AM (7 years ago)
- Location:
- trunk/hal/tsar_mips32/drivers
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/hal/tsar_mips32/drivers/soclib_pic.c
r204 r205 68 68 inline uint32_t * soclib_pic_xcu_base() 69 69 { 70 return ((soclib_pic_cluster_t *)LOCAL_CLUSTER->pic_extend)->xcu_base; 71 72 } // end soclib_pic_xcu_base() 70 return ((soclib_pic_cluster_t *)(LOCAL_CLUSTER->pic_extend))->xcu_base; 71 } 72 73 ///////////////////////////////////////////////////////// 74 inline uint32_t * soclib_pic_remote_xcu_base( cxy_t cxy ) 75 { 76 soclib_pic_cluster_t * extend; 77 78 // get extended pointer on PIC extension in remote cluster 79 extend = hal_remote_lpt( XPTR( cxy , &cluster_manager.pic_extend ) ); 80 81 return (uint32_t *)hal_remote_lpt( XPTR( cxy , &extend->xcu_base ) ); 82 83 } 73 84 74 85 … … 397 408 } // end soclib_pic_bind_irq(); 398 409 399 ////////////////////////////////////////// 400 void soclib_pic_enable_irq( lid_t lid, 401 chdev_t * src_chdev ) 402 { 403 // get local pointer on XCU segment base 404 uint32_t * seg_xcu_ptr = soclib_pic_xcu_base(); 410 /////////////////////////////////////// 411 void soclib_pic_enable_irq( lid_t lid, 412 xptr_t src_chdev_xp ) 413 { 414 // get cluster and local pointer on remote src_chdev 415 cxy_t src_chdev_cxy = GET_CXY( src_chdev_xp ); 416 chdev_t * src_chdev_ptr = (chdev_t *)GET_PTR( src_chdev_xp ); 417 418 // get local pointer on remote XCU segment base 419 uint32_t * seg_xcu_ptr = soclib_pic_remote_xcu_base( src_chdev_cxy ); 405 420 406 421 // get the source chdev IRQ type and index 407 uint32_t irq_type = src_chdev->irq_type;408 uint32_t irq_id = src_chdev->irq_id;422 uint32_t irq_type = hal_remote_lw( XPTR( src_chdev_cxy , &src_chdev_ptr->irq_type ) ); 423 uint32_t irq_id = hal_remote_lw( XPTR( src_chdev_cxy , &src_chdev_ptr->irq_id ) ); 409 424 410 425 if( irq_type == SOCLIB_TYPE_HWI ) 411 426 { 412 // enable this HWI in local XCU controller 413 seg_xcu_ptr[(XCU_MSK_HWI_ENABLE << 5) | lid] = (1 << irq_id); 427 // enable this HWI in remote XCU controller 428 hal_remote_sw( XPTR( src_chdev_cxy , 429 &seg_xcu_ptr[(XCU_MSK_HWI_ENABLE << 5) | lid] ) , (1 << irq_id) ); 414 430 } 415 431 else if( irq_type == SOCLIB_TYPE_WTI ) 416 432 { 417 // enable this WTI in local XCU controller 418 seg_xcu_ptr[(XCU_MSK_WTI_ENABLE << 5) | lid] = 1 << irq_id; 433 // enable this WTI in local XCU controller 434 hal_remote_sw( XPTR( src_chdev_cxy , 435 &seg_xcu_ptr[(XCU_MSK_WTI_ENABLE << 5) | lid] ) , (1 << irq_id) ); 419 436 } 420 437 else … … 424 441 } // end soclib_pic_enable_irq() 425 442 426 /////////////////////////////////////////// 427 void soclib_pic_disable_irq( lid_t lid, 428 chdev_t * src_chdev ) 429 { 430 // get local pointer on XCU segment base 431 uint32_t * seg_xcu_ptr = soclib_pic_xcu_base(); 443 //////////////////////////////////////// 444 void soclib_pic_disable_irq( lid_t lid, 445 xptr_t src_chdev_xp ) 446 { 447 // get cluster and local pointer on remote src_chdev 448 cxy_t src_chdev_cxy = GET_CXY( src_chdev_xp ); 449 chdev_t * src_chdev_ptr = (chdev_t *)GET_PTR( src_chdev_xp ); 450 451 // get local pointer on remote XCU segment base 452 uint32_t * seg_xcu_ptr = soclib_pic_remote_xcu_base( src_chdev_cxy ); 432 453 433 454 // get the source chdev IRQ type and index 434 uint32_t irq_type = src_chdev->irq_type;435 uint32_t irq_id = src_chdev->irq_id;455 uint32_t irq_type = hal_remote_lw( XPTR( src_chdev_cxy , &src_chdev_ptr->irq_type ) ); 456 uint32_t irq_id = hal_remote_lw( XPTR( src_chdev_cxy , &src_chdev_ptr->irq_id ) ); 436 457 437 458 if( irq_type == SOCLIB_TYPE_HWI ) 438 459 { 439 // disable this HWI in local XCU controller 440 seg_xcu_ptr[(XCU_MSK_HWI_DISABLE << 5) | lid] = 1 << irq_id; 460 // enable this HWI in remote XCU controller 461 hal_remote_sw( XPTR( src_chdev_cxy , 462 &seg_xcu_ptr[(XCU_MSK_HWI_DISABLE << 5) | lid] ) , (1 << irq_id) ); 441 463 } 442 464 else if( irq_type == SOCLIB_TYPE_WTI ) 443 465 { 444 // disable this WTI in local XCU controller 445 seg_xcu_ptr[(XCU_MSK_WTI_DISABLE << 5) | lid] = 1 << irq_id; 466 // enable this WTI in local XCU controller 467 hal_remote_sw( XPTR( src_chdev_cxy , 468 &seg_xcu_ptr[(XCU_MSK_WTI_DISABLE << 5) | lid] ) , (1 << irq_id) ); 446 469 } 447 470 else -
trunk/hal/tsar_mips32/drivers/soclib_pic.h
r188 r205 206 206 207 207 /****************************************************************************************** 208 * This function enable a HWI/WTI IRQ identified by the <src_chdev> argument,208 * This function enables a remote HWI/WTI IRQ, identified by the <src_chdev_xp> argument, 209 209 * that contains information on the IRQ type (HWI/WTI), and IRQ index. 210 * It access the re levantXCU mask register, but does not access IOPIC.211 ****************************************************************************************** 212 * @ lid : target core local index.213 * @ src_chdev : localpointer on source chdev descriptor.214 *****************************************************************************************/ 215 void soclib_pic_enable_irq( lid_t 216 chdev_t * src_chdev);217 218 /****************************************************************************************** 219 * This function disable a HWI/WTI IRQ identified by the <src_chdev> argument,210 * It access the remote XCU mask register, but does not access IOPIC. 211 ****************************************************************************************** 212 * @ lid : target core local index (in cluster containing the source chdev). 213 * @ src_chdev_xp : extended pointer on source chdev descriptor. 214 *****************************************************************************************/ 215 void soclib_pic_enable_irq( lid_t lid, 216 xptr_t src_chdev_xp ); 217 218 /****************************************************************************************** 219 * This function disables a remote HWI/WTI IRQ, identified by the <src_chdev_xp> argument, 220 220 * that contains information on the IRQ type (HWI/WTI), and IRQ index. 221 * It access the re levantXCU mask register, but does not access IOPIC.222 ****************************************************************************************** 223 * @ lid : target core local index.224 * @ src_chdev : localpointer on source chdev descriptor.225 *****************************************************************************************/ 226 void soclib_pic_disable_irq( lid_t 227 chdev_t * src_chdev);221 * It access the remote XCU mask register, but does not access IOPIC. 222 ****************************************************************************************** 223 * @ lid : target core local index (in cluster containing the source chdev). 224 * @ src_chdev_xp : extended pointer on source chdev descriptor. 225 *****************************************************************************************/ 226 void soclib_pic_disable_irq( lid_t lid, 227 xptr_t src_chdev_xp ); 228 228 229 229 /****************************************************************************************** … … 266 266 267 267 /****************************************************************************************** 268 * This function returns alocal pointer on the local XCU base segment.268 * This function returns the local pointer on the local XCU base segment. 269 269 *****************************************************************************************/ 270 270 uint32_t * soclib_pic_xcu_base(); 271 272 /****************************************************************************************** 273 * This function returns the local pointer on a remote XCU base segment. 274 * It is used by the soclip_pic_enable_irq() and soclib_pic_disable_irq() functions. 275 ****************************************************************************************** 276 * @ cxy : target cluster identifier. 277 *****************************************************************************************/ 278 uint32_t * soclib_pic_remote_xcu_base( cxy_t cxy ); 271 279 272 280 /******************************************************************************************
Note: See TracChangeset
for help on using the changeset viewer.