Skip to content

Commit

Permalink
Use balena bootloader on raspberrypi5
Browse files Browse the repository at this point in the history
Changelog-entry: Use balena bootloader on Raspberry Pi 5
Signed-off-by: Michal Toman <michalt@balena.io>
Signed-off-by: Florin Sarbu <florin@balena.io>
  • Loading branch information
floion committed Jul 3, 2024
1 parent e16ea78 commit 836e321
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ CMDLINE_DEBUG = ""
# Necessary for balena bootloader to work
# These will not be passed to the actual kernel
CMDLINE:append:raspberrypicm4-ioboard-sb := " balena_stage2 nr_cpus=1"
CMDLINE:append:raspberrypi5 := " balena_stage2 maxcpus=0"
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ SDIMG_KERNELIMAGE:raspberrypi2 ?= "kernel7.img"
SDIMG_KERNELIMAGE:raspberrypi3-64 ?= "kernel8.img"
SDIMG_KERNELIMAGE:raspberrypi0-2w-64 ?= "kernel8.img"

# Double the root partition size from 320MiB to 640MiB and boot partition size from 40MiB to 80MiB for the Pi5
IMAGE_ROOTFS_SIZE:raspberrypi5="655360"
BALENA_BOOT_SIZE:raspberrypi5="81920"

# Increase boot partition size
BALENA_BOOT_SIZE:raspberrypicm4-ioboard-sb = "131072"

Expand Down Expand Up @@ -57,6 +61,16 @@ BALENA_ESSENTIAL_BOOT_FILES:append:raspberrypi4-64 = " \
"
do_rootfs[vardeps] += "${@oe.utils.conditional('SIGN_API','','','BALENA_ESSENTIAL_BOOT_FILES',d)}"

BALENA_BOOT_PARTITION_FILES:remove:raspberrypi5 = " \
u-boot.bin:/${SDIMG_KERNELIMAGE} \
boot.scr:/boot.scr \
"

BALENA_BOOT_PARTITION_FILES:append:raspberrypi5 = " \
balena-bootloader/${KERNEL_IMAGETYPE}-initramfs-${MACHINE}.bin:/${SDIMG_KERNELIMAGE} \
balena-bootloader/bootenv:/bootenv \
"

BALENA_BOOT_PARTITION_FILES:append:revpi-core-3 = " revpi-core-dt-blob-overlay.dtb:/dt-blob.bin"

BALENA_BOOT_PARTITION_FILES:append:revpi-connect = " revpi-connect-dt-blob-overlay.dtb:/dt-blob.bin"
Expand Down Expand Up @@ -92,9 +106,13 @@ do_resin_boot_dirgen_and_deploy[prefuncs] += "overlay_dtbs_handler"
IMAGE_INSTALL:append:rpi = " u-boot"
IMAGE_INSTALL:remove:raspberrypicm4-ioboard-sb = " u-boot"
IMAGE_INSTALL:append:raspberrypicm4-ioboard-sb = " grub-editenv"
IMAGE_INSTALL:remove:raspberrypi5 = " u-boot"
IMAGE_INSTALL:append:raspberrypi5 = " grub-editenv"

do_rootfs[depends] += "${@oe.utils.conditional('MACHINE','raspberrypicm4-ioboard-sb',' virtual/balena-bootloader:do_deploy','',d)}"
do_image_balenaos_img[depends] += "${@oe.utils.conditional('MACHINE','raspberrypicm4-ioboard-sb',' virtual/balena-bootloader:do_deploy','',d)}"
do_rootfs[depends] += "${@oe.utils.conditional('MACHINE','raspberrypi5',' virtual/balena-bootloader:do_deploy','',d)}"
do_image_balenaos_img[depends] += "${@oe.utils.conditional('MACHINE','raspberrypi5',' virtual/balena-bootloader:do_deploy','',d)}"

do_resin_boot_dirgen_and_deploy[depends] += "virtual/kernel:do_install"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ HOSTAPP_HOOKS:append:revpi-core-3 = " 9999-bootfiles"
HOSTAPP_HOOKS:remove:raspberrypicm4-ioboard-sb = "99-resin-uboot 999-resin-boot-cleaner"
HOSTAPP_HOOKS:append:raspberrypicm4-ioboard-sb = " 99-balena-bootloader"

HOSTAPP_HOOKS:remove:raspberrypi5 = "99-resin-uboot 999-resin-boot-cleaner"
HOSTAPP_HOOKS:append:raspberrypi5 = " 99-balena-bootloader"

HOSTAPP_HOOKS:append:raspberrypi4-64 = " 98-pieeprom"
RDEPENDS:${PN}:append:raspberrypi4-64 = " rpi-eeprom"

Expand Down

0 comments on commit 836e321

Please sign in to comment.