From patchwork Sun Feb 11 10:53:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Skvortsov X-Patchwork-Id: 13552420 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 E8F78C4829B for ; Sun, 11 Feb 2024 10:53:59 +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: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:In-Reply-To:References: List-Owner; bh=0LCS3N8CIf3fEJlJxuKl6otjbs3hW4WXFg2+wzhlPfA=; b=G6DHvCx27Zd/YB TFRu577Lr6XXjTIHQEcMC8bI5jNhoFbkPVAinqqEmSjSkERvw+nyq3Kgciswqj5x771kC9m88V1DD WJHWXBu1VkCqQ2PNV/8ptjU0bO7pO6tZ9XMUWqtdLbR7Zhh91S0XxygYeGYXm+NNS9ua9wnBKYWSV vmx/lOC6KKczzK/tVAoo6A5CfeWyPjvmRFtK/IhuwypXJKkqPZ6Xz4jYwDknc+j/VrTcm4UNgdLRL 3sJJ+qos3HwCkGJojsl3MOVjUaTKGFkniX2KJFUrYsqkItGH88PWj38MuG6wsq9ewZ6IuDCBpXy5D kLVzL7gcaY2JLdeEX4GQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rZ7Sz-00000002db5-1lZK; Sun, 11 Feb 2024 10:53:45 +0000 Received: from mail-lj1-x22a.google.com ([2a00:1450:4864:20::22a]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rZ7Sx-00000002dak-0Q9o for linux-arm-kernel@lists.infradead.org; Sun, 11 Feb 2024 10:53:44 +0000 Received: by mail-lj1-x22a.google.com with SMTP id 38308e7fff4ca-2d0aabed735so30562751fa.0 for ; Sun, 11 Feb 2024 02:53:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707648820; x=1708253620; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=uO+FD++i6lu3R3UMtfKiyAbMLFBWQFc/P76C+86fYSw=; b=PTE+iLmfcDIGTalQ09sWqq8K6PwaUQTibRhXzEMZo9hKB8uPl2ccdOLLt6EpUsWjwa xboywH51Ofi3m2oJY/EnBeYlKkWvOnlkgwKbEwKJMY27pIDuIo5KW+sv86GWyhGOyGgD UjIGFWtmZkiWJyTFLReGa/AqHBJ7YTx361KX8kX0MQcrpsp4yDqB4sJuhwKoVwgZKQxP MxqOUYCQV5uMuJYS6n9p1uPKAFN03XvKprYMUtE20vITQqVNXLGDiTaHQufrLuQjh5Zb ugd3MwvS2ZzqL8JPzot3q8nYnOrVaLe3zA+uc1pLTPKAErTnJHSMTyTWYOAO8vaLJRnP Kx9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707648820; x=1708253620; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=uO+FD++i6lu3R3UMtfKiyAbMLFBWQFc/P76C+86fYSw=; b=sUlnZqJQViNjIx+xUkDrSp7e/0VTqGvcqMVR8lpDHwpHH9KFOejmiWN1kMwkRk9ePi bdv2DQvLS5H2eDq6PWjrKy3gHEfTJgBsPMOmBTAJserDAnNeU2r9ojsiJKTM5p1Cx0uO 8/gQq/BxJLvfsX+X8WqA7opjJoDdo8OucoEfApaK/bwiu3Kv8+KExgpaDfkpykBBpcz0 RNn8oFr9Cubj95s0YAbJ0ZtsS6/Yos7ttxThwui30dv7v2xG1jWPLatPeOeYgckUPQ1v NaMYAx5RqzkfTaQNsTh0S4fhVjC4XOQF9VjdQzcgHE2Mebe0t04/G288qX9ya48cZ/do VSng== X-Forwarded-Encrypted: i=1; AJvYcCXmRKR86MRBARIRqbs0YMe/g5IQMWXLm9eH20jQVmNcRblxvlmOgt7lwDgyQwSWWuhbXV/xmxzNXjNUTcxX+5c06zLTAnrvZo5bHIuZb8bpqvPqL+Y= X-Gm-Message-State: AOJu0YzSiOnXDs8xhtMmTE8XkNBBLkFt8RskG0hc3r2maDJCgVsE9fel 8ArvX6Qcvyza4xaZNd2UbxWxJrn/8bY4YRBtiqV9I4AblA6JrWTG X-Google-Smtp-Source: AGHT+IHfeJGfD6S5ADXFrljt6jbddz9qVjW3/0nsFBVwOu/NPnAfiZcxzuyjoHLont1QS/afVvVHYw== X-Received: by 2002:a2e:a0c5:0:b0:2d0:41d1:8124 with SMTP id f5-20020a2ea0c5000000b002d041d18124mr2687733ljm.1.1707648820227; Sun, 11 Feb 2024 02:53:40 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCXq0bUGyM2L2ZMhPe3QpzgYa2IAkwmyOEM121qoFdMoe+SQp89/Lo1WfqGa3sgNYrtjmEojn5mz2kpuhustodB5Gp3JOTfyUfGcemSebzkqRrsrzReLXngmSqImWSCUdcrPz/07+oV80iYqDNefI0e+zcVybbPZbySaATJnRYzx+rM5sIpXUZoCcks5pf8Rb+GjC2d8ooGmLJKNGsr+GPaP1VxQgrr3JOYPVa/Eu1lAAmzUgZRr9XtNzadND3dP5LW0jke9n0sxDBdslvXAz1mFEHuv33a5akuoYGsUrm/DKxPYQf8uCtbcjHS6H0yb0g2W3bkFwhO+Sft9I0NbhvDwdfBhJGdGWolmywbcSpGmxjOqxtf8akVzUX1c17J9X1gZUKmKMp7cUChndpLB7bp8ki78slLaIKa2++EOs7zSiPAcnzNjVm4xmwTBaD57deNaCh8YnOJznTwImzoD1QNFKN28/ZKTrAC9Duni6hL+VBG0L2lXZQ== Received: from localhost.localdomain ([2a05:3580:f312:6c01:1b8f:2a1b:d18:1951]) by smtp.gmail.com with ESMTPSA id y5-20020a2e95c5000000b002cd34872be7sm893799ljh.25.2024.02.11.02.53.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Feb 2024 02:53:39 -0800 (PST) From: Andrey Skvortsov To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, Arnaud Ferraris , Alexey Klimov Cc: Daniel Lezcano , Andrey Skvortsov Subject: [PATCH] arm64: dts: allwinner: a64: Add thermal trip points for GPU Date: Sun, 11 Feb 2024 13:53:26 +0300 Message-ID: <20240211105326.506049-1-andrej.skvortzov@gmail.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240211_025343_170813_9254A7C2 X-CRM114-Status: GOOD ( 14.52 ) X-BeenThere: linux-arm-kernel@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-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Alexey Klimov Without trip points for GPU, the following errors are printed in the dmesg log and the sun8i-thermal driver fails to load: thermal_sys: Failed to find 'trips' node thermal_sys: Failed to find trip points for thermal-sensor id=1 sun8i-thermal: probe of 1c25000.thermal-sensor failed with error -22 When thermal zones are defined, trip points definitions are mandatory. Trip values for the GPU are assumed to be the same values as the CPU ones. The available specs do not provide any hints about thermal regimes for the GPU and it seems GPU is implemented on the same die as the CPU. 'make dtbs_check' complains about problem in dts for 18 A64-based boards supported by the kernel: sun50i-a64-pine64.dtb: thermal-zones: gpu0-thermal: 'trips' is a required property from schema $id: http://devicetree.org/schemas/thermal/thermal-zones.yaml# sun50i-a64-pine64.dtb: thermal-zones: gpu1-thermal: 'trips' is a required property from schema $id: http://devicetree.org/schemas/thermal/thermal-zones.yaml# Tested on Pine a64+ and PinePhone 1.2. Cc: Samuel Holland Cc: Jernej Skrabec Cc: Chen-Yu Tsai Cc: Daniel Lezcano Cc: devicetree@vger.kernel.org Signed-off-by: Alexey Klimov Tested-by: Andrey Skvortsov --- arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi index 57ac18738c99..c25da7229e42 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi @@ -244,6 +244,29 @@ gpu0_thermal: gpu0-thermal { polling-delay-passive = <0>; polling-delay = <0>; thermal-sensors = <&ths 1>; + + trips { + gpu0_alert0: gpu0_alert0 { + /* milliCelsius */ + temperature = <75000>; + hysteresis = <2000>; + type = "passive"; + }; + + gpu0_alert1: gpu0_alert1 { + /* milliCelsius */ + temperature = <90000>; + hysteresis = <2000>; + type = "hot"; + }; + + gpu0_crit: gpu0_crit { + /* milliCelsius */ + temperature = <110000>; + hysteresis = <2000>; + type = "critical"; + }; + }; }; gpu1_thermal: gpu1-thermal { @@ -251,6 +274,29 @@ gpu1_thermal: gpu1-thermal { polling-delay-passive = <0>; polling-delay = <0>; thermal-sensors = <&ths 2>; + + trips { + gpu1_alert0: gpu1_alert0 { + /* milliCelsius */ + temperature = <75000>; + hysteresis = <2000>; + type = "passive"; + }; + + gpu1_alert1: gpu1_alert1 { + /* milliCelsius */ + temperature = <90000>; + hysteresis = <2000>; + type = "hot"; + }; + + gpu1_crit: gpu1_crit { + /* milliCelsius */ + temperature = <110000>; + hysteresis = <2000>; + type = "critical"; + }; + }; }; };