u-boot.lds.S 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. /*
  2. * U-boot - u-boot.lds.S
  3. *
  4. * Copyright (c) 2005-2008 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. #undef bfin
  32. #ifndef LDS_BOARD_TEXT
  33. # define LDS_BOARD_TEXT
  34. #endif
  35. /* If we don't actually load anything into L1 data, this will avoid
  36. * a syntax error. If we do actually load something into L1 data,
  37. * we'll get a linker memory load error (which is what we'd want).
  38. * This is here in the first place so we can quickly test building
  39. * for different CPU's which may lack non-cache L1 data.
  40. */
  41. #ifndef L1_DATA_B_SRAM
  42. # define L1_DATA_B_SRAM CONFIG_SYS_MONITOR_BASE
  43. # define L1_DATA_B_SRAM_SIZE 0
  44. #endif
  45. /* The 0xC offset is so we don't clobber the tiny LDR jump block. */
  46. #ifdef CONFIG_BFIN_BOOTROM_USES_EVT1
  47. # define L1_CODE_ORIGIN L1_INST_SRAM
  48. #else
  49. # define L1_CODE_ORIGIN L1_INST_SRAM + 0xC
  50. #endif
  51. OUTPUT_ARCH(bfin)
  52. MEMORY
  53. {
  54. #if CONFIG_MEM_SIZE
  55. ram : ORIGIN = CONFIG_SYS_MONITOR_BASE, LENGTH = CONFIG_SYS_MONITOR_LEN
  56. # define ram_code ram
  57. # define ram_data ram
  58. #else
  59. # define ram_code l1_code
  60. # define ram_data l1_data
  61. #endif
  62. l1_code : ORIGIN = L1_CODE_ORIGIN, LENGTH = L1_INST_SRAM_SIZE
  63. l1_data : ORIGIN = L1_DATA_B_SRAM, LENGTH = L1_DATA_B_SRAM_SIZE
  64. }
  65. ENTRY(_start)
  66. SECTIONS
  67. {
  68. .text.pre :
  69. {
  70. cpu/blackfin/start.o (.text .text.*)
  71. LDS_BOARD_TEXT
  72. } >ram_code
  73. .text.init :
  74. {
  75. cpu/blackfin/initcode.o (.text .text.*)
  76. } >ram_code
  77. __initcode_lma = LOADADDR(.text.init);
  78. __initcode_len = SIZEOF(.text.init);
  79. .text :
  80. {
  81. *(.text .text.*)
  82. } >ram_code
  83. .rodata :
  84. {
  85. . = ALIGN(4);
  86. *(.rodata .rodata.*)
  87. *(.rodata1)
  88. *(.eh_frame)
  89. . = ALIGN(4);
  90. } >ram_data
  91. .data :
  92. {
  93. . = ALIGN(256);
  94. *(.data .data.*)
  95. *(.data1)
  96. *(.sdata)
  97. *(.sdata2)
  98. *(.dynamic)
  99. CONSTRUCTORS
  100. } >ram_data
  101. .u_boot_cmd :
  102. {
  103. ___u_boot_cmd_start = .;
  104. *(.u_boot_cmd)
  105. ___u_boot_cmd_end = .;
  106. } >ram_data
  107. .text_l1 :
  108. {
  109. . = ALIGN(4);
  110. __stext_l1 = .;
  111. *(.l1.text)
  112. . = ALIGN(4);
  113. __etext_l1 = .;
  114. } >l1_code AT>ram_code
  115. __text_l1_lma = LOADADDR(.text_l1);
  116. __text_l1_len = SIZEOF(.text_l1);
  117. ASSERT (__text_l1_len <= L1_INST_SRAM_SIZE, "L1 text overflow!")
  118. .data_l1 :
  119. {
  120. . = ALIGN(4);
  121. __sdata_l1 = .;
  122. *(.l1.data)
  123. *(.l1.bss)
  124. . = ALIGN(4);
  125. __edata_l1 = .;
  126. } >l1_data AT>ram_data
  127. __data_l1_lma = LOADADDR(.data_l1);
  128. __data_l1_len = SIZEOF(.data_l1);
  129. ASSERT (__data_l1_len <= L1_DATA_B_SRAM_SIZE, "L1 data B overflow!")
  130. .bss :
  131. {
  132. . = ALIGN(4);
  133. *(.sbss) *(.scommon)
  134. *(.dynbss)
  135. *(.bss .bss.*)
  136. *(COMMON)
  137. } >ram_data
  138. __bss_vma = ADDR(.bss);
  139. __bss_len = SIZEOF(.bss);
  140. }