diff mbox series

[v3,3/5] dt-bindings: mfd: Add Renesas RAA215300 PMIC bindings

Message ID 20230513165227.13117-4-biju.das.jz@bp.renesas.com
State Changes Requested, archived
Headers show
Series Add Renesas PMIC RAA215300 and built-in RTC support | expand

Checks

Context Check Description
robh/checkpatch success
robh/patch-applied success
robh/dt-meta-schema fail build log

Commit Message

Biju Das May 13, 2023, 4:52 p.m. UTC
Document Renesas RAA215300 PMIC bindings.

The RAA215300 is a high Performance 9-Channel PMIC supporting DDR
Memory, with Built-In Charger and RTC.

It supports DDR3, DDR3L, DDR4, and LPDDR4 memory power requirements.
The internally compensated regulators, built-in Real-Time Clock (RTC),
32kHz crystal oscillator, and coin cell battery charger provide a
highly integrated, small footprint power solution ideal for
System-On-Module (SOM) applications. A spread spectrum feature
provides an ease-of-use solution for noise-sensitive audio or RF
applications.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
v2->v3:
 * Added more detailed description for renesas,rtc-enabled property.
RFC->v2:
 * Updated reg property
 * Added optional reg-names, interrupts and renesas,rtc-enabled
   properties.
 * Fixed the node name in the example
 * Dropped the cross link property renesas,raa215300-rtc.
 * Updated the example
---
 .../bindings/mfd/renesas,raa215300.yaml       | 70 +++++++++++++++++++
 1 file changed, 70 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mfd/renesas,raa215300.yaml

Comments

Krzysztof Kozlowski May 13, 2023, 6:26 p.m. UTC | #1
On 13/05/2023 18:52, Biju Das wrote:
> Document Renesas RAA215300 PMIC bindings.
> 
> The RAA215300 is a high Performance 9-Channel PMIC supporting DDR
> Memory, with Built-In Charger and RTC.
> 
> It supports DDR3, DDR3L, DDR4, and LPDDR4 memory power requirements.
> The internally compensated regulators, built-in Real-Time Clock (RTC),
> 32kHz crystal oscillator, and coin cell battery charger provide a
> highly integrated, small footprint power solution ideal for
> System-On-Module (SOM) applications. A spread spectrum feature
> provides an ease-of-use solution for noise-sensitive audio or RF
> applications.
> 
> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> ---
> v2->v3:
>  * Added more detailed description for renesas,rtc-enabled property.
> RFC->v2:
>  * Updated reg property
>  * Added optional reg-names, interrupts and renesas,rtc-enabled
>    properties.
>  * Fixed the node name in the example
>  * Dropped the cross link property renesas,raa215300-rtc.
>  * Updated the example
> ---
>  .../bindings/mfd/renesas,raa215300.yaml       | 70 +++++++++++++++++++
>  1 file changed, 70 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/mfd/renesas,raa215300.yaml
> 
> diff --git a/Documentation/devicetree/bindings/mfd/renesas,raa215300.yaml b/Documentation/devicetree/bindings/mfd/renesas,raa215300.yaml
> new file mode 100644
> index 000000000000..04d34e5be23e
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/mfd/renesas,raa215300.yaml
> @@ -0,0 +1,70 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/mfd/renesas,raa215300.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Renesas RAA215300 Power Management Integrated Circuit (PMIC)
> +
> +maintainers:
> +  - Biju Das <biju.das.jz@bp.renesas.com>
> +
> +description: |
> +  The RAA215300 is a high-performance, low-cost 9-channel PMIC designed for
> +  32-bit and 64-bit MCU and MPU applications. It supports DDR3, DDR3L, DDR4,
> +  and LPDDR4 memory power requirements. The internally compensated regulators,
> +  built-in Real-Time Clock (RTC), 32kHz crystal oscillator, and coin cell
> +  battery charger provide a highly integrated, small footprint power solution
> +  ideal for System-On-Module (SOM) applications. A spread spectrum feature
> +  provides an ease-of-use solution for noise-sensitive audio or RF applications.
> +
> +  This device exposes two devices via I2C. One for the integrated RTC IP, and
> +  one for everything else.
> +
> +  Link to datasheet:
> +  https://www.renesas.com/in/en/products/power-power-management/multi-channel-power-management-ics-pmics/ssdsoc-power-management-ics-pmic-and-pmus/raa215300-high-performance-9-channel-pmic-supporting-ddr-memory-built-charger-and-rtc
> +
> +properties:
> +  compatible:
> +    enum:
> +      - renesas,raa215300
> +
> +  reg:
> +    minItems: 1
> +    maxItems: 2
> +
> +  reg-names:
> +    items:
> +      - const: main
> +      - const: rtc

I missed it last time. This does not match your reg. I suggest to drop
minItems from reg, assuming your device always has two address spaces.

> +
> +  interrupts:
> +    maxItems: 1
> +

Best regards,
Krzysztof
Biju Das May 14, 2023, 8:04 a.m. UTC | #2
Hi Krzysztof Kozlowski,

Thanks for the feedback.

> Subject: Re: [PATCH v3 3/5] dt-bindings: mfd: Add Renesas RAA215300 PMIC
> bindings
> 
> On 13/05/2023 18:52, Biju Das wrote:
> > Document Renesas RAA215300 PMIC bindings.
> >
> > The RAA215300 is a high Performance 9-Channel PMIC supporting DDR
> > Memory, with Built-In Charger and RTC.
> >
> > It supports DDR3, DDR3L, DDR4, and LPDDR4 memory power requirements.
> > The internally compensated regulators, built-in Real-Time Clock (RTC),
> > 32kHz crystal oscillator, and coin cell battery charger provide a
> > highly integrated, small footprint power solution ideal for
> > System-On-Module (SOM) applications. A spread spectrum feature
> > provides an ease-of-use solution for noise-sensitive audio or RF
> > applications.
> >
> > Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> > ---
> > v2->v3:
> >  * Added more detailed description for renesas,rtc-enabled property.
> > RFC->v2:
> >  * Updated reg property
> >  * Added optional reg-names, interrupts and renesas,rtc-enabled
> >    properties.
> >  * Fixed the node name in the example
> >  * Dropped the cross link property renesas,raa215300-rtc.
> >  * Updated the example
> > ---
> >  .../bindings/mfd/renesas,raa215300.yaml       | 70
> +++++++++++++++++++
> >  1 file changed, 70 insertions(+)
> >  create mode 100644
> > Documentation/devicetree/bindings/mfd/renesas,raa215300.yaml
> >
> > diff --git
> > a/Documentation/devicetree/bindings/mfd/renesas,raa215300.yaml
> > b/Documentation/devicetree/bindings/mfd/renesas,raa215300.yaml
> > new file mode 100644
> > index 000000000000..04d34e5be23e
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/mfd/renesas,raa215300.yaml
> > @@ -0,0 +1,70 @@
> > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) %YAML 1.2
> > +---
> > +$id:
> > +
> > +title: Renesas RAA215300 Power Management Integrated Circuit (PMIC)
> > +
> > +maintainers:
> > +  - Biju Das <biju.das.jz@bp.renesas.com>
> > +
> > +description: |
> > +  The RAA215300 is a high-performance, low-cost 9-channel PMIC
> > +designed for
> > +  32-bit and 64-bit MCU and MPU applications. It supports DDR3,
> > +DDR3L, DDR4,
> > +  and LPDDR4 memory power requirements. The internally compensated
> > +regulators,
> > +  built-in Real-Time Clock (RTC), 32kHz crystal oscillator, and coin
> > +cell
> > +  battery charger provide a highly integrated, small footprint power
> > +solution
> > +  ideal for System-On-Module (SOM) applications. A spread spectrum
> > +feature
> > +  provides an ease-of-use solution for noise-sensitive audio or RF
> applications.
> > +
> > +  This device exposes two devices via I2C. One for the integrated RTC
> > + IP, and  one for everything else.
> > +
> > +  Link to datasheet:
> > +
> > + https://www.renesas.com/in/en/products/power-power-management/multi-
> > + channel-power-management-ics-pmics/ssdsoc-power-management-ics-pmic-
> > + and-pmus/raa215300-high-performance-9-channel-pmic-supporting-ddr-me
> > + mory-built-charger-and-rtc
> > +
> > +properties:
> > +  compatible:
> > +    enum:
> > +      - renesas,raa215300
> > +
> > +  reg:
> > +    minItems: 1
> > +    maxItems: 2
> > +
> > +  reg-names:
> > +    items:
> > +      - const: main
> > +      - const: rtc
> 
> I missed it last time. This does not match your reg. I suggest to drop
> minItems from reg, assuming your device always has two address spaces.

OK, will drop minItems.

Also, in next-version, will add reg-names as required-properties .

+required:
+  - compatible
+  - reg
+  - reg-names

I will send next version, based on feedback from others.

Cheers,
Biju
Geert Uytterhoeven May 16, 2023, 8 a.m. UTC | #3
Hi Biju,

On Sat, May 13, 2023 at 6:52 PM Biju Das <biju.das.jz@bp.renesas.com> wrote:
>
> Document Renesas RAA215300 PMIC bindings.
>
> The RAA215300 is a high Performance 9-Channel PMIC supporting DDR
> Memory, with Built-In Charger and RTC.
>
> It supports DDR3, DDR3L, DDR4, and LPDDR4 memory power requirements.
> The internally compensated regulators, built-in Real-Time Clock (RTC),
> 32kHz crystal oscillator, and coin cell battery charger provide a
> highly integrated, small footprint power solution ideal for
> System-On-Module (SOM) applications. A spread spectrum feature
> provides an ease-of-use solution for noise-sensitive audio or RF
> applications.
>
> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> ---
> v2->v3:
>  * Added more detailed description for renesas,rtc-enabled property.

Thanks for your patch!

> --- /dev/null
> +++ b/Documentation/devicetree/bindings/mfd/renesas,raa215300.yaml

> +  renesas,rtc-enabled:
> +    description:
> +      To indicate RTC is enabled on the PMIC.
> +      Enabling of the RTC is based on system design. System designers may
> +      choose not to populate built-in RTC by grounding XIN and XOUT pins.
> +    type: boolean

Perhaps you should go full DT monty and replace this logic by a clocks
property pointing to the external crystal?

However, as I only have the Short-Form Datasheet, I am wondering what
"Built-in 32kHz crystal oscillator (with bypass)" really means?
Does this mean the RTC can work without an external crystal, using an
on-chip oscillator?

Thanks!

Gr{oetje,eeting}s,

                        Geert
Biju Das May 16, 2023, 9:30 a.m. UTC | #4
Hi Geert,

Thanks for the feedback.

> -----Original Message-----
> From: Geert Uytterhoeven <geert@linux-m68k.org>
> Sent: Tuesday, May 16, 2023 9:00 AM
> To: Biju Das <biju.das.jz@bp.renesas.com>
> Cc: Lee Jones <lee@kernel.org>; Rob Herring <robh+dt@kernel.org>;
> Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>; Magnus Damm
> <magnus.damm@gmail.com>; devicetree@vger.kernel.org; linux-renesas-
> soc@vger.kernel.org; Fabrizio Castro <fabrizio.castro.jz@renesas.com>
> Subject: Re: [PATCH v3 3/5] dt-bindings: mfd: Add Renesas RAA215300 PMIC
> bindings
> 
> Hi Biju,
> 
> On Sat, May 13, 2023 at 6:52 PM Biju Das <biju.das.jz@bp.renesas.com>
> wrote:
> >
> > Document Renesas RAA215300 PMIC bindings.
> >
> > The RAA215300 is a high Performance 9-Channel PMIC supporting DDR
> > Memory, with Built-In Charger and RTC.
> >
> > It supports DDR3, DDR3L, DDR4, and LPDDR4 memory power requirements.
> > The internally compensated regulators, built-in Real-Time Clock (RTC),
> > 32kHz crystal oscillator, and coin cell battery charger provide a
> > highly integrated, small footprint power solution ideal for
> > System-On-Module (SOM) applications. A spread spectrum feature
> > provides an ease-of-use solution for noise-sensitive audio or RF
> > applications.
> >
> > Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> > ---
> > v2->v3:
> >  * Added more detailed description for renesas,rtc-enabled property.
> 
> Thanks for your patch!
> 
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/mfd/renesas,raa215300.yaml
> 
> > +  renesas,rtc-enabled:
> > +    description:
> > +      To indicate RTC is enabled on the PMIC.
> > +      Enabling of the RTC is based on system design. System designers
> may
> > +      choose not to populate built-in RTC by grounding XIN and XOUT
> pins.
> > +    type: boolean
> 
> Perhaps you should go full DT monty and replace this logic by a clocks
> property pointing to the external crystal?

OK for me. Krzysztof Kozlowski, Rob are you ok with this?

> 
> However, as I only have the Short-Form Datasheet, I am wondering what
> "Built-in 32kHz crystal oscillator (with bypass)" really means?

It is not mentioned in original doc as well.

> Does this mean the RTC can work without an external crystal, using an
> on-chip oscillator?

I am checking with hardware team. I will update you once I get this info.

Cheers,
Biju
Biju Das June 2, 2023, 7:05 a.m. UTC | #5
Hi Geert,

> Subject: RE: [PATCH v3 3/5] dt-bindings: mfd: Add Renesas RAA215300 PMIC
> bindings
> 
> Hi Geert,
> 
> Thanks for the feedback.
> 
> > -----Original Message-----
> > From: Geert Uytterhoeven <geert@linux-m68k.org>
> > Sent: Tuesday, May 16, 2023 9:00 AM
> > To: Biju Das <biju.das.jz@bp.renesas.com>
> > Cc: Lee Jones <lee@kernel.org>; Rob Herring <robh+dt@kernel.org>;
> > Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>; Magnus Damm
> > <magnus.damm@gmail.com>; devicetree@vger.kernel.org; linux-renesas-
> > soc@vger.kernel.org; Fabrizio Castro <fabrizio.castro.jz@renesas.com>
> > Subject: Re: [PATCH v3 3/5] dt-bindings: mfd: Add Renesas RAA215300
> > PMIC bindings
> >
> > Hi Biju,
> >
> > On Sat, May 13, 2023 at 6:52 PM Biju Das <biju.das.jz@bp.renesas.com>
> > wrote:
> > >
> > > Document Renesas RAA215300 PMIC bindings.
> > >
> > > The RAA215300 is a high Performance 9-Channel PMIC supporting DDR
> > > Memory, with Built-In Charger and RTC.
> > >
> > > It supports DDR3, DDR3L, DDR4, and LPDDR4 memory power requirements.
> > > The internally compensated regulators, built-in Real-Time Clock
> > > (RTC), 32kHz crystal oscillator, and coin cell battery charger
> > > provide a highly integrated, small footprint power solution ideal
> > > for System-On-Module (SOM) applications. A spread spectrum feature
> > > provides an ease-of-use solution for noise-sensitive audio or RF
> > > applications.
> > >
> > > Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> > > ---
> > > v2->v3:
> > >  * Added more detailed description for renesas,rtc-enabled property.
> >
> > Thanks for your patch!
> >
> > > --- /dev/null
> > > +++ b/Documentation/devicetree/bindings/mfd/renesas,raa215300.yaml
> >
> > > +  renesas,rtc-enabled:
> > > +    description:
> > > +      To indicate RTC is enabled on the PMIC.
> > > +      Enabling of the RTC is based on system design. System
> > > + designers
> > may
> > > +      choose not to populate built-in RTC by grounding XIN and XOUT
> > pins.
> > > +    type: boolean
> >
> > Perhaps you should go full DT monty and replace this logic by a clocks
> > property pointing to the external crystal?
> 
> OK for me. Krzysztof Kozlowski, Rob are you ok with this?
> 
> >
> > However, as I only have the Short-Form Datasheet, I am wondering what
> > "Built-in 32kHz crystal oscillator (with bypass)" really means?
> 
> It is not mentioned in original doc as well.
> 
> > Does this mean the RTC can work without an external crystal, using an
> > on-chip oscillator?
> 
> I am checking with hardware team. I will update you once I get this
> info.

Please find the answer from HW team, it is inline with current implementation.

Q1) Can you please clarify "Built-in 32kHz crystal oscillator (with bypass)" really means?

Ans:
The RTC on RAA215300 can work with an external 32.768kHz crystal or an external clock IC. So you can use it in two different ways:
1) Connect an external 32.768kHz crystal to XIN/XOUT. The on-chip oscillator needs to be enabled in this case, meaning the XTOSCB bit(0x07[6]) needs to be at ‘0’ (default value).
2) Connect an external clock IC of 32.768kHz to the XIN pin. The on-chip oscillator needs to be disabled (bypassed) in this case, meaning the XTOSCB bit needs to be at ‘1’.

Q2) Does this mean the RTC can work without an external crystal, using an on-chip oscillator?

Ans:
I guess you meant using the on-chip oscillator only without connecting anything to XIN/XOUT. That is not possible.

Cheers,
Biju
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/mfd/renesas,raa215300.yaml b/Documentation/devicetree/bindings/mfd/renesas,raa215300.yaml
new file mode 100644
index 000000000000..04d34e5be23e
--- /dev/null
+++ b/Documentation/devicetree/bindings/mfd/renesas,raa215300.yaml
@@ -0,0 +1,70 @@ 
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/mfd/renesas,raa215300.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Renesas RAA215300 Power Management Integrated Circuit (PMIC)
+
+maintainers:
+  - Biju Das <biju.das.jz@bp.renesas.com>
+
+description: |
+  The RAA215300 is a high-performance, low-cost 9-channel PMIC designed for
+  32-bit and 64-bit MCU and MPU applications. It supports DDR3, DDR3L, DDR4,
+  and LPDDR4 memory power requirements. The internally compensated regulators,
+  built-in Real-Time Clock (RTC), 32kHz crystal oscillator, and coin cell
+  battery charger provide a highly integrated, small footprint power solution
+  ideal for System-On-Module (SOM) applications. A spread spectrum feature
+  provides an ease-of-use solution for noise-sensitive audio or RF applications.
+
+  This device exposes two devices via I2C. One for the integrated RTC IP, and
+  one for everything else.
+
+  Link to datasheet:
+  https://www.renesas.com/in/en/products/power-power-management/multi-channel-power-management-ics-pmics/ssdsoc-power-management-ics-pmic-and-pmus/raa215300-high-performance-9-channel-pmic-supporting-ddr-memory-built-charger-and-rtc
+
+properties:
+  compatible:
+    enum:
+      - renesas,raa215300
+
+  reg:
+    minItems: 1
+    maxItems: 2
+
+  reg-names:
+    items:
+      - const: main
+      - const: rtc
+
+  interrupts:
+    maxItems: 1
+
+  renesas,rtc-enabled:
+    description:
+      To indicate RTC is enabled on the PMIC.
+      Enabling of the RTC is based on system design. System designers may
+      choose not to populate built-in RTC by grounding XIN and XOUT pins.
+    type: boolean
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        raa215300: pmic@12 {
+            compatible = "renesas,raa215300";
+            reg = <0x12>, <0x6f>;
+            reg-names = "main", "rtc";
+
+            renesas,rtc-enabled;
+        };
+    };