Skip to contentSkip to conversation

make rockchip kernel tweaks easier to use

PATCH Superseded Trevor Woerner 2 participants 4 messages Dec 5, 2025 Arm Rockchip

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 make rockchip kernel tweaks easier to use

If linux-yocto is used with this layer, these rockchip tweaks are available automatically. However, if the user wishes to use their own linux kernel recipe, these rockchip tweaks are cumbersome since the MACHINE definition wants to include them. Reorganize how these tweaks are provided to make them easier to work with when using custom recipes.

Nothing needs to be changed when using linux-yocto. Otherwise simply provide the following line (or something similar which has the same effect) in any custom linux kernel recipe:

require recipes-kernel/linux/linux-rockchip.inc

---
 recipes-kernel/linux/linux-rockchip.inc       | 35 ++++++++++++++++++
 .../realtek-r8169.cfg                         |  0
 .../rockchip/remove-non-rockchip-arch-arm.cfg |  0
 .../rockchip/remove-non-rockchip-arch-arm.scc |  0
 .../remove-non-rockchip-arch-arm64.cfg        |  0
 .../remove-non-rockchip-arch-arm64.scc        |  0
 recipes-kernel/linux/linux-yocto_%.bbappend   | 36 +------------------
 7 files changed, 36 insertions(+), 35 deletions(-)
 create mode 100644 recipes-kernel/linux/linux-rockchip.inc
 rename recipes-kernel/linux/{linux-yocto => linux-rockchip}/realtek-r8169.cfg (100%)
 rename recipes-kernel/linux/{linux-yocto => linux-rockchip}/rockchip-kmeta/bsp/rockchip/remove-non-rockchip-arch-arm.cfg (100%)
 rename recipes-kernel/linux/{linux-yocto => linux-rockchip}/rockchip-kmeta/bsp/rockchip/remove-non-rockchip-arch-arm.scc (100%)
 rename recipes-kernel/linux/{linux-yocto => linux-rockchip}/rockchip-kmeta/bsp/rockchip/remove-non-rockchip-arch-arm64.cfg (100%)
 rename recipes-kernel/linux/{linux-yocto => linux-rockchip}/rockchip-kmeta/bsp/rockchip/remove-non-rockchip-arch-arm64.scc (100%)
recipes-kernel/linux/linux-rockchip.inc new file +35 -0
new file mode 100644
index 000000000000..a648ecb20679
@@ -0,0 +1,35 @@
+FILESEXTRAPATHS:prepend := "${THISDIR}/linux-rockchip:"
+
+# 32-bit devices
+COMPATIBLE_MACHINE:firefly-rk3288 = "firefly-rk3288"
+COMPATIBLE_MACHINE:marsboard-rk3066 = "marsboard-rk3066"
+COMPATIBLE_MACHINE:radxarock = "radxarock"
+COMPATIBLE_MACHINE:rock2-square = "rock2-square"
+COMPATIBLE_MACHINE:tinker-board = "tinker-board"
+COMPATIBLE_MACHINE:tinker-board-s = "tinker-board-s"
+COMPATIBLE_MACHINE:vyasa-rk3288 = "vyasa-rk3288"
+
+# 64-bit devices
+COMPATIBLE_MACHINE:nanopc-t6 = "nanopc-t6"
+COMPATIBLE_MACHINE:nanopi-m4 = "nanopi-m4"
+COMPATIBLE_MACHINE:nanopi-m4-2gb = "nanopi-m4-2gb"
+COMPATIBLE_MACHINE:nanopi-m4b = "nanopi-m4b"
+COMPATIBLE_MACHINE:nanopi-r2s = "nanopi-r2s"
+COMPATIBLE_MACHINE:nanopi-r4s = "nanopi-r4s"
+COMPATIBLE_MACHINE:orangepi-3b = "orangepi-3b"
+COMPATIBLE_MACHINE:orangepi-5-plus = "orangepi-5-plus"
+COMPATIBLE_MACHINE:radxa-zero-3 = "radxa-zero-3"
+COMPATIBLE_MACHINE:roc-rk3308-cc = "roc-rk3308-cc"
+COMPATIBLE_MACHINE:roc-rk3328-cc = "roc-rk3328-cc"
+COMPATIBLE_MACHINE:rock-3a = "rock-3a"
+COMPATIBLE_MACHINE:rock-4c-plus = "rock-4c-plus"
+COMPATIBLE_MACHINE:rock-5a = "rock-5a"
+COMPATIBLE_MACHINE:rock-5b = "rock-5b"
+COMPATIBLE_MACHINE:rock-pi-4 = "rock-pi-4"
+COMPATIBLE_MACHINE:rock-pi-e = "rock-pi-e"
+COMPATIBLE_MACHINE:rock-pi-s = "rock-pi-s"
+COMPATIBLE_MACHINE:rock64 = "rock64"
+COMPATIBLE_MACHINE:soquartz = "soquartz"
+
+SRC_URI:append:rockchip = " file://rockchip-kmeta;type=kmeta;name=rockchip-kmeta;destsuffix=rockchip-kmeta"
+SRC_URI:append:nanopi-r4s = " file://realtek-r8169.cfg"
recipes-kernel/linux/linux-rockchip/realtek-r8169.cfg renamed from recipes-kernel/linux/linux-yocto/realtek-r8169.cfg +0 -0
similarity index 100%
rename from recipes-kernel/linux/linux-yocto/realtek-r8169.cfg
rename to recipes-kernel/linux/linux-rockchip/realtek-r8169.cfg
recipes-kernel/linux/linux-rockchip/rockchip-kmeta/bsp/rockchip/remove-non-rockchip-arch-arm.cfg renamed from recipes-kernel/linux/linux-yocto/rockchip-kmeta/bsp/rockchip/remove-non-rockchip-arch-arm.cfg +0 -0
similarity index 100%
rename from recipes-kernel/linux/linux-yocto/rockchip-kmeta/bsp/rockchip/remove-non-rockchip-arch-arm.cfg
rename to recipes-kernel/linux/linux-rockchip/rockchip-kmeta/bsp/rockchip/remove-non-rockchip-arch-arm.cfg
recipes-kernel/linux/linux-rockchip/rockchip-kmeta/bsp/rockchip/remove-non-rockchip-arch-arm.scc renamed from recipes-kernel/linux/linux-yocto/rockchip-kmeta/bsp/rockchip/remove-non-rockchip-arch-arm.scc +0 -0
similarity index 100%
rename from recipes-kernel/linux/linux-yocto/rockchip-kmeta/bsp/rockchip/remove-non-rockchip-arch-arm.scc
rename to recipes-kernel/linux/linux-rockchip/rockchip-kmeta/bsp/rockchip/remove-non-rockchip-arch-arm.scc
recipes-kernel/linux/linux-rockchip/rockchip-kmeta/bsp/rockchip/remove-non-rockchip-arch-arm64.cfg renamed from recipes-kernel/linux/linux-yocto/rockchip-kmeta/bsp/rockchip/remove-non-rockchip-arch-arm64.cfg +0 -0
similarity index 100%
rename from recipes-kernel/linux/linux-yocto/rockchip-kmeta/bsp/rockchip/remove-non-rockchip-arch-arm64.cfg
rename to recipes-kernel/linux/linux-rockchip/rockchip-kmeta/bsp/rockchip/remove-non-rockchip-arch-arm64.cfg
recipes-kernel/linux/linux-rockchip/rockchip-kmeta/bsp/rockchip/remove-non-rockchip-arch-arm64.scc renamed from recipes-kernel/linux/linux-yocto/rockchip-kmeta/bsp/rockchip/remove-non-rockchip-arch-arm64.scc +0 -0
similarity index 100%
rename from recipes-kernel/linux/linux-yocto/rockchip-kmeta/bsp/rockchip/remove-non-rockchip-arch-arm64.scc
rename to recipes-kernel/linux/linux-rockchip/rockchip-kmeta/bsp/rockchip/remove-non-rockchip-arch-arm64.scc
recipes-kernel/linux/linux-yocto_%.bbappend +1 -35
index 2dba3d70a3ca..34bf335d0b10 100644
@@ -1,35 +1 @@
-FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
-
-# 32-bit devices
-COMPATIBLE_MACHINE:firefly-rk3288 = "firefly-rk3288"
-COMPATIBLE_MACHINE:marsboard-rk3066 = "marsboard-rk3066"
-COMPATIBLE_MACHINE:radxarock = "radxarock"
-COMPATIBLE_MACHINE:rock2-square = "rock2-square"
-COMPATIBLE_MACHINE:tinker-board = "tinker-board"
-COMPATIBLE_MACHINE:tinker-board-s = "tinker-board-s"
-COMPATIBLE_MACHINE:vyasa-rk3288 = "vyasa-rk3288"
-
-# 64-bit devices
-COMPATIBLE_MACHINE:nanopc-t6 = "nanopc-t6"
-COMPATIBLE_MACHINE:nanopi-m4 = "nanopi-m4"
-COMPATIBLE_MACHINE:nanopi-m4-2gb = "nanopi-m4-2gb"
-COMPATIBLE_MACHINE:nanopi-m4b = "nanopi-m4b"
-COMPATIBLE_MACHINE:nanopi-r2s = "nanopi-r2s"
-COMPATIBLE_MACHINE:nanopi-r4s = "nanopi-r4s"
-COMPATIBLE_MACHINE:orangepi-3b = "orangepi-3b"
-COMPATIBLE_MACHINE:orangepi-5-plus = "orangepi-5-plus"
-COMPATIBLE_MACHINE:radxa-zero-3 = "radxa-zero-3"
-COMPATIBLE_MACHINE:roc-rk3308-cc = "roc-rk3308-cc"
-COMPATIBLE_MACHINE:roc-rk3328-cc = "roc-rk3328-cc"
-COMPATIBLE_MACHINE:rock-3a = "rock-3a"
-COMPATIBLE_MACHINE:rock-4c-plus = "rock-4c-plus"
-COMPATIBLE_MACHINE:rock-5a = "rock-5a"
-COMPATIBLE_MACHINE:rock-5b = "rock-5b"
-COMPATIBLE_MACHINE:rock-pi-4 = "rock-pi-4"
-COMPATIBLE_MACHINE:rock-pi-e = "rock-pi-e"
-COMPATIBLE_MACHINE:rock-pi-s = "rock-pi-s"
-COMPATIBLE_MACHINE:rock64 = "rock64"
-COMPATIBLE_MACHINE:soquartz = "soquartz"
-
-SRC_URI:append:rockchip = " file://rockchip-kmeta;type=kmeta;name=rockchip-kmeta;destsuffix=rockchip-kmeta"
-SRC_URI:append:nanopi-r4s = " file://realtek-r8169.cfg"
+require linux-rockchip.inc
Signature · 1 line
2.51.0.193.g4975ec3473b4
#1 lore raw

PATCH 2/2 remove-non-rockchip-arch-arm64: remove new arches

Over time more architectures are supported by the linux kernel, architectures unrelated to rockchip. Therefore remove these as well from the kernel config to help keep its size small.

---
 .../bsp/rockchip/remove-non-rockchip-arch-arm64.cfg    | 10 ++++++++++
 1 file changed, 10 insertions(+)
recipes-kernel/linux/linux-rockchip/rockchip-kmeta/bsp/rockchip/remove-non-rockchip-arch-arm64.cfg +10 -0
index 597d47a424d2..b4b657e00e85 100644
@@ -1,12 +1,17 @@
 CONFIG_ARCH_ACTIONS=n
+CONFIG_ARCH_AIROHA=n
 CONFIG_ARCH_ALPINE=n
 CONFIG_ARCH_APPLE=n
+CONFIG_ARCH_AXIADO=n
 CONFIG_ARCH_BCM2835=n
 CONFIG_ARCH_BCM=n
 CONFIG_ARCH_BCMBCA=n
 CONFIG_ARCH_BCM_IPROC=n
 CONFIG_ARCH_BERLIN=n
+CONFIG_ARCH_BITMAIN=n
+CONFIG_ARCH_BLAIZE=n
 CONFIG_ARCH_BRCMSTB=n
+CONFIG_ARCH_CIX=n
 CONFIG_ARCH_EXYNOS=n
 CONFIG_ARCH_HISI=n
 CONFIG_ARCH_INTEL_SOCFPGA=n
@@ -14,6 +19,7 @@ CONFIG_ARCH_K3=n
 CONFIG_ARCH_KEEMBAY=n
 CONFIG_ARCH_LAYERSCAPE=n
 CONFIG_ARCH_LG1K=n
+CONFIG_ARCH_MA35=n
 CONFIG_ARCH_MEDIATEK=n
 CONFIG_ARCH_MESON=n
 CONFIG_ARCH_MVEBU=n
@@ -40,10 +46,14 @@ CONFIG_ARCH_R9A07G043=n
 CONFIG_ARCH_R9A07G044=n
 CONFIG_ARCH_R9A07G054=n
 CONFIG_ARCH_R9A09G011=n
+CONFIG_ARCH_REALTEK=n
 CONFIG_ARCH_RENESAS=n
 CONFIG_ARCH_S32=n
 CONFIG_ARCH_SEATTLE=n
+CONFIG_ARCH_SOPHGO=n
+CONFIG_ARCH_SPARX5=n
 CONFIG_ARCH_SPRD=n
+CONFIG_ARCH_STM32=n
 CONFIG_ARCH_SUNXI=n
 CONFIG_ARCH_SYNQUACER=n
 CONFIG_ARCH_TEGRA=n
Signature · 1 line
2.51.0.193.g4975ec3473b4
Reviewed-by on v1 2/2
#2 lore raw

Re: [yocto-patches] [meta-rockchip][PATCH 2/2] remove-non-rockchip-arch-arm64: remove new arches

Hi Trevor,

Quoted 4 lines · Trevor Woerner via lists.yoctoproject.org

Over time more architectures are supported by the linux kernel, architectures unrelated to rockchip. Therefore remove these as well from the kernel config to help keep its size small.

Thanks!
Quentin

#3 lore raw
In reply to Trevor Woerner

Hi Trevor,

Quoted 6 lines · Trevor Woerner via lists.yoctoproject.org

If linux-yocto is used with this layer, these rockchip tweaks are available automatically. However, if the user wishes to use their own linux kernel recipe, these rockchip tweaks are cumbersome since the MACHINE definition wants to include them. Reorganize how these tweaks are provided to make them easier to work with when using custom recipes.

I don't understand the issue here, specifically the "these rockchip tweaks are cumbersome since the MACHINE definition wants to include them" part of it. Can you clarify? The change looks zero sum to me so I'm not sure what's helping here?

Quoted 6 lines

Nothing needs to be changed when using linux-yocto. Otherwise simply provide the following line (or something similar which has the same effect) in any custom linux kernel recipe:

require recipes-kernel/linux/linux-rockchip.inc

Are you sure this is a good idea? I'm not convinced having config fragments spanning multiple kernel versions is a good idea. Not a blocker though, and the patch does seem fine to me.

Cheers,
Quentin