diff options
Diffstat (limited to 'arch/mips/Makefile')
| -rw-r--r-- | arch/mips/Makefile | 83 |
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 |
| 49 | endif | 49 | endif |
| 50 | 50 | ||
| 51 | ifndef CONFIG_FUNCTION_TRACER | ||
| 51 | cflags-y := -ffunction-sections | 52 | cflags-y := -ffunction-sections |
| 53 | endif | ||
| 54 | ifdef 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 | ||
| 60 | endif | ||
| 52 | cflags-y += $(call cc-option, -mno-check-zero-division) | 61 | cflags-y += $(call cc-option, -mno-check-zero-division) |
| 53 | 62 | ||
| 54 | ifdef CONFIG_32BIT | 63 | ifdef CONFIG_32BIT |
| @@ -69,6 +78,7 @@ endif | |||
| 69 | 78 | ||
| 70 | all-$(CONFIG_BOOT_ELF32) := $(vmlinux-32) | 79 | all-$(CONFIG_BOOT_ELF32) := $(vmlinux-32) |
| 71 | all-$(CONFIG_BOOT_ELF64) := $(vmlinux-64) | 80 | all-$(CONFIG_BOOT_ELF64) := $(vmlinux-64) |
| 81 | all-$(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 | |||
| 124 | cflags-$(CONFIG_CPU_LOONGSON2) += -Wa,--trap | 134 | cflags-$(CONFIG_CPU_LOONGSON2) += -Wa,--trap |
| 125 | cflags-$(CONFIG_CPU_LOONGSON2E) += \ | 135 | cflags-$(CONFIG_CPU_LOONGSON2E) += \ |
| 126 | $(call cc-option,-march=loongson2e,-march=r4600) | 136 | $(call cc-option,-march=loongson2e,-march=r4600) |
| 137 | cflags-$(CONFIG_CPU_LOONGSON2F) += \ | ||
| 138 | $(call cc-option,-march=loongson2f,-march=r4600) | ||
| 139 | # enable the workarounds for loongson2f | ||
| 140 | ifdef 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 | ||
| 151 | endif | ||
| 127 | 152 | ||
| 128 | cflags-$(CONFIG_CPU_MIPS32_R1) += $(call cc-option,-march=mips32,-mips32 -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS32) \ | 153 | cflags-$(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/ | |||
| 173 | libs-y += arch/mips/fw/lib/ | 198 | libs-y += arch/mips/fw/lib/ |
| 174 | 199 | ||
| 175 | # | 200 | # |
| 201 | # Kernel compression | ||
| 202 | # | ||
| 203 | ifdef SYS_SUPPORTS_ZBOOT | ||
| 204 | COMPRESSION_FNAME = vmlinuz | ||
| 205 | else | ||
| 206 | COMPRESSION_FNAME = vmlinux | ||
| 207 | endif | ||
| 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 | # |
| 323 | core-$(CONFIG_MACH_LOONGSON) +=arch/mips/loongson/ | 357 | core-$(CONFIG_MACH_LOONGSON) += arch/mips/loongson/ |
| 324 | cflags-$(CONFIG_MACH_LOONGSON) += -I$(srctree)/arch/mips/include/asm/mach-loongson \ | 358 | cflags-$(CONFIG_MACH_LOONGSON) += -I$(srctree)/arch/mips/include/asm/mach-loongson \ |
| 325 | -mno-branch-likely | 359 | -mno-branch-likely |
| 326 | load-$(CONFIG_LEMOTE_FULOONG2E) +=0xffffffff80100000 | 360 | load-$(CONFIG_LEMOTE_FULOONG2E) += 0xffffffff80100000 |
| 361 | load-$(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 | |||
| 331 | core-$(CONFIG_MIPS_MALTA) += arch/mips/mti-malta/ | 366 | core-$(CONFIG_MIPS_MALTA) += arch/mips/mti-malta/ |
| 332 | cflags-$(CONFIG_MIPS_MALTA) += -I$(srctree)/arch/mips/include/asm/mach-malta | 367 | cflags-$(CONFIG_MIPS_MALTA) += -I$(srctree)/arch/mips/include/asm/mach-malta |
| 333 | load-$(CONFIG_MIPS_MALTA) += 0xffffffff80100000 | 368 | load-$(CONFIG_MIPS_MALTA) += 0xffffffff80100000 |
| 334 | all-$(CONFIG_MIPS_MALTA) := vmlinux.bin | 369 | all-$(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 | |||
| 356 | load-$(CONFIG_PMC_YOSEMITE) += 0xffffffff80100000 | 391 | load-$(CONFIG_PMC_YOSEMITE) += 0xffffffff80100000 |
| 357 | 392 | ||
| 358 | # | 393 | # |
| 359 | # Basler eXcite | ||
| 360 | # | ||
| 361 | core-$(CONFIG_BASLER_EXCITE) += arch/mips/basler/excite/ | ||
| 362 | cflags-$(CONFIG_BASLER_EXCITE) += -I$(srctree)/arch/mips/include/asm/mach-excite | ||
| 363 | load-$(CONFIG_BASLER_EXCITE) += 0x80100000 | ||
| 364 | |||
| 365 | # | ||
| 366 | # LASAT platforms | 394 | # LASAT platforms |
| 367 | # | 395 | # |
| 368 | core-$(CONFIG_LASAT) += arch/mips/lasat/ | 396 | core-$(CONFIG_LASAT) += arch/mips/lasat/ |
| @@ -441,6 +469,13 @@ core-$(CONFIG_NEC_MARKEINS) += arch/mips/emma/markeins/ | |||
| 441 | load-$(CONFIG_NEC_MARKEINS) += 0xffffffff88100000 | 469 | load-$(CONFIG_NEC_MARKEINS) += 0xffffffff88100000 |
| 442 | 470 | ||
| 443 | # | 471 | # |
| 472 | # Cisco PowerTV Platform | ||
| 473 | # | ||
| 474 | core-$(CONFIG_POWERTV) += arch/mips/powertv/ | ||
| 475 | cflags-$(CONFIG_POWERTV) += -I$(srctree)/arch/mips/include/asm/mach-powertv | ||
| 476 | load-$(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 | |||
| 581 | else | 616 | else |
| 582 | load-$(CONFIG_SNI_RM) += 0xffffffff80030000 | 617 | load-$(CONFIG_SNI_RM) += 0xffffffff80030000 |
| 583 | endif | 618 | endif |
| 584 | all-$(CONFIG_SNI_RM) := vmlinux.ecoff | 619 | all-$(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 | ||
| 701 | makeboot =$(Q)$(MAKE) $(build)=arch/mips/boot VMLINUX=$(vmlinux-32) $(1) | 736 | makeboot =$(Q)$(MAKE) $(build)=arch/mips/boot VMLINUX=$(vmlinux-32) $(1) |
| 737 | makezboot =$(Q)$(MAKE) $(build)=arch/mips/boot/compressed \ | ||
| 738 | VMLINUX_LOAD_ADDRESS=$(load-y) 32bit-bfd=$(32bit-bfd) $(1) | ||
| 702 | 739 | ||
| 703 | all: $(all-y) | 740 | all: $(all-y) |
| 704 | 741 | ||
| 742 | vmlinuz: vmlinux FORCE | ||
| 743 | +@$(call makezboot,$@) | ||
| 744 | |||
| 745 | vmlinuz.bin: vmlinux | ||
| 746 | +@$(call makezboot,$@) | ||
| 747 | |||
| 748 | vmlinuz.ecoff: vmlinux | ||
| 749 | +@$(call makezboot,$@) | ||
| 750 | |||
| 751 | vmlinuz.srec: vmlinux | ||
| 752 | +@$(call makezboot,$@) | ||
| 753 | |||
| 705 | vmlinux.bin: $(vmlinux-32) | 754 | vmlinux.bin: $(vmlinux-32) |
| 706 | +@$(call makeboot,$@) | 755 | +@$(call makeboot,$@) |
| 707 | 756 | ||
| @@ -726,11 +775,13 @@ endif | |||
| 726 | 775 | ||
| 727 | install: | 776 | install: |
| 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 | ||
| 732 | archclean: | 782 | archclean: |
| 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 | ||
| 736 | define archhelp | 787 | define 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.' |
| 743 | endef | 798 | endef |
| 744 | 799 | ||
| 745 | CLEAN_FILES += vmlinux.32 \ | 800 | CLEAN_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 | ||
