blob: 4755153fcf97a9b6a9b74abd37b979d9e83d2923 [file] [log] [blame]
Mike Frysinger4752c192008-10-12 21:32:52 -04001/*
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
28#include <config.h>
29#include <asm/blackfin.h>
30#undef ALIGN
31#undef ENTRY
32#undef bfin
33
Mike Frysinger37f48702009-06-14 06:29:07 -040034#ifndef LDS_BOARD_TEXT
35# define LDS_BOARD_TEXT
36#endif
37
Mike Frysinger4752c192008-10-12 21:32:52 -040038/* If we don't actually load anything into L1 data, this will avoid
39 * a syntax error. If we do actually load something into L1 data,
40 * we'll get a linker memory load error (which is what we'd want).
41 * This is here in the first place so we can quickly test building
42 * for different CPU's which may lack non-cache L1 data.
43 */
44#ifndef L1_DATA_B_SRAM
45# define L1_DATA_B_SRAM CONFIG_SYS_MONITOR_BASE
46# define L1_DATA_B_SRAM_SIZE 0
47#endif
48
49OUTPUT_ARCH(bfin)
50
51MEMORY
52{
53 ram : ORIGIN = CONFIG_SYS_MONITOR_BASE, LENGTH = CONFIG_SYS_MONITOR_LEN
54 l1_code : ORIGIN = L1_INST_SRAM, LENGTH = L1_INST_SRAM_SIZE
55 l1_data : ORIGIN = L1_DATA_B_SRAM, LENGTH = L1_DATA_B_SRAM_SIZE
56}
57
58ENTRY(_start)
59SECTIONS
60{
61 .text :
62 {
63 cpu/blackfin/start.o (.text .text.*)
Mike Frysinger37f48702009-06-14 06:29:07 -040064
65 LDS_BOARD_TEXT
66
Mike Frysinger4752c192008-10-12 21:32:52 -040067 __initcode_start = .;
68 cpu/blackfin/initcode.o (.text .text.*)
69 __initcode_end = .;
Mike Frysinger37f48702009-06-14 06:29:07 -040070
Mike Frysinger4752c192008-10-12 21:32:52 -040071 *(.text .text.*)
72 } >ram
73
74 .rodata :
75 {
76 . = ALIGN(4);
77 *(.rodata .rodata.*)
78 *(.rodata1)
79 *(.eh_frame)
80 . = ALIGN(4);
81 } >ram
82
83 .data :
84 {
85 . = ALIGN(256);
86 *(.data .data.*)
87 *(.data1)
88 *(.sdata)
89 *(.sdata2)
90 *(.dynamic)
91 CONSTRUCTORS
92 } >ram
93
94 .u_boot_cmd :
95 {
96 ___u_boot_cmd_start = .;
97 *(.u_boot_cmd)
98 ___u_boot_cmd_end = .;
99 } >ram
100
101 .text_l1 :
102 {
103 . = ALIGN(4);
104 __stext_l1 = .;
105 *(.l1.text)
106 . = ALIGN(4);
107 __etext_l1 = .;
108 } >l1_code AT>ram
109 __stext_l1_lma = LOADADDR(.text_l1);
110
111 .data_l1 :
112 {
113 . = ALIGN(4);
114 __sdata_l1 = .;
115 *(.l1.data)
116 *(.l1.bss)
117 . = ALIGN(4);
118 __edata_l1 = .;
119 } >l1_data AT>ram
120 __sdata_l1_lma = LOADADDR(.data_l1);
121
122 .bss :
123 {
124 . = ALIGN(4);
125 __bss_start = .;
126 *(.sbss) *(.scommon)
127 *(.dynbss)
128 *(.bss .bss.*)
129 *(COMMON)
130 __bss_end = .;
131 } >ram
132}