mmu-8xx.h 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. #ifndef _ASM_POWERPC_MMU_8XX_H_
  2. #define _ASM_POWERPC_MMU_8XX_H_
  3. /*
  4. * PPC8xx support
  5. */
  6. /* Control/status registers for the MPC8xx.
  7. * A write operation to these registers causes serialized access.
  8. * During software tablewalk, the registers used perform mask/shift-add
  9. * operations when written/read. A TLB entry is created when the Mx_RPN
  10. * is written, and the contents of several registers are used to
  11. * create the entry.
  12. */
  13. #define SPRN_MI_CTR 784 /* Instruction TLB control register */
  14. #define MI_GPM 0x80000000 /* Set domain manager mode */
  15. #define MI_PPM 0x40000000 /* Set subpage protection */
  16. #define MI_CIDEF 0x20000000 /* Set cache inhibit when MMU dis */
  17. #define MI_RSV4I 0x08000000 /* Reserve 4 TLB entries */
  18. #define MI_PPCS 0x02000000 /* Use MI_RPN prob/priv state */
  19. #define MI_IDXMASK 0x00001f00 /* TLB index to be loaded */
  20. #define MI_RESETVAL 0x00000000 /* Value of register at reset */
  21. /* These are the Ks and Kp from the PowerPC books. For proper operation,
  22. * Ks = 0, Kp = 1.
  23. */
  24. #define SPRN_MI_AP 786
  25. #define MI_Ks 0x80000000 /* Should not be set */
  26. #define MI_Kp 0x40000000 /* Should always be set */
  27. /* The effective page number register. When read, contains the information
  28. * about the last instruction TLB miss. When MI_RPN is written, bits in
  29. * this register are used to create the TLB entry.
  30. */
  31. #define SPRN_MI_EPN 787
  32. #define MI_EPNMASK 0xfffff000 /* Effective page number for entry */
  33. #define MI_EVALID 0x00000200 /* Entry is valid */
  34. #define MI_ASIDMASK 0x0000000f /* ASID match value */
  35. /* Reset value is undefined */
  36. /* A "level 1" or "segment" or whatever you want to call it register.
  37. * For the instruction TLB, it contains bits that get loaded into the
  38. * TLB entry when the MI_RPN is written.
  39. */
  40. #define SPRN_MI_TWC 789
  41. #define MI_APG 0x000001e0 /* Access protection group (0) */
  42. #define MI_GUARDED 0x00000010 /* Guarded storage */
  43. #define MI_PSMASK 0x0000000c /* Mask of page size bits */
  44. #define MI_PS8MEG 0x0000000c /* 8M page size */
  45. #define MI_PS512K 0x00000004 /* 512K page size */
  46. #define MI_PS4K_16K 0x00000000 /* 4K or 16K page size */
  47. #define MI_SVALID 0x00000001 /* Segment entry is valid */
  48. /* Reset value is undefined */
  49. /* Real page number. Defined by the pte. Writing this register
  50. * causes a TLB entry to be created for the instruction TLB, using
  51. * additional information from the MI_EPN, and MI_TWC registers.
  52. */
  53. #define SPRN_MI_RPN 790
  54. /* Define an RPN value for mapping kernel memory to large virtual
  55. * pages for boot initialization. This has real page number of 0,
  56. * large page size, shared page, cache enabled, and valid.
  57. * Also mark all subpages valid and write access.
  58. */
  59. #define MI_BOOTINIT 0x000001fd
  60. #define SPRN_MD_CTR 792 /* Data TLB control register */
  61. #define MD_GPM 0x80000000 /* Set domain manager mode */
  62. #define MD_PPM 0x40000000 /* Set subpage protection */
  63. #define MD_CIDEF 0x20000000 /* Set cache inhibit when MMU dis */
  64. #define MD_WTDEF 0x10000000 /* Set writethrough when MMU dis */
  65. #define MD_RSV4I 0x08000000 /* Reserve 4 TLB entries */
  66. #define MD_TWAM 0x04000000 /* Use 4K page hardware assist */
  67. #define MD_PPCS 0x02000000 /* Use MI_RPN prob/priv state */
  68. #define MD_IDXMASK 0x00001f00 /* TLB index to be loaded */
  69. #define MD_RESETVAL 0x04000000 /* Value of register at reset */
  70. #define SPRN_M_CASID 793 /* Address space ID (context) to match */
  71. #define MC_ASIDMASK 0x0000000f /* Bits used for ASID value */
  72. /* These are the Ks and Kp from the PowerPC books. For proper operation,
  73. * Ks = 0, Kp = 1.
  74. */
  75. #define SPRN_MD_AP 794
  76. #define MD_Ks 0x80000000 /* Should not be set */
  77. #define MD_Kp 0x40000000 /* Should always be set */
  78. /* The effective page number register. When read, contains the information
  79. * about the last instruction TLB miss. When MD_RPN is written, bits in
  80. * this register are used to create the TLB entry.
  81. */
  82. #define SPRN_MD_EPN 795
  83. #define MD_EPNMASK 0xfffff000 /* Effective page number for entry */
  84. #define MD_EVALID 0x00000200 /* Entry is valid */
  85. #define MD_ASIDMASK 0x0000000f /* ASID match value */
  86. /* Reset value is undefined */
  87. /* The pointer to the base address of the first level page table.
  88. * During a software tablewalk, reading this register provides the address
  89. * of the entry associated with MD_EPN.
  90. */
  91. #define SPRN_M_TWB 796
  92. #define M_L1TB 0xfffff000 /* Level 1 table base address */
  93. #define M_L1INDX 0x00000ffc /* Level 1 index, when read */
  94. /* Reset value is undefined */
  95. /* A "level 1" or "segment" or whatever you want to call it register.
  96. * For the data TLB, it contains bits that get loaded into the TLB entry
  97. * when the MD_RPN is written. It is also provides the hardware assist
  98. * for finding the PTE address during software tablewalk.
  99. */
  100. #define SPRN_MD_TWC 797
  101. #define MD_L2TB 0xfffff000 /* Level 2 table base address */
  102. #define MD_L2INDX 0xfffffe00 /* Level 2 index (*pte), when read */
  103. #define MD_APG 0x000001e0 /* Access protection group (0) */
  104. #define MD_GUARDED 0x00000010 /* Guarded storage */
  105. #define MD_PSMASK 0x0000000c /* Mask of page size bits */
  106. #define MD_PS8MEG 0x0000000c /* 8M page size */
  107. #define MD_PS512K 0x00000004 /* 512K page size */
  108. #define MD_PS4K_16K 0x00000000 /* 4K or 16K page size */
  109. #define MD_WT 0x00000002 /* Use writethrough page attribute */
  110. #define MD_SVALID 0x00000001 /* Segment entry is valid */
  111. /* Reset value is undefined */
  112. /* Real page number. Defined by the pte. Writing this register
  113. * causes a TLB entry to be created for the data TLB, using
  114. * additional information from the MD_EPN, and MD_TWC registers.
  115. */
  116. #define SPRN_MD_RPN 798
  117. /* This is a temporary storage register that could be used to save
  118. * a processor working register during a tablewalk.
  119. */
  120. #define SPRN_M_TW 799
  121. #ifndef __ASSEMBLY__
  122. typedef struct {
  123. unsigned int id;
  124. unsigned int active;
  125. unsigned long vdso_base;
  126. } mm_context_t;
  127. #endif /* !__ASSEMBLY__ */
  128. #define mmu_virtual_psize MMU_PAGE_4K
  129. #define mmu_linear_psize MMU_PAGE_8M
  130. #endif /* _ASM_POWERPC_MMU_8XX_H_ */