Skip to contentSkip to conversation

tune-riscv: be explicit about riscv32gc, riscv64gc defaults

PATCH New Trevor Gamblin 1 participant 2 messages Oct 16 RISC-V

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 tune-riscv: be explicit about riscv32gc, riscv64gc defaults

The string 'riscv64' is a generic descriptor for the 64-bit RISC-V ISA, and can mean different things under different contexts. In the case of tune-riscv.inc, it has served as an alias for the 'riscv64gc' profile which packages are typically built against, resulting in the following output (from a typical bitbake preamble):

|TUNE_FEATURES = "rv 64 i m a f d c zicsr zifencei"

Modify tune-riscv.inc to avoid overloading the 'riscv64' string in this way, instead setting DEFAULTTUNE to 'riscv64gc', and changing other occurrences to match. TUNE_FEATURES remains the same under this adjustment, but the .inc file is clearer which profile is being targeted.

Do the same for riscv32 -> riscv32gc. In this case, we also need to update qemuriscv32.conf, since it sets DEFAULTTUNE to override the default.

Also add TUNE_FEATURE aliases for the old riscv32 and riscv64 names so that other layers using them don't break.

---
 meta/conf/machine/include/riscv/tune-riscv.inc | 18 ++++++++++++------
 meta/conf/machine/qemuriscv32.conf             |  2 +-
 2 files changed, 13 insertions(+), 7 deletions(-)
meta/conf/machine/include/riscv/tune-riscv.inc +12 -6
index 12c1125c8b..8a14971d5f 100644
@@ -1,15 +1,21 @@
 require conf/machine/include/riscv/arch-riscv.inc
 
-DEFAULTTUNE ?= "riscv64"
+DEFAULTTUNE ?= "riscv64gc"
 
-AVAILTUNES += "riscv64 riscv32 riscv64nc riscv64nf riscv32nf"
+AVAILTUNES += "riscv64gc riscv32gc riscv64 riscv32 riscv64nc riscv64nf riscv32nf"
 
 # Default
-TUNE_FEATURES:tune-riscv64 := "${@oe.tune.riscv_isa_to_tune("rv64gc")}"
-PACKAGE_EXTRA_ARCHS:tune-riscv64 = "${TUNE_RISCV_PKGARCH}"
+TUNE_FEATURES:tune-riscv64gc := "${@oe.tune.riscv_isa_to_tune("rv64gc")}"
+PACKAGE_EXTRA_ARCHS:tune-riscv64gc = "${TUNE_RISCV_PKGARCH}"
 
-TUNE_FEATURES:tune-riscv32 := "${@oe.tune.riscv_isa_to_tune("rv32gc")}"
-PACKAGE_EXTRA_ARCHS:tune-riscv32 = "${TUNE_RISCV_PKGARCH}"
+TUNE_FEATURES:tune-riscv32gc := "${@oe.tune.riscv_isa_to_tune("rv32gc")}"
+PACKAGE_EXTRA_ARCHS:tune-riscv32gc = "${TUNE_RISCV_PKGARCH}"
+
+# Compatibility aliases so that layers using old tunes don't break
+TUNE_FEATURES:tune-riscv64 := "${TUNE_FEATURES:tune-riscv64gc}"
+PACKAGE_EXTRA_ARCHS:tune-riscv64 = "${PACKAGE_EXTRA_ARCHS:tune-riscv64gc}"
+TUNE_FEATURES:tune-riscv32 := "${TUNE_FEATURES:tune-riscv32gc}"
+PACKAGE_EXTRA_ARCHS:tune-riscv32 = "${PACKAGE_EXTRA_ARCHS:tune-riscv32gc}"
 
 # No float
 TUNE_FEATURES:tune-riscv64nf := "${@oe.tune.riscv_isa_to_tune("rv64imac_zicsr_zifencei")}"
meta/conf/machine/qemuriscv32.conf +1 -1
index aff36c28a5..5cb9ba5aa9 100644
@@ -2,7 +2,7 @@
 #@NAME: generic riscv32 machine
 #@DESCRIPTION: Machine configuration for running a generic riscv32
 
-DEFAULTTUNE ?= "riscv32"
+DEFAULTTUNE ?= "riscv32gc"
 
 require conf/machine/include/riscv/qemuriscv.inc
 
Signature · 1 line
2.56.0
#1 lore raw

PATCH 2/2 tune-riscv.inc: add 'riscv64gcv' tune

Add a new RISC-V tune option which adds the 'v' (vector) extension, compared to the default.

---
 meta/conf/machine/include/riscv/tune-riscv.inc | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
meta/conf/machine/include/riscv/tune-riscv.inc +4 -1
index 8a14971d5f..ed71dc06ba 100644
@@ -2,12 +2,15 @@ require conf/machine/include/riscv/arch-riscv.inc
 
 DEFAULTTUNE ?= "riscv64gc"
 
-AVAILTUNES += "riscv64gc riscv32gc riscv64 riscv32 riscv64nc riscv64nf riscv32nf"
+AVAILTUNES += "riscv64gcv riscv64gc riscv32gc riscv64 riscv32 riscv64nc riscv64nf riscv32nf"
 
 # Default
 TUNE_FEATURES:tune-riscv64gc := "${@oe.tune.riscv_isa_to_tune("rv64gc")}"
 PACKAGE_EXTRA_ARCHS:tune-riscv64gc = "${TUNE_RISCV_PKGARCH}"
 
+TUNE_FEATURES:tune-riscv64gcv := "${@oe.tune.riscv_isa_to_tune("rv64gcv")}"
+PACKAGE_EXTRA_ARCHS:tune-riscv64gcv = "${TUNE_RISCV_PKGARCH}"
+
 TUNE_FEATURES:tune-riscv32gc := "${@oe.tune.riscv_isa_to_tune("rv32gc")}"
 PACKAGE_EXTRA_ARCHS:tune-riscv32gc = "${TUNE_RISCV_PKGARCH}"
 
Signature · 1 line
2.56.0