From patchwork Tue Oct 18 11:43:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sughosh Ganu X-Patchwork-Id: 616040 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp2570572pvb; Tue, 18 Oct 2022 04:45:53 -0700 (PDT) X-Google-Smtp-Source: AMsMyM731GWUa8hCuaNNGO+mAJNu/RNL6s/3tCU7+zQ+B37D7u+SAJbyFDDIXl9a06h5zQX2CoU2 X-Received: by 2002:a63:5958:0:b0:457:523c:57b1 with SMTP id j24-20020a635958000000b00457523c57b1mr2266181pgm.145.1666093553116; Tue, 18 Oct 2022 04:45:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666093553; cv=none; d=google.com; s=arc-20160816; b=gJXQc4gJgO7zKyFhFo3yX4SwncgOBZeFV6kl4cI1H4fsTd0VYThsHZiurSMshMPL+V xk2P4RiZnvBZYkZTkugMx3a5NfgjmS5+IlpjEK3hTt+Cze7M5iFU2hekQ3mpbfQEY321 IotxY7sJnueV/JeQe+5l7l3QWMFAuao12krfBB8aG0ztXH+B19KJOIwjqXy/sPcm2FW2 117Sl1FLUc84VXW1tI4y3MmcsGWeo/OgdnFRozF9xjh21X02iBsT0ubZC3rxz1Sav2vZ vyMJMmKjl4ahG4BozBCF6nRXGebcWvBaAlJOBrDqB9Nn9RHkzDnVH6RpYgF1g4hclbmt /VjQ== 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=58hQe6mFj8dt2tOp9wsf+JIE7TO+I1h9AZXbCVLgNKw=; b=D3U1OSrf/IRTy9/K8h+3BrXmkChYYZd/vM6k9XOVbGXaDzoy626o17xPoTa2D0WhJY JFZQpVwzc2baUNxl8Rp5JrB4yJ5m3oOSgjn8oK/xS2lScScrsYiknHcd8+R21J47o5hr O3cLcQ29zdBXxkNHY+FG4u0jl1hhGQ5ZZdH05HS7a4IE4imJBwRR0wJwxQ8SOQ0X1/bo eVndEx4gTwhuA43JY43/e/LwGqlmcdrr22D2Rt3AB6RWYVCcf7PsMpE+0l4+1+RJl6RJ TxJR65GfW69lPf1kFW8F/SsfM69nVZujNVeif1O3A7uBCZscHeiNzfBxdvdZvcGMh8Z5 tsAA== 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 g5-20020a056a0023c500b00537fe344fa8si16581195pfc.34.2022.10.18.04.45.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Oct 2022 04:45:53 -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 EABC984F90; Tue, 18 Oct 2022 13:45:37 +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 8B0B984F81; Tue, 18 Oct 2022 13:44:32 +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,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 A2E9D84F58 for ; Tue, 18 Oct 2022 13:44:21 +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 4864B113E; Tue, 18 Oct 2022 04:44:27 -0700 (PDT) Received: from a076522.blr.arm.com (a076522.blr.arm.com [10.162.16.44]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 6CFF63F7D8; Tue, 18 Oct 2022 04:44:17 -0700 (PDT) From: Sughosh Ganu To: u-boot@lists.denx.de Cc: Heinrich Schuchardt , Ilias Apalodimas , Takahiro Akashi , Patrick Delaunay , Patrice Chotard , Simon Glass , Bin Meng , Tom Rini , Etienne Carriere , Michal Simek , Jassi Brar , Sughosh Ganu Subject: [PATCH v14 05/15] stm32mp1: Add image information for capsule updates Date: Tue, 18 Oct 2022 17:13:27 +0530 Message-Id: <20221018114337.439816-6-sughosh.ganu@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221018114337.439816-1-sughosh.ganu@linaro.org> References: <20221018114337.439816-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.6 at phobos.denx.de X-Virus-Status: Clean Enabling capsule update functionality on the platform requires populating information on the images that are to be updated using the functionality. Do so for the DK2 board. Signed-off-by: Sughosh Ganu Reviewed-by: Patrick Delaunay Reviewed-by: Ilias Apalodimas Reviewed-by: Etienne Carriere --- Changes since V13: None board/st/stm32mp1/stm32mp1.c | 18 ++++++++++++++++++ include/configs/stm32mp15_common.h | 4 ++++ 2 files changed, 22 insertions(+) diff --git a/board/st/stm32mp1/stm32mp1.c b/board/st/stm32mp1/stm32mp1.c index 2d98ff41ab..98e96d9e0b 100644 --- a/board/st/stm32mp1/stm32mp1.c +++ b/board/st/stm32mp1/stm32mp1.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -87,6 +88,16 @@ #define USB_START_LOW_THRESHOLD_UV 1230000 #define USB_START_HIGH_THRESHOLD_UV 2150000 +#if CONFIG_IS_ENABLED(EFI_HAVE_CAPSULE_SUPPORT) +struct efi_fw_image fw_images[1]; + +struct efi_capsule_update_info update_info = { + .images = fw_images, +}; + +u8 num_image_type_guids = ARRAY_SIZE(fw_images); +#endif /* EFI_HAVE_CAPSULE_SUPPORT */ + int board_early_init_f(void) { /* nothing to do, only used in SPL */ @@ -666,6 +677,13 @@ int board_init(void) setup_led(LEDST_ON); +#if CONFIG_IS_ENABLED(EFI_HAVE_CAPSULE_SUPPORT) + efi_guid_t image_type_guid = STM32MP_FIP_IMAGE_GUID; + + guidcpy(&fw_images[0].image_type_id, &image_type_guid); + fw_images[0].fw_name = u"STM32MP-FIP"; + fw_images[0].image_index = 1; +#endif return 0; } diff --git a/include/configs/stm32mp15_common.h b/include/configs/stm32mp15_common.h index bd8e16bc1b..214901c557 100644 --- a/include/configs/stm32mp15_common.h +++ b/include/configs/stm32mp15_common.h @@ -32,6 +32,10 @@ #define CONFIG_SERVERIP 192.168.1.1 #endif +#define STM32MP_FIP_IMAGE_GUID \ + EFI_GUID(0x19d5df83, 0x11b0, 0x457b, 0xbe, 0x2c, \ + 0x75, 0x59, 0xc1, 0x31, 0x42, 0xa5) + /*****************************************************************************/ #ifdef CONFIG_DISTRO_DEFAULTS /*****************************************************************************/