Skip to content

Commit 954b585

Browse files
ngmorrissonnmenon
authored andcommitted
arm64: dts: ti: am64-phyboard-electra: Add overlay to enable a GPIO fan
The phyBOARD-Electra has a GPIO fan header. This overlay enables the fan header and sets the fan to turn on at 65C. Signed-off-by: Nathan Morrisson <nmorrisson@phytec.com> Reviewed-by: Wadim Egorov <w.egorov@phytec.de> Link: https://lore.kernel.org/r/20240419193114.3090084-1-nmorrisson@phytec.com Signed-off-by: Nishanth Menon <nm@ti.com>
1 parent 04c6dd3 commit 954b585

2 files changed

Lines changed: 54 additions & 0 deletions

File tree

arch/arm64/boot/dts/ti/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ dtb-$(CONFIG_ARCH_K3) += k3-am642-hummingboard-t.dtb
4848
dtb-$(CONFIG_ARCH_K3) += k3-am642-hummingboard-t-pcie.dtb
4949
dtb-$(CONFIG_ARCH_K3) += k3-am642-hummingboard-t-usb3.dtb
5050
dtb-$(CONFIG_ARCH_K3) += k3-am642-phyboard-electra-rdk.dtb
51+
dtb-$(CONFIG_ARCH_K3) += k3-am642-phyboard-electra-gpio-fan.dtbo
5152
dtb-$(CONFIG_ARCH_K3) += k3-am642-sk.dtb
5253
dtb-$(CONFIG_ARCH_K3) += k3-am642-tqma64xxl-mbax4xxl.dtb
5354
dtb-$(CONFIG_ARCH_K3) += k3-am64-tqma64xxl-mbax4xxl-sdcard.dtbo
@@ -131,6 +132,8 @@ k3-am62p5-sk-csi2-tevi-ov5640-dtbs := k3-am62p5-sk.dtb \
131132
k3-am62x-sk-csi2-tevi-ov5640.dtbo
132133
k3-am642-evm-icssg1-dualemac-dtbs := \
133134
k3-am642-evm.dtb k3-am642-evm-icssg1-dualemac.dtbo
135+
k3-am642-phyboard-electra-gpio-fan-dtbs := \
136+
k3-am642-phyboard-electra-rdk.dtb k3-am642-phyboard-electra-gpio-fan.dtbo
134137
k3-am642-tqma64xxl-mbax4xxl-sdcard-dtbs := \
135138
k3-am642-tqma64xxl-mbax4xxl.dtb k3-am64-tqma64xxl-mbax4xxl-sdcard.dtbo
136139
k3-am642-tqma64xxl-mbax4xxl-wlan-dtbs := \
@@ -174,6 +177,7 @@ DTC_FLAGS_k3-am62-lp-sk += -@
174177
DTC_FLAGS_k3-am62a7-sk += -@
175178
DTC_FLAGS_k3-am62p5-sk += -@
176179
DTC_FLAGS_k3-am642-evm += -@
180+
DTC_FLAGS_k3-am642-phyboard-electra-rdk += -@
177181
DTC_FLAGS_k3-am642-tqma64xxl-mbax4xxl += -@
178182
DTC_FLAGS_k3-am6548-iot2050-advanced-m2 += -@
179183
DTC_FLAGS_k3-am68-sk-base-board += -@
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
// SPDX-License-Identifier: GPL-2.0-only OR MIT
2+
/*
3+
* Copyright (C) 2024 PHYTEC America LLC
4+
* Author: Nathan Morrisson <nmorrisson@phytec.com>
5+
*/
6+
7+
/dts-v1/;
8+
/plugin/;
9+
10+
#include <dt-bindings/gpio/gpio.h>
11+
#include <dt-bindings/thermal/thermal.h>
12+
#include "k3-pinctrl.h"
13+
14+
&{/} {
15+
fan: gpio-fan {
16+
compatible = "gpio-fan";
17+
gpio-fan,speed-map = <0 0 8600 1>;
18+
gpios = <&main_gpio0 28 GPIO_ACTIVE_LOW>;
19+
#cooling-cells = <2>;
20+
pinctrl-names = "default";
21+
pinctrl-0 = <&gpio_fan_pins_default>;
22+
};
23+
};
24+
25+
&main_pmx0 {
26+
gpio_fan_pins_default: gpio-fan-default-pins {
27+
pinctrl-single,pins = <
28+
AM64X_IOPAD(0x070, PIN_OUTPUT, 7) /* (V18) GPMC0_AD13.GPIO0_28 */
29+
>;
30+
};
31+
};
32+
33+
&thermal_zones {
34+
main0_thermal: main0-thermal {
35+
trips {
36+
main0_thermal_trip0: main0-thermal-trip {
37+
temperature = <65000>; /* millicelsius */
38+
hysteresis = <2000>; /* millicelsius */
39+
type = "active";
40+
};
41+
};
42+
43+
cooling-maps {
44+
map0 {
45+
trip = <&main0_thermal_trip0>;
46+
cooling-device = <&fan THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
47+
};
48+
};
49+
};
50+
};

0 commit comments

Comments
 (0)