From patchwork Thu Jul 21 06:16:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 72527 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp263273qga; Wed, 20 Jul 2016 23:15:18 -0700 (PDT) X-Received: by 10.194.242.165 with SMTP id wr5mr5084234wjc.35.1469081718745; Wed, 20 Jul 2016 23:15:18 -0700 (PDT) Return-Path: Received: from theia.denx.de (theia.denx.de. [85.214.87.163]) by mx.google.com with ESMTP id m62si1681091wme.82.2016.07.20.23.15.18; Wed, 20 Jul 2016 23:15:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 85.214.87.163 as permitted sender) client-ip=85.214.87.163; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 85.214.87.163 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D838BA751C; Thu, 21 Jul 2016 08:15:17 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2eDMYckxkBIu; Thu, 21 Jul 2016 08:15:17 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 3A73BA750A; Thu, 21 Jul 2016 08:15:17 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C6F8AA750A for ; Thu, 21 Jul 2016 08:15:12 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8UMtJ0HtjnTI for ; Thu, 21 Jul 2016 08:15:12 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from conuserg-09.nifty.com (conuserg-09.nifty.com [210.131.2.76]) by theia.denx.de (Postfix) with ESMTPS id 1812DA74F1 for ; Thu, 21 Jul 2016 08:15:09 +0200 (CEST) Received: from beagle.diag.org (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-09.nifty.com with ESMTP id u6L6EEUM022413; Thu, 21 Jul 2016 15:14:14 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-09.nifty.com u6L6EEUM022413 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1469081654; bh=LNS/0cO9m1a/+uOIsRgDOvRxQx4Anmg8Ml05Rnds0+k=; h=From:To:Cc:Subject:Date:From; b=lLN0a8AG8YLnDqoveWuPCHOaM95Nip8oa7AvbKcKppuS3powFusT4ixuZUjGoyVkv 2tdD0uncEO/hbffgqJPPtPt61Gidp+KhvDTZzKnXArglhuvWTZzPelio3JBYcUZQft 0b7DyPvzeNO+NPkbHOYbWVdyGpycs/g974J78j0bfIuoDiMutizZFMZGZ4QAgzL/Su NZDc81tb02JKtuNCSTz5OPkXiZ+wyYOB539ycieSklTS27I8fHLciIJxQlTs+MT09n qLhbzSC2M3Gro5xPcFan8Wtqod3HT8jvm0scDdvbWP7cu7SGyIhFZnHU06/kzIuXtf 1uG4PMkBqp2CQ== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Thu, 21 Jul 2016 15:16:00 +0900 Message-Id: <1469081760-6537-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 1.9.1 Cc: Tom Rini , Michal Simek , Daniel Allred Subject: [U-Boot] [PATCH v2] image: fix IH_ARCH_... values for uImage compatibility X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 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" Commit 555f45d8f916 ("image: Convert the IH_... values to enums") accidentally changed some IH_ARCH_... values. Prior to that commit, there existed a gap between IH_ARCH_M68K and IH_ARCH_MICROBLAZE, like follows. #define IH_ARCH_SPARC64 11 /* Sparc 64 Bit */ #define IH_ARCH_M68K 12 /* M68K */ #define IH_ARCH_MICROBLAZE 14 /* MicroBlaze */ #define IH_ARCH_NIOS2 15 /* Nios-II */ The enum conversion broke the compatibility with existing uImage files. Reverting 555f45d8f916 will cause build error unfortunately, so here is a more easy fix. I dug the git history and figured out the gap was introduced by commit 1117cbf2adac ("nios: remove nios-32 arch"). So, I revived IH_ARCH_NIOS just for filling the gap. I added comments to each enum block. Once we assign a value to IH_... it is not allowed to change it. Signed-off-by: Masahiro Yamada Reviewed-by: Simon Glass --- Changes in v2: - Different way to fix the issue - Add more comments include/image.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) -- 1.9.1 _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot diff --git a/include/image.h b/include/image.h index 2a5b560..734def3 100644 --- a/include/image.h +++ b/include/image.h @@ -134,6 +134,9 @@ enum ih_category { /* * Operating System Codes + * + * The following are exposed to uImage header. + * Do not change values for backward compatibility. */ enum { IH_OS_INVALID = 0, /* Invalid OS */ @@ -167,6 +170,9 @@ enum { /* * CPU Architecture Codes (supported by Linux) + * + * The following are exposed to uImage header. + * Do not change values for backward compatibility. */ enum { IH_ARCH_INVALID = 0, /* Invalid CPU */ @@ -182,6 +188,7 @@ enum { IH_ARCH_SPARC, /* Sparc */ IH_ARCH_SPARC64, /* Sparc 64 Bit */ IH_ARCH_M68K, /* M68K */ + IH_ARCH_NIOS, /* Nios-32 */ IH_ARCH_MICROBLAZE, /* MicroBlaze */ IH_ARCH_NIOS2, /* Nios-II */ IH_ARCH_BLACKFIN, /* Blackfin */ @@ -234,6 +241,9 @@ enum { * U-Boot's command interpreter; this feature is especially * useful when you configure U-Boot to use a real shell (hush) * as command interpreter (=> Shell Scripts). + * + * The following are exposed to uImage header. + * Do not change values for backward compatibility. */ enum { @@ -273,6 +283,9 @@ enum { /* * Compression Types + * + * The following are exposed to uImage header. + * Do not change values for backward compatibility. */ enum { IH_COMP_NONE = 0, /* No Compression Used */