xtensa: define CONFIG_CPU_{BIG,LITTLE}_ENDIAN
authorMax Filippov <jcmvbkbc@gmail.com>
Mon, 29 Feb 2016 23:00:59 +0000 (02:00 +0300)
committerChris Zankel <chris@zankel.net>
Fri, 11 Mar 2016 08:53:31 +0000 (08:53 +0000)
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@gmail.com>
arch/xtensa/Makefile

index 709b5748a2d7ed44aeacf7d378cc99b4e37c0939..e54189427b315159ed00e5f7d4c2ae81d8c78773 100644 (file)
@@ -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))