From nobody Thu Apr 16 10:55:01 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 8A19C3B27EE for ; Wed, 8 Apr 2026 09:24:50 +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=1775640293; cv=none; b=G32f/izR7TBS11dRcGalPyBJu0FZlsjvx+3QJ/KJQG0qfP88iXwh2XsIndYjveiYv3q1sCvMEXsB6Mx2FxcYNh56CqheGKTOl9uddr8aNZmmfxf5hVBiwtpEtowcj+q4o7IC0pxoXkO4NiPnw2nihlo7hHiE6ZkgRO6L2ZhzjzE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775640293; c=relaxed/simple; bh=ysF7lMnW62Dw8GqPrgjEmc8c/jln9FFb0gpHqDZSArQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=WVEH0ShbVVaHVdJvk5+MtM6zNkQfAizES1GOXGFdLsI+4cQUaEvEUIQj1A2tZoJeVFV4tPjx7NkJ/98caB+emFVN2xWDyG4stHswPxHa7plGGGIxTa1+4jAEIZVivolXoKtkIZ6Vi/KJYL9PE1jx6fW0JwjZPim+t4yZwPBpvMU= 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=BtjbBiCQ; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=IEu/r/is; 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="BtjbBiCQ"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="IEu/r/is" Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6385YLYH1006173 for ; Wed, 8 Apr 2026 09:24:49 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= SOIlc/PtWR6rFkaZhdIsYBBjFwDm/X+YdDt7YDt1vJg=; b=BtjbBiCQLnliM9XW GVMMHfe02jgneaOhyQVHj8UkN1zqtL0VX9gPFsouFy2zNlqWbnOhyL2TjFSLcZ2A teqYSRJ6LeiuI81EAu11HU76hRxvD6h7K5tf5SFb7IdhHEnf56WFo6HAFInIvGJx TR55KYgzc+PjlquqOcOjptUeP4PRz2xl4mnCrf7wZRk3DgfoVR2MlbN9UuFXAGFY /JXdsjDyK/LILHwY0Mcf4uEroMUBEFinANqXcJ9xAA05hrLBLsuxr3iC1Re0jykP dntA0+7KBNwex4IKfua+YNSRo2EWWlMFcS3lMNM88PXB+hsFwSeFUKtBzFoHZeed Ax/fAA== Received: from mail-pg1-f199.google.com (mail-pg1-f199.google.com [209.85.215.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4dd7tpajcn-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 08 Apr 2026 09:24:49 +0000 (GMT) Received: by mail-pg1-f199.google.com with SMTP id 41be03b00d2f7-bce224720d8so2949982a12.1 for ; Wed, 08 Apr 2026 02:24:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1775640289; x=1776245089; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=SOIlc/PtWR6rFkaZhdIsYBBjFwDm/X+YdDt7YDt1vJg=; b=IEu/r/is+5FMGR5YtTdZI1lA7Bo/77UVrOdwh99X+takwkAMa1CHgS2aDawd1TmrLL djtAvWSA1zuPKASZXvSZMbaK5GRuXkUhWRWvLEtUvwG8U1zFvYYzi2q+zsYr1sw2lOCY pg1zD5ucjMCM3VCCPOjqmDCYZa9tIn2NWVc8PfbT8HO6QHg6AJDRiJEuGc6Y3p49F94h H2WjYzL56/FaveGI2I5DgtIW2b5kvp6tXUeE81eukXibFhkUvPiFdgmYrLq5LM//EfGT t60CeKLdbnmm+Jnxe0jqDG7pA/IHo2FqcBkAHS18bMvSNfKRRqQxFHZQVIMPgWdOD7G4 d2iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775640289; x=1776245089; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=SOIlc/PtWR6rFkaZhdIsYBBjFwDm/X+YdDt7YDt1vJg=; b=pDKpnUblpD3E2oAk0FIag+3xZ2KZnTNXP+b184pikyPKZ2ysGxZSI2XQ5Bc0h6eqO/ EiJPrB/DFkn7IXFVioxCIxo9llhI90bcWoGiFbWscsA8swF7QKh7RVna4WT08kl7Tinj tUjqLtSTEnFjBu7li4tNdjOpsITyjmpK/zsTo+ks2n3QexgSrd0uUrHTr3ey16Ej9mUL 8c7BFibkTGzOIKYQ7r5XyiU3JWaBVv4zKU1wKhFEGxZOQb/bt/oJSwpoGENJHM0389Kt RNeI6fi6Mocdn/SScKaYwpQmAIUAyaDbLNPweTql/2JTgmCexx7geRgyV+GnqcoPjMvy tndw== X-Forwarded-Encrypted: i=1; AJvYcCWFHzuraBs3bNHUj/xJasHKuy6nwRlL/nHozYN2psc8yzmIbfe2snUdGGEkOFF21q1MCtFJHeoM37FTuAc=@vger.kernel.org X-Gm-Message-State: AOJu0YyWaN30O4yoSg2CFm4VYgpCr/MGb/fyML0dDaz4dEk/P9st5JZs V96TdpCceP0J6JBb2qEmyJMeR5+Rh6T8pOZWpUz1OaRo/Gx2+aEnB1cL43FTV/t26qwnFR8XW1J LfzRRbU5Upno9GGuseB4RE4Nir+DF8M9mnfIrgqnipQ3Qqr1AmhkNmkZmuWfg7lpIkRg= X-Gm-Gg: AeBDies025F9Uf6lMpmf+awR+hq3236CAN0Z3YVQu7ojDMc0Ag6I953bLIgkw4T0NZH eiU4qC8pqKJpcz4P54cEJDCkvOWU2uAHC5O5cwt8qOVNRgNQk6LjNYYJ4DeKI74rF6j5CvrAnA1 fzWzLBR+6hDHiRoj6AKww4B//WN0znGqJFXJszCeP30V/Kxrj01KdrP1uOujNMoBvvxod1Go7MC AX721BUdLO3UdKEKK8/A/wlw/OHn+0LRaFTJio0w0LAeA7s2W38N01PzYcR1wMjtfzW7fbxw7QS /NCzBnWzpwVVwixS+OhcP74TTuz3VsauXZoliHb3pZJtEEVWhxcFoXeA4MWt96LMJy3altLhdGI iP2+TxwfkofoxQrPB+kX77DAl/ztijJ9ApXGG0A4bv/yDvdj3cG2iAGN0Kvx1FzgxBsQcBF0OzL X62fZWM7jcveINXGvNQYD1iO+6h4Rf0MfatyO3G4uLM4Q81OVpbp2kenNc X-Received: by 2002:a05:6a20:7346:b0:398:aaac:a079 with SMTP id adf61e73a8af0-39f2f215352mr20749069637.45.1775640288860; Wed, 08 Apr 2026 02:24:48 -0700 (PDT) X-Received: by 2002:a05:6a20:7346:b0:398:aaac:a079 with SMTP id adf61e73a8af0-39f2f215352mr20749042637.45.1775640288393; Wed, 08 Apr 2026 02:24:48 -0700 (PDT) Received: from hu-kathirav-blr.qualcomm.com (blr-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com. [103.229.18.19]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-c76c65a3f08sm18274413a12.31.2026.04.08.02.24.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Apr 2026 02:24:48 -0700 (PDT) From: Kathiravan Thirumoorthy Date: Wed, 08 Apr 2026 14:54:37 +0530 Subject: [PATCH v10 1/2] dt-bindings: watchdog: qcom-wdt: Document sram property 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: <20260408-wdt_reset_reason-v10-1-caf66786329f@oss.qualcomm.com> References: <20260408-wdt_reset_reason-v10-0-caf66786329f@oss.qualcomm.com> In-Reply-To: <20260408-wdt_reset_reason-v10-0-caf66786329f@oss.qualcomm.com> To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Konrad Dybcio , Wim Van Sebroeck , Guenter Roeck , Rajendra Nayak Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-watchdog@vger.kernel.org, Kathiravan Thirumoorthy X-Mailer: b4 0.15.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1775640279; l=1576; i=kathiravan.thirumoorthy@oss.qualcomm.com; s=20230906; h=from:subject:message-id; bh=ysF7lMnW62Dw8GqPrgjEmc8c/jln9FFb0gpHqDZSArQ=; b=bBzR0mJkOQv8UsfpR8e2VEDPLF/CyO69j4fLRNMOihyoxdjx2WE3VTh2pEA/ACC9uUikNZ9oh tzPFp1lh7IdDdLADvjzls6r/CyD+Z2j6Dj4cIUkuWHL5SkUtzLTjaK0 X-Developer-Key: i=kathiravan.thirumoorthy@oss.qualcomm.com; a=ed25519; pk=xWsR7pL6ch+vdZ9MoFGEaP61JUaRf0XaZYWztbQsIiM= X-Proofpoint-GUID: qmkxZUINenIzmBycI7g45UYzBcyafd9U X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNDA4MDA4NSBTYWx0ZWRfXyDWhZhWa5AyH DsOLuPe+HZKH9GnWMSQTHUq5rXZUEx36gWRXPAMFyWLmJajCbJzmoMa9L7mbuGTiHjpzLJE5ZiM hgydDc8Y78KwdQ/Tx7SPnKfu+HzGgTV29nFwK9OHUTET9qmv8383enyrwLzgD0y1RDoWNyAAslA B/wQf2IRlpdbEXg74vL0IMUpnGBPMD1DHVrXofJJ4AGO6VYjyLlJzY1OwFrPx22eW4h4fz7k/gT 3B6gtx+QJRfvsfQV9ge/TVa462ojrmpO09+IWkUJiw4sM+Ol/MPAomgK+XfgjsGeV4aCJsWgfkQ iANvStRWul8+abRAcsYbarFpteXm4idDr4Rr0ZXn9nRvsM4ETWdvXqpf1HrSDLNzYVMf308NPq6 K0znelid54jqxCLrkpqocNmjC2oLkYRUf5bkIlJwRIg6S4AsxO+LgLi6R+K4vEYcE1SZLiJ/ekF 8TbWNM4YK+86PvTQxxQ== X-Proofpoint-ORIG-GUID: qmkxZUINenIzmBycI7g45UYzBcyafd9U X-Authority-Analysis: v=2.4 cv=DNS/JSNb c=1 sm=1 tr=0 ts=69d61ee1 cx=c_pps a=Oh5Dbbf/trHjhBongsHeRQ==:117 a=Ou0eQOY4+eZoSc0qltEV5Q==:17 a=IkcTkHD0fZMA:10 a=A5OVakUREuEA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=Um2Pa8k9VHT-vaBCBUpS:22 a=VwQbUJbxAAAA:8 a=EUspDBNiAAAA:8 a=RpRSbNz5O0cLrIcFx98A:9 a=QEXdDO2ut3YA:10 a=_Vgx9l1VpLgwpw_dHYaR:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-04-08_03,2026-04-08_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 spamscore=0 lowpriorityscore=0 adultscore=0 priorityscore=1501 impostorscore=0 clxscore=1015 bulkscore=0 phishscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604010000 definitions=main-2604080085 Document the "sram" property for the watchdog device on Qualcomm IPQ platforms. Use this property to extract the restart reason from IMEM, which is updated by XBL. Populate the watchdog's bootstatus sysFS entry with this information, when the system reboots due to a watchdog timeout. Describe this property for the IPQ5424 watchdog device and extend support to other targets subsequently. Reviewed-by: Rob Herring (Arm) Signed-off-by: Kathiravan Thirumoorthy --- Changes in v10: - no changes Changes in v9: - no changes Changes in v8: - no changes Changes in v7: - Picked up the R-b tag Changes in v6: - Update the 'sram' property to point to the SRAM region Changes in v5: - Rename the property 'qcom,imem' to 'sram' Changes in v4: - New patch --- Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml b/Doc= umentation/devicetree/bindings/watchdog/qcom-wdt.yaml index 9f861045b71e..3ead00da3cd6 100644 --- a/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml +++ b/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml @@ -84,6 +84,12 @@ properties: minItems: 1 maxItems: 5 =20 + sram: + maxItems: 1 + description: + A reference to an region residing in IMEM(on-chip SRAM), which conta= ins + the system restart reason value populated by the bootloader. + required: - compatible - reg --=20 2.34.1 From nobody Thu Apr 16 10:55:01 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 197EC3B27CD for ; Wed, 8 Apr 2026 09:24:54 +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=1775640296; cv=none; b=WGXLxLJscsAKiSmAGkBB4UxLIqKBS58NMFljH2OPNJa9H9j+33F3M8Xl0AoPEs41bv40ytZjv2evyLw0PfrPXeuAdxCudXmySTQOlbWAR03dW8ZKXpFJH1xRXdfC3QD8FNZoI31mgPyw55O25eudQ7wtqL603nCnJHpfPrnwCfQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775640296; c=relaxed/simple; bh=CyI3VfpN7ZvgkmfHWVT3f4/oL+YMTP8zz6uM1V5D2I0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=b3MF3uDsjQ9mzyO82SM+kLAQlke7lEnxd2kG/cOW+4yRGqzRlGFV+t5jArzbv5YOhmbi8eovx/A0z9iK8bHjg/jO6YDji6z3J6Z29wFY1NsJajOet72Iljt6Ga6isnWtfyLgPL2N2tnVtkc7qfR5watiQYG935ABQcp2MdR7Spc= 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=ckYXAHeX; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=jnZcUu3d; 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="ckYXAHeX"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="jnZcUu3d" 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 6386KYJM250154 for ; Wed, 8 Apr 2026 09:24:54 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= sDvhAf2B9DrbLm4bHF1kl57Fvn2pa47nhjegElwkOHo=; b=ckYXAHeX2DZAVL0h T1oL24KRmw433Q2fXGuZzfpimH/Op1Q7IDiKVUyjumU5Y/E6bR4VkMMycXfJPKmE 5Vl8Q9Kwt93tvKNyorZexvZMtxICZh/EZ4l1ec/4I8eJLGRBFnVhLhxSjf0TZ1Xl mMgOXBY2Dd1u8gaQPQ9p8NfDfvp5VUiyQM1vsKGTl92S5HZoNSJxbwUa8dy4Zti3 XRtrsdWCHWxP+qsC7iLoWJC7FlxEYgklG/eHGmQxMtmsj7xxGUuwdLfWxSQ0Tur5 /noXrfEI5Eievoa0pHBjUyV0N1wF4mpntXnqQ1kfxPM4JCJl585h5rqLnlo2ME/8 q4/MGg== Received: from mail-pg1-f198.google.com (mail-pg1-f198.google.com [209.85.215.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4dd8x9abqc-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 08 Apr 2026 09:24:54 +0000 (GMT) Received: by mail-pg1-f198.google.com with SMTP id 41be03b00d2f7-c741b950511so3363631a12.0 for ; Wed, 08 Apr 2026 02:24:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1775640293; x=1776245093; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=sDvhAf2B9DrbLm4bHF1kl57Fvn2pa47nhjegElwkOHo=; b=jnZcUu3dCLN08uKd2F5HpVj6ibdNjFLMFPxBdRYqAx7SwjjeJuIwK54R0Ej1Y3fOMS VTKWnsC0XxNd3/yskX0VPMv3xopWyDZEu9NuHvGySzKSNh7XAqJ8/Oiyhnq+QYv+EYf5 ITp6Qur5HDuYgnx0VzQPx9yq8uFsxy8tRBlx0/uTXciCszM1+7TkIPj4y70IwCjrSl2t osCLq6srSmhlkoq3TimAojs/iQhSWJH0wwZDeCiTsDooZkuyCKXjNKa9GnQ62QJSOZEK UwAQ2S+oPJUgDO6K+FsAhJgUQgg0ULo7drhhyJ1MLBCAjI8dMSbJyZjWusrncV3NaKfU DZzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775640293; x=1776245093; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=sDvhAf2B9DrbLm4bHF1kl57Fvn2pa47nhjegElwkOHo=; b=S9g26EnRUSsMKBlix8zOd3iejC9dPEgAhJfjRorSg+9gFd6+mIWvHtyeW6k2WWWpXU +L/p6ZV2/UXL3yR2XAMyxT3yUFFCmJtDoSwzWj485RgBKPG1J2ggISqTjy0q8m9/i92w v7p7YdOO4oS4EbtMY5+eY1O+LslhB5RB5GA6JeRbGSA52EMYpgH3fe/gGRQIsSvybrTv eF/ECH3W6h+Al11riB7QKaH3cDHuLJRMrWrSSuhwBRj01JSZGGGhzqLgSI9priOqDUJS iKPmYGK1kMUYSlLt9AniiJ1u4COHuEZY3MESj/+iSdTJBRITuAGA+9Wrly6A4qZElndC /X9A== X-Forwarded-Encrypted: i=1; AJvYcCXL7hq1S3zzCcoxLCsEeaSyPhYhyjCKI+HTRsdsJ7c4kbKJ14dyIJXn+9ruZq/kMp2oSQd6wRku6u1nL1E=@vger.kernel.org X-Gm-Message-State: AOJu0YwAu5m4x33aWkm2bT0XrtMuTfcg1jU5u37eNc8EaKj9zr1BQRxd JZ27BHgAleZo3qdG70Rew7+P1kxab+Sgk3LMaVhZCj9GzNaEL9tfmR5f9Umm+3aWSh7l3chVy/c 4GVtpZuo2fAOUqMDN3XVsBwKkbQpDdTbrqNK9IjyesHL3uGbfScp0DtAnDYOQW/a0Ilw= X-Gm-Gg: AeBDietl8TdF+q2ux/T3/rRDwlUEqlLN9ImR+wL6YzCkIA5PjdseFjf/ithViIJKehT YRzHAASj6vcYZ1ln9IJMlKJPZgkyIBCven7Wt/8g/mUvIRt7Q3eYh8TpaCPVsljPYmIwccHDdpc 529EFLX0W8evktyDY9NtzQMVinSGc1Nt68wUam/6tUhmYH4f0JCY/UJiaDEJ1f/I6R+8PhU4HKp GAOZ7Lz4tp8IPHS2BjXWckgqVxYwVRCuceU8yF//YjFa0TmyPikNGNKTZS8BR0tj3tKYLbPxcHG HssDfFcbyD+mO1tVqXImKEWaq3nnYv1bw7IrxL7BGBxu9oFkfwiBFzHY3NNHI/HMlBjnRV2X6sn MevvQlapXJZJLQ15OX3xmWlH6KCHax0NjZv6mja8mNaSawvJrnfP7TP55iNfCIQCEci8Ds9roqy pMdHsLidmMoH/lJieB2BrwBqUIVRU4NUCOIk+8u+1VZM/VUsT/MwGWYzqE X-Received: by 2002:a05:6a20:7346:b0:39f:24ad:ad11 with SMTP id adf61e73a8af0-39f2f046df4mr20634360637.9.1775640293505; Wed, 08 Apr 2026 02:24:53 -0700 (PDT) X-Received: by 2002:a05:6a20:7346:b0:39f:24ad:ad11 with SMTP id adf61e73a8af0-39f2f046df4mr20634329637.9.1775640293018; Wed, 08 Apr 2026 02:24:53 -0700 (PDT) Received: from hu-kathirav-blr.qualcomm.com (blr-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com. [103.229.18.19]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-c76c65a3f08sm18274413a12.31.2026.04.08.02.24.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Apr 2026 02:24:52 -0700 (PDT) From: Kathiravan Thirumoorthy Date: Wed, 08 Apr 2026 14:54:38 +0530 Subject: [PATCH v10 2/2] watchdog: qcom: add support to get the bootstatus from IMEM 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: <20260408-wdt_reset_reason-v10-2-caf66786329f@oss.qualcomm.com> References: <20260408-wdt_reset_reason-v10-0-caf66786329f@oss.qualcomm.com> In-Reply-To: <20260408-wdt_reset_reason-v10-0-caf66786329f@oss.qualcomm.com> To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Konrad Dybcio , Wim Van Sebroeck , Guenter Roeck , Rajendra Nayak Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-watchdog@vger.kernel.org, Kathiravan Thirumoorthy , Konrad Dybcio X-Mailer: b4 0.15.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1775640279; l=4422; i=kathiravan.thirumoorthy@oss.qualcomm.com; s=20230906; h=from:subject:message-id; bh=CyI3VfpN7ZvgkmfHWVT3f4/oL+YMTP8zz6uM1V5D2I0=; b=dQg7F/41tHFheDpFaSfZTB3oEOJJt/EN7mICP0FotiZPPuCTe0ltklrG6bCQqTlQ/VDk/lNWg e3JDu6gdXkcBjCYOs/q4jEzgI6kSgNusosSqdN3pG7KkyixcwZePuvK X-Developer-Key: i=kathiravan.thirumoorthy@oss.qualcomm.com; a=ed25519; pk=xWsR7pL6ch+vdZ9MoFGEaP61JUaRf0XaZYWztbQsIiM= X-Authority-Analysis: v=2.4 cv=Rr716imK c=1 sm=1 tr=0 ts=69d61ee6 cx=c_pps a=Qgeoaf8Lrialg5Z894R3/Q==:117 a=Ou0eQOY4+eZoSc0qltEV5Q==:17 a=IkcTkHD0fZMA:10 a=A5OVakUREuEA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=eoimf2acIAo5FJnRuUoq:22 a=EUspDBNiAAAA:8 a=qKWHfwwlgvfnR6H4MV8A:9 a=QEXdDO2ut3YA:10 a=x9snwWr2DeNwDh03kgHS:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNDA4MDA4NSBTYWx0ZWRfX4IVpp/9dVamX 45l87zFZAGrhIT9S5BazGrZEhHVoii4BhDr+n8DbQ9NzKkW2gp4luA74CYAYNU4WCoElWJ+MUMO 46nYb/w4YSZdcR82F0Au06tB3svccYaD2HHD/VdEN0FldVfJNCnyAHru2hMa8QRBhM/V0tTW/Ts A8kPR3EOY7pXmQQYso+fUN9w32f1AxKKIYy1zG6PV7k6tfHKvvI0K7xlR18btwtjxb5GgvdYAQq JdlFpvFzbNuztvNgsRKi/t8N8p8K5ujWTewi6WLAC14djDbRA66juA3wMY6u3ltNHS89LOjBqb2 mJmKjgm+qgDcJZbWZ1NIFB6iUqSM0ijQ5G2BK1wdwPwjezrb/+zNkWWQUDdNYjlIUz69eE3uLqK 6bZy+QIla+zVFYE7ISqQVIQhX3Es6DL6RFSYd9bbabbI2nUEWTqYcUavKmuVzb4v+U2GhQ6CrSU LvSZCkh3x46xb57zbZw== X-Proofpoint-ORIG-GUID: V5aSo9t6JkkRbI7ygaFbuSwLdXFdLGbY X-Proofpoint-GUID: V5aSo9t6JkkRbI7ygaFbuSwLdXFdLGbY X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-04-08_03,2026-04-08_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 priorityscore=1501 suspectscore=0 malwarescore=0 clxscore=1015 bulkscore=0 phishscore=0 adultscore=0 spamscore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604010000 definitions=main-2604080085 When the system boots up after a watchdog reset, the EXPIRED_STATUS bit in the WDT_STS register is cleared. To identify if the system was restarted due to WDT expiry, XBL update the information in the IMEM region. Update the driver to read the restart reason from IMEM and populate the bootstatus accordingly. With the CONFIG_WATCHDOG_SYSFS enabled, user can extract the information as below: cat /sys/devices/platform/soc@0/f410000.watchdog/watchdog/watchdog0/bootsta= tus 32 For backward compatibility, keep the EXPIRED_STATUS bit check. Add a new function qcom_wdt_get_bootstatus() to read the restart reason from IMEM. Reviewed-by: Konrad Dybcio Signed-off-by: Kathiravan Thirumoorthy --- Changes in v10: - no changes Changes in v9: - Log the error message and continue with probe instead of returning from the probe Changes in v8: - Picked up the R-b tag - Updated the comment as suggested by Konrad Changes in v7: - no changes Changes in v6: - Reworked to get the restart reason code from SRAM region Changes in v5: - Use dev_err_probe instead of dev_err Changes in v4: - Kept only WDIOF_CARDRESET and dropped other codes - Renamed qcom_wdt_get_reason_reason() to qcom_wdt_get_bootstatus() - Moved the existing check inside qcom_wdt_get_bootstatus() - Dropped the device data and put all the details in the DT node Changes in v3: - Split the introduction of device data into separate patch - s/bootloaders/XBL - for clarity of which bootloader is involved - Mention the sysfs path on to extract this information - s/compatible/imem_compatible in the device data structure to avoid the confusion / better naming Changes in v2: - Use the syscon API to access the IMEM region - Handle the error cases returned by qcom_wdt_get_restart_reason - Define device specific data to retrieve the IMEM compatible, offset and the value for non secure WDT, which allows to extend the support for other SoCs --- drivers/watchdog/qcom-wdt.c | 42 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 40 insertions(+), 2 deletions(-) diff --git a/drivers/watchdog/qcom-wdt.c b/drivers/watchdog/qcom-wdt.c index dfaac5995c84..49bd04841f0c 100644 --- a/drivers/watchdog/qcom-wdt.c +++ b/drivers/watchdog/qcom-wdt.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include =20 @@ -42,6 +43,7 @@ struct qcom_wdt_match_data { const u32 *offset; bool pretimeout; u32 max_tick_count; + u32 wdt_reason_val; }; =20 struct qcom_wdt { @@ -185,6 +187,7 @@ static const struct qcom_wdt_match_data match_data_ipq5= 424 =3D { .offset =3D reg_offset_data_kpss, .pretimeout =3D true, .max_tick_count =3D 0xFFFFFU, + .wdt_reason_val =3D 5, }; =20 static const struct qcom_wdt_match_data match_data_kpss =3D { @@ -193,6 +196,40 @@ static const struct qcom_wdt_match_data match_data_kps= s =3D { .max_tick_count =3D 0xFFFFFU, }; =20 +static int qcom_wdt_get_bootstatus(struct device *dev, struct qcom_wdt *wd= t, + u32 val) +{ + struct device_node *imem; + struct resource res; + void __iomem *addr; + int ret; + + imem =3D of_parse_phandle(dev->of_node, "sram", 0); + if (!imem) { + /* Read the EXPIRED_STATUS bit as a fallback */ + if (readl(wdt_addr(wdt, WDT_STS)) & 1) + wdt->wdd.bootstatus =3D WDIOF_CARDRESET; + + return 0; + } + + ret =3D of_address_to_resource(imem, 0, &res); + of_node_put(imem); + if (ret) + return ret; + + addr =3D ioremap(res.start, resource_size(&res)); + if (!addr) + return -ENOMEM; + + if (readl(addr) =3D=3D val) + wdt->wdd.bootstatus =3D WDIOF_CARDRESET; + + iounmap(addr); + + return 0; +} + static int qcom_wdt_probe(struct platform_device *pdev) { struct device *dev =3D &pdev->dev; @@ -273,8 +310,9 @@ static int qcom_wdt_probe(struct platform_device *pdev) wdt->wdd.parent =3D dev; wdt->layout =3D data->offset; =20 - if (readl(wdt_addr(wdt, WDT_STS)) & 1) - wdt->wdd.bootstatus =3D WDIOF_CARDRESET; + ret =3D qcom_wdt_get_bootstatus(dev, wdt, data->wdt_reason_val); + if (ret) + dev_err(dev, "failed to get the bootstatus, %d\n", ret); =20 /* * If 'timeout-sec' unspecified in devicetree, assume a 30 second --=20 2.34.1