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
6 # Copyright (C) 1994, 1995, 1996 by Ralf Baechle
7 # DECStation modifications by Paul M. Antoine, 1996
8 # Copyright (C) 2002 Maciej W. Rozycki
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" and "archdep" for cleaning up and making dependencies for
17 # Select the object file format to substitute into the linker script.
19 ifdef CONFIG_CPU_LITTLE_ENDIAN
20 tool-prefix = mipsel-linux-
22 tool-prefix = mips-linux-
25 ifdef CONFIG_CROSSCOMPILE
26 CROSS_COMPILE = $(tool-prefix)
30 # GCC uses -G 0 -mabicalls -fpic as default. We don't want PIC in the kernel
31 # code since it only slows down the whole thing. At some point we might make
32 # use of global pointer optimizations but their use of $28 conflicts with
33 # the current pointer optimization.
35 # The DECStation requires an ECOFF kernel for remote booting, other MIPS
36 # machines may also. Since BFD is incredibly buggy with respect to
37 # crossformat linking we rely on the elf2ecoff tool for format conversion.
39 GCCFLAGS := -I $(TOPDIR)/include/asm/gcc
40 GCCFLAGS += -G 0 -mno-abicalls -fno-pic -pipe
41 LINKFLAGS += -G 0 -static # -N
42 MODFLAGS += -mlong-calls
44 ifdef CONFIG_REMOTE_DEBUG
49 # CPU-dependent compiler/assembler options for optimization.
51 ifdef CONFIG_CPU_R3000
52 GCCFLAGS += -mcpu=r3000 -mips1
54 ifdef CONFIG_CPU_TX39XX
55 GCCFLAGS += -mcpu=r3000 -mips1
57 ifdef CONFIG_CPU_R6000
58 GCCFLAGS += -mcpu=r6000 -mips2 -Wa,--trap
60 ifdef CONFIG_CPU_R4300
61 GCCFLAGS += -mcpu=r4300 -mips2 -Wa,--trap
63 ifdef CONFIG_CPU_VR41XX
64 GCCFLAGS += -mcpu=r4600 -mips2 -Wa,--trap
66 ifdef CONFIG_CPU_R4X00
67 GCCFLAGS += -mcpu=r4600 -mips2 -Wa,--trap
69 ifdef CONFIG_CPU_TX49XX
70 GCCFLAGS += -mcpu=r4600 -mips2 -Wa,--trap
72 ifdef CONFIG_CPU_MIPS32
73 GCCFLAGS += -mcpu=r4600 -mips2 -Wa,--trap
75 ifdef CONFIG_CPU_MIPS64
76 GCCFLAGS += -mcpu=r4600 -mips2 -Wa,--trap
78 ifdef CONFIG_CPU_R5000
79 GCCFLAGS += -mcpu=r5000 -mips2 -Wa,--trap
81 ifdef CONFIG_CPU_R5432
82 GCCFLAGS += -mcpu=r5000 -mips2 -Wa,--trap
84 ifdef CONFIG_CPU_NEVADA
85 # Cannot use -mmad with currently recommended tools
86 GCCFLAGS += -mcpu=r5000 -mips2 -Wa,--trap
88 ifdef CONFIG_CPU_RM7000
89 GCCFLAGS += -mcpu=r5000 -mips2 -Wa,--trap
92 GCCFLAGS += -mcpu=sb1 -mips2 -Wa,--trap
93 ifdef CONFIG_SB1_PASS_1_WORKAROUNDS
94 MODFLAGS += -msb1-pass1-workarounds
103 # We unconditionally build the math emulator
105 CORE_FILES += arch/mips/math-emu/fpu_emulator.o
106 SUBDIRS += arch/mips/math-emu
109 # ramdisk/initrd support
110 # You need a compressed ramdisk image, named ramdisk.gz in
113 ifdef CONFIG_EMBEDDED_RAMDISK
114 CORE_FILES += arch/mips/ramdisk/ramdisk.o
115 SUBDIRS += arch/mips/ramdisk
120 # Board-dependent options and extra files
124 # Acer PICA 61, Mips Magnum 4000 and Olivetti M700.
126 ifdef CONFIG_MIPS_JAZZ
127 CORE_FILES += arch/mips/jazz/jazz.o
128 SUBDIRS += arch/mips/jazz arch/mips/arc
129 LIBS += arch/mips/arc/arclib.a
130 LOADADDR := 0x80080000
134 # Au1000 (Alchemy Semi PB1000) eval board
136 ifdef CONFIG_MIPS_PB1000
137 LIBS += arch/mips/au1000/pb1000/pb1000.o \
138 arch/mips/au1000/common/au1000.o
139 SUBDIRS += arch/mips/au1000/pb1000 arch/mips/au1000/common
140 LOADADDR := 0x80100000
144 # Au1100 (Alchemy Semi PB1100) eval board
146 ifdef CONFIG_MIPS_PB1100
147 LIBS += arch/mips/au1000/pb1100/pb1100.o \
148 arch/mips/au1000/common/au1000.o
149 SUBDIRS += arch/mips/au1000/pb1100 arch/mips/au1000/common
150 LOADADDR += 0x80100000
154 # Au1500 (Alchemy Semi PB1500) eval board
156 ifdef CONFIG_MIPS_PB1500
157 LIBS += arch/mips/au1000/pb1500/pb1500.o \
158 arch/mips/au1000/common/au1000.o
159 SUBDIRS += arch/mips/au1000/pb1500 arch/mips/au1000/common
160 LOADADDR := 0x80100000
166 ifdef CONFIG_ALGOR_P4032
167 CORE_FILES += arch/mips/algor/algor.o
168 SUBDIRS += arch/mips/algor
169 LOADADDR := 0x80000000
175 ifdef CONFIG_BAGET_MIPS
176 SUBDIRS += arch/mips/baget arch/mips/baget/prom
177 LIBS += arch/mips/baget/baget.a arch/mips/baget/prom/bagetlib.a
178 LOADADDR := 0x80001000
184 ifdef CONFIG_MIPS_COBALT
185 SUBDIRS += arch/mips/cobalt
186 CORE_FILES += arch/mips/cobalt/cobalt.o
187 LOADADDR := 0x80080000
193 ifdef CONFIG_DECSTATION
194 CORE_FILES += arch/mips/dec/dec.o
195 SUBDIRS += arch/mips/dec arch/mips/dec/prom
196 LIBS += arch/mips/dec/prom/rexlib.a
197 LOADADDR := 0x80040000
201 # Galileo EV64120 Board
203 ifdef CONFIG_MIPS_EV64120
204 LIBS += arch/mips/galileo-boards/ev64120/ev64120.o
205 SUBDIRS += arch/mips/galileo-boards/ev64120
206 LOADADDR := 0x80100000
210 # Galileo EV96100 Board
212 ifdef CONFIG_MIPS_EV96100
213 LIBS += arch/mips/galileo-boards/ev96100/ev96100.o \
214 arch/mips/galileo-boards/generic/galboards.o
215 SUBDIRS += arch/mips/galileo-boards/generic \
216 arch/mips/galileo-boards/ev96100
217 LOADADDR := 0x80100000
221 # Globespan IVR eval board with QED 5231 CPU
223 ifdef CONFIG_MIPS_IVR
224 LIBS += arch/mips/ite-boards/ivr/ivr.o \
225 arch/mips/ite-boards/generic/it8172.o
226 SUBDIRS += arch/mips/ite-boards/generic arch/mips/ite-boards/ivr
227 LOADADDR := 0x80100000
233 ifdef CONFIG_HP_LASERJET
234 SUBDIRS += arch/mips/hp-lj
235 LIBS += arch/mips/hp-lj/hp-lj.o
236 LOADADDR := 0x80030000
240 # ITE 8172 eval board with QED 5231 CPU
242 ifdef CONFIG_MIPS_ITE8172
243 LIBS += arch/mips/ite-boards/qed-4n-s01b/ite.o \
244 arch/mips/ite-boards/generic/it8172.o
245 SUBDIRS += arch/mips/ite-boards/generic arch/mips/ite-boards/qed-4n-s01b
246 LOADADDR := 0x80100000
252 ifdef CONFIG_MIPS_ATLAS
253 LIBS += arch/mips/mips-boards/atlas/atlas.o \
254 arch/mips/mips-boards/generic/mipsboards.o
255 SUBDIRS += arch/mips/mips-boards/generic arch/mips/mips-boards/atlas
256 LOADADDR := 0x80100000
262 ifdef CONFIG_MIPS_MALTA
263 LIBS += arch/mips/mips-boards/malta/malta.o \
264 arch/mips/mips-boards/generic/mipsboards.o
265 SUBDIRS += arch/mips/mips-boards/malta arch/mips/mips-boards/generic
266 LOADADDR := 0x80100000
272 ifdef CONFIG_MIPS_SEAD
273 LIBS += arch/mips/mips-boards/sead/sead.o \
274 arch/mips/mips-boards/generic/mipsboards.o
275 SUBDIRS += arch/mips/mips-boards/generic arch/mips/mips-boards/sead
276 LOADADDR := 0x80100000
280 # Momentum Ocelot board
282 ifdef CONFIG_MOMENCO_OCELOT
283 # The Ocelot setup.o must be linked early - it does the ioremap() for the
285 CORE_FILES += arch/mips/gt64120/common/gt64120.o \
286 arch/mips/gt64120/momenco_ocelot/momenco_ocelot.o
287 SUBDIRS += arch/mips/gt64120/common arch/mips/gt64120/momenco_ocelot
288 LOADADDR := 0x80100000
292 # Momentum Ocelot-G board
294 ifdef CONFIG_MOMENCO_OCELOT_G
295 # The Ocelot-G setup.o must be linked early - it does the ioremap() for the
297 CORE_FILES += arch/mips/momentum/ocelot_g/ocelot_g.o
298 SUBDIRS += arch/mips/momentum/ocelot_g
299 LOADADDR := 0x80100000
306 SUBDIRS += arch/mips/ddb5xxx/common arch/mips/ddb5xxx/ddb5074
307 LIBS += arch/mips/ddb5xxx/common/ddb5xxx.o arch/mips/ddb5xxx/ddb5074/ddb5074.o
308 LOADADDR := 0x80080000
315 SUBDIRS += arch/mips/ddb5xxx/common arch/mips/ddb5xxx/ddb5476
316 LIBS += arch/mips/ddb5xxx/common/ddb5xxx.o \
317 arch/mips/ddb5xxx/ddb5476/ddb5476.o
318 LOADADDR := 0x80080000
325 SUBDIRS += arch/mips/ddb5xxx/common arch/mips/ddb5xxx/ddb5477
326 LIBS += arch/mips/ddb5xxx/common/ddb5xxx.o \
327 arch/mips/ddb5xxx/ddb5477/ddb5477.o
328 LOADADDR := 0x80100000
332 # NEC Osprey (vr4181) board
334 ifdef CONFIG_NEC_OSPREY
335 SUBDIRS += arch/mips/vr4181/common arch/mips/vr4181/osprey
336 LIBS += arch/mips/vr4181/common/vr4181.o \
337 arch/mips/vr4181/osprey/osprey.o
338 LOADADDR := 0x80002000
342 # NEC Eagle/Hawk (VR4122/VR4131) board
344 ifdef CONFIG_NEC_EAGLE
345 SUBDIRS += arch/mips/vr41xx/common \
346 arch/mips/vr41xx/nec-eagle
347 LIBS += arch/mips/vr41xx/common/vr41xx.o \
348 arch/mips/vr41xx/nec-eagle/eagle.o
349 LOADADDR := 0x80000000
353 # ZAO Networks Capcella (VR4131)
355 ifdef CONFIG_ZAO_CAPCELLA
356 SUBDIRS += arch/mips/vr41xx/common \
357 arch/mips/vr41xx/zao-capcella
358 LIBS += arch/mips/vr41xx/common/vr41xx.o \
359 arch/mips/vr41xx/zao-capcella/capcella.o
360 LOADADDR := 0x80000000
367 CORE_FILES += arch/mips/philips/nino/nino.o
368 SUBDIRS += arch/mips/philips/nino
369 LOADADDR := 0x80000000
373 # SGI IP22 (Indy/Indigo2)
375 ifdef CONFIG_SGI_IP22
376 CORE_FILES += arch/mips/sgi-ip22/ip22-kern.o
377 LIBS += arch/mips/arc/arclib.a
378 SUBDIRS += arch/mips/sgi-ip22 arch/mips/arc
380 # Set LOADADDR to >= 0x88069000 if you want to leave space for symmon,
381 # 0x88002000 for production kernels. Note that the value must be
382 # 8kb aligned or the handling of the current variable will break.
384 LOADADDR := 0x88002000
390 ifdef CONFIG_SIBYTE_SB1250
391 # This is a LIB so that it links at the end, and initcalls are later
392 # the sequence; but it is built as an object so that modules don't get
393 # removed (as happens, even if they have __initcall/module_init)
394 LIBS += arch/mips/sibyte/sb1250/sb1250.o
395 SUBDIRS += arch/mips/sibyte/sb1250
401 ifdef CONFIG_SIBYTE_SWARM
402 LIBS += arch/mips/sibyte/swarm/sbswarm.a
403 SUBDIRS += arch/mips/sibyte/swarm
404 LOADADDR := 0x80100000
408 # Sibyte CFE firmware
410 ifdef CONFIG_SIBYTE_CFE
411 LIBS += arch/mips/sibyte/cfe/cfe.a
412 SUBDIRS += arch/mips/sibyte/cfe
416 # SB1 Cache Error handler
418 ifdef CONFIG_SB1_CACHE_ERROR
419 LIBS += arch/mips/sibyte/sb1/sb1kern.a
420 SUBDIRS += arch/mips/sibyte/sb1
426 ifdef CONFIG_SNI_RM200_PCI
427 CORE_FILES += arch/mips/sni/sni.o
428 SUBDIRS += arch/mips/sni arch/mips/arc
429 LIBS += arch/mips/arc/arclib.a
430 LOADADDR := 0x80080000
434 # Toshiba JMR-TX3927 board
436 ifdef CONFIG_TOSHIBA_JMR3927
437 CORE_FILES += arch/mips/jmr3927/rbhma3100/jmr3927.o \
438 arch/mips/jmr3927/common/tx3927.o
439 SUBDIRS += arch/mips/jmr3927/rbhma3100 arch/mips/jmr3927/common
440 LOADADDR := 0x80050000
445 # Choosing incompatible machines durings configuration will result in
446 # error messages during linking. Select a default linkscript if
447 # none has been choosen above.
449 vmlinux: arch/$(ARCH)/ld.script
451 arch/$(ARCH)/ld.script: arch/$(ARCH)/ld.script.in arch/$(ARCH)/Makefile
452 sed -e 's/@@LOADADDR@@/$(LOADADDR)/' <$< >$@
453 LINKFLAGS += -T arch/$(ARCH)/ld.script
455 HEAD := arch/mips/kernel/head.o arch/mips/kernel/init_task.o
457 SUBDIRS := $(addprefix arch/mips/, tools) $(SUBDIRS) $(addprefix arch/mips/, kernel mm lib)
458 CORE_FILES := arch/mips/kernel/kernel.o arch/mips/mm/mm.o $(CORE_FILES)
459 LIBS := arch/mips/lib/lib.a $(LIBS)
461 ifdef CONFIG_BAGET_MIPS
463 BAGETBOOT = $(MAKE) -C arch/$(ARCH)/baget
470 ifdef CONFIG_MIPS_EV64120
471 GALILEOBOOT = $(MAKE) -C arch/$(ARCH)/galileo-boards/ev64120
474 $(MAKE) -C arch/$(ARCH)/galileo-boards/ev64120/compressed
477 MAKEBOOT = $(MAKE) -C arch/$(ARCH)/boot
479 vmlinux.ecoff: vmlinux
484 rm -f arch/$(ARCH)/ld.script
485 $(MAKE) -C arch/$(ARCH)/tools clean
486 $(MAKE) -C arch/mips/baget clean
489 @$(MAKEBOOT) mrproper
490 $(MAKE) -C arch/$(ARCH)/tools mrproper
493 if [ ! -f $(TOPDIR)/include/asm-$(ARCH)/offset.h ]; then \
494 touch $(TOPDIR)/include/asm-$(ARCH)/offset.h; \