vm_init_segtable.S 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443
  1. /*
  2. * Initial page table for Linux kernel under Hexagon VM,
  3. *
  4. * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2 and
  8. * only version 2 as published by the Free Software Foundation.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program; if not, write to the Free Software
  17. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  18. * 02110-1301, USA.
  19. */
  20. /*
  21. * These tables are pre-computed and linked into kernel.
  22. */
  23. #include <asm/vm_mmu.h>
  24. /* #include <asm/iomap.h> */
  25. /*
  26. * Start with mapping PA=0 to both VA=0x0 and VA=0xc000000 as 16MB large pages.
  27. * No user mode access, RWX, write-back cache. The entry needs
  28. * to be replicated for all 4 virtual segments mapping to the page.
  29. */
  30. /* "Big Kernel Page" */
  31. #define BKP(pa) (((pa) & __HVM_PTE_PGMASK_4MB) \
  32. | __HVM_PTE_R | __HVM_PTE_W | __HVM_PTE_X \
  33. | __HEXAGON_C_WB_L2 << 6 \
  34. | __HVM_PDE_S_16MB)
  35. /* No cache version */
  36. #define BKPG_IO(pa) (((pa) & __HVM_PTE_PGMASK_16MB) \
  37. | __HVM_PTE_R | __HVM_PTE_W | __HVM_PTE_X \
  38. | __HVM_PDE_S_16MB | __HEXAGON_C_DEV << 6 )
  39. #define FOURK_IO(pa) (((pa) & __HVM_PTE_PGMASK_4KB) \
  40. | __HVM_PTE_R | __HVM_PTE_W | __HVM_PTE_X \
  41. | __HEXAGON_C_DEV << 6 )
  42. #define L2_PTR(pa) (((pa) & __HVM_PTE_PGMASK_4KB) \
  43. | __HVM_PDE_S_4KB )
  44. #define X __HVM_PDE_S_INVALID
  45. .p2align 12
  46. .globl swapper_pg_dir
  47. .globl _K_init_segtable
  48. swapper_pg_dir:
  49. /* VA 0x00000000 */
  50. .word X,X,X,X
  51. .word X,X,X,X
  52. .word X,X,X,X
  53. .word X,X,X,X
  54. .word X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X
  55. .word X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X
  56. .word X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X
  57. .word X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X
  58. .word X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X
  59. .word X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X
  60. .word X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X
  61. .word X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X
  62. /* VA 0x40000000 */
  63. .word X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X
  64. .word X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X
  65. .word X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X
  66. .word X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X
  67. .word X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X
  68. .word X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X
  69. .word X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X
  70. .word X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X
  71. /* VA 0x80000000 */
  72. .word X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X
  73. .word X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X
  74. .word X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X
  75. .word X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X
  76. .word X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X
  77. /*0xa8*/.word X,X,X,X
  78. #ifdef CONFIG_COMET_EARLY_UART_DEBUG
  79. UART_PTE_ENTRY:
  80. /*0xa9*/.word BKPG_IO(0xa9000000),BKPG_IO(0xa9000000),BKPG_IO(0xa9000000),BKPG_IO(0xa9000000)
  81. #else
  82. /*0xa9*/.word X,X,X,X
  83. #endif
  84. /*0xaa*/.word X,X,X,X
  85. /*0xab*/.word X,X,X,X
  86. /*0xac*/.word X,X,X,X
  87. /*0xad*/.word X,X,X,X
  88. /*0xae*/.word X,X,X,X
  89. /*0xaf*/.word X,X,X,X
  90. /*0xb0*/.word X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X
  91. .word X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X
  92. _K_init_segtable:
  93. /* VA 0xC0000000 */
  94. .word BKP(0x00000000), BKP(0x00400000), BKP(0x00800000), BKP(0x00c00000)
  95. .word BKP(0x01000000), BKP(0x01400000), BKP(0x01800000), BKP(0x01c00000)
  96. .word BKP(0x02000000), BKP(0x02400000), BKP(0x02800000), BKP(0x02c00000)
  97. .word BKP(0x03000000), BKP(0x03400000), BKP(0x03800000), BKP(0x03c00000)
  98. .word BKP(0x04000000), BKP(0x04400000), BKP(0x04800000), BKP(0x04c00000)
  99. .word BKP(0x05000000), BKP(0x05400000), BKP(0x05800000), BKP(0x05c00000)
  100. .word BKP(0x06000000), BKP(0x06400000), BKP(0x06800000), BKP(0x06c00000)
  101. .word BKP(0x07000000), BKP(0x07400000), BKP(0x07800000), BKP(0x07c00000)
  102. .word BKP(0x08000000), BKP(0x08400000), BKP(0x08800000), BKP(0x08c00000)
  103. .word BKP(0x09000000), BKP(0x09400000), BKP(0x09800000), BKP(0x09c00000)
  104. .word BKP(0x0a000000), BKP(0x0a400000), BKP(0x0a800000), BKP(0x0ac00000)
  105. .word BKP(0x0b000000), BKP(0x0b400000), BKP(0x0b800000), BKP(0x0bc00000)
  106. .word BKP(0x0c000000), BKP(0x0c400000), BKP(0x0c800000), BKP(0x0cc00000)
  107. .word BKP(0x0d000000), BKP(0x0d400000), BKP(0x0d800000), BKP(0x0dc00000)
  108. .word BKP(0x0e000000), BKP(0x0e400000), BKP(0x0e800000), BKP(0x0ec00000)
  109. .word BKP(0x0f000000), BKP(0x0f400000), BKP(0x0f800000), BKP(0x0fc00000)
  110. .word BKP(0x10000000), BKP(0x10400000), BKP(0x10800000), BKP(0x10c00000)
  111. .word BKP(0x11000000), BKP(0x11400000), BKP(0x11800000), BKP(0x11c00000)
  112. .word BKP(0x12000000), BKP(0x12400000), BKP(0x12800000), BKP(0x12c00000)
  113. .word BKP(0x13000000), BKP(0x13400000), BKP(0x13800000), BKP(0x13c00000)
  114. .word BKP(0x14000000), BKP(0x14400000), BKP(0x14800000), BKP(0x14c00000)
  115. .word BKP(0x15000000), BKP(0x15400000), BKP(0x15800000), BKP(0x15c00000)
  116. .word BKP(0x16000000), BKP(0x16400000), BKP(0x16800000), BKP(0x16c00000)
  117. .word BKP(0x17000000), BKP(0x17400000), BKP(0x17800000), BKP(0x17c00000)
  118. .word BKP(0x18000000), BKP(0x18400000), BKP(0x18800000), BKP(0x18c00000)
  119. .word BKP(0x19000000), BKP(0x19400000), BKP(0x19800000), BKP(0x19c00000)
  120. .word BKP(0x1a000000), BKP(0x1a400000), BKP(0x1a800000), BKP(0x1ac00000)
  121. .word BKP(0x1b000000), BKP(0x1b400000), BKP(0x1b800000), BKP(0x1bc00000)
  122. .word BKP(0x1c000000), BKP(0x1c400000), BKP(0x1c800000), BKP(0x1cc00000)
  123. .word BKP(0x1d000000), BKP(0x1d400000), BKP(0x1d800000), BKP(0x1dc00000)
  124. .word BKP(0x1e000000), BKP(0x1e400000), BKP(0x1e800000), BKP(0x1ec00000)
  125. .word BKP(0x1f000000), BKP(0x1f400000), BKP(0x1f800000), BKP(0x1fc00000)
  126. .word BKP(0x20000000), BKP(0x20400000), BKP(0x20800000), BKP(0x20c00000)
  127. .word BKP(0x21000000), BKP(0x21400000), BKP(0x21800000), BKP(0x21c00000)
  128. .word BKP(0x22000000), BKP(0x22400000), BKP(0x22800000), BKP(0x22c00000)
  129. .word BKP(0x23000000), BKP(0x23400000), BKP(0x23800000), BKP(0x23c00000)
  130. .word BKP(0x24000000), BKP(0x24400000), BKP(0x24800000), BKP(0x24c00000)
  131. .word BKP(0x25000000), BKP(0x25400000), BKP(0x25800000), BKP(0x25c00000)
  132. .word BKP(0x26000000), BKP(0x26400000), BKP(0x26800000), BKP(0x26c00000)
  133. .word BKP(0x27000000), BKP(0x27400000), BKP(0x27800000), BKP(0x27c00000)
  134. .word BKP(0x28000000), BKP(0x28400000), BKP(0x28800000), BKP(0x28c00000)
  135. .word BKP(0x29000000), BKP(0x29400000), BKP(0x29800000), BKP(0x29c00000)
  136. .word BKP(0x2a000000), BKP(0x2a400000), BKP(0x2a800000), BKP(0x2ac00000)
  137. .word BKP(0x2b000000), BKP(0x2b400000), BKP(0x2b800000), BKP(0x2bc00000)
  138. .word BKP(0x2c000000), BKP(0x2c400000), BKP(0x2c800000), BKP(0x2cc00000)
  139. .word BKP(0x2d000000), BKP(0x2d400000), BKP(0x2d800000), BKP(0x2dc00000)
  140. .word BKP(0x2e000000), BKP(0x2e400000), BKP(0x2e800000), BKP(0x2ec00000)
  141. .word BKP(0x2f000000), BKP(0x2f400000), BKP(0x2f800000), BKP(0x2fc00000)
  142. .word BKP(0x30000000), BKP(0x30400000), BKP(0x30800000), BKP(0x30c00000)
  143. .word BKP(0x31000000), BKP(0x31400000), BKP(0x31800000), BKP(0x31c00000)
  144. .word BKP(0x32000000), BKP(0x32400000), BKP(0x32800000), BKP(0x32c00000)
  145. .word BKP(0x33000000), BKP(0x33400000), BKP(0x33800000), BKP(0x33c00000)
  146. .word BKP(0x34000000), BKP(0x34400000), BKP(0x34800000), BKP(0x34c00000)
  147. .word BKP(0x35000000), BKP(0x35400000), BKP(0x35800000), BKP(0x35c00000)
  148. .word BKP(0x36000000), BKP(0x36400000), BKP(0x36800000), BKP(0x36c00000)
  149. .word BKP(0x37000000), BKP(0x37400000), BKP(0x37800000), BKP(0x37c00000)
  150. .word BKP(0x38000000), BKP(0x38400000), BKP(0x38800000), BKP(0x38c00000)
  151. .word BKP(0x39000000), BKP(0x39400000), BKP(0x39800000), BKP(0x39c00000)
  152. .word BKP(0x3a000000), BKP(0x3a400000), BKP(0x3a800000), BKP(0x3ac00000)
  153. .word BKP(0x3b000000), BKP(0x3b400000), BKP(0x3b800000), BKP(0x3bc00000)
  154. .word BKP(0x3c000000), BKP(0x3c400000), BKP(0x3c800000), BKP(0x3cc00000)
  155. .word BKP(0x3d000000), BKP(0x3d400000), BKP(0x3d800000), BKP(0x3dc00000)
  156. _K_io_map:
  157. .word X,X,X,X /* 0x3e000000 - device IO early remap */
  158. .word X,X,X,X /* 0x3f000000 - hypervisor space*/
  159. #if 0
  160. /*
  161. * This is in here as an example for devices which need to be mapped really
  162. * early.
  163. */
  164. .p2align 12
  165. .globl _K_io_kmap
  166. .globl _K_init_devicetable
  167. _K_init_devicetable: /* Should be 4MB worth of entries */
  168. .word FOURK_IO(MSM_GPIO1_PHYS),FOURK_IO(MSM_GPIO2_PHYS),FOURK_IO(MSM_SIRC_PHYS),X
  169. .word FOURK_IO(TLMM_GPIO1_PHYS),X,X,X
  170. .word X,X,X,X
  171. .word X,X,X,X
  172. .word X,X,X,X
  173. .word X,X,X,X
  174. .word X,X,X,X
  175. .word X,X,X,X
  176. .word X,X,X,X
  177. .word X,X,X,X
  178. .word X,X,X,X
  179. .word X,X,X,X
  180. .word X,X,X,X
  181. .word X,X,X,X
  182. .word X,X,X,X
  183. .word X,X,X,X
  184. .word X,X,X,X
  185. .word X,X,X,X
  186. .word X,X,X,X
  187. .word X,X,X,X
  188. .word X,X,X,X
  189. .word X,X,X,X
  190. .word X,X,X,X
  191. .word X,X,X,X
  192. .word X,X,X,X
  193. .word X,X,X,X
  194. .word X,X,X,X
  195. .word X,X,X,X
  196. .word X,X,X,X
  197. .word X,X,X,X
  198. .word X,X,X,X
  199. .word X,X,X,X
  200. .word X,X,X,X
  201. .word X,X,X,X
  202. .word X,X,X,X
  203. .word X,X,X,X
  204. .word X,X,X,X
  205. .word X,X,X,X
  206. .word X,X,X,X
  207. .word X,X,X,X
  208. .word X,X,X,X
  209. .word X,X,X,X
  210. .word X,X,X,X
  211. .word X,X,X,X
  212. .word X,X,X,X
  213. .word X,X,X,X
  214. .word X,X,X,X
  215. .word X,X,X,X
  216. .word X,X,X,X
  217. .word X,X,X,X
  218. .word X,X,X,X
  219. .word X,X,X,X
  220. .word X,X,X,X
  221. .word X,X,X,X
  222. .word X,X,X,X
  223. .word X,X,X,X
  224. .word X,X,X,X
  225. .word X,X,X,X
  226. .word X,X,X,X
  227. .word X,X,X,X
  228. .word X,X,X,X
  229. .word X,X,X,X
  230. .word X,X,X,X
  231. .word X,X,X,X
  232. .word X,X,X,X
  233. .word X,X,X,X
  234. .word X,X,X,X
  235. .word X,X,X,X
  236. .word X,X,X,X
  237. .word X,X,X,X
  238. .word X,X,X,X
  239. .word X,X,X,X
  240. .word X,X,X,X
  241. .word X,X,X,X
  242. .word X,X,X,X
  243. .word X,X,X,X
  244. .word X,X,X,X
  245. .word X,X,X,X
  246. .word X,X,X,X
  247. .word X,X,X,X
  248. .word X,X,X,X
  249. .word X,X,X,X
  250. .word X,X,X,X
  251. .word X,X,X,X
  252. .word X,X,X,X
  253. .word X,X,X,X
  254. .word X,X,X,X
  255. .word X,X,X,X
  256. .word X,X,X,X
  257. .word X,X,X,X
  258. .word X,X,X,X
  259. .word X,X,X,X
  260. .word X,X,X,X
  261. .word X,X,X,X
  262. .word X,X,X,X
  263. .word X,X,X,X
  264. .word X,X,X,X
  265. .word X,X,X,X
  266. .word X,X,X,X
  267. .word X,X,X,X
  268. .word X,X,X,X
  269. .word X,X,X,X
  270. .word X,X,X,X
  271. .word X,X,X,X
  272. .word X,X,X,X
  273. .word X,X,X,X
  274. .word X,X,X,X
  275. .word X,X,X,X
  276. .word X,X,X,X
  277. .word X,X,X,X
  278. .word X,X,X,X
  279. .word X,X,X,X
  280. .word X,X,X,X
  281. .word X,X,X,X
  282. .word X,X,X,X
  283. .word X,X,X,X
  284. .word X,X,X,X
  285. .word X,X,X,X
  286. .word X,X,X,X
  287. .word X,X,X,X
  288. .word X,X,X,X
  289. .word X,X,X,X
  290. .word X,X,X,X
  291. .word X,X,X,X
  292. .word X,X,X,X
  293. .word X,X,X,X
  294. .word X,X,X,X
  295. .word X,X,X,X
  296. .word X,X,X,X
  297. .word X,X,X,X
  298. .word X,X,X,X
  299. .word X,X,X,X
  300. .word X,X,X,X
  301. .word X,X,X,X
  302. .word X,X,X,X
  303. .word X,X,X,X
  304. .word X,X,X,X
  305. .word X,X,X,X
  306. .word X,X,X,X
  307. .word X,X,X,X
  308. .word X,X,X,X
  309. .word X,X,X,X
  310. .word X,X,X,X
  311. .word X,X,X,X
  312. .word X,X,X,X
  313. .word X,X,X,X
  314. .word X,X,X,X
  315. .word X,X,X,X
  316. .word X,X,X,X
  317. .word X,X,X,X
  318. .word X,X,X,X
  319. .word X,X,X,X
  320. .word X,X,X,X
  321. .word X,X,X,X
  322. .word X,X,X,X
  323. .word X,X,X,X
  324. .word X,X,X,X
  325. .word X,X,X,X
  326. .word X,X,X,X
  327. .word X,X,X,X
  328. .word X,X,X,X
  329. .word X,X,X,X
  330. .word X,X,X,X
  331. .word X,X,X,X
  332. .word X,X,X,X
  333. .word X,X,X,X
  334. .word X,X,X,X
  335. .word X,X,X,X
  336. .word X,X,X,X
  337. .word X,X,X,X
  338. .word X,X,X,X
  339. .word X,X,X,X
  340. .word X,X,X,X
  341. .word X,X,X,X
  342. .word X,X,X,X
  343. .word X,X,X,X
  344. .word X,X,X,X
  345. .word X,X,X,X
  346. .word X,X,X,X
  347. .word X,X,X,X
  348. .word X,X,X,X
  349. .word X,X,X,X
  350. .word X,X,X,X
  351. .word X,X,X,X
  352. .word X,X,X,X
  353. .word X,X,X,X
  354. .word X,X,X,X
  355. .word X,X,X,X
  356. .word X,X,X,X
  357. .word X,X,X,X
  358. .word X,X,X,X
  359. .word X,X,X,X
  360. .word X,X,X,X
  361. .word X,X,X,X
  362. .word X,X,X,X
  363. .word X,X,X,X
  364. .word X,X,X,X
  365. .word X,X,X,X
  366. .word X,X,X,X
  367. .word X,X,X,X
  368. .word X,X,X,X
  369. .word X,X,X,X
  370. .word X,X,X,X
  371. .word X,X,X,X
  372. .word X,X,X,X
  373. .word X,X,X,X
  374. .word X,X,X,X
  375. .word X,X,X,X
  376. .word X,X,X,X
  377. .word X,X,X,X
  378. .word X,X,X,X
  379. .word X,X,X,X
  380. .word X,X,X,X
  381. .word X,X,X,X
  382. .word X,X,X,X
  383. .word X,X,X,X
  384. .word X,X,X,X
  385. .word X,X,X,X
  386. .word X,X,X,X
  387. .word X,X,X,X
  388. .word X,X,X,X
  389. .word X,X,X,X
  390. .word X,X,X,X
  391. .word X,X,X,X
  392. .word X,X,X,X
  393. .word X,X,X,X
  394. .word X,X,X,X
  395. .word X,X,X,X
  396. .word X,X,X,X
  397. .word X,X,X,X
  398. .word X,X,X,X
  399. .word X,X,X,X
  400. .word X,X,X,X
  401. .word X,X,X,X
  402. .word X,X,X,X
  403. .word X,X,X,X
  404. .word X,X,X,X
  405. .word X,X,X,X
  406. .word X,X,X,X
  407. .word X,X,X,X
  408. .word X,X,X,X
  409. .word X,X,X,X
  410. .word X,X,X,X
  411. .word X,X,X,X
  412. .word X,X,X,X
  413. .word X,X,X,X
  414. .word X,X,X,X
  415. .word X,X,X,X
  416. .word X,X,X,X
  417. .word X,X,X,X
  418. .word X,X,X,X
  419. .word X,X,X,X
  420. .word X,X,X,X
  421. .word X,X,X,X
  422. .word X,X,X,X
  423. .word X,X,X,X
  424. #endif