]> Git Repo - u-boot.git/blame - arch/riscv/Makefile
riscv: Weakly define invalidate_icache_range()
[u-boot.git] / arch / riscv / Makefile
CommitLineData
83d290c5 1# SPDX-License-Identifier: GPL-2.0+
f94c44e5
RC
2#
3# Copyright (C) 2017 Andes Technology Corporation.
4# Rick Chen, Andes Technology Corporation <[email protected]>
f94c44e5 5
0c074845
LA
6ifeq ($(CONFIG_ARCH_RV64I),y)
7 ARCH_BASE = rv64im
e67f34f7 8 ABI_BASE = lp64
0c074845
LA
9endif
10ifeq ($(CONFIG_ARCH_RV32I),y)
11 ARCH_BASE = rv32im
e67f34f7 12 ABI_BASE = ilp32
0c074845
LA
13endif
14ifeq ($(CONFIG_RISCV_ISA_A),y)
15 ARCH_A = a
16endif
e67f34f7
HS
17ifeq ($(CONFIG_RISCV_ISA_F),y)
18 ARCH_F = f
19endif
20ifeq ($(CONFIG_RISCV_ISA_D),y)
21 ARCH_D = d
22 ABI_D = d
23endif
0c074845
LA
24ifeq ($(CONFIG_RISCV_ISA_C),y)
25 ARCH_C = c
26endif
bc5a5045
YCPL
27ifeq ($(CONFIG_RISCV_ISA_ZBB),y)
28 ARCH_ZBB = _zbb
29endif
8176ea4d
LA
30ifeq ($(CONFIG_CMODEL_MEDLOW),y)
31 CMODEL = medlow
32endif
33ifeq ($(CONFIG_CMODEL_MEDANY),y)
34 CMODEL = medany
35endif
0c074845 36
e67f34f7 37
bc5a5045 38RISCV_MARCH = $(ARCH_BASE)$(ARCH_A)$(ARCH_F)$(ARCH_D)$(ARCH_C)$(ARCH_ZBB)
e67f34f7 39ABI = $(ABI_BASE)$(ABI_D)
1dde9775
AG
40
41# Newer binutils versions default to ISA spec version 20191213 which moves some
42# instructions from the I extension to the Zicsr and Zifencei extensions.
43toolchain-need-zicsr-zifencei := $(call cc-option-yn, -mabi=$(ABI) -march=$(RISCV_MARCH)_zicsr_zifencei)
44ifeq ($(toolchain-need-zicsr-zifencei),y)
45 RISCV_MARCH := $(RISCV_MARCH)_zicsr_zifencei
46endif
47
48ARCH_FLAGS = -march=$(RISCV_MARCH) -mabi=$(ABI) \
8176ea4d 49 -mcmodel=$(CMODEL)
0c074845
LA
50
51PLATFORM_CPPFLAGS += $(ARCH_FLAGS)
52CFLAGS_EFI += $(ARCH_FLAGS)
53
b5369c58 54head-y := arch/riscv/cpu/start.o
f94c44e5 55
2fab2e9c 56libs-y += arch/riscv/cpu/
f94c44e5
RC
57libs-y += arch/riscv/cpu/$(CPU)/
58libs-y += arch/riscv/lib/
This page took 0.094322 seconds and 4 git commands to generate.