Skip to content

Commit 5d6f526

Browse files
committed
ARM: rework endianess selection
Choosing big-endian vs little-endian kernels in Kconfig has not worked correctly since the introduction of CONFIG_ARCH_MULTIPLATFORM a long time ago. The problems is that CONFIG_BIG_ENDIAN depends on ARCH_SUPPORTS_BIG_ENDIAN, which can set by any one platform in the config, but would actually have to be supported by all of them. This was mostly ok for ARMv6/ARMv7 builds, since these are BE8 and tend to just work aside from problems in nonportable device drivers. For ARMv4/v5 machines, CONFIG_BIG_ENDIAN and CONFIG_ARCH_MULTIPLATFORM were never set together, so this was disabled on all those machines except for IXP4xx. As IXP4xx can now become part of ARCH_MULTIPLATFORM, it seems better to formalize this logic: all ARMv4/v5 platforms get an explicit dependency on being either big-endian (ixp4xx) or little-endian (the rest). We may want to fix ixp4xx in the future to support both, but it does not work in LE mode at the moment. For the ARMv6/v7 platforms, there are two ways this could be handled a) allow both modes only for platforms selecting 'ARCH_SUPPORTS_BIG_ENDIAN' today, but only LE mode for the others, given that these were added intentionally at some point. b) allow both modes everwhere, given that it was already possible to build that way by e.g. selecting ARCH_VIRT, and that the list is not an accurate reflection of which platforms may or may not work. Out of these, I picked b) because it seemed slighly more logical to me. Signed-off-by: Arnd Bergmann <arnd@arndb.de>
1 parent a3102fa commit 5d6f526

34 files changed

Lines changed: 54 additions & 33 deletions

File tree

arch/arm/Kconfig

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,7 @@ config ARCH_MULTIPLATFORM
349349

350350
config ARCH_FOOTBRIDGE
351351
bool "FootBridge"
352+
depends on CPU_LITTLE_ENDIAN
352353
select CPU_SA110
353354
select FOOTBRIDGE
354355
select NEED_MACH_MEMORY_H
@@ -358,7 +359,7 @@ config ARCH_FOOTBRIDGE
358359

359360
config ARCH_IXP4XX
360361
bool "IXP4xx-based"
361-
select ARCH_SUPPORTS_BIG_ENDIAN
362+
depends on CPU_BIG_ENDIAN
362363
select ARM_PATCH_PHYS_VIRT
363364
select CPU_XSCALE
364365
select GPIO_IXP4XX
@@ -374,6 +375,7 @@ config ARCH_IXP4XX
374375

375376
config ARCH_PXA
376377
bool "PXA2xx/PXA3xx-based"
378+
depends on CPU_LITTLE_ENDIAN
377379
select ARCH_MTD_XIP
378380
select ARM_CPU_SUSPEND if PM
379381
select AUTO_ZRELADDR
@@ -393,6 +395,7 @@ config ARCH_PXA
393395
config ARCH_RPC
394396
bool "RiscPC"
395397
depends on !CC_IS_CLANG && GCC_VERSION < 90100 && GCC_VERSION >= 60000
398+
depends on CPU_LITTLE_ENDIAN
396399
select ARCH_ACORN
397400
select ARCH_MAY_HAVE_PC_FDC
398401
select ARCH_SPARSEMEM_ENABLE
@@ -411,6 +414,7 @@ config ARCH_RPC
411414

412415
config ARCH_SA1100
413416
bool "SA1100-based"
417+
depends on CPU_LITTLE_ENDIAN
414418
select ARCH_MTD_XIP
415419
select ARCH_SPARSEMEM_ENABLE
416420
select CLKSRC_MMIO
@@ -429,6 +433,7 @@ config ARCH_SA1100
429433

430434
config ARCH_OMAP1
431435
bool "TI OMAP1"
436+
depends on CPU_LITTLE_ENDIAN
432437
select ARCH_OMAP
433438
select CLKSRC_MMIO
434439
select GENERIC_IRQ_CHIP
@@ -505,7 +510,6 @@ config ARCH_VIRT
505510
select ARM_GIC_V3_ITS if PCI
506511
select ARM_PSCI
507512
select HAVE_ARM_ARCH_TIMER
508-
select ARCH_SUPPORTS_BIG_ENDIAN
509513

510514
config ARCH_AIROHA
511515
bool "Airoha SoC Support"

arch/arm/mach-asm9260/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
config MACH_ASM9260
33
bool "Alphascale ASM9260"
44
depends on ARCH_MULTI_V5
5+
depends on CPU_LITTLE_ENDIAN
56
select CPU_ARM926T
67
select ASM9260_TIMER
78
help

arch/arm/mach-aspeed/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# SPDX-License-Identifier: GPL-2.0-only
22
menuconfig ARCH_ASPEED
33
bool "Aspeed BMC architectures"
4-
depends on ARCH_MULTI_V5 || ARCH_MULTI_V6 || ARCH_MULTI_V7
4+
depends on (CPU_LITTLE_ENDIAN && ARCH_MULTI_V5) || ARCH_MULTI_V6 || ARCH_MULTI_V7
55
select SRAM
66
select WATCHDOG
77
select ASPEED_WATCHDOG

arch/arm/mach-at91/Kconfig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# SPDX-License-Identifier: GPL-2.0-only
22
menuconfig ARCH_AT91
33
bool "AT91/Microchip SoCs"
4-
depends on ARCH_MULTI_V4T || ARCH_MULTI_V5 || ARCH_MULTI_V7 || ARM_SINGLE_ARMV7M
4+
depends on (CPU_LITTLE_ENDIAN && (ARCH_MULTI_V4T || ARCH_MULTI_V5)) || \
5+
ARCH_MULTI_V7 || ARM_SINGLE_ARMV7M
56
select ARM_CPU_SUSPEND if PM && ARCH_MULTI_V7
67
select COMMON_CLK_AT91
78
select GPIOLIB

arch/arm/mach-clps711x/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
menuconfig ARCH_CLPS711X
33
bool "Cirrus Logic EP721x/EP731x-based"
44
depends on ARCH_MULTI_V4T
5+
depends on CPU_LITTLE_ENDIAN
56
select CLPS711X_TIMER
67
select CPU_ARM720T
78
select GPIOLIB

arch/arm/mach-davinci/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
menuconfig ARCH_DAVINCI
44
bool "TI DaVinci"
55
depends on ARCH_MULTI_V5
6+
depends on CPU_LITTLE_ENDIAN
67
select DAVINCI_TIMER
78
select ZONE_DMA
89
select PM_GENERIC_DOMAINS if PM

arch/arm/mach-ep93xx/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
menuconfig ARCH_EP93XX
33
bool "EP93xx-based"
44
depends on ARCH_MULTI_V4T
5+
depends on CPU_LITTLE_ENDIAN
56
select ARCH_SPARSEMEM_ENABLE
67
select ARM_AMBA
78
select ARM_VIC

arch/arm/mach-exynos/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
menuconfig ARCH_EXYNOS
99
bool "Samsung Exynos"
1010
depends on ARCH_MULTI_V7
11-
select ARCH_SUPPORTS_BIG_ENDIAN
1211
select ARM_AMBA
1312
select ARM_GIC
1413
select EXYNOS_IRQ_COMBINER

arch/arm/mach-gemini/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
menuconfig ARCH_GEMINI
33
bool "Cortina Systems Gemini"
44
depends on ARCH_MULTI_V4
5+
depends on CPU_LITTLE_ENDIAN
56
select ARCH_HAS_RESET_CONTROLLER
67
select ARM_AMBA
78
select ARM_APPENDED_DTB # Old Redboot bootloaders deployed

arch/arm/mach-highbank/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
config ARCH_HIGHBANK
33
bool "Calxeda ECX-1000/2000 (Highbank/Midway)"
44
depends on ARCH_MULTI_V7
5-
select ARCH_SUPPORTS_BIG_ENDIAN
65
select ARM_AMBA
76
select ARM_ERRATA_764369 if SMP
87
select ARM_ERRATA_775420

0 commit comments

Comments
 (0)