]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
Kconfig: Unify endian support option
authorJiaxun Yang <jiaxun.yang@flygoat.com>
Wed, 17 Jul 2024 08:07:02 +0000 (16:07 +0800)
committerTom Rini <trini@konsulko.com>
Wed, 31 Jul 2024 17:18:37 +0000 (11:18 -0600)
Move SUPPORT_BIG_ENDIAN, SUPPORT_LITTLE_ENDIAN to top-level
arch Kconfig and let architectures select them as necessary.

Remove if guard for Endianness selection choice so we can
have one of SYS_BIG_ENDIAN, SYS_LITTLE_ENDIAN config symbol
defined even on single endian system.

Default endian to SYS_BIG_ENDIAN for MIPS || MICROBLAZE
and LITTLE_ENDIAN for the rest to retain old config
behaviour.

Note: PPC, SH, Xtensa are technically bi-endian, but I
checked compiled u-boot image with readelf, U-Boot currently
only support little endian for SH and Xtensa, Big Endian for
PPC.

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
arch/Kconfig
arch/mips/Kconfig
arch/mips/mach-ath79/Kconfig
arch/mips/mach-bmips/Kconfig
arch/mips/mach-jz47xx/Kconfig
arch/mips/mach-mscc/Kconfig
arch/mips/mach-pic32/Kconfig

index abd406d4884133932b3b7bc1f2e8aacc57ce4cc3..8f1f46670128e69822234792371290eae4d1d1d2 100644 (file)
@@ -8,6 +8,13 @@ config CREATE_ARCH_SYMLINK
 config HAVE_ARCH_IOREMAP
        bool
 
+config SUPPORT_BIG_ENDIAN
+       bool
+
+config SUPPORT_LITTLE_ENDIAN
+       bool
+       default y if !SUPPORT_BIG_ENDIAN
+
 config SYS_CACHE_SHIFT_4
        bool
 
@@ -59,6 +66,8 @@ config ARC
        select SUPPORT_OF_CONTROL
        select SYS_CACHE_SHIFT_7
        select TIMER
+       select SUPPORT_BIG_ENDIAN
+       select SUPPORT_LITTLE_ENDIAN
        select SYS_BIG_ENDIAN if CPU_BIG_ENDIAN
        select SYS_LITTLE_ENDIAN if !CPU_BIG_ENDIAN
 
@@ -68,6 +77,7 @@ config ARM
        select CREATE_ARCH_SYMLINK
        select HAVE_PRIVATE_LIBGCC if !ARM64
        select SUPPORT_ACPI
+       select SUPPORT_LITTLE_ENDIAN
        select SUPPORT_OF_CONTROL
 
 config M68K
@@ -77,10 +87,13 @@ config M68K
        select SYS_BOOT_GET_CMDLINE
        select SYS_BOOT_GET_KBD
        select SYS_CACHE_SHIFT_4
+       select SUPPORT_BIG_ENDIAN
        select SUPPORT_OF_CONTROL
 
 config MICROBLAZE
        bool "MicroBlaze architecture"
+       select SUPPORT_BIG_ENDIAN
+       select SUPPORT_LITTLE_ENDIAN
        select SUPPORT_OF_CONTROL
        imply CMD_TIMER
        imply SPL_REGMAP if SPL
@@ -101,12 +114,14 @@ config NIOS2
        select DM
        select DM_EVENT
        select OF_CONTROL
+       select SUPPORT_LITTLE_ENDIAN
        select SUPPORT_OF_CONTROL
        imply CMD_DM
 
 config PPC
        bool "PowerPC architecture"
        select HAVE_PRIVATE_LIBGCC
+       select SUPPORT_BIG_ENDIAN
        select SUPPORT_OF_CONTROL
        select SYS_BOOT_GET_CMDLINE
        select SYS_BOOT_GET_KBD
@@ -115,6 +130,7 @@ config RISCV
        bool "RISC-V architecture"
        select CREATE_ARCH_SYMLINK
        select SUPPORT_ACPI
+       select SUPPORT_LITTLE_ENDIAN
        select SUPPORT_OF_CONTROL
        select OF_CONTROL
        select DM
@@ -160,6 +176,8 @@ config SANDBOX
        select PCI_ENDPOINT
        select SPI
        select SUPPORT_OF_CONTROL
+       select SUPPORT_BIG_ENDIAN
+       select SUPPORT_LITTLE_ENDIAN
        select SYSRESET_CMD_POWEROFF if CMD_POWEROFF
        select SYS_CACHE_SHIFT_4
        select IRQ
@@ -224,6 +242,7 @@ config SANDBOX
 
 config SH
        bool "SuperH architecture"
+       select SUPPORT_LITTLE_ENDIAN
        select HAVE_PRIVATE_LIBGCC
        select SUPPORT_OF_CONTROL
 
@@ -231,6 +250,7 @@ config X86
        bool "x86 architecture"
        select SUPPORT_SPL
        select SUPPORT_TPL
+       select SUPPORT_LITTLE_ENDIAN
        select CREATE_ARCH_SYMLINK
        select DM
        select HAVE_ARCH_IOMAP
@@ -312,6 +332,7 @@ config X86
 config XTENSA
        bool "Xtensa architecture"
        select CREATE_ARCH_SYMLINK
+       select SUPPORT_LITTLE_ENDIAN
        select SUPPORT_OF_CONTROL
 
 endchoice
@@ -515,24 +536,21 @@ endif
 
 source "board/keymile/Kconfig"
 
-if MIPS || MICROBLAZE
-
 choice
        prompt "Endianness selection"
+       default SYS_BIG_ENDIAN if MIPS || MICROBLAZE
+       default SYS_LITTLE_ENDIAN
        help
-         Some MIPS boards can be configured for either little or big endian
+         Some boards can be configured for either little or big endian
          byte order. These modes require different U-Boot images. In general there
          is one preferred byteorder for a particular system but some systems are
          just as commonly used in the one or the other endianness.
 
 config SYS_BIG_ENDIAN
        bool "Big endian"
-       depends on (SUPPORTS_BIG_ENDIAN && MIPS) || MICROBLAZE
+       depends on SUPPORT_BIG_ENDIAN
 
 config SYS_LITTLE_ENDIAN
        bool "Little endian"
-       depends on (SUPPORTS_LITTLE_ENDIAN && MIPS) || MICROBLAZE
-
+       depends on SUPPORT_LITTLE_ENDIAN
 endchoice
-
-endif
index eb7f3ad23762e55d90134e9f88bed18be51ae8a1..38577af43d03e2888504743357ae918912691761 100644 (file)
@@ -28,14 +28,14 @@ config TARGET_MALTA
        select OF_ISA_BUS
        select PCI_MAP_SYSTEM_MEMORY
        select ROM_EXCEPTION_VECTORS
-       select SUPPORTS_BIG_ENDIAN
        select SUPPORTS_CPU_MIPS32_R1
        select SUPPORTS_CPU_MIPS32_R2
        select SUPPORTS_CPU_MIPS32_R6
        select SUPPORTS_CPU_MIPS64_R1
        select SUPPORTS_CPU_MIPS64_R2
        select SUPPORTS_CPU_MIPS64_R6
-       select SUPPORTS_LITTLE_ENDIAN
+       select SUPPORT_BIG_ENDIAN
+       select SUPPORT_LITTLE_ENDIAN
        select SWAP_IO_SPACE
        imply CMD_DM
 
@@ -86,7 +86,7 @@ config ARCH_MTMIPS
        select ROM_EXCEPTION_VECTORS
        select SUPPORTS_CPU_MIPS32_R1
        select SUPPORTS_CPU_MIPS32_R2
-       select SUPPORTS_LITTLE_ENDIAN
+       select SUPPORT_LITTLE_ENDIAN
        select SUPPORT_SPL
 
 config ARCH_JZ47XX
@@ -112,7 +112,7 @@ config ARCH_OCTEON
        select MIPS_TUNE_OCTEON3
        select MTD
        select ROM_EXCEPTION_VECTORS
-       select SUPPORTS_BIG_ENDIAN
+       select SUPPORT_BIG_ENDIAN
        select SUPPORTS_CPU_MIPS64_OCTEON
        select PHYS_64BIT
        select OF_CONTROL
@@ -138,14 +138,14 @@ config TARGET_BOSTON
        select OF_BOARD_SETUP
        select OF_CONTROL
        select ROM_EXCEPTION_VECTORS
-       select SUPPORTS_BIG_ENDIAN
        select SUPPORTS_CPU_MIPS32_R1
        select SUPPORTS_CPU_MIPS32_R2
        select SUPPORTS_CPU_MIPS32_R6
        select SUPPORTS_CPU_MIPS64_R1
        select SUPPORTS_CPU_MIPS64_R2
        select SUPPORTS_CPU_MIPS64_R6
-       select SUPPORTS_LITTLE_ENDIAN
+       select SUPPORT_BIG_ENDIAN
+       select SUPPORT_LITTLE_ENDIAN
        imply CMD_DM
 
 config TARGET_XILFPGA
@@ -159,7 +159,7 @@ config TARGET_XILFPGA
        select ROM_EXCEPTION_VECTORS
        select SUPPORTS_CPU_MIPS32_R1
        select SUPPORTS_CPU_MIPS32_R2
-       select SUPPORTS_LITTLE_ENDIAN
+       select SUPPORT_LITTLE_ENDIAN
        imply CMD_DM
        help
          This supports IMGTEC MIPSfpga platform
@@ -413,12 +413,6 @@ config MIPS_BOOT_FDT
 
 endmenu
 
-config SUPPORTS_BIG_ENDIAN
-       bool
-
-config SUPPORTS_LITTLE_ENDIAN
-       bool
-
 config SUPPORTS_CPU_MIPS32_R1
        bool
 
index cd85d1b6c31bc4cdccbac6e6d9623cd66262d06e..2fa628568aa0fcf95c303e24cda85d520fdeb40e 100644 (file)
@@ -8,7 +8,7 @@ config SOC_AR933X
        bool
        select MIPS_TUNE_24KC
        select ROM_EXCEPTION_VECTORS
-       select SUPPORTS_BIG_ENDIAN
+       select SUPPORT_BIG_ENDIAN
        select SUPPORTS_CPU_MIPS32_R1
        select SUPPORTS_CPU_MIPS32_R2
        help
@@ -17,7 +17,7 @@ config SOC_AR933X
 config SOC_AR934X
        bool
        select MIPS_TUNE_74KC
-       select SUPPORTS_BIG_ENDIAN
+       select SUPPORT_BIG_ENDIAN
        select SUPPORTS_CPU_MIPS32_R1
        select SUPPORTS_CPU_MIPS32_R2
        select USB_EHCI_IS_TDI if USB_EHCI_HCD
@@ -28,7 +28,7 @@ config SOC_QCA953X
        bool
        select MIPS_TUNE_24KC
        select ROM_EXCEPTION_VECTORS
-       select SUPPORTS_BIG_ENDIAN
+       select SUPPORT_BIG_ENDIAN
        select SUPPORTS_CPU_MIPS32_R1
        select SUPPORTS_CPU_MIPS32_R2
        help
@@ -37,7 +37,7 @@ config SOC_QCA953X
 config SOC_QCA956X
        bool
        select MIPS_TUNE_74KC
-       select SUPPORTS_BIG_ENDIAN
+       select SUPPORT_BIG_ENDIAN
        select SUPPORTS_CPU_MIPS32_R1
        select SUPPORTS_CPU_MIPS32_R2
        help
index eb9ea34c52fe3a692c494869b10757c4083aec69..b140552657ff019c74775d1b51d9e830ffea41bf 100644 (file)
@@ -23,7 +23,7 @@ config SOC_BMIPS_BCM3380
        bool "BMIPS BCM3380 family"
        select SYS_CACHE_SHIFT_4
        select MIPS_TUNE_4KC
-       select SUPPORTS_BIG_ENDIAN
+       select SUPPORT_BIG_ENDIAN
        select SUPPORTS_CPU_MIPS32_R1
        select SYSRESET_WATCHDOG
        help
@@ -33,7 +33,7 @@ config SOC_BMIPS_BCM6318
        bool "BMIPS BCM6318 family"
        select SYS_CACHE_SHIFT_4
        select MIPS_TUNE_4KC
-       select SUPPORTS_BIG_ENDIAN
+       select SUPPORT_BIG_ENDIAN
        select SUPPORTS_CPU_MIPS32_R1
        select SYSRESET_SYSCON
        help
@@ -43,7 +43,7 @@ config SOC_BMIPS_BCM6328
        bool "BMIPS BCM6328 family"
        select SYS_CACHE_SHIFT_4
        select MIPS_TUNE_4KC
-       select SUPPORTS_BIG_ENDIAN
+       select SUPPORT_BIG_ENDIAN
        select SUPPORTS_CPU_MIPS32_R1
        select SYSRESET_SYSCON
        help
@@ -53,7 +53,7 @@ config SOC_BMIPS_BCM6338
        bool "BMIPS BCM6338 family"
        select SYS_CACHE_SHIFT_4
        select MIPS_TUNE_4KC
-       select SUPPORTS_BIG_ENDIAN
+       select SUPPORT_BIG_ENDIAN
        select SUPPORTS_CPU_MIPS32_R1
        select SYSRESET_SYSCON
        help
@@ -63,7 +63,7 @@ config SOC_BMIPS_BCM6348
        bool "BMIPS BCM6348 family"
        select SYS_CACHE_SHIFT_4
        select MIPS_TUNE_4KC
-       select SUPPORTS_BIG_ENDIAN
+       select SUPPORT_BIG_ENDIAN
        select SUPPORTS_CPU_MIPS32_R1
        select SYSRESET_WATCHDOG
        help
@@ -73,7 +73,7 @@ config SOC_BMIPS_BCM6358
        bool "BMIPS BCM6358 family"
        select SYS_CACHE_SHIFT_4
        select MIPS_TUNE_4KC
-       select SUPPORTS_BIG_ENDIAN
+       select SUPPORT_BIG_ENDIAN
        select SUPPORTS_CPU_MIPS32_R1
        select SYSRESET_SYSCON
        help
@@ -83,7 +83,7 @@ config SOC_BMIPS_BCM6368
        bool "BMIPS BCM6368 family"
        select SYS_CACHE_SHIFT_4
        select MIPS_TUNE_4KC
-       select SUPPORTS_BIG_ENDIAN
+       select SUPPORT_BIG_ENDIAN
        select SUPPORTS_CPU_MIPS32_R1
        select SYSRESET_SYSCON
        help
@@ -93,7 +93,7 @@ config SOC_BMIPS_BCM6362
        bool "BMIPS BCM6362 family"
        select SYS_CACHE_SHIFT_4
        select MIPS_TUNE_4KC
-       select SUPPORTS_BIG_ENDIAN
+       select SUPPORT_BIG_ENDIAN
        select SUPPORTS_CPU_MIPS32_R1
        select SYSRESET_SYSCON
        help
@@ -103,7 +103,7 @@ config SOC_BMIPS_BCM63268
        bool "BMIPS BCM63268 family"
        select SYS_CACHE_SHIFT_4
        select MIPS_TUNE_4KC
-       select SUPPORTS_BIG_ENDIAN
+       select SUPPORT_BIG_ENDIAN
        select SUPPORTS_CPU_MIPS32_R1
        select SYSRESET_SYSCON
        help
@@ -114,7 +114,7 @@ config SOC_BMIPS_BCM6838
        bool "BMIPS BCM6838 family"
        select SYS_CACHE_SHIFT_4
        select MIPS_TUNE_4KC
-       select SUPPORTS_BIG_ENDIAN
+       select SUPPORT_BIG_ENDIAN
        select SUPPORTS_CPU_MIPS32_R1
        select SYSRESET_SYSCON
        help
index dcaac01628669a88917b60638a84c5a1667ea4bd..858173e75b4068bbeeea198309f4cf35697e1557 100644 (file)
@@ -6,7 +6,7 @@ config SYS_SOC
 
 config SOC_JZ4780
        bool
-       select SUPPORTS_LITTLE_ENDIAN
+       select SUPPORT_LITTLE_ENDIAN
        select SUPPORTS_CPU_MIPS32_R1
        select SUPPORTS_CPU_MIPS32_R2
        help
index affc4721f82ea8379f1eb43022d5a091017e52d9..367d5248a1ccee7a9577407512a9c66583d62fd4 100644 (file)
@@ -6,10 +6,10 @@ menu "MSCC VCore-III platforms"
 config SOC_VCOREIII
        select MIPS_TUNE_24KC
        select ROM_EXCEPTION_VECTORS
-       select SUPPORTS_BIG_ENDIAN
+       select SUPPORT_BIG_ENDIAN
        select SUPPORTS_CPU_MIPS32_R1
        select SUPPORTS_CPU_MIPS32_R2
-       select SUPPORTS_LITTLE_ENDIAN
+       select SUPPORT_LITTLE_ENDIAN
        bool
 
 config SYS_SOC
index 2afa972074c19cf368462869756bede0259b7559..52d2eec0a76637a37e303a9ab5a2bed5fc0721fc 100644 (file)
@@ -13,7 +13,7 @@ config SOC_PIC32MZDA
        select ROM_EXCEPTION_VECTORS
        select SUPPORTS_CPU_MIPS32_R1
        select SUPPORTS_CPU_MIPS32_R2
-       select SUPPORTS_LITTLE_ENDIAN
+       select SUPPORT_LITTLE_ENDIAN
        select SYS_MIPS_CACHE_INIT_RAM_LOAD
        help
          This supports Microchip PIC32MZ[DA] family of microcontrollers.