From d223c88f57898ad05b6637a946ff81b310f26cf2 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Thu, 10 Sep 2026 12:49:52 +0100 Subject: [PATCH] targets: derive ARM ISA features from CPU_TYPE arm_v6 and arm_v7 are taken from the merged kernel config, which describes the kernel and can differ from the userspace ISA: sunxi/arm926ejs inherits CONFIG_CPU_V7=y from its target config and is advertised as ARMv7 although it builds for arm926ej-s, and a promptless symbol such as CPU_V7 cannot be unset in a subtarget config in a way that survives kernel_oldconfig. Derive arm_v6, arm_v6k and arm_v7 from CPU_TYPE, the core the toolchain targets, and keep ARMv6K, which has ldrexd/strexd, apart from plain ARMv6. Signed-off-by: Daniel Golle --- include/target.mk | 18 +++++++++--------- target/Config.in | 3 +++ 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/include/target.mk b/include/target.mk index 9b692ddf42e..dbeef2761f7 100644 --- a/include/target.mk +++ b/include/target.mk @@ -238,6 +238,15 @@ ifeq ($(DUMP),1) endif ifneq ($(findstring arm,$(ARCH)),) CPU_TYPE ?= xscale + ifneq ($(filter arm1136j-s arm1136jf-s arm1156t2-s,$(CPU_TYPE)),) + FEATURES += arm_v6 + endif + ifneq ($(filter arm1176jz-s arm1176jzf-s mpcore mpcorenovfp,$(CPU_TYPE)),) + FEATURES += arm_v6k + endif + ifneq ($(filter cortex-a% generic-armv7-a marvell-pj4,$(CPU_TYPE)),) + FEATURES += arm_v7 + endif endif ifeq ($(ARCH),powerpc) CPU_CFLAGS_603e:=-mcpu=603e @@ -330,15 +339,6 @@ ifeq ($(DUMP),1) ifneq ($(CONFIG_CPU_MIPS32_R2),) FEATURES += mips16 endif - ifneq ($(CONFIG_CPU_V6),) - FEATURES += arm_v6 - endif - ifneq ($(CONFIG_CPU_V6K),) - FEATURES += arm_v6 - endif - ifneq ($(CONFIG_CPU_V7),) - FEATURES += arm_v7 - endif # remove duplicates FEATURES:=$(sort $(FEATURES)) diff --git a/target/Config.in b/target/Config.in index 293567ec7c8..734e99f10f6 100644 --- a/target/Config.in +++ b/target/Config.in @@ -152,6 +152,9 @@ config armeb config arm_v6 bool +config arm_v6k + bool + config arm_v7 bool