u-boot.lds.S 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  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. /* If we don't actually load anything into L1 data, this will avoid
  33. * a syntax error. If we do actually load something into L1 data,
  34. * we'll get a linker memory load error (which is what we'd want).
  35. * This is here in the first place so we can quickly test building
  36. * for different CPU's which may lack non-cache L1 data.
  37. */
  38. #ifndef L1_DATA_B_SRAM
  39. # define L1_DATA_B_SRAM CONFIG_SYS_MONITOR_BASE
  40. # define L1_DATA_B_SRAM_SIZE 0
  41. #endif
  42. /* The 0xC offset is so we don't clobber the tiny LDR jump block. */
  43. #ifdef CONFIG_BFIN_BOOTROM_USES_EVT1
  44. # define L1_CODE_ORIGIN L1_INST_SRAM
  45. #else
  46. # define L1_CODE_ORIGIN L1_INST_SRAM + 0xC
  47. #endif
  48. OUTPUT_ARCH(bfin)
  49. MEMORY
  50. {
  51. ram : ORIGIN = CONFIG_SYS_MONITOR_BASE, LENGTH = CONFIG_SYS_MONITOR_LEN
  52. l1_code : ORIGIN = L1_CODE_ORIGIN, LENGTH = L1_INST_SRAM_SIZE
  53. l1_data : ORIGIN = L1_DATA_B_SRAM, LENGTH = L1_DATA_B_SRAM_SIZE
  54. }
  55. ENTRY(_start)
  56. SECTIONS
  57. {
  58. .text :
  59. {
  60. cpu/blackfin/start.o (.text .text.*)
  61. #ifdef ENV_IS_EMBEDDED
  62. /* WARNING - the following is hand-optimized to fit within
  63. * the sector before the environment sector. If it throws
  64. * an error during compilation remove an object here to get
  65. * it linked after the configuration sector.
  66. */
  67. cpu/blackfin/traps.o (.text .text.*)
  68. cpu/blackfin/interrupt.o (.text .text.*)
  69. cpu/blackfin/serial.o (.text .text.*)
  70. common/dlmalloc.o (.text .text.*)
  71. lib_generic/crc32.o (.text .text.*)
  72. lib_generic/zlib.o (.text .text.*)
  73. board/ibf-dsp561/ibf-dsp561.o (.text .text.*)
  74. . = DEFINED(env_offset) ? env_offset : .;
  75. common/env_embedded.o (.text .text.*)
  76. #endif
  77. __initcode_start = .;
  78. cpu/blackfin/initcode.o (.text .text.*)
  79. __initcode_end = .;
  80. *(.text .text.*)
  81. } >ram
  82. .rodata :
  83. {
  84. . = ALIGN(4);
  85. *(.rodata .rodata.*)
  86. *(.rodata1)
  87. *(.eh_frame)
  88. . = ALIGN(4);
  89. } >ram
  90. .data :
  91. {
  92. . = ALIGN(256);
  93. *(.data .data.*)
  94. *(.data1)
  95. *(.sdata)
  96. *(.sdata2)
  97. *(.dynamic)
  98. CONSTRUCTORS
  99. } >ram
  100. .u_boot_cmd :
  101. {
  102. ___u_boot_cmd_start = .;
  103. *(.u_boot_cmd)
  104. ___u_boot_cmd_end = .;
  105. } >ram
  106. .text_l1 :
  107. {
  108. . = ALIGN(4);
  109. __stext_l1 = .;
  110. *(.l1.text)
  111. . = ALIGN(4);
  112. __etext_l1 = .;
  113. } >l1_code AT>ram
  114. __stext_l1_lma = LOADADDR(.text_l1);
  115. .data_l1 :
  116. {
  117. . = ALIGN(4);
  118. __sdata_l1 = .;
  119. *(.l1.data)
  120. *(.l1.bss)
  121. . = ALIGN(4);
  122. __edata_l1 = .;
  123. } >l1_data AT>ram
  124. __sdata_l1_lma = LOADADDR(.data_l1);
  125. .bss :
  126. {
  127. . = ALIGN(4);
  128. __bss_start = .;
  129. *(.sbss) *(.scommon)
  130. *(.dynbss)
  131. *(.bss .bss.*)
  132. *(COMMON)
  133. __bss_end = .;
  134. } >ram
  135. }