From cc0db789e4d86155009e875c55eb58705a64733e Mon Sep 17 00:00:00 2001 From: Alvin Xie Date: Wed, 15 May 2024 17:19:18 +0800 Subject: [PATCH 1/2] feat: add radxa zero3 poe overlay Signed-off-by: Alvin Xie --- .../arm64/boot/dts/rockchip/overlays/Makefile | 1 + .../rockchip/overlays/radxa-zero3-poe-hat.dts | 55 +++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 arch/arm64/boot/dts/rockchip/overlays/radxa-zero3-poe-hat.dts diff --git a/arch/arm64/boot/dts/rockchip/overlays/Makefile b/arch/arm64/boot/dts/rockchip/overlays/Makefile index 31503671..4d5d1e1a 100644 --- a/arch/arm64/boot/dts/rockchip/overlays/Makefile +++ b/arch/arm64/boot/dts/rockchip/overlays/Makefile @@ -300,6 +300,7 @@ dtb-$(CONFIG_CPU_RK3568) += \ radxa-zero3-radxa-camera-8m.dtbo \ radxa-zero3-rpi-camera-v1.3.dtbo \ radxa-zero3-rpi-camera-v2.dtbo \ + radxa-zero3-poe-hat.dtbo \ radxa-zero3-disabled-ethernet.dtbo \ radxa-zero3-disabled-wireless.dtbo \ rock-3a-radxa-display-8hd.dtbo \ diff --git a/arch/arm64/boot/dts/rockchip/overlays/radxa-zero3-poe-hat.dts b/arch/arm64/boot/dts/rockchip/overlays/radxa-zero3-poe-hat.dts new file mode 100644 index 00000000..9b53cc74 --- /dev/null +++ b/arch/arm64/boot/dts/rockchip/overlays/radxa-zero3-poe-hat.dts @@ -0,0 +1,55 @@ +/dts-v1/; +/plugin/; + +#include +#include +#include +#include + +/ { + metadata { + title = "Enable Radxa ZERO 3E PoE HAT"; + category = "misc"; + compatible = "radxa,zero3"; + description = "Enable Radxa ZERO 3E PoE HAT."; + exclusive = "GPIO3_C3"; + package = "rsetup-config-thermal-governor-step-wise"; + }; +}; + +&{/} { + radxa_poe_pwm: radxa-poe-pwm { + compatible = "pwm-gpio"; + #pwm-cells = <3>; + pwm-gpio = <&gpio3 RK_PC3 GPIO_ACTIVE_HIGH>; + }; + + radxa_poe_fan: radxa-poe-fan { + compatible = "pwm-fan"; + #cooling-cells = <2>; + cooling-min-state = <0>; + cooling-max-state = <4>; + cooling-levels = <0 64 128 192 255>; + pwms = <&radxa_poe_pwm 0 40000 PWM_POLARITY_INVERTED>; + }; +}; + +&threshold { + temperature = <60000>; +}; + +&soc_thermal { + sustainable-power = <5000>; /* milliwatts */ + cooling-maps { + map2 { + trip = <&target>; + cooling-device = <&radxa_poe_fan THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; + contribution = <8192>; + }; + map3 { + trip = <&threshold>; + cooling-device = <&radxa_poe_fan THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; + contribution = <8192>; + }; + }; +}; From 32baacdffa41dab509c53829b8b7ba177c6b72a2 Mon Sep 17 00:00:00 2001 From: Alvin Xie Date: Thu, 16 May 2024 17:43:37 +0800 Subject: [PATCH 2/2] feat: add rock 2a radxa poe overlay Signed-off-by: Alvin Xie --- .../arm64/boot/dts/rockchip/overlays/Makefile | 3 +- .../dts/rockchip/overlays/rock-2a-poe-hat.dts | 61 +++++++++++++++++++ 2 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 arch/arm64/boot/dts/rockchip/overlays/rock-2a-poe-hat.dts diff --git a/arch/arm64/boot/dts/rockchip/overlays/Makefile b/arch/arm64/boot/dts/rockchip/overlays/Makefile index 4d5d1e1a..bcbf8ce5 100644 --- a/arch/arm64/boot/dts/rockchip/overlays/Makefile +++ b/arch/arm64/boot/dts/rockchip/overlays/Makefile @@ -133,7 +133,8 @@ dtb-$(CONFIG_CLK_RK3528) += \ rk3528-uart3-m1.dtbo \ rk3528-uart7-m0.dtbo \ rock-2a-eeprom.dtbo \ - rock-2a-enable-pcie.dtbo + rock-2a-enable-pcie.dtbo \ + rock-2a-poe-hat.dtbo dtb-$(CONFIG_CLK_RK3568) += \ audioinjector-isolated-soundcard.dtbo \ diff --git a/arch/arm64/boot/dts/rockchip/overlays/rock-2a-poe-hat.dts b/arch/arm64/boot/dts/rockchip/overlays/rock-2a-poe-hat.dts new file mode 100644 index 00000000..0d426ba7 --- /dev/null +++ b/arch/arm64/boot/dts/rockchip/overlays/rock-2a-poe-hat.dts @@ -0,0 +1,61 @@ +/dts-v1/; +/plugin/; + +#include +#include +#include +#include + +/ { + metadata { + title = "Enable Radxa 25W PoE+ HAT"; + category = "misc"; + compatible = "radxa,rock-2a"; + description = "Enable Radxa 25W PoE+ HAT."; + exclusive = "GPIO1_B1", "GPIO4_A6"; + package = "rsetup-config-thermal-governor-step-wise"; + }; +}; + +&{/} { + radxa_pow_w1: radxa-poe-w1 { + compatible = "w1-gpio"; + gpios = <&gpio4 RK_PA6 GPIO_ACTIVE_HIGH>; + status = "okay"; + }; + + radxa_poe_pwm: radxa-poe-pwm { + compatible = "pwm-gpio"; + #pwm-cells = <3>; + pwm-gpio = <&gpio1 RK_PB1 GPIO_ACTIVE_HIGH>; + }; + + radxa_poe_fan: radxa-poe-fan { + compatible = "pwm-fan"; + #cooling-cells = <2>; + cooling-min-state = <0>; + cooling-max-state = <4>; + cooling-levels = <0 64 128 192 255>; + pwms = <&radxa_poe_pwm 0 40000 PWM_POLARITY_INVERTED>; + }; +}; + +&threshold { + temperature = <60000>; +}; + +&soc_thermal { + sustainable-power = <5000>; /* milliwatts */ + cooling-maps { + map2 { + trip = <&target>; + cooling-device = <&radxa_poe_fan THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; + contribution = <8192>; + }; + map3 { + trip = <&threshold>; + cooling-device = <&radxa_poe_fan THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; + contribution = <8192>; + }; + }; +};