]> git.ipfire.org Git - thirdparty/u-boot.git/commit
clk: renesas: Add Renesas R-Car R8A78000 X5H CPG clock driver
authorMarek Vasut <marek.vasut+renesas@mailbox.org>
Thu, 7 May 2026 23:23:28 +0000 (01:23 +0200)
committerMarek Vasut <marek.vasut+renesas@mailbox.org>
Thu, 21 May 2026 19:48:05 +0000 (21:48 +0200)
commit24039ffefbc1d2a0848af216f655af416ede79b5
tree6a091495447f2cc19dd663ea3b9686544e3721d9
parent3e24519d6f7ed84581d159d501b973b9ada74588
clk: renesas: Add Renesas R-Car R8A78000 X5H CPG clock driver

Add Renesas R-Car R8A78000 X5H CPG clock driver, which serves as a
remap driver between DT clock IDs and SCMI clock IDs in case U-Boot
runs on the Cortex-A, and as a trivial clock driver for RSIP.

The R-Car X5H SCP firmware uses different SCMI clock IDs in different
versions of the SCP firmware, which makes this remapping necessary.
The SCMI base protocol version is updated for each new SCP firmware
version, it is therefore possible to determine which SCP firmware
version is running on the platform from the base protocol and then
determine which remapping table to use for DT clock ID to SCMI clock
ID remapping.

Currently supported versions are SCP 4.28, 4.31, 4.32 .

The DT clock ID to SCMI clock ID remap and call mechanism is a bit
complex. The driver looks up the SCMI clock protocol device on probe
and stores pointer to it in private data. On each clock request which
has to be remapped, the device sequence ID of this SCMI clock protocol
device is incremented by the remapped SCMI clock ID + 1 and used to
look up matching clock device by sequence number. If the device is
found, it is converted to clock, which can be used in regular clock
operations. This look up has to be done because the SCMI clock driver
registers a subdevice for each clock, and this look up is the only way
to find the correct SCMI clock subdevice. Since the SCMI device and
the clock subdevices are registered in the same function, we can depend
on the device sequence numbers to be monotonically incrementing, with
SCMI clock protocol device being sequence number N, the first SCMI
clock subdevice being sequence number N+1 and so on.

In case of RSIP, all clocks are already enabled by BootROM or early
SoC initialization code, the driver therefore only acts as a stub.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
drivers/clk/renesas/Kconfig
drivers/clk/renesas/Makefile
drivers/clk/renesas/r8a78000-cpg.c [new file with mode: 0644]