Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp443655pxu; Thu, 3 Dec 2020 04:24:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJwHFHml5hA6pf86A/NwiQ+Eou9VkE/Yi34ge5+OTpHsHUMqIiBMAAYWQQg7jozhzgmzC5cP X-Received: by 2002:a05:6402:44b:: with SMTP id p11mr2606780edw.164.1606998279021; Thu, 03 Dec 2020 04:24:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606998279; cv=none; d=google.com; s=arc-20160816; b=BEYcs2GQzP698yp0SRZ6JlKhw//5R89OLfueE5bFhlIUAuB/dNzmCmWs+zN15lw5TA yymXwqU5I5qkR+V+NPyngXbaNE8R9hoZLWk23aFg63ky7RuO4Y/671wjDJlMzoWC1bHN qjI/MN4AhFnLN+brhlqFV8bkAZubklRDw+Cgp/mTxaop9v/xbyEfwLPOfa28+/hhDsxa oFSFU8o2dfPz1bmEneZqFzYDeMXXkmvVmcGqDT84+OVatStFsg/dGSSgb+gPEttynU5Q nBZ5F+EQdx5uYin2qi+f3iyMY93GMCWVbUTSDpPNwfTou1y4eLYfVIxFxOQAmn5seLw2 S5dw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=dTWk1GpmRlVaN8nyAETRBq1km10Xgoi0avXM+eJ/JQc=; b=jjYWgbQSwhENLGsL6WMlpaOhC8CICJW72S4P9FKSdyTWQDQYXG+FmEd4e6DWnE4C9X aXStgmwHH+Kxsx0CneeZay7NUvkcXxe4h6W5qU+vK1GxFgcPUdmw17QAsekFDlJhqNfK sQyUmA9NeG1af58hc2Cd/ZRFgvjZnSjc2tEKBaf05dVbX1LccX2DeWtG/H5uImE0HTB+ 2zkmbRCkMnGUuAFrRaxlveOrqzB3Cs0vOwpPVlbsXWSs7mEk6N/Ktbr7TdKqsb3LAUTF 76c7s6lk0UNALhwczRBOYZwMOOsurKHTKokTRNy7UcWby2cUjQDlHtThwwE0McgLAs35 u7eQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x18si1127327ejd.193.2020.12.03.04.24.15; Thu, 03 Dec 2020 04:24:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730431AbgLCMU6 (ORCPT + 99 others); Thu, 3 Dec 2020 07:20:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48298 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728650AbgLCMU4 (ORCPT ); Thu, 3 Dec 2020 07:20:56 -0500 Received: from baptiste.telenet-ops.be (baptiste.telenet-ops.be [IPv6:2a02:1800:120:4::f00:13]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0D858C061A55 for ; Thu, 3 Dec 2020 04:19:33 -0800 (PST) Received: from ramsan.of.borg ([84.195.186.194]) by baptiste.telenet-ops.be with bizsmtp id zoKP2300H4C55Sk01oKPgz; Thu, 03 Dec 2020 13:19:30 +0100 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1kknZz-007hFp-42; Thu, 03 Dec 2020 13:19:23 +0100 Received: from geert by rox.of.borg with local (Exim 4.93) (envelope-from ) id 1kknZy-00C2tI-6K; Thu, 03 Dec 2020 13:19:22 +0100 From: Geert Uytterhoeven To: Russell King , Nicolas Pitre , Ard Biesheuvel , Marek Szyprowski , Dmitry Osipenko , Linus Walleij Cc: Arnd Bergmann , Eric Miao , =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= , Lukasz Stelmach , Stephen Boyd , Chris Brandt , linux-arm-kernel@lists.infradead.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH v10 2/3] ARM: uncompress: Add OF_DT_MAGIC macro Date: Thu, 3 Dec 2020 13:19:15 +0100 Message-Id: <20201203121916.2870975-3-geert+renesas@glider.be> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201203121916.2870975-1-geert+renesas@glider.be> References: <20201203121916.2870975-1-geert+renesas@glider.be> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The DTB magic marker is stored as a 32-bit big-endian value, and thus depends on the CPU's endianness. Add a macro to define this value in native endianness, to reduce #ifdef clutter and (future) duplication. Signed-off-by: Geert Uytterhoeven --- v10: - New. --- arch/arm/boot/compressed/head.S | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S index aabdc544c03aafdc..d9cce7238a365081 100644 --- a/arch/arm/boot/compressed/head.S +++ b/arch/arm/boot/compressed/head.S @@ -11,6 +11,12 @@ #include "efi-header.S" +#ifdef __ARMEB__ +#define OF_DT_MAGIC 0xd00dfeed +#else +#define OF_DT_MAGIC 0xedfe0dd0 +#endif + AR_CLASS( .arch armv7-a ) M_CLASS( .arch armv7-m ) @@ -335,11 +341,7 @@ restart: adr r0, LC1 */ ldr lr, [r6, #0] -#ifndef __ARMEB__ - ldr r1, =0xedfe0dd0 @ sig is 0xd00dfeed big endian -#else - ldr r1, =0xd00dfeed -#endif + ldr r1, =OF_DT_MAGIC cmp lr, r1 bne dtb_check_done @ not found -- 2.25.1