fitimage rework

oe-core has completely re-written the fitImage support starting roughly at
commit [1], update meta-rockchip to match.

Most of the MACHINEs in meta-rockchip use a fitImage for the kernel, but
some don't. Create a boolean variable (RK_KERNEL_FITIMAGE), enabled by
default, to keep track of which ones do and which ones don't. Use this
variable to decide how to configure various image-related fields.

Build tested with all meta-rockchip MACHINEs both with and without RAUC.

Run tested on the following with RAUC configured:
	- nanopi-m4b
	- nanopi-r2s
	- radxa-zero-3e
	- rock-pi-4b
	- rock-pi-e
	- rock-pi-s

Run tested on the following without RAUC:
	- radxa-zero-3e
	- rock-pi-e
	- rock-pi-s

[1] oe-core: 3442d9297dca ("oe-selftest: fitimage: test external dtb")
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
Signed-off-by: Trevor Woerner <twoerner@gmail.com>
This commit is contained in:
Trevor Woerner 2025-06-10 17:21:52 -04:00
parent 61505560d4
commit fe7cfa748b
14 changed files with 28 additions and 21 deletions

10
README
View File

@ -159,6 +159,16 @@ Notes:
compatible (see Rockchip Media Process Platform (MPP) and
downstream gstreamer-rockchip plugin for those kernels).
RK_KERNEL_FITIMAGE
When generating an image, the BSP code needs to know whether or not to
package the kernel pieces as a fitImage or not. By default it is assumed
most MACHINEs will use the fitImage format. Otherwise disable the
RK_KERNEL_FITIMAGE variable boolean to indicate otherwise.
NOTE: this variable must be set before any include/require in the
machine configuration file
U-Boot Environment:
------------------
In order to configure U-Boot to be able to store its environment into the

View File

@ -11,8 +11,6 @@ require conf/machine/include/arm/armv8a/tune-cortexa35.inc
require conf/machine/include/rockchip-wic.inc
KBUILD_DEFCONFIG ?= "defconfig"
KERNEL_CLASSES = "kernel-fitimage"
KERNEL_IMAGETYPE ?= "fitImage"
TFA_PLATFORM = "px30"
TFA_BUILD_TARGET = "bl31"

View File

@ -2,6 +2,7 @@
# Released under the MIT license (see COPYING.MIT for the terms)
SOC_FAMILY = "rk3066"
RK_KERNEL_FITIMAGE ?= "False"
require conf/machine/include/soc-family.inc
require conf/machine/include/rockchip-defaults.inc
@ -11,6 +12,5 @@ SERIAL_CONSOLES = "115200;ttyS2"
KBUILD_DEFCONFIG = "multi_v7_defconfig"
KERNEL_FEATURES:append:rk3066 = " bsp/rockchip/remove-non-rockchip-arch-arm.scc"
KERNEL_IMAGETYPE ?= "zImage"
ENABLE_STATELESS_VPU_GST ?= "1"

View File

@ -2,6 +2,7 @@
# Released under the MIT license (see COPYING.MIT for the terms)
SOC_FAMILY = "rk3188"
RK_KERNEL_FITIMAGE ?= "False"
require conf/machine/include/soc-family.inc
require conf/machine/include/rockchip-defaults.inc
@ -11,6 +12,5 @@ SERIAL_CONSOLES = "115200;ttyFIQ0"
KBUILD_DEFCONFIG = "multi_v7_defconfig"
KERNEL_FEATURES:append:rk3188 = " bsp/rockchip/remove-non-rockchip-arch-arm.scc"
KERNEL_IMAGETYPE ?= "zImage"
ENABLE_STATELESS_VPU_GST ?= "1"

View File

@ -2,6 +2,7 @@
# Released under the MIT license (see COPYING.MIT for the terms)
SOC_FAMILY = "rk3288"
RK_KERNEL_FITIMAGE ?= "False"
require conf/machine/include/soc-family.inc
require conf/machine/include/rockchip-defaults.inc
@ -11,7 +12,6 @@ SERIAL_CONSOLES = "115200;ttyS2"
KBUILD_DEFCONFIG ?= "multi_v7_defconfig"
KERNEL_FEATURES:append:rk3288 = " bsp/rockchip/remove-non-rockchip-arch-arm.scc"
KERNEL_IMAGETYPE ?= "zImage"
UBOOT_SUFFIX ?= "bin"

View File

@ -13,8 +13,6 @@ SERIAL_CONSOLES = "1500000;ttyS0"
KBUILD_DEFCONFIG ?= "defconfig"
KERNEL_FEATURES:append:rk3308 = " bsp/rockchip/remove-non-rockchip-arch-arm64.scc"
KERNEL_CLASSES = "kernel-fitimage"
KERNEL_IMAGETYPE ?= "fitImage"
UBOOT_SUFFIX ?= "itb"
UBOOT_ENTRYPOINT ?= "0x06000000"

View File

@ -12,8 +12,6 @@ require conf/machine/include/rockchip-wic.inc
KBUILD_DEFCONFIG ?= "defconfig"
KERNEL_FEATURES:append:rk3328 = " bsp/rockchip/remove-non-rockchip-arch-arm64.scc"
KERNEL_CLASSES = "kernel-fitimage"
KERNEL_IMAGETYPE ?= "fitImage"
TFA_PLATFORM = "rk3328"
TFA_BUILD_TARGET = "bl31"

View File

@ -12,8 +12,6 @@ require conf/machine/include/rockchip-wic.inc
KBUILD_DEFCONFIG ?= "defconfig"
KERNEL_FEATURES:append:rk3399 = " bsp/rockchip/remove-non-rockchip-arch-arm64.scc"
KERNEL_CLASSES = "kernel-fitimage"
KERNEL_IMAGETYPE ?= "fitImage"
TFA_PLATFORM = "rk3399"
TFA_BUILD_TARGET = "bl31"

View File

@ -11,8 +11,6 @@ require conf/machine/include/rockchip-wic.inc
KBUILD_DEFCONFIG ?= "defconfig"
KERNEL_FEATURES:append:rk3566 = " bsp/rockchip/remove-non-rockchip-arch-arm64.scc"
KERNEL_CLASSES = "kernel-fitimage"
KERNEL_IMAGETYPE ?= "fitImage"
PREFERRED_PROVIDER_trusted-firmware-a = "rockchip-rkbin-tf-a"
PREFERRED_PROVIDER_optee-os = "rockchip-rkbin-optee-os"

View File

@ -11,8 +11,6 @@ require conf/machine/include/rockchip-wic.inc
KBUILD_DEFCONFIG ?= "defconfig"
KERNEL_FEATURES:append:rk3568 = " bsp/rockchip/remove-non-rockchip-arch-arm64.scc"
KERNEL_CLASSES = "kernel-fitimage"
KERNEL_IMAGETYPE ?= "fitImage"
PREFERRED_PROVIDER_trusted-firmware-a = "rockchip-rkbin-tf-a"
PREFERRED_PROVIDER_optee-os = "rockchip-rkbin-optee-os"

View File

@ -10,8 +10,6 @@ require conf/machine/include/rockchip-wic.inc
KBUILD_DEFCONFIG ?= "defconfig"
KERNEL_FEATURES:append:rk3588s = " bsp/rockchip/remove-non-rockchip-arch-arm64.scc"
KERNEL_CLASSES = "kernel-fitimage"
KERNEL_IMAGETYPE ?= "fitImage"
PREFERRED_PROVIDER_trusted-firmware-a = "rockchip-rkbin-tf-a"
PREFERRED_PROVIDER_optee-os = "rockchip-rkbin-optee-os"

View File

@ -1,9 +1,16 @@
# meta-rockchip default settings
MACHINEOVERRIDES =. "${@bb.utils.contains('ROCKCHIP_CLOSED_TPL', '1', 'closed-tpl:', '', d)}"
MACHINEOVERRIDES =. "rockchip:"
# kernel
# RK_KERNEL_FITIMAGE needs to be set before the next "require ..."
RK_KERNEL_FITIMAGE ?= "True"
PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto"
KCONFIG_MODE ?= "alldefconfig"
MACHINE_ESSENTIAL_EXTRA_RDEPENDS_KERNEL = "kernel-devicetree"
MACHINE_ESSENTIAL_EXTRA_RDEPENDS += "${MACHINE_ESSENTIAL_EXTRA_RDEPENDS_KERNEL}"
require ${@ 'conf/machine/include/rockchip-fitimage.inc' if bb.utils.to_boolean(d.getVar('RK_KERNEL_FITIMAGE')) else ''}
KERNEL_IMAGETYPE ?= "zImage"
# xserver
XSERVER = " \

View File

@ -13,13 +13,12 @@ NONFITDT ?= "${@d.getVar('KERNEL_DEVICETREE').split()[0].split('/')[1]}"
UBOOT_EXTLINUX ?= "1"
UBOOT_EXTLINUX_ROOT ?= "root=PARTLABEL=rootfsA"
UBOOT_EXTLINUX_FDTDIR ?= "${@bb.utils.contains('KERNEL_IMAGETYPE', 'fitImage', '', '/boot', d)}"
UBOOT_EXTLINUX_FDT ?= "${@bb.utils.contains('KERNEL_IMAGETYPE', 'fitImage', '', '/boot/${NONFITDT}', d)}"
UBOOT_EXTLINUX_FDTDIR ?= "${@ '' if bb.utils.to_boolean(d.getVar('RK_KERNEL_FITIMAGE')) else '/boot'}"
UBOOT_EXTLINUX_FDT ?= "${@ '' if bb.utils.to_boolean(d.getVar('RK_KERNEL_FITIMAGE')) else '/boot/${NONFITDT}'}"
UBOOT_EXTLINUX_CONSOLE ?= "earlycon console=tty1 console=${RK_CONSOLE_DEVICE},${RK_CONSOLE_BAUD}n8"
UBOOT_EXTLINUX_KERNEL_ARGS ?= "rootwait rw rootfstype=ext4"
UBOOT_EXTLINUX_KERNEL_IMAGE ?= "/boot/${KERNEL_IMAGETYPE}"
UBOOT_EXTLINUX_KERNEL_IMAGE ?= "/boot/${@ 'fitImage' if bb.utils.to_boolean(d.getVar('RK_KERNEL_FITIMAGE')) else '${KERNEL_IMAGETYPE}'}"
UBOOT_EXTLINUX_LABELS ?= "default"
UBOOT_EXTLINUX_MENU_DESCRIPTION:default ?= "${MACHINE}"
MACHINE_ESSENTIAL_EXTRA_RDEPENDS += "u-boot-extlinux"
MACHINE_ESSENTIAL_EXTRA_RDEPENDS += "kernel-image ${@bb.utils.contains('KERNEL_IMAGETYPE', 'fitImage', '', 'kernel-devicetree', d)}"

View File

@ -0,0 +1,5 @@
KERNEL_CLASSES += "kernel-fit-extra-artifacts"
KERNEL_IMAGETYPE ?= "Image"
RRECOMMENDS:${KERNEL_PACKAGE_NAME}-base = ""
KERNEL_DEPLOY_DEPEND ?= "linux-yocto-fitimage:do_deploy"
MACHINE_ESSENTIAL_EXTRA_RDEPENDS_KERNEL = "linux-yocto-fitimage"