]> git.ipfire.org Git - thirdparty/linux.git/commit
clk: renesas: r9a09g077: Add xSPI core and module clocks
authorLad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Mon, 17 Nov 2025 20:56:27 +0000 (20:56 +0000)
committerGeert Uytterhoeven <geert+renesas@glider.be>
Mon, 15 Dec 2025 10:49:10 +0000 (11:49 +0100)
commitec74d201e697503d8460597e2c3cc5ade222c4fb
tree2a46c14f70ac2ce64dc0e6ea39c3aba5c0581d09
parenteede457b4c823d183e1c95d7286ca08614baa36a
clk: renesas: r9a09g077: Add xSPI core and module clocks

Add core clocks and module clock definitions required by the xSPI
(Expanded SPI) IP on the R9A09G077 SoC.

Define the new SCKCR fields FSELXSPI0/FSELXSPI1 and DIVSEL_XSPI0/1 and
add two new core clocks XSPI_CLK0 and XSPI_CLK1. The xSPI block uses
PCLKH as its bus clock (use as module clock parent) while the operation
clock (XSPI_CLKn) is derived from PLL4. To support this arrangement
provide mux/div selectors and divider tables for the supported
XSPI operating rates.

Add CLK_TYPE_RZT2H_FSELXSPI to implement a custom divider/mux clock
where the determine_rate() callback enforces the hardware constraint:
when the parent output is 600MHz only dividers 8 and 16 are valid,
whereas for 800MHz operation the full divider set (6,8,16,32,64) may
be used. The custom determine_rate() picks the best parent/divider pair
to match the requested rate and programs the appropriate SCKCR fields.

Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://patch.msgid.link/20251117205627.39376-1-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
drivers/clk/renesas/r9a09g077-cpg.c