blob: 219e66683d2f7c82c8b5f3ddf19ad5ba264a0fbc [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001# SPDX-License-Identifier: GPL-2.0+
Rick Chenf94c44e2017-12-26 13:55:52 +08002#
3# (C) Copyright 2000-2002
4# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
5#
6# Copyright (c) 2017 Microsemi Corporation.
7# Padmarao Begari, Microsemi Corporation <padmarao.begari@microsemi.com>
8#
9# Copyright (C) 2017 Andes Technology Corporation
10# Rick Chen, Andes Technology Corporation <rick@andestech.com>
11#
Rick Chenf94c44e2017-12-26 13:55:52 +080012
13ifeq ($(CROSS_COMPILE),)
14CROSS_COMPILE := riscv32-unknown-linux-gnu-
15endif
16
1732bit-emul := elf32lriscv
1864bit-emul := elf64lriscv
19
20ifdef CONFIG_32BIT
21PLATFORM_LDFLAGS += -m $(32bit-emul)
Alexander Graf493d1e82018-04-23 07:59:45 +020022EFI_LDS := elf_riscv32_efi.lds
Rick Chenf94c44e2017-12-26 13:55:52 +080023endif
24
25ifdef CONFIG_64BIT
26PLATFORM_LDFLAGS += -m $(64bit-emul)
Alexander Graf493d1e82018-04-23 07:59:45 +020027EFI_LDS := elf_riscv64_efi.lds
Rick Chenf94c44e2017-12-26 13:55:52 +080028endif
29
30CONFIG_STANDALONE_LOAD_ADDR = 0x00000000 \
31 -T $(srctree)/examples/standalone/riscv.lds
32
33PLATFORM_CPPFLAGS += -ffixed-gp -fpic
Alexander Graf6cc1a2a2018-04-23 07:59:44 +020034PLATFORM_RELFLAGS += -fno-strict-aliasing -fno-common -gdwarf-2 -ffunction-sections
Rick Chenf94c44e2017-12-26 13:55:52 +080035LDFLAGS_u-boot += --gc-sections -static -pie
Alexander Graf493d1e82018-04-23 07:59:45 +020036
37EFI_CRT0 := crt0_riscv_efi.o
38EFI_RELOC := reloc_riscv_efi.o