]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
clk: bcm: rpi: Turn firmware clock on/off when preparing/unpreparing
authorMaíra Canal <mcanal@igalia.com>
Thu, 31 Jul 2025 21:06:18 +0000 (18:06 -0300)
committerStephen Boyd <sboyd@kernel.org>
Sun, 21 Sep 2025 16:09:34 +0000 (09:09 -0700)
commit919d6924ae9b4bcc9cb1d5ce4b78d5b92665d630
tree7ec6c0d436e2b10792e9234329107e309f15c434
parent072ce917bf95fc31f3c8c106b71a31e8607553ce
clk: bcm: rpi: Turn firmware clock on/off when preparing/unpreparing

Currently, when we prepare or unprepare RPi's clocks, we don't actually
enable/disable the firmware clock. This means that
`clk_disable_unprepare()` doesn't actually change the clock state at
all, nor does it lowers the clock rate.

From the Mailbox Property Interface documentation [1], we can see that
we should use `RPI_FIRMWARE_SET_CLOCK_STATE` to set the clock state
off/on. Therefore, use `RPI_FIRMWARE_SET_CLOCK_STATE` to create a
prepare and an unprepare hook for RPi's firmware clock.

As now the clocks are actually turned off, some of them are now marked
CLK_IS_CRITICAL, as those are required to be on during the whole system
operation.

Link: https://github.com/raspberrypi/firmware/wiki/Mailbox-property-interface
Signed-off-by: Maíra Canal <mcanal@igalia.com>
Reviewed-by: Stefan Wahren <wahrenst@gmx.net>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
drivers/clk/bcm/clk-raspberrypi.c