Skip to contentSkip to conversation

arm64: dts: ti: am62-phyboard-lyra: Add overlay to enable a GPIO fan

PATCH Superseded Nathan Morrisson 2 participants 2 messages Feb 9, 2024

Subsystems (2)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 arm64: dts: ti: am62-phyboard-lyra: Add overlay to enable a GPIO fan

The phyBOARD-Lyra has a GPIO fan header. This overlay enables the fan header and sets the fan to turn on at 65C.

---
v2:
- Change overlay name from k3-am62-... to k3-am62x-...
- Add compile time test

 arch/arm64/boot/dts/ti/Makefile               |  3 ++
 .../ti/k3-am62x-phyboard-lyra-gpio-fan.dtso   | 51 +++++++++++++++++++
 2 files changed, 54 insertions(+)
 create mode 100644 arch/arm64/boot/dts/ti/k3-am62x-phyboard-lyra-gpio-fan.dtso
arch/arm64/boot/dts/ti/Makefile +3 -0
index 52c1dc910308..bfeb496d5039 100644
@@ -22,6 +22,7 @@ dtb-$(CONFIG_ARCH_K3) += k3-am625-verdin-wifi-dahlia.dtb
 dtb-$(CONFIG_ARCH_K3) += k3-am625-verdin-wifi-dev.dtb
 dtb-$(CONFIG_ARCH_K3) += k3-am625-verdin-wifi-mallow.dtb
 dtb-$(CONFIG_ARCH_K3) += k3-am625-verdin-wifi-yavia.dtb
+dtb-$(CONFIG_ARCH_K3) += k3-am62x-phyboard-lyra-gpio-fan.dtbo
 dtb-$(CONFIG_ARCH_K3) += k3-am62-lp-sk.dtb
 
 # Boards with AM62Ax SoC
@@ -87,6 +88,8 @@ k3-am625-beagleplay-csi2-ov5640-dtbs := k3-am625-beagleplay.dtb \
 	k3-am625-beagleplay-csi2-ov5640.dtbo
 k3-am625-beagleplay-csi2-tevi-ov5640-dtbs := k3-am625-beagleplay.dtb \
 	k3-am625-beagleplay-csi2-tevi-ov5640.dtbo
+k3-am625-phyboard-lyra-gpio-fan-dtbs := k3-am625-phyboard-lyra-rdk.dtb \
+	k3-am62x-phyboard-lyra-gpio-fan.dtbo
 k3-am625-sk-csi2-imx219-dtbs := k3-am625-sk.dtb \
 	k3-am62x-sk-csi2-imx219.dtbo
 k3-am625-sk-csi2-ov5640-dtbs := k3-am625-sk.dtb \
arch/arm64/boot/dts/ti/k3-am62x-phyboard-lyra-gpio-fan.dtso new file +51 -0

51 lines not on this page · raw message

Signature · 1 line
2.25.1
Reviewed-by on v2 1/1
#1 lore raw

Hi Nathan,

Am 09.02.24 um 01:29 schrieb Nathan Morrisson:

Quoted 53 lines

The phyBOARD-Lyra has a GPIO fan header. This overlay enables the fan header and sets the fan to turn on at 65C.

---
v2:
- Change overlay name from k3-am62-... to k3-am62x-...
- Add compile time test

  arch/arm64/boot/dts/ti/Makefile               |  3 ++
  .../ti/k3-am62x-phyboard-lyra-gpio-fan.dtso   | 51 +++++++++++++++++++
  2 files changed, 54 insertions(+)

create mode 100644 arch/arm64/boot/dts/ti/k3-am62x-phyboard-lyra-gpio-fan.dtso

arch/arm64/boot/dts/ti/Makefile +3 -0
index 52c1dc910308..bfeb496d5039 100644
@@ -22,6 +22,7 @@ dtb-$(CONFIG_ARCH_K3) += k3-am625-verdin-wifi-dahlia.dtb
  dtb-$(CONFIG_ARCH_K3) += k3-am625-verdin-wifi-dev.dtb
  dtb-$(CONFIG_ARCH_K3) += k3-am625-verdin-wifi-mallow.dtb
  dtb-$(CONFIG_ARCH_K3) += k3-am625-verdin-wifi-yavia.dtb
+dtb-$(CONFIG_ARCH_K3) += k3-am62x-phyboard-lyra-gpio-fan.dtbo
  dtb-$(CONFIG_ARCH_K3) += k3-am62-lp-sk.dtb
 
  # Boards with AM62Ax SoC
@@ -87,6 +88,8 @@ k3-am625-beagleplay-csi2-ov5640-dtbs := k3-am625-beagleplay.dtb \
  	k3-am625-beagleplay-csi2-ov5640.dtbo
  k3-am625-beagleplay-csi2-tevi-ov5640-dtbs := k3-am625-beagleplay.dtb \
  	k3-am625-beagleplay-csi2-tevi-ov5640.dtbo
+k3-am625-phyboard-lyra-gpio-fan-dtbs := k3-am625-phyboard-lyra-rdk.dtb \
+	k3-am62x-phyboard-lyra-gpio-fan.dtbo
  k3-am625-sk-csi2-imx219-dtbs := k3-am625-sk.dtb \
  	k3-am62x-sk-csi2-imx219.dtbo
  k3-am625-sk-csi2-ov5640-dtbs := k3-am625-sk.dtb \
arch/arm64/boot/dts/ti/k3-am62x-phyboard-lyra-gpio-fan.dtso new file +12 -0
new file mode 100644
index 000000000000..9c05748bdd9d
@@ -0,0 +1,51 @@
+// SPDX-License-Identifier: GPL-2.0-only OR MIT
+/*
+ * Copyright (C) 2024 PHYTEC America LLC
+ * Author: Garrett Giordano <[email protected]>
+ */
+
+/dts-v1/;
+/plugin/;
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/thermal/thermal.h>
+#include "k3-pinctrl.h"

arch/arm64/boot/dts/ti/k3-am62x-phyboard-lyra-gpio-fan.dtso line 22

Quoted 10 lines
arch/arm64/boot/dts/ti/k3-am62x-phyboard-lyra-gpio-fan.dtso new file +10 -0
+
+&{/} {
+	fan: gpio-fan {
+		compatible = "gpio-fan";
+		gpio-fan,speed-map = <0 0 8600 1>;
+		gpios = <&main_gpio0 40 GPIO_ACTIVE_LOW>;
+		#cooling-cells = <2>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&gpio_fan_pins_default>;
+		status = "okay";

There is no need to set the status. If no status is present, it also indicates that the node is activated.

With this change,

Quoted 29 lines
arch/arm64/boot/dts/ti/k3-am62x-phyboard-lyra-gpio-fan.dtso new file +29 -0
+	};
+};
+
+&main_pmx0 {
+	gpio_fan_pins_default: gpio-fan-default-pins {
+		pinctrl-single,pins = <
+			AM62X_IOPAD(0x0a4, PIN_OUTPUT, 7) /* (M22) GPMC0_DIR.GPIO0_40 */
+		>;
+	};
+};
+
+&thermal_zones {
+	main0_thermal: main0-thermal {
+		trips {
+			main0_thermal_trip0: main0-thermal-trip {
+				temperature = <65000>;  /* millicelsius */
+				hysteresis = <2000>;    /* millicelsius */
+				type = "active";
+			};
+		};
+
+		cooling-maps {
+			map0 {
+				trip = <&main0_thermal_trip0>;
+				cooling-device = <&fan THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+			};
+		};
+	};
+};