mbox series

[v2,0/3] Add SoC identification support for RZ/V2M

Message ID 20221110162126.103437-1-biju.das.jz@bp.renesas.com
Headers show
Series Add SoC identification support for RZ/V2M | expand

Message

Biju Das Nov. 10, 2022, 4:21 p.m. UTC
This patch series aims to add SoC identification support for RZ/V2M.

v1->v2:
 * Moved the binding file from arm->soc/renesas
 * Updated the binding example
 * Removed config from patch#2 as it is already present
 * Removed extra space before 'else if' statement

Ref:
[1] https://patchwork.kernel.org/project/linux-renesas-soc/patch/20220321154232.56315-3-phil.edworthy@renesas.com/
[2] https://patchwork.kernel.org/project/linux-renesas-soc/patch/20220321154232.56315-8-phil.edworthy@renesas.com/

logs:
root@rzv2m:~# dmesg | grep "Renesas RZ/V2M"
[ 0.119196] Detected Renesas RZ/V2M r9a09g011 1.1

root@rzv2m:~# for i in machine family soc_id revision; do echo -n "$i: ";cat /sys/devices/soc0/$i; done
machine: RZ/V2M Evaluation Kit 2.0
family: RZ/V2M
soc_id: r9a09g011
revision: 1.1

Biju Das (1):
  arm64: dts: renesas: r9a09g011: Add system configuration node

Phil Edworthy (2):
  dt-bindings: arm: renesas: Document Renesas RZ/V2M System
    Configuration
  soc: renesas: Identify RZ/V2M SoC

 .../soc/renesas/renesas,rzv2m-sys.yaml        | 39 +++++++++++++++++++
 arch/arm64/boot/dts/renesas/r9a09g011.dtsi    |  6 +++
 drivers/soc/renesas/renesas-soc.c             | 22 +++++++++++
 3 files changed, 67 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/soc/renesas/renesas,rzv2m-sys.yaml

Comments

Krzysztof Kozlowski Nov. 11, 2022, 8:34 a.m. UTC | #1
On 10/11/2022 17:21, Biju Das wrote:
> Add system configuration node to RZ/V2M SoC dtsi.
> 
> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> ---
> v2:
>  * New patch
> ---
>  arch/arm64/boot/dts/renesas/r9a09g011.dtsi | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/renesas/r9a09g011.dtsi b/arch/arm64/boot/dts/renesas/r9a09g011.dtsi
> index 7b949e40745a..07164d9e4a0f 100644
> --- a/arch/arm64/boot/dts/renesas/r9a09g011.dtsi
> +++ b/arch/arm64/boot/dts/renesas/r9a09g011.dtsi
> @@ -130,6 +130,12 @@ cpg: clock-controller@a3500000 {
>  			#power-domain-cells = <0>;
>  		};
>  
> +		sysc: system-configuration@a3f03000 {
> +			compatible = "renesas,r9a09g011-sys";
> +			reg = <0 0xa3f03000 0 0x400>;
> +			status = "disabled";

Why disabled? You do not have any other resources needed. This is odd.

Best regards,
Krzysztof
Biju Das Nov. 11, 2022, 9:10 a.m. UTC | #2
Hi Krzysztof Kozlowski,

Thanks for the  feedback.

> -----Original Message-----
> From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> Sent: 11 November 2022 08:35
> To: Biju Das <biju.das.jz@bp.renesas.com>; Rob Herring <robh+dt@kernel.org>;
> Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>
> Cc: Geert Uytterhoeven <geert+renesas@glider.be>; Magnus Damm
> <magnus.damm@gmail.com>; linux-renesas-soc@vger.kernel.org;
> devicetree@vger.kernel.org; Chris Paterson <Chris.Paterson2@renesas.com>;
> Fabrizio Castro <fabrizio.castro.jz@renesas.com>
> Subject: Re: [PATCH v2 3/3] arm64: dts: renesas: r9a09g011: Add system
> configuration node
> 
> On 10/11/2022 17:21, Biju Das wrote:
> > Add system configuration node to RZ/V2M SoC dtsi.
> >
> > Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> > ---
> > v2:
> >  * New patch
> > ---
> >  arch/arm64/boot/dts/renesas/r9a09g011.dtsi | 6 ++++++
> >  1 file changed, 6 insertions(+)
> >
> > diff --git a/arch/arm64/boot/dts/renesas/r9a09g011.dtsi
> b/arch/arm64/boot/dts/renesas/r9a09g011.dtsi
> > index 7b949e40745a..07164d9e4a0f 100644
> > --- a/arch/arm64/boot/dts/renesas/r9a09g011.dtsi
> > +++ b/arch/arm64/boot/dts/renesas/r9a09g011.dtsi
> > @@ -130,6 +130,12 @@ cpg: clock-controller@a3500000 {
> >  			#power-domain-cells = <0>;
> >  		};
> >
> > +		sysc: system-configuration@a3f03000 {
> > +			compatible = "renesas,r9a09g011-sys";
> > +			reg = <0 0xa3f03000 0 0x400>;
> > +			status = "disabled";
> 
> Why disabled? You do not have any other resources needed. This is odd.

OK, will enable by default. Currently the driver compatible is used for getting SoC
Major and Minor versions. But later will enhance to support more features.

Cheers,
Biju
Krzysztof Kozlowski Nov. 11, 2022, 10:50 a.m. UTC | #3
On 11/11/2022 10:10, Biju Das wrote:
> Hi Krzysztof Kozlowski,
> 
> Thanks for the  feedback.
> 
>> -----Original Message-----
>> From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>> Sent: 11 November 2022 08:35
>> To: Biju Das <biju.das.jz@bp.renesas.com>; Rob Herring <robh+dt@kernel.org>;
>> Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>
>> Cc: Geert Uytterhoeven <geert+renesas@glider.be>; Magnus Damm
>> <magnus.damm@gmail.com>; linux-renesas-soc@vger.kernel.org;
>> devicetree@vger.kernel.org; Chris Paterson <Chris.Paterson2@renesas.com>;
>> Fabrizio Castro <fabrizio.castro.jz@renesas.com>
>> Subject: Re: [PATCH v2 3/3] arm64: dts: renesas: r9a09g011: Add system
>> configuration node
>>
>> On 10/11/2022 17:21, Biju Das wrote:
>>> Add system configuration node to RZ/V2M SoC dtsi.
>>>
>>> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
>>> ---
>>> v2:
>>>  * New patch
>>> ---
>>>  arch/arm64/boot/dts/renesas/r9a09g011.dtsi | 6 ++++++
>>>  1 file changed, 6 insertions(+)
>>>
>>> diff --git a/arch/arm64/boot/dts/renesas/r9a09g011.dtsi
>> b/arch/arm64/boot/dts/renesas/r9a09g011.dtsi
>>> index 7b949e40745a..07164d9e4a0f 100644
>>> --- a/arch/arm64/boot/dts/renesas/r9a09g011.dtsi
>>> +++ b/arch/arm64/boot/dts/renesas/r9a09g011.dtsi
>>> @@ -130,6 +130,12 @@ cpg: clock-controller@a3500000 {
>>>  			#power-domain-cells = <0>;
>>>  		};
>>>
>>> +		sysc: system-configuration@a3f03000 {
>>> +			compatible = "renesas,r9a09g011-sys";
>>> +			reg = <0 0xa3f03000 0 0x400>;
>>> +			status = "disabled";
>>
>> Why disabled? You do not have any other resources needed. This is odd.
> 
> OK, will enable by default. Currently the driver compatible is used for getting SoC
> Major and Minor versions. But later will enhance to support more features.

Whatever your driver is doing, should be rather independent of
enabling/disabling nodes in DTS. Generic rule is that all SoC
components, which do not need external resources from board, should be
enabled by default. Of course there are exceptions to this rule. DTS is
anyway description of hardware, so "driver compatible" is not
appropriate argument for this (or I miss the meaning behind this).

Best regards,
Krzysztof
Biju Das Nov. 11, 2022, 11:25 a.m. UTC | #4
Hi Krzysztof Kozlowski,

> -----Original Message-----
> From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> Sent: 11 November 2022 10:51
> To: Biju Das <biju.das.jz@bp.renesas.com>; Rob Herring <robh+dt@kernel.org>;
> Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>
> Cc: Geert Uytterhoeven <geert+renesas@glider.be>; Magnus Damm
> <magnus.damm@gmail.com>; linux-renesas-soc@vger.kernel.org;
> devicetree@vger.kernel.org; Chris Paterson <Chris.Paterson2@renesas.com>;
> Fabrizio Castro <fabrizio.castro.jz@renesas.com>
> Subject: Re: [PATCH v2 3/3] arm64: dts: renesas: r9a09g011: Add system
> configuration node
> 
> On 11/11/2022 10:10, Biju Das wrote:
> > Hi Krzysztof Kozlowski,
> >
> > Thanks for the  feedback.
> >
> >> -----Original Message-----
> >> From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> >> Sent: 11 November 2022 08:35
> >> To: Biju Das <biju.das.jz@bp.renesas.com>; Rob Herring
> >> <robh+dt@kernel.org>; Krzysztof Kozlowski
> >> <krzysztof.kozlowski+dt@linaro.org>
> >> Cc: Geert Uytterhoeven <geert+renesas@glider.be>; Magnus Damm
> >> <magnus.damm@gmail.com>; linux-renesas-soc@vger.kernel.org;
> >> devicetree@vger.kernel.org; Chris Paterson
> >> <Chris.Paterson2@renesas.com>; Fabrizio Castro
> >> <fabrizio.castro.jz@renesas.com>
> >> Subject: Re: [PATCH v2 3/3] arm64: dts: renesas: r9a09g011: Add
> >> system configuration node
> >>
> >> On 10/11/2022 17:21, Biju Das wrote:
> >>> Add system configuration node to RZ/V2M SoC dtsi.
> >>>
> >>> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> >>> ---
> >>> v2:
> >>>  * New patch
> >>> ---
> >>>  arch/arm64/boot/dts/renesas/r9a09g011.dtsi | 6 ++++++
> >>>  1 file changed, 6 insertions(+)
> >>>
> >>> diff --git a/arch/arm64/boot/dts/renesas/r9a09g011.dtsi
> >> b/arch/arm64/boot/dts/renesas/r9a09g011.dtsi
> >>> index 7b949e40745a..07164d9e4a0f 100644
> >>> --- a/arch/arm64/boot/dts/renesas/r9a09g011.dtsi
> >>> +++ b/arch/arm64/boot/dts/renesas/r9a09g011.dtsi
> >>> @@ -130,6 +130,12 @@ cpg: clock-controller@a3500000 {
> >>>  			#power-domain-cells = <0>;
> >>>  		};
> >>>
> >>> +		sysc: system-configuration@a3f03000 {
> >>> +			compatible = "renesas,r9a09g011-sys";
> >>> +			reg = <0 0xa3f03000 0 0x400>;
> >>> +			status = "disabled";
> >>
> >> Why disabled? You do not have any other resources needed. This is odd.
> >
> > OK, will enable by default. Currently the driver compatible is used
> > for getting SoC Major and Minor versions. But later will enhance to support
> more features.
> 
> Whatever your driver is doing, should be rather independent of
> enabling/disabling nodes in DTS. Generic rule is that all SoC components,
> which do not need external resources from board, should be enabled by
> default. Of course there are exceptions to this rule. DTS is anyway
> description of hardware, so "driver compatible" is not appropriate argument
> for this (or I miss the meaning behind this).

OK, agreed. Thanks for the detailed description. 

Previously, I just referred [1] for consistency
[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm64/boot/dts/renesas/r9a07g054.dtsi?h=v6.1-rc4#n635


Cheers,
Biju