vmlinux.lds.S 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348
  1. /*
  2. * vmlinux.lds.S -- master linker script for m68knommu arch
  3. *
  4. * (C) Copyright 2002-2004, Greg Ungerer <gerg@snapgear.com>
  5. *
  6. * This ends up looking compilcated, because of the number of
  7. * address variations for ram and rom/flash layouts. The real
  8. * work of the linker script is all at the end, and reasonably
  9. * strait forward.
  10. */
  11. #include <linux/config.h>
  12. #include <asm-generic/vmlinux.lds.h>
  13. /*
  14. * Original Palm pilot (same for Xcopilot).
  15. * There is really only a rom target for this.
  16. */
  17. #ifdef CONFIG_PILOT3
  18. #define ROMVEC_START 0x10c00000
  19. #define ROMVEC_LENGTH 0x10400
  20. #define ROM_START 0x10c10400
  21. #define ROM_LENGTH 0xfec00
  22. #define ROM_END 0x10d00000
  23. #define RAMVEC_START 0x00000000
  24. #define RAMVEC_LENGTH 0x400
  25. #define RAM_START 0x10000400
  26. #define RAM_LENGTH 0xffc00
  27. #define RAM_END 0x10100000
  28. #define _ramend _ram_end_notused
  29. #define DATA_ADDR RAM_START
  30. #endif
  31. /*
  32. * Same setup on both the uCsimm and uCdimm.
  33. */
  34. #if defined(CONFIG_UCSIMM) || defined(CONFIG_UCDIMM)
  35. #ifdef CONFIG_RAMKERNEL
  36. #define ROMVEC_START 0x10c10000
  37. #define ROMVEC_LENGTH 0x400
  38. #define ROM_START 0x10c10400
  39. #define ROM_LENGTH 0x1efc00
  40. #define ROM_END 0x10e00000
  41. #define RAMVEC_START 0x00000000
  42. #define RAMVEC_LENGTH 0x400
  43. #define RAM_START 0x00020400
  44. #define RAM_LENGTH 0x7dfc00
  45. #define RAM_END 0x00800000
  46. #endif
  47. #ifdef CONFIG_ROMKERNEL
  48. #define ROMVEC_START 0x10c10000
  49. #define ROMVEC_LENGTH 0x400
  50. #define ROM_START 0x10c10400
  51. #define ROM_LENGTH 0x1efc00
  52. #define ROM_END 0x10e00000
  53. #define RAMVEC_START 0x00000000
  54. #define RAMVEC_LENGTH 0x400
  55. #define RAM_START 0x00020000
  56. #define RAM_LENGTH 0x600000
  57. #define RAM_END 0x00800000
  58. #endif
  59. #ifdef CONFIG_HIMEMKERNEL
  60. #define ROMVEC_START 0x00600000
  61. #define ROMVEC_LENGTH 0x400
  62. #define ROM_START 0x00600400
  63. #define ROM_LENGTH 0x1efc00
  64. #define ROM_END 0x007f0000
  65. #define RAMVEC_START 0x00000000
  66. #define RAMVEC_LENGTH 0x400
  67. #define RAM_START 0x00020000
  68. #define RAM_LENGTH 0x5e0000
  69. #define RAM_END 0x00600000
  70. #endif
  71. #endif
  72. #ifdef CONFIG_DRAGEN2
  73. #define RAM_START 0x10000
  74. #define RAM_LENGTH 0x7f0000
  75. #endif
  76. #ifdef CONFIG_UCQUICC
  77. #define ROMVEC_START 0x00000000
  78. #define ROMVEC_LENGTH 0x404
  79. #define ROM_START 0x00000404
  80. #define ROM_LENGTH 0x1ff6fc
  81. #define ROM_END 0x00200000
  82. #define RAMVEC_START 0x00200000
  83. #define RAMVEC_LENGTH 0x404
  84. #define RAM_START 0x00200404
  85. #define RAM_LENGTH 0x1ff6fc
  86. #define RAM_END 0x00400000
  87. #endif
  88. /*
  89. * The standard Arnewsh 5206 board only has 1MiB of ram. Not normally
  90. * enough to be useful. Assume the user has fitted something larger,
  91. * at least 4MiB in size. No point in not letting the kernel completely
  92. * link, it will be obvious if it is too big when they go to load it.
  93. */
  94. #if defined(CONFIG_ARN5206)
  95. #define RAM_START 0x10000
  96. #define RAM_LENGTH 0x3f0000
  97. #endif
  98. /*
  99. * The Motorola 5206eLITE board only has 1MiB of static RAM.
  100. */
  101. #if defined(CONFIG_ELITE)
  102. #define RAM_START 0x30020000
  103. #define RAM_END 0xe0000
  104. #endif
  105. /*
  106. * All the Motorola eval boards have the same basic arrangement.
  107. * The end of RAM will vary depending on how much ram is fitted,
  108. * but this isn't important here, we assume at least 4MiB.
  109. */
  110. #if defined(CONFIG_M5206eC3) || defined(CONFIG_M5249C3) || \
  111. defined(CONFIG_M5272C3) || defined(CONFIG_M5307C3) || \
  112. defined(CONFIG_ARN5307) || defined(CONFIG_M5407C3) || \
  113. defined(CONFIG_M5271EVB) || defined(CONFIG_M5275EVB)
  114. #define RAM_START 0x20000
  115. #define RAM_LENGTH 0x3e0000
  116. #endif
  117. /*
  118. * The senTec COBRA5272 board has nearly the same memory layout as
  119. * the M5272C3. We assume 16MiB ram.
  120. */
  121. #if defined(CONFIG_COBRA5272)
  122. #define RAM_START 0x20000
  123. #define RAM_LENGTH 0xfe0000
  124. #endif
  125. #if defined(CONFIG_M5282EVB)
  126. #define RAM_START 0x10000
  127. #define RAM_LENGTH 0x3f0000
  128. #endif
  129. /*
  130. * The senTec COBRA5282 board has the same memory layout as the M5282EVB.
  131. */
  132. #if defined(CONFIG_COBRA5282)
  133. #define RAM_START 0x10000
  134. #define RAM_LENGTH 0x3f0000
  135. #endif
  136. /*
  137. * These flash boot boards use all of ram for operation. Again the
  138. * actual memory size is not important here, assume at least 4MiB.
  139. * They currently have no support for running in flash.
  140. */
  141. #if defined(CONFIG_NETtel) || defined(CONFIG_eLIA) || \
  142. defined(CONFIG_DISKtel) || defined(CONFIG_SECUREEDGEMP3) || \
  143. defined(CONFIG_HW_FEITH)
  144. #define RAM_START 0x400
  145. #define RAM_LENGTH 0x3ffc00
  146. #endif
  147. /*
  148. * Sneha Boards mimimun memmory
  149. * The end of RAM will vary depending on how much ram is fitted,
  150. * but this isn't important here, we assume at least 4MiB.
  151. */
  152. #if defined(CONFIG_CPU16B)
  153. #define RAM_START 0x20000
  154. #define RAM_LENGTH 0x3e0000
  155. #endif
  156. #if defined(CONFIG_RAMKERNEL)
  157. #define TEXT ram
  158. #define DATA ram
  159. #define INIT ram
  160. #define BSS ram
  161. #endif
  162. #if defined(CONFIG_ROMKERNEL) || defined(CONFIG_HIMEMKERNEL)
  163. #define TEXT rom
  164. #define DATA ram
  165. #define INIT ram
  166. #define BSS ram
  167. #endif
  168. #ifndef DATA_ADDR
  169. #define DATA_ADDR
  170. #endif
  171. OUTPUT_ARCH(m68k)
  172. ENTRY(_start)
  173. MEMORY {
  174. #ifdef RAMVEC_START
  175. ramvec : ORIGIN = RAMVEC_START, LENGTH = RAMVEC_LENGTH
  176. #endif
  177. ram : ORIGIN = RAM_START, LENGTH = RAM_LENGTH
  178. #ifdef RAM_END
  179. eram : ORIGIN = RAM_END, LENGTH = 0
  180. #endif
  181. #ifdef ROM_START
  182. romvec : ORIGIN = ROMVEC_START, LENGTH = ROMVEC_LENGTH
  183. rom : ORIGIN = ROM_START, LENGTH = ROM_LENGTH
  184. erom : ORIGIN = ROM_END, LENGTH = 0
  185. #endif
  186. }
  187. jiffies = jiffies_64 + 4;
  188. SECTIONS {
  189. #ifdef ROMVEC_START
  190. . = ROMVEC_START ;
  191. .romvec : {
  192. __rom_start = . ;
  193. _romvec = .;
  194. *(.data.initvect)
  195. } > romvec
  196. #endif
  197. .text : {
  198. _stext = . ;
  199. *(.text)
  200. SCHED_TEXT
  201. *(.text.lock)
  202. . = ALIGN(16); /* Exception table */
  203. __start___ex_table = .;
  204. *(__ex_table)
  205. __stop___ex_table = .;
  206. *(.rodata) *(.rodata.*)
  207. *(__vermagic) /* Kernel version magic */
  208. *(.rodata1)
  209. *(.rodata.str1.1)
  210. /* Kernel symbol table: Normal symbols */
  211. . = ALIGN(4);
  212. __start___ksymtab = .;
  213. *(__ksymtab)
  214. __stop___ksymtab = .;
  215. /* Kernel symbol table: GPL-only symbols */
  216. __start___ksymtab_gpl = .;
  217. *(__ksymtab_gpl)
  218. __stop___ksymtab_gpl = .;
  219. /* Kernel symbol table: Normal symbols */
  220. __start___kcrctab = .;
  221. *(__kcrctab)
  222. __stop___kcrctab = .;
  223. /* Kernel symbol table: GPL-only symbols */
  224. __start___kcrctab_gpl = .;
  225. *(__kcrctab_gpl)
  226. __stop___kcrctab_gpl = .;
  227. /* Kernel symbol table: strings */
  228. *(__ksymtab_strings)
  229. /* Built-in module parameters */
  230. __start___param = .;
  231. *(__param)
  232. __stop___param = .;
  233. . = ALIGN(4) ;
  234. _etext = . ;
  235. } > TEXT
  236. #ifdef ROM_END
  237. . = ROM_END ;
  238. .erom : {
  239. __rom_end = . ;
  240. } > erom
  241. #endif
  242. #ifdef RAMVEC_START
  243. . = RAMVEC_START ;
  244. .ramvec : {
  245. __ramvec = .;
  246. } > ramvec
  247. #endif
  248. .data DATA_ADDR : {
  249. . = ALIGN(4);
  250. _sdata = . ;
  251. *(.data)
  252. . = ALIGN(8192) ;
  253. *(.data.init_task)
  254. _edata = . ;
  255. } > DATA
  256. .init : {
  257. . = ALIGN(4096);
  258. __init_begin = .;
  259. _sinittext = .;
  260. *(.init.text)
  261. _einittext = .;
  262. *(.init.data)
  263. . = ALIGN(16);
  264. __setup_start = .;
  265. *(.init.setup)
  266. __setup_end = .;
  267. __initcall_start = .;
  268. *(.initcall1.init)
  269. *(.initcall2.init)
  270. *(.initcall3.init)
  271. *(.initcall4.init)
  272. *(.initcall5.init)
  273. *(.initcall6.init)
  274. *(.initcall7.init)
  275. __initcall_end = .;
  276. __con_initcall_start = .;
  277. *(.con_initcall.init)
  278. __con_initcall_end = .;
  279. __security_initcall_start = .;
  280. *(.security_initcall.init)
  281. __security_initcall_end = .;
  282. . = ALIGN(4);
  283. __initramfs_start = .;
  284. *(.init.ramfs)
  285. __initramfs_end = .;
  286. . = ALIGN(4096);
  287. __init_end = .;
  288. } > INIT
  289. /DISCARD/ : {
  290. *(.exit.text)
  291. *(.exit.data)
  292. *(.exitcall.exit)
  293. }
  294. .bss : {
  295. . = ALIGN(4);
  296. _sbss = . ;
  297. *(.bss)
  298. *(COMMON)
  299. . = ALIGN(4) ;
  300. _ebss = . ;
  301. } > BSS
  302. #ifdef RAM_END
  303. . = RAM_END ;
  304. .eram : {
  305. __ramend = . ;
  306. _ramend = . ;
  307. } > eram
  308. #endif
  309. }