mmu.txt 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. MMUv3 initialization sequence.
  2. The code in the initialize_mmu macro sets up MMUv3 memory mapping
  3. identically to MMUv2 fixed memory mapping. Depending on
  4. CONFIG_INITIALIZE_XTENSA_MMU_INSIDE_VMLINUX symbol this code is
  5. located in one of the following address ranges:
  6. 0xF0000000..0xFFFFFFFF (will keep same address in MMU v2 layout;
  7. typically ROM)
  8. 0x00000000..0x07FFFFFF (system RAM; this code is actually linked
  9. at 0xD0000000..0xD7FFFFFF [cached]
  10. or 0xD8000000..0xDFFFFFFF [uncached];
  11. in any case, initially runs elsewhere
  12. than linked, so have to be careful)
  13. The code has the following assumptions:
  14. This code fragment is run only on an MMU v3.
  15. TLBs are in their reset state.
  16. ITLBCFG and DTLBCFG are zero (reset state).
  17. RASID is 0x04030201 (reset state).
  18. PS.RING is zero (reset state).
  19. LITBASE is zero (reset state, PC-relative literals); required to be PIC.
  20. TLB setup proceeds along the following steps.
  21. Legend:
  22. VA = virtual address (two upper nibbles of it);
  23. PA = physical address (two upper nibbles of it);
  24. pc = physical range that contains this code;
  25. After step 2, we jump to virtual address in 0x40000000..0x5fffffff
  26. that corresponds to next instruction to execute in this code.
  27. After step 4, we jump to intended (linked) address of this code.
  28. Step 0 Step1 Step 2 Step3 Step 4 Step5
  29. ============ ===== ============ ===== ============ =====
  30. VA PA PA VA PA PA VA PA PA
  31. ------ -- -- ------ -- -- ------ -- --
  32. E0..FF -> E0 -> E0 E0..FF -> E0 F0..FF -> F0 -> F0
  33. C0..DF -> C0 -> C0 C0..DF -> C0 E0..EF -> F0 -> F0
  34. A0..BF -> A0 -> A0 A0..BF -> A0 D8..DF -> 00 -> 00
  35. 80..9F -> 80 -> 80 80..9F -> 80 D0..D7 -> 00 -> 00
  36. 60..7F -> 60 -> 60 60..7F -> 60
  37. 40..5F -> 40 40..5F -> pc -> pc 40..5F -> pc
  38. 20..3F -> 20 -> 20 20..3F -> 20
  39. 00..1F -> 00 -> 00 00..1F -> 00
  40. The default location of IO peripherals is above 0xf0000000. This may change
  41. using a "ranges" property in a device tree simple-bus node. See ePAPR 1.1, §6.5
  42. for details on the syntax and semantic of simple-bus nodes. The following
  43. limitations apply:
  44. 1. Only top level simple-bus nodes are considered
  45. 2. Only one (first) simple-bus node is considered
  46. 3. Empty "ranges" properties are not supported
  47. 4. Only the first triplet in the "ranges" property is considered
  48. 5. The parent-bus-address value is rounded down to the nearest 256MB boundary
  49. 6. The IO area covers the entire 256MB segment of parent-bus-address; the
  50. "ranges" triplet length field is ignored