From patchwork Thu Apr 30 08:06:01 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 4590 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id C6F7A3F0D7 for ; Thu, 30 Apr 2026 10:06:38 +0200 (CEST) Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-48a692c2940sf708775e9.0 for ; Thu, 30 Apr 2026 01:06:38 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1777536398; cv=pass; d=google.com; s=arc-20240605; b=TvU2zU/Qyw5su+KywJkCumnYVah0edRGg5/k29fFCcAFEpqcDzabCjU0DA7UFLq/TS s4W/Z75xRTAfI8vZ/E4NtPdWrRmdHb2bm3lc5XT09KLqWB0g7XqUzRPT6ePxnRRIgMPF /IPxCoXfuFoDwQIecImBX1Nh/oAZ0MClLYeHeeZAy0kdck21iECmA+381OOMxftKFNV0 pd6ijxa0KgrJfQddU54VeBzrHt1N39Td85NxOG4KexfQX8HWRYHAQXpMdc/rmsox3Abo epd2gfEye2Dvp+zl87dZIdkCKc5oHQmfyviJc3CUWi4LggAmNPhgxqcbR1tGvKag0iFK rOYw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:message-id:date:subject:cc:to :from:dkim-signature; bh=qSBskdjbZ7L7vn1Gf2S/+RKwWSiHGMLiOjPkQjKkstg=; fh=7yeABOpMvycDDHtaSkya/5/Ffk8Zju8SWkAp7tBUdBc=; b=OWmyDjLTktCT/Cg5TkT4ncs4kGI1Q8oFW99m+QV7HZ4gYiOlRKDwO6Iqkz+dmtbMeB OENorQYiTJGf0jFit8Z55EfshMq75tNJS2vJJnqNAtpT7tc0cByvkXwxFzemECEhYuB5 yxFVThxZtBDrgxKv2Jnh7Q/02tncRNnkfiSNzbRgh1WQusibsRnSNU0djoe/1AVv+vaa nEER6IVohpVEFBGehKk6D/PIdU/Pwa6w0dNmbBOcmyYCSjgDYqd7uPxuHeYguLWCObFt 9HslaH1NGs49nsSaLGGkHxILA2S+4pH3j+10J8gmA3QCbhUMGgjimFNaB8Mm5FBBg5+H QjNg==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=HqEA2YWu; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com; dara=neutral header.i=@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1777536398; x=1778141198; darn=patchwork.amarulasolutions.com; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:message-id:date:subject:cc:to:from :from:to:cc:subject:date:message-id:reply-to; bh=qSBskdjbZ7L7vn1Gf2S/+RKwWSiHGMLiOjPkQjKkstg=; b=oezDlWvreCGzgq3nTr1qrECDajPyPrC8rc+NFW7Z18CzY6jkVoQBVaBT+uWiNc7Pb0 kVQbClNTwPFEN8Ms2G80fgy7xER/eVzoHRPy+gHhgMXwel9TUHCNzzUTbyvUgaILvHL6 rlVdF104p6jhjqj3zmnLEkNe49idStplEZcRM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777536398; x=1778141198; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :message-id:date:subject:cc:to:from:x-gm-gg:x-beenthere :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=qSBskdjbZ7L7vn1Gf2S/+RKwWSiHGMLiOjPkQjKkstg=; b=Hlg4gDt+72VyqwrEdl4Ynq0cOCjUwrSsW7PCIHwONz88ZizWCCX7INzgm+SXwJ5ppG aSTFMXaYMvOZZSigtJ7TKD3R4W5WBGWdqN3gBAFwVKocXQom80P4dp7NG8zm7qn7YAV0 ZaLaDU88JcQ6rzJlBMDJ+RU0A2Y+WOoSE9PxVta74TgLpr56uOGsmiBbzxA7RdlRYfVK rJd5MSrFOeZZNzIFxTRFmIRrtsFc7m/vj3WroMW4oK0VKfy5f2UpkmvnGcTDT8QwGqp5 fLJ3DzHOqaeTkCHLaDdNyt1VhGDHCyLVTXsq84RAXjrLmR4jAyiuL/7aUj1UPHBZQtGx HY2g== X-Forwarded-Encrypted: i=2; AFNElJ/7xdI5F8zC6sTfL2vRuO7bT0e9IQNtuCoIJGsvVhsFDziIInYCBpU3tM3n5SZTPptcf1FYbTgWr/UJ7/FP@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0YwXUnK+ciflSiYKELiI+buIcCejN6t3wEmOpw2Dy9ZkXs5XzpQh FSmKTJ0w85zGeWtmbJkZ7OPBru6rZrxw61kdKzCdMpP3Dz1gCdmzibj5R1uVJT+f7KVkiQ== X-Received: by 2002:a05:600c:3ba5:b0:48a:56d4:7274 with SMTP id 5b1f17b1804b1-48a844677a1mr17942105e9.3.1777536398124; Thu, 30 Apr 2026 01:06:38 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com; h="AUV6zMMzITVahFGOdj2kkN5tbS/8oloOQsEkh+dPeSaAoydAaw==" Received: by 2002:a05:600c:378c:b0:486:fa9e:9317 with SMTP id 5b1f17b1804b1-48a83bf5492ls4661325e9.2.-pod-prod-05-eu; Thu, 30 Apr 2026 01:06:36 -0700 (PDT) X-Received: by 2002:a05:600c:81ca:b0:489:1a3a:9e45 with SMTP id 5b1f17b1804b1-48a8445eabamr32340325e9.26.1777536396178; Thu, 30 Apr 2026 01:06:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1777536396; cv=none; d=google.com; s=arc-20240605; b=feFPvi0/On4Ndyw1P7iiL0uecATtGf0fBip0rseaIvb45SS/WZZ4u+7DHDikAwJVpc 4oa6J5pqhyfTMH3IZTba3eLNe1f9xBz5D4CBGbB17g0M97Yz79Wf94dioC+/0TOOGsq2 +ZEVlu4cTs1p97q+di855XJ3lyJIHEVOtfXjF+s58hPcL8Z6MpjtNCnOjmp8KZQmyCdd UYvznqZv6zViIBwQxcvWbQ7qc1Ux1GqZDF4AgNJIEIGWyDjizRg2OLjYtRgZjNIZ4KJ2 Y7Y+BraDa6lRaRcJF6NXkiVyuBeHZbnNCJChlzOZ99bcZJni7L2inWU4+hn45jwyCibm qlwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=/QV82wuNp4nweUt0s7vcjJ2bxGHNpCyc6rgkz0B9U9w=; fh=Cz/sY8zpkpQmclTy+XOk+qFS4QV7TEHlYbwT3/vMQ1M=; b=JnSdEz80k2C9AfEpP+hSoRH9IpG0O8WC3RNF1ErlliDzrvogVedlTN5bh7BJZMXaL2 R39PV5dF/V1w/IzM6kltNWmvqUdrJpSYabUcL9lypDHbE2JIk/KYdJlBdj3c0k/U+DyX FOjOy740iv7KRH2bn71gBvLQHuFsRYJh1PoePfpGtEcMIo4YDXcaSuAl560feROILobW UHghnx/lTeEBTvNYeBzTYnluYycThCygpE+dZuq2kO6VgC/85nYJQchTHkH6/eUgJWOw 6y2ffVnC6qB38sjo7f9H4ne5g55VIDvVHwMNF8P0+SOwoANbE+YZGFcjq0T7HPCinoAP 9ttA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=HqEA2YWu; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com; dara=neutral header.i=@amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id 5b1f17b1804b1-48a7c5da9absor7829045e9.12.2026.04.30.01.06.36 for (Google Transport Security); Thu, 30 Apr 2026 01:06:36 -0700 (PDT) Received-SPF: pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Gm-Gg: AeBDievfHwEsqL1AK/oEqmPZ55fzctJEepo07KMwO/mZCoAI/JaI4DdGtCMSWPQEDXH e8Vzvzm/XGxoZS7M+YGRpEvKVyC9Vd1HVwfteMe1Z6bPAT4eA1JDUR1kkdtEJupo6TvbiNf557G GUOq6gGe0CPx1M684vKyZ1250Yr/HNDu50KnTN9XcOTXsLOn7mJFlIXgT5g9IeC61WGbpVV0cBP yaPUL4SC8W05IBh///YaBsVBmGoc8rbEA+mEm3mKuyT4t/Q1aahV65fzyjApnZ9gSzdQvyPKn6x QAZTbbmy3m5Oh8Kd6v9h3UvjDOYasG4DNC0jbyCPv27iUP27qlwWk0L2J0QOorh4X2B1TT38jXA qbUNTuIvD6U1/myjzoVIoJYzGGQsTfELVoWIqEi1ECcUi/3aSLeu6yHGML4DibnFu2MK2rGPtGS n8IUWM8ecHoTstMOZLxVlUB/cN6sHMoX2FPE6mgJQzmD2dEuLpNm2KX1sAsB8Pm4HD63vf+pWLw y2audFCezIbeI2piBmGYLAAnDMn+8enls5eBTwq8ZemYmx4fah+X1BnCv4wguF20M5fYw+cT2+U y/hswH4YO7UKX3/0HieSjoZKqPmI5dXT7Me8d/gJmuyI5Q== X-Received: by 2002:a05:600c:c170:b0:489:1a63:509c with SMTP id 5b1f17b1804b1-48a83d06bc3mr27641745e9.0.1777536395535; Thu, 30 Apr 2026 01:06:35 -0700 (PDT) Received: from dario-ThinkPad-P14s-Gen-5.homenet.telecomitalia.it (host-82-56-22-134.retail.telecomitalia.it. [82.56.22.134]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-449c576d0a2sm668071f8f.31.2026.04.30.01.06.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Apr 2026 01:06:34 -0700 (PDT) From: Dario Binacchi To: u-boot@lists.denx.de Cc: linux-amarula@amarulasolutions.com, Dario Binacchi , Dinesh Maniyam , Heinrich Schuchardt , Ilias Apalodimas , Javier Martinez Canillas , Jerome Forissier , John Toomey , Jonathan GUILLOT , Kory Maincent , Marek Vasut , Mattijs Korpershoek , Michal Simek , Padmarao Begari , Patrice Chotard , Patrick Delaunay , Quentin Schulz , Rasmus Villemoes , Simon Glass , Sughosh Ganu , Tom Rini , =?utf-8?q?Vincent_Stehl=C3=A9?= , uboot-stm32@st-md-mailman.stormreply.com Subject: [PATCH v8 0/8] Support metadata-driven A/B boot for STM32MP25 Date: Thu, 30 Apr 2026 10:06:01 +0200 Message-ID: <20260430080627.849636-1-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-Original-Sender: dario.binacchi@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=HqEA2YWu; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com; dara=neutral header.i=@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , This series, the mainline version of [1], provides the necessary changes in U-Boot to support the metadata-driven A/B update flow for STM32MP25 boards. It implements the logic required to dynamically select the boot bank based on FWU metadata. These changes are designed to be backward compatible while providing the necessary infrastructure for the A/B scheme. The series has been tested on the STM32MP257F-EV1 board. Additionally, some patches in the series propose changes with general-purpose utility: 1/7 lib: uuid: add partition type GUID for extended bootloader 4/7 cmd: part: support lookup by UUID in 'part number' 6/7 fwu: add helper to get image GUID by type and bank index [1] https://github.com/STMicroelectronics/u-boot/pull/6 Changes in v8: - Skip the test in case the CONFIG_MCC is not enabled or the mmc device is not found. - Add Reviewed-by of Patrice Chotard - Skip cmd_test_part tests for configurations where MMC is not enabled or the device is missing Changes in v7: - Add Reviewed-by of Simon Glass for patc 7/8 of "test: dm: fwu_mdata: add test for fwu_mdata_get_image_guid" Changes in v6: - Add Reviewed-by of Simon Glass to patch 3/8 "test: cmd: add unit tests for part command" Changes in v5: - Update doc/usage/cmd/part.rst to reflect the changes related to the part command. - Add Acked-by of Ilias Apalodimas to patch 6/8 "fwu: add helper to get image GUID by type and bank index" Changes in v4: - Place the part command tests in the cmd suite rather than the dm suite. - Order the include files according the U-Boot coding style. - Add patch 7/8 test: dm: fwu_mdata: add test for fwu_mdata_get_image_guid Changes in v3: - Wrap lines exceeding 80 columns in test/cmd/part.c file. - Combine run_command() and ut_asserteq() -> ut_asserteq(1, run_command( - Add kerneldoc comment for fwu_mdata_get_image_guid() above its declaration in fwu.h. - Add log_warning() messages to fwu_platform_hook() to catch inconsistent FWU metadata (boot GUID found but root GUID missing or viceversa), as suggested by Simon Glass. Changes in v2: - Add links to the XBOOTLDR specification in the commit message of patch 1/7 lib: uuid: add partition type GUID for extended bootloader. - Update help for 'part start', 'part size' to mention UUID. - Add kerneldoc comment for fwu_mdata_get_image_guid(). - Pass efi_guid_t by pointer in fwu_mdata_get_image_guid(). - Add patches: 5/7 test: cmd: part: add UUID lookup tests 3/7 test: cmd: add unit tests for part command 2/7 test: dm: part: add test for part_get_info_by_uuid Dario Binacchi (8): lib: uuid: add partition type GUID for extended bootloader test: dm: part: add test for part_get_info_by_uuid test: cmd: add unit tests for part command cmd: part: support lookup by UUID test: cmd: part: add UUID lookup tests fwu: add helper to get image GUID by type and bank index test: dm: fwu_mdata: add test for fwu_mdata_get_image_guid board: st: stm32mp25: support dynamic A/B bank bootup board/st/stm32mp2/stm32mp2.c | 32 ++++ cmd/part.c | 12 +- doc/README.gpt | 2 + doc/usage/cmd/part.rst | 6 +- include/configs/stm32mp25_st_common.h | 15 ++ include/fwu.h | 11 ++ include/part_efi.h | 3 + lib/fwu_updates/fwu.c | 33 ++++ lib/uuid.c | 1 + test/cmd/Makefile | 1 + test/cmd/part.c | 227 ++++++++++++++++++++++++++ test/dm/fwu_mdata.c | 48 ++++++ test/dm/part.c | 53 ++++++ 13 files changed, 437 insertions(+), 7 deletions(-) create mode 100644 test/cmd/part.c