$OpenBSD: patch-arch_arm_dts_rk3399-rockpro64_dtsi,v 1.1 2020/07/07 08:26:26 jsg Exp $

Set baud rate, enable fan control and PCIe gen2.

Index: arch/arm/dts/rk3399-rockpro64.dtsi
--- arch/arm/dts/rk3399-rockpro64.dtsi.orig
+++ arch/arm/dts/rk3399-rockpro64.dtsi
@@ -11,7 +11,7 @@
 
 / {
 	chosen {
-		stdout-path = "serial2:1500000n8";
+		stdout-path = "serial2:115200n8";
 	};
 
 	clkin_gmac: external-gmac-clock {
@@ -56,6 +56,7 @@
 
 	fan: pwm-fan {
 		compatible = "pwm-fan";
+		cooling-levels = <0 40 80 255>;
 		#cooling-cells = <2>;
 		fan-supply = <&vcc12v_dcin>;
 		pwms = <&pwm1 0 50000 0>;
@@ -525,6 +526,7 @@
 
 &pcie0 {
 	ep-gpios = <&gpio2 RK_PD4 GPIO_ACTIVE_HIGH>;
+	max-link-speed = <2>;
 	num-lanes = <4>;
 	pinctrl-names = "default";
 	pinctrl-0 = <&pcie_perst>;
@@ -794,4 +796,43 @@
 
 &vopl_mmu {
 	status = "okay";
+};
+
+&cpu_thermal {
+	trips {
+		cpu_warm: cpu_warm {
+			temperature = <55000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+
+		cpu_med: cpu_med {
+			temperature = <60000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+
+		cpu_hot: cpu_hot {
+			temperature = <65000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+	};
+
+	cooling-maps {
+		map2 {
+			trip = <&cpu_warm>;
+			cooling-device = <&fan THERMAL_NO_LIMIT 1>;
+		};
+
+		map3 {
+			trip = <&cpu_med>;
+			cooling-device = <&fan THERMAL_NO_LIMIT 2>;
+		};
+
+		map4 {
+			trip = <&cpu_hot>;
+			cooling-device = <&fan 2 THERMAL_NO_LIMIT>;
+		};
+	};
 };
