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