Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp2125220pxu; Fri, 9 Oct 2020 08:32:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxsYyDGgXbSg9VlVrLTEzuJoGgLSKcGqHJHQ8LxLFRCrwxPx7Ujw9IN27muOKfQ0WK3Yc1n X-Received: by 2002:a05:6402:2076:: with SMTP id bd22mr15526461edb.197.1602257578233; Fri, 09 Oct 2020 08:32:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602257578; cv=none; d=google.com; s=arc-20160816; b=lpgGDHaYBeVL01Sy3gWWBnu7Xmf/AylyJ6mm+Ixsdy03Pq1KoVySwOP/u41/j2GfSu Z+8gv1rlbPnNxMnx39u4OpbqLYc8nfY05QMZUiPaj6aGteHXN/JP2Xt9RKc2RZOkrodW yESh5kj80aN6zrFtYL2ltUFyobZAfgejrGM0gaulvDoYu/kETEONMXvPQn4Htg9nh5hO a8fCbKeBrZA2vXnWLfIU43fIk8fjy/jVqDB80snwYEV0cbvVKzvefZpu0RO6IxPziYWN pEUezGgzHsLoDFXmnaZxKD1k3kGAkrzcFWQ46xtsWu0fH9cNyT2rV9HrM248J84WqJcl GjUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=QfdMvUzumnQF1EpUTl5RE4T046ItchdFfqq6nLYhMIc=; b=jRwGxMqCdwx4gEKJxnWY3FoIbI6oEqM67uHJix9t5NHeSb/5a3QbyjIGcWM/OUb4hd bUmdEOoJse1jf9sSftzvDa8b39HNd4FAX9Kl84t6oZupDpJtpHrN+eVqPNK/5FSEa3V8 slUp9+r0SlKKwpigtS5La+u1YPNlNghn3Hp5uEcKpRMbYthi8YUET8SBznCfqmZQMrPU PzKRKFSHkyPBLwI7BtJSB3+gMYgrdN1PhfhFaL4t/WUwrj+t4WIEu0RKHbtsYgvcb0DG C498Ww3gKHff2vljXixsRYnxZ8J1omShVXu394LX1Qy/VE8vhKWIKDp7fXaQ1avkjZhL 7GBw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b11si5785368eju.453.2020.10.09.08.32.34; Fri, 09 Oct 2020 08:32:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389294AbgJIPaw (ORCPT + 99 others); Fri, 9 Oct 2020 11:30:52 -0400 Received: from mx2.suse.de ([195.135.220.15]:34442 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388473AbgJIPau (ORCPT ); Fri, 9 Oct 2020 11:30:50 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id E6A0DAF2B; Fri, 9 Oct 2020 15:30:48 +0000 (UTC) From: Nicolas Saenz Julienne To: f.fainelli@gmail.com, linux@roeck-us.net, jdelvare@suse.com, wahrenst@gmx.net, =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= , Eric Anholt , bcm-kernel-feedback-list@broadcom.com, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-pwm@vger.kernel.org, Rob Herring , Nicolas Saenz Julienne Cc: linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/3] DO NOT MERGE: ARM: dts: Add RPi's official PoE hat support Date: Fri, 9 Oct 2020 17:30:29 +0200 Message-Id: <20201009153031.986-3-nsaenzjulienne@suse.de> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201009153031.986-1-nsaenzjulienne@suse.de> References: <20201009153031.986-1-nsaenzjulienne@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is an example on how to enable the fan on top of RPi's official PoE hat. Signed-off-by: Nicolas Saenz Julienne --- arch/arm/boot/dts/bcm2711-rpi-4-b.dts | 54 +++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/arch/arm/boot/dts/bcm2711-rpi-4-b.dts b/arch/arm/boot/dts/bcm2711-rpi-4-b.dts index 09a1182c2936..98ecb9d82ecd 100644 --- a/arch/arm/boot/dts/bcm2711-rpi-4-b.dts +++ b/arch/arm/boot/dts/bcm2711-rpi-4-b.dts @@ -5,6 +5,7 @@ #include "bcm283x-rpi-usb-peripheral.dtsi" #include +#include / { compatible = "raspberrypi,4-model-b", "brcm,bcm2711"; @@ -68,6 +69,54 @@ sd_vcc_reg: sd_vcc_reg { enable-active-high; gpio = <&expgpio 6 GPIO_ACTIVE_HIGH>; }; + + fan: pwm-fan { + compatible = "pwm-fan"; + cooling-levels = <0 50 150 255>; + #cooling-cells = <2>; + pwms = <&fwpwm RASPBERRYPI_FIRMWARE_PWM_POE>; + }; + + thermal-zones { + cpu_thermal: cpu-thermal { + trips { + threshold: trip-point@0 { + temperature = <45000>; + hysteresis = <5000>; + type = "active"; + }; + + target: trip-point@1 { + temperature = <50000>; + hysteresis = <2000>; + type = "active"; + }; + + cpu_hot: cpu_hot@0 { + temperature = <55000>; + hysteresis = <2000>; + type = "active"; + }; + }; + + cooling-maps { + map0 { + trip = <&threshold>; + cooling-device = <&fan 0 1>; + }; + + map1 { + trip = <&target>; + cooling-device = <&fan 1 2>; + }; + + map2 { + trip = <&cpu_hot>; + cooling-device = <&fan 2 3>; + }; + }; + }; + }; }; &ddc0 { @@ -103,6 +152,11 @@ reset: reset { compatible = "raspberrypi,firmware-reset"; #reset-cells = <1>; }; + + fwpwm: pwm { + compatible = "raspberrypi,firmware-pwm"; + #pwm-cells = <1>; + }; }; &gpio { -- 2.28.0