18e1a6dd2SChris Zankel# 28e1a6dd2SChris Zankel# This file is subject to the terms and conditions of the GNU General Public 38e1a6dd2SChris Zankel# License. See the file "COPYING" in the main directory of this archive 48e1a6dd2SChris Zankel# for more details. 58e1a6dd2SChris Zankel# 68e1a6dd2SChris Zankel# Copyright (C) 2001 - 2005 Tensilica Inc. 7420ae951SMax Filippov# Copyright (C) 2014 Cadence Design Systems Inc. 88e1a6dd2SChris Zankel# 98e1a6dd2SChris Zankel# This file is included by the global makefile so that you can add your own 108212f898SMasahiro Yamada# architecture-specific flags and dependencies. 118e1a6dd2SChris Zankel 128e1a6dd2SChris Zankel# Core configuration. 13173d6681SChris Zankel# (Use VAR=<xtensa_config> to use another default compiler.) 148e1a6dd2SChris Zankel 15129ab0d2SMasahiro Yamadavariant-y := $(CONFIG_XTENSA_VARIANT_NAME) 168e1a6dd2SChris Zankel 17173d6681SChris ZankelVARIANT = $(variant-y) 188e1a6dd2SChris Zankel 1970cefe76SGeert Uytterhoevenifneq ($(VARIANT),) 2023243c1aSMasahiro Yamada ifdef cross_compiling 2170cefe76SGeert Uytterhoeven ifndef CROSS_COMPILE 2270cefe76SGeert Uytterhoeven CROSS_COMPILE = xtensa_$(VARIANT)- 2370cefe76SGeert Uytterhoeven endif 2470cefe76SGeert Uytterhoeven endif 2570cefe76SGeert Uytterhoevenendif 2670cefe76SGeert Uytterhoeven 278e1a6dd2SChris Zankel# Platform configuration 288e1a6dd2SChris Zankel 298e1a6dd2SChris Zankelplatform-$(CONFIG_XTENSA_PLATFORM_XT2000) := xt2000 308e1a6dd2SChris Zankelplatform-$(CONFIG_XTENSA_PLATFORM_ISS) := iss 310d456badSMax Filippovplatform-$(CONFIG_XTENSA_PLATFORM_XTFPGA) := xtfpga 328e1a6dd2SChris Zankel 33b2444d34SChris Zankel# temporarily until string.h is fixed 34a753cd9aSMax FilippovKBUILD_CFLAGS += -ffreestanding -D__linux__ 35f8f02ca7SMax FilippovKBUILD_CFLAGS += -pipe -mlongcalls -mtext-section-literals 36cf1c0aafSChris ZankelKBUILD_CFLAGS += $(call cc-option,-mforce-no-pic,) 377bf5234dSMax FilippovKBUILD_CFLAGS += $(call cc-option,-mno-serialize-volatile,) 38*c20e1117SMax Filippovifneq ($(CONFIG_KERNEL_ABI_CALL0),) 39*c20e1117SMax FilippovKBUILD_CFLAGS += -mabi=call0 40*c20e1117SMax FilippovKBUILD_AFLAGS += -mabi=call0 41*c20e1117SMax Filippovendif 42cf1c0aafSChris Zankel 43f8f02ca7SMax FilippovKBUILD_AFLAGS += -mlongcalls -mtext-section-literals 44f8f02ca7SMax Filippov 4565501622SChris Zankelifneq ($(CONFIG_LD_NO_RELAX),) 46d503ac53SMasahiro YamadaKBUILD_LDFLAGS := --no-relax 4765501622SChris Zankelendif 4865501622SChris Zankel 49c425c546SMasahiro YamadaCHECKFLAGS += -D$(if $(CONFIG_CPU_BIG_ENDIAN),__XTENSA_EB__,__XTENSA_EL__) 5072100ed7SMax Filippov 51367b8112SChris Zankelvardirs := $(patsubst %,arch/xtensa/variants/%/,$(variant-y)) 52367b8112SChris Zankelplfdirs := $(patsubst %,arch/xtensa/platforms/%/,$(platform-y)) 53367b8112SChris Zankel 54367b8112SChris ZankelKBUILD_CPPFLAGS += $(patsubst %,-I$(srctree)/%include,$(vardirs) $(plfdirs)) 55367b8112SChris Zankel 56e7d163f7SChris ZankelKBUILD_DEFCONFIG := iss_defconfig 578e1a6dd2SChris Zankel 5819c5699fSMax Filippovlibs-y += arch/xtensa/lib/ 598e1a6dd2SChris Zankel 608e1a6dd2SChris Zankelboot := arch/xtensa/boot 618e1a6dd2SChris Zankel 627af710d9SMax Filippovall Image zImage uImage xipImage: vmlinux 638e1a6dd2SChris Zankel $(Q)$(MAKE) $(build)=$(boot) $@ 648e1a6dd2SChris Zankel 655eacadb5SFiroz Khanarchheaders: 665eacadb5SFiroz Khan $(Q)$(MAKE) $(build)=arch/xtensa/kernel/syscalls all 675eacadb5SFiroz Khan 688e1a6dd2SChris Zankeldefine archhelp 699a736fcbSMax Filippov @echo '* Image - Kernel ELF image with reset vector' 708e1a6dd2SChris Zankel @echo '* zImage - Compressed kernel image (arch/xtensa/boot/images/zImage.*)' 719a736fcbSMax Filippov @echo '* uImage - U-Boot wrapped image' 727af710d9SMax Filippov @echo ' xipImage - XIP image' 738e1a6dd2SChris Zankelendef 74