sh: Explicit endian selection support.
authorPaul Mundt <lethal@linux-sh.org>
Tue, 21 Nov 2006 02:12:19 +0000 (11:12 +0900)
committerPaul Mundt <lethal@linux-sh.org>
Wed, 6 Dec 2006 01:45:38 +0000 (10:45 +0900)
Previously big endian was simply assumed if little endian was
not set, which led to some cflags ordering issues. There's not
much point to not having a big endian option, so shove one in
a choice and wire it up in the Makefile.

This lets us clean up some of the cflags ordering while we're
at it.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
arch/sh/Kconfig
arch/sh/Makefile

index b95dbb8..d62183f 100644 (file)
@@ -294,12 +294,20 @@ config CF_BASE_ADDR
 
 menu "Processor features"
 
-config CPU_LITTLE_ENDIAN
-       bool "Little Endian"
+choice
+       prompt "Endianess selection" 
+       default CPU_LITTLE_ENDIAN
        help
          Some SuperH machines can be configured for either little or big
-         endian byte order. These modes require different kernels. Say Y if
-         your machine is little endian, N if it's a big endian machine.
+         endian byte order. These modes require different kernels.
+
+config CPU_LITTLE_ENDIAN
+       bool "Little Endian"
+
+config CPU_BIG_ENDIAN
+       bool "Big Endian"
+
+endchoice
 
 config SH_FPU
        bool "FPU support"
index dc43984..6b3af5c 100644 (file)
 # for "archclean" and "archdep" for cleaning up and making dependencies for
 # this architecture
 #
-
-cflags-y                               := -mb
-cflags-$(CONFIG_CPU_LITTLE_ENDIAN)     := -ml
-
 isa-y                                  := any
 isa-$(CONFIG_SH_DSP)                   := sh
 isa-$(CONFIG_CPU_SH2)                  := sh2
@@ -38,13 +34,16 @@ isa-y                       := $(isa-y)-nofpu
 endif
 endif
 
-cflags-y       += $(call as-option,-Wa$(comma)-isa=$(isa-y),)
-
-cflags-$(CONFIG_CPU_SH2)               += -m2
-cflags-$(CONFIG_CPU_SH3)               += -m3
-cflags-$(CONFIG_CPU_SH4)               += -m4 \
+cflags-$(CONFIG_CPU_SH2)               := -m2
+cflags-$(CONFIG_CPU_SH3)               := -m3
+cflags-$(CONFIG_CPU_SH4)               := -m4 \
        $(call cc-option,-mno-implicit-fp,-m4-nofpu)
-cflags-$(CONFIG_CPU_SH4A)              += $(call cc-option,-m4a-nofpu,)
+cflags-$(CONFIG_CPU_SH4A)              := -m4a $(call cc-option,-m4a-nofpu,)
+
+cflags-$(CONFIG_CPU_BIG_ENDIAN)                += -mb
+cflags-$(CONFIG_CPU_LITTLE_ENDIAN)     += -ml
+
+cflags-y       += $(call as-option,-Wa$(comma)-isa=$(isa-y),)
 
 cflags-$(CONFIG_SH_DSP)                        += -Wa,-dsp
 cflags-$(CONFIG_SH_KGDB)               += -g