From nobody Fri Sep 25 09:26:54 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 54DE3483BCD for ; Mon, 14 Sep 2026 14:59:33 +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=1789397977; cv=none; b=hnFYLs5zhm3AVI80d95ioIsvRv60sg0dyiSsoGUO5dhYWR5dZmWXTTP4/c0V8+hfiQx7Er0cbLv8wRSyBOim49Vx9cnH6XW9QPh/F7fnWVXIL4FgcY0rQp/yKnWlBN4RwyLs07tFw4ahxnhY+LWPALlFNCrO4Wgc/m6vdizZisk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789397977; c=relaxed/simple; bh=3jZJCDBmdKair7R/qKaAWXxKmatvkMOd5u4ong8jp54=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=eNsOfay3B1E0V/FXetkx13y/h5TGR6a7Z7yebJGuyRUY1wQ8Xq+pqQlEdjcqzwW6ude5v8LQ5c6J4SDh6xnAYsB0/VtWR7aYNKWoLEHi9T1TBT7sP/+ifS1/xC53L34OO56ASPi45Ves22CAAMk7kUabqvHg2OZOI2qs6S1ZcFM= 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=K+zPpzd0; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=V3+a+IeH; 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="K+zPpzd0"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="V3+a+IeH" 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 68ED0SZe674451 for ; Mon, 14 Sep 2026 14:59:32 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= 8+ql9HRxwiF7Hsvr+2veecKSO1rWsvRUfuJvm2uvKQo=; b=K+zPpzd03UkEsCJt LiqtWyAwkfM2Xrx++xrZE/ZNqHYbLFI4LvthAK0hpVCtaP6/K8S0sjkLPg91ljO4 6cbzbO5sJsk1bS2F513JL2w//K8XrjF9aoMXe1hvDVPezR3y91wBfIWUn0JLIEdB c3BY+D/esbbtBsIkq/vuLeYhH8kZW9IeqXZQzivJav2NuydB/o7xxA+vxndTQQVo d2PlccpmAsVojFChgbnspw3sjkyILURvdKj6X09kr0Ftxq/YyGJHFKlTLrx629LK BjwrxTpWvkGbiyeKS2hX1/cVAjW0JY5P2Fn1sHZwM7Q8W2rLgpGAgpz8pqxzLGYr unEx8g== Received: from mail-pl1-f197.google.com (mail-pl1-f197.google.com [209.85.214.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gpecs99jx-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 14 Sep 2026 14:59:32 +0000 (GMT) Received: by mail-pl1-f197.google.com with SMTP id d9443c01a7336-2dd753a52bbso2236125ad.0 for ; Mon, 14 Sep 2026 07:59:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1789397971; x=1790002771; 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=8+ql9HRxwiF7Hsvr+2veecKSO1rWsvRUfuJvm2uvKQo=; b=V3+a+IeHSS0QQfIHEY0U4sbFjXSktQoo29fpYbXpm/irpFmjz1EaCxdcRtViRDJs+T yd0ytnn6gfkDuU7a8VjImVfkh8vJ3V5qBS/dLhvQ1AhZ6JUwRZ4pZ3I9P4npjvDgJyYg KWcFoBcyBGzw1o6opT/3cbBR23Qqn/brDfXTfalr/Apkr6LNqG33OyudGn4dIlxAI1sC EGhZnTKeMdQawYVwEI23X36g0QPo85vdRH5qwJ65pAv7DXyCRBXXxw5dEJUYMCAkTvMM WqXCxuTjGE/n96jTEA4aBf+zB1/aJpjYUnCKMzpNGHbiORTrruuiWQQJUI4TR4dY2uGM nHWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1789397971; x=1790002771; 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=8+ql9HRxwiF7Hsvr+2veecKSO1rWsvRUfuJvm2uvKQo=; b=jUoK6VLNdc8E8CCmcb0NKospfYE5Rd3r/J1DZcI5dqSFVD8DrxP5NeM2MdM6oVVHby xh+fSJwYgCb7LYx0DU7R+pzH8Aq4AzK3abxjKnYe4xrDga8pyWtUY1ErKRtfWU6xsGIG XtZLsjsp+OhhRy2vlzHWzskfcm9+kCCfzaMZJg216Wa4x8BwT1vC9WTswDC8sAxWPYBr nST6zhf6QYspzHciK1AI+GBknbLeOC90r2MAuneH3n7qyEbjKVV16ReRfdzVy92Zphp7 ce5NsS8hMv4vBYaDmY/LNozSkXFgn4HusiP9hv5+eeeIONEIX9LlElvj/zJIa3OYBuSq nD1Q== X-Forwarded-Encrypted: i=1; AKwUvBwCOOElQSmbW9NHz65KKN8uLQ++AKazf4CpU3uVxsfyU6+tHMi8bNyLlQotZr3C54q21T602H8g6rhfKuo=@vger.kernel.org X-Gm-Message-State: AFuF++nZ5+orGCz/+DyU4XV/Jnhh0szQD/6Mz7kaAQINxXOtef7jMZKs kCKgQEV1Ob5AJgoPG5v2zq61cU1zrXfsG2J+nqB2vcX075CrJCcPEwc5p5Sr+gEGZku0Z3P3EZZ SE7FJpK7IdjROw+D39uUGwM+Ubf47NPtMmDBQC8oif5IoRXehTAp9iOixuzwWgOdtoU0= X-Gm-Gg: AYBFou292tW9Hh3XojnGpxdvtOZ1OKhHdsrDeaAbwU/glGWVff1NtDCauC1cSJF+Oao fCTP475cP1rULnciXv1X6jg8NJk0ICo5VjIFBBh1RkqHQ4Xl2Uu+SFhqQozFV8xe9yn74+9p6Sk VvmuPUYmQZIijq7X+zJRCvnxdcd8aHd6UZxslxzEY+zdE6jCkrSnPP0KnDdQ/JGILItXtl8RHcJ 1VPCcax2e3ONT8LCpSTp5l7XvMKHaQGBO/oisCZQqiWg7Yv4yIL/gZqd5t/VMaD+XUunCn9o6AV ZVyW51s22ngActDRGLPsH+DE5Rkl6BaDfv990WUH6PUGpzkOXA4nwbJ0JNRB4twon7/w6eqdjoD JngRA8DJljx0GL1c+ZNU7Cl4oyOoDkUYvoRyn X-Received: by 2002:a17:902:e74b:b0:2d9:216a:cdd3 with SMTP id d9443c01a7336-2dd6c6fd5e3mr56147005ad.18.1789397971015; Mon, 14 Sep 2026 07:59:31 -0700 (PDT) X-Received: by 2002:a17:902:e74b:b0:2d9:216a:cdd3 with SMTP id d9443c01a7336-2dd6c6fd5e3mr56146095ad.18.1789397970445; Mon, 14 Sep 2026 07:59:30 -0700 (PDT) Received: from hu-spratap-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2dd4007bd4dsm42943345ad.4.2026.09.14.07.59.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Sep 2026 07:59:30 -0700 (PDT) From: Shivendra Pratap Date: Mon, 14 Sep 2026 20:29:05 +0530 Subject: [PATCH v25 01/10] 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: <20260914-arm-psci-system_reset2-vendor-reboots-v25-1-4aaf5c09b5c2@oss.qualcomm.com> References: <20260914-arm-psci-system_reset2-vendor-reboots-v25-0-4aaf5c09b5c2@oss.qualcomm.com> In-Reply-To: <20260914-arm-psci-system_reset2-vendor-reboots-v25-0-4aaf5c09b5c2@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 , Abel Vesa , 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=1789397948; l=4572; i=shivendra.pratap@oss.qualcomm.com; s=20250710; h=from:subject:message-id; bh=3jZJCDBmdKair7R/qKaAWXxKmatvkMOd5u4ong8jp54=; b=7s+Gk1QNxVnLkzG+di2vJq+YQbfPHSTrr1QX/D/s21KZdIuvvOz1TUPD1brXp5hNyUSG3VZ/K movM2/29tT9Anf0uibgKIKF2jcDz0/Fu8ns4yO7NEmVxmJVZ8FXwY1P X-Developer-Key: i=shivendra.pratap@oss.qualcomm.com; a=ed25519; pk=ssWsJFX3OM9pkdoe4+guOfGPaulHOFt0GVnVlB6on+s= X-Proofpoint-Spam-Info: AW1haW4tMjYwOTE0MDIxNSBTYWx0ZWRfX3rnmUD/+3aeb iCQGNgTKCN4iwaRawF75JpRZqiTas87HEkPo2Z8kSGWXx2oX6UDMb3VPMvPglk0d0+cUyJyn/Xw aWiTsFDyBx7+o7A6kFUY6KlZARXCB2Y= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTE0MDIxNSBTYWx0ZWRfXyBm1QlHudfFY BTzkeCKUKPtKHreA/qOafGdQbB/ZJ0tpafANkV836Sl8qFHVzNAtDJz0wzbBE1fSckNB/ex7ZWl RF5VF+DBCPkPxrJoNzp/H5NqXHW1DozImDX0QY89iNSJLhkLBHiuZBmXDs3gS3bGaPh+QWhx9fj lbD5PEZhe09SgakiN2zrUSo1AQYo/ihv4VGNuMfuCUbITUgpQ+0wJzMOlUBtPwzs2A6WT1BisKe xrZD3fsrMEfGvIZ6hkoL7f/jB2h3mSzKESdHY+2bcjZf8t7f/Qhn7dwB0PztRuFtpVt38zUuaCn NYe58IjmvfWqqCP6WOz0ZlMgH7vC9mXt/jG4rj+U2Kq5GTNN2HyKzNfcnvrcDoSUna9O+jTkqmy mgElIhY7rj/BT4ROESBcLFEJZ5LCbkdw5h01RrhUfkzH4ltHwvk67CD/dql/KuRToXog8D/F+Jd /qeDZcS68Z9rp6Cjdww== X-Proofpoint-GUID: fADTgSfQrA99_gPlaeLyZn_dk3BIVC6O X-Authority-Analysis: v=2.4 cv=b/cncdGx c=1 sm=1 tr=0 ts=6aa80bd4 cx=c_pps a=cmESyDAEBpBGqyK7t0alAg==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=VdqzKS8jKosA: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=1OuFwYUASf3TG4hYMiVC:22 X-Proofpoint-ORIG-GUID: fADTgSfQrA99_gPlaeLyZn_dk3BIVC6O X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-14_03,2026-09-14_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 bulkscore=0 adultscore=0 priorityscore=1501 phishscore=0 clxscore=1015 impostorscore=0 lowpriorityscore=0 suspectscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609140215 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 3611bed341e1..328fa37598df 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 Sep 25 09:26:54 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 85A724825D7 for ; Mon, 14 Sep 2026 14:59:43 +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=1789397986; cv=none; b=EAX3jJZ5+W6qFHI4d8ENxer1uzHIMG4+OcCez3aCU6lLtnAQMHhO0AsNzv+mqNhR1M11jFhPFpsJP8+DjA2BEb6OqaPy3M/9Wg5ZSMVh4QpnXoDqlVjRFjQDGIHZNUkrWfEvgKg3qyPtMKYxJQUka+0DTTeSUxf/Ch8rd18YLiE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789397986; c=relaxed/simple; bh=PrRAHImr6yIYsW7KLCHcHGI0oKMKMwPmNh0f+s4qJFU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=okC1RZ194XSR2VoNBkka9eWC6XNYDxp6dBUmaxPYvQOjnQQkJZdQgguKW/oqYbBfVPSxDl6zmR5M2U3rx/MwKLni/qL2j4+NCUxbZJUEJsiQxDUq05NCdpFUz7Mr6xEPCUELYjxK/jfZjvGlrCv6uBelNjigzuMgEUW+qFyra0E= 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=HW1CL6fy; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=SomqALhY; 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="HW1CL6fy"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="SomqALhY" Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68ED0KVa4090474 for ; Mon, 14 Sep 2026 14:59:42 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= UQixMKmo4tOht+KG0/AfOgWsqoDK9/2xnAOGm0oQgkM=; b=HW1CL6fyq2wgBCod slbFDff3GVj/E+9Wvi2Kdv/pwaC6D/MBor+bbMDV4pE2UYLTavEZ2SmCFACzS9p9 s+CdDfLn/WQBHz1MF7WniqZIsd5Zf5fsnjjLStK5gSJ9YjJoZ58N8PWfyMbEkjtL M9Bz2dyOomKJriuK2806EhJG8WX94JTWGIV23yZCbn3nQQE5SHF6BtWh7MDtAv9u iAK5DOT48TEg9O6qtjgXMbC4AkODCAxlIAQ/mSWAhKIijWs3WWKriY/nSTVEnXg3 wSGn3Mu6nFb+bRO/pnbiPr+yFRbnuDPDsKa/PlfRjZFk0QVheYDjqYeW1dFbPTBl GWi46g== Received: from mail-pl1-f199.google.com (mail-pl1-f199.google.com [209.85.214.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gpcjg1qht-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 14 Sep 2026 14:59:42 +0000 (GMT) Received: by mail-pl1-f199.google.com with SMTP id d9443c01a7336-2d94a158dc8so49599305ad.2 for ; Mon, 14 Sep 2026 07:59:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1789397982; x=1790002782; 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=UQixMKmo4tOht+KG0/AfOgWsqoDK9/2xnAOGm0oQgkM=; b=SomqALhYhSQmcD2Z4BxoWGJEwDTRFLfYEbTtWdY/TeiuS56byxKIz+NOhJe5W8H6i5 QWjBlD4QUYAUQXEbBk24W+6ai9mgrdunZe6YALH6V4XYDy236GsDHB/C6vsUGcW1MjfN 2wqNeEP7eKfWPWqezzRYth7Lha06zfjUKGHYojmi3AKN8dlL29rYLc4AsaIAqlfIvVfX oQbuZh/nVZ8+61ss6fhoOLzmiQrc4DhsDkRZHMiQ0Oq1GIJqUmKXsYJzXyBDT+mPxKx4 ZSZouOp61LmarwRNIrqDremDmyYqfGCR6x+mhkcEltEp7vcoJ/cpELkeDrGyqFQXH5x3 IDpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1789397982; x=1790002782; 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=UQixMKmo4tOht+KG0/AfOgWsqoDK9/2xnAOGm0oQgkM=; b=Uw2YB74EcFYA7iWqFbuR+r0sM6d4G8qcsbk5WC4l/m/aA6zN4iscq/cp+SVz1JlsQW +9dWpjpE+DaEB1SJtKAQTmmdZMeKBsB4VIlYI0oWX41PWnfZ/aQffhQnQ9wcVdDtl8mp /jbmENHGSBhW9Pg7KSq0viAJ1G8gVFWG28zV14jjl+17baQh99goA0frEPvUEdpoZP3e SFxUM40k41owBJi4O3jCbCTKI+iOZBD8IF9hez0axqYQLh1m84DwuG7aoDkqYh86f8oo DfLGMc0e2DtchZ3aOfHtdc4V8ZkMwJaj5EK2ldi4DdlKBrc/V4+yX5FlfdfdNx+lxQ5C b/0w== X-Forwarded-Encrypted: i=1; AKwUvBzTjMMOoA7/Qo5GDzuT1llOrvckLdvhE5j2pZHtefmThPNtqADVLCthx5B4MFdKqn7iBYwgDQaz6V0h8Y4=@vger.kernel.org X-Gm-Message-State: AFuF++lBwNgEbaAWh/FlUXqZ7lWvpJ/xauyb8BKVF6MA/kN94v5nsGpz PB4GSXpGvL8pnKvc4NVKROmZIAwdNDULp/sTuJUXS4fG0gNQ/fLH15UAPl5OszlNBJODS92/EMl xoAEcVx6bzXxJoQaGl8gCuUelGS0CSN1wxye8IBtWlfGkkQFiOvyi4urDun6g/GMdJsCg79CrFq c= X-Gm-Gg: AYBFou0KDKLP2Af4iriDMLBaWfxMCTY+2ChNGnnZiU/K9Wvpw7unkjsaKP7bMoFBdeX VhdjT+nlNSJeKMapvq8nluQq6e9Gl8glrqSwgEaw83f9AhlTTTwLP24KpGyDYcA1LFbCk7tPQ8H DA/NjGH+Y05GAzDh62cSkZ4U5/l6FR5kSmLlZnUgrUWNm+MOTodRe27sbjEU0Ofotkezbxc7tPU gqkSPqSCyuukEX9nlA5u4dw+wJp6KOYmNu2NX9CMixzqx1cQ4sgt78bNYgRPsp2ftlGZj2F9Lz5 Xetr3kaHC6zPeJp6wCMACaY7Giwm4HzaUyodNkcIpKFZEwGnrhon1VOnnzSLVMyGiTOUglGfPGD a7WjsnONBWb9pTOOoogJk3I+90Uo2uQ9Pg/n4 X-Received: by 2002:a17:903:1b50:b0:2db:8ae7:a5d2 with SMTP id d9443c01a7336-2dd6c5f39camr63812585ad.9.1789397981518; Mon, 14 Sep 2026 07:59:41 -0700 (PDT) X-Received: by 2002:a17:903:1b50:b0:2db:8ae7:a5d2 with SMTP id d9443c01a7336-2dd6c5f39camr63811745ad.9.1789397980906; Mon, 14 Sep 2026 07:59:40 -0700 (PDT) Received: from hu-spratap-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2dd4007bd4dsm42943345ad.4.2026.09.14.07.59.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Sep 2026 07:59:40 -0700 (PDT) From: Shivendra Pratap Date: Mon, 14 Sep 2026 20:29:06 +0530 Subject: [PATCH v25 02/10] 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: <20260914-arm-psci-system_reset2-vendor-reboots-v25-2-4aaf5c09b5c2@oss.qualcomm.com> References: <20260914-arm-psci-system_reset2-vendor-reboots-v25-0-4aaf5c09b5c2@oss.qualcomm.com> In-Reply-To: <20260914-arm-psci-system_reset2-vendor-reboots-v25-0-4aaf5c09b5c2@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 , Abel Vesa , 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=1789397948; l=12507; i=shivendra.pratap@oss.qualcomm.com; s=20250710; h=from:subject:message-id; bh=PrRAHImr6yIYsW7KLCHcHGI0oKMKMwPmNh0f+s4qJFU=; b=e1x01LDqpNHrIpzvQj7TEKdGPaA75zRoFMybskfHBu3mRbgEr7lGt17uA8xm0pnwonlFQAviQ +04sJ8J6HnCB5JKoO3609kA14neYBlMihvk7bMDzO1tfV6/PaCX/Gvy X-Developer-Key: i=shivendra.pratap@oss.qualcomm.com; a=ed25519; pk=ssWsJFX3OM9pkdoe4+guOfGPaulHOFt0GVnVlB6on+s= X-Authority-Analysis: v=2.4 cv=CKa/zhrD c=1 sm=1 tr=0 ts=6aa80bde cx=c_pps a=JL+w9abYAAE89/QcEU+0QA==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=VdqzKS8jKosA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=YMgV9FUhrdKAYTUUvYB2:22 a=EUspDBNiAAAA:8 a=S_7UqdFmbgqGN4e7PDYA:9 a=QEXdDO2ut3YA:10 a=324X-CrmTo6CU4MGRt3R:22 X-Proofpoint-ORIG-GUID: yYlpik5aWHHkGFa8v61VBt0NG2hSONzb X-Proofpoint-Spam-Info: AW1haW4tMjYwOTE0MDIxNSBTYWx0ZWRfXy7pnRPhOork2 EW+rg+z/q3dGCof0vT+X7cZ2p9p4Zb3STpwk5z8+OQeYLKynCsZPgE14VspkPrb2PXcV/Tghp9P UdF+H0DdoxnjhMfsMjtNdXnpTK0JEl0= X-Proofpoint-GUID: yYlpik5aWHHkGFa8v61VBt0NG2hSONzb X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTE0MDIxNSBTYWx0ZWRfXyuPKqMBfU42P gXihI74qfsfjrPc8UPkIpcApomRH2iWzlHmUnAG9WNgcXKJwNGjppzWtwUmScyEGawtCMwlRWwj 5U6uu3lbEubIPYFEowTQUpymS5+tFNDnnY7dGeFJVpY8UTWGXRm6n4QWa3JcsWIVj9VZTP0VHFX xcMEbH/0pl3MtBIN/FunNrixhl665PwaAn187Kf39VEHlmi39CVnWP1oJdXYdiNDQ/V5Xsmo45S 3e8K62O3BOLR0L+8GTptF5eWLGw5+vRyKRo3a+vysxkk0Fu4P1KOkSpkBjUNO1kL3WWLBOghMOD YKQHuW2wWG9wph+e7J+hi1TcijJLnCDZ2+xC7nwFd4RL9xUbs9HnsJgwkNtjvJAf91Eo61Z7XTr Wl2yBAbix5i2z8u4Rqfkqqpogs1pj5OokJ9dG8GSAhgni1ozbHkKeexDTATWug7QWH1qU6Kvczk 5+3QJKZ3m3D99upSTjQ== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-14_03,2026-09-14_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 malwarescore=0 clxscore=1015 priorityscore=1501 impostorscore=0 spamscore=0 lowpriorityscore=0 phishscore=0 bulkscore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609140215 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 328fa37598df..fd61de226383 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); - 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 Sep 25 09:26:54 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 52BA6481666 for ; Mon, 14 Sep 2026 14:59:54 +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=1789397997; cv=none; b=R2OFRGMY4yqrZP6SWoXkVO0VQq6ZN1GaBRh7hUXTJJZBIlB6zCmAT4vUzRdrS3KXZkhElQuL79+geKuWqi1tdb5eaiMP4Cw/ODIaTvrIikEKt6deQ85/snTADS8ceGyawwa7U0y1DwpsbpDxBWZ4H//bBimaScARmua4UHZBQ/c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789397997; c=relaxed/simple; bh=ePR4OuoTlUavycOVnXKN78dPp96WxpPQP3RUTs/YnxU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=kCgl6t5cv3WscatMxV7nFAjA07bfDosMio1eBOgnaJ9F9CQB/w8m0j8LSIB8TOm+wGo37DXEX2BOyY7cJY8Wggb5XQQoaYEqN7iv3cPTartzQid/PsoynWshqVQniBZBmWnGSanq42dGD4EuVDlhyc/VQ2IT6m5/Ps3dxXAeVvo= 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=GoCAFsnx; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=UKsqMlz1; 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="GoCAFsnx"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="UKsqMlz1" 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 68ED0aOM511045 for ; Mon, 14 Sep 2026 14:59:53 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= 6c7FsVt+6kZf0MJjLIZNdKyh8QTMehkeel45ASz2OUw=; b=GoCAFsnxwvqsRPJy M068qtSqBrT7jINXMCTsyAjvgaGjQfrw9CHwF7DRrWamA8c34NHD8SQNvpaM9sGN UJCwT/rhmbG0U1nnpkf/U+FYF9Mi3iavGYzdmJ5dy3BCT9W6IihTgd5MljZrPKNg CsBMS1fe9GUpObjLbn+eT4LTSsZbpWhi80vPjwAdBQnOxezGlvB92vy4m2va6QnU XgkdBbLDopuppz6UgEIIJpVEORTJtlMSymNaFhl1YQT6aLRROliVvaIQvu6973++ eo6zAVux+0N05lu/+QNPfvlaurqrkOFfNq85DolayJ8j63GLv2fj97pIaIzuBha6 QxV92g== 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 4gpgvtgkfv-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 14 Sep 2026 14:59:52 +0000 (GMT) Received: by mail-pj1-f71.google.com with SMTP id 98e67ed59e1d1-38ec0f510a9so7080399a91.2 for ; Mon, 14 Sep 2026 07:59:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1789397992; x=1790002792; 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=6c7FsVt+6kZf0MJjLIZNdKyh8QTMehkeel45ASz2OUw=; b=UKsqMlz1F0Z2BeDA4nBuPhj6TzY9ER9G4s9TtngqOpHBVHgBhNqaOCh9SsKszqSAnp KRnz22Sco031VRjRH50fUDqquP6Ghbjv1QMnu0YIV7d1S8I7lnXAIwiky9it8wygektJ YakfXuM/htkRcP93BYQmwrY+Jdfi6qLfjUkjaBDlW2lyv9dv4oZkdnrAQOWn32U6MZVT D3mbwOCEDEbXevYz1EZSsHpQpkzqXgBsnf5mGOdYt1ZAqYDs87L6CVpZLoGdtyjuub8u OjmevqZwui7/JhLfM5Gfm5XsObLX6sFbUoCl9h2FksN7GXGNWiw+NV2RN5tF17Pflx3u 6WQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1789397992; x=1790002792; 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=6c7FsVt+6kZf0MJjLIZNdKyh8QTMehkeel45ASz2OUw=; b=dQztd2x17RdusYh6EugYihFfcmxY3EBCtsHWOSMDMTBehDrqk+0GyfiGGU0CBr9ZUK nU79M2XHUiIKxan6Yc/0m5K0DpcJ1fwD4lv5hBjb8rGCdv4gjwddtr7n+GoAnXCLLI17 jk0xrP/WvofH0EGkOz4GU0+qpE8T3NEVseVSMFUDxvqwmEXknstvrpKRboeCm4s6Dx0m mm/BbMwUY3/AefW+kagd/uVEGQ/5Xovyl6w2ojYBny+HllugT3E5Z5hZsloPD8ehw+vO HwqkBckaA+e4qc9hfu0szHPUgKlGUJLU7BBwhgAcE0ww6XOSCiqAYAvez1WLje8lIsEj 6QlA== X-Forwarded-Encrypted: i=1; AKwUvBxHPu3pHfXd5tAsAoueGuy89IBfPuFJMBF5afe6NxZihUPtv4QF6Kx3T3tTWQTKcpWgKFbLUD3C4p63qjU=@vger.kernel.org X-Gm-Message-State: AFuF++mRD2Rtb5Gzl9CuwNtxZypSQwg3PHrADE/J2lgtyi9TVyD8hvMb Sc50AITD2giMJAOQI5/01ErzF2x9VkFrC0Uy2sVe1bR/uzHqHsWlGujqdCmGms3t4GxvnpoNcmH JKw1Nap4IPOGgJpuH7OvLIUiUUx8DD1er1EM6zIkPNwrge2sYOLEm5gXM7bfB6HjHkqw= X-Gm-Gg: AYBFou0TRd3iPbHL1A0FzC6Gn0DsX9ssk/q0GKb7+FjugwcP5otRhnkICtdZxhDzDbX lA1QoUZtjERwtB/MgRbLFvY/LxYlPygoQqZeGFSWAMUNkh1Of8CbGtwMEoZ0g7FpFSQKdRuVnIk ZqA4wURgOeKsE3TWDTtuQzLzU4tnNSsryriKMy/7Kl9t794UX0w9r9O03PP5f3iE+1NR7tkD5Oe rjc/BcMh3cnYgViUBxMbtiWeQ47/Wz9shNy7xAUYAOGs78xJ5ZQ7xuQvI2eOAW98nou2l8ffHOV OkabcaGekleESlsuseqtwBnhSzA0XaP0QHlkWfwSO8xRV5JRg2ypko5FqO5g/CRHQmhXYKj0Dc+ 34mrsBQ9hwC1GDxhP/Z8MSIYunisueSiYRehS X-Received: by 2002:a17:90a:150:b0:39d:eda9:febf with SMTP id 98e67ed59e1d1-39dedaa1a80mr3695031a91.18.1789397991956; Mon, 14 Sep 2026 07:59:51 -0700 (PDT) X-Received: by 2002:a17:90a:150:b0:39d:eda9:febf with SMTP id 98e67ed59e1d1-39dedaa1a80mr3694994a91.18.1789397991523; Mon, 14 Sep 2026 07:59:51 -0700 (PDT) Received: from hu-spratap-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2dd4007bd4dsm42943345ad.4.2026.09.14.07.59.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Sep 2026 07:59:50 -0700 (PDT) From: Shivendra Pratap Date: Mon, 14 Sep 2026 20:29:07 +0530 Subject: [PATCH v25 03/10] 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: <20260914-arm-psci-system_reset2-vendor-reboots-v25-3-4aaf5c09b5c2@oss.qualcomm.com> References: <20260914-arm-psci-system_reset2-vendor-reboots-v25-0-4aaf5c09b5c2@oss.qualcomm.com> In-Reply-To: <20260914-arm-psci-system_reset2-vendor-reboots-v25-0-4aaf5c09b5c2@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 , Abel Vesa , 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=1789397948; l=8099; i=shivendra.pratap@oss.qualcomm.com; s=20250710; h=from:subject:message-id; bh=ePR4OuoTlUavycOVnXKN78dPp96WxpPQP3RUTs/YnxU=; b=CJxt7ThA3ijgEcBqAnR0lw3czXy1gO1zix8W7Xfhh0XqKkZFux15Zr2jI3plrrUw39TAxF6Bt 3jet7ZQ/MSXB1hsGElQziD7bv8Aq81yS680bBY/kfpAu0pPn6DWAHh6 X-Developer-Key: i=shivendra.pratap@oss.qualcomm.com; a=ed25519; pk=ssWsJFX3OM9pkdoe4+guOfGPaulHOFt0GVnVlB6on+s= X-Authority-Analysis: v=2.4 cv=c/0+0h9l c=1 sm=1 tr=0 ts=6aa80be8 cx=c_pps a=UNFcQwm+pnOIJct1K4W+Mw==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=VdqzKS8jKosA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=ZpdpYltYx_vBUK5n70dp:22 a=EUspDBNiAAAA:8 a=njxsUegImOJjkw56WvUA:9 a=QEXdDO2ut3YA:10 a=uKXjsCUrEbL0IQVhDsJ9:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTE0MDIxNSBTYWx0ZWRfX0gq32fJwl5qa Cf8y6syEtyVIm2Hx043TAuzv+IL5y4Ay4rb2kmU5BsnpmSJtZlotsDSuTd8+cSghp6SYA2fxYH1 g1PKZJBSAuJBwbk991bWaXId/4yDmoErZDzPIDS/y9qVnJL5OsyfHETehovcqJa0jh/Qr1gXSWf svMhu3VzAwGW9ytMGVQ1yRD4DVERF8xpBJYGlm7uhqy6CHdN+L9VbBPoBH6104olgc5AbHQ3h02 ajyA0c5Oaf59gv5jTSXhZWW2SROD3GaUMZzEjKnBvfal4qsHxMpqWVOh/dOQBQOtkbvPrTId5aR 6xE8d1eDRYn8aZ+7uS95zDXzQGswTnOcLa1QC2/orIHRpuGSyBdRC87G9vJ3x7JnGy0EzNjhtbN W4rETP73Quybpw8UpB5EBLntvgNAbslDBMXVaMGGtsfAgTlMHiUemMW/QhYd8m33F/x1N4ypzEe YccsiiJjmHJ+PuIuyzA== X-Proofpoint-Spam-Info: AW1haW4tMjYwOTE0MDIxNSBTYWx0ZWRfX8JzO7r0ja1Ci jd4MT4y7ly7tV77IUAF1rJGc+k1JGb8bvq5xPpLslwSYmuelZ+raNRAg+Lgin3A0L+vYILlNDpb Q8u4go5OSMmOoppGkclsr0twfLNgHnY= X-Proofpoint-ORIG-GUID: TgV2c-tbuUJGZQ448AOzrrIjT0auMb5n X-Proofpoint-GUID: TgV2c-tbuUJGZQ448AOzrrIjT0auMb5n X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-14_03,2026-09-14_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 spamscore=0 bulkscore=0 impostorscore=0 clxscore=1015 adultscore=0 phishscore=0 malwarescore=0 lowpriorityscore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609140215 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 | 117 +++++++++++++++++++++++++++++++++++++++= +++- include/linux/psci.h | 15 ++++++ 2 files changed, 130 insertions(+), 2 deletions(-) diff --git a/drivers/firmware/psci/psci.c b/drivers/firmware/psci/psci.c index e73bae6cb23a..d489ba5d147c 100644 --- a/drivers/firmware/psci/psci.c +++ b/drivers/firmware/psci/psci.c @@ -11,17 +11,22 @@ #include #include #include +#include #include +#include #include +#include #include #include #include #include #include #include +#include =20 #include =20 +#include #include #include #include @@ -51,6 +56,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 +94,64 @@ 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: PSCI SYSTEM_RESET2 reset_type, or 0 for a standard reset s= elector + * @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; + + if (!IS_ENABLED(CONFIG_64BIT) && upper_32_bits(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 +378,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 +409,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 Sep 25 09:26:54 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 F1D523C3C00 for ; Mon, 14 Sep 2026 15:00:05 +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=1789398009; cv=none; b=gDQDKQ19Zi3lstsK+ObQ93u9ukFCt6az9nD1P4GSvjnJkzcliL+58bBzvSIzjAnWtptnrWJybw2oY2RdomPRbU26HGAsPb/ulJu7wOay5bdsRQI3xS3NISiZNukambv1HjGj9Hm55SXuBUm5ZN9vl+cDER8qu+KHVGRt4xpBdig= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789398009; c=relaxed/simple; bh=FOu15IfVscVgR29NkFHFBNDuZD58sPfHqAtlXoQpgqw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=obtUTisiZzPP1Mqopav2FwzK80TyXjcD/njzmlwlxf13dwhXJHlTYHP+HyPlKdVOeDDZ4HFYaSqne3hyW2/SWfKgC9Wu/ouF8NpSvQmqBc6CXHwzPTw14D546iIzEPspzVvrZDvQjSR+UAAIvoIwofh1RageAILVEl3SN4YTvu8= 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=blqUaSU/; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=UKEY85x+; 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="blqUaSU/"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="UKEY85x+" 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 68ED0QoS674430 for ; Mon, 14 Sep 2026 15:00:04 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= EzX6Y8Q0nJrzC5BWWNN7/NXu0LvfGsQ9qXt/GZGOImI=; b=blqUaSU/AByAjmRF 3/KxVrVmmy2+UIwo9MJkrozlcxMh8I/dRjVhjcqOc+hwWPo9Dpo0szw9L+F9CiIw Rde8hKoMf7sN/7c/w80bl7DYgFYY2avc/obz4t1WyDD1fUm6QeSu1Xv1nzMEBJCx WW09M6pqd1ddBksaBovxdrvWkK7Dcdvsgqg5tFCHInQuTMfN6r2QIkcPFkdmR+qi GTB02Y6jTgvYp9wquYeMOnDycwBq9WzkHZ2MkipalMfAy8azPQ3HocQnEhWczN0J 2NPfkZNUi3dyPKuph2wCUGkobdBg+RamG9iPlg6TdDFDcisnZics85ryx35ER40M 5SOThQ== Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gpecs99nm-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 14 Sep 2026 15:00:04 +0000 (GMT) Received: by mail-pl1-f198.google.com with SMTP id d9443c01a7336-2dc92350888so56829245ad.3 for ; Mon, 14 Sep 2026 08:00:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1789398003; x=1790002803; 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=EzX6Y8Q0nJrzC5BWWNN7/NXu0LvfGsQ9qXt/GZGOImI=; b=UKEY85x+Y16kuUyvHZ7YH3+xsp69wkMDgc6XcRFZ3yrYp+MqsyBFHO65OZNido8DhG kKA1mB7RxBs6NIO6KXJ1cMhpJf52sxAtgPge3ZraC2YBmcPVAKSBFN1GNaB8XZkqpoFD oldQpD856dhG+f7e31RsZdBl3jAPhmgKq7qNlyLZyP4HbQJBH1eT1OXuew5+3zbaq7ft 1XWli+2EaY8EsgjnCcMxMCRD7SVcIuEde9kysqKh+qJAl3tXToGI/WjfS5NDgXbdvD34 FuvBxAUUHgiEPkqFNCG0goGgFPhaxPKM1cBYI5xceocS200yOqHuDHo1Q6cLKRwL0XFb u/Pg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1789398003; x=1790002803; 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=EzX6Y8Q0nJrzC5BWWNN7/NXu0LvfGsQ9qXt/GZGOImI=; b=VYhsispFvIgbWj8n84a1xx+liH6MxSDx76ZVM/4sLhQ8L09TIp8iF2Aa+upheBlrxs JfkbELAAfayax6o8tbJfFQHtCuVh5z74hGMUMKYZc7he8FKWgvQWNQP4YMv9pnl3mGzy Mhvuz5RRc2jHw3kMLuFPqF79Tu3pUGNeZBFkHt42OdYMdnFa+8FWi3o/8eBaXGh1banY QG0IC9BOmHsygt3TLR7arytbYMx64lPf0IzBqLBTcRgDqOkrokM8SvZpRx1IrNVKlJnk TJMVPa9BL76ZiODX/sA6cdBJXNmu/Q9dJwz5kI0/HoN8r6qsI9EsKMH3L3qn5v/2F0ZJ +uvA== X-Forwarded-Encrypted: i=1; AKwUvBzwArySuBnhXueYYw6ZlsakCMz8au2a/B4GIfbenYrQtGBromfXPWBKXwTQx01Wad/l+NQZN0GFTT8o2r8=@vger.kernel.org X-Gm-Message-State: AFuF++k5zHa47GmQWwaukQLHz5RTB1fAJg5iwGZWcR6HimFeOWsZN9s3 4xL4v6r5RH4JVM2No2QNE3Qm6Z11VJC+T5yo3WyZsdAoZdVAaGIuAlGe62S8LmFa7/xu2UhUS10 uWEEEgIXgNRYouDY9MKzXLeGi/mOOMbR2O02IkjxPB883XVKl/WME3fvRKV3tENf5KaM= X-Gm-Gg: AYBFou315nwEpDv5pZLli7mLCY9XHUfJL61deEm/mb/Z7X51C34kX+2xN4oZSaPWIFY ia3fgXuei91KtQUBLu8rn0UA+TvNtDrVCdzhT2HjMp6hf6z+LGK2GjRJWl8B1470nG/+Eb4Sqo+ CMOL3mEDpSRzR3Eht3ekjfgkwRCUkp2zd96YTFmRdZQxP3fdGF6mmi5U6Jt9shVv/tvZBrAJh6Y 7SYtVnU4bk0Dq95TaAHM7chXsfvG4UEnsTWyOD4jWPGnMDHNHo0xZGoystH+o7oRvTPedJFAvtu xqtzftSwwlvCsIGDBOuVXIfZDt8ocCUfjq8lP1c74CdrrZ2p4SqOLaA6VIb/mG34iKg9YHTeVYF VyRmRnTp8xfuwsfTSByQpmeQMHE2/toGjYBne X-Received: by 2002:a17:903:f87:b0:2d6:fee6:65ae with SMTP id d9443c01a7336-2dd6c5b16famr61615065ad.4.1789398003386; Mon, 14 Sep 2026 08:00:03 -0700 (PDT) X-Received: by 2002:a17:903:f87:b0:2d6:fee6:65ae with SMTP id d9443c01a7336-2dd6c5b16famr61613975ad.4.1789398002807; Mon, 14 Sep 2026 08:00:02 -0700 (PDT) Received: from hu-spratap-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2dd4007bd4dsm42943345ad.4.2026.09.14.07.59.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Sep 2026 08:00:02 -0700 (PDT) From: Shivendra Pratap Date: Mon, 14 Sep 2026 20:29:08 +0530 Subject: [PATCH v25 04/10] firmware: psci: Add support for PSCI auxiliary devices 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: <20260914-arm-psci-system_reset2-vendor-reboots-v25-4-4aaf5c09b5c2@oss.qualcomm.com> References: <20260914-arm-psci-system_reset2-vendor-reboots-v25-0-4aaf5c09b5c2@oss.qualcomm.com> In-Reply-To: <20260914-arm-psci-system_reset2-vendor-reboots-v25-0-4aaf5c09b5c2@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 , Abel Vesa , 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 , Ulf Hansson , Bartosz Golaszewski X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1789397948; l=6657; i=shivendra.pratap@oss.qualcomm.com; s=20250710; h=from:subject:message-id; bh=FOu15IfVscVgR29NkFHFBNDuZD58sPfHqAtlXoQpgqw=; b=K6Xup1/+JMH4iBlOks405xptv03xSmRxdRpOFG8uwredQE2Y6VwEQ0H5O5UdKrsn7FCn47XNr +fU2rVjd4lHAx1eJNJQoD6tG8t2Xqsg9Fftyx5RyenNhZsPc+k8Sy60 X-Developer-Key: i=shivendra.pratap@oss.qualcomm.com; a=ed25519; pk=ssWsJFX3OM9pkdoe4+guOfGPaulHOFt0GVnVlB6on+s= X-Proofpoint-Spam-Info: AW1haW4tMjYwOTE0MDIxNSBTYWx0ZWRfX+3RxTTfFziMr O9KAiIJZG/4jb9kxrzbvHFX/b5ZEzofnR80rCZs2c676bIcdlfKo6tDdQLHhANyukg1gmTjGylQ OO2r6lE1XBgwQ6Ygf556kS/YwfdHd4I= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTE0MDIxNSBTYWx0ZWRfX+wrb0xhisJI4 QRpT11/vhEyOpsn1dpK3ZtJ5IbkbamyMtyB2vPn0K2C8+i0o/CECMSpuvQtq9uacBaWzVLplZOt cL5JLHID0mIi9SRo+5Qs7vMCXxPCIZksc7d4scLmm00Yhb/AHrivfOWw5BP6BNwqwLs/HBEe7g8 f59GU7pYHF6oORbnQ5xLQLguT8/E4fpJsC5gNlxzPr+KVKknjzxjC3abLRrMa7nM27CqVBkM5LD upLV4YKLV4dawKZ6r50gjI9s4xipYIM2xpnzzEtg255aWhKl5VgLnqbVrhZbANqWokfUWctNWoe 2cfW1ptXoV0J7cZUweMWBjB6K6M3oaYNsk+SpjiqkfUPs6IG5yJeCajRFwC4QlWkc+7J11vwjbZ vqnF3HU2cSocsM4/J6Q3saY+MBwC98n98xm6ePWiT6ajw2SzBaF5mvY91uC8rHsqDcpBAD0otXS Jc2I6CAk43wjy/zAJeg== X-Proofpoint-GUID: aLtg1HbMEgjIPpS2dIBYW0z_GXbBrNDY X-Authority-Analysis: v=2.4 cv=b/cncdGx c=1 sm=1 tr=0 ts=6aa80bf4 cx=c_pps a=MTSHoo12Qbhz2p7MsH1ifg==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=VdqzKS8jKosA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yOCtJkima9RkubShWh1s:22 a=EUspDBNiAAAA:8 a=VwQbUJbxAAAA:8 a=JfrnYn6hAAAA:8 a=eg3YruLvm9Mffrp2VfYA:9 a=QEXdDO2ut3YA:10 a=GvdueXVYPmCkWapjIL-Q:22 a=1CNFftbPRP8L7MoqJWF3:22 X-Proofpoint-ORIG-GUID: aLtg1HbMEgjIPpS2dIBYW0z_GXbBrNDY X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-14_03,2026-09-14_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 bulkscore=0 adultscore=0 priorityscore=1501 phishscore=0 clxscore=1015 impostorscore=0 lowpriorityscore=0 suspectscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609140215 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 multiple drivers attached to a single device node. Introduce a PSCI auxiliary-device provider that binds to "arm,psci-1.0" and registers PSCI child devices on the auxiliary bus. As the first user, register cpuidle-psci-domain as an auxiliary device. Update cpuidle-psci-domain to probe as an auxiliary driver and use the PSCI device node for power-domain traversal. Suggested-by: Ulf Hansson Suggested-by: Lee Jones Suggested-by: Bartosz Golaszewski Signed-off-by: Shivendra Pratap --- MAINTAINERS | 1 + drivers/cpuidle/Kconfig.arm | 1 + drivers/cpuidle/cpuidle-psci-domain.c | 31 +++++++++++++++----------- drivers/firmware/psci/Kconfig | 14 ++++++++++++ drivers/firmware/psci/Makefile | 1 + drivers/firmware/psci/psci-devices.c | 41 +++++++++++++++++++++++++++++++= ++++ 6 files changed, 76 insertions(+), 13 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index 207a6e2db70c..9c0334ee2ed2 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -21932,6 +21932,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/firmware/psci/psci-devices.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..f22e18b05053 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 ARM_PSCI_DEVICES 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..0ce6a83f6588 100644 --- a/drivers/cpuidle/cpuidle-psci-domain.c +++ b/drivers/cpuidle/cpuidle-psci-domain.c @@ -9,10 +9,11 @@ =20 #define pr_fmt(fmt) "CPUidle PSCI: " fmt =20 +#include #include #include #include -#include +#include #include #include #include @@ -122,14 +123,10 @@ 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) +static int psci_cpuidle_domain_probe(struct auxiliary_device *auxdev, + const struct auxiliary_device_id *id) { - struct device_node *np =3D pdev->dev.of_node; + struct device_node *np =3D auxdev->dev.of_node; bool use_osi =3D psci_has_osi_support(); int ret =3D 0, pd_count =3D 0; =20 @@ -177,16 +174,24 @@ static int psci_cpuidle_domain_probe(struct platform_= device *pdev) return ret; } =20 -static struct platform_driver psci_cpuidle_domain_driver =3D { - .probe =3D psci_cpuidle_domain_probe, +static const struct auxiliary_device_id psci_cpuidle_domain_id_table[] =3D= { + { .name =3D "arm-psci.psci-cpuidle-domain" }, + { } +}; +MODULE_DEVICE_TABLE(auxiliary, psci_cpuidle_domain_id_table); + +static struct auxiliary_driver psci_cpuidle_domain_driver =3D { + .probe =3D psci_cpuidle_domain_probe, .driver =3D { - .name =3D "psci-cpuidle-domain", - .of_match_table =3D psci_of_match, + .suppress_bind_attrs =3D true, }, + .id_table =3D psci_cpuidle_domain_id_table, }; =20 static int __init psci_idle_init_domains(void) { - return platform_driver_register(&psci_cpuidle_domain_driver); + return __auxiliary_driver_register(&psci_cpuidle_domain_driver, + THIS_MODULE, + "psci-cpuidle-domain"); } core_initcall(psci_idle_init_domains); diff --git a/drivers/firmware/psci/Kconfig b/drivers/firmware/psci/Kconfig index 97944168b5e6..68e381f1a618 100644 --- a/drivers/firmware/psci/Kconfig +++ b/drivers/firmware/psci/Kconfig @@ -2,6 +2,20 @@ config ARM_PSCI_FW bool =20 +config ARM_PSCI_DEVICES + bool "PSCI auxiliary device support" + depends on ARM_PSCI_FW + depends on OF + select AUXILIARY_BUS + default y + help + Say Y here to enable auxiliary device support for PSCI. + + This creates auxiliary devices for PSCI functionality implemented + outside the core PSCI firmware driver. These devices allow PSCI + child drivers to bind through the auxiliary bus while sharing the + PSCI firmware device as their parent. + config ARM_PSCI_CHECKER bool "ARM PSCI checker" depends on ARM_PSCI_FW && HOTPLUG_CPU && CPU_IDLE && !TORTURE_TEST diff --git a/drivers/firmware/psci/Makefile b/drivers/firmware/psci/Makefile index 1956b882470f..8e75a0ed6f74 100644 --- a/drivers/firmware/psci/Makefile +++ b/drivers/firmware/psci/Makefile @@ -1,4 +1,5 @@ # SPDX-License-Identifier: GPL-2.0 # obj-$(CONFIG_ARM_PSCI_FW) +=3D psci.o +obj-$(CONFIG_ARM_PSCI_DEVICES) +=3D psci-devices.o obj-$(CONFIG_ARM_PSCI_CHECKER) +=3D psci_checker.o diff --git a/drivers/firmware/psci/psci-devices.c b/drivers/firmware/psci/p= sci-devices.c new file mode 100644 index 000000000000..f1eca61e3269 --- /dev/null +++ b/drivers/firmware/psci/psci-devices.c @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries. + */ + +#include +#include +#include +#include + +static int arm_psci_probe(struct platform_device *pdev) +{ + struct auxiliary_device *auxdev; + + auxdev =3D __devm_auxiliary_device_create(&pdev->dev, "arm-psci", + "psci-cpuidle-domain", NULL, 0); + if (!auxdev) + return -ENOMEM; + + return 0; +} + +static const struct of_device_id arm_psci_of_match[] =3D { + { .compatible =3D "arm,psci-1.0" }, + { } +}; + +static struct platform_driver arm_psci_driver =3D { + .probe =3D arm_psci_probe, + .driver =3D { + .name =3D "arm-psci", + .of_match_table =3D arm_psci_of_match, + .suppress_bind_attrs =3D true, + }, +}; + +static int __init arm_psci_init(void) +{ + return platform_driver_register(&arm_psci_driver); +} +core_initcall(arm_psci_init); --=20 2.34.1 From nobody Fri Sep 25 09:26:54 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 6AF454825D5 for ; Mon, 14 Sep 2026 15:00:17 +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=1789398020; cv=none; b=EKmVKPmfrF74fCtoG7D2pfDz5cXqPxcbsN0u5nop4rNdgX8g5fSpKj4b3M4QfN7Re7Slf5x1PriBIhNBXYASeG6DBJkjyqTNkOfUQycaCD1xFMJss9U/DiMiHD01KPiditjuCXN0b3i0EuacJsyHdxDNE4S23PyrGV+QQiTRVP0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789398020; c=relaxed/simple; bh=1LKdaQC3O+xm9aTmJtKPrncrf8fJAOhX1XLDI/B4dnM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ccDbZZCUYK4ZkuP5yeFqs2GLC/sIvErlb+FbaLBqxkeUl8CrL0QTBKig+vIyMFrF+HP7f7GG40SugIlQ3CKlwFNUbDRd4Xtf+gpJb9HjOnwbPLxU4VmRh5vujJRNOBLavcN3+2NCJUjjNz4+TOZ+qkSbl1PBm4tHdlkiQzlbCmo= 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=S9nrs0NI; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=MIzrBMKx; 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="S9nrs0NI"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="MIzrBMKx" Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68ED0TFa1761392 for ; Mon, 14 Sep 2026 15:00: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= DHDwEn+WIWhQ0IciLdsAkajeCelVa0Flp2Kskcti1Lo=; b=S9nrs0NII51EzlaS oPQDWtpnPaQQRLUIa8BGGsCw6DbMcjf6l2hropH0DVPM361GXEM7Bdfw8uKwdZot 5dOgiLl6tw+aB+VWElqzrMmfCq1GH88Sa41UbYxNA0bYRzwTWYmxS93DiKmTotia mQ54DderMnj43hGaEWqkAwXXi3K/j6rpsGhQRXwbjH04nbzWP0BZhZza/lfcOIMp 1pNrHYjjo47G5xuwQBxuKPBIzyWyFqSXimgw7Mm5av/gpzxNL3dG3wV6JYUqHGlv Nz6KPv8wCjTyjO36EN3wNZEWB3aExOdQV2sjiMZ7alXNteBk+XLP6itFWwR5O76z BZFdTQ== Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gpeex983n-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 14 Sep 2026 15:00:16 +0000 (GMT) Received: by mail-pl1-f198.google.com with SMTP id d9443c01a7336-2db3d832827so41687655ad.2 for ; Mon, 14 Sep 2026 08:00:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1789398016; x=1790002816; 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=DHDwEn+WIWhQ0IciLdsAkajeCelVa0Flp2Kskcti1Lo=; b=MIzrBMKx71YQWFvwiPg5eVpOOW0x8WjsIftntu7X1boylJtO4xTXk3expAgmJAeuEs UQFQpMKJ8DYGSm90EXcBWaR0lIvio28udV7WQNWXX3IBX1XKdIdgmKViZIBOcehj97WL e2UixoPfex7K2616G5dTsS02zuHD2mVC7vK5x3740bxtkYIrB9z33IZ+R7Qmq1ejYweu Li6U2o/X6DYsbC20dQIyRX+G8WeZpZaLmIXmSM+xnPdZpCkjPm/Zn4SvNzrM0AjUMRD5 3+hHXkjOwm2E2w/8JSASatQjMJvZzpVg9mjbETWYu68ZTELJTGEJAFgMz03fQc1mQgnz WJ8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1789398016; x=1790002816; 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=DHDwEn+WIWhQ0IciLdsAkajeCelVa0Flp2Kskcti1Lo=; b=mvoi65JMJBOpEKhDSO+jMmP7x+weerGxSrka35FaOr4Ce95TKwQHVafCwG4D69PfHi gdQF909Mcq9ggdKY0oiqo10cZ5HOB9uAHZ7QC1rEL5zElYQnD/yGukqFzNQCGrzZazMi W5Sx8gdW2nqzDVz3VnUZfXBS33XsNnoQwKs87RY8Vgr87hA/FAfZDhPmyHj2cOFye2J+ Lwic/dgebpBzRSwkFtXHVak9nrA/PLq8g7HcxMYn5QdwgKQljFb4qqxD3zjMFc+AfRyY UE/mwQYELOjlcBpVYgcoZaGLxJEe7TlJyu5hZWERCoMb9Augg4UWnLCJL00gF89BFIkc 0n0g== X-Forwarded-Encrypted: i=1; AKwUvByW3Al09mW1TjBLX80sb++k/al1+oFL4yPmxYDeN1M4ske6jebnHhrWWRUUcUIuDTw9MfEDvH1xbVfGIaI=@vger.kernel.org X-Gm-Message-State: AFuF++kOk9YPj7XdwgHfRS79kwp3A+XNjRNopqv9eZj2YCtvxEJRYfRT HSP/k6pvF5b/ndc6GzjrlvPPVaqHpf59IpTQai/6KYafGLDNUqmc9wHNsS/Ke+Nco0e8xN8sfyM /D/18PE+gD7Ga7/0K+3yAeRmGr9Xf//Y8rV4CDBr3yROr1ul8Vrk8vrFlR5umV17PQoA= X-Gm-Gg: AYBFou18moK0SeL0qEJDt7zblA25PWUhocJvaO0gCX3NaxPnTsHGV86DSKOFbp0YJer MsyH0qswvs0BnilxrO9r3KXX3mgzmi1vL9F4lje9fPomrt6XWfS9XjuVrC3+xVfnF0ns60xX/Jz eBjgf2NCtSVdd6LoGtBHrBNnmQQyqmnlRoYK4wp3IqyuDh+jTB6KZgdyKaKA4wrRWnt1wksREmB JtORBSvN+/+SKEO2T3n+GRuPHiSwvbn+UiumhrbIi/w+4oMGFacjuGLajsPH41xVRE0lDa8U/VO xaxmgOsnI05nPngjYRuLDYkI6J5SKgo3avnG2+wSoD49ASpKwDcB2LxMTg6KdOCyN5EfaAWQj+V dTO41RYxan7EBf9bjChHVv/LKRJ/28uR3g6Sy X-Received: by 2002:a17:902:ef0a:b0:2d9:4871:393d with SMTP id d9443c01a7336-2dd6c741d36mr64686835ad.21.1789398014974; Mon, 14 Sep 2026 08:00:14 -0700 (PDT) X-Received: by 2002:a17:902:ef0a:b0:2d9:4871:393d with SMTP id d9443c01a7336-2dd6c741d36mr64684915ad.21.1789398014250; Mon, 14 Sep 2026 08:00:14 -0700 (PDT) Received: from hu-spratap-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2dd4007bd4dsm42943345ad.4.2026.09.14.08.00.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Sep 2026 08:00:13 -0700 (PDT) From: Shivendra Pratap Date: Mon, 14 Sep 2026 20:29:09 +0530 Subject: [PATCH v25 05/10] 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: <20260914-arm-psci-system_reset2-vendor-reboots-v25-5-4aaf5c09b5c2@oss.qualcomm.com> References: <20260914-arm-psci-system_reset2-vendor-reboots-v25-0-4aaf5c09b5c2@oss.qualcomm.com> In-Reply-To: <20260914-arm-psci-system_reset2-vendor-reboots-v25-0-4aaf5c09b5c2@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 , Abel Vesa , 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=1789397948; l=3255; i=shivendra.pratap@oss.qualcomm.com; s=20250710; h=from:subject:message-id; bh=1LKdaQC3O+xm9aTmJtKPrncrf8fJAOhX1XLDI/B4dnM=; b=9f7VltXLt86w6F9+EGr8WWpUIDOdDKEqN7YWpUaS4nIV6sFJpeL13CNDFTmp4mRqRZO347vQt fCuknKj9CbwBQX5SYiQx+DzSwdtAWrzVzAFYgN2Gc7+Nd//a8CWe0qk X-Developer-Key: i=shivendra.pratap@oss.qualcomm.com; a=ed25519; pk=ssWsJFX3OM9pkdoe4+guOfGPaulHOFt0GVnVlB6on+s= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTE0MDIxNSBTYWx0ZWRfX0TNSm88UIoF6 2FxtjdMFlN030VaYAjGRsp2HnOFTAIdf+FlCoBV3BxuOVWaWA6FRUgeDNqOkwYHkd1nBcpvC8Xr J4DO70/FYDVw2S/U6MaieXS6YxK6pMhuDDrC3DTuDWCrMPE3UPEdbu8BdYLpqDbhtnDmIoXlTxo hEQ1BRZ5aPxnolqtmrVo8gZo6TXDXJPPXnVqA3iUZRZQjwAgWPPcc6WtKzqUzXmFPA4nDkUyu2E omt1ka5IMVMNUvK/mMrKDBFHc8Kc5RgMVvRTx4RgzMSUzpM0CcVbSoXWokqoeXvE9KbzGSOnb1C msuyODWs8HovjGw757T95IbLXoalidwNNakYtRKJX4eW/kidl/zn23lST8ebc9eik/zu3x+yI3Z BAVMoDErYPsnioslLnofUczN8P4t/VQnkbIdJtCJ0v2gioIXtQdbRxN/7cv1Ahn209C1abG6kvb GuY3WjvJWUhJZz8eOlw== X-Proofpoint-GUID: cOq61vb0A_IO3SaQwL2bCNRbvg06Uxkx X-Proofpoint-Spam-Info: AW1haW4tMjYwOTE0MDIxNSBTYWx0ZWRfX5gq4nNBO7eLr VGwXq9GdgGNkH4Y5e36mEJhz20rvev4NGUMP6Od+z6LYlKbpmiKje4ewPpwnGXmfQEuTVmIC1Jy j/3TdOYSGJey2s4UJUjGsvV/Ge4i8KQ= X-Proofpoint-ORIG-GUID: cOq61vb0A_IO3SaQwL2bCNRbvg06Uxkx X-Authority-Analysis: v=2.4 cv=MsrHeGae c=1 sm=1 tr=0 ts=6aa80c00 cx=c_pps a=MTSHoo12Qbhz2p7MsH1ifg==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=VdqzKS8jKosA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=eoimf2acIAo5FJnRuUoq:22 a=EUspDBNiAAAA:8 a=VHtpXdJELXZ9Nr0wy4oA:9 a=QEXdDO2ut3YA:10 a=GvdueXVYPmCkWapjIL-Q:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-14_03,2026-09-14_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 lowpriorityscore=0 priorityscore=1501 phishscore=0 malwarescore=0 suspectscore=0 clxscore=1015 adultscore=0 impostorscore=0 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609140215 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 | 60 +++++++++++++++++++++= ++++ 1 file changed, 60 insertions(+) diff --git a/Documentation/devicetree/bindings/arm/psci.yaml b/Documentatio= n/devicetree/bindings/arm/psci.yaml index 0d04389c81fa..8b6a28b81ed7 100644 --- a/Documentation/devicetree/bindings/arm/psci.yaml +++ b/Documentation/devicetree/bindings/arm/psci.yaml @@ -98,6 +98,43 @@ 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-.*$": + $ref: /schemas/types.yaml#/definitions/uint32-array + minItems: 2 + items: + - description: arg1 (vendor-specific SYSTEM_RESET2 reset_type) + $ref: /schemas/types.yaml#/definitions/uint32 + minimum: 0x80000000 + - description: + arg2 (cookie_lo in 2-cell form, cookie_hi in 3-cell 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 +174,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 +306,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 Sep 25 09:26:54 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 795E04915AB for ; Mon, 14 Sep 2026 15:01:24 +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=1789398086; cv=none; b=cUBqA5YiIhDeHkbEgRvoRzLX4CGoPctZ8/IPiIq8TYCo5NU0wPTzsMWQUROhtflsr+YJ0Cm9OptMq1eSkmV8TlJ51Whi9t2lNZFEpr0bZiXf33AkKrN2/j4ndcUqFZkWWxQvokcPAjcVJWvSiC4IykGD50vhdmNERmmPe1mt5Hg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789398086; c=relaxed/simple; bh=kmURiLH0HbeNUKYyjbcEiNP3i7H5c5RQFvtK3PJJyto=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=XmmTgwQxDZ5b26vSRl7pfSmOintJupTV3LecsnQQd7bNqWHqMB480pBtK6+A6mRavqrvJ+WppbiIhpi0tw3FiK116cr9spMuvBOqtc57UBNnETLYwpxk0Mg46baDH1I/UTm8IqSJUajeRhSFNTYswOYzwOc0wtUdMeBJDccKqMQ= 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=Q7tAc7LZ; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=Iih8UDsz; 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="Q7tAc7LZ"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="Iih8UDsz" Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68ED0URd1761505 for ; Mon, 14 Sep 2026 15:01:23 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= 4yXvTTCDIbtu2vy71Vu0vYymlBft+UiYBz6e9iJYcdE=; b=Q7tAc7LZMbnctMu6 vQMMQ2bYNDDOyfiBhs1f1xPfLFR+IDeGswu13pHQ26n0kyCQB5lRYSOoFauePkqG Z1gzdDyEKGzKCM5HflJXVcYOK7lbcRWmTTQfJ/+AqxRpXJ2OHQc3KAA7xxfogFoK HZ5UOAp+OMcOzPzyH3bE2YsF1odMvEeAWltMJqd9b9cgSx2sydHY4bFk59UL9JKT 8580+CC30F+yjdfse5iLtO6p4Zw7iYu6g5QAFPcd5VX4OoV+WD7l6OJpdYPEgzbD 9cpLtOQB1RDPbavJyy5MQjRZABGOgJ8O0a7b6x7lwQInd4LMHhzEd6OUBGyeZpxG lhIUOw== Received: from mail-pl1-f197.google.com (mail-pl1-f197.google.com [209.85.214.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gpeex98ce-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 14 Sep 2026 15:01:23 +0000 (GMT) Received: by mail-pl1-f197.google.com with SMTP id d9443c01a7336-2dd188e16a2so39236905ad.2 for ; Mon, 14 Sep 2026 08:01:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1789398083; x=1790002883; 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=4yXvTTCDIbtu2vy71Vu0vYymlBft+UiYBz6e9iJYcdE=; b=Iih8UDszZK++JD1aJ57p+iEcvLm1y1NVu08+wPNlNrBaGU+bXUM0ipCrTTjlSKm73l TjWFfwTCYyI0DpFofy9hCA6Xaz32s0HqbyWwbfsknDGZYGHsfSVFwhDOR7xqaRTsjijH ZC6vnZHFrG3UpJ+tpgyNCXJAiuMmj1Qyx0o4I1ShV2+IhK0N05gTnP+pm+b+WDerIxLH +mCrb85ydKP3i+hwVw7QYvqcB25xN2cpysksDawYlMLMY6Su7GRNdlvmh9rkabac83x5 yb9n4WHaAgsGqREVGdyB67nD8JOZJztM32QhewVQ95RApwUXj8V8psswA0KpggxHBnXn 285A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1789398083; x=1790002883; 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=4yXvTTCDIbtu2vy71Vu0vYymlBft+UiYBz6e9iJYcdE=; b=SU2+vBGGzY7RNxRLPFRSiQEeVcgMQgAOJZ5J5SBqFyxp1hVDg5mIoj989xSBQDEAR4 RHs4Y2j8DvW570hVO5WrUfklQ+GdP4E1nFXoz8GXHHM3O1Eh9lMu5bM2ZKDiD8v/T9p7 qwIJg74FTK+EBpVv/EQlUOidHg8GzC108ejqpo+ppPKnRqVA9bdY+tjYISWVvQbP5bCy cwKvmuklpFWfW7VL69JJZ4p9jHfL4YAV/iHqRtzDxarbZYg54R+g6d5IcgqE8d2pUlxx stDVXAb8XcbalTTAJ0koCYxUi8yXOjUujqvxKYzcpZtSaWttVAImQHnagWCUYN4G4Io3 POvQ== X-Forwarded-Encrypted: i=1; AKwUvBwH6OwPU371j3d2Mpn+sR+uxZ9KXoWBhkJxPqeo1H7TXeHpqaxvtbqjzAEmKnJHC2NrSeSUUa1YJWcDT9I=@vger.kernel.org X-Gm-Message-State: AFuF++krp9RXCbw83KthnYz6ICF6F6cf+IQXXLU7yha+FAhkyZfV38xn zpAAT7S0inwW7YpetdGF+pvORHC1hdH9/Jq8RDnvtOvfV/tF0/D3LF2Qw8NGb0lzGKpNaBF6LeM /XpQjiaZM3PBwk7g7tSaUP0ohJ7MiR8OfjilGssV/g9FbonpOsWj7EjY5h8sX8hTWlK8= X-Gm-Gg: AYBFou1kRs9QjoBxi3qn8yJS4tvPDEAWWg11W+L6ZOPZjLWFganN9OtzmShBsETOjeD AgsaE+Wpxa5zfWNlEikuE/ITHOALT/fXJjzjJBkGmPcBOj/totWpero4VB0U8AGOyly/9lYJlAh +9ML3GlfULb8TM0VHvaorjJUgrXxZJDHvCGiVc7UwyruQRyrsvCJvLlm8UOCwninbyy5pZB7cjB bqV/uS/+Uo0qO1xfY5/voQTynZPuo02yyook6I+72JGogLLvQe+HERXNSUjRx02az1/lznSotT6 3VPNTLnkrBcWsZqQtX/i/yKQoC0EtKGnsu9aUTXMB4gIt0XQ6f5RZJZJJCrC8jeaAaqNU9b3Tvq I6Xt/hhkbbW83836ZZPrn4D0jq0NjsYRsaHSn X-Received: by 2002:a17:903:2312:b0:2d8:d4d3:3fbc with SMTP id d9443c01a7336-2dd6c741b20mr61951775ad.16.1789398037072; Mon, 14 Sep 2026 08:00:37 -0700 (PDT) X-Received: by 2002:a17:903:2312:b0:2d8:d4d3:3fbc with SMTP id d9443c01a7336-2dd6c741b20mr61907675ad.16.1789398026267; Mon, 14 Sep 2026 08:00:26 -0700 (PDT) Received: from hu-spratap-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2dd4007bd4dsm42943345ad.4.2026.09.14.08.00.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Sep 2026 08:00:25 -0700 (PDT) From: Shivendra Pratap Date: Mon, 14 Sep 2026 20:29:10 +0530 Subject: [PATCH v25 06/10] 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: <20260914-arm-psci-system_reset2-vendor-reboots-v25-6-4aaf5c09b5c2@oss.qualcomm.com> References: <20260914-arm-psci-system_reset2-vendor-reboots-v25-0-4aaf5c09b5c2@oss.qualcomm.com> In-Reply-To: <20260914-arm-psci-system_reset2-vendor-reboots-v25-0-4aaf5c09b5c2@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 , Abel Vesa , 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 , Ulf Hansson , Bartosz Golaszewski X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1789397948; l=8962; i=shivendra.pratap@oss.qualcomm.com; s=20250710; h=from:subject:message-id; bh=kmURiLH0HbeNUKYyjbcEiNP3i7H5c5RQFvtK3PJJyto=; b=/V/AdimkUBCwTl+pJFMpVXlCpbHXB51ulryAX373joLKS3jPXpUgfBQryXrHBQ2qu4Q3fX+yQ UMISbaYe4JcBOjrKcysrL5n1TL24HIiepXI46g7+5ZiIAdEO+v4rdUg X-Developer-Key: i=shivendra.pratap@oss.qualcomm.com; a=ed25519; pk=ssWsJFX3OM9pkdoe4+guOfGPaulHOFt0GVnVlB6on+s= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTE0MDIxNSBTYWx0ZWRfX85WVefD6lWC0 dIy05EagZoOTlWnO2SVItf0HIHkBOk57l9hTJKyOp3mawGhvJWTA0IXO0Wi2C6Wn03GlKRy1pv3 XmAuqCUxAcUjO5o43yh7T05tKvdEE3i/jw4iikTRSie7YQ7NZjJSfJwCqUE4lGRPBe43nhviISU T5l4JlELuVGVBnxZOHjPOJ5AMwCWQ3kR00t/q+Ss0pjcW97vAQ0vgoF5PxTmLSjbzPzPGzQ3OhS aO1ks1hTuYosJwHtt+O0NBJH+KtcGQGjCCKbwkvrL5tQR0y12Dg2S3STfjdzWaoIt2ATSr2Y3kX qWseDLKOJ0y100q9fPdxb2RH+umKrRwGdFpN3ebTw4U8K8jhDAxJ3wLeaRANvUNY6Lpro0FmKPD rcXyc7zWGrq8EXlmSED5qV+180mBFLnAPDgYxBoWt9Un3ru9O+N+Obv11voO7DWl6bdihAs+oAN BIwIPjOhMtYfpHxXRfA== X-Proofpoint-GUID: uMcFnTpnGAkok3JKTepbm1VYyzVMtDtl X-Proofpoint-Spam-Info: AW1haW4tMjYwOTE0MDIxNSBTYWx0ZWRfX4eFPmdJ9KAxM emzytMrMCFGijRS5GCs7pyptiFcvaYW/jN/q1pgWn9tYXduMKHdOA0l7yIDTPVaFG7cEn9PKqwf JyFl+W3KjkhmMwjEo7x7SUYEDbVZ/z8= X-Proofpoint-ORIG-GUID: uMcFnTpnGAkok3JKTepbm1VYyzVMtDtl X-Authority-Analysis: v=2.4 cv=MsrHeGae c=1 sm=1 tr=0 ts=6aa80c43 cx=c_pps a=cmESyDAEBpBGqyK7t0alAg==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=VdqzKS8jKosA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=eoimf2acIAo5FJnRuUoq:22 a=EUspDBNiAAAA:8 a=VwQbUJbxAAAA:8 a=bUBultAy4ErWMeHVyy4A:9 a=QEXdDO2ut3YA:10 a=1OuFwYUASf3TG4hYMiVC:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-14_03,2026-09-14_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 lowpriorityscore=0 priorityscore=1501 phishscore=0 malwarescore=0 suspectscore=0 clxscore=1015 adultscore=0 impostorscore=0 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609140215 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 psci-reboot-mode as an auxiliary device created by the psci-devices driver. 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. Suggested-by: Ulf Hansson Suggested-by: Lee Jones Suggested-by: Bartosz Golaszewski Signed-off-by: Shivendra Pratap --- MAINTAINERS | 1 + drivers/firmware/psci/psci-devices.c | 71 +++++++++++++++++++++- drivers/power/reset/Kconfig | 10 ++++ drivers/power/reset/Makefile | 1 + drivers/power/reset/psci-reboot-mode.c | 104 +++++++++++++++++++++++++++++= ++++ 5 files changed, 185 insertions(+), 2 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index 9c0334ee2ed2..1c0f111ba197 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -21933,6 +21933,7 @@ S: Maintained F: Documentation/devicetree/bindings/arm/psci.yaml F: drivers/firmware/psci/ F: drivers/firmware/psci/psci-devices.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/firmware/psci/psci-devices.c b/drivers/firmware/psci/p= sci-devices.c index f1eca61e3269..43e6743202f9 100644 --- a/drivers/firmware/psci/psci-devices.c +++ b/drivers/firmware/psci/psci-devices.c @@ -4,19 +4,86 @@ */ =20 #include +#include #include #include #include +#include +#include + +static void arm_psci_auxiliary_device_release(struct device *dev) +{ + struct auxiliary_device *auxdev =3D to_auxiliary_dev(dev); + + of_node_put(dev->of_node); + kfree(auxdev); +} + +static struct auxiliary_device * +arm_psci_auxiliary_device_create(struct device *dev, const char *devname, + struct device_node *np) +{ + struct auxiliary_device *auxdev; + int ret; + + auxdev =3D kzalloc_obj(*auxdev); + if (!auxdev) + return NULL; + + auxdev->id =3D 0; + auxdev->name =3D devname; + auxdev->dev.parent =3D dev; + auxdev->dev.release =3D arm_psci_auxiliary_device_release; + + if (np) + device_set_node(&auxdev->dev, of_fwnode_handle(of_node_get(np))); + + ret =3D auxiliary_device_init(auxdev); + if (ret) { + of_node_put(auxdev->dev.of_node); + kfree(auxdev); + return NULL; + } + + ret =3D __auxiliary_device_add(auxdev, "arm-psci"); + if (ret) { + auxiliary_device_uninit(auxdev); + return NULL; + } + + ret =3D devm_add_action_or_reset(dev, auxiliary_device_destroy, auxdev); + if (ret) + return NULL; + + return auxdev; +} =20 static int arm_psci_probe(struct platform_device *pdev) { struct auxiliary_device *auxdev; +#ifdef CONFIG_PSCI_REBOOT_MODE + struct device_node *reboot_mode_np =3D NULL; +#endif =20 - auxdev =3D __devm_auxiliary_device_create(&pdev->dev, "arm-psci", - "psci-cpuidle-domain", NULL, 0); + auxdev =3D arm_psci_auxiliary_device_create(&pdev->dev, + "psci-cpuidle-domain", + pdev->dev.of_node); if (!auxdev) return -ENOMEM; =20 +#ifdef CONFIG_PSCI_REBOOT_MODE + if (psci_has_system_reset2_support()) + reboot_mode_np =3D of_get_child_by_name(pdev->dev.of_node, + "reboot-mode"); + + auxdev =3D arm_psci_auxiliary_device_create(&pdev->dev, + "psci-reboot-mode", + reboot_mode_np); + of_node_put(reboot_mode_np); + if (!auxdev) + dev_warn(&pdev->dev, "failed to create PSCI reboot mode device\n"); +#endif + return 0; } =20 diff --git a/drivers/power/reset/Kconfig b/drivers/power/reset/Kconfig index bce996bbef28..5c349f41e097 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_DEVICES + select REBOOT_MODE + help + Say y here to enable the PSCI reboot mode driver. The driver + registers with the reboot-mode framework to configure PSCI + reset commands, which are executed by the PSCI driver during + psci_sys_reset(). + 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..bf2dd6626feb --- /dev/null +++ b/drivers/power/reset/psci-reboot-mode.c @@ -0,0 +1,104 @@ +// 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 +#include +#include + +/* + * Predefined modes use two arguments. arg1/magic[0] is always zero and + * arg2/magic[1] is one of the values defined by enum psci_standard_resets. + */ +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; + + /* + * For a 3-cell magic, arg2 is the high 32 bits and arg3 is the low 32 bi= ts. + * For a 2-cell magic, arg2 is the low 32 bits. + */ + 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) +{ + if (count < 2 || count > 3) + return -EINVAL; + + /* Unexpected value at magic[1]/arg2 on a 32-bit system. */ + if (!IS_ENABLED(CONFIG_64BIT) && count =3D=3D 3 && magic[1]) + return -EINVAL; + + return psci_set_reset_cmd(magic[0], + psci_reboot_mode_get_cookie(magic, count)); +} + +static int psci_reboot_mode_probe(struct auxiliary_device *auxdev, + const struct auxiliary_device_id *id) +{ + struct reboot_mode_driver *reboot; + struct device *dev =3D &auxdev->dev; + size_t count; + int ret; + + reboot =3D devm_kzalloc(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, dev, NULL, + psci_reboot_mode_write, psci_resets, + count); + if (ret) + return ret; + + return devm_reboot_mode_register(dev, reboot); +} + +static const struct auxiliary_device_id psci_reboot_mode_id_table[] =3D { + { .name =3D "arm-psci.psci-reboot-mode" }, + { } +}; +MODULE_DEVICE_TABLE(auxiliary, psci_reboot_mode_id_table); + +static struct auxiliary_driver psci_reboot_mode_driver =3D { + .probe =3D psci_reboot_mode_probe, + .id_table =3D psci_reboot_mode_id_table, +}; + +static int __init psci_reboot_mode_init(void) +{ + return __auxiliary_driver_register(&psci_reboot_mode_driver, THIS_MODULE, + "psci-reboot-mode"); +} +subsys_initcall(psci_reboot_mode_init); --=20 2.34.1 From nobody Fri Sep 25 09:26:54 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 B7049481AB5 for ; Mon, 14 Sep 2026 15:00:45 +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=1789398048; cv=none; b=CluT2wIkiuxV7lrvlLm731YjH1oDTcUT6Rer0XyZnpOnjAxbYGfkegkAMhkc5cRAilgxHMAYDEyCmk1D2n6vAwB9LoqM1viaJpBEYmzU2TAfWHdzDZjb9dZNhKkmNsW3mGjj7a8MO1Tb1FokWv+u73pKwzHPGei785eJQ14j0Rc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789398048; c=relaxed/simple; bh=qOFvn7wgKOMIlixvdMXPEO8Y8u2ONv9k+Pz20i023QE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=afSbq4TQ2swbMlIau2DgRRy39KH5vzE3jsNP2Lm78VlNQOkauDNxUvH3uyj/re7mBT65FC+3Y9zaDAPfar7W4riWGx4Oof7WT7zReYDPLaVitEpcKAzQVOID1MG5Yx//acWkJ4jEjxdf4krU+TXj4gIUyJrXlkAzuVaKYTnvAWE= 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=jOk7EHTb; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=PFqm0KgO; 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="jOk7EHTb"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="PFqm0KgO" 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 68ED0X341025811 for ; Mon, 14 Sep 2026 15:00:44 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= TMDoaAwlzNUTRWkFfx6sI7/AXu3O1IHa2Ua1CeFXUbY=; b=jOk7EHTbuz8pS8cH 2Gb+jU3y1nBmkLekUDDyGZ/92x7TIofuECsKyDafT5bYNu0czoCcznXOSW5+1Z/a X/h5ePTTxWNH7ljipeU9G5D9PLnYNgZAIBLgJyzYH/L6MiBAzyq98oYxEqG1xMO7 lmjkiwVkz+jKPjPmXBgm0rzsIlectJST8omgNd26cVJoCb5UXY8gCoASQ1k2Oljd rRoE8fCgiF4fAAG7LpaQQc5sXk3cGtoNDOkfHSHPf4rjw925n5Vb8VLtaRUnn7OL aAmZ/ZSzhgtmEtx9hKoSpg5SI6kMt7EpbBWRAS5T5AfINeBGcJTPRnXXEOvAkUtU TcLQcw== Received: from mail-pl1-f197.google.com (mail-pl1-f197.google.com [209.85.214.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gpdb5sg0q-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 14 Sep 2026 15:00:43 +0000 (GMT) Received: by mail-pl1-f197.google.com with SMTP id d9443c01a7336-2dd753a52bbso2260695ad.0 for ; Mon, 14 Sep 2026 08:00:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1789398043; x=1790002843; 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=TMDoaAwlzNUTRWkFfx6sI7/AXu3O1IHa2Ua1CeFXUbY=; b=PFqm0KgO52NDKfxAA2MPEykdjmAe4m2v/8dxiou2mqozkrPkSJd+phaljE6SB9nPAr 5EfIn1UpTJlKZeCYdQjvjp9hWeJkaQ/bpIxDvmnHxl9RISjMeCVMUc59wXC6d17RmS5V sxw8tsViXZq7u2zl0dPViVAYC52rj+MmPTnVffeLG205u5tuzNMmX9qJLtYsTJpnhndB kS+gIS8FOrU9/LnrjyzFjrbp4dFjZV7MyOsSn0JCgrAV1cLKzqGGekP+yvUU/A2ZBg7m V6+oYcrg5+QT2YzcAYchpAbVqCm0g2lO5D7FGc3GQ5GXWTfT11aWJ+TVSvay4R8KITEJ wnog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1789398043; x=1790002843; 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=TMDoaAwlzNUTRWkFfx6sI7/AXu3O1IHa2Ua1CeFXUbY=; b=ncmvqA7Vf/WJ+u+NdyLuy9adfsYPnB26UdS+dm/C4Hb7rjYPXdMz2edqlQd7FUTF8L 10PraajImmuz7/fa9wDTWQRvEHm26t3r5n74vBy+A2Y/3contLHEUGtcHacdUT5QLHO0 opXgmpWYk1D34V5544UJ3mnkkPxA8JYCi7S0VlGA1ENXWyY9GhIPPQQpSMaV9OBgl+tZ zpQg9NCllf5z9E6H8zD+yEjCgMn3MI0lPgM6bQT2qakc9Gja2DeUcP1Wme1yONSYRW41 VoY6OMw9hR6laOUs50WCcxIyj3/XnZ4HFX0KJ6gw9h3Fe1X4reZSTEW7twkNn0skF40l vdpg== X-Forwarded-Encrypted: i=1; AKwUvBxHH0zoamOPWwn8S/bORHIHWg+R/46ySAVHb7tMvGSx3AuUZivIzNL/dPtkDl8/zF60xKA3CGcqafLVQ/Y=@vger.kernel.org X-Gm-Message-State: AFuF++lsOvBSTFGxS8tOO1A4KwsC3YvPqJ0cATfFI4lPrtmzIia999/2 M/IfGu5P+clMDiXsDvvp5at8n3OlIobgdn8zmnylq4+bznk+yubbw4ZY8BMIBiue3Kv7tUmmE0Z 5jj95RWlZgyh8/pVVj7kxllmm7iU3IyyZ7VwXjeiAT4xkCbWJ+uEdPJqJtmajgGgTxq0= X-Gm-Gg: AYBFou1+d1TpYNYtv05csd7dvP2wstcEz+HEpN16yTog51BLDOvxnowCUKKjGW0wIHU cQvPNBacN1GMGvvaOXc3KynkNOOTcrtFJQbrnqNFf4Ck97rmsB7CT5jOzJk9nM+bVh/dzyTZtKV k8ZsVSU6+S8ebz7KPDFXQpP2tLHhirYYKjKJzVI2gvXT1t94FmF9JDL8b+3XWN31FSqWFKLs29T TIojD86w8xsgtMnwjizqeK8GW64ZdqZI+w1QcIhGE8THpVzs1x5zWP3KpBoZ40+CxGa8PJTpU3C K61twVbdybhEL4wPPIDkjtER53yZfXL9eUoGCzQFo7cODwoyvPaznWwLMDVdmg2KctC5hEu+pg4 OR0o725phrQQ6+DDo+v+/+3NM/OlAeCc38/3E X-Received: by 2002:a17:902:c40d:b0:2db:5c0a:f184 with SMTP id d9443c01a7336-2dd6c6fc4f3mr55282025ad.17.1789398040458; Mon, 14 Sep 2026 08:00:40 -0700 (PDT) X-Received: by 2002:a17:902:c40d:b0:2db:5c0a:f184 with SMTP id d9443c01a7336-2dd6c6fc4f3mr55278505ad.17.1789398038902; Mon, 14 Sep 2026 08:00:38 -0700 (PDT) Received: from hu-spratap-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2dd4007bd4dsm42943345ad.4.2026.09.14.08.00.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Sep 2026 08:00:37 -0700 (PDT) From: Shivendra Pratap Date: Mon, 14 Sep 2026 20:29:11 +0530 Subject: [PATCH v25 07/10] 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: <20260914-arm-psci-system_reset2-vendor-reboots-v25-7-4aaf5c09b5c2@oss.qualcomm.com> References: <20260914-arm-psci-system_reset2-vendor-reboots-v25-0-4aaf5c09b5c2@oss.qualcomm.com> In-Reply-To: <20260914-arm-psci-system_reset2-vendor-reboots-v25-0-4aaf5c09b5c2@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 , Abel Vesa , 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=1789397948; l=2145; i=shivendra.pratap@oss.qualcomm.com; s=20250710; h=from:subject:message-id; bh=qOFvn7wgKOMIlixvdMXPEO8Y8u2ONv9k+Pz20i023QE=; b=txsEWykMpTLSUOW6FXQVTJLBQQ1Nc4sqO3I+bYIXwGfuhPQ6gT4S9k1E4GUbqfnAs8R/0URP4 /HrN6czalP9ApLSw6uR4PpjIRu9AyPfqqX0KmqYStyBUvqXmpeSjBoz X-Developer-Key: i=shivendra.pratap@oss.qualcomm.com; a=ed25519; pk=ssWsJFX3OM9pkdoe4+guOfGPaulHOFt0GVnVlB6on+s= X-Proofpoint-Spam-Info: AW1haW4tMjYwOTE0MDIxNSBTYWx0ZWRfX9XNoOAMzw4k6 ORrig30c7ab+XzepPfKSY8ZLTE+tfCD8k247PKNc7gIfHA+xMYm//nmTfNUZjnut/hd9vjQI0t8 o/nnO4D+f1q1ubHvXrNXL6/PAFhPpos= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTE0MDIxNSBTYWx0ZWRfX/RmKl//KQ1he CHsF8iJ/fZR2fQwQCllfPAx4eE1o26crBdbNM8NLB4ZfJ141ZLMTcWdZjiypHszzEva/nLDIAuj eCBZY1VJy2HSeSxhJ1FQIcr4Krh76VqDCfK8caTAULNcgVBAFGuh7VixDJRM3kBv4YusHTzLPWK fCb83ucgEoR02ePBqjxnhqC7hoD6cqHebxdextEidF359Ijkb1ilZgWUhNmJknlrOYlnMX7Hn6j 8UYqxT8qJacI4GGG+ZOPFCAPkla4L1dazXS1P4dkf6JqBqrKFL5i4IjpcIsDogMDALBzud8U8cA 5qVw7eSK+V1kTwdVGK7zCV/dK5deksZtZ1TgxKwu7QqoSLorwpAhs3LFcW404Ni5lGohsqh5Q/g G0eVODSmLPQPTjUs0Qbn3Q99PZkdWF/4HEkF3rgGc2qQvJkv7dBtVTmCWZqdChZd4n0jQqEJsAH pg/YJApQOUzKZ4kXaag== X-Proofpoint-GUID: m4ffw3S296RqiV-hHreJmUQrMflezlkI X-Authority-Analysis: v=2.4 cv=Ie4Symqa c=1 sm=1 tr=0 ts=6aa80c1b cx=c_pps a=cmESyDAEBpBGqyK7t0alAg==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=VdqzKS8jKosA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=_glEPmIy2e8OvE2BGh3C:22 a=EUspDBNiAAAA:8 a=t9IVmYW30V31rltyR78A:9 a=QEXdDO2ut3YA:10 a=1OuFwYUASf3TG4hYMiVC:22 X-Proofpoint-ORIG-GUID: m4ffw3S296RqiV-hHreJmUQrMflezlkI X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-14_03,2026-09-14_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 bulkscore=0 impostorscore=0 phishscore=0 adultscore=0 malwarescore=0 suspectscore=0 clxscore=1015 lowpriorityscore=0 priorityscore=1501 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609140215 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 347815e5983e..307fc45af37a 100644 --- a/arch/arm64/boot/dts/qcom/kodiak.dtsi +++ b/arch/arm64/boot/dts/qcom/kodiak.dtsi @@ -867,7 +867,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 58cce89a0c1c..c9c1b0c48550 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 3bb5fca8e2b1..a107abee10c3 100644 --- a/arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts +++ b/arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts @@ -1097,6 +1097,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 Sep 25 09:26:54 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 174EB48663D for ; Mon, 14 Sep 2026 15:00:52 +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=1789398055; cv=none; b=u5Xt2Jb0khruVf1SYub4/CDnFTKwmHhAxGN679NsPBGWdcYJyNiZeGBOIXTsEr+ENwOW9TTX/c3961A3+aCThjkMWUmVpfqG5b2rJGa5FBZCoUDd6xkKmuItJCiIYe0aioy3LORUQ5R/92lrFkg2zwhV453GJpxZSVOs3yZExxw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789398055; c=relaxed/simple; bh=HY9fLa8u8u31BscwdrGeQccVQPGFQUgGa2K581SXsxg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=QYTCQClNfE3O5qI0PXl24DRvtdQBlyS2iDfVOcu7pff/lrHAeQloNQ+1LqnyOx1l2UcFC86NNWkJFly7QBeW6hVmIMVbRi6ScPXhsqSly3TRPfQ8X0TpQkTpGH1R5PHu7mUVFqMB3YHhb+b+bnZyWzYJTBhawzKhze1B4+CZCEY= 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=P/cew2hH; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=FE+LpdhN; 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="P/cew2hH"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="FE+LpdhN" 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 68ED0XAB674511 for ; Mon, 14 Sep 2026 15:00:52 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= jfT8oPSA0cGLEFSCxt0NN45mGUPgAF14lIogeHiakWY=; b=P/cew2hHZQT7dWMP dOgrhAfwUUqvNmkCA61QHC65RV6hkeEWLtXjiK10IczKYcqiVrxE1fQ/eN8P5k5b XCuTKUUb+qdOBOjbq5Rq9FckjgM8HQ4fapdpZW5haLnLuhOVFVCHD3pUfwztoax+ OFSSn0tuK5dnngeoCKoj/oK06I/TdacobsbGxubKDSarCSDv1jGJcSizQWZu84bO auQT7FsR9NAhILViOX7aAvsHF1Q30+jUjTASqp3jwQUSTPWrt3Kv3gvkX3ppMS3i lqiAUoiHK9p7CPRd3weaNxFQGD1a9ATE+BWezwvVJu7RrU2Mq3NphWA76GXh5ePf Amv9aQ== Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gpecs99v4-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 14 Sep 2026 15:00:51 +0000 (GMT) Received: by mail-pl1-f198.google.com with SMTP id d9443c01a7336-2d6df0a1e18so66920245ad.1 for ; Mon, 14 Sep 2026 08:00:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1789398051; x=1790002851; 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=jfT8oPSA0cGLEFSCxt0NN45mGUPgAF14lIogeHiakWY=; b=FE+LpdhNLxSk55h5s4VuNjgFdJrV9qPNzRHASegypnzRfv5oQfMMc6O4k88hT8qwEM dgEbugT+4moo/riPVPZQmVwsYmo1iy/Tw1nuoIja7m/LDx4ptIRNww+iT5V6uc/YC0Jx RGnKxnjyNWOUNZaNgY/y6mpaIPrzuhxisXTdoz+ZXRyADQdYfhb6nzljlAHS69Hl74i3 zxatiiuaZ+Krm3/SW46d+2D01FSVK9S1IgExpEu4+dAi7OztiR/0jf8KZjGb9KNN8Lq8 bcRJefw8M0UZ23kIXqlbBuiDWSCuuWiby22thxbfkjJjY98lxEdLlMZX918lVogbJFan 3CaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1789398051; x=1790002851; 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=jfT8oPSA0cGLEFSCxt0NN45mGUPgAF14lIogeHiakWY=; b=SYPUoPndBzfagCIuK8zioKyqOV6ra3wPiUt1QI8EjXI+5xdDaDpiB9HtyR80gamzW7 xCLrbMGYEzmCwQXu1VUiafxIsNu8k8pi5G1Duq6v8xg+Sw3CRkyYJ+ESHv4+xuUDZv6n aM/Zj0UEZYqlyUIkVfYr/+A2zIo7xlcwyXqRXB+40U8KmGJkmCTnnl30ZTiLmDqDUAIC pxbKevkizdQjlQ/c94e+9NHUklwaGFKcu9pKI+AMaRzmsnaYrIoFws+f+V30aJ7jmjD+ XUOhb4ayNVyA1YJXd56czl/E18b0yyN0O0Lw5PW8T6gH6u28YF4a42xGaTj/vsdXvm99 UFbQ== X-Forwarded-Encrypted: i=1; AKwUvBzBal+XAKOF7NI6H0uPX2/695fazgf/LhVEpX4kHX8qKfaymoxzXYcv6AD+My9CY5NagUAYdmMQKgq5eTk=@vger.kernel.org X-Gm-Message-State: AFuF++m9mejhyH+seSeJ0jzZB2F28kwG0Px624WAMGlxwpL1+S7e0zln yGI3Gr9+Gyuo9lPmwfwNOYZxScmUkVWEFqqaHRquJWRACBdzZfGKUYDKLX5Y4MMyLB3ZURqGXT1 2kSK2/jELtRGFGdUpWIrNccEhZrvbzcXlMHzQb4BqQxRB84gCw61znN84EUqnZeU2lro= X-Gm-Gg: AYBFou3Dh56zJjr+x6J1p/Up0vJdOqBkb7szWGAuMqe4ZLYbhjpvRcifgcMVZirwgcV i0dH6vhEtVzL8L99AdlvGmfh7fmCkdYxufh6W05qPtkzLlF1fNFOWfId3UorELoR6U5xRKDf7bp qqe5tTEshZsWAex4Y0+SXKsj9Jm5c0KcUBkulHW+0dst0gsVgFnQtfr3x1t3aGB5UIgh5Pz/1qR Lmf/X4SbbRb6Bl3oHuktVeLOVDZrB16Tr4//cNFMuOE74N9AYuBKtAZBMWJEy3khKb0PsxDUdmp 2UlRvGOHPX/nyB68p9/5YiH7RxkIUdcTf+GJvwgTBhOepYFHCDtrDiz4/T/jP/xdSNckg/zEusp 4KPoVLbBIfOB9ie4ofJ27kfl6IkEg7sIgNbB7 X-Received: by 2002:a17:902:ecc9:b0:2db:539c:b7c7 with SMTP id d9443c01a7336-2dd6c75a41emr62769695ad.20.1789398051329; Mon, 14 Sep 2026 08:00:51 -0700 (PDT) X-Received: by 2002:a17:902:ecc9:b0:2db:539c:b7c7 with SMTP id d9443c01a7336-2dd6c75a41emr62768505ad.20.1789398050872; Mon, 14 Sep 2026 08:00:50 -0700 (PDT) Received: from hu-spratap-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2dd4007bd4dsm42943345ad.4.2026.09.14.08.00.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Sep 2026 08:00:49 -0700 (PDT) From: Shivendra Pratap Date: Mon, 14 Sep 2026 20:29:12 +0530 Subject: [PATCH v25 08/10] 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: <20260914-arm-psci-system_reset2-vendor-reboots-v25-8-4aaf5c09b5c2@oss.qualcomm.com> References: <20260914-arm-psci-system_reset2-vendor-reboots-v25-0-4aaf5c09b5c2@oss.qualcomm.com> In-Reply-To: <20260914-arm-psci-system_reset2-vendor-reboots-v25-0-4aaf5c09b5c2@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 , Abel Vesa , 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=1789397948; l=2178; i=shivendra.pratap@oss.qualcomm.com; s=20250710; h=from:subject:message-id; bh=HY9fLa8u8u31BscwdrGeQccVQPGFQUgGa2K581SXsxg=; b=fNw+c8n6DonkQZy6Ryg4I7jQGU3AwDIZpv1saXTAQP0uoDA44F09SQVdEZYzRHbUuA5FolYsW 532efuuiRUfByHxOdaaphUQmNsImBGJ54C2AfORsbVFpdPXiRM8pMD9 X-Developer-Key: i=shivendra.pratap@oss.qualcomm.com; a=ed25519; pk=ssWsJFX3OM9pkdoe4+guOfGPaulHOFt0GVnVlB6on+s= X-Proofpoint-Spam-Info: AW1haW4tMjYwOTE0MDIxNSBTYWx0ZWRfX0p1ov7+QNnDf I3uoJ5ssV56ZlCMOi41S4Y4HqdA+X1qcsbgCCuRUN3XIlapoACRVL+70wq6xyxI31+OCU65pwE8 h1L3VkFxRe/P4jCqBsplQaeHQTqZxDQ= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTE0MDIxNSBTYWx0ZWRfX8m/IkBPDF20n w+Rgt7VlS81Fk1cRlJPSwdGmvJLnqaGBbYkRfBWPZL95El150wB+MC2oDQMbdxt8SUnzNoQ8ii5 1viErg3wslt24HNfFvlRROSDZxSAxA80vM/8XN50xfVM0tzKdUV7kkU+xulHHZqD4Wx4Em1QSyW 34HisCsFP3Y7LEZLucJDi4wK897+RWVVQYB5+jQ1YsIuyNk76jfInHHNw5oJNMH3Nd38zLOIknu HWSk2EFYKu14rgRYWyGR66ea7QNhr/ABV/U2dzl5hIaG/vwrcUSXHLWMszDDB5b+cXoiJ2hK5CP BXVdvi1grCNoaKoNv8cgXE7Ti5qNaLHX0t+MF7Si1/gnGIdS/z0zV2ylfUpDiUoZ1Q8xyZN6yhv lwcO3z8nyC2VmQJjvwZOu09k52tzZSXlcfdWMHb14Ws/UC/UBTmbkUW61JLdy9UVsXjinxa6uex ApGGDoCM2pUNnChcvbQ== X-Proofpoint-GUID: 5iAy8iSWkpcr4zeYIZQHIDpH_iGWISYW X-Authority-Analysis: v=2.4 cv=b/cncdGx c=1 sm=1 tr=0 ts=6aa80c23 cx=c_pps a=MTSHoo12Qbhz2p7MsH1ifg==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=VdqzKS8jKosA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yOCtJkima9RkubShWh1s:22 a=EUspDBNiAAAA:8 a=t9IVmYW30V31rltyR78A:9 a=QEXdDO2ut3YA:10 a=GvdueXVYPmCkWapjIL-Q:22 X-Proofpoint-ORIG-GUID: 5iAy8iSWkpcr4zeYIZQHIDpH_iGWISYW X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-14_03,2026-09-14_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 bulkscore=0 adultscore=0 priorityscore=1501 phishscore=0 clxscore=1015 impostorscore=0 lowpriorityscore=0 suspectscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609140215 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 a45485b54a5b..87d01acc7b5a 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 144f117ba511..0adf9f02c8cf 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 695eae1b7256..f0633b81a04d 100644 --- a/arch/arm64/boot/dts/qcom/lemans.dtsi +++ b/arch/arm64/boot/dts/qcom/lemans.dtsi @@ -550,7 +550,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 Sep 25 09:26:54 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 4EF3E48381B for ; Mon, 14 Sep 2026 15:01: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=1789398078; cv=none; b=HNTUgooLfjucIpxbKZ46czTjflvj0FdiTFs6SYDf8KfJtp95RhZ73VuF22kg4ZTSM8Ka4cMf8I0CSdL+Tz9G4Da4rkfUbpI0xeb1zBIiwT6CI/nzj4MBNiqvU1HcA9CpZ36a2WLnUOg8JDF1/Bz9DxPvNEWilJ0hE99yD9NwRLM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789398078; c=relaxed/simple; bh=HciPNJeroVrXrUOsjAQZrtcE5R9UzHaUh1eqHckGx+o=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=pKSuvWjn9V49NxnliANteM8JIo0Vd21eRkHWZg7DI9x+JUqS51ZfrpwAzo/Tau/Advk+AzosGItrLfJgIZ3AX3VG18yHRQtn6SsNS9Kb/yy/vv1rcCKZQ/8wU+3/gZiP8Kh1Uwq9MxJ88lQtfPgzpICDu37ksddL8JeXrRczazQ= 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=lg1hMAq+; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=S65OrK0R; 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="lg1hMAq+"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="S65OrK0R" 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 68ED0OBW607367 for ; Mon, 14 Sep 2026 15:01: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= btXV6KHGAw3+GaDmIGslj+LlIRfZXkr4tQ4AjomFcuM=; b=lg1hMAq+rA2JcRsl MaQMCeQKDQoXXDEuAkGPzCk9mfww45mYEak/SQD5rKAIFvZKvOB7KTq68eSwDSEk lrYhjOQfbmevxvH8RAqdt9Zi2YnB4Sdd3mza3C+v/8aK74qku9giZfPnF68s6bju lVvsMQ84PIu/2MkJqZACptjMjLl2vF637F8EmhZS5tAjWF30yMyhEpZvm3crVsNf G3Q16S1LjGNS8dp9Bzf6JYiOFOTZ5UbsJcexSlgf4Ndy/n6PKCs/Xw2ShAAZeT/C 9O0wIa56inkE8gS5835wc2u7wto/QUeZA9Vci1hDCd3jKlgyqEG4ozRJtZn5KI51 zuShIg== Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gpg2krsub-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 14 Sep 2026 15:01:11 +0000 (GMT) Received: by mail-pl1-f198.google.com with SMTP id d9443c01a7336-2d6df0a1e18so66925235ad.1 for ; Mon, 14 Sep 2026 08:01:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1789398071; x=1790002871; 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=btXV6KHGAw3+GaDmIGslj+LlIRfZXkr4tQ4AjomFcuM=; b=S65OrK0RIQJqRpU4nPGuFe3HnPG91GaFoe4ie/uWzUDWpMC64yBI+eoNTEvqnUAE/c y84Bu4fXPr60pPTfLB0ph0imMZBGo+YHnz+isEdEOEdJQFNr4fbtnGA4X+xJsbbazDVH BvFcaPPvvCIqxIefxW4yDcUlwCbVeJa0eh3+HRNm45Ecb4uJ5KXyjkTuN00c/+R8kt09 cdprq1FJKNet8SZyTHc6tylU1BxgTabfGCcFLEGfh/8REMbLakbYL5sjbI9x2NIDIgRi 6/r8PdtjTjLOycIWI6dvM9jsPdQQLIOwRiYcchhmEYDzfSiS6IVqVOA1AVPmk5F0JALP vuLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1789398071; x=1790002871; 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=btXV6KHGAw3+GaDmIGslj+LlIRfZXkr4tQ4AjomFcuM=; b=GiOVq1evM/LuQIUwlXeN/JfAUpzPzImwC40E4dcIy74l+opAVbGtNnp7LC39otCHCq iYhPkr9uBkw6u1Cq2ybGvlPpfeXX69l49eg6G1uTq616FRHocQtBMEMAq2JBu3BiShU0 pVfLKe0he6gxHbWGI7RWD2+U9tr6ZlnvvdPm0X9UzkRTdEvdtN/I+3c7j6c4mXkVTXJ0 y4JAlwEM8zwGnuQke2ddy5YoMf2DQdIpvKKpZ+d7Y722MuY0U2HUdMNZbfh9JraKbvLi lrGYxu2mtdm39Vn1+8Qc2KpWKQYeQH5WdmncGWEDK+HDqPsCHX4KqQVmvWQGoL5KrJFJ C2LQ== X-Forwarded-Encrypted: i=1; AKwUvBzWs5o9+x42BaVP0D9PVFv/pz3YrbFz6BwtnWvj1bZey1BHxNPR0U6NEC+VgPJqnZC4Xjkn8lkMpiTzjLM=@vger.kernel.org X-Gm-Message-State: AFuF++kWWzccfJRGeWcVJOvh65lVQt+22BNYZpmfjyundrOW8D1vi/q4 U/i2oSCG0k7O+pF5OP0y/6XSxvtHyf1aIFenOhiCeg6EX5Q+KC0kKEaIgVcjqRWy3+gf/61Z99H HYfUypge6RWenwQVuiRHHqqPVhZ9sedQDDE5TlDMx59Qep3UobFAZVLm2qZdIM6y95ig= X-Gm-Gg: AYBFou226D5GsnIs3rMnENaqu83n1kHwfXzfaDx2Ef68yk4j90wJWcqMqAsdcRt0boj /iOyT5hIWDTCBUXdHY+D9gPsVtRa9KUWweZaEtYPhrCT8DGRga7tEDIiRtq+NKPcE67bdJI3qGC vLsGAXvnpl/LK0mA1/mD2t50qmUc0indBWL3qoskygnrP5TCxpHd+MXXILrG/wdEtfTAVbmvBMK Zy/oWeonNVObULWY0tWPj8oTPxtGWvE4y81bdcAelEkV2cBucA5lDcsb9IFoOPNcNLUQMIS/Ht1 Ly8AnEdJkxpvXx+1y7e9h/YtjH7TLg+Vgh5ZrlduDsulounoLbVrmI3ubUUVA2lL0xCLDK4MoU0 ZnxQXX8PV3IIVzkm6FWut+1Mpq6cn5Ay4MKzu X-Received: by 2002:a17:903:2281:b0:2d6:fd55:3a9d with SMTP id d9443c01a7336-2dd6c5c121bmr55028855ad.3.1789398070560; Mon, 14 Sep 2026 08:01:10 -0700 (PDT) X-Received: by 2002:a17:903:2281:b0:2d6:fd55:3a9d with SMTP id d9443c01a7336-2dd6c5c121bmr55027765ad.3.1789398069890; Mon, 14 Sep 2026 08:01:09 -0700 (PDT) Received: from hu-spratap-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2dd4007bd4dsm42943345ad.4.2026.09.14.08.00.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Sep 2026 08:01:01 -0700 (PDT) From: Shivendra Pratap Date: Mon, 14 Sep 2026 20:29:13 +0530 Subject: [PATCH v25 09/10] 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: <20260914-arm-psci-system_reset2-vendor-reboots-v25-9-4aaf5c09b5c2@oss.qualcomm.com> References: <20260914-arm-psci-system_reset2-vendor-reboots-v25-0-4aaf5c09b5c2@oss.qualcomm.com> In-Reply-To: <20260914-arm-psci-system_reset2-vendor-reboots-v25-0-4aaf5c09b5c2@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 , Abel Vesa , 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=1789397948; l=2076; i=shivendra.pratap@oss.qualcomm.com; s=20250710; h=from:subject:message-id; bh=HciPNJeroVrXrUOsjAQZrtcE5R9UzHaUh1eqHckGx+o=; b=UfsY7hvxgla20/C84Iw/tfliv3ND94oAV4ltNhIsRBPYTiUf+dZTp14djxCjGxqCD1wyPym5h ja9i2LTf4ynAyKkvvXv59iyNjK7EUvPNRdV/B681ucGMj9XpztqZlP2 X-Developer-Key: i=shivendra.pratap@oss.qualcomm.com; a=ed25519; pk=ssWsJFX3OM9pkdoe4+guOfGPaulHOFt0GVnVlB6on+s= X-Proofpoint-ORIG-GUID: HKQ9hR3_nYoHi4v04UKL0CSufjt79j4d X-Proofpoint-GUID: HKQ9hR3_nYoHi4v04UKL0CSufjt79j4d X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTE0MDIxNSBTYWx0ZWRfX8R4nBXHh+ndU zAeLLeUq1b4WshTWbI3Z67LszO1uI+Y5zs3rk95FsY1VGHVdG7L1HentfeVPGUdka+Fwsw1l6YC bCUb0zWCtxzI7jTxqmgPe3ptMGggCHBRwFf1/sZ76sI8Q/0AN/BPCBAyqy7gQr2yAXaVfXuTq63 Ck5GbVF5aLBqTYaNwCqnpejIsl7ttl6IUQruiN71/Rxv16cpJ7zv84+NayPNWaR3+U4d1vcRf4l tYqGRfckehsSDi/IP1omiAkKC08OckQMlYOZ5bECo1oTMxMcO3/X2jXWCuJLFzkCGzE19xPBslD FjjdRF/hOR3SBoIlkrAxm1jDnanyLwYwMCDfoL2z8irhHak9c50pA6FLVPjTiqd9NkSjLSQ0RV5 IlNChGPmU9KFWxW/MFUu8UEGYwI3Tw== X-Authority-Analysis: v=2.4 cv=M7TYuCws c=1 sm=1 tr=0 ts=6aa80c37 cx=c_pps a=MTSHoo12Qbhz2p7MsH1ifg==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=VdqzKS8jKosA: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=GvdueXVYPmCkWapjIL-Q:22 X-Proofpoint-Spam-Info: AW1haW4tMjYwOTE0MDIxNSBTYWx0ZWRfX1SamhknDyJ0k 3eBIglBUkH4IzGI7mPMdRjdz63LJz2/SpjOaTplXV8AHkF+UYymqg87gSB1DxgOA6cWRWodsqKz /BAf7lp1pxDdzdffjWN4CODLTM21Ak0= X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-14_03,2026-09-14_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 bulkscore=0 suspectscore=0 malwarescore=0 adultscore=0 lowpriorityscore=0 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609140215 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 395d32d36844..9f1ab59dee2d 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 Sep 25 09:26:54 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 A0D75488215 for ; Mon, 14 Sep 2026 15:01:24 +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=1789398086; cv=none; b=rU37hWUhUdP8UQ5H2oanSviYmgVjNhQCcbQ1GpiJlecb3tI7S5lL2GX8b4bVVnx1IjjiIz0ipXlVFAAN7VdXc3BdEtOMsPGiiELz+CmE0jDh1nyL2FdEXTyCwKSTdSeWIeoVWKDstGRJ5sTrFtyGVdkSnK0Dor/tOThskwitDv4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789398086; c=relaxed/simple; bh=4fTpCSkuJ6PFbWarr8sThQ/LuS8y6G1v4667LcR6KHQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=jZ4+4sVEJuUf6IRXgb36i9Nc0vbgYs9rnoMkzm8iSeLMQb3aOfHbWQtpUB3ifl3zwALY3w8NdOG7vauJv9+v/EGSlUBjy4tfutoK7hQ6MDkf/BsCyr/2mq3IGJr2KFGkYmrNzzZX0M4QA484UGMOMQdxZ0ofK5I+n8P8FsAEpvI= 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=BuDVlL0u; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=bLt+8MsX; 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="BuDVlL0u"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="bLt+8MsX" 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 68ED0V3O607565 for ; Mon, 14 Sep 2026 15:01:23 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= Y8QpsQNU1m4GxJroPAMjexZ1MBknKFRA0AkELRZtXV0=; b=BuDVlL0uPLQkdBFS gRWCtoIyDiBTwF4lUx+p42vEDb036xj3A8f+89JrezOJcuVBwwLCiJFPvOD0ra/e vQ0a+zi0zZczTmdsi8H188hBQTYvGIvsWDmAsJT9bmOOKfD+H3tG3SU3CmEVgt+Q oHeS7QDwwsDusUEXQIJLco5XBChlHMyktNnCg8azHxOjURS4/W11rHts2dO7cN6m T8LkkocuB5oGBNt6o+bMHI5JJ4C9zcOQLGw7dZyB3fqa3vLrRo7HzDIOHgkj+BF9 tHaaQH4WefSa+HFvFQmGoyxwRJ0rJGGsG6S94iC3/EU0mKry3dadSV+CWb/+fask yO52TA== Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gpg2krsvp-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 14 Sep 2026 15:01:22 +0000 (GMT) Received: by mail-pl1-f198.google.com with SMTP id d9443c01a7336-2d932ef41c4so57644945ad.0 for ; Mon, 14 Sep 2026 08:01:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1789398082; x=1790002882; 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=Y8QpsQNU1m4GxJroPAMjexZ1MBknKFRA0AkELRZtXV0=; b=bLt+8MsXKohEZkZ/v5x6taQBYhqt38tplqKnUUAqJPKJLfqOD5DTzsoXQs7WhR6eBx 3q5MNCM2O2eiVEWLlrGulcHEGkEfP95kpFKiPzcYaiy5B+w6GsIZrBA+OBLBfD/at62V eVFwv1Eclj/NJxTHtDkEnGnlG1KZyTkY/RYfajp4bymGu8ztmkwUK6OedAfgFy9K9us4 G7UdFxHUAyGqep00TLctFPInstu739lkeonLxz7ANmfB7x/hGK+2fpfq5m61XIixFEpg TZ51GaEe3IWdphAXWns7o+ufuXpLHOMwpdnvMD0vVIttGSTQwUG8RkLQEh3lA/a58CXB YqaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1789398082; x=1790002882; 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=Y8QpsQNU1m4GxJroPAMjexZ1MBknKFRA0AkELRZtXV0=; b=dfp9dLaS0JGckDl7h+KCsi5Xpzq18p5tsobIUESP6b3YLY/cxVur8og9jjkO+48fKW Tznoiwggk/NE+q4Ku1WcWhjt4tUG3mhwWFKJ4LpSdb0jIX7QwLYn58ASieZ5LxYF7hs6 mcVzSUGeTKYoUIgPwI02zqVagqVaBkWbpX+EY39V3/Jl7xSbOlCLiRcJ8UvVtqDXrcw+ z6JzKdeHD7I0MukGm4c560ZaEAmeG+IJhO2xOp06v+2tYILj2sysKyvGrMK7FcO+aCJs hjjyiWMs/zoify2SorShaYgoU8G7k4vK+9hkSY9vP0je+1rRoN7yEuaIMiqeNPbT5Y5G iFbA== X-Forwarded-Encrypted: i=1; AKwUvBybxM0GoIcUz4/vzeG74SAacp+w2k5q7FZ+RPyOA+QJgPWZrGfsi8aIKtogvGqjnELRwOOFdGywby/uiM4=@vger.kernel.org X-Gm-Message-State: AFuF++lYL07QIdvzDMZtFEa+DUIEk1I8/oMy6+ksHCKcvpEYsX5IkZm+ BTmQQfVZIvbVgqTjgKA+qbQkyfIgQP889UyCz5++BgOTECsmSY+TFqwagoXanpka/xF2GRlGy99 3Yf/paBBHVdtaE/itDAss7rocB9gxNwnAUsGirfjZIbepYxQK/+/4vizIFepUxVLM8IY= X-Gm-Gg: AYBFou2JOguW29AHNzTDZQt2Y2JnafbbsJR11r4GsQKq3s4J9y8wajqlyNdc2YqLe+A o3FolB/GUu87R/q2iZyvhhLlbIcj9OnHR/EmpTTrfi7Kblc6rwNi+d90HsyXxhmHi/M4t4xDRK4 8cfMKEFXNH1VAX77+vnHVg5ojvRUL5RryudmU1LPlwx5RANyvJwqgUM8ZyL5P1BAMgyHBM8CUcy ieYtY20UUyQrWOPlj57hABdnkMAf2pZ4hd4EXflON4vNmtOonJO8NdtFKkOxUmPS4tSDK4wYWtR ghC2B8pol7QJDRAM2gILf9pKKJP5BlCdbv+5bdQTRlzb2ryvg+3kjv/X3KDBQgaZh1mtuwILmqr cwD+tfdqbhUu9U0rTIplzSpl6etqbq2BHnWes X-Received: by 2002:a17:902:ec84:b0:2d8:d4cf:fe48 with SMTP id d9443c01a7336-2dd6c7af936mr37525995ad.14.1789398081810; Mon, 14 Sep 2026 08:01:21 -0700 (PDT) X-Received: by 2002:a17:902:ec84:b0:2d8:d4cf:fe48 with SMTP id d9443c01a7336-2dd6c7af936mr37524975ad.14.1789398080977; Mon, 14 Sep 2026 08:01:20 -0700 (PDT) Received: from hu-spratap-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2dd4007bd4dsm42943345ad.4.2026.09.14.08.01.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Sep 2026 08:01:20 -0700 (PDT) From: Shivendra Pratap Date: Mon, 14 Sep 2026 20:29:14 +0530 Subject: [PATCH v25 10/10] 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: <20260914-arm-psci-system_reset2-vendor-reboots-v25-10-4aaf5c09b5c2@oss.qualcomm.com> References: <20260914-arm-psci-system_reset2-vendor-reboots-v25-0-4aaf5c09b5c2@oss.qualcomm.com> In-Reply-To: <20260914-arm-psci-system_reset2-vendor-reboots-v25-0-4aaf5c09b5c2@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 , Abel Vesa , 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=1789397948; l=1558; i=shivendra.pratap@oss.qualcomm.com; s=20250710; h=from:subject:message-id; bh=4fTpCSkuJ6PFbWarr8sThQ/LuS8y6G1v4667LcR6KHQ=; b=OK+6WeOtO64lo0FcZHTNlZGIoPXAR7yNvptpjLckifVArrp5hx2yljQM7GJx04qdJ9a+fg9n1 IBav0oSF1hCD7C0am0pWIpUA0S7pbcnv/yiFUJ/CrmRTv4cfbCR4OZq X-Developer-Key: i=shivendra.pratap@oss.qualcomm.com; a=ed25519; pk=ssWsJFX3OM9pkdoe4+guOfGPaulHOFt0GVnVlB6on+s= X-Proofpoint-ORIG-GUID: MJvJlgBMCFrfa7EPFtBry_IuoMIb7AAj X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTE0MDIxNSBTYWx0ZWRfX1gM58JHB1MhJ DIc1J6mSgfwSnszuy24KKBtyRtDUO16KYdPXKzKZ7eMDHuzpytBabPSAVxnkZ6ZM8mHnalCcY0Y ZGRWc61FcCyTWGVwF1Hva8oV6vtLLVNaIw491Ktru9nzXgN9Eqe/nTh9pHQHTBXrFqakxu+e8Zz 52NATnwxtWzsIT6DMgfINigbCNZZkPNJ17K7qsmmYTHkkS5zUEo11yDQCS+xQsasLuwWlyR3bTD 1vUbd+CheMbioWx7BZZ11pWvm5C6VwlywBxBtEkBj5qDjPY/qDbpl9OWiU61NI/68yGuuCEm37J OeCiBeSwGPC2t1LmGRhFgSMqFQLNf9/yahfp62sFClzkA4wNjUO2bJi7u+cK82IKmGP2Wyem6cZ Cp/xIyFGwgRPlNU5o/0yqBYZenPG87I2dU7wipr6uzlhCdi76WvxKQYkNwIzx+wUqI0Pb98Ydf+ qy3M5tueK5kqlAbGN4Q== X-Proofpoint-GUID: MJvJlgBMCFrfa7EPFtBry_IuoMIb7AAj X-Authority-Analysis: v=2.4 cv=M7TYuCws c=1 sm=1 tr=0 ts=6aa80c42 cx=c_pps a=MTSHoo12Qbhz2p7MsH1ifg==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=VdqzKS8jKosA: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=GvdueXVYPmCkWapjIL-Q:22 a=TjNXssC_j7lpFel5tvFf:22 X-Proofpoint-Spam-Info: AW1haW4tMjYwOTE0MDIxNSBTYWx0ZWRfX+UIPUIPG3k2V XiprEimES6bj+PHHTDX0djoTtNrhi9MzGkGVHVDwJbldOaFSn8TWPkKsxfUhr5OUFcQAA1C0jJ0 tj+cwnHcnc9dVmb4UIJMzVZfzfrb4o8= X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-14_03,2026-09-14_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 clxscore=1015 bulkscore=0 impostorscore=0 suspectscore=0 malwarescore=0 adultscore=0 lowpriorityscore=0 spamscore=0 priorityscore=1501 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609140215 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 531cf41b94dc..a2197dec430a 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