aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/Makefile')
-rw-r--r--arch/mips/Makefile83
1 files changed, 71 insertions, 12 deletions
diff --git a/arch/mips/Makefile b/arch/mips/Makefile
index 77f5021218d3..0b9c01add0a0 100644
--- a/arch/mips/Makefile
+++ b/arch/mips/Makefile
@@ -48,7 +48,16 @@ ifneq ($(SUBARCH),$(ARCH))
48 endif 48 endif
49endif 49endif
50 50
51ifndef CONFIG_FUNCTION_TRACER
51cflags-y := -ffunction-sections 52cflags-y := -ffunction-sections
53endif
54ifdef CONFIG_FUNCTION_GRAPH_TRACER
55 ifndef KBUILD_MCOUNT_RA_ADDRESS
56 ifeq ($(call cc-option-yn,-mmcount-ra-address), y)
57 cflags-y += -mmcount-ra-address -DKBUILD_MCOUNT_RA_ADDRESS
58 endif
59 endif
60endif
52cflags-y += $(call cc-option, -mno-check-zero-division) 61cflags-y += $(call cc-option, -mno-check-zero-division)
53 62
54ifdef CONFIG_32BIT 63ifdef CONFIG_32BIT
@@ -69,6 +78,7 @@ endif
69 78
70all-$(CONFIG_BOOT_ELF32) := $(vmlinux-32) 79all-$(CONFIG_BOOT_ELF32) := $(vmlinux-32)
71all-$(CONFIG_BOOT_ELF64) := $(vmlinux-64) 80all-$(CONFIG_BOOT_ELF64) := $(vmlinux-64)
81all-$(CONFIG_SYS_SUPPORTS_ZBOOT)+= vmlinuz
72 82
73# 83#
74# GCC uses -G 0 -mabicalls -fpic as default. We don't want PIC in the kernel 84# GCC uses -G 0 -mabicalls -fpic as default. We don't want PIC in the kernel
@@ -124,6 +134,21 @@ cflags-$(CONFIG_CPU_TX49XX) += -march=r4600 -Wa,--trap
124cflags-$(CONFIG_CPU_LOONGSON2) += -Wa,--trap 134cflags-$(CONFIG_CPU_LOONGSON2) += -Wa,--trap
125cflags-$(CONFIG_CPU_LOONGSON2E) += \ 135cflags-$(CONFIG_CPU_LOONGSON2E) += \
126 $(call cc-option,-march=loongson2e,-march=r4600) 136 $(call cc-option,-march=loongson2e,-march=r4600)
137cflags-$(CONFIG_CPU_LOONGSON2F) += \
138 $(call cc-option,-march=loongson2f,-march=r4600)
139# enable the workarounds for loongson2f
140ifdef CONFIG_CPU_LOONGSON2F_WORKAROUNDS
141 ifeq ($(call as-option,-Wa$(comma)-mfix-loongson2f-nop,),)
142 $(error only binutils >= 2.20.2 have needed option -mfix-loongson2f-nop)
143 else
144 cflags-$(CONFIG_CPU_NOP_WORKAROUNDS) += -Wa$(comma)-mfix-loongson2f-nop
145 endif
146 ifeq ($(call as-option,-Wa$(comma)-mfix-loongson2f-jump,),)
147 $(error only binutils >= 2.20.2 have needed option -mfix-loongson2f-jump)
148 else
149 cflags-$(CONFIG_CPU_JUMP_WORKAROUNDS) += -Wa$(comma)-mfix-loongson2f-jump
150 endif
151endif
127 152
128cflags-$(CONFIG_CPU_MIPS32_R1) += $(call cc-option,-march=mips32,-mips32 -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS32) \ 153cflags-$(CONFIG_CPU_MIPS32_R1) += $(call cc-option,-march=mips32,-mips32 -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS32) \
129 -Wa,-mips32 -Wa,--trap 154 -Wa,-mips32 -Wa,--trap
@@ -173,6 +198,15 @@ libs-$(CONFIG_SNIPROM) += arch/mips/fw/sni/
173libs-y += arch/mips/fw/lib/ 198libs-y += arch/mips/fw/lib/
174 199
175# 200#
201# Kernel compression
202#
203ifdef SYS_SUPPORTS_ZBOOT
204COMPRESSION_FNAME = vmlinuz
205else
206COMPRESSION_FNAME = vmlinux
207endif
208
209#
176# Board-dependent options and extra files 210# Board-dependent options and extra files
177# 211#
178 212
@@ -320,10 +354,11 @@ load-$(CONFIG_WR_PPMC) += 0xffffffff80100000
320# 354#
321# Loongson family 355# Loongson family
322# 356#
323core-$(CONFIG_MACH_LOONGSON) +=arch/mips/loongson/ 357core-$(CONFIG_MACH_LOONGSON) += arch/mips/loongson/
324cflags-$(CONFIG_MACH_LOONGSON) += -I$(srctree)/arch/mips/include/asm/mach-loongson \ 358cflags-$(CONFIG_MACH_LOONGSON) += -I$(srctree)/arch/mips/include/asm/mach-loongson \
325 -mno-branch-likely 359 -mno-branch-likely
326load-$(CONFIG_LEMOTE_FULOONG2E) +=0xffffffff80100000 360load-$(CONFIG_LEMOTE_FULOONG2E) += 0xffffffff80100000
361load-$(CONFIG_LEMOTE_MACH2F) += 0xffffffff80200000
327 362
328# 363#
329# MIPS Malta board 364# MIPS Malta board
@@ -331,7 +366,7 @@ load-$(CONFIG_LEMOTE_FULOONG2E) +=0xffffffff80100000
331core-$(CONFIG_MIPS_MALTA) += arch/mips/mti-malta/ 366core-$(CONFIG_MIPS_MALTA) += arch/mips/mti-malta/
332cflags-$(CONFIG_MIPS_MALTA) += -I$(srctree)/arch/mips/include/asm/mach-malta 367cflags-$(CONFIG_MIPS_MALTA) += -I$(srctree)/arch/mips/include/asm/mach-malta
333load-$(CONFIG_MIPS_MALTA) += 0xffffffff80100000 368load-$(CONFIG_MIPS_MALTA) += 0xffffffff80100000
334all-$(CONFIG_MIPS_MALTA) := vmlinux.bin 369all-$(CONFIG_MIPS_MALTA) := $(COMPRESSION_FNAME).bin
335 370
336# 371#
337# MIPS SIM 372# MIPS SIM
@@ -356,13 +391,6 @@ cflags-$(CONFIG_PMC_YOSEMITE) += -I$(srctree)/arch/mips/include/asm/mach-yosemit
356load-$(CONFIG_PMC_YOSEMITE) += 0xffffffff80100000 391load-$(CONFIG_PMC_YOSEMITE) += 0xffffffff80100000
357 392
358# 393#
359# Basler eXcite
360#
361core-$(CONFIG_BASLER_EXCITE) += arch/mips/basler/excite/
362cflags-$(CONFIG_BASLER_EXCITE) += -I$(srctree)/arch/mips/include/asm/mach-excite
363load-$(CONFIG_BASLER_EXCITE) += 0x80100000
364
365#
366# LASAT platforms 394# LASAT platforms
367# 395#
368core-$(CONFIG_LASAT) += arch/mips/lasat/ 396core-$(CONFIG_LASAT) += arch/mips/lasat/
@@ -441,6 +469,13 @@ core-$(CONFIG_NEC_MARKEINS) += arch/mips/emma/markeins/
441load-$(CONFIG_NEC_MARKEINS) += 0xffffffff88100000 469load-$(CONFIG_NEC_MARKEINS) += 0xffffffff88100000
442 470
443# 471#
472# Cisco PowerTV Platform
473#
474core-$(CONFIG_POWERTV) += arch/mips/powertv/
475cflags-$(CONFIG_POWERTV) += -I$(srctree)/arch/mips/include/asm/mach-powertv
476load-$(CONFIG_POWERTV) += 0xffffffff90800000
477
478#
444# SGI IP22 (Indy/Indigo2) 479# SGI IP22 (Indy/Indigo2)
445# 480#
446# Set the load address to >= 0xffffffff88069000 if you want to leave space for 481# Set the load address to >= 0xffffffff88069000 if you want to leave space for
@@ -581,7 +616,7 @@ load-$(CONFIG_SNI_RM) += 0xffffffff80600000
581else 616else
582load-$(CONFIG_SNI_RM) += 0xffffffff80030000 617load-$(CONFIG_SNI_RM) += 0xffffffff80030000
583endif 618endif
584all-$(CONFIG_SNI_RM) := vmlinux.ecoff 619all-$(CONFIG_SNI_RM) := $(COMPRESSION_FNAME).ecoff
585 620
586# 621#
587# Common TXx9 622# Common TXx9
@@ -699,9 +734,23 @@ vmlinux.64: vmlinux
699 $(OBJCOPY) -O $(64bit-bfd) $(OBJCOPYFLAGS) $< $@ 734 $(OBJCOPY) -O $(64bit-bfd) $(OBJCOPYFLAGS) $< $@
700 735
701makeboot =$(Q)$(MAKE) $(build)=arch/mips/boot VMLINUX=$(vmlinux-32) $(1) 736makeboot =$(Q)$(MAKE) $(build)=arch/mips/boot VMLINUX=$(vmlinux-32) $(1)
737makezboot =$(Q)$(MAKE) $(build)=arch/mips/boot/compressed \
738 VMLINUX_LOAD_ADDRESS=$(load-y) 32bit-bfd=$(32bit-bfd) $(1)
702 739
703all: $(all-y) 740all: $(all-y)
704 741
742vmlinuz: vmlinux FORCE
743 +@$(call makezboot,$@)
744
745vmlinuz.bin: vmlinux
746 +@$(call makezboot,$@)
747
748vmlinuz.ecoff: vmlinux
749 +@$(call makezboot,$@)
750
751vmlinuz.srec: vmlinux
752 +@$(call makezboot,$@)
753
705vmlinux.bin: $(vmlinux-32) 754vmlinux.bin: $(vmlinux-32)
706 +@$(call makeboot,$@) 755 +@$(call makeboot,$@)
707 756
@@ -726,11 +775,13 @@ endif
726 775
727install: 776install:
728 $(Q)install -D -m 755 vmlinux $(INSTALL_PATH)/vmlinux-$(KERNELRELEASE) 777 $(Q)install -D -m 755 vmlinux $(INSTALL_PATH)/vmlinux-$(KERNELRELEASE)
778 $(Q)install -D -m 755 vmlinuz $(INSTALL_PATH)/vmlinuz-$(KERNELRELEASE)
729 $(Q)install -D -m 644 .config $(INSTALL_PATH)/config-$(KERNELRELEASE) 779 $(Q)install -D -m 644 .config $(INSTALL_PATH)/config-$(KERNELRELEASE)
730 $(Q)install -D -m 644 System.map $(INSTALL_PATH)/System.map-$(KERNELRELEASE) 780 $(Q)install -D -m 644 System.map $(INSTALL_PATH)/System.map-$(KERNELRELEASE)
731 781
732archclean: 782archclean:
733 @$(MAKE) $(clean)=arch/mips/boot 783 @$(MAKE) $(clean)=arch/mips/boot
784 @$(MAKE) $(clean)=arch/mips/boot/compressed
734 @$(MAKE) $(clean)=arch/mips/lasat 785 @$(MAKE) $(clean)=arch/mips/lasat
735 786
736define archhelp 787define archhelp
@@ -738,10 +789,18 @@ define archhelp
738 echo ' vmlinux.ecoff - ECOFF boot image' 789 echo ' vmlinux.ecoff - ECOFF boot image'
739 echo ' vmlinux.bin - Raw binary boot image' 790 echo ' vmlinux.bin - Raw binary boot image'
740 echo ' vmlinux.srec - SREC boot image' 791 echo ' vmlinux.srec - SREC boot image'
792 echo ' vmlinuz - Compressed boot(zboot) image'
793 echo ' vmlinuz.ecoff - ECOFF zboot image'
794 echo ' vmlinuz.bin - Raw binary zboot image'
795 echo ' vmlinuz.srec - SREC zboot image'
741 echo 796 echo
742 echo ' These will be default as apropriate for a configured platform.' 797 echo ' These will be default as apropriate for a configured platform.'
743endef 798endef
744 799
745CLEAN_FILES += vmlinux.32 \ 800CLEAN_FILES += vmlinux.32 \
746 vmlinux.64 \ 801 vmlinux.64 \
747 vmlinux.ecoff 802 vmlinux.ecoff \
803 vmlinuz \
804 vmlinuz.ecoff \
805 vmlinuz.bin \
806 vmlinuz.srec