[RFC 0/5] cpufreq enablement update

Nicolas Saenz Julienne nsaenzjulienne at suse.de
Wed Apr 3 07:39:00 PDT 2019

Here's a small update on how the enablement is doing. There is enough
done so a review is worth it. I'm specially interested on having some
opinions on the overall architecture.

Apart from adding a regular cpufreq driver the series tackles the issue
of correcting the clock configuration on all the devices that depend on
the VPU clock, which is updated by RPi's firmware anytime we submit a
performance requirement.

As the clock registers are updated by the firmware, I marked all the
relevant ones as non-cached in RPi's clk & clk-aux drivers. This forces
the clock core to read the register values instead of using a cached
value when the rate is requested. Using this property, cpufreq's
set_target() can request a CPU frequency change thought it's firmware
interface and refresh the clock tree by requesting the affected clock

The affected devices, the ones that depend on the VPU clock, can
register with the cpufreq_notifier which will notify them before and
after the clock changes. An example implementation is provided for RPi's
aux serial console.

There still a huge list of devices to fix: SPI, SPI-aux, I2C, DPI and
SDHOST. So if anyone interested in helping they are more than welcome

Note: to test this, it's highly recommended to boot from the USB as the
SDHOST driver isn't yet ready for frequency changes (it's the next one
on my list).

That's all,


Nicolas Saenz Julienne (5):
  clk: bcm2835: set CLK_GET_RATE_NOCACHE to firmware dependent clocks
  ARM: dts: bcm2837: Add cpu operating points
  cpufreq: add driver for Raspbery Pi
  dt-bindings: cpufreq: add bindings for Raspberry Pi
  serial: 8250: bcm2835aux: add notifier to follow clock changes

 .../bindings/cpufreq/cpufreq-raspberrypi.txt  |  95 ++++++++
 arch/arm/boot/dts/bcm2835-rpi.dtsi            |   8 +
 arch/arm/boot/dts/bcm2837-rpi-3-b-plus.dts    |   7 +
 arch/arm/boot/dts/bcm2837.dtsi                |  25 ++
 drivers/clk/bcm/clk-bcm2835-aux.c             |   9 +-
 drivers/clk/bcm/clk-bcm2835.c                 |  31 ++-
 drivers/cpufreq/Kconfig.arm                   |   8 +
 drivers/cpufreq/Makefile                      |   1 +
 drivers/cpufreq/raspberrypi-cpufreq.c         | 222 ++++++++++++++++++
 drivers/tty/serial/8250/8250_bcm2835aux.c     |  75 ++++++
 10 files changed, 467 insertions(+), 14 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/cpufreq/cpufreq-raspberrypi.txt
 create mode 100644 drivers/cpufreq/raspberrypi-cpufreq.c


More information about the linux-rpi-kernel mailing list