From patchwork Wed Sep 28 09:29:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sughosh Ganu X-Patchwork-Id: 610073 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp139892pvb; Wed, 28 Sep 2022 02:31:36 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6QDE1LyuVoRduxFATa+4uD6x53HXPi8Cha7si1KcIOyPIKQ6nUfk1ytyAJAErrtif9l35z X-Received: by 2002:a17:907:9619:b0:782:8016:f66f with SMTP id gb25-20020a170907961900b007828016f66fmr23723979ejc.766.1664357496025; Wed, 28 Sep 2022 02:31:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664357496; cv=none; d=google.com; s=arc-20160816; b=Tp7BsP6bs974lpC0IFGH5QOXYwWic+zgwIa6JBkPoCfoVBWhIZF4s+qTKTccrcLLyO NouAbwBtzKgsiUnFqV3+JTtYP41fr5RquIkZs0bXcI540Xh8w9yW/fzl31VnDSHNI9gm R7CJ5RDB4bKjp8ePLR/cdDDFZixuP0Av281j0Y30IEMqMjhk2mu7pvFqm6PAZa+sYFSk 173bSOy3LyXSPvP1vXaLgbWjeqmvJJrGRtItdktw4e1D06P+O2vAGoLC7q7AhkpTHbYN gBRtJ1LIqXFr6xLCzS6HbyrvEAndvCZYEIGSMbvXezDXsUmKn6E/n/92p2lbirs6NA7O Tk5g== 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=oTPjWLFAb3LbYMEFz9V0kTzdYtfp82xC7Icn+2cGIJs=; b=rodApBDZd6QzHoT/yqcDjE+Ot0dMcKJiQLnEXyJKz2ik5DpJH0ME8rT/wM6ZwJhjRM 677JhGjRQtgHMPyBKuclHztke3Z55EcqNUUEa8T8rK8IRnDlD6X4Yc3PoU8Q1wjbnPy1 DknjCGRp/vYSiAZDyBKOLdgwQXo4djaRXGCnBp1yNMcn9tnA37RGFd6+L2U1PwSz1cls WtUbG0txRWdMyl7J2dqsFKuhvABtXO1jYxVFpe5Z414fLEat9TA0iJgC3e/pzBhTpsCb l69zWHXoPIimg+wFzR5d77cYHMfNhdOQH20g90ghvZpcyPmqwMkgCR+rzMhgCRbqwuIT VguA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 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. [85.214.62.61]) by mx.google.com with ESMTPS id t2-20020a056402524200b00457c9eddd10si3715010edd.617.2022.09.28.02.31.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Sep 2022 02:31:36 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 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 AB2E184AC9; Wed, 28 Sep 2022 11:31:22 +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 E063084AD5; Wed, 28 Sep 2022 11:30:51 +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 918B584B58 for ; Wed, 28 Sep 2022 11:30:44 +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 1CF9F2103; Wed, 28 Sep 2022 02:30:50 -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 E9F9F3F792; Wed, 28 Sep 2022 02:30:39 -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 v11 05/15] stm32mp1: dk2: Add image information for capsule updates Date: Wed, 28 Sep 2022 14:59:46 +0530 Message-Id: <20220928092956.2535777-6-sughosh.ganu@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220928092956.2535777-1-sughosh.ganu@linaro.org> References: <20220928092956.2535777-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 with 1 comment: --- Changes since V10: * Use image_index value of 1 for the FIP image as it is now relevant 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 8c162b42a5..e43dab018f 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 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 /*****************************************************************************/