Commit 90340c87e5eed344f6f947661ff170c8369635db

Authored by Thomas Petazzoni
Committed by Nobuhiro Iwamatsu
1 parent 90ae53ce1a

arch/sh: allow building in big-endian mode

The SuperH architecture allows to be run in either little or big
endian mode. Some SuperH SoCs get the little vs. big endian decision
through mode pins sampled at reset, so if big endian has been choosen
by HW designers, it cannot be easily changed.

Therefore, it makes sense to allow building U-Boot for SuperH in big
endian mode. To allow this, the only change needed is to adjust the
OUTPUT_FORMAT() in the linker script.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

Showing 1 changed file with 5 additions and 0 deletions Side-by-side Diff

arch/sh/cpu/u-boot.lds
... ... @@ -9,7 +9,12 @@
9 9  
10 10 #include "config.h"
11 11  
  12 +#ifdef CONFIG_SYS_BIG_ENDIAN
  13 +OUTPUT_FORMAT("elf32-shbig-linux", "elf32-shbig-linux", "elf32-sh-linux")
  14 +#else
12 15 OUTPUT_FORMAT("elf32-sh-linux", "elf32-sh-linux", "elf32-sh-linux")
  16 +#endif
  17 +
13 18 OUTPUT_ARCH(sh)
14 19  
15 20 MEMORY