arm64: dts: meson: Enable active coling using gpio-fan on Odroid N2/N2+
Subsystems (2)
PATCH 1/1 arm64: dts: meson: Enable active coling using gpio-fan on Odroid N2/N2+
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.
--- .../dts/amlogic/meson-g12b-odroid-n2.dtsi | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+)
arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi +42 -0
@@ -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
Signature · 7 lines
2.38.0 _______________________________________________ linux-amlogic mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-amlogic
Martin Blumenstingl
reviewerHello Anand,
Quoted 4 lines · 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.
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:
Quoted 13 lines
Hello Anand,
Quoted 3 lines · 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.
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.
Quoted 3 lines
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.
Quoted 13 lines
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
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-amlogic
Signature · 4 lines
Kind regards *Dan Johansen* Project lead of the *Manjaro ARM* project Manjaro-ARM <https://manjaro.org>
Hi Martin,
Quoted 15 lines · Martin Blumenstingl
Hello Anand,
Quoted 4 lines · 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.
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.
Quoted 5 lines
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.
Quoted 6 lines
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 Martin,
Quoted 25 lines · Anand Moon
Hi Martin,
Quoted 15 lines · Martin Blumenstingl
Hello Anand,
Quoted 4 lines · 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.
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.Quoted 5 lines
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?
Quoted 5 lines
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
Quoted 8 lines
Quoted 6 lines
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.pdfThanks
-Anand
_______________________________________________
linux-amlogic mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-amlogic
Neil Armstrong
maintainerHi Anand,
Quoted 43 lines · Anand Moon
Hi Martin,
Quoted 25 lines · Anand Moon
Hi Martin,
Quoted 15 lines · Martin Blumenstingl
Hello Anand,
Quoted 4 lines · 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.
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.Quoted 5 lines
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?
Quoted 5 lines
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_10is controlled byPWMAO_DBut looking into the datasheet [0] I could not find the relevantPWMAO_Dpmw 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.
Review &pwm_ab { · line 591
Quoted 4 lines
(quoted diff) +1
-0@@ -547,6 +588,14 @@ &pwm_ab { status = "okay"; }; +&pwm_AO_ab {
&pwm_AO_cd not _ab
Quoted 8 lines
(quoted diff) +7
-0+ pinctrl-1 = <&pwm_ao_d_10_pins>; + pinctrl-names = "default"; + clocks = <&xtal>; + clock-names = "clkin0"; + status = "okay"; +}; +
Quoted 12 lines
Thanks
-AnandQuoted 8 lines
Quoted 6 lines
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.pdfThanks
-Anand
Neil
_______________________________________________
linux-amlogic mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-amlogic
Hi Neil
Quoted 46 lines · Neil Armstrong
Hi Anand,
Quoted 42 lines · Anand Moon
Hi Martin,
Quoted 25 lines · Anand Moon
Hi Martin,
Quoted 15 lines · Martin Blumenstingl
Hello Anand,
Quoted 4 lines · 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.
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.Quoted 5 lines
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?
Quoted 5 lines
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_10is controlled byPWMAO_DBut looking into the datasheet [0] I could not find the relevantPWMAO_Dpmw 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.
Quoted 8 lines
Review &pwm_ab { · line 591
Quoted 5 lines
(quoted diff) +1
-0@@ -547,6 +588,14 @@ &pwm_ab { status = "okay"; }; +&pwm_AO_ab {
&pwm_AO_cdnot_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
Martin Blumenstingl
reviewerHi Anand,
On Wed, Oct 19, 2022 at 7:17 PM Anand Moon <[email protected]> wrote:
[...]
Quoted 5 lines
Quoted 4 lines
Quoted 1 line
+&pwm_AO_ab {
&pwm_AO_cdnot_abNo 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
[email protected]
maintainerQuoted 14 lines · Martin Blumenstingl
Hi Anand,
On Wed, Oct 19, 2022 at 7:17 PM Anand Moon <[email protected]> wrote:
[...]Quoted 5 lines
Quoted 4 lines
Quoted 1 line
+&pwm_AO_ab {
&pwm_AO_cdnot_abNo it has a conflict with
CPU_B(vddcpu_b) PWMUh, 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 forVDDCPU_Bor the fan.
Quoted 5 lines
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
Quoted 6 lines
Best regards,
Martin
Hi Martin / Neil,
Quoted 15 lines · Martin Blumenstingl
Hi Anand,
On Wed, Oct 19, 2022 at 7:17 PM Anand Moon <[email protected]> wrote:
[...]Quoted 5 lines
Quoted 4 lines
Quoted 1 line
+&pwm_AO_ab {
&pwm_AO_cdnot_abNo it has a conflict with
CPU_B(vddcpu_b) PWMUh, 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 forVDDCPU_Bor the fan.
Quoted 5 lines
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-highWhen 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-highThanks
-Anand
Quoted 6 lines
Best regards,
Martin
[email protected]
maintainerQuoted 47 lines · Anand Moon
Hi Martin / Neil,
Quoted 15 lines · Martin Blumenstingl
Hi Anand,
On Wed, Oct 19, 2022 at 7:17 PM Anand Moon <[email protected]> wrote:
[...]Quoted 5 lines
Quoted 4 lines
Quoted 1 line
+&pwm_AO_ab {
&pwm_AO_cdnot_abNo it has a conflict with
CPU_B(vddcpu_b) PWMUh, 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 forVDDCPU_Bor the fan.Quoted 5 lines
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
Quoted 2 lines
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.
Quoted 32 lines
$ .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-highThanks
-AnandQuoted 6 lines
Best regards,
Martin
Neil Armstrong
maintainerHi,
Quoted 11 lines · Martin Blumenstingl
Hello Anand,
Quoted 4 lines · 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.
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.
Quoted 8 lines
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?
Quoted 6 lines
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
Am Dienstag, 18. Oktober 2022, 21:51:19 CEST schrieb Anand Moon:
Quoted 36 lines
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 <[email protected]>--- .../dts/amlogic/meson-g12b-odroid-n2.dtsi | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+)(quoted diff) +0
-0
b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsiindexfd3fa82e4c33..e61a4285a910100644arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi +11
-0@@ -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 {
arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi &cpu103 { · line 433
Quoted 10 lines
arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi +10
-0+ temperature = <60000>; /* millicelsius */ + hysteresis = <2000>; /* millicelsius */ + type = "active"; + }; + }; + + cooling-maps { + map { + trip = <&cpu_active>; + cooling-device = <&fan THERMAL_NO_LIMIT
THERMAL_NO_LIMIT>;
arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi &cpu103 { · line 440
Quoted 7 lines
arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi +7
-0+ }; + }; +}; + +&ddr_thermal { + trips { + ddr_active: cpu-active {
I suspect this node name shall be 'ddr-active', not 'cpu-active'.
Best regards,
Alexander
arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi &cpu103 {
Quoted 10 lines
arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi +10
-0+ temperature = <60000>; /* millicelsius */ + hysteresis = <2000>; /* millicelsius */ + type = "active"; + }; + }; + + cooling-maps { + map { + trip = <&ddr_active>; + cooling-device = <&fan THERMAL_NO_LIMIT
THERMAL_NO_LIMIT>;
Quoted 9 lines
arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi +4
-0+ }; + }; +}; + &ext_mdio { external_phy: ethernet-phy@0 { /* Realtek RTL8211F (0x001cc916) */base-commit:
aae703b02f92bde9264366c545e87cec451de471
_______________________________________________
linux-amlogic mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-amlogic