From nobody Wed Nov 27 07:51:12 2024 Received: from bayard.4d2.org (bayard.4d2.org [5.78.89.93]) (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 2697614AD24; Mon, 14 Oct 2024 07:38:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=5.78.89.93 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728891535; cv=none; b=k2xaDxd5znPzU42mHnM7coR4QkcD0D/8O7EQ38xhciVuqmVICZFU3Udmixo4vso67Coka8sloWpq4SnykJpUJtG1iieTs4ZwcCrCBCW9JS4muQLKyjVsqpJ8+27ISACppa6B+WzGZyV3TiVIblwGnrcka0jzr0yJyUjaCFI9Lws= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728891535; c=relaxed/simple; bh=DwDhlRnfpNqUwydKjC1DfKRcf6/WtjZO99jAwo/5zu0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=k4glcYkD25WhJ3aQB3pYDULzFH0rNPZxcb1BYuVGVGCAvKMrguX8fIsTbqD5KQ3Nd+U4BcrYR9HFL65Ax7kizjBWSmk9d6TRXue03tazqX59eS42LRakhhJxOSiyzXt8grjKKnQ5LuxCiOmccqHEM/0Q9LUDbQ2xq4e95vP5Fa0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=4d2.org; spf=pass smtp.mailfrom=4d2.org; dkim=pass (2048-bit key) header.d=4d2.org header.i=@4d2.org header.b=y1916qdS; dkim=pass (2048-bit key) header.d=4d2.org header.i=@4d2.org header.b=y1916qdS; arc=none smtp.client-ip=5.78.89.93 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=4d2.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=4d2.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=4d2.org header.i=@4d2.org header.b="y1916qdS"; dkim=pass (2048-bit key) header.d=4d2.org header.i=@4d2.org header.b="y1916qdS" Received: from bayard.4d2.org (bayard.4d2.org [127.0.0.1]) by bayard.4d2.org (Postfix) with ESMTP id D1357122FE1E; Mon, 14 Oct 2024 00:38:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=4d2.org; s=mail; t=1728891533; bh=DwDhlRnfpNqUwydKjC1DfKRcf6/WtjZO99jAwo/5zu0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=y1916qdSUQSOFUWoMsWsKiK+hPQ9abzy46MMb+1BK7HiIzjV+YkPmX0kMXsCMN4oZ nt55DEO0RHjD4Y5yzgnYGjj/1rgOBu1x2dgvVouuuPVYAJeVaNB9/16fxzCYq9DuKX tXumTql/PSWyIllPnLqHSDm3U+JdJ55N4mENBoYNFfswHEPmsw57vIDA+kz0vuwhG7 Mu+vVjVk+YIj+nddSMQHtKwNy4rKrgIeyp18Yd5AFea4mGmgTKRDxRrur/mbT73sDV KwftQJFPGnFE71ByhL6yc4+DnOaAVpTHUi00X6YPpUUEhcMOtp31BxULUMs76mnkDH ROQ3gXcYYLYQw== X-Virus-Scanned: amavisd-new at 4d2.org Authentication-Results: bayard.4d2.org (amavisd-new); dkim=pass (2048-bit key) header.d=4d2.org Received: from bayard.4d2.org ([127.0.0.1]) by bayard.4d2.org (bayard.4d2.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id bJZxxpwYIaA4; Mon, 14 Oct 2024 00:38:53 -0700 (PDT) Received: from localhost.localdomain (unknown [110.52.220.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) (Authenticated sender: heylenay@4d2.org) by bayard.4d2.org (Postfix) with ESMTPSA id 1679B122FE21; Mon, 14 Oct 2024 00:38:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=4d2.org; s=mail; t=1728891533; bh=DwDhlRnfpNqUwydKjC1DfKRcf6/WtjZO99jAwo/5zu0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=y1916qdSUQSOFUWoMsWsKiK+hPQ9abzy46MMb+1BK7HiIzjV+YkPmX0kMXsCMN4oZ nt55DEO0RHjD4Y5yzgnYGjj/1rgOBu1x2dgvVouuuPVYAJeVaNB9/16fxzCYq9DuKX tXumTql/PSWyIllPnLqHSDm3U+JdJ55N4mENBoYNFfswHEPmsw57vIDA+kz0vuwhG7 Mu+vVjVk+YIj+nddSMQHtKwNy4rKrgIeyp18Yd5AFea4mGmgTKRDxRrur/mbT73sDV KwftQJFPGnFE71ByhL6yc4+DnOaAVpTHUi00X6YPpUUEhcMOtp31BxULUMs76mnkDH ROQ3gXcYYLYQw== From: Haylen Chu To: "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chen Wang , Inochi Amaoto , Paul Walmsley , Palmer Dabbelt , Albert Ou , Jisheng Zhang Cc: linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, Haylen Chu Subject: [PATCH v5 3/3] riscv: dts: sophgo: cv18xx: Add sensor device and thermal zone Date: Mon, 14 Oct 2024 07:38:13 +0000 Message-ID: <20241014073813.23984-4-heylenay@4d2.org> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20241014073813.23984-1-heylenay@4d2.org> References: <20241014073813.23984-1-heylenay@4d2.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add common sensor device for Sophgo CV18xx SoCs and thermal zone for CV1800b SoC. Signed-off-by: Haylen Chu --- arch/riscv/boot/dts/sophgo/cv1800b.dtsi | 28 +++++++++++++++++++++++++ arch/riscv/boot/dts/sophgo/cv18xx.dtsi | 8 +++++++ 2 files changed, 36 insertions(+) diff --git a/arch/riscv/boot/dts/sophgo/cv1800b.dtsi b/arch/riscv/boot/dts/= sophgo/cv1800b.dtsi index ec9530972ae2..af53c9ec3197 100644 --- a/arch/riscv/boot/dts/sophgo/cv1800b.dtsi +++ b/arch/riscv/boot/dts/sophgo/cv1800b.dtsi @@ -12,6 +12,34 @@ memory@80000000 { device_type =3D "memory"; reg =3D <0x80000000 0x4000000>; }; + + thermal-zones { + soc-thermal { + polling-delay-passive =3D <1000>; + polling-delay =3D <1000>; + thermal-sensors =3D <&soc_temp>; + + trips { + soc_passive: soc-passive { + temperature =3D <75000>; + hysteresis =3D <5000>; + type =3D "passive"; + }; + + soc_hot: soc-hot { + temperature =3D <85000>; + hysteresis =3D <5000>; + type =3D "hot"; + }; + + soc_critical: soc-critical { + temperature =3D <100000>; + hysteresis =3D <0>; + type =3D "critical"; + }; + }; + }; + }; }; =20 &plic { diff --git a/arch/riscv/boot/dts/sophgo/cv18xx.dtsi b/arch/riscv/boot/dts/s= ophgo/cv18xx.dtsi index b724fb6d9689..0465561f7043 100644 --- a/arch/riscv/boot/dts/sophgo/cv18xx.dtsi +++ b/arch/riscv/boot/dts/sophgo/cv18xx.dtsi @@ -133,6 +133,14 @@ portd: gpio-controller@0 { }; }; =20 + soc_temp: thermal-sensor@30e0000 { + compatible =3D "sophgo,cv1800-thermal"; + reg =3D <0x30e0000 0x100>; + clocks =3D <&clk CLK_TEMPSEN>; + interrupts =3D <16 IRQ_TYPE_LEVEL_HIGH>; + #thermal-sensor-cells =3D <0>; + }; + i2c0: i2c@4000000 { compatible =3D "snps,designware-i2c"; reg =3D <0x04000000 0x10000>; --=20 2.46.2