diff --git a/embedded/build.sh b/embedded/build.sh index ef513a8..6800abe 100755 --- a/embedded/build.sh +++ b/embedded/build.sh @@ -7,6 +7,7 @@ BUILDROOT_TAR=buildroot-20231002.tar.bz2 if [ ! -e $BUILDROOT ]; then tar xjf $BUILDROOT_TAR + patch -p0 < buildroot-mesa3d-pi5.patch fi if [ ! -e $BUILDROOT/.config ]; then diff --git a/embedded/buildroot-mesa3d-pi5.patch b/embedded/buildroot-mesa3d-pi5.patch new file mode 100644 index 0000000..4e18c32 --- /dev/null +++ b/embedded/buildroot-mesa3d-pi5.patch @@ -0,0 +1,150 @@ +diff -urN buildroot/package/mesa3d.orig/0004-Fix-uClibc-build.patch buildroot/package/mesa3d/0004-Fix-uClibc-build.patch +--- buildroot/package/mesa3d.orig/0004-Fix-uClibc-build.patch 2023-10-01 23:05:28.000000000 +0200 ++++ buildroot/package/mesa3d/0004-Fix-uClibc-build.patch 1970-01-01 01:00:00.000000000 +0100 +@@ -1,69 +0,0 @@ +-From 09ce52fe375a6fc1ccf51b6b691aaa2c3f53fbd5 Mon Sep 17 00:00:00 2001 +-From: Bernd Kuhls +-Date: Fri, 3 Jun 2022 16:26:03 +0200 +-Subject: [PATCH] Fix uClibc build +-MIME-Version: 1.0 +-Content-Type: text/plain; charset=UTF-8 +-Content-Transfer-Encoding: 8bit +- +-Fixes build errors with uClibc and gcc-9.3.0: +- +-../src/gallium/drivers/lima/lima_texture.c:47:15: error: expected +- declaration specifiers or ‘...’ before ‘__builtin_offsetof’ +- 47 | static_assert(offsetof(lima_tex_desc, va) == 24, +- "lima_tex_desc->va offset isn't 24"); +- +-../src/egl/main/egldisplay.c: In function ‘_eglGetNativePlatformFromEnv’: +- ../src/egl/main/egldisplay.c:101:4: error: implicit declaration of +- function ‘static_assert’ [-Werror=implicit-function-declaration] 101 | +- static_assert(ARRAY_SIZE(egl_platforms) == _EGL_NUM_PLATFORMS, +- +-../src/util/macros.h:74:4: error: implicit declaration of function +- ‘static_assert’ [-Werror=implicit-function-declaration] +- 74 | static_assert(cond, #cond); \ +- | ^~~~~~~~~~~~~ +- +-Upstream: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13898 +- +-Signed-off-by: Bernd Kuhls +---- +- src/util/compiler.h | 10 ++++++++++ +- src/util/macros.h | 1 + +- 2 files changed, 11 insertions(+) +- +-diff --git a/src/util/compiler.h b/src/util/compiler.h +-index d184ad455af..b5c56807acc 100644 +---- a/src/util/compiler.h +-+++ b/src/util/compiler.h +-@@ -36,6 +36,16 @@ +- +- #include +- +-+/* +-+ * C11 static_assert() macro +-+ * assert.h only defines that name for C11 and above +-+ */ +-+#if !defined(__cplusplus) +-+#ifndef static_assert +-+#define static_assert _Static_assert +-+#endif +-+#endif +-+ +- #include "util/macros.h" +- +- +-diff --git a/src/util/macros.h b/src/util/macros.h +-index 22b18303826..8f73ee72693 100644 +---- a/src/util/macros.h +-+++ b/src/util/macros.h +-@@ -27,6 +27,7 @@ +- #include +- #include +- #include +-+#include "util/compiler.h" +- +- /* Compute the size of an array */ +- #ifndef ARRAY_SIZE +--- +-2.34.1 +- +diff -urN buildroot/package/mesa3d.orig/0006-meson-ensure-i915-Gallium-driver-includes-Intel-sour.patch buildroot/package/mesa3d/0006-meson-ensure-i915-Gallium-driver-includes-Intel-sour.patch +--- buildroot/package/mesa3d.orig/0006-meson-ensure-i915-Gallium-driver-includes-Intel-sour.patch 2023-10-01 23:05:28.000000000 +0200 ++++ buildroot/package/mesa3d/0006-meson-ensure-i915-Gallium-driver-includes-Intel-sour.patch 1970-01-01 01:00:00.000000000 +0100 +@@ -1,46 +0,0 @@ +-From cd861b7f38e448822ce765aee61304d1e0a3a8b5 Mon Sep 17 00:00:00 2001 +-From: James Knight +-Date: Thu, 13 Apr 2023 16:38:51 -0400 +-Subject: meson: ensure i915 Gallium driver includes Intel sources +- +-Ensure builds flag the use of Intel sources when the i915 Gallium driver +-is configured (`-Dgallium-drivers=i915`). Otherwise, a build may fail if +-other Intel-based configuration options are not enabled: +- +- ./src/gallium/winsys/i915/drm/meson.build:21:0: ERROR: Unknown variable "libintel_common". +- +-Signed-off-by: James Knight +-Part-of: +- +-Upstream: https://gitlab.freedesktop.org/mesa/mesa/-/commit/cd861b7f38e448822ce765aee61304d1e0a3a8b5 +- +-Signed-off-by: Bernd Kuhls +---- +- meson.build | 9 ++++++++- +- 1 file changed, 8 insertions(+), 1 deletion(-) +- +-(limited to 'meson.build') +- +-diff --git a/meson.build b/meson.build +-index 23d2d965b37..a3e3c5478a8 100644 +---- a/meson.build +-+++ b/meson.build +-@@ -245,7 +245,14 @@ with_microsoft_vk = _vulkan_drivers.contains('microsoft-experimental') +- with_any_vk = _vulkan_drivers.length() != 0 +- +- with_any_broadcom = with_gallium_vc4 or with_gallium_v3d or with_broadcom_vk +--with_any_intel = with_intel_vk or with_intel_hasvk or with_gallium_iris or with_gallium_crocus or with_intel_tools +-+with_any_intel = [ +-+ with_gallium_crocus, +-+ with_gallium_i915, +-+ with_gallium_iris, +-+ with_intel_hasvk, +-+ with_intel_tools, +-+ with_intel_vk, +-+].contains(true) +- +- if with_swrast_vk and not with_gallium_softpipe +- error('swrast vulkan requires gallium swrast') +--- +-cgit v1.2.1 +- +diff -urN buildroot/package/mesa3d.orig/mesa3d.hash buildroot/package/mesa3d/mesa3d.hash +--- buildroot/package/mesa3d.orig/mesa3d.hash 2023-10-01 23:05:28.000000000 +0200 ++++ buildroot/package/mesa3d/mesa3d.hash 1970-01-01 01:00:00.000000000 +0100 +@@ -1,5 +0,0 @@ +-# From https://lists.freedesktop.org/archives/mesa-announce/2023-September/000730.html +-sha256 45434ff91a709844130a3174d9c0ef39c6b50725b2bb0c13e736f36134db14ad mesa-23.1.8.tar.xz +-sha512 02dc6f8b10dd3827a2b62fba3035726b1b60ec0c3188817deea2ad14f80f332a37272e9f15c5f653f20cecb14f8ff91697d73c89afc83674c19b686a674b677d mesa-23.1.8.tar.xz +-# License +-sha256 a00275a53178e2645fb65be99a785c110513446a5071ff2c698ed260ad917d75 docs/license.rst +diff -urN buildroot/package/mesa3d.orig/mesa3d.mk buildroot/package/mesa3d/mesa3d.mk +--- buildroot/package/mesa3d.orig/mesa3d.mk 2023-10-01 23:05:28.000000000 +0200 ++++ buildroot/package/mesa3d/mesa3d.mk 2023-10-16 22:07:23.863228341 +0200 +@@ -4,10 +4,10 @@ + # + ################################################################################ + +-# When updating the version, please also update mesa3d-headers +-MESA3D_VERSION = 23.1.8 +-MESA3D_SOURCE = mesa-$(MESA3D_VERSION).tar.xz +-MESA3D_SITE = https://archive.mesa3d.org ++# gitid that has Pi 5 support ++MESA3D_VERSION = cba898a53059b12b948fba7c69634a033c6dccad ++MESA3D_SITE = https://gitlab.freedesktop.org/mesa/mesa.git ++MESA3D_SITE_METHOD = git + MESA3D_LICENSE = MIT, SGI, Khronos + MESA3D_LICENSE_FILES = docs/license.rst + MESA3D_CPE_ID_VENDOR = mesa3d diff --git a/embedded/imager/board/overlay/init b/embedded/imager/board/overlay/init index c38517d..bf73fe2 100755 --- a/embedded/imager/board/overlay/init +++ b/embedded/imager/board/overlay/init @@ -22,7 +22,7 @@ mkdir -p /var/run dhcpcd -f /etc/dhcpcd.conf --noarp 2>/dev/null & if grep -q debugconsole /proc/cmdline; then - /sbin/getty -L ttyAMA0 0 vt100 & + /sbin/getty -L console 0 vt100 & fi if grep -q blockingconsole /proc/cmdline; then diff --git a/embedded/imager/configs/rpi-imager_defconfig b/embedded/imager/configs/rpi-imager_defconfig index f5042ad..10fc5bd 100644 --- a/embedded/imager/configs/rpi-imager_defconfig +++ b/embedded/imager/configs/rpi-imager_defconfig @@ -2,6 +2,8 @@ BR2_aarch64=y BR2_cortex_a72=y BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_6_1=y BR2_TOOLCHAIN_BUILDROOT_CXX=y +BR2_SSP_NONE=y +BR2_FORTIFY_SOURCE_NONE=y BR2_INIT_NONE=y BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y BR2_ROOTFS_MERGED_USR=y @@ -10,7 +12,7 @@ BR2_ROOTFS_OVERLAY="$(BR2_EXTERNAL_IMAGER_PATH)/board/overlay/" BR2_ROOTFS_POST_BUILD_SCRIPT="$(BR2_EXTERNAL_IMAGER_PATH)/board/post-build.sh" BR2_LINUX_KERNEL=y BR2_LINUX_KERNEL_CUSTOM_TARBALL=y -BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="$(call github,raspberrypi,linux,2ff65ffbdeb0c8764985af19df2a687a126136f4)/linux-2ff65ffbdeb0c8764985af19df2a687a126136f4.tar.gz" +BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="$(call github,raspberrypi,linux,2a47ccf97c6a91bc56f8cfb387d47f59cc347dd5)/linux-2a47ccf97c6a91bc56f8cfb387d47f59cc347dd5.tar.gz" BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL_IMAGER_PATH)/board/bcm2711_defconfig_minus_modules" BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="$(BR2_EXTERNAL_IMAGER_PATH)/board/kernel_config_fragment_imager" diff --git a/embedded/output/cmdline.txt b/embedded/output/cmdline.txt index e56ef0b..e61c857 100644 --- a/embedded/output/cmdline.txt +++ b/embedded/output/cmdline.txt @@ -1 +1 @@ -quiet console=serial0,115200 console=tty1 debugconsole +quiet console=tty1 console=serial0,115200 debugconsole diff --git a/embedded/output/config.txt b/embedded/output/config.txt index a0e9105..03e9891 100644 --- a/embedded/output/config.txt +++ b/embedded/output/config.txt @@ -1,7 +1,3 @@ -[HDMI:0] -hdmi_pixel_freq_limit=200000000 -[HDMI:1] -hdmi_pixel_freq_limit=200000000 [all] kernel=Image.gz initramfs rootfs.cpio.zst