From patchwork Thu Jun 9 12:29:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sughosh Ganu X-Patchwork-Id: 580296 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:5806:0:0:0:0 with SMTP id j6csp733659max; Thu, 9 Jun 2022 05:31:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxNdHMQ9xg5kDwBS5W/Z3Z0kw3YfG9ORkyWQzVPhgHrfG8yAOhIxwpQqyMfhPUpNycOGltp X-Received: by 2002:a05:6e02:1b04:b0:2d1:af55:eb92 with SMTP id i4-20020a056e021b0400b002d1af55eb92mr22589386ilv.227.1654777892980; Thu, 09 Jun 2022 05:31:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654777892; cv=none; d=google.com; s=arc-20160816; b=l6jay2fr1addorKz9PTNe9U2qvQ27nsJ1Pwmuqu3LnSSJfkPskBpQfpT7Gnw26+S93 rRHGqtE5Ta5nfRfjXN8ox1nHNs4Dqb1+mT2VSAymRXkx4gMMY2MDFWDDF/7dV6fKTza3 7P2PIuEggWiY1sDorYOQnPlHkntwfqzrNaO71bitHX8FHFVjACyt3enTU/JhZlKij7so WQKX6QZRfU533d6OPGmtRdmab920Vi8vmjj5KxbyuUiVartkHGPo0w0t5wTgpcnpH5K8 LQqlfgixzBFnKe/Ak3X1EzO3Lq3NhCW31bwhuhGWWDuKh7jCRYSdKQAbR6w+x/HAWdYJ Lflg== 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=u/RQ0CltTyQmDPnFSAeq6/299iMgy0XOcy06JEZ5xvc=; b=Y0JOrbLsQ8TnLJKwE+N1ZkFOX7WGLcVsPj6ZlSLMrdiI98gUOtPx3WrLuQ9Z4a4qUX VpD+0XR6EYTiIQgGUYWsSDWW+M8WN48Jrpsts4/+GU7BpH2k/2RGOglKlbuaIoyxr4mW eq686utQJThmOrIizMnlpljFd64KEbH21RTmEl5zDwPPsrMcSARK+Afn49L5lWDk32M9 fmbiYMJVj9gXnXOmKg7EY+lDYN812DA58PH4N8HPRJ8YkWkj75ELWtzTfpkoaghmOS1D TfPQchVCtaTxmX+l6DWaSq2SauKORjha0501tULFRFReTDHZ2eWqA+DCq5lYPBufp/UJ GcYQ== 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 z25-20020a05660200d900b00654b25dd831si23638562ioe.33.2022.06.09.05.31.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jun 2022 05:31:32 -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 9BD7B843E7; Thu, 9 Jun 2022 14:31:12 +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 EF58B843D0; Thu, 9 Jun 2022 14:30:57 +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 D4FDC843D6 for ; Thu, 9 Jun 2022 14:30:51 +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 5A99615BF; Thu, 9 Jun 2022 05:30:51 -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 849163F766; Thu, 9 Jun 2022 05:30:46 -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 v5 05/23] stm32mp1: dk2: Add image information for capsule updates Date: Thu, 9 Jun 2022 17:59:52 +0530 Message-Id: <20220609123010.1017463-6-sughosh.ganu@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220609123010.1017463-1-sughosh.ganu@linaro.org> References: <20220609123010.1017463-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.5 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 --- board/st/stm32mp1/stm32mp1.c | 19 +++++++++++++++++++ include/configs/stm32mp15_common.h | 4 ++++ 2 files changed, 23 insertions(+) diff --git a/board/st/stm32mp1/stm32mp1.c b/board/st/stm32mp1/stm32mp1.c index 07b1a63db7..62d98ad776 100644 --- a/board/st/stm32mp1/stm32mp1.c +++ b/board/st/stm32mp1/stm32mp1.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -92,6 +93,16 @@ DECLARE_GLOBAL_DATA_PTR; #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 */ @@ -675,6 +686,14 @@ int board_init(void) setup_led(LEDST_ON); +#if CONFIG_IS_ENABLED(EFI_HAVE_CAPSULE_SUPPORT) + if (board_is_dk2()) { + efi_guid_t image_type_guid = STM32MP1_DK2_FIP_IMAGE_GUID; + guidcpy(&fw_images[0].image_type_id, &image_type_guid); + fw_images[0].fw_name = u"STM32MP1-DK2-FIP"; + fw_images[0].image_index = 5; + } +#endif return 0; } diff --git a/include/configs/stm32mp15_common.h b/include/configs/stm32mp15_common.h index 6b40cdb017..6a1ae9788d 100644 --- a/include/configs/stm32mp15_common.h +++ b/include/configs/stm32mp15_common.h @@ -54,6 +54,10 @@ #define CONFIG_SYS_AUTOLOAD "no" #endif +#define STM32MP1_DK2_FIP_IMAGE_GUID \ + EFI_GUID(0x19d5df83, 0x11b0, 0x457b, 0xbe, 0x2c, \ + 0x75, 0x59, 0xc1, 0x31, 0x42, 0xa5) + /*****************************************************************************/ #ifdef CONFIG_DISTRO_DEFAULTS /*****************************************************************************/