Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.2/patches/2230932/?format=api
{ "id": 2230932, "url": "http://patchwork.ozlabs.org/api/1.2/patches/2230932/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/20260430084414.1354490-6-richard.genoud@bootlin.com/", "project": { "id": 18, "url": "http://patchwork.ozlabs.org/api/1.2/projects/18/?format=api", "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, "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20260430084414.1354490-6-richard.genoud@bootlin.com>", "list_archive_url": null, "date": "2026-04-30T08:43:58", "name": "[05/20] board: ti: j722s: Add resume detection", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "95106cac1b2268572f9f973ec7abd77ca8d807b0", "submitter": { "id": 88519, "url": "http://patchwork.ozlabs.org/api/1.2/people/88519/?format=api", "name": "Richard Genoud (TI)", "email": "richard.genoud@bootlin.com" }, "delegate": { "id": 3651, "url": "http://patchwork.ozlabs.org/api/1.2/users/3651/?format=api", "username": "trini", "first_name": "Tom", "last_name": "Rini", "email": "trini@ti.com" }, "mbox": "http://patchwork.ozlabs.org/project/uboot/patch/20260430084414.1354490-6-richard.genoud@bootlin.com/mbox/", "series": [ { "id": 502237, "url": "http://patchwork.ozlabs.org/api/1.2/series/502237/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/list/?series=502237", "date": "2026-04-30T08:43:53", "name": "Introduce resume for J7xx SoCs", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/502237/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2230932/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2230932/checks/", "tags": {}, "related": [], "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 (2048-bit key;\n unprotected) header.d=bootlin.com header.i=@bootlin.com header.a=rsa-sha256\n header.s=dkim header.b=JGEIuXJL;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de\n (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de;\n envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org)", "phobos.denx.de;\n dmarc=pass (p=reject dis=none) header.from=bootlin.com", "phobos.denx.de;\n spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de", "phobos.denx.de;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=bootlin.com header.i=@bootlin.com header.b=\"JGEIuXJL\";\n\tdkim-atps=neutral", "phobos.denx.de;\n dmarc=pass (p=reject dis=none) header.from=bootlin.com", "phobos.denx.de;\n spf=pass smtp.mailfrom=richard.genoud@bootlin.com" ], "Received": [ "from phobos.denx.de (phobos.denx.de\n [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01])\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 4g5nms54Psz1yHZ\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 30 Apr 2026 18:45:17 +1000 (AEST)", "from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id D2B298466C;\n\tThu, 30 Apr 2026 10:44:44 +0200 (CEST)", "by phobos.denx.de (Postfix, from userid 109)\n id F1F3B84694; Thu, 30 Apr 2026 10:44:42 +0200 (CEST)", "from smtpout-04.galae.net (smtpout-04.galae.net [185.171.202.116])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))\n (No client certificate requested)\n by phobos.denx.de (Postfix) with ESMTPS id E860D8468E\n for <u-boot@lists.denx.de>; Thu, 30 Apr 2026 10:44:40 +0200 (CEST)", "from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233])\n by smtpout-04.galae.net (Postfix) with ESMTPS id 2BC0EC5CD68;\n Thu, 30 Apr 2026 08:45:25 +0000 (UTC)", "from mail.galae.net (mail.galae.net [212.83.136.155])\n by smtpout-01.galae.net (Postfix) with ESMTPS id A837560495;\n Thu, 30 Apr 2026 08:44:40 +0000 (UTC)", "from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon)\n with ESMTPSA id 03CDB1072B7B2;\n Thu, 30 Apr 2026 10:44:36 +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,\n DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED,\n SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim;\n t=1777538679; h=from:subject:date:message-id:to:cc:mime-version:\n content-transfer-encoding:in-reply-to:references;\n bh=HojJGXhy1EtalH02BCYkFlQezY/8A9+epllHBD71sqc=;\n b=JGEIuXJLCIEbrFm4CWFoAzBMzuOiEg2vTi5bTcU6P187vRpsy8WGoBd5rvAtiMM3Aw6t1L\n 10TSB/C3GdOHeD3k5Qk0T/YPWjh+F5ysAOpf1+5USeiYnOeeOOa67Fi3oXDdKGHVqx1CDZ\n MiWVxwEuF8smmS/Ctg2wrotkdBiBlpDJKSf1++ZTtI2Jzu5ORqU6oylvh6QTp6jc5eSuGl\n CSOd2u0YSinL5fc/647UBlk+NC0tCyu/9VoP4i0S+RaPVQdOzcFJkenISMXDOv8JbUW8ef\n 4SisE/k6+rGCzNKtbOaSy7sY2b20EIvB2g4RyYtu7fB/lsIhf+E8bxUdpAvilQ==", "From": "\"Richard Genoud (TI)\" <richard.genoud@bootlin.com>", "To": "Tom Rini <trini@konsulko.com>, Manorit Chawdhry <m-chawdhry@ti.com>,\n Apurva Nandan <a-nandan@ti.com>, \"Andrew F . Davis\" <afd@ti.com>,\n Vignesh Raghavendra <vigneshr@ti.com>, Bryan Brattlof <bb@ti.com>,\n Vaishnav Achath <vaishnav.a@ti.com>, Jayesh Choudhary <j-choudhary@ti.com>,\n Simon Glass <sjg@chromium.org>, Alper Nebi Yasak <alpernebiyasak@gmail.com>", "Cc": "Markus Schneider-Pargmann <msp@baylibre.com>,\n Udit Kumar <u-kumar1@ti.com>,\n Abhash Kumar <a-kumar2@ti.com>,\n Thomas Richard <thomas.richard@bootlin.com>,\n Gregory CLEMENT <gregory.clement@bootlin.com>,\n Thomas Petazzoni <thomas.petazzoni@bootlin.com>,\n Richard Genoud <richard.genoud@bootlin.com>, u-boot@lists.denx.de", "Subject": "[PATCH 05/20] board: ti: j722s: Add resume detection", "Date": "Thu, 30 Apr 2026 10:43:58 +0200", "Message-ID": "<20260430084414.1354490-6-richard.genoud@bootlin.com>", "X-Mailer": "git-send-email 2.47.3", "In-Reply-To": "<20260430084414.1354490-1-richard.genoud@bootlin.com>", "References": "<20260430084414.1354490-1-richard.genoud@bootlin.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "X-Last-TLS-Session-Version": "TLSv1.3", "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": "Add the capability to detect a resume. This overrides the weak\nfunction j7xx_board_is_resuming().\nTo detect the resume, SPL searches a magic value (0xBA) in a register\nof PMIC.\nThis value is set by DM-Firmware during the suspend sequence.\n\nNB: As this is called in board_init_f(), there's no BSS, so we can't\nuse global/static variables.\n\nNB2: For HS-SE device, we need an extra call to ctrl_mmr_unlock(), and\nwe have to use I2C API instead of PMIC API for this to work.\nThis is because bind is called before anything comes up, in between either\nbootrom or TIFS messing up, clearing pad config and pd config.\n\nCo-developed-by: Udit Kumar <u-kumar1@ti.com>\nSigned-off-by: Udit Kumar <u-kumar1@ti.com>\nSigned-off-by: Richard Genoud (TI) <richard.genoud@bootlin.com>\n---\n arch/arm/mach-k3/j722s/j722s_init.c | 2 +-\n board/ti/j722s/evm.c | 51 +++++++++++++++++++++++++++++\n 2 files changed, 52 insertions(+), 1 deletion(-)", "diff": "diff --git a/arch/arm/mach-k3/j722s/j722s_init.c b/arch/arm/mach-k3/j722s/j722s_init.c\nindex 1180c75f551d..7b3d27c1e855 100644\n--- a/arch/arm/mach-k3/j722s/j722s_init.c\n+++ b/arch/arm/mach-k3/j722s/j722s_init.c\n@@ -37,7 +37,7 @@ static void store_boot_info_from_rom(void)\n \t sizeof(struct rom_extended_boot_data));\n }\n \n-static void ctrl_mmr_unlock(void)\n+void ctrl_mmr_unlock(void)\n {\n \t/* Unlock all WKUP_CTRL_MMR0 module registers */\n \tmmr_unlock(WKUP_CTRL_MMR0_BASE, 0);\ndiff --git a/board/ti/j722s/evm.c b/board/ti/j722s/evm.c\nindex 1173adc072be..86aa10ffb0fd 100644\n--- a/board/ti/j722s/evm.c\n+++ b/board/ti/j722s/evm.c\n@@ -9,12 +9,15 @@\n #include <asm/arch/hardware.h>\n #include <asm/io.h>\n #include <cpu_func.h>\n+#include <dm/device.h>\n #include <dm/uclass.h>\n+#include <i2c.h>\n #include <env.h>\n #include <fdt_support.h>\n #include <spl.h>\n #include <asm/arch/k3-ddr.h>\n #include \"../common/fdt_ops.h\"\n+#include \"../common/k3-lpm.h\"\n \n #if IS_ENABLED(CONFIG_SPL_BUILD)\n void spl_board_init(void)\n@@ -23,6 +26,54 @@ void spl_board_init(void)\n }\n #endif\n \n+#if (IS_ENABLED(CONFIG_SPL_BUILD) && IS_ENABLED(CONFIG_TARGET_J722S_R5_EVM))\n+\n+extern void ctrl_mmr_unlock(void);\n+\n+/* in board_init_f(), there's no BSS, so we can't use global/static variables */\n+bool j7xx_board_is_resuming(void)\n+{\n+\tstruct udevice *pmic, *i2c;\n+\tint err;\n+\n+\tif (gd_k3_resuming() != K3_RESUME_STATE_UNKNOWN)\n+\t\tgoto end;\n+\n+\t/*\n+\t * On HS-SE devices, i2c access fails unless MMR registers are unlocked.\n+\t * Moreover, it fails also if we use PMIC API instead of I2C API.\n+\t */\n+\tctrl_mmr_unlock();\n+\terr = uclass_get_device_by_name(UCLASS_I2C,\n+\t\t\t\t\t\"i2c@2b200000\", &i2c);\n+\tif (err) {\n+\t\tprintf(\"Getting I2C failed: %d\\n\", err);\n+\t\tgoto end;\n+\t}\n+\terr = dm_i2c_probe(i2c, 0x48, 0, &pmic);\n+\tif (err) {\n+\t\tprintf(\"Getting PMIC failed: %d\\n\", err);\n+\t\tgoto end;\n+\t}\n+\n+\tdebug(\"%s: PMIC is detected (%s)\\n\", __func__, pmic->name);\n+\n+\tif (dm_i2c_reg_read(pmic, K3_LPM_SCRATCH_PAD_REG) == K3_LPM_MAGIC_SUSPEND) {\n+\t\tdebug(\"%s: board is resuming\\n\", __func__);\n+\t\tgd_set_k3_resuming(K3_RESUME_STATE_RESUMING);\n+\n+\t\t/* clean magic suspend */\n+\t\tif (dm_i2c_reg_write(pmic, K3_LPM_SCRATCH_PAD_REG, 0))\n+\t\t\tprintf(\"Failed to clean magic value for suspend detection in PMIC\\n\");\n+\t} else {\n+\t\tdebug(\"%s: board is booting (no resume detected)\\n\", __func__);\n+\t\tgd_set_k3_resuming(K3_RESUME_STATE_BOOTING);\n+\t}\n+end:\n+\treturn gd_k3_resuming() == K3_RESUME_STATE_RESUMING;\n+}\n+#endif /* CONFIG_SPL_BUILD && CONFIG_TARGET_J722S_R5_EVM */\n+\n #if defined(CONFIG_XPL_BUILD)\n void spl_perform_board_fixups(struct spl_image_info *spl_image)\n {\n", "prefixes": [ "05/20" ] }