From patchwork Thu Jan 26 16:04:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Safae Ouajih X-Patchwork-Id: 1732362 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=baylibre-com.20210112.gappssmtp.com header.i=@baylibre-com.20210112.gappssmtp.com header.a=rsa-sha256 header.s=20210112 header.b=ZpdkeHNJ; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4P2lwK2j8Dz23h7 for ; Fri, 27 Jan 2023 03:07:29 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4579085720; Thu, 26 Jan 2023 17:07:16 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=baylibre-com.20210112.gappssmtp.com header.i=@baylibre-com.20210112.gappssmtp.com header.b="ZpdkeHNJ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 99B5A856D5; Thu, 26 Jan 2023 17:05:29 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id A1165856BB for ; Thu, 26 Jan 2023 17:05:14 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=souajih@baylibre.com Received: by mail-wr1-x42c.google.com with SMTP id q5so2300977wrv.0 for ; Thu, 26 Jan 2023 08:05:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=AVzWkeDOXwmLhQvI6XH0MLJxMfohbmMZxQBzjjjvVnQ=; b=ZpdkeHNJcnQlGj5cJpHckRSiWJ5Glp9JwUNQqHev8db48ZGotlAlfZDcFR62M9NT9X cZtaxdp48Nacmr1aDD5cUxIrJENDN9Xx64h5il937ZHxS88LpLQ+Tar/mNJuNd4zCTvz s6ZetDVQCS4q3r+WJKI0caHWZBQJVvGdMCh3nAiIDvxDwYQ+pai2uJMge17/u4dij6Ys 3Acyitj368VpkpsOOODHYJ1CPOOj/ED1OJIgBrkAscHtxx0HhLIsgFQNWXOfLZy8cxc8 Kq/qBvnzcs4z1q/R67czsLx6B2vzzq0lSLefXL5FWWgMMbB95YvK//aMZ8HjPXlwlHEQ TGHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=AVzWkeDOXwmLhQvI6XH0MLJxMfohbmMZxQBzjjjvVnQ=; b=y4d6Km6Hn+ZoOmWMPlYXS9Bo5LfFOS/yxY6MFUfe0aYl22eT9W4NvI+HEPHKKoZizi 1izkpnwXeFqiOEPiABLBr/IGGpmykFK8X1hAHy6t0c3i5UIkb+JFkmp9MuMr6Vu3+Pzr nvW+gOhCsiNTJmXJIlupl7/faRSh2qPPSYW2fuE8XnA/W1Cquo+z/AnMjVW3skomoq7U hh9SSnMtam5J0qrcYA2PNjJddkyPwcJcb9PJtb7mtFbRElyKQ4GDymM/h8XaIXKXFnfg LM78T8oACVf0bmFO1yP4ROQkMx4tu2ZTp6hMnkH79U/FwPJ2vRMgdCceYuavgKFLzSFR 1wmA== X-Gm-Message-State: AFqh2kpqttwwD0Ab9saZv4ME3XwBsUCi/OKCIBByGFwD4mKx1jotejCU xJZdP8CV/mtsY6u1X1iltNvFrQ== X-Google-Smtp-Source: AMrXdXtjSLppkBkjbsV62q5zgwTen9XeTiZiPQqEopKu4JxLOVWRBi5usdjXrxzTRKkXNgkZFRm6Mw== X-Received: by 2002:a05:6000:12cb:b0:2bd:bf44:2427 with SMTP id l11-20020a05600012cb00b002bdbf442427mr34408452wrx.42.1674749113949; Thu, 26 Jan 2023 08:05:13 -0800 (PST) Received: from localhost.localdomain (lfbn-nic-1-295-18.w90-116.abo.wanadoo.fr. [90.116.132.18]) by smtp.gmail.com with ESMTPSA id o1-20020adfcf01000000b002bfb6b9f55bsm1721235wrj.16.2023.01.26.08.05.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Jan 2023 08:05:13 -0800 (PST) From: Safae Ouajih To: sjg@chromium.org Cc: u-boot@lists.denx.de, sean.anderson@seco.com, r.stratiienko@gmail.com, mkorpershoek@baylibre.com, glaroque@baylibre.com, khilman@baylibre.com Subject: [PATCH v2 08/17] android: boot: boot image header v3, v4 do not support recovery DTBO Date: Thu, 26 Jan 2023 17:04:57 +0100 Message-Id: <20230126160506.1026643-9-souajih@baylibre.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230126160506.1026643-1-souajih@baylibre.com> References: <20230126160506.1026643-1-souajih@baylibre.com> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean android_image_get_dtbo() is used to get recovery DTBO via abootimg cmd. This is not supported in boot image header v3 and v4. Thus, we print an error message when v1,v2 header version are not used. Signed-off-by: Safae Ouajih Reviewed-by: Simon Glass Reviewed-by: Mattijs Korpershoek --- boot/image-android.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/boot/image-android.c b/boot/image-android.c index a6e7a7abb0..d797270a32 100644 --- a/boot/image-android.c +++ b/boot/image-android.c @@ -316,8 +316,8 @@ bool android_image_get_dtbo(ulong hdr_addr, ulong *addr, u32 *size) goto exit; } - if (hdr->header_version < 1) { - printf("Error: header_version must be >= 1 to get dtbo\n"); + if (hdr->header_version != 1 && hdr->header_version != 2) { + printf("Error: header version must be >= 1 and <= 2 to get dtbo\n"); ret = false; goto exit; }