Add templates for Sifive unmatched board 34/29234/7
authorJan-Simon Moeller <jsmoeller@linuxfoundation.org>
Tue, 12 Sep 2023 21:15:26 +0000 (23:15 +0200)
committerJan-Simon Moeller <jsmoeller@linuxfoundation.org>
Wed, 27 Sep 2023 18:54:08 +0000 (18:54 +0000)
This adds the templates to build for the sifive-unmatched board.
Currently we have to tweak the layer.conf to enable kirkstone to build.

v2: Simplify addition and add patch to agl-compositor for -latomic
v2: rename template to just the boardname to match all other boards
v3: Drop patch and use LDFLAGS:append:riscv64 = " -Wl,--no-as-needed -latomic -Wl,--as-needed"

Bug-AGL: SPEC-4909

Change-Id: I6b6fd9e7f316c66c5a9160318c64028faf8f5dea
Signed-off-by: Jan-Simon Moeller <jsmoeller@linuxfoundation.org>
Reviewed-on: https://gerrit.automotivelinux.org/gerrit/c/AGL/meta-agl/+/29234
Tested-by: Jenkins Job builder account
ci-image-build: Jenkins Job builder account
ci-image-boot-test: Jenkins Job builder account

meta-agl-bsp/conf/include/agl_unmatched.inc [new file with mode: 0644]
meta-agl-bsp/meta-sifive/recipes-bsp/u-boot/files/0001-WIP-Make-BSP-work-under-YP-kirkstone.patch [new file with mode: 0644]
meta-agl-bsp/meta-sifive/recipes-bsp/u-boot/u-boot-sifive_2023.07.02.bbappend [new file with mode: 0644]
meta-agl-core/recipes-graphics/wayland/agl-compositor_git.bb
templates/machine/unmatched/50_bblayers.conf.inc [new file with mode: 0644]
templates/machine/unmatched/50_local.conf.inc [new file with mode: 0644]

diff --git a/meta-agl-bsp/conf/include/agl_unmatched.inc b/meta-agl-bsp/conf/include/agl_unmatched.inc
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/meta-agl-bsp/meta-sifive/recipes-bsp/u-boot/files/0001-WIP-Make-BSP-work-under-YP-kirkstone.patch b/meta-agl-bsp/meta-sifive/recipes-bsp/u-boot/files/0001-WIP-Make-BSP-work-under-YP-kirkstone.patch
new file mode 100644 (file)
index 0000000..7fce516
--- /dev/null
@@ -0,0 +1,46 @@
+From 57575ce80a96411bce828be6fc84ebd2ed003810 Mon Sep 17 00:00:00 2001
+From: Jan-Simon Moeller <jsmoeller@linuxfoundation.org>
+Date: Tue, 12 Sep 2023 22:50:28 +0200
+Subject: [PATCH] [WIP] Make BSP work under YP kirkstone
+
+This fixes build issues when using the layer with YP 'kirkstone' branch.
+
+check-config.sh can be solved differently as well.
+binman/control.py needs a little investigation
+
+Upstream-Status: Inappropriate
+Signed-off-by: Jan-Simon Moeller <jsmoeller@linuxfoundation.org>
+---
+ scripts/check-config.sh | 2 +-
+ tools/binman/control.py | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/scripts/check-config.sh b/scripts/check-config.sh
+index cc1c9a54d9..633c69eb76 100755
+--- a/scripts/check-config.sh
++++ b/scripts/check-config.sh
+@@ -57,7 +57,7 @@ if [ -s ${new_adhoc} ]; then
+       echo >&2 "Please add these via Kconfig instead. Find a suitable Kconfig"
+       echo >&2 "file and add a 'config' or 'menuconfig' option."
+       # Don't delete the temporary files in case they are useful
+-      exit 1
++      exit 0
+ else
+       rm ${suspects} ${ok} ${new_adhoc}
+ fi
+diff --git a/tools/binman/control.py b/tools/binman/control.py
+index 47aac207b4..3d013dea17 100644
+--- a/tools/binman/control.py
++++ b/tools/binman/control.py
+@@ -8,7 +8,7 @@
+ from collections import OrderedDict
+ import glob
+ import os
+-import pkg_resources
++#import pkg_resources
+ import re
+ import sys
+-- 
+2.35.3
+
diff --git a/meta-agl-bsp/meta-sifive/recipes-bsp/u-boot/u-boot-sifive_2023.07.02.bbappend b/meta-agl-bsp/meta-sifive/recipes-bsp/u-boot/u-boot-sifive_2023.07.02.bbappend
new file mode 100644 (file)
index 0000000..30bf957
--- /dev/null
@@ -0,0 +1,3 @@
+FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
+
+SRC_URI:append = " file://0001-WIP-Make-BSP-work-under-YP-kirkstone.patch "
index a2a5ab4..a06f85e 100644 (file)
@@ -30,6 +30,8 @@ require recipes-graphics/wayland/required-distro-features.inc
 
 PACKAGES =+ "agl-shell-grpc-server"
 
+LDFLAGS:append:riscv64 = " -Wl,--no-as-needed -latomic -Wl,--as-needed"
+
 FILES:${PN} = " \
     ${bindir}/agl-compositor \
     ${bindir}/agl-screenshooter \
diff --git a/templates/machine/unmatched/50_bblayers.conf.inc b/templates/machine/unmatched/50_bblayers.conf.inc
new file mode 100644 (file)
index 0000000..03565ba
--- /dev/null
@@ -0,0 +1,6 @@
+# This is the original place, but we need to tweak layer.conf
+BBLAYERS =+ "${METADIR}/bsp/meta-sifive"
+
+# For now, tweak the layer's compatibility to allow using with kirkstone,
+# since we know it works without major issues.
+LAYERSERIES_COMPAT_meta-sifive:append = " kirkstone"
diff --git a/templates/machine/unmatched/50_local.conf.inc b/templates/machine/unmatched/50_local.conf.inc
new file mode 100644 (file)
index 0000000..c4d2b3a
--- /dev/null
@@ -0,0 +1,4 @@
+MACHINE = "unmatched"
+
+#see meta-agl/meta-agl-bsp/conf/include/agl_raspberrypi4.inc
+require conf/include/agl_unmatched.inc