1*4882a593Smuzhiyun# This file is included by the global makefile so that you can add your own 2*4882a593Smuzhiyun# architecture-specific flags and dependencies. Remember to do have actions 3*4882a593Smuzhiyun# for "archclean" and "archdep" for cleaning up and making dependencies for 4*4882a593Smuzhiyun# this architecture. 5*4882a593Smuzhiyun# 6*4882a593Smuzhiyun# This file is subject to the terms and conditions of the GNU General Public 7*4882a593Smuzhiyun# License. See the file "COPYING" in the main directory of this archive 8*4882a593Smuzhiyun# for more details. 9*4882a593Smuzhiyun# 10*4882a593Smuzhiyun# Copyright (C) 1994 by Linus Torvalds 11*4882a593Smuzhiyun# Changes for PPC by Gary Thomas 12*4882a593Smuzhiyun# Rewritten by Cort Dougan and Paul Mackerras 13*4882a593Smuzhiyun# 14*4882a593Smuzhiyun 15*4882a593SmuzhiyunHAS_BIARCH := $(call cc-option-yn, -m32) 16*4882a593Smuzhiyun 17*4882a593Smuzhiyun# Set default 32 bits cross compilers for vdso and boot wrapper 18*4882a593SmuzhiyunCROSS32_COMPILE ?= 19*4882a593Smuzhiyun 20*4882a593Smuzhiyun# If we're on a ppc/ppc64/ppc64le machine use that defconfig, otherwise just use 21*4882a593Smuzhiyun# ppc64_defconfig because we have nothing better to go on. 22*4882a593Smuzhiyununame := $(shell uname -m) 23*4882a593SmuzhiyunKBUILD_DEFCONFIG := $(if $(filter ppc%,$(uname)),$(uname),ppc64)_defconfig 24*4882a593Smuzhiyun 25*4882a593Smuzhiyunnew_nm := $(shell if $(NM) --help 2>&1 | grep -- '--synthetic' > /dev/null; then echo y; else echo n; fi) 26*4882a593Smuzhiyun 27*4882a593Smuzhiyunifeq ($(new_nm),y) 28*4882a593SmuzhiyunNM := $(NM) --synthetic 29*4882a593Smuzhiyunendif 30*4882a593Smuzhiyun 31*4882a593Smuzhiyun# BITS is used as extension for files which are available in a 32 bit 32*4882a593Smuzhiyun# and a 64 bit version to simplify shared Makefiles. 33*4882a593Smuzhiyun# e.g.: obj-y += foo_$(BITS).o 34*4882a593Smuzhiyunexport BITS 35*4882a593Smuzhiyun 36*4882a593Smuzhiyunifdef CONFIG_PPC64 37*4882a593Smuzhiyun BITS := 64 38*4882a593Smuzhiyunelse 39*4882a593Smuzhiyun BITS := 32 40*4882a593Smuzhiyunendif 41*4882a593Smuzhiyun 42*4882a593Smuzhiyunmachine-y = ppc 43*4882a593Smuzhiyunmachine-$(CONFIG_PPC64) += 64 44*4882a593Smuzhiyunmachine-$(CONFIG_CPU_LITTLE_ENDIAN) += le 45*4882a593SmuzhiyunUTS_MACHINE := $(subst $(space),,$(machine-y)) 46*4882a593Smuzhiyun 47*4882a593Smuzhiyun# XXX This needs to be before we override LD below 48*4882a593Smuzhiyunifdef CONFIG_PPC32 49*4882a593SmuzhiyunKBUILD_LDFLAGS_MODULE += arch/powerpc/lib/crtsavres.o 50*4882a593Smuzhiyunelse 51*4882a593Smuzhiyunifeq ($(call ld-ifversion, -ge, 225000000, y),y) 52*4882a593Smuzhiyun# Have the linker provide sfpr if possible. 53*4882a593Smuzhiyun# There is a corresponding test in arch/powerpc/lib/Makefile 54*4882a593SmuzhiyunKBUILD_LDFLAGS_MODULE += --save-restore-funcs 55*4882a593Smuzhiyunelse 56*4882a593SmuzhiyunKBUILD_LDFLAGS_MODULE += arch/powerpc/lib/crtsavres.o 57*4882a593Smuzhiyunendif 58*4882a593Smuzhiyunendif 59*4882a593Smuzhiyun 60*4882a593Smuzhiyunifdef CONFIG_CPU_LITTLE_ENDIAN 61*4882a593SmuzhiyunKBUILD_CFLAGS += -mlittle-endian 62*4882a593SmuzhiyunKBUILD_LDFLAGS += -EL 63*4882a593SmuzhiyunLDEMULATION := lppc 64*4882a593SmuzhiyunGNUTARGET := powerpcle 65*4882a593SmuzhiyunMULTIPLEWORD := -mno-multiple 66*4882a593SmuzhiyunKBUILD_CFLAGS_MODULE += $(call cc-option,-mno-save-toc-indirect) 67*4882a593Smuzhiyunelse 68*4882a593SmuzhiyunKBUILD_CFLAGS += $(call cc-option,-mbig-endian) 69*4882a593SmuzhiyunKBUILD_LDFLAGS += -EB 70*4882a593SmuzhiyunLDEMULATION := ppc 71*4882a593SmuzhiyunGNUTARGET := powerpc 72*4882a593SmuzhiyunMULTIPLEWORD := -mmultiple 73*4882a593Smuzhiyunendif 74*4882a593Smuzhiyun 75*4882a593Smuzhiyunifdef CONFIG_PPC64 76*4882a593Smuzhiyunifndef CONFIG_CC_IS_CLANG 77*4882a593Smuzhiyuncflags-$(CONFIG_CPU_BIG_ENDIAN) += $(call cc-option,-mabi=elfv1) 78*4882a593Smuzhiyuncflags-$(CONFIG_CPU_BIG_ENDIAN) += $(call cc-option,-mcall-aixdesc) 79*4882a593Smuzhiyunaflags-$(CONFIG_CPU_BIG_ENDIAN) += $(call cc-option,-mabi=elfv1) 80*4882a593Smuzhiyunaflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -mabi=elfv2 81*4882a593Smuzhiyunendif 82*4882a593Smuzhiyunendif 83*4882a593Smuzhiyun 84*4882a593Smuzhiyunifndef CONFIG_CC_IS_CLANG 85*4882a593Smuzhiyun cflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -mno-strict-align 86*4882a593Smuzhiyunendif 87*4882a593Smuzhiyun 88*4882a593Smuzhiyuncflags-$(CONFIG_CPU_BIG_ENDIAN) += $(call cc-option,-mbig-endian) 89*4882a593Smuzhiyuncflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -mlittle-endian 90*4882a593Smuzhiyunaflags-$(CONFIG_CPU_BIG_ENDIAN) += $(call cc-option,-mbig-endian) 91*4882a593Smuzhiyunaflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -mlittle-endian 92*4882a593Smuzhiyun 93*4882a593Smuzhiyunifeq ($(HAS_BIARCH),y) 94*4882a593SmuzhiyunKBUILD_CFLAGS += -m$(BITS) 95*4882a593SmuzhiyunKBUILD_AFLAGS += -m$(BITS) -Wl,-a$(BITS) 96*4882a593SmuzhiyunKBUILD_LDFLAGS += -m elf$(BITS)$(LDEMULATION) 97*4882a593Smuzhiyunendif 98*4882a593Smuzhiyun 99*4882a593Smuzhiyuncflags-$(CONFIG_STACKPROTECTOR) += -mstack-protector-guard=tls 100*4882a593Smuzhiyunifdef CONFIG_PPC64 101*4882a593Smuzhiyuncflags-$(CONFIG_STACKPROTECTOR) += -mstack-protector-guard-reg=r13 102*4882a593Smuzhiyunelse 103*4882a593Smuzhiyuncflags-$(CONFIG_STACKPROTECTOR) += -mstack-protector-guard-reg=r2 104*4882a593Smuzhiyunendif 105*4882a593Smuzhiyun 106*4882a593SmuzhiyunLDFLAGS_vmlinux-y := -Bstatic 107*4882a593SmuzhiyunLDFLAGS_vmlinux-$(CONFIG_RELOCATABLE) := -pie 108*4882a593SmuzhiyunLDFLAGS_vmlinux := $(LDFLAGS_vmlinux-y) 109*4882a593Smuzhiyun 110*4882a593Smuzhiyunifdef CONFIG_PPC64 111*4882a593Smuzhiyunifeq ($(call cc-option-yn,-mcmodel=medium),y) 112*4882a593Smuzhiyun # -mcmodel=medium breaks modules because it uses 32bit offsets from 113*4882a593Smuzhiyun # the TOC pointer to create pointers where possible. Pointers into the 114*4882a593Smuzhiyun # percpu data area are created by this method. 115*4882a593Smuzhiyun # 116*4882a593Smuzhiyun # The kernel module loader relocates the percpu data section from the 117*4882a593Smuzhiyun # original location (starting with 0xd...) to somewhere in the base 118*4882a593Smuzhiyun # kernel percpu data space (starting with 0xc...). We need a full 119*4882a593Smuzhiyun # 64bit relocation for this to work, hence -mcmodel=large. 120*4882a593Smuzhiyun KBUILD_CFLAGS_MODULE += -mcmodel=large 121*4882a593Smuzhiyunelse 122*4882a593Smuzhiyun export NO_MINIMAL_TOC := -mno-minimal-toc 123*4882a593Smuzhiyunendif 124*4882a593Smuzhiyunendif 125*4882a593Smuzhiyun 126*4882a593SmuzhiyunCFLAGS-$(CONFIG_PPC64) := $(call cc-option,-mtraceback=no) 127*4882a593Smuzhiyunifndef CONFIG_CC_IS_CLANG 128*4882a593Smuzhiyunifdef CONFIG_CPU_LITTLE_ENDIAN 129*4882a593SmuzhiyunCFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mabi=elfv2,$(call cc-option,-mcall-aixdesc)) 130*4882a593SmuzhiyunAFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mabi=elfv2) 131*4882a593Smuzhiyunelse 132*4882a593SmuzhiyunCFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mabi=elfv1) 133*4882a593SmuzhiyunCFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mcall-aixdesc) 134*4882a593SmuzhiyunAFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mabi=elfv1) 135*4882a593Smuzhiyunendif 136*4882a593Smuzhiyunendif 137*4882a593SmuzhiyunCFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mcmodel=medium,$(call cc-option,-mminimal-toc)) 138*4882a593SmuzhiyunCFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mno-pointers-to-nested-functions) 139*4882a593Smuzhiyun 140*4882a593Smuzhiyun# Clang unconditionally reserves r2 on ppc32 and does not support the flag 141*4882a593Smuzhiyun# https://bugs.llvm.org/show_bug.cgi?id=39555 142*4882a593SmuzhiyunCFLAGS-$(CONFIG_PPC32) := $(call cc-option, -ffixed-r2) 143*4882a593Smuzhiyun 144*4882a593Smuzhiyun# Clang doesn't support -mmultiple / -mno-multiple 145*4882a593Smuzhiyun# https://bugs.llvm.org/show_bug.cgi?id=39556 146*4882a593SmuzhiyunCFLAGS-$(CONFIG_PPC32) += $(call cc-option, $(MULTIPLEWORD)) 147*4882a593Smuzhiyun 148*4882a593SmuzhiyunCFLAGS-$(CONFIG_PPC32) += $(call cc-option,-mno-readonly-in-sdata) 149*4882a593Smuzhiyun 150*4882a593Smuzhiyunifdef CONFIG_PPC_BOOK3S_64 151*4882a593Smuzhiyunifdef CONFIG_CPU_LITTLE_ENDIAN 152*4882a593SmuzhiyunCFLAGS-$(CONFIG_GENERIC_CPU) += -mcpu=power8 153*4882a593SmuzhiyunCFLAGS-$(CONFIG_GENERIC_CPU) += $(call cc-option,-mtune=power9,-mtune=power8) 154*4882a593Smuzhiyunelse 155*4882a593SmuzhiyunCFLAGS-$(CONFIG_GENERIC_CPU) += $(call cc-option,-mtune=power7,$(call cc-option,-mtune=power5)) 156*4882a593SmuzhiyunCFLAGS-$(CONFIG_GENERIC_CPU) += -mcpu=power4 157*4882a593Smuzhiyunendif 158*4882a593Smuzhiyunelse ifdef CONFIG_PPC_BOOK3E_64 159*4882a593SmuzhiyunCFLAGS-$(CONFIG_GENERIC_CPU) += -mcpu=powerpc64 160*4882a593Smuzhiyunendif 161*4882a593Smuzhiyun 162*4882a593Smuzhiyunifdef CONFIG_FUNCTION_TRACER 163*4882a593SmuzhiyunCC_FLAGS_FTRACE := -pg 164*4882a593Smuzhiyunifdef CONFIG_MPROFILE_KERNEL 165*4882a593SmuzhiyunCC_FLAGS_FTRACE += -mprofile-kernel 166*4882a593Smuzhiyunendif 167*4882a593Smuzhiyun# Work around gcc code-gen bugs with -pg / -fno-omit-frame-pointer in gcc <= 4.8 168*4882a593Smuzhiyun# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=44199 169*4882a593Smuzhiyun# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52828 170*4882a593Smuzhiyunifndef CONFIG_CC_IS_CLANG 171*4882a593SmuzhiyunCC_FLAGS_FTRACE += $(call cc-ifversion, -lt, 0409, -mno-sched-epilog) 172*4882a593Smuzhiyunendif 173*4882a593Smuzhiyunendif 174*4882a593Smuzhiyun 175*4882a593SmuzhiyunCFLAGS-$(CONFIG_TARGET_CPU_BOOL) += $(call cc-option,-mcpu=$(CONFIG_TARGET_CPU)) 176*4882a593SmuzhiyunAFLAGS-$(CONFIG_TARGET_CPU_BOOL) += $(call cc-option,-mcpu=$(CONFIG_TARGET_CPU)) 177*4882a593Smuzhiyun 178*4882a593Smuzhiyun# Altivec option not allowed with e500mc64 in GCC. 179*4882a593Smuzhiyunifdef CONFIG_ALTIVEC 180*4882a593SmuzhiyunE5500_CPU := -mcpu=powerpc64 181*4882a593Smuzhiyunelse 182*4882a593SmuzhiyunE5500_CPU := $(call cc-option,-mcpu=e500mc64,-mcpu=powerpc64) 183*4882a593Smuzhiyunendif 184*4882a593SmuzhiyunCFLAGS-$(CONFIG_E5500_CPU) += $(E5500_CPU) 185*4882a593SmuzhiyunCFLAGS-$(CONFIG_E6500_CPU) += $(call cc-option,-mcpu=e6500,$(E5500_CPU)) 186*4882a593Smuzhiyun 187*4882a593Smuzhiyunasinstr := $(call as-instr,lis 9$(comma)foo@high,-DHAVE_AS_ATHIGH=1) 188*4882a593Smuzhiyun 189*4882a593SmuzhiyunKBUILD_CPPFLAGS += -I $(srctree)/arch/$(ARCH) $(asinstr) 190*4882a593SmuzhiyunKBUILD_AFLAGS += $(AFLAGS-y) 191*4882a593SmuzhiyunKBUILD_CFLAGS += $(call cc-option,-msoft-float) 192*4882a593SmuzhiyunKBUILD_CFLAGS += -pipe $(CFLAGS-y) 193*4882a593SmuzhiyunCPP = $(CC) -E $(KBUILD_CFLAGS) 194*4882a593Smuzhiyun 195*4882a593SmuzhiyunCHECKFLAGS += -m$(BITS) -D__powerpc__ -D__powerpc$(BITS)__ 196*4882a593Smuzhiyunifdef CONFIG_CPU_BIG_ENDIAN 197*4882a593SmuzhiyunCHECKFLAGS += -D__BIG_ENDIAN__ 198*4882a593Smuzhiyunelse 199*4882a593SmuzhiyunCHECKFLAGS += -D__LITTLE_ENDIAN__ 200*4882a593Smuzhiyunendif 201*4882a593Smuzhiyun 202*4882a593Smuzhiyunifdef CONFIG_476FPE_ERR46 203*4882a593Smuzhiyun KBUILD_LDFLAGS_MODULE += --ppc476-workaround \ 204*4882a593Smuzhiyun -T $(srctree)/arch/powerpc/platforms/44x/ppc476_modules.lds 205*4882a593Smuzhiyunendif 206*4882a593Smuzhiyun 207*4882a593Smuzhiyun# No AltiVec or VSX instructions when building kernel 208*4882a593SmuzhiyunKBUILD_CFLAGS += $(call cc-option,-mno-altivec) 209*4882a593SmuzhiyunKBUILD_CFLAGS += $(call cc-option,-mno-vsx) 210*4882a593Smuzhiyun 211*4882a593Smuzhiyun# No SPE instruction when building kernel 212*4882a593Smuzhiyun# (We use all available options to help semi-broken compilers) 213*4882a593SmuzhiyunKBUILD_CFLAGS += $(call cc-option,-mno-spe) 214*4882a593SmuzhiyunKBUILD_CFLAGS += $(call cc-option,-mspe=no) 215*4882a593Smuzhiyun 216*4882a593Smuzhiyun# Don't emit .eh_frame since we have no use for it 217*4882a593SmuzhiyunKBUILD_CFLAGS += -fno-asynchronous-unwind-tables 218*4882a593Smuzhiyun 219*4882a593Smuzhiyun# Never use string load/store instructions as they are 220*4882a593Smuzhiyun# often slow when they are implemented at all 221*4882a593SmuzhiyunKBUILD_CFLAGS += $(call cc-option,-mno-string) 222*4882a593Smuzhiyun 223*4882a593Smuzhiyuncpu-as-$(CONFIG_40x) += -Wa,-m405 224*4882a593Smuzhiyuncpu-as-$(CONFIG_44x) += -Wa,-m440 225*4882a593Smuzhiyuncpu-as-$(CONFIG_ALTIVEC) += $(call as-option,-Wa$(comma)-maltivec) 226*4882a593Smuzhiyuncpu-as-$(CONFIG_E500) += -Wa,-me500 227*4882a593Smuzhiyun 228*4882a593Smuzhiyun# When using '-many -mpower4' gas will first try and find a matching power4 229*4882a593Smuzhiyun# mnemonic and failing that it will allow any valid mnemonic that GAS knows 230*4882a593Smuzhiyun# about. GCC will pass -many to GAS when assembling, clang does not. 231*4882a593Smuzhiyuncpu-as-$(CONFIG_PPC_BOOK3S_64) += -Wa,-mpower4 -Wa,-many 232*4882a593Smuzhiyuncpu-as-$(CONFIG_PPC_E500MC) += $(call as-option,-Wa$(comma)-me500mc) 233*4882a593Smuzhiyun 234*4882a593SmuzhiyunKBUILD_AFLAGS += $(cpu-as-y) 235*4882a593SmuzhiyunKBUILD_CFLAGS += $(cpu-as-y) 236*4882a593Smuzhiyun 237*4882a593SmuzhiyunKBUILD_AFLAGS += $(aflags-y) 238*4882a593SmuzhiyunKBUILD_CFLAGS += $(cflags-y) 239*4882a593Smuzhiyun 240*4882a593Smuzhiyunhead-$(CONFIG_PPC64) := arch/powerpc/kernel/head_64.o 241*4882a593Smuzhiyunhead-$(CONFIG_PPC_BOOK3S_32) := arch/powerpc/kernel/head_book3s_32.o 242*4882a593Smuzhiyunhead-$(CONFIG_PPC_8xx) := arch/powerpc/kernel/head_8xx.o 243*4882a593Smuzhiyunhead-$(CONFIG_40x) := arch/powerpc/kernel/head_40x.o 244*4882a593Smuzhiyunhead-$(CONFIG_44x) := arch/powerpc/kernel/head_44x.o 245*4882a593Smuzhiyunhead-$(CONFIG_FSL_BOOKE) := arch/powerpc/kernel/head_fsl_booke.o 246*4882a593Smuzhiyun 247*4882a593Smuzhiyunhead-$(CONFIG_PPC64) += arch/powerpc/kernel/entry_64.o 248*4882a593Smuzhiyunhead-$(CONFIG_PPC_FPU) += arch/powerpc/kernel/fpu.o 249*4882a593Smuzhiyunhead-$(CONFIG_ALTIVEC) += arch/powerpc/kernel/vector.o 250*4882a593Smuzhiyunhead-$(CONFIG_PPC_OF_BOOT_TRAMPOLINE) += arch/powerpc/kernel/prom_init.o 251*4882a593Smuzhiyun 252*4882a593Smuzhiyun# See arch/powerpc/Kbuild for content of core part of the kernel 253*4882a593Smuzhiyuncore-y += arch/powerpc/ 254*4882a593Smuzhiyun 255*4882a593Smuzhiyundrivers-$(CONFIG_OPROFILE) += arch/powerpc/oprofile/ 256*4882a593Smuzhiyun 257*4882a593Smuzhiyun# Default to zImage, override when needed 258*4882a593Smuzhiyunall: zImage 259*4882a593Smuzhiyun 260*4882a593Smuzhiyun# With make 3.82 we cannot mix normal and wildcard targets 261*4882a593SmuzhiyunBOOT_TARGETS1 := zImage zImage.initrd uImage 262*4882a593SmuzhiyunBOOT_TARGETS2 := zImage% dtbImage% treeImage.% cuImage.% simpleImage.% uImage.% 263*4882a593Smuzhiyun 264*4882a593SmuzhiyunPHONY += $(BOOT_TARGETS1) $(BOOT_TARGETS2) 265*4882a593Smuzhiyun 266*4882a593Smuzhiyunboot := arch/$(ARCH)/boot 267*4882a593Smuzhiyun 268*4882a593Smuzhiyun$(BOOT_TARGETS1): vmlinux 269*4882a593Smuzhiyun $(Q)$(MAKE) $(build)=$(boot) $(patsubst %,$(boot)/%,$@) 270*4882a593Smuzhiyun$(BOOT_TARGETS2): vmlinux 271*4882a593Smuzhiyun $(Q)$(MAKE) $(build)=$(boot) $(patsubst %,$(boot)/%,$@) 272*4882a593Smuzhiyun 273*4882a593Smuzhiyun 274*4882a593SmuzhiyunPHONY += bootwrapper_install 275*4882a593Smuzhiyunbootwrapper_install: 276*4882a593Smuzhiyun $(Q)$(MAKE) $(build)=$(boot) $(patsubst %,$(boot)/%,$@) 277*4882a593Smuzhiyun 278*4882a593Smuzhiyun# Used to create 'merged defconfigs' 279*4882a593Smuzhiyun# To use it $(call) it with the first argument as the base defconfig 280*4882a593Smuzhiyun# and the second argument as a space separated list of .config files to merge, 281*4882a593Smuzhiyun# without the .config suffix. 282*4882a593Smuzhiyundefine merge_into_defconfig 283*4882a593Smuzhiyun $(Q)$(CONFIG_SHELL) $(srctree)/scripts/kconfig/merge_config.sh \ 284*4882a593Smuzhiyun -m -O $(objtree) $(srctree)/arch/$(ARCH)/configs/$(1) \ 285*4882a593Smuzhiyun $(foreach config,$(2),$(srctree)/arch/$(ARCH)/configs/$(config).config) 286*4882a593Smuzhiyun +$(Q)$(MAKE) -f $(srctree)/Makefile olddefconfig 287*4882a593Smuzhiyunendef 288*4882a593Smuzhiyun 289*4882a593SmuzhiyunPHONY += pseries_le_defconfig 290*4882a593Smuzhiyunpseries_le_defconfig: 291*4882a593Smuzhiyun $(call merge_into_defconfig,pseries_defconfig,le) 292*4882a593Smuzhiyun 293*4882a593SmuzhiyunPHONY += ppc64le_defconfig 294*4882a593Smuzhiyunppc64le_defconfig: 295*4882a593Smuzhiyun $(call merge_into_defconfig,ppc64_defconfig,le) 296*4882a593Smuzhiyun 297*4882a593SmuzhiyunPHONY += ppc64le_guest_defconfig 298*4882a593Smuzhiyunppc64le_guest_defconfig: 299*4882a593Smuzhiyun $(call merge_into_defconfig,ppc64_defconfig,le guest) 300*4882a593Smuzhiyun 301*4882a593SmuzhiyunPHONY += ppc64_guest_defconfig 302*4882a593Smuzhiyunppc64_guest_defconfig: 303*4882a593Smuzhiyun $(call merge_into_defconfig,ppc64_defconfig,be guest) 304*4882a593Smuzhiyun 305*4882a593SmuzhiyunPHONY += powernv_be_defconfig 306*4882a593Smuzhiyunpowernv_be_defconfig: 307*4882a593Smuzhiyun $(call merge_into_defconfig,powernv_defconfig,be) 308*4882a593Smuzhiyun 309*4882a593SmuzhiyunPHONY += mpc85xx_defconfig 310*4882a593Smuzhiyunmpc85xx_defconfig: 311*4882a593Smuzhiyun $(call merge_into_defconfig,mpc85xx_base.config,\ 312*4882a593Smuzhiyun 85xx-32bit 85xx-hw fsl-emb-nonhw) 313*4882a593Smuzhiyun 314*4882a593SmuzhiyunPHONY += mpc85xx_smp_defconfig 315*4882a593Smuzhiyunmpc85xx_smp_defconfig: 316*4882a593Smuzhiyun $(call merge_into_defconfig,mpc85xx_base.config,\ 317*4882a593Smuzhiyun 85xx-32bit 85xx-smp 85xx-hw fsl-emb-nonhw) 318*4882a593Smuzhiyun 319*4882a593SmuzhiyunPHONY += corenet32_smp_defconfig 320*4882a593Smuzhiyuncorenet32_smp_defconfig: 321*4882a593Smuzhiyun $(call merge_into_defconfig,corenet_base.config,\ 322*4882a593Smuzhiyun 85xx-32bit 85xx-smp 85xx-hw fsl-emb-nonhw dpaa) 323*4882a593Smuzhiyun 324*4882a593SmuzhiyunPHONY += corenet64_smp_defconfig 325*4882a593Smuzhiyuncorenet64_smp_defconfig: 326*4882a593Smuzhiyun $(call merge_into_defconfig,corenet_base.config,\ 327*4882a593Smuzhiyun 85xx-64bit 85xx-smp altivec 85xx-hw fsl-emb-nonhw dpaa) 328*4882a593Smuzhiyun 329*4882a593SmuzhiyunPHONY += mpc86xx_defconfig 330*4882a593Smuzhiyunmpc86xx_defconfig: 331*4882a593Smuzhiyun $(call merge_into_defconfig,mpc86xx_base.config,\ 332*4882a593Smuzhiyun 86xx-hw fsl-emb-nonhw) 333*4882a593Smuzhiyun 334*4882a593SmuzhiyunPHONY += mpc86xx_smp_defconfig 335*4882a593Smuzhiyunmpc86xx_smp_defconfig: 336*4882a593Smuzhiyun $(call merge_into_defconfig,mpc86xx_base.config,\ 337*4882a593Smuzhiyun 86xx-smp 86xx-hw fsl-emb-nonhw) 338*4882a593Smuzhiyun 339*4882a593SmuzhiyunPHONY += ppc32_allmodconfig 340*4882a593Smuzhiyunppc32_allmodconfig: 341*4882a593Smuzhiyun $(Q)$(MAKE) KCONFIG_ALLCONFIG=$(srctree)/arch/powerpc/configs/book3s_32.config \ 342*4882a593Smuzhiyun -f $(srctree)/Makefile allmodconfig 343*4882a593Smuzhiyun 344*4882a593SmuzhiyunPHONY += ppc_defconfig 345*4882a593Smuzhiyunppc_defconfig: 346*4882a593Smuzhiyun $(call merge_into_defconfig,book3s_32.config,) 347*4882a593Smuzhiyun 348*4882a593SmuzhiyunPHONY += ppc64le_allmodconfig 349*4882a593Smuzhiyunppc64le_allmodconfig: 350*4882a593Smuzhiyun $(Q)$(MAKE) KCONFIG_ALLCONFIG=$(srctree)/arch/powerpc/configs/le.config \ 351*4882a593Smuzhiyun -f $(srctree)/Makefile allmodconfig 352*4882a593Smuzhiyun 353*4882a593SmuzhiyunPHONY += ppc64_book3e_allmodconfig 354*4882a593Smuzhiyunppc64_book3e_allmodconfig: 355*4882a593Smuzhiyun $(Q)$(MAKE) KCONFIG_ALLCONFIG=$(srctree)/arch/powerpc/configs/85xx-64bit.config \ 356*4882a593Smuzhiyun -f $(srctree)/Makefile allmodconfig 357*4882a593Smuzhiyun 358*4882a593Smuzhiyundefine archhelp 359*4882a593Smuzhiyun @echo '* zImage - Build default images selected by kernel config' 360*4882a593Smuzhiyun @echo ' zImage.* - Compressed kernel image (arch/$(ARCH)/boot/zImage.*)' 361*4882a593Smuzhiyun @echo ' uImage - U-Boot native image format' 362*4882a593Smuzhiyun @echo ' cuImage.<dt> - Backwards compatible U-Boot image for older' 363*4882a593Smuzhiyun @echo ' versions which do not support device trees' 364*4882a593Smuzhiyun @echo ' dtbImage.<dt> - zImage with an embedded device tree blob' 365*4882a593Smuzhiyun @echo ' simpleImage.<dt> - Firmware independent image.' 366*4882a593Smuzhiyun @echo ' treeImage.<dt> - Support for older IBM 4xx firmware (not U-Boot)' 367*4882a593Smuzhiyun @echo ' install - Install kernel using' 368*4882a593Smuzhiyun @echo ' (your) ~/bin/$(INSTALLKERNEL) or' 369*4882a593Smuzhiyun @echo ' (distribution) /sbin/$(INSTALLKERNEL) or' 370*4882a593Smuzhiyun @echo ' install to $$(INSTALL_PATH) and run lilo' 371*4882a593Smuzhiyun @echo ' *_defconfig - Select default config from arch/$(ARCH)/configs' 372*4882a593Smuzhiyun @echo '' 373*4882a593Smuzhiyun @echo ' Targets with <dt> embed a device tree blob inside the image' 374*4882a593Smuzhiyun @echo ' These targets support board with firmware that does not' 375*4882a593Smuzhiyun @echo ' support passing a device tree directly. Replace <dt> with the' 376*4882a593Smuzhiyun @echo ' name of a dts file from the arch/$(ARCH)/boot/dts/ directory' 377*4882a593Smuzhiyun @echo ' (minus the .dts extension).' 378*4882a593Smuzhiyunendef 379*4882a593Smuzhiyun 380*4882a593SmuzhiyunPHONY += install 381*4882a593Smuzhiyuninstall: 382*4882a593Smuzhiyun $(Q)$(MAKE) $(build)=$(boot) install 383*4882a593Smuzhiyun 384*4882a593SmuzhiyunPHONY += vdso_install 385*4882a593Smuzhiyunvdso_install: 386*4882a593Smuzhiyunifdef CONFIG_PPC64 387*4882a593Smuzhiyun $(Q)$(MAKE) $(build)=arch/$(ARCH)/kernel/vdso64 $@ 388*4882a593Smuzhiyunendif 389*4882a593Smuzhiyunifdef CONFIG_VDSO32 390*4882a593Smuzhiyun $(Q)$(MAKE) $(build)=arch/$(ARCH)/kernel/vdso32 $@ 391*4882a593Smuzhiyunendif 392*4882a593Smuzhiyun 393*4882a593Smuzhiyunarchclean: 394*4882a593Smuzhiyun $(Q)$(MAKE) $(clean)=$(boot) 395*4882a593Smuzhiyun 396*4882a593Smuzhiyunarchprepare: checkbin 397*4882a593Smuzhiyun 398*4882a593Smuzhiyunarchheaders: 399*4882a593Smuzhiyun $(Q)$(MAKE) $(build)=arch/powerpc/kernel/syscalls all 400*4882a593Smuzhiyun 401*4882a593Smuzhiyunifdef CONFIG_STACKPROTECTOR 402*4882a593Smuzhiyunprepare: stack_protector_prepare 403*4882a593Smuzhiyun 404*4882a593SmuzhiyunPHONY += stack_protector_prepare 405*4882a593Smuzhiyunstack_protector_prepare: prepare0 406*4882a593Smuzhiyunifdef CONFIG_PPC64 407*4882a593Smuzhiyun $(eval KBUILD_CFLAGS += -mstack-protector-guard-offset=$(shell awk '{if ($$2 == "PACA_CANARY") print $$3;}' include/generated/asm-offsets.h)) 408*4882a593Smuzhiyunelse 409*4882a593Smuzhiyun $(eval KBUILD_CFLAGS += -mstack-protector-guard-offset=$(shell awk '{if ($$2 == "TASK_CANARY") print $$3;}' include/generated/asm-offsets.h)) 410*4882a593Smuzhiyunendif 411*4882a593Smuzhiyunendif 412*4882a593Smuzhiyun 413*4882a593Smuzhiyunifdef CONFIG_SMP 414*4882a593Smuzhiyunprepare: task_cpu_prepare 415*4882a593Smuzhiyun 416*4882a593SmuzhiyunPHONY += task_cpu_prepare 417*4882a593Smuzhiyuntask_cpu_prepare: prepare0 418*4882a593Smuzhiyun $(eval KBUILD_CFLAGS += -D_TASK_CPU=$(shell awk '{if ($$2 == "TASK_CPU") print $$3;}' include/generated/asm-offsets.h)) 419*4882a593Smuzhiyunendif 420*4882a593Smuzhiyun 421*4882a593SmuzhiyunPHONY += checkbin 422*4882a593Smuzhiyun# Check toolchain versions: 423*4882a593Smuzhiyun# - gcc-4.6 is the minimum kernel-wide version so nothing required. 424*4882a593Smuzhiyuncheckbin: 425*4882a593Smuzhiyun @if test "x${CONFIG_CPU_LITTLE_ENDIAN}" = "xy" \ 426*4882a593Smuzhiyun && $(LD) --version | head -1 | grep ' 2\.24$$' >/dev/null ; then \ 427*4882a593Smuzhiyun echo -n '*** binutils 2.24 miscompiles weak symbols ' ; \ 428*4882a593Smuzhiyun echo 'in some circumstances.' ; \ 429*4882a593Smuzhiyun echo -n '*** Please use a different binutils version.' ; \ 430*4882a593Smuzhiyun false ; \ 431*4882a593Smuzhiyun fi 432