Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D3479C636CC for ; Sun, 5 Feb 2023 23:52:09 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3C5E185BAB; Mon, 6 Feb 2023 00:51: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=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="GoEUk8GS"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 42B6085A6B; Mon, 6 Feb 2023 00:50:46 +0100 (CET) Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) (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 E2BEB85B51 for ; Mon, 6 Feb 2023 00:50:38 +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-x42e.google.com with SMTP id d14so8922362wrr.9 for ; Sun, 05 Feb 2023 15:50:38 -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=0aAqvZmii1Rknik1kFA+rv+8CRRP5VrlY9cBaSLcKK8=; b=GoEUk8GSzweX8bcjxgHpNqixZqiOzL77CtKURMNR5DuH6ki2mkhRu7gl1M4wOJKCL3 4z6PTptxDlvlzP5k+cZJ1n0LY+AYIrtnBAi6tKEdDPfWgfjumTHFqohtIgEbfnh6ZyEu 54kPkqu/wLanGCKdGBRUGQc+AIbWl4WgjJo0wYypCK4OrK9nDx4wvirER11Xf/gD+hmV Vh5e5YKVBzNauxy3ZpsD9kVZBXVJnPOIMetcuLWF2X5OC22RftE4na2UoVbjxM0oMSmR JJD0lU2IvLd1+cBbb1sFyJajOamCy3zCgcmNmyeX/3l1fC8IrPyZEUttKBo8yYlaqgxX gQiw== 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=0aAqvZmii1Rknik1kFA+rv+8CRRP5VrlY9cBaSLcKK8=; b=oxTdIYECk9uF8v5EzLMliSadR1QEiEPg43jB3XKmW5P0A8DfSFuRnPAw+2q/ZBbxmt h0DAfgJ6QYkTpig+lqNfgZyxUc5WpHO5GNV4VcCjGK18FX3ZPiGL76nETRsB7ekpHE4y SIj4JS666Aij/YKJ4R9fbe8HnlN+szh885visHv+MaCbTUxOVEsdb4PP+RzLeb8G6LTU zzSFzlMRku3aThFinMB8nJcZo6uyEkqb6FubG1LT4iu9Xot7mfYWOHTE0mJH+LsxwKly lNpV83wajUd2phl9CeSkpmM3LkEsOBYDp+fXCM/vxmMxQeMsSS7NgQo1BCORFL+BX/0O tIIQ== X-Gm-Message-State: AO0yUKWuwLr4tq0mV3uRUFGMJi2tmVZTgVenYUapJ2TSYS346nR+jSjM k5ZVug/hJ8vAksk2wsAacS5azw== X-Google-Smtp-Source: AK7set9iLWIX2Tr5yAMMdDIIpnfq9Sad0a8AQSXcUg4ZoiYxnlH7Pd1mDF9qn7ksc+GAz+5sQWJYlw== X-Received: by 2002:a5d:4f07:0:b0:2c3:dfcb:afc4 with SMTP id c7-20020a5d4f07000000b002c3dfcbafc4mr4972302wru.27.1675641038378; Sun, 05 Feb 2023 15:50:38 -0800 (PST) Received: from safae-ThinkPad-T480.. ([2a04:cec0:11ad:6643:93a:a991:f152:4df7]) by smtp.gmail.com with ESMTPSA id w2-20020a5d6802000000b002bfb1de74absm7430196wru.114.2023.02.05.15.50.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Feb 2023 15:50:38 -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 v3 08/19] android: boot: boot image header v3, v4 do not support recovery DTBO Date: Mon, 6 Feb 2023 00:50:10 +0100 Message-Id: <20230205235021.355410-9-souajih@baylibre.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230205235021.355410-1-souajih@baylibre.com> References: <20230205235021.355410-1-souajih@baylibre.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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, 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 31a5d30162..748fd212ae 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; } -- 2.34.1