vmlinux.lds.S 7.8 KB

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