Changeset 451 for trunk/hal/tsar_mips32/drivers/soclib_pic.c
- Timestamp:
- Jul 5, 2018, 3:45:43 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/hal/tsar_mips32/drivers/soclib_pic.c
r440 r451 22 22 */ 23 23 24 #include <hal_ types.h>24 #include <hal_kernel_types.h> 25 25 #include <chdev.h> 26 26 #include <soclib_pic.h> … … 255 255 { 256 256 uint32_t i; // for loop on IOPIC inputs 257 uint32_t x; // for loop on clusters in a row258 uint32_t y; // for loop on clusters in a column inputs259 uint32_t lid; // for loop on cores in a cluster260 261 // get target architecture parameters262 cluster_t * cluster = LOCAL_CLUSTER;263 uint32_t x_size = cluster->x_size;264 uint32_t y_size = cluster->y_size;265 uint32_t y_width = cluster->y_width;266 uint32_t ncores = cluster->cores_nr;267 257 268 258 // get IOPIC controller cluster and segment base pointer 269 cxy_t iopic_seg_cxy = (cxy_t)GET_CXY( pic->base );270 uint32_t * iopic_seg_ptr = (uint32_t *)GET_PTR( pic->base );259 cxy_t iopic_seg_cxy = GET_CXY( pic->base ); 260 uint32_t * iopic_seg_ptr = GET_PTR( pic->base ); 271 261 272 262 // reset the IOPIC component registers : disable all input IRQs … … 277 267 hal_remote_sw( iopic_seg_xp , 0 ); 278 268 } 279 280 // GET XCU controller segment base 281 uint32_t * base = soclib_pic_xcu_base(); 282 283 // reset the XCU component registers in all clusters: 284 // mask all HWIs, all WTIs, and all PTIs, for all cores 285 for( x = 0 ; x < x_size ; x++ ) 286 { 287 for( y = 0 ; y < y_size ; y++ ) 288 { 289 for( lid = 0 ; lid < ncores ; lid++ ) 290 { 291 cxy_t cxy = (x<<y_width) + y; 292 xptr_t hwi_mask_xp = XPTR( cxy , base + (XCU_MSK_HWI_DISABLE << 5 | lid) ); 293 xptr_t wti_mask_xp = XPTR( cxy , base + (XCU_MSK_WTI_DISABLE << 5 | lid) ); 294 xptr_t pti_mask_xp = XPTR( cxy , base + (XCU_MSK_PTI_DISABLE << 5 | lid) ); 295 hal_remote_sw( hwi_mask_xp , 0xFFFFFFFF ); 296 hal_remote_sw( wti_mask_xp , 0xFFFFFFFF ); 297 hal_remote_sw( pti_mask_xp , 0xFFFFFFFF ); 298 } 299 } 300 } 269 301 270 } // end soclib_pic_init() 302 271 … … 357 326 // register PIC extension in cluster manager 358 327 cluster->pic_extend = cluster_ext_ptr; 328 329 // reset the XCU component registers 330 // mask all HWIs, all WTIs, and all PTIs, for all cores in local cluster 331 for( lid = 0 ; lid < cluster->cores_nr ; lid++ ) 332 { 333 xcu_base[XCU_MSK_HWI_DISABLE << 5 | lid] = 0xFFFFFFFF; 334 xcu_base[XCU_MSK_WTI_DISABLE << 5 | lid] = 0xFFFFFFFF; 335 xcu_base[XCU_MSK_PTI_DISABLE << 5 | lid] = 0xFFFFFFFF; 336 } 359 337 360 338 } // end soclib_pic_extend_init()
Note: See TracChangeset
for help on using the changeset viewer.