vmlinux.lds.S 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384
  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_LENGTH 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. defined(CONFIG_M5235EVB)
  115. #define RAM_START 0x20000
  116. #define RAM_LENGTH 0x3e0000
  117. #endif
  118. /*
  119. * The Freescale 5208EVB board has 32MB of RAM.
  120. */
  121. #if defined(CONFIG_M5208EVB)
  122. #define RAM_START 0x40020000
  123. #define RAM_LENGTH 0x01fe0000
  124. #endif
  125. /*
  126. * The senTec COBRA5272 board has nearly the same memory layout as
  127. * the M5272C3. We assume 16MiB ram.
  128. */
  129. #if defined(CONFIG_COBRA5272)
  130. #define RAM_START 0x20000
  131. #define RAM_LENGTH 0xfe0000
  132. #endif
  133. #if defined(CONFIG_M5282EVB)
  134. #define RAM_START 0x10000
  135. #define RAM_LENGTH 0x3f0000
  136. #endif
  137. /*
  138. * The senTec COBRA5282 board has the same memory layout as the M5282EVB.
  139. */
  140. #if defined(CONFIG_COBRA5282)
  141. #define RAM_START 0x10000
  142. #define RAM_LENGTH 0x3f0000
  143. #endif
  144. /*
  145. * The EMAC SoM-5282EM module.
  146. */
  147. #if defined(CONFIG_SOM5282EM)
  148. #define RAM_START 0x10000
  149. #define RAM_LENGTH 0xff0000
  150. #endif
  151. /*
  152. * These flash boot boards use all of ram for operation. Again the
  153. * actual memory size is not important here, assume at least 4MiB.
  154. * They currently have no support for running in flash.
  155. */
  156. #if defined(CONFIG_NETtel) || defined(CONFIG_eLIA) || \
  157. defined(CONFIG_DISKtel) || defined(CONFIG_SECUREEDGEMP3) || \
  158. defined(CONFIG_HW_FEITH)
  159. #define RAM_START 0x400
  160. #define RAM_LENGTH 0x3ffc00
  161. #endif
  162. /*
  163. * Sneha Boards mimimun memory
  164. * The end of RAM will vary depending on how much ram is fitted,
  165. * but this isn't important here, we assume at least 4MiB.
  166. */
  167. #if defined(CONFIG_CPU16B)
  168. #define RAM_START 0x20000
  169. #define RAM_LENGTH 0x3e0000
  170. #endif
  171. #if defined(CONFIG_MOD5272)
  172. #define RAM_START 0x02000000
  173. #define RAM_LENGTH 0x00800000
  174. #define RAMVEC_START 0x20000000
  175. #define RAMVEC_LENGTH 0x00000400
  176. #endif
  177. #if defined(CONFIG_RAMKERNEL)
  178. #define TEXT ram
  179. #define DATA ram
  180. #define INIT ram
  181. #define BSS ram
  182. #endif
  183. #if defined(CONFIG_ROMKERNEL) || defined(CONFIG_HIMEMKERNEL)
  184. #define TEXT rom
  185. #define DATA ram
  186. #define INIT ram
  187. #define BSS ram
  188. #endif
  189. #ifndef DATA_ADDR
  190. #define DATA_ADDR
  191. #endif
  192. OUTPUT_ARCH(m68k)
  193. ENTRY(_start)
  194. MEMORY {
  195. #ifdef RAMVEC_START
  196. ramvec : ORIGIN = RAMVEC_START, LENGTH = RAMVEC_LENGTH
  197. #endif
  198. ram : ORIGIN = RAM_START, LENGTH = RAM_LENGTH
  199. #ifdef RAM_END
  200. eram : ORIGIN = RAM_END, LENGTH = 0
  201. #endif
  202. #ifdef ROM_START
  203. romvec : ORIGIN = ROMVEC_START, LENGTH = ROMVEC_LENGTH
  204. rom : ORIGIN = ROM_START, LENGTH = ROM_LENGTH
  205. erom : ORIGIN = ROM_END, LENGTH = 0
  206. #endif
  207. }
  208. jiffies = jiffies_64 + 4;
  209. SECTIONS {
  210. #ifdef ROMVEC_START
  211. . = ROMVEC_START ;
  212. .romvec : {
  213. __rom_start = . ;
  214. _romvec = .;
  215. *(.data.initvect)
  216. } > romvec
  217. #endif
  218. .text : {
  219. _stext = . ;
  220. *(.text)
  221. SCHED_TEXT
  222. *(.text.lock)
  223. . = ALIGN(16); /* Exception table */
  224. __start___ex_table = .;
  225. *(__ex_table)
  226. __stop___ex_table = .;
  227. *(.rodata) *(.rodata.*)
  228. *(__vermagic) /* Kernel version magic */
  229. *(.rodata1)
  230. *(.rodata.str1.1)
  231. /* Kernel symbol table: Normal symbols */
  232. . = ALIGN(4);
  233. __start___ksymtab = .;
  234. *(__ksymtab)
  235. __stop___ksymtab = .;
  236. /* Kernel symbol table: GPL-only symbols */
  237. __start___ksymtab_gpl = .;
  238. *(__ksymtab_gpl)
  239. __stop___ksymtab_gpl = .;
  240. /* Kernel symbol table: GPL-future symbols */
  241. __start___ksymtab_gpl_future = .;
  242. *(__ksymtab_gpl_future)
  243. __stop___ksymtab_gpl_future = .;
  244. /* Kernel symbol table: Normal symbols */
  245. __start___kcrctab = .;
  246. *(__kcrctab)
  247. __stop___kcrctab = .;
  248. /* Kernel symbol table: GPL-only symbols */
  249. __start___kcrctab_gpl = .;
  250. *(__kcrctab_gpl)
  251. __stop___kcrctab_gpl = .;
  252. /* Kernel symbol table: GPL-future symbols */
  253. __start___kcrctab_gpl_future = .;
  254. *(__kcrctab_gpl_future)
  255. __stop___kcrctab_gpl_future = .;
  256. /* Kernel symbol table: strings */
  257. *(__ksymtab_strings)
  258. /* Built-in module parameters */
  259. . = ALIGN(4) ;
  260. __start___param = .;
  261. *(__param)
  262. __stop___param = .;
  263. . = ALIGN(4) ;
  264. _etext = . ;
  265. } > TEXT
  266. #ifdef ROM_END
  267. . = ROM_END ;
  268. .erom : {
  269. __rom_end = . ;
  270. } > erom
  271. #endif
  272. #ifdef RAMVEC_START
  273. . = RAMVEC_START ;
  274. .ramvec : {
  275. __ramvec = .;
  276. } > ramvec
  277. #endif
  278. .data DATA_ADDR : {
  279. . = ALIGN(4);
  280. _sdata = . ;
  281. *(.data)
  282. . = ALIGN(8192) ;
  283. *(.data.init_task)
  284. _edata = . ;
  285. } > DATA
  286. .init : {
  287. . = ALIGN(4096);
  288. __init_begin = .;
  289. _sinittext = .;
  290. *(.init.text)
  291. _einittext = .;
  292. *(.init.data)
  293. . = ALIGN(16);
  294. __setup_start = .;
  295. *(.init.setup)
  296. __setup_end = .;
  297. __initcall_start = .;
  298. *(.initcall1.init)
  299. *(.initcall2.init)
  300. *(.initcall3.init)
  301. *(.initcall4.init)
  302. *(.initcall5.init)
  303. *(.initcall6.init)
  304. *(.initcall7.init)
  305. __initcall_end = .;
  306. __con_initcall_start = .;
  307. *(.con_initcall.init)
  308. __con_initcall_end = .;
  309. __security_initcall_start = .;
  310. *(.security_initcall.init)
  311. __security_initcall_end = .;
  312. . = ALIGN(4);
  313. __initramfs_start = .;
  314. *(.init.ramfs)
  315. __initramfs_end = .;
  316. . = ALIGN(4096);
  317. __init_end = .;
  318. } > INIT
  319. /DISCARD/ : {
  320. *(.exit.text)
  321. *(.exit.data)
  322. *(.exitcall.exit)
  323. }
  324. .bss : {
  325. . = ALIGN(4);
  326. _sbss = . ;
  327. *(.bss)
  328. *(COMMON)
  329. . = ALIGN(4) ;
  330. _ebss = . ;
  331. } > BSS
  332. #ifdef RAM_END
  333. . = RAM_END ;
  334. .eram : {
  335. __ramend = . ;
  336. _ramend = . ;
  337. } > eram
  338. #endif
  339. }