u-boot.lds 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. /*
  2. * U-boot - u-boot.lds.S
  3. *
  4. * Copyright (c) 2005-2010 Analog Device Inc.
  5. *
  6. * (C) Copyright 2000-2004
  7. * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  8. *
  9. * See file CREDITS for list of people who contributed to this
  10. * project.
  11. *
  12. * This program is free software; you can redistribute it and/or
  13. * modify it under the terms of the GNU General Public License as
  14. * published by the Free Software Foundation; either version 2 of
  15. * the License, or (at your option) any later version.
  16. *
  17. * This program is distributed in the hope that it will be useful,
  18. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  20. * GNU General Public License for more details.
  21. *
  22. * You should have received a copy of the GNU General Public License
  23. * along with this program; if not, write to the Free Software
  24. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  25. * MA 02111-1307 USA
  26. */
  27. #include <config.h>
  28. #include <asm/blackfin.h>
  29. #undef ALIGN
  30. #undef ENTRY
  31. #ifndef LDS_BOARD_TEXT
  32. # define LDS_BOARD_TEXT
  33. #endif
  34. /* If we don't actually load anything into L1 data, this will avoid
  35. * a syntax error. If we do actually load something into L1 data,
  36. * we'll get a linker memory load error (which is what we'd want).
  37. * This is here in the first place so we can quickly test building
  38. * for different CPU's which may lack non-cache L1 data.
  39. */
  40. #ifndef L1_DATA_A_SRAM
  41. # define L1_DATA_A_SRAM 0
  42. # define L1_DATA_A_SRAM_SIZE 0
  43. #endif
  44. #ifndef L1_DATA_B_SRAM
  45. # define L1_DATA_B_SRAM L1_DATA_A_SRAM
  46. # define L1_DATA_B_SRAM_SIZE L1_DATA_A_SRAM_SIZE
  47. #endif
  48. /* The 0xC offset is so we don't clobber the tiny LDR jump block. */
  49. #ifdef CONFIG_BFIN_BOOTROM_USES_EVT1
  50. # define L1_CODE_ORIGIN L1_INST_SRAM
  51. #else
  52. # define L1_CODE_ORIGIN L1_INST_SRAM + 0xC
  53. #endif
  54. OUTPUT_ARCH(bfin)
  55. MEMORY
  56. {
  57. #if CONFIG_MEM_SIZE
  58. ram : ORIGIN = CONFIG_SYS_MONITOR_BASE, LENGTH = CONFIG_SYS_MONITOR_LEN
  59. # define ram_code ram
  60. # define ram_data ram
  61. #else
  62. # define ram_code l1_code
  63. # define ram_data l1_data
  64. #endif
  65. l1_code : ORIGIN = L1_CODE_ORIGIN, LENGTH = L1_INST_SRAM_SIZE
  66. l1_data : ORIGIN = L1_DATA_B_SRAM, LENGTH = L1_DATA_B_SRAM_SIZE
  67. }
  68. ENTRY(_start)
  69. SECTIONS
  70. {
  71. .text.pre :
  72. {
  73. arch/blackfin/cpu/start.o (.text .text.*)
  74. LDS_BOARD_TEXT
  75. } >ram_code
  76. .text.init :
  77. {
  78. arch/blackfin/cpu/initcode.o (.text .text.*)
  79. } >ram_code
  80. __initcode_lma = LOADADDR(.text.init);
  81. __initcode_len = SIZEOF(.text.init);
  82. .text :
  83. {
  84. *(.text .text.*)
  85. } >ram_code
  86. .rodata :
  87. {
  88. . = ALIGN(4);
  89. *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*)))
  90. . = ALIGN(4);
  91. } >ram_data
  92. .data :
  93. {
  94. . = ALIGN(4);
  95. *(.data .data.*)
  96. *(.data1)
  97. *(.sdata)
  98. *(.sdata2)
  99. *(.dynamic)
  100. CONSTRUCTORS
  101. } >ram_data
  102. .u_boot_cmd :
  103. {
  104. ___u_boot_cmd_start = .;
  105. *(.u_boot_cmd)
  106. ___u_boot_cmd_end = .;
  107. } >ram_data
  108. .u_boot_list : {
  109. #include <u-boot.lst>
  110. } >ram_data
  111. .text_l1 :
  112. {
  113. . = ALIGN(4);
  114. __stext_l1 = .;
  115. *(.l1.text)
  116. . = ALIGN(4);
  117. __etext_l1 = .;
  118. } >l1_code AT>ram_code
  119. __text_l1_lma = LOADADDR(.text_l1);
  120. __text_l1_len = SIZEOF(.text_l1);
  121. ASSERT (__text_l1_len <= L1_INST_SRAM_SIZE, "L1 text overflow!")
  122. .data_l1 :
  123. {
  124. . = ALIGN(4);
  125. __sdata_l1 = .;
  126. *(.l1.data)
  127. *(.l1.bss)
  128. . = ALIGN(4);
  129. __edata_l1 = .;
  130. } >l1_data AT>ram_data
  131. __data_l1_lma = LOADADDR(.data_l1);
  132. __data_l1_len = SIZEOF(.data_l1);
  133. ASSERT (__data_l1_len <= L1_DATA_B_SRAM_SIZE, "L1 data overflow!")
  134. .bss :
  135. {
  136. . = ALIGN(4);
  137. *(.sbss) *(.scommon)
  138. *(.dynbss)
  139. *(.bss .bss.*)
  140. *(COMMON)
  141. . = ALIGN(4);
  142. } >ram_data
  143. __bss_vma = ADDR(.bss);
  144. __bss_len = SIZEOF(.bss);
  145. }