Bug 256628

Summary: Allwinner aw_thermal error
Product: Base System Reporter: Manuel Stühn <freebsd>
Component: armAssignee: freebsd-arm (Nobody) <freebsd-arm>
Status: Closed Not A Bug    
Severity: Affects Only Me    
Priority: ---    
Version: CURRENT   
Hardware: arm64   
OS: Any   

Description Manuel Stühn 2021-06-15 19:53:05 UTC
aw_thermal seems not to attach properly on my NanoPI NEO2:

root@bsd-neopi:~ # dmesg | grep therm 
aw_thermal0: <Allwinner Thermal Sensor Controller> mem 0x1c25000-0x1c250ff irq 4 on simplebus0
aw_thermal0: Cannot read THS efuse
device_attach: aw_thermal0 attach returned 6
interface aw_thermal.1 already present in the KLD 'kernel'!
root@bsd-neopi:~ # sysctl -n dev.aw_thermal.0.cpu
sysctl: unknown oid 'dev.aw_thermal.0.cpu'
root@bsd-neopi:~ # uname -UKa
FreeBSD bsd-neopi 14.0-CURRENT FreeBSD 14.0-CURRENT #0 main-n247356-715df83abc0: Mon Jun 14 21:20:51 CEST 2021     root@freebsd-current-vm:/usr/obj/usr/src/arm64.aarch64/sys/GENERIC-NODEBUG  arm64 1400023 1400023

I do only have another productive node running an old 13-CURRENT where the driver attaches:
root@nanopi-bsd:~ # cat /var/log/messages | grep therm
Feb 15 11:36:30 nanopi-bsd kernel: aw_thermal0: <Allwinner Thermal Sensor Controller> mem 0x1c25000-0x1c250ff irq 4 on simplebus0
root@nanopi-bsd:~ # uname -aUK
FreeBSD nanopi-bsd 13.0-CURRENT FreeBSD 13.0-CURRENT efa57a39e85(master) GENERIC-NODEBUG  arm64 1300021 1300021
root@nanopi-bsd:~ # sysctl dev.aw_thermal.0
dev.aw_thermal.0.gpu: 42C
dev.aw_thermal.0.cpu: 38C
dev.aw_thermal.0.%parent: simplebus0
dev.aw_thermal.0.%pnpinfo: name=thermal_sensor@1c25000 compat=allwinner,sun50i-h5-ths
dev.aw_thermal.0.%driver: aw_thermal
dev.aw_thermal.0.%desc: Allwinner Thermal Sensor Controller
Comment 1 Manuel Stühn 2021-06-16 07:54:30 UTC
obsolete DT-overlay-files were lurking around in /boot/dts/overlays and got loaded during boot. After removing those, the thermal-driver did work.