From patchwork Fri May 3 11:19:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Fritz X-Patchwork-Id: 1094822 X-Patchwork-Delegate: trini@ti.com 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=) Authentication-Results: ozlabs.org; dmarc=fail (p=quarantine dis=none) header.from=googlemail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=googlemail.com header.i=@googlemail.com header.b="p01JGuml"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 44wV7L1Hwbz9s4V for ; Fri, 3 May 2019 21:21:01 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 80F8AC21E49; Fri, 3 May 2019 11:20:45 +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=FREEMAIL_FROM, T_DKIM_INVALID 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 69C2FC21D74; Fri, 3 May 2019 11:20:31 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 86853C21C29; Fri, 3 May 2019 11:19:51 +0000 (UTC) Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) by lists.denx.de (Postfix) with ESMTPS id 31E9AC21BE5 for ; Fri, 3 May 2019 11:19:51 +0000 (UTC) Received: by mail-wm1-f66.google.com with SMTP id b10so6676451wmj.4 for ; Fri, 03 May 2019 04:19:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=message-id:subject:from:reply-to:to:cc:date:in-reply-to:references :mime-version:content-transfer-encoding; bh=7bNExupUpR4rR1ZIixc+3zSLMDXvSoN9d8NL+5LzqkI=; b=p01JGuml7f/AUwwVM6+8NVdEDq6nh/h56Q2NAxkjSZjn+WHPCBH31G07p8KrIGYfsa v0Q2y4Ig0h995XultutQp9M4VmCIxDdl5KBed9wgGAnXlk0ONlMIwch9xnSWuT+2Ghrz OAJqb5NhM9QPzgHQE17uLtJ6+EYxRpFn540jGL3UPDMc3D1H5+qoC4VlLlNtXo5ZAwvh 1pujQpbpdfSySYcNMkU7+hjbHT7tTx+VsSgsp212eLmkLxBP/IAT2guhrnnUUgVpxdFX 4IF2LeOED1SR5EdupQGxyPdCyFkUrbSOJ0BZSMEP46LgRqz5qgqWOeh5+rY5xMU+qf77 TdPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:reply-to:to:cc:date :in-reply-to:references:mime-version:content-transfer-encoding; bh=7bNExupUpR4rR1ZIixc+3zSLMDXvSoN9d8NL+5LzqkI=; b=Yxth3h5GWZR541Wp1ACRQi61DESV+3X227FdCp2MVZe2nbIQx6grp5qymZB47vySOg AP1nRzFESpHuUGe2P8Sf3xxZVxhbFQ+QxxeJMee2e5rc1Bs5v+GmkqmDSCgLid+6D/tJ PkfMkEBXxChyQaUX0JN5dBr0NBh3Pz0/tob0Yjvi+Th+A471SyHNLY0SLvh8XqFjx8O6 /ZWYYU80YYtf2SxDFYni+N0hmKiTzoZ5NzP/j9vSaI6fVWyKY1iEJLZtNeIAe4F9i8h3 2vfN5YVmqd59byGEM4zXXkkp5Re8atCa9jhwC+wOsp4sC8c6uFb88Ex2DRsfBRD1BVvn N2aA== X-Gm-Message-State: APjAAAWUD4EP3k8AznCASn9c9Izo5JzgAtg1C3aeg+ST9zmaLVY9Uygx NgJJlpkjVBdiYez0su2h0vU= X-Google-Smtp-Source: APXvYqwDPUDO0LFlHrblPLInziDq4yHHvBqpw5VeVoTI3TPb0nIwHs1J7cJ6WBhcE6szMrbJeIaSdg== X-Received: by 2002:a1c:4e0a:: with SMTP id g10mr5952128wmh.128.1556882390745; Fri, 03 May 2019 04:19:50 -0700 (PDT) Received: from [192.168.0.87] (HSI-KBW-109-192-114-146.hsi6.kabel-badenwuerttemberg.de. [109.192.114.146]) by smtp.gmail.com with ESMTPSA id k206sm3747603wmk.16.2019.05.03.04.19.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 May 2019 04:19:50 -0700 (PDT) Message-ID: <1556882389.2494.5.camel@googlemail.com> From: Christoph Fritz To: Tom Rini Date: Fri, 03 May 2019 13:19:49 +0200 In-Reply-To: <20190503111317.GR31207@bill-the-cat> References: <1556878745.2494.1.camel@googlemail.com> <20190503111317.GR31207@bill-the-cat> X-Mailer: Evolution 3.12.9-1+b1 Mime-Version: 1.0 X-Mailman-Approved-At: Fri, 03 May 2019 11:20:29 +0000 Cc: U-Boot Mailing List Subject: [U-Boot] [PATCH v2] arm: zimage: add barebox image magic number 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: , Reply-To: chf.fritz@googlemail.com Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" For chainboot configurations or test environments, this patch allows booting barebox images by using command bootz. Signed-off-by: Christoph Fritz --- Changes since v1: - s/other-bootloader/barebox/ arch/arm/lib/zimage.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/arm/lib/zimage.c b/arch/arm/lib/zimage.c index 09ab331..bc2768b 100644 --- a/arch/arm/lib/zimage.c +++ b/arch/arm/lib/zimage.c @@ -9,6 +9,7 @@ #include #define LINUX_ARM_ZIMAGE_MAGIC 0x016f2818 +#define BAREBOX_IMAGE_MAGIC 0x00786f62 struct arm_z_header { uint32_t code[9]; @@ -21,9 +22,10 @@ int bootz_setup(ulong image, ulong *start, ulong *end) { struct arm_z_header *zi = (struct arm_z_header *)image; - if (zi->zi_magic != LINUX_ARM_ZIMAGE_MAGIC) { + if (zi->zi_magic != LINUX_ARM_ZIMAGE_MAGIC && + zi->zi_magic != BAREBOX_IMAGE_MAGICE) { #ifndef CONFIG_SPL_FRAMEWORK - puts("Bad Linux ARM zImage magic!\n"); + puts("zimage: Bad magic!\n"); #endif return 1; }