Raspberry pi 5 status

Turning the fan off doesn't appear to work except by unloading the driver.
Well, except that it doesn't work either. I can unload the rpi5 module, the bcm2712 module, but the fan just keeps on going. Only if I frestrt the Pi 5 does the fan stop (I load the modules manually for now).
 
One other thing:
- there is a bcm2712 kernel module which apparently does read the temperature sensor, and also control pwm.
- there is a rpi5 module, which implements the fan control

but rumors have it that on the Pi 5 the fan is controlled by the rp1 co-processor....
The code does contain the files rp1_pwm_driver.c and Makefile.thermal but if I try to compile it
Code:
tingo@devpi5:~/work/projects/FreeBSD/FreeBSD15-RPi5-modules $ make -f Makefile.thermal
Warning: Object directory not changed from original /home/tingo/work/projects/FreeBSD/FreeBSD15-RPi5-modules
cc  -O2 -pipe  -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE -nostdinc   -include /home/tingo/work/projects/FreeBSD/FreeBSD15-RPi5-modules/opt_global.h -I. -I/usr/src/sys -I/usr/src/sys/contrib/ck/include -fno-common  -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fPIC -ffile-prefix-map=/usr/src/sys=/usr/src/sys -ffile-prefix-map=/home/tingo/work/projects/FreeBSD/FreeBSD15-RPi5-modules=/usr/obj/usr/src/arm64.aarch64/sys/modules/FreeBSD15-RPi5-modules -fdebug-prefix-map=./machine=/usr/src/sys/arm64/include     -MD  -MF.depend.rpi5_cooling_fan_integrated.o -MTrpi5_cooling_fan_integrated.o -mgeneral-regs-only -ffixed-x18 -mno-outline-atomics -ffreestanding -fwrapv -fstack-protector -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wcast-qual -Wundef -Wno-pointer-sign -D__printf__=__freebsd_kprintf__ -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas -Wno-error=tautological-compare -Wno-error=empty-body -Wno-error=parentheses-equality -Wno-error=unused-function -Wno-error=pointer-sign -Wno-error=shift-negative-value -Wno-address-of-packed-member -Wno-format-zero-length     -std=gnu99 -c rpi5_cooling_fan_integrated.c -o rpi5_cooling_fan_integrated.o
In file included from rpi5_cooling_fan_integrated.c:23:
/usr/src/sys/dev/pwm/pwmbus.h:58:1: error: call to undeclared function 'BUS_READ_IVAR'; ISO C99 and later do not support implicit function declarations [-Werror,-Wimplicit-function-declaration]
   58 | PWMBUS_ACCESSOR(channel, CHANNEL, u_int)
      | ^
/usr/src/sys/dev/pwm/pwmbus.h:48:9: note: expanded from macro 'PWMBUS_ACCESSOR'
   48 |         return BUS_READ_IVAR(device_get_parent(dev), dev,               \
      |                ^
/usr/src/sys/dev/pwm/pwmbus.h:58:1: error: call to undeclared function 'device_get_parent'; ISO C99 and later do not support implicit function declarations [-Werror,-Wimplicit-function-declaration]
/usr/src/sys/dev/pwm/pwmbus.h:48:23: note: expanded from macro 'PWMBUS_ACCESSOR'
   48 |         return BUS_READ_IVAR(device_get_parent(dev), dev,               \
      |                              ^
/usr/src/sys/dev/pwm/pwmbus.h:58:1: error: call to undeclared function 'BUS_WRITE_IVAR'; ISO C99 and later do not support implicit function declarations [-Werror,-Wimplicit-function-declaration]
/usr/src/sys/dev/pwm/pwmbus.h:54:9: note: expanded from macro 'PWMBUS_ACCESSOR'
   54 |         return BUS_WRITE_IVAR(device_get_parent(dev), dev,              \
      |                ^
/usr/src/sys/dev/pwm/pwmbus.h:58:1: error: call to undeclared function 'device_get_parent'; ISO C99 and later do not support implicit function declarations [-Werror,-Wimplicit-function-declaration]
/usr/src/sys/dev/pwm/pwmbus.h:54:24: note: expanded from macro 'PWMBUS_ACCESSOR'
   54 |         return BUS_WRITE_IVAR(device_get_parent(dev), dev,              \
      |                               ^
/usr/src/sys/dev/pwm/pwmbus.h:66:8: error: unknown type name 'driver_t'
   66 | extern driver_t   pwmbus_driver;
      |        ^
/usr/src/sys/dev/pwm/pwmbus.h:67:8: error: unknown type name 'driver_t'
   67 | extern driver_t   ofw_pwmbus_driver;
      |        ^
rpi5_cooling_fan_integrated.c:104:2: error: use of undeclared identifier 'FILE'
  104 |         FILE *fp;
      |         ^
rpi5_cooling_fan_integrated.c:104:8: error: use of undeclared identifier 'fp'
  104 |         FILE *fp;
      |               ^
rpi5_cooling_fan_integrated.c:206:11: error: call to undeclared function 'PWMBUS_CHANNEL_CONFIG'; ISO C99 and later do not support implicit function declarations [-Werror,-Wimplicit-function-declaration]
  206 |                 error = PWMBUS_CHANNEL_CONFIG(cooling_fan.pwm_dev, 
      |                         ^
rpi5_cooling_fan_integrated.c:212:5: error: call to undeclared function 'PWMBUS_CHANNEL_ENABLE'; ISO C99 and later do not support implicit function declarations [-Werror,-Wimplicit-function-declaration]
  212 |                                 PWMBUS_CHANNEL_ENABLE(cooling_fan.pwm_dev,
      |                                 ^
rpi5_cooling_fan_integrated.c:138:11: error: unused variable 'thresh' [-Werror,-Wunused-variable]
  138 |         uint32_t thresh, hyst, speed;
      |                  ^~~~~~
rpi5_cooling_fan_integrated.c:138:19: error: unused variable 'hyst' [-Werror,-Wunused-variable]
  138 |         uint32_t thresh, hyst, speed;
      |                          ^~~~
rpi5_cooling_fan_integrated.c:138:25: error: unused variable 'speed' [-Werror,-Wunused-variable]
  138 |         uint32_t thresh, hyst, speed;
      |                                ^~~~~
rpi5_cooling_fan_integrated.c:500:4: error: call to undeclared function 'PWMBUS_CHANNEL_ENABLE'; ISO C99 and later do not support implicit function declarations [-Werror,-Wimplicit-function-declaration]
  500 |                         PWMBUS_CHANNEL_ENABLE(cooling_fan.pwm_dev, 
      |                         ^
14 errors generated.
*** Error code 1

Stop.
make: stopped making "all" in /home/tingo/work/projects/FreeBSD/FreeBSD15-RPi5-modules
I will submit issues on github.
 
Back
Top