Wiadomość napisana przez Jonathan Gray <[email protected]> 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>; >> >
