@@ -4,6 +4,22 @@ menu "MicroBlaze architecture"
config SYS_ARCH
default "microblaze"
+# Endianness selection
+choice
+ prompt "Endianness selection"
+ default SYS_LITTLE_ENDIAN
+ help
+ Microblaze architectures can be configured for either little or
+ big endian formats. Be sure to select the appropriate mode.
+
+config SYS_BIG_ENDIAN
+ bool "Big endian"
+
+config SYS_LITTLE_ENDIAN
+ bool "Little endian"
+
+endchoice
+
choice
prompt "Target select"
optional
@@ -16,3 +16,9 @@ LDFLAGS_FINAL += --gc-sections
ifeq ($(CONFIG_SPL_BUILD),)
PLATFORM_CPPFLAGS += -fPIC
endif
+
+ifeq ($(CONFIG_SYS_LITTLE_ENDIAN),y)
+PLATFORM_ELFFLAGS += -B microblaze $(OBJCOPYFLAGS) -O elf32-microblazeel
+else
+PLATFORM_ELFFLAGS += -B microblaze $(OBJCOPYFLAGS) -O elf32-microblaze
+endif
@@ -18,6 +18,7 @@ CONFIG_XILINX_MICROBLAZE0_USE_DIV=1
CONFIG_XILINX_MICROBLAZE0_USE_HW_MUL=2
CONFIG_DEBUG_UART=y
CONFIG_DISTRO_DEFAULTS=y
+CONFIG_REMAKE_ELF=y
CONFIG_FIT=y
CONFIG_FIT_VERBOSE=y
CONFIG_BOOTDELAY=-1
Enable u-boot.elf recreation from u-boot.bin to prepare for removing manul relocation. Enable option for big endian configuration but it is not used too much that's why it is completely untested. By supporting this system there is a need to define LITTLE/BIG endian Kconfig options to pass -EL/-EB flags. Full command line for u-boot.elf recreation looks like this: microblazeel-xilinx-linux-gnu-objcopy -I binary -B microblaze \ -O elf32-microblazeel u-boot.bin u-boot-elf.o Signed-off-by: Michal Simek <michal.simek@amd.com> --- There are two Kconfig warnings and don't know how to fix it now. arch/mips/Kconfig:192:warning: choice value used outside its choice group arch/mips/Kconfig:196:warning: choice value used outside its choice group --- arch/microblaze/Kconfig | 16 ++++++++++++++++ arch/microblaze/config.mk | 6 ++++++ configs/microblaze-generic_defconfig | 1 + 3 files changed, 23 insertions(+)