forked from Mirrors/opensbi
		
	Makefile: Set ABI, ISA and Code Model in top-level make
This patch introduces following optional PLATFORM options: PLATFORM_RISCV_XLEN -> RISC-V register width PLATFORM_RISCV_ABI -> RISC-V GCC ABI PLATFORM_RISCV_ISA -> RISC-V GCC ISA string PLATFORM_RISCV_CODE_MODEL -> RISC-V GCC Code Model If the above options are not provided by platform config.mk or by command-line parameters then: 1. PLATFORM_RISCV_XLEN will be determined using toolchain capability 2. PLATFORM_RISCV_ABI, PLATFORM_RISCV_ISA, and PLATFORM_RISCV_CODE_MODEL is set to value best suited for generic libsbi.a As a result of these optional PLATFORM options, the platform-cflags-y and platform-asflags-y is further simplified for platform config.mk. Signed-off-by: Anup Patel <anup.patel@wdc.com>
This commit is contained in:
		@@ -9,8 +9,8 @@
 | 
			
		||||
 | 
			
		||||
# Compiler flags
 | 
			
		||||
platform-cppflags-y =
 | 
			
		||||
platform-cflags-y =-mabi=lp64 -march=rv64imafdc -mcmodel=medany
 | 
			
		||||
platform-asflags-y =-mabi=lp64 -march=rv64imafdc -mcmodel=medany
 | 
			
		||||
platform-cflags-y =
 | 
			
		||||
platform-asflags-y =
 | 
			
		||||
platform-ldflags-y =
 | 
			
		||||
 | 
			
		||||
# Common drivers to enable
 | 
			
		||||
 
 | 
			
		||||
@@ -9,8 +9,8 @@
 | 
			
		||||
 | 
			
		||||
# Compiler flags
 | 
			
		||||
platform-cppflags-y =
 | 
			
		||||
platform-cflags-y =-mabi=lp64 -march=rv64imafdc -mcmodel=medany
 | 
			
		||||
platform-asflags-y =-mabi=lp64 -march=rv64imafdc -mcmodel=medany
 | 
			
		||||
platform-cflags-y =
 | 
			
		||||
platform-asflags-y =
 | 
			
		||||
platform-ldflags-y =
 | 
			
		||||
 | 
			
		||||
# Common drivers to enable
 | 
			
		||||
 
 | 
			
		||||
@@ -9,17 +9,8 @@
 | 
			
		||||
 | 
			
		||||
# Compiler flags
 | 
			
		||||
platform-cppflags-y =
 | 
			
		||||
# 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-cflags-y =
 | 
			
		||||
platform-asflags-y =
 | 
			
		||||
platform-ldflags-y =
 | 
			
		||||
 | 
			
		||||
# Common drivers to enable
 | 
			
		||||
 
 | 
			
		||||
@@ -9,8 +9,8 @@
 | 
			
		||||
 | 
			
		||||
# Compiler flags
 | 
			
		||||
platform-cppflags-y =
 | 
			
		||||
platform-cflags-y =-mabi=lp64 -march=rv64imafdc -mcmodel=medany
 | 
			
		||||
platform-asflags-y =-mabi=lp64 -march=rv64imafdc -mcmodel=medany
 | 
			
		||||
platform-cflags-y =
 | 
			
		||||
platform-asflags-y =
 | 
			
		||||
platform-ldflags-y =
 | 
			
		||||
 | 
			
		||||
# Common drivers to enable
 | 
			
		||||
 
 | 
			
		||||
@@ -8,19 +8,23 @@
 | 
			
		||||
platform-cppflags-y =
 | 
			
		||||
 | 
			
		||||
# C Compiler and assembler flags.
 | 
			
		||||
# For a 64 bits platform, this will likely be:
 | 
			
		||||
# 	-mabi=lp64 -march=rv64imafdc -mcmodel=medany
 | 
			
		||||
# For a 32 bits platform, this will likely be:
 | 
			
		||||
# 	-mabi=lp32 -march=rv32imafdc -mcmodel=medlow
 | 
			
		||||
# You can also use the Makefile variable OPENSBI_CC_XLEN for the xlen
 | 
			
		||||
# See the QEMU virt machine for an example of this
 | 
			
		||||
platform-cflags-y = -mabi=lp64 -march=rv64imafdc -mcmodel=medany
 | 
			
		||||
platform-asflags-y = -mabi=lp64 -march=rv64imafdc -mcmodel=medany
 | 
			
		||||
platform-cflags-y =
 | 
			
		||||
platform-asflags-y =
 | 
			
		||||
 | 
			
		||||
# Linker flags: additional libraries and object files that the platform
 | 
			
		||||
# code needs can be added here
 | 
			
		||||
platform-ldflags-y =
 | 
			
		||||
 | 
			
		||||
#
 | 
			
		||||
# Platform RISC-V XLEN, ABI, ISA and Code Model configuration.
 | 
			
		||||
# These are optional parameters but platforms can optionaly provide it.
 | 
			
		||||
# Some of these are guessed based on GCC compiler capabilities
 | 
			
		||||
#
 | 
			
		||||
# PLATFORM_RISCV_XLEN = 64
 | 
			
		||||
# PLATFORM_RISCV_ABI = lp64
 | 
			
		||||
# PLATFORM_RISCV_ISA = rv64imafdc
 | 
			
		||||
# PLATFORM_RISCV_CODE_MODEL = medany
 | 
			
		||||
 | 
			
		||||
#
 | 
			
		||||
# OpenSBI implements generic drivers for some common generic hardware. The
 | 
			
		||||
# drivers currently available are the RISC-V Platform Level Interrupt
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user