1ec8f24b7SThomas Gleixner# SPDX-License-Identifier: GPL-2.0-only 2c32e64e8SGuo RenOBJCOPYFLAGS :=-O binary 3c32e64e8SGuo RenGZFLAGS :=-9 4c32e64e8SGuo Ren 5c32e64e8SGuo Renifdef CONFIG_CPU_HAS_FPU 6c32e64e8SGuo RenFPUEXT = f 7c32e64e8SGuo Renendif 8c32e64e8SGuo Ren 9c32e64e8SGuo Renifdef CONFIG_CPU_HAS_VDSP 10c32e64e8SGuo RenVDSPEXT = v 11c32e64e8SGuo Renendif 12c32e64e8SGuo Ren 13c32e64e8SGuo Renifdef CONFIG_CPU_HAS_TEE 14c32e64e8SGuo RenTEEEXT = t 15c32e64e8SGuo Renendif 16c32e64e8SGuo Ren 17c32e64e8SGuo Renifdef CONFIG_CPU_CK610 18c32e64e8SGuo RenCPUTYPE = ck610 19c32e64e8SGuo RenCSKYABI = abiv1 20c32e64e8SGuo Renendif 21c32e64e8SGuo Ren 22c32e64e8SGuo Renifdef CONFIG_CPU_CK810 23c32e64e8SGuo RenCPUTYPE = ck810 24c32e64e8SGuo RenCSKYABI = abiv2 25c32e64e8SGuo Renendif 26c32e64e8SGuo Ren 27c32e64e8SGuo Renifdef CONFIG_CPU_CK807 28c32e64e8SGuo RenCPUTYPE = ck807 29c32e64e8SGuo RenCSKYABI = abiv2 30c32e64e8SGuo Renendif 31c32e64e8SGuo Ren 32c32e64e8SGuo Renifdef CONFIG_CPU_CK860 33c32e64e8SGuo RenCPUTYPE = ck860 34c32e64e8SGuo RenCSKYABI = abiv2 35c32e64e8SGuo Renendif 36c32e64e8SGuo Ren 37c32e64e8SGuo Renifneq ($(CSKYABI),) 38c32e64e8SGuo RenMCPU_STR = $(CPUTYPE)$(FPUEXT)$(VDSPEXT)$(TEEEXT) 393dfc242fSGuo RenKBUILD_CFLAGS += -mcpu=$(CPUTYPE) -Wa,-mcpu=$(MCPU_STR) 40c32e64e8SGuo RenKBUILD_CFLAGS += -DCSKYCPU_DEF_NAME=\"$(MCPU_STR)\" 41c32e64e8SGuo RenKBUILD_CFLAGS += -msoft-float -mdiv 42c32e64e8SGuo RenKBUILD_CFLAGS += -fno-tree-vectorize 43c32e64e8SGuo Renendif 44c32e64e8SGuo Ren 45c32e64e8SGuo RenKBUILD_CFLAGS += -pipe 46c32e64e8SGuo Renifeq ($(CSKYABI),abiv2) 47c32e64e8SGuo RenKBUILD_CFLAGS += -mno-stack-size 48c32e64e8SGuo Renendif 49c32e64e8SGuo Ren 50*18c07d23SGuo Renifdef CONFIG_FRAME_POINTER 510ea2dc7cSGuo RenKBUILD_CFLAGS += -mbacktrace 520ea2dc7cSGuo Renendif 530ea2dc7cSGuo Ren 54c32e64e8SGuo Renabidirs := $(patsubst %,arch/csky/%/,$(CSKYABI)) 55c32e64e8SGuo RenKBUILD_CFLAGS += $(patsubst %,-I$(srctree)/%inc,$(abidirs)) 56c32e64e8SGuo Ren 57c32e64e8SGuo RenKBUILD_CPPFLAGS += -mlittle-endian 58c32e64e8SGuo RenLDFLAGS += -EL 59c32e64e8SGuo Ren 60c32e64e8SGuo RenKBUILD_AFLAGS += $(KBUILD_CFLAGS) 61c32e64e8SGuo Ren 62c32e64e8SGuo Rencore-y += arch/csky/$(CSKYABI)/ 63c32e64e8SGuo Ren 64c32e64e8SGuo Renlibs-y += arch/csky/lib/ \ 65c32e64e8SGuo Ren $(shell $(CC) $(KBUILD_CFLAGS) $(KCFLAGS) -print-libgcc-file-name) 66c32e64e8SGuo Ren 67c32e64e8SGuo Renboot := arch/csky/boot 68c32e64e8SGuo Ren 69c32e64e8SGuo Renall: zImage 70c32e64e8SGuo Ren 71e8d0c9a7SGuo RenzImage Image uImage: vmlinux 72c32e64e8SGuo Ren $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@ 73c32e64e8SGuo Ren 74c32e64e8SGuo Rendefine archhelp 75c32e64e8SGuo Ren echo '* zImage - Compressed kernel image (arch/$(ARCH)/boot/zImage)' 76c32e64e8SGuo Ren echo ' Image - Uncompressed kernel image (arch/$(ARCH)/boot/Image)' 77c32e64e8SGuo Ren echo ' uImage - U-Boot wrapped zImage' 78c32e64e8SGuo Renendef 79