From patchwork Thu Jun 8 15:09:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick DELAUNAY X-Patchwork-Id: 1792354 X-Patchwork-Delegate: patrice.chotard@st.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=foss.st.com header.i=@foss.st.com header.a=rsa-sha256 header.s=selector1 header.b=2NZnOh+Z; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4QcSML0P2sz20QH for ; Fri, 9 Jun 2023 01:10:38 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id DBA18860F2; Thu, 8 Jun 2023 17:10:17 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=foss.st.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=foss.st.com header.i=@foss.st.com header.b="2NZnOh+Z"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5E059860CB; Thu, 8 Jun 2023 17:10:11 +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=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mx07-00178001.pphosted.com (mx08-00178001.pphosted.com [91.207.212.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 03FC6860BC for ; Thu, 8 Jun 2023 17:10:05 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=foss.st.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=prvs=45235c3c9f=patrick.delaunay@foss.st.com Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 358EA8HJ029843; Thu, 8 Jun 2023 17:10:04 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=selector1; bh=WrSkoo5FchRFoswYGuG5dOQycmL07P67jUPeXtn9zV4=; b=2NZnOh+Z7wJkldY2fcdYyeGo4pAuZOlaRcUsYhZ6VybFvgeO2h3b8Fjup+9pceNfnm6n OtMlQmf/pJSMU0Kxba86jo9GafRESCJthqrgTN3cASfwdkAQ2RYy4Dmc+RjbQ2I55sUX 51k5XgqZ8Epdj44s3dKgvyBraaRGBZRArzid57UdPMDSZVThg4pYCo2Q2wi5758Kd3Rx FY9RutA0JwDeWa2QlBcTTsT5MLhctkO09uJVE+acJK6oHbAjVlxmdpj7DydV7F7KahjG 5OSy/rB88ge7TrRfcQLF8FZk4k2D/l9trbMg/fcxp+LPPPVrsFTm+Ouuyq9B5Jk+G0PO +w== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 3r3ggygcny-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 08 Jun 2023 17:10:04 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 9003610003E; Thu, 8 Jun 2023 17:10:03 +0200 (CEST) Received: from Webmail-eu.st.com (shfdag1node3.st.com [10.75.129.71]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 8995D237D92; Thu, 8 Jun 2023 17:10:03 +0200 (CEST) Received: from localhost (10.48.1.0) by SHFDAG1NODE3.st.com (10.75.129.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Thu, 8 Jun 2023 17:10:03 +0200 From: Patrick Delaunay To: CC: Patrick Delaunay , Patrice Chotard , Simon Glass , U-Boot STM32 Subject: [PATCH 1/3] stm32mp: stm32prog: Add support of ENV partition type Date: Thu, 8 Jun 2023 17:09:54 +0200 Message-ID: <20230608170941.1.I0c3b7963b669b6c03e5a3bdf7e9e736e767aafd1@changeid> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Originating-IP: [10.48.1.0] X-ClientProxiedBy: SHFCAS1NODE1.st.com (10.75.129.72) To SHFDAG1NODE3.st.com (10.75.129.71) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.176.26 definitions=2023-06-08_11,2023-06-08_01,2023-05-22_02 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 Add support of "ENV" partition type in flashlayout to select the "u-boot-env" GUID, with PARTITION_U_BOOT_ENVIRONMENT = 3de21764-95bd-54bd-a5c3-4abe786f38a8, that mean a partition holding a U-Boot environment introduced by commit c0364ce1c695 ("doc/README.gpt: define partition type GUID for U-Boot environment")' Signed-off-by: Patrick Delaunay Reviewed-by: Patrice Chotard --- arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c | 5 +++++ arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h | 1 + 2 files changed, 6 insertions(+) diff --git a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c index 6f3641ccf57b..1bd86b5187da 100644 --- a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c +++ b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c @@ -430,6 +430,8 @@ static int parse_type(struct stm32prog_data *data, } } else if (!strcmp(p, "FIP")) { part->part_type = PART_FIP; + } else if (!strcmp(p, "ENV")) { + part->part_type = PART_ENV; } else if (!strcmp(p, "System")) { part->part_type = PART_SYSTEM; } else if (!strcmp(p, "FileSystem")) { @@ -1130,6 +1132,9 @@ static int create_gpt_partitions(struct stm32prog_data *data) case PART_BINARY: type_str = LINUX_RESERVED_UUID; break; + case PART_ENV: + type_str = "u-boot-env"; + break; case PART_FIP: type_str = FIP_TYPE_UUID; break; diff --git a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h index 58f4b96fa752..4c2c1314d990 100644 --- a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h +++ b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h @@ -100,6 +100,7 @@ struct stm32_header_v2 { enum stm32prog_part_type { PART_BINARY, PART_FIP, + PART_ENV, PART_SYSTEM, PART_FILESYSTEM, RAW_IMAGE, From patchwork Thu Jun 8 15:09:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick DELAUNAY X-Patchwork-Id: 1792353 X-Patchwork-Delegate: patrice.chotard@st.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=foss.st.com header.i=@foss.st.com header.a=rsa-sha256 header.s=selector1 header.b=wJCFfrLL; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4QcSM869ftz20QH for ; Fri, 9 Jun 2023 01:10:27 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E5218860CF; Thu, 8 Jun 2023 17:10:13 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=foss.st.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=foss.st.com header.i=@foss.st.com header.b="wJCFfrLL"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 12C0E860F2; Thu, 8 Jun 2023 17:10:10 +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=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mx07-00178001.pphosted.com (mx08-00178001.pphosted.com [91.207.212.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 040DE860CB for ; Thu, 8 Jun 2023 17:10:05 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=foss.st.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=prvs=45235c3c9f=patrick.delaunay@foss.st.com Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 358EA8HK029843; Thu, 8 Jun 2023 17:10:05 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=selector1; bh=sOQYQtWJ9rJ23nJoypDStzOgywqmzuwMEYxfRgP6jz4=; b=wJCFfrLL4jmDfbLlmOqpW97V/Ylrzb1KyAxUUqMEcAqZ9lqwKsvzWwbm4Dw5Kr29poQk aQvtlYPHTweQpGzkKzPopcw8RRTOJ8VzwJDU0YVYC1hYh4bOd/i8SpnztTv6EgtMIpGa suYKvUrQl591fO+hf8hQYxOcZkO9sdMIiYjItTc7lGEoNJ/AC0weuXKj1l9OuwVC94Z6 qjxIPx/i6wK7dmibG1ZClBZoK2G4KKPFeLiGhcX/x/xIs9qB4Bl63nr0WY7amobEABVd Wd8HXQWyB9FmR0K7pUdTG9No7wMIYceoJweI2zXL+4x1ar9vwwK5W2G0ZkuKmOGuZcr7 GQ== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 3r3ggygcp1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 08 Jun 2023 17:10:05 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 7BED810003A; Thu, 8 Jun 2023 17:10:04 +0200 (CEST) Received: from Webmail-eu.st.com (shfdag1node3.st.com [10.75.129.71]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 757DC237D90; Thu, 8 Jun 2023 17:10:04 +0200 (CEST) Received: from localhost (10.48.1.0) by SHFDAG1NODE3.st.com (10.75.129.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Thu, 8 Jun 2023 17:10:04 +0200 From: Patrick Delaunay To: CC: Patrick Delaunay , Patrice Chotard , Simon Glass , U-Boot STM32 Subject: [PATCH 2/3] stm32mp: stm32prog: Add support of ESP partition type Date: Thu, 8 Jun 2023 17:09:55 +0200 Message-ID: <20230608170941.2.I046fa722833caf4e9c5b0d0b95fb591b1cfb8ab1@changeid> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230608170941.1.I0c3b7963b669b6c03e5a3bdf7e9e736e767aafd1@changeid> References: <20230608170941.1.I0c3b7963b669b6c03e5a3bdf7e9e736e767aafd1@changeid> MIME-Version: 1.0 X-Originating-IP: [10.48.1.0] X-ClientProxiedBy: SHFCAS1NODE1.st.com (10.75.129.72) To SHFDAG1NODE3.st.com (10.75.129.71) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.176.26 definitions=2023-06-08_11,2023-06-08_01,2023-05-22_02 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 Add support of "ESP" partition type in flashlayout to select the "EFI System Partition", associated to U-Boot "system" partition type guid, PARTITION_SYSTEM_GUID = C12A7328-F81F-11d2-BA4B-00A0C93EC93B. This partition is the bootable partition for efi boot. Signed-off-by: Patrick Delaunay Reviewed-by: Patrice Chotard --- arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c | 8 +++++++- arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c index 1bd86b5187da..07369919620e 100644 --- a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c +++ b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c @@ -434,6 +434,8 @@ static int parse_type(struct stm32prog_data *data, part->part_type = PART_ENV; } else if (!strcmp(p, "System")) { part->part_type = PART_SYSTEM; + } else if (!strcmp(p, "ESP")) { + part->part_type = PART_ESP; } else if (!strcmp(p, "FileSystem")) { part->part_type = PART_FILESYSTEM; } else if (!strcmp(p, "RawImage")) { @@ -1138,7 +1140,11 @@ static int create_gpt_partitions(struct stm32prog_data *data) case PART_FIP: type_str = FIP_TYPE_UUID; break; - default: + case PART_ESP: + /* EFI System Partition */ + type_str = "system"; + break; + default: /* PART_FILESYSTEM or PART_SYSTEM for distro */ type_str = "linux"; break; } diff --git a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h index 4c2c1314d990..a6fb9d5e9cc5 100644 --- a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h +++ b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h @@ -96,13 +96,19 @@ struct stm32_header_v2 { u8 extension_padding[376]; }; -/* partition type in flashlayout file */ +/* + * partition type in flashlayout file + * SYSTEM = linux partition, bootable + * FILESYSTEM = linux partition + * ESP = EFI system partition + */ enum stm32prog_part_type { PART_BINARY, PART_FIP, PART_ENV, PART_SYSTEM, PART_FILESYSTEM, + PART_ESP, RAW_IMAGE, }; From patchwork Thu Jun 8 15:09:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick DELAUNAY X-Patchwork-Id: 1792355 X-Patchwork-Delegate: patrice.chotard@st.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=foss.st.com header.i=@foss.st.com header.a=rsa-sha256 header.s=selector1 header.b=WZSGJksi; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4QcSMc6qJ6z20QH for ; Fri, 9 Jun 2023 01:10:52 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id EAF6186101; Thu, 8 Jun 2023 17:10:21 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=foss.st.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=foss.st.com header.i=@foss.st.com header.b="WZSGJksi"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id F2A26860BC; Thu, 8 Jun 2023 17:10:12 +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=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mx07-00178001.pphosted.com (mx08-00178001.pphosted.com [91.207.212.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 0AD69860EA for ; Thu, 8 Jun 2023 17:10:06 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=foss.st.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=prvs=45235c3c9f=patrick.delaunay@foss.st.com Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 358EAHET029938; Thu, 8 Jun 2023 17:10:06 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=selector1; bh=U0ten2sCPaJbuVNmQywyltYr4TZxelxOF+tCM3IhHRg=; b=WZSGJksiCUSGRmz6gC2wXcV08ELonoR0R8qxhR+BuNfaGsGj+LSaGZ7p2bGXLG22a/2S hexwJ8ZW1v7MCJjDNz2/nH3WI9OrYyeH4MthX1QXw/Z43xLWjs5r5nq/lI9mY68pBSON kawHZzLTjbjR0FPyiSQQOflOk3Vv3VNu68/tE6JQyf4NASTfB3HZlyENryaZ1uDbisou GVMF/y0xYHMJsLNLxUbBpBOP9GxALsFGMsZg8ySJHR4iingoLz8jREdanheRQr7PR2Fi H3MBZemgXcg6EX/dLm21icGNACuiRjUa3pRN+UkRcjzqEuou2V1z+d+bhI02eZZA3h5z AA== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 3r3ggygcp4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 08 Jun 2023 17:10:06 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 9C3EC10002A; Thu, 8 Jun 2023 17:10:05 +0200 (CEST) Received: from Webmail-eu.st.com (shfdag1node3.st.com [10.75.129.71]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 95713237D91; Thu, 8 Jun 2023 17:10:05 +0200 (CEST) Received: from localhost (10.48.1.0) by SHFDAG1NODE3.st.com (10.75.129.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Thu, 8 Jun 2023 17:10:05 +0200 From: Patrick Delaunay To: CC: Patrick Delaunay , Patrice Chotard , Simon Glass , U-Boot STM32 Subject: [PATCH 3/3] stm32mp: stm32prog: Add support of FWU_MDATA partition type Date: Thu, 8 Jun 2023 17:09:56 +0200 Message-ID: <20230608170941.3.I2c67e801f791e9b397c7a39c6f9ac503930f1203@changeid> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230608170941.1.I0c3b7963b669b6c03e5a3bdf7e9e736e767aafd1@changeid> References: <20230608170941.1.I0c3b7963b669b6c03e5a3bdf7e9e736e767aafd1@changeid> MIME-Version: 1.0 X-Originating-IP: [10.48.1.0] X-ClientProxiedBy: SHFCAS1NODE1.st.com (10.75.129.72) To SHFDAG1NODE3.st.com (10.75.129.71) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.176.26 definitions=2023-06-08_11,2023-06-08_01,2023-05-22_02 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 Add support of "FWU_MDATA" partition type in flashlayout to select the TF-A firmware update metadata partition type guid, associated to U-Boot "system" partition type guid, FWU_MDATA_GUID introduced by commit 2eaedc95164f ("FWU: Add FWU metadata structure and driver for accessing metadata") and used in gpt_get_mdata_partitions() for commit 554b38f7a532 ("FWU: Add FWU metadata access driver for GPT partitioned block devices") See also recommendation in FWU-PSA-A_DEN0118_1.0ALP3.pdf 4.1.2 Metadata integration with GPT When embedded in a GPT, each metadata replica occupies a single partition with PartitionTypeGUID = metadata_uuid. UUID = 8a7a84a0-8387-40f6-ab41-a8b9a5a60d23 Signed-off-by: Patrick Delaunay Reviewed-by: Patrice Chotard --- arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c | 11 +++++++++++ arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h | 1 + 2 files changed, 12 insertions(+) diff --git a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c index 07369919620e..a2ff5558a519 100644 --- a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c +++ b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c @@ -63,6 +63,12 @@ static const efi_guid_t uuid_mmc[3] = { ROOTFS_MMC2_UUID }; +/* + * GUID value defined in the FWU specification for identification + * of the FWU metadata partition. + */ +#define FWU_MDATA_UUID "8a7a84a0-8387-40f6-ab41-a8b9a5a60d23" + /* FIP type partition UUID used by TF-A*/ #define FIP_TYPE_UUID "19D5DF83-11B0-457B-BE2C-7559C13142A5" @@ -430,6 +436,8 @@ static int parse_type(struct stm32prog_data *data, } } else if (!strcmp(p, "FIP")) { part->part_type = PART_FIP; + } else if (!strcmp(p, "FWU_MDATA")) { + part->part_type = PART_FWU_MDATA; } else if (!strcmp(p, "ENV")) { part->part_type = PART_ENV; } else if (!strcmp(p, "System")) { @@ -1140,6 +1148,9 @@ static int create_gpt_partitions(struct stm32prog_data *data) case PART_FIP: type_str = FIP_TYPE_UUID; break; + case PART_FWU_MDATA: + type_str = FWU_MDATA_UUID; + break; case PART_ESP: /* EFI System Partition */ type_str = "system"; diff --git a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h index a6fb9d5e9cc5..02b286be8182 100644 --- a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h +++ b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h @@ -105,6 +105,7 @@ struct stm32_header_v2 { enum stm32prog_part_type { PART_BINARY, PART_FIP, + PART_FWU_MDATA, PART_ENV, PART_SYSTEM, PART_FILESYSTEM,