From patchwork Thu Jan 26 16:05:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Safae Ouajih X-Patchwork-Id: 1732370 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=85.214.62.61; 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=5zYEWB2G; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (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 4P2lyg2vtGz23h7 for ; Fri, 27 Jan 2023 03:09:31 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 868C98574E; Thu, 26 Jan 2023 17:08: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="5zYEWB2G"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A3EFD856F0; Thu, 26 Jan 2023 17:05:36 +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-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) (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 956BB85705 for ; Thu, 26 Jan 2023 17:05:23 +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-x42d.google.com with SMTP id h12so2241299wrv.10 for ; Thu, 26 Jan 2023 08:05:23 -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=Mur7WXvbsh4+mSqen0wap/KajQfSg+KfFJgSOYta2Tk=; b=5zYEWB2G9ZXebkUDh4JAHwjfwMhfOyiQnd4EN8Jg4oQqtUwhLIBPNta8y5wqiDwtvL vRM0Sds5xWICd49qvoaX9xnSbFuZPTRq/r4p9X5RRCmGStN/sQZ5kDfmzNWbYr4deGLc HkPMZD5ozp4OnhIWCGVMVT63qJa+hd9yEDeWjzJAKRlDBkHclrJT7b6NDTEVnOOzj3zS sVBuE5FiAoBTE9DcLSJrErrhpn1tIH0gNDF84tdbJ9FsR8CJuXr34Fq0+cQ0BCrLkfX6 6/txqxbJ1if0l+02G9GiJR0DZOc4hPUSF5papSjZ/t8b0oOJP8heeT/NQTCPCWpwv4iR YdJA== 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=Mur7WXvbsh4+mSqen0wap/KajQfSg+KfFJgSOYta2Tk=; b=Hty+hRWI3Si/WFywAjKWiRI/Wpjept06X9YpbPjCgJGmjE5zvyFMDgBKeKOJj9EKJR PhtAnSXKYLsGKDo0nk+phSackENvZwtkvyDdC19lgKh3ac/SAN5obxXpyGNEwQT8gXaI hh856fQSA1PyN7/TwT43oJfJEuMJqff6WlQ7XfulWlJLIOheuKYCOddb4ph4/8AVBmtC bs4YlM0VgBl3WdDid36a5LuN9wMUzQOlaqAdkgoqw5BFXD6Ow3RWhOdpcIoo1iAnvGtT N3i+eQA3i1Y7kW3GJrB4mJMHSJox7Q9S3vN/Q3Y79eu5quaNaZN3UyyPN0kHSGFvZYod vAdw== X-Gm-Message-State: AO0yUKUgWTLu4GTGV15Lqx1+StVbTge6BvIruL0kudcBITIjAfNGEAj8 tLdueSXKtdZZ104XXZvoxmAfuA== X-Google-Smtp-Source: AK7set+NudCLqcUZnPJfM9CfrQK9rTgpN79ymX5w8BG3YW4c7Qtf0kWCsyNW7wGNvTkbBSttGjAOLw== X-Received: by 2002:adf:e2d1:0:b0:2bf:c741:5956 with SMTP id d17-20020adfe2d1000000b002bfc7415956mr2189288wrj.19.1674749118091; Thu, 26 Jan 2023 08:05:18 -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.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Jan 2023 08:05:17 -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 14/17] drivers: fastboot: zImage flashing is not supported for v3, v4 Date: Thu, 26 Jan 2023 17:05:03 +0100 Message-Id: <20230126160506.1026643-15-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 Print an error message when the boot image header version is greater than 2 as this is not supported for v3 and v4. Signed-off-by: Safae Ouajih --- drivers/fastboot/fb_mmc.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/fastboot/fb_mmc.c b/drivers/fastboot/fb_mmc.c index 086e5f7843..9fb2ab3820 100644 --- a/drivers/fastboot/fb_mmc.c +++ b/drivers/fastboot/fb_mmc.c @@ -370,6 +370,14 @@ static int fb_mmc_update_zimage(struct blk_desc *dev_desc, return -1; } + /* Check if boot image header version is 2 or less */ + if (hdr->header_version > 2) { + pr_err("zImage flashing supported only for boot images v2 and less\n"); + fastboot_fail("zImage flashing supported only for boot images v2 and less", + response); + return -1; + } + /* Check if boot image has second stage in it (we don't support it) */ if (hdr->second_size > 0) { pr_err("moving second stage is not supported yet\n");