summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorAlistair Francis <alistair.francis@wdc.com>2019-02-23 02:02:55 +0300
committerAnup Patel <anup@brainfault.org>2019-02-26 16:53:26 +0300
commit42e9ad556ddae97dde3a55d649213a606efb01c0 (patch)
treec4dd87db82c8da6c601d5bb0e9e06bc65446de72 /Makefile
parenta1ffba1ac9b0cde0e9005fa79b36e45216646b9d (diff)
downloadopensbi-42e9ad556ddae97dde3a55d649213a606efb01c0.tar.xz
Makefile: Set the platform variables before parsing the platforms
Ensure the platform variable PLATFORM_RISCV_XLEN is set before we parse the platform files. This fixes the 32-bit openSBI FW_JUMP_ADDR. Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile18
1 files changed, 10 insertions, 8 deletions
diff --git a/Makefile b/Makefile
index ae68f55..6463f54 100644
--- a/Makefile
+++ b/Makefile
@@ -74,6 +74,15 @@ DTC = dtc
# Guess the compillers xlen
OPENSBI_CC_XLEN := $(shell TMP=`$(CC) -dumpmachine | sed 's/riscv\([0-9][0-9]\).*/\1/'`; echo $${TMP})
+# Setup platform XLEN
+ifndef PLATFORM_RISCV_XLEN
+ ifeq ($(OPENSBI_CC_XLEN), 32)
+ PLATFORM_RISCV_XLEN = 32
+ else
+ PLATFORM_RISCV_XLEN = 64
+ endif
+endif
+
# Setup list of objects.mk files
ifdef PLATFORM
platform-object-mks=$(shell if [ -d $(platform_dir) ]; then find $(platform_dir) -iname "objects.mk" | sort -r; fi)
@@ -112,14 +121,7 @@ deps-y+=$(platform-common-objs-path-y:.o=.dep)
deps-y+=$(lib-objs-path-y:.o=.dep)
deps-y+=$(firmware-objs-path-y:.o=.dep)
-# Setup platform XLEN, ABI, ISA and Code Model
-ifndef PLATFORM_RISCV_XLEN
- ifeq ($(OPENSBI_CC_XLEN), 32)
- PLATFORM_RISCV_XLEN = 32
- else
- PLATFORM_RISCV_XLEN = 64
- endif
-endif
+# Setup platform ABI, ISA and Code Model
ifndef PLATFORM_RISCV_ABI
ifeq ($(PLATFORM_RISCV_XLEN), 32)
PLATFORM_RISCV_ABI = ilp$(PLATFORM_RISCV_XLEN)