From patchwork Fri Mar 22 10:57:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sughosh Ganu X-Patchwork-Id: 781846 Delivered-To: patch@linaro.org Received: by 2002:adf:cf01:0:b0:33e:7753:30bd with SMTP id o1csp1274351wrj; Fri, 22 Mar 2024 04:01:00 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWBPNSYCpHm0gwa9pTYTSaPKjasOEDLP/bENYcaw2/YUQeqkNVyfeSQ0IQqNUV9Tf9w/4/fiRsWanIRub8Xe+aO X-Google-Smtp-Source: AGHT+IFAvu/ZFZoI7s9iuZts4Lb51zELdB/mbITMM50+Fg+FJvJeMvsqW6L3degdCN1xUxfuJVkh X-Received: by 2002:adf:f947:0:b0:33d:2474:5aa with SMTP id q7-20020adff947000000b0033d247405aamr1388001wrr.40.1711105259952; Fri, 22 Mar 2024 04:00:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1711105259; cv=none; d=google.com; s=arc-20160816; b=Zkp848rNEfZRPz36BLlR/9+lpTqpLkwwQ9f863n/0I/68Mu1LTJlS2PFZ7TnWKbLEt e7RKhyQOu+CcXSDqKJ4tiEms+AL1GS7cPQmFV3853OZwMZARO8ZUlYj/fAh3WO/L/BED 8NSqrs+WX6p8GMrFVzyGDai4FlGS1t+/dmwifhaNKywAgHyPTSKnRI7C4684hJeRSd0X ckvRMQ0oErSl9ZdtDJyTrDHgAi1XP3LZ1ZYW5MluLi/+Kxf3EWtwfngKAcUIzxhnndYt r0XfFhJfpBmrrcYwsyGv9EindHghSJU5Y43rt++qcQFmhBz/EnOpClIrbf0Hm5NGoqhh 48zQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=4wJxgVUZaXs1+0mRGU8trl7EN9FDqhSCJygkzukxdMU=; fh=0OBOeNvG1YwOz62VjCAPxJsyowuZOMIwtNTktJXXBMY=; b=W54QJG8YUYYPbwbOqaZ3SaWg/GGCVnhEcOc8KDALfRp2BMlslDwbann6FoXqbQ0iDX j6za5u7JyrUncqT4es84gc2iLJNocN9LaXPdv4ZiOFXzf64TsTe5LrpYQd+a0P+fiUTx Ihb2MgpuZ9L5z7qjfDwknY72XpGKizAk5zKbIqah/r9gzXltWEQHGo9w8fsBwhyBbeC8 RqEAZ9xp82EiV+7xqRCKGBlbeXm+k3eq6A+i5gWO1+7iGjPDGf38fOS3UWsSX5UIUpDx 58LeteRaT/duX6THLA9d7JP5AozQXVSZ70rn3OG+m9XBS5AAkWDwZTvPjKDz2ERmudY4 JHlg==; 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 v23-20020adfa1d7000000b0033df3763392si857393wrv.497.2024.03.22.04.00.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Mar 2024 04:00:59 -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 4DE11881C5; Fri, 22 Mar 2024 11:59:00 +0100 (CET) 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 57C008817E; Fri, 22 Mar 2024 11:58:56 +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.2 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_SOFTFAIL 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 E62C8881F9 for ; Fri, 22 Mar 2024 11:58:53 +0100 (CET) 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 86475169C; Fri, 22 Mar 2024 03:59:27 -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 6B2433F64C; Fri, 22 Mar 2024 03:58:50 -0700 (PDT) From: Sughosh Ganu To: u-boot@lists.denx.de Cc: Heinrich Schuchardt , Ilias Apalodimas , Yann GAUTIER , Etienne Carriere , Patrick DELAUNAY - foss , Michal Simek , Masahisa Kojima , Michal Simek , Sughosh Ganu Subject: [PATCH v3 13/20] fwu: mtd: obtain image information from version agnostic structure Date: Fri, 22 Mar 2024 16:27:26 +0530 Message-Id: <20240322105733.203888-14-sughosh.ganu@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240322105733.203888-1-sughosh.ganu@linaro.org> References: <20240322105733.203888-1-sughosh.ganu@linaro.org> 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 Make changes to the functions used for generating the DFU's alt variable so that the FWU image information is obtained from the common version agnostic structure instead of reading the metadata. While here, also update the name of the field used for storing the image GUID in the FWU metadata. Signed-off-by: Sughosh Ganu --- Changes since V2: * New patch lib/fwu_updates/fwu_mtd.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/lib/fwu_updates/fwu_mtd.c b/lib/fwu_updates/fwu_mtd.c index f4e0e3107b..e8211dd5ba 100644 --- a/lib/fwu_updates/fwu_mtd.c +++ b/lib/fwu_updates/fwu_mtd.c @@ -136,7 +136,7 @@ static int gen_image_alt_info(char *buf, size_t len, /* Query a partition by image UUID */ bank = &img->img_bank_info[i]; - uuid_bin_to_str(bank->image_uuid.b, uuidbuf, UUID_STR_FORMAT_STD); + uuid_bin_to_str(bank->image_guid.b, uuidbuf, UUID_STR_FORMAT_STD); mtd_img_info = mtd_img_by_uuid(uuidbuf); if (!mtd_img_info) { @@ -163,17 +163,13 @@ static int gen_image_alt_info(char *buf, size_t len, int fwu_gen_alt_info_from_mtd(char *buf, size_t len, struct mtd_info *mtd) { - struct fwu_mdata mdata; int i, l, ret; - - ret = fwu_get_mdata(&mdata); - if (ret < 0) { - log_err("Failed to get the FWU mdata.\n"); - return ret; - } + struct fwu_data *data = fwu_get_data(); + struct fwu_image_entry *img_entry; for (i = 0; i < CONFIG_FWU_NUM_IMAGES_PER_BANK; i++) { - ret = gen_image_alt_info(buf, len, &mdata.img_entry[i], mtd); + img_entry = &data->fwu_images[i]; + ret = gen_image_alt_info(buf, len, img_entry, mtd); if (ret) break;