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" cleaning up for this architecture.
16 # Select the object file format to substitute into the linker script.
18 ifdef CONFIG_CPU_LITTLE_ENDIAN
19 tool-prefix
= mipsel-linux-
20 JIFFIES32
= jiffies_64
21 LDFLAGS_BLOB
:= --format binary
--oformat elf32-tradlittlemips
23 tool-prefix
= mips-linux-
24 JIFFIES32
= jiffies_64
+ 4
25 LDFLAGS_BLOB
:= --format binary
--oformat elf32-tradbigmips
28 ifdef CONFIG_CROSSCOMPILE
29 CROSS_COMPILE
= $(tool-prefix
)
33 # GCC uses -G 0 -mabicalls -fpic as default. We don't want PIC in the kernel
34 # code since it only slows down the whole thing. At some point we might make
35 # use of global pointer optimizations but their use of $28 conflicts with
36 # the current pointer optimization.
38 # The DECStation requires an ECOFF kernel for remote booting, other MIPS
39 # machines may also. Since BFD is incredibly buggy with respect to
40 # crossformat linking we rely on the elf2ecoff tool for format conversion.
42 cflags-y
:= -I
$(TOPDIR
)/include/asm
/gcc
43 cflags-y
+= -G
0 -mno-abicalls
-fno-pic
-pipe
44 LDFLAGS_vmalinux
+= -G
0 -static
# -N
45 MODFLAGS
+= -mlong-calls
47 cflags-
$(CONFIG_KGDB
) += -g
48 cflags-
$(CONFIG_SB1XXX_CORELIS
) += -mno-sched-prolog
-fno-omit-frame-pointer
50 check_gcc
= $(shell if
$(CC
) $(1) -S
-o
/dev
/null
-xc
/dev
/null
> /dev
/null
2>&1; then echo
"$(1)"; else echo
"$(2)"; fi
)
53 # CPU-dependent compiler/assembler options for optimization.
55 cflags-
$(CONFIG_CPU_R3000
) += -mcpu
=r3000
-mips1
56 cflags-
$(CONFIG_CPU_TX39XX
) += -mcpu
=r3000
-mips1
57 cflags-
$(CONFIG_CPU_R6000
) += -mcpu
=r6000
-mips2
-Wa
,--trap
58 cflags-
$(CONFIG_CPU_R4300
) += -mcpu
=r4300
-mips2
-Wa
,--trap
59 cflags-
$(CONFIG_CPU_VR41XX
) += -mcpu
=r4600
-mips2
-Wa
,--trap
60 cflags-
$(CONFIG_CPU_R4X00
) += -mcpu
=r4600
-mips2
-Wa
,--trap
61 cflags-
$(CONFIG_CPU_TX49XX
) += -mcpu
=r4600
-mips2
-Wa
,--trap
62 cflags-
$(CONFIG_CPU_MIPS32
) += -mcpu
=r4600
-mips2
-Wa
,--trap
63 cflags-
$(CONFIG_CPU_MIPS64
) += -mcpu
=r4600
-mips2
-Wa
,--trap
64 cflags-
$(CONFIG_CPU_R5000
) += -mcpu
=r5000
-mips2
-Wa
,--trap
65 cflags-
$(CONFIG_CPU_R5432
) += -mcpu
=r5000
-mips2
-Wa
,--trap
66 # Cannot use -mmad with currently recommended tools
67 cflags-
$(CONFIG_CPU_NEVADA
) += -mcpu
=r5000
-mips2
-Wa
,--trap
68 cflags-
$(CONFIG_CPU_RM7000
) += -mcpu
=r5000
-mips2
-Wa
,--trap
69 cflags-
$(CONFIG_CPU_RM7000
) += $(call check_gcc
, -mcpu
=r7000
, -mcpu
=r5000
) \
71 cflags-
$(CONFIG_CPU_SB1
) += $(call check_gcc
, -mcpu
=sb1
, -mcpu
=r8000
) \
74 ifdef CONFIG_SB1_PASS_1_WORKAROUNDS
75 MODFLAGS
+= -msb1-pass1-workarounds
84 # ramdisk/initrd support
85 # You need a compressed ramdisk image, named ramdisk.gz in
88 ifdef CONFIG_EMBEDDED_RAMDISK
89 CORE_FILES
+= arch
/mips
/ramdisk
/ramdisk.o
90 SUBDIRS
+= arch
/mips
/ramdisk
96 libs-
$(CONFIG_ARC
) += arch
/mips
/arc
/
97 libs-
$(CONFIG_SIBYTE_CFE
) += arch
/mips
/sibyte
/cfe
/
100 # Board-dependent options and extra files
104 # Acer PICA 61, Mips Magnum 4000 and Olivetti M700.
106 core-
$(CONFIG_MIPS_JAZZ
) += arch
/mips
/jazz
/
107 load-
$(CONFIG_MIPS_JAZZ
) += 0x80080000
111 # Au1500 (Alchemy Semi PB1500) eval board
113 core-
$(CONFIG_MIPS_PB1500
) += arch
/mips
/au1000
/common
/
114 libs-
$(CONFIG_MIPS_PB1500
) += arch
/mips
/au1000
/pb1500
/
115 load-
$(CONFIG_MIPS_PB1500
) += 0x80100000
120 libs-
$(CONFIG_BAGET_MIPS
) += arch
/mips
/baget
/ arch
/mips
/baget
/prom
/
121 load-
$(CONFIG_BAGET_MIPS
) += 0x80001000
126 core-
$(CONFIG_MIPS_COBALT
) += arch
/mips
/cobalt
/
127 load-
$(CONFIG_MIPS_COBALT
) += 0x80080000
132 core-
$(CONFIG_DECSTATION
) += arch
/mips
/dec
/
133 libs-
$(CONFIG_DECSTATION
) += arch
/mips
/dec
/prom
/
134 load-
$(CONFIG_DECSTATION
) += 0x80040000
135 CLEAN_FILES
+= drivers
/tc
/lk201-map.c
138 # Galileo EV64120 Board
140 core-
$(CONFIG_MIPS_EV64120
) += arch
/mips
/galileo-boards
/ev64120
/
141 load-
$(CONFIG_MIPS_EV64120
) += 0x80100000
144 # Galileo EV96100 Board
146 core-
$(CONFIG_MIPS_EV96100
) += arch
/mips
/galileo-boards
/generic
/ \
147 arch
/mips
/galileo-boards
/ev96100
/
148 load-
$(CONFIG_MIPS_EV96100
) += 0x80100000
151 # Globespan IVR eval board with QED 5231 CPU
153 core-
$(CONFIG_ITE_BOARD_GEN
) += arch
/mips
/ite-boards
/generic
/
154 core-
$(CONFIG_MIPS_IVR
) += arch
/mips
/ite-boards
/ivr
/
155 load-
$(CONFIG_MIPS_IVR
) += 0x80100000
160 core-
$(CONFIG_HP_LASERJET
) += arch
/mips
/hp-lj
/
161 load-
$(CONFIG_HP_LASERJET
) += 0x80030000
164 # ITE 8172 eval board with QED 5231 CPU
166 core-
$(CONFIG_MIPS_ITE8172
) += arch
/mips
/ite-boards
/qed-4n-s01b
/
167 load-
$(CONFIG_MIPS_ITE8172
) += 0x80100000
172 core-
$(CONFIG_MIPS_BOARDS_GEN
) += arch
/mips
/mips-boards
/generic
/
173 core-
$(CONFIG_MIPS_ATLAS
) += arch
/mips
/mips-boards
/atlas
/
174 load-
$(CONFIG_MIPS_ATLAS
) += 0x80100000
179 core-
$(CONFIG_MIPS_MALTA
) += arch
/mips
/mips-boards
/malta
/
180 load-
$(CONFIG_MIPS_MALTA
) := 0x80100000
185 core-
$(CONFIG_MIPS_SEAD
) += arch
/mips
/mips-boards
/sead
/
186 load-
$(CONFIG_MIPS_SEAD
) += 0x80100000
189 # Momentum Ocelot board
191 # The Ocelot setup.o must be linked early - it does the ioremap() for the
194 core-
$(CONFIG_MOMENCO_OCELOT
) += arch
/mips
/gt64120
/common
/ \
195 arch
/mips
/gt64120
/momenco_ocelot
/
196 load-
$(CONFIG_MOMENCO_OCELOT
) += 0x80100000
199 # Momentum Ocelot-G board
201 # The Ocelot-G setup.o must be linked early - it does the ioremap() for the
204 core-
$(CONFIG_MOMENCO_OCELOT_G
) += arch
/mips
/momentum
/ocelot_g
/
205 load-
$(CONFIG_MOMENCO_OCELOT_G
) += 0x80100000
208 # Momentum Ocelot-C and -CS boards
210 # The Ocelot-C[S] setup.o must be linked early - it does the ioremap() for the
212 core-
$(CONFIG_MOMENCO_OCELOT_C
) += arch
/mips
/momentum
/ocelot_c
/
213 load-
$(CONFIG_MOMENCO_OCELOT_C
) += 0x80100000
218 core-
$(CONFIG_DDB5XXX_COMMON
) += arch
/mips
/ddb5xxx
/common
/
219 core-
$(CONFIG_DDB5074
) += arch
/mips
/ddb5xxx
/ddb5074
/
220 load-
$(CONFIG_DDB5074
) += 0x80080000
225 core-
$(CONFIG_DDB5476
) += arch
/mips
/ddb5xxx
/ddb5476
/
226 load-
$(CONFIG_DDB5476
) += 0x80080000
231 core-
$(CONFIG_DDB5477
) += arch
/mips
/ddb5xxx
/ddb5477
/
232 load-
$(CONFIG_DDB5477
) += 0x80100000
234 core-
$(CONFIG_LASAT
) += arch
/mips
/lasat
/
235 load-
$(CONFIG_LASAT
) += 0x80000000
238 # NEC Osprey (vr4181) board
240 core-
$(CONFIG_NEC_OSPREY
) += arch
/mips
/vr4181
/common
/ \
241 arch
/mips
/vr4181
/osprey
/
242 load-
$(CONFIG_NEC_OSPREY
) += 0x80002000
245 # NEC Eagle/Hawk (VR4122/VR4131) board
247 core-
$(CONFIG_VR41XX_COMMON
) += arch
/mips
/vr41xx
/common
/
248 core-
$(CONFIG_NEC_EAGLE
) += arch
/mips
/vr41xx
/nec-eagle
/
249 load-
$(CONFIG_NEC_EAGLE
) += 0x80000000
252 # ZAO Networks Capcella (VR4131)
254 core-
$(CONFIG_ZAO_CAPCELLA
) += arch
/mips
/vr41xx
/zao-capcella
/
255 load-
$(CONFIG_ZAO_CAPCELLA
) += 0x80000000
258 # Victor MP-C303/304 (VR4122)
260 core-
$(CONFIG_VICTOR_MPC30X
) += arch
/mips
/vr41xx
/victor-mpc30x
/
261 load-
$(CONFIG_VICTOR_MPC30X
) += 0x80001000
264 # IBM WorkPad z50 (VR4121)
266 core-
$(CONFIG_IBM_WORKPAD
) += arch
/mips
/vr41xx
/ibm-workpad
/
267 load-
$(CONFIG_IBM_WORKPAD
) += 0x80004000
270 # CASIO CASSIPEIA E-55/65 (VR4111)
272 core-
$(CONFIG_CASIO_E55
) += arch
/mips
/vr41xx
/casio-e55
/
273 load-
$(CONFIG_CASIO_E55
) += 0x80004000
276 # TANBAC TB0226 Mbase (VR4131)
278 core-
$(CONFIG_TANBAC_TB0226
) += arch
/mips
/vr41xx
/tanbac-tb0226
/
279 load-
$(CONFIG_TANBAC_TB0226
) += 0x80000000
282 # TANBAC TB0229 VR4131DIMM (VR4131)
284 core-
$(CONFIG_TANBAC_TB0229
) += arch
/mips
/vr41xx
/tanbac-tb0229
/
285 load-
$(CONFIG_TANBAC_TB0229
) += 0x80000000
288 # SGI IP22 (Indy/Indigo2)
290 # Set the load address to >= 0x88069000 if you want to leave space for symmon,
291 # 0x88002000 for production kernels. Note that the value must be 8kb aligned
292 # or the handling of the current variable will break.
294 core-
$(CONFIG_SGI_IP22
) += arch
/mips
/sgi-ip22
/
295 load-
$(CONFIG_SGI_IP22
) += 0x88002000
300 # This is a LIB so that it links at the end, and initcalls are later
301 # the sequence; but it is built as an object so that modules don't get
302 # removed (as happens, even if they have __initcall/module_init)
304 core-
$(CONFIG_SIBYTE_BCM112X
) += arch
/mips
/sibyte
/sb1250
/
305 core-
$(CONFIG_SIBYTE_SB1250
) += arch
/mips
/sibyte
/sb1250
/
308 # Sibyte BCM91120x (Carmel) board
309 # Sibyte BCM91120C (CRhine) board
310 # Sibyte BCM91125C (CRhone) board
311 # Sibyte BCM91125E (Rhone) board
314 libs-
$(CONFIG_SIBYTE_CARMEL
) += arch
/mips
/sibyte
/swarm
/
315 load-
$(CONFIG_SIBYTE_CARMEL
) := 0x80100000
316 libs-
$(CONFIG_SIBYTE_CRHINE
) += arch
/mips
/sibyte
/swarm
/
317 load-
$(CONFIG_SIBYTE_CRHINE
) := 0x80100000
318 libs-
$(CONFIG_SIBYTE_CRHONE
) += arch
/mips
/sibyte
/swarm
/
319 load-
$(CONFIG_SIBYTE_CRHONE
) := 0x80100000
320 libs-
$(CONFIG_SIBYTE_RHONE
) += arch
/mips
/sibyte
/swarm
/
321 load-
$(CONFIG_SIBYTE_RHONE
) := 0x80100000
322 libs-
$(CONFIG_SIBYTE_SENTOSA
) += arch
/mips
/sibyte
/swarm
/
323 load-
$(CONFIG_SIBYTE_SENTOSA
) := 0x80100000
324 libs-
$(CONFIG_SIBYTE_SWARM
) += arch
/mips
/sibyte
/swarm
/
325 load-
$(CONFIG_SIBYTE_SWARM
) := 0x80100000
330 core-
$(CONFIG_SNI_RM200_PCI
) += arch
/mips
/sni
/
331 load-
$(CONFIG_SNI_RM200_PCI
) += 0x80080000
334 # Toshiba JMR-TX3927 board
336 core-
$(CONFIG_TOSHIBA_JMR3927
) += arch
/mips
/jmr3927
/rbhma3100
/ \
337 arch
/mips
/jmr3927
/common
/
338 load-
$(CONFIG_TOSHIBA_JMR3927
) += 0x80050000
341 # Toshiba RBTX4927 board or
342 # Toshiba RBTX4937 board
344 core-
$(CONFIG_TOSHIBA_RBTX4927
) += arch
/mips
/tx4927
/toshiba_rbtx4927
/
345 core-
$(CONFIG_TOSHIBA_RBTX4927
) += arch
/mips
/tx4927
/common
/
346 load-
$(CONFIG_TOSHIBA_RBTX4927
) := 0x80020000
348 drivers-
$(CONFIG_PCI
) += arch
/mips
/pci
/
352 # Choosing incompatible machines durings configuration will result in
353 # error messages during linking. Select a default linkscript if
354 # none has been choosen above.
357 AFLAGS_vmlinux.lds.o
:= -D
"LOADADDR=$(load-y)" -D
"JIFFIES32=$(JIFFIES32)"
359 head-y
:= arch
/mips
/kernel
/head.o arch
/mips
/kernel
/init_task.o
361 libs-y
+= arch
/mips
/lib
/
362 core-y
+= arch
/mips
/kernel
/ arch
/mips
/mm
/ arch
/mips
/math-emu
/
364 ifdef CONFIG_BAGET_MIPS
366 BAGETBOOT
= $(MAKE
) -C arch
/$(ARCH
)/baget
374 rom.bin rom.sw
: vmlinux
375 $(call descend
,arch
/mips
/lasat
/image
,$@
)
378 makeboot
=$(Q
)$(MAKE
) -f scripts
/Makefile.build obj
=arch
/mips
/boot
$(1)
381 # SNI firmware is f*cked in interesting ways ...
383 ifdef CONFIG_SNI_RM200_PCI
387 vmlinux.ecoff vmlinux.rm200
: vmlinux
388 +@
$(call makeboot
,$@
)
390 CLEAN_FILES
+= vmlinux.ecoff \
395 @
$(MAKE
) -f scripts
/Makefile.
clean obj
=arch
/mips
/boot
396 @
$(MAKE
) -f scripts
/Makefile.
clean obj
=arch
/mips
/baget
397 @
$(MAKE
) -f scripts
/Makefile.
clean obj
=arch
/mips
/lasat
401 # Generate <asm/offset.h
403 # The default rule is suffering from funny problems on MIPS so we using our
406 # ---------------------------------------------------------------------------
408 define filechk_gen-asm-offset.h
410 echo
"#ifndef __ASM_OFFSET_H"; \
411 echo
"#define __ASM_OFFSET_H"; \
413 echo
" * DO NOT MODIFY."; \
415 echo
" * This file was generated by arch/$(ARCH)/Makefile"; \
419 sed
-ne
"/^@@@/s///p"; \
420 echo
"#endif /* __ASM_OFFSET_H */" )
423 prepare
: include/asm-
$(ARCH
)/offset.h
425 arch
/$(ARCH
)/kernel
/offset.s
: include/asm
include/linux
/version.h \
426 include/config
/MARKER
428 include/asm-
$(ARCH
)/offset.h
: arch
/$(ARCH
)/kernel
/offset.s
429 $(call filechk
,gen-asm-offset.h
)
431 CLEAN_FILES
+= include/asm-
$(ARCH
)/offset.h.tmp \
432 include/asm-
$(ARCH
)/offset.h