Skip to content

Commit

Permalink
Merge pull request #380 from leon-anavi/rpi5-master
Browse files Browse the repository at this point in the history
Add Raspberry Pi 5 Support in meta-mender-community/meta-mender-raspberrypi
  • Loading branch information
TheYoctoJester authored May 10, 2024
2 parents 4af5d3e + 0f31f99 commit a993e5e
Show file tree
Hide file tree
Showing 31 changed files with 419 additions and 23 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ jobs:
raspberrypi-cm3,
raspberrypi4,
raspberrypi4-64,
raspberrypi5,
qemuarm64,
qemux86-64,
vexpress-qemu,
Expand Down
8 changes: 4 additions & 4 deletions kas/include/mender-base.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
header:
version: 11
version: 14

distro: poky

repos:
poky:
url: git://git.yoctoproject.org/poky
refspec: scarthgap
branch: scarthgap
layers:
meta:
meta-poky:
meta-yocto-bsp:

meta-openembedded:
url: https://git.openembedded.org/meta-openembedded
refspec: scarthgap
branch: scarthgap
layers:
meta-oe:

meta-mender:
url: https://github.com/theyoctojester/meta-mender.git
refspec: scarthgap
branch: scarthgap
layers:
meta-mender-core:

Expand Down
4 changes: 2 additions & 2 deletions kas/include/mender-full-ubi.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
header:
version: 11
version: 14
includes:
- kas/include/mender-base.yml

local_conf_header:
mender-full: |
INHERIT += "mender-full-ubi"
INHERIT += "mender-full-ubi"
4 changes: 2 additions & 2 deletions kas/include/mender-full.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
header:
version: 11
version: 14
includes:
- kas/include/mender-base.yml

local_conf_header:
mender-full: |
INHERIT += "mender-full"
INHERIT += "mender-full"
15 changes: 12 additions & 3 deletions kas/include/raspberrypi.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
header:
version: 11
version: 14

repos:
meta-raspberrypi:
url: https://github.com/agherzan/meta-raspberrypi.git
refspec: 54f6b3c660ad7de9e2e6d5c0e8befe82405c262a
commit: 1879cb831f4ea3e532cb5ce9fa0f32be917e8fa3

meta-lts-mixins:
url: https://git.yoctoproject.org/meta-lts-mixins
branch: scarthgap/u-boot

meta-mender:
url: https://github.com/TheYoctoJester/meta-mender.git
branch: scarthgap

meta-mender-community:
layers:
meta-mender-raspberrypi:

Expand All @@ -16,4 +24,5 @@ local_conf_header:
ENABLE_UART = "1"
MENDER_BOOT_PART_SIZE_MB = "100"
IMAGE_INSTALL:append = " kernel-image kernel-devicetree"
IMAGE_FSTYPES:remove = " rpi-sdimg"
IMAGE_FSTYPES:remove = " rpi-sdimg"
EXTRA_IMAGE_FEATURES = "debug-tweaks"
2 changes: 1 addition & 1 deletion kas/raspberrypi-cm.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
header:
version: 11
version: 14
includes:
- kas/include/mender-full.yml
- kas/include/raspberrypi.yml
Expand Down
2 changes: 1 addition & 1 deletion kas/raspberrypi-cm3.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
header:
version: 11
version: 14
includes:
- kas/include/mender-full.yml
- kas/include/raspberrypi.yml
Expand Down
2 changes: 1 addition & 1 deletion kas/raspberrypi.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
header:
version: 11
version: 14
includes:
- kas/include/mender-full.yml
- kas/include/raspberrypi.yml
Expand Down
2 changes: 1 addition & 1 deletion kas/raspberrypi0-2w-64.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
header:
version: 11
version: 14
includes:
- kas/include/mender-full.yml
- kas/include/raspberrypi.yml
Expand Down
2 changes: 1 addition & 1 deletion kas/raspberrypi0-2w.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
header:
version: 11
version: 14
includes:
- kas/include/mender-full.yml
- kas/include/raspberrypi.yml
Expand Down
2 changes: 1 addition & 1 deletion kas/raspberrypi0-wifi.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
header:
version: 11
version: 14
includes:
- kas/include/mender-full.yml
- kas/include/raspberrypi.yml
Expand Down
2 changes: 1 addition & 1 deletion kas/raspberrypi0.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
header:
version: 11
version: 14
includes:
- kas/include/mender-full.yml
- kas/include/raspberrypi.yml
Expand Down
2 changes: 1 addition & 1 deletion kas/raspberrypi2.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
header:
version: 11
version: 14
includes:
- kas/include/mender-full.yml
- kas/include/raspberrypi.yml
Expand Down
2 changes: 1 addition & 1 deletion kas/raspberrypi3-64.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
header:
version: 11
version: 14
includes:
- kas/include/mender-full.yml
- kas/include/raspberrypi.yml
Expand Down
2 changes: 1 addition & 1 deletion kas/raspberrypi3.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
header:
version: 11
version: 14
includes:
- kas/include/mender-full.yml
- kas/include/raspberrypi.yml
Expand Down
2 changes: 1 addition & 1 deletion kas/raspberrypi4-64.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
header:
version: 11
version: 14
includes:
- kas/include/mender-full.yml
- kas/include/raspberrypi.yml
Expand Down
2 changes: 1 addition & 1 deletion kas/raspberrypi4.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
header:
version: 11
version: 14
includes:
- kas/include/mender-full.yml
- kas/include/raspberrypi.yml
Expand Down
13 changes: 13 additions & 0 deletions kas/raspberrypi5.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
header:
version: 14
includes:
- kas/include/mender-full.yml
- kas/include/raspberrypi.yml

machine: raspberrypi5

local_conf_header:
raspberrypi5: |
KERNEL_IMAGETYPE_UBOOT ?= "Image"
KERNEL_BOOTCMD ?= "booti"
UBOOT_MACHINE = "rpi_arm64_config"
16 changes: 16 additions & 0 deletions meta-mender-raspberrypi/classes/rpi-update-firmware.bbclass
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
rpi_install_firmware_to_rootfs() {
install -d ${IMAGE_ROOTFS}/boot/firmware/overlays

cp ${DEPLOY_DIR_IMAGE}/${BOOTFILES_DIR_NAME}/* ${IMAGE_ROOTFS}/boot/firmware/

# To exclude files such as bcm2710-rpi-3-b-1-4.19.88+git0+988cc7beac-r0-raspberrypi3-20200323173633.dtb
# as only the link names are actually valid and searched for on the device.
find ${DEPLOY_DIR_IMAGE}/ -type l \( -iname "*.dtb" \) -exec cp {} ${IMAGE_ROOTFS}/boot/firmware/ \;
find ${DEPLOY_DIR_IMAGE}/ -type l \( -iname "*.dtbo" \) -exec cp {} ${IMAGE_ROOTFS}/boot/firmware/overlays/ \;

cp ${DEPLOY_DIR_IMAGE}/u-boot.bin ${IMAGE_ROOTFS}/boot/firmware/${SDIMG_KERNELIMAGE}
cp ${DEPLOY_DIR_IMAGE}/boot.scr ${IMAGE_ROOTFS}/boot/firmware/
}
ROOTFS_POSTPROCESS_COMMAND += "rpi_install_firmware_to_rootfs; "

IMAGE_INSTALL:append = " update-firmware-state-script"
22 changes: 22 additions & 0 deletions meta-mender-raspberrypi/conf/layer.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# We have a conf and classes directory, add to BBPATH
BBPATH .= ":${LAYERDIR}"

# We have recipes-* directories, add to BBFILES
BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \
${LAYERDIR}/recipes-*/*/*.bbappend"

BBFILE_COLLECTIONS += "mender-raspberrypi"
BBFILE_PATTERN_mender-raspberrypi = "^${LAYERDIR}/"
BBFILE_PRIORITY_mender-raspberrypi = "10"

LAYERDEPENDS_mender-raspberrypi = "mender raspberrypi"

# Recommended for u-boot support for raspberrypi5
# https://git.yoctoproject.org/meta-lts-mixins 'scarthgap/u-boot' branch
LAYERRECOMMENDS_mender-raspberrypi = "lts-u-boot-mixin"

LAYERSERIES_COMPAT_mender-raspberrypi = "scarthgap"

# Raspberry Pi doesn't work with GRUB currently.
_MENDER_IMAGE_TYPE_DEFAULT:rpi = "mender-image-sd"
_MENDER_BOOTLOADER_DEFAULT:rpi = "mender-uboot"
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CMDLINE_ROOTFS:remove = "root=/dev/mmcblk0p2"
CMDLINE_ROOTFS:append = " root=\${mender_kernel_root} "
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include ${@mender_feature_is_enabled("mender-update-install","rpi-cmdline-mender.inc","",d)}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
fdt addr ${fdt_addr} && fdt get value bootargs /chosen bootargs
run mender_setup
mmc dev ${mender_uboot_dev}
load ${mender_uboot_root} ${kernel_addr_r} /boot/@@KERNEL_IMAGETYPE@@
@@KERNEL_BOOTCMD@@ ${kernel_addr_r} - ${fdt_addr}
run mender_try_to_recover
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
FILESEXTRAPATHS:prepend:rpi:mender-update-install := "${THISDIR}/files:"
Loading

0 comments on commit a993e5e

Please sign in to comment.