From patchwork Wed Jun 18 21:35:08 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Pitre X-Patchwork-Id: 32161 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yk0-f197.google.com (mail-yk0-f197.google.com [209.85.160.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6C0E7206A0 for ; Wed, 18 Jun 2014 21:35:18 +0000 (UTC) Received: by mail-yk0-f197.google.com with SMTP id 19sf3028880ykq.4 for ; Wed, 18 Jun 2014 14:35:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:date:from:to:cc:subject:in-reply-to :message-id:references:user-agent:mime-version:sender:precedence :list-id:x-original-sender:x-original-authentication-results :mailing-list:list-post:list-help:list-archive:list-unsubscribe :content-type; bh=x8QUxwFJCuDNl+C9/V3NrA2B7l3sqaZgRXdF8daJ2e4=; b=SOY+USIfyUH8JtppZ5EwRMYn68S0uVB5jY5qcwKSZ3Wm9/ioWQSclvM0AOfjp1Z2/e h4ktk1rp1Oodzr9rjj1AiCmODf3PzEL0NdEc2L0f693bmzqh8FBk4lvrKKLtMHdV1W5o c+9esCq7mXNSyZJCKA6xJ3lUKtGffSQD5rpl95xsNrByggzZBdMmmE1YVZt2qJmMS9AN nUItLy9FMtESmcDR44kxvjxJ5g82LZHe4szmpaVVCWbaLc9k5utx5oNAfbQPhd1/Tav5 ZVyuguIZZV79kXTiYBEGaOjvCGqnvBM3Qs+TXT/C+AE6G3he79rydvBT/trHsYvleBd2 jraA== X-Gm-Message-State: ALoCoQnIfEANjL1YYNMbChmUL7VG9LCPdSCjbTvA/tcQj8Q576vRwUjncPkC8FF355flAI0acHCn X-Received: by 10.236.55.69 with SMTP id j45mr325241yhc.49.1403127318233; Wed, 18 Jun 2014 14:35:18 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.109.33 with SMTP id k30ls16956qgf.15.gmail; Wed, 18 Jun 2014 14:35:18 -0700 (PDT) X-Received: by 10.220.182.5 with SMTP id ca5mr113785vcb.50.1403127318002; Wed, 18 Jun 2014 14:35:18 -0700 (PDT) Received: from mail-vc0-f176.google.com (mail-vc0-f176.google.com [209.85.220.176]) by mx.google.com with ESMTPS id yn17si1429437vdb.49.2014.06.18.14.35.17 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 18 Jun 2014 14:35:17 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.176 as permitted sender) client-ip=209.85.220.176; Received: by mail-vc0-f176.google.com with SMTP id ik5so1402860vcb.21 for ; Wed, 18 Jun 2014 14:35:17 -0700 (PDT) X-Received: by 10.58.112.65 with SMTP id io1mr110286veb.61.1403127317728; Wed, 18 Jun 2014 14:35:17 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.54.6 with SMTP id vs6csp314819vcb; Wed, 18 Jun 2014 14:35:17 -0700 (PDT) X-Received: by 10.68.135.195 with SMTP id pu3mr879507pbb.10.1403127316843; Wed, 18 Jun 2014 14:35:16 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id yj9si3483160pac.146.2014.06.18.14.35.16; Wed, 18 Jun 2014 14:35:16 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756260AbaFRVfO (ORCPT + 7 others); Wed, 18 Jun 2014 17:35:14 -0400 Received: from mail-qc0-f179.google.com ([209.85.216.179]:56425 "EHLO mail-qc0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756004AbaFRVfL (ORCPT ); Wed, 18 Jun 2014 17:35:11 -0400 Received: by mail-qc0-f179.google.com with SMTP id x3so1381322qcv.24 for ; Wed, 18 Jun 2014 14:35:10 -0700 (PDT) X-Received: by 10.140.95.105 with SMTP id h96mr1369254qge.2.1403127310801; Wed, 18 Jun 2014 14:35:10 -0700 (PDT) Received: from xanadu.home (modemcable177.143-130-66.mc.videotron.ca. [66.130.143.177]) by mx.google.com with ESMTPSA id u1sm5149779qae.29.2014.06.18.14.35.09 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 18 Jun 2014 14:35:09 -0700 (PDT) Date: Wed, 18 Jun 2014 17:35:08 -0400 (EDT) From: Nicolas Pitre To: Kevin Hilman cc: Stephen Boyd , Taras Kondratiuk , Thomas Petazzoni , Russell King , Jason Cooper , Victor Kamensky , LKML , Ben Dooks , Olof Johansson , Linaro Networking , linux-arm-kernel Subject: Re: [PATCH] ARM: zImage: ensure header in LE format for BE8 kernels In-Reply-To: Message-ID: References: <1397147232-28516-1-git-send-email-taras.kondratiuk@linaro.org> <53A1D701.8060404@codeaurora.org> <53A1D8FE.6030404@codeaurora.org> User-Agent: Alpine 2.11 (LFD 23 2013-08-11) MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: nicolas.pitre@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.176 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , On Wed, 18 Jun 2014, Kevin Hilman wrote: > On Wed, Jun 18, 2014 at 11:22 AM, Stephen Boyd wrote: > > On 06/18/14 11:21, Kevin Hilman wrote: > >> On Wed, Jun 18, 2014 at 11:14 AM, Stephen Boyd wrote: > >>> On 06/18/14 10:55, Kevin Hilman wrote: > >>>> All of that to say, with this patch applied, I need a new (and > >>>> reliable) way to determine the endianness of a kernel just by looking > >>>> at the zImage. Recommendations welcome. > >>> Assuming that you have the .config configured to be built into the > >>> kernel you could use extract-ikconfig > >>> > >>> $ ./scripts/extract-ikconfig zImage | grep CONFIG_CPU_ENDIAN_BE8 > >> Unfortunately, I can't rely on having that built in since I want the > >> boot tools to be as generic as possible. > >> > >> > > > > Yeah ok. Perhaps you can look for the 'setend be' instruction right > > after the magic values instead. > > Yeah, that works, as long as I can always assume that instruction will > be at the same offset (currently at 0x30). Well... then you also have to test for the Thumb2 variant. And that forces this instruction to always be there. If we're to "officialize" this, I'd much prefer we add another magic value like this: > > Kevin > -- > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.tux.org/lkml/ > --- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ diff --git a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S index c95feab6ce..413fd94b53 100644 --- a/arch/arm/boot/compressed/head.S +++ b/arch/arm/boot/compressed/head.S @@ -128,6 +128,7 @@ start: .word _magic_sig @ Magic numbers to help the loader .word _magic_start @ absolute load/run zImage address .word _magic_end @ zImage end address + .word 0x04030201 @ endianness flag THUMB( .thumb ) 1: