From 41b12fce05f611f3c32314268d39c37f695cc73a Mon Sep 17 00:00:00 2001 From: Quentin Schulz Date: Fri, 31 May 2024 11:25:18 +0200 Subject: [PATCH] bsp: u-boot: split things that can apply to any U-Boot into a .inc file Anyone writing their own U-Boot recipe for their Rockchip-based board will need to repeat the same as currently done in a bbappend that only applies to the upstream u-boot recipe from OE-Core. This is both error-prone and more difficult to maintain as well as lowering the number of people actually using the code in meta-rockchip (thus increasing maintainer load by having less people debug the code). Move everything that is Rockchip-specific but reusable in an .inc file that can be included by other layers. Signed-off-by: Quentin Schulz --- recipes-bsp/u-boot/u-boot-rockchip.inc | 19 +++++++++++++++++++ recipes-bsp/u-boot/u-boot_%.bbappend | 22 ++-------------------- 2 files changed, 21 insertions(+), 20 deletions(-) create mode 100644 recipes-bsp/u-boot/u-boot-rockchip.inc diff --git a/recipes-bsp/u-boot/u-boot-rockchip.inc b/recipes-bsp/u-boot/u-boot-rockchip.inc new file mode 100644 index 0000000..0a634fc --- /dev/null +++ b/recipes-bsp/u-boot/u-boot-rockchip.inc @@ -0,0 +1,19 @@ +BL31:rockchip:aarch64 = "${DEPLOY_DIR_IMAGE}/bl31-${SOC_FAMILY}.elf" +# SOC_FAMILY for RK3588S is rk3588s but it should use the binaries from rk3588 +BL31:rk3588s = "${DEPLOY_DIR_IMAGE}/bl31-rk3588.elf" +EXTRA_OEMAKE:append:rockchip:aarch64 = " BL31=${BL31}" + +TFA_DEPENDS ??= "" +TFA_DEPENDS:rockchip:aarch64 = " trusted-firmware-a:do_deploy" +do_compile[depends] .= "${TFA_DEPENDS}" + +# No open-source TPL (yet) +EXTRA_OEMAKE:append:rk3308 = " ROCKCHIP_TPL=${DEPLOY_DIR_IMAGE}/ddr-rk3308.bin" +EXTRA_OEMAKE:append:rk3568 = " ROCKCHIP_TPL=${DEPLOY_DIR_IMAGE}/ddr-rk3568.bin" +EXTRA_OEMAKE:append:rk3588s = " ROCKCHIP_TPL=${DEPLOY_DIR_IMAGE}/ddr-rk3588.bin" + +INIT_FIRMWARE_DEPENDS ??= "" +INIT_FIRMWARE_DEPENDS:rk3308 = " rockchip-rkbin:do_deploy" +INIT_FIRMWARE_DEPENDS:rk3568 = " rockchip-rkbin:do_deploy" +INIT_FIRMWARE_DEPENDS:rk3588s = " rockchip-rkbin:do_deploy" +do_compile[depends] .= "${INIT_FIRMWARE_DEPENDS}" diff --git a/recipes-bsp/u-boot/u-boot_%.bbappend b/recipes-bsp/u-boot/u-boot_%.bbappend index 60f93a4..1f5f634 100644 --- a/recipes-bsp/u-boot/u-boot_%.bbappend +++ b/recipes-bsp/u-boot/u-boot_%.bbappend @@ -1,3 +1,5 @@ +require u-boot-rockchip.inc + FILESEXTRAPATHS:prepend := "${THISDIR}/files:" SRC_URI:append:rk-u-boot-env = " file://rockchip-enable-environment-mmc.cfg" @@ -7,26 +9,6 @@ DEPENDS:append:rk3308 = " u-boot-tools-native" DEPENDS:append:rock-pi-4 = " gnutls-native" DEPENDS:append:rk-u-boot-env = " u-boot-mkenvimage-native" -BL31:rockchip:aarch64 = "${DEPLOY_DIR_IMAGE}/bl31-${SOC_FAMILY}.elf" -# SOC_FAMILY for RK3588S is rk3588s but it should use the binaries from rk3588 -BL31:rk3588s = "${DEPLOY_DIR_IMAGE}/bl31-rk3588.elf" -EXTRA_OEMAKE:append:rockchip:aarch64 = " BL31=${BL31}" - -TFA_DEPENDS ??= "" -TFA_DEPENDS:rockchip:aarch64 = " trusted-firmware-a:do_deploy" -do_compile[depends] .= "${TFA_DEPENDS}" - -# No open-source TPL (yet) -EXTRA_OEMAKE:append:rk3308 = " ROCKCHIP_TPL=${DEPLOY_DIR_IMAGE}/ddr-rk3308.bin" -EXTRA_OEMAKE:append:rk3568 = " ROCKCHIP_TPL=${DEPLOY_DIR_IMAGE}/ddr-rk3568.bin" -EXTRA_OEMAKE:append:rk3588s = " ROCKCHIP_TPL=${DEPLOY_DIR_IMAGE}/ddr-rk3588.bin" - -INIT_FIRMWARE_DEPENDS ??= "" -INIT_FIRMWARE_DEPENDS:rk3308 = " rockchip-rkbin:do_deploy" -INIT_FIRMWARE_DEPENDS:rk3568 = " rockchip-rkbin:do_deploy" -INIT_FIRMWARE_DEPENDS:rk3588s = " rockchip-rkbin:do_deploy" -do_compile[depends] .= "${INIT_FIRMWARE_DEPENDS}" - do_compile:append:rock2-square () { # copy to default search path if [ "${SPL_BINARY}" = "u-boot-spl-dtb.bin" ]; then