Re: [PATCH/RFC 10/14] dt-bindings: power: Document Renesas R-Car X5H Module Controller
From: Geert Uytterhoeven
Date: Thu May 07 2026 - 03:37:58 EST
Hi Marek,
On Thu, 7 May 2026 at 00:58, Marek Vasut <marek.vasut@xxxxxxxxxxx> wrote:
> On 4/21/26 8:11 PM, Geert Uytterhoeven wrote:
> > + '#power-domain-cells':
> > + description: |
> > + - The first power domain specifier cell must be either the Module
> > + Power Domain Gating (MPDG) register index (0x00-0x3f) from the
> > + datasheet,
>
> I agree with this part.
>
> > or a Power Domain number, as defined in
> > + <dt-bindings/power/renesas,r8a78000-mdlc.h>,
>
> I do not understand this part, please see end of this email ...
>
> > + - The second power domain specifier cell must be the module number
> > + (0x00-0xff), composed of the Module System Reset (MSRES) register index
> > + in the high nibble, and the Module Reset Destination bitfield index in
> > + the low nibble.
> > + const: 2
>
> I am unsure about this part.
>
> There are multiple MDLC blocks, AON, SCP, HSCN, and so on. Each MDLC
> block contains multiple Module Power Domain Gating registers (MPDGn) and
> multiple Module System RESet register (MSRES) .
>
> I do understand and agree that the first power-domains-cells cell must
> be the identifier of power domain within the MDLC block.
>
> However, I do not understand the second cell. The MDLC bindings already
> contain reset-cells, which should be used to refer to a reset within the
> MDLC block. Resets within the MDLC block are operated using the MSRES
> registers. Why are resets conflated into power-domain-cells ?
The Module Reset Destination bitfields in the MSRES registers are
2-bit wide, and control both Reset and Module Standby. Hence the
same register bitfields are referred to in the power-domains and
resets properties, through the module number.
Module Standby controls the clock(s) going into the module,
and is modelled as an SCMI clock (SCP_CLOCK_ID_MDLC_*) by the SCP
firmware. This is very similar to how MSTP (Module Stop) clocks are
handled on earlier R-Car SoCs (except that the SCP_CLOCK_ID_MDLC_*
clocks have a zero rate :-(.
Summarized, the first cell is the power domain part, and the second
cell is the clock domain part.
So perhaps I will clarify like this:
- The first power domain specifier cell is the power domain part, and
must be either the Module Power Domain Gating (MPDG) register index
(0x00-0x3f) from the datasheet, or a Power Domain number, as defined in
<dt-bindings/power/renesas,r8a78000-mdlc.h>,
- The second power domain specifier cell is the clock domain part, and
must be the module number (0x00-0xff), composed of the Module System
Reset (MSRES) register index in the high nibble, and the Module Reset
Destination bitfield index in the low nibble.
> > + '#reset-cells':
> > + description:
> > + The single reset specifier cell must be the module number (0x00-0xff).
> > + const: 1
>
> [...]
>
> > +#ifndef __DT_BINDINGS_POWER_RENESAS_R8A78000_MDLC_H__
> > +#define __DT_BINDINGS_POWER_RENESAS_R8A78000_MDLC_H__
> > +
> > +/* R-Car X5H MDLC Power Domains */
> > +
> > +#define R8A78000_MDLC_PD_AON 0x40
> > +#define R8A78000_MDLC_PD_SCP 0x41
> > +#define R8A78000_MDLC_PD_APL 0x42
> > +#define R8A78000_MDLC_PD_CMN 0x43
> > +#define R8A78000_MDLC_PD_ACL 0x44
> ... what do these numbers represent ? Shouldn't those be register
> offsets from MDLC MPDG00 according to power-domain-cells ?
These are Power Domains that are not backed by any of the 64 Module
Power Domain Gating (MPDG) registers in MDLC blocks.
It is not clear to me if they can be controlled manually, probably
they are just always sequenced automatically on power-up. As the
documentation does treat them as separate domains (see e.g. Table 14.1
Power Supply Voltage Monitor Functions), I figured they would better be
exposed as separate domains, instead of as a single always-on domain,
like on earlier R-Car SoCs (cfr. R8A779*_PD_ALWAYS_ON domains number
32 or 64).
See also the X5H_Power_domain_structure.xlsx attachment in the R-Car
X5H documentation.
> If those are power domain IDs, then I am unsure why e.g. for SCIF the
> domain ID is R8A78000_MDLC_PD_APL in [PATCH/RFC 13/14] arm64: dts:
> renesas: r8a78000: Add CPG/MDLC nodes . Could you please expand on that ?
See the "Module Standby" attachment X5H_MS.xlsx in the R-Car X5H
documentation. The "PERW" tab shows that all PERW devices are located
in the PD_APL power domain, which is always-on.
This is different from e.g. the UFS controllers: they are located in
their own PD_UFS0 and PD_UFS1 power domains, which are controlled
through the Module Power Domain Gating registers (MPDGn) (cfr. the
"PERE" tab).
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx
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