From patchwork Thu May 30 13:48:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haylen Chu X-Patchwork-Id: 13680451 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 16B40C27C43 for ; Thu, 30 May 2024 13:49:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Bf73x0qwxEDKacU2kAzAlvr3I+91/5UgGJ+Sh9qS9Nk=; b=T07XDLe0amzZ8Z Qq+cJLv4GW5csYLEASCkxrJP9XBf5GLl/duzxSqHIbVh/vj00tzGY2EJTTaiWRqFtY29yNenJIfC4 zt4bIPlw/niy4sWGgXAUG19JHx3z27zuLeD7HUDX5hxGiXPEmdf7jNfb6kLpW/ntKL5P5WJYb45fb hYu2xNcWhUUrqxvQkVAr5SeIECQ10qxuk2HnIv4w1zyubp9HnQdW4MENY5SBAn+RFmD5NlPo0LBlb 3xPQLPuaUJ8L4UXkB28fmO02h0zOPT/OBCUY4bt3quUNgMqHsvNtfZsLZ5+nHg1laUix4U5+Av/ET TSwRNITt0Brdv+JWZJuw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sCg9j-00000007Qba-3278; Thu, 30 May 2024 13:49:24 +0000 Received: from mail-sgaapc01olkn20817.outbound.protection.outlook.com ([2a01:111:f400:feab::817] helo=APC01-SG2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sCg9f-00000007QYF-1A2b for linux-riscv@lists.infradead.org; Thu, 30 May 2024 13:49:20 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EwGNxihuVk4M4+josK/ui3HYxzTY2B3nFrCrkUGSeqYjZkiw6INSwEychwSZTggf4jG7RP2JzoTt3nSCXAZlXmn7t8Ro5UTiFdiC5aN5dpWSnL0sjdIdJqjgaROxOu9ZmV/4emXaYi7VPTs7xeCYLsNQWV3y8/3IRSRrNCQiDDoKXUPdduySZjzSiN728rwn7JXnTni3dDkN8ZQvz/ntdkMogvoFBdfSxVt2ivdICv9QnZrtf6Jp63upEXSR/pPLRUN52koAYoE6YLEKS4KBIUBts4RZB/4cdk3Eheg4ii1GKx74eSyfkE5Jmj0NaLDp4s2nDz+6/WthMff8+mQ7GA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=GtGZvbT+opLTcEOyl33/qy+kzhnzNCZA6o30Kwn1ZU0=; b=bqCLsZQ78yXaA4OXgFXulGo8SDvwNKMAK72JwiE8ZiLXVhstm5oibeTYdPcV+oH49/63v7n3GeKrr2wkeCKFbziRrVXbwf4ywbvkW39FqvjYQW8ah/iQAE1SpttyfcFIUJojd4ihes7pToFCrExZ1nFFPG1f3NtlcZ85bi/Yu95ht10MLlcOeWGGWbUkTiCBO49ZWBLFtaIOrbqxgg+tdCDdT+NMZMxF6hfXAP+6ttz7hldE3P/dBDejX3Jb8YXLML73tWvtfbjiNV7dIgDfpSsxLDBc26Yp2XvYA8Mbk9wuDPuFiWFr3G3K4VFrQyIpfUzM0wbbQr0U/JfOfArjrQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GtGZvbT+opLTcEOyl33/qy+kzhnzNCZA6o30Kwn1ZU0=; b=QdoOIsERtH0Tas2HUeRc5d9Ye/ekdhfwir0enjsGtPbPgYjPPEUHVEOknowYKClpD41IrIO41AOx6xQG2Ybgq6LLRP0O2gVWQ24llNPUZbDyFm5ry3II67bfXWatgGGFn7gEKk3Yw5ENfCP1HBcrEEhUx7kClcXwJymKQg0nPgVDqBg2Rs/SFu0TNn/XVRx/D8Qqo2EMK/vFLNzRiwK4cO1/T1VYYBl7Zt/k9ls+x+7ndRpGFFq40JBSaieS2tbx/hjjPxIFKaQAt+9aMM1/r7WfJAePwu9oRnuJ/6vKSDKhoSxs2f60l/R5ouJmLkBYLw2jNGC0n3I8qbk7BcBg6Q== Received: from SEYPR01MB4221.apcprd01.prod.exchangelabs.com (2603:1096:101:56::12) by TYSPR01MB5657.apcprd01.prod.exchangelabs.com (2603:1096:400:42c::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.19; Thu, 30 May 2024 13:49:08 +0000 Received: from SEYPR01MB4221.apcprd01.prod.exchangelabs.com ([fe80::b674:8f70:6e29:3756]) by SEYPR01MB4221.apcprd01.prod.exchangelabs.com ([fe80::b674:8f70:6e29:3756%4]) with mapi id 15.20.7611.030; Thu, 30 May 2024 13:49:08 +0000 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 2/3] riscv: dts: sophgo: cv18xx: Add sensor device and thermal zone Date: Thu, 30 May 2024 13:48:26 +0000 Message-ID: X-Mailer: git-send-email 2.45.1 In-Reply-To: References: X-TMN: [cDqv6Z6241IZmUbL7wqkd8seSOTSEdn2] X-ClientProxiedBy: SG2P153CA0036.APCP153.PROD.OUTLOOK.COM (2603:1096:4:c7::23) To SEYPR01MB4221.apcprd01.prod.exchangelabs.com (2603:1096:101:56::12) X-Microsoft-Original-Message-ID: <20240530134827.53431-2-heylenay@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEYPR01MB4221:EE_|TYSPR01MB5657:EE_ X-MS-Office365-Filtering-Correlation-Id: cd5c6725-0690-4bef-c82c-08dc80af4735 X-Microsoft-Antispam: BCL:0;ARA:14566002|461199019|3430499023|440099019|3412199016|1710799017; X-Microsoft-Antispam-Message-Info: 4sDYTCID00s/eiq0M545+AAkXR+oaF3ejYE6OQJr4leSLkr9DHLriY9WF3LJJDKlWe8kxsHbDWk1cdD7eaCHoaIju2IUMvValEGJgBofzvXTe8Hs6YWmVG1cw2KQpgWEu6T2VAPaPxaLCc+Ev+20et/N64TU53g3YhDut4TFQHEOZF/iKV3jS2EfA3XI/5KixJ5wrSaJOkWpIOVXUpIJgdDuPzmp8LBl4VrEIWWF3vXMVkVJFok3+acUZWVM9PA21u7VEuJe8MAHhGIuIE+ZKl/0rkTDjksD8bOrDLm5tjh7WJl9m8UEeH6JnaVM3B5mOTH0qHTKWXkrl0Uo5/YIRudo6IVJmKBgjOAy4rmud+4/cbxHWs5ljFarTmGB96ec3w7/G2b0ooXtp4wLc4l+Py6DIGFNtZ341F/qV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FifeVSRVIwER6dHkQ1mw0nyMQeDl1zVN8O0ZRxqfia1Vg9oBjwfMK32F1NnBhA3620uckU7S230JbJH0BYG72tuQsJfKgG/M7/J8FA3LZRefX+UXSaRBjbewm2pYz37BU25prFPDYUsuvZNiVAg/1yBL6CwIX1PCLmAjf0jnUc3DY2Sw2MEFlf2bbiwZVG5os9SyHBKEFtXsF9FMK3RE+eTSShnGusNsuCMS8xvhoJLIrPYPZi5tBCzIC5ZF5RCp0/Ujlzt4IWGJps8elh10Jbef917fPUAlBztxeqPio3UB9XHg12xfsOMJ+Gq16euyHEKst6LJtaYKMok6mpAphpTS5fE7NRNizX39c6LIMUdbnCGEdZufRqkYpe2UULj854wtrw09knFGmAcNxBlKV8G9rPc1o2GkDvIsHHbQ2D3m4eThdhLBk7BznaInaepV2AY= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: cd5c6725-0690-4bef-c82c-08dc80af4735 X-MS-Exchange-CrossTenant-AuthSource: SEYPR01MB4221.apcprd01.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 May 2024 13:49:08.4807 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYSPR01MB5657 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240530_064919_339566_7D022789 X-CRM114-Status: UNSURE ( 8.23 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Add common sensor device and thermal zones for Sophgo CV18xx SoCs. Signed-off-by: Haylen Chu --- arch/riscv/boot/dts/sophgo/cv18xx.dtsi | 36 ++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/arch/riscv/boot/dts/sophgo/cv18xx.dtsi b/arch/riscv/boot/dts/sophgo/cv18xx.dtsi index 891932ae470f..dfb4bb6eb319 100644 --- a/arch/riscv/boot/dts/sophgo/cv18xx.dtsi +++ b/arch/riscv/boot/dts/sophgo/cv18xx.dtsi @@ -310,5 +310,41 @@ clint: timer@74000000 { reg = <0x74000000 0x10000>; interrupts-extended = <&cpu0_intc 3>, <&cpu0_intc 7>; }; + + soc_temp: thermal-sensor@30e0000 { + compatible = "sophgo,cv180x-thermal"; + reg = <0x30e0000 0x100>; + clocks = <&clk CLK_TEMPSEN>; + clock-names = "clk_tempsen"; + #thermal-sensor-cells = <0>; + }; + }; + + thermal-zones { + soc-thermal-0 { + polling-delay-passive = <1000>; + polling-delay = <1000>; + thermal-sensors = <&soc_temp>; + + trips { + soc_passive: soc-passive { + temperature = <75000>; + hysteresis = <5000>; + type = "passive"; + }; + + soc_hot: soc-hot { + temperature = <85000>; + hysteresis = <5000>; + type = "hot"; + }; + + soc_critical: soc-critical { + temperature = <100000>; + hysteresis = <0>; + type = "critical"; + }; + }; + }; }; };