From nobody Fri Oct 2 09:22:59 2026 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2B4AB363C64 for ; Mon, 3 Aug 2026 09:44:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785750297; cv=none; b=ERwOIGahpJqEIeBXTsXbwMOApX1vPcZCuM20a9yYckoNFEqSyDJZhxvkalQMEKwj9F7wIly4xVA5tENoMP1yBuzR3rl/rOPU5XBv1OqpHBjE0C022Y+5EFqJhGSOwNfCtKFhagYFdzi9ePuFWfS8EoTs0R/HFl5dLRrgRdoWcl8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785750297; c=relaxed/simple; bh=2/mMawez6NK626poMyU8T8NA9gdZ6S0XfZEN/N7KY1I=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Vr+zSYpvpraKIsaOH4OsOOIxKzu95Uy6sGJhmbMwFU9qtWmzE+ZS4R6wueNLOptFunv6KxFMuAPXYSto6q/T54fDTi6T9EwJpjUFV/6MdGBxegWtiPUcC0ShZO4oiQcWOkkgslkmWFrvqoV2xNiHgew94ecpD3+NQ0ghfWPzmMA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=ACMmb4Bu; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=Cr1AsSsF; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="ACMmb4Bu"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="Cr1AsSsF" Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6736kqbS4123759 for ; Mon, 3 Aug 2026 09:44:55 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= r1TRODCDblm/9JLtIWphfOP7mJeC6V7GnV66A4jorCE=; b=ACMmb4Bur0R7+p9D 1UUk86nNqNglPnh+L923LAcxwIYAeqPfq5yRZdbDH6fTy2cVwhMki1pskkztKJ1D eZyb3k8Vq3m5EuTewvYPjIDlcHBUocNgHHwMGDtalaumm/1gB4QKB/JrZTzayqzd +n1wlYPRRx/W2mqRzJ5otRnxb0gi3twSsX1fijYpisKpWwOdMm4K1kxIBCCv5BCr S9tmsx2U1XAyXZZtZcXdpIiTUikM/vDgIcPNAQ0C1Uvwtbw7cizKwGtMK9Welwi0 pxZH/GEjKd43S9lip5fiJ5cGvL9JEegI7JoIXY+6+lo+XppbiCKmO0pKP037dFpH GvoxzA== Received: from mail-pj1-f71.google.com (mail-pj1-f71.google.com [209.85.216.71]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4ftp168smj-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 03 Aug 2026 09:44:55 +0000 (GMT) Received: by mail-pj1-f71.google.com with SMTP id 98e67ed59e1d1-38e4758ab46so3712322a91.0 for ; Mon, 03 Aug 2026 02:44:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1785750295; x=1786355095; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=r1TRODCDblm/9JLtIWphfOP7mJeC6V7GnV66A4jorCE=; b=Cr1AsSsF8otfPUvX2hESk1tdFnK25Opq8X+/0ZkC1UI6RMOaXJFcPsWYyUTpRPhHo1 UC/B2s7Tbdh2fJsz1keFNE+0McpqWXRlRxeI9SBn0gxFAPiehjlBGtSDN4eYEfsaKpKM s87CHN+mhLh3By8dW8ZZF3Wv22dQYHWmc8lhiOhn+Dq0inSEK8DKEyFFeSTLAtvkPGOL kAGcx6CSlfoyrUKPUHbM/l0eRYih3agNML5NypwFLv8zQ/vmrxsLzbWp7sSH9pOdm1tB +FnjE+u57TTveAxHEyePbbAxigPH1bcuzXspspfs3oa5BNCkAyDjB9y2Jeg3JXyURLQM 7evg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785750295; x=1786355095; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=r1TRODCDblm/9JLtIWphfOP7mJeC6V7GnV66A4jorCE=; b=JDtLUIhyjQjagDjRVVGo2rajfO6tjcIunkvZUlRiK7mWhfRAIiiGJZstQ9AAPJKon9 U16Ooy6+A1lOX0NjU5tyJdtJoQTO7uABQSMXYSsJHvuLat8fj6BTEUDzpsoWw4sNCRC9 IaKLYqSd7C6tnY9RzEl9wYR2CzCQwwBi8pgNyDRjZIqLOwt2vok0ffWyTKKKIkJxQJpw sVWn6vfiaZHwsnhS3o0rns/Okajwo255znUcksptij0GHVh8gMLlw5/3I3wKOyXhKVO8 TGkLfBOVi3tQixfLwiRkT++gOLj6ELgprTa2bfwD29Sa/3+yGhcXI34YFwtDUd2rZ+s7 dlqA== X-Forwarded-Encrypted: i=1; AHgh+RpGL+kOVzbnZZj2hIeeeyP+eswNGHWhXnihexjLKXk1LfOC9FLmAt4qkZb45pGfWsc+EN048Yx+EppBqac=@vger.kernel.org X-Gm-Message-State: AOJu0Yy/5zQ2szcPttBaZMO49eID8hilG/+oBFWaLZHNKJ/r+aK2g8gM M+soeDmugAuuLaTZjzrAFuTBiekgzvchfjo3P8ZXTaMFIwFlygjSEpAt3SIgOlbciT0nTqzlsHg qq9DaKm1xYNQsQWVGZjGiF0tjCB225DHtOS/724gY7iRFh3l9QEjqe+Lg2vvU4VJ8ANo= X-Gm-Gg: AR+sD13h/A10KcFiaH0mpkmUmAWmCL+K4n1pcvTe7QXGJRbxDNNNoQ5Gv7/isFQvNzL vK7IevAlaeZh6Al6wcyTtXqX0VrP1XnT9KALcVRIfNDanFA0IvONPviOpvkgFb60twrXUTaJsBd jqlfAPBix5iNhySne8ACnrMiqkgUvafc7B4N5lQF0SEA+aIXbRors+dO7l9krk7hJIheYNKrzuo 58Nnw7YAgpEB4dBYUkayy1L1Qz0IoDnQPHc8EaMMJLfj8AM3Ld5oBI316Slw6eD5iHMIqbFeFa6 78wVLyGwXm0qOWyV+8E1Xf6aPdOMleY/3dOB0eY5UU//9k+HSL9RY3aiM+npZ4qNYtJj8gW3D1k IR/b4RLWVtHWTXikiTy7nBzKrldUdZddTKdAG X-Received: by 2002:a17:90b:57e6:b0:38f:23d6:b4ad with SMTP id 98e67ed59e1d1-38fbc3f7e43mr8156689a91.8.1785750294748; Mon, 03 Aug 2026 02:44:54 -0700 (PDT) X-Received: by 2002:a17:90b:57e6:b0:38f:23d6:b4ad with SMTP id 98e67ed59e1d1-38fbc3f7e43mr8156650a91.8.1785750294303; Mon, 03 Aug 2026 02:44:54 -0700 (PDT) Received: from hu-spratap-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-38fb2be6c8csm3660671a91.13.2026.08.03.02.44.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Aug 2026 02:44:54 -0700 (PDT) From: Shivendra Pratap Date: Mon, 03 Aug 2026 15:13:32 +0530 Subject: [PATCH v24 01/12] power: reset: reboot-mode: Support up to 3 magic values per mode Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260803-arm-psci-system_reset2-vendor-reboots-v24-1-889281373870@oss.qualcomm.com> References: <20260803-arm-psci-system_reset2-vendor-reboots-v24-0-889281373870@oss.qualcomm.com> In-Reply-To: <20260803-arm-psci-system_reset2-vendor-reboots-v24-0-889281373870@oss.qualcomm.com> To: Lorenzo Pieralisi , Arnd Bergmann , Bjorn Andersson , Sebastian Reichel , Rob Herring , Souvik Chakravarty , Krzysztof Kozlowski , Andy Yan , Matthias Brugger , Mark Rutland , Conor Dooley , Konrad Dybcio , John Stultz , Moritz Fischer , "Rafael J. Wysocki" , Daniel Lezcano , Christian Loehle , Lee Jones , Ulf Hansson , Pavan Kondeti , Bartosz Golaszewski , Sudeep Holla , Ulf Hansson Cc: Florian Fainelli , Krzysztof Kozlowski , Dmitry Baryshkov , Mukesh Ojha , Andre Draszik , Greg Kroah-Hartman , Kathiravan Thirumoorthy , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, mfd@lists.linux.dev, Shivendra Pratap , Srinivas Kandagatla X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1785750273; l=4572; i=shivendra.pratap@oss.qualcomm.com; s=20250710; h=from:subject:message-id; bh=2/mMawez6NK626poMyU8T8NA9gdZ6S0XfZEN/N7KY1I=; b=xvU9I4zZ2yqhSbHQ4Sj5d5q6B9I3PNsjrVLvkEbssORYCteXpmVFM3Ktc7dyL02b9gY1Ngg4+ pgoUHjBjDIaCTlfsiQkfExsM7V7X88mmS3J73VfAddR6YEZZlU05T2X X-Developer-Key: i=shivendra.pratap@oss.qualcomm.com; a=ed25519; pk=CpsuL7yZ8NReDPhGgq6Xn/SRoa59mAvzWOW0QZoo4gw= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwODAzMDA4NiBTYWx0ZWRfX9GhAKNVcko6s 3QLfunXtaJEjOVZwvkQ8jE8Dbtt5F9aSEDSwtVp7soPIjwRAjStxVQh3xPgy/jorld9jQzHuvIe Q6kJbomnRlTHb9TrO8V8dCiZeUX/Pnlrd2bDCCYMfl74zw9ctho+9+2cf1J5Tn34GOXPw4OG1+1 1u2Vu9hy3uR0D+8/wAc9qywI+c/NwodzhE/zamDHkGsQn5+YKJk7NZkyyw+93zQWckZAAIE72MQ cgLh7IXaeRwNtOFrQ0/+iH3J9FDQ5r48RxC/B2mbHXnXDJBHpDbia3xEXEE+wUW5qdmVIz25Zf4 ZReAYaVMHo71u6od261XPgTyKksmkdT2m9NNWWGdTdmKlxfGXBoSiip//eIF7ODZaMvGQVCKgSc lxvKs6vBWWZ92shPSgA2RZ7uLkC6PL+lt7GSn0FO13uaa3Rvl4qAz8OKur89Pw1lCuZmrmChr5j ym38HFl8M4aBA5fPgdg== X-Authority-Analysis: v=2.4 cv=Wpob99fv c=1 sm=1 tr=0 ts=6a706317 cx=c_pps a=UNFcQwm+pnOIJct1K4W+Mw==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=Sv0fKeRqtYgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yOCtJkima9RkubShWh1s:22 a=EUspDBNiAAAA:8 a=_usNffLPL2KliZ4tEdwA:9 a=QEXdDO2ut3YA:10 a=uKXjsCUrEbL0IQVhDsJ9:22 X-Proofpoint-Spam-Info: AW1haW4tMjYwODAzMDA4NiBTYWx0ZWRfX7qnXGrnfP7x8 yfo6FQlwuRlRvkboU9wh92e8aqW8omAX23iXNM5TaAvfPC2rO9wnuRfjakH8zaNWZL9vfUxu/40 NP+6Lz7QjSTPTKScRnEQicA3NfekWaE= X-Proofpoint-ORIG-GUID: aejlCbYZJI77HskU1n5C6jvJdKFWLo9l X-Proofpoint-GUID: aejlCbYZJI77HskU1n5C6jvJdKFWLo9l X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-08-02_06,2026-07-30_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 malwarescore=0 suspectscore=0 priorityscore=1501 impostorscore=0 spamscore=0 clxscore=1015 phishscore=0 lowpriorityscore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2608030086 ARM PSCI vendor-specific resets, require a 32-bit reset_type and a 64-bit cookie as arguments. This cannot be implemented via the reboot-mode framework, which supports a single 32-bit argument as magic value. Extend the reboot-mode framework to support up to three 32-bit arguments as magic, per reboot-mode. Signed-off-by: Shivendra Pratap --- drivers/power/reset/reboot-mode.c | 46 +++++++++++++++++++++++++++--------= ---- include/linux/reboot-mode.h | 3 +++ 2 files changed, 35 insertions(+), 14 deletions(-) diff --git a/drivers/power/reset/reboot-mode.c b/drivers/power/reset/reboot= -mode.c index af00c00eceee..c7e9285c64e9 100644 --- a/drivers/power/reset/reboot-mode.c +++ b/drivers/power/reset/reboot-mode.c @@ -20,7 +20,8 @@ =20 struct mode_info { const char *mode; - u32 magic; + u32 magic[3]; + u32 count; struct list_head list; }; =20 @@ -72,8 +73,7 @@ static const struct class reboot_mode_class =3D { .dev_groups =3D reboot_mode_groups, }; =20 -static unsigned int get_reboot_mode_magic(struct reboot_mode_driver *reboo= t, - const char *cmd) +static struct mode_info *get_reboot_mode_info(struct reboot_mode_driver *r= eboot, const char *cmd) { const char *normal =3D "normal"; struct mode_info *info; @@ -84,11 +84,11 @@ static unsigned int get_reboot_mode_magic(struct reboot= _mode_driver *reboot, =20 list_for_each_entry(info, &reboot->head, list) if (!strcmp(info->mode, cmd)) - return info->magic; + return info; =20 /* try to match again, replacing characters impossible in DT */ if (strscpy(cmd_, cmd, sizeof(cmd_)) =3D=3D -E2BIG) - return 0; + return NULL; =20 strreplace(cmd_, ' ', '-'); strreplace(cmd_, ',', '-'); @@ -96,21 +96,25 @@ static unsigned int get_reboot_mode_magic(struct reboot= _mode_driver *reboot, =20 list_for_each_entry(info, &reboot->head, list) if (!strcmp(info->mode, cmd_)) - return info->magic; + return info; =20 - return 0; + return NULL; } =20 static int reboot_mode_notify(struct notifier_block *this, unsigned long mode, void *cmd) { struct reboot_mode_driver *reboot; - unsigned int magic; + struct mode_info *info; =20 reboot =3D container_of(this, struct reboot_mode_driver, reboot_notifier); - magic =3D get_reboot_mode_magic(reboot, cmd); - if (magic) - reboot->write(reboot, magic); + info =3D get_reboot_mode_info(reboot, cmd); + if (info && info->count) { + if (reboot->write_array) + reboot->write_array(reboot, info->magic, info->count); + else if (reboot->write && info->magic[0]) + reboot->write(reboot, info->magic[0]); + } =20 return NOTIFY_DONE; } @@ -173,16 +177,22 @@ int reboot_mode_register(struct reboot_mode_driver *r= eboot) struct property *prop; struct device_node *np =3D reboot->dev->of_node; size_t len =3D strlen(PREFIX); - u32 magic; + u32 magic[3]; + int count; int ret; =20 INIT_LIST_HEAD(&reboot->head); =20 for_each_property_of_node(np, prop) { + memset(magic, 0, sizeof(magic)); + if (strncmp(prop->name, PREFIX, len)) continue; =20 - if (device_property_read_u32(reboot->dev, prop->name, &magic)) { + count =3D device_property_count_u32(reboot->dev, prop->name); + + if (count <=3D 0 || count > ARRAY_SIZE(magic) || + device_property_read_u32_array(reboot->dev, prop->name, magic, count= )) { dev_dbg(reboot->dev, "reboot mode %s without magic number\n", prop->name); continue; @@ -194,7 +204,15 @@ int reboot_mode_register(struct reboot_mode_driver *re= boot) goto error; } =20 - info->magic =3D magic; + if (!memchr_inv(magic, 0, count * sizeof(u32))) { + dev_dbg(reboot->dev, "reboot mode %s with zero magic values\n", + prop->name); + info->count =3D 0; + } else { + memcpy(info->magic, magic, count * sizeof(u32)); + info->count =3D count; + } + info->mode =3D kstrdup_const(prop->name + len, GFP_KERNEL); if (!info->mode) { ret =3D -ENOMEM; diff --git a/include/linux/reboot-mode.h b/include/linux/reboot-mode.h index 4a2abb38d1d6..29ae39935d69 100644 --- a/include/linux/reboot-mode.h +++ b/include/linux/reboot-mode.h @@ -2,10 +2,13 @@ #ifndef __REBOOT_MODE_H__ #define __REBOOT_MODE_H__ =20 +#include + struct reboot_mode_driver { struct device *dev; struct list_head head; int (*write)(struct reboot_mode_driver *reboot, unsigned int magic); + int (*write_array)(struct reboot_mode_driver *reboot, const u32 *magic, i= nt count); struct notifier_block reboot_notifier; }; =20 --=20 2.34.1 From nobody Fri Oct 2 09:22:59 2026 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6776B372046 for ; Mon, 3 Aug 2026 09:45:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785750309; cv=none; b=pxUyEf7//KYdlufUJb8+RhRaJysLhMjyd1II8ZN7S+dl3jrOchEXJEUTYtYUSETkvARFbFMQVhEN0cKsWQJtgLhp5zki5DSLOaBoo0jlPLW7xrO8SpK9Rzl31imZMTamkodMrqwiKEU9MhprbClc8yampmUzmaheaqOeb88vPoY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785750309; c=relaxed/simple; bh=VHt/Xlh3dG+fpJVkqBW87GlRrduUY8EYtxecsJfAScc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=sagJQ5BPeeV/PhsuorGxXzFVVKHoBu7FSwS4V9NnEinQuoDrMoRLopHcQ6qOf0acG8eOAzAacez/bci4HFsLxzZfPETgkxP+TsNSN2YcdjjiTEA6bUKP1Yu+ugpfSuWWYxbH6VvZmY2oY/CTMilKwKj0Jze1CjO/QUX81o0H70Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=dC8TsN2a; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=Q3sIG8h0; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="dC8TsN2a"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="Q3sIG8h0" Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6736sYt53790808 for ; Mon, 3 Aug 2026 09:45:06 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= YGhWisHctodCgDQTqMfvDZTRJvhCOI+t/LXjxPoaQTk=; b=dC8TsN2aXECIt1+x mH0L64H5tfQx+aCalssbMb+4UKcyEj+JlztZUNXjJ1s7IKSGzdMJ8R5+AKmlXcsQ pHvICWnDrnaLk2A48yRMeqh9dhqEb74XUTrviCaNIf3Yj8b4xaIW7I5RjEseQu+4 cTkGp3geTDjv8zazFY4katArCMnuDsBTvAk0q8WImNp1Yv1lbKDewecxtTTeMlU/ SMHF6M7+tZX6cuavkKAPCtTfQ+rd82e9yI25WYTYtaoTeCtXUEuyd3S1/tXFQkID n+oDbUx62VUeBSHREESqeFZZEXS2phaywfbuMVQysc9n26RcCXcLWfE8vjR0MH98 l+QAeg== Received: from mail-pj1-f71.google.com (mail-pj1-f71.google.com [209.85.216.71]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4ftp4r0sd4-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 03 Aug 2026 09:45:06 +0000 (GMT) Received: by mail-pj1-f71.google.com with SMTP id 98e67ed59e1d1-38f5ac7416eso3475331a91.3 for ; Mon, 03 Aug 2026 02:45:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1785750305; x=1786355105; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=YGhWisHctodCgDQTqMfvDZTRJvhCOI+t/LXjxPoaQTk=; b=Q3sIG8h0/GDikBLx8LeEhGkisq+Z0/UOJYWm7uwOZvfQNLZc3nI1ry/z25I3q3rS3D KjuK7+FOQdg6ydBswI4MSBqySDoP/oqUaqJZ6KUTp7uu1HW6VXC1kEOj/APJP3/jzk1u +kzbeB+zHq5ytJctNfMNiOg9tRsGI45VdZXi+yIdrXeATCMzd5r1xjFSYcja+KVwy/Wx cW5rDoVcOCnYrLVqWa3WkUQPUxwQ/D+RIOT47oKYnky2ULRV8EFz+UwXRSs9gZU/keIM Sj0fne0Y7uTVnyq4/9YIuhooQ+s6HsaY5CXiMdCDfub3Suu7YZ0l9CNCRRhjH8+BGCG2 UzFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785750305; x=1786355105; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=YGhWisHctodCgDQTqMfvDZTRJvhCOI+t/LXjxPoaQTk=; b=J5J3/JEeQqRzeUzMuYpRRj5pUL1Ko8pO2GLFX6jTdw9dblfG3VZvde66aoYvKdCiAl T6z+pJsTuH7cAJaDNVZSXNukwpssVFF5ar7rrs6pAOa2pHOv1eKs6rKenMPgoQ1WMaSz JpEIPBJUNARzxlOtUizWrf7p811N6enjUlS1+m4ViGptdPRMOourZj4LuPdh0FW6/8Wd dWKnBbhcBsdhY61uAwNO/QBG/D4PINnNqLp5Kw4rp8hZeTc06asYs/MDk385t5/fQgaL sOYD0sJsrAuy+EJNYbiPSKbqqYj1mkNmDLM/GXYvPfsb8dwjhL7ZqEjyf8QQgJLMut3G fitA== X-Forwarded-Encrypted: i=1; AHgh+RpevgXLCdaBNleL3sIu9usYkxI3vpYeRBlq5ccm4kOJ7XuTx/7wOc4DVzROShdAqck6znijZ2Rdcah0K6Y=@vger.kernel.org X-Gm-Message-State: AOJu0YyFse27slJbiUrltYAOaqzh5XptAkAArh8yG4q/BMr5iTUXAufT zwlS1SgNVTGUjz6aFI017g2nFVi+wGrU8Fjco82iRw4ComJJ7a525KHkAwYXrZAxmvTF3DVx06k 8TyOeeoXqMaHZgcjHLVUQborc0VPMkQK0Z7odkemhRoalCSyYFgQrCo5rdj3mKfL+j3s= X-Gm-Gg: AR+sD12BBRO2k4G7Fnr18fuuHlxqs6dATSG6q94e/vDJfk676RyGAVrt2Foum2Mi/II bOnLcR24yoevqHiGy67tEqf/1VlIz33e48Iu/DArd/NbBdpo+z4kWFpWu05vMnB+avannsuWwq1 WDey7uVVhibTj3wO1x+jrP2N7KmWY7dYEOKDzEypoZ2ypyGcSSKmU8rKmkxE32r1JBQY0FNPZVr X5XRWBnr7YEpB5Jgys13BLPNCQVIbd7fZ4QR6hbZgcNjA5ecg9QekcH+4H5sEeHMK6Mdxs/h3Pe Jk5bgbheAV3MH8uIVbCS3WhApzDcVbTePvW3srx6E/uF+kvcxg0irK+qb/7PRnemtfvSeev9zd5 WOlP3YAcPSQ1ZziR/C1mdz8oAI+lO0ZHmsHj6 X-Received: by 2002:a17:90b:3c4a:b0:38e:7cb6:5c2b with SMTP id 98e67ed59e1d1-38fbc55292emr8247672a91.35.1785750305006; Mon, 03 Aug 2026 02:45:05 -0700 (PDT) X-Received: by 2002:a17:90b:3c4a:b0:38e:7cb6:5c2b with SMTP id 98e67ed59e1d1-38fbc55292emr8247603a91.35.1785750304207; Mon, 03 Aug 2026 02:45:04 -0700 (PDT) Received: from hu-spratap-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-38fb2be6c8csm3660671a91.13.2026.08.03.02.44.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Aug 2026 02:45:03 -0700 (PDT) From: Shivendra Pratap Date: Mon, 03 Aug 2026 15:13:33 +0530 Subject: [PATCH v24 02/12] power: reset: reboot-mode: Add support for predefined reboot modes Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260803-arm-psci-system_reset2-vendor-reboots-v24-2-889281373870@oss.qualcomm.com> References: <20260803-arm-psci-system_reset2-vendor-reboots-v24-0-889281373870@oss.qualcomm.com> In-Reply-To: <20260803-arm-psci-system_reset2-vendor-reboots-v24-0-889281373870@oss.qualcomm.com> To: Lorenzo Pieralisi , Arnd Bergmann , Bjorn Andersson , Sebastian Reichel , Rob Herring , Souvik Chakravarty , Krzysztof Kozlowski , Andy Yan , Matthias Brugger , Mark Rutland , Conor Dooley , Konrad Dybcio , John Stultz , Moritz Fischer , "Rafael J. Wysocki" , Daniel Lezcano , Christian Loehle , Lee Jones , Ulf Hansson , Pavan Kondeti , Bartosz Golaszewski , Sudeep Holla , Ulf Hansson Cc: Florian Fainelli , Krzysztof Kozlowski , Dmitry Baryshkov , Mukesh Ojha , Andre Draszik , Greg Kroah-Hartman , Kathiravan Thirumoorthy , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, mfd@lists.linux.dev, Shivendra Pratap , Srinivas Kandagatla X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1785750273; l=12519; i=shivendra.pratap@oss.qualcomm.com; s=20250710; h=from:subject:message-id; bh=VHt/Xlh3dG+fpJVkqBW87GlRrduUY8EYtxecsJfAScc=; b=RyTQv9RQSUt2m47dFwdYdy1ilIZndfJe6rmG6GTmf0/KL9ymQAuae/uOhENWaSS81j+N/g4c8 qRi4+KDDJuMAlW8AFETvbdQB+tIO08+6/KI58OJBYvZjJKzDBbKI/3i X-Developer-Key: i=shivendra.pratap@oss.qualcomm.com; a=ed25519; pk=CpsuL7yZ8NReDPhGgq6Xn/SRoa59mAvzWOW0QZoo4gw= X-Authority-Analysis: v=2.4 cv=X9Ri7mTe c=1 sm=1 tr=0 ts=6a706322 cx=c_pps a=UNFcQwm+pnOIJct1K4W+Mw==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=Sv0fKeRqtYgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yx91gb_oNiZeI1HMLzn7:22 a=EUspDBNiAAAA:8 a=S_7UqdFmbgqGN4e7PDYA:9 a=QEXdDO2ut3YA:10 a=uKXjsCUrEbL0IQVhDsJ9:22 X-Proofpoint-ORIG-GUID: it2JsiCOZQtIBVV_5NkEujq-QnZHiYE7 X-Proofpoint-GUID: it2JsiCOZQtIBVV_5NkEujq-QnZHiYE7 X-Proofpoint-Spam-Info: AW1haW4tMjYwODAzMDA4NiBTYWx0ZWRfX1Sa9aLF5mdjm WQ6eTHsqvvjxUwJqsEQzTI0LqiTES+dJrHWBijwNMzwmVkSP2UA0FHVCQgmOIDXFnX7b3KaIsfV PrupDK1dYxe+X/dE3AdYX73YM0X1zSw= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwODAzMDA4NiBTYWx0ZWRfX4nGrZTuQ2nx7 3bDpx1IC/qFkEqQUsu2tYTqjyLyF1t025NVLMjWIJW8pHyMVTG6xuNVi+K7m8YAMo+qASTf0GD/ b8vm/aU1uS0cg3z/qJl4FHiX4J4GW+HN+z5ixBbH080WPuRO7KcbG827taZOalkfsHfEejTdmPc ioeIxkHyFkb/DvZ7tqpQoUs0PVQZVL3ZwXEFqqeZdh9LNr4oq7oRIxYY4z8sv+Vh4eZGvjjP/OQ awdL5yvB2s9k6yLko3LrxOleduKn3Zf8U4TJL0Cs/e9D6YjC+mBGKvNaFzmxXDXKgXMDyOExNSA FUE/zRA5rJ+48JEfE0RWeZBR7LhXd7eK0Ok07Lwqy9GEmGcgB9LhRxCrMF2LN5fBVEJpErO8CR1 Jjr3zm/h42d43RusprSePvgX4Zd9yo3Zhnn4QXNVO3OKvTc9/EMtzPxdY4X00Cgn/yMBV7ybHlv Ngs3u7X9DJJ9Dbfy8kg== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-08-02_06,2026-07-30_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 impostorscore=0 bulkscore=0 malwarescore=0 priorityscore=1501 phishscore=0 adultscore=0 spamscore=0 lowpriorityscore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2608030086 reboot-mode based drivers can define a reboot-mode by adding it under the reboot-mode node in device tree. This limits such drivers, to define any predefined reboot-modes statically within the driver and creates a dependency on device-tree. Extend the reboot-mode framework to support driver-defined predefined reboot modes. Add a centralized initcall to initialize driver state along with predefined modes. Signed-off-by: Shivendra Pratap --- drivers/power/reset/nvmem-reboot-mode.c | 7 +- drivers/power/reset/qcom-pon.c | 7 +- drivers/power/reset/reboot-mode.c | 192 ++++++++++++++++++++++-----= ---- drivers/power/reset/syscon-reboot-mode.c | 7 +- include/linux/reboot-mode.h | 26 ++++- 5 files changed, 175 insertions(+), 64 deletions(-) diff --git a/drivers/power/reset/nvmem-reboot-mode.c b/drivers/power/reset/= nvmem-reboot-mode.c index d260715fccf6..700732ed0f5b 100644 --- a/drivers/power/reset/nvmem-reboot-mode.c +++ b/drivers/power/reset/nvmem-reboot-mode.c @@ -51,8 +51,11 @@ static int nvmem_reboot_mode_probe(struct platform_devic= e *pdev) if (!nvmem_rbm) return -ENOMEM; =20 - nvmem_rbm->reboot.dev =3D &pdev->dev; - nvmem_rbm->reboot.write =3D nvmem_reboot_mode_write; + ret =3D reboot_mode_driver_init(&nvmem_rbm->reboot, &pdev->dev, + nvmem_reboot_mode_write, NULL, + NULL, 0); + if (ret) + return ret; =20 nvmem_rbm->cell =3D devm_nvmem_cell_get(&pdev->dev, "reboot-mode"); if (IS_ERR(nvmem_rbm->cell)) { diff --git a/drivers/power/reset/qcom-pon.c b/drivers/power/reset/qcom-pon.c index 7e108982a582..f63996994a25 100644 --- a/drivers/power/reset/qcom-pon.c +++ b/drivers/power/reset/qcom-pon.c @@ -70,9 +70,12 @@ static int qcom_pon_probe(struct platform_device *pdev) reason_shift =3D (long)of_device_get_match_data(&pdev->dev); =20 if (reason_shift !=3D NO_REASON_SHIFT) { - pon->reboot_mode.dev =3D &pdev->dev; + error =3D reboot_mode_driver_init(&pon->reboot_mode, &pdev->dev, + qcom_pon_reboot_mode_write, NULL, + NULL, 0); + if (error) + return error; pon->reason_shift =3D reason_shift; - pon->reboot_mode.write =3D qcom_pon_reboot_mode_write; error =3D devm_reboot_mode_register(&pdev->dev, &pon->reboot_mode); if (error) { dev_err(&pdev->dev, "can't register reboot mode\n"); diff --git a/drivers/power/reset/reboot-mode.c b/drivers/power/reset/reboot= -mode.c index c7e9285c64e9..cf8978c0ce22 100644 --- a/drivers/power/reset/reboot-mode.c +++ b/drivers/power/reset/reboot-mode.c @@ -30,12 +30,12 @@ struct reboot_mode_sysfs_data { struct list_head head; }; =20 -static inline void reboot_mode_release_list(struct reboot_mode_sysfs_data = *priv) +static void reboot_mode_release_list(struct list_head *head) { struct mode_info *info; struct mode_info *next; =20 - list_for_each_entry_safe(info, next, &priv->head, list) { + list_for_each_entry_safe(info, next, head, list) { list_del(&info->list); kfree_const(info->mode); kfree(info); @@ -119,6 +119,80 @@ static int reboot_mode_notify(struct notifier_block *t= his, return NOTIFY_DONE; } =20 +/** + * reboot_mode_driver_init - Initialize reboot-mode state + * @reboot: reboot mode driver object to initialize + * @dev: backing device + * @write: write callback to program a single magic value + * @write_array: write callback to program multiple magic values + * @predefined_modes: optional predefined reboot-mode table + * @predefined_mode_count: number of entries in @predefined_modes + * + * Exactly one write callback must be provided by the driver. + * + * This function must be called with a valid @dev before calling + * reboot_mode_register(). + * + * Returns: 0 on success or -EINVAL if callback/predefined mode configurat= ion + * is invalid. + */ +int reboot_mode_driver_init(struct reboot_mode_driver *reboot, + struct device *dev, + int (*write)(struct reboot_mode_driver *reboot, unsigned int magic), + int (*write_array)(struct reboot_mode_driver *reboot, + const u32 *magic, u32 count), + const struct reboot_mode_entry *predefined_modes, + size_t predefined_mode_count) +{ + if (!reboot || !dev) + return -EINVAL; + + if (!write =3D=3D !write_array) + return -EINVAL; + + memset(reboot, 0, sizeof(*reboot)); + reboot->dev =3D dev; + reboot->write =3D write; + reboot->write_array =3D write_array; + reboot->predefined_modes =3D predefined_modes; + reboot->predefined_mode_count =3D predefined_mode_count; + INIT_LIST_HEAD(&reboot->head); + + return 0; +} +EXPORT_SYMBOL_GPL(reboot_mode_driver_init); + +static struct mode_info *reboot_mode_create_info(struct device *dev, const= char *mode, + const u32 *magic, int count) +{ + struct mode_info *info; + + if (!mode || mode[0] =3D=3D '\0') { + dev_err(dev, "invalid mode name\n"); + return ERR_PTR(-EINVAL); + } + + info =3D kzalloc_obj(*info, GFP_KERNEL); + if (!info) + return ERR_PTR(-ENOMEM); + + info->mode =3D kstrdup_const(mode, GFP_KERNEL); + if (!info->mode) { + kfree(info); + return ERR_PTR(-ENOMEM); + } + + if (!memchr_inv(magic, 0, count * sizeof(u32))) { + dev_dbg(dev, "reboot mode %s with zero magic values\n", mode); + info->count =3D 0; + } else { + memcpy(info->magic, magic, count * sizeof(u32)); + info->count =3D count; + } + + return info; +} + static int reboot_mode_create_device(struct reboot_mode_driver *reboot) { struct reboot_mode_sysfs_data *priv; @@ -160,11 +234,38 @@ static int reboot_mode_create_device(struct reboot_mo= de_driver *reboot) return 0; =20 error: - reboot_mode_release_list(priv); + reboot_mode_release_list(&priv->head); kfree(priv); return ret; } =20 +static int reboot_mode_add_predefined_modes(struct reboot_mode_driver *reb= oot) +{ + const struct reboot_mode_entry *modes =3D reboot->predefined_modes; + struct mode_info *info; + size_t i; + + if (!modes) + return 0; + + for (i =3D 0; i < reboot->predefined_mode_count; i++) { + if (modes[i].name && strpbrk(modes[i].name, "\n ,/")) + return -EINVAL; + + if (!modes[i].count || modes[i].count > ARRAY_SIZE(modes[i].magic)) + return -EINVAL; + + info =3D reboot_mode_create_info(reboot->dev, modes[i].name, + modes[i].magic, modes[i].count); + if (IS_ERR(info)) + return PTR_ERR(info); + + list_add_tail(&info->list, &reboot->head); + } + + return 0; +} + /** * reboot_mode_register - register a reboot mode driver * @reboot: reboot mode driver @@ -173,7 +274,7 @@ static int reboot_mode_create_device(struct reboot_mode= _driver *reboot) */ int reboot_mode_register(struct reboot_mode_driver *reboot) { - struct mode_info *info =3D NULL; + struct mode_info *info; struct property *prop; struct device_node *np =3D reboot->dev->of_node; size_t len =3D strlen(PREFIX); @@ -183,52 +284,36 @@ int reboot_mode_register(struct reboot_mode_driver *r= eboot) =20 INIT_LIST_HEAD(&reboot->head); =20 - for_each_property_of_node(np, prop) { - memset(magic, 0, sizeof(magic)); - - if (strncmp(prop->name, PREFIX, len)) - continue; - - count =3D device_property_count_u32(reboot->dev, prop->name); - - if (count <=3D 0 || count > ARRAY_SIZE(magic) || - device_property_read_u32_array(reboot->dev, prop->name, magic, count= )) { - dev_dbg(reboot->dev, "reboot mode %s without magic number\n", - prop->name); - continue; - } - - info =3D kzalloc_obj(*info, GFP_KERNEL); - if (!info) { - ret =3D -ENOMEM; - goto error; - } - - if (!memchr_inv(magic, 0, count * sizeof(u32))) { - dev_dbg(reboot->dev, "reboot mode %s with zero magic values\n", - prop->name); - info->count =3D 0; - } else { - memcpy(info->magic, magic, count * sizeof(u32)); - info->count =3D count; - } - - info->mode =3D kstrdup_const(prop->name + len, GFP_KERNEL); - if (!info->mode) { - ret =3D -ENOMEM; - goto error; - } else if (info->mode[0] =3D=3D '\0') { - kfree_const(info->mode); - ret =3D -EINVAL; - dev_err(reboot->dev, "invalid mode name(%s): too short!\n", - prop->name); - goto error; + if (np) { + for_each_property_of_node(np, prop) { + memset(magic, 0, sizeof(magic)); + if (strncmp(prop->name, PREFIX, len)) + continue; + + count =3D device_property_count_u32(reboot->dev, prop->name); + + if (count <=3D 0 || count > ARRAY_SIZE(magic) || + device_property_read_u32_array(reboot->dev, prop->name, magic, coun= t)) { + dev_dbg(reboot->dev, "reboot mode %s without magic number\n", + prop->name); + continue; + } + + info =3D reboot_mode_create_info(reboot->dev, prop->name + len, + magic, count); + if (IS_ERR(info)) { + ret =3D PTR_ERR(info); + goto error; + } + + list_add_tail(&info->list, &reboot->head); } - - list_add_tail(&info->list, &reboot->head); - info =3D NULL; } =20 + ret =3D reboot_mode_add_predefined_modes(reboot); + if (ret) + goto error; + reboot->reboot_notifier.notifier_call =3D reboot_mode_notify; register_reboot_notifier(&reboot->reboot_notifier); =20 @@ -239,7 +324,6 @@ int reboot_mode_register(struct reboot_mode_driver *reb= oot) return 0; =20 error: - kfree(info); reboot_mode_unregister(reboot); return ret; } @@ -272,7 +356,7 @@ static inline void reboot_mode_unregister_device(struct= reboot_mode_driver *rebo if (!priv) return; =20 - reboot_mode_release_list(priv); + reboot_mode_release_list(&priv->head); kfree(priv); } =20 @@ -282,17 +366,11 @@ static inline void reboot_mode_unregister_device(stru= ct reboot_mode_driver *rebo */ int reboot_mode_unregister(struct reboot_mode_driver *reboot) { - struct mode_info *info; - struct mode_info *next; - unregister_reboot_notifier(&reboot->reboot_notifier); + reboot->reboot_notifier.notifier_call =3D NULL; reboot_mode_unregister_device(reboot); =20 - list_for_each_entry_safe(info, next, &reboot->head, list) { - list_del(&info->list); - kfree_const(info->mode); - kfree(info); - } + reboot_mode_release_list(&reboot->head); =20 return 0; } diff --git a/drivers/power/reset/syscon-reboot-mode.c b/drivers/power/reset= /syscon-reboot-mode.c index e0772c9f70f7..7d3a95e8dfd7 100644 --- a/drivers/power/reset/syscon-reboot-mode.c +++ b/drivers/power/reset/syscon-reboot-mode.c @@ -45,8 +45,11 @@ static int syscon_reboot_mode_probe(struct platform_devi= ce *pdev) if (!syscon_rbm) return -ENOMEM; =20 - syscon_rbm->reboot.dev =3D &pdev->dev; - syscon_rbm->reboot.write =3D syscon_reboot_mode_write; + ret =3D reboot_mode_driver_init(&syscon_rbm->reboot, &pdev->dev, + syscon_reboot_mode_write, NULL, + NULL, 0); + if (ret) + return ret; syscon_rbm->mask =3D 0xffffffff; =20 syscon_rbm->map =3D syscon_node_to_regmap(pdev->dev.parent->of_node); diff --git a/include/linux/reboot-mode.h b/include/linux/reboot-mode.h index 29ae39935d69..560d8b4d67ac 100644 --- a/include/linux/reboot-mode.h +++ b/include/linux/reboot-mode.h @@ -4,14 +4,38 @@ =20 #include =20 +struct reboot_mode_entry { + const char *name; + u32 magic[3]; + u32 count; +}; + struct reboot_mode_driver { struct device *dev; struct list_head head; + /* + * Optional predefined reboot-mode table. + * + * Must be initialized before reboot_mode_register() and remain valid + * until reboot_mode_unregister(). + * + * If a predefined mode name duplicates a DT-defined mode name, + * the DT-defined mode takes precedence. + */ + const struct reboot_mode_entry *predefined_modes; + size_t predefined_mode_count; + int (*write_array)(struct reboot_mode_driver *reboot, const u32 *magic, u= 32 count); int (*write)(struct reboot_mode_driver *reboot, unsigned int magic); - int (*write_array)(struct reboot_mode_driver *reboot, const u32 *magic, i= nt count); struct notifier_block reboot_notifier; }; =20 +int reboot_mode_driver_init(struct reboot_mode_driver *reboot, + struct device *dev, + int (*write)(struct reboot_mode_driver *reboot, unsigned int magic), + int (*write_array)(struct reboot_mode_driver *reboot, + const u32 *magic, u32 count), + const struct reboot_mode_entry *predefined_modes, + size_t predefined_mode_count); int reboot_mode_register(struct reboot_mode_driver *reboot); int reboot_mode_unregister(struct reboot_mode_driver *reboot); int devm_reboot_mode_register(struct device *dev, --=20 2.34.1 From nobody Fri Oct 2 09:22:59 2026 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8C888377A97 for ; Mon, 3 Aug 2026 09:45:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785750320; cv=none; b=RRQiAU2r+xGVjjogIGEbjaLjh6gQR2LtqrnTTzCp5dlkNxxsvmvIA1n3q0lMGUq/KHLS1m4TPyJTpPutI9cZcbackiJddVuPI067cfYJXm+I7Ssx8HYH2gSBWm4AeyBYJUsFs+4hod9wDpkoSHG6Kwzlp4TAi473RFmtbQrwybk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785750320; c=relaxed/simple; bh=8t6y60ki3WvBG4I02nVmPEeD2nL6qsnMaolT7hOv6CM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ewV3db9ayLF+Fh/3YVm67CLEDciXyFttxnxKr9MoB5KyEv+L1tzo7/+9Yp2QjS6YGdCGotbGjEYkOzS43D1ifkBsj9O6zlITOFhAmhVg0Xi3RHWV4jxmM1lSt5RrtceoJgiE29Gcud2hK6yhvTmtk9TkztPB1seCc3IEM6U8VtQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=ZQuyDOHd; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=YNaBQ7RQ; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="ZQuyDOHd"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="YNaBQ7RQ" Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6736S20n051801 for ; Mon, 3 Aug 2026 09:45:16 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= KmS0i4+ikceJ7oOpqw2TVU+CULAM7RtzmwWI6IxadPQ=; b=ZQuyDOHdMIF6FqZP AirHbKY3TucuXt3RZxZ48Ojb0Fsd5u66kwsPlohSF84/WdxpweL0m8ZzfR9byR37 UU51dC5c/JowpPXuU2R9Ocni4FymKEs9rpwjFWJ5tcCeE/APStEjTGdI/jN/NHGe hldVrCeI/bpb0Tq2hka4znRd939hAFPDrUpE8UPuhsYD6OQVAKSthngODVcL0oLc 4sbNPYOv/Qr54sUk/BSoQ6BZM+QB1qvYf733ElK9rIEm5izjYfCopKBvRwwIZ4K7 /JYyGmJ94iSp5/6QZ8JSF62W54vvBZw/dipfrcsiG1BZOC11AzlqrONVbb8l9QZt rgD9Xw== Received: from mail-pj1-f72.google.com (mail-pj1-f72.google.com [209.85.216.72]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4ftnrb8usu-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 03 Aug 2026 09:45:15 +0000 (GMT) Received: by mail-pj1-f72.google.com with SMTP id 98e67ed59e1d1-38e5a616d07so3304155a91.2 for ; Mon, 03 Aug 2026 02:45:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1785750315; x=1786355115; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=KmS0i4+ikceJ7oOpqw2TVU+CULAM7RtzmwWI6IxadPQ=; b=YNaBQ7RQ2j+1wPclR2NlAj9aQl1AYMzo7ohCJ7KlD0FuYDnSqLFxc8DnBNPNaDab5J CIs4bAkmhok6wnBjWD/H96zbM+hM9VWVnlWLRJ6+apzyC2dA2FnCJ7625Vo8VXlahQRJ aEmPrclRcX9jnxfgYgQ/hK7UfUwm48hcFAGoyKcHleBk0Cw99/wsaoU7++LyCx8/60U3 r6Dr+Z1bB6QcpDbYvQDvOVn9MlM2t5QCDXLXvS8K9noAdrtvQzp+4RBHIIgDQ4yPqgcq Rmlh4sb8IQsUw4yZtmqUsVdqsmpLZbK1P+f60e+RQwVrJ99YU+uh3+coGqWMxBN+tHgR Lklw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785750315; x=1786355115; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=KmS0i4+ikceJ7oOpqw2TVU+CULAM7RtzmwWI6IxadPQ=; b=ob3MyS+crmqt2+3l1OWWdvJAn+R3/Zhey3B3DQOzOAnAuYb67laAMCdXk6FD3pvSUb QnV6i0Tav0Z96Vtpcvim4QLF0JyLlzQYv/3Dw7+G8T4uYqIQjrhB9P1q7Z4lKE+zPcQz 1UQjrodPu+dMWfWhfeIa48Oyd2QoPUJHYS0Tzy4LkDL5VZoVmyPyEvPwETrorzBwVqUe CXmAs+R8KFj0oXGppWsBzrAy3a+usOQrchjrhKDRLB+atT3iFEB5liG+OfEBeWHYphtg iB8DQLKAYcRvvHSmn0Pn/TidHLtoM90pxoIcAkEfCRIf9V5CbMS4Tbt93X8imt3hH2/X /6cw== X-Forwarded-Encrypted: i=1; AHgh+RpBIcFkvl7F34MLxAJyIRLfEmY7fijn/81pQV79VnM4s4USihrBqJjxT3Fj8qXR5O41MNGBapRF6P9V4rg=@vger.kernel.org X-Gm-Message-State: AOJu0YwMnR2od79GDdRH9h72jP7sGfIMJXO2Fx+2Uu2WgAxI4UIbV6z5 fbPb4Hu3IuiwRyoRuOX/iqu3763f/lQPPrlWeae9+3PVYEdBtk4c7ezk7EvYWHcLPPE3cLXgcwh DtH7utz8yj2KP2PjlsSHOJ608wMDy9kWXO4+naPswY7jSnigB7Yah0msEiKGde6kQJ9U= X-Gm-Gg: AR+sD11bl58AyfZObQfBdgFEreB39z85CfOT0kKVlzsEpsQpuv1Et992Wz35qzLjp1A AUQv34bNQXSfqSOL4gklp+EuuKUIjD+PX+m+9rZRALn2Ly1+FYgC4IZVJwfRcjK/xTqZxH5DuTO Y1aomLBDVPKnRSAaK3sejPSCPoxRB3WtoDlxoEJynmUtonxz8QbqTFZH77zod7mgxNQUyFh7B3M arpL7yDirCTU84rcWJGBEDPewZLpfAN7eTuaYHhIy3wdBXVbGsSlHhTl7YILIn2VOKA7JvnBC/y YY1CmTuWXbbp4veatp6L+Rx4nFxr9oKLN2spRW3HSBPIY7pRwrvGMD4CX/eeEHV5TWmwZu/sDxK spvl0RSNn/vR1c3q1FPMb+7n/j1jbR1RZylyE X-Received: by 2002:a17:90b:4f48:b0:387:e0db:bc31 with SMTP id 98e67ed59e1d1-38fbc56ca58mr7318553a91.39.1785750314664; Mon, 03 Aug 2026 02:45:14 -0700 (PDT) X-Received: by 2002:a17:90b:4f48:b0:387:e0db:bc31 with SMTP id 98e67ed59e1d1-38fbc56ca58mr7318521a91.39.1785750314185; Mon, 03 Aug 2026 02:45:14 -0700 (PDT) Received: from hu-spratap-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-38fb2be6c8csm3660671a91.13.2026.08.03.02.45.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Aug 2026 02:45:13 -0700 (PDT) From: Shivendra Pratap Date: Mon, 03 Aug 2026 15:13:34 +0530 Subject: [PATCH v24 03/12] firmware: psci: Introduce command-based resets Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260803-arm-psci-system_reset2-vendor-reboots-v24-3-889281373870@oss.qualcomm.com> References: <20260803-arm-psci-system_reset2-vendor-reboots-v24-0-889281373870@oss.qualcomm.com> In-Reply-To: <20260803-arm-psci-system_reset2-vendor-reboots-v24-0-889281373870@oss.qualcomm.com> To: Lorenzo Pieralisi , Arnd Bergmann , Bjorn Andersson , Sebastian Reichel , Rob Herring , Souvik Chakravarty , Krzysztof Kozlowski , Andy Yan , Matthias Brugger , Mark Rutland , Conor Dooley , Konrad Dybcio , John Stultz , Moritz Fischer , "Rafael J. Wysocki" , Daniel Lezcano , Christian Loehle , Lee Jones , Ulf Hansson , Pavan Kondeti , Bartosz Golaszewski , Sudeep Holla , Ulf Hansson Cc: Florian Fainelli , Krzysztof Kozlowski , Dmitry Baryshkov , Mukesh Ojha , Andre Draszik , Greg Kroah-Hartman , Kathiravan Thirumoorthy , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, mfd@lists.linux.dev, Shivendra Pratap , Srinivas Kandagatla X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1785750273; l=7849; i=shivendra.pratap@oss.qualcomm.com; s=20250710; h=from:subject:message-id; bh=8t6y60ki3WvBG4I02nVmPEeD2nL6qsnMaolT7hOv6CM=; b=iEvQgWnrP8vQjP6P5IvdxVeReewecLzubAupX/0UmqFjxielVZ7Bfps9d6wl83I65tpVDLExu icKuZANXYNJAnxQRC8u0vwH19Ja3fDDxi5LUk8MoHzg1/dv03tseGKl X-Developer-Key: i=shivendra.pratap@oss.qualcomm.com; a=ed25519; pk=CpsuL7yZ8NReDPhGgq6Xn/SRoa59mAvzWOW0QZoo4gw= X-Proofpoint-Spam-Info: AW1haW4tMjYwODAzMDA4NiBTYWx0ZWRfX41wJpsklbiOZ HhUv05zRQ+buzGSOTPAZYmJHGySy2rMjEeUiPCSGsN/P6/TVnlmrktMkA2AQPtgjM8TcjVXfeZf ks4sLbMWGcgPUZ45ll0BEwChdmC+JcY= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwODAzMDA4NiBTYWx0ZWRfX+hIyfa+MDpie njw4npbzNYHJaQfBPvsM73LM2vXCOm0aocitHLBExe/S6x0ki2jONy3dthMmEu9LhkXHNMCdurn hW+r7StbZSJ7uvMgeWL6dGyveAK99pdmkIYc0xmaN67E8lEXQ09lUrUhAyqyf/wiHPFyDmWLOv5 Xhf+DzehjTQAhjEdsyyHZXR8+S7n/vFOWb8O1JMlsu3XQaXiV++ahU8j+XeZC+7WfDIazeYnHTw 8lm3KYW47+lsTZ1u7gwHJnK/qIK9a4H1p9W4l/BHbt7BQNtJIGC5X0LJ/fQCTXUwwHlRAr8nqc6 QH/+moqHSlIOn23CgsPhHDI3xSoNM4qfUMP9mNDQxPDPxQs7IAFvl/muRmvIQAJygGQ7C2H+UAJ OghFOcdiUOjJnBxtcSOHuVCQEGAySye8EnkCCNRAzgW+fTNdBuDM154ky3avjRAOEOtVngPfhgH y5xBt/seC1Aka+mlF9g== X-Authority-Analysis: v=2.4 cv=RNSD2Yi+ c=1 sm=1 tr=0 ts=6a70632b cx=c_pps a=RP+M6JBNLl+fLTcSJhASfg==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=Sv0fKeRqtYgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=3WHJM1ZQz_JShphwDgj5:22 a=EUspDBNiAAAA:8 a=njxsUegImOJjkw56WvUA:9 a=QEXdDO2ut3YA:10 a=iS9zxrgQBfv6-_F4QbHw:22 X-Proofpoint-GUID: 1JbdAQTXlZlTbSmg9r325yBEp0pDc78v X-Proofpoint-ORIG-GUID: 1JbdAQTXlZlTbSmg9r325yBEp0pDc78v X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-08-02_06,2026-07-30_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 clxscore=1015 adultscore=0 lowpriorityscore=0 malwarescore=0 phishscore=0 impostorscore=0 priorityscore=1501 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2608030086 PSCI currently supports only two resets - SYSTEM_RESET and SYSTEM_RESET2 ARCH WARM reset. The reset patch is selected based on the Linux reboot_mode variable. The PSCI specification now includes SYSTEM_RESET2 for vendor-specific resets but there's no mechanism to issue these through psci_sys_reset(). Add a command-based reset mechanism that allows reboot-mode drivers to set the PSCI reset command by passing a reset_type and a cookie. Add support for the following reset commands: - SYSTEM_RESET2 vendor-specific resets. - SYSTEM_RESET2 ARCH WARM reset and SYSTEM_RESET (reset_type =3D 0 and cookie one of psci_standard_resets). Unsupported commands fall back to the regular PSCI reset path. Default to the existing reboot_mode-based reset flow unless a reset command is configured. If a kernel panic() or a emergency_restart() occurs after a reset command is set but before the final PSCI reset is issued, ignore the reset command and follow the normal reboot_mode-based reset path. Signed-off-by: Shivendra Pratap --- drivers/firmware/psci/psci.c | 112 +++++++++++++++++++++++++++++++++++++++= +++- include/linux/psci.h | 15 ++++++ 2 files changed, 125 insertions(+), 2 deletions(-) diff --git a/drivers/firmware/psci/psci.c b/drivers/firmware/psci/psci.c index e73bae6cb23a..094303ef7c03 100644 --- a/drivers/firmware/psci/psci.c +++ b/drivers/firmware/psci/psci.c @@ -12,7 +12,9 @@ #include #include #include +#include #include +#include #include #include #include @@ -22,6 +24,7 @@ =20 #include =20 +#include #include #include #include @@ -51,6 +54,15 @@ static int resident_cpu =3D -1; struct psci_operations psci_ops; static enum arm_smccc_conduit psci_conduit =3D SMCCC_CONDUIT_NONE; =20 +struct psci_system_reset_cmd { + u32 reset_type; + u64 cookie; +}; + +static struct psci_system_reset_cmd reset_cmd_data; +static struct psci_system_reset_cmd *reset_cmd; +static DEFINE_MUTEX(reset_cmd_mutex); + bool psci_tos_resident_on(int cpu) { return cpu =3D=3D resident_cpu; @@ -80,6 +92,61 @@ static u32 psci_cpu_suspend_feature; static bool psci_system_reset2_supported; static bool psci_system_off2_hibernate_supported; =20 +static u32 psci_get_sys_reset_fn(const struct psci_system_reset_cmd *cmd) +{ + switch (cmd->cookie) { + case PSCI_SYSTEM_RESET2_ARCH_WARM_RESET: + if (psci_system_reset2_supported) + return PSCI_FN_NATIVE(1_1, SYSTEM_RESET2); + return 0; + case PSCI_SYSTEM_RESET_COLD_RESET: + return PSCI_0_2_FN_SYSTEM_RESET; + default: + return 0; + } +} + +/** + * psci_set_reset_cmd() - Configure the PSCI reset command + * @reset_type: SYSTEM_RESET2 reset type, or 0 for a standard reset + * @cookie: Vendor-defined SYSTEM_RESET2 cookie, or a value from + * enum psci_standard_resets when @reset_type is 0 + * + * For vendor-specific SYSTEM_RESET2 resets, @reset_type and @cookie + * must contain platform-defined values. + * + * For standard resets, @reset_type must be 0 and @cookie must be a + * value from enum psci_standard_resets. + * + * The reset command may be configured only once per boot cycle. + */ +int psci_set_reset_cmd(u32 reset_type, u64 cookie) +{ + if (!reset_type && !cookie) + return -EINVAL; + + scoped_guard(mutex, &reset_cmd_mutex) { + if (reset_cmd) + return -EBUSY; + + reset_cmd_data.reset_type =3D reset_type; + reset_cmd_data.cookie =3D cookie; + /* + * Publish the command only after both fields are fully initialized. + * Readers run from the atomic restart notifier path and must not block. + */ + smp_store_release(&reset_cmd, &reset_cmd_data); + } + + return 0; +} + +bool psci_has_system_reset2_support(void) +{ + return psci_system_reset2_supported; +} +EXPORT_SYMBOL_NS_GPL(psci_has_system_reset2_support, "PSCI"); + static inline bool psci_has_ext_power_state(void) { return psci_cpu_suspend_feature & @@ -306,8 +373,25 @@ static int get_set_conduit_method(const struct device_= node *np) return 0; } =20 -static int psci_sys_reset(struct notifier_block *nb, unsigned long action, - void *data) +static void psci_handle_reset_cmd(const struct psci_system_reset_cmd *cmd) +{ + u32 psci_sys_reset_fn; + + /* PSCI_1_1_RESET_TYPE_VENDOR_START identifies vendor reset types. */ + if ((cmd->reset_type & PSCI_1_1_RESET_TYPE_VENDOR_START) && + psci_system_reset2_supported) { + /* PSCI SYSTEM_RESET2 Vendor-specific reset */ + invoke_psci_fn(PSCI_FN_NATIVE(1_1, SYSTEM_RESET2), + cmd->reset_type, cmd->cookie, 0); + } else { + /* Retrieve the psci reset function from reset_cmd */ + psci_sys_reset_fn =3D psci_get_sys_reset_fn(cmd); + if (!cmd->reset_type && psci_sys_reset_fn) + invoke_psci_fn(psci_sys_reset_fn, 0, 0, 0); + } +} + +static void psci_handle_reboot_mode(void) { if ((reboot_mode =3D=3D REBOOT_WARM || reboot_mode =3D=3D REBOOT_SOFT) && psci_system_reset2_supported) { @@ -320,6 +404,30 @@ static int psci_sys_reset(struct notifier_block *nb, u= nsigned long action, } else { invoke_psci_fn(PSCI_0_2_FN_SYSTEM_RESET, 0, 0, 0); } +} + +static int psci_sys_reset(struct notifier_block *nb, unsigned long action, + void *data) +{ + const struct psci_system_reset_cmd *cmd; + + /* The function psci_handle_reboot_mode follows reboot_mode based + * reset flow and psci_handle_reset_cmd uses reset_cmd based reset flow. + * + * The reset_cmd is configured at the reboot_notifier phase. + * If panic() or emergency_restart() occurs between the reboot_notifier + * and this final reset, skip command-based reset and let reboot_mode dri= ve + * the reset flow. + * + * The function psci_handle_reset_cmd invokes non-returning PSCI SYSTEM_R= ESET + * calls to reset the device. If it returns, either the reset failed, or = the + * command was unsupported. Fallback to reboot_mode based reset flow. + */ + cmd =3D smp_load_acquire(&reset_cmd); + if (data && cmd && !panic_in_progress()) + psci_handle_reset_cmd(cmd); + + psci_handle_reboot_mode(); =20 return NOTIFY_DONE; } diff --git a/include/linux/psci.h b/include/linux/psci.h index 4ca0060a3fc4..e81b1cdeca51 100644 --- a/include/linux/psci.h +++ b/include/linux/psci.h @@ -8,6 +8,7 @@ #define __LINUX_PSCI_H =20 #include +#include #include #include =20 @@ -21,6 +22,16 @@ bool psci_power_state_is_valid(u32 state); int psci_set_osi_mode(bool enable); bool psci_has_osi_support(void); =20 +/** + * enum psci_standard_resets - Standard reset selectors for PSCI reset + * @PSCI_SYSTEM_RESET_COLD_RESET: Standard SYSTEM_RESET command. + * @PSCI_SYSTEM_RESET2_ARCH_WARM_RESET: SYSTEM_RESET2 architectural warm r= eset. + */ +enum psci_standard_resets { + PSCI_SYSTEM_RESET_COLD_RESET =3D 1, + PSCI_SYSTEM_RESET2_ARCH_WARM_RESET, +}; + struct psci_operations { u32 (*get_version)(void); int (*cpu_suspend)(u32 state, unsigned long entry_point); @@ -45,8 +56,12 @@ struct psci_0_1_function_ids get_psci_0_1_function_ids(v= oid); =20 #if defined(CONFIG_ARM_PSCI_FW) int __init psci_dt_init(void); +int psci_set_reset_cmd(u32 reset_type, u64 cookie); +bool psci_has_system_reset2_support(void); #else static inline int psci_dt_init(void) { return 0; } +static inline int psci_set_reset_cmd(u32 reset_type, u64 cookie) { return = -EOPNOTSUPP; } +static inline bool psci_has_system_reset2_support(void) { return false; } #endif =20 #if defined(CONFIG_ARM_PSCI_FW) && defined(CONFIG_ACPI) --=20 2.34.1 From nobody Fri Oct 2 09:22:59 2026 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 45BCD36B901 for ; Mon, 3 Aug 2026 09:45:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785750329; cv=none; b=YxuN6yhfBgxWSY1zzRijqJzZI9N1t+kzUdcXdfLceMYmraWi2N3+DR7w+WwkHASWaZkoa+19GMzSCSGorot4q7GvwE6ayqqsZFLihx2LUIzNxZrg8u6zpHg/k2QlQ1YTRC7CLIk+KPRJVvBVqqt0+ZWWVD2rjGw4ibbdiciTJ6c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785750329; c=relaxed/simple; bh=14Wda5kuxCa3ilXVAoY0TfVZfkEE9VqcOuvoOICdoVs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=iATr13yfkFNQIvehOxYlOqI+wjf+ljGUc/BnAyAuj2Vbn5W7mJHreFjZe8AHhNCQFszw4/eS4GpO7fPRt/R052GZPV1GZAAYrK1tyMbjzK2z3+wRqdMRk3wtJn3fhOxJGuWBKm8tlem/zW6c5nkzcyyI1jo5yLUKUiiS6fjtJ4Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=S9Y4Ke9f; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=WlFpFPCN; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="S9Y4Ke9f"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="WlFpFPCN" Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6736F4tu005963 for ; Mon, 3 Aug 2026 09:45:26 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= V4D+pGGbNl/vhgsCUDZ0lT7ihke5qeqjPnm8lr8lBIY=; b=S9Y4Ke9fetdzZCLQ d6W0xPF+376FSs+qGvUboSD902GzFzpnyvsGxO+QG4vh6MigY7lcE7cFRPNNgMb3 82v5VS+bd018/IzcLxFUZ/0k6evixIgnNGWYdz8B+L+OmdmaXudkHvxyWnw5p0i9 +srfy5PEgYEsqxVVUzQu1bUj/Eu0XGuxE5Tn0jVpF1JCZCcbjjPVgHJ51jm0F324 h/b7k08U0iffJFFVXCr1ED0LGDeqQAFXP1FwVzBkfHtMYvFsuuQvZdxtkF3W3Efy I4Xt80jwBCoOW1frLsbbaRVXzbAIXeVV3M4Nr+a5m9Eeqda1N7g3srwOpLpt5i/z Krk/7Q== Received: from mail-pj1-f71.google.com (mail-pj1-f71.google.com [209.85.216.71]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4ftnj78vru-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 03 Aug 2026 09:45:26 +0000 (GMT) Received: by mail-pj1-f71.google.com with SMTP id 98e67ed59e1d1-38e25e4b41cso3619356a91.0 for ; Mon, 03 Aug 2026 02:45:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1785750325; x=1786355125; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=V4D+pGGbNl/vhgsCUDZ0lT7ihke5qeqjPnm8lr8lBIY=; b=WlFpFPCNR7JhWyKWz458/FnwxI7kqWgC6a+LGdzrouonWNZwbeHts5InyvpSI/AqeA ELA1dfCyqR6RZmz9jz/Psjie0zlRq5Bpj+diXF8l9/Ee9XJC5o+z8hPMJdOM+9pdqxZH kXnoXmk/yA38i68QmObwGuzVnN0/NBxe27m+ashgLFwFhGzFuJvqwGodQ/nhGD519Nj+ mDXTDc2AQeK4j1RsdVK8+UVbuk9265Bk7GYo+yuINVSInuuUKxH9JWhBYSoX15jAzse0 le8BzUISD3TIYPak2bwCNGTHeUEkcuIefub4HoDQ8UW6cltHUwueZIRcgkfIKcjkL8xu 4i+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785750325; x=1786355125; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=V4D+pGGbNl/vhgsCUDZ0lT7ihke5qeqjPnm8lr8lBIY=; b=eUobWBhJHslWN51rmV3glQrw7P5NnsUNLedGou4HJn4M1n7YGn9wQCyaGWxv0nr4Yx QDoSNmiZrLFan+P17Q5Ljb3EuXu6yMi1EZl05hy1EcIrosF1PNC34ntQDlzy+AZQO4mD U5y87EU2dI9AsxlpSHWiAa81tdghx+qaDQ6p/qIQK7YXDUwuWGw/WYq5zgv77keASIyW SlKXq8YRjPYt+odxqLZgiClTqfHO1b0K0t1hnRmGsT6ltDQPvie0xubRLrnnMMJS9s+k DhP3eyv07YzCEcjkzvDpdzjPUavftQzIEcnJ0s2O4OfChMoYhAN4bU2MwKserLjHkDSS cUoQ== X-Forwarded-Encrypted: i=1; AHgh+RqCtDB+NzJXGkIz8Av/7FdVWnz7hpQ6zPNmmo7bvrLpN67XXyHZP7XPEJT1kl0ElU2kBqJtBITOL7+fowc=@vger.kernel.org X-Gm-Message-State: AOJu0Yw3eP6/qm7vkAsei7tC/BY3DXbttsXYKakbljKXxFkhL4FMpVWQ sOIJka0MtLwWSioh79u6PARIlGd6mu5ptbCbczwx4R37rj41Dj/J/yn1beKGUUd1uhfTvJOxaSy wVvE2XEapadxnEwhBO8Pe+x2hzxbEjPuPJaKmWx+zCqUUbV0mtE/sqKvG5IOzLhKDB4s= X-Gm-Gg: AR+sD11VQWf625gkTu3LlOby2JLCDtHprEcVpXw8jirgSzyarJ5FpmdKU9O0OBAySSo 9NWnl5kzmC8Meem0yIO8M5LQPJnmdAQP0c4w6X0Z3uvUKur3yiuYiSFZLhVmy9mvn0QB+3rl2cw 63RDT1imnJObgfdiJqpyPD6VOhoqQFZbqgH+lr+S78h2ozNlLzNx1937OhrINPXP2QS3S15AZ3X dGL7kpihUDlq64oU5oj+jXthLLjw4Jm8YRfZv0977dao1l4nf0xMC5z/y4xDs7/wMjNngz6HOXV eItZE48vArXtvr/w6G8pZ/l51cGHvvs8sL72+1/kYY+5Az+DHcw+2GJUoFRDKQ/t2MC2J9zMkEy uk/i+Pl41TgD8Y1ljFvzIEao2aMymXPNoqwtt X-Received: by 2002:a17:90b:2ccf:b0:38f:57f0:1f4b with SMTP id 98e67ed59e1d1-38fbc576496mr7546514a91.35.1785750325052; Mon, 03 Aug 2026 02:45:25 -0700 (PDT) X-Received: by 2002:a17:90b:2ccf:b0:38f:57f0:1f4b with SMTP id 98e67ed59e1d1-38fbc576496mr7546477a91.35.1785750324313; Mon, 03 Aug 2026 02:45:24 -0700 (PDT) Received: from hu-spratap-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-38fb2be6c8csm3660671a91.13.2026.08.03.02.45.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Aug 2026 02:45:24 -0700 (PDT) From: Shivendra Pratap Date: Mon, 03 Aug 2026 15:13:35 +0530 Subject: [PATCH v24 04/12] mfd: psci-mfd: Add PSCI MFD driver for cpuidle-psci-domain cell Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260803-arm-psci-system_reset2-vendor-reboots-v24-4-889281373870@oss.qualcomm.com> References: <20260803-arm-psci-system_reset2-vendor-reboots-v24-0-889281373870@oss.qualcomm.com> In-Reply-To: <20260803-arm-psci-system_reset2-vendor-reboots-v24-0-889281373870@oss.qualcomm.com> To: Lorenzo Pieralisi , Arnd Bergmann , Bjorn Andersson , Sebastian Reichel , Rob Herring , Souvik Chakravarty , Krzysztof Kozlowski , Andy Yan , Matthias Brugger , Mark Rutland , Conor Dooley , Konrad Dybcio , John Stultz , Moritz Fischer , "Rafael J. Wysocki" , Daniel Lezcano , Christian Loehle , Lee Jones , Ulf Hansson , Pavan Kondeti , Bartosz Golaszewski , Sudeep Holla , Ulf Hansson Cc: Florian Fainelli , Krzysztof Kozlowski , Dmitry Baryshkov , Mukesh Ojha , Andre Draszik , Greg Kroah-Hartman , Kathiravan Thirumoorthy , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, mfd@lists.linux.dev, Shivendra Pratap , Srinivas Kandagatla , Bartosz Golaszewski X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1785750274; l=5547; i=shivendra.pratap@oss.qualcomm.com; s=20250710; h=from:subject:message-id; bh=14Wda5kuxCa3ilXVAoY0TfVZfkEE9VqcOuvoOICdoVs=; b=9IqK9YQfeGIBQH2lyLywWk9vUay4MYLXLPwLUwHLrLKBYO/8Fz8A7JrYANArZU5BL46C/TEgs twT/hme0T3ZCsPgPRUMBhJv6UlJYhfMCWuJUcw8p0DoR+YHJ9GsV42P X-Developer-Key: i=shivendra.pratap@oss.qualcomm.com; a=ed25519; pk=CpsuL7yZ8NReDPhGgq6Xn/SRoa59mAvzWOW0QZoo4gw= X-Proofpoint-ORIG-GUID: -nudDbXhY1Vbt-kuAAt4GU_t_mOebLN0 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwODAzMDA4NiBTYWx0ZWRfX6JsqV11Ehehc Yu2PszcIUhYW9i9OnbPSSq/lP+gGMz96EHdnIbtNw0aG/Ya5t96R6Tf0ESzD/8PCRyrnpC+Hkyy jp5JZvv2Fb+KmY9UEXxv2xigWSTdG9goy+8xMc+URnkYb1GUDGOApeU0MuYXH8GAvK+i0EHWYna nyR9EQcrjA0y9jj9p9NpByOHVlh0IO9mvER3QM5OMSppY2nJmKVB4U6Qgfg/1HwuoVmzxl3vhfW LHPZHzqGLqZfVrpC3x7MbBd4TZI+Y7V2FBhig9GWnIgojT1iFfdsO2rvCLtx0nBuuuymNmhyuzJ En8VXUsq/nuVhdoCjJ7uOIkjQqgcyNMJdndb+VGl5lS09smFv2rgzd06YEDgWYSZMqYE938pGMD 5Ty2cuo2wYeCoqlcN9/piS/5KfeWYVFjxuySpEhVUK7D4/M5UUjlMisJTdcuzvLdvb/efUg98p9 4zLAwH91lh7HsAlk/ig== X-Proofpoint-GUID: -nudDbXhY1Vbt-kuAAt4GU_t_mOebLN0 X-Authority-Analysis: v=2.4 cv=PqSjqQM3 c=1 sm=1 tr=0 ts=6a706336 cx=c_pps a=UNFcQwm+pnOIJct1K4W+Mw==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=Sv0fKeRqtYgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=_glEPmIy2e8OvE2BGh3C:22 a=EUspDBNiAAAA:8 a=JfrnYn6hAAAA:8 a=wfThnEy5_2w5d1iZ5YkA:9 a=QEXdDO2ut3YA:10 a=uKXjsCUrEbL0IQVhDsJ9:22 a=1CNFftbPRP8L7MoqJWF3:22 X-Proofpoint-Spam-Info: AW1haW4tMjYwODAzMDA4NiBTYWx0ZWRfX0gj6wbGvYejY z2SB4F/WOQW7I02saIKs0xeQK2CEZKeXzRonDPIG0/U1Msk3yIUglPWe1t0DIiRWe4qIs/KzBtN k/49YlLs8jbZUU5eJKXBbNi85mx+NJg= X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-08-02_06,2026-07-30_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 phishscore=0 spamscore=0 priorityscore=1501 adultscore=0 clxscore=1015 impostorscore=0 suspectscore=0 bulkscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2608030086 PSCI has multiple kernel consumers, such as cpuidle-psci-domain. Currently, both the PSCI core driver and cpuidle-psci-domain bind directly to the same PSCI node "arm,psci-1.0". Additional consumers, if introduced, would also need to bind in the same way, leading to several drivers attached to a single device node. Introduce a PSCI MFD driver that binds to "arm,psci-1.0" and registers PSCI child cells. As the first user, register cpuidle-psci-domain as a child cell. Update cpuidle-psci-domain to probe as an MFD child and use the parent PSCI node for power-domain traversal. Suggested-by: Bartosz Golaszewski Reviewed-by: Bartosz Golaszewski Signed-off-by: Shivendra Pratap --- MAINTAINERS | 1 + drivers/cpuidle/Kconfig.arm | 1 + drivers/cpuidle/cpuidle-psci-domain.c | 9 +------- drivers/mfd/Kconfig | 12 ++++++++++ drivers/mfd/Makefile | 2 ++ drivers/mfd/psci-mfd.c | 43 +++++++++++++++++++++++++++++++= ++++ 6 files changed, 60 insertions(+), 8 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index fe67f7bfa44c..0b6e4f89f319 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -21671,6 +21671,7 @@ L: linux-arm-kernel@lists.infradead.org (moderated = for non-subscribers) S: Maintained F: Documentation/devicetree/bindings/arm/psci.yaml F: drivers/firmware/psci/ +F: drivers/mfd/psci-mfd.c F: include/linux/psci.h F: include/uapi/linux/psci.h =20 diff --git a/drivers/cpuidle/Kconfig.arm b/drivers/cpuidle/Kconfig.arm index b88b01aa5829..c5ecca0d7397 100644 --- a/drivers/cpuidle/Kconfig.arm +++ b/drivers/cpuidle/Kconfig.arm @@ -36,6 +36,7 @@ config ARM_PSCI_CPUIDLE_DOMAIN bool "PSCI CPU idle Domain" depends on ARM_PSCI_CPUIDLE depends on PM_GENERIC_DOMAINS_OF + depends on MFD_PSCI select DT_IDLE_GENPD default y help diff --git a/drivers/cpuidle/cpuidle-psci-domain.c b/drivers/cpuidle/cpuidl= e-psci-domain.c index b9e4ad7d43a3..a2d01810f295 100644 --- a/drivers/cpuidle/cpuidle-psci-domain.c +++ b/drivers/cpuidle/cpuidle-psci-domain.c @@ -17,7 +17,6 @@ #include #include #include -#include =20 #include "cpuidle-psci.h" #include "dt_idle_genpd.h" @@ -122,14 +121,9 @@ static void psci_pd_remove(void) } } =20 -static const struct of_device_id psci_of_match[] =3D { - { .compatible =3D "arm,psci-1.0" }, - {} -}; - static int psci_cpuidle_domain_probe(struct platform_device *pdev) { - struct device_node *np =3D pdev->dev.of_node; + struct device_node *np =3D pdev->dev.parent->of_node; bool use_osi =3D psci_has_osi_support(); int ret =3D 0, pd_count =3D 0; =20 @@ -181,7 +175,6 @@ static struct platform_driver psci_cpuidle_domain_drive= r =3D { .probe =3D psci_cpuidle_domain_probe, .driver =3D { .name =3D "psci-cpuidle-domain", - .of_match_table =3D psci_of_match, }, }; =20 diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig index e4fd4572472f..d18655d76172 100644 --- a/drivers/mfd/Kconfig +++ b/drivers/mfd/Kconfig @@ -2374,6 +2374,18 @@ config MFD_KHADAS_MCU additional drivers must be enabled in order to use the functionality of the device. =20 +config MFD_PSCI + bool "PSCI MFD for psci child cells" + depends on ARM_PSCI_FW + depends on OF + select MFD_CORE + default y + help + PSCI MFD registers PSCI child cells and exposes them as + platform devices. Child drivers are probed only if enabled in the + kernel configuration. Select this option whenever a supported PSCI + child driver is selected. + config MFD_ACER_A500_EC tristate "Support for Acer Iconia Tab A500 Embedded Controller" depends on I2C diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile index 72d3944b0ad8..f3edfad702ff 100644 --- a/drivers/mfd/Makefile +++ b/drivers/mfd/Makefile @@ -24,6 +24,8 @@ obj-$(CONFIG_MFD_EXYNOS_LPASS) +=3D exynos-lpass.o obj-$(CONFIG_MFD_GATEWORKS_GSC) +=3D gateworks-gsc.o obj-$(CONFIG_MFD_MACSMC) +=3D macsmc.o =20 +obj-$(CONFIG_MFD_PSCI) +=3D psci-mfd.o + obj-$(CONFIG_MFD_TI_LP873X) +=3D lp873x.o obj-$(CONFIG_MFD_TI_LP87565) +=3D lp87565.o obj-$(CONFIG_MFD_TI_AM335X_TSCADC) +=3D ti_am335x_tscadc.o diff --git a/drivers/mfd/psci-mfd.c b/drivers/mfd/psci-mfd.c new file mode 100644 index 000000000000..7affd6bb09dd --- /dev/null +++ b/drivers/mfd/psci-mfd.c @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries. + */ + +#include +#include +#include +#include + +static const struct mfd_cell psci_cells[] =3D { + { + .name =3D "psci-cpuidle-domain", + }, +}; + +static int psci_mfd_probe(struct platform_device *pdev) +{ + return devm_mfd_add_devices(&pdev->dev, PLATFORM_DEVID_AUTO, psci_cells, + ARRAY_SIZE(psci_cells), NULL, 0, NULL); +} + +static const struct of_device_id psci_mfd_of_match[] =3D { + { .compatible =3D "arm,psci-1.0" }, + { } +}; + +static struct platform_driver psci_mfd_driver =3D { + .probe =3D psci_mfd_probe, + .driver =3D { + .name =3D "psci-mfd", + .of_match_table =3D psci_mfd_of_match, + }, +}; + +static int __init psci_mfd_init(void) +{ + return platform_driver_register(&psci_mfd_driver); +} + +core_initcall(psci_mfd_init); + +MODULE_LICENSE("GPL"); --=20 2.34.1 From nobody Fri Oct 2 09:22:59 2026 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D6B413822B5 for ; Mon, 3 Aug 2026 09:45:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785750341; cv=none; b=E0MM8+W02qGDWOAWLdDLbGHjSXWAeMHeBPjsmOxb3K/vkE6UJQe335pYdp5TiCILwmazQoRuXhOkW+ysDl7aszhmdp1Mvyb/RYAAI86J3nQ9d5VHADkurHJyBLhVo5jZkVvQ+fpAXk701/Uw2ivrZlva3u4x/m2Nx9tGnzRwZlY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785750341; c=relaxed/simple; bh=jx181RVT+Xa3QJe2eg0re3HefIe2r4k0bcdeIdeVIYk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=aCG7Zc1s4cRD/hHxlb5kkXSrwSJQXIw7e8SBPLQedSfnjgihdi6cqCHQlzUcHie85sYhVAhORckStr9FG4/1fs5SNcU7FNJN98JpElInPTwMkE4fdyenBC+zA44ETiP92ATr3uuUXvzW8WYYQJHy9nhhyQ+puZNPIVWm3XVwbTU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=CLhBfX3A; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=Qjyi66Xv; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="CLhBfX3A"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="Qjyi66Xv" Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6736bFdj3956941 for ; Mon, 3 Aug 2026 09:45:35 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= Yv45iK+EJbGOlrtao0TiTSTpdAWP/+S9LANR6C5Wz5c=; b=CLhBfX3AmtRTNkLt iIde/hqO/gts/Wqk2Mg8iV4Yoo4OYdP9JTLto7pabGM7TDY6G33LADCMuTL4TL+K 9ci8OpngdrQyJqhnkhzlCEOqSyf18HQ5IIwFZhHpcauoSlPNdp4DxX7ntJimVTw7 /MvxD0bYNzZRCyBbKGvG4A00iUXCUvZ8+gfLpXPn9vG/2eNDeKNzvp0CA0BILxYZ totClmRlREic6+ovDIMAluL/Wdz+m/k6pRTSqQdFbYZ8fQhgkekboSazWf2jgw19 Kfh7oqzMALT82IpI+90f7QKG3KlqdU+mMK/OXk6K/ew3r7fzalDuhBehE+ExBjYL BdRiIw== Received: from mail-pj1-f69.google.com (mail-pj1-f69.google.com [209.85.216.69]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4ftnvngu9n-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 03 Aug 2026 09:45:35 +0000 (GMT) Received: by mail-pj1-f69.google.com with SMTP id 98e67ed59e1d1-38e475f83a2so5371825a91.1 for ; Mon, 03 Aug 2026 02:45:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1785750335; x=1786355135; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=Yv45iK+EJbGOlrtao0TiTSTpdAWP/+S9LANR6C5Wz5c=; b=Qjyi66XvxLWQLzFRZujiGXg3hEwIFxYOfvSS2pVCIXTy/mzdwg1lE6rS7n+1MqjN/m uqRSt3oe4xeuHqc5/TTwf3iX5B9pOsnZ1oQWzp5SKGuf7d42rwJgS//6W0MRV6Hq9LWE yG4JBQ6B+gzKJjbz0a8ENuB8ukYlLZiJhWQZjJ9EgTq4mptMlHVprSWj+1/PoRLAW64H nL5NRmufafZPssKcG9/61TsrqEQbjIkJi/i8LE4c/Cqm0Hnojg4ICU9xV/o07YiqNxH5 sB7dIVSTY4b+tLgRdhYYjM1RgwB1l2Hu+EVEuIJFGqjz5Qh77PQWhUrA4fHaHgRiRU8o aEVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785750335; x=1786355135; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=Yv45iK+EJbGOlrtao0TiTSTpdAWP/+S9LANR6C5Wz5c=; b=TVWKgeXHwIMdDua5FR+K3Qq71ZmOeUCdnve8atV2rC4bGoScfNGQIUZNvANYHe2UM/ i57jOlE2/PwoV3Qopx2Uc9rwqrAheZKJR+4RlsmDwvze9ipcwbypUyJK1bWft68B7Ip9 4m/1dfieXTxDQOleK4OPGw35UyzZ75zyqGBjST+tVX+1fwSo7Vlcs2glLHFY/B/8SDs2 AQSl4PeCHvvwG6W39Y4X/7w86rIR2nGvfC/9JUysFFds/U0TEFUPrNh93D6tsCz5Jkvq PrmOkdlbg9GQiLLlOMHBncQhQ/d3+cOnWpXj/0sKNpx0wTA4qIqhzrFTjvub4audpV7/ cDHw== X-Forwarded-Encrypted: i=1; AHgh+RprsSqLTphe2EfbeMLw6+jDtQBRoSPyoGt06MBPqNeQGcT0SBgEwSWoYRquJriy0BUukYGADhY0bfAwTKg=@vger.kernel.org X-Gm-Message-State: AOJu0YyaJa+4L/ct2JdJYe7VvIkIFA3hHv5e5zHKj+mfRlK6QAsd67o+ 3xoNluN7adw2OegITKdHqKrJmxl8JwoiHIIeY5JxiMUGJ416xRJkCsXQg0Pb8euqg6s3YFTFPGG c9edV7fs0hw3ieJzuhbAKBBKcPaevuggv3k3D5A9r3L10+SKRQ+hjloBVwdCP39Lbyf0= X-Gm-Gg: AR+sD11jrt75cUsWGsTu8vy2Ol+9bLIh9XP31Sl/mkYCGMuUKx9pNJd0nC5jMfffZEp IrPll+ofK0kVhy8maJEL8B1oPO+yanlDu70ViWtYX48N9bi9T8YC1BRJs/kbWyAJ7p/Ac1jkbcZ L4hEG8FTIcPwkpeksBfD6n6c/n1KOr6yjGCoH9igOARkNUER2rduALFACHLjYgLI2wmut2Pwwi1 0KsTlVFcxNx1opF1GWPlA5Umw556yYejAveSTZiRyis/EOlu9wXCVUC2GohZ+h8/82KYnB8hEAX KQERtKvLfA9W1ItmdfiON+6vKFTnCdq99/72G+ZHcsyHoBT7d77ZuV11t60l7q8iJiMTcLkCYRg WgB0oKQAyFsnhHRjB/imEgM8hBvSDS415J3AG X-Received: by 2002:a17:90b:3c4a:b0:389:8f6c:4d58 with SMTP id 98e67ed59e1d1-38fbc579dd9mr8679791a91.34.1785750334570; Mon, 03 Aug 2026 02:45:34 -0700 (PDT) X-Received: by 2002:a17:90b:3c4a:b0:389:8f6c:4d58 with SMTP id 98e67ed59e1d1-38fbc579dd9mr8679766a91.34.1785750334150; Mon, 03 Aug 2026 02:45:34 -0700 (PDT) Received: from hu-spratap-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-38fb2be6c8csm3660671a91.13.2026.08.03.02.45.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Aug 2026 02:45:33 -0700 (PDT) From: Shivendra Pratap Date: Mon, 03 Aug 2026 15:13:36 +0530 Subject: [PATCH v24 05/12] dt-bindings: arm: Document reboot mode magic Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260803-arm-psci-system_reset2-vendor-reboots-v24-5-889281373870@oss.qualcomm.com> References: <20260803-arm-psci-system_reset2-vendor-reboots-v24-0-889281373870@oss.qualcomm.com> In-Reply-To: <20260803-arm-psci-system_reset2-vendor-reboots-v24-0-889281373870@oss.qualcomm.com> To: Lorenzo Pieralisi , Arnd Bergmann , Bjorn Andersson , Sebastian Reichel , Rob Herring , Souvik Chakravarty , Krzysztof Kozlowski , Andy Yan , Matthias Brugger , Mark Rutland , Conor Dooley , Konrad Dybcio , John Stultz , Moritz Fischer , "Rafael J. Wysocki" , Daniel Lezcano , Christian Loehle , Lee Jones , Ulf Hansson , Pavan Kondeti , Bartosz Golaszewski , Sudeep Holla , Ulf Hansson Cc: Florian Fainelli , Krzysztof Kozlowski , Dmitry Baryshkov , Mukesh Ojha , Andre Draszik , Greg Kroah-Hartman , Kathiravan Thirumoorthy , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, mfd@lists.linux.dev, Shivendra Pratap , Srinivas Kandagatla X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1785750274; l=3217; i=shivendra.pratap@oss.qualcomm.com; s=20250710; h=from:subject:message-id; bh=jx181RVT+Xa3QJe2eg0re3HefIe2r4k0bcdeIdeVIYk=; b=ZUjomEzxGruYUFbeJModicvv9K3qeDt+KCUFH3eB+ladIDrsKzjpKb5KbaPCEB6A/khOSHHtP VPUuqmEgLKlAAJBPJ9GFsYbZlfmyR95GIt/pHlobN6539b7mgJz2slj X-Developer-Key: i=shivendra.pratap@oss.qualcomm.com; a=ed25519; pk=CpsuL7yZ8NReDPhGgq6Xn/SRoa59mAvzWOW0QZoo4gw= X-Authority-Analysis: v=2.4 cv=aoaCzyZV c=1 sm=1 tr=0 ts=6a70633f cx=c_pps a=vVfyC5vLCtgYJKYeQD43oA==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=Sv0fKeRqtYgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=ZpdpYltYx_vBUK5n70dp:22 a=EUspDBNiAAAA:8 a=7Vk81bxoM4tuurpRRsYA:9 a=QEXdDO2ut3YA:10 a=rl5im9kqc5Lf4LNbBjHf:22 X-Proofpoint-GUID: 7l6_4yfwOneDwXAv7NZywVSTIR3mW1cH X-Proofpoint-ORIG-GUID: 7l6_4yfwOneDwXAv7NZywVSTIR3mW1cH X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwODAzMDA4NiBTYWx0ZWRfX3TG4m8TidLAR 5QPL1qxSNx0BMtLovQeQUdL0EOBrTNvfg7G3JqNk6m/0cP4XLoQ1PUdw73yjViZDyf1ySvASEVu YHdAGRR1jmaL/O4eeH3GoaY9Pg1mewlMgHxhx4SvmCPU8Sl9RJx14+whuIuNA3b/miKgH6kkCGb Ds3YZklrQJuqfzcgkRN8jweEnTb5GsQFmKyaUJpALKcj7EQaI2YQ07Hcdet80LzTgBsvK6RYbCN MjqL78YP5fmfzyUIp1+qAt188KYg0op8vZHo+Cemf6/fAFBKEskV0QxhGJhYi3zdKuuAsCvokxl X1L7mXBHN3ak548wldOiRFy5vPU+kepCJARrGIdI50Eo5e34EqQbAbR9F2oPhH61lCd077+rnKN lbZNqhGYolW33rLkxHmfDYvvOjQ4mTZfbXZIq6zA+IjsdBfC3Ja+b1lN/9N7taxg38oxlC8TCuK ASPCWCMJdSibaLlbWfQ== X-Proofpoint-Spam-Info: AW1haW4tMjYwODAzMDA4NiBTYWx0ZWRfX0IVo7pVPMUlf SK8Cg1g8Ux3RyaXhzDV0h5FtyvYPu18XBg7A9INpqixVx3/hJNDi6RYoZlfgnEwgxYviSHoRBzP 9eTcNfUCxRkgOTiegODU5xDNz2V4hCY= X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-08-02_06,2026-07-30_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 bulkscore=0 suspectscore=0 priorityscore=1501 adultscore=0 spamscore=0 lowpriorityscore=0 malwarescore=0 phishscore=0 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2608030086 Add bindings to describe vendor-specific reboot modes. Values here correspond to valid parameters to vendor-specific reset types in PSCI SYSTEM_RESET2 call. Signed-off-by: Shivendra Pratap --- Documentation/devicetree/bindings/arm/psci.yaml | 58 +++++++++++++++++++++= ++++ 1 file changed, 58 insertions(+) diff --git a/Documentation/devicetree/bindings/arm/psci.yaml b/Documentatio= n/devicetree/bindings/arm/psci.yaml index 6e2e0c551841..7d6a86690a2e 100644 --- a/Documentation/devicetree/bindings/arm/psci.yaml +++ b/Documentation/devicetree/bindings/arm/psci.yaml @@ -98,6 +98,41 @@ properties: [1] Kernel documentation - ARM idle states bindings Documentation/devicetree/bindings/cpu/idle-states.yaml =20 + reboot-mode: + type: object + $ref: /schemas/power/reset/reboot-mode.yaml# + unevaluatedProperties: false + properties: + # "mode-normal" is just SYSTEM_RESET + mode-normal: false + patternProperties: + "^mode-.*$": + minItems: 1 + maxItems: 3 + items: + - description: arg1 (vendor-specific SYSTEM_RESET2 reset_type) + allOf: + - $ref: /schemas/types.yaml#/definitions/uint32 + - minimum: 0x80000000 + - description: arg2 (cookie_lo in 2-cell form, cookie_hi in 3-ce= ll form) + $ref: /schemas/types.yaml#/definitions/uint32 + - description: arg3 (cookie_lo in 3-cell form) + $ref: /schemas/types.yaml#/definitions/uint32 + description: | + Describes a PSCI SYSTEM_RESET2 vendor-specific reset type. The s= tring + after "mode-" maps a reboot mode to a vendor-specific reset. + A vendor-specific reset takes two arguments, a 32-bit reset_type= and a + 64-bit cookie. The arguments are encoded as up to three 32-bit c= ells. + Each mode property is encoded as mode-xxx =3D , + where: + - arg1 is reset_type and must be >=3D 0x80000000. + - In 2-cell form, arg2 is lower 32 bits of cookie. + - In 3-cell form, arg2 is high 32 bits of cookie + and arg3 is low 32 bits of cookie. + + All values should be provided as per the PSCI SYSTEM_RESET2 + specification. + patternProperties: "^power-domain-": $ref: /schemas/power/power-domain.yaml# @@ -137,6 +172,15 @@ allOf: required: - cpu_off - cpu_on + - if: + not: + properties: + compatible: + contains: + const: arm,psci-1.0 + then: + properties: + reboot-mode: false =20 additionalProperties: false =20 @@ -260,4 +304,18 @@ examples: domain-idle-states =3D <&cluster_ret>, <&cluster_pwrdn>; }; }; + + - |+ + + // Case 5: SYSTEM_RESET2 vendor resets + psci { + compatible =3D "arm,psci-1.0"; + method =3D "smc"; + + reboot-mode { + mode-edl =3D <0x80000000 0x00000001>; + mode-bootloader =3D <0x80010001 0x00000002>; + mode-vendor =3D <0x80000000 0x00000001 0x00000002>; + }; + }; ... --=20 2.34.1 From nobody Fri Oct 2 09:22:59 2026 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9B7E636E498 for ; Mon, 3 Aug 2026 09:45:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785750348; cv=none; b=m7PRS2MdpXG0hL6vYp9mdzBi4bZlWJ46KGDOrti7FKNiiHLtI2SMtZmnnd67DJJKpxtXTaQEwJ/Xx9wsQl6QyIMalGY+ys1XQ1UGnXZdXIQqqgEXNR3y/DxxtydTB+oS17a7lTrz4VPYdZ14GmZ/jVsBh2Q6KfHyI0u/FpAcQZY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785750348; c=relaxed/simple; bh=IqjZzKl7BNCcMxSaF/5GXH4dOI6iylxX8niIaIkSeSQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=PuEzrBFId5uX4Rq9q3Y9Fn+klYRvtKYaZhW0UwLWfyy/NKBvPb+EpyAE2AJ4psU9GitpPOLR3FxvBQeGsmAg+I+AgYPlUfvtAIULzAK/PzP0jka73LQpSWCCNo/8Z78gRzw2CHy8axkxfHXm2E+UVWQEzWUGVcTtxjvUI84fOS4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=U2+j8Yif; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=NURdXliO; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="U2+j8Yif"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="NURdXliO" Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6736SNnY250911 for ; Mon, 3 Aug 2026 09:45:45 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= P7gMpX23LaFBur5pPQaddvCHQnd9R+tRGpPVMI8EOpA=; b=U2+j8YifrLrGpHLf DagnOKH5YQVkmVgEsYiYdrTjJ44r+L1oIRaC9h0ICZlvQSQuX8tblcc2WzG9VizG JiHWhc2kLcnsJJiy6+MJsZCOkLWm3VHNBXZcj77hlZsncMPAZSEmuj6G5nrUJ7ng 8HgjolqMvaZEnXkE2kDllhCaJxKL780lKiWoM3YEC8HcCPQ2XOZT+aBsMIowwbv2 GggyiZo288eBc8OaIuTyk7ffxS5wNk4KrK7JciNCl4F354usc61ksDbWt8F41NRQ GFDSilfhagTNLJEshhgsFEqiOl9kzsNwZafxenYf4llM+u2be5ynk1c0hVqV4jub o87HfA== Received: from mail-pg1-f197.google.com (mail-pg1-f197.google.com [209.85.215.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4ftnrd8v0r-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 03 Aug 2026 09:45:45 +0000 (GMT) Received: by mail-pg1-f197.google.com with SMTP id 41be03b00d2f7-ca6bd8a190cso4002331a12.0 for ; Mon, 03 Aug 2026 02:45:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1785750345; x=1786355145; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=P7gMpX23LaFBur5pPQaddvCHQnd9R+tRGpPVMI8EOpA=; b=NURdXliO8fehWGFeqFJANlG9ph7vBzzglU9yWB42hjBcYiclf07snKsR5NfwqPf1k5 w+gcE7mopkdlXagYBjKaRmvyqFWAXSqtjh1pt63fEMSRf2pc3q3aX7GkwGJUcy/nmoaK 6XdCsZfnzMzpaBuBn0KKL9QS0IH+MsJSZwzFo4grZC9KKv+rwBAWDeTkSWB1R3RMUcmm GGTZPGrgHqH90ku4px0l23FRDQiHMz7rFdWLTgb+tCYOaVCx4hkoUUqdbO0YAColMGER sQtjUMRwV+KnlmEoxpJ24eu+by68XDuY4IvSv2WnJ9sktRr3E6r7TCCATESMlk6zBLh3 w4eA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785750345; x=1786355145; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=P7gMpX23LaFBur5pPQaddvCHQnd9R+tRGpPVMI8EOpA=; b=Io4EPkn6eQGNhF3LcpRplR4e6RB03ndXFRRddxfWntHOts3mUuBIVRfHWd9bF6W9Yh 15ifsh2Wkz6dN0pGjEJEkryQtf1+qXFhkfQRmTtu55OQZCcWZEdeWbFblR13XbmLIsGJ WwsnwzMGqwDLkNDh+Aq0jQSURM0PKOxyMwUc4XqXAopuSIi/MSfdtqQLkD/AtLQ7x5+K cJBHNLBImGanZwmAXrYySbN9eT85pRNOWembpJJieexF1VfzC9l/DK/VlXDs2x0cmieM lTFXhFb+o+u1bIrlQsBWKI6XRLzo0QB3wHDVgbkqDmNpl6lUeR3h2LmhhRkfQws2AYzk NKmQ== X-Forwarded-Encrypted: i=1; AHgh+RobDIAsB3ULiC3UfA4TwZs1AWyqq7GQhJedAyZ7iulWDU41UNdtSnNnImWLNL9Z4teO5kaQN+H8lvPzdG0=@vger.kernel.org X-Gm-Message-State: AOJu0Yyuat/BWLV/BddJG6/oFyy7D1t/fI1MUHE9YQ+zO02XfhZvmF6d 4MWsh1PN2lPCWhXDoaRiOhBNrrIZzQ5uApOpW5a6e3Zwhxg95T7oLmMIBTrllvkWzpPJuRGdmOd 3UrXYgfdITrOwa9guBo1nLL+D7TLDF097Q/zf+Tg+9Lp3hXMnrDvh8ORIkUJNalvrae4= X-Gm-Gg: AR+sD129hzE7zLkgZYfFRQGGZso+ynZhXfs/0aTR9dgDr0tKaWNqMdhhLfKkzt2rKyq Ec4oREqyPwJ0rJI0sCh+Zkwfy6FpeDxrQjPImTT2uxAUVq5JRojyj5sxtqDv82ZyTfsFfmnb1QO nvym44XCth/BpLk404bBAL84QANXRpJCQ5k3D1AtRTkBiW9KX8t4WatGwiWTHRbH5iacq08sIHM tZDmRGi2AY+2tjgjuA2svKzSIo2vn3Jc62RKvicuhiDS3bz/1KeHaKHas8WRTZbAhIkCjX2y9au fIBu5YDFk89kDSPqCoq1darD9pwcd8bvk0Z+MvakQYus2RfFNqnl7gePlIugcvebBtqXu1Bt3Eb G0FJNiY9vQ8MOJwiYXrQNrEYwKW3Vkdut3yvF X-Received: by 2002:a17:90b:2d4c:b0:387:df8f:1401 with SMTP id 98e67ed59e1d1-38fbc598becmr9021694a91.34.1785750344775; Mon, 03 Aug 2026 02:45:44 -0700 (PDT) X-Received: by 2002:a17:90b:2d4c:b0:387:df8f:1401 with SMTP id 98e67ed59e1d1-38fbc598becmr9021646a91.34.1785750344278; Mon, 03 Aug 2026 02:45:44 -0700 (PDT) Received: from hu-spratap-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-38fb2be6c8csm3660671a91.13.2026.08.03.02.45.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Aug 2026 02:45:43 -0700 (PDT) From: Shivendra Pratap Date: Mon, 03 Aug 2026 15:13:37 +0530 Subject: [PATCH v24 06/12] power: reset: Add psci-reboot-mode driver Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260803-arm-psci-system_reset2-vendor-reboots-v24-6-889281373870@oss.qualcomm.com> References: <20260803-arm-psci-system_reset2-vendor-reboots-v24-0-889281373870@oss.qualcomm.com> In-Reply-To: <20260803-arm-psci-system_reset2-vendor-reboots-v24-0-889281373870@oss.qualcomm.com> To: Lorenzo Pieralisi , Arnd Bergmann , Bjorn Andersson , Sebastian Reichel , Rob Herring , Souvik Chakravarty , Krzysztof Kozlowski , Andy Yan , Matthias Brugger , Mark Rutland , Conor Dooley , Konrad Dybcio , John Stultz , Moritz Fischer , "Rafael J. Wysocki" , Daniel Lezcano , Christian Loehle , Lee Jones , Ulf Hansson , Pavan Kondeti , Bartosz Golaszewski , Sudeep Holla , Ulf Hansson Cc: Florian Fainelli , Krzysztof Kozlowski , Dmitry Baryshkov , Mukesh Ojha , Andre Draszik , Greg Kroah-Hartman , Kathiravan Thirumoorthy , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, mfd@lists.linux.dev, Shivendra Pratap , Srinivas Kandagatla , Bartosz Golaszewski X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1785750274; l=5554; i=shivendra.pratap@oss.qualcomm.com; s=20250710; h=from:subject:message-id; bh=IqjZzKl7BNCcMxSaF/5GXH4dOI6iylxX8niIaIkSeSQ=; b=VvuvdMCCFfCnpfXMiifmJIg8ToW9mGWhz/YcyhcWBwYZyQ++L8G27zDMPlOvzPWKAgRM6T2dZ hAxw26BregDDZ4ndgGJJEgdlZIWzxDPFme60Q11ADtcSKqSRYEiKRjY X-Developer-Key: i=shivendra.pratap@oss.qualcomm.com; a=ed25519; pk=CpsuL7yZ8NReDPhGgq6Xn/SRoa59mAvzWOW0QZoo4gw= X-Proofpoint-Spam-Info: AW1haW4tMjYwODAzMDA4NiBTYWx0ZWRfX9ANQSxJRNaGa LsSDufYLlYsUe2Epk79VgMC1Oc3fC3Lg0BVP4Mt8/kEGQ3/yYqS56z65BerAqwlDMzymaHGz9vp vmwmtwWY9qpqc1FrV03zzLTpEYMDdT0= X-Authority-Analysis: v=2.4 cv=f/94wuyM c=1 sm=1 tr=0 ts=6a706349 cx=c_pps a=rz3CxIlbcmazkYymdCej/Q==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=Sv0fKeRqtYgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=Um2Pa8k9VHT-vaBCBUpS:22 a=EUspDBNiAAAA:8 a=5CqnhzuZLWPXzHx0y-cA:9 a=QEXdDO2ut3YA:10 a=bFCP_H2QrGi7Okbo017w:22 X-Proofpoint-GUID: OCEzXDaXxpGbthvpQIRhW3E_uohA61p_ X-Proofpoint-ORIG-GUID: OCEzXDaXxpGbthvpQIRhW3E_uohA61p_ X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwODAzMDA4NiBTYWx0ZWRfX21fZiKH4zLYd hHFZg0NbWiYPtJ2AOQe3qz/PkrXh6QEFeUoTTQbQeLvL+C+XjN98EsmRrszNnAkduKUyRLxyQmN 25Wou0WkTe1p8DQQC3h0Q5PXvsN9JtKJ5q9HON5pZt0n5EnK/KxsrpPu7G3T4AHERS5Q7D3vZjE MOLw3zrhRUcsFjnAlUCowRZYFbgiFjGjEk93lLKYBZyG7RdlzXLuqhToXvhpe3nU5Yvw2KQSZRO vMF3UBc60SIOOPEhtlj27Q9oKcI7CR4rCOFACpWbMuyTdzYeVkpuVJtwpSmItUaWpxJ/+Zzl+NL CUNwDyC7OKF0MCsR2+t8jYQSfb/2QSkTwxw6KvjU7j8f7Q/4f1Pt3QotHXVI3trBzD9eIr4rEoA 0kVpDofiqACPoL0Uu0cqUab6wn5Y+HPJdr4JFu+bKjqGgDXnTuzdXj15CumsATTYnMgmpI4CIuA 4Y3oBFo1tgt/d/HYWzA== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-08-02_06,2026-07-30_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 adultscore=0 priorityscore=1501 malwarescore=0 spamscore=0 bulkscore=0 impostorscore=0 suspectscore=0 clxscore=1015 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2608030086 PSCI supports different types of resets like SYSTEM_RESET, SYSTEM_RESET2 ARCH WARM reset and SYSTEM_RESET2 vendor-specific resets. Currently there is no common driver that handles all supported psci resets at one place. Additionally, there is no common mechanism to issue the supported psci resets from userspace. Add a psci-reboot-mode driver, and define two types of PSCI resets, predefined-resets and vendor-specific resets. Predefined-resets are defined by psci driver and vendor-specific resets are defined by SoC vendors, under the psci:reboot-mode node of SoC device tree. Register the driver with the reboot-mode framework to interface these resets to userspace. When userspace initiates a supported command, pass the reset arguments to the PSCI driver to enable command-based reset. This change allows userspace to issue supported PSCI reset commands using the standard reboot system calls while enabling SoC vendors to define their specific resets for PSCI. Reviewed-by: Bartosz Golaszewski Signed-off-by: Shivendra Pratap --- MAINTAINERS | 1 + drivers/power/reset/Kconfig | 10 +++++ drivers/power/reset/Makefile | 1 + drivers/power/reset/psci-reboot-mode.c | 82 ++++++++++++++++++++++++++++++= ++++ 4 files changed, 94 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 0b6e4f89f319..a3339b98ba86 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -21672,6 +21672,7 @@ S: Maintained F: Documentation/devicetree/bindings/arm/psci.yaml F: drivers/firmware/psci/ F: drivers/mfd/psci-mfd.c +F: drivers/power/reset/psci-reboot-mode.c F: include/linux/psci.h F: include/uapi/linux/psci.h =20 diff --git a/drivers/power/reset/Kconfig b/drivers/power/reset/Kconfig index bce996bbef28..143f3260f04a 100644 --- a/drivers/power/reset/Kconfig +++ b/drivers/power/reset/Kconfig @@ -360,6 +360,16 @@ config NVMEM_REBOOT_MODE then the bootloader can read it and take different action according to the mode. =20 +config PSCI_REBOOT_MODE + bool "PSCI reboot mode driver" + depends on ARM_PSCI_FW || COMPILE_TEST + select REBOOT_MODE + help + Say y here will enable PSCI reboot mode driver. This gets + the PSCI reboot mode arguments and passes them to psci + driver. psci driver uses these arguments for issuing + device reset into different boot states. + config POWER_MLXBF tristate "Mellanox BlueField power handling driver" depends on (GPIO_MLXBF2 || GPIO_MLXBF3) && ACPI diff --git a/drivers/power/reset/Makefile b/drivers/power/reset/Makefile index e31cab4ba78e..45d8aaaffaa1 100644 --- a/drivers/power/reset/Makefile +++ b/drivers/power/reset/Makefile @@ -41,5 +41,6 @@ obj-$(CONFIG_REBOOT_MODE) +=3D reboot-mode.o obj-$(CONFIG_SYSCON_REBOOT_MODE) +=3D syscon-reboot-mode.o obj-$(CONFIG_POWER_RESET_SC27XX) +=3D sc27xx-poweroff.o obj-$(CONFIG_NVMEM_REBOOT_MODE) +=3D nvmem-reboot-mode.o +obj-$(CONFIG_PSCI_REBOOT_MODE) +=3D psci-reboot-mode.o obj-$(CONFIG_POWER_MLXBF) +=3D pwr-mlxbf.o obj-$(CONFIG_POWER_RESET_QEMU_VIRT_CTRL) +=3D qemu-virt-ctrl.o diff --git a/drivers/power/reset/psci-reboot-mode.c b/drivers/power/reset/p= sci-reboot-mode.c new file mode 100644 index 000000000000..2f960fda8229 --- /dev/null +++ b/drivers/power/reset/psci-reboot-mode.c @@ -0,0 +1,82 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static const struct reboot_mode_entry psci_resets[] =3D { + { + .name =3D "psci-system-reset", + .magic =3D { 0, PSCI_SYSTEM_RESET_COLD_RESET }, + .count =3D 2, + }, + { + .name =3D "psci-system-reset2-arch-warm-reset", + .magic =3D { 0, PSCI_SYSTEM_RESET2_ARCH_WARM_RESET }, + .count =3D 2, + }, +}; + +static u64 psci_reboot_mode_get_cookie(const u32 *magic, int count) +{ + u64 cookie =3D 0; + int i; + + /* Build cookie from arg2/arg3 cells in order: cookie_hi then cookie_lo. = */ + for (i =3D 1; i < count; i++) + cookie =3D (cookie << 32) | magic[i]; + + return cookie; +} + +static int psci_reboot_mode_write(struct reboot_mode_driver *reboot, + const u32 *magic, u32 count) +{ + (void)reboot; + + if (count < 1 || count > 3) + return -EINVAL; + + return psci_set_reset_cmd(magic[0], psci_reboot_mode_get_cookie(magic, co= unt)); +} + +static int psci_reboot_mode_probe(struct platform_device *pdev) +{ + struct reboot_mode_driver *reboot; + size_t count; + int ret; + + reboot =3D devm_kzalloc(&pdev->dev, sizeof(*reboot), GFP_KERNEL); + if (!reboot) + return -ENOMEM; + + /* Skip PSCI SYSTEM_RESET2 modes if unsupported */ + count =3D psci_has_system_reset2_support() ? ARRAY_SIZE(psci_resets) : 1; + + ret =3D reboot_mode_driver_init(reboot, &pdev->dev, NULL, + psci_reboot_mode_write, psci_resets, count); + if (ret) + return ret; + + return devm_reboot_mode_register(&pdev->dev, reboot); +} + +static struct platform_driver psci_reboot_mode_driver =3D { + .probe =3D psci_reboot_mode_probe, + .driver =3D { + .name =3D "psci-reboot-mode", + }, +}; +module_platform_driver(psci_reboot_mode_driver); + +MODULE_DESCRIPTION("PSCI reboot mode driver"); +MODULE_LICENSE("GPL"); --=20 2.34.1 From nobody Fri Oct 2 09:22:59 2026 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 732A538DC79 for ; Mon, 3 Aug 2026 09:45:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785750362; cv=none; b=ZAIpQnExINn/WjPPWzYoqQpd5pzik57JvOjJvy14cHgNKL42ZV/k6oqNRF/hbYRcr6x9mYWN6tmQ2C52IcWqNaZ4NnKP/f+20MXbbAPXFgNTyrY7c/xYySkG6Kylu80zVWak6k/FqkjqsSw9QBLZNi6xo6k5D2sNIKxfUGKNJWg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785750362; c=relaxed/simple; bh=YF09NFBv8XV2mwwiWYdQirwqkhH8XmGEPACV2jstcps=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=PC/AQabFc/l089cYqDezqU7AMGq/PiMCHqJhW0dQ+RfySbSpUDtV1dCvn/O9kc6obQy9JOoPEwJJJdDge+xG8mrlUfZZFqRzSYLrhuRxUtukldNfN9MBo5PyUaAwVnNRCcgcCfZIOGK6XNedD18qzJwsdslmuybB1DDRZ4O0K4A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=fgzCke40; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=P429LUHk; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="fgzCke40"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="P429LUHk" Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6736T1cA4014138 for ; Mon, 3 Aug 2026 09:45:56 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= BMf292AZeOlCNbfbdHJJYz8+230HZxidGqGvw+WCW6M=; b=fgzCke40gnRS4arn f9EwwqN6SB3k1PoNe0aMjz9vMUA0BE24rlR6kj6GGgmT2Wpf8Cyz4zz1fWdxXsML zPolrcIt3Y2deLVuUlcokcNJDMN24RmuVBSh+UnWXQH2KbNw6+YQ542FcJNDdXP8 odgTF2e5YSA/5jo2KCZTIIQEyXo14eJG65UbRE1uIhNfwULznEpv88JBwCo5W+2C i2M+0ELnZ8yLr4dGDL6Ke2wI0JSiD7JwV/O35FPPxJtx5mO1boNy5bwi31jqCLG5 UK9lVtVcSJizltAXIpGCbNoFF25agggUKY4NB/Mk0r3Nuu39FQscxEqY5/M4lS9h 9MJGKA== Received: from mail-pj1-f72.google.com (mail-pj1-f72.google.com [209.85.216.72]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4ftnrt8v7n-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 03 Aug 2026 09:45:56 +0000 (GMT) Received: by mail-pj1-f72.google.com with SMTP id 98e67ed59e1d1-38e667368f0so5903399a91.2 for ; Mon, 03 Aug 2026 02:45:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1785750355; x=1786355155; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=BMf292AZeOlCNbfbdHJJYz8+230HZxidGqGvw+WCW6M=; b=P429LUHkPRATpVUAFuB1bYSJTgMBT85m//dJPhZlokOnvNanF0g+G/Cxw+ruNm71N6 uBqc6Xd7062UcqLDVfSRQkbPwQbWLxGsx/6dLWd+nYZd+EjPV1IF1E2acA8A+wXmflax cfnctayW6lJYwyynwKFn/8pA8ZjPseCW+xNlIN/rupq7CgA4eM5+U+zUb9LBiHiyHmHf /Aq/BiulHWKM3vrlOIZ3L5Ap+5lV8WBIigVp5mK+NFzlZhOBIFqOisGTMXbHOj+G9ts3 UgrCgP6fJxw4vD8grVLV0frF5uitfV6opBl5ckifQYLJIgdoaROF9UP+ny6TwVPzQ8r8 ta2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785750355; x=1786355155; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=BMf292AZeOlCNbfbdHJJYz8+230HZxidGqGvw+WCW6M=; b=qDWKzK1lgWyxjjInK+i39KtkS6XabFUNQ4I9daddlxxzEmPQDXKJ5VT9pJlrUv18St aOW7EauSbWtWzVatrC+LuHvNI3qZZ9cVYtgTKhIps2f4Lx5pqDYeKotfndG4pmkZhK+/ 1SCg07K+PPUBW0p5nmE95CAVC2ei3OzpCpQBsdWPGvMCoxzIxIyaPeG4ZfgENAUzDE2s yyL60l1++klLWj/VHnqxtXWX+gV1WwA8G8qjNi4ZMG7NE56OIeODlhEt+ZUW4HQeaZu7 1tTAkPT6ZS6PXCB9SC3AfKOq9LpgAYTcRtK+H0+K3jm4/7F+tgIlv87VCjcE2hG0+Fiz dH4A== X-Forwarded-Encrypted: i=1; AHgh+RrAS1rh7HYsRwBKKNmxoN3padaAG29Ddeu0Fgb/IyZnYHgrCbfeHW/JTginp+MK6DlpgbGmOessjQOIgWU=@vger.kernel.org X-Gm-Message-State: AOJu0Yzooh2gvxwVFVMnpB0ktWcCyuYufwHtOZTMPps9ChX3KYJEd7CZ rP71y03zlFgFAOBNydWMKgVDalYpDyW6xGmvCaxPbBSVOyplpLNhbOVcFszKiuZ+0p1ehWmKzOE Cf6Jn1kKsyFTM0a5BfrKR8fpfobJfiNASwSS+EXfvpx1cJ9m7kDUjZmsmEsmrPS+j80U= X-Gm-Gg: AR+sD13HJC+zXED31zyIb1Kwp/Isg8yawqKofQZe0D6y0G8seQ5tFWi25b1N/ydGG+4 Wyrqq/0uLkKSBcZ4hZmWJ30PH6/VZ1k5amznYa0naOxtP3xDcWBMUOlDHgQnzSTYoFiohsVOvGW tBeGV8z6kxsL+1JSBKSfJwW/kjLtRBcn7ctZGS3shGHoKMRFjKUCiKnLsgkIqNMZJ12eYRi5YSa BeYPHFTPGALb0hYyttpN3PHpwDeqJmswwIQkOLtB+hm6LGsxVH72VCZHmz7VTywdHHt7aZYCXIL eK4bM+L15Q0+dPZdrLI1J1yQ1kW1Mb4KgNqlQcDoLLPxB8qeLRqYdvAJ3gNbXuIHwrF0xZbfPIj /bapmLB89KQv6vrgkcB8V3FLYOtq2XRrBGeKs X-Received: by 2002:a17:90b:2750:b0:38e:2c8f:a01a with SMTP id 98e67ed59e1d1-38fbc42c3a1mr7726899a91.11.1785750355061; Mon, 03 Aug 2026 02:45:55 -0700 (PDT) X-Received: by 2002:a17:90b:2750:b0:38e:2c8f:a01a with SMTP id 98e67ed59e1d1-38fbc42c3a1mr7726841a91.11.1785750354407; Mon, 03 Aug 2026 02:45:54 -0700 (PDT) Received: from hu-spratap-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-38fb2be6c8csm3660671a91.13.2026.08.03.02.45.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Aug 2026 02:45:54 -0700 (PDT) From: Shivendra Pratap Date: Mon, 03 Aug 2026 15:13:38 +0530 Subject: [PATCH v24 07/12] mfd: core: Add firmware-node support to MFD cells Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260803-arm-psci-system_reset2-vendor-reboots-v24-7-889281373870@oss.qualcomm.com> References: <20260803-arm-psci-system_reset2-vendor-reboots-v24-0-889281373870@oss.qualcomm.com> In-Reply-To: <20260803-arm-psci-system_reset2-vendor-reboots-v24-0-889281373870@oss.qualcomm.com> To: Lorenzo Pieralisi , Arnd Bergmann , Bjorn Andersson , Sebastian Reichel , Rob Herring , Souvik Chakravarty , Krzysztof Kozlowski , Andy Yan , Matthias Brugger , Mark Rutland , Conor Dooley , Konrad Dybcio , John Stultz , Moritz Fischer , "Rafael J. Wysocki" , Daniel Lezcano , Christian Loehle , Lee Jones , Ulf Hansson , Pavan Kondeti , Bartosz Golaszewski , Sudeep Holla , Ulf Hansson Cc: Florian Fainelli , Krzysztof Kozlowski , Dmitry Baryshkov , Mukesh Ojha , Andre Draszik , Greg Kroah-Hartman , Kathiravan Thirumoorthy , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, mfd@lists.linux.dev, Shivendra Pratap , Srinivas Kandagatla , Bartosz Golaszewski X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1785750274; l=7933; i=shivendra.pratap@oss.qualcomm.com; s=20250710; h=from:subject:message-id; bh=YF09NFBv8XV2mwwiWYdQirwqkhH8XmGEPACV2jstcps=; b=iWxDeilK2zVkbE2E9xjCYxx29tooW1BOq49KVaULUzqDdvX/jStMSvMhIwd2nOaQew8OoeMcI lKpd/Cq9ECPCTsZ1UmShciKwCIG6nToGM9niWP3D+6sLmE/kCk2I2ku X-Developer-Key: i=shivendra.pratap@oss.qualcomm.com; a=ed25519; pk=CpsuL7yZ8NReDPhGgq6Xn/SRoa59mAvzWOW0QZoo4gw= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwODAzMDA4NiBTYWx0ZWRfXyYRlIky6MMqh rwCoLg2Cn30Prt0u9pCr6qj3CmBahXmRUWrfOqRHlJmwiKVD/8Ho5MOTYTLXNSHI0dzMzcto/Ql B0VxsKp7I4R1E3iKW6+mMBzU9iCOm8q9BcerHSDRXcOaLC2JTPXgcY6rzr8aSNUs7JiLaiirExr BjZChevMFsb45OuZpi7FrGJ+/+TVyfMpc4m/k35SPyz3R6MgIqRU1k34Gzm7Uawb+SOO51TZlQb /rz02bquuxwzkHPO3lr6udSuzzOpxhewOFcbyddEDTusa9/clX9XFD38XTgm0E2VrkU6rPK4irK fXbUsxRzayIEs69UZ2yPf3TJpYC509GUH1jXJw39cqFfX8r0VdmlFGpgW8bl5vwqyM2GPanowYv AnpS+t7wr3YjNH+NcEChn7eH8aSknP4MDPYXtnou3tL7kH4maUsOK/XqbxlOD6Itdlugmh8ZtKi BBJK1lSbfPGnyzKWe0g== X-Proofpoint-GUID: n2vDZuXRHsrAX9FkCfv9o7T3J1-8E9VH X-Proofpoint-ORIG-GUID: n2vDZuXRHsrAX9FkCfv9o7T3J1-8E9VH X-Proofpoint-Spam-Info: AW1haW4tMjYwODAzMDA4NiBTYWx0ZWRfX2PmGhkfq4r64 nil2RJsoEtrAm5ILljsJJ9HfpYcdxyH4mTOzYgcmCRg4rsnMfUunsRZtg1hXh2oyj5y4qmQtxmu fxmu4LHLzBSskuuZWn8mqMm1QoOgIRs= X-Authority-Analysis: v=2.4 cv=Ft81OWrq c=1 sm=1 tr=0 ts=6a706354 cx=c_pps a=RP+M6JBNLl+fLTcSJhASfg==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=Sv0fKeRqtYgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=gowsoOTTUOVcmtlkKump:22 a=EUspDBNiAAAA:8 a=2Layw8R8_bQqnRkAqW4A:9 a=QEXdDO2ut3YA:10 a=iS9zxrgQBfv6-_F4QbHw:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-08-02_06,2026-07-30_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 impostorscore=0 lowpriorityscore=0 clxscore=1015 adultscore=0 phishscore=0 bulkscore=0 suspectscore=0 priorityscore=1501 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2608030086 MFD core has no way to register a child device using an explicit firmware node. This prevents drivers from registering child nodes when those nodes do not define a compatible string. One such example is the PSCI "reboot-mode" node, which omits a compatible string as it describes boot-states provided by the underlying firmware. Extend struct mfd_cell with a named firmware-node field to identify a child node under the MFD parent. The node is added to the MFD child device during registration when none is assigned by device tree, ACPI, or software matching. Suggested-by: Bartosz Golaszewski Signed-off-by: Shivendra Pratap --- drivers/mfd/mfd-core.c | 151 +++++++++++++++++++++++++++++++++++++++++--= ---- include/linux/mfd/core.h | 10 ++++ 2 files changed, 142 insertions(+), 19 deletions(-) diff --git a/drivers/mfd/mfd-core.c b/drivers/mfd/mfd-core.c index 7aa32b90cf1e..79b400535138 100644 --- a/drivers/mfd/mfd-core.c +++ b/drivers/mfd/mfd-core.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -22,6 +23,7 @@ #include =20 static LIST_HEAD(mfd_of_node_list); +static LIST_HEAD(mfd_named_fwnode_list); static DEFINE_MUTEX(mfd_of_node_mutex); =20 struct mfd_of_node_entry { @@ -30,10 +32,91 @@ struct mfd_of_node_entry { struct device_node *np; }; =20 +struct mfd_named_fwnode_entry { + struct list_head list; + struct device *dev; + struct fwnode_handle *fwnode; +}; + static const struct device_type mfd_dev_type =3D { .name =3D "mfd_device", }; =20 +static int mfd_claim_named_fwnode(struct platform_device *pdev, + struct fwnode_handle *fwnode) +{ + struct mfd_named_fwnode_entry *entry, *iter; + + entry =3D kzalloc_obj(*entry, GFP_KERNEL); + if (!entry) + return -ENOMEM; + + entry->dev =3D &pdev->dev; + entry->fwnode =3D fwnode_handle_get(fwnode); + + scoped_guard(mutex, &mfd_of_node_mutex) { + list_for_each_entry(iter, &mfd_named_fwnode_list, list) + if (iter->fwnode =3D=3D fwnode) { + fwnode_handle_put(entry->fwnode); + kfree(entry); + return -EAGAIN; + } + + list_add_tail(&entry->list, &mfd_named_fwnode_list); + } + + return 0; +} + +/* + * Temporary MFD-local cleanup for named non-OF child fwnodes. + * Remove/rework this when platform core starts owning and dropping + * dev->fwnode references for these devices. + */ +static void mfd_release_named_fwnode(struct platform_device *pdev) +{ + struct mfd_named_fwnode_entry *entry, *tmp; + + scoped_guard(mutex, &mfd_of_node_mutex) { + list_for_each_entry_safe(entry, tmp, &mfd_named_fwnode_list, list) + if (entry->dev =3D=3D &pdev->dev) { + if (dev_fwnode(&pdev->dev) =3D=3D entry->fwnode) + device_set_node(&pdev->dev, NULL); + fwnode_handle_put(entry->fwnode); + list_del(&entry->list); + kfree(entry); + } + } +} + +static int mfd_claim_of_node_to_dev(struct platform_device *pdev, + struct device_node *np) +{ + struct mfd_of_node_entry *of_entry, *iter; + + of_entry =3D kzalloc_obj(*of_entry, GFP_KERNEL); + if (!of_entry) + return -ENOMEM; + + of_entry->dev =3D &pdev->dev; + of_entry->np =3D of_node_get(np); + + /* Skip if OF node has previously been allocated to a device */ + scoped_guard(mutex, &mfd_of_node_mutex) { + list_for_each_entry(iter, &mfd_of_node_list, list) + if (iter->np =3D=3D np) { + of_node_put(of_entry->np); + kfree(of_entry); + return -EAGAIN; + } + + list_add_tail(&of_entry->list, &mfd_of_node_list); + } + + device_set_node(&pdev->dev, of_fwnode_handle(np)); + return 0; +} + #if IS_ENABLED(CONFIG_ACPI) struct match_ids_walk_data { struct acpi_device_id *ids; @@ -111,19 +194,11 @@ static int mfd_match_of_node_to_dev(struct platform_d= evice *pdev, struct device_node *np, const struct mfd_cell *cell) { - struct mfd_of_node_entry *of_entry; u64 of_node_addr; =20 - /* Skip if OF node has previously been allocated to a device */ - scoped_guard(mutex, &mfd_of_node_mutex) { - list_for_each_entry(of_entry, &mfd_of_node_list, list) - if (of_entry->np =3D=3D np) - return -EAGAIN; - } - if (!cell->use_of_reg) /* No of_reg defined - allocate first free compatible match */ - goto allocate_of_node; + return mfd_claim_of_node_to_dev(pdev, np); =20 /* We only care about each node's first defined address */ if (of_property_read_reg(np, 0, &of_node_addr, NULL)) @@ -134,18 +209,48 @@ static int mfd_match_of_node_to_dev(struct platform_d= evice *pdev, /* No match */ return -EAGAIN; =20 -allocate_of_node: - of_entry =3D kzalloc(sizeof(*of_entry), GFP_KERNEL); - if (!of_entry) - return -ENOMEM; + return mfd_claim_of_node_to_dev(pdev, np); +} =20 - of_entry->dev =3D &pdev->dev; - of_entry->np =3D of_node_get(np); - scoped_guard(mutex, &mfd_of_node_mutex) - list_add_tail(&of_entry->list, &mfd_of_node_list); +static int mfd_attach_named_fwnode(struct device *parent, + struct platform_device *pdev, + const struct mfd_cell *cell) +{ + struct fwnode_handle *fwnode; + struct device_node *named_np; + int ret =3D 0; =20 - device_set_node(&pdev->dev, of_fwnode_handle(np)); - return 0; + /* named_fwnode is a fallback only when no OF/ACPI match and no swnode */ + if (dev_fwnode(&pdev->dev) || cell->swnode || !cell->named_fwnode) + return 0; + + fwnode =3D device_get_named_child_node(parent, cell->named_fwnode); + if (!fwnode) + return 0; + + if (!fwnode_device_is_available(fwnode)) + goto out_put; + + named_np =3D to_of_node(fwnode); + if (named_np) + ret =3D mfd_claim_of_node_to_dev(pdev, named_np); + else + ret =3D mfd_claim_named_fwnode(pdev, fwnode); + + if (ret =3D=3D -EAGAIN) { + ret =3D 0; + goto out_put; + } + + if (ret) + goto out_put; + + if (!named_np) + device_set_node(&pdev->dev, fwnode); + +out_put: + fwnode_handle_put(fwnode); + return ret; } =20 static int mfd_add_device(struct device *parent, int id, @@ -224,6 +329,10 @@ static int mfd_add_device(struct device *parent, int i= d, =20 mfd_acpi_add_device(cell, pdev); =20 + ret =3D mfd_attach_named_fwnode(parent, pdev, cell); + if (ret) + goto fail_alias; + if (cell->pdata_size) { ret =3D platform_device_add_data(pdev, cell->platform_data, cell->pdata_size); @@ -295,6 +404,7 @@ static int mfd_add_device(struct device *parent, int id, if (cell->swnode) device_remove_software_node(&pdev->dev); fail_of_entry: + mfd_release_named_fwnode(pdev); scoped_guard(mutex, &mfd_of_node_mutex) { list_for_each_entry_safe(of_entry, tmp, &mfd_of_node_list, list) if (of_entry->dev =3D=3D &pdev->dev) { @@ -382,7 +492,10 @@ static int mfd_remove_devices_fn(struct device *dev, v= oid *data) regulator_bulk_unregister_supply_alias(dev, cell->parent_supplies, cell->num_parent_supplies); =20 + get_device(&pdev->dev); platform_device_unregister(pdev); + mfd_release_named_fwnode(pdev); + put_device(&pdev->dev); return 0; } =20 diff --git a/include/linux/mfd/core.h b/include/linux/mfd/core.h index faeea7abd688..8daa83dd31ea 100644 --- a/include/linux/mfd/core.h +++ b/include/linux/mfd/core.h @@ -80,6 +80,16 @@ struct mfd_cell { =20 /* Software node for the device. */ const struct software_node *swnode; + /* + * Name of a child firmware node under the MFD parent device. + * + * Used only as a fallback when no firmware node is assigned to MFD + * child and no software node is provided. + * + * For Device Tree parents, lookup is by base node name only + * (the part before '@'). Unit-addresses are not matched. + */ + const char *named_fwnode; =20 /* * Device Tree compatible string --=20 2.34.1 From nobody Fri Oct 2 09:22:59 2026 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3E00B370D6E for ; Mon, 3 Aug 2026 09:46:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785750368; cv=none; b=EOrnJKXHO2I6JlydaGPhubyDxKnjefhzUPFoQ80kbgFl0NCAzoYr46v3ulejNJB/U4f4xaj8j0pfX10AB38xAj2DjWbJ+PSFLiO0/k/EVzfYVmqFaqrcWfkLdZKb52DSykeCUu8+t2EWrNTKt23QcAvsMm2Ph6YTZm982ojn4EY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785750368; c=relaxed/simple; bh=a4fxcZei+1h97cnUB4Koj6aUmwrxpdQsIsCANK7Zphs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=taiYU1Uyj7CGVbdlSQvj0cc8t7MEx8uFPxeC0tRr/xnIkS5B90f2xXgEMF9Jg/uAc/yjoDM4OBlH6mdMEJHbb0xpbsuurrclOne8bkGrGAiSnWZ1Gyh45FPqjOJBKP4jLfWg1QEqHVnK9uwfxCXSoF1eUyVWlGS31MrmMufJvQc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=a93+VRjp; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=DYS7ovgm; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="a93+VRjp"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="DYS7ovgm" Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6736sYIE3790798 for ; Mon, 3 Aug 2026 09:46:06 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= miyN33yZIoWSSdkcC3toNxzlqXgaA/C5AXSlDcD42bA=; b=a93+VRjpDeAHhX87 3lzQVhB0l2nMDdMKZfqsukZ2ADuleCH9oXvv4hc7jeo3QfbkmrkwoH58rGCYt0pk 2xzWeP+aoKi1oCsjiHwrjfRx3wUigHt55EtszBCzOhEsURVYcPYvKajmJWcaTCrr CXsMxqWoV5a103PnVnIazeg5ssbYe4w5V7Pr8IGNR8G/G7lD9PUWxqhKH+vBA+Vg AFMCGqXnpXAtYMZJuS9om4czlVlRSpvpSgTBooF7ZqFy/MlvOkBq7KlYDcBFbfWV IckEDfEB5OT1BWI9hHeMkqfpOd+iK2GrTjhfaOZ5G9e7AVB+kDwiCx77AiHXpzMI V+iIJw== Received: from mail-pj1-f70.google.com (mail-pj1-f70.google.com [209.85.216.70]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4ftp4r0sjc-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 03 Aug 2026 09:46:05 +0000 (GMT) Received: by mail-pj1-f70.google.com with SMTP id 98e67ed59e1d1-38e7ff7b375so3465855a91.1 for ; Mon, 03 Aug 2026 02:46:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1785750365; x=1786355165; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=miyN33yZIoWSSdkcC3toNxzlqXgaA/C5AXSlDcD42bA=; b=DYS7ovgma82sSaNv1udGP+aNo9QESD6efmRlO/0wDWs4BdDcf/vFxqxR1VRiXhlVM3 CGXmtHkVOEfplqWoC9dvpvr6Y2xHF8FZ0uwgVBvPWfoO+3IUc0CpQWdPNPao1qaVtJtG IqEx/pad63T23smZisGTI6acoPXuNfLV3x58ftl/cxFEDua1mymp7RWfk3DBdxxqRBoM NOhK2zM0gUefrrkOiAlZ7NxyQQ/CINJLPD56PAq0R3AtXvn29r/vG7Dp7JptE+kfGhfm cbZNsbpE0HIccaiBW5uO34Fgfm0U15KS1FTPy0vJNAl00I8MvhIaeY7j9OcJFHPCOjd0 XT0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785750365; x=1786355165; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=miyN33yZIoWSSdkcC3toNxzlqXgaA/C5AXSlDcD42bA=; b=M1Aiw2GfQ5S4EEGZmN1LZkXIm0N6tt5/KGa4jbtVOEC426FGq3n5D3xJNe5ty08Ut9 EsvHfvvIuNo+mMO1P50ONb8JREnCkzc4mNUlskVlzx/NaS6BylX3hSCrGLYow5rB/km2 VVgzhxOo1uafr3anPOrG+jp6TyYDXTwciMXf5suso1vISPoLcXKFlP2v7zylIp/ROquY 38mckZT/Z6dJNEL6kT4L2s+GnsLsRaQH4fLgAsvlgsW0jEZoLSXnsvasql+crO6Q3kmi MEpQnCYFUk1bNNHZ9qxqWVwFYMkP6QeGYTqxgG55lpY2sTnTOn1XFH1vDoOWa3xFyjlb /4Ng== X-Forwarded-Encrypted: i=1; AHgh+Rr/GPFsUH4hXxdFwm2b2g5Pd5XpQDZoLA9MKk+a5YP7HovFjI5tjQB76nCq7ilFxwo8Xj+0Zg6ppY/Fga8=@vger.kernel.org X-Gm-Message-State: AOJu0YxcNtW1ylltqN2ZuABAYCMIyc+YXU+wu1ypXQnorpBSI85Lgfc5 7f8KPLTlgNl4i7+ppds1Ul7mV81gao68Hd2j0w1wyFbek+IsOa9Bvv0c2ikRPLTUYr9GZFZPnRQ 4n6UVMa9e6fB7AipVYWBFLFGpYc+oVGSYrLPXFDnWjlRBOXWkQQvG2z8kIbkulvi2fqQ= X-Gm-Gg: AR+sD13mFxhkQ/28zFpNkjMeofd6OhleBUnGj7O7PahdoKtlXYm8iZQXDDLBt7oDAaB y40cIzfqpQD0camJRcBCEpVFoqMGDLegdZztJK2Q9k9pl31LXSXpiz4xqvb/fOvqLhpn/pcxJa5 wrCzNBgxKEa6yC2XrkHWGAEjTYOg+RGGGMdOtfotE87goudqxdpXbqrlAEazG6VGTXtJRDe9O1T gffi+SJkPRDDZtpavh0YLMoiUQ4kaGH4tJu07XglD5sUFpLKyQlydpDb5KhACIgeI31yuBSNt1f hlFIq1cEsXrxoIjr2PfrECFi9JY3K7HgkJ6daOoCOGMasfzEcRhR6eyfHMGh2K1MdDRUxS200+d Nj5PDmImW6BBuUpn+lOJBvFZ+oMGVQxjLiYfF X-Received: by 2002:a17:90b:1dc3:b0:387:e0db:bc28 with SMTP id 98e67ed59e1d1-38fbc554637mr8271579a91.40.1785750364991; Mon, 03 Aug 2026 02:46:04 -0700 (PDT) X-Received: by 2002:a17:90b:1dc3:b0:387:e0db:bc28 with SMTP id 98e67ed59e1d1-38fbc554637mr8271557a91.40.1785750364566; Mon, 03 Aug 2026 02:46:04 -0700 (PDT) Received: from hu-spratap-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-38fb2be6c8csm3660671a91.13.2026.08.03.02.45.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Aug 2026 02:46:04 -0700 (PDT) From: Shivendra Pratap Date: Mon, 03 Aug 2026 15:13:39 +0530 Subject: [PATCH v24 08/12] mfd: psci-mfd: Add psci-reboot-mode child cell Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260803-arm-psci-system_reset2-vendor-reboots-v24-8-889281373870@oss.qualcomm.com> References: <20260803-arm-psci-system_reset2-vendor-reboots-v24-0-889281373870@oss.qualcomm.com> In-Reply-To: <20260803-arm-psci-system_reset2-vendor-reboots-v24-0-889281373870@oss.qualcomm.com> To: Lorenzo Pieralisi , Arnd Bergmann , Bjorn Andersson , Sebastian Reichel , Rob Herring , Souvik Chakravarty , Krzysztof Kozlowski , Andy Yan , Matthias Brugger , Mark Rutland , Conor Dooley , Konrad Dybcio , John Stultz , Moritz Fischer , "Rafael J. Wysocki" , Daniel Lezcano , Christian Loehle , Lee Jones , Ulf Hansson , Pavan Kondeti , Bartosz Golaszewski , Sudeep Holla , Ulf Hansson Cc: Florian Fainelli , Krzysztof Kozlowski , Dmitry Baryshkov , Mukesh Ojha , Andre Draszik , Greg Kroah-Hartman , Kathiravan Thirumoorthy , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, mfd@lists.linux.dev, Shivendra Pratap , Srinivas Kandagatla , Bartosz Golaszewski X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1785750274; l=2310; i=shivendra.pratap@oss.qualcomm.com; s=20250710; h=from:subject:message-id; bh=a4fxcZei+1h97cnUB4Koj6aUmwrxpdQsIsCANK7Zphs=; b=6PUWyqdZoXA1QuaysA36vs/XHvAO2olSJrRMhPgZHp0LLLjlf15a6Ar5oPcErXR2QVPoPKJKw fm10+Fms55SCR80ZbNJ6JxxIvTiBOyaIWQ6cBXZoRzudw1S6emdYjg+ X-Developer-Key: i=shivendra.pratap@oss.qualcomm.com; a=ed25519; pk=CpsuL7yZ8NReDPhGgq6Xn/SRoa59mAvzWOW0QZoo4gw= X-Authority-Analysis: v=2.4 cv=X9Ri7mTe c=1 sm=1 tr=0 ts=6a70635d cx=c_pps a=0uOsjrqzRL749jD1oC5vDA==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=Sv0fKeRqtYgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yx91gb_oNiZeI1HMLzn7:22 a=EUspDBNiAAAA:8 a=qQQu7YRYY0fa_xNKXW0A:9 a=QEXdDO2ut3YA:10 a=mQ_c8vxmzFEMiUWkPHU9:22 X-Proofpoint-ORIG-GUID: g2vP1KmxLKtyCiI7CdfaR6jX4kiFqC-x X-Proofpoint-GUID: g2vP1KmxLKtyCiI7CdfaR6jX4kiFqC-x X-Proofpoint-Spam-Info: AW1haW4tMjYwODAzMDA4NiBTYWx0ZWRfX4VENxRTgY/Aj elIvg5/+6t5YL/ap2VPswr1xRfDFfrD3g5vavCG/mMTWX/o3RLLb0zNSyrw8GS5dOSiYeoOeM/8 EQFCPH2YEnRjXstMIu/QumHUfms+/HQ= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwODAzMDA4NiBTYWx0ZWRfX49poIKWTMdsT wAx+CS2ja1pBvKFHzLPDBL+u21sHKYxmnJCededBNssaZOwwaUPRKh79NDhWDUoMHWFLlc47xUp zPPnhr7eybrSs1yNMjOuJzFnoCuAf5lJiJNJC/76BzTRRtJgdC0CerYJITISNYbghrF6NZsx9GP 4y50JkRpvILD0PghFfC9WU/aYMDInOHJGQorj5qCs8zJ03kGTPXs6qeBZYtPTLMlIGAbLOEZ/70 FG0cMf8ORFjTUlXMzZHToNXuhb06CjjCTxixlTXo5tPP8NXowMlER1r0uXErzFsLi7NjtaxcIUK j0tLrAscvOp6TdWRkiJ4FrvVlW2CsSYeC8SG6yi8dJkM6ENcrFjiAc6Qc6DC9CpGgAk5ss3OyEq Y0tgex0qWG7bmW5dbpG7UCFKH4s6VSCxmMUMHcgxdrZb1AOkgwsZHHZkE6VFdym7aVMMgIkyqTL GMbCOCJ9y0YqyrBfXEA== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-08-02_06,2026-07-30_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 impostorscore=0 bulkscore=0 malwarescore=0 priorityscore=1501 phishscore=0 adultscore=0 spamscore=0 lowpriorityscore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2608030086 The PSCI "reboot-mode" node does not define a compatible because it is a configuration of boot-states provided by the underlying firmware. With the new firmware-node based cells in mfd-core, this node can now be exposed as a proper child cell. Add the psci-reboot-mode child cell to the psci-mfd driver with a named_fwnode. Add psci-cpuidle-domain cell first to isolate it from reboot-mode failures. Suggested-by: Bartosz Golaszewski Signed-off-by: Shivendra Pratap --- drivers/mfd/psci-mfd.c | 27 ++++++++++++++++++++++++++- drivers/power/reset/Kconfig | 2 +- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/drivers/mfd/psci-mfd.c b/drivers/mfd/psci-mfd.c index 7affd6bb09dd..7befc4fa86f5 100644 --- a/drivers/mfd/psci-mfd.c +++ b/drivers/mfd/psci-mfd.c @@ -14,10 +14,35 @@ static const struct mfd_cell psci_cells[] =3D { }, }; =20 +static const struct mfd_cell psci_reboot_mode_cell[] =3D { + { + .name =3D "psci-reboot-mode", + .named_fwnode =3D "reboot-mode", + }, +}; + static int psci_mfd_probe(struct platform_device *pdev) { - return devm_mfd_add_devices(&pdev->dev, PLATFORM_DEVID_AUTO, psci_cells, + int ret; + + ret =3D devm_mfd_add_devices(&pdev->dev, PLATFORM_DEVID_AUTO, psci_cells, ARRAY_SIZE(psci_cells), NULL, 0, NULL); + if (ret) + goto out; + + ret =3D devm_mfd_add_devices(&pdev->dev, PLATFORM_DEVID_AUTO, + psci_reboot_mode_cell, + ARRAY_SIZE(psci_reboot_mode_cell), + NULL, 0, NULL); + if (ret) { + if (ret =3D=3D -ENOMEM) + goto out; + dev_warn(&pdev->dev, "reboot-mode child cell failed to add: %d\n", ret); + ret =3D 0; + } + +out: + return ret; } =20 static const struct of_device_id psci_mfd_of_match[] =3D { diff --git a/drivers/power/reset/Kconfig b/drivers/power/reset/Kconfig index 143f3260f04a..1810482d52e6 100644 --- a/drivers/power/reset/Kconfig +++ b/drivers/power/reset/Kconfig @@ -362,7 +362,7 @@ config NVMEM_REBOOT_MODE =20 config PSCI_REBOOT_MODE bool "PSCI reboot mode driver" - depends on ARM_PSCI_FW || COMPILE_TEST + depends on (ARM_PSCI_FW && MFD_PSCI) || COMPILE_TEST select REBOOT_MODE help Say y here will enable PSCI reboot mode driver. This gets --=20 2.34.1 From nobody Fri Oct 2 09:22:59 2026 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 782BE371CE0 for ; Mon, 3 Aug 2026 09:46:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785750378; cv=none; b=dd0DaS+88b/a4VOzJEdHDBo2eZbDpyjpyo5PxKkurjqpDm5VWhNzjsx4gM8xUdCeDWUQrROwuUYcjJEyp3QW6BwrknDRgSr/BcgWWj+5bx2cl5QORNqZhaA14XNOIVHZNdl6UoLFM9CwPDa/tKOg1qY7q8jrHTsww6JfpJYEt4Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785750378; c=relaxed/simple; bh=7gXNlR1o8pvBTeUND9fIjf5bCHj2X+kzGUngmo2YPFo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Jk+EGUiRiboKa5FvVPgagLc7lhcyViq1K+LDr3WacBIVd0EH1Fb7Xn6j1t+OMLJDZ9vJ7YjzOrOZvVRwjZ0hSKepG8E691R3Gv17Ss91893bX/bAPGjmXI5O5DMFTZIBYy6bQIgWSsNn+OJnfQVkqu04hVnq2rc2ayPXnNtv8h8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=FuBW1BhE; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=PwMKLqEJ; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="FuBW1BhE"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="PwMKLqEJ" Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6736DaXt3882594 for ; Mon, 3 Aug 2026 09:46:16 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= CcMzfR8AuBhxlCwjCxGKeA1DUODDCoEWqiB6TsALmRc=; b=FuBW1BhEuWRozKGx JeO8DS8E2PuCuK6pGbqY/68JvA05vuF/Gh92L4CYelvStm7lUseeFK/3u6XMwXt8 fy1zqlSQIeB8toqYATO3T6IIgLuhIopR9eHiobuBCdbmUaea+A/m+yEGsI0Ncr+6 FLyVj/dHyhfWC0yNNfXlSfn3wr+JzQjMXPvv1U/SW2Rl5C9Tg5m4NuYbYRELjQCy 61MfCBQqS2OAgUDPbymd6oc+Vs7MnnxxGXiEc2P1WrZOJFn7v07K+n418w5lF7Rg lSiIQJht3F7Hur6PZYKk2ZAXWPlpJZfOYS35zFcy2d0CMoVfrk2YLU5Har/rbPcI LCVeIA== Received: from mail-pj1-f70.google.com (mail-pj1-f70.google.com [209.85.216.70]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4ftnhkgwhr-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 03 Aug 2026 09:46:16 +0000 (GMT) Received: by mail-pj1-f70.google.com with SMTP id 98e67ed59e1d1-38e667368f0so5903780a91.2 for ; Mon, 03 Aug 2026 02:46:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1785750375; x=1786355175; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=CcMzfR8AuBhxlCwjCxGKeA1DUODDCoEWqiB6TsALmRc=; b=PwMKLqEJmZCqk2z7euhim1B1VJb2VHvuPfkTh+xAsZMyDH9oxBYx68xOvEEV2t+HzV xuGz7yLUUwemlcP3b7Y4sxhypr+ugsaOIVHq9F0Y0sXVx4RQn0uUdwaFxDH0iwP78s94 v3gNTiOvs+EB0zHufXXhkjP+Bu9LUqRKnbuxxn2E55S2BV7Ujnkn4jZ4GvXs9E55I1Uy P3ItqWXzTYbz6MkAr8kmeOTY4G6/o867+zXOD3kMJYyAoF9KjHzBVmUNa3bKD70Wrefb 1nVO4aCec2540NLOvrmjtcq+cNj/IRTyvFHK+KiowSWO3bxfzJfg6Ax/bLOAy1P6jFRM p4jQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785750375; x=1786355175; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=CcMzfR8AuBhxlCwjCxGKeA1DUODDCoEWqiB6TsALmRc=; b=oFZL9UQI3RzID9rt01YXIIk1YyRIxYqG6XkTP3AiRHSEAnJLASCffYuo8Up4dOOI8I 0BA+Ley8idPjkTK3Q5US4e2jvbemTayB6rwYSTv4+8h8eTt/56sD2897xhX1mUddEC34 DK25zMHRWAvbWKVpWXrqA4y15fFqgPVDKRWw+rnp503cAaBH0FBZilOFGl4uluibioQV ZMyMwfyj9V1JY4e5nATvecZVKwCs/vKaJP6+8++EtE2S+yF+HordrhGRsHCp6yTKA0Ii HHbiyL1g9qnAcrYNP/6DcbR1tXhVHxBGVKjMu0jx8I/BWHxRcoY+tcMa2xs+bk5A2VTq wmIQ== X-Forwarded-Encrypted: i=1; AHgh+RqLrzYr0THQbaDmunez7c8Fe/DPVqRfSwS6LZCxD2S14keVV8d+qojEZve0taSNeEjJZd/DAAfHTupPxs0=@vger.kernel.org X-Gm-Message-State: AOJu0YwPHOcBMCr0llSnKmcYcQCYlOFWPxSis/O/RO9mc0F2A2wSLcS4 NxN6IgFsLplOqyyoVo66herQVPlTXojdFCpSmEDEZFyGJugapiOU2l67RY+yf+nlPMPv2z9ND43 US4AN6kULPw+BwlnY56UmBQWQ6l/PXHk0eQOd51g3XoBu03aY/UISvyY8ZXBC3js2TPo= X-Gm-Gg: AR+sD1069N6wJpFmJW+plaTIwothrapMvVlxCrtgokaxRORdqCqFdoGAogC0rkWPMyA FYnVc0Gk9xsM2ZlpjGu5OyALL3iEDEYRDZIU56BztOmpILftDdRtrz2dcdPRPfbjKlbjAPMMJlT hpzHEfU3mGZw2UllAG4attYSb8DrpWmAK8fCimu3cIhPeIy7RrGQ2uPV0O/TxPt+75QPATErSvP d94s5I0xUtsla8OI+4f5FGgpWJqLZg9tF1Zma11WYkHkqXSlNIipDYwGVcG06iflOB2xO3BkRyj ZfNcQvcy5sxg+cTK2mdoONvW8ouPGix2PLqo2fhsGGIKzcjYNJSVFcEBkV5PJ78uPdi/fXU9srb VMO2uRusJimcsMoT6nuwnJ9ZGn4BotsgXymmW X-Received: by 2002:a17:90b:4c44:b0:38e:baf:6087 with SMTP id 98e67ed59e1d1-38fbc55b78dmr7942294a91.35.1785750375176; Mon, 03 Aug 2026 02:46:15 -0700 (PDT) X-Received: by 2002:a17:90b:4c44:b0:38e:baf:6087 with SMTP id 98e67ed59e1d1-38fbc55b78dmr7942240a91.35.1785750374705; Mon, 03 Aug 2026 02:46:14 -0700 (PDT) Received: from hu-spratap-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-38fb2be6c8csm3660671a91.13.2026.08.03.02.46.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Aug 2026 02:46:14 -0700 (PDT) From: Shivendra Pratap Date: Mon, 03 Aug 2026 15:13:40 +0530 Subject: [PATCH v24 09/12] arm64: dts: qcom: Add psci reboot-modes for kodiak boards Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260803-arm-psci-system_reset2-vendor-reboots-v24-9-889281373870@oss.qualcomm.com> References: <20260803-arm-psci-system_reset2-vendor-reboots-v24-0-889281373870@oss.qualcomm.com> In-Reply-To: <20260803-arm-psci-system_reset2-vendor-reboots-v24-0-889281373870@oss.qualcomm.com> To: Lorenzo Pieralisi , Arnd Bergmann , Bjorn Andersson , Sebastian Reichel , Rob Herring , Souvik Chakravarty , Krzysztof Kozlowski , Andy Yan , Matthias Brugger , Mark Rutland , Conor Dooley , Konrad Dybcio , John Stultz , Moritz Fischer , "Rafael J. Wysocki" , Daniel Lezcano , Christian Loehle , Lee Jones , Ulf Hansson , Pavan Kondeti , Bartosz Golaszewski , Sudeep Holla , Ulf Hansson Cc: Florian Fainelli , Krzysztof Kozlowski , Dmitry Baryshkov , Mukesh Ojha , Andre Draszik , Greg Kroah-Hartman , Kathiravan Thirumoorthy , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, mfd@lists.linux.dev, Shivendra Pratap , Srinivas Kandagatla , Bartosz Golaszewski X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1785750274; l=2145; i=shivendra.pratap@oss.qualcomm.com; s=20250710; h=from:subject:message-id; bh=7gXNlR1o8pvBTeUND9fIjf5bCHj2X+kzGUngmo2YPFo=; b=QnPk8zoYCiSKzuRa5gqJtn5pFY6pPshnwaLvDzq0DRAMNJnv3wwALCsoc5TnH3xAy/STPH0bO /pMa2XbKfqICzDVEPwpxaz5Qk0kjLWwfbu6UWG6z1VoZ7+bCFOEYbhC X-Developer-Key: i=shivendra.pratap@oss.qualcomm.com; a=ed25519; pk=CpsuL7yZ8NReDPhGgq6Xn/SRoa59mAvzWOW0QZoo4gw= X-Proofpoint-GUID: B2MEkUounmgZ07dMq1ojFH_7FXqfCLs8 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwODAzMDA4NiBTYWx0ZWRfX5bQBwF6fgHq0 s1jqjCUlX6W7P9bSSCfbzjMBtqv1In7N3MDBdZqfAeLTbEfxsk0obHqNHGWwSD/tVfb1ADSmZUA fIvLEKiQDmK/FP5Cozc7snjZqyLZnjZxhjw7FqxJS3FljsDDY069FubAogMy333ZwLPKeMNRxBK kqtwwXNa/XapgkVF9p3KOu/dAJvl4H0W4SteOFqAHeQeotfjYHZWPwhEvPSd2RYuUTwoKEB8nO4 8Yb2ifHvDLd9pY+0V0SNj/ZqJXd3S5YctJfntIjcUvaD+nhlPVX7R0cDkM06+0KqljMc/KP/FwJ iVLxLGYO2VCmPsKo8u4okUmVIXhU2UExbjUhARDRwPBFGASkiXdQ3TpfAW851Bo6zGuqMAueatn uO2DmunhSlu3GEz6EiUS+3u4yEp8pDz2DzwmviyCgSj32EqYyOXVBRUeECer3eJmpMdOPs+06UY NfPd7n44M3EY/p0uk0Q== X-Proofpoint-ORIG-GUID: B2MEkUounmgZ07dMq1ojFH_7FXqfCLs8 X-Proofpoint-Spam-Info: AW1haW4tMjYwODAzMDA4NiBTYWx0ZWRfX1SFarsMOt7RU r8+VGF/eScDl+LHj1zm1KvW3ViqdLlpfVQAXI+TulsnIlv/BxBi6XUCGvJCbfKINKkf8VMVJPBo vZGkxzISfbqf6fcnosH+wTmXMIh2gCA= X-Authority-Analysis: v=2.4 cv=UIjt2ify c=1 sm=1 tr=0 ts=6a706368 cx=c_pps a=0uOsjrqzRL749jD1oC5vDA==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=Sv0fKeRqtYgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=rJkE3RaqiGZ5pbrm-msn:22 a=EUspDBNiAAAA:8 a=t9IVmYW30V31rltyR78A:9 a=QEXdDO2ut3YA:10 a=mQ_c8vxmzFEMiUWkPHU9:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-08-02_06,2026-07-30_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 clxscore=1015 priorityscore=1501 lowpriorityscore=0 impostorscore=0 bulkscore=0 adultscore=0 spamscore=0 suspectscore=0 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2608030086 Add PSCI SYSTEM_RESET2 reboot-modes for qcm6490-idp and qcs6490-rb3gen2 for use by the psci-reboot-mode driver. The following modes are defined: - bootloader: reboot into fastboot mode for fastboot flashing. - edl: reboot into emergency download mode for image loading via the Firehose protocol. Support for these modes is firmware dependent and not available across all kodiak based boards. Reviewed-by: Bartosz Golaszewski Signed-off-by: Shivendra Pratap --- arch/arm64/boot/dts/qcom/kodiak.dtsi | 2 +- arch/arm64/boot/dts/qcom/qcm6490-idp.dts | 7 +++++++ arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts | 7 +++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/qcom/kodiak.dtsi b/arch/arm64/boot/dts/qco= m/kodiak.dtsi index f74fa66f1a67..6e3837c2490c 100644 --- a/arch/arm64/boot/dts/qcom/kodiak.dtsi +++ b/arch/arm64/boot/dts/qcom/kodiak.dtsi @@ -866,7 +866,7 @@ pmu-a78 { interrupts =3D ; }; =20 - psci { + psci: psci { compatible =3D "arm,psci-1.0"; method =3D "smc"; =20 diff --git a/arch/arm64/boot/dts/qcom/qcm6490-idp.dts b/arch/arm64/boot/dts= /qcom/qcm6490-idp.dts index bdc02260f902..b7a0b5347639 100644 --- a/arch/arm64/boot/dts/qcom/qcm6490-idp.dts +++ b/arch/arm64/boot/dts/qcom/qcm6490-idp.dts @@ -786,6 +786,13 @@ &qup_uart7_tx { bias-disable; }; =20 +&psci { + reboot-mode { + mode-bootloader =3D <0x80010001 0x2>; + mode-edl =3D <0x80000000 0x1>; + }; +}; + &qupv3_id_0 { status =3D "okay"; }; diff --git a/arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts b/arch/arm64/boot= /dts/qcom/qcs6490-rb3gen2.dts index 90f2eebc349f..4ba5246fe3f1 100644 --- a/arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts +++ b/arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts @@ -1105,6 +1105,13 @@ &pon_resin { status =3D "okay"; }; =20 +&psci { + reboot-mode { + mode-bootloader =3D <0x80010001 0x2>; + mode-edl =3D <0x80000000 0x1>; + }; +}; + &qup_uart7_cts { /* * Configure a bias-bus-hold on CTS to lower power --=20 2.34.1 From nobody Fri Oct 2 09:22:59 2026 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6F68E364057 for ; Mon, 3 Aug 2026 09:46:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785750388; cv=none; b=V3EIkWoN4sukAEUr9ilvHVbnIyxCOGNiA84T/r39Te3T8xO3z+JK6y/ZOJ0w43NrVgGydnHPOg8pAFV9LPWp72QU1GwDpu3JmivJQU8g8jfPDpkSUaWkR402g3c4Rcx4hCztC6slRN4Q5w2gtSzAGKrVjS3qU6dKnev2SBrBbok= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785750388; c=relaxed/simple; bh=eX0gyJVSoiIZC4uU3tt6tpOvtTx0GJUfdT5GBO9fTMQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Q5YwJcrqY8uaQpbxda+XyBYPCYfEjEe59GVKH39nOd9hsP9NoLhZ4oVqgUSB5/ub7haVcndv9BPRyCvV7uD6N3NVtSlekhoeFkPnPWIaiS8ob3LZQi8YxZ25eZpfU5oSQRf6xR5IeDxNE8+Q/IVZ7klbboD2d+yk45fp6WI6Sds= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=ljwniybB; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=hfiM9/1f; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="ljwniybB"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="hfiM9/1f" Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6736TE1V4015164 for ; Mon, 3 Aug 2026 09:46:26 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= RkbUYnG5QVUwJjpx/m9+iBpC8gUP3/hJ5OfATJdYexg=; b=ljwniybB8G58AIXW p/ACoAOs2h09mwEO+AJP0ukYht9lNoqDX+L4DsIfDm2tJwQm+WzTUVwYKSPqsczN nZmoEPasbwOwXUPFtrR4sgucdpVAT+wYdZEoYHDn6jy5GhAUtCnnRfk6lJerEqTr p6hC/waAu05Yll1Vhei58EkbweInvItTDmNCwvqscXMwMyje4E/xkKC2D6bq9DU6 zsnbAlqBH7sD/LGOkAXW1PYNBkkxiWyuVHoAqEINhw8EQf9+YoVqU/ZWSvkserqF kna5soRi9/n03t7be2zbat68tMUskFgE9HigAwfRl10hg4HLYtIPU3HFBAjwVyHX TADBAw== Received: from mail-pj1-f71.google.com (mail-pj1-f71.google.com [209.85.216.71]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4ftnrt8v9r-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 03 Aug 2026 09:46:26 +0000 (GMT) Received: by mail-pj1-f71.google.com with SMTP id 98e67ed59e1d1-38dbe39ce62so3055993a91.0 for ; Mon, 03 Aug 2026 02:46:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1785750385; x=1786355185; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=RkbUYnG5QVUwJjpx/m9+iBpC8gUP3/hJ5OfATJdYexg=; b=hfiM9/1fuLbCWJ0lczIjuezKclwgNjmc3e6gbH1gMyfxQnIQ41VbhD7/t+5BaD+MrR 27aaTiYGPimu4cVNZkpxbbn+Hy6Q7X3a6vxlMuFmxkiRUXgSgZG8IqMHiEDNN5sTbcd+ 4rjJ9Au7xF6SnOTlLzrRBRBdGGL8NXN92O9sopRoZvbwGM9tR398vTLRczAFCh4nG0rv 2lmIUt1s5Kh/zzoIyhOVHVUYSUJBLv8dOonkj0XJwSlLASxAs5KQJyeKoxvnBGBL/kTm YO7j//RSr2If7jsx/KJpQLgLsdEzkza/73fxx/avgibP0+CEvINptz4gzy0wq+xNBmKt kO2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785750385; x=1786355185; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=RkbUYnG5QVUwJjpx/m9+iBpC8gUP3/hJ5OfATJdYexg=; b=b1kvnzc/Kcs+8RBKnUa/7zFq3XztSVhaH97+7sA74k+i9DMpfnvzQCAn6kJcHqZvQE 8dZK4aMcxnao8E+VXKTHrc/QGa7/wK6zlfKyqbzg+OsSBNHZCyy8dt91yFu4N4xpxEUz TBca43XN5vNYDSLjR+5dyCP+7pGkYf2dylZVscj82EzWlzRnlIPm6imiojUTDX/yUIpe NQ+nBdXj7gnpYDBzScgmRSY8nl9PLgJKlYwqgUeuUxGc36VLYx0wJRl8rpIs/7hNe/59 az2wef5lAPWFRQbxSS5usxSQfyN0gWPTzZNx/vdOpU+0w94B3R7T63rumLnEAUFsScvk nEeA== X-Forwarded-Encrypted: i=1; AHgh+Rr9ZNT/EWC07SYKfmrClos5l0xraCGE/05lAMckXLrSCkDyVBaSYdzCwZFQyVFqtHiHv1dD3+JDTcfFbfQ=@vger.kernel.org X-Gm-Message-State: AOJu0YwQ9BTklj8Vin3vaW/Mv6mfc6/oHIVYgJ7MzvN2kq6x0+sHvR5y U0SHI//R66qIj1Pe7z2Btubr98dNwW3BSOwHD8kqUFenJBmqqlb98oN5hgKWfv4K8rWhCPFv651 Q4BY0AsUqlhJPv5RSbjtoSyxsjX0HGeKceXYKPgji4/m+AdqREnpofXAC+yb4RbABPzo= X-Gm-Gg: AR+sD11tSjZbFKOThjwUdo4mJ7Dw59uDg1H6dtlmgpn9A3nbyACT2KuR3B+RF8OeG57 7oYmxY+sVudxhsCPIxNSWoj40tttd7qqKiQ3mnCaHDRgX0/fhzYrzI8cTKHSkaVOHtzKifp6dbQ PkIeVrOYo1cHFCmyap0asXQmLOSQTngWG3k1TukWuTzv16jWLygPPR3e/4n2OlsBHFgF4+EjyGU 0+smf1sIOruCGXgLCeVkCMdYZDXecGMrVLxIFX7q/C8al4Y8x/+YxrXKFyjrQpba0yGxMGzqKB/ NcNewM1G8pYyfqdJIKx+CDLiOlzpnQ3/7doPJzLeN0KSJ3++u8jvYP/JGb66U+xYoA6gQ0XaYk9 RLm+BONAQ6GeUvMLmg3gYYE6RWH72fD6ZGs2X X-Received: by 2002:a17:90b:1e46:b0:38e:4f42:d0d6 with SMTP id 98e67ed59e1d1-38fbca8e5e6mr7069164a91.12.1785750385365; Mon, 03 Aug 2026 02:46:25 -0700 (PDT) X-Received: by 2002:a17:90b:1e46:b0:38e:4f42:d0d6 with SMTP id 98e67ed59e1d1-38fbca8e5e6mr7069120a91.12.1785750384847; Mon, 03 Aug 2026 02:46:24 -0700 (PDT) Received: from hu-spratap-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-38fb2be6c8csm3660671a91.13.2026.08.03.02.46.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Aug 2026 02:46:24 -0700 (PDT) From: Shivendra Pratap Date: Mon, 03 Aug 2026 15:13:41 +0530 Subject: [PATCH v24 10/12] arm64: dts: qcom: Add psci reboot-modes for lemans boards Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260803-arm-psci-system_reset2-vendor-reboots-v24-10-889281373870@oss.qualcomm.com> References: <20260803-arm-psci-system_reset2-vendor-reboots-v24-0-889281373870@oss.qualcomm.com> In-Reply-To: <20260803-arm-psci-system_reset2-vendor-reboots-v24-0-889281373870@oss.qualcomm.com> To: Lorenzo Pieralisi , Arnd Bergmann , Bjorn Andersson , Sebastian Reichel , Rob Herring , Souvik Chakravarty , Krzysztof Kozlowski , Andy Yan , Matthias Brugger , Mark Rutland , Conor Dooley , Konrad Dybcio , John Stultz , Moritz Fischer , "Rafael J. Wysocki" , Daniel Lezcano , Christian Loehle , Lee Jones , Ulf Hansson , Pavan Kondeti , Bartosz Golaszewski , Sudeep Holla , Ulf Hansson Cc: Florian Fainelli , Krzysztof Kozlowski , Dmitry Baryshkov , Mukesh Ojha , Andre Draszik , Greg Kroah-Hartman , Kathiravan Thirumoorthy , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, mfd@lists.linux.dev, Shivendra Pratap , Srinivas Kandagatla , Bartosz Golaszewski X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1785750274; l=2178; i=shivendra.pratap@oss.qualcomm.com; s=20250710; h=from:subject:message-id; bh=eX0gyJVSoiIZC4uU3tt6tpOvtTx0GJUfdT5GBO9fTMQ=; b=RINqxFXiKRYq0XQfmxM1CrYk2MUvveTibsQb+NSF/OZeeVCPI2iDfg9IvXNAtieahlF3sAyLO IGXmJGGc147AIH6szVfuhfSfGdVZqIIEioAPxE+NSIFUkr3ZbV73cx5 X-Developer-Key: i=shivendra.pratap@oss.qualcomm.com; a=ed25519; pk=CpsuL7yZ8NReDPhGgq6Xn/SRoa59mAvzWOW0QZoo4gw= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwODAzMDA4NiBTYWx0ZWRfX0XtVulPTM9qG vBX/fBONgktPncWriopsGqn07aA6fT9L3yHYWjh5vcH3JvRWEPVG5t6mtjAU/7N3hyCgVwqoEvc c/9cUinxw7AxN1PPn85isWZug5+AOA2jFydrS5ybQyJyVttH73g6CnoMZFAfYoJKI9MTZz7w7CC MOnFkJgAaRdJ/Jfm9vxfMqSjxLqczDFDwIrrhiZFhnLBQFJA5fo9gLT8WyjiJZENfsW9TOaRt5w ePUjdbMzoE54FMOs+rRGrORSxtX8v99c+gTt1UrIvxgxLVSNtWpxJgbj2c9uMreiIFm3AKTk15W bELOG9hPMioDi9nDJX6yiAkHJeCQSrGWDu6UAAX/m+agIMgHSyTWhzBNmLDUrH99sLBTFE2VEj0 DbiFO9uaEPjAXZbDXsyhoEg9Jc+5i4msJUtIRq2EBTUvrLBbVZjPUkPRf0nLfOrg8XPI3+8e9hS hjd0RbOAVtJR3WduqTw== X-Proofpoint-GUID: q_XsMWUFtNh-wSUWxi7lSG6EnXBuC7ZT X-Proofpoint-ORIG-GUID: q_XsMWUFtNh-wSUWxi7lSG6EnXBuC7ZT X-Proofpoint-Spam-Info: AW1haW4tMjYwODAzMDA4NiBTYWx0ZWRfX9GexLx0aZNB8 iMaJTdWbVghVVI5Vg1mTHf4VBTech7T7PnB3dNia1//rFBLUe60D7TX+vsVIiAFTmjdWncti0xG CxXNNYdImjvUrXUKSstWh/py+d7N5yQ= X-Authority-Analysis: v=2.4 cv=Ft81OWrq c=1 sm=1 tr=0 ts=6a706372 cx=c_pps a=UNFcQwm+pnOIJct1K4W+Mw==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=Sv0fKeRqtYgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=gowsoOTTUOVcmtlkKump:22 a=EUspDBNiAAAA:8 a=t9IVmYW30V31rltyR78A:9 a=QEXdDO2ut3YA:10 a=uKXjsCUrEbL0IQVhDsJ9:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-08-02_06,2026-07-30_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 impostorscore=0 lowpriorityscore=0 clxscore=1015 adultscore=0 phishscore=0 bulkscore=0 suspectscore=0 priorityscore=1501 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2608030086 Add PSCI SYSTEM_RESET2 reboot-modes for lemans-evk and lemans-ride-common(sa8775p-ride, sa8775p-ride-r3, qcs9100-ride, qcs9100-ride-r3) for use by the psci-reboot-mode driver. The following modes are defined: - bootloader: reboot into fastboot mode for fastboot flashing. - edl: reboot into emergency download mode for image loading via the Firehose protocol. Support for these modes is firmware dependent. Reviewed-by: Bartosz Golaszewski Signed-off-by: Shivendra Pratap --- arch/arm64/boot/dts/qcom/lemans-evk.dts | 7 +++++++ arch/arm64/boot/dts/qcom/lemans-ride-common.dtsi | 7 +++++++ arch/arm64/boot/dts/qcom/lemans.dtsi | 2 +- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/qcom/lemans-evk.dts b/arch/arm64/boot/dts/= qcom/lemans-evk.dts index 0c53640c42a6..3baad102270d 100644 --- a/arch/arm64/boot/dts/qcom/lemans-evk.dts +++ b/arch/arm64/boot/dts/qcom/lemans-evk.dts @@ -911,6 +911,13 @@ usb2_id: usb2-id-state { }; }; =20 +&psci { + reboot-mode { + mode-bootloader =3D <0x80010001 0x2>; + mode-edl =3D <0x80000000 0x1>; + }; +}; + &qup_i2c19_default { drive-strength =3D <2>; bias-pull-up; diff --git a/arch/arm64/boot/dts/qcom/lemans-ride-common.dtsi b/arch/arm64/= boot/dts/qcom/lemans-ride-common.dtsi index cefb8ff00806..cc96442403e8 100644 --- a/arch/arm64/boot/dts/qcom/lemans-ride-common.dtsi +++ b/arch/arm64/boot/dts/qcom/lemans-ride-common.dtsi @@ -800,6 +800,13 @@ &pmm8654au_3_gpios { "GNSS_BOOT_MODE"; }; =20 +&psci { + reboot-mode { + mode-bootloader =3D <0x80010001 0x2>; + mode-edl =3D <0x80000000 0x1>; + }; +}; + &qupv3_id_1 { status =3D "okay"; }; diff --git a/arch/arm64/boot/dts/qcom/lemans.dtsi b/arch/arm64/boot/dts/qco= m/lemans.dtsi index 17bc5bcd9d09..cde157f6d7c0 100644 --- a/arch/arm64/boot/dts/qcom/lemans.dtsi +++ b/arch/arm64/boot/dts/qcom/lemans.dtsi @@ -549,7 +549,7 @@ pmu { interrupts =3D ; }; =20 - psci { + psci: psci { compatible =3D "arm,psci-1.0"; method =3D "smc"; =20 --=20 2.34.1 From nobody Fri Oct 2 09:22:59 2026 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 740A6374E5C for ; Mon, 3 Aug 2026 09:46:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785750400; cv=none; b=n30s57To2ETwMk311NAIKQ3QfpCMQji5nL6dmYU2OJFyESu76tFKt1STNAokQPMzzH2E/nLpCmXOQFHUugOMhLIZul2VpPamL2Ocy3g6seWLhfPlgj6kQo9w+mClvj9/6WajLbM02NoDylQyL2+UtxkXzmD0jyuTPoOdfvsBqN8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785750400; c=relaxed/simple; bh=O4Tzed7m01NrjoUwSpC2HzBAZQmMIMSt/VK8SDx89II=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=XTJccQK4+/G4pThbeaR/7Zuf/rF8dr6RjZD9Yek99/3Sowq4dCkZmurSqArirQH5sIM4Hw2nTauAnnNQf0qCHYLax5yifNGPVBh5jUsXD0S/qEnehjuPvyzMBNvbZaIIuQkslNBGrlFxw1jzK/TghSZuV0NpA2KHKYRxZVXzMgQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=M7izVduf; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=BjT9QzI0; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="M7izVduf"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="BjT9QzI0" Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6736DaY13882594 for ; Mon, 3 Aug 2026 09:46:36 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= ezThn65VJDM09Kdd3e/bqDNQx15D8XtlMr6yKq720FY=; b=M7izVdufe4+P8sb5 LAcVwgnRudqXPYT2ajswUCwjO3LYTD+vzy3GVnFxt5ff8wmQDxA8q+foKI2liHWq p+F1m5WiMNS6WkzHO+GXj1KKHchgpQjqMJ0qYmfjvL91jpGju7uOEt4kNWP4pyjW i+RCKJUHKTMkq8w6QrX1gFj6X/6e/QDOm2DQPFCcCZFJ7LArZLz9QaWRojvsnxrd KA+qlGH6nCZQ2dWVbkihKQbcrJhli+WK6oEhf67u6xHrQzTxLhFX6gXb2bgyLzBH C4L5pGlbbRUCnoJjmCTj9kuERSyTnPOJzhD8zZrlXrUMQ+PTyiJZvryq/gWXlxkM 4J2BDw== Received: from mail-pj1-f71.google.com (mail-pj1-f71.google.com [209.85.216.71]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4ftnhkgwkg-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 03 Aug 2026 09:46:36 +0000 (GMT) Received: by mail-pj1-f71.google.com with SMTP id 98e67ed59e1d1-388cfc4848dso4378175a91.3 for ; Mon, 03 Aug 2026 02:46:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1785750395; x=1786355195; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=ezThn65VJDM09Kdd3e/bqDNQx15D8XtlMr6yKq720FY=; b=BjT9QzI0M8n3S5viCJtU1PZaphSK7zNtAi+m5jTzo/RC+TzJdrmwPC+/StGY9jhERn sGUL15HBI2FBE3uhvZ+DcdeGStquliVHkA8afB9oCKjfcOpzAuLgV5u+MtnY6LAvI11S 4b3GX4D++fxJ8y2jFpSrVXq0WLUVGa1+jR0IdpVuNfelb7umKg5qkOH2wtsSRaTmduul W4UukoTCn9uC4HpRCiNGBqJAQG7ciTtzw9yxJXuf7lpjXnZhmRwx2JXO3yJ2Pf2g+ZtJ f7p9IMy0lS2iV8wLUgYarh2R8cHrGFcctanazVgDHZNDuu5eFPdcRcWeJ/eQ9OLgquNu +fiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785750395; x=1786355195; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=ezThn65VJDM09Kdd3e/bqDNQx15D8XtlMr6yKq720FY=; b=GfCdBRWBUWKP7PtPXHXQKct3PrFcvFsBXLiMwWRZXmh7hahSX/O2FpP++p6g82bn4m f/G/KR8PKyiEX02VXq1DoA6teyQsJ84wJx1zcXUBP5xMz4IG9wZsNUxvvzR1dKDZqoTr 0dY606fQwLupBlBvRYMKM3FmzqZRsmz3aBAI6kVLXoo30MVFc87Xb/jGKZNojgkzx4IL +wYQVACB7ulKAEjUGCwzI/y3P7C3Mzr3IHzXSkd/AxLSGP5SdLMqPIEmdpmFRtGQC1c4 VTcxPjoAq8aC4nQfnCHf/KTib/zeSPocKSvmAKrR7ZL/APC9GA7kF652y/El6uwpoFPm Ld2w== X-Forwarded-Encrypted: i=1; AHgh+RpzfaXIaAkFAkyB18X1uPCEVBU77dTvYqwt1A3Snhb4AAfdT2XJrn6+4PmlVe9Nkk+VRQFJg1gJ6LO6rKw=@vger.kernel.org X-Gm-Message-State: AOJu0YyaCqtR9K8t1ipAMXlGu4JpRFYlBlo3KSQc+jEizBienTJ2q4qI wzYq+H0cWuY9sTO/GGA8Ioifze8DDOA/ZOI0ZBBxOzpr5QJvPfh3Qpt1a9x8AYEjFKMHdqeQ7Yo vvUOk1QrkFa7jiW+rsjtdp1J3dHBQyq0X9Re+vbxKQeJkk9CDF/d+69bgq3tFC3fuhvM= X-Gm-Gg: AR+sD13ccV9OWtxkpSLW4yH7HaJiG3q4qSLocvFVk0hA45Lu5YlcUsuvDRRipkam8JE SPIburo5g2QzGg5h09HzqZYtBXkMzbT0qIV/+UUIq6OUXQ2jKQtSY2+fB72lPRFwhslsRFVFyl1 AP3fEiaxcURwl8e1E9wRnIHv9MIE5sXeQDAaFX0XG81ddkJ2XhOUMMecyGV2Sg1EdyLSB0YDq8d qSq3Qi2G6ZMpyrW8ic6mq8UixmWhpy/U9vhCLH/SYdcA2thEcsoilv43rs44VQUeSq4TqHhmddP UR7sKpBkPdYOz3UoRM+lJjpChxidZh6vdC7URd2/E9jfsxGarutEUf1NuX8/ax3olCAPPXDe8Ru Z0vhc+9jxN8ARLDmC65Azc1LWNbw4BWVBrGas X-Received: by 2002:a17:90b:57cb:b0:381:11eb:d78e with SMTP id 98e67ed59e1d1-38fbc4431dcmr9095175a91.14.1785750395454; Mon, 03 Aug 2026 02:46:35 -0700 (PDT) X-Received: by 2002:a17:90b:57cb:b0:381:11eb:d78e with SMTP id 98e67ed59e1d1-38fbc4431dcmr9095152a91.14.1785750395034; Mon, 03 Aug 2026 02:46:35 -0700 (PDT) Received: from hu-spratap-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-38fb2be6c8csm3660671a91.13.2026.08.03.02.46.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Aug 2026 02:46:34 -0700 (PDT) From: Shivendra Pratap Date: Mon, 03 Aug 2026 15:13:42 +0530 Subject: [PATCH v24 11/12] arm64: dts: qcom: Add psci reboot-modes for monaco boards Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260803-arm-psci-system_reset2-vendor-reboots-v24-11-889281373870@oss.qualcomm.com> References: <20260803-arm-psci-system_reset2-vendor-reboots-v24-0-889281373870@oss.qualcomm.com> In-Reply-To: <20260803-arm-psci-system_reset2-vendor-reboots-v24-0-889281373870@oss.qualcomm.com> To: Lorenzo Pieralisi , Arnd Bergmann , Bjorn Andersson , Sebastian Reichel , Rob Herring , Souvik Chakravarty , Krzysztof Kozlowski , Andy Yan , Matthias Brugger , Mark Rutland , Conor Dooley , Konrad Dybcio , John Stultz , Moritz Fischer , "Rafael J. Wysocki" , Daniel Lezcano , Christian Loehle , Lee Jones , Ulf Hansson , Pavan Kondeti , Bartosz Golaszewski , Sudeep Holla , Ulf Hansson Cc: Florian Fainelli , Krzysztof Kozlowski , Dmitry Baryshkov , Mukesh Ojha , Andre Draszik , Greg Kroah-Hartman , Kathiravan Thirumoorthy , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, mfd@lists.linux.dev, Shivendra Pratap , Srinivas Kandagatla , Bartosz Golaszewski X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1785750274; l=2076; i=shivendra.pratap@oss.qualcomm.com; s=20250710; h=from:subject:message-id; bh=O4Tzed7m01NrjoUwSpC2HzBAZQmMIMSt/VK8SDx89II=; b=jIK9eRQowAumFQnJU8rgPJj3lU1UNl6daKuWFCJ3dV5jgI1ReAHdNEUECvVtm84xI7oCNMRfr Z24jbNqM8OnCRYo8+wOhwXz1fw6dU/k2BIKAA/ZnbfCF1H8PV6qp1J9 X-Developer-Key: i=shivendra.pratap@oss.qualcomm.com; a=ed25519; pk=CpsuL7yZ8NReDPhGgq6Xn/SRoa59mAvzWOW0QZoo4gw= X-Proofpoint-GUID: 0CjgxnSo2sL90xtjcUqVPCJ_9Kv4eX3b X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwODAzMDA4NyBTYWx0ZWRfX7sDT1bDfLU2t xhCSjXpGtGdGTBH8HW4M4nxGqTVCxAf08TaqnYgeql1HCUbYXawaPWhz9KsIVx7hWHSlK8ZYDiX tFv4RQF01qhjE1mmM0w39Z5w3ymZzc6g3knaVoZAbOA7QpjTb2eEJSGaMd2maMeVUmIgAH6aMTI nYM7g/ydr8/Ne8t10l16AqqBMMuR5VwDqiATPcM8J48hTR9J3FYBY4TcN0JWi2Jw7rhL9xuJmfn phyq5ys8oGuUuTDirExZkOY4ifanv4B8Jd7X/hksizc/z8tCPd5UgQYRouUf/AjmFZXGonuFSxI fuvGtldhevHoGuNQCXXsxICNydKIg1jgvoDtWz0+/KvvUe7djiMBO3N96TwcNQ0bj+yiTJS4BRv DS4uTtsoaajXSq6t2dHWQIgbIaP56XFPqS0SgdNL3zMdvuGFwDAe5iUvKZ+IsHRkLeyvskBb0LX Btru8/DRdNy7J3VwuFg== X-Proofpoint-ORIG-GUID: 0CjgxnSo2sL90xtjcUqVPCJ_9Kv4eX3b X-Proofpoint-Spam-Info: AW1haW4tMjYwODAzMDA4NyBTYWx0ZWRfXypEjIW8aK48w 3KwzCraqG5+kXIuza2NuUKbZzAvkNYf4kjJgBpU5/vJJRsa3fRTNQzc8nrNNLok6ZBBGoDu8QmI 52UJanqG+t7E/1w7Sf0rfuB8IvUhyyM= X-Authority-Analysis: v=2.4 cv=UIjt2ify c=1 sm=1 tr=0 ts=6a70637c cx=c_pps a=UNFcQwm+pnOIJct1K4W+Mw==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=Sv0fKeRqtYgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=rJkE3RaqiGZ5pbrm-msn:22 a=EUspDBNiAAAA:8 a=t9IVmYW30V31rltyR78A:9 a=QEXdDO2ut3YA:10 a=uKXjsCUrEbL0IQVhDsJ9:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-08-02_06,2026-07-30_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 clxscore=1015 priorityscore=1501 lowpriorityscore=0 impostorscore=0 bulkscore=0 adultscore=0 spamscore=0 suspectscore=0 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2608030087 Add PSCI SYSTEM_RESET2 reboot-modes for monaco-evk and qcs8300-ride for use by the psci-reboot-mode driver. The following modes are defined: - bootloader: reboot into fastboot mode for fastboot flashing. - edl: reboot into emergency download mode for image loading via the Firehose protocol. Support for these modes is firmware dependent. Reviewed-by: Bartosz Golaszewski Signed-off-by: Shivendra Pratap --- arch/arm64/boot/dts/qcom/monaco-evk.dts | 7 +++++++ arch/arm64/boot/dts/qcom/monaco.dtsi | 2 +- arch/arm64/boot/dts/qcom/qcs8300-ride.dts | 7 +++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/qcom/monaco-evk.dts b/arch/arm64/boot/dts/= qcom/monaco-evk.dts index 9d17ef7d2caf..df668dbf2bc6 100644 --- a/arch/arm64/boot/dts/qcom/monaco-evk.dts +++ b/arch/arm64/boot/dts/qcom/monaco-evk.dts @@ -661,6 +661,13 @@ usb2_id: usb2-id-state { }; }; =20 +&psci { + reboot-mode { + mode-bootloader =3D <0x80010001 0x2>; + mode-edl =3D <0x80000000 0x1>; + }; +}; + &qup_i2c0_data_clk { drive-strength =3D <2>; bias-pull-up; diff --git a/arch/arm64/boot/dts/qcom/monaco.dtsi b/arch/arm64/boot/dts/qco= m/monaco.dtsi index 2c0af0326147..81cdc4ccf8c9 100644 --- a/arch/arm64/boot/dts/qcom/monaco.dtsi +++ b/arch/arm64/boot/dts/qcom/monaco.dtsi @@ -654,7 +654,7 @@ pmu-a78 { interrupts =3D ; }; =20 - psci { + psci: psci { compatible =3D "arm,psci-1.0"; method =3D "smc"; =20 diff --git a/arch/arm64/boot/dts/qcom/qcs8300-ride.dts b/arch/arm64/boot/dt= s/qcom/qcs8300-ride.dts index 1ff39530ea3d..aa95584b000d 100644 --- a/arch/arm64/boot/dts/qcom/qcs8300-ride.dts +++ b/arch/arm64/boot/dts/qcom/qcs8300-ride.dts @@ -678,6 +678,13 @@ &mdss_dsi0_out { remote-endpoint =3D <&dsi2dp_bridge_in>; }; =20 +&psci { + reboot-mode { + mode-bootloader =3D <0x80010001 0x2>; + mode-edl =3D <0x80000000 0x1>; + }; +}; + &qupv3_id_0 { status =3D "okay"; }; --=20 2.34.1 From nobody Fri Oct 2 09:22:59 2026 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EFE9F377566 for ; Mon, 3 Aug 2026 09:46:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785750409; cv=none; b=JDZTcYScsqKsbrMsT5TrCWcK4ipHuq72AIx9V0KrPCnB36SVTtyni/1Iw1JqPAzyL11su12fabKgXVIp+foz8j0YnvZXG33eQa2//aTZMJFyCsNRmLfUcQxLVVVGQzypmGDEMBq7+yoAjA7/IraCbC1lkmP/FptY6PRlAygPxq4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785750409; c=relaxed/simple; bh=OJwAm/Vozmf+aVTmHqCY4oum1OVPcZBckomX6WcElq8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Z+1brmOt+NzCUccGCo85wVFsLg0IPWasyYOG5vChIxkGHVy41NFldyePPcrsjtS+32y+HAdw3eCi8EQT8riuqxGDTRz2yQ2AC337KjsEUJwWNaVLulEAs45+j0Pzjbj1G93lGFR3xoK8Ot1imB2/XcEndQGSkzjTpEEDlFOiYf0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=QrS8cyTe; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=LxinmNUe; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="QrS8cyTe"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="LxinmNUe" Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6736DaY53882594 for ; Mon, 3 Aug 2026 09:46:47 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= o/+3/8QxNTkVS2/4tc3nfViSHcapFtRLbeTLF1zxXN4=; b=QrS8cyTeGtmmLJpw VZ7FRl0hxHBX+kaoNrTzcTE6OBufJsUH5AVMNCJExi2+0kpen8ylUY+VcIoc+IYU hX/uh5ma9MggKifQCrcpyP185ySGaVIGtz0XxmvecLbD0Bh5/LMftrGyYGZuwQH7 4g0uC+4PsN5AA7+jRVVnxkLxL0gENilXwGaaf/8UqVBTc2pAiYxzfmN5El4LS/Mb hsa4A73b/GE6bRunzA75dSlcr0iZSdheaykODVXs0+mrTQHuUaQiM6NSbyb5ut+5 fDEd+YgXjAaINpxdoVef/ZbfOHO5Y+4PmZU3RLWF08D5ai+FBR0/G5CFaxWSTVbU QcW1zA== Received: from mail-pj1-f72.google.com (mail-pj1-f72.google.com [209.85.216.72]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4ftnhkgwmd-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 03 Aug 2026 09:46:46 +0000 (GMT) Received: by mail-pj1-f72.google.com with SMTP id 98e67ed59e1d1-38e667368f0so5904549a91.2 for ; Mon, 03 Aug 2026 02:46:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1785750406; x=1786355206; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=o/+3/8QxNTkVS2/4tc3nfViSHcapFtRLbeTLF1zxXN4=; b=LxinmNUeghnsjdABF2zRd0hUS17ZE+Xr588hHzNPgCnj3h5r8CU61WbFaH6f5CwGBP rygQDqFKmBnt6PjlE2SA65eGDdfH206GTtLzrIGhPcc2JVUIHkgBopbX0Zx1F7gCCNRJ G4KjhUzCU+AXOJsCmYCV4O+kHGNUdPGkF/urOciyST95x89+daoAIAtqV5AbI6mEYXny jgxlQtdDeOWL/8Mv37mHWZCoyRh4r1HDwD4XA5PQ1RW8WnPSLngMBgELcSFNyks/ffk4 F+9k8OyKeTcThwukDgPNCjTjPx8cy6+KpDLh8a/yn1Yy+Qlx+v81SHlRxHKd8NPgPszR wnwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785750406; x=1786355206; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=o/+3/8QxNTkVS2/4tc3nfViSHcapFtRLbeTLF1zxXN4=; b=o31U0sy5aa6QyBMLL1sFUEddD7tVJyYDLiQWjbfXvS+Tr5WtNRNSDj5JajSOx2a4vy 5SzifEsIvKyqi/vDQZK5frSLl5jlPZwsZwVFo4TNQ7NWbEzwSWb6/KSxCWc80lANK6px Pu35ZTIQEGWd5UwghtunX34REuyWSmVo9jSXaJzE1Ifpa6xTsZv3sYDNVX/FQRifXUcO 7RfNMD1fdVSp9qxkBTVstS0Wgz3b4ZTh9TRy27trOukUvIie/1g+VuBLGv9kiaGiGzIU 0LGtJq+XOzgKZC8X71BE4wgq37/w+I83kqMqyl+pCLcczndZg23/7ENmf1bLv74ln3Zq VFOQ== X-Forwarded-Encrypted: i=1; AHgh+RofYBNfhcnWzB2r7Fi6e16l12yeX+t9XFbL4qWW4EAInSwpM2nK78M/wg0h6Hw6KXH3xKRmGH5iE2nDVJ0=@vger.kernel.org X-Gm-Message-State: AOJu0YzR88ZrZ4qxUAk73xytoZ4pd9G47vtywIgBV8nrJ6vA+Zo3XHRv GkRlsl6emj1kWyyOSf8fHuPhcNbhvcbXNrFhSe6TyE+siVPowGKxc1Lr2p/lSkU3Dk/eDVlwQhC YcJ83syEB7dNicc63BUFjzJ0eAPvdz3l46sXNeQPQqs9yJ8dbmu5QNpCtyfERaTteCbI= X-Gm-Gg: AR+sD118BkZtZnYY3FpmiGdWgrPUyPFb3WYKqzzf+h1+YgB245qKLby5kS5lIvFFBnJ YsVft2Sbtjj8LemQ3gZpbE/dyjQXZE42Gw7v+wmT4hdKhpcnygifjgVSjRznCytoCOksid06kI1 UT2+3kRmJyeV3qamdThb9whipi0DOQd2y1EDXG2qp6rojevRNdIjpeGazdGfkYqthcJQUnouoRe 4wCjBDWtM+1llhU437fZI0bBltTUTpb40h9ryI5f8zZkbhk80C6xQnxV826Wh06KNDcx0DWv5b1 xazUz0eEEm5/pDNVHikWKvMOP/2BNRQ6mV5fQRBMU929b7VKUQCzf7VkqTiYOQCdL5uHC7pI7sf xUfGjDZWYjZs/4ydv3beGSIMVi8RAEmpA+rCj X-Received: by 2002:a17:90b:2750:b0:38e:2c8f:a01a with SMTP id 98e67ed59e1d1-38fbc42c3a1mr7728803a91.11.1785750405832; Mon, 03 Aug 2026 02:46:45 -0700 (PDT) X-Received: by 2002:a17:90b:2750:b0:38e:2c8f:a01a with SMTP id 98e67ed59e1d1-38fbc42c3a1mr7728767a91.11.1785750405386; Mon, 03 Aug 2026 02:46:45 -0700 (PDT) Received: from hu-spratap-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-38fb2be6c8csm3660671a91.13.2026.08.03.02.46.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Aug 2026 02:46:45 -0700 (PDT) From: Shivendra Pratap Date: Mon, 03 Aug 2026 15:13:43 +0530 Subject: [PATCH v24 12/12] arm64: dts: qcom: Add psci reboot-modes for talos boards Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260803-arm-psci-system_reset2-vendor-reboots-v24-12-889281373870@oss.qualcomm.com> References: <20260803-arm-psci-system_reset2-vendor-reboots-v24-0-889281373870@oss.qualcomm.com> In-Reply-To: <20260803-arm-psci-system_reset2-vendor-reboots-v24-0-889281373870@oss.qualcomm.com> To: Lorenzo Pieralisi , Arnd Bergmann , Bjorn Andersson , Sebastian Reichel , Rob Herring , Souvik Chakravarty , Krzysztof Kozlowski , Andy Yan , Matthias Brugger , Mark Rutland , Conor Dooley , Konrad Dybcio , John Stultz , Moritz Fischer , "Rafael J. Wysocki" , Daniel Lezcano , Christian Loehle , Lee Jones , Ulf Hansson , Pavan Kondeti , Bartosz Golaszewski , Sudeep Holla , Ulf Hansson Cc: Florian Fainelli , Krzysztof Kozlowski , Dmitry Baryshkov , Mukesh Ojha , Andre Draszik , Greg Kroah-Hartman , Kathiravan Thirumoorthy , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, mfd@lists.linux.dev, Shivendra Pratap , Srinivas Kandagatla , Bartosz Golaszewski , Song Xue X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1785750274; l=1558; i=shivendra.pratap@oss.qualcomm.com; s=20250710; h=from:subject:message-id; bh=OJwAm/Vozmf+aVTmHqCY4oum1OVPcZBckomX6WcElq8=; b=JT9H0YmF5yLeWr/AEcg8+MJ7UyCAiqsbYnspRpD92XUQxxYXUDNXtMj4+2agXuu437sW8T4nT RMamNuCOjdDAy6VL5p10AWng8umeH3A/HICOVzaWNLeNSbuCV0twLTi X-Developer-Key: i=shivendra.pratap@oss.qualcomm.com; a=ed25519; pk=CpsuL7yZ8NReDPhGgq6Xn/SRoa59mAvzWOW0QZoo4gw= X-Proofpoint-GUID: N_r6WtxxQFM5FZKxTRqmwdpNm-PnpWlJ X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwODAzMDA4NyBTYWx0ZWRfX5L+tXGHa2B8K Kl8NC+rI6J4wfZ8NGAVOVoGBebtJkVM4UAxffOXl5euEuaQEdoNbZ5XxRzKlw1S8ipAcjEvaf1+ 1BvMUt7bYOy6ElHzZh2yHI2kOt75lyEtB/ZYCdDTHv3uVI0hBZyxax7t6QRukpnqY6R96Rjj2wY j182XzaEqs/YhfoZY0HNviK8vwApg5kOcoOxHACZEkC9OOk5yuk5VGxknm1sZtC70sWk2XSdlXx YfqKchn4FRJrAiP29aCrWtEblaCgYLB6xK19dG1Qczbe7EtupATICc7ShASq/1a+bwOe9IIgtCt 0Y0ZNBkDJalJneAN97HbEV0zx+OUNW0PciRirrtd/nonv0+y4JLD9xraFS55DFI4Kcz+zgsX/vW ym+6aYwXnzmnXzM0uKBsDn48pkL+RFkfPyCDdXIvnMEGaJQ0Pf6Z19wnqxaRFIz384CNsmT3qFm ScREutwcMvdD8gpatjw== X-Proofpoint-ORIG-GUID: N_r6WtxxQFM5FZKxTRqmwdpNm-PnpWlJ X-Proofpoint-Spam-Info: AW1haW4tMjYwODAzMDA4NyBTYWx0ZWRfXzpDPLkPagOOL /pRpgOS6k1c1pLN+rUvq52i7qx1fzMOlkcW7DAfHjosxm6sAjdIj6KMxDgqIRfOcssgdlE1AmYU zhitaJsK6PK/uHwowwP8LdobMEz5v4o= X-Authority-Analysis: v=2.4 cv=UIjt2ify c=1 sm=1 tr=0 ts=6a706386 cx=c_pps a=RP+M6JBNLl+fLTcSJhASfg==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=Sv0fKeRqtYgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=rJkE3RaqiGZ5pbrm-msn:22 a=EUspDBNiAAAA:8 a=COk6AnOGAAAA:8 a=bjH5yOvFM8yfI_BY5k4A:9 a=QEXdDO2ut3YA:10 a=iS9zxrgQBfv6-_F4QbHw:22 a=TjNXssC_j7lpFel5tvFf:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-08-02_06,2026-07-30_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 clxscore=1015 priorityscore=1501 lowpriorityscore=0 impostorscore=0 bulkscore=0 adultscore=0 spamscore=0 suspectscore=0 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2608030087 Add PSCI SYSTEM_RESET2 reboot-modes for qcs615-ride, for use by the psci-reboot-mode driver. The following modes are defined: - bootloader: reboot into fastboot mode for fastboot flashing. - edl: reboot into emergency download mode for image loading via the Firehose protocol. Support for these modes is firmware dependent. Reviewed-by: Bartosz Golaszewski Signed-off-by: Song Xue Signed-off-by: Shivendra Pratap --- arch/arm64/boot/dts/qcom/qcs615-ride.dts | 7 +++++++ arch/arm64/boot/dts/qcom/talos.dtsi | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/qcom/qcs615-ride.dts b/arch/arm64/boot/dts= /qcom/qcs615-ride.dts index 047b4efb04b9..48d3519f50ff 100644 --- a/arch/arm64/boot/dts/qcom/qcs615-ride.dts +++ b/arch/arm64/boot/dts/qcom/qcs615-ride.dts @@ -498,6 +498,13 @@ &pon_resin { status =3D "okay"; }; =20 +&psci { + reboot-mode { + mode-bootloader =3D <0x80010001 0x2>; + mode-edl =3D <0x80000000 0x1>; + }; +}; + &qspi { status =3D "okay"; =20 diff --git a/arch/arm64/boot/dts/qcom/talos.dtsi b/arch/arm64/boot/dts/qcom= /talos.dtsi index 07ba5733ca92..113f10775991 100644 --- a/arch/arm64/boot/dts/qcom/talos.dtsi +++ b/arch/arm64/boot/dts/qcom/talos.dtsi @@ -581,7 +581,7 @@ pmu-a76 { interrupts =3D ; }; =20 - psci { + psci: psci { compatible =3D "arm,psci-1.0"; method =3D "smc"; =20 --=20 2.34.1