* [PATCH] arm64: dts: meson: Enable active coling using gpio-fan on Odroid N2/N2+ @ 2022-10-18 19:51 Anand Moon 2022-10-18 21:16 ` Martin Blumenstingl 2022-10-19 10:45 ` Alexander Stein 0 siblings, 2 replies; 13+ messages in thread From: Anand Moon @ 2022-10-18 19:51 UTC (permalink / raw) To: Rob Herring, Krzysztof Kozlowski, Neil Armstrong, Kevin Hilman, Jerome Brunet, Martin Blumenstingl Cc: Anand Moon, devicetree, linux-arm-kernel, linux-amlogic, linux-kernel 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 { + 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 -- 2.38.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [PATCH] arm64: dts: meson: Enable active coling using gpio-fan on Odroid N2/N2+ 2022-10-18 19:51 [PATCH] arm64: dts: meson: Enable active coling using gpio-fan on Odroid N2/N2+ Anand Moon @ 2022-10-18 21:16 ` Martin Blumenstingl 2022-10-18 21:23 ` Dan Johansen ` (2 more replies) 2022-10-19 10:45 ` Alexander Stein 1 sibling, 3 replies; 13+ messages in thread From: Martin Blumenstingl @ 2022-10-18 21:16 UTC (permalink / raw) To: Anand Moon Cc: Rob Herring, Krzysztof Kozlowski, Neil Armstrong, Kevin Hilman, Jerome Brunet, devicetree, linux-arm-kernel, linux-amlogic, linux-kernel 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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] arm64: dts: meson: Enable active coling using gpio-fan on Odroid N2/N2+ 2022-10-18 21:16 ` Martin Blumenstingl @ 2022-10-18 21:23 ` Dan Johansen 2022-10-19 3:06 ` Anand Moon 2022-10-19 7:24 ` Neil Armstrong 2 siblings, 0 replies; 13+ messages in thread From: Dan Johansen @ 2022-10-18 21:23 UTC (permalink / raw) To: Martin Blumenstingl, Anand Moon Cc: Rob Herring, Krzysztof Kozlowski, Neil Armstrong, Kevin Hilman, Jerome Brunet, devicetree, linux-arm-kernel, linux-amlogic, linux-kernel 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 -- Kind regards *Dan Johansen* Project lead of the *Manjaro ARM* project Manjaro-ARM <https://manjaro.org> _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] arm64: dts: meson: Enable active coling using gpio-fan on Odroid N2/N2+ 2022-10-18 21:16 ` Martin Blumenstingl 2022-10-18 21:23 ` Dan Johansen @ 2022-10-19 3:06 ` Anand Moon 2022-10-19 9:48 ` Anand Moon 2022-10-19 7:24 ` Neil Armstrong 2 siblings, 1 reply; 13+ messages in thread From: Anand Moon @ 2022-10-19 3:06 UTC (permalink / raw) To: Martin Blumenstingl Cc: Rob Herring, Krzysztof Kozlowski, Neil Armstrong, Kevin Hilman, Jerome Brunet, devicetree, linux-arm-kernel, linux-amlogic, linux-kernel 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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] arm64: dts: meson: Enable active coling using gpio-fan on Odroid N2/N2+ 2022-10-19 3:06 ` Anand Moon @ 2022-10-19 9:48 ` Anand Moon 2022-10-19 11:08 ` Neil Armstrong 0 siblings, 1 reply; 13+ messages in thread From: Anand Moon @ 2022-10-19 9:48 UTC (permalink / raw) To: Martin Blumenstingl Cc: Rob Herring, Krzysztof Kozlowski, Neil Armstrong, Kevin Hilman, Jerome Brunet, devicetree, linux-arm-kernel, linux-amlogic, linux-kernel 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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] arm64: dts: meson: Enable active coling using gpio-fan on Odroid N2/N2+ 2022-10-19 9:48 ` Anand Moon @ 2022-10-19 11:08 ` Neil Armstrong 2022-10-19 17:16 ` Anand Moon 0 siblings, 1 reply; 13+ messages in thread From: Neil Armstrong @ 2022-10-19 11:08 UTC (permalink / raw) To: Anand Moon, Martin Blumenstingl Cc: Rob Herring, Krzysztof Kozlowski, Kevin Hilman, Jerome Brunet, devicetree, linux-arm-kernel, linux-amlogic, linux-kernel 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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] arm64: dts: meson: Enable active coling using gpio-fan on Odroid N2/N2+ 2022-10-19 11:08 ` Neil Armstrong @ 2022-10-19 17:16 ` Anand Moon 2022-10-19 20:40 ` Martin Blumenstingl 0 siblings, 1 reply; 13+ messages in thread From: Anand Moon @ 2022-10-19 17:16 UTC (permalink / raw) To: neil.armstrong Cc: Martin Blumenstingl, Rob Herring, Krzysztof Kozlowski, Kevin Hilman, Jerome Brunet, devicetree, linux-arm-kernel, linux-amlogic, linux-kernel 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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] arm64: dts: meson: Enable active coling using gpio-fan on Odroid N2/N2+ 2022-10-19 17:16 ` Anand Moon @ 2022-10-19 20:40 ` Martin Blumenstingl 2022-10-20 8:15 ` neil.armstrong 2022-10-21 5:07 ` Anand Moon 0 siblings, 2 replies; 13+ messages in thread From: Martin Blumenstingl @ 2022-10-19 20:40 UTC (permalink / raw) To: Anand Moon Cc: neil.armstrong, Rob Herring, Krzysztof Kozlowski, Kevin Hilman, Jerome Brunet, devicetree, linux-arm-kernel, linux-amlogic, linux-kernel 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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] arm64: dts: meson: Enable active coling using gpio-fan on Odroid N2/N2+ 2022-10-19 20:40 ` Martin Blumenstingl @ 2022-10-20 8:15 ` neil.armstrong 2022-10-21 5:07 ` Anand Moon 1 sibling, 0 replies; 13+ messages in thread From: neil.armstrong @ 2022-10-20 8:15 UTC (permalink / raw) To: Martin Blumenstingl, Anand Moon Cc: Rob Herring, Krzysztof Kozlowski, Kevin Hilman, Jerome Brunet, devicetree, linux-arm-kernel, linux-amlogic, linux-kernel 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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] arm64: dts: meson: Enable active coling using gpio-fan on Odroid N2/N2+ 2022-10-19 20:40 ` Martin Blumenstingl 2022-10-20 8:15 ` neil.armstrong @ 2022-10-21 5:07 ` Anand Moon 2022-10-21 8:38 ` neil.armstrong 1 sibling, 1 reply; 13+ messages in thread From: Anand Moon @ 2022-10-21 5:07 UTC (permalink / raw) To: Martin Blumenstingl Cc: neil.armstrong, Rob Herring, Krzysztof Kozlowski, Kevin Hilman, Jerome Brunet, devicetree, linux-arm-kernel, linux-amlogic, linux-kernel 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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] arm64: dts: meson: Enable active coling using gpio-fan on Odroid N2/N2+ 2022-10-21 5:07 ` Anand Moon @ 2022-10-21 8:38 ` neil.armstrong 0 siblings, 0 replies; 13+ messages in thread From: neil.armstrong @ 2022-10-21 8:38 UTC (permalink / raw) To: Anand Moon, Martin Blumenstingl Cc: Rob Herring, Krzysztof Kozlowski, Kevin Hilman, Jerome Brunet, devicetree, linux-arm-kernel, linux-amlogic, linux-kernel 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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] arm64: dts: meson: Enable active coling using gpio-fan on Odroid N2/N2+ 2022-10-18 21:16 ` Martin Blumenstingl 2022-10-18 21:23 ` Dan Johansen 2022-10-19 3:06 ` Anand Moon @ 2022-10-19 7:24 ` Neil Armstrong 2 siblings, 0 replies; 13+ messages in thread From: Neil Armstrong @ 2022-10-19 7:24 UTC (permalink / raw) To: Martin Blumenstingl, Anand Moon Cc: Rob Herring, Krzysztof Kozlowski, Kevin Hilman, Jerome Brunet, devicetree, linux-arm-kernel, linux-amlogic, linux-kernel 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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] arm64: dts: meson: Enable active coling using gpio-fan on Odroid N2/N2+ 2022-10-18 19:51 [PATCH] arm64: dts: meson: Enable active coling using gpio-fan on Odroid N2/N2+ Anand Moon 2022-10-18 21:16 ` Martin Blumenstingl @ 2022-10-19 10:45 ` Alexander Stein 1 sibling, 0 replies; 13+ messages in thread From: Alexander Stein @ 2022-10-19 10:45 UTC (permalink / raw) To: Anand Moon Cc: Rob Herring, Krzysztof Kozlowski, Neil Armstrong, Kevin Hilman, Jerome Brunet, Martin Blumenstingl, linux-arm-kernel, devicetree, linux-arm-kernel, linux-amlogic, linux-kernel, Anand Moon 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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2022-10-21 8:40 UTC | newest] Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2022-10-18 19:51 [PATCH] arm64: dts: meson: Enable active coling using gpio-fan on Odroid N2/N2+ Anand Moon 2022-10-18 21:16 ` Martin Blumenstingl 2022-10-18 21:23 ` Dan Johansen 2022-10-19 3:06 ` Anand Moon 2022-10-19 9:48 ` Anand Moon 2022-10-19 11:08 ` Neil Armstrong 2022-10-19 17:16 ` Anand Moon 2022-10-19 20:40 ` Martin Blumenstingl 2022-10-20 8:15 ` neil.armstrong 2022-10-21 5:07 ` Anand Moon 2022-10-21 8:38 ` neil.armstrong 2022-10-19 7:24 ` Neil Armstrong 2022-10-19 10:45 ` Alexander Stein
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).