.. | .. |
---|
| 1 | +# SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | # |
---|
2 | 3 | # Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com) |
---|
3 | 4 | # |
---|
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 | | -# |
---|
8 | 5 | |
---|
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 |
---|
10 | 11 | |
---|
11 | 12 | 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 | + |
---|
14 | 32 | |
---|
15 | 33 | ifdef CONFIG_ARC_CURR_IN_REG |
---|
16 | 34 | # For a global register defintion, make sure it gets passed to every file |
---|
.. | .. |
---|
18 | 36 | # any kernel headers, and missing the r25 global register |
---|
19 | 37 | # Can't do unconditionally because of recursive include issues |
---|
20 | 38 | # 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 |
---|
22 | 40 | endif |
---|
23 | 41 | |
---|
24 | 42 | cflags-y += -fsection-anchors |
---|
.. | .. |
---|
27 | 45 | cflags-$(CONFIG_ARC_HAS_SWAPE) += -mswape |
---|
28 | 46 | |
---|
29 | 47 | 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 |
---|
30 | 54 | |
---|
31 | 55 | ifndef CONFIG_ARC_HAS_LL64 |
---|
32 | 56 | cflags-y += -mno-ll64 |
---|
.. | .. |
---|
40 | 64 | |
---|
41 | 65 | cfi := $(call as-instr,.cfi_startproc\n.cfi_endproc,-DARC_DW2_UNWIND_AS_CFI) |
---|
42 | 66 | 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 |
---|
51 | 67 | |
---|
52 | 68 | # small data is default for elf32 tool-chain. If not usable, disable it |
---|
53 | 69 | # This also allows repurposing GP as scratch reg to gcc reg allocator |
---|
.. | .. |
---|
78 | 94 | core-y += arch/arc/plat-sim/ |
---|
79 | 95 | core-$(CONFIG_ARC_PLAT_TB10X) += arch/arc/plat-tb10x/ |
---|
80 | 96 | core-$(CONFIG_ARC_PLAT_AXS10X) += arch/arc/plat-axs10x/ |
---|
81 | | -core-$(CONFIG_ARC_PLAT_EZNPS) += arch/arc/plat-eznps/ |
---|
82 | 97 | 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 |
---|
87 | 98 | |
---|
88 | 99 | drivers-$(CONFIG_OPROFILE) += arch/arc/oprofile/ |
---|
89 | 100 | |
---|
.. | .. |
---|
91 | 102 | |
---|
92 | 103 | boot := arch/arc/boot |
---|
93 | 104 | |
---|
94 | | -boot_targets := uImage uImage.bin uImage.gz uImage.lzma |
---|
| 105 | +boot_targets := uImage.bin uImage.gz uImage.lzma |
---|
95 | 106 | |
---|
96 | 107 | PHONY += $(boot_targets) |
---|
97 | 108 | $(boot_targets): vmlinux |
---|
98 | 109 | $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@ |
---|
99 | 110 | |
---|
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 |
---|
102 | 114 | |
---|
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 |
---|
105 | 121 | |
---|
106 | 122 | archclean: |
---|
107 | 123 | $(Q)$(MAKE) $(clean)=$(boot) |
---|