Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gui-v2 with hardware acceleration on raspberry-pi #27

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
91 changes: 77 additions & 14 deletions meta-bsp/conf/machine/include/rpi-base.inc
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,82 @@ WKS_FILE ?= "sdimage-raspberrypi.wks"
MACHINE_FEATURES += "headless"

PREFERRED_PROVIDER_virtual/kernel ?= "linux-raspberrypi"
PREFERRED_PROVIDER_virtual/egl ?= "${@bb.utils.contains("MACHINE_FEATURES", "vc4graphics", "mesa", "", d)}"
PREFERRED_PROVIDER_virtual/libgles2 ?= "${@bb.utils.contains("MACHINE_FEATURES", "vc4graphics", "mesa", "", d)}"
PREFERRED_PROVIDER_virtual/libgl ?= "${@bb.utils.contains("MACHINE_FEATURES", "vc4graphics", "mesa", "mesa-gl", d)}"
PREFERRED_PROVIDER_virtual/mesa ?= "${@bb.utils.contains("MACHINE_FEATURES", "vc4graphics", "mesa", "mesa-gl", d)}"
PREFERRED_PROVIDER_virtual/libgbm ?= "${@bb.utils.contains("MACHINE_FEATURES", "vc4graphics", "mesa", "mesa-gl", d)}"

RPI_KERNEL_DEVICETREE_OVERLAYS = " \
overlays/ads7846.dtbo \
overlays/overlay_map.dtb \
overlays/at86rf233.dtbo \
overlays/disable-bt.dtbo \
overlays/disable-wifi.dtbo \
overlays/gpio-fan.dtbo \
overlays/pitft28-capacitive.dtbo \
overlays/pitft35-resistive.dtbo \
overlays/rpi-display.dtbo \
overlays/dwc2.dtbo \
overlays/gpio-ir.dtbo \
overlays/gpio-ir-tx.dtbo \
overlays/gpio-key.dtbo \
overlays/gpio-poweroff.dtbo \
overlays/gpio-shutdown.dtbo \
overlays/hifiberry-amp.dtbo \
overlays/hifiberry-amp100.dtbo \
overlays/hifiberry-amp3.dtbo \
overlays/hifiberry-amp4pro.dtbo \
overlays/hifiberry-dac.dtbo \
overlays/hifiberry-dacplus.dtbo \
overlays/hifiberry-dacplusadc.dtbo \
overlays/hifiberry-dacplusadcpro.dtbo \
overlays/hifiberry-dacplusdsp.dtbo \
overlays/hifiberry-dacplushd.dtbo \
overlays/hifiberry-digi-pro.dtbo \
overlays/hifiberry-digi.dtbo \
overlays/justboom-both.dtbo \
overlays/justboom-dac.dtbo \
overlays/justboom-digi.dtbo \
overlays/i2c-gpio.dtbo \
overlays/i2c-rtc.dtbo \
overlays/imx219.dtbo \
overlays/imx477.dtbo \
overlays/imx708.dtbo \
overlays/iqaudio-dac.dtbo \
overlays/iqaudio-dacplus.dtbo \
overlays/mcp2515-can0.dtbo \
overlays/mcp2515-can1.dtbo \
overlays/mcp251xfd.dtbo \
overlays/rpi-backlight.dtbo \
overlays/mcp3008.dtbo \
overlays/miniuart-bt.dtbo \
overlays/pitft22.dtbo \
overlays/pitft28-capacitive.dtbo \
overlays/pitft28-resistive.dtbo \
overlays/pitft35-resistive.dtbo \
overlays/pps-gpio.dtbo \
overlays/rpi-ft5406.dtbo \
overlays/sc16is752-spi1.dtbo \
overlays/spi1-3cs.dtbo \
overlays/waveshare-can-fd-hat-mode-a.dtbo \
overlays/waveshare-can-fd-hat-mode-b.dtbo \
overlays/rpi-poe.dtbo \
overlays/uart0.dtbo \
overlays/uart1.dtbo \
overlays/uart2.dtbo \
overlays/uart3.dtbo \
overlays/uart4.dtbo \
overlays/uart5.dtbo \
overlays/vc4-fkms-v3d.dtbo \
overlays/vc4-fkms-v3d-pi4.dtbo \
overlays/vc4-kms-dsi-waveshare-panel.dtbo \
overlays/vc4-kms-v3d.dtbo \
overlays/vc4-kms-v3d-pi4.dtbo \
overlays/vc4-kms-dsi-7inch.dtbo \
overlays/w1-gpio.dtbo \
overlays/w1-gpio-pullup.dtbo \
overlays/wm8960-soundcard.dtbo \
"

RPI_KERNEL_DEVICETREE_OVERLAYS:append:raspberrypi5 = " \
overlays/disable-bt-pi5.dtbo \
overlays/disable-wifi-pi5.dtbo \
overlays/uart0-pi5.dtbo \
overlays/uart1-pi5.dtbo \
overlays/uart2-pi5.dtbo \
overlays/uart3-pi5.dtbo \
overlays/uart4-pi5.dtbo \
overlays/vc4-kms-v3d-pi5.dtbo \
"

KERNEL_PACKAGES ?= "kernel-image kernel-modules"
Expand All @@ -50,16 +108,21 @@ MACHINE_FEATURES_BACKFILL_CONSIDERED = "rtc"
SWU_VERSION = "3"

IMAGE_BOOT_FILES ?= " \
bcm2835-bootfiles/* \
bootfiles/* \
config.txt \
cmdline.txt \
${RPI_KERNEL_DEVICETREE} \
${RPI_KERNEL_DEVICETREE_OVERLAYS} \
${@' '.join([os.path.basename(dtb) for dtb in d.getVar("RPI_KERNEL_DEVICETREE_DTB").split()])} \
${UBOOT_BINARY} \
"

do_image_wic[depends] += " \
bcm2835-bootfiles:do_deploy \
rpi-bootfiles:do_deploy \
virtual/bootloader:do_deploy \
"

do_image_wic[recrdeps] = "do_deploy"

# The kernel image is installed into the FAT32 boot partition and does not need
# to also be installed into the rootfs.
RDEPENDS:${KERNEL_PACKAGE_NAME}-base = ""
22 changes: 15 additions & 7 deletions meta-bsp/conf/machine/raspberrypi2.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,27 @@ DEFAULTTUNE = "cortexa7hf-neon-vfpv4"
require conf/machine/include/tune-cortexa7.inc
require conf/machine/include/rpi-base.inc

MACHINE_EXTRA_RRECOMMENDS += "\
linux-firmware-rpidistro-bcm43430 \
linux-firmware-rpidistro-bcm43455 \
bluez-firmware-rpidistro-bcm43430a1-hcd \
bluez-firmware-rpidistro-bcm4345c0-hcd \
linux-firmware-rpidistro-bcm43436 \
linux-firmware-rpidistro-bcm43436s \
bluez-firmware-rpidistro-bcm43430b0-hcd \
"

SERIAL_CONSOLES = "-l;/sbin/autologin;-n;115200;ttyAMA0 -l;/sbin/autologin;-n;38400;tty1"
USE_VT = "0"

UBOOT_MACHINE = "rpi_2_config"

KERNEL_CONFIG = "bcm2709_defconfig"

RPI_KERNEL_DEVICETREE_DTB = " \
bcm2709-rpi-2-b.dtb \
bcm2837-rpi-3-a-plus.dtb \
bcm2710-rpi-3-b.dtb \
bcm2710-rpi-3-b-plus.dtb \
bcm2710-rpi-zero-2-w.dtb \
broadcom/bcm2709-rpi-2-b.dtb \
broadcom/bcm2837-rpi-3-a-plus.dtb \
broadcom/bcm2710-rpi-3-b.dtb \
broadcom/bcm2710-rpi-3-b-plus.dtb \
broadcom/bcm2710-rpi-zero-2-w.dtb \
"

RPI_KERNEL_DEVICETREE_OVERLAYS += " \
Expand Down
13 changes: 11 additions & 2 deletions meta-bsp/conf/machine/raspberrypi4.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,18 @@ DEFAULTTUNE ?= "cortexa7hf-neon-vfpv4"
require conf/machine/include/tune-cortexa7.inc
require conf/machine/include/rpi-base.inc

KERNEL_CONFIG = "bcm2711_defconfig"
MACHINE_FEATURES += "pci"
MACHINE_EXTRA_RRECOMMENDS += "\
linux-firmware-rpidistro-bcm43455 \
bluez-firmware-rpidistro-bcm4345c0-hcd \
linux-firmware-rpidistro-bcm43456 \
bluez-firmware-rpidistro-bcm4345c5-hcd \
"

RPI_KERNEL_DEVICETREE_DTB = "bcm2711-rpi-4-b.dtb"
# start-gui can switch between gui-v1 and gui-v2
START_GUI = "start-gui"

RPI_KERNEL_DEVICETREE_DTB = "broadcom/bcm2711-rpi-4-b.dtb"

UBOOT_MACHINE = "rpi_4_32b_config"
SERIAL_CONSOLES ?= "-l;/sbin/autologin;-n;115200;ttyS0 -l;/sbin/autologin;-n;38400;tty1"
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
enable_uart=1
kernel=u-boot.bin
dtoverlay=vc4-kms-v3d

[all]
device_tree=bcm2711-rpi-4-b.dtb
48 changes: 48 additions & 0 deletions meta-bsp/recipes-bsp/bootfiles-raspberrypi/rpi-bootfiles.bb
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
DESCRIPTION = "Closed source binary files to help boot all raspberry pi devices."
LICENSE = "Proprietary"

LIC_FILES_CHKSUM = "file://LICENCE.broadcom;md5=c403841ff2837657b2ed8e5bb474ac8d"

inherit deploy nopackages

RPIFW_DATE ?= "20240319"
SRCREV = "9f24f4bc2bdd07ffd158cfbb4bce88a2efc4c1f5"
SHORTREV = "${@d.getVar("SRCREV", False).__str__()[:7]}"
RPIFW_SRC_URI ?= "https://api.github.com/repos/raspberrypi/firmware/tarball/9f24f4bc2bdd07ffd158cfbb4bce88a2efc4c1f5;downloadfilename=raspberrypi-firmware-${SHORTREV}.tar.gz"
RPIFW_S ?= "${WORKDIR}/raspberrypi-firmware-${SHORTREV}"

SRC_URI = "${RPIFW_SRC_URI}"
SRC_URI[sha256sum] = "4b436f8946b139c6a1202375ef55d4848e3bcd8c1a9cb47000e06d7ecec828f7"

PV = "${RPIFW_DATE}"

INHIBIT_DEFAULT_DEPS = "1"

COMPATIBLE_MACHINE = "^rpi$"

S = "${RPIFW_S}/boot"

PR = "r3"
BOOTFILES_DIR_NAME ?= "bootfiles"

do_deploy() {
install -d ${DEPLOYDIR}/${BOOTFILES_DIR_NAME}

for i in ${S}/*.elf ; do
cp $i ${DEPLOYDIR}/${BOOTFILES_DIR_NAME}
done
for i in ${S}/*.dat ; do
cp $i ${DEPLOYDIR}/${BOOTFILES_DIR_NAME}
done
for i in ${S}/*.bin ; do
cp $i ${DEPLOYDIR}/${BOOTFILES_DIR_NAME}
done

# Add stamp in deploy directory
touch ${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/${PN}-${PV}.stamp
}

addtask deploy before do_build after do_install
do_deploy[dirs] += "${DEPLOYDIR}/${BOOTFILES_DIR_NAME}"

PACKAGE_ARCH = "${MACHINE_ARCH}"
6 changes: 6 additions & 0 deletions meta-bsp/recipes-graphics/mesa/mesa_20.0.2.bbappend
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# DRI3 note:
# With oe-core commit 8509e2e1a87578882b71948ccef3b50ccf1228b3 dri3 is set
# as default. To state out clearly that Raspi needs dri3 and to avoid surprises
# in case oe-core changes this default, we set dri3 explicitly.
PACKAGECONFIG:append:rpi = " gallium vc4 v3d kmsro ${@bb.utils.contains('DISTRO_FEATURES', 'x11 opengl', 'x11 dri3', '', d)} ${@bb.utils.contains('DISTRO_FEATURES', 'vulkan', 'vulkan broadcom', '', d)}"
DRIDRIVERS:class-target:rpi = ""
Loading