clk: bcm: rpi: Discover the firmware clocks
authorMaxime Ripard <maxime@cerno.tech>
Mon, 10 Feb 2020 13:06:09 +0000 (14:06 +0100)
committerpopcornmix <popcornmix@gmail.com>
Wed, 1 Jul 2020 15:33:34 +0000 (16:33 +0100)
commit5b0e59aa958fbc1f2e724ea4b515912b79577c1a
tree875a72a5819415f270169e557bc4d6a58a404e07
parent1efa52e97f96f28e43375eaf373eb5eea728d935
clk: bcm: rpi: Discover the firmware clocks

The RaspberryPi4 firmware actually exposes more clocks than are currently
handled by the driver and we will need to change some of them directly
based on the pixel rate for the display related clocks, or the load for the
GPU.

This rate change can have a number of side-effects, including adjusting the
various PLL voltages or the PLL parents. The firmware will also update
those clocks by itself for example if the SoC runs too hot.

In order to make Linux play as nice as possible with those constraints, it
makes sense to rely on the firmware clocks as much as possible.

Fortunately,t he firmware has an interface to discover the clocks it
exposes.

Let's use it to discover, register the clocks in the clocks framework and
then expose them through the device tree for consumers to use them.

Cc: Michael Turquette <mturquette@baylibre.com>
Cc: Stephen Boyd <sboyd@kernel.org>
Cc: linux-clk@vger.kernel.org
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
drivers/clk/bcm/clk-raspberrypi.c
include/soc/bcm2835/raspberrypi-firmware.h