mmu-40x.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. #ifndef _ASM_POWERPC_MMU_40X_H_
  2. #define _ASM_POWERPC_MMU_40X_H_
  3. /*
  4. * PPC40x support
  5. */
  6. #define PPC40X_TLB_SIZE 64
  7. /*
  8. * TLB entries are defined by a "high" tag portion and a "low" data
  9. * portion. On all architectures, the data portion is 32-bits.
  10. *
  11. * TLB entries are managed entirely under software control by reading,
  12. * writing, and searchoing using the 4xx-specific tlbre, tlbwr, and tlbsx
  13. * instructions.
  14. */
  15. #define TLB_LO 1
  16. #define TLB_HI 0
  17. #define TLB_DATA TLB_LO
  18. #define TLB_TAG TLB_HI
  19. /* Tag portion */
  20. #define TLB_EPN_MASK 0xFFFFFC00 /* Effective Page Number */
  21. #define TLB_PAGESZ_MASK 0x00000380
  22. #define TLB_PAGESZ(x) (((x) & 0x7) << 7)
  23. #define PAGESZ_1K 0
  24. #define PAGESZ_4K 1
  25. #define PAGESZ_16K 2
  26. #define PAGESZ_64K 3
  27. #define PAGESZ_256K 4
  28. #define PAGESZ_1M 5
  29. #define PAGESZ_4M 6
  30. #define PAGESZ_16M 7
  31. #define TLB_VALID 0x00000040 /* Entry is valid */
  32. /* Data portion */
  33. #define TLB_RPN_MASK 0xFFFFFC00 /* Real Page Number */
  34. #define TLB_PERM_MASK 0x00000300
  35. #define TLB_EX 0x00000200 /* Instruction execution allowed */
  36. #define TLB_WR 0x00000100 /* Writes permitted */
  37. #define TLB_ZSEL_MASK 0x000000F0
  38. #define TLB_ZSEL(x) (((x) & 0xF) << 4)
  39. #define TLB_ATTR_MASK 0x0000000F
  40. #define TLB_W 0x00000008 /* Caching is write-through */
  41. #define TLB_I 0x00000004 /* Caching is inhibited */
  42. #define TLB_M 0x00000002 /* Memory is coherent */
  43. #define TLB_G 0x00000001 /* Memory is guarded from prefetch */
  44. #ifndef __ASSEMBLY__
  45. typedef struct {
  46. unsigned int id;
  47. unsigned int active;
  48. unsigned long vdso_base;
  49. } mm_context_t;
  50. #endif /* !__ASSEMBLY__ */
  51. #define mmu_virtual_psize MMU_PAGE_4K
  52. #define mmu_linear_psize MMU_PAGE_256M
  53. #endif /* _ASM_POWERPC_MMU_40X_H_ */