Buildroot sysfs cpufreq and thermal folder

1.1k Views Asked by At

Hi I am trying to access the frequency and thermal statistics for orange pi zero board runing Buildroot using the sysfs interface. I have enabled freq scaling and Thermal sysfs driver in linux-menuconfig but I dont see the folder cpufreq getting created at all and the thermal folder is empty.

Their paths should be

/sys/devices/system/cpu/cpu0/cpufreq
/sys/class/thermal/

I am not sure if anything needs to be done in the init script to create these files. I have also looked in armbian(runing a version on orange pi zero as reference) and I can see the folders and files getting created correctly. I think armbian downloads cpufrequtils in the background to get the frequency statistics.

I think powertop from busy box is an option but I still want to use the sysfs interface and powertop will not give me thermal statistics. Any help will be deeply appreciated

Edit: Just tried powertop with root privileges which fails with error

 no stats available; run as root or enable the timer_stats module
 C-state information is not available

The following are options enabled from linux-menuconfig ThermalConfig CputFrqConfig

2

There are 2 best solutions below

0
On BEST ANSWER

After going through the source code I see that the device tree for the orange pi zero board is not up to date in Buildroot. The Armbian device tree has thermal_zones and frequency scaling added in the device tree. Guess I will try updating the device tree and check if that works.

So Once you update the device tree even the driver is out of date. Weird as the kernel version for Buildroot is 4.15 and Armbian is 4.14. After updating the driver everything seems to work.

3
On

This question has nothing to do with Buildroot. Buildroot mounts the sysfs filesystem at boot time in /sys. The contents of the sysfs filesystem only depends on the Linux kernel and its configuration. If you don't have thermal and cpufreq in sysfs, it's because your kernel configuration and/or platform don't support those features.