From patchwork Fri Aug 30 11:40:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sughosh Ganu X-Patchwork-Id: 823979 Delivered-To: patch@linaro.org Received: by 2002:a5d:48c1:0:b0:367:895a:4699 with SMTP id p1csp730544wrs; Fri, 30 Aug 2024 04:41:15 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWgkL7gZf7jqQ+1l9VIeff6J5qXzPwoQP+H4k1jnKZxQgON1Ox11Os/OmnuSQTCH7DGt01r1w==@linaro.org X-Google-Smtp-Source: AGHT+IHvoM4KIB4w0aQXrGPtADtv2KXSqkN2zYlLLPybAd1aM8RTFvE3TQXMH/VUoigpTyhJQ95Q X-Received: by 2002:adf:f350:0:b0:368:7f8f:ca68 with SMTP id ffacd0b85a97d-3749b54d369mr5223158f8f.30.1725018075539; Fri, 30 Aug 2024 04:41:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725018075; cv=none; d=google.com; s=arc-20240605; b=Z5gMbLoo4V3mXmQw/j1HehBnHfbTLTCsY/gsVnhO9V5t6v0jRnW0Q7/cktvE+c0dmY vUIj7pSOFn2DMw/OOSDC389xYwzD4kuFafvF0Q3DKENJPOew6aKvXxyC84dNp96zDE2t DBqs6BTT1wEJivOOuwvRIjSlNQrGNPcB/WOm4Vo2+Otf0nHOHwzuZgOrDlQD7hEVIT5Y an+ijxO+AGb5SkSoOetJYKeCvz+4UOqjcb0TcXGvdoORw0dYS4CkvG4mAX8xu9nWLYOp 650yLkzv0uWyT4hAovZaLEIPCe64riVeBCGaQeOhDIak9IRM8aPjDVJFmOeGJDY2seUd wW9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from; bh=L2qMweFGBKshIrvDpGKyXbRDcoO2x0SKA0osjbaIAVs=; fh=KML96dCI2dDOPHJfp1P5tqe//NaOtRS04jCoF0Bug6A=; b=KupDLm894z8boD7bfBwdIp+y+V/kMvS6i7uQ6P0jgaZxuZo9/kZ2KBDAEweNENomVu 6dwQ24BQVuvhsVLvILJyttbuvmn6KqGyrlHvq8W2Q6OyYjorhLaEhGIpVhNO72BLN5we onu1x7X8oz5TOqPqw+3SFOLjxtzKY9JQeT1mqyHTj0a8Qjw1UQPaHRvWtXfXn9z77WLR A2v81Y0bmx+2qWoEVW45DDBhbTXAX+GmJL4yPMxdkNS7XERWIylAIiYlZuuUaET84HyF y/tKNEVC5JQzWLL1RnU1/bYQOLbef6YebPyZObAYV70tubLA1MnlbpRbGVvoj4Y/e83z NAmA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id a640c23a62f3a-a898916d963si263614566b.665.2024.08.30.04.41.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Aug 2024 04:41:15 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0251788AB2; Fri, 30 Aug 2024 13:41:14 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id CA74088A9B; Fri, 30 Aug 2024 13:41:12 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, SPF_HELO_NONE,SPF_SOFTFAIL,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by phobos.denx.de (Postfix) with ESMTP id B027D88A10 for ; Fri, 30 Aug 2024 13:41:10 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=sughosh.ganu@linaro.org Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 1D6A0339; Fri, 30 Aug 2024 04:41:36 -0700 (PDT) Received: from a079122.blr.arm.com (a079122.arm.com [10.162.17.48]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 4C8DF3F66E; Fri, 30 Aug 2024 04:41:08 -0700 (PDT) From: Sughosh Ganu To: u-boot@lists.denx.de Cc: Michal Simek , Ilias Apalodimas , Heinrich Schuchardt Subject: [PATCH 0/6] Miscellaneous FWU fixes Date: Fri, 30 Aug 2024 17:10:51 +0530 Message-Id: <20240830114057.891069-1-sughosh.ganu@linaro.org> X-Mailer: git-send-email 2.34.1 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.8 at phobos.denx.de X-Virus-Status: Clean The following set of patches are miscellaneous fixes and some hardening of the FWU update logic. Sughosh Ganu (6): fwu: v2: perform some checks before reading metadata fwu: v2: try reading both copies of metadata fwu: v1: do a version check for the metadata fwu: check all images for transitioning out of Trial State fwu: add dependency checks for selecting FWU metadata version fwu: do not allow capsule processing on exceeding Trial Counter threshold include/fwu.h | 11 ++++++ lib/fwu_updates/Kconfig | 1 + lib/fwu_updates/fwu.c | 31 +++++++++++++++- lib/fwu_updates/fwu_v1.c | 18 +++++++-- lib/fwu_updates/fwu_v2.c | 80 ++++++++++++++++++++++------------------ 5 files changed, 99 insertions(+), 42 deletions(-)