22 #ifndef _RTEMS_POWERPC_REGISTERS_H 23 #define _RTEMS_POWERPC_REGISTERS_H 26 #define MSR_UCLE (1<<26) 27 #define MSR_VE (1<<25) 28 #define MSR_SPE (1<<25) 29 #define MSR_AP (1<<25) 30 #define MSR_APE (1<<19) 31 #define MSR_POW (1<<18) 32 #define MSR_WE (1<<18) 33 #define MSR_TGPR (1<<17) 34 #define MSR_CE (1<<17) 35 #define MSR_ILE (1<<16) 36 #define MSR_EE (1<<15) 37 #define MSR_PR (1<<14) 38 #define MSR_FP (1<<13) 39 #define MSR_ME (1<<12) 40 #define MSR_FE0 (1<<11) 41 #define MSR_SE (1<<10) 42 #define MSR_UBLE (1<<10) 43 #define MSR_DWE (1<<10) 46 #define MSR_FE1 (1<<8) 47 #define MSR_E300_CE (1<<7) 53 #define MSR_PMM (1<<2) 67 #define HID0_EMCP (1<<31) 68 #define HID0_EBA (1<<29) 69 #define HID0_EBD (1<<28) 70 #define HID0_SBCLK (1<<27) 71 #define HID0_TBEN (1<<26) 76 #define HID0_EICE (1<<26) 77 #define HID0_ECLK (1<<25) 78 #define HID0_PAR (1<<24) 79 #define HID0_DOZE (1<<23) 81 #define HID0_7455_HIGH_BAT_EN (1<<23) 83 #define HID0_NAP (1<<22) 84 #define HID0_SLEEP (1<<21) 85 #define HID0_DPM (1<<20) 86 #define HID0_ICE (1<<15) 87 #define HID0_DCE (1<<14) 88 #define HID0_ILOCK (1<<13) 89 #define HID0_DLOCK (1<<12) 90 #define HID0_ICFI (1<<11) 91 #define HID0_DCI (1<<10) 93 #define HID0_7455_XBSEN (1<<8) 94 #define HID0_SIED (1<<7) 95 #define HID0_BTIC (1<<5) 97 #define HID0_LRSTK (1<<4) 98 #define HID0_FOLD (1<<3) 100 #define HID0_BHTE (1<<2) 101 #define HID0_BTCD (1<<1) 104 #define FPSCR_FX (1<<31) 105 #define FPSCR_FEX (1<<30) 111 #define _MACH_apus 16 112 #define _MACH_fads 32 115 #define _PREP_Motorola 0x01 116 #define _PREP_Firm 0x02 117 #define _PREP_IBM 0x00 118 #define _PREP_Bull 0x03 121 #define _CHRP_Motorola 0x04 122 #define _CHRP_IBM 0x05 187 #define DEAR_BOOKE 61 213 #define L2CR_L2E (1<<31) 214 #define L2CR_L2I (1<<21) 222 #define L2CR_L2IO_745x 0x100000 223 #define L2CR_L2DO_745x 0x10000 224 #define L2CR_LOCK_745x (L2CR_L2IO_745x|L2CR_L2DO_745x) 225 #define L2CR_L3OH0 0x00080000 228 #define L3CR_L3IO_745x 0x400000 229 #define L3CR_L3DO_745x 0x40 231 #define L3CR_LOCK_745x (L3CR_L3IO_745x|L3CR_L3DO_745x) 233 #define L3CR_RESERVED 0x0438003a 234 #define L3CR_L3E 0x80000000 235 #define L3CR_L3PE 0x40000000 236 #define L3CR_L3APE 0x20000000 237 #define L3CR_L3SIZ 0x10000000 238 #define L3SIZ_1M 0x00000000 239 #define L3SIZ_2M 0x10000000 240 #define L3CR_L3CLKEN 0x08000000 241 #define L3CR_L3CLK 0x03800000 242 #define L3CLK_60 0x00000000 243 #define L3CLK_20 0x01000000 244 #define L3CLK_25 0x01800000 245 #define L3CLK_30 0x02000000 246 #define L3CLK_35 0x02800000 247 #define L3CLK_40 0x03000000 248 #define L3CLK_50 0x03800000 249 #define L3CR_L3IO 0x00400000 250 #define L3CR_L3SPO 0x00040000 251 #define L3CR_L3CKSP 0x00030000 252 #define L3CKSP_2 0x00000000 253 #define L3CKSP_3 0x00010000 254 #define L3CKSP_4 0x00020000 255 #define L3CKSP_5 0x00030000 256 #define L3CR_L3PSP 0x0000e000 257 #define L3PSP_0 0x00000000 258 #define L3PSP_1 0x00002000 259 #define L3PSP_2 0x00004000 260 #define L3PSP_3 0x00006000 261 #define L3PSP_4 0x00008000 262 #define L3PSP_5 0x0000a000 263 #define L3CR_L3REP 0x00001000 264 #define L3CR_L3HWF 0x00000800 265 #define L3CR_L3I 0x00000400 267 #define L3CR_L3RT 0x00000300 268 #define L3RT_MSUG2_DDR 0x00000000 269 #define L3RT_PIPELINE_LATE 0x00000100 270 #define L3RT_PB2_SRAM 0x00000300 271 #define L3CR_L3NIRCA 0x00000080 272 #define L3CR_L3DO 0x00000040 273 #define L3CR_PMEN 0x00000004 274 #define L3CR_PMSIZ 0x00000004 279 #define THRM1_TIN (1<<(31-0)) 280 #define THRM1_TIV (1<<(31-1)) 281 #define THRM1_THRES (0x7f<<(31-8)) 282 #define THRM1_TID (1<<(31-29)) 283 #define THRM1_TIE (1<<(31-30)) 284 #define THRM1_V (1<<(31-31)) 285 #define THRM3_SITV (0x1fff << (31-30)) 286 #define THRM3_E (1<<(31-31)) 306 #define BOOKE_DECAR 54 308 #define PPC405_MCSR 0x23C 309 #define PPC405_ESR 0x3D4 310 #define PPC405_DEAR 0x3D5 311 #define BOOKE_DEAR 61 313 #define PPC405_TSR 0x3D8 314 #define BOOKE_TSR 336 315 #define BOOKE_TSR_ENW (1<<31) 316 #define BOOKE_TSR_WIS (1<<30) 317 #define BOOKE_TSR_DIS (1<<27) 318 #define BOOKE_TSR_FIS (1<<26) 320 #define PPC405_TCR 0x3DA 321 #define BOOKE_TCR 340 322 #define BOOKE_TCR_WP(x) (((x)&3)<<30) 323 #define BOOKE_TCR_WP_MASK (3<<30) 324 #define BOOKE_TCR_WRC(x) (((x)&3)<<28) 325 #define BOOKE_TCR_WRC_MASK (3<<28) 326 #define BOOKE_TCR_WIE (1<<27) 327 #define BOOKE_TCR_DIE (1<<26) 328 #define BOOKE_TCR_FP(x) (((x)&3)<<24) 329 #define BOOKE_TCR_FIE (1<<23) 330 #define BOOKE_TCR_ARE (1<<22) 331 #define BOOKE_TCR_WPEXT(x) (((x)&0xf)<<17) 332 #define BOOKE_TCR_WPEXT_MASK (0xf<<17) 333 #define BOOKE_TCR_FPEXT(x) (((x)&0xf)<<13) 334 #define BOOKE_TCR_FPEXT_MASK (0xf<<13) 337 #define BOOKE_CSRR0 58 338 #define BOOKE_CSRR1 59 340 #define BOOKE_IVPR 63 341 #define BOOKE_SPRG4_W 260 342 #define BOOKE_SPRG5_W 261 343 #define BOOKE_SPRG6_W 262 344 #define BOOKE_SPRG7_W 263 345 #define BOOKE_PIR 286 346 #define BOOKE_DBSR 304 347 #define BOOKE_DBCR0 308 348 #define BOOKE_DBCR1 309 349 #define BOOKE_DBCR2 310 350 #define BOOKE_IAC1 312 351 #define BOOKE_IAC2 313 352 #define BOOKE_IAC3 314 353 #define BOOKE_IAC4 315 354 #define BOOKE_DAC1 316 355 #define BOOKE_DAC2 317 356 #define BOOKE_DVC1 318 357 #define BOOKE_DVC2 319 358 #define BOOKE_IVOR0 400 359 #define BOOKE_IVOR1 401 360 #define BOOKE_IVOR2 402 361 #define BOOKE_IVOR3 403 362 #define BOOKE_IVOR4 404 363 #define BOOKE_IVOR5 405 364 #define BOOKE_IVOR6 406 365 #define BOOKE_IVOR7 407 366 #define BOOKE_IVOR8 408 367 #define BOOKE_IVOR9 409 368 #define BOOKE_IVOR10 410 369 #define BOOKE_IVOR11 411 370 #define BOOKE_IVOR12 412 371 #define BOOKE_IVOR13 413 372 #define BOOKE_IVOR14 414 373 #define BOOKE_IVOR15 415 374 #define BOOKE_MCSRR0 570 375 #define BOOKE_MCSRR1 571 376 #define BOOKE_MCSR 572 378 #define PPC440_INV0 880 379 #define PPC440_INV1 881 380 #define PPC440_INV2 882 381 #define PPC440_INV3 883 382 #define PPC440_ITV0 884 383 #define PPC440_ITV1 885 384 #define PPC440_ITV2 886 385 #define PPC440_ITV3 887 386 #define PPC440_CCR1 888 387 #define PPC440_DNV0 912 388 #define PPC440_DNV1 913 389 #define PPC440_DNV2 914 390 #define PPC440_DNV3 915 391 #define PPC440_DTV0 916 392 #define PPC440_DTV1 917 393 #define PPC440_DTV2 918 394 #define PPC440_DTV3 919 395 #define PPC440_DVLIM 920 396 #define PPC440_IVLIM 921 397 #define PPC440_RSTCFG 923 398 #define PPC440_DCDBTRL 924 399 #define PPC440_DCDBTRH 925 400 #define PPC440_ICDBTRL 926 401 #define PPC440_ICDBTRH 927 402 #define PPC440_MMUCR 946 403 #define PPC440_CCR0 947 404 #define PPC440_ICDBDR 979 405 #define PPC440_DBDR 1011 407 #define PPC440_TLB0_EPN(n) ( (((1<<22)-1)&(n)) << (31-21)) 408 #define PPC440_TLB0_EPN_GET(n) ( ((n) >> (31-21)) & ((1<<22)-1)) 409 #define PPC440_TLB0_V ( 1 << (31-22)) 410 #define PPC440_TLB0_TS ( 1 << (31-23)) 411 #define PPC440_TLB0_TSIZE(n) ( (0xf & (n)) << (31-27)) 412 #define PPC440_TLB0_TSIZE_GET(n) ( ((n) >> (31-27)) & 0xf) 413 #define PPC440_TLB0_TPAR(n) ( (0xf & (n)) << (31-31)) 414 #define PPC440_TLB0_TPAR_GET(n) ( ((n) >> (31-31)) & 0xf) 416 #define PPC440_PID_TID(n) ( (0xff & (n)) << (31-31)) 417 #define PPC440_PID_TID_GET(n) ( ((n) >> (31-31)) & 0xff) 419 #define PPC440_TLB1_RPN(n) ( (((1<<22)-1)&(n)) << (31-21)) 420 #define PPC440_TLB1_RPN_GET(n) ( ((n) >> (31-21)) & ((1<<22)-1)) 421 #define PPC440_TLB1_PAR1(n) ( (0x3 & (n)) << (31-23)) 422 #define PPC440_TLB1_PAR1_GET(n) ( ((n) >> (31-23)) & 0x3) 423 #define PPC440_TLB1_ERPN(n) ( (0xf & (n)) << (31-31)) 424 #define PPC440_TLB1_ERPN_GET(n) ( ((n) >> (31-31)) & 0xf) 426 #define PPC440_TLB2_PAR2(n) ( (0x3 & (n)) << (31- 1)) 427 #define PPC440_TLB2_PAR2_GET(n) ( ((n) >> (31- 1)) & 0x3) 428 #define PPC440_TLB2_U0 ( 1 << (31-16)) 429 #define PPC440_TLB2_U1 ( 1 << (31-17)) 430 #define PPC440_TLB2_U2 ( 1 << (31-18)) 431 #define PPC440_TLB2_U3 ( 1 << (31-19)) 432 #define PPC440_TLB2_W ( 1 << (31-20)) 433 #define PPC440_TLB2_I ( 1 << (31-21)) 434 #define PPC440_TLB2_M ( 1 << (31-22)) 435 #define PPC440_TLB2_G ( 1 << (31-23)) 436 #define PPC440_TLB2_E ( 1 << (31-24)) 437 #define PPC440_TLB2_UX ( 1 << (31-26)) 438 #define PPC440_TLB2_UW ( 1 << (31-27)) 439 #define PPC440_TLB2_UR ( 1 << (31-28)) 440 #define PPC440_TLB2_SX ( 1 << (31-29)) 441 #define PPC440_TLB2_SW ( 1 << (31-30)) 442 #define PPC440_TLB2_SR ( 1 << (31-31)) 444 #define PPC440_TLB2_ATTR(x) ( ((x) & 0x1ff) << 7 ) 445 #define PPC440_TLB2_ATTR_GET(x) ( ((x) >> 7) & 0x1ff ) 447 #define PPC440_TLB2_PERM(n) ( (n) & 0x3f ) 448 #define PPC440_TLB2_PERM_GET(n) ( (n) & 0x3f ) 452 #define FSL_EIS_BUCSR 1013 453 #define FSL_EIS_BUCSR_STAC_EN (1 << (63 - 39)) 454 #define FSL_EIS_BUCSR_LS_EN (1 << (63 - 41)) 455 #define FSL_EIS_BUCSR_BBFI (1 << (63 - 54)) 456 #define FSL_EIS_BUCSR_BALLOC_ALL (0x0 << (63 - 59)) 457 #define FSL_EIS_BUCSR_BALLOC_FORWARD (0x1 << (63 - 59)) 458 #define FSL_EIS_BUCSR_BALLOC_BACKWARD (0x2 << (63 - 59)) 459 #define FSL_EIS_BUCSR_BALLOC_NONE (0x3 << (63 - 59)) 460 #define FSL_EIS_BUCSR_BPRED_TAKEN (0x0 << (63 - 61)) 461 #define FSL_EIS_BUCSR_BPRED_TAKEN_ONLY_FORWARD (0x1 << (63 - 62)) 462 #define FSL_EIS_BUCSR_BPRED_TAKEN_ONLY_BACKWARD (0x2 << (63 - 62)) 463 #define FSL_EIS_BUCSR_BPRED_NOT_TAKEN (0x3 << (63 - 62)) 464 #define FSL_EIS_BUCSR_BPEN (1 << (63 - 63)) 468 #define FSL_EIS_SVR 1023 472 #define FSL_EIS_MAS0 624 473 #define FSL_EIS_MAS0_TLBSEL (1 << (63 - 35)) 474 #define FSL_EIS_MAS0_ESEL(n) ((0xf & (n)) << (63 - 47)) 475 #define FSL_EIS_MAS0_ESEL_GET(m) (((m) >> (63 - 47)) & 0xf) 476 #define FSL_EIS_MAS0_NV (1 << (63 - 63)) 478 #define FSL_EIS_MAS1 625 479 #define FSL_EIS_MAS1_V (1 << (63 - 32)) 480 #define FSL_EIS_MAS1_IPROT (1 << (63 - 33)) 481 #define FSL_EIS_MAS1_TID(n) ((0xff & (n)) << (63 - 47)) 482 #define FSL_EIS_MAS1_TID_GET(n) (((n) >> (63 - 47)) & 0xfff) 483 #define FSL_EIS_MAS1_TS (1 << (63 - 51)) 484 #define FSL_EIS_MAS1_TSIZE(n) ((0xf & (n)) << (63 - 55)) 485 #define FSL_EIS_MAS1_TSIZE_GET(n) (((n)>>(63 - 55)) & 0xf) 487 #define FSL_EIS_MAS2 626 488 #define FSL_EIS_MAS2_EPN(n) ((((1 << 21) - 1)&(n)) << (63-51)) 489 #define FSL_EIS_MAS2_EPN_GET(n) (((n) >> (63 - 51)) & 0xfffff) 490 #define FSL_EIS_MAS2_EA(n) FSL_EIS_MAS2_EPN((n) >> 12) 491 #define FSL_EIS_MAS2_EA_GET(n) (FSL_EIS_MAS2_EPN_GET(n) << 12) 492 #define FSL_EIS_MAS2_X0 (1 << (63 - 57)) 493 #define FSL_EIS_MAS2_X1 (1 << (63 - 58)) 494 #define FSL_EIS_MAS2_W (1 << (63 - 59)) 495 #define FSL_EIS_MAS2_I (1 << (63 - 60)) 496 #define FSL_EIS_MAS2_M (1 << (63 - 61)) 497 #define FSL_EIS_MAS2_G (1 << (63 - 62)) 498 #define FSL_EIS_MAS2_E (1 << (63 - 63)) 499 #define FSL_EIS_MAS2_ATTR(x) ((x) & 0x7f) 500 #define FSL_EIS_MAS2_ATTR_GET(x) ((x) & 0x7f) 502 #define FSL_EIS_MAS3 627 503 #define FSL_EIS_MAS3_RPN(n) ((((1 << 21) - 1) & (n)) << (63-51)) 504 #define FSL_EIS_MAS3_RPN_GET(n) (((n)>>(63 - 51)) & 0xfffff) 505 #define FSL_EIS_MAS3_RA(n) FSL_EIS_MAS3_RPN((n) >> 12) 506 #define FSL_EIS_MAS3_RA_GET(n) (FSL_EIS_MAS3_RPN_GET(n) << 12) 507 #define FSL_EIS_MAS3_U0 (1 << (63 - 54)) 508 #define FSL_EIS_MAS3_U1 (1 << (63 - 55)) 509 #define FSL_EIS_MAS3_U2 (1 << (63 - 56)) 510 #define FSL_EIS_MAS3_U3 (1 << (63 - 57)) 511 #define FSL_EIS_MAS3_UX (1 << (63 - 58)) 512 #define FSL_EIS_MAS3_SX (1 << (63 - 59)) 513 #define FSL_EIS_MAS3_UW (1 << (63 - 60)) 514 #define FSL_EIS_MAS3_SW (1 << (63 - 61)) 515 #define FSL_EIS_MAS3_UR (1 << (63 - 62)) 516 #define FSL_EIS_MAS3_SR (1 << (63 - 63)) 517 #define FSL_EIS_MAS3_PERM(n) ((n) & 0x3ff) 518 #define FSL_EIS_MAS3_PERM_GET(n) ((n) & 0x3ff) 520 #define FSL_EIS_MAS4 628 521 #define FSL_EIS_MAS4_TLBSELD (1 << (63 - 35)) 522 #define FSL_EIS_MAS4_TIDSELD(n) ((0x3 & (n)) << (63 - 47)) 523 #define FSL_EIS_MAS4_TSIZED(n) ((0xf & (n)) << (63 - 55)) 524 #define FSL_EIS_MAS4_X0D FSL_EIS_MAS2_X0 525 #define FSL_EIS_MAS4_X1D FSL_EIS_MAS2_X1 526 #define FSL_EIS_MAS4_WD FSL_EIS_MAS2_W 527 #define FSL_EIS_MAS4_ID FSL_EIS_MAS2_I 528 #define FSL_EIS_MAS4_MD FSL_EIS_MAS2_M 529 #define FSL_EIS_MAS4_GD FSL_EIS_MAS2_G 530 #define FSL_EIS_MAS4_ED FSL_EIS_MAS2_E 532 #define FSL_EIS_MAS5 629 534 #define FSL_EIS_MAS6 630 535 #define FSL_EIS_MAS6_SPID0(n) ((0xff & (n)) << (63 - 55)) 536 #define FSL_EIS_MAS6_SAS (1 << (63 - 63)) 538 #define FSL_EIS_MAS7 944 540 #define FSL_EIS_MMUCFG 1015 541 #define FSL_EIS_MMUCSR0 1012 542 #define FSL_EIS_PID0 48 543 #define FSL_EIS_PID1 633 544 #define FSL_EIS_PID2 634 545 #define FSL_EIS_TLB0CFG 688 546 #define FSL_EIS_TLB1CFG 689 550 #define FSL_EIS_L1CFG0 515 551 #define FSL_EIS_L1CFG1 516 552 #define FSL_EIS_L1CSR0 1010 553 #define FSL_EIS_L1CSR1 1011 557 #define FSL_EIS_ATBL 526 558 #define FSL_EIS_ATBU 527 562 #define FSL_EIS_MCAR 573 563 #define FSL_EIS_DSRR0 574 564 #define FSL_EIS_DSRR1 575 568 #define FSL_EIS_SPEFSCR 512 572 #define FSL_EIS_SPRG8 604 573 #define FSL_EIS_SPRG9 605 577 #define FSL_EIS_DBCR3 561 578 #define FSL_EIS_DBCR4 563 579 #define FSL_EIS_DBCR5 564 580 #define FSL_EIS_DBCR6 603 581 #define FSL_EIS_DBCNT 562 589 #define PPC_INTERRUPT_DISABLE_MASK_DEFAULT MSR_EE 599 #define _CPU_MSR_GET( _msr_value ) \ 602 __asm__ volatile ("mfmsr %0" : "=&r" ((_msr_value)) : "0" ((_msr_value))); \ 605 #define _CPU_MSR_SET( _msr_value ) \ 606 { __asm__ volatile ("mtmsr %0" : "=&r" ((_msr_value)) : "0" ((_msr_value))); } 615 static inline uint32_t ppc_interrupt_get_disable_mask(
void )
620 static inline uint32_t ppc_interrupt_disable(
void )
627 "lis %1, _PPC_INTERRUPT_DISABLE_MASK@h;" 628 "ori %1, %1, _PPC_INTERRUPT_DISABLE_MASK@l;" 631 :
"=r" (level),
"=r" (mask)
637 static inline void ppc_interrupt_enable( uint32_t level )
646 static inline void ppc_interrupt_flash( uint32_t level )
648 uint32_t current_level;
654 :
"=&r" (current_level)
659 #define _CPU_ISR_Disable( _isr_cookie ) \ 661 _isr_cookie = ppc_interrupt_disable(); \ 670 #define _CPU_ISR_Enable( _isr_cookie ) \ 671 ppc_interrupt_enable(_isr_cookie) 684 #define _CPU_ISR_Flash( _isr_cookie ) \ 685 ppc_interrupt_flash(_isr_cookie) char _PPC_INTERRUPT_DISABLE_MASK[]
A global symbol used to disable interrupts in the MSR.
register struct Per_CPU_Control *_SPARC_Per_CPU_current __asm__("g6")
The pointer to the current per-CPU control is available via register g6.