]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
u-boot: Dynamic RISC-V ISA configuration
authorMark Hatle <mark.hatle@amd.com>
Wed, 2 Jul 2025 21:44:19 +0000 (16:44 -0500)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 7 Jul 2025 21:12:47 +0000 (22:12 +0100)
Allow the risc-v TUNE_FEATURES to select specific ISA (kconfig) selections
via config fragments.

This allows the following items to be selected dynamically:

    CONFIG_RISCV_ISA_C
    CONFIG_RISCV_ISA_F
    CONFIG_RISCV_ISA_D
    CONFIG_RISCV_ISA_ZBB
    CONFIG_RISCV_ISA_A
    CONFIG_RISCV_ISA_ZICBOM

Signed-off-by: Mark Hatle <mark.hatle@amd.com>
Signed-off-by: Antonin Godard <antonin.godard@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-bsp/u-boot/files/u-boot-riscv-isa_a.cfg [new file with mode: 0644]
meta/recipes-bsp/u-boot/files/u-boot-riscv-isa_c.cfg [new file with mode: 0644]
meta/recipes-bsp/u-boot/files/u-boot-riscv-isa_clear.cfg [new file with mode: 0644]
meta/recipes-bsp/u-boot/files/u-boot-riscv-isa_d.cfg [new file with mode: 0644]
meta/recipes-bsp/u-boot/files/u-boot-riscv-isa_f.cfg [new file with mode: 0644]
meta/recipes-bsp/u-boot/files/u-boot-riscv-isa_zbb.cfg [new file with mode: 0644]
meta/recipes-bsp/u-boot/files/u-boot-riscv-isa_zicbom.cfg [new file with mode: 0644]
meta/recipes-bsp/u-boot/u-boot-common.inc

diff --git a/meta/recipes-bsp/u-boot/files/u-boot-riscv-isa_a.cfg b/meta/recipes-bsp/u-boot/files/u-boot-riscv-isa_a.cfg
new file mode 100644 (file)
index 0000000..fc45b64
--- /dev/null
@@ -0,0 +1 @@
+CONFIG_RISCV_ISA_A=y
diff --git a/meta/recipes-bsp/u-boot/files/u-boot-riscv-isa_c.cfg b/meta/recipes-bsp/u-boot/files/u-boot-riscv-isa_c.cfg
new file mode 100644 (file)
index 0000000..1cb459f
--- /dev/null
@@ -0,0 +1 @@
+CONFIG_RISCV_ISA_C=y
diff --git a/meta/recipes-bsp/u-boot/files/u-boot-riscv-isa_clear.cfg b/meta/recipes-bsp/u-boot/files/u-boot-riscv-isa_clear.cfg
new file mode 100644 (file)
index 0000000..ce90da2
--- /dev/null
@@ -0,0 +1,6 @@
+# CONFIG_RISCV_ISA_C is not set
+# CONFIG_RISCV_ISA_F is not set
+# CONFIG_RISCV_ISA_D is not set
+# CONFIG_RISCV_ISA_ZBB is not set
+# CONFIG_RISCV_ISA_A is not set
+# CONFIG_RISCV_ISA_ZICBOM is not set
diff --git a/meta/recipes-bsp/u-boot/files/u-boot-riscv-isa_d.cfg b/meta/recipes-bsp/u-boot/files/u-boot-riscv-isa_d.cfg
new file mode 100644 (file)
index 0000000..fd25fa4
--- /dev/null
@@ -0,0 +1 @@
+CONFIG_RISCV_ISA_D=y
diff --git a/meta/recipes-bsp/u-boot/files/u-boot-riscv-isa_f.cfg b/meta/recipes-bsp/u-boot/files/u-boot-riscv-isa_f.cfg
new file mode 100644 (file)
index 0000000..dfa9876
--- /dev/null
@@ -0,0 +1 @@
+CONFIG_RISCV_ISA_F=y
diff --git a/meta/recipes-bsp/u-boot/files/u-boot-riscv-isa_zbb.cfg b/meta/recipes-bsp/u-boot/files/u-boot-riscv-isa_zbb.cfg
new file mode 100644 (file)
index 0000000..2b71b01
--- /dev/null
@@ -0,0 +1 @@
+CONFIG_RISCV_ISA_ZBB=y
diff --git a/meta/recipes-bsp/u-boot/files/u-boot-riscv-isa_zicbom.cfg b/meta/recipes-bsp/u-boot/files/u-boot-riscv-isa_zicbom.cfg
new file mode 100644 (file)
index 0000000..96daf04
--- /dev/null
@@ -0,0 +1 @@
+CONFIG_RISCV_ISA_ZICBOM=y
index 617f5a60bb882f75e59fce36ad4d9751f2bb1ae5..8600d4bab6ed7a54aec290e2c89821f352d8cdcb 100644 (file)
@@ -16,6 +16,18 @@ SRCREV = "34820924edbc4ec7803eb89d9852f4b870fa760a"
 
 SRC_URI = "git://source.denx.de/u-boot/u-boot.git;protocol=https;branch=master;tag=v${PV}"
 
+SRC_URI_RISCV = "\
+    file://u-boot-riscv-isa_clear.cfg \
+    ${@bb.utils.contains    ("TUNE_FEATURES", "a",      "file://u-boot-riscv-isa_a.cfg", "", d)} \
+    ${@bb.utils.contains    ("TUNE_FEATURES", "f",      "file://u-boot-riscv-isa_f.cfg", "", d)} \
+    ${@bb.utils.contains    ("TUNE_FEATURES", "d",      "file://u-boot-riscv-isa_d.cfg", "", d)} \
+    ${@bb.utils.contains_any("TUNE_FEATURES", "b zbb",  "file://u-boot-riscv-isa_zbb.cfg", "", d)} \
+    ${@bb.utils.contains    ("TUNE_FEATURES", "zicbom", "file://u-boot-riscv-isa_zicbom.cfg", "", d)} \
+    "
+
+SRC_URI:append:riscv32 = "${SRC_URI_RISCV}"
+SRC_URI:append:riscv64 = "${SRC_URI_RISCV}"
+
 B = "${WORKDIR}/build"
 
 inherit pkgconfig