From patchwork Mon May 5 14:20:37 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Schulz X-Patchwork-Id: 62465 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id CDB1CC3ABBC for ; Mon, 5 May 2025 14:20:57 +0000 (UTC) Received: from smtp-190a.mail.infomaniak.ch (smtp-190a.mail.infomaniak.ch [185.125.25.10]) by mx.groups.io with SMTP id smtpd.web11.51614.1746454852000012382 for ; Mon, 05 May 2025 07:20:52 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: 0leil.net, ip: 185.125.25.10, mailfrom: foss+yocto@0leil.net) Received: from smtp-3-0000.mail.infomaniak.ch (smtp-3-0000.mail.infomaniak.ch [10.4.36.107]) by smtp-3-3000.mail.infomaniak.ch (Postfix) with ESMTPS id 4ZrkGB1zm0zDFx; Mon, 5 May 2025 16:20:50 +0200 (CEST) Received: from unknown by smtp-3-0000.mail.infomaniak.ch (Postfix) with ESMTPA id 4ZrkG9669Tzt8Q; Mon, 5 May 2025 16:20:49 +0200 (CEST) From: Quentin Schulz Date: Mon, 05 May 2025 16:20:37 +0200 Subject: [meta-rockchip PATCH v3 1/9] bsp: rkbin: ddr: store directory path for the DDR bin blob in a variable MIME-Version: 1.0 Message-Id: <20250505-ddrbin-custom-v3-1-577b94c72035@cherry.de> References: <20250505-ddrbin-custom-v3-0-577b94c72035@cherry.de> In-Reply-To: <20250505-ddrbin-custom-v3-0-577b94c72035@cherry.de> To: yocto-patches@lists.yoctoproject.org Cc: Quentin Schulz X-Mailer: b4 0.14.2 X-Infomaniak-Routing: alpha List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Mon, 05 May 2025 14:20:57 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto-patches/message/1503 From: Quentin Schulz This will be used in a later commit when an SoC-agnostic do_configure will call ddrbin_tool.py with the DDR bin blob as input. Signed-off-by: Quentin Schulz --- recipes-bsp/rkbin/rockchip-rkbin-ddr_git.bb | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/recipes-bsp/rkbin/rockchip-rkbin-ddr_git.bb b/recipes-bsp/rkbin/rockchip-rkbin-ddr_git.bb index 3227a53db22ba5906355e6925399aafe08813c9f..a88cfc10bb4404634671c7f193b4255405da6b21 100644 --- a/recipes-bsp/rkbin/rockchip-rkbin-ddr_git.bb +++ b/recipes-bsp/rkbin/rockchip-rkbin-ddr_git.bb @@ -2,34 +2,38 @@ DESCRIPTION = "Rockchip Firmware for DDR init (TPL in U-Boot terms)" require rockchip-rkbin.inc +DDRBIN_DIR:rk3308 ?= "bin/rk33/" DDRBIN_VERS:rk3308 ?= "v2.10" DDRBIN_FILE:rk3308 ?= "rk3308_ddr_589MHz_uart4_m0_${DDRBIN_VERS}.bin" do_deploy:rk3308() { # Prebuilt U-Boot TPL (DDR init) - install -m 644 ${S}/bin/rk33/${DDRBIN_FILE} ${DEPLOYDIR}/ddr-rk3308.bin + install -m 644 ${S}/${DDRBIN_DIR}${DDRBIN_FILE} ${DEPLOYDIR}/ddr-rk3308.bin } +DDRBIN_DIR:rk3566 ?= "bin/rk35/" DDRBIN_VERS:rk3566 ?= "v1.23" DDRBIN_FILE:rk3566 ?= "rk3566_ddr_1056MHz_${DDRBIN_VERS}.bin" do_deploy:rk3566() { # Prebuilt U-Boot TPL (DDR init) - install -m 644 ${S}/bin/rk35/${DDRBIN_FILE} ${DEPLOYDIR}/ddr-rk3566.bin + install -m 644 ${S}/${DDRBIN_DIR}${DDRBIN_FILE} ${DEPLOYDIR}/ddr-rk3566.bin } +DDRBIN_DIR:rk3568 ?= "bin/rk35/" DDRBIN_VERS:rk3568 ?= "v1.23" DDRBIN_FILE:rk3568 ?= "rk3568_ddr_1560MHz_${DDRBIN_VERS}.bin" do_deploy:rk3568() { # Prebuilt U-Boot TPL (DDR init) - install -m 644 ${S}/bin/rk35/${DDRBIN_FILE} ${DEPLOYDIR}/ddr-rk3568.bin + install -m 644 ${S}/${DDRBIN_DIR}${DDRBIN_FILE} ${DEPLOYDIR}/ddr-rk3568.bin } +DDRBIN_DIR:rk3588s ?= "bin/rk35/" DDRBIN_VERS:rk3588s ?= "v1.18" DDRBIN_FILE:rk3588s ?= "rk3588_ddr_lp4_2112MHz_lp5_2400MHz_${DDRBIN_VERS}.bin" do_deploy:rk3588s() { # Prebuilt U-Boot TPL (DDR init) - install -m 644 ${S}/bin/rk35/${DDRBIN_FILE} ${DEPLOYDIR}/ddr-rk3588.bin + install -m 644 ${S}/${DDRBIN_DIR}${DDRBIN_FILE} ${DEPLOYDIR}/ddr-rk3588.bin } From patchwork Mon May 5 14:20:38 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Schulz X-Patchwork-Id: 62463 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0A034C3ABC0 for ; Mon, 5 May 2025 14:20:58 +0000 (UTC) Received: from smtp-190a.mail.infomaniak.ch (smtp-190a.mail.infomaniak.ch [185.125.25.10]) by mx.groups.io with SMTP id smtpd.web11.51615.1746454852163034775 for ; Mon, 05 May 2025 07:20:52 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: 0leil.net, ip: 185.125.25.10, mailfrom: foss+yocto@0leil.net) Received: from smtp-3-0000.mail.infomaniak.ch (smtp-3-0000.mail.infomaniak.ch [10.4.36.107]) by smtp-3-3000.mail.infomaniak.ch (Postfix) with ESMTPS id 4ZrkGB6KTHzFB9; Mon, 5 May 2025 16:20:50 +0200 (CEST) Received: from unknown by smtp-3-0000.mail.infomaniak.ch (Postfix) with ESMTPA id 4ZrkGB2fj5zrTt; Mon, 5 May 2025 16:20:50 +0200 (CEST) From: Quentin Schulz Date: Mon, 05 May 2025 16:20:38 +0200 Subject: [meta-rockchip PATCH v3 2/9] bsp: rkbin: ddr: make deployed name configurable MIME-Version: 1.0 Message-Id: <20250505-ddrbin-custom-v3-2-577b94c72035@cherry.de> References: <20250505-ddrbin-custom-v3-0-577b94c72035@cherry.de> In-Reply-To: <20250505-ddrbin-custom-v3-0-577b94c72035@cherry.de> To: yocto-patches@lists.yoctoproject.org Cc: Quentin Schulz X-Mailer: b4 0.14.2 X-Infomaniak-Routing: alpha List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Mon, 05 May 2025 14:20:58 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto-patches/message/1504 From: Quentin Schulz This will also allow us to generate an SoC-agnostic do_deploy instead of duplicating it for each SoC. Additionally, it allows users to pick a different name for the deployed binary. Signed-off-by: Quentin Schulz --- recipes-bsp/rkbin/rockchip-rkbin-ddr_git.bb | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/recipes-bsp/rkbin/rockchip-rkbin-ddr_git.bb b/recipes-bsp/rkbin/rockchip-rkbin-ddr_git.bb index a88cfc10bb4404634671c7f193b4255405da6b21..546560cf58b0480efd0f89ff21639c7b78f70530 100644 --- a/recipes-bsp/rkbin/rockchip-rkbin-ddr_git.bb +++ b/recipes-bsp/rkbin/rockchip-rkbin-ddr_git.bb @@ -5,35 +5,39 @@ require rockchip-rkbin.inc DDRBIN_DIR:rk3308 ?= "bin/rk33/" DDRBIN_VERS:rk3308 ?= "v2.10" DDRBIN_FILE:rk3308 ?= "rk3308_ddr_589MHz_uart4_m0_${DDRBIN_VERS}.bin" +DDRBIN_DEPLOY_FILENAME:rk3308 ?= "ddr-rk3308.bin" do_deploy:rk3308() { # Prebuilt U-Boot TPL (DDR init) - install -m 644 ${S}/${DDRBIN_DIR}${DDRBIN_FILE} ${DEPLOYDIR}/ddr-rk3308.bin + install -m 644 ${S}/${DDRBIN_DIR}${DDRBIN_FILE} ${DEPLOYDIR}/${DDRBIN_DEPLOY_FILENAME} } DDRBIN_DIR:rk3566 ?= "bin/rk35/" DDRBIN_VERS:rk3566 ?= "v1.23" DDRBIN_FILE:rk3566 ?= "rk3566_ddr_1056MHz_${DDRBIN_VERS}.bin" +DDRBIN_DEPLOY_FILENAME:rk3566 ?= "ddr-rk3566.bin" do_deploy:rk3566() { # Prebuilt U-Boot TPL (DDR init) - install -m 644 ${S}/${DDRBIN_DIR}${DDRBIN_FILE} ${DEPLOYDIR}/ddr-rk3566.bin + install -m 644 ${S}/${DDRBIN_DIR}${DDRBIN_FILE} ${DEPLOYDIR}/${DDRBIN_DEPLOY_FILENAME} } DDRBIN_DIR:rk3568 ?= "bin/rk35/" DDRBIN_VERS:rk3568 ?= "v1.23" DDRBIN_FILE:rk3568 ?= "rk3568_ddr_1560MHz_${DDRBIN_VERS}.bin" +DDRBIN_DEPLOY_FILENAME:rk3568 ?= "ddr-rk3568.bin" do_deploy:rk3568() { # Prebuilt U-Boot TPL (DDR init) - install -m 644 ${S}/${DDRBIN_DIR}${DDRBIN_FILE} ${DEPLOYDIR}/ddr-rk3568.bin + install -m 644 ${S}/${DDRBIN_DIR}${DDRBIN_FILE} ${DEPLOYDIR}/${DDRBIN_DEPLOY_FILENAME} } DDRBIN_DIR:rk3588s ?= "bin/rk35/" DDRBIN_VERS:rk3588s ?= "v1.18" DDRBIN_FILE:rk3588s ?= "rk3588_ddr_lp4_2112MHz_lp5_2400MHz_${DDRBIN_VERS}.bin" +DDRBIN_DEPLOY_FILENAME:rk3588s ?= "ddr-rk3588.bin" do_deploy:rk3588s() { # Prebuilt U-Boot TPL (DDR init) - install -m 644 ${S}/${DDRBIN_DIR}${DDRBIN_FILE} ${DEPLOYDIR}/ddr-rk3588.bin + install -m 644 ${S}/${DDRBIN_DIR}${DDRBIN_FILE} ${DEPLOYDIR}/${DDRBIN_DEPLOY_FILENAME} } From patchwork Mon May 5 14:20:39 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Schulz X-Patchwork-Id: 62466 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 074C5C3ABBE for ; Mon, 5 May 2025 14:20:58 +0000 (UTC) Received: from smtp-42a8.mail.infomaniak.ch (smtp-42a8.mail.infomaniak.ch [84.16.66.168]) by mx.groups.io with SMTP id smtpd.web11.51616.1746454853329710285 for ; Mon, 05 May 2025 07:20:53 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: 0leil.net, ip: 84.16.66.168, mailfrom: foss+yocto@0leil.net) Received: from smtp-3-0000.mail.infomaniak.ch (smtp-3-0000.mail.infomaniak.ch [10.4.36.107]) by smtp-3-3000.mail.infomaniak.ch (Postfix) with ESMTPS id 4ZrkGC36MCzDCY; Mon, 5 May 2025 16:20:51 +0200 (CEST) Received: from unknown by smtp-3-0000.mail.infomaniak.ch (Postfix) with ESMTPA id 4ZrkGB71J0zrZt; Mon, 5 May 2025 16:20:50 +0200 (CEST) From: Quentin Schulz Date: Mon, 05 May 2025 16:20:39 +0200 Subject: [meta-rockchip PATCH v3 3/9] bsp: rkbin: add native recipe for tools (ddrbin_tool.py) MIME-Version: 1.0 Message-Id: <20250505-ddrbin-custom-v3-3-577b94c72035@cherry.de> References: <20250505-ddrbin-custom-v3-0-577b94c72035@cherry.de> In-Reply-To: <20250505-ddrbin-custom-v3-0-577b94c72035@cherry.de> To: yocto-patches@lists.yoctoproject.org Cc: Quentin Schulz X-Mailer: b4 0.14.2 X-Infomaniak-Routing: alpha List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Mon, 05 May 2025 14:20:58 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto-patches/message/1505 From: Quentin Schulz This will allow us to use tools from rkbin repo destined to be used on the host in recipes for the target. For example, ddrbin_tool.py which is used to modify the configuration of the DDR bin blob. This has limited usefulness for ddrbin_tool.py as it is a python script with no external dependencies and could be run directly from rockchip-ddr-bin recipe. However, this is required so we can decouple the version of the git repo used for rockchip-ddr-bin DDR bin blob from the version of the git repo used for ddrbin_tool.py (which is very recent). This recipe will be used in a later commit to modify the DDR bin blob if need be. Signed-off-by: Quentin Schulz --- recipes-bsp/rkbin/rockchip-rkbin-native_git.bb | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/recipes-bsp/rkbin/rockchip-rkbin-native_git.bb b/recipes-bsp/rkbin/rockchip-rkbin-native_git.bb new file mode 100644 index 0000000000000000000000000000000000000000..2adccdd59bbf454bd5264d503d6d5883b94c472d --- /dev/null +++ b/recipes-bsp/rkbin/rockchip-rkbin-native_git.bb @@ -0,0 +1,21 @@ +DESCRIPTION = "Rockchip native tools related to their rkbin blobs, e.g. ddrbin_tool.py" + +SRC_URI = "git://github.com/rockchip-linux/rkbin;protocol=https;branch=master" +SRCREV = "f43a462e7a1429a9d407ae52b4745033034a6cf9" +LICENSE = "Proprietary" +LIC_FILES_CHKSUM = "file://../LICENSE;md5=11e3673115959bf596feaaa6ea7ce9a5" + +inherit native + +S = "${WORKDIR}/git/tools" + +# ddrbin_tool.py only uses python and core modules. +# Yocto depends on a host python anyway so we can simply ignore that dependency +# and have ddrbin_tool.py run with the host's python instead of building python +# natively. +# DEPENDS = "python3-native" + +do_install() { + install -d "${D}${bindir}" + install -m 0755 ddrbin_tool.py "${D}${bindir}" +} From patchwork Mon May 5 14:20:40 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Schulz X-Patchwork-Id: 62470 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0DB21C3ABAA for ; Mon, 5 May 2025 14:21:08 +0000 (UTC) Received: from smtp-42ae.mail.infomaniak.ch (smtp-42ae.mail.infomaniak.ch [84.16.66.174]) by mx.groups.io with SMTP id smtpd.web10.51254.1746454858701028647 for ; Mon, 05 May 2025 07:20:59 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: 0leil.net, ip: 84.16.66.174, mailfrom: foss+yocto@0leil.net) Received: from smtp-3-0000.mail.infomaniak.ch (smtp-3-0000.mail.infomaniak.ch [10.4.36.107]) by smtp-3-3000.mail.infomaniak.ch (Postfix) with ESMTPS id 4ZrkGD1pM0z9vM; Mon, 5 May 2025 16:20:52 +0200 (CEST) Received: from unknown by smtp-3-0000.mail.infomaniak.ch (Postfix) with ESMTPA id 4ZrkGC3dMDzrLd; Mon, 5 May 2025 16:20:51 +0200 (CEST) From: Quentin Schulz Date: Mon, 05 May 2025 16:20:40 +0200 Subject: [meta-rockchip PATCH v3 4/9] bsp: rkbin: ddr: allow to customize DDR bin blob MIME-Version: 1.0 Message-Id: <20250505-ddrbin-custom-v3-4-577b94c72035@cherry.de> References: <20250505-ddrbin-custom-v3-0-577b94c72035@cherry.de> In-Reply-To: <20250505-ddrbin-custom-v3-0-577b94c72035@cherry.de> To: yocto-patches@lists.yoctoproject.org Cc: Quentin Schulz X-Mailer: b4 0.14.2 X-Infomaniak-Routing: alpha List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Mon, 05 May 2025 14:21:08 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto-patches/message/1511 From: Quentin Schulz Rockchip provides a tool to customize the DDR bin blob which can prove to be extremely useful, for example if your HW doesn't follow the HW reference design and uses a different UART controller or UART mux for the serial console, or use a different baudrate. If RKBIN_DDR_RECONFIGURE is set to 1 for a machine, a ddrbin_params.txt needs to be provided for said machine and ddrbin_tool.py will be run against it to generate a new custom binary with the desired config. Note that future implementations may allow to provide configuration through a different mechanism than a simple and difficult to maintain/modify file. E.g. this doesn't really work well when one wants to have this in sync with SERIAL_CONSOLES for example. But that may be much harder to support as the serial controller index in SERIAL_CONSOLES does not necessarily match the hardware index expected by ddrbin_params.txt. It also doesn't provide the UART mux. In any case, I believe this is a decent start at allowing customization of the DDR bin blob without having to provide a blob directly in-tree. Signed-off-by: Quentin Schulz --- README | 20 ++++++++++++- recipes-bsp/rkbin/rockchip-rkbin-ddr_git.bb | 44 +++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+), 1 deletion(-) diff --git a/README b/README index 6bceba0c9cf09cc0fc881c855fabeeb68aeb55fb..9672c6ab8d5b2ce004a33bfb825969ab958d8834 100644 --- a/README +++ b/README @@ -55,7 +55,7 @@ Status of supported boards: Notes: ----- - Custom DDR rkbin version: + Customize DDR rkbin: If you wish to use a different version of DDR binary provided by rockchip-rkbin-ddr recipe than the one in this layer, you can create a .bbappend in your own layer, and accordingly set SRCREV (possibly @@ -70,6 +70,24 @@ Notes: DDRBIN_VERS:my-machine = "v2.07" DDRBIN_FILE:my-machine = "rk3308_ddr_451MHz_uart4_m0_${DDRBIN_VERS}.bin" + If you wish to use a configuration for the DDR binary blob provided in + rockchip-rkbin-ddr recipe that differs from the default, you can set the + RKBIN_DDR_RECONFIGURE variable to 1 for your machine, e.g.: + + RKBIN_DDR_RECONFIGURE:my-machine = "1" + + You will need to provide your custom ddrbin_param.txt via your bbappend, e.g. + your ddrbin_param in + meta-my-layer/recipes-bsp/rkbin/rockchip-rkbin-ddr/my-machine/ddrbin_param.txt + and a bbappend, e.g. in meta-my-layer/recipes-bsp/rkbin/rockchip-rkbin-ddr_git.bbappend, + which contains: + + FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" + + As for the content of ddrbin_param.txt, + https://github.com/rockchip-linux/rkbin/blob/master/tools/ddrbin_tool_user_guide.txt + may help. + rk3308 rkbin: The latest ddr initializer for the rk3308 platform does not output diagnostic messages to uart0. This causes a bunch of gibberish to diff --git a/recipes-bsp/rkbin/rockchip-rkbin-ddr_git.bb b/recipes-bsp/rkbin/rockchip-rkbin-ddr_git.bb index 546560cf58b0480efd0f89ff21639c7b78f70530..c368d3f59a39e73cb95ac0018ea93c013d1ebb3d 100644 --- a/recipes-bsp/rkbin/rockchip-rkbin-ddr_git.bb +++ b/recipes-bsp/rkbin/rockchip-rkbin-ddr_git.bb @@ -6,6 +6,7 @@ DDRBIN_DIR:rk3308 ?= "bin/rk33/" DDRBIN_VERS:rk3308 ?= "v2.10" DDRBIN_FILE:rk3308 ?= "rk3308_ddr_589MHz_uart4_m0_${DDRBIN_VERS}.bin" DDRBIN_DEPLOY_FILENAME:rk3308 ?= "ddr-rk3308.bin" +DDRBIN_TOOL_SOC:rk3308 ?= "rk3308" do_deploy:rk3308() { # Prebuilt U-Boot TPL (DDR init) @@ -16,6 +17,7 @@ DDRBIN_DIR:rk3566 ?= "bin/rk35/" DDRBIN_VERS:rk3566 ?= "v1.23" DDRBIN_FILE:rk3566 ?= "rk3566_ddr_1056MHz_${DDRBIN_VERS}.bin" DDRBIN_DEPLOY_FILENAME:rk3566 ?= "ddr-rk3566.bin" +DDRBIN_TOOL_SOC:rk3566 ?= "rk356x" do_deploy:rk3566() { # Prebuilt U-Boot TPL (DDR init) @@ -26,6 +28,7 @@ DDRBIN_DIR:rk3568 ?= "bin/rk35/" DDRBIN_VERS:rk3568 ?= "v1.23" DDRBIN_FILE:rk3568 ?= "rk3568_ddr_1560MHz_${DDRBIN_VERS}.bin" DDRBIN_DEPLOY_FILENAME:rk3568 ?= "ddr-rk3568.bin" +DDRBIN_TOOL_SOC:rk3568 ?= "rk356x" do_deploy:rk3568() { # Prebuilt U-Boot TPL (DDR init) @@ -36,8 +39,49 @@ DDRBIN_DIR:rk3588s ?= "bin/rk35/" DDRBIN_VERS:rk3588s ?= "v1.18" DDRBIN_FILE:rk3588s ?= "rk3588_ddr_lp4_2112MHz_lp5_2400MHz_${DDRBIN_VERS}.bin" DDRBIN_DEPLOY_FILENAME:rk3588s ?= "ddr-rk3588.bin" +DDRBIN_TOOL_SOC:rk3588s ?= "rk3588" do_deploy:rk3588s() { # Prebuilt U-Boot TPL (DDR init) install -m 644 ${S}/${DDRBIN_DIR}${DDRBIN_FILE} ${DEPLOYDIR}/${DDRBIN_DEPLOY_FILENAME} } + +# The following is only required if DDR bin blob needs to be modified +# (e.g. different UART controller, UART mux, or baudrate) +# RKBIN_DDR_RECONFIGURE = "1" if it needs to be modified, all below logic needs to +# depend on that value be 1, and not run if 0. +RKBIN_DDR_RECONFIGURE ?= "0" + +# The tool (ddrbin_tool.py) for modifying the DDR bin is from rockchip-rkbin-native... +DEPENDS += "${@'rockchip-rkbin-native' if d.getVar('RKBIN_DDR_RECONFIGURE') == '1' else ''}" + +# ... and it expects a file as input, which is named ddrbin_param.txt in the tree. +SRC_URI += "${@'file://ddrbin_param.txt' if d.getVar('RKBIN_DDR_RECONFIGURE') == '1' else ''}" + +python __anonymous() { + # Because rockchip-rkbin.inc inherits bin_package and we need to run some step before + # the install task re-enable do_configure task. + # We could use + # do_configure[noexec] = "${@'0' if d.getVar('RKBIN_DDR_RECONFIGURE') == '1' else '1'}" + # but this spams the console with deprecation warnings, see + # https://bugzilla.yoctoproject.org/show_bug.cgi?id=13808 + if d.getVar('RKBIN_DDR_RECONFIGURE') == '1': + d.delVarFlag("do_configure", "noexec") +} + +do_configure() { + if [ "${RKBIN_DDR_RECONFIGURE}" = "1" ]; then + # ddrbin_tool.py always modifies a date in the DDR blob, based on current time. + # This is bad for reproducibility and hashequiv usage, so use the commit author + # date of the last change made to the DDR bin. + # DATE must be max 17-character long! + RKBIN_DDR_DATE=$(git log --pretty=format:"%ad" --date=format:"%Y%m%d-%H:%M:%S" -1 -- ${S}/${DDRBIN_DIR}${DDRBIN_FILE}) + # DDRBIN_TOOL_SOC is mostly useless except for rk3528 for now. It needs to match one string in the global + # chip_list array in ddrbin_tool.py. + if [ -z "${DDRBIN_TOOL_SOC}" ]; then + bbfatal "Non-empty DDRBIN_TOOL_SOC: required!" + fi + # Modify blob with appropriate settings stored in ddrbin_params.txt + ddrbin_tool.py ${DDRBIN_TOOL_SOC} ${UNPACKDIR}/ddrbin_param.txt ${S}/${DDRBIN_DIR}${DDRBIN_FILE} --verinfo_editable "${RKBIN_DDR_DATE}" + fi +} From patchwork Mon May 5 14:20:41 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Schulz X-Patchwork-Id: 62468 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id E9512C3ABBD for ; Mon, 5 May 2025 14:20:57 +0000 (UTC) Received: from smtp-bc0a.mail.infomaniak.ch (smtp-bc0a.mail.infomaniak.ch [45.157.188.10]) by mx.groups.io with SMTP id smtpd.web11.51617.1746454854025309435 for ; Mon, 05 May 2025 07:20:54 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: 0leil.net, ip: 45.157.188.10, mailfrom: foss+yocto@0leil.net) Received: from smtp-3-0000.mail.infomaniak.ch (smtp-3-0000.mail.infomaniak.ch [10.4.36.107]) by smtp-3-3000.mail.infomaniak.ch (Postfix) with ESMTPS id 4ZrkGD58hDzDCZ; Mon, 5 May 2025 16:20:52 +0200 (CEST) Received: from unknown by smtp-3-0000.mail.infomaniak.ch (Postfix) with ESMTPA id 4ZrkGD23n6zqpk; Mon, 5 May 2025 16:20:52 +0200 (CEST) From: Quentin Schulz Date: Mon, 05 May 2025 16:20:41 +0200 Subject: [meta-rockchip PATCH v3 5/9] bsp: rkbin: ddr: factor out do_deploy to be SoC-agnostic MIME-Version: 1.0 Message-Id: <20250505-ddrbin-custom-v3-5-577b94c72035@cherry.de> References: <20250505-ddrbin-custom-v3-0-577b94c72035@cherry.de> In-Reply-To: <20250505-ddrbin-custom-v3-0-577b94c72035@cherry.de> To: yocto-patches@lists.yoctoproject.org Cc: Quentin Schulz X-Mailer: b4 0.14.2 X-Infomaniak-Routing: alpha List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Mon, 05 May 2025 14:20:57 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto-patches/message/1506 From: Quentin Schulz The do_deploy task is essentially the same for all SoCs, install a file from a specific path to another one. No magic involved, so let's rather have one generic do_deploy task. For this to work nicely, we check that all necessary variables are set and notify the developer otherwise. This may be useful whenever a new SoC will be supported by this recipe. Signed-off-by: Quentin Schulz --- recipes-bsp/rkbin/rockchip-rkbin-ddr_git.bb | 70 ++++++++++++++--------------- 1 file changed, 34 insertions(+), 36 deletions(-) diff --git a/recipes-bsp/rkbin/rockchip-rkbin-ddr_git.bb b/recipes-bsp/rkbin/rockchip-rkbin-ddr_git.bb index c368d3f59a39e73cb95ac0018ea93c013d1ebb3d..5b049f9a2b77a77d8ea44268a1f47c60659e16d1 100644 --- a/recipes-bsp/rkbin/rockchip-rkbin-ddr_git.bb +++ b/recipes-bsp/rkbin/rockchip-rkbin-ddr_git.bb @@ -2,48 +2,46 @@ DESCRIPTION = "Rockchip Firmware for DDR init (TPL in U-Boot terms)" require rockchip-rkbin.inc -DDRBIN_DIR:rk3308 ?= "bin/rk33/" -DDRBIN_VERS:rk3308 ?= "v2.10" -DDRBIN_FILE:rk3308 ?= "rk3308_ddr_589MHz_uart4_m0_${DDRBIN_VERS}.bin" -DDRBIN_DEPLOY_FILENAME:rk3308 ?= "ddr-rk3308.bin" -DDRBIN_TOOL_SOC:rk3308 ?= "rk3308" +RKBIN_BINDIR:rk3308 ?= "bin/rk33/" +RKBIN_BINVERS:rk3308 ?= "v2.10" +RKBIN_BINFILE:rk3308 ?= "rk3308_ddr_589MHz_uart4_m0_${RKBIN_BINVERS}.bin" +RKBIN_DEPLOY_FILENAME:rk3308 ?= "ddr-rk3308.bin" -do_deploy:rk3308() { - # Prebuilt U-Boot TPL (DDR init) - install -m 644 ${S}/${DDRBIN_DIR}${DDRBIN_FILE} ${DEPLOYDIR}/${DDRBIN_DEPLOY_FILENAME} -} +RKBIN_BINDIR:rk3566 ?= "bin/rk35/" +RKBIN_BINVERS:rk3566 ?= "v1.23" +RKBIN_BINFILE:rk3566 ?= "rk3566_ddr_1056MHz_${RKBIN_BINVERS}.bin" +RKBIN_DEPLOY_FILENAME:rk3566 ?= "ddr-rk3566.bin" -DDRBIN_DIR:rk3566 ?= "bin/rk35/" -DDRBIN_VERS:rk3566 ?= "v1.23" -DDRBIN_FILE:rk3566 ?= "rk3566_ddr_1056MHz_${DDRBIN_VERS}.bin" -DDRBIN_DEPLOY_FILENAME:rk3566 ?= "ddr-rk3566.bin" -DDRBIN_TOOL_SOC:rk3566 ?= "rk356x" +RKBIN_BINDIR:rk3568 ?= "bin/rk35/" +RKBIN_BINVERS:rk3568 ?= "v1.23" +RKBIN_BINFILE:rk3568 ?= "rk3568_ddr_1560MHz_${RKBIN_BINVERS}.bin" +RKBIN_DEPLOY_FILENAME:rk3568 ?= "ddr-rk3568.bin" -do_deploy:rk3566() { - # Prebuilt U-Boot TPL (DDR init) - install -m 644 ${S}/${DDRBIN_DIR}${DDRBIN_FILE} ${DEPLOYDIR}/${DDRBIN_DEPLOY_FILENAME} -} +RKBIN_BINDIR:rk3588s ?= "bin/rk35/" +RKBIN_BINVERS:rk3588s ?= "v1.18" +RKBIN_BINFILE:rk3588s ?= "rk3588_ddr_lp4_2112MHz_lp5_2400MHz_${RKBIN_BINVERS}.bin" +RKBIN_DEPLOY_FILENAME:rk3588s ?= "ddr-rk3588.bin" -DDRBIN_DIR:rk3568 ?= "bin/rk35/" -DDRBIN_VERS:rk3568 ?= "v1.23" -DDRBIN_FILE:rk3568 ?= "rk3568_ddr_1560MHz_${DDRBIN_VERS}.bin" -DDRBIN_DEPLOY_FILENAME:rk3568 ?= "ddr-rk3568.bin" DDRBIN_TOOL_SOC:rk3568 ?= "rk356x" - -do_deploy:rk3568() { - # Prebuilt U-Boot TPL (DDR init) - install -m 644 ${S}/${DDRBIN_DIR}${DDRBIN_FILE} ${DEPLOYDIR}/${DDRBIN_DEPLOY_FILENAME} -} - -DDRBIN_DIR:rk3588s ?= "bin/rk35/" -DDRBIN_VERS:rk3588s ?= "v1.18" -DDRBIN_FILE:rk3588s ?= "rk3588_ddr_lp4_2112MHz_lp5_2400MHz_${DDRBIN_VERS}.bin" -DDRBIN_DEPLOY_FILENAME:rk3588s ?= "ddr-rk3588.bin" +DDRBIN_TOOL_SOC:rk3308 ?= "rk3308" +DDRBIN_TOOL_SOC:rk3566 ?= "rk356x" DDRBIN_TOOL_SOC:rk3588s ?= "rk3588" -do_deploy:rk3588s() { +do_deploy() { + if [ -z "${RKBIN_BINDIR}" ]; then + bbfatal "Non-empty RKBIN_BINDIR: required!" + fi + + if [ -z "${RKBIN_BINFILE}" ]; then + bbfatal "Non-empty RKBIN_BINFILE: required!" + fi + + if [ -z "${RKBIN_DEPLOY_FILENAME}" ]; then + bbfatal "Non-empty RKBIN_DEPLOY_FILENAME: required!" + fi + # Prebuilt U-Boot TPL (DDR init) - install -m 644 ${S}/${DDRBIN_DIR}${DDRBIN_FILE} ${DEPLOYDIR}/${DDRBIN_DEPLOY_FILENAME} + install -m 644 ${S}/${RKBIN_BINDIR}${RKBIN_BINFILE} ${DEPLOYDIR}/${RKBIN_DEPLOY_FILENAME} } # The following is only required if DDR bin blob needs to be modified @@ -75,13 +73,13 @@ do_configure() { # This is bad for reproducibility and hashequiv usage, so use the commit author # date of the last change made to the DDR bin. # DATE must be max 17-character long! - RKBIN_DDR_DATE=$(git log --pretty=format:"%ad" --date=format:"%Y%m%d-%H:%M:%S" -1 -- ${S}/${DDRBIN_DIR}${DDRBIN_FILE}) + RKBIN_DDR_DATE=$(git log --pretty=format:"%ad" --date=format:"%Y%m%d-%H:%M:%S" -1 -- ${S}/${RKBIN_BINDIR}${RKBIN_BINFILE}) # DDRBIN_TOOL_SOC is mostly useless except for rk3528 for now. It needs to match one string in the global # chip_list array in ddrbin_tool.py. if [ -z "${DDRBIN_TOOL_SOC}" ]; then bbfatal "Non-empty DDRBIN_TOOL_SOC: required!" fi # Modify blob with appropriate settings stored in ddrbin_params.txt - ddrbin_tool.py ${DDRBIN_TOOL_SOC} ${UNPACKDIR}/ddrbin_param.txt ${S}/${DDRBIN_DIR}${DDRBIN_FILE} --verinfo_editable "${RKBIN_DDR_DATE}" + ddrbin_tool.py ${DDRBIN_TOOL_SOC} ${UNPACKDIR}/ddrbin_param.txt ${S}/${RKBIN_BINDIR}${RKBIN_BINFILE} --verinfo_editable "${RKBIN_DDR_DATE}" fi } From patchwork Mon May 5 14:20:42 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Schulz X-Patchwork-Id: 62467 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id E15C2C3ABBB for ; Mon, 5 May 2025 14:20:57 +0000 (UTC) Received: from smtp-8fa8.mail.infomaniak.ch (smtp-8fa8.mail.infomaniak.ch [83.166.143.168]) by mx.groups.io with SMTP id smtpd.web10.51248.1746454855189247529 for ; Mon, 05 May 2025 07:20:55 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: 0leil.net, ip: 83.166.143.168, mailfrom: foss+yocto@0leil.net) Received: from smtp-3-0000.mail.infomaniak.ch (smtp-3-0000.mail.infomaniak.ch [10.4.36.107]) by smtp-3-3000.mail.infomaniak.ch (Postfix) with ESMTPS id 4ZrkGF51Gtz8jw; Mon, 5 May 2025 16:20:53 +0200 (CEST) Received: from unknown by smtp-3-0000.mail.infomaniak.ch (Postfix) with ESMTPA id 4ZrkGD60NSzs2F; Mon, 5 May 2025 16:20:52 +0200 (CEST) From: Quentin Schulz Date: Mon, 05 May 2025 16:20:42 +0200 Subject: [meta-rockchip PATCH v3 6/9] bsp: rkbin: optee-os: factor out do_deploy to be SoC-agnostic MIME-Version: 1.0 Message-Id: <20250505-ddrbin-custom-v3-6-577b94c72035@cherry.de> References: <20250505-ddrbin-custom-v3-0-577b94c72035@cherry.de> In-Reply-To: <20250505-ddrbin-custom-v3-0-577b94c72035@cherry.de> To: yocto-patches@lists.yoctoproject.org Cc: Quentin Schulz X-Mailer: b4 0.14.2 X-Infomaniak-Routing: alpha List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Mon, 05 May 2025 14:20:57 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto-patches/message/1507 From: Quentin Schulz The do_deploy task is essentially the same for all SoCs, install a file from a specific path to another one. No magic involved, so let's rather have one generic do_deploy task. For this to work nicely, we check that all necessary variables are set and notify the developer otherwise. This may be useful whenever a new SoC will be supported by this recipe. Signed-off-by: Quentin Schulz --- recipes-bsp/rkbin/rockchip-rkbin-optee-os_git.bb | 46 ++++++++++++++++-------- 1 file changed, 32 insertions(+), 14 deletions(-) diff --git a/recipes-bsp/rkbin/rockchip-rkbin-optee-os_git.bb b/recipes-bsp/rkbin/rockchip-rkbin-optee-os_git.bb index 6d25368d3392c29438d5ff34c621552633885f1b..7858688b23679d67df5ac2739312ef83b677af6b 100644 --- a/recipes-bsp/rkbin/rockchip-rkbin-optee-os_git.bb +++ b/recipes-bsp/rkbin/rockchip-rkbin-optee-os_git.bb @@ -4,24 +4,42 @@ require rockchip-rkbin.inc PROVIDES += "optee-os" -do_deploy:rk3308() { - # Prebuilt OPTEE-OS - install -m 644 ${S}/bin/rk33/rk3308_bl32_v*.bin ${DEPLOYDIR}/tee-rk3308.bin -} +RKBIN_BINDIR:rk3308 ?= "bin/rk33/" +RKBIN_BINVERS:rk3308 ?= "v2.08" +RKBIN_BINFILE:rk3308 ?= "rk3308_bl32_${RKBIN_BINVERS}.bin" +RKBIN_DEPLOY_FILENAME:rk3308 ?= "tee-rk3308.bin" +RKBIN_BINVERS_RK356x ?= "v2.14" +RKBIN_BINDIR:rk3566 ?= "bin/rk35/" +RKBIN_BINVERS:rk3566 ?= "${RKBIN_BINVERS_RK356x}" # NOTE: the following are not typos # the rk3566 uses the same bl32 as the rk3568 -do_deploy:rk3566() { - # Prebuilt OPTEE-OS - install -m 644 ${S}/bin/rk35/rk3568_bl32_v*.bin ${DEPLOYDIR}/tee-rk3566.bin -} +RKBIN_BINFILE:rk3566 ?= "rk3568_bl32_${RKBIN_BINVERS}.bin" +RKBIN_DEPLOY_FILENAME:rk3566 ?= "tee-rk3566.bin" -do_deploy:rk3568() { - # Prebuilt OPTEE-OS - install -m 644 ${S}/bin/rk35/rk3568_bl32_v*.bin ${DEPLOYDIR}/tee-rk3568.bin -} +RKBIN_BINDIR:rk3568 ?= "bin/rk35/" +RKBIN_BINVERS:rk3568 ?= "${RKBIN_BINVERS_RK356x}" +RKBIN_BINFILE:rk3568 ?= "rk3568_bl32_${RKBIN_BINVERS}.bin" +RKBIN_DEPLOY_FILENAME:rk3568 ?= "tee-rk3568.bin" + +RKBIN_BINDIR:rk3588s ?= "bin/rk35/" +RKBIN_BINVERS:rk3588s ?= "v1.17" +RKBIN_BINFILE:rk3588s ?= "rk3588_bl32_${RKBIN_BINVERS}.bin" +RKBIN_DEPLOY_FILENAME:rk3588s ?= "tee-rk3588.bin" + +do_deploy() { + if [ -z "${RKBIN_BINDIR}" ]; then + bbfatal "Non-empty RKBIN_BINDIR: required!" + fi + + if [ -z "${RKBIN_BINFILE}" ]; then + bbfatal "Non-empty RKBIN_BINFILE: required!" + fi + + if [ -z "${RKBIN_DEPLOY_FILENAME}" ]; then + bbfatal "Non-empty RKBIN_DEPLOY_FILENAME: required!" + fi -do_deploy:rk3588s() { # Prebuilt OPTEE-OS - install -m 644 ${S}/bin/rk35/rk3588_bl32_v*.bin ${DEPLOYDIR}/tee-rk3588.bin + install -m 644 ${S}/${RKBIN_BINDIR}${RKBIN_BINFILE} ${DEPLOYDIR}/${RKBIN_DEPLOY_FILENAME} } From patchwork Mon May 5 14:20:43 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Schulz X-Patchwork-Id: 62464 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id CDAD8C3ABAA for ; Mon, 5 May 2025 14:20:57 +0000 (UTC) Received: from smtp-8fa8.mail.infomaniak.ch (smtp-8fa8.mail.infomaniak.ch [83.166.143.168]) by mx.groups.io with SMTP id smtpd.web11.51618.1746454855514731812 for ; Mon, 05 May 2025 07:20:55 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: 0leil.net, ip: 83.166.143.168, mailfrom: foss+yocto@0leil.net) Received: from smtp-3-0000.mail.infomaniak.ch (smtp-3-0000.mail.infomaniak.ch [10.4.36.107]) by smtp-3-3000.mail.infomaniak.ch (Postfix) with ESMTPS id 4ZrkGG1ZgqzBnw; Mon, 5 May 2025 16:20:54 +0200 (CEST) Received: from unknown by smtp-3-0000.mail.infomaniak.ch (Postfix) with ESMTPA id 4ZrkGF5J8jzsQ6; Mon, 5 May 2025 16:20:53 +0200 (CEST) From: Quentin Schulz Date: Mon, 05 May 2025 16:20:43 +0200 Subject: [meta-rockchip PATCH v3 7/9] bsp: rkbin: tf-a: factor out do_deploy to be SoC-agnostic MIME-Version: 1.0 Message-Id: <20250505-ddrbin-custom-v3-7-577b94c72035@cherry.de> References: <20250505-ddrbin-custom-v3-0-577b94c72035@cherry.de> In-Reply-To: <20250505-ddrbin-custom-v3-0-577b94c72035@cherry.de> To: yocto-patches@lists.yoctoproject.org Cc: Quentin Schulz X-Mailer: b4 0.14.2 X-Infomaniak-Routing: alpha List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Mon, 05 May 2025 14:20:57 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto-patches/message/1508 From: Quentin Schulz The do_deploy task is essentially the same for all SoCs, install a file from a specific path to another one. No magic involved, so let's rather have one generic do_deploy task. For this to work nicely, we check that all necessary variables are set and notify the developer otherwise. This may be useful whenever a new SoC will be supported by this recipe. Signed-off-by: Quentin Schulz --- recipes-bsp/rkbin/rockchip-rkbin-tf-a_git.bb | 46 +++++++++++++++++++--------- 1 file changed, 32 insertions(+), 14 deletions(-) diff --git a/recipes-bsp/rkbin/rockchip-rkbin-tf-a_git.bb b/recipes-bsp/rkbin/rockchip-rkbin-tf-a_git.bb index 0ed28a2f18daae280fe38e6939f1b4742b29a778..a515cf8cc01967b0bf23369edebf2061a3c0f877 100644 --- a/recipes-bsp/rkbin/rockchip-rkbin-tf-a_git.bb +++ b/recipes-bsp/rkbin/rockchip-rkbin-tf-a_git.bb @@ -4,24 +4,42 @@ require rockchip-rkbin.inc PROVIDES += "trusted-firmware-a" -do_deploy:rk3308() { - # Prebuilt TF-A - install -m 644 ${S}/bin/rk33/rk3308_bl31_v*.elf ${DEPLOYDIR}/bl31-rk3308.elf -} +RKBIN_BINDIR:rk3308 ?= "bin/rk33/" +RKBIN_BINVERS:rk3308 ?= "v2.26" +RKBIN_BINFILE:rk3308 ?= "rk3308_bl31_${RKBIN_BINVERS}.elf" +RKBIN_DEPLOY_FILENAME:rk3308 ?= "bl31-rk3308.elf" +RKBIN_BINVERS_RK356x ?= "v1.44" +RKBIN_BINDIR:rk3566 ?= "bin/rk35/" +RKBIN_BINVERS:rk3566 ?= "${RKBIN_BINVERS_RK356x}" # NOTE: the following are not typos # the rk3566 uses the same bl31 as the rk3568 -do_deploy:rk3566() { - # Prebuilt TF-A - install -m 644 ${S}/bin/rk35/rk3568_bl31_v*.elf ${DEPLOYDIR}/bl31-rk3566.elf -} +RKBIN_BINFILE:rk3566 ?= "rk3568_bl31_${RKBIN_BINVERS}.elf" +RKBIN_DEPLOY_FILENAME:rk3566 ?= "bl31-rk3566.elf" -do_deploy:rk3568() { - # Prebuilt TF-A - install -m 644 ${S}/bin/rk35/rk3568_bl31_v*.elf ${DEPLOYDIR}/bl31-rk3568.elf -} +RKBIN_BINDIR:rk3568 ?= "bin/rk35/" +RKBIN_BINVERS:rk3568 ?= "${RKBIN_BINVERS_RK356x}" +RKBIN_BINFILE:rk3568 ?= "rk3568_bl31_${RKBIN_BINVERS}.elf" +RKBIN_DEPLOY_FILENAME:rk3568 ?= "bl31-rk3568.elf" + +RKBIN_BINDIR:rk3588s ?= "bin/rk35/" +RKBIN_BINVERS:rk3588s ?= "v1.47" +RKBIN_BINFILE:rk3588s ?= "rk3588_bl31_${RKBIN_BINVERS}.elf" +RKBIN_DEPLOY_FILENAME:rk3588s ?= "bl31-rk3588.elf" + +do_deploy() { + if [ -z "${RKBIN_BINDIR}" ]; then + bbfatal "Non-empty RKBIN_BINDIR: required!" + fi + + if [ -z "${RKBIN_BINFILE}" ]; then + bbfatal "Non-empty RKBIN_BINFILE: required!" + fi + + if [ -z "${RKBIN_DEPLOY_FILENAME}" ]; then + bbfatal "Non-empty RKBIN_DEPLOY_FILENAME: required!" + fi -do_deploy:rk3588s() { # Prebuilt TF-A - install -m 644 ${S}/bin/rk35/rk3588_bl31_v*.elf ${DEPLOYDIR}/bl31-rk3588.elf + install -m 644 ${S}/${RKBIN_BINDIR}${RKBIN_BINFILE} ${DEPLOYDIR}/${RKBIN_DEPLOY_FILENAME} } From patchwork Mon May 5 14:20:44 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Schulz X-Patchwork-Id: 62469 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 17CF6C3ABBF for ; Mon, 5 May 2025 14:20:58 +0000 (UTC) Received: from smtp-8faa.mail.infomaniak.ch (smtp-8faa.mail.infomaniak.ch [83.166.143.170]) by mx.groups.io with SMTP id smtpd.web10.51250.1746454856364053423 for ; Mon, 05 May 2025 07:20:56 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: 0leil.net, ip: 83.166.143.170, mailfrom: foss+yocto@0leil.net) Received: from smtp-3-0000.mail.infomaniak.ch (unknown [IPv6:2001:1600:4:17::246b]) by smtp-3-3000.mail.infomaniak.ch (Postfix) with ESMTPS id 4ZrkGG6KP7z1Hs; Mon, 5 May 2025 16:20:54 +0200 (CEST) Received: from unknown by smtp-3-0000.mail.infomaniak.ch (Postfix) with ESMTPA id 4ZrkGG2Q1VzHYr; Mon, 5 May 2025 16:20:54 +0200 (CEST) From: Quentin Schulz Date: Mon, 05 May 2025 16:20:44 +0200 Subject: [meta-rockchip PATCH v3 8/9] bsp: rkbin: factor out do_deploy and RKBIN_BINDIR variable MIME-Version: 1.0 Message-Id: <20250505-ddrbin-custom-v3-8-577b94c72035@cherry.de> References: <20250505-ddrbin-custom-v3-0-577b94c72035@cherry.de> In-Reply-To: <20250505-ddrbin-custom-v3-0-577b94c72035@cherry.de> To: yocto-patches@lists.yoctoproject.org Cc: Quentin Schulz X-Mailer: b4 0.14.2 X-Infomaniak-Routing: alpha List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Mon, 05 May 2025 14:20:58 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto-patches/message/1509 From: Quentin Schulz do_deploy is now identical for all recipes including rockchip-rkbin.inc so let's simply move it to the .inc file to avoid duplication. While at it, RKBIN_BINDIR is also identical so can also be moved to the .inc, so do it. Signed-off-by: Quentin Schulz --- recipes-bsp/rkbin/rockchip-rkbin-ddr_git.bb | 21 --------------------- recipes-bsp/rkbin/rockchip-rkbin-optee-os_git.bb | 21 --------------------- recipes-bsp/rkbin/rockchip-rkbin-tf-a_git.bb | 21 --------------------- recipes-bsp/rkbin/rockchip-rkbin.inc | 19 ++++++++++++++++++- 4 files changed, 18 insertions(+), 64 deletions(-) diff --git a/recipes-bsp/rkbin/rockchip-rkbin-ddr_git.bb b/recipes-bsp/rkbin/rockchip-rkbin-ddr_git.bb index 5b049f9a2b77a77d8ea44268a1f47c60659e16d1..7f1e82081ed2925f386a1cee46ab62c549f8b5fa 100644 --- a/recipes-bsp/rkbin/rockchip-rkbin-ddr_git.bb +++ b/recipes-bsp/rkbin/rockchip-rkbin-ddr_git.bb @@ -2,22 +2,18 @@ DESCRIPTION = "Rockchip Firmware for DDR init (TPL in U-Boot terms)" require rockchip-rkbin.inc -RKBIN_BINDIR:rk3308 ?= "bin/rk33/" RKBIN_BINVERS:rk3308 ?= "v2.10" RKBIN_BINFILE:rk3308 ?= "rk3308_ddr_589MHz_uart4_m0_${RKBIN_BINVERS}.bin" RKBIN_DEPLOY_FILENAME:rk3308 ?= "ddr-rk3308.bin" -RKBIN_BINDIR:rk3566 ?= "bin/rk35/" RKBIN_BINVERS:rk3566 ?= "v1.23" RKBIN_BINFILE:rk3566 ?= "rk3566_ddr_1056MHz_${RKBIN_BINVERS}.bin" RKBIN_DEPLOY_FILENAME:rk3566 ?= "ddr-rk3566.bin" -RKBIN_BINDIR:rk3568 ?= "bin/rk35/" RKBIN_BINVERS:rk3568 ?= "v1.23" RKBIN_BINFILE:rk3568 ?= "rk3568_ddr_1560MHz_${RKBIN_BINVERS}.bin" RKBIN_DEPLOY_FILENAME:rk3568 ?= "ddr-rk3568.bin" -RKBIN_BINDIR:rk3588s ?= "bin/rk35/" RKBIN_BINVERS:rk3588s ?= "v1.18" RKBIN_BINFILE:rk3588s ?= "rk3588_ddr_lp4_2112MHz_lp5_2400MHz_${RKBIN_BINVERS}.bin" RKBIN_DEPLOY_FILENAME:rk3588s ?= "ddr-rk3588.bin" @@ -27,23 +23,6 @@ DDRBIN_TOOL_SOC:rk3308 ?= "rk3308" DDRBIN_TOOL_SOC:rk3566 ?= "rk356x" DDRBIN_TOOL_SOC:rk3588s ?= "rk3588" -do_deploy() { - if [ -z "${RKBIN_BINDIR}" ]; then - bbfatal "Non-empty RKBIN_BINDIR: required!" - fi - - if [ -z "${RKBIN_BINFILE}" ]; then - bbfatal "Non-empty RKBIN_BINFILE: required!" - fi - - if [ -z "${RKBIN_DEPLOY_FILENAME}" ]; then - bbfatal "Non-empty RKBIN_DEPLOY_FILENAME: required!" - fi - - # Prebuilt U-Boot TPL (DDR init) - install -m 644 ${S}/${RKBIN_BINDIR}${RKBIN_BINFILE} ${DEPLOYDIR}/${RKBIN_DEPLOY_FILENAME} -} - # The following is only required if DDR bin blob needs to be modified # (e.g. different UART controller, UART mux, or baudrate) # RKBIN_DDR_RECONFIGURE = "1" if it needs to be modified, all below logic needs to diff --git a/recipes-bsp/rkbin/rockchip-rkbin-optee-os_git.bb b/recipes-bsp/rkbin/rockchip-rkbin-optee-os_git.bb index 7858688b23679d67df5ac2739312ef83b677af6b..b534e6359645cd7082c9ac69036de15ce8813b3a 100644 --- a/recipes-bsp/rkbin/rockchip-rkbin-optee-os_git.bb +++ b/recipes-bsp/rkbin/rockchip-rkbin-optee-os_git.bb @@ -4,42 +4,21 @@ require rockchip-rkbin.inc PROVIDES += "optee-os" -RKBIN_BINDIR:rk3308 ?= "bin/rk33/" RKBIN_BINVERS:rk3308 ?= "v2.08" RKBIN_BINFILE:rk3308 ?= "rk3308_bl32_${RKBIN_BINVERS}.bin" RKBIN_DEPLOY_FILENAME:rk3308 ?= "tee-rk3308.bin" RKBIN_BINVERS_RK356x ?= "v2.14" -RKBIN_BINDIR:rk3566 ?= "bin/rk35/" RKBIN_BINVERS:rk3566 ?= "${RKBIN_BINVERS_RK356x}" # NOTE: the following are not typos # the rk3566 uses the same bl32 as the rk3568 RKBIN_BINFILE:rk3566 ?= "rk3568_bl32_${RKBIN_BINVERS}.bin" RKBIN_DEPLOY_FILENAME:rk3566 ?= "tee-rk3566.bin" -RKBIN_BINDIR:rk3568 ?= "bin/rk35/" RKBIN_BINVERS:rk3568 ?= "${RKBIN_BINVERS_RK356x}" RKBIN_BINFILE:rk3568 ?= "rk3568_bl32_${RKBIN_BINVERS}.bin" RKBIN_DEPLOY_FILENAME:rk3568 ?= "tee-rk3568.bin" -RKBIN_BINDIR:rk3588s ?= "bin/rk35/" RKBIN_BINVERS:rk3588s ?= "v1.17" RKBIN_BINFILE:rk3588s ?= "rk3588_bl32_${RKBIN_BINVERS}.bin" RKBIN_DEPLOY_FILENAME:rk3588s ?= "tee-rk3588.bin" - -do_deploy() { - if [ -z "${RKBIN_BINDIR}" ]; then - bbfatal "Non-empty RKBIN_BINDIR: required!" - fi - - if [ -z "${RKBIN_BINFILE}" ]; then - bbfatal "Non-empty RKBIN_BINFILE: required!" - fi - - if [ -z "${RKBIN_DEPLOY_FILENAME}" ]; then - bbfatal "Non-empty RKBIN_DEPLOY_FILENAME: required!" - fi - - # Prebuilt OPTEE-OS - install -m 644 ${S}/${RKBIN_BINDIR}${RKBIN_BINFILE} ${DEPLOYDIR}/${RKBIN_DEPLOY_FILENAME} -} diff --git a/recipes-bsp/rkbin/rockchip-rkbin-tf-a_git.bb b/recipes-bsp/rkbin/rockchip-rkbin-tf-a_git.bb index a515cf8cc01967b0bf23369edebf2061a3c0f877..3ad0f7cffa077cfbc88b08a319c181e8a8c5a7c1 100644 --- a/recipes-bsp/rkbin/rockchip-rkbin-tf-a_git.bb +++ b/recipes-bsp/rkbin/rockchip-rkbin-tf-a_git.bb @@ -4,42 +4,21 @@ require rockchip-rkbin.inc PROVIDES += "trusted-firmware-a" -RKBIN_BINDIR:rk3308 ?= "bin/rk33/" RKBIN_BINVERS:rk3308 ?= "v2.26" RKBIN_BINFILE:rk3308 ?= "rk3308_bl31_${RKBIN_BINVERS}.elf" RKBIN_DEPLOY_FILENAME:rk3308 ?= "bl31-rk3308.elf" RKBIN_BINVERS_RK356x ?= "v1.44" -RKBIN_BINDIR:rk3566 ?= "bin/rk35/" RKBIN_BINVERS:rk3566 ?= "${RKBIN_BINVERS_RK356x}" # NOTE: the following are not typos # the rk3566 uses the same bl31 as the rk3568 RKBIN_BINFILE:rk3566 ?= "rk3568_bl31_${RKBIN_BINVERS}.elf" RKBIN_DEPLOY_FILENAME:rk3566 ?= "bl31-rk3566.elf" -RKBIN_BINDIR:rk3568 ?= "bin/rk35/" RKBIN_BINVERS:rk3568 ?= "${RKBIN_BINVERS_RK356x}" RKBIN_BINFILE:rk3568 ?= "rk3568_bl31_${RKBIN_BINVERS}.elf" RKBIN_DEPLOY_FILENAME:rk3568 ?= "bl31-rk3568.elf" -RKBIN_BINDIR:rk3588s ?= "bin/rk35/" RKBIN_BINVERS:rk3588s ?= "v1.47" RKBIN_BINFILE:rk3588s ?= "rk3588_bl31_${RKBIN_BINVERS}.elf" RKBIN_DEPLOY_FILENAME:rk3588s ?= "bl31-rk3588.elf" - -do_deploy() { - if [ -z "${RKBIN_BINDIR}" ]; then - bbfatal "Non-empty RKBIN_BINDIR: required!" - fi - - if [ -z "${RKBIN_BINFILE}" ]; then - bbfatal "Non-empty RKBIN_BINFILE: required!" - fi - - if [ -z "${RKBIN_DEPLOY_FILENAME}" ]; then - bbfatal "Non-empty RKBIN_DEPLOY_FILENAME: required!" - fi - - # Prebuilt TF-A - install -m 644 ${S}/${RKBIN_BINDIR}${RKBIN_BINFILE} ${DEPLOYDIR}/${RKBIN_DEPLOY_FILENAME} -} diff --git a/recipes-bsp/rkbin/rockchip-rkbin.inc b/recipes-bsp/rkbin/rockchip-rkbin.inc index 9264db9048e31b7dae650bdc8e31009f7f4cf404..8a6a9f44ce908934dd58fc3c37d338a43aa00bff 100644 --- a/recipes-bsp/rkbin/rockchip-rkbin.inc +++ b/recipes-bsp/rkbin/rockchip-rkbin.inc @@ -25,8 +25,25 @@ do_install() { PACKAGES = "${PN}" ALLOW_EMPTY:${PN} = "1" +RKBIN_BINDIR:rk3308 ?= "bin/rk33/" +RKBIN_BINDIR:rk3566 ?= "bin/rk35/" +RKBIN_BINDIR:rk3568 ?= "bin/rk35/" +RKBIN_BINDIR:rk3588s ?= "bin/rk35/" + do_deploy() { - bbfatal "COMPATIBLE_MACHINE requires a corresponding do_deploy:() override" + if [ -z "${RKBIN_BINDIR}" ]; then + bbfatal "Non-empty RKBIN_BINDIR: required!" + fi + + if [ -z "${RKBIN_BINFILE}" ]; then + bbfatal "Non-empty RKBIN_BINFILE: required!" + fi + + if [ -z "${RKBIN_DEPLOY_FILENAME}" ]; then + bbfatal "Non-empty RKBIN_DEPLOY_FILENAME: required!" + fi + + install -m 644 ${S}/${RKBIN_BINDIR}${RKBIN_BINFILE} ${DEPLOYDIR}/${RKBIN_DEPLOY_FILENAME} } addtask deploy after do_install From patchwork Mon May 5 14:20:45 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Schulz X-Patchwork-Id: 62462 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id C0BAFC3ABB8 for ; Mon, 5 May 2025 14:20:57 +0000 (UTC) Received: from smtp-42a8.mail.infomaniak.ch (smtp-42a8.mail.infomaniak.ch [84.16.66.168]) by mx.groups.io with SMTP id smtpd.web10.51251.1746454856773703828 for ; Mon, 05 May 2025 07:20:57 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: 0leil.net, ip: 84.16.66.168, mailfrom: foss+yocto@0leil.net) Received: from smtp-3-0000.mail.infomaniak.ch (unknown [IPv6:2001:1600:4:17::246b]) by smtp-3-3000.mail.infomaniak.ch (Postfix) with ESMTPS id 4ZrkGH3YxNzDVS; Mon, 5 May 2025 16:20:55 +0200 (CEST) Received: from unknown by smtp-3-0000.mail.infomaniak.ch (Postfix) with ESMTPA id 4ZrkGG6zdmzslT; Mon, 5 May 2025 16:20:54 +0200 (CEST) From: Quentin Schulz Date: Mon, 05 May 2025 16:20:45 +0200 Subject: [meta-rockchip PATCH v3 9/9] bsp: rkbin: bump to latest commit in master branch MIME-Version: 1.0 Message-Id: <20250505-ddrbin-custom-v3-9-577b94c72035@cherry.de> References: <20250505-ddrbin-custom-v3-0-577b94c72035@cherry.de> In-Reply-To: <20250505-ddrbin-custom-v3-0-577b94c72035@cherry.de> To: yocto-patches@lists.yoctoproject.org Cc: Quentin Schulz X-Mailer: b4 0.14.2 X-Infomaniak-Routing: alpha List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Mon, 05 May 2025 14:20:57 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto-patches/message/1510 From: Quentin Schulz This bumps rkbin to be using the last public blobs. Signed-off-by: Quentin Schulz --- recipes-bsp/rkbin/rockchip-rkbin-optee-os_git.bb | 6 +++--- recipes-bsp/rkbin/rockchip-rkbin-tf-a_git.bb | 2 +- recipes-bsp/rkbin/rockchip-rkbin.inc | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/recipes-bsp/rkbin/rockchip-rkbin-optee-os_git.bb b/recipes-bsp/rkbin/rockchip-rkbin-optee-os_git.bb index b534e6359645cd7082c9ac69036de15ce8813b3a..0f3c9277a61ec9798f78107fb2f402b8a792f81d 100644 --- a/recipes-bsp/rkbin/rockchip-rkbin-optee-os_git.bb +++ b/recipes-bsp/rkbin/rockchip-rkbin-optee-os_git.bb @@ -4,11 +4,11 @@ require rockchip-rkbin.inc PROVIDES += "optee-os" -RKBIN_BINVERS:rk3308 ?= "v2.08" +RKBIN_BINVERS:rk3308 ?= "v2.09" RKBIN_BINFILE:rk3308 ?= "rk3308_bl32_${RKBIN_BINVERS}.bin" RKBIN_DEPLOY_FILENAME:rk3308 ?= "tee-rk3308.bin" -RKBIN_BINVERS_RK356x ?= "v2.14" +RKBIN_BINVERS_RK356x ?= "v2.15" RKBIN_BINVERS:rk3566 ?= "${RKBIN_BINVERS_RK356x}" # NOTE: the following are not typos # the rk3566 uses the same bl32 as the rk3568 @@ -19,6 +19,6 @@ RKBIN_BINVERS:rk3568 ?= "${RKBIN_BINVERS_RK356x}" RKBIN_BINFILE:rk3568 ?= "rk3568_bl32_${RKBIN_BINVERS}.bin" RKBIN_DEPLOY_FILENAME:rk3568 ?= "tee-rk3568.bin" -RKBIN_BINVERS:rk3588s ?= "v1.17" +RKBIN_BINVERS:rk3588s ?= "v1.19" RKBIN_BINFILE:rk3588s ?= "rk3588_bl32_${RKBIN_BINVERS}.bin" RKBIN_DEPLOY_FILENAME:rk3588s ?= "tee-rk3588.bin" diff --git a/recipes-bsp/rkbin/rockchip-rkbin-tf-a_git.bb b/recipes-bsp/rkbin/rockchip-rkbin-tf-a_git.bb index 3ad0f7cffa077cfbc88b08a319c181e8a8c5a7c1..f51d9e934ab52b5ee7f356e7c3c5120513c2f0f1 100644 --- a/recipes-bsp/rkbin/rockchip-rkbin-tf-a_git.bb +++ b/recipes-bsp/rkbin/rockchip-rkbin-tf-a_git.bb @@ -19,6 +19,6 @@ RKBIN_BINVERS:rk3568 ?= "${RKBIN_BINVERS_RK356x}" RKBIN_BINFILE:rk3568 ?= "rk3568_bl31_${RKBIN_BINVERS}.elf" RKBIN_DEPLOY_FILENAME:rk3568 ?= "bl31-rk3568.elf" -RKBIN_BINVERS:rk3588s ?= "v1.47" +RKBIN_BINVERS:rk3588s ?= "v1.48" RKBIN_BINFILE:rk3588s ?= "rk3588_bl31_${RKBIN_BINVERS}.elf" RKBIN_DEPLOY_FILENAME:rk3588s ?= "bl31-rk3588.elf" diff --git a/recipes-bsp/rkbin/rockchip-rkbin.inc b/recipes-bsp/rkbin/rockchip-rkbin.inc index 8a6a9f44ce908934dd58fc3c37d338a43aa00bff..79149c5bebc3c59e337b303f24274ed1925da5ce 100644 --- a/recipes-bsp/rkbin/rockchip-rkbin.inc +++ b/recipes-bsp/rkbin/rockchip-rkbin.inc @@ -1,5 +1,5 @@ SRC_URI = "git://github.com/rockchip-linux/rkbin;protocol=https;branch=master" -SRCREV = "7c35e21a8529b3758d1f051d1a5dc62aae934b2b" +SRCREV = "f43a462e7a1429a9d407ae52b4745033034a6cf9" LICENSE = "Proprietary" LIC_FILES_CHKSUM = "file://LICENSE;md5=11e3673115959bf596feaaa6ea7ce9a5"