{"id":2223616,"url":"http://patchwork.ozlabs.org/api/1.1/patches/2223616/?format=json","web_url":"http://patchwork.ozlabs.org/project/uboot/patch/20260415183250.3031030-8-dario.binacchi@amarulasolutions.com/","project":{"id":18,"url":"http://patchwork.ozlabs.org/api/1.1/projects/18/?format=json","name":"U-Boot","link_name":"uboot","list_id":"u-boot.lists.denx.de","list_email":"u-boot@lists.denx.de","web_url":null,"scm_url":null,"webscm_url":null},"msgid":"<20260415183250.3031030-8-dario.binacchi@amarulasolutions.com>","date":"2026-04-15T18:31:34","name":"[v3,7/7] board: st: stm32mp25: support dynamic A/B bank bootup","commit_ref":null,"pull_url":null,"state":"changes-requested","archived":true,"hash":"6670d344d333e5eaf769fc4c6a02ed3a9b19f034","submitter":{"id":83038,"url":"http://patchwork.ozlabs.org/api/1.1/people/83038/?format=json","name":"Dario Binacchi","email":"dario.binacchi@amarulasolutions.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/uboot/patch/20260415183250.3031030-8-dario.binacchi@amarulasolutions.com/mbox/","series":[{"id":500027,"url":"http://patchwork.ozlabs.org/api/1.1/series/500027/?format=json","web_url":"http://patchwork.ozlabs.org/project/uboot/list/?series=500027","date":"2026-04-15T18:31:27","name":"Support metadata-driven A/B boot for STM32MP25","version":3,"mbox":"http://patchwork.ozlabs.org/series/500027/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2223616/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2223616/checks/","tags":{},"headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=amarulasolutions.com header.i=@amarulasolutions.com\n header.a=rsa-sha256 header.s=google header.b=mNghHytY;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de\n (client-ip=85.214.62.61; helo=phobos.denx.de;\n envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org)","phobos.denx.de;\n dmarc=pass (p=none dis=none) header.from=amarulasolutions.com","phobos.denx.de;\n spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de","phobos.denx.de;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=amarulasolutions.com header.i=@amarulasolutions.com\n header.b=\"mNghHytY\";\n\tdkim-atps=neutral","phobos.denx.de; dmarc=pass (p=none dis=none)\n header.from=amarulasolutions.com","phobos.denx.de; spf=pass\n smtp.mailfrom=dario.binacchi@amarulasolutions.com"],"Received":["from phobos.denx.de (phobos.denx.de [85.214.62.61])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fwqYF54jvz1yHM\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 16 Apr 2026 04:34:09 +1000 (AEST)","from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id 76F8F84227;\n\tWed, 15 Apr 2026 20:33:20 +0200 (CEST)","by phobos.denx.de (Postfix, from userid 109)\n id 4E0A48423E; Wed, 15 Apr 2026 20:33:18 +0200 (CEST)","from mail-wm1-x329.google.com (mail-wm1-x329.google.com\n [IPv6:2a00:1450:4864:20::329])\n (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits))\n (No client certificate requested)\n by phobos.denx.de (Postfix) with ESMTPS id A00C984223\n for <u-boot@lists.denx.de>; Wed, 15 Apr 2026 20:33:15 +0200 (CEST)","by mail-wm1-x329.google.com with SMTP id\n 5b1f17b1804b1-488af96f6b2so94133865e9.0\n for <u-boot@lists.denx.de>; Wed, 15 Apr 2026 11:33:15 -0700 (PDT)","from dario-ThinkPad-P14s-Gen-5.amarulasolutions.com ([2.196.40.93])\n by smtp.gmail.com with ESMTPSA id\n 5b1f17b1804b1-488f0e72980sm34953115e9.5.2026.04.15.11.33.13\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Wed, 15 Apr 2026 11:33:14 -0700 (PDT)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,\n DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED,\n SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=amarulasolutions.com; s=google; t=1776277995; x=1776882795;\n darn=lists.denx.de;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n :message-id:reply-to;\n bh=gEPs0fGJ6OgadP+ub4aVqo1ljemvKjXa6np+zn4X2AI=;\n b=mNghHytYzTCTj9o55D35JctAIBpuTSArNUkSSSQPPrhZJ8HM44DEX7zwsH61XjeDkx\n EpaezjbhmRheF7aUZDUnGcoPjKM6+J8rquYXP9Cr9wpaUWVMNX9Xvl3kI7v7DWgC/6xs\n yD2t4eNSxw3NmY8cyChAshSUkgzMUEMjX9QXc=","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1776277995; x=1776882795;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from\n :to:cc:subject:date:message-id:reply-to;\n bh=gEPs0fGJ6OgadP+ub4aVqo1ljemvKjXa6np+zn4X2AI=;\n b=AiANcRn5HQsSa4fVZxs91hcOpCh2SFStOhypmf7WfhywtSRej9J1sOvEbUy5nJT4TD\n L0o/FsxYYxd43QS3uJpCf6qc4221CWhKWMvHV49FYErjR+FZmCHRWQgLgX1STfeeRO0d\n FwJuSt7LMnl/GkCniLw5NP1wxaYOuaqOkP9SIT/yhF05IsFGEux6L5vxLG9zo7SCIC5Z\n HvxEtyrP40ceRNAXwGz9Gnk5twqSByvozEmRg5oY3Ne8peg2/o1wil+Ppvyk0Q4pBUCP\n lnkQ4ZvhtuOVX51wbpDU7VOrMU60YRp4mSws9y+PcrkvzRGFnaTZrAT+h6Vhyp0ZODkR\n +Z4w==","X-Gm-Message-State":"AOJu0YyQJ+NbRtok0zfX1PovCdwVVMxh4FD63BRl6rGkEt+e5cvsE/y2\n 5ciROF7/Sxk67gd6ucvgO3BPqiT1uz9ris+f2YBPO9J+B9xUtlOLzNChwqrPjqED27C7OptHj+h\n Al5pt","X-Gm-Gg":"AeBDiesxIGQzadHZLDNjtMjMaaIOWs1Ft/MNv3PPEQ53Hb1Vgk7A66z7bokKFtpkp6b\n /uXujTJFgg2xi1R4UjmhOpioCFFFutwoYbgsGZgUm5lWCtQRTGKuTabTbj++OkJvfLcHDnh2OkS\n zKNagu1B8+lmd8ZybuVbA1CjAzK4tLYwUf86YzUf/qfrQN68xqUoDWiJtDuOr2V0Q9dMTtJgRDa\n 6sbHfMn8dlwYIxrEa/eV2dtmklIuVUVQYo4in0ojf3HQ67tROWN+l4uymzfvP6bRZTCGaJiNlDb\n /lL2tdqfqpcyc8Ck9+y9cI591rpHv24psSZ7cUaWtnlCX5Ld+/KMbocui+ANd6aV4iSr1SW/Mxz\n UJEI4ojzuINfML2Go6PySo8chQrBT5HHlgFuASaIu1U9BdruboaBBnfe75iaef1mVTR0IYpag1F\n rHOOyOKkntwgMbIX2ljIi1kFORfSzT4sW2k6rvMAnBN9xqW2JIQl9znHcGWcbSGt90ybhWKecfi\n Hlqu3Q9PVEAbokS4lL74PHWWiALLId4/oIbILdyJP1tdsSkz+xZuGjVsw==","X-Received":"by 2002:a05:600c:c0da:b0:488:b187:d898 with SMTP id\n 5b1f17b1804b1-488d685b6e8mr276633475e9.14.1776277994818;\n Wed, 15 Apr 2026 11:33:14 -0700 (PDT)","From":"Dario Binacchi <dario.binacchi@amarulasolutions.com>","To":"u-boot@lists.denx.de","Cc":"linux-amarula@amarulasolutions.com,\n Dario Binacchi <dario.binacchi@amarulasolutions.com>,\n Simon Glass <sjg@chromium.org>,\n Marek Vasut <marek.vasut+renesas@mailbox.org>,\n Patrice Chotard <patrice.chotard@foss.st.com>,\n Patrick Delaunay <patrick.delaunay@foss.st.com>,\n Quentin Schulz <quentin.schulz@cherry.de>, Tom Rini <trini@konsulko.com>,\n uboot-stm32@st-md-mailman.stormreply.com","Subject":"[PATCH v3 7/7] board: st: stm32mp25: support dynamic A/B bank bootup","Date":"Wed, 15 Apr 2026 20:31:34 +0200","Message-ID":"<20260415183250.3031030-8-dario.binacchi@amarulasolutions.com>","X-Mailer":"git-send-email 2.43.0","In-Reply-To":"<20260415183250.3031030-1-dario.binacchi@amarulasolutions.com>","References":"<20260415183250.3031030-1-dario.binacchi@amarulasolutions.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.39","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<https://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=subscribe>","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>","X-Virus-Scanned":"clamav-milter 0.103.8 at phobos.denx.de","X-Virus-Status":"Clean"},"content":"Enable automatic detection of the active A/B bank by retrieving\npartition GUIDs from FWU metadata.\n\nThis ensures the system correctly identifies the bootable partitions\neven in multi-bank scenarios, falling back to a standard bootable flag\nscan if the UUIDs are missing.\n\nTo enable A/B bank bootup on stm32mp25 boards, add the following Kconfig\noptions to the stm32mp25_defconfig:\n\n CONFIG_FWU_MULTI_BANK_UPDATE=y\n CONFIG_FWU_MDATA=y\n CONFIG_FWU_NUM_BANKS=2\n CONFIG_FWU_NUM_IMAGES_PER_BANK=3\n CONFIG_CMD_FWU_METADATA=y\n CONFIG_FWU_MDATA_V2=y\n\nSigned-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>\nReviewed-by: Simon Glass <sjg@chromium.org>\n\n---\n\nChanges in v3:\n- Add Reviewed-by tag of Simon Glass.\n\nChanges in v2:\n- Add links to the XBOOTLDR specification in the commit message of patch\n   1/7 lib: uuid: add partition type GUID for extended bootloader.\n- Update help for 'part start', 'part size' to mention UUID.\n- Add kerneldoc comment for fwu_mdata_get_image_guid().\n- Pass efi_guid_t by pointer in fwu_mdata_get_image_guid().\n- Add patches:\n   5/7 test: cmd: part: add UUID lookup tests\n   3/7 test: cmd: add unit tests for part command\n   2/7 test: dm: part: add test for part_get_info_by_uuid\n- Pass efi_guid_t by pointer in fwu_mdata_get_image_guid() calls.\n\n board/st/stm32mp2/stm32mp2.c          | 32 +++++++++++++++++++++++++++\n include/configs/stm32mp25_st_common.h | 15 +++++++++++++\n 2 files changed, 47 insertions(+)","diff":"diff --git a/board/st/stm32mp2/stm32mp2.c b/board/st/stm32mp2/stm32mp2.c\nindex 43bc583378e6..5cbbbc322a3a 100644\n--- a/board/st/stm32mp2/stm32mp2.c\n+++ b/board/st/stm32mp2/stm32mp2.c\n@@ -208,4 +208,36 @@ void fwu_plat_get_bootidx(uint *boot_idx)\n \t*boot_idx = (readl(TAMP_FWU_BOOT_INFO_REG) >>\n \t\t    TAMP_FWU_BOOT_IDX_OFFSET) & TAMP_FWU_BOOT_IDX_MASK;\n }\n+\n+int fwu_platform_hook(struct udevice *dev, struct fwu_data *data)\n+{\n+\tuint boot_idx;\n+\tefi_guid_t boot_uuid, root_uuid;\n+\tconst efi_guid_t boot_type_guid = PARTITION_XBOOTLDR;\n+\tconst efi_guid_t root_type_guid =\n+\t\tPARTITION_LINUX_FILE_SYSTEM_DATA_GUID;\n+\tchar uuidbuf[UUID_STR_LEN + 1];\n+\tint retb, retr;\n+\n+\tfwu_plat_get_bootidx(&boot_idx);\n+\n+\tretb = fwu_mdata_get_image_guid(&boot_uuid, &boot_type_guid, boot_idx);\n+\tretr = fwu_mdata_get_image_guid(&root_uuid, &root_type_guid, boot_idx);\n+\n+\tif (!retb && !retr) {\n+\t\tuuid_bin_to_str(boot_uuid.b, uuidbuf, UUID_STR_FORMAT_GUID);\n+\t\tenv_set(\"boot_partuuid\", uuidbuf);\n+\n+\t\tuuid_bin_to_str(root_uuid.b, uuidbuf, UUID_STR_FORMAT_GUID);\n+\t\tenv_set(\"root_partuuid\", uuidbuf);\n+\t} else if (!retb && retr) {\n+\t\tlog_warning(\"%s: found boot GUID but missing root GUID (%d)\\n\",\n+\t\t\t    __func__, retr);\n+\t} else if (!retr && retb) {\n+\t\tlog_warning(\"%s: found root GUID but missing boot GUID (%d)\\n\",\n+\t\t\t    __func__, retb);\n+\t}\n+\n+\treturn 0;\n+}\n #endif /* CONFIG_FWU_MULTI_BANK_UPDATE */\ndiff --git a/include/configs/stm32mp25_st_common.h b/include/configs/stm32mp25_st_common.h\nindex cb679eb1be22..0b0267ae99b0 100644\n--- a/include/configs/stm32mp25_st_common.h\n+++ b/include/configs/stm32mp25_st_common.h\n@@ -8,7 +8,22 @@\n #ifndef __CONFIG_STM32MP25_ST_COMMON_H__\n #define __CONFIG_STM32MP25_ST_COMMON_H__\n \n+#ifdef CONFIG_FWU_MULTI_BANK_UPDATE\n+#define SCAN_DEV_FOR_BOOT_PARTS \\\n+\t\"setenv devplist; \" \\\n+\t\"env exists boot_partuuid && \" \\\n+\t\t\"part number ${devtype} ${devnum} ${boot_partuuid} devplist; \" \\\n+\t\"env exists devplist || \" \\\n+\t\t\"part list ${devtype} ${devnum} -bootable devplist; \"\n+\n+#define ST_STM32MP25_FWU_ENV \\\n+\t\"altbootcmd=${bootcmd}\\0\"\n+#else\n+#define ST_STM32MP25_FWU_ENV\n+#endif\n+\n #define STM32MP_BOARD_EXTRA_ENV \\\n+\tST_STM32MP25_FWU_ENV \\\n \t\"usb_pgood_delay=2000\\0\" \\\n \t\"console=ttySTM0\\0\"\n \n","prefixes":["v3","7/7"]}