cleverca22
Posts: 4732
Joined: Sat Aug 18, 2012 2:33 pm

how to bind a clock source to cpufreq

Sun Sep 19, 2021 8:29 am

i have a clock already registered in linux's clock management system:

Code: Select all

[root@nixos:~]# cat /sys/kernel/debug/clk/pllb_arm/clk_rate 
249999999
[root@nixos:~]# cat /sys/kernel/debug/clk/pllb_arm/regdump 
cm = 0x00000000
a2w = 0x00000004
[root@nixos:~]# cat /sys/kernel/debug/clk/pllb_arm/clk_min_rate 
0
[root@nixos:~]# cat /sys/kernel/debug/clk/pllb_arm/clk_max_rate 
4294967295
from device-tree, how would i tell linux to manipulate that clock, based on what cpufreq wants?

for example:

Code: Select all

clocks = <&clocks BCM2835_CLOCK_UART>;
this is telling linux that a given clock within a device described elsewhere, is driving the ttyAMA0 uart

and i know that the clock in question is using the BCM2835_PLLB_ARM constant


poking around in other boards dts files, i can see a clocks= being added to the cpu node, just like my example
but doing so, in combination with a operating-points, doesnt have any useful effect

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 4125
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: how to bind a clock source to cpufreq

Sun Sep 19, 2021 11:01 am

From what I remember there is no explicit link from cpufreq to the relevant clock. Instead, cpufreq knows how to locate the CPUs and their clock(s).

cleverca22
Posts: 4732
Joined: Sat Aug 18, 2012 2:33 pm

Re: how to bind a clock source to cpufreq

Sun Sep 19, 2021 11:18 pm

ah, so i should just need to somehow force cpufreq into loading, and then the clocks= and operating-points= should kick into gear?

but ive already built the kernel with cpufreq built in

Return to “Device Tree”