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