[PATCH v7 05/14] clk: renesas: r8a78000: Add SCMI remapping support
Geert Uytterhoeven
geert+renesas at glider.be
Wed Dec 2 01:59:38 PST 2026
Hi Wolfram,
On Wed, Dec 2, 2026, at 10:46, Wolfram Sang wrote:
> On Mon, Nov 30, 2026 at 02:12:36PM +0100, Geert Uytterhoeven wrote:
>> From: Geert Uytterhoeven <geert+renesas at glider.be>
>>
>> Extend the Clock Pulse Generator driver for R-Car X5H with SCMI support,
>> to remap DT clock IDs to abstractions (clocks) offered by the SCMI
>> firmware when running on a system with SCMI, and SCMI support is
>> enabled. Take into account some peculiarities of the current SCMI
>> firmware implementations, and fall-back to fixed-rate clocks as
>> replacements for SCMI clocks that are not available.
>> Support for bus clocks used by serial, I2C, and SPI devices is included.
>>
>> This lets us avoid putting SCMI IDs in DT, and allows us to use the same
>> hardware description in SoC DTS for systems with and without SCMI
>> firmware.
>>
>> Note that fixed-rate clock IDs are now offset to maintain a clear
>> separation with the SCMI clock ID space, and that the default fallback
>> map is now populated using a macro, to prevent accidental inclusion of
>> SCMI firmware clock IDs.
>>
>> For now, it is assumed SCMI clock IDs are stable, and match SCP FW
>> SDKv4.31.0 and later.
>>
>> Suggested-by: Marek Vasut <marek.vasut+renesas at mailbox.org>
>> Signed-off-by: Geert Uytterhoeven <geert+renesas at glider.be>
>> Tested-by: Wolfram Sang <wsa+renesas at sang-engineering.com>
>> Reviewed-by: Marek Vasut <marek.vasut+renesas at mailbox.org>
>
> Reviewed-by: Wolfram Sang <wsa+renesas at sang-engineering.com>
Thanks!
> Only some more places to add a 'r8a78000_' prefix if we want that.
Do we really need large prefixes for all small static inline functions,
some of which are inlined by the compiler?
> One further question:
>
>> +#define MAP_FIXED(id, rate) { id, FIXED_CLK(rate) }
>> + MAP_FIXED(R8A78000_CPG_SGASYNCD4_PERW_BUS, 266M),
>> + MAP_FIXED(R8A78000_CPG_SGASYNCD8_PERW_BUS, 133M),
>> + MAP_FIXED(R8A78000_CPG_SGASYNCD16_PERW_BUS, 66M),
>> +#undef MAP_FIXED
>
> Why the undef? Couldn't we find a better name and keep the macro?
To prevent using it below. I wanted to have a clear separation
between default/fallback clocks that are always fixed rate clocks,
and the tables for use with SCMI, which can contain both firmware
IDs and fixed clock IDs.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
More information about the linux-arm-kernel
mailing list