From patchwork Wed Oct 9 17:34:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Atish Patra X-Patchwork-Id: 1173926 X-Patchwork-Delegate: uboot@andestech.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=none dis=none) header.from=wdc.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=wdc.com header.i=@wdc.com header.b="OMxZ9APu"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 46pLvl0klnz9sDQ for ; Thu, 10 Oct 2019 04:35:14 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id A5DEFC21C6A; Wed, 9 Oct 2019 17:35:09 +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=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 36FC9C21C2C; Wed, 9 Oct 2019 17:35:08 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 05476C21C2C; Wed, 9 Oct 2019 17:35:06 +0000 (UTC) Received: from esa2.hgst.iphmx.com (esa2.hgst.iphmx.com [68.232.143.124]) by lists.denx.de (Postfix) with ESMTPS id 005BAC21BE5 for ; Wed, 9 Oct 2019 17:35:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1570642564; x=1602178564; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=B1LQOpRVDdRZyCHL6HIw4nbQvQtECz2jlaGxBZvOjuI=; b=OMxZ9APu7kVlxq67oLvhYQsfj14eIMnBTmmbXAxgmRtP72symYNnrA2m si50PsWTxlzNCiR7/iAfxQPCdInM68/tcqEUpaSbDq9u9yRalyEWX0uva aw/HF9YhZTFzt24O83u7vvtpL7VJQSGYiVpYH7FgGTuAmVY0lYrTeJOEV zsEAqzUibrzankAKGSZV6l5oyDA99OCrCpevNWFu+IXfXs3NiIgIuQ5io eyykSn+k+RY+Y6/xz/3tHmhFCqj7gxXGQ9GqiFsxUL84ydJzPLJ75+LR1 zuxAMAUAlp1z+rOVFk2QAcy7Q2Q9NgZAGC1D4suE0A55zzDf/s8dzyH3B g==; IronPort-SDR: OSq8LxefXAxfWtyhZyFEcGfYbPGdOz7/n3AHN46TuaKrZQLpqlT8Dk68IWfbodr/pLTaJJWSEn dtWc3hf9WdRO4oLl2GuqBlzRnJO2qIWVa290nJ+YhX0BmD6/LpaYSs4uAPCYksrs4VsToimyyP thF9eBQZIJoJs0XUByhXEDvRuyxppCfnitHLsX+rt3EojlYk9okOSRw/wU61C0FWdz2l9Fwhtu vDz/AZeCG62sUY7z1rARijf9N2Im+15U+VIv4mOjisBu+0pUz+x+mhlceeWG6YU3p2imRisvyr PsY= X-IronPort-AV: E=Sophos;i="5.67,277,1566835200"; d="scan'208";a="221149821" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 10 Oct 2019 01:36:00 +0800 IronPort-SDR: BV9uQSqDzG38hRn2QNc2pH3vd94GrSQwxTEQCb913cvYvfyZkG12xMf71taGXn0Avy7pIoYI/m zAmQWgdmvCd/MC9/cQwPw94ek7CcK6fenLVPZNSSjAIoUPvtbiYJhDtrymt7BOAP/zNBiXuMb/ mMn4v9yAFODBgXsz06ExnjvqN1tfSfc20BFigUJ19Q7r8edB2RihmT7cBKWdfh2mPM2GADNS9h z96P14g1TPvJ+SNcnYK98/XxyRddiG0BSKVJAEU/lhB5wLVOY0qAf5/EjI4O/YIpWhCk+dSNJ5 nlcFVs9E2XDmo+p7ZSxPOL0M Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Oct 2019 10:30:56 -0700 IronPort-SDR: U2H2vb/5Yx24+vGf3lJBcMSGEXhzZcpe/ywfusXmTyI2Ju0cqAuSdF29KMe2gZ4IDLZILDPfx6 JTV7Gg5TBr4flnUtNtWWQsG7VkXPyK+4c/x2dlPOTY3H8O7uE3SnifrHp93V3av54eMvd6XV7h ave+6+ZuAVhemNWIUDs/OOJZxZ+41+N/N0w2Oo3S4iznps34m5axEpX1Xz1LOL6SMwTI03XtMV N3i0G9KTbwBTKH+gAT94ZLGlkPubievspTsGtWb1Lj6nA0IF60Owu9eztj6r9y2Jxi8mBSSzTE HGs= WDCIronportException: Internal Received: from jedi-01.sdcorp.global.sandisk.com (HELO jedi-01.int.fusionio.com) ([10.11.143.218]) by uls-op-cesaip01.wdc.com with ESMTP; 09 Oct 2019 10:35:03 -0700 From: Atish Patra To: u-boot@lists.denx.de Date: Wed, 9 Oct 2019 10:34:17 -0700 Message-Id: <20191009173417.26178-1-atish.patra@wdc.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Cc: David Abdurachmanov Subject: [U-Boot] [U-Boot PATCH v2] RISC-V: Align boot image header with Linux 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: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" The released Linux boot image header in v5.3 is different from the one present in U-Boot. Align the header with the new version. The changes in Linux are backward compatible. Previous U-Boot releases with older header will continue to work as well. As v5.3 kernel is the first one to support image header, there is no compatibility issue between new U-Boot (with this patch) and older kernel. Signed-off-by: Atish Patra Reviewed-by: Rick Chen --- arch/riscv/lib/image.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/arch/riscv/lib/image.c b/arch/riscv/lib/image.c index d063beb7dfbe..7357d3b07d6c 100644 --- a/arch/riscv/lib/image.c +++ b/arch/riscv/lib/image.c @@ -14,20 +14,21 @@ DECLARE_GLOBAL_DATA_PTR; -/* ASCII version of "RISCV" defined in Linux kernel */ -#define LINUX_RISCV_IMAGE_MAGIC 0x5643534952 +/* ASCII version of "RSC\0x5" defined in Linux kernel */ +#define LINUX_RISCV_IMAGE_MAGIC 0x05435352 struct linux_image_h { uint32_t code0; /* Executable code */ uint32_t code1; /* Executable code */ uint64_t text_offset; /* Image load offset */ uint64_t image_size; /* Effective Image size */ - uint64_t res1; /* reserved */ + uint64_t flags; /* kernel flags (little endian) */ + uint32_t version; /* version of the header */ + uint32_t res1; /* reserved */ uint64_t res2; /* reserved */ uint64_t res3; /* reserved */ - uint64_t magic; /* Magic number */ + uint32_t magic; /* Magic number */ uint32_t res4; /* reserved */ - uint32_t res5; /* reserved */ }; int booti_setup(ulong image, ulong *relocated_addr, ulong *size,