Message ID | 20221018195122.8877-1-linux.amoon@gmail.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp2134081wrs; Tue, 18 Oct 2022 12:55:39 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5UC/M2RNiLAlGWf55GlcmB8QtRV0dyHlJWqhPGwB/+t4J9Z8zUG6db3cXq8osF6+YLyUUn X-Received: by 2002:a17:907:a47:b0:780:6883:2a37 with SMTP id be7-20020a1709070a4700b0078068832a37mr3778456ejc.219.1666122938955; Tue, 18 Oct 2022 12:55:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666122938; cv=none; d=google.com; s=arc-20160816; b=g6S3RMGhSihabGSS8dOBU10pSNvNcOCiBz760s7DugR05OFMEx3EEKXNBXhMfbfS8u sS2BPuLo3TYmnSbVw8n7o7KFwiiJZ+6x/HK97NIGrzzJPKgVPE3Wyb0WunEp6S6sH6wR TzYAQSjL2v77bv1WEtHKaq0NWd5MrTVo/fL9pHoTAh/k5zgZAFjuNTwZlVId5OEQ4ibq UMkFW08IW8i78l/I5l0LK/hhdGg8eXn829HmSCBmRJ/0a6IgK78xUWZEvgjDZU0wnWCl a3N7OuGgVdnZvnpDzrrhJaAOGFk92OUWwLy1ddEruEKmyGUjrfyIzx5tl4cqZwrGgWAc m8eA== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=Decn228I23NeLLtliUyA2wHQT/chAyjBvAFPep29TTY=; b=XSavs/zryEF6picBQx8gnMlXaIZQpo4HJUt8OgUojxFfT6M24piyMM59s6aVdP2PDf hj5LaL0q0YjrQ/fAjwP3itFmwjjR2uRjDZ9oZR8ThuCASJGa133gH8y/vGrqRUs1hAzF wPuduP89BgKE+9UwdTiU9Wg1LUjQhwk8mgHjEulmYNXLN1g/GGUj62kEi8lJizlcIp0C AKgPzQGtXWOi0z/PZv6EEY5hZRM6us2bX2B2b/AASZRyWoy4yc0bBbN3Lfm+bWWRIQtV bzCI+bm7KoWNmNpVXWAg/yLpLQ2wO8QzNwo4rMIa8NURoVftlp3fcXlIt5N4Of76kEex MLpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=gPXw0e5D; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id en6-20020a056402528600b004534c6c4bd7si10878272edb.433.2022.10.18.12.55.13; Tue, 18 Oct 2022 12:55:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=gPXw0e5D; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230070AbiJRTx5 (ORCPT <rfc822;toshivichauhan@gmail.com> + 99 others); Tue, 18 Oct 2022 15:53:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52624 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230010AbiJRTxk (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 18 Oct 2022 15:53:40 -0400 Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com [IPv6:2607:f8b0:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F0BF8FD5A; Tue, 18 Oct 2022 12:53:10 -0700 (PDT) Received: by mail-pl1-x62b.google.com with SMTP id o21so12444667ple.5; Tue, 18 Oct 2022 12:53:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=Decn228I23NeLLtliUyA2wHQT/chAyjBvAFPep29TTY=; b=gPXw0e5DdOSjS6vUUvJpAJ25al5FdM+3bpuoFbiQViQvegio6bFFg4zi3gRrQqc8QI uNd1nwd6fspz6ZrvMd2DvKYPo7yuPe3pPbz1xvMikstoqaxGPr67o75E0KE0VA4orT55 4KSz4FB75Q3BlufHKu3D58LBG/Gm/tF83H5lUxzVtDjyPNT0WZAaYZ5z1XV/djSnR9/7 p0p7hcIk2ESbzkY1StAXf9RLw+rFJcE3n9Y/TL4rwvQ2syZxXXtVvylM4HhP165eEpYy 3R6v4priW798+Ub3UG0W+hb7YrtEuAqx9pfhkT1JsKwwgTZJeGxJJu59xbITIrYevMDO Z2gQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=Decn228I23NeLLtliUyA2wHQT/chAyjBvAFPep29TTY=; b=gmyD52dh5cC2AqZebOcOij1cBAlk016R6wDpmIJWgCLU/wTy2zr3axPxfJsNjGNFYz /xUf9Ge2jW8C6M5vmbq2A3Sq5G9hsbBW0M9hjoOFktM5PkKjzNVmJuEpMQkd+OnGwWe/ UtWP/ZU1OzRaU44harA76iXTBU5X0YGAKZ/svQzZw+FJSyebYmzQhEkYpovPsHKuye26 MOVByLKGdESEu5mxAy6z/e2xRjbJbPz04oAQ53yrwAy3cRgn6NbguK59ubm9ZegrSsg3 TinrCV0trXSxLwC7yrfUwUQTjWJORBVnW2fEWcxRZ3/XDtyaqkjnygdDLm1h/g37BC9M FF2A== X-Gm-Message-State: ACrzQf1qTGvKUPH2hDO5JKFm87J0AF19uTKPhLqiDnm+xWC4XoySE7we NWdsVIvBHrFyUl8vM9HVCjY= X-Received: by 2002:a17:902:8491:b0:183:c3d2:2112 with SMTP id c17-20020a170902849100b00183c3d22112mr4773643plo.133.1666122789257; Tue, 18 Oct 2022 12:53:09 -0700 (PDT) Received: from localhost.localdomain ([103.51.72.20]) by smtp.gmail.com with ESMTPSA id t25-20020aa79479000000b0056126b79072sm9666063pfq.21.2022.10.18.12.53.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Oct 2022 12:53:08 -0700 (PDT) From: Anand Moon <linux.amoon@gmail.com> To: Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Neil Armstrong <neil.armstrong@linaro.org>, Kevin Hilman <khilman@baylibre.com>, Jerome Brunet <jbrunet@baylibre.com>, Martin Blumenstingl <martin.blumenstingl@googlemail.com> Cc: Anand Moon <linux.amoon@gmail.com>, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] arm64: dts: meson: Enable active coling using gpio-fan on Odroid N2/N2+ Date: Tue, 18 Oct 2022 19:51:19 +0000 Message-Id: <20221018195122.8877-1-linux.amoon@gmail.com> X-Mailer: git-send-email 2.38.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747056526782924777?= X-GMAIL-MSGID: =?utf-8?q?1747056526782924777?= |
Series |
arm64: dts: meson: Enable active coling using gpio-fan on Odroid N2/N2+
|
|
Commit Message
Anand Moon
Oct. 18, 2022, 7:51 p.m. UTC
Odroid N2/N2+ support active cooling via gpio-fan controller.
Add fan controls and tip point for cpu and ddr thermal sensor
on this boards.
Signed-off-by: Anand Moon <linux.amoon@gmail.com>
---
.../dts/amlogic/meson-g12b-odroid-n2.dtsi | 42 +++++++++++++++++++
1 file changed, 42 insertions(+)
base-commit: aae703b02f92bde9264366c545e87cec451de471
Comments
Hello Anand, On Tue, Oct 18, 2022 at 9:53 PM Anand Moon <linux.amoon@gmail.com> wrote: > > Odroid N2/N2+ support active cooling via gpio-fan controller. > Add fan controls and tip point for cpu and ddr thermal sensor > on this boards. In the schematics for board rev 0.6 [0] I cannot find any information about a fan connector. The schematics for board rev 0.3 [1] on the other hand document a PWM based fan connector on page 16. So now I am not sure whether your patch only applies to certain board revisions, the schematics are incorrect, etc. Can you please provide some details about the fan connector on Odroid-N2/N2+ and which hardware revisions are supported (and which aren't) by your patch? Thank you! Martin [0] https://dn.odroid.com/S922X/ODROID-N2/Schematic/odroid-n2_rev0.6_20210121.pdf [1] https://dn.odroid.com/S922X/ODROID-N2/Schematic/odroid-n2_rev0.3_20190117.pdf
Den 18.10.2022 kl. 23.16 skrev Martin Blumenstingl: > Hello Anand, > > On Tue, Oct 18, 2022 at 9:53 PM Anand Moon <linux.amoon@gmail.com> wrote: >> Odroid N2/N2+ support active cooling via gpio-fan controller. >> Add fan controls and tip point for cpu and ddr thermal sensor >> on this boards. > In the schematics for board rev 0.6 [0] I cannot find any information > about a fan connector. > The schematics for board rev 0.3 [1] on the other hand document a PWM > based fan connector on page 16. > So now I am not sure whether your patch only applies to certain board > revisions, the schematics are incorrect, etc. > > Can you please provide some details about the fan connector on > Odroid-N2/N2+ and which hardware revisions are supported (and which > aren't) by your patch? I can add that my N2+ rev 0.5 does have a fan connector. > > > Thank you! > Martin > > > [0] https://dn.odroid.com/S922X/ODROID-N2/Schematic/odroid-n2_rev0.6_20210121.pdf > [1] https://dn.odroid.com/S922X/ODROID-N2/Schematic/odroid-n2_rev0.3_20190117.pdf > > _______________________________________________ > linux-amlogic mailing list > linux-amlogic@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-amlogic
Hi Martin, On Wed, 19 Oct 2022 at 02:46, Martin Blumenstingl <martin.blumenstingl@googlemail.com> wrote: > > Hello Anand, > > On Tue, Oct 18, 2022 at 9:53 PM Anand Moon <linux.amoon@gmail.com> wrote: > > > > Odroid N2/N2+ support active cooling via gpio-fan controller. > > Add fan controls and tip point for cpu and ddr thermal sensor > > on this boards. > In the schematics for board rev 0.6 [0] I cannot find any information > about a fan connector. > The schematics for board rev 0.3 [1] on the other hand document a PWM > based fan connector on page 16. > So now I am not sure whether your patch only applies to certain board > revisions, the schematics are incorrect, etc. > > Can you please provide some details about the fan connector on > Odroid-N2/N2+ and which hardware revisions are supported (and which > aren't) by your patch? > > Ok I got this wrong the schematics below there is pwm controller, not gpio controller GPIOAO.BIT10 (PWM) I will correct the patch sorry for the mistake I did not look more carefully. > Thank you! > Martin > > > [0] https://dn.odroid.com/S922X/ODROID-N2/Schematic/odroid-n2_rev0.6_20210121.pdf > [1] https://dn.odroid.com/S922X/ODROID-N2/Schematic/odroid-n2_rev0.3_20190117.pdf Thanks -Anand
Hi, On 18/10/2022 23:16, Martin Blumenstingl wrote: > Hello Anand, > > On Tue, Oct 18, 2022 at 9:53 PM Anand Moon <linux.amoon@gmail.com> wrote: >> >> Odroid N2/N2+ support active cooling via gpio-fan controller. >> Add fan controls and tip point for cpu and ddr thermal sensor >> on this boards. > In the schematics for board rev 0.6 [0] I cannot find any information > about a fan connector. > The schematics for board rev 0.3 [1] on the other hand document a PWM > based fan connector on page 16. It seems the fan connector is on page 41 on rev 0.6 and it seems to be the same. > So now I am not sure whether your patch only applies to certain board > revisions, the schematics are incorrect, etc. > > Can you please provide some details about the fan connector on > Odroid-N2/N2+ and which hardware revisions are supported (and which > aren't) by your patch? > > > Thank you! > Martin > > > [0] https://dn.odroid.com/S922X/ODROID-N2/Schematic/odroid-n2_rev0.6_20210121.pdf > [1] https://dn.odroid.com/S922X/ODROID-N2/Schematic/odroid-n2_rev0.3_20190117.pdf Neil
Hi Martin, On Wed, 19 Oct 2022 at 08:36, Anand Moon <linux.amoon@gmail.com> wrote: > > Hi Martin, > > On Wed, 19 Oct 2022 at 02:46, Martin Blumenstingl > <martin.blumenstingl@googlemail.com> wrote: > > > > Hello Anand, > > > > On Tue, Oct 18, 2022 at 9:53 PM Anand Moon <linux.amoon@gmail.com> wrote: > > > > > > Odroid N2/N2+ support active cooling via gpio-fan controller. > > > Add fan controls and tip point for cpu and ddr thermal sensor > > > on this boards. > > In the schematics for board rev 0.6 [0] I cannot find any information > > about a fan connector. > > The schematics for board rev 0.3 [1] on the other hand document a PWM > > based fan connector on page 16. > > So now I am not sure whether your patch only applies to certain board > > revisions, the schematics are incorrect, etc. > > > > Can you please provide some details about the fan connector on > > Odroid-N2/N2+ and which hardware revisions are supported (and which > > aren't) by your patch? > > > > > Ok I got this wrong the schematics below there is pwm controller, not > gpio controller > GPIOAO.BIT10 (PWM) > I will correct the patch sorry for the mistake I did not look more carefully. > As per the schematics GPIOAO_10 is controlled by PWMAO_D But looking into the datasheet [0] I could not find the relevant PWMAO_D pmw ip block to link the fan to the PWM controller. [0] https://dn.odroid.com/S922X/ODROID-N2/Datasheet/S922X_Public_Datasheet_V0.2.pdf I could get the PWM node but is not working for me. @@ -547,6 +588,14 @@ &pwm_ab { status = "okay"; }; +&pwm_AO_ab { + pinctrl-1 = <&pwm_ao_d_10_pins>; + pinctrl-names = "default"; + clocks = <&xtal>; + clock-names = "clkin0"; + status = "okay"; +}; + Thanks -Anand > > Thank you! > > Martin > > > > > > [0] https://dn.odroid.com/S922X/ODROID-N2/Schematic/odroid-n2_rev0.6_20210121.pdf > > [1] https://dn.odroid.com/S922X/ODROID-N2/Schematic/odroid-n2_rev0.3_20190117.pdf > Thanks > -Anand
Am Dienstag, 18. Oktober 2022, 21:51:19 CEST schrieb Anand Moon: > Odroid N2/N2+ support active cooling via gpio-fan controller. > Add fan controls and tip point for cpu and ddr thermal sensor > on this boards. > > Signed-off-by: Anand Moon <linux.amoon@gmail.com> > --- > .../dts/amlogic/meson-g12b-odroid-n2.dtsi | 42 +++++++++++++++++++ > 1 file changed, 42 insertions(+) > > diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi > b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi index > fd3fa82e4c33..e61a4285a910 100644 > --- a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi > +++ b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi > @@ -39,6 +39,14 @@ emmc_pwrseq: emmc-pwrseq { > reset-gpios = <&gpio BOOT_12 GPIO_ACTIVE_LOW>; > }; > > + fan: gpio-fan { > + compatible = "gpio-fan"; > + gpios = <&gpio_ao GPIOAO_10 GPIO_ACTIVE_HIGH>; > + /* Using Dummy Speed */ > + gpio-fan,speed-map = <0 0>, <1 1>; > + #cooling-cells = <2>; > + }; > + > leds { > compatible = "gpio-leds"; > > @@ -410,6 +418,40 @@ &cpu103 { > clock-latency = <50000>; > }; > > +&cpu_thermal { > + trips { > + cpu_active: cpu-active { > + temperature = <60000>; /* millicelsius */ > + hysteresis = <2000>; /* millicelsius */ > + type = "active"; > + }; > + }; > + > + cooling-maps { > + map { > + trip = <&cpu_active>; > + cooling-device = <&fan THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; > + }; > + }; > +}; > + > +&ddr_thermal { > + trips { > + ddr_active: cpu-active { I suspect this node name shall be 'ddr-active', not 'cpu-active'. Best regards, Alexander > + temperature = <60000>; /* millicelsius */ > + hysteresis = <2000>; /* millicelsius */ > + type = "active"; > + }; > + }; > + > + cooling-maps { > + map { > + trip = <&ddr_active>; > + cooling-device = <&fan THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; > + }; > + }; > +}; > + > &ext_mdio { > external_phy: ethernet-phy@0 { > /* Realtek RTL8211F (0x001cc916) */ > > base-commit: aae703b02f92bde9264366c545e87cec451de471
Hi Anand, On 19/10/2022 11:48, Anand Moon wrote: > Hi Martin, > > On Wed, 19 Oct 2022 at 08:36, Anand Moon <linux.amoon@gmail.com> wrote: >> >> Hi Martin, >> >> On Wed, 19 Oct 2022 at 02:46, Martin Blumenstingl >> <martin.blumenstingl@googlemail.com> wrote: >>> >>> Hello Anand, >>> >>> On Tue, Oct 18, 2022 at 9:53 PM Anand Moon <linux.amoon@gmail.com> wrote: >>>> >>>> Odroid N2/N2+ support active cooling via gpio-fan controller. >>>> Add fan controls and tip point for cpu and ddr thermal sensor >>>> on this boards. >>> In the schematics for board rev 0.6 [0] I cannot find any information >>> about a fan connector. >>> The schematics for board rev 0.3 [1] on the other hand document a PWM >>> based fan connector on page 16. >>> So now I am not sure whether your patch only applies to certain board >>> revisions, the schematics are incorrect, etc. >>> >>> Can you please provide some details about the fan connector on >>> Odroid-N2/N2+ and which hardware revisions are supported (and which >>> aren't) by your patch? >>> >>> >> Ok I got this wrong the schematics below there is pwm controller, not >> gpio controller >> GPIOAO.BIT10 (PWM) >> I will correct the patch sorry for the mistake I did not look more carefully. >> > > As per the schematics GPIOAO_10 is controlled by PWMAO_D > But looking into the datasheet [0] I could not find the relevant > PWMAO_D pmw ip block to link the fan to the PWM controller. > > [0] https://dn.odroid.com/S922X/ODROID-N2/Datasheet/S922X_Public_Datasheet_V0.2.pdf > > I could get the PWM node but is not working for me. > > @@ -547,6 +588,14 @@ &pwm_ab { > status = "okay"; > }; > > +&pwm_AO_ab { &pwm_AO_cd not _ab > + pinctrl-1 = <&pwm_ao_d_10_pins>; > + pinctrl-names = "default"; > + clocks = <&xtal>; > + clock-names = "clkin0"; > + status = "okay"; > +}; > + > > Thanks > -Anand > > >>> Thank you! >>> Martin >>> >>> >>> [0] https://dn.odroid.com/S922X/ODROID-N2/Schematic/odroid-n2_rev0.6_20210121.pdf >>> [1] https://dn.odroid.com/S922X/ODROID-N2/Schematic/odroid-n2_rev0.3_20190117.pdf >> Thanks >> -Anand Neil
Hi Neil On Wed, 19 Oct 2022 at 16:39, Neil Armstrong <neil.armstrong@linaro.org> wrote: > > Hi Anand, > > On 19/10/2022 11:48, Anand Moon wrote: > > Hi Martin, > > > > On Wed, 19 Oct 2022 at 08:36, Anand Moon <linux.amoon@gmail.com> wrote: > >> > >> Hi Martin, > >> > >> On Wed, 19 Oct 2022 at 02:46, Martin Blumenstingl > >> <martin.blumenstingl@googlemail.com> wrote: > >>> > >>> Hello Anand, > >>> > >>> On Tue, Oct 18, 2022 at 9:53 PM Anand Moon <linux.amoon@gmail.com> wrote: > >>>> > >>>> Odroid N2/N2+ support active cooling via gpio-fan controller. > >>>> Add fan controls and tip point for cpu and ddr thermal sensor > >>>> on this boards. > >>> In the schematics for board rev 0.6 [0] I cannot find any information > >>> about a fan connector. > >>> The schematics for board rev 0.3 [1] on the other hand document a PWM > >>> based fan connector on page 16. > >>> So now I am not sure whether your patch only applies to certain board > >>> revisions, the schematics are incorrect, etc. > >>> > >>> Can you please provide some details about the fan connector on > >>> Odroid-N2/N2+ and which hardware revisions are supported (and which > >>> aren't) by your patch? > >>> > >>> > >> Ok I got this wrong the schematics below there is pwm controller, not > >> gpio controller > >> GPIOAO.BIT10 (PWM) > >> I will correct the patch sorry for the mistake I did not look more carefully. > >> > > > > As per the schematics GPIOAO_10 is controlled by PWMAO_D > > But looking into the datasheet [0] I could not find the relevant > > PWMAO_D pmw ip block to link the fan to the PWM controller. > > > > [0] https://dn.odroid.com/S922X/ODROID-N2/Datasheet/S922X_Public_Datasheet_V0.2.pdf > > > > I could get the PWM node but is not working for me. > > > > @@ -547,6 +588,14 @@ &pwm_ab { > > status = "okay"; > > }; > > > > +&pwm_AO_ab { > > &pwm_AO_cd not _ab > No it has a conflict with CPU_B (vddcpu_b) PWM I have tried linking all the PWM with pwm-fan but it's not working. # sudo cat /sys/kernel/debug/pwm platform/ffd1b000.pwm, 2 PWM devices pwm-0 (regulator-vddcpu-a ): requested enabled period: 1250 ns duty: 0 ns polarity: normal pwm-1 ((null) ): period: 0 ns duty: 0 ns polarity: normal platform/ff807000.pwm, 2 PWM devices pwm-0 ((null) ): period: 0 ns duty: 0 ns polarity: normal pwm-1 (pwm-fan ): requested period: 1250 ns duty: 0 ns polarity: normal platform/ff802000.pwm, 2 PWM devices pwm-0 ((null) ): period: 0 ns duty: 0 ns polarity: normal pwm-1 (regulator-vddcpu-b ): requested enabled period: 1250 ns duty: 88 ns polarity: normal Thanks -Anand
Hi Anand, On Wed, Oct 19, 2022 at 7:17 PM Anand Moon <linux.amoon@gmail.com> wrote: [...] > > > +&pwm_AO_ab { > > > > &pwm_AO_cd not _ab > > > No it has a conflict with CPU_B (vddcpu_b) PWM Uh, you're right. That's probably why the Hardkernel team uses a software based PWM implementation: [0] In hindsight they should have used a different pad either for VDDCPU_B or the fan. I think the most pragmatic approach (since the "GPIO PWM" driver is not upstream and I don't know if something like that would be accepted upstream) is to use a GPIO based fan as you did in your initial patch. Not sure what others think though. Best regards, Martin [0] https://github.com/hardkernel/linux/blob/c109dec94e7e819554830acfac4b6ed96e230179/arch/arm64/boot/dts/amlogic/meson64_odroidn2.dtsi#L356-L359
On 19/10/2022 22:40, Martin Blumenstingl wrote: > Hi Anand, > > On Wed, Oct 19, 2022 at 7:17 PM Anand Moon <linux.amoon@gmail.com> wrote: > [...] >>>> +&pwm_AO_ab { >>> >>> &pwm_AO_cd not _ab >>> >> No it has a conflict with CPU_B (vddcpu_b) PWM > Uh, you're right. That's probably why the Hardkernel team uses a > software based PWM implementation: [0] > In hindsight they should have used a different pad either for VDDCPU_B > or the fan. > > I think the most pragmatic approach (since the "GPIO PWM" driver is > not upstream and I don't know if something like that would be accepted > upstream) is to use a GPIO based fan as you did in your initial patch. > Not sure what others think though. > Indeed I recall them using a SW pwm. Yes it's perfectly ok to use a gpio-fan. Anand, please fixup the ddr-active name and send a v2. Thanks, Neil > > Best regards, > Martin > > > [0] https://github.com/hardkernel/linux/blob/c109dec94e7e819554830acfac4b6ed96e230179/arch/arm64/boot/dts/amlogic/meson64_odroidn2.dtsi#L356-L359
Hi Martin / Neil, On Thu, 20 Oct 2022 at 02:10, Martin Blumenstingl <martin.blumenstingl@googlemail.com> wrote: > > Hi Anand, > > On Wed, Oct 19, 2022 at 7:17 PM Anand Moon <linux.amoon@gmail.com> wrote: > [...] > > > > +&pwm_AO_ab { > > > > > > &pwm_AO_cd not _ab > > > > > No it has a conflict with CPU_B (vddcpu_b) PWM > Uh, you're right. That's probably why the Hardkernel team uses a > software based PWM implementation: [0] > In hindsight they should have used a different pad either for VDDCPU_B > or the fan. > > I think the most pragmatic approach (since the "GPIO PWM" driver is > not upstream and I don't know if something like that would be accepted > upstream) is to use a GPIO based fan as you did in your initial patch. > Not sure what others think though. > When I use gpio-fan I get the following output with gpioinfo Feature it woks as expected. $ .sudo gpioinfo .... gpiochip1 - 15 lines: line 0: unnamed unused input active-high line 1: unnamed unused input active-high line 2: unnamed "enable" output active-high [used] line 3: unnamed unused input active-high line 4: unnamed unused output active-high line 5: unnamed unused input active-high line 6: unnamed unused input active-high line 7: unnamed unused input active-high line 8: unnamed "regulator-tflash_vdd" output active-high [used] line 9: unnamed "TF_IO" output active-high [used] line 10: unnamed "gpio-fan" output active-high [used] line 11: unnamed "n2:blue" output active-high [used] line 12: unnamed unused input active-high line 13: unnamed unused input active-high line 14: unnamed unused input active-high When I am using pwm-fan using *pwm_ao_d_10_pins* pin is not getting registered below hence it is not working on my end. $ .sudo gpioinfo .... gpiochip1 - 15 lines: line 0: unnamed unused input active-high line 1: unnamed unused input active-high line 2: unnamed "enable" output active-high [used] line 3: unnamed unused input active-high line 4: unnamed unused output active-high line 5: unnamed unused input active-high line 6: unnamed unused input active-high line 7: unnamed unused input active-high line 8: unnamed "regulator-tflash_vdd" output active-high [used] line 9: unnamed "TF_IO" output active-high [used] line 10: unnamed unused output active-high line 11: unnamed "n2:blue" output active-high [used] line 12: unnamed unused input active-high line 13: unnamed unused input active-high line 14: unnamed unused input active-high Thanks -Anand > > Best regards, > Martin > > > [0] https://github.com/hardkernel/linux/blob/c109dec94e7e819554830acfac4b6ed96e230179/arch/arm64/boot/dts/amlogic/meson64_odroidn2.dtsi#L356-L359
On 21/10/2022 07:07, Anand Moon wrote: > Hi Martin / Neil, > > On Thu, 20 Oct 2022 at 02:10, Martin Blumenstingl > <martin.blumenstingl@googlemail.com> wrote: >> >> Hi Anand, >> >> On Wed, Oct 19, 2022 at 7:17 PM Anand Moon <linux.amoon@gmail.com> wrote: >> [...] >>>>> +&pwm_AO_ab { >>>> >>>> &pwm_AO_cd not _ab >>>> >>> No it has a conflict with CPU_B (vddcpu_b) PWM >> Uh, you're right. That's probably why the Hardkernel team uses a >> software based PWM implementation: [0] >> In hindsight they should have used a different pad either for VDDCPU_B >> or the fan. >> >> I think the most pragmatic approach (since the "GPIO PWM" driver is >> not upstream and I don't know if something like that would be accepted >> upstream) is to use a GPIO based fan as you did in your initial patch. >> Not sure what others think though. >> > > When I use gpio-fan I get the following output with gpioinfo > Feature it woks as expected. > > $ .sudo gpioinfo > .... > gpiochip1 - 15 lines: > line 0: unnamed unused input active-high > line 1: unnamed unused input active-high > line 2: unnamed "enable" output active-high [used] > line 3: unnamed unused input active-high > line 4: unnamed unused output active-high > line 5: unnamed unused input active-high > line 6: unnamed unused input active-high > line 7: unnamed unused input active-high > line 8: unnamed "regulator-tflash_vdd" output active-high [used] > line 9: unnamed "TF_IO" output active-high [used] > line 10: unnamed "gpio-fan" output active-high [used] > line 11: unnamed "n2:blue" output active-high [used] > line 12: unnamed unused input active-high > line 13: unnamed unused input active-high > line 14: unnamed unused input active-high > > When I am using pwm-fan using *pwm_ao_d_10_pins* pin is not getting > registered below hence it is not working on my end. It's expected because it's not used as a GPIO but another function, you should look in the pinctrl debugfs files to see it. > > $ .sudo gpioinfo > .... > gpiochip1 - 15 lines: > line 0: unnamed unused input active-high > line 1: unnamed unused input active-high > line 2: unnamed "enable" output active-high [used] > line 3: unnamed unused input active-high > line 4: unnamed unused output active-high > line 5: unnamed unused input active-high > line 6: unnamed unused input active-high > line 7: unnamed unused input active-high > line 8: unnamed "regulator-tflash_vdd" output active-high [used] > line 9: unnamed "TF_IO" output active-high [used] > line 10: unnamed unused output active-high > line 11: unnamed "n2:blue" output active-high [used] > line 12: unnamed unused input active-high > line 13: unnamed unused input active-high > line 14: unnamed unused input active-high > > Thanks > -Anand > > > > >> >> Best regards, >> Martin >> >> >> [0] https://github.com/hardkernel/linux/blob/c109dec94e7e819554830acfac4b6ed96e230179/arch/arm64/boot/dts/amlogic/meson64_odroidn2.dtsi#L356-L359
diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi index fd3fa82e4c33..e61a4285a910 100644 --- a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi +++ b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi @@ -39,6 +39,14 @@ emmc_pwrseq: emmc-pwrseq { reset-gpios = <&gpio BOOT_12 GPIO_ACTIVE_LOW>; }; + fan: gpio-fan { + compatible = "gpio-fan"; + gpios = <&gpio_ao GPIOAO_10 GPIO_ACTIVE_HIGH>; + /* Using Dummy Speed */ + gpio-fan,speed-map = <0 0>, <1 1>; + #cooling-cells = <2>; + }; + leds { compatible = "gpio-leds"; @@ -410,6 +418,40 @@ &cpu103 { clock-latency = <50000>; }; +&cpu_thermal { + trips { + cpu_active: cpu-active { + temperature = <60000>; /* millicelsius */ + hysteresis = <2000>; /* millicelsius */ + type = "active"; + }; + }; + + cooling-maps { + map { + trip = <&cpu_active>; + cooling-device = <&fan THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; + }; + }; +}; + +&ddr_thermal { + trips { + ddr_active: cpu-active { + temperature = <60000>; /* millicelsius */ + hysteresis = <2000>; /* millicelsius */ + type = "active"; + }; + }; + + cooling-maps { + map { + trip = <&ddr_active>; + cooling-device = <&fan THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; + }; + }; +}; + &ext_mdio { external_phy: ethernet-phy@0 { /* Realtek RTL8211F (0x001cc916) */