Skip to contentSkip to conversation

rock5b: add

PATCH In review Trevor Woerner 3 participants 5 messages Sep 22, 2023 – Sep 25, 2023 Arm Rockchip

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 rock5b: add

Add support for the Radxa Rock 5B
https://wiki.radxa.com/Rock5/5b

The device-tree for this board is better in the 6.5 (and later) kernels, therefore set the kernel to linux-yocto-dev for now (eventually this won't be needed as linux-yocto moves forward).

Unfortunately the TF-A project does not currently have support for the rk3588. Therefore, for the time-being, the only way to supply a TPL/DDR-init for the rk3588 is to use the closed-source rkbin binaries from Rockchip. If/when TF-A adds support for the rk3588 we can investigate switching.

The rk3588 comes in two variants: rk3588 and rk3588s. The "s" option is a stripped-down version of the rk3588. In the Linux kernel these two SoCs are kept separate, with the rk3588 building on the rk3588s, so we've mimicked that same behaviour here.

---
v2:
- fix the logic behind the MACHINEOVERRIDES to get the content, and ordering, correct
- improved the commit message around TF-A/rkbin
- correct Quentin's SoB line

---
 README                                        |  1 +
 conf/machine/include/rk3588.inc               |  6 ++
 conf/machine/include/rk3588s.inc              | 17 ++++
 conf/machine/rock5b.conf                      | 12 +++
 recipes-bsp/rkbin/rockchip-rkbin_git.bb       | 37 ++++++++
 recipes-bsp/u-boot/u-boot%.bbappend           |  5 ++
 recipes-kernel/linux/linux-yocto-dev.bbappend |  3 +
 .../rockchip/remove-non-rockchip-arch-arm.cfg | 85 +++++++++++++++++++
 .../rockchip/remove-non-rockchip-arch-arm.scc |  1 +
 .../remove-non-rockchip-arch-arm64.cfg        | 66 ++++++++++++++
 .../remove-non-rockchip-arch-arm64.scc        |  1 +
 11 files changed, 234 insertions(+)
 create mode 100644 conf/machine/include/rk3588.inc
 create mode 100644 conf/machine/include/rk3588s.inc
 create mode 100644 conf/machine/rock5b.conf
 create mode 100644 recipes-bsp/rkbin/rockchip-rkbin_git.bb
 create mode 100644 recipes-kernel/linux/linux-yocto-dev.bbappend
 create mode 100644 recipes-kernel/linux/linux-yocto-dev/rockchip-kmeta/bsp/rockchip/remove-non-rockchip-arch-arm.cfg
 create mode 100644 recipes-kernel/linux/linux-yocto-dev/rockchip-kmeta/bsp/rockchip/remove-non-rockchip-arch-arm.scc
 create mode 100644 recipes-kernel/linux/linux-yocto-dev/rockchip-kmeta/bsp/rockchip/remove-non-rockchip-arch-arm64.cfg
 create mode 100644 recipes-kernel/linux/linux-yocto-dev/rockchip-kmeta/bsp/rockchip/remove-non-rockchip-arch-arm64.scc
README +1 -0
index 286dafbe1020..032d9bbb6b34 100644
@@ -30,6 +30,7 @@ Status of supported boards:
 		vyasa-rk3288
 		firefly-rk3288
 		nanopi-r4s
+		rock5b
 	builds:
 		marsboard-rk3066
 		radxarock
conf/machine/include/rk3588.inc new file +6 -0
new file mode 100644
index 000000000000..34f0627dc085
@@ -0,0 +1,6 @@
+MACHINEOVERRIDES =. "rk3588:"
+
+# the rk3588s is a "stripped-down" version of the rk3588
+# in the kernel's device-tree the rk3588 builds on top of the rk3588s
+# so anything that is valid for the rk3588s is valid for the rk3588
+require conf/machine/include/rk3588s.inc
conf/machine/include/rk3588s.inc new file +17 -0
new file mode 100644
index 000000000000..65d9054e88d8
@@ -0,0 +1,17 @@
+MACHINEOVERRIDES =. "rk3588s:"
+DEFAULTTUNE ?= "cortexa76-cortexa55-crypto"
+
+require conf/machine/include/arm/armv8-2a/tune-cortexa76-cortexa55.inc
+require conf/machine/include/rockchip-defaults.inc
+require conf/machine/include/rockchip-wic.inc
+
+KBUILD_DEFCONFIG ?= "defconfig"
+KERNEL_FEATURES:append:rk3588 = " bsp/rockchip/remove-non-rockchip-arch-arm64.scc"
+KERNEL_CLASSES = "kernel-fitimage"
+KERNEL_IMAGETYPE = "fitImage"
+
+PREFERRED_PROVIDER_trusted-firmware-a = "rockchip-rkbin"
+PREFERRED_PROVIDER_optee-os = "rockchip-rkbin"
+
+UBOOT_SUFFIX ?= "itb"
+UBOOT_ENTRYPOINT ?= "0x06000000"
conf/machine/rock5b.conf new file +12 -0
new file mode 100644
index 000000000000..dc31a9f3a4e4
@@ -0,0 +1,12 @@
+#@TYPE: Machine
+#@NAME: Radxa Rock5b
+#@DESCRIPTION: ROCK5 is the 5th generation of SBC designed by Radxa.
+#https://wiki.radxa.com/Rock5/5b
+
+require conf/machine/include/rk3588.inc
+
+PREFERRED_PROVIDER_virtual/kernel = "linux-yocto-dev"
+KERNEL_DEVICETREE = "rockchip/rk3588-rock-5b.dtb"
+MACHINE_EXTRA_RRECOMMENDS += "kernel-modules"
+
+UBOOT_MACHINE = "rock5b-rk3588_defconfig"
recipes-bsp/rkbin/rockchip-rkbin_git.bb new file +37 -0
new file mode 100644
index 000000000000..7fefb017053b
@@ -0,0 +1,37 @@
+DESCRIPTION = "Rockchip Firmware and Tool Binaries"
+LICENSE = "Proprietary"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=15faa4a01e7eb0f5d33f9f2bcc7bff62"
+
+SRC_URI = "git://github.com/rockchip-linux/rkbin;protocol=https;branch=master"
+SRCREV = "b4558da0860ca48bf1a571dd33ccba580b9abe23"
+
+PROVIDES += "trusted-firmware-a"
+PROVIDES += "optee-os"
+
+inherit bin_package deploy
+
+S = "${WORKDIR}/git"
+
+COMPATIBLE_MACHINE = ""
+COMPATIBLE_MACHINE:rk3588s = "rk3588s"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+do_install() {
+	# Nothing in this recipe is useful in a filesystem
+	:
+}
+
+PACKAGES = "${PN}"
+ALLOW_EMPTY:${PN} = "1"
+
+do_deploy() {
+	# Prebuilt TF-A
+	install -m 644 ${S}/bin/rk35/rk3588_bl31_v*.elf ${DEPLOYDIR}/bl31-rk3588.elf
+	# Prebuilt OPTEE-OS
+	install -m 644 ${S}/bin/rk35/rk3588_bl32_v*.bin ${DEPLOYDIR}/tee-rk3588.bin
+	# Prebuilt U-Boot TPL (DDR init)
+	install -m 644 ${S}/bin/rk35/rk3588_ddr_lp4_2112MHz_lp5_2736MHz_v*.bin ${DEPLOYDIR}/ddr-rk3588.bin
+}
+
+addtask deploy after do_install
recipes-bsp/u-boot/u-boot%.bbappend +5 -0
index db8e0166f5b3..3732c7f04373 100644
@@ -11,6 +11,11 @@ DEPENDS:append = " python3-pyelftools-native"
 
 ATF_DEPENDS ??= ""
 
+EXTRA_OEMAKE:append:rk3588s = " BL31=${DEPLOY_DIR_IMAGE}/bl31-rk3588.elf"
+ATF_DEPENDS:append:rk3588s = " trusted-firmware-a:do_deploy"
+EXTRA_OEMAKE:append:rk3588s = " ROCKCHIP_TPL=${DEPLOY_DIR_IMAGE}/ddr-rk3588.bin"
+ATF_DEPENDS:append:rk3588s = " rockchip-rkbin:do_deploy"
+
 EXTRA_OEMAKE:append:rk3399 = " BL31=${DEPLOY_DIR_IMAGE}/bl31-rk3399.elf"
 ATF_DEPENDS:rk3399 = " trusted-firmware-a:do_deploy"
 EXTRA_OEMAKE:append:rk3328 = " BL31=${DEPLOY_DIR_IMAGE}/bl31-rk3328.elf"
recipes-kernel/linux/linux-yocto-dev.bbappend new file +3 -0
new file mode 100644
index 000000000000..cda5c520c4fe
@@ -0,0 +1,3 @@
+FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
+COMPATIBLE_MACHINE:rock5b = "rock5b"
+SRC_URI:append:rock5b = " file://rockchip-kmeta;type=kmeta;name=rockchip-kmeta;destsuffix=rockchip-kmeta"
recipes-kernel/linux/linux-yocto-dev/rockchip-kmeta/bsp/rockchip/remove-non-rockchip-arch-arm.cfg new file +85 -0

85 lines not on this page · raw message

recipes-kernel/linux/linux-yocto-dev/rockchip-kmeta/bsp/rockchip/remove-non-rockchip-arch-arm.scc new file +1 -0
new file mode 100644
index 000000000000..ce7770456ea4
@@ -0,0 +1 @@
+kconf hardware remove-non-rockchip-arch-arm.cfg
recipes-kernel/linux/linux-yocto-dev/rockchip-kmeta/bsp/rockchip/remove-non-rockchip-arch-arm64.cfg new file +66 -0

66 lines not on this page · raw message

recipes-kernel/linux/linux-yocto-dev/rockchip-kmeta/bsp/rockchip/remove-non-rockchip-arch-arm64.scc new file +1 -0
new file mode 100644
index 000000000000..e169240f5067
@@ -0,0 +1 @@
+kconf hardware remove-non-rockchip-arch-arm64.cfg
Signature · 1 line
2.41.0.327.gaa9166bcc0ba
#1 lore raw

Thanks for your work Trevor, I have been waiting for this for a while.

I am new around here so forgive me if I am being impertinent but my only feedback would be to keep the naming of the machines consistent with the dtb and uboot defconfig? ie, rock-5b rather then rock5b?

#2 lore raw

Hi Anthony,

Quoted 5 lines · Anthony Davies

Thanks for your work Trevor, I have been waiting for this for a while.

I am new around here so forgive me if I am being impertinent but my only feedback would be to keep the naming of the machines consistent with the dtb and uboot defconfig? ie, rock-5b rather then rock5b?

In meta-rockchip we try to follow the naming that the manufacturer gives to the product. Device-tree names come and go, get munged together, and split apart. While the kernel might call it rock-5b today, some new board might come along that causes a refactorisation leading to a whole bunch of renaming.

That said the manufacturer isn't 100% clear on the naming of this product. One of the original post introducing the product,
https://forum.radxa.com/t/introduce-rock-5-model-b-arm-desktop-level-sbc/8361
shows it written both "Rock5B" and "Rock 5B".

From the manufacturer's own website, they seem to attach the "5" to the "Rock" (without a space) when they're just saying "Rock5", but add a space when they're distinguishing between the "A" and "B" variants:
https://wiki.radxa.com/Rock5
https://wiki.radxa.com/Rock5/5b

So the naming could go either way. Given that there are more instances of "Rock 5B" we could go with what you suggest.

Thanks!

#3 lore raw
In reply to Trevor Woerner

Hi Trevor,

Quoted 79 lines · Trevor Woerner

Add support for the Radxa Rock 5B
https://wiki.radxa.com/Rock5/5b

The device-tree for this board is better in the 6.5 (and later) kernels, therefore set the kernel to linux-yocto-dev for now (eventually this won't be needed as linux-yocto moves forward).

Unfortunately the TF-A project does not currently have support for the rk3588. Therefore, for the time-being, the only way to supply a TPL/DDR-init for the rk3588 is to use the closed-source rkbin binaries from Rockchip. If/when TF-A adds support for the rk3588 we can investigate switching.

The rk3588 comes in two variants: rk3588 and rk3588s. The "s" option is a stripped-down version of the rk3588. In the Linux kernel these two SoCs are kept separate, with the rk3588 building on the rk3588s, so we've mimicked that same behaviour here.

---
v2:
- fix the logic behind the MACHINEOVERRIDES to get the content, and ordering, correct
- improved the commit message around TF-A/rkbin
- correct Quentin's SoB line

---
  README                                        |  1 +
  conf/machine/include/rk3588.inc               |  6 ++
  conf/machine/include/rk3588s.inc              | 17 ++++
  conf/machine/rock5b.conf                      | 12 +++
  recipes-bsp/rkbin/rockchip-rkbin_git.bb       | 37 ++++++++
  recipes-bsp/u-boot/u-boot%.bbappend           |  5 ++
  recipes-kernel/linux/linux-yocto-dev.bbappend |  3 +
  .../rockchip/remove-non-rockchip-arch-arm.cfg | 85 +++++++++++++++++++
  .../rockchip/remove-non-rockchip-arch-arm.scc |  1 +
  .../remove-non-rockchip-arch-arm64.cfg        | 66 ++++++++++++++
  .../remove-non-rockchip-arch-arm64.scc        |  1 +
  11 files changed, 234 insertions(+)

create mode 100644 conf/machine/include/rk3588.inc
create mode 100644 conf/machine/include/rk3588s.inc
create mode 100644 conf/machine/rock5b.conf
create mode 100644 recipes-bsp/rkbin/rockchip-rkbin_git.bb
create mode 100644 recipes-kernel/linux/linux-yocto-dev.bbappend
create mode 100644 recipes-kernel/linux/linux-yocto-dev/rockchip-kmeta/bsp/rockchip/remove-non-rockchip-arch-arm.cfg create mode 100644 recipes-kernel/linux/linux-yocto-dev/rockchip-kmeta/bsp/rockchip/remove-non-rockchip-arch-arm.scc create mode 100644 recipes-kernel/linux/linux-yocto-dev/rockchip-kmeta/bsp/rockchip/remove-non-rockchip-arch-arm64.cfg create mode 100644 recipes-kernel/linux/linux-yocto-dev/rockchip-kmeta/bsp/rockchip/remove-non-rockchip-arch-arm64.scc

README +1 -0
index 286dafbe1020..032d9bbb6b34 100644
@@ -30,6 +30,7 @@ Status of supported boards:
  		vyasa-rk3288
  		firefly-rk3288
  		nanopi-r4s
+		rock5b
  	builds:
  		marsboard-rk3066
  		radxarock
conf/machine/include/rk3588.inc new file +6 -0
new file mode 100644
index 000000000000..34f0627dc085
@@ -0,0 +1,6 @@
+MACHINEOVERRIDES =. "rk3588:"
+
+# the rk3588s is a "stripped-down" version of the rk3588
+# in the kernel's device-tree the rk3588 builds on top of the rk3588s
+# so anything that is valid for the rk3588s is valid for the rk3588
+require conf/machine/include/rk3588s.inc
conf/machine/include/rk3588s.inc new file +0 -0
new file mode 100644
index 000000000000..65d9054e88d8

conf/machine/include/rk3588s.inc line 9

Quoted 9 lines
conf/machine/include/rk3588s.inc new file +9 -0
@@ -0,0 +1,17 @@
+MACHINEOVERRIDES =. "rk3588s:"
+DEFAULTTUNE ?= "cortexa76-cortexa55-crypto"
+
+require conf/machine/include/arm/armv8-2a/tune-cortexa76-cortexa55.inc
+require conf/machine/include/rockchip-defaults.inc
+require conf/machine/include/rockchip-wic.inc
+
+KBUILD_DEFCONFIG ?= "defconfig"
+KERNEL_FEATURES:append:rk3588 = " bsp/rockchip/remove-non-rockchip-arch-arm64.scc"

I believe this is supposed to be an OVERRIDES for rk3588s and not rk3588 since it applies to both (in addition of being in the rk3588s.inc file).

The rest looks fine otherwise :)

Thanks!

Cheers,
Quentin

Quoted 271 lines
conf/machine/include/rk3588s.inc new file +8 -0
+KERNEL_CLASSES = "kernel-fitimage"
+KERNEL_IMAGETYPE = "fitImage"
+
+PREFERRED_PROVIDER_trusted-firmware-a = "rockchip-rkbin"
+PREFERRED_PROVIDER_optee-os = "rockchip-rkbin"
+
+UBOOT_SUFFIX ?= "itb"
+UBOOT_ENTRYPOINT ?= "0x06000000"
conf/machine/rock5b.conf new file +12 -0
new file mode 100644
index 000000000000..dc31a9f3a4e4
@@ -0,0 +1,12 @@
+#@TYPE: Machine
+#@NAME: Radxa Rock5b
+#@DESCRIPTION: ROCK5 is the 5th generation of SBC designed by Radxa.
+#https://wiki.radxa.com/Rock5/5b
+
+require conf/machine/include/rk3588.inc
+
+PREFERRED_PROVIDER_virtual/kernel = "linux-yocto-dev"
+KERNEL_DEVICETREE = "rockchip/rk3588-rock-5b.dtb"
+MACHINE_EXTRA_RRECOMMENDS += "kernel-modules"
+
+UBOOT_MACHINE = "rock5b-rk3588_defconfig"
recipes-bsp/rkbin/rockchip-rkbin_git.bb new file +37 -0
new file mode 100644
index 000000000000..7fefb017053b
@@ -0,0 +1,37 @@
+DESCRIPTION = "Rockchip Firmware and Tool Binaries"
+LICENSE = "Proprietary"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=15faa4a01e7eb0f5d33f9f2bcc7bff62"
+
+SRC_URI = "git://github.com/rockchip-linux/rkbin;protocol=https;branch=master"
+SRCREV = "b4558da0860ca48bf1a571dd33ccba580b9abe23"
+
+PROVIDES += "trusted-firmware-a"
+PROVIDES += "optee-os"
+
+inherit bin_package deploy
+
+S = "${WORKDIR}/git"
+
+COMPATIBLE_MACHINE = ""
+COMPATIBLE_MACHINE:rk3588s = "rk3588s"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+do_install() {
+	# Nothing in this recipe is useful in a filesystem
+	:
+}
+
+PACKAGES = "${PN}"
+ALLOW_EMPTY:${PN} = "1"
+
+do_deploy() {
+	# Prebuilt TF-A
+	install -m 644 ${S}/bin/rk35/rk3588_bl31_v*.elf ${DEPLOYDIR}/bl31-rk3588.elf
+	# Prebuilt OPTEE-OS
+	install -m 644 ${S}/bin/rk35/rk3588_bl32_v*.bin ${DEPLOYDIR}/tee-rk3588.bin
+	# Prebuilt U-Boot TPL (DDR init)
+	install -m 644 ${S}/bin/rk35/rk3588_ddr_lp4_2112MHz_lp5_2736MHz_v*.bin ${DEPLOYDIR}/ddr-rk3588.bin
+}
+
+addtask deploy after do_install
recipes-bsp/u-boot/u-boot%.bbappend +5 -0
index db8e0166f5b3..3732c7f04373 100644
@@ -11,6 +11,11 @@ DEPENDS:append = " python3-pyelftools-native"
 
  ATF_DEPENDS ??= ""
 
+EXTRA_OEMAKE:append:rk3588s = " BL31=${DEPLOY_DIR_IMAGE}/bl31-rk3588.elf"
+ATF_DEPENDS:append:rk3588s = " trusted-firmware-a:do_deploy"
+EXTRA_OEMAKE:append:rk3588s = " ROCKCHIP_TPL=${DEPLOY_DIR_IMAGE}/ddr-rk3588.bin"
+ATF_DEPENDS:append:rk3588s = " rockchip-rkbin:do_deploy"
+
  EXTRA_OEMAKE:append:rk3399 = " BL31=${DEPLOY_DIR_IMAGE}/bl31-rk3399.elf"
  ATF_DEPENDS:rk3399 = " trusted-firmware-a:do_deploy"
  EXTRA_OEMAKE:append:rk3328 = " BL31=${DEPLOY_DIR_IMAGE}/bl31-rk3328.elf"
recipes-kernel/linux/linux-yocto-dev.bbappend new file +3 -0
new file mode 100644
index 000000000000..cda5c520c4fe
@@ -0,0 +1,3 @@
+FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
+COMPATIBLE_MACHINE:rock5b = "rock5b"
+SRC_URI:append:rock5b = " file://rockchip-kmeta;type=kmeta;name=rockchip-kmeta;destsuffix=rockchip-kmeta"
recipes-kernel/linux/linux-yocto-dev/rockchip-kmeta/bsp/rockchip/remove-non-rockchip-arch-arm.cfg new file +85 -0
new file mode 100644
index 000000000000..e9443f17895c
@@ -0,0 +1,85 @@
+CONFIG_ARCH_ACTIONS=n
+CONFIG_ARCH_AIROHA=n
+CONFIG_ARCH_ALPINE=n
+CONFIG_ARCH_ARTPEC=n
+CONFIG_ARCH_ASPEED=n
+CONFIG_ARCH_AT91=n
+CONFIG_ARCH_BCM2835=n
+CONFIG_ARCH_BCM=n
+CONFIG_ARCH_BCMBCA=n
+CONFIG_ARCH_BCMBCA_BRAHMAB15=n
+CONFIG_ARCH_BCMBCA_CORTEXA7=n
+CONFIG_ARCH_BCMBCA_CORTEXA9=n
+CONFIG_ARCH_BCM_21664=n
+CONFIG_ARCH_BCM_23550=n
+CONFIG_ARCH_BCM_281XX=n
+CONFIG_ARCH_BCM_5301X=n
+CONFIG_ARCH_BCM_53573=n
+CONFIG_ARCH_BCM_CYGNUS=n
+CONFIG_ARCH_BCM_HR2=n
+CONFIG_ARCH_BCM_NSP=n
+CONFIG_ARCH_BERLIN=n
+CONFIG_ARCH_BRCMSTB=n
+CONFIG_ARCH_DIGICOLOR=n
+CONFIG_ARCH_EMEV2=n
+CONFIG_ARCH_EXYNOS=n
+CONFIG_ARCH_HI3xxx=n
+CONFIG_ARCH_HIGHBANK=n
+CONFIG_ARCH_HIP01=n
+CONFIG_ARCH_HIP04=n
+CONFIG_ARCH_HISI=n
+CONFIG_ARCH_HIX5HD2=n
+CONFIG_ARCH_HPE=n
+CONFIG_ARCH_HPE_GXP=n
+CONFIG_ARCH_INTEL_SOCFPGA=n
+CONFIG_ARCH_KEYSTONE=n
+CONFIG_ARCH_MEDIATEK=n
+CONFIG_ARCH_MESON=n
+CONFIG_ARCH_MILBEAUT=n
+CONFIG_ARCH_MILBEAUT_M10V=n
+CONFIG_ARCH_MMP=n
+CONFIG_ARCH_MSM8916=n
+CONFIG_ARCH_MSM8960=n
+CONFIG_ARCH_MSM8974=n
+CONFIG_ARCH_MSM8X60=n
+CONFIG_ARCH_MVEBU=n
+CONFIG_ARCH_MXC=n
+CONFIG_ARCH_OMAP3=n
+CONFIG_ARCH_OMAP4=n
+CONFIG_ARCH_QCOM=n
+CONFIG_ARCH_R7S72100=n
+CONFIG_ARCH_R7S9210=n
+CONFIG_ARCH_R8A73A4=n
+CONFIG_ARCH_R8A7740=n
+CONFIG_ARCH_R8A7742=n
+CONFIG_ARCH_R8A7743=n
+CONFIG_ARCH_R8A7744=n
+CONFIG_ARCH_R8A7745=n
+CONFIG_ARCH_R8A77470=n
+CONFIG_ARCH_R8A7778=n
+CONFIG_ARCH_R8A7779=n
+CONFIG_ARCH_R8A7790=n
+CONFIG_ARCH_R8A7791=n
+CONFIG_ARCH_R8A7792=n
+CONFIG_ARCH_R8A7793=n
+CONFIG_ARCH_R8A7794=n
+CONFIG_ARCH_R9A06G032=n
+CONFIG_ARCH_RENESAS=n
+CONFIG_ARCH_SH73A0=n
+CONFIG_ARCH_SPEAR13XX=n
+CONFIG_ARCH_STI=n
+CONFIG_ARCH_STM32=n
+CONFIG_ARCH_SUNPLUS=n
+CONFIG_ARCH_SUNXI=n
+CONFIG_ARCH_TEGRA=n
+CONFIG_ARCH_TEGRA_114_SOC=n
+CONFIG_ARCH_TEGRA_124_SOC=n
+CONFIG_ARCH_TEGRA_2x_SOC=n
+CONFIG_ARCH_TEGRA_3x_SOC=n
+CONFIG_ARCH_U8500=n
+CONFIG_ARCH_UNIPHIER=n
+CONFIG_ARCH_VEXPRESS=n
+CONFIG_ARCH_VEXPRESS_TC2_PM=n
+CONFIG_ARCH_VIRT=n
+CONFIG_ARCH_WM8850=n
+CONFIG_ARCH_ZYNQ=n
recipes-kernel/linux/linux-yocto-dev/rockchip-kmeta/bsp/rockchip/remove-non-rockchip-arch-arm.scc new file +1 -0
new file mode 100644
index 000000000000..ce7770456ea4
@@ -0,0 +1 @@
+kconf hardware remove-non-rockchip-arch-arm.cfg
recipes-kernel/linux/linux-yocto-dev/rockchip-kmeta/bsp/rockchip/remove-non-rockchip-arch-arm64.cfg new file +66 -0
new file mode 100644
index 000000000000..5b804a2ca26b
@@ -0,0 +1,66 @@
+CONFIG_ARCH_ACTIONS=n
+CONFIG_ARCH_ALPINE=n
+CONFIG_ARCH_APPLE=n
+CONFIG_ARCH_BCM2835=n
+CONFIG_ARCH_BCM=n
+CONFIG_ARCH_BCMBCA=n
+CONFIG_ARCH_BCM_IPROC=n
+CONFIG_ARCH_BERLIN=n
+CONFIG_ARCH_BRCMSTB=n
+CONFIG_ARCH_EXYNOS=n
+CONFIG_ARCH_SPARX5=n
+CONFIG_ARCH_HISI=n
+CONFIG_ARCH_INTEL_SOCFPGA=n
+CONFIG_ARCH_K3=n
+CONFIG_ARCH_KEEMBAY=n
+CONFIG_ARCH_LAYERSCAPE=n
+CONFIG_ARCH_LG1K=n
+CONFIG_ARCH_MEDIATEK=n
+CONFIG_ARCH_MESON=n
+CONFIG_ARCH_MVEBU=n
+CONFIG_ARCH_MXC=n
+CONFIG_ARCH_NPCM=n
+CONFIG_ARCH_NXP=n
+CONFIG_ARCH_MA35=n
+CONFIG_ARCH_QCOM=n
+CONFIG_ARCH_REALTEK=n
+CONFIG_ARCH_R8A774A1=n
+CONFIG_ARCH_R8A774B1=n
+CONFIG_ARCH_R8A774C0=n
+CONFIG_ARCH_R8A774E1=n
+CONFIG_ARCH_R8A77951=n
+CONFIG_ARCH_R8A77960=n
+CONFIG_ARCH_R8A77961=n
+CONFIG_ARCH_R8A77965=n
+CONFIG_ARCH_R8A77970=n
+CONFIG_ARCH_R8A77980=n
+CONFIG_ARCH_R8A77990=n
+CONFIG_ARCH_R8A77995=n
+CONFIG_ARCH_R8A779A0=n
+CONFIG_ARCH_R8A779F0=n
+CONFIG_ARCH_R8A779G0=n
+CONFIG_ARCH_R9A07G043=n
+CONFIG_ARCH_R9A07G044=n
+CONFIG_ARCH_R9A07G054=n
+CONFIG_ARCH_R9A09G011=n
+CONFIG_ARCH_RENESAS=n
+CONFIG_ARCH_S32=n
+CONFIG_ARCH_SEATTLE=n
+CONFIG_ARCH_STM32=n
+CONFIG_ARCH_SPRD=n
+CONFIG_ARCH_SUNXI=n
+CONFIG_ARCH_SYNQUACER=n
+CONFIG_ARCH_TEGRA=n
+CONFIG_ARCH_TEGRA_132_SOC=n
+CONFIG_ARCH_TEGRA_186_SOC=n
+CONFIG_ARCH_TEGRA_194_SOC=n
+CONFIG_ARCH_TEGRA_210_SOC=n
+CONFIG_ARCH_TEGRA_234_SOC=n
+CONFIG_ARCH_TESLA_FSD=n
+CONFIG_ARCH_THUNDER2=n
+CONFIG_ARCH_THUNDER=n
+CONFIG_ARCH_UNIPHIER=n
+CONFIG_ARCH_VEXPRESS=n
+CONFIG_ARCH_VISCONTI=n
+CONFIG_ARCH_XGENE=n
+CONFIG_ARCH_ZYNQMP=n
recipes-kernel/linux/linux-yocto-dev/rockchip-kmeta/bsp/rockchip/remove-non-rockchip-arch-arm64.scc new file +1 -0
new file mode 100644
index 000000000000..e169240f5067
@@ -0,0 +1 @@
+kconf hardware remove-non-rockchip-arch-arm64.cfg
#4 lore raw
Quoted 86 lines · Quentin Schulz

Hi Trevor,

Quoted 83 lines · Trevor Woerner

Add support for the Radxa Rock 5B
https://wiki.radxa.com/Rock5/5b

The device-tree for this board is better in the 6.5 (and later) kernels, therefore set the kernel to linux-yocto-dev for now (eventually this won't be needed as linux-yocto moves forward).

Unfortunately the TF-A project does not currently have support for the rk3588. Therefore, for the time-being, the only way to supply a TPL/DDR-init for the rk3588 is to use the closed-source rkbin binaries from Rockchip. If/when TF-A adds support for the rk3588 we can investigate switching.

The rk3588 comes in two variants: rk3588 and rk3588s. The "s" option is a stripped-down version of the rk3588. In the Linux kernel these two SoCs are kept separate, with the rk3588 building on the rk3588s, so we've mimicked that same behaviour here.

---
v2:
- fix the logic behind the MACHINEOVERRIDES to get the content, and ordering, correct
- improved the commit message around TF-A/rkbin
- correct Quentin's SoB line

---
  README                                        |  1 +
  conf/machine/include/rk3588.inc               |  6 ++
  conf/machine/include/rk3588s.inc              | 17 ++++
  conf/machine/rock5b.conf                      | 12 +++
  recipes-bsp/rkbin/rockchip-rkbin_git.bb       | 37 ++++++++
  recipes-bsp/u-boot/u-boot%.bbappend           |  5 ++
  recipes-kernel/linux/linux-yocto-dev.bbappend |  3 +
  .../rockchip/remove-non-rockchip-arch-arm.cfg | 85 +++++++++++++++++++
  .../rockchip/remove-non-rockchip-arch-arm.scc |  1 +
  .../remove-non-rockchip-arch-arm64.cfg        | 66 ++++++++++++++
  .../remove-non-rockchip-arch-arm64.scc        |  1 +
  11 files changed, 234 insertions(+)

create mode 100644 conf/machine/include/rk3588.inc
create mode 100644 conf/machine/include/rk3588s.inc
create mode 100644 conf/machine/rock5b.conf
create mode 100644 recipes-bsp/rkbin/rockchip-rkbin_git.bb
create mode 100644 recipes-kernel/linux/linux-yocto-dev.bbappend
create mode 100644 recipes-kernel/linux/linux-yocto-dev/rockchip-kmeta/bsp/rockchip/remove-non-rockchip-arch-arm.cfg create mode 100644 recipes-kernel/linux/linux-yocto-dev/rockchip-kmeta/bsp/rockchip/remove-non-rockchip-arch-arm.scc create mode 100644 recipes-kernel/linux/linux-yocto-dev/rockchip-kmeta/bsp/rockchip/remove-non-rockchip-arch-arm64.cfg create mode 100644 recipes-kernel/linux/linux-yocto-dev/rockchip-kmeta/bsp/rockchip/remove-non-rockchip-arch-arm64.scc

README +1 -0
index 286dafbe1020..032d9bbb6b34 100644
@@ -30,6 +30,7 @@ Status of supported boards:
  		vyasa-rk3288
  		firefly-rk3288
  		nanopi-r4s
+		rock5b
  	builds:
  		marsboard-rk3066
  		radxarock
conf/machine/include/rk3588.inc new file +6 -0
new file mode 100644
index 000000000000..34f0627dc085
@@ -0,0 +1,6 @@
+MACHINEOVERRIDES =. "rk3588:"
+
+# the rk3588s is a "stripped-down" version of the rk3588
+# in the kernel's device-tree the rk3588 builds on top of the rk3588s
+# so anything that is valid for the rk3588s is valid for the rk3588
+require conf/machine/include/rk3588s.inc
conf/machine/include/rk3588s.inc new file +4 -0
new file mode 100644
index 000000000000..65d9054e88d8
@@ -0,0 +1,17 @@
+MACHINEOVERRIDES =. "rk3588s:"
+DEFAULTTUNE ?= "cortexa76-cortexa55-crypto"
+
+require conf/machine/include/arm/armv8-2a/tune-cortexa76-cortexa55.inc
Quoted 8 lines

conf/machine/include/rk3588s.inc line 9

Quoted 5 lines
conf/machine/include/rk3588s.inc new file +5 -0
+require conf/machine/include/rockchip-defaults.inc
+require conf/machine/include/rockchip-wic.inc
+
+KBUILD_DEFCONFIG ?= "defconfig"
+KERNEL_FEATURES:append:rk3588 = " bsp/rockchip/remove-non-rockchip-arch-arm64.scc"

I believe this is supposed to be an OVERRIDES for rk3588s and not rk3588 since it applies to both (in addition of being in the rk3588s.inc file).

Great catch!

Quoted 2 lines

The rest looks fine otherwise :)

Thanks :-)

Quoted 275 lines

Thanks!

Cheers,
Quentin

Quoted 269 lines
conf/machine/include/rk3588s.inc new file +8 -0
+KERNEL_CLASSES = "kernel-fitimage"
+KERNEL_IMAGETYPE = "fitImage"
+
+PREFERRED_PROVIDER_trusted-firmware-a = "rockchip-rkbin"
+PREFERRED_PROVIDER_optee-os = "rockchip-rkbin"
+
+UBOOT_SUFFIX ?= "itb"
+UBOOT_ENTRYPOINT ?= "0x06000000"
conf/machine/rock5b.conf new file +12 -0
new file mode 100644
index 000000000000..dc31a9f3a4e4
@@ -0,0 +1,12 @@
+#@TYPE: Machine
+#@NAME: Radxa Rock5b
+#@DESCRIPTION: ROCK5 is the 5th generation of SBC designed by Radxa.
+#https://wiki.radxa.com/Rock5/5b
+
+require conf/machine/include/rk3588.inc
+
+PREFERRED_PROVIDER_virtual/kernel = "linux-yocto-dev"
+KERNEL_DEVICETREE = "rockchip/rk3588-rock-5b.dtb"
+MACHINE_EXTRA_RRECOMMENDS += "kernel-modules"
+
+UBOOT_MACHINE = "rock5b-rk3588_defconfig"
recipes-bsp/rkbin/rockchip-rkbin_git.bb new file +37 -0
new file mode 100644
index 000000000000..7fefb017053b
@@ -0,0 +1,37 @@
+DESCRIPTION = "Rockchip Firmware and Tool Binaries"
+LICENSE = "Proprietary"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=15faa4a01e7eb0f5d33f9f2bcc7bff62"
+
+SRC_URI = "git://github.com/rockchip-linux/rkbin;protocol=https;branch=master"
+SRCREV = "b4558da0860ca48bf1a571dd33ccba580b9abe23"
+
+PROVIDES += "trusted-firmware-a"
+PROVIDES += "optee-os"
+
+inherit bin_package deploy
+
+S = "${WORKDIR}/git"
+
+COMPATIBLE_MACHINE = ""
+COMPATIBLE_MACHINE:rk3588s = "rk3588s"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+do_install() {
+	# Nothing in this recipe is useful in a filesystem
+	:
+}
+
+PACKAGES = "${PN}"
+ALLOW_EMPTY:${PN} = "1"
+
+do_deploy() {
+	# Prebuilt TF-A
+	install -m 644 ${S}/bin/rk35/rk3588_bl31_v*.elf ${DEPLOYDIR}/bl31-rk3588.elf
+	# Prebuilt OPTEE-OS
+	install -m 644 ${S}/bin/rk35/rk3588_bl32_v*.bin ${DEPLOYDIR}/tee-rk3588.bin
+	# Prebuilt U-Boot TPL (DDR init)
+	install -m 644 ${S}/bin/rk35/rk3588_ddr_lp4_2112MHz_lp5_2736MHz_v*.bin ${DEPLOYDIR}/ddr-rk3588.bin
+}
+
+addtask deploy after do_install
recipes-bsp/u-boot/u-boot%.bbappend +5 -0
index db8e0166f5b3..3732c7f04373 100644
@@ -11,6 +11,11 @@ DEPENDS:append = " python3-pyelftools-native"
  ATF_DEPENDS ??= ""
+EXTRA_OEMAKE:append:rk3588s = " BL31=${DEPLOY_DIR_IMAGE}/bl31-rk3588.elf"
+ATF_DEPENDS:append:rk3588s = " trusted-firmware-a:do_deploy"
+EXTRA_OEMAKE:append:rk3588s = " ROCKCHIP_TPL=${DEPLOY_DIR_IMAGE}/ddr-rk3588.bin"
+ATF_DEPENDS:append:rk3588s = " rockchip-rkbin:do_deploy"
+
  EXTRA_OEMAKE:append:rk3399 = " BL31=${DEPLOY_DIR_IMAGE}/bl31-rk3399.elf"
  ATF_DEPENDS:rk3399 = " trusted-firmware-a:do_deploy"
  EXTRA_OEMAKE:append:rk3328 = " BL31=${DEPLOY_DIR_IMAGE}/bl31-rk3328.elf"
recipes-kernel/linux/linux-yocto-dev.bbappend new file +3 -0
new file mode 100644
index 000000000000..cda5c520c4fe
@@ -0,0 +1,3 @@
+FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
+COMPATIBLE_MACHINE:rock5b = "rock5b"
+SRC_URI:append:rock5b = " file://rockchip-kmeta;type=kmeta;name=rockchip-kmeta;destsuffix=rockchip-kmeta"
recipes-kernel/linux/linux-yocto-dev/rockchip-kmeta/bsp/rockchip/remove-non-rockchip-arch-arm.cfg new file +85 -0
new file mode 100644
index 000000000000..e9443f17895c
@@ -0,0 +1,85 @@
+CONFIG_ARCH_ACTIONS=n
+CONFIG_ARCH_AIROHA=n
+CONFIG_ARCH_ALPINE=n
+CONFIG_ARCH_ARTPEC=n
+CONFIG_ARCH_ASPEED=n
+CONFIG_ARCH_AT91=n
+CONFIG_ARCH_BCM2835=n
+CONFIG_ARCH_BCM=n
+CONFIG_ARCH_BCMBCA=n
+CONFIG_ARCH_BCMBCA_BRAHMAB15=n
+CONFIG_ARCH_BCMBCA_CORTEXA7=n
+CONFIG_ARCH_BCMBCA_CORTEXA9=n
+CONFIG_ARCH_BCM_21664=n
+CONFIG_ARCH_BCM_23550=n
+CONFIG_ARCH_BCM_281XX=n
+CONFIG_ARCH_BCM_5301X=n
+CONFIG_ARCH_BCM_53573=n
+CONFIG_ARCH_BCM_CYGNUS=n
+CONFIG_ARCH_BCM_HR2=n
+CONFIG_ARCH_BCM_NSP=n
+CONFIG_ARCH_BERLIN=n
+CONFIG_ARCH_BRCMSTB=n
+CONFIG_ARCH_DIGICOLOR=n
+CONFIG_ARCH_EMEV2=n
+CONFIG_ARCH_EXYNOS=n
+CONFIG_ARCH_HI3xxx=n
+CONFIG_ARCH_HIGHBANK=n
+CONFIG_ARCH_HIP01=n
+CONFIG_ARCH_HIP04=n
+CONFIG_ARCH_HISI=n
+CONFIG_ARCH_HIX5HD2=n
+CONFIG_ARCH_HPE=n
+CONFIG_ARCH_HPE_GXP=n
+CONFIG_ARCH_INTEL_SOCFPGA=n
+CONFIG_ARCH_KEYSTONE=n
+CONFIG_ARCH_MEDIATEK=n
+CONFIG_ARCH_MESON=n
+CONFIG_ARCH_MILBEAUT=n
+CONFIG_ARCH_MILBEAUT_M10V=n
+CONFIG_ARCH_MMP=n
+CONFIG_ARCH_MSM8916=n
+CONFIG_ARCH_MSM8960=n
+CONFIG_ARCH_MSM8974=n
+CONFIG_ARCH_MSM8X60=n
+CONFIG_ARCH_MVEBU=n
+CONFIG_ARCH_MXC=n
+CONFIG_ARCH_OMAP3=n
+CONFIG_ARCH_OMAP4=n
+CONFIG_ARCH_QCOM=n
+CONFIG_ARCH_R7S72100=n
+CONFIG_ARCH_R7S9210=n
+CONFIG_ARCH_R8A73A4=n
+CONFIG_ARCH_R8A7740=n
+CONFIG_ARCH_R8A7742=n
+CONFIG_ARCH_R8A7743=n
+CONFIG_ARCH_R8A7744=n
+CONFIG_ARCH_R8A7745=n
+CONFIG_ARCH_R8A77470=n
+CONFIG_ARCH_R8A7778=n
+CONFIG_ARCH_R8A7779=n
+CONFIG_ARCH_R8A7790=n
+CONFIG_ARCH_R8A7791=n
+CONFIG_ARCH_R8A7792=n
+CONFIG_ARCH_R8A7793=n
+CONFIG_ARCH_R8A7794=n
+CONFIG_ARCH_R9A06G032=n
+CONFIG_ARCH_RENESAS=n
+CONFIG_ARCH_SH73A0=n
+CONFIG_ARCH_SPEAR13XX=n
+CONFIG_ARCH_STI=n
+CONFIG_ARCH_STM32=n
+CONFIG_ARCH_SUNPLUS=n
+CONFIG_ARCH_SUNXI=n
+CONFIG_ARCH_TEGRA=n
+CONFIG_ARCH_TEGRA_114_SOC=n
+CONFIG_ARCH_TEGRA_124_SOC=n
+CONFIG_ARCH_TEGRA_2x_SOC=n
+CONFIG_ARCH_TEGRA_3x_SOC=n
+CONFIG_ARCH_U8500=n
+CONFIG_ARCH_UNIPHIER=n
+CONFIG_ARCH_VEXPRESS=n
+CONFIG_ARCH_VEXPRESS_TC2_PM=n
+CONFIG_ARCH_VIRT=n
+CONFIG_ARCH_WM8850=n
+CONFIG_ARCH_ZYNQ=n
recipes-kernel/linux/linux-yocto-dev/rockchip-kmeta/bsp/rockchip/remove-non-rockchip-arch-arm.scc new file +1 -0
new file mode 100644
index 000000000000..ce7770456ea4
@@ -0,0 +1 @@
+kconf hardware remove-non-rockchip-arch-arm.cfg
recipes-kernel/linux/linux-yocto-dev/rockchip-kmeta/bsp/rockchip/remove-non-rockchip-arch-arm64.cfg new file +66 -0
new file mode 100644
index 000000000000..5b804a2ca26b
@@ -0,0 +1,66 @@
+CONFIG_ARCH_ACTIONS=n
+CONFIG_ARCH_ALPINE=n
+CONFIG_ARCH_APPLE=n
+CONFIG_ARCH_BCM2835=n
+CONFIG_ARCH_BCM=n
+CONFIG_ARCH_BCMBCA=n
+CONFIG_ARCH_BCM_IPROC=n
+CONFIG_ARCH_BERLIN=n
+CONFIG_ARCH_BRCMSTB=n
+CONFIG_ARCH_EXYNOS=n
+CONFIG_ARCH_SPARX5=n
+CONFIG_ARCH_HISI=n
+CONFIG_ARCH_INTEL_SOCFPGA=n
+CONFIG_ARCH_K3=n
+CONFIG_ARCH_KEEMBAY=n
+CONFIG_ARCH_LAYERSCAPE=n
+CONFIG_ARCH_LG1K=n
+CONFIG_ARCH_MEDIATEK=n
+CONFIG_ARCH_MESON=n
+CONFIG_ARCH_MVEBU=n
+CONFIG_ARCH_MXC=n
+CONFIG_ARCH_NPCM=n
+CONFIG_ARCH_NXP=n
+CONFIG_ARCH_MA35=n
+CONFIG_ARCH_QCOM=n
+CONFIG_ARCH_REALTEK=n
+CONFIG_ARCH_R8A774A1=n
+CONFIG_ARCH_R8A774B1=n
+CONFIG_ARCH_R8A774C0=n
+CONFIG_ARCH_R8A774E1=n
+CONFIG_ARCH_R8A77951=n
+CONFIG_ARCH_R8A77960=n
+CONFIG_ARCH_R8A77961=n
+CONFIG_ARCH_R8A77965=n
+CONFIG_ARCH_R8A77970=n
+CONFIG_ARCH_R8A77980=n
+CONFIG_ARCH_R8A77990=n
+CONFIG_ARCH_R8A77995=n
+CONFIG_ARCH_R8A779A0=n
+CONFIG_ARCH_R8A779F0=n
+CONFIG_ARCH_R8A779G0=n
+CONFIG_ARCH_R9A07G043=n
+CONFIG_ARCH_R9A07G044=n
+CONFIG_ARCH_R9A07G054=n
+CONFIG_ARCH_R9A09G011=n
+CONFIG_ARCH_RENESAS=n
+CONFIG_ARCH_S32=n
+CONFIG_ARCH_SEATTLE=n
+CONFIG_ARCH_STM32=n
+CONFIG_ARCH_SPRD=n
+CONFIG_ARCH_SUNXI=n
+CONFIG_ARCH_SYNQUACER=n
+CONFIG_ARCH_TEGRA=n
+CONFIG_ARCH_TEGRA_132_SOC=n
+CONFIG_ARCH_TEGRA_186_SOC=n
+CONFIG_ARCH_TEGRA_194_SOC=n
+CONFIG_ARCH_TEGRA_210_SOC=n
+CONFIG_ARCH_TEGRA_234_SOC=n
+CONFIG_ARCH_TESLA_FSD=n
+CONFIG_ARCH_THUNDER2=n
+CONFIG_ARCH_THUNDER=n
+CONFIG_ARCH_UNIPHIER=n
+CONFIG_ARCH_VEXPRESS=n
+CONFIG_ARCH_VISCONTI=n
+CONFIG_ARCH_XGENE=n
+CONFIG_ARCH_ZYNQMP=n
recipes-kernel/linux/linux-yocto-dev/rockchip-kmeta/bsp/rockchip/remove-non-rockchip-arch-arm64.scc new file +1 -0
new file mode 100644
index 000000000000..e169240f5067
@@ -0,0 +1 @@
+kconf hardware remove-non-rockchip-arch-arm64.cfg