From patchwork Fri Aug 26 09:57:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sughosh Ganu X-Patchwork-Id: 600275 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:4388:0:0:0:0 with SMTP id w8csp309966mae; Fri, 26 Aug 2022 02:58:55 -0700 (PDT) X-Google-Smtp-Source: AA6agR7aZOAte8eYsmPUynRgfwxe7mqrJ8hVZw5OVtYFfNwUcHLK/Ba7DYK/4CMYI1aamSTklJ0r X-Received: by 2002:a17:907:1c8a:b0:6e9:2a0d:d7b7 with SMTP id nb10-20020a1709071c8a00b006e92a0dd7b7mr4722095ejc.572.1661507935018; Fri, 26 Aug 2022 02:58:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661507935; cv=none; d=google.com; s=arc-20160816; b=d4L7Io4m4gwmrdOtxJXhl8mAa/asHCL0vLbGgCB9xc9gCWbmNXvQG4/lKiX+Hinr2e PTmEwrhORPanOxuFG6PQ8+UAWU4QzPMTyCQvzJ1QtzOVzWsiy0mDFVGabAoj7JIcxG2a 1wAeBaj1xTxM08WaXc68Aq3dm4NPz1uBkgYMro5VcB2rkE4/n5YWD8x56Aq+r9SB4HEp TCiYb8OmuxsGBRyk5B8yQloxZoUQtOXoFxTYaHxOe7QjDEaljaA9Ii3y/U6+lqARQRQ2 BixUGQ5Wx/Z9v2fFRG0eICPXy9bilL141Op/NnCLY8VrChjJg+6D20COoCzK80Z9boHn 2/Lg== 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=Yr1gdLFC9qsNZD77hdPednWiPlZRv66eRqgsr2vJnRM=; b=MiEH744pUFjv8v9BfOsUkGYBVqkNOsPW17EjLFUcWh8xod2fW0jZjtXb5oV8n7Zero C5pTCtexSw6JX9hOppqGwelsYmtOjHeNrnqk+VnHi22bgu0EdSKMVh7w7RGg/TFAQ5d+ crok3v7wrP1P51lkRk2iknFbevYyMAk6tlGMIWoyAcHOx75HH2RReWu5w1FXrhrKDf/R 2f2ab65Y9Mu02Hgahq0tXyeYETlYSg5sbXEcbeG/dmHV/16A2QiLW2ib+54AA6HBHxPr n6PeKGxvxIt09SAovKNvAJvdmMAZ9xHExyor+O1+4pVXr0YTMHTnyy1Gv5Yqd7JVXDKV TO4A== 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 du19-20020a17090772d300b0073dcb2ec4d2si1200413ejc.889.2022.08.26.02.58.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Aug 2022 02:58:55 -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 2404384906; Fri, 26 Aug 2022 11:58:15 +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 04E9C848E3; Fri, 26 Aug 2022 11:58:02 +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,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 3346284939 for ; Fri, 26 Aug 2022 11:57:54 +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 9D53B1682; Fri, 26 Aug 2022 02:57:58 -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 01E7F3F93E; Fri, 26 Aug 2022 02:57:49 -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 v9 05/15] stm32mp1: dk2: Add image information for capsule updates Date: Fri, 26 Aug 2022 15:27:06 +0530 Message-Id: <20220826095716.1676150-6-sughosh.ganu@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220826095716.1676150-1-sughosh.ganu@linaro.org> References: <20220826095716.1676150-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: Ilias Apalodimas --- Changes since V8: * Use STM32MP_FIP_IMAGE_GUID for the FIP GUID value as suggested by Yann board/st/stm32mp1/stm32mp1.c | 23 +++++++++++++++++++++++ include/configs/stm32mp15_common.h | 4 ++++ 2 files changed, 27 insertions(+) diff --git a/board/st/stm32mp1/stm32mp1.c b/board/st/stm32mp1/stm32mp1.c index 9496890d16..bfec0a710d 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 */ @@ -670,6 +681,18 @@ int board_init(void) setup_led(LEDST_ON); +#if CONFIG_IS_ENABLED(EFI_HAVE_CAPSULE_SUPPORT) + if (board_is_stm32mp15x_dk2()) { + 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"; + /* + * For FWU multi bank update, the image + * index will be computed at runtime + */ + fw_images[0].image_index = 0; + } +#endif return 0; } diff --git a/include/configs/stm32mp15_common.h b/include/configs/stm32mp15_common.h index c5412ffeb3..bb19dae945 100644 --- a/include/configs/stm32mp15_common.h +++ b/include/configs/stm32mp15_common.h @@ -34,6 +34,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 /*****************************************************************************/