From patchwork Mon Jun 3 12:49:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caleb Connolly X-Patchwork-Id: 801245 Delivered-To: patch@linaro.org Received: by 2002:a5d:65c4:0:b0:35b:5a80:51b4 with SMTP id e4csp1897481wrw; Mon, 3 Jun 2024 05:49:25 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUJIOw9NpnIUIPzvoFFBUAVi/hAtLXM+WOwTAHtJHc2cFmM9qegDLZBi+cBVDOQ1U70F6cLXdZ0VHsQXR2W7TT5 X-Google-Smtp-Source: AGHT+IFbmMLX+i82iGicvCK6ciCkQW3pR26s9uHhF4/sj1VH/lsYN3TPQLKhTUAgeCNdHfkq5SUs X-Received: by 2002:a50:9f8b:0:b0:578:57b7:9f32 with SMTP id 4fb4d7f45d1cf-57a36488640mr6721708a12.35.1717418964829; Mon, 03 Jun 2024 05:49:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1717418964; cv=none; d=google.com; s=arc-20160816; b=XAbjH5ZjAUzd3LqQDbC6MLDtA38yn7ugctNSmjQhwltZBwI19h/tvo/4kBVs8Jftok teQ8xn4LMczK+BfQ6uV9l/9pV27p69OD5/oaumElPAY9Mt/GzjhXnY0b4ngUU9ocEfje DX9vRoFal7Y0MlaotB5+ygtK7LMbZae2SwKD7KPiypLV/diQEiKDaMMacqGlxPa48oDN M+NVg8Zst8D3YqR7Kb3UBpouq/7QJy1skI53BXc4Tkgwb8TmZyyUbbf0M+MQaaaKMVT4 F2Lek4FZ65DMtI5jlBsSxsDtoQlg9y1tdn2yD+hPuzas2Wx5EtHG2SiMUoLvtSnLZsEo G7og== 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:cc:to:content-transfer-encoding :mime-version:message-id:date:subject:from:dkim-signature; bh=Xi4KqcKUzHSBeGu8h5eKCPa9zjQDldEDM593qTyD6Ek=; fh=XKeoXENxr9Qe8t3YDprQvy0A080IPYjriadn0VZxWR4=; b=e6j6uDSUII1db4PuFDwGY2ZJf8ZOBKBPLXdm/r5WqGrP6WGJ7l6GbKlNLaDitOsuiR KMt62r0/tcFtq8DWj3dT1IlBQdudc9HYbi6RdXe/7oXM+PDT5LglC9gM24d0obQRvSXL te+Y4oeq9Ct81xg+Nq1TtBsXbOX6qC31oKi7mG3ECQ+iZTWqGKQ1h+6Ud90JlBrq6k5L sOwB8GZM0cUbcLiTNwOsKpLqt4M+vAF+YEMoaY1mM7EWS0DD7O5+WFTIF7bka5j5bnOK Q5ONFzPD6ZcfTKKrT2B0e1RLV3HdFRhh5SZM5rsPg++RnVzj20M5BV1Avp8cY9WTTvan 4TMg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dp1dgdpN; 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=pass (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 4fb4d7f45d1cf-57a31b80d8bsi4048878a12.68.2024.06.03.05.49.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jun 2024 05:49:24 -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; dkim=pass header.i=@linaro.org header.s=google header.b=dp1dgdpN; 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=pass (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 A35E8882F9; Mon, 3 Jun 2024 14:49:23 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org 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=linaro.org header.i=@linaro.org header.b="dp1dgdpN"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3DA64882F6; Mon, 3 Jun 2024 14:49:22 +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.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ed1-x543.google.com (mail-ed1-x543.google.com [IPv6:2a00:1450:4864:20::543]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id C360987FC1 for ; Mon, 3 Jun 2024 14:49:19 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=caleb.connolly@linaro.org Received: by mail-ed1-x543.google.com with SMTP id 4fb4d7f45d1cf-57a4d7ba501so1984444a12.2 for ; Mon, 03 Jun 2024 05:49:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717418959; x=1718023759; darn=lists.denx.de; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:from:to:cc:subject:date:message-id:reply-to; bh=Xi4KqcKUzHSBeGu8h5eKCPa9zjQDldEDM593qTyD6Ek=; b=dp1dgdpNHM/KgvmkdZIL7X6t6wiT42ndjeyZyrfiqyEJWvCBhy/Wh83ZcckwoDx/l5 SHJ30AZUwf4/baJU+V3PoCxwWpug6wNzQ1MzCW9wzuRVBzbR9LzPIYq5cjkHxZqIkU4i ZNxCucMwKHNEfWm0sI30kTMrtAANAC3kztUMD70LCU/JsqE8xq4JQeaMSq8xcju0qhhz tnCHTzkQhkAbrotoo4Tpgy+zkbTW/LA7V40w04GR9eSHIPMbOxc16//w8ttyRD1Ovajb bk3wLwJLhKOEeDn9z2MAmnKDmd1QAtR9yX0o/vC6Ndpft1zMWaTp85sHztF9SJ35O2hI BE1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717418959; x=1718023759; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Xi4KqcKUzHSBeGu8h5eKCPa9zjQDldEDM593qTyD6Ek=; b=MM9PSuWn92BEcRNM8T3UGyCW9obkvJCpS5ydh/eBUBnklBJIjLMqXKTyWkfX29upUB hPFuAaq8TN8rpqx+ty+DZUjpfOsgWqvf7yrXeqGAz49/zw003JsGZfG0sik8tMnq4EMw mztHtV1LZKUrZiYWhWOW0ZqVTJR0fmEROEhptOeLghfeYxQcmvnbvpOH7/MCedRlWV63 Fn8sgB+9cf6GdP6nvmbOl2N2l7+qjopRBxbTELUQn957bsm/GvHAV2qQKeONKFuERr+k h5iLgY71AqWZ1EyoTtJY4wsWDIX8YwJtau2EvY3OcOo0VnzdZgImxVop2jOVvSKOo8w0 VoLw== X-Forwarded-Encrypted: i=1; AJvYcCXeBcifBBcCtnYB+2wKaVmi8w89lOfP+dkajwsn7k7KrXfPc7OnAhtp8UPmV3QpTYYOqADgK+qqBv/sNr73TsEG4jzQsg== X-Gm-Message-State: AOJu0YyufsmiJSDn22SYw0aCeus6l3aTNppjLxQQ/Qu+cG07yQ1Y2vL1 gQT7Ko6Weh8zahrwzRHY/YzN8MfwVeIOpKg1lcQXCZETnib5GWWBiw/TO/eLSbE= X-Received: by 2002:a17:906:a293:b0:a68:e58b:2c35 with SMTP id a640c23a62f3a-a68e58b2c64mr302223266b.31.1717418959211; Mon, 03 Jun 2024 05:49:19 -0700 (PDT) Received: from [192.168.0.113] ([2a02:8109:aa0d:be00::8090]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a691cd07c72sm98917066b.170.2024.06.03.05.49.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jun 2024 05:49:18 -0700 (PDT) From: Caleb Connolly Subject: [PATCH v3 0/8] qcom: implement capsule updates Date: Mon, 03 Jun 2024 14:49:15 +0200 Message-Id: <20240603-b4-qcom-capsule-updates-v3-0-fe2e083289ec@linaro.org> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAMu7XWYC/3XOQQ7CIBAF0KsY1o6hQEt15T2MC4ShJamlQks0T e8urQvjwuWf5L8/M4kYHEZy2s0kYHLR+T4Hvt8R3aq+QXAmZ8IoE7RkHG4CHtrfQashTh3CNBg 1YgRUDIWtLbWWktweAlr33OTLNefWxdGH1zaUivX6MQU9rqaxE0QdHaQCKHAshChURbmszp3rV fAHHxqyQol9yyWTfx9KLENCljU3UhnB6h9oWZY3YgXsxPwAAAA= To: Tom Rini , Simon Glass , Lukasz Majewski , Mattijs Korpershoek , Caleb Connolly , Neil Armstrong , Sumit Garg Cc: Ilias Apalodimas , u-boot@lists.denx.de, u-boot-qcom@groups.io X-Mailer: b4 0.14-dev X-Developer-Signature: v=1; a=openpgp-sha256; l=3206; i=caleb.connolly@linaro.org; h=from:subject:message-id; bh=dt7NHoCeoL30HWFoQisJqeIe1xYA8I+1N539lyAavh4=; b=owEBbQKS/ZANAwAIAQWDMSsZX2S2AcsmYgBmXbvMQE4sBmlW8vxNBJT4kcQ9ny+2qdrFUlMbw Vcd0HhvIRKJAjMEAAEIAB0WIQS2UaFGPGq+0GkMVc0FgzErGV9ktgUCZl27zAAKCRAFgzErGV9k tq0kEACLpT0yXRGcgE0hgPzwPMADzZtzYGW/Dqhh5pru6ZSO4nmhxv9wfM61VPGJP1LgPRl451l 15ob9QAECHwmvx8DXU5p+hm6p82Zz7/exnTmKC8cgkcSp6whygU/BUiFugzr6OralZVIC6JTSS7 MCRTAzbSCfHKNzUMQjGGhryM0W8STYqW7TMQ7o5TDXg8hOn9Ui8W/0rNkpeMf/NnnK8yUHHSkno +OYly4p89VHdZNXUMBnSmr4rZUC4gw3MjwQK82TJEXtiSKCILfgYE7t/OYRs+PA0kWs1697AVma gkjTa8Mgu6vvnTqnI5WF2P3cuN54/XiMcioZ8L8jMXru/vTmyF721WJVDPiLbnK4cH7YkhkXSDq afi5WE2K8AF4ax6E0FEoDJPzLE4aiJ07bC8NQHrY1IFZcrU+ipG8+0LlCDj4SmqWdzR0/9CRNcx qJv8yhewtTwUo31gsfOp6v35Tw7LIzelLFKDC9bnn0oskow27XxAIeO9CKPEv9MUnRhXsnJ2h8G rIFJwHK3/bpVyWtiJWkQtswEfhUl4W3yrem3JQLzN2eL3pa6XkfT6hIgq2ZscBLthJvP9Ur5x2h FxRNNctsW7jz7m23FXd0UfH3qn6HPPPLngEW/tJSRzkgmCa5+PXTaePm0+tJX4eCsbNSGvy3wYR Jkzrq2xlLm0jH9g== X-Developer-Key: i=caleb.connolly@linaro.org; a=openpgp; fpr=83B24DA7FE145076BC38BB250CD904EB673A7C47 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 Hook up support for capsule updates loaded from disk on Qualcomm platforms. Most Qualcomm devices have an A/B partition layout, with most partitions duplicated. The metadata on which slot is active is stored in the GPT headers in the vendor-specific attribute bits of each partition. Add support for reading this attributes via the disk_partition struct and using them to determine which boot partition U-Boot is flashed to and generate the appropriate DFU string. This logic is gated behind a check to ensure that U-Boot is actually being chainloaded and not run via some other mechanism. SCSI support for most Qualcomm platforms is not yet enabled upstream, but will follow in future patches. This series enables capsule updates on the RB2, however [1] is required for it to work properly (as otherwise MMC won't be available). [1]: https://lore.kernel.org/u-boot/20240527-b4-clk-stub-v2-0-29013855e343@linaro.org/ To: Tom Rini To: Simon Glass To: Lukasz Majewski To: Mattijs Korpershoek To: Caleb Connolly To: Neil Armstrong To: Sumit Garg Cc: Ilias Apalodimas Cc: u-boot@lists.denx.de Cc: u-boot-qcom@groups.io Changes in v3: - Address comments in scsi dfu support - enable CONFIG_DFU_SCSI for qcom - Link to v2: https://lore.kernel.org/r/20240527-b4-qcom-capsule-updates-v2-0-47583d7ad428@linaro.org Changes in v2: - Add qcom capsule update support patches - Link to v1: https://lore.kernel.org/r/20240409-b4-dfu-scsi-v1-0-3e1441a60376@linaro.org Acked-by: Sumit Garg --- Caleb Connolly (8): dfu: add scsi backend disk: expose partition type flags mmc: msm_sdhci: work around a bug when writing mach-snapdragon: implement capsule update support qcom_defconfig: savedefconfig mach-snapdragon: use SYSRESET_PSCI mach-snapdragon: bump up heap size qcom_defconfig: enable capsule update support arch/arm/Kconfig | 2 + arch/arm/mach-snapdragon/Kconfig | 3 + arch/arm/mach-snapdragon/Makefile | 1 + arch/arm/mach-snapdragon/board.c | 8 +- arch/arm/mach-snapdragon/capsule_update.c | 147 ++++++++++ arch/arm/mach-snapdragon/qcom-priv.h | 6 + configs/qcom_defconfig | 19 +- disk/part_efi.c | 1 + doc/usage/dfu.rst | 32 +++ drivers/dfu/Kconfig | 7 + drivers/dfu/Makefile | 1 + drivers/dfu/dfu.c | 5 +- drivers/dfu/dfu_scsi.c | 435 ++++++++++++++++++++++++++++++ drivers/mmc/msm_sdhci.c | 7 + include/configs/qcom.h | 5 + include/dfu.h | 26 ++ include/part.h | 1 + 17 files changed, 695 insertions(+), 11 deletions(-) --- change-id: 20240523-b4-qcom-capsule-updates-ea2e4f8f0ff0 base-commit: 5d8881a0801241d68701e8644d495f1d535506f0 // Caleb (they/them)