Fix IP22 timer calibration.
[linux-2.6/linux-mips.git] / arch / v850 / vmlinux.lds.S
blob7391ab36f1a9ac3de5dbdc957faa3c9ef260a1a9
1 /*
2  * arch/v850/vmlinux.lds.S -- kernel linker script for v850 platforms
3  *
4  *  Copyright (C) 2002,03  NEC Electronics Corporation
5  *  Copyright (C) 2002,03  Miles Bader <miles@gnu.org>
6  *
7  * This file is subject to the terms and conditions of the GNU General
8  * Public License.  See the file COPYING in the main directory of this
9  * archive for more details.
10  *
11  * Written by Miles Bader <miles@gnu.org>
12  */
14 #include <linux/config.h>
15 #include <asm-generic/vmlinux.lds.h>
18 /* The following macros contain the usual definitions for various data areas.
19    The prefix `RAMK_' is used to indicate macros suitable for kernels loaded
20    into RAM, and similarly `ROMK_' for ROM-resident kernels.  Note that all
21    symbols are prefixed with an extra `_' for compatibility with the v850
22    toolchain.  */
24         
25 /* Interrupt vectors.  */
26 #define INTV_CONTENTS                                                         \
27                 . = ALIGN (0x10) ;                                            \
28                 __intv_start = . ;                                            \
29                         *(.intv.reset)  /* Reset vector */                    \
30                 . = __intv_start + 0x10 ;                                     \
31                         *(.intv.common) /* Vectors common to all v850e proc */\
32                 . = __intv_start + 0x80 ;                                     \
33                         *(.intv.mach)   /* Machine-specific int. vectors.  */ \
34                 __intv_end = . ;
36 /* Kernel text segment, and some constant data areas.  */
37 #define TEXT_CONTENTS                                                         \
38                 __stext = . ;                                                 \
39                 *(.text)                                                      \
40                         *(.exit.text)   /* 2.5 convention */                  \
41                         *(.text.exit)   /* 2.4 convention */                  \
42                         *(.text.lock)                                         \
43                         *(.exitcall.exit)                                     \
44                 __real_etext = . ;      /* There may be data after here.  */  \
45                 RODATA                                                        \
46                 . = ALIGN (4) ;                                               \
47                         *(.call_table_data)                                   \
48                         *(.call_table_text)                                   \
49                 . = ALIGN (16) ;        /* Exception table.  */               \
50                 ___start___ex_table = . ;                                     \
51                         *(__ex_table)                                         \
52                 ___stop___ex_table = . ;                                      \
53                 . = ALIGN (4) ;                                               \
54                 __etext = . ;
56 /* Kernel data segment.  */
57 #define DATA_CONTENTS                                                         \
58                 __sdata = . ;                                                 \
59                 *(.data)                                                      \
60                         *(.exit.data)   /* 2.5 convention */                  \
61                         *(.data.exit)   /* 2.4 convention */                  \
62                 . = ALIGN (16) ;                                              \
63                 *(.data.cacheline_aligned)                                    \
64                 . = ALIGN (0x2000) ;                                          \
65                 *(.data.init_task)                                            \
66                 . = ALIGN (0x2000) ;                                          \
67                 __edata = . ;
69 /* Kernel BSS segment.  */
70 #define BSS_CONTENTS                                                          \
71                 __sbss = . ;                                                  \
72                         *(.bss)                                               \
73                         *(COMMON)                                             \
74                 . = ALIGN (4) ;                                               \
75                 __init_stack_end = . ;                                        \
76                 __ebss = . ;
78 /* `initcall' tables.  */
79 #define INITCALL_CONTENTS                                                     \
80                 . = ALIGN (16) ;                                              \
81                 ___setup_start = . ;                                          \
82                         *(.init.setup)  /* 2.5 convention */                  \
83                         *(.setup.init)  /* 2.4 convention */                  \
84                 ___setup_end = . ;                                            \
85                 ___start___param = . ;                                        \
86                         *(__param)                                            \
87                 ___stop___param = . ;                                         \
88                 ___initcall_start = . ;                                       \
89                         *(.initcall.init)                                     \
90                         *(.initcall1.init)                                    \
91                         *(.initcall2.init)                                    \
92                         *(.initcall3.init)                                    \
93                         *(.initcall4.init)                                    \
94                         *(.initcall5.init)                                    \
95                         *(.initcall6.init)                                    \
96                         *(.initcall7.init)                                    \
97                 . = ALIGN (4) ;                                               \
98                 ___initcall_end = . ;                                         \
99                 ___con_initcall_start = .;                                    \
100                         *(.con_initcall.init)                                 \
101                 ___con_initcall_end = .;
103 /* Contents of `init' section for a kernel that's loaded into RAM.  */
104 #define RAMK_INIT_CONTENTS                                                    \
105                 RAMK_INIT_CONTENTS_NO_END                                     \
106                 __init_end = . ;
107 /* Same as RAMK_INIT_CONTENTS, but doesn't define the `__init_end' symbol.  */
108 #define RAMK_INIT_CONTENTS_NO_END                                             \
109                 . = ALIGN (4096) ;                                            \
110                 __init_start = . ;                                            \
111                         __sinittext = .;                                      \
112                         *(.init.text)   /* 2.5 convention */                  \
113                         __einittext = .;                                      \
114                         *(.init.data)                                         \
115                         *(.text.init)   /* 2.4 convention */                  \
116                         *(.data.init)                                         \
117                 INITCALL_CONTENTS                                             \
118                 INITRAMFS_CONTENTS
120 /* The contents of `init' section for a ROM-resident kernel which
121    should go into RAM.  */      
122 #define ROMK_INIT_RAM_CONTENTS                                                \
123                 . = ALIGN (4096) ;                                            \
124                 __init_start = . ;                                            \
125                         *(.init.data)   /* 2.5 convention */                  \
126                         *(.data.init)   /* 2.4 convention */                  \
127                 __init_end = . ;                                              \
128                 . = ALIGN (4096) ;
130 /* The contents of `init' section for a ROM-resident kernel which
131    should go into ROM.  */      
132 #define ROMK_INIT_ROM_CONTENTS                                                \
133                         _sinittext = .;                                       \
134                         *(.init.text)   /* 2.5 convention */                  \
135                         _einittext = .;                                       \
136                         *(.text.init)   /* 2.4 convention */                  \
137                 INITCALL_CONTENTS                                             \
138                 INITRAMFS_CONTENTS
140 /* A root filesystem image, for kernels with an embedded root filesystem.  */
141 #define ROOT_FS_CONTENTS                                                      \
142                 __root_fs_image_start = . ;                                   \
143                 *(.root)                                                      \
144                 __root_fs_image_end = . ;
145 /* The initramfs archive.  */
146 #define INITRAMFS_CONTENTS                                                    \
147                 . = ALIGN (4) ;                                               \
148                 ___initramfs_start = . ;                                      \
149                         *(.init.ramfs)                                        \
150                 ___initramfs_end = . ;
151 /* Where the initial bootmap (bitmap for the boot-time memory allocator) 
152    should be place.  */
153 #define BOOTMAP_CONTENTS                                                      \
154                 . = ALIGN (4096) ;                                            \
155                 __bootmap = . ;                                               \
156                 . = . + 4096 ;          /* enough for 128MB.   */
158 /* The contents of a `typical' kram area for a kernel in RAM.  */
159 #define RAMK_KRAM_CONTENTS                                                    \
160                 __kram_start = . ;                                            \
161                 TEXT_CONTENTS                                                 \
162                 DATA_CONTENTS                                                 \
163                 BSS_CONTENTS                                                  \
164                 RAMK_INIT_CONTENTS                                            \
165                 __kram_end = . ;                                              \
166                 BOOTMAP_CONTENTS
169 /* Define output sections normally used for a ROM-resident kernel.  
170    ROM and RAM should be appropriate memory areas to use for kernel
171    ROM and RAM data.  This assumes that ROM starts at 0 (and thus can
172    hold the interrupt vectors).  */
173 #define ROMK_SECTIONS(ROM, RAM)                                               \
174         .rom : {                                                              \
175                 INTV_CONTENTS                                                 \
176                 TEXT_CONTENTS                                                 \
177                 ROMK_INIT_ROM_CONTENTS                                        \
178                 ROOT_FS_CONTENTS                                              \
179         } > ROM                                                               \
180                                                                               \
181         __rom_copy_src_start = . ;                                            \
182                                                                               \
183         .data : {                                                             \
184                 __kram_start = . ;                                            \
185                 __rom_copy_dst_start = . ;                                    \
186                 DATA_CONTENTS                                                 \
187                 ROMK_INIT_RAM_CONTENTS                                        \
188                 __rom_copy_dst_end = . ;                                      \
189         } > RAM  AT> ROM                                                      \
190                                                                               \
191         .bss ALIGN (4) : {                                                    \
192                 BSS_CONTENTS                                                  \
193                 __kram_end = . ;                                              \
194                 BOOTMAP_CONTENTS                                              \
195         } > RAM
198 /* The 32-bit variable `jiffies' is just the lower 32-bits of `jiffies_64'.  */
199 _jiffies = _jiffies_64 ;
202 /* Include an appropriate platform-dependent linker-script (which
203    usually should use the above macros to do most of the work).  */
205 #ifdef CONFIG_V850E_SIM
206 # include "sim.ld"
207 #endif
209 #ifdef CONFIG_V850E2_SIM85E2C
210 # include "sim85e2c.ld"
211 #endif
213 #ifdef CONFIG_V850E2_FPGA85E2C
214 # include "fpga85e2c.ld"
215 #endif
217 #ifdef CONFIG_V850E2_ANNA
218 # ifdef CONFIG_ROM_KERNEL
219 #  include "anna-rom.ld"
220 # else
221 #  include "anna.ld"
222 # endif
223 #endif
225 #ifdef CONFIG_V850E_AS85EP1
226 # ifdef CONFIG_ROM_KERNEL
227 #  include "as85ep1-rom.ld"
228 # else
229 #  include "as85ep1.ld"
230 # endif
231 #endif
233 #ifdef CONFIG_RTE_CB_MA1
234 # ifdef CONFIG_ROM_KERNEL
235 #  include "rte_ma1_cb-rom.ld"
236 # else
237 #  include "rte_ma1_cb.ld"
238 # endif
239 #endif
241 #ifdef CONFIG_RTE_CB_NB85E
242 # ifdef CONFIG_ROM_KERNEL
243 #  include "rte_nb85e_cb-rom.ld"
244 # elif defined(CONFIG_RTE_CB_MULTI)
245 #  include "rte_nb85e_cb-multi.ld"
246 # else
247 #  include "rte_nb85e_cb.ld"
248 # endif
249 #endif