Skip to contentSkip to conversation

arch/microblaze: add choice for endianness and update Makefile

PATCH New [email protected] 1 participant 1 message Sep 8, 2017 Microblaze architecture

lore
Share & tools
lore
#0 lore raw

PATCH 63/126 arch/microblaze: add choice for endianness and update Makefile

From: Babu Moger <[email protected]>
Subject: arch/microblaze: add choice for endianness and update Makefile

microblaze architectures can be configured for either little or big endian formats. Add a choice option for the user to select the correct endian format(default to big endian).

Also update the Makefile so toolchain can compile for the format it is configured for.

Cc Michal Simek <[email protected]>
Cc "James E.J. Bottomley" <[email protected]>
Cc Alexander Viro <[email protected]>
Cc David S. Miller <[email protected]>
Cc Geert Uytterhoeven <[email protected]>
Cc Greg KH <[email protected]>
Cc Helge Deller <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Jonas Bonn <[email protected]>
Cc Max Filippov <[email protected]>
Cc Michael Ellerman <[email protected]> (powerpc)
Cc Peter Zijlstra <[email protected]>
Cc Stafford Horne <[email protected]>
Cc Stefan Kristiansson <[email protected]>
Cc Yoshinori Sato <[email protected]>

---

 arch/microblaze/Kconfig  |   16 ++++++++++++++++
 arch/microblaze/Makefile |    2 ++
 2 files changed, 18 insertions(+)
arch/microblaze/Kconfig renamed from arch/microblaze/Kconfig~arch-microblaze-add-choice-for-endianness-and-update-makefile +16 -0
diff -puN arch/microblaze/Kconfig~arch-microblaze-add-choice-for-endianness-and-update-makefile arch/microblaze/Kconfig
@@ -36,6 +36,22 @@ config MICROBLAZE
 	select VIRT_TO_BUS
 	select CPU_NO_EFFICIENT_FFS
 
+# Endianness selection
+choice
+	prompt "Endianness selection"
+	default CPU_BIG_ENDIAN
+	help
+	  microblaze architectures can be configured for either little or
+	  big endian formats. Be sure to select the appropriate mode.
+
+config CPU_BIG_ENDIAN
+	bool "Big endian"
+
+config CPU_LITTLE_ENDIAN
+	bool "Little endian"
+
+endchoice
+
 config SWAP
 	def_bool n
 
arch/microblaze/Makefile renamed from arch/microblaze/Makefile~arch-microblaze-add-choice-for-endianness-and-update-makefile +2 -0
diff -puN arch/microblaze/Makefile~arch-microblaze-add-choice-for-endianness-and-update-makefile arch/microblaze/Makefile
@@ -35,6 +35,8 @@ endif
 CPUFLAGS-$(CONFIG_XILINX_MICROBLAZE0_USE_DIV) += -mno-xl-soft-div
 CPUFLAGS-$(CONFIG_XILINX_MICROBLAZE0_USE_BARREL) += -mxl-barrel-shift
 CPUFLAGS-$(CONFIG_XILINX_MICROBLAZE0_USE_PCMP_INSTR) += -mxl-pattern-compare
+CPUFLAGS-$(CONFIG_BIG_ENDIAN) += -mbig-endian
+CPUFLAGS-$(CONFIG_LITTLE_ENDIAN) += -mlittle-endian
 
 CPUFLAGS-1 += $(call cc-option,-mcpu=v$(CPU_VER))
 

_