[Linux-Xtensa] [PATCH 1/5] xtensa: define CONFIG_CPU_{BIG, LITTLE}_ENDIAN

Max Filippov jcmvbkbc at gmail.com
Mon Feb 29 23:26:34 UTC 2016


Query compiler for the CPU endianness and add corresponding definition
to KBUILD_CPPFLAGS. This allows using 'native-endian' property in DTS.

Signed-off-by: Max Filippov <jcmvbkbc at gmail.com>
---
 arch/xtensa/Makefile | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/xtensa/Makefile b/arch/xtensa/Makefile
index 709b574..e541894 100644
--- a/arch/xtensa/Makefile
+++ b/arch/xtensa/Makefile
@@ -53,9 +53,11 @@ endif
 
 ifeq ($(shell echo __XTENSA_EB__ | $(CC) -E - | grep -v "\#"),1)
 CHECKFLAGS += -D__XTENSA_EB__
+KBUILD_CPPFLAGS += -DCONFIG_CPU_BIG_ENDIAN
 endif
 ifeq ($(shell echo __XTENSA_EL__ | $(CC) -E - | grep -v "\#"),1)
 CHECKFLAGS += -D__XTENSA_EL__
+KBUILD_CPPFLAGS += -DCONFIG_CPU_LITTLE_ENDIAN
 endif
 
 vardirs := $(patsubst %,arch/xtensa/variants/%/,$(variant-y))
-- 
2.1.4



More information about the linux-xtensa mailing list