hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/arch/arc/Makefile
....@@ -1,16 +1,34 @@
1
+# SPDX-License-Identifier: GPL-2.0-only
12 #
23 # Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com)
34 #
4
-# This program is free software; you can redistribute it and/or modify
5
-# it under the terms of the GNU General Public License version 2 as
6
-# published by the Free Software Foundation.
7
-#
85
9
-KBUILD_DEFCONFIG := nsim_hs_defconfig
6
+KBUILD_DEFCONFIG := haps_hs_smp_defconfig
7
+
8
+ifeq ($(CROSS_COMPILE),)
9
+CROSS_COMPILE := $(call cc-cross-prefix, arc-linux- arceb-linux-)
10
+endif
1011
1112 cflags-y += -fno-common -pipe -fno-builtin -mmedium-calls -D__linux__
12
-cflags-$(CONFIG_ISA_ARCOMPACT) += -mA7
13
-cflags-$(CONFIG_ISA_ARCV2) += -mcpu=hs38
13
+
14
+tune-mcpu-def-$(CONFIG_ISA_ARCOMPACT) := -mcpu=arc700
15
+tune-mcpu-def-$(CONFIG_ISA_ARCV2) := -mcpu=hs38
16
+
17
+ifeq ($(CONFIG_ARC_TUNE_MCPU),"")
18
+cflags-y += $(tune-mcpu-def-y)
19
+else
20
+tune-mcpu := $(shell echo $(CONFIG_ARC_TUNE_MCPU))
21
+tune-mcpu-ok := $(call cc-option-yn, $(tune-mcpu))
22
+ifeq ($(tune-mcpu-ok),y)
23
+cflags-y += $(tune-mcpu)
24
+else
25
+# The flag provided by 'CONFIG_ARC_TUNE_MCPU' option isn't known by this compiler
26
+# (probably the compiler is too old). Use ISA default mcpu flag instead as a safe option.
27
+$(warning ** WARNING ** CONFIG_ARC_TUNE_MCPU flag '$(tune-mcpu)' is unknown, fallback to '$(tune-mcpu-def-y)')
28
+cflags-y += $(tune-mcpu-def-y)
29
+endif
30
+endif
31
+
1432
1533 ifdef CONFIG_ARC_CURR_IN_REG
1634 # For a global register defintion, make sure it gets passed to every file
....@@ -18,7 +36,7 @@
1836 # any kernel headers, and missing the r25 global register
1937 # Can't do unconditionally because of recursive include issues
2038 # due to <linux/thread_info.h>
21
-LINUXINCLUDE += -include ${src}/arch/arc/include/asm/current.h
39
+LINUXINCLUDE += -include $(srctree)/arch/arc/include/asm/current.h
2240 endif
2341
2442 cflags-y += -fsection-anchors
....@@ -27,6 +45,12 @@
2745 cflags-$(CONFIG_ARC_HAS_SWAPE) += -mswape
2846
2947 ifdef CONFIG_ISA_ARCV2
48
+
49
+ifdef CONFIG_ARC_USE_UNALIGNED_MEM_ACCESS
50
+cflags-y += -munaligned-access
51
+else
52
+cflags-y += -mno-unaligned-access
53
+endif
3054
3155 ifndef CONFIG_ARC_HAS_LL64
3256 cflags-y += -mno-ll64
....@@ -40,14 +64,6 @@
4064
4165 cfi := $(call as-instr,.cfi_startproc\n.cfi_endproc,-DARC_DW2_UNWIND_AS_CFI)
4266 cflags-$(CONFIG_ARC_DW2_UNWIND) += -fasynchronous-unwind-tables $(cfi)
43
-
44
-ifndef CONFIG_CC_OPTIMIZE_FOR_SIZE
45
-# Generic build system uses -O2, we want -O3
46
-# Note: No need to add to cflags-y as that happens anyways
47
-#
48
-# Disable the false maybe-uninitialized warings gcc spits out at -O3
49
-ARCH_CFLAGS += -O3 $(call cc-disable-warning,maybe-uninitialized,)
50
-endif
5167
5268 # small data is default for elf32 tool-chain. If not usable, disable it
5369 # This also allows repurposing GP as scratch reg to gcc reg allocator
....@@ -78,12 +94,7 @@
7894 core-y += arch/arc/plat-sim/
7995 core-$(CONFIG_ARC_PLAT_TB10X) += arch/arc/plat-tb10x/
8096 core-$(CONFIG_ARC_PLAT_AXS10X) += arch/arc/plat-axs10x/
81
-core-$(CONFIG_ARC_PLAT_EZNPS) += arch/arc/plat-eznps/
8297 core-$(CONFIG_ARC_SOC_HSDK) += arch/arc/plat-hsdk/
83
-
84
-ifdef CONFIG_ARC_PLAT_EZNPS
85
-KBUILD_CPPFLAGS += -I$(srctree)/arch/arc/plat-eznps/include
86
-endif
8798
8899 drivers-$(CONFIG_OPROFILE) += arch/arc/oprofile/
89100
....@@ -91,17 +102,22 @@
91102
92103 boot := arch/arc/boot
93104
94
-boot_targets := uImage uImage.bin uImage.gz uImage.lzma
105
+boot_targets := uImage.bin uImage.gz uImage.lzma
95106
96107 PHONY += $(boot_targets)
97108 $(boot_targets): vmlinux
98109 $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
99110
100
-%.dtb %.dtb.S %.dtb.o: scripts
101
- $(Q)$(MAKE) $(build)=$(boot)/dts $(boot)/dts/$@
111
+uimage-default-y := uImage.bin
112
+uimage-default-$(CONFIG_KERNEL_GZIP) := uImage.gz
113
+uimage-default-$(CONFIG_KERNEL_LZMA) := uImage.lzma
102114
103
-dtbs: scripts
104
- $(Q)$(MAKE) $(build)=$(boot)/dts
115
+PHONY += uImage
116
+uImage: $(uimage-default-y)
117
+ @ln -sf $< $(boot)/uImage
118
+ @$(kecho) ' Image $(boot)/uImage is ready'
119
+
120
+CLEAN_FILES += $(boot)/uImage
105121
106122 archclean:
107123 $(Q)$(MAKE) $(clean)=$(boot)