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