diff mbox series

[meta-rockchip,v2,4/5] kernel: clean up non-rockchip arch removal

Message ID 20251221004843.31946-4-twoerner@gmail.com
State New
Headers show
Series [meta-rockchip,v2,1/5] kmeta reorganization | expand

Commit Message

Trevor Woerner Dec. 21, 2025, 12:48 a.m. UTC
Over time more architectures are supported by the linux kernel (both
32-bit and 64-bit), and others are dropped; architectures unrelated to
rockchip. Clean up these non-rockchip architectures from the kernel
config to help keep its size small.

Signed-off-by: Trevor Woerner <twoerner@gmail.com>
---
changes since v1:
- none
---
 .../bsp/rockchip/remove-non-rockchip-arch-arm.cfg     | 11 +++++++----
 .../bsp/rockchip/remove-non-rockchip-arch-arm64.cfg   |  5 +++++
 2 files changed, 12 insertions(+), 4 deletions(-)

Comments

Quentin Schulz Jan. 9, 2026, 11:25 a.m. UTC | #1
Hi Trevor,

On 12/21/25 1:48 AM, Trevor Woerner via lists.yoctoproject.org wrote:
> Over time more architectures are supported by the linux kernel (both
> 32-bit and 64-bit), and others are dropped; architectures unrelated to
> rockchip. Clean up these non-rockchip architectures from the kernel
> config to help keep its size small.
> 

How do you generate this list? I'm wondering if we cannot patch it on 
the go via a new task?

For Aarch64, I think it could be as simple as:

grep -P 'config ARCH_(?!ROCKCHIP)' arch/arm64/Kconfig.platforms | sed 
's/.* \(ARCH_\w*\)$/CONFIG_\1=n/'

which will return all config ARCH_ and menuconfig ARCH_ lines which 
don't contain ROCKCHIP, then strip the config/menuconfig part, add 
CONFIG_ in front of the symbol and add =n to unselect them.

For Aarch32, it's a bit more involved.

grep -P 'config ARCH_(?!ROCKCHIP|MULTI_.*V7)' arch/arm/Kconfig.platforms 
arch/arm/mach-*/Kconfig | sed 's/.* \(ARCH_\w*\)$/CONFIG_\1=n/'

Same logic as for Aarch64, except that we need ARCH_MULTI_V7 (and 
ARCH_MULTI_V6_V7 which is selected by ARCH_MULTI_V7) otherwise we cannot 
select ARCH_ROCKCHIP.

But then we need to add ARCH_LPC18XX=n, ARCH_MPS2=n and ARCH_ACORN=n 
from arch/arm/Kconfig if we really wanted to be pedantic.

Disclaimer: I have not tested if those command lines lead to a usable 
kernel.

What I am wondering is how you handle the multiple linux-yocto recipe 
versions? I'm assuming you're only building the latest one (the 
default), and not older versions. But considering you said some new 
architectures are added and some dropped, can we really use the same 
.cfg for all linux-yocto recipe versions?

Also, if the plan is to support other kernel recipes (e.g. 
linux-mainline) with this config fragment, we also do not know what 
kernel version those will be running.

Hence I'm wondering if we should try being smart or if it's too much 
risk in getting things wrong?

What do you think? (I do not run linux-yocto or linux-mainline on my 
devices... so these are more question for you as a maintainer in terms 
of what you're comfortable supporting and debugging :) ).

Cheers,
Quentin
diff mbox series

Patch

diff --git a/recipes-kernel/linux/linux-rockchip/rockchip-kmeta/bsp/rockchip/remove-non-rockchip-arch-arm.cfg b/recipes-kernel/linux/linux-rockchip/rockchip-kmeta/bsp/rockchip/remove-non-rockchip-arch-arm.cfg
index e9443f17895c..fdd3e6964053 100644
--- a/recipes-kernel/linux/linux-rockchip/rockchip-kmeta/bsp/rockchip/remove-non-rockchip-arch-arm.cfg
+++ b/recipes-kernel/linux/linux-rockchip/rockchip-kmeta/bsp/rockchip/remove-non-rockchip-arch-arm.cfg
@@ -38,14 +38,16 @@  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_OMAP=n
+CONFIG_ARCH_OMAP2PLUS=n
 CONFIG_ARCH_OMAP3=n
 CONFIG_ARCH_OMAP4=n
+CONFIG_SOC_OMAP5=n
+CONFIG_SOC_AM33XX=n
+CONFIG_SOC_AM43XX=n
+CONFIG_SOC_DRA7XX=n
 CONFIG_ARCH_QCOM=n
 CONFIG_ARCH_R7S72100=n
 CONFIG_ARCH_R7S9210=n
@@ -66,6 +68,7 @@  CONFIG_ARCH_R8A7794=n
 CONFIG_ARCH_R9A06G032=n
 CONFIG_ARCH_RENESAS=n
 CONFIG_ARCH_SH73A0=n
+CONFIG_PLAT_SPEAR=n
 CONFIG_ARCH_SPEAR13XX=n
 CONFIG_ARCH_STI=n
 CONFIG_ARCH_STM32=n
diff --git a/recipes-kernel/linux/linux-rockchip/rockchip-kmeta/bsp/rockchip/remove-non-rockchip-arch-arm64.cfg b/recipes-kernel/linux/linux-rockchip/rockchip-kmeta/bsp/rockchip/remove-non-rockchip-arch-arm64.cfg
index 5b804a2ca26b..12fde404d64a 100644
--- a/recipes-kernel/linux/linux-rockchip/rockchip-kmeta/bsp/rockchip/remove-non-rockchip-arch-arm64.cfg
+++ b/recipes-kernel/linux/linux-rockchip/rockchip-kmeta/bsp/rockchip/remove-non-rockchip-arch-arm64.cfg
@@ -1,12 +1,16 @@ 
 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_BLAIZE=n
 CONFIG_ARCH_BRCMSTB=n
+CONFIG_ARCH_CIX=n
 CONFIG_ARCH_EXYNOS=n
 CONFIG_ARCH_SPARX5=n
 CONFIG_ARCH_HISI=n
@@ -46,6 +50,7 @@  CONFIG_ARCH_R9A09G011=n
 CONFIG_ARCH_RENESAS=n
 CONFIG_ARCH_S32=n
 CONFIG_ARCH_SEATTLE=n
+CONFIG_ARCH_SOPHGO=n
 CONFIG_ARCH_STM32=n
 CONFIG_ARCH_SPRD=n
 CONFIG_ARCH_SUNXI=n