patch-2_6_7-vs1_9_1_12
[linux-2.6.git] / arch / mips / Makefile
1 #
2 # This file is subject to the terms and conditions of the GNU General Public
3 # License.  See the file "COPYING" in the main directory of this archive
4 # for more details.
5 #
6 # Copyright (C) 1994, 95, 96, 2003 by Ralf Baechle
7 # DECStation modifications by Paul M. Antoine, 1996
8 # Copyright (C) 2002, 2003  Maciej W. Rozycki
9 #
10 # This file is included by the global makefile so that you can add your own
11 # architecture-specific flags and dependencies. Remember to do have actions
12 # for "archclean" cleaning up for this architecture.
13 #
14
15 #
16 # Select the object file format to substitute into the linker script.
17 #
18 ifdef CONFIG_CPU_LITTLE_ENDIAN
19 32bit-tool-prefix       = mipsel-linux-
20 64bit-tool-prefix       = mips64el-linux-
21 32bit-bfd               = elf32-tradlittlemips
22 64bit-bfd               = elf64-tradlittlemips
23 else
24 32bit-tool-prefix       = mips-linux-
25 64bit-tool-prefix       = mips64-linux-
26 32bit-bfd               = elf32-tradbigmips
27 64bit-bfd               = elf64-tradbigmips
28 endif
29
30 ifdef CONFIG_MIPS32
31 gcc-abi                 = 32
32 gas-abi                 = 32
33 tool-prefix             = $(32bit-tool-prefix)
34 UTS_MACHINE             := mips
35 endif
36 ifdef CONFIG_MIPS64
37 gcc-abi                 = 64
38 gas-abi                 = 32
39 tool-prefix             = $(64bit-tool-prefix)
40 UTS_MACHINE             := mips64
41 endif
42
43 ifdef CONFIG_CROSSCOMPILE
44 CROSS_COMPILE           := $(tool-prefix)
45 endif
46
47 #
48 # GCC uses -G 0 -mabicalls -fpic as default.  We don't want PIC in the kernel
49 # code since it only slows down the whole thing.  At some point we might make
50 # use of global pointer optimizations but their use of $28 conflicts with
51 # the current pointer optimization.
52 #
53 # The DECStation requires an ECOFF kernel for remote booting, other MIPS
54 # machines may also.  Since BFD is incredibly buggy with respect to
55 # crossformat linking we rely on the elf2ecoff tool for format conversion.
56 #
57 cflags-y                        := -I $(TOPDIR)/include/asm/gcc
58 cflags-y                        += -G 0 -mno-abicalls -fno-pic -pipe
59 cflags-y                        += $(call check_gcc, -finline-limit=100000,)
60 LDFLAGS_vmlinux                 += -G 0 -static -n
61 MODFLAGS                        += -mlong-calls
62
63 cflags-$(CONFIG_SB1XXX_CORELIS) += -mno-sched-prolog -fno-omit-frame-pointer
64
65 check_warning = $(shell if $(CC) $(1) -c -o /dev/null -xc /dev/null > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi)
66
67 #
68 # Use: $(call set_gccflags,<cpu0>,<isa0>,<cpu1>,<isa1>,<isa2>)
69 #
70 # <cpu0>,<isa0> -- preferred CPU and ISA designations (may require
71 #                  recent tools)
72 # <cpu1>,<isa1> -- fallback CPU and ISA designations (have to work
73 #                  with up to the oldest supported tools)
74 # <isa2>        -- an ISA designation used as an ABI selector for
75 #                  gcc versions that do not support "-mabi=32"
76 #                  (depending on the CPU type, either "mips1" or
77 #                  "mips2")
78 #
79 set_gccflags = $(shell \
80 while :; do \
81         cpu=$(1); isa=-$(2); \
82         for gcc_opt in -march= -mcpu=; do \
83                 $(CC) $$gcc_opt$$cpu $$isa -S -o /dev/null \
84                         -xc /dev/null > /dev/null 2>&1 && \
85                         break 2; \
86         done; \
87         cpu=$(3); isa=-$(4); \
88         for gcc_opt in -march= -mcpu=; do \
89                 $(CC) $$gcc_opt$$cpu $$isa -S -o /dev/null \
90                         -xc /dev/null > /dev/null 2>&1 && \
91                         break 2; \
92         done; \
93         break; \
94 done; \
95 gcc_abi=-mabi=$(gcc-abi); gcc_cpu=$$cpu; \
96 if $(CC) $$gcc_abi -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then \
97         gcc_isa=$$isa; \
98 else \
99         gcc_abi=; gcc_isa=-$(5); \
100 fi; \
101 gas_abi=-Wa,-$(gcc-abi); gas_cpu=$$cpu; gas_isa=-Wa,$$isa; \
102 while :; do \
103         for gas_opt in -Wa,-march= -Wa,-mcpu=; do \
104                 $(CC) $$gas_abi $$gas_opt$$cpu $$gas_isa -Wa,-Z -c \
105                         -o /dev/null -xassembler /dev/null > /dev/null 2>&1 && \
106                         break 2; \
107         done; \
108         gas_abi=; gas_opt=; gas_cpu=; gas_isa=; \
109         break; \
110 done; \
111 if test "$(gcc-abi)" != "$(gas-abi)"; then \
112         gas_abi="-Wa,-$(gas-abi) -Wa,-mgp$(gcc-abi)"; \
113 fi; \
114 if test "$$gcc_opt" = -march= && test -n "$$gcc_abi"; then \
115         $(CC) $$gcc_abi $$gcc_opt$$gcc_cpu -S -o /dev/null \
116                 -xc /dev/null > /dev/null 2>&1 && \
117                 gcc_isa=; \
118 fi; \
119 echo $$gcc_abi $$gcc_opt$$gcc_cpu $$gcc_isa $$gas_abi $$gas_opt$$gas_cpu $$gas_isa)
120
121 #
122 # CPU-dependent compiler/assembler options for optimization.
123 #
124 cflags-$(CONFIG_CPU_R3000)      += \
125                         $(call set_gccflags,r3000,mips1,r3000,mips1,mips1)
126
127 cflags-$(CONFIG_CPU_TX39XX)     += \
128                         $(call set_gccflags,r3900,mips1,r3000,mips1,mips1)
129
130 cflags-$(CONFIG_CPU_R6000)      += \
131                         $(call set_gccflags,r6000,mips2,r6000,mips2,mips2) \
132                         -Wa,--trap
133
134 cflags-$(CONFIG_CPU_R4300)      += \
135                         $(call set_gccflags,r4300,mips3,r4300,mips3,mips2) \
136                         -Wa,--trap
137
138 cflags-$(CONFIG_CPU_VR41XX)     += \
139                         $(call set_gccflags,r4100,mips3,r4600,mips3,mips2) \
140                         -Wa,--trap
141
142 cflags-$(CONFIG_CPU_R4X00)      += \
143                         $(call set_gccflags,r4600,mips3,r4600,mips3,mips2) \
144                         -Wa,--trap
145
146 cflags-$(CONFIG_CPU_MIPS32)     += \
147                         $(call set_gccflags,mips32,mips32,r4600,mips3,mips2) \
148                         -Wa,--trap
149
150 cflags-$(CONFIG_CPU_MIPS64)     += \
151                         $(call set_gccflags,mips64,mips64,r4600,mips3,mips2) \
152                         -Wa,--trap
153
154 cflags-$(CONFIG_CPU_R5000)      += \
155                         $(call set_gccflags,r5000,mips4,r5000,mips4,mips2) \
156                         -Wa,--trap 
157
158 cflags-$(CONFIG_CPU_R5432)      += \
159                         $(call set_gccflags,r5400,mips4,r5000,mips4,mips2) \
160                         -Wa,--trap
161
162 cflags-$(CONFIG_CPU_NEVADA)     += \
163                         $(call set_gccflags,rm5200,mips4,r5000,mips4,mips2) \
164                         -Wa,--trap
165 #                       $(call check_gcc,-mmad,)
166
167 cflags-$(CONFIG_CPU_RM7000)     += \
168                         $(call set_gccflags,rm7000,mips4,r5000,mips4,mips2) \
169                         -Wa,--trap
170
171 cflags-$(CONFIG_CPU_RM9000)     += \
172                         $(call set_gccflags,rm9000,mips4,r5000,mips4,mips2) \
173                         -Wa,--trap
174
175 cflags-$(CONFIG_CPU_SB1)        += \
176                         $(call set_gccflags,sb1,mips64,r5000,mips4,mips2) \
177                         -Wa,--trap
178
179 cflags-$(CONFIG_CPU_R8000)      += \
180                         $(call set_gccflags,r8000,mips4,r8000,mips4,mips2) \
181                         -Wa,--trap
182
183 cflags-$(CONFIG_CPU_R10000)     += \
184                         $(call set_gccflags,r10000,mips4,r8000,mips4,mips2) \
185                         -Wa,--trap
186
187 ifdef CONFIG_CPU_SB1
188 ifdef CONFIG_SB1_PASS_1_WORKAROUNDS
189 MODFLAGS        += -msb1-pass1-workarounds
190 endif
191 endif
192
193 #
194 # ramdisk/initrd support
195 # You need a compressed ramdisk image, named
196 # CONFIG_EMBEDDED_RAMDISK_IMAGE. Relative pathnames 
197 # are relative to arch/mips/ramdisk/.
198 #
199 core-$(CONFIG_EMBEDDED_RAMDISK) += arch/mips/ramdisk/
200
201 #
202 # Firmware support
203 #
204 libs-$(CONFIG_ARC)              += arch/mips/arc/
205 libs-$(CONFIG_SIBYTE_CFE)       += arch/mips/sibyte/cfe/
206
207 #
208 # Board-dependent options and extra files
209 #
210
211 #
212 # Acer PICA 61, Mips Magnum 4000 and Olivetti M700.
213 #
214 core-$(CONFIG_MACH_JAZZ)        += arch/mips/jazz/
215 cflags-$(CONFIG_MACH_JAZZ)      += -Iinclude/asm-mips/mach-jazz
216 load-$(CONFIG_MACH_JAZZ)        += 0x80080000
217
218 #
219 # Common Alchemy Au1x00 stuff
220 #
221 core-$(CONFIG_SOC_AU1X00)       += arch/mips/au1000/common/
222 cflags-$(CONFIG_SOC_AU1X00)     += -Iinclude/asm-mips/mach-au1x00
223
224 #
225 # AMD Alchemy Pb1000 eval board
226 #
227 libs-$(CONFIG_MIPS_PB1000)      += arch/mips/au1000/pb1000/
228 cflags-$(CONFIG_MIPS_PB1000)    += -Iinclude/asm-mips/mach-pb1x00
229 load-$(CONFIG_MIPS_PB1000)      += 0x80100000
230
231 #
232 # AMD Alchemy Pb1100 eval board
233 #
234 libs-$(CONFIG_MIPS_PB1100)      += arch/mips/au1000/pb1100/
235 cflags-$(CONFIG_MIPS_PB1100)    += -Iinclude/asm-mips/mach-pb1x00
236 load-$(CONFIG_MIPS_PB1100)      += 0x80100000
237
238 #
239 # AMD Alchemy Pb1500 eval board
240 #
241 libs-$(CONFIG_MIPS_PB1500)      += arch/mips/au1000/pb1500/
242 cflags-$(CONFIG_MIPS_PB1500)    += -Iinclude/asm-mips/mach-pb1x00
243 load-$(CONFIG_MIPS_PB1500)      += 0x80100000
244
245 #
246 # AMD Alchemy Pb1550 eval board
247 #
248 libs-$(CONFIG_MIPS_PB1550)      += arch/mips/au1000/pb1550/
249 cflags-$(CONFIG_MIPS_PB1550)    += -Iinclude/asm-mips/mach-pb1x00
250 load-$(CONFIG_MIPS_PB1550)      += 0x80100000
251
252 #
253 # AMD Alchemy Db1000 eval board
254 #
255 libs-$(CONFIG_MIPS_DB1000)      += arch/mips/au1000/db1x00/
256 cflags-$(CONFIG_MIPS_DB1000)    += -Iinclude/asm-mips/mach-db1x00
257 load-$(CONFIG_MIPS_DB1000)      += 0x80100000
258
259 #
260 # AMD Alchemy Db1100 eval board
261 #
262 libs-$(CONFIG_MIPS_DB1100)      += arch/mips/au1000/db1x00/
263 cflags-$(CONFIG_MIPS_DB1100)    += -Iinclude/asm-mips/mach-db1x00
264 load-$(CONFIG_MIPS_DB1100)      += 0x80100000
265
266 #
267 # AMD Alchemy Db1500 eval board
268 #
269 libs-$(CONFIG_MIPS_DB1500)      += arch/mips/au1000/db1x00/
270 cflags-$(CONFIG_MIPS_DB1500)    += -Iinclude/asm-mips/mach-db1x00
271 load-$(CONFIG_MIPS_DB1500)      += 0x80100000
272
273 #
274 # AMD Alchemy Bosporus eval board
275 #
276 libs-$(CONFIG_MIPS_BOSPORUS)    += arch/mips/au1000/db1x00/
277 cflags-$(CONFIG_MIPS_BOSPORUS)  += -Iinclude/asm-mips/mach-db1x00
278 load-$(CONFIG_MIPS_BOSPORUS)    += 0x80100000
279
280 #
281 # AMD Alchemy Mirage eval board
282 #
283 libs-$(CONFIG_MIPS_MIRAGE)      += arch/mips/au1000/db1x00/
284 cflags-$(CONFIG_MIPS_MIRAGE)    += -Iinclude/asm-mips/mach-db1x00
285 load-$(CONFIG_MIPS_MIRAGE)      += 0x80100000
286
287 #
288 # 4G-Systems eval board
289 #
290 libs-$(CONFIG_MIPS_MTX1)        += arch/mips/au1000/mtx-1/
291 load-$(CONFIG_MIPS_MTX1)        += 0x80100000
292
293 #
294 # MyCable eval board
295 #
296 libs-$(CONFIG_MIPS_XXS1500)     += arch/mips/au1000/xxs1500/
297 load-$(CONFIG_MIPS_XXS1500)     += 0x80100000
298
299 #
300 # Baget/MIPS
301 #
302 libs-$(CONFIG_BAGET_MIPS)       += arch/mips/baget/ arch/mips/baget/prom/
303 load-$(CONFIG_BAGET_MIPS)       += 0x80001000
304
305 #
306 # Cobalt Server
307 #
308 core-$(CONFIG_MIPS_COBALT)      += arch/mips/cobalt/
309 load-$(CONFIG_MIPS_COBALT)      += 0x80080000
310
311 #
312 # DECstation family
313 #
314 core-$(CONFIG_MACH_DECSTATION)  += arch/mips/dec/
315 cflags-$(CONFIG_MACH_DECSTATION)+= -Iinclude/asm-mips/mach-dec
316 libs-$(CONFIG_MACH_DECSTATION)  += arch/mips/dec/prom/
317 load-$(CONFIG_MACH_DECSTATION)  += 0x80040000
318 CLEAN_FILES                     += drivers/tc/lk201-map.c
319
320 #
321 # Galileo EV64120 Board
322 #
323 core-$(CONFIG_MIPS_EV64120)     += arch/mips/gt64120/ev64120/
324 core-$(CONFIG_MIPS_EV64120)     += arch/mips/gt64120/common/
325 cflags-$(CONFIG_MIPS_EV64120)   += -Iinclude/asm-mips/mach-ev64120
326 load-$(CONFIG_MIPS_EV64120)     += 0x80100000
327
328 #
329 # Galileo EV96100 Board
330 #
331 core-$(CONFIG_MIPS_EV96100)     += arch/mips/galileo-boards/ev96100/
332 cflags-$(CONFIG_MIPS_EV96100)   += -Iinclude/asm-mips/mach-ev96100
333 load-$(CONFIG_MIPS_EV96100)     += 0x80100000
334
335 #
336 # Globespan IVR eval board with QED 5231 CPU
337 #
338 core-$(CONFIG_ITE_BOARD_GEN)    += arch/mips/ite-boards/generic/
339 core-$(CONFIG_MIPS_IVR)         += arch/mips/ite-boards/ivr/
340 load-$(CONFIG_MIPS_IVR)         += 0x80100000
341
342 #
343 # HP LaserJet
344 #
345 core-$(CONFIG_HP_LASERJET)      += arch/mips/hp-lj/
346 load-$(CONFIG_HP_LASERJET)      += 0x80030000
347
348 #
349 # ITE 8172 eval board with QED 5231 CPU
350 #
351 core-$(CONFIG_MIPS_ITE8172)     += arch/mips/ite-boards/qed-4n-s01b/
352 load-$(CONFIG_MIPS_ITE8172)     += 0x80100000
353
354 #
355 # For all MIPS, Inc. eval boards
356 #
357 core-$(CONFIG_MIPS_BOARDS_GEN)  += arch/mips/mips-boards/generic/
358
359 #
360 # MIPS Atlas board
361 #
362 core-$(CONFIG_MIPS_ATLAS)       += arch/mips/mips-boards/atlas/
363 cflags-$(CONFIG_MIPS_ATLAS)     += -Iinclude/asm-mips/mach-atlas
364 cflags-$(CONFIG_MIPS_ATLAS)     += -Iinclude/asm-mips/mach-mips
365 load-$(CONFIG_MIPS_ATLAS)       += 0x80100000
366
367 #
368 # MIPS Malta board
369 #
370 core-$(CONFIG_MIPS_MALTA)       += arch/mips/mips-boards/malta/
371 cflags-$(CONFIG_MIPS_MALTA)     += -Iinclude/asm-mips/mach-mips
372 load-$(CONFIG_MIPS_MALTA)       += 0x80100000
373
374 #
375 # MIPS SEAD board
376 #
377 core-$(CONFIG_MIPS_SEAD)        += arch/mips/mips-boards/sead/
378 load-$(CONFIG_MIPS_SEAD)        += 0x80100000
379
380 #
381 # Momentum Ocelot board
382 #
383 # The Ocelot setup.o must be linked early - it does the ioremap() for the
384 # mips_io_port_base.
385 #
386 core-$(CONFIG_MOMENCO_OCELOT)   += arch/mips/gt64120/common/ \
387                                    arch/mips/gt64120/momenco_ocelot/
388 cflags-$(CONFIG_MOMENCO_OCELOT) += -Iinclude/asm-mips/mach-ocelot
389 load-$(CONFIG_MOMENCO_OCELOT)   += 0x80100000
390
391 #
392 # Momentum Ocelot-G board
393 #
394 # The Ocelot-G setup.o must be linked early - it does the ioremap() for the
395 # mips_io_port_base.
396 #
397 core-$(CONFIG_MOMENCO_OCELOT_G) += arch/mips/momentum/ocelot_g/
398 load-$(CONFIG_MOMENCO_OCELOT_G) += 0x80100000
399
400 #
401 # Momentum Ocelot-C and -CS boards
402 #
403 # The Ocelot-C[S] setup.o must be linked early - it does the ioremap() for the
404 # mips_io_port_base.
405 core-$(CONFIG_MOMENCO_OCELOT_C) += arch/mips/momentum/ocelot_c/
406 load-$(CONFIG_MOMENCO_OCELOT_C) += 0x80100000
407
408 #
409 # Momentum Jaguar ATX
410 #
411 core-$(CONFIG_MOMENCO_JAGUAR_ATX)       += arch/mips/momentum/jaguar_atx/
412 cflags-$(CONFIG_MOMENCO_JAGUAR_ATX)     += -Iinclude/asm-mips/mach-ja
413 #ifdef CONFIG_JAGUAR_DMALOW
414 #load-$(CONFIG_MOMENCO_JAGUAR_ATX)      += 0x88000000
415 #else
416 load-$(CONFIG_MOMENCO_JAGUAR_ATX)       += 0x80100000
417 #endif
418
419 #
420 # NEC DDB
421 #
422 core-$(CONFIG_DDB5XXX_COMMON)   += arch/mips/ddb5xxx/common/
423
424 #
425 # NEC DDB Vrc-5074
426 #
427 core-$(CONFIG_DDB5074)          += arch/mips/ddb5xxx/ddb5074/
428 load-$(CONFIG_DDB5074)          += 0x80080000
429
430 #
431 # NEC DDB Vrc-5476
432 #
433 core-$(CONFIG_DDB5476)          += arch/mips/ddb5xxx/ddb5476/
434 load-$(CONFIG_DDB5476)          += 0x80080000
435
436 #
437 # NEC DDB Vrc-5477
438 #
439 core-$(CONFIG_DDB5477)          += arch/mips/ddb5xxx/ddb5477/
440 load-$(CONFIG_DDB5477)          += 0x80100000
441
442 core-$(CONFIG_LASAT)            += arch/mips/lasat/
443 cflags-$(CONFIG_LASAT)          += -Iinclude/asm-mips/mach-lasat
444 load-$(CONFIG_LASAT)            += 0x80000000
445
446 #
447 # NEC Osprey (vr4181) board
448 #
449 core-$(CONFIG_NEC_OSPREY)       += arch/mips/vr4181/common/ \
450                                    arch/mips/vr4181/osprey/
451 load-$(CONFIG_NEC_OSPREY)       += 0x80002000
452
453 #
454 # Common VR41xx
455 #
456 core-$(CONFIG_MACH_VR41XX)      += arch/mips/vr41xx/common/
457 cflags-$(CONFIG_MACH_VR41XX)    += -Iinclude/asm-mips/mach-vr41xx
458
459 #
460 # NEC Eagle/Hawk (VR4122/VR4131) board
461 #
462 core-$(CONFIG_NEC_EAGLE)        += arch/mips/vr41xx/nec-eagle/
463 load-$(CONFIG_NEC_EAGLE)        += 0x80000000
464
465 #
466 # ZAO Networks Capcella (VR4131)
467 #
468 core-$(CONFIG_ZAO_CAPCELLA)     += arch/mips/vr41xx/zao-capcella/
469 load-$(CONFIG_ZAO_CAPCELLA)     += 0x80000000
470
471 #
472 # Victor MP-C303/304 (VR4122)
473 #
474 core-$(CONFIG_VICTOR_MPC30X)    += arch/mips/vr41xx/victor-mpc30x/
475 load-$(CONFIG_VICTOR_MPC30X)    += 0x80001000
476
477 #
478 # IBM WorkPad z50 (VR4121)
479 #
480 core-$(CONFIG_IBM_WORKPAD)      += arch/mips/vr41xx/ibm-workpad/
481 load-$(CONFIG_IBM_WORKPAD)      += 0x80004000
482
483 #
484 # CASIO CASSIPEIA E-55/65 (VR4111)
485 #
486 core-$(CONFIG_CASIO_E55)        += arch/mips/vr41xx/casio-e55/
487 load-$(CONFIG_CASIO_E55)        += 0x80004000
488
489 #
490 # TANBAC TB0226 Mbase (VR4131)
491 #
492 core-$(CONFIG_TANBAC_TB0226)    += arch/mips/vr41xx/tanbac-tb0226/
493 load-$(CONFIG_TANBAC_TB0226)    += 0x80000000
494
495 #
496 # TANBAC TB0229 VR4131DIMM (VR4131)
497 #
498 core-$(CONFIG_TANBAC_TB0229)    += arch/mips/vr41xx/tanbac-tb0229/
499 load-$(CONFIG_TANBAC_TB0229)    += 0x80000000
500
501 #
502 # SGI IP22 (Indy/Indigo2)
503 #
504 # Set the load address to >= 0x88069000 if you want to leave space for symmon,
505 # 0x80002000 for production kernels.  Note that the value must be aligned to
506 # a multiple of the kernel stack size or the handling of the current variable
507 # will break so for 64-bit kernels we have to raise the start address by 8kb.
508 #
509 core-$(CONFIG_SGI_IP22)         += arch/mips/sgi-ip22/
510 cflags-$(CONFIG_SGI_IP22)       += -Iinclude/asm-mips/mach-ip22
511 ifdef CONFIG_MIPS32
512 load-$(CONFIG_SGI_IP22)         += 0x88002000
513 endif
514 ifdef CONFIG_MIPS64
515 load-$(CONFIG_SGI_IP22)         += 0x88004000
516 endif
517
518 #
519 # SGI-IP27 (Origin200/2000)
520 #
521 # Set the load address to >= 0xc000000000300000 if you want to leave space for
522 # symmon, 0xc00000000001c000 for production kernels.  Note that the value
523 # must be 16kb aligned or the handling of the current variable will break.
524 #
525 ifdef CONFIG_SGI_IP27
526 core-$(CONFIG_SGI_IP27)         += arch/mips/sgi-ip27/
527 cflags-$(CONFIG_SGI_IP27)       += -Iinclude/asm-mips/mach-ip27
528 #load-$(CONFIG_SGI_IP27)        += 0xa80000000001c000
529 ifdef CONFIG_MAPPED_KERNEL
530 load-$(CONFIG_SGI_IP27)         += 0xc001c000
531 else
532 load-$(CONFIG_SGI_IP27)         += 0x8001c000
533 endif
534 endif
535
536 #
537 # SGI-IP32 (O2)
538 #
539 # Set the load address to >= 80069000 if you want to leave space for symmon,
540 # 0x80002000 for production kernels.  Note that the value must be aligned to
541 # a multiple of the kernel stack size or the handling of the current variable
542 # will break so for 64-bit kernels we have to raise the start address by 8kb.
543 #
544 core-$(CONFIG_SGI_IP32)         += arch/mips/sgi-ip32/
545 cflags-$(CONFIG_SGI_IP32)       += -Iinclude/asm-mips/mach-ip32
546 ifdef CONFIG_MIPS32
547 load-$(CONFIG_SGI_IP32)         += 0x80002000
548 endif
549 ifdef CONFIG_MIPS64
550 load-$(CONFIG_SGI_IP32)         += 0x80004000
551 endif
552
553 #
554 # Sibyte SB1250 SOC
555 #
556 # This is a LIB so that it links at the end, and initcalls are later
557 # the sequence; but it is built as an object so that modules don't get
558 # removed (as happens, even if they have __initcall/module_init)
559 #
560 core-$(CONFIG_SIBYTE_BCM112X)   += arch/mips/sibyte/sb1250/
561
562 core-$(CONFIG_SIBYTE_SB1250)    += arch/mips/sibyte/sb1250/
563
564 #
565 # Sibyte BCM91120x (Carmel) board
566 # Sibyte BCM91120C (CRhine) board
567 # Sibyte BCM91125C (CRhone) board
568 # Sibyte BCM91125E (Rhone) board
569 # Sibyte SWARM board
570 #
571 libs-$(CONFIG_SIBYTE_CARMEL)    += arch/mips/sibyte/swarm/
572 load-$(CONFIG_SIBYTE_CARMEL)    := 0x80100000
573 libs-$(CONFIG_SIBYTE_CRHINE)    += arch/mips/sibyte/swarm/
574 load-$(CONFIG_SIBYTE_CRHINE)    := 0x80100000
575 libs-$(CONFIG_SIBYTE_CRHONE)    += arch/mips/sibyte/swarm/
576 load-$(CONFIG_SIBYTE_CRHONE)    := 0x80100000
577 libs-$(CONFIG_SIBYTE_RHONE)     += arch/mips/sibyte/swarm/
578 load-$(CONFIG_SIBYTE_RHONE)     := 0x80100000
579 libs-$(CONFIG_SIBYTE_SENTOSA)   += arch/mips/sibyte/swarm/
580 load-$(CONFIG_SIBYTE_SENTOSA)   := 0x80100000
581 libs-$(CONFIG_SIBYTE_SWARM)     += arch/mips/sibyte/swarm/
582 load-$(CONFIG_SIBYTE_SWARM)     := 0x80100000
583
584 #
585 # SNI RM200 PCI
586 #
587 core-$(CONFIG_SNI_RM200_PCI)    += arch/mips/sni/
588 cflags-$(CONFIG_SNI_RM200_PCI)  += -Iinclude/asm-mips/mach-rm200
589 load-$(CONFIG_SNI_RM200_PCI)    += 0x80600000
590
591 #
592 # Toshiba JMR-TX3927 board
593 #
594 core-$(CONFIG_TOSHIBA_JMR3927)  += arch/mips/jmr3927/rbhma3100/ \
595                                    arch/mips/jmr3927/common/
596 load-$(CONFIG_TOSHIBA_JMR3927)  += 0x80050000
597
598 #
599 # Toshiba RBTX4927 board or
600 # Toshiba RBTX4937 board
601 #
602 core-$(CONFIG_TOSHIBA_RBTX4927) += arch/mips/tx4927/toshiba_rbtx4927/
603 core-$(CONFIG_TOSHIBA_RBTX4927) += arch/mips/tx4927/common/
604 load-$(CONFIG_TOSHIBA_RBTX4927) += 0x80020000
605
606 cflags-y                        += -Iinclude/asm-mips/mach-generic
607 drivers-$(CONFIG_PCI)           += arch/mips/pci/
608
609 ifdef CONFIG_MIPS32
610 build-bfd               = $(32bit-bfd)
611 cflags-y                += $(32bit-isa-y)
612 endif
613 ifdef CONFIG_MIPS64
614 build-bfd               = $(64bit-bfd)
615 cflags-y                += $(64bit-isa-y)
616 endif
617
618 ifdef CONFIG_MIPS32
619 ifdef CONFIG_CPU_LITTLE_ENDIAN
620 JIFFIES                 = jiffies_64
621 else
622 JIFFIES                 = jiffies_64 + 4
623 endif
624 else
625 JIFFIES                 = jiffies_64
626 endif
627
628 #
629 # Some machines like the Indy need 32-bit ELF binaries for booting purposes.
630 # Other need ECOFF, so we build a 32-bit ELF binary for them which we then
631 # convert to ECOFF using elf2ecoff.
632 #
633 # The 64-bit ELF tools are pretty broken so at this time we generate 64-bit
634 # ELF files from 32-bit files by conversion.
635 #
636 #AS += -64
637 #LDFLAGS += -m elf64bmip
638
639 #
640 # Choosing incompatible machines durings configuration will result in
641 # error messages during linking.  Select a default linkscript if
642 # none has been choosen above.
643 #
644
645 AFLAGS_vmlinux.lds.o := \
646         -D"LOADADDR=$(load-y)" \
647         -D"JIFFIES=$(JIFFIES)" \
648         -imacros $(srctree)/include/asm-$(ARCH)/sn/mapped_kernel.h
649
650 AFLAGS          += $(cflags-y)
651 CFLAGS          += $(cflags-y)
652
653 LDFLAGS                 += --oformat $(32bit-bfd)
654
655 head-y := arch/mips/kernel/head.o arch/mips/kernel/init_task.o
656
657 libs-y                  += arch/mips/lib/
658 libs-$(CONFIG_MIPS32)   += arch/mips/lib-32/
659 libs-$(CONFIG_MIPS64)   += arch/mips/lib-64/
660
661 core-y                  += arch/mips/kernel/ arch/mips/mm/ arch/mips/math-emu/
662 core-$(CONFIG_MIPS32)   += arch/mips/mm-32/
663 core-$(CONFIG_MIPS64)   += arch/mips/mm-64/
664
665 ifdef CONFIG_BAGET_MIPS
666
667 BAGETBOOT = $(MAKE) -C arch/$(ARCH)/baget
668
669 balo: vmlinux
670         $(BAGETBOOT) balo
671
672 endif
673
674 ifdef CONFIG_LASAT
675 rom.bin rom.sw: vmlinux
676         $(call descend,arch/mips/lasat/image,$@)
677 endif
678
679 ifdef CONFIG_MAPPED_KERNEL
680 vmlinux.64: vmlinux
681         $(OBJCOPY) -O $(64bit-bfd) --remove-section=.reginfo \
682                 --change-addresses=0xc000000080000000 $< $@
683 else
684 vmlinux.64: vmlinux
685         $(OBJCOPY) -O $(64bit-bfd) --remove-section=.reginfo \
686                 --change-addresses=0xa800000080000000 $< $@
687 endif
688
689 makeboot =$(Q)$(MAKE) $(build)=arch/mips/boot $(1)
690
691 ifdef CONFIG_SGI_IP27
692 all:    vmlinux.64
693 endif
694
695 ifdef CONFIG_SNI_RM200_PCI
696 all:    vmlinux.ecoff
697 endif
698
699 vmlinux.ecoff vmlinux.rm200: vmlinux
700         +@$(call makeboot,$@)
701
702 vmlinux.srec: vmlinux
703         +@$(call makeboot,$@)
704
705 CLEAN_FILES += vmlinux.ecoff \
706                vmlinux.srec \
707                vmlinux.rm200.tmp \
708                vmlinux.rm200
709
710 archclean:
711         @$(MAKE) $(clean)=arch/mips/boot
712         @$(MAKE) $(clean)=arch/mips/baget
713         @$(MAKE) $(clean)=arch/mips/lasat
714
715 # Generate <asm/offset.h 
716 #
717 # The default rule is suffering from funny problems on MIPS so we using our
718 # own ...
719 #
720 # ---------------------------------------------------------------------------
721
722 define filechk_gen-asm-offset.h
723         (set -e; \
724          echo "#ifndef _ASM_OFFSET_H"; \
725          echo "#define _ASM_OFFSET_H"; \
726          echo "/*"; \
727          echo " * DO NOT MODIFY."; \
728          echo " *"; \
729          echo " * This file was generated by arch/$(ARCH)/Makefile"; \
730          echo " *"; \
731          echo " */"; \
732          echo ""; \
733          sed -ne "/^@@@/s///p"; \
734          echo "#endif /* _ASM_OFFSET_H */" )
735 endef
736
737 define filechk_gen-asm-reg.h
738         (set -e; \
739          echo "#ifndef _ASM_REG_H"; \
740          echo "#define _ASM_REG_H"; \
741          echo "/*"; \
742          echo " * DO NOT MODIFY."; \
743          echo " *"; \
744          echo " * This file was generated by arch/$(ARCH)/Makefile"; \
745          echo " *"; \
746          echo " */"; \
747          echo ""; \
748          sed -ne "/^@@@/s///p"; \
749          echo "#endif /* _ASM_REG_H */" )
750 endef
751
752 prepare: include/asm-$(ARCH)/offset.h \
753          include/asm-$(ARCH)/reg.h
754
755 arch/$(ARCH)/kernel/offset.s: include/asm include/linux/version.h \
756                                    include/config/MARKER
757
758 include/asm-$(ARCH)/offset.h: arch/$(ARCH)/kernel/offset.s
759         $(call filechk,gen-asm-offset.h)
760 include/asm-$(ARCH)/reg.h: arch/$(ARCH)/kernel/reg.s
761         $(call filechk,gen-asm-reg.h)
762
763 CLEAN_FILES += include/asm-$(ARCH)/offset.h.tmp \
764                include/asm-$(ARCH)/offset.h \
765                include/asm-$(ARCH)/reg.h.tmp \
766                include/asm-$(ARCH)/reg.h \
767                vmlinux.64 \
768                vmlinux.ecoff