diff mbox series

[meta-rockchip,1/3] bsp: rkbin: add .inc for factoring out reusable pieces

Message ID 20240927-rkbin-split-recipes-v1-1-0f4a9b0cbf56@cherry.de
State New
Headers show
Series bsp: rkbin: split rkbin into separate recipes for DDR init, TF-A and OP-TEE OS | expand

Commit Message

Quentin Schulz Sept. 27, 2024, 12:36 p.m. UTC
From: Quentin Schulz <quentin.schulz@cherry.de>

In future commits, the rkbin recipe will be split into multiple ones:
- one for TPL DRAM init
- one for TF-A blob (BL31)
- one for OP-TEE OS blob (BL32)

Since in most cases those three blobs will be coming from the exact same
commit hash and repo, let's have a .inc so some duplication can be
avoided.

Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
---
 recipes-bsp/rkbin/rockchip-rkbin.inc    | 30 ++++++++++++++++++++++++++++++
 recipes-bsp/rkbin/rockchip-rkbin_git.bb | 31 +------------------------------
 2 files changed, 31 insertions(+), 30 deletions(-)
diff mbox series

Patch

diff --git a/recipes-bsp/rkbin/rockchip-rkbin.inc b/recipes-bsp/rkbin/rockchip-rkbin.inc
new file mode 100644
index 0000000..abd2e30
--- /dev/null
+++ b/recipes-bsp/rkbin/rockchip-rkbin.inc
@@ -0,0 +1,30 @@ 
+SRC_URI = "git://github.com/rockchip-linux/rkbin;protocol=https;branch=master"
+SRCREV = "a2a0b89b6c8c612dca5ed9ed8a68db8a07f68bc0"
+LICENSE = "Proprietary"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=15faa4a01e7eb0f5d33f9f2bcc7bff62"
+
+inherit bin_package deploy
+
+S = "${WORKDIR}/git"
+
+COMPATIBLE_MACHINE = "^$"
+COMPATIBLE_MACHINE:rk3308 = "rk3308"
+COMPATIBLE_MACHINE:rk3566 = "rk3566"
+COMPATIBLE_MACHINE:rk3568 = "rk3568"
+COMPATIBLE_MACHINE:rk3588s = "rk3588s"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+do_install() {
+	# Nothing in this recipe is useful in a filesystem
+	:
+}
+
+PACKAGES = "${PN}"
+ALLOW_EMPTY:${PN} = "1"
+
+do_deploy() {
+	bbfatal "COMPATIBLE_MACHINE requires a corresponding do_deploy:<MACHINE>() override"
+}
+
+addtask deploy after do_install
diff --git a/recipes-bsp/rkbin/rockchip-rkbin_git.bb b/recipes-bsp/rkbin/rockchip-rkbin_git.bb
index 1b71414..a841c2e 100644
--- a/recipes-bsp/rkbin/rockchip-rkbin_git.bb
+++ b/recipes-bsp/rkbin/rockchip-rkbin_git.bb
@@ -1,33 +1,10 @@ 
 DESCRIPTION = "Rockchip Firmware and Tool Binaries"
-LICENSE = "Proprietary"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=15faa4a01e7eb0f5d33f9f2bcc7bff62"
 
-SRC_URI = "git://github.com/rockchip-linux/rkbin;protocol=https;branch=master"
-SRCREV = "a2a0b89b6c8c612dca5ed9ed8a68db8a07f68bc0"
+require rockchip-rkbin.inc
 
 PROVIDES += "trusted-firmware-a"
 PROVIDES += "optee-os"
 
-inherit bin_package deploy
-
-S = "${WORKDIR}/git"
-
-COMPATIBLE_MACHINE = "^$"
-COMPATIBLE_MACHINE:rk3308 = "rk3308"
-COMPATIBLE_MACHINE:rk3566 = "rk3566"
-COMPATIBLE_MACHINE:rk3568 = "rk3568"
-COMPATIBLE_MACHINE:rk3588s = "rk3588s"
-
-PACKAGE_ARCH = "${MACHINE_ARCH}"
-
-do_install() {
-	# Nothing in this recipe is useful in a filesystem
-	:
-}
-
-PACKAGES = "${PN}"
-ALLOW_EMPTY:${PN} = "1"
-
 do_deploy:rk3308() {
 	# Prebuilt TF-A
 	install -m 644 ${S}/bin/rk33/rk3308_bl31_v*.elf ${DEPLOYDIR}/bl31-rk3308.elf
@@ -65,9 +42,3 @@  do_deploy:rk3588s() {
 	# Prebuilt U-Boot TPL (DDR init)
 	install -m 644 ${S}/bin/rk35/rk3588_ddr_lp4_2112MHz_lp5_2400MHz_v1.16.bin ${DEPLOYDIR}/ddr-rk3588.bin
 }
-
-do_deploy() {
-	bbfatal "COMPATIBLE_MACHINE requires a corresponding do_deploy:<MACHINE>() override"
-}
-
-addtask deploy after do_install