sysutils/u-boot - thermal readings for Pine A64(+)

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

sysutils/u-boot - thermal readings for Pine A64(+)

Krystian Lewandowski
Hi ports@,
OpenBSD supports temperature readings for Pine A64 (sxitemp.c,
allwinner,sun50i-a64-ths) but dts file in u-boot port does not contain necessary
entry.

Its based on FreeBSD overlay[1] with small changes (no sensor calibration in OpenBSD
yet).  Built with FLAVOR=aarch64.

before:
$ sysctl hw
hw.machine=arm64
hw.model=ARM Cortex-A53 r0p4
[…]
hw.sensors.axppmic0.temp0=36.28 degC
hw.sensors.axppmic0.indicator0=On (ACIN), OK
hw.sensors.axppmic0.indicator1=Off (VBUS)
[…]
hw.product=Pine64+
[…]

after:
$ sysctl hw
[…]
hw.sensors.axppmic0.temp0=37.45 degC
hw.sensors.axppmic0.indicator0=On (ACIN), OK
hw.sensors.axppmic0.indicator1=Off (VBUS)
hw.sensors.sxitemp0.temp0=43.57 degC (CPU)
hw.sensors.sxitemp0.temp1=43.57 degC (GPU)
hw.sensors.sxitemp0.temp2=44.39 degC
[…]

Krystian

[1] https://github.com/freebsd/freebsd/blob/master/sys/dts/arm64/overlays/sun50i-a64-ths.dtso

Index: patches/patch-arch_arm_dts_sun50i-a64_dtsi
===================================================================
RCS file: patches/patch-arch_arm_dts_sun50i-a64_dtsi
diff -N patches/patch-arch_arm_dts_sun50i-a64_dtsi
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-arch_arm_dts_sun50i-a64_dtsi  29 Jan 2019 17:31:45 -0000
@@ -0,0 +1,24 @@
+$OpenBSD$
+
+Index: arch/arm/dts/sun50i-a64.dtsi
+--- arch/arm/dts/sun50i-a64.dtsi.orig
++++ arch/arm/dts/sun50i-a64.dtsi
+@@ -666,6 +666,18 @@
+                       status = "disabled";
+               };
+
++              ths: thermal-sensor@1c25000 {
++                      compatible = "allwinner,sun50i-a64-ths";
++                      reg = <0x01c25000 0x100>;
++                      interrupts = <GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>;
++                      clocks = <&ccu CLK_BUS_THS>, <&ccu CLK_THS>;
++                      clock-names = "apb", "ths";
++                      resets = <&ccu RST_BUS_THS>;
++                      reset-names = "apb";
++                      #thermal-sensor-cells = <2>;
++                      status = "okay";
++              };
++
+               uart0: serial@1c28000 {
+                       compatible = "snps,dw-apb-uart";
+                       reg = <0x01c28000 0x400>;

Reply | Threaded
Open this post in threaded view
|

Re: sysutils/u-boot - thermal readings for Pine A64(+)

Jonathan Gray-11
On Tue, Jan 29, 2019 at 06:37:57PM +0100, Krystian Lewandowski wrote:
> Hi ports@,
> OpenBSD supports temperature readings for Pine A64 (sxitemp.c,
> allwinner,sun50i-a64-ths) but dts file in u-boot port does not contain necessary
> entry.
>
> Its based on FreeBSD overlay[1] with small changes (no sensor calibration in OpenBSD
> yet).  Built with FLAVOR=aarch64.

I'm not sure we want to carry patches for this as doing it properly would
mean picking up all the other patches for h3, h5, etc and setting it to
enabled on each board going by the proposed devicetree changes which were
not applied as far as I can see.

https://lkml.org/lkml/2018/8/4/32

>
> before:
> $ sysctl hw
> hw.machine=arm64
> hw.model=ARM Cortex-A53 r0p4
> [???]
> hw.sensors.axppmic0.temp0=36.28 degC
> hw.sensors.axppmic0.indicator0=On (ACIN), OK
> hw.sensors.axppmic0.indicator1=Off (VBUS)
> [???]
> hw.product=Pine64+
> [???]
>
> after:
> $ sysctl hw
> [???]
> hw.sensors.axppmic0.temp0=37.45 degC
> hw.sensors.axppmic0.indicator0=On (ACIN), OK
> hw.sensors.axppmic0.indicator1=Off (VBUS)
> hw.sensors.sxitemp0.temp0=43.57 degC (CPU)
> hw.sensors.sxitemp0.temp1=43.57 degC (GPU)
> hw.sensors.sxitemp0.temp2=44.39 degC
> [???]
>
> Krystian
>
> [1] https://github.com/freebsd/freebsd/blob/master/sys/dts/arm64/overlays/sun50i-a64-ths.dtso
>
> Index: patches/patch-arch_arm_dts_sun50i-a64_dtsi
> ===================================================================
> RCS file: patches/patch-arch_arm_dts_sun50i-a64_dtsi
> diff -N patches/patch-arch_arm_dts_sun50i-a64_dtsi
> --- /dev/null   1 Jan 1970 00:00:00 -0000
> +++ patches/patch-arch_arm_dts_sun50i-a64_dtsi  29 Jan 2019 17:31:45 -0000
> @@ -0,0 +1,24 @@
> +$OpenBSD$
> +
> +Index: arch/arm/dts/sun50i-a64.dtsi
> +--- arch/arm/dts/sun50i-a64.dtsi.orig
> ++++ arch/arm/dts/sun50i-a64.dtsi
> +@@ -666,6 +666,18 @@
> +                       status = "disabled";
> +               };
> +
> ++              ths: thermal-sensor@1c25000 {
> ++                      compatible = "allwinner,sun50i-a64-ths";
> ++                      reg = <0x01c25000 0x100>;
> ++                      interrupts = <GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>;
> ++                      clocks = <&ccu CLK_BUS_THS>, <&ccu CLK_THS>;
> ++                      clock-names = "apb", "ths";
> ++                      resets = <&ccu RST_BUS_THS>;
> ++                      reset-names = "apb";
> ++                      #thermal-sensor-cells = <2>;
> ++                      status = "okay";
> ++              };
> ++
> +               uart0: serial@1c28000 {
> +                       compatible = "snps,dw-apb-uart";
> +                       reg = <0x01c28000 0x400>;
>

Reply | Threaded
Open this post in threaded view
|

Re: sysutils/u-boot - thermal readings for Pine A64(+)

Krystian Lewandowski
Wiadomość napisana przez Jonathan Gray <[hidden email]> w dniu 30.01.2019, o godz. 12:40:

>
> On Tue, Jan 29, 2019 at 06:37:57PM +0100, Krystian Lewandowski wrote:
>> Hi ports@,
>> OpenBSD supports temperature readings for Pine A64 (sxitemp.c,
>> allwinner,sun50i-a64-ths) but dts file in u-boot port does not contain necessary
>> entry.
>>
>> Its based on FreeBSD overlay[1] with small changes (no sensor calibration in OpenBSD
>> yet).  Built with FLAVOR=aarch64.
>
> I'm not sure we want to carry patches for this as doing it properly would
> mean picking up all the other patches for h3, h5, etc and setting it to
> enabled on each board going by the proposed devicetree changes which were
> not applied as far as I can see.
>
> https://lkml.org/lkml/2018/8/4/32

I saw this LKML thread.  It seems FreeBSD team adapted these changes because they
already had thermal driver, while Linux didn't.  I could try to provide complete
patch (based on LKML thread and FreeBSD) - cant promise when.  Maybe it would be
a good start for extended sxitemp.c (warnings, critical temp, interrupt based
instead of polling (does it make sense?), FreeBSD even supports throttling and I
noticed apm for ARM64 showed up in the tree - I assume these things are somehow
connected).

If you don't want to see this in the official repo no worries, I can keep it locally
if I'll need it.

Krystian

>>
>> before:
>> $ sysctl hw
>> hw.machine=arm64
>> hw.model=ARM Cortex-A53 r0p4
>> [???]
>> hw.sensors.axppmic0.temp0=36.28 degC
>> hw.sensors.axppmic0.indicator0=On (ACIN), OK
>> hw.sensors.axppmic0.indicator1=Off (VBUS)
>> [???]
>> hw.product=Pine64+
>> [???]
>>
>> after:
>> $ sysctl hw
>> [???]
>> hw.sensors.axppmic0.temp0=37.45 degC
>> hw.sensors.axppmic0.indicator0=On (ACIN), OK
>> hw.sensors.axppmic0.indicator1=Off (VBUS)
>> hw.sensors.sxitemp0.temp0=43.57 degC (CPU)
>> hw.sensors.sxitemp0.temp1=43.57 degC (GPU)
>> hw.sensors.sxitemp0.temp2=44.39 degC
>> [???]
>>
>> Krystian
>>
>> [1] https://github.com/freebsd/freebsd/blob/master/sys/dts/arm64/overlays/sun50i-a64-ths.dtso
>>
>> Index: patches/patch-arch_arm_dts_sun50i-a64_dtsi
>> ===================================================================
>> RCS file: patches/patch-arch_arm_dts_sun50i-a64_dtsi
>> diff -N patches/patch-arch_arm_dts_sun50i-a64_dtsi
>> --- /dev/null   1 Jan 1970 00:00:00 -0000
>> +++ patches/patch-arch_arm_dts_sun50i-a64_dtsi  29 Jan 2019 17:31:45 -0000
>> @@ -0,0 +1,24 @@
>> +$OpenBSD$
>> +
>> +Index: arch/arm/dts/sun50i-a64.dtsi
>> +--- arch/arm/dts/sun50i-a64.dtsi.orig
>> ++++ arch/arm/dts/sun50i-a64.dtsi
>> +@@ -666,6 +666,18 @@
>> +                       status = "disabled";
>> +               };
>> +
>> ++              ths: thermal-sensor@1c25000 {
>> ++                      compatible = "allwinner,sun50i-a64-ths";
>> ++                      reg = <0x01c25000 0x100>;
>> ++                      interrupts = <GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>;
>> ++                      clocks = <&ccu CLK_BUS_THS>, <&ccu CLK_THS>;
>> ++                      clock-names = "apb", "ths";
>> ++                      resets = <&ccu RST_BUS_THS>;
>> ++                      reset-names = "apb";
>> ++                      #thermal-sensor-cells = <2>;
>> ++                      status = "okay";
>> ++              };
>> ++
>> +               uart0: serial@1c28000 {
>> +                       compatible = "snps,dw-apb-uart";
>> +                       reg = <0x01c28000 0x400>;
>>
>

Reply | Threaded
Open this post in threaded view
|

Re: sysutils/u-boot - thermal readings for Pine A64(+)

Krystian Lewandowski
In reply to this post by Jonathan Gray-11


> Wiadomość napisana przez Jonathan Gray <[hidden email]> w dniu 30.01.2019, o godz. 12:40:
>
> On Tue, Jan 29, 2019 at 06:37:57PM +0100, Krystian Lewandowski wrote:
>> Hi ports@,
>> OpenBSD supports temperature readings for Pine A64 (sxitemp.c,
>> allwinner,sun50i-a64-ths) but dts file in u-boot port does not contain necessary
>> entry.
>>
>> Its based on FreeBSD overlay[1] with small changes (no sensor calibration in OpenBSD
>> yet).  Built with FLAVOR=aarch64.
>
> I'm not sure we want to carry patches for this as doing it properly would
> mean picking up all the other patches for h3, h5, etc and setting it to
> enabled on each board going by the proposed devicetree changes which were
> not applied as far as I can see.
>
> https://lkml.org/lkml/2018/8/4/32
>

If you are interested, below is the patch with all changes from LKML thread applied.
I tested a64's u-boot-sunxi-with-spl.bin only (I don't have other boards).

I had to add "sid" entries to h5 and h3 and "ths" entries were not added to two
definitions:
sun50i-a64-teres-i.dts
sun8i-h3-beelink-x2.dts
because they are missing in u-boot at the moment.

FLAVOR=aarch64 builld went fine and I wasnt sure what would be the correct method
to confirm nothing got broken, so I ran "find" on "./build" folder, sorted the output
for port without this patch and without the patch, checked diff - no changes reported.

Krystian

Index: Makefile
===================================================================
RCS file: /cvs/ports/sysutils/u-boot/Makefile,v
retrieving revision 1.51
diff -u -p -r1.51 Makefile
--- Makefile 7 Feb 2019 20:50:18 -0000 1.51
+++ Makefile 12 Feb 2019 20:37:57 -0000
@@ -7,7 +7,7 @@ FLAVOR?= arm
 
 COMMENT= U-Boot firmware
 VERSION= 2019.01
-REVISION= 4
+REVISION= 5
 DISTNAME= u-boot-${VERSION}
 PKGNAME= u-boot-${FLAVOR}-${VERSION:S/-//}
 FULLPKGNAME= ${PKGNAME}
Index: patches/patch-arch_arm_dts_sun50i-a64-amarula-relic_dts
===================================================================
RCS file: patches/patch-arch_arm_dts_sun50i-a64-amarula-relic_dts
diff -N patches/patch-arch_arm_dts_sun50i-a64-amarula-relic_dts
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-arch_arm_dts_sun50i-a64-amarula-relic_dts 12 Feb 2019 20:37:57 -0000
@@ -0,0 +1,16 @@
+$OpenBSD$
+
+Index: arch/arm/dts/sun50i-a64-amarula-relic.dts
+--- arch/arm/dts/sun50i-a64-amarula-relic.dts.orig
++++ arch/arm/dts/sun50i-a64-amarula-relic.dts
+@@ -201,6 +201,10 @@
+ regulator-name = "vcc-rtc";
+ };
+
++&ths {
++ status = "okay";
++};
++
+ &uart0 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&uart0_pb_pins>;
Index: patches/patch-arch_arm_dts_sun50i-a64-bananapi-m64_dts
===================================================================
RCS file: patches/patch-arch_arm_dts_sun50i-a64-bananapi-m64_dts
diff -N patches/patch-arch_arm_dts_sun50i-a64-bananapi-m64_dts
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-arch_arm_dts_sun50i-a64-bananapi-m64_dts 12 Feb 2019 20:37:57 -0000
@@ -0,0 +1,16 @@
+$OpenBSD$
+
+Index: arch/arm/dts/sun50i-a64-bananapi-m64.dts
+--- arch/arm/dts/sun50i-a64-bananapi-m64.dts.orig
++++ arch/arm/dts/sun50i-a64-bananapi-m64.dts
+@@ -326,6 +326,10 @@
+ vcc-hdmi-supply = <&reg_dldo1>;
+ };
+
++&ths {
++ status = "okay";
++};
++
+ &uart0 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&uart0_pb_pins>;
Index: patches/patch-arch_arm_dts_sun50i-a64-nanopi-a64_dts
===================================================================
RCS file: patches/patch-arch_arm_dts_sun50i-a64-nanopi-a64_dts
diff -N patches/patch-arch_arm_dts_sun50i-a64-nanopi-a64_dts
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-arch_arm_dts_sun50i-a64-nanopi-a64_dts 12 Feb 2019 20:37:57 -0000
@@ -0,0 +1,16 @@
+$OpenBSD$
+
+Index: arch/arm/dts/sun50i-a64-nanopi-a64.dts
+--- arch/arm/dts/sun50i-a64-nanopi-a64.dts.orig
++++ arch/arm/dts/sun50i-a64-nanopi-a64.dts
+@@ -276,6 +276,10 @@
+ vcc-hdmi-supply = <&reg_dldo1>;
+ };
+
++&ths {
++ status = "okay";
++};
++
+ &uart0 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&uart0_pb_pins>;
Index: patches/patch-arch_arm_dts_sun50i-a64-olinuxino_dts
===================================================================
RCS file: patches/patch-arch_arm_dts_sun50i-a64-olinuxino_dts
diff -N patches/patch-arch_arm_dts_sun50i-a64-olinuxino_dts
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-arch_arm_dts_sun50i-a64-olinuxino_dts 12 Feb 2019 20:37:57 -0000
@@ -0,0 +1,16 @@
+$OpenBSD$
+
+Index: arch/arm/dts/sun50i-a64-olinuxino.dts
+--- arch/arm/dts/sun50i-a64-olinuxino.dts.orig
++++ arch/arm/dts/sun50i-a64-olinuxino.dts
+@@ -299,6 +299,10 @@
+ vcc-hdmi-supply = <&reg_dldo1>;
+ };
+
++&ths {
++ status = "okay";
++};
++
+ &uart0 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&uart0_pb_pins>;
Index: patches/patch-arch_arm_dts_sun50i-a64-orangepi-win_dts
===================================================================
RCS file: patches/patch-arch_arm_dts_sun50i-a64-orangepi-win_dts
diff -N patches/patch-arch_arm_dts_sun50i-a64-orangepi-win_dts
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-arch_arm_dts_sun50i-a64-orangepi-win_dts 12 Feb 2019 20:37:57 -0000
@@ -0,0 +1,16 @@
+$OpenBSD$
+
+Index: arch/arm/dts/sun50i-a64-orangepi-win.dts
+--- arch/arm/dts/sun50i-a64-orangepi-win.dts.orig
++++ arch/arm/dts/sun50i-a64-orangepi-win.dts
+@@ -322,6 +322,10 @@
+ };
+ };
+
++&ths {
++ status = "okay";
++};
++
+ /* On debug connector */
+ &uart0 {
+ pinctrl-names = "default";
Index: patches/patch-arch_arm_dts_sun50i-a64-pine64_dts
===================================================================
RCS file: patches/patch-arch_arm_dts_sun50i-a64-pine64_dts
diff -N patches/patch-arch_arm_dts_sun50i-a64-pine64_dts
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-arch_arm_dts_sun50i-a64-pine64_dts 12 Feb 2019 20:37:57 -0000
@@ -0,0 +1,16 @@
+$OpenBSD$
+
+Index: arch/arm/dts/sun50i-a64-pine64.dts
+--- arch/arm/dts/sun50i-a64-pine64.dts.orig
++++ arch/arm/dts/sun50i-a64-pine64.dts
+@@ -264,6 +264,10 @@
+ status = "disabled";
+ };
+
++&ths {
++ status = "okay";
++};
++
+ /* On Exp and Euler connectors */
+ &uart0 {
+ pinctrl-names = "default";
Index: patches/patch-arch_arm_dts_sun50i-a64-pinebook_dts
===================================================================
RCS file: patches/patch-arch_arm_dts_sun50i-a64-pinebook_dts
diff -N patches/patch-arch_arm_dts_sun50i-a64-pinebook_dts
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-arch_arm_dts_sun50i-a64-pinebook_dts 12 Feb 2019 20:37:57 -0000
@@ -0,0 +1,16 @@
+$OpenBSD$
+
+Index: arch/arm/dts/sun50i-a64-pinebook.dts
+--- arch/arm/dts/sun50i-a64-pinebook.dts.orig
++++ arch/arm/dts/sun50i-a64-pinebook.dts
+@@ -277,6 +277,10 @@
+ vcc-hdmi-supply = <&reg_dldo1>;
+ };
+
++&ths {
++ status = "okay";
++};
++
+ &uart0 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&uart0_pb_pins>;
Index: patches/patch-arch_arm_dts_sun50i-a64-sopine-baseboard_dts
===================================================================
RCS file: patches/patch-arch_arm_dts_sun50i-a64-sopine-baseboard_dts
diff -N patches/patch-arch_arm_dts_sun50i-a64-sopine-baseboard_dts
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-arch_arm_dts_sun50i-a64-sopine-baseboard_dts 12 Feb 2019 20:37:57 -0000
@@ -0,0 +1,16 @@
+$OpenBSD$
+
+Index: arch/arm/dts/sun50i-a64-sopine-baseboard.dts
+--- arch/arm/dts/sun50i-a64-sopine-baseboard.dts.orig
++++ arch/arm/dts/sun50i-a64-sopine-baseboard.dts
+@@ -164,6 +164,10 @@
+ vcc-hdmi-supply = <&reg_dldo1>;
+ };
+
++&ths {
++ status = "okay";
++};
++
+ &uart0 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&uart0_pb_pins>;
Index: patches/patch-arch_arm_dts_sun50i-a64_dtsi
===================================================================
RCS file: patches/patch-arch_arm_dts_sun50i-a64_dtsi
diff -N patches/patch-arch_arm_dts_sun50i-a64_dtsi
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-arch_arm_dts_sun50i-a64_dtsi 12 Feb 2019 20:37:57 -0000
@@ -0,0 +1,31 @@
+$OpenBSD$
+
+Index: arch/arm/dts/sun50i-a64.dtsi
+--- arch/arm/dts/sun50i-a64.dtsi.orig
++++ arch/arm/dts/sun50i-a64.dtsi
+@@ -405,6 +405,25 @@
+ sid: eeprom@1c14000 {
+ compatible = "allwinner,sun50i-a64-sid";
+ reg = <0x1c14000 0x400>;
++
++ ths_calib: calib@234 {
++ reg = <0x234 0x6>;
++ };
++ };
++
++ ths: thermal-sensor@1c25000 {
++ compatible = "allwinner,sun50i-a64-ths";
++ reg = <0x01c25000 0x100>;
++ interrupts = <GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>;
++ clocks = <&ccu CLK_BUS_THS>, <&ccu CLK_THS>;
++ clock-names = "apb", "ths";
++ resets = <&ccu RST_BUS_THS>;
++ reset-names = "apb";
++ #thermal-sensor-cells = <2>;
++ status = "disabled";
++
++ nvmem-cells = <&ths_calib>;
++ nvmem-cell-names = "ths-calib";
+ };
+
+ usb_otg: usb@1c19000 {
Index: patches/patch-arch_arm_dts_sun50i-h5-nanopi-neo-plus2_dts
===================================================================
RCS file: patches/patch-arch_arm_dts_sun50i-h5-nanopi-neo-plus2_dts
diff -N patches/patch-arch_arm_dts_sun50i-h5-nanopi-neo-plus2_dts
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-arch_arm_dts_sun50i-h5-nanopi-neo-plus2_dts 12 Feb 2019 20:37:57 -0000
@@ -0,0 +1,16 @@
+$OpenBSD$
+
+Index: arch/arm/dts/sun50i-h5-nanopi-neo-plus2.dts
+--- arch/arm/dts/sun50i-h5-nanopi-neo-plus2.dts.orig
++++ arch/arm/dts/sun50i-h5-nanopi-neo-plus2.dts
+@@ -189,6 +189,10 @@
+ status = "okay";
+ };
+
++&ths {
++ status = "okay";
++};
++
+ &uart0 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&uart0_pins_a>;
Index: patches/patch-arch_arm_dts_sun50i-h5-nanopi-neo2_dts
===================================================================
RCS file: patches/patch-arch_arm_dts_sun50i-h5-nanopi-neo2_dts
diff -N patches/patch-arch_arm_dts_sun50i-h5-nanopi-neo2_dts
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-arch_arm_dts_sun50i-h5-nanopi-neo2_dts 12 Feb 2019 20:37:57 -0000
@@ -0,0 +1,16 @@
+$OpenBSD$
+
+Index: arch/arm/dts/sun50i-h5-nanopi-neo2.dts
+--- arch/arm/dts/sun50i-h5-nanopi-neo2.dts.orig
++++ arch/arm/dts/sun50i-h5-nanopi-neo2.dts
+@@ -140,6 +140,10 @@
+ status = "okay";
+ };
+
++&ths {
++ status = "okay";
++};
++
+ &uart0 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&uart0_pins_a>;
Index: patches/patch-arch_arm_dts_sun50i-h5-orangepi-pc2_dts
===================================================================
RCS file: patches/patch-arch_arm_dts_sun50i-h5-orangepi-pc2_dts
diff -N patches/patch-arch_arm_dts_sun50i-h5-orangepi-pc2_dts
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-arch_arm_dts_sun50i-h5-orangepi-pc2_dts 12 Feb 2019 20:37:57 -0000
@@ -0,0 +1,16 @@
+$OpenBSD$
+
+Index: arch/arm/dts/sun50i-h5-orangepi-pc2.dts
+--- arch/arm/dts/sun50i-h5-orangepi-pc2.dts.orig
++++ arch/arm/dts/sun50i-h5-orangepi-pc2.dts
+@@ -219,6 +219,10 @@
+ };
+ };
+
++&ths {
++ status = "okay";
++};
++
+ &uart0 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&uart0_pins_a>;
Index: patches/patch-arch_arm_dts_sun50i-h5-orangepi-prime_dts
===================================================================
RCS file: patches/patch-arch_arm_dts_sun50i-h5-orangepi-prime_dts
diff -N patches/patch-arch_arm_dts_sun50i-h5-orangepi-prime_dts
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-arch_arm_dts_sun50i-h5-orangepi-prime_dts 12 Feb 2019 20:37:57 -0000
@@ -0,0 +1,16 @@
+$OpenBSD$
+
+Index: arch/arm/dts/sun50i-h5-orangepi-prime.dts
+--- arch/arm/dts/sun50i-h5-orangepi-prime.dts.orig
++++ arch/arm/dts/sun50i-h5-orangepi-prime.dts
+@@ -222,6 +222,10 @@
+ status = "okay";
+ };
+
++&ths {
++ status = "okay";
++};
++
+ &uart0 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&uart0_pins_a>;
Index: patches/patch-arch_arm_dts_sun50i-h5-orangepi-zero-plus2_dts
===================================================================
RCS file: patches/patch-arch_arm_dts_sun50i-h5-orangepi-zero-plus2_dts
diff -N patches/patch-arch_arm_dts_sun50i-h5-orangepi-zero-plus2_dts
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-arch_arm_dts_sun50i-h5-orangepi-zero-plus2_dts 12 Feb 2019 20:37:57 -0000
@@ -0,0 +1,16 @@
+$OpenBSD$
+
+Index: arch/arm/dts/sun50i-h5-orangepi-zero-plus2.dts
+--- arch/arm/dts/sun50i-h5-orangepi-zero-plus2.dts.orig
++++ arch/arm/dts/sun50i-h5-orangepi-zero-plus2.dts
+@@ -132,6 +132,10 @@
+ status = "okay";
+ };
+
++&ths {
++ status = "okay";
++};
++
+ &uart0 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&uart0_pins_a>;
Index: patches/patch-arch_arm_dts_sun50i-h5-orangepi-zero-plus_dts
===================================================================
RCS file: patches/patch-arch_arm_dts_sun50i-h5-orangepi-zero-plus_dts
diff -N patches/patch-arch_arm_dts_sun50i-h5-orangepi-zero-plus_dts
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-arch_arm_dts_sun50i-h5-orangepi-zero-plus_dts 12 Feb 2019 20:37:57 -0000
@@ -0,0 +1,16 @@
+$OpenBSD$
+
+Index: arch/arm/dts/sun50i-h5-orangepi-zero-plus.dts
+--- arch/arm/dts/sun50i-h5-orangepi-zero-plus.dts.orig
++++ arch/arm/dts/sun50i-h5-orangepi-zero-plus.dts
+@@ -125,6 +125,10 @@
+ status = "okay";
+ };
+
++&ths {
++ status = "okay";
++};
++
+ &uart0 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&uart0_pins_a>;
Index: patches/patch-arch_arm_dts_sun50i-h5_dtsi
===================================================================
RCS file: patches/patch-arch_arm_dts_sun50i-h5_dtsi
diff -N patches/patch-arch_arm_dts_sun50i-h5_dtsi
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-arch_arm_dts_sun50i-h5_dtsi 12 Feb 2019 20:37:57 -0000
@@ -0,0 +1,38 @@
+$OpenBSD$
+
+Index: arch/arm/dts/sun50i-h5.dtsi
+--- arch/arm/dts/sun50i-h5.dtsi.orig
++++ arch/arm/dts/sun50i-h5.dtsi
+@@ -92,6 +92,32 @@
+     <GIC_PPI 10
+ (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>;
+ };
++
++ soc {
++ sid: eeprom@1c14000 {
++ compatible = "allwinner,sun50i-h5-sid";
++ reg = <0x1c14000 0x400>;
++
++ ths_calib: calib@234 {
++ reg = <0x234 0x4>;
++ };
++ };
++
++ ths: thermal-sensor@1c25000 {
++ compatible = "allwinner,sun50i-h5-ths";
++ reg = <0x01c25000 0x100>;
++ interrupts = <GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>;
++ clocks = <&ccu CLK_BUS_THS>, <&ccu CLK_THS>;
++ clock-names = "apb", "ths";
++ resets = <&ccu RST_BUS_THS>;
++ reset-names = "apb";
++ #thermal-sensor-cells = <1>;
++ status = "disabled";
++
++ nvmem-cells = <&ths_calib>;
++ nvmem-cell-names = "ths-calib";
++ };
++ };
+ };
+
+ &ccu {
Index: patches/patch-arch_arm_dts_sun8i-h3-bananapi-m2-plus_dts
===================================================================
RCS file: patches/patch-arch_arm_dts_sun8i-h3-bananapi-m2-plus_dts
diff -N patches/patch-arch_arm_dts_sun8i-h3-bananapi-m2-plus_dts
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-arch_arm_dts_sun8i-h3-bananapi-m2-plus_dts 12 Feb 2019 20:37:57 -0000
@@ -0,0 +1,16 @@
+$OpenBSD$
+
+Index: arch/arm/dts/sun8i-h3-bananapi-m2-plus.dts
+--- arch/arm/dts/sun8i-h3-bananapi-m2-plus.dts.orig
++++ arch/arm/dts/sun8i-h3-bananapi-m2-plus.dts
+@@ -211,6 +211,10 @@
+ status = "okay";
+ };
+
++&ths {
++ status = "okay";
++};
++
+ &uart0 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&uart0_pins_a>;
Index: patches/patch-arch_arm_dts_sun8i-h3-nanopi-m1-plus_dts
===================================================================
RCS file: patches/patch-arch_arm_dts_sun8i-h3-nanopi-m1-plus_dts
diff -N patches/patch-arch_arm_dts_sun8i-h3-nanopi-m1-plus_dts
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-arch_arm_dts_sun8i-h3-nanopi-m1-plus_dts 12 Feb 2019 20:37:57 -0000
@@ -0,0 +1,16 @@
+$OpenBSD$
+
+Index: arch/arm/dts/sun8i-h3-nanopi-m1-plus.dts
+--- arch/arm/dts/sun8i-h3-nanopi-m1-plus.dts.orig
++++ arch/arm/dts/sun8i-h3-nanopi-m1-plus.dts
+@@ -135,6 +135,10 @@
+ status = "okay";
+ };
+
++&ths {
++ status = "okay";
++};
++
+ &uart3 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&uart3_pins>, <&uart3_rts_cts_pins>;
Index: patches/patch-arch_arm_dts_sun8i-h3-nanopi-m1_dts
===================================================================
RCS file: patches/patch-arch_arm_dts_sun8i-h3-nanopi-m1_dts
diff -N patches/patch-arch_arm_dts_sun8i-h3-nanopi-m1_dts
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-arch_arm_dts_sun8i-h3-nanopi-m1_dts 12 Feb 2019 20:37:57 -0000
@@ -0,0 +1,13 @@
+$OpenBSD$
+
+Index: arch/arm/dts/sun8i-h3-nanopi-m1.dts
+--- arch/arm/dts/sun8i-h3-nanopi-m1.dts.orig
++++ arch/arm/dts/sun8i-h3-nanopi-m1.dts
+@@ -104,3 +104,7 @@
+ &ohci2 {
+ status = "okay";
+ };
++
++&ths {
++ status = "okay";
++};
Index: patches/patch-arch_arm_dts_sun8i-h3-nanopi-neo-air_dts
===================================================================
RCS file: patches/patch-arch_arm_dts_sun8i-h3-nanopi-neo-air_dts
diff -N patches/patch-arch_arm_dts_sun8i-h3-nanopi-neo-air_dts
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-arch_arm_dts_sun8i-h3-nanopi-neo-air_dts 12 Feb 2019 20:37:57 -0000
@@ -0,0 +1,16 @@
+$OpenBSD$
+
+Index: arch/arm/dts/sun8i-h3-nanopi-neo-air.dts
+--- arch/arm/dts/sun8i-h3-nanopi-neo-air.dts.orig
++++ arch/arm/dts/sun8i-h3-nanopi-neo-air.dts
+@@ -103,6 +103,10 @@
+ };
+ };
+
++&ths {
++ status = "okay";
++};
++
+ &uart0 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&uart0_pins_a>;
Index: patches/patch-arch_arm_dts_sun8i-h3-nanopi-neo_dts
===================================================================
RCS file: patches/patch-arch_arm_dts_sun8i-h3-nanopi-neo_dts
diff -N patches/patch-arch_arm_dts_sun8i-h3-nanopi-neo_dts
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-arch_arm_dts_sun8i-h3-nanopi-neo_dts 12 Feb 2019 20:37:57 -0000
@@ -0,0 +1,16 @@
+$OpenBSD$
+
+Index: arch/arm/dts/sun8i-h3-nanopi-neo.dts
+--- arch/arm/dts/sun8i-h3-nanopi-neo.dts.orig
++++ arch/arm/dts/sun8i-h3-nanopi-neo.dts
+@@ -62,6 +62,10 @@
+ status = "okay";
+ };
+
++&ths {
++ status = "okay";
++};
++
+ &usb_otg {
+ status = "okay";
+ dr_mode = "peripheral";
Index: patches/patch-arch_arm_dts_sun8i-h3-nanopi_dtsi
===================================================================
RCS file: patches/patch-arch_arm_dts_sun8i-h3-nanopi_dtsi
diff -N patches/patch-arch_arm_dts_sun8i-h3-nanopi_dtsi
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-arch_arm_dts_sun8i-h3-nanopi_dtsi 12 Feb 2019 20:37:57 -0000
@@ -0,0 +1,16 @@
+$OpenBSD$
+
+Index: arch/arm/dts/sun8i-h3-nanopi.dtsi
+--- arch/arm/dts/sun8i-h3-nanopi.dtsi.orig
++++ arch/arm/dts/sun8i-h3-nanopi.dtsi
+@@ -123,6 +123,10 @@
+ };
+ };
+
++&ths {
++ status = "okay";
++};
++
+ &uart0 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&uart0_pins_a>;
Index: patches/patch-arch_arm_dts_sun8i-h3-orangepi-2_dts
===================================================================
RCS file: patches/patch-arch_arm_dts_sun8i-h3-orangepi-2_dts
diff -N patches/patch-arch_arm_dts_sun8i-h3-orangepi-2_dts
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-arch_arm_dts_sun8i-h3-orangepi-2_dts 12 Feb 2019 20:37:57 -0000
@@ -0,0 +1,16 @@
+$OpenBSD$
+
+Index: arch/arm/dts/sun8i-h3-orangepi-2.dts
+--- arch/arm/dts/sun8i-h3-orangepi-2.dts.orig
++++ arch/arm/dts/sun8i-h3-orangepi-2.dts
+@@ -208,6 +208,10 @@
+ status = "okay";
+ };
+
++&ths {
++ status = "okay";
++};
++
+ &uart0 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&uart0_pins_a>;
Index: patches/patch-arch_arm_dts_sun8i-h3-orangepi-lite_dts
===================================================================
RCS file: patches/patch-arch_arm_dts_sun8i-h3-orangepi-lite_dts
diff -N patches/patch-arch_arm_dts_sun8i-h3-orangepi-lite_dts
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-arch_arm_dts_sun8i-h3-orangepi-lite_dts 12 Feb 2019 20:37:57 -0000
@@ -0,0 +1,16 @@
+$OpenBSD$
+
+Index: arch/arm/dts/sun8i-h3-orangepi-lite.dts
+--- arch/arm/dts/sun8i-h3-orangepi-lite.dts.orig
++++ arch/arm/dts/sun8i-h3-orangepi-lite.dts
+@@ -179,6 +179,10 @@
+ };
+ };
+
++&ths {
++ status = "okay";
++};
++
+ &uart0 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&uart0_pins_a>;
Index: patches/patch-arch_arm_dts_sun8i-h3-orangepi-one_dts
===================================================================
RCS file: patches/patch-arch_arm_dts_sun8i-h3-orangepi-one_dts
diff -N patches/patch-arch_arm_dts_sun8i-h3-orangepi-one_dts
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-arch_arm_dts_sun8i-h3-orangepi-one_dts 12 Feb 2019 20:37:57 -0000
@@ -0,0 +1,16 @@
+$OpenBSD$
+
+Index: arch/arm/dts/sun8i-h3-orangepi-one.dts
+--- arch/arm/dts/sun8i-h3-orangepi-one.dts.orig
++++ arch/arm/dts/sun8i-h3-orangepi-one.dts
+@@ -190,6 +190,10 @@
+ status = "okay";
+ };
+
++&ths {
++ status = "okay";
++};
++
+ &uart0 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&uart0_pins_a>;
Index: patches/patch-arch_arm_dts_sun8i-h3-orangepi-pc-plus_dts
===================================================================
RCS file: patches/patch-arch_arm_dts_sun8i-h3-orangepi-pc-plus_dts
diff -N patches/patch-arch_arm_dts_sun8i-h3-orangepi-pc-plus_dts
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-arch_arm_dts_sun8i-h3-orangepi-pc-plus_dts 12 Feb 2019 20:37:57 -0000
@@ -0,0 +1,13 @@
+$OpenBSD$
+
+Index: arch/arm/dts/sun8i-h3-orangepi-pc-plus.dts
+--- arch/arm/dts/sun8i-h3-orangepi-pc-plus.dts.orig
++++ arch/arm/dts/sun8i-h3-orangepi-pc-plus.dts
+@@ -89,3 +89,7 @@
+ /* eMMC is missing pull-ups */
+ bias-pull-up;
+ };
++
++&ths {
++ status = "okay";
++};
Index: patches/patch-arch_arm_dts_sun8i-h3-orangepi-pc_dts
===================================================================
RCS file: patches/patch-arch_arm_dts_sun8i-h3-orangepi-pc_dts
diff -N patches/patch-arch_arm_dts_sun8i-h3-orangepi-pc_dts
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-arch_arm_dts_sun8i-h3-orangepi-pc_dts 12 Feb 2019 20:37:57 -0000
@@ -0,0 +1,16 @@
+$OpenBSD$
+
+Index: arch/arm/dts/sun8i-h3-orangepi-pc.dts
+--- arch/arm/dts/sun8i-h3-orangepi-pc.dts.orig
++++ arch/arm/dts/sun8i-h3-orangepi-pc.dts
+@@ -227,6 +227,10 @@
+ status = "okay";
+ };
+
++&ths {
++ status = "okay";
++};
++
+ &uart0 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&uart0_pins_a>;
Index: patches/patch-arch_arm_dts_sun8i-h3-orangepi-plus2e_dts
===================================================================
RCS file: patches/patch-arch_arm_dts_sun8i-h3-orangepi-plus2e_dts
diff -N patches/patch-arch_arm_dts_sun8i-h3-orangepi-plus2e_dts
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-arch_arm_dts_sun8i-h3-orangepi-plus2e_dts 12 Feb 2019 20:37:57 -0000
@@ -0,0 +1,13 @@
+$OpenBSD$
+
+Index: arch/arm/dts/sun8i-h3-orangepi-plus2e.dts
+--- arch/arm/dts/sun8i-h3-orangepi-plus2e.dts.orig
++++ arch/arm/dts/sun8i-h3-orangepi-plus2e.dts
+@@ -77,3 +77,7 @@
+ reg = <1>;
+ };
+ };
++
++&ths {
++ status = "okay";
++};
Index: patches/patch-arch_arm_dts_sun8i-h3-orangepi-plus_dts
===================================================================
RCS file: patches/patch-arch_arm_dts_sun8i-h3-orangepi-plus_dts
diff -N patches/patch-arch_arm_dts_sun8i-h3-orangepi-plus_dts
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-arch_arm_dts_sun8i-h3-orangepi-plus_dts 12 Feb 2019 20:37:57 -0000
@@ -0,0 +1,16 @@
+$OpenBSD$
+
+Index: arch/arm/dts/sun8i-h3-orangepi-plus.dts
+--- arch/arm/dts/sun8i-h3-orangepi-plus.dts.orig
++++ arch/arm/dts/sun8i-h3-orangepi-plus.dts
+@@ -119,6 +119,10 @@
+ };
+ };
+
++&ths {
++ status = "okay";
++};
++
+ &usbphy {
+ usb3_vbus-supply = <&reg_usb3_vbus>;
+ };
Index: patches/patch-arch_arm_dts_sun8i-h3_dtsi
===================================================================
RCS file: patches/patch-arch_arm_dts_sun8i-h3_dtsi
diff -N patches/patch-arch_arm_dts_sun8i-h3_dtsi
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-arch_arm_dts_sun8i-h3_dtsi 12 Feb 2019 20:37:57 -0000
@@ -0,0 +1,36 @@
+$OpenBSD$
+
+Index: arch/arm/dts/sun8i-h3.dtsi
+--- arch/arm/dts/sun8i-h3.dtsi.orig
++++ arch/arm/dts/sun8i-h3.dtsi
+@@ -142,6 +142,30 @@
+ };
+ };
+
++ sid: eeprom@1c14000 {
++ compatible = "allwinner,sun8i-h3-sid";
++ reg = <0x1c14000 0x400>;
++
++ ths_calib: calib@234 {
++ reg = <0x234 0x2>;
++ };
++ };
++
++ ths: thermal-sensor@1c25000 {
++ compatible = "allwinner,sun8i-h3-ths";
++ reg = <0x01c25000 0x100>;
++ interrupts = <GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>;
++ clocks = <&ccu CLK_BUS_THS>, <&ccu CLK_THS>;
++ clock-names = "apb", "ths";
++ resets = <&ccu RST_BUS_THS>;
++ reset-names = "apb";
++ #thermal-sensor-cells = <0>;
++ status = "disabled";
++
++ nvmem-cells = <&ths_calib>;
++ nvmem-cell-names = "ths-calib";
++ };
++
+ mali: gpu@1c40000 {
+ compatible = "allwinner,sun8i-h3-mali", "arm,mali-400";
+ reg = <0x01c40000 0x10000>;