6

The current config.txt allows one to change arm_freq, gpu_freq, core_freq, h264_freq, isp_freq, and v3d_freq. In addition, there is support for the kernel to change clocks on demand and based on thermal limits.

On the other hand, the hardware peripheral clock is described as:

The Raspberry Pi runs the BCM2835 with a core clock of 250MHz. This is relevant for the peripheral modules like I2C, SPI and Timer ( ARM side ) for calculating the desired clock rate.

Elsewhere, this is described as the Advanced Peripheral Bus (APB) clock, and references are made to APB clock domain.

Now, my questions are:

  • Do any of the config.txt settings affect the APB clock used for SPI?
  • Does on demand cpufreq changing affect the APB clock used for SPI?
  • Is there a way to determine this clock from Linux userland, or should it be hardcoded to 250 MHz for all current and future Raspberry Pi's?
Dave Tweed
  • 171
  • 4
  • 8
Nakedible
  • 1,561
  • 1
  • 13
  • 18

1 Answers1

2

I believe core_freq is a setting responsible for that clock as I saw some foundation members mentioning APB is a internal clock driven by GPU (but I haven't found a definitive proof for that). You should not threat it like a static value but I don't know how it can be determined from userspace.

Also by default, if turbo_mode=0, cpufreq will be changed according to system load. It should be between core_freq_min and core_freq which both, defaults to 250.

On the other hand, kernel SPI driver seems to be using sdhost_clk (according to arch/arm/mach-bcm2708/bcm2708.c file) clock which seems to be set as static 250Mhz. cpufreq driver does not change this value (as far as I can see, it only sets ARM clock but it is doing this through GPU which may adjust other frequencies by itself automatically).

Krzysztof Adamski
  • 9,605
  • 1
  • 38
  • 53