porting.rst 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. =======
  2. Porting
  3. =======
  4. Taken from list archive at http://lists.arm.linux.org.uk/pipermail/linux-arm-kernel/2001-July/004064.html
  5. Initial definitions
  6. -------------------
  7. The following symbol definitions rely on you knowing the translation that
  8. __virt_to_phys() does for your machine. This macro converts the passed
  9. virtual address to a physical address. Normally, it is simply:
  10. phys = virt - PAGE_OFFSET + PHYS_OFFSET
  11. Decompressor Symbols
  12. --------------------
  13. ZTEXTADDR
  14. Start address of decompressor. There's no point in talking about
  15. virtual or physical addresses here, since the MMU will be off at
  16. the time when you call the decompressor code. You normally call
  17. the kernel at this address to start it booting. This doesn't have
  18. to be located in RAM, it can be in flash or other read-only or
  19. read-write addressable medium.
  20. ZBSSADDR
  21. Start address of zero-initialised work area for the decompressor.
  22. This must be pointing at RAM. The decompressor will zero initialise
  23. this for you. Again, the MMU will be off.
  24. ZRELADDR
  25. This is the address where the decompressed kernel will be written,
  26. and eventually executed. The following constraint must be valid:
  27. __virt_to_phys(TEXTADDR) == ZRELADDR
  28. The initial part of the kernel is carefully coded to be position
  29. independent.
  30. INITRD_PHYS
  31. Physical address to place the initial RAM disk. Only relevant if
  32. you are using the bootpImage stuff (which only works on the old
  33. struct param_struct).
  34. INITRD_VIRT
  35. Virtual address of the initial RAM disk. The following constraint
  36. must be valid:
  37. __virt_to_phys(INITRD_VIRT) == INITRD_PHYS
  38. PARAMS_PHYS
  39. Physical address of the struct param_struct or tag list, giving the
  40. kernel various parameters about its execution environment.
  41. Kernel Symbols
  42. --------------
  43. PHYS_OFFSET
  44. Physical start address of the first bank of RAM.
  45. PAGE_OFFSET
  46. Virtual start address of the first bank of RAM. During the kernel
  47. boot phase, virtual address PAGE_OFFSET will be mapped to physical
  48. address PHYS_OFFSET, along with any other mappings you supply.
  49. This should be the same value as TASK_SIZE.
  50. TASK_SIZE
  51. The maximum size of a user process in bytes. Since user space
  52. always starts at zero, this is the maximum address that a user
  53. process can access+1. The user space stack grows down from this
  54. address.
  55. Any virtual address below TASK_SIZE is deemed to be user process
  56. area, and therefore managed dynamically on a process by process
  57. basis by the kernel. I'll call this the user segment.
  58. Anything above TASK_SIZE is common to all processes. I'll call
  59. this the kernel segment.
  60. (In other words, you can't put IO mappings below TASK_SIZE, and
  61. hence PAGE_OFFSET).
  62. TEXTADDR
  63. Virtual start address of kernel, normally PAGE_OFFSET + 0x8000.
  64. This is where the kernel image ends up. With the latest kernels,
  65. it must be located at 32768 bytes into a 128MB region. Previous
  66. kernels placed a restriction of 256MB here.
  67. DATAADDR
  68. Virtual address for the kernel data segment. Must not be defined
  69. when using the decompressor.
  70. VMALLOC_START / VMALLOC_END
  71. Virtual addresses bounding the vmalloc() area. There must not be
  72. any static mappings in this area; vmalloc will overwrite them.
  73. The addresses must also be in the kernel segment (see above).
  74. Normally, the vmalloc() area starts VMALLOC_OFFSET bytes above the
  75. last virtual RAM address (found using variable high_memory).
  76. VMALLOC_OFFSET
  77. Offset normally incorporated into VMALLOC_START to provide a hole
  78. between virtual RAM and the vmalloc area. We do this to allow
  79. out of bounds memory accesses (eg, something writing off the end
  80. of the mapped memory map) to be caught. Normally set to 8MB.
  81. Architecture Specific Macros
  82. ----------------------------
  83. BOOT_MEM(pram,pio,vio)
  84. `pram` specifies the physical start address of RAM. Must always
  85. be present, and should be the same as PHYS_OFFSET.
  86. `pio` is the physical address of an 8MB region containing IO for
  87. use with the debugging macros in arch/arm/kernel/debug-armv.S.
  88. `vio` is the virtual address of the 8MB debugging region.
  89. It is expected that the debugging region will be re-initialised
  90. by the architecture specific code later in the code (via the
  91. MAPIO function).
  92. BOOT_PARAMS
  93. Same as, and see PARAMS_PHYS.
  94. FIXUP(func)
  95. Machine specific fixups, run before memory subsystems have been
  96. initialised.
  97. MAPIO(func)
  98. Machine specific function to map IO areas (including the debug
  99. region above).
  100. INITIRQ(func)
  101. Machine specific function to initialise interrupts.