platform/qemu/virt: Dynamically calculate xlen

The QEMU virt machine can be either 32 or 66 bit. Don't hard code the
CPU bit length and instead let the compiler determine it.

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
This commit is contained in:
Alistair Francis
2019-01-17 17:33:47 -08:00
committed by Anup Patel
parent b4c72deba9
commit 5a91fec1a8
3 changed files with 16 additions and 2 deletions

View File

@@ -9,8 +9,17 @@
# Compiler flags
platform-cppflags-y =
platform-cflags-y =-mabi=lp64 -march=rv64imafdc -mcmodel=medany
platform-asflags-y =-mabi=lp64 -march=rv64imafdc -mcmodel=medany
# If we know the compillers xlen use it below
ifeq ($(OPENSBI_CC_XLEN), 32)
platform-cflags-y =-mabi=ilp$(OPENSBI_CC_XLEN) -march=rv$(OPENSBI_CC_XLEN)imafdc
platform-asflags-y =-mabi=ilp$(OPENSBI_CC_XLEN) -march=rv$(OPENSBI_CC_XLEN)imafdc
endif
ifeq ($(OPENSBI_CC_XLEN), 64)
platform-cflags-y =-mabi=lp$(OPENSBI_CC_XLEN) -march=rv$(OPENSBI_CC_XLEN)imafdc
platform-asflags-y =-mabi=lp$(OPENSBI_CC_XLEN) -march=rv$(OPENSBI_CC_XLEN)imafdc
endif
platform-cflags-y += -mcmodel=medany
platform-asflags-y += -mcmodel=medany
platform-ldflags-y =
# Common drivers to enable