Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | # SPDX-License-Identifier: GPL-2.0+ |
Rick Chen | 64d4ead | 2017-12-26 13:55:52 +0800 | [diff] [blame] | 2 | # |
| 3 | # Copyright (C) 2017 Andes Technology Corporation. |
| 4 | # Rick Chen, Andes Technology Corporation <rick@andestech.com> |
Rick Chen | 64d4ead | 2017-12-26 13:55:52 +0800 | [diff] [blame] | 5 | |
Lukas Auer | 17d3e90 | 2018-11-22 11:26:15 +0100 | [diff] [blame] | 6 | ifeq ($(CONFIG_ARCH_RV64I),y) |
| 7 | ARCH_BASE = rv64im |
| 8 | ABI = lp64 |
| 9 | endif |
| 10 | ifeq ($(CONFIG_ARCH_RV32I),y) |
| 11 | ARCH_BASE = rv32im |
| 12 | ABI = ilp32 |
| 13 | endif |
| 14 | ifeq ($(CONFIG_RISCV_ISA_A),y) |
| 15 | ARCH_A = a |
| 16 | endif |
| 17 | ifeq ($(CONFIG_RISCV_ISA_C),y) |
| 18 | ARCH_C = c |
| 19 | endif |
Lukas Auer | ecc5d83 | 2018-12-12 06:12:23 -0800 | [diff] [blame] | 20 | ifeq ($(CONFIG_CMODEL_MEDLOW),y) |
| 21 | CMODEL = medlow |
| 22 | endif |
| 23 | ifeq ($(CONFIG_CMODEL_MEDANY),y) |
| 24 | CMODEL = medany |
| 25 | endif |
Lukas Auer | 17d3e90 | 2018-11-22 11:26:15 +0100 | [diff] [blame] | 26 | |
Lukas Auer | ecc5d83 | 2018-12-12 06:12:23 -0800 | [diff] [blame] | 27 | ARCH_FLAGS = -march=$(ARCH_BASE)$(ARCH_A)$(ARCH_C) -mabi=$(ABI) \ |
| 28 | -mcmodel=$(CMODEL) |
Lukas Auer | 17d3e90 | 2018-11-22 11:26:15 +0100 | [diff] [blame] | 29 | |
| 30 | PLATFORM_CPPFLAGS += $(ARCH_FLAGS) |
| 31 | CFLAGS_EFI += $(ARCH_FLAGS) |
| 32 | |
Bin Meng | bcb3843 | 2018-09-26 06:55:17 -0700 | [diff] [blame] | 33 | head-y := arch/riscv/cpu/start.o |
Rick Chen | 64d4ead | 2017-12-26 13:55:52 +0800 | [diff] [blame] | 34 | |
Bin Meng | 055700e | 2018-09-26 06:55:14 -0700 | [diff] [blame] | 35 | libs-y += arch/riscv/cpu/ |
Rick Chen | 64d4ead | 2017-12-26 13:55:52 +0800 | [diff] [blame] | 36 | libs-y += arch/riscv/cpu/$(CPU)/ |
| 37 | libs-y += arch/riscv/lib/ |