Chris Zankel | 8e1a6dd | 2005-06-23 22:01:10 -0700 | [diff] [blame] | 1 | # |
| 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 |
| 4 | # for more details. |
| 5 | # |
| 6 | # Copyright (C) 2001 - 2005 Tensilica Inc. |
Max Filippov | 420ae95 | 2014-06-16 07:25:06 +0400 | [diff] [blame] | 7 | # Copyright (C) 2014 Cadence Design Systems Inc. |
Chris Zankel | 8e1a6dd | 2005-06-23 22:01:10 -0700 | [diff] [blame] | 8 | # |
| 9 | # This file is included by the global makefile so that you can add your own |
Masahiro Yamada | 8212f89 | 2021-10-13 15:36:22 +0900 | [diff] [blame] | 10 | # architecture-specific flags and dependencies. |
Chris Zankel | 8e1a6dd | 2005-06-23 22:01:10 -0700 | [diff] [blame] | 11 | |
| 12 | # Core configuration. |
Chris Zankel | 173d668 | 2006-12-10 02:18:48 -0800 | [diff] [blame] | 13 | # (Use VAR=<xtensa_config> to use another default compiler.) |
Chris Zankel | 8e1a6dd | 2005-06-23 22:01:10 -0700 | [diff] [blame] | 14 | |
Masahiro Yamada | 129ab0d | 2021-12-14 11:53:53 +0900 | [diff] [blame] | 15 | variant-y := $(CONFIG_XTENSA_VARIANT_NAME) |
Chris Zankel | 8e1a6dd | 2005-06-23 22:01:10 -0700 | [diff] [blame] | 16 | |
Chris Zankel | 173d668 | 2006-12-10 02:18:48 -0800 | [diff] [blame] | 17 | VARIANT = $(variant-y) |
Chris Zankel | 8e1a6dd | 2005-06-23 22:01:10 -0700 | [diff] [blame] | 18 | |
Geert Uytterhoeven | 70cefe7 | 2012-05-12 22:39:08 +0200 | [diff] [blame] | 19 | ifneq ($(VARIANT),) |
Masahiro Yamada | 23243c1 | 2021-05-02 02:24:36 +0900 | [diff] [blame] | 20 | ifdef cross_compiling |
Geert Uytterhoeven | 70cefe7 | 2012-05-12 22:39:08 +0200 | [diff] [blame] | 21 | ifndef CROSS_COMPILE |
| 22 | CROSS_COMPILE = xtensa_$(VARIANT)- |
| 23 | endif |
| 24 | endif |
| 25 | endif |
| 26 | |
Chris Zankel | 8e1a6dd | 2005-06-23 22:01:10 -0700 | [diff] [blame] | 27 | # Platform configuration |
| 28 | |
Chris Zankel | 8e1a6dd | 2005-06-23 22:01:10 -0700 | [diff] [blame] | 29 | platform-$(CONFIG_XTENSA_PLATFORM_XT2000) := xt2000 |
| 30 | platform-$(CONFIG_XTENSA_PLATFORM_ISS) := iss |
Max Filippov | 0d456ba | 2012-11-05 07:37:14 +0400 | [diff] [blame] | 31 | platform-$(CONFIG_XTENSA_PLATFORM_XTFPGA) := xtfpga |
Chris Zankel | 8e1a6dd | 2005-06-23 22:01:10 -0700 | [diff] [blame] | 32 | |
Chris Zankel | b2444d3 | 2007-08-04 09:23:54 -0700 | [diff] [blame] | 33 | # temporarily until string.h is fixed |
Max Filippov | a753cd9 | 2012-09-17 05:44:51 +0400 | [diff] [blame] | 34 | KBUILD_CFLAGS += -ffreestanding -D__linux__ |
Max Filippov | f8f02ca | 2017-12-03 20:55:35 -0800 | [diff] [blame] | 35 | KBUILD_CFLAGS += -pipe -mlongcalls -mtext-section-literals |
Chris Zankel | cf1c0aa | 2010-05-02 01:00:22 -0700 | [diff] [blame] | 36 | KBUILD_CFLAGS += $(call cc-option,-mforce-no-pic,) |
Max Filippov | 7bf5234 | 2017-04-28 09:40:00 -0700 | [diff] [blame] | 37 | KBUILD_CFLAGS += $(call cc-option,-mno-serialize-volatile,) |
Chris Zankel | cf1c0aa | 2010-05-02 01:00:22 -0700 | [diff] [blame] | 38 | |
Max Filippov | f8f02ca | 2017-12-03 20:55:35 -0800 | [diff] [blame] | 39 | KBUILD_AFLAGS += -mlongcalls -mtext-section-literals |
| 40 | |
Chris Zankel | 6550162 | 2012-11-13 15:16:36 -0800 | [diff] [blame] | 41 | ifneq ($(CONFIG_LD_NO_RELAX),) |
Masahiro Yamada | d503ac5 | 2018-08-24 08:20:39 +0900 | [diff] [blame] | 42 | KBUILD_LDFLAGS := --no-relax |
Chris Zankel | 6550162 | 2012-11-13 15:16:36 -0800 | [diff] [blame] | 43 | endif |
| 44 | |
Masahiro Yamada | c425c54 | 2021-03-13 21:23:41 +0900 | [diff] [blame] | 45 | CHECKFLAGS += -D$(if $(CONFIG_CPU_BIG_ENDIAN),__XTENSA_EB__,__XTENSA_EL__) |
Max Filippov | 72100ed | 2012-12-11 01:26:25 +0400 | [diff] [blame] | 46 | |
Chris Zankel | 367b811 | 2008-11-06 06:40:46 -0800 | [diff] [blame] | 47 | vardirs := $(patsubst %,arch/xtensa/variants/%/,$(variant-y)) |
| 48 | plfdirs := $(patsubst %,arch/xtensa/platforms/%/,$(platform-y)) |
| 49 | |
Chris Zankel | 367b811 | 2008-11-06 06:40:46 -0800 | [diff] [blame] | 50 | KBUILD_CPPFLAGS += $(patsubst %,-I$(srctree)/%include,$(vardirs) $(plfdirs)) |
Chris Zankel | 367b811 | 2008-11-06 06:40:46 -0800 | [diff] [blame] | 51 | |
Chris Zankel | e7d163f | 2005-06-30 02:58:59 -0700 | [diff] [blame] | 52 | KBUILD_DEFCONFIG := iss_defconfig |
Chris Zankel | 8e1a6dd | 2005-06-23 22:01:10 -0700 | [diff] [blame] | 53 | |
Chris Zankel | f193318 | 2009-04-02 16:58:53 -0700 | [diff] [blame] | 54 | # Find libgcc.a |
Chris Zankel | 8e1a6dd | 2005-06-23 22:01:10 -0700 | [diff] [blame] | 55 | |
Sam Ravnborg | a0f97e0 | 2007-10-14 22:21:35 +0200 | [diff] [blame] | 56 | LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name) |
Chris Zankel | 8e1a6dd | 2005-06-23 22:01:10 -0700 | [diff] [blame] | 57 | |
| 58 | head-y := arch/xtensa/kernel/head.o |
Chris Zankel | f193318 | 2009-04-02 16:58:53 -0700 | [diff] [blame] | 59 | |
Chris Zankel | 8e1a6dd | 2005-06-23 22:01:10 -0700 | [diff] [blame] | 60 | libs-y += arch/xtensa/lib/ $(LIBGCC) |
| 61 | |
Chris Zankel | e7d163f | 2005-06-30 02:58:59 -0700 | [diff] [blame] | 62 | boot := arch/xtensa/boot |
| 63 | |
Max Filippov | 7af710d | 2017-01-03 17:57:51 -0800 | [diff] [blame] | 64 | all Image zImage uImage xipImage: vmlinux |
Chris Zankel | 8e1a6dd | 2005-06-23 22:01:10 -0700 | [diff] [blame] | 65 | $(Q)$(MAKE) $(build)=$(boot) $@ |
| 66 | |
Firoz Khan | 5eacadb | 2018-11-13 15:49:30 +0530 | [diff] [blame] | 67 | archheaders: |
| 68 | $(Q)$(MAKE) $(build)=arch/xtensa/kernel/syscalls all |
| 69 | |
Chris Zankel | 8e1a6dd | 2005-06-23 22:01:10 -0700 | [diff] [blame] | 70 | define archhelp |
Max Filippov | 9a736fc | 2016-12-25 04:58:57 -0800 | [diff] [blame] | 71 | @echo '* Image - Kernel ELF image with reset vector' |
Chris Zankel | 8e1a6dd | 2005-06-23 22:01:10 -0700 | [diff] [blame] | 72 | @echo '* zImage - Compressed kernel image (arch/xtensa/boot/images/zImage.*)' |
Max Filippov | 9a736fc | 2016-12-25 04:58:57 -0800 | [diff] [blame] | 73 | @echo '* uImage - U-Boot wrapped image' |
Max Filippov | 7af710d | 2017-01-03 17:57:51 -0800 | [diff] [blame] | 74 | @echo ' xipImage - XIP image' |
Chris Zankel | 8e1a6dd | 2005-06-23 22:01:10 -0700 | [diff] [blame] | 75 | endef |