From patchwork Fri Jul 28 21:14:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 795090 X-Patchwork-Delegate: iwamatsu@nigauri.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3xK1nd4pM3z9s75 for ; Sat, 29 Jul 2017 07:14:44 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id CDAA0C2232D; Fri, 28 Jul 2017 21:14:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id AA2B1C21C39; Fri, 28 Jul 2017 21:14:35 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id AABD5C21C39; Fri, 28 Jul 2017 21:14:34 +0000 (UTC) Received: from mail.free-electrons.com (mail.free-electrons.com [62.4.15.54]) by lists.denx.de (Postfix) with ESMTP id 5A0A3C21C2F for ; Fri, 28 Jul 2017 21:14:34 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 110) id 1926521DF6; Fri, 28 Jul 2017 23:14:33 +0200 (CEST) Received: from localhost (132.230.147.77.rev.sfr.net [77.147.230.132]) by mail.free-electrons.com (Postfix) with ESMTPSA id 81C1620929; Fri, 28 Jul 2017 23:14:32 +0200 (CEST) From: Thomas Petazzoni To: u-boot@lists.denx.de, Nobuhiro Iwamatsu , Vladimir Zapolskiy Date: Fri, 28 Jul 2017 23:14:28 +0200 Message-Id: <20170728211428.7947-1-thomas.petazzoni@free-electrons.com> X-Mailer: git-send-email 2.9.4 Cc: Thomas Petazzoni Subject: [U-Boot] [PATCH] arch/sh: allow building in big-endian mode X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" 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 --- arch/sh/cpu/u-boot.lds | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/sh/cpu/u-boot.lds b/arch/sh/cpu/u-boot.lds index bbf9ff4..f185b4d 100644 --- a/arch/sh/cpu/u-boot.lds +++ b/arch/sh/cpu/u-boot.lds @@ -9,7 +9,12 @@ #include "config.h" +#ifdef CONFIG_SYS_BIG_ENDIAN +OUTPUT_FORMAT("elf32-shbig-linux", "elf32-shbig-linux", "elf32-sh-linux") +#else OUTPUT_FORMAT("elf32-sh-linux", "elf32-sh-linux", "elf32-sh-linux") +#endif + OUTPUT_ARCH(sh) MEMORY