* [meta-rockchip PATCH 0/6] rkbin: factoring ddrbin do_deploy, customize ddrbin and bump rkbin
@ 2025-03-11 11:26 Quentin Schulz
2025-03-11 11:26 ` [meta-rockchip PATCH 1/6] bsp: rkbin: ddr: store directory path for the DDR bin blob in a variable Quentin Schulz
` (7 more replies)
0 siblings, 8 replies; 12+ messages in thread
From: Quentin Schulz @ 2025-03-11 11:26 UTC (permalink / raw)
To: yocto-patches; +Cc: Quentin Schulz
This simplifies rockchip-rkbin-ddr do_deploy to only have one do_deploy
task common to all supported SoC instead of having to add a new task
override for each new SoC. It does require to set a few more variables
though.
Additionally, this allows to finally customize the DDR binary blob using
Rockchip's ddrbin_tool.py tool. This is typically useful if your board
isn't following Rockchip's HW reference design, e.g. using a different
UART controller or pins for serial output, or using a baudrate different
from the default of 1500000.
Finally it bumps OP-TEE OS, TF-A and DDR bin recipes to use the latest
commit in rkbin git repo.
I am not too fond of using a file as input for the customization, but
this is what ddrbin_tool.py uses and there are possibly too many
corner-cases to handle by using fine-grained variables. So for now, I
decided to go with that but that is for sure not the only possible
implementation!
Note that the bump commit wasn't tested.
Note that I plan on backporting all but the last two patches to
scarthgap (and I assume styhead too). The patch before the last would
break backward compatibility if someone appends to the
do_deploy:<override> task. The last patch could be merged but there's no
absolute need for it?
Lastly, the patch about customizing DDR bin needs to be modified before
being backported as it uses UNPACKDIR which doesn't exist in scarthgap.
The logic should be safe to use with ${S} (for scarthgap) though!
@Trevor, maybe you can check if that would fix your issue with the
RK3308 DDR blob you wanted to keep on that outdated version which is one
of the last versions where the UART you want to use exists? It'd be nice
to get rid of the rk3308-specific recipes I believe :)
Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
---
Quentin Schulz (6):
bsp: rkbin: ddr: store directory path for the DDR bin blob in a variable
bsp: rkbin: ddr: make deployed name configurable
bsp: rkbin: add native recipe for tools (ddrbin_tool.py)
bsp: rkbin: ddr: allow to customize DDR bin blob
bsp: rkbin: ddr: factor out do_deploy to be SoC-agnostic
bsp: rkbin: bump to latest commit in master branch
README | 20 +++++-
recipes-bsp/rkbin/rockchip-rkbin-ddr_git.bb | 87 +++++++++++++++++++++-----
recipes-bsp/rkbin/rockchip-rkbin-native_git.bb | 21 +++++++
recipes-bsp/rkbin/rockchip-rkbin.inc | 2 +-
4 files changed, 111 insertions(+), 19 deletions(-)
---
base-commit: 0aba79e47951b049bcdd39e07f660c665e257393
change-id: 20250311-ddrbin-custom-f83918406e3a
Best regards,
--
Quentin Schulz <quentin.schulz@cherry.de>
^ permalink raw reply [flat|nested] 12+ messages in thread
* [meta-rockchip PATCH 1/6] bsp: rkbin: ddr: store directory path for the DDR bin blob in a variable
2025-03-11 11:26 [meta-rockchip PATCH 0/6] rkbin: factoring ddrbin do_deploy, customize ddrbin and bump rkbin Quentin Schulz
@ 2025-03-11 11:26 ` Quentin Schulz
2025-03-11 11:26 ` [meta-rockchip PATCH 2/6] bsp: rkbin: ddr: make deployed name configurable Quentin Schulz
` (6 subsequent siblings)
7 siblings, 0 replies; 12+ messages in thread
From: Quentin Schulz @ 2025-03-11 11:26 UTC (permalink / raw)
To: yocto-patches; +Cc: Quentin Schulz
From: Quentin Schulz <quentin.schulz@cherry.de>
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 <quentin.schulz@cherry.de>
---
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
}
--
2.48.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [meta-rockchip PATCH 2/6] bsp: rkbin: ddr: make deployed name configurable
2025-03-11 11:26 [meta-rockchip PATCH 0/6] rkbin: factoring ddrbin do_deploy, customize ddrbin and bump rkbin Quentin Schulz
2025-03-11 11:26 ` [meta-rockchip PATCH 1/6] bsp: rkbin: ddr: store directory path for the DDR bin blob in a variable Quentin Schulz
@ 2025-03-11 11:26 ` Quentin Schulz
2025-03-11 11:26 ` [meta-rockchip PATCH 3/6] bsp: rkbin: add native recipe for tools (ddrbin_tool.py) Quentin Schulz
` (5 subsequent siblings)
7 siblings, 0 replies; 12+ messages in thread
From: Quentin Schulz @ 2025-03-11 11:26 UTC (permalink / raw)
To: yocto-patches; +Cc: Quentin Schulz
From: Quentin Schulz <quentin.schulz@cherry.de>
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 <quentin.schulz@cherry.de>
---
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}
}
--
2.48.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [meta-rockchip PATCH 3/6] bsp: rkbin: add native recipe for tools (ddrbin_tool.py)
2025-03-11 11:26 [meta-rockchip PATCH 0/6] rkbin: factoring ddrbin do_deploy, customize ddrbin and bump rkbin Quentin Schulz
2025-03-11 11:26 ` [meta-rockchip PATCH 1/6] bsp: rkbin: ddr: store directory path for the DDR bin blob in a variable Quentin Schulz
2025-03-11 11:26 ` [meta-rockchip PATCH 2/6] bsp: rkbin: ddr: make deployed name configurable Quentin Schulz
@ 2025-03-11 11:26 ` Quentin Schulz
2025-03-11 11:26 ` [meta-rockchip PATCH 4/6] bsp: rkbin: ddr: allow to customize DDR bin blob Quentin Schulz
` (4 subsequent siblings)
7 siblings, 0 replies; 12+ messages in thread
From: Quentin Schulz @ 2025-03-11 11:26 UTC (permalink / raw)
To: yocto-patches; +Cc: Quentin Schulz
From: Quentin Schulz <quentin.schulz@cherry.de>
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 <quentin.schulz@cherry.de>
---
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}"
+}
--
2.48.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [meta-rockchip PATCH 4/6] bsp: rkbin: ddr: allow to customize DDR bin blob
2025-03-11 11:26 [meta-rockchip PATCH 0/6] rkbin: factoring ddrbin do_deploy, customize ddrbin and bump rkbin Quentin Schulz
` (2 preceding siblings ...)
2025-03-11 11:26 ` [meta-rockchip PATCH 3/6] bsp: rkbin: add native recipe for tools (ddrbin_tool.py) Quentin Schulz
@ 2025-03-11 11:26 ` Quentin Schulz
2025-03-11 11:26 ` [meta-rockchip PATCH 5/6] bsp: rkbin: ddr: factor out do_deploy to be SoC-agnostic Quentin Schulz
` (3 subsequent siblings)
7 siblings, 0 replies; 12+ messages in thread
From: Quentin Schulz @ 2025-03-11 11:26 UTC (permalink / raw)
To: yocto-patches; +Cc: Quentin Schulz
From: Quentin Schulz <quentin.schulz@cherry.de>
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 <quentin.schulz@cherry.de>
---
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..567d7ed8c5dd37c3c796acb869b85c25ad548a15 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_params.txt via your bbappend, e.g.
+ your ddrbin_params in
+ meta-my-layer/recipes-bsp/rkbin/rockchip-rkbin-ddr/my-machine/ddrbin_params.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_params.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..193d0f00a6868f050a0ff4531278b3296d3eae94 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_params.txt in the tree.
+SRC_URI += "${@'file://ddrbin_params.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:<MACHINE> required!"
+ fi
+ # Modify blob with appropriate settings stored in ddrbin_params.txt
+ ddrbin_tool.py ${DDRBIN_TOOL_SOC} ${UNPACKDIR}/ddrbin_params.txt ${S}/${DDRBIN_DIR}${DDRBIN_FILE} --verinfo_editable "${RKBIN_DDR_DATE}"
+ fi
+}
--
2.48.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [meta-rockchip PATCH 5/6] bsp: rkbin: ddr: factor out do_deploy to be SoC-agnostic
2025-03-11 11:26 [meta-rockchip PATCH 0/6] rkbin: factoring ddrbin do_deploy, customize ddrbin and bump rkbin Quentin Schulz
` (3 preceding siblings ...)
2025-03-11 11:26 ` [meta-rockchip PATCH 4/6] bsp: rkbin: ddr: allow to customize DDR bin blob Quentin Schulz
@ 2025-03-11 11:26 ` Quentin Schulz
2025-04-15 18:07 ` [yocto-patches] " Trevor Woerner
2025-03-11 11:26 ` [meta-rockchip PATCH 6/6] bsp: rkbin: bump to latest commit in master branch Quentin Schulz
` (2 subsequent siblings)
7 siblings, 1 reply; 12+ messages in thread
From: Quentin Schulz @ 2025-03-11 11:26 UTC (permalink / raw)
To: yocto-patches; +Cc: Quentin Schulz
From: Quentin Schulz <quentin.schulz@cherry.de>
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 <quentin.schulz@cherry.de>
---
recipes-bsp/rkbin/rockchip-rkbin-ddr_git.bb | 33 +++++++++++++++--------------
1 file changed, 17 insertions(+), 16 deletions(-)
diff --git a/recipes-bsp/rkbin/rockchip-rkbin-ddr_git.bb b/recipes-bsp/rkbin/rockchip-rkbin-ddr_git.bb
index 193d0f00a6868f050a0ff4531278b3296d3eae94..17131b6d5a6b443409eacb5806e0613b292852d7 100644
--- a/recipes-bsp/rkbin/rockchip-rkbin-ddr_git.bb
+++ b/recipes-bsp/rkbin/rockchip-rkbin-ddr_git.bb
@@ -8,40 +8,41 @@ 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)
- 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"
DDRBIN_TOOL_SOC:rk3566 ?= "rk356x"
-do_deploy:rk3566() {
- # Prebuilt U-Boot TPL (DDR init)
- 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"
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:rk3588s ?= "rk3588"
-do_deploy:rk3588s() {
+do_deploy() {
+ if [ -z "${DDRBIN_DIR}" ]; then
+ bbfatal "Non-empty DDRBIN_DIR:<MACHINE> required!"
+ fi
+
+ if [ -z "${DDRBIN_VERS}" ]; then
+ bbfatal "Non-empty DDRBIN_VERS:<MACHINE> required!"
+ fi
+
+ if [ -z "${DDRBIN_FILE}" ]; then
+ bbfatal "Non-empty DDRBIN_FILE:<MACHINE> required!"
+ fi
+
+ if [ -z "${DDRBIN_DEPLOY_FILENAME}" ]; then
+ bbfatal "Non-empty DDRBIN_DEPLOY_FILENAME:<MACHINE> required!"
+ fi
+
# Prebuilt U-Boot TPL (DDR init)
install -m 644 ${S}/${DDRBIN_DIR}${DDRBIN_FILE} ${DEPLOYDIR}/${DDRBIN_DEPLOY_FILENAME}
}
--
2.48.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [meta-rockchip PATCH 6/6] bsp: rkbin: bump to latest commit in master branch
2025-03-11 11:26 [meta-rockchip PATCH 0/6] rkbin: factoring ddrbin do_deploy, customize ddrbin and bump rkbin Quentin Schulz
` (4 preceding siblings ...)
2025-03-11 11:26 ` [meta-rockchip PATCH 5/6] bsp: rkbin: ddr: factor out do_deploy to be SoC-agnostic Quentin Schulz
@ 2025-03-11 11:26 ` Quentin Schulz
2025-04-10 11:01 ` [meta-rockchip PATCH 0/6] rkbin: factoring ddrbin do_deploy, customize ddrbin and bump rkbin Quentin Schulz
2025-04-15 18:14 ` [yocto-patches] " Trevor Woerner
7 siblings, 0 replies; 12+ messages in thread
From: Quentin Schulz @ 2025-03-11 11:26 UTC (permalink / raw)
To: yocto-patches; +Cc: Quentin Schulz
From: Quentin Schulz <quentin.schulz@cherry.de>
This bumps rkbin to be using the last public blobs.
Among RK356x and RK3588, the following changes are noteworthy:
- OP-TEE OS (bl32) bump for RK356x and RK3588
- TF-A (bl31) bump for RK3588
Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
---
recipes-bsp/rkbin/rockchip-rkbin.inc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/recipes-bsp/rkbin/rockchip-rkbin.inc b/recipes-bsp/rkbin/rockchip-rkbin.inc
index 9264db9048e31b7dae650bdc8e31009f7f4cf404..468779ac7e9b939c4f7a5d19aecb7ce0f0fb2d09 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"
--
2.48.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [meta-rockchip PATCH 0/6] rkbin: factoring ddrbin do_deploy, customize ddrbin and bump rkbin
2025-03-11 11:26 [meta-rockchip PATCH 0/6] rkbin: factoring ddrbin do_deploy, customize ddrbin and bump rkbin Quentin Schulz
` (5 preceding siblings ...)
2025-03-11 11:26 ` [meta-rockchip PATCH 6/6] bsp: rkbin: bump to latest commit in master branch Quentin Schulz
@ 2025-04-10 11:01 ` Quentin Schulz
2025-04-15 18:14 ` [yocto-patches] " Trevor Woerner
7 siblings, 0 replies; 12+ messages in thread
From: Quentin Schulz @ 2025-04-10 11:01 UTC (permalink / raw)
To: Quentin Schulz, yocto-patches
Hi all,
On 3/11/25 12:26 PM, Quentin Schulz wrote:
> This simplifies rockchip-rkbin-ddr do_deploy to only have one do_deploy
> task common to all supported SoC instead of having to add a new task
> override for each new SoC. It does require to set a few more variables
> though.
>
> Additionally, this allows to finally customize the DDR binary blob using
> Rockchip's ddrbin_tool.py tool. This is typically useful if your board
> isn't following Rockchip's HW reference design, e.g. using a different
> UART controller or pins for serial output, or using a baudrate different
> from the default of 1500000.
>
> Finally it bumps OP-TEE OS, TF-A and DDR bin recipes to use the latest
> commit in rkbin git repo.
>
> I am not too fond of using a file as input for the customization, but
> this is what ddrbin_tool.py uses and there are possibly too many
> corner-cases to handle by using fine-grained variables. So for now, I
> decided to go with that but that is for sure not the only possible
> implementation!
>
> Note that the bump commit wasn't tested.
>
> Note that I plan on backporting all but the last two patches to
> scarthgap (and I assume styhead too). The patch before the last would
> break backward compatibility if someone appends to the
> do_deploy:<override> task. The last patch could be merged but there's no
> absolute need for it?
>
> Lastly, the patch about customizing DDR bin needs to be modified before
> being backported as it uses UNPACKDIR which doesn't exist in scarthgap.
> The logic should be safe to use with ${S} (for scarthgap) though!
>
> @Trevor, maybe you can check if that would fix your issue with the
> RK3308 DDR blob you wanted to keep on that outdated version which is one
> of the last versions where the UART you want to use exists? It'd be nice
> to get rid of the rk3308-specific recipes I believe :)
>
Any feedback?
Cheers,
Quentin
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [yocto-patches] [meta-rockchip PATCH 5/6] bsp: rkbin: ddr: factor out do_deploy to be SoC-agnostic
2025-03-11 11:26 ` [meta-rockchip PATCH 5/6] bsp: rkbin: ddr: factor out do_deploy to be SoC-agnostic Quentin Schulz
@ 2025-04-15 18:07 ` Trevor Woerner
2025-04-16 11:25 ` Quentin Schulz
0 siblings, 1 reply; 12+ messages in thread
From: Trevor Woerner @ 2025-04-15 18:07 UTC (permalink / raw)
To: yocto-patches; +Cc: Quentin Schulz
On Tue 2025-03-11 @ 12:26:34 PM, Quentin Schulz via lists.yoctoproject.org wrote:
> From: Quentin Schulz <quentin.schulz@cherry.de>
>
> 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 <quentin.schulz@cherry.de>
> ---
> recipes-bsp/rkbin/rockchip-rkbin-ddr_git.bb | 33 +++++++++++++++--------------
> 1 file changed, 17 insertions(+), 16 deletions(-)
>
> diff --git a/recipes-bsp/rkbin/rockchip-rkbin-ddr_git.bb b/recipes-bsp/rkbin/rockchip-rkbin-ddr_git.bb
> index 193d0f00a6868f050a0ff4531278b3296d3eae94..17131b6d5a6b443409eacb5806e0613b292852d7 100644
> --- a/recipes-bsp/rkbin/rockchip-rkbin-ddr_git.bb
> +++ b/recipes-bsp/rkbin/rockchip-rkbin-ddr_git.bb
> @@ -8,40 +8,41 @@ 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)
> - 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"
> DDRBIN_TOOL_SOC:rk3566 ?= "rk356x"
>
> -do_deploy:rk3566() {
> - # Prebuilt U-Boot TPL (DDR init)
> - 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"
> 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:rk3588s ?= "rk3588"
>
> -do_deploy:rk3588s() {
> +do_deploy() {
> + if [ -z "${DDRBIN_DIR}" ]; then
> + bbfatal "Non-empty DDRBIN_DIR:<MACHINE> required!"
> + fi
> +
> + if [ -z "${DDRBIN_VERS}" ]; then
> + bbfatal "Non-empty DDRBIN_VERS:<MACHINE> required!"
> + fi
> +
> + if [ -z "${DDRBIN_FILE}" ]; then
> + bbfatal "Non-empty DDRBIN_FILE:<MACHINE> required!"
> + fi
> +
> + if [ -z "${DDRBIN_DEPLOY_FILENAME}" ]; then
> + bbfatal "Non-empty DDRBIN_DEPLOY_FILENAME:<MACHINE> required!"
> + fi
> +
> # Prebuilt U-Boot TPL (DDR init)
> install -m 644 ${S}/${DDRBIN_DIR}${DDRBIN_FILE} ${DEPLOYDIR}/${DDRBIN_DEPLOY_FILENAME}
> }
This is nice, but the problem with this patch is that the rkbin handling
involves 4 files:
- rockchip-rkbin.inc
- rockchip-rkbin-ddr_git.bb
- rockchip-rkbin-optee-os_git.bb
- rockchip-rkbin-tf-a_git.bb
In the *inc file it says:
28 do_deploy() {
29 bbfatal "COMPATIBLE_MACHINE requires a corresponding do_deploy:<MACHINE>() override"
30 }
These machine-specific overrides are found in both:
- rockchip-rkbin-optee-os_git.bb and -
rockchip-rkbin-tf-a_git.bb
but, with this patch, not in rockchip-rkbin-ddr_git.bb.
I like what you've done, but I would prefer they all follow the same
"template". Either:
1) modify rockchip-rkbin-optee-os_git.bb and
rockchip-rkbin-tf-a_git.bb to match and update the bbfatal in
rockchip-rkbin.inc so it makes sense, or
2) skip this patch
I don't have a strong preference either way, but I do have a strong desire
that they all match.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [yocto-patches] [meta-rockchip PATCH 0/6] rkbin: factoring ddrbin do_deploy, customize ddrbin and bump rkbin
2025-03-11 11:26 [meta-rockchip PATCH 0/6] rkbin: factoring ddrbin do_deploy, customize ddrbin and bump rkbin Quentin Schulz
` (6 preceding siblings ...)
2025-04-10 11:01 ` [meta-rockchip PATCH 0/6] rkbin: factoring ddrbin do_deploy, customize ddrbin and bump rkbin Quentin Schulz
@ 2025-04-15 18:14 ` Trevor Woerner
2025-04-16 10:17 ` Quentin Schulz
7 siblings, 1 reply; 12+ messages in thread
From: Trevor Woerner @ 2025-04-15 18:14 UTC (permalink / raw)
To: yocto-patches; +Cc: Quentin Schulz
On Tue 2025-03-11 @ 12:26:29 PM, Quentin Schulz via lists.yoctoproject.org wrote:
> @Trevor, maybe you can check if that would fix your issue with the
> RK3308 DDR blob you wanted to keep on that outdated version which is one
> of the last versions where the UART you want to use exists? It'd be nice
> to get rid of the rk3308-specific recipes I believe :)
Yes, that would be nice!
If I understand all of this correctly, I tried using the ddrbin_tool.py to
unpack the parameters of the latest version of the ddr.bin for the rk3308.
In other words, I applied this patchset, set RKBIN_RK3308_LATEST = "1", and
did a build. I then unpacked the parameters of the ddrbin that was in the
deploy directory. According to the values that were placed in the parameter
file by this tool, the baud rate of the uart is already set to 1,500,000. Yet
I'm still seeing gibberish with the latest version. So I don't think using
this tool to re-set the baud rate to 1,500,000 is going to work. For the
time-being I'll just leave things as they are.
Sorry for taking so long. I had wanted to play around with it and see if I
could get this working. I'm going to try anyway, if nothing else it would
prove that this mechanism is working correctly. But it does not look like it
will fix anything with respect to the rk3308.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [yocto-patches] [meta-rockchip PATCH 0/6] rkbin: factoring ddrbin do_deploy, customize ddrbin and bump rkbin
2025-04-15 18:14 ` [yocto-patches] " Trevor Woerner
@ 2025-04-16 10:17 ` Quentin Schulz
0 siblings, 0 replies; 12+ messages in thread
From: Quentin Schulz @ 2025-04-16 10:17 UTC (permalink / raw)
To: yocto-patches
Hi Trevor,
On 4/15/25 8:14 PM, Trevor Woerner via lists.yoctoproject.org wrote:
> On Tue 2025-03-11 @ 12:26:29 PM, Quentin Schulz via lists.yoctoproject.org wrote:
>> @Trevor, maybe you can check if that would fix your issue with the
>> RK3308 DDR blob you wanted to keep on that outdated version which is one
>> of the last versions where the UART you want to use exists? It'd be nice
>> to get rid of the rk3308-specific recipes I believe :)
>
> Yes, that would be nice!
>
> If I understand all of this correctly, I tried using the ddrbin_tool.py to
> unpack the parameters of the latest version of the ddr.bin for the rk3308.
> In other words, I applied this patchset, set RKBIN_RK3308_LATEST = "1", and
> did a build. I then unpacked the parameters of the ddrbin that was in the
> deploy directory. According to the values that were placed in the parameter
> file by this tool, the baud rate of the uart is already set to 1,500,000. Yet
> I'm still seeing gibberish with the latest version. So I don't think using
> this tool to re-set the baud rate to 1,500,000 is going to work. For the
> time-being I'll just leave things as they are.
>
If I'm not mistaken, we kept the old rkbin for the RK3308 because it is
one of the latest ones that uses UART0 (M0) for its serial output and
the new ones only have either UART2 or UART4.
I would recommend to set
uart id=0
uart iomux=0
in a ddrbin_param.txt for your Rock Pi S provided you want to expose the
UART on pins listed here https://wiki.radxa.com/RockpiS/dev/serial-console
For the ROC-3308-CC you have options as UART0, UART1 and UART2_M0 are
exposed on the headers. Considering we use the same rkbin, I would
assume you want it to be on UART0 so the same can be done in a
ddrbin_param.txt.
Considering there are no iomux on UART0, you possibly could omit `uart
iomux=0` but eh, doesn't hurt probably?
> Sorry for taking so long. I had wanted to play around with it and see if I
> could get this working. I'm going to try anyway, if nothing else it would
> prove that this mechanism is working correctly. But it does not look like it
> will fix anything with respect to the rk3308.
>
Did/Can you try with the uart id and uart iomux changed in ddrbin_param.txt?
Cheers,
Quentin
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [yocto-patches] [meta-rockchip PATCH 5/6] bsp: rkbin: ddr: factor out do_deploy to be SoC-agnostic
2025-04-15 18:07 ` [yocto-patches] " Trevor Woerner
@ 2025-04-16 11:25 ` Quentin Schulz
0 siblings, 0 replies; 12+ messages in thread
From: Quentin Schulz @ 2025-04-16 11:25 UTC (permalink / raw)
To: Trevor Woerner, yocto-patches
Hi Trevor,
On 4/15/25 8:07 PM, Trevor Woerner wrote:
> On Tue 2025-03-11 @ 12:26:34 PM, Quentin Schulz via lists.yoctoproject.org wrote:
>> From: Quentin Schulz <quentin.schulz@cherry.de>
>>
>> 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 <quentin.schulz@cherry.de>
>> ---
>> recipes-bsp/rkbin/rockchip-rkbin-ddr_git.bb | 33 +++++++++++++++--------------
>> 1 file changed, 17 insertions(+), 16 deletions(-)
>>
>> diff --git a/recipes-bsp/rkbin/rockchip-rkbin-ddr_git.bb b/recipes-bsp/rkbin/rockchip-rkbin-ddr_git.bb
>> index 193d0f00a6868f050a0ff4531278b3296d3eae94..17131b6d5a6b443409eacb5806e0613b292852d7 100644
>> --- a/recipes-bsp/rkbin/rockchip-rkbin-ddr_git.bb
>> +++ b/recipes-bsp/rkbin/rockchip-rkbin-ddr_git.bb
>> @@ -8,40 +8,41 @@ 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)
>> - 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"
>> DDRBIN_TOOL_SOC:rk3566 ?= "rk356x"
>>
>> -do_deploy:rk3566() {
>> - # Prebuilt U-Boot TPL (DDR init)
>> - 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"
>> 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:rk3588s ?= "rk3588"
>>
>> -do_deploy:rk3588s() {
>> +do_deploy() {
>> + if [ -z "${DDRBIN_DIR}" ]; then
>> + bbfatal "Non-empty DDRBIN_DIR:<MACHINE> required!"
>> + fi
>> +
>> + if [ -z "${DDRBIN_VERS}" ]; then
>> + bbfatal "Non-empty DDRBIN_VERS:<MACHINE> required!"
>> + fi
>> +
>> + if [ -z "${DDRBIN_FILE}" ]; then
>> + bbfatal "Non-empty DDRBIN_FILE:<MACHINE> required!"
>> + fi
>> +
>> + if [ -z "${DDRBIN_DEPLOY_FILENAME}" ]; then
>> + bbfatal "Non-empty DDRBIN_DEPLOY_FILENAME:<MACHINE> required!"
>> + fi
>> +
>> # Prebuilt U-Boot TPL (DDR init)
>> install -m 644 ${S}/${DDRBIN_DIR}${DDRBIN_FILE} ${DEPLOYDIR}/${DDRBIN_DEPLOY_FILENAME}
>> }
>
> This is nice, but the problem with this patch is that the rkbin handling
> involves 4 files:
> - rockchip-rkbin.inc
> - rockchip-rkbin-ddr_git.bb
> - rockchip-rkbin-optee-os_git.bb
> - rockchip-rkbin-tf-a_git.bb
>
> In the *inc file it says:
>
> 28 do_deploy() {
> 29 bbfatal "COMPATIBLE_MACHINE requires a corresponding do_deploy:<MACHINE>() override"
> 30 }
>
> These machine-specific overrides are found in both:
> - rockchip-rkbin-optee-os_git.bb and -
> rockchip-rkbin-tf-a_git.bb
> but, with this patch, not in rockchip-rkbin-ddr_git.bb.
>
Which isn't an issue as do_deploy() is entirely overridden in
rockchip-rkbin-ddr_git.bb so this message would never be shown for that
recipe, but the others yes.
> I like what you've done, but I would prefer they all follow the same
> "template". Either:
> 1) modify rockchip-rkbin-optee-os_git.bb and
> rockchip-rkbin-tf-a_git.bb to match and update the bbfatal in
> rockchip-rkbin.inc so it makes sense, or
>
I can agree with consistency across similar recipes.
One of the issues is that we're using a shell glob at the moment to
avoid specifying the exact version number for OP-TEE OS and TF-A
binaries. If I remember correctly, I cannot have this pattern stored in
a variable, but I could hardcode the version (which will require us to
modify it for every rkbin bump we'll do) or use find with a glob stored
in a variable instead.
If we want absolute consistency, we can simply hardcode the version
number as well.
I could also move the whole do_deploy logic I added in
recipes-bsp/rkbin/rockchip-rkbin-ddr_git.bb to rockchip-rkbin.inc and
use recipe-agnostic variables. After all, we only ever install one
binary in rockchip-rkbin-ddr, rockchip-rkbin-optee-os and
rockchip-rkbin-tf-a so we would only need to specify the variables at
the top of the file and the .inc will take care of deploying the proper
file in the proper directory. What do you think? If we don't do that,
then it doesn't make much sense to keep a default do_deploy() in the
.inc, don't you think? And if we don't keep the default do_deploy() in
the .inc, then we should probably not inherit deploy either?
I'll start working on a version that has hardcoded binary versions and
moves the new do_deploy logic into the .inc, lemme know if you would
rather have something different.
> 2) skip this patch
>
> I don't have a strong preference either way, but I do have a strong desire
> that they all match.
Fair enough :)
For what it's worth, you could skip the 5th patch and apply the others
if you want, and I could work on a v2 for the 5th patch alone instead of
making it a blocker for this series. I don't mind either way :)
Cheers,
Quentin
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2025-04-16 11:25 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-11 11:26 [meta-rockchip PATCH 0/6] rkbin: factoring ddrbin do_deploy, customize ddrbin and bump rkbin Quentin Schulz
2025-03-11 11:26 ` [meta-rockchip PATCH 1/6] bsp: rkbin: ddr: store directory path for the DDR bin blob in a variable Quentin Schulz
2025-03-11 11:26 ` [meta-rockchip PATCH 2/6] bsp: rkbin: ddr: make deployed name configurable Quentin Schulz
2025-03-11 11:26 ` [meta-rockchip PATCH 3/6] bsp: rkbin: add native recipe for tools (ddrbin_tool.py) Quentin Schulz
2025-03-11 11:26 ` [meta-rockchip PATCH 4/6] bsp: rkbin: ddr: allow to customize DDR bin blob Quentin Schulz
2025-03-11 11:26 ` [meta-rockchip PATCH 5/6] bsp: rkbin: ddr: factor out do_deploy to be SoC-agnostic Quentin Schulz
2025-04-15 18:07 ` [yocto-patches] " Trevor Woerner
2025-04-16 11:25 ` Quentin Schulz
2025-03-11 11:26 ` [meta-rockchip PATCH 6/6] bsp: rkbin: bump to latest commit in master branch Quentin Schulz
2025-04-10 11:01 ` [meta-rockchip PATCH 0/6] rkbin: factoring ddrbin do_deploy, customize ddrbin and bump rkbin Quentin Schulz
2025-04-15 18:14 ` [yocto-patches] " Trevor Woerner
2025-04-16 10:17 ` Quentin Schulz
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.