Back to home page

OSCL-LXR

 
 

    


0001 # SPDX-License-Identifier: GPL-2.0-only
0002 OBJCOPYFLAGS            :=-O binary
0003 GZFLAGS                 :=-9
0004 
0005 ifdef CONFIG_CPU_HAS_FPU
0006 FPUEXT = f
0007 endif
0008 
0009 ifdef CONFIG_CPU_HAS_VDSP
0010 VDSPEXT = v
0011 endif
0012 
0013 ifdef CONFIG_CPU_HAS_TEE
0014 TEEEXT = t
0015 endif
0016 
0017 ifdef CONFIG_CPU_CK610
0018 CPUTYPE = ck610
0019 CSKYABI = abiv1
0020 endif
0021 
0022 ifdef CONFIG_CPU_CK810
0023 CPUTYPE = ck810
0024 CSKYABI = abiv2
0025 endif
0026 
0027 ifdef CONFIG_CPU_CK807
0028 CPUTYPE = ck807
0029 CSKYABI = abiv2
0030 endif
0031 
0032 ifdef CONFIG_CPU_CK860
0033 CPUTYPE = ck860
0034 CSKYABI = abiv2
0035 endif
0036 
0037 ifneq ($(CSKYABI),)
0038 MCPU_STR = $(CPUTYPE)$(FPUEXT)$(VDSPEXT)$(TEEEXT)
0039 KBUILD_CFLAGS += -mcpu=$(CPUTYPE) -Wa,-mcpu=$(MCPU_STR)
0040 KBUILD_CFLAGS += -DCSKYCPU_DEF_NAME=\"$(MCPU_STR)\"
0041 KBUILD_CFLAGS += -msoft-float -mdiv
0042 KBUILD_CFLAGS += -fno-tree-vectorize
0043 endif
0044 
0045 KBUILD_CFLAGS += -pipe
0046 ifeq ($(CSKYABI),abiv2)
0047 KBUILD_CFLAGS += -mno-stack-size
0048 endif
0049 
0050 ifdef CONFIG_FRAME_POINTER
0051 KBUILD_CFLAGS += -mbacktrace
0052 endif
0053 
0054 abidirs := $(patsubst %,arch/csky/%/,$(CSKYABI))
0055 KBUILD_CFLAGS += $(patsubst %,-I$(srctree)/%inc,$(abidirs))
0056 
0057 KBUILD_CPPFLAGS += -mlittle-endian
0058 LDFLAGS += -EL
0059 
0060 KBUILD_AFLAGS += $(KBUILD_CFLAGS)
0061 
0062 head-y := arch/csky/kernel/head.o
0063 
0064 core-y += arch/csky/$(CSKYABI)/
0065 
0066 libs-y += arch/csky/lib/ \
0067         $(shell $(CC) $(KBUILD_CFLAGS) $(KCFLAGS) -print-libgcc-file-name)
0068 
0069 boot := arch/csky/boot
0070 
0071 all: zImage
0072 
0073 zImage Image uImage: vmlinux
0074         $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
0075 
0076 define archhelp
0077   echo  '* zImage       - Compressed kernel image (arch/$(ARCH)/boot/zImage)'
0078   echo  '  Image        - Uncompressed kernel image (arch/$(ARCH)/boot/Image)'
0079   echo  '  uImage       - U-Boot wrapped zImage'
0080 endef