diff mbox series

[05/10] ARM: dts: BCM5301X: Provide defaults ports container node

Message ID 20201110033113.31090-6-f.fainelli@gmail.com (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series Broadcom b53 YAML bindings | expand

Checks

Context Check Description
netdev/tree_selection success Not a local patch

Commit Message

Florian Fainelli Nov. 10, 2020, 3:31 a.m. UTC
Provide an empty 'ports' container node with the correct #address-cells
and #size-cells properties. This silences the following warning:

arch/arm/boot/dts/bcm4708-asus-rt-ac56u.dt.yaml:
ethernet-switch@18007000: 'oneOf' conditional failed, one must be fixed:
        'ports' is a required property
        'ethernet-ports' is a required property
        From schema:
Documentation/devicetree/bindings/net/dsa/b53.yaml

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 arch/arm/boot/dts/bcm5301x.dtsi | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Rafał Miłecki Nov. 10, 2020, 9:31 a.m. UTC | #1
10.11.2020 04:31, Florian Fainelli wrote:
> Provide an empty 'ports' container node with the correct #address-cells
> and #size-cells properties. This silences the following warning:
> 
> arch/arm/boot/dts/bcm4708-asus-rt-ac56u.dt.yaml:
> ethernet-switch@18007000: 'oneOf' conditional failed, one must be fixed:
>          'ports' is a required property
>          'ethernet-ports' is a required property
>          From schema:
> Documentation/devicetree/bindings/net/dsa/b53.yaml
> 
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
> ---
>   arch/arm/boot/dts/bcm5301x.dtsi | 4 ++++
>   1 file changed, 4 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/bcm5301x.dtsi b/arch/arm/boot/dts/bcm5301x.dtsi
> index 807580dd89f5..89993a8a6765 100644
> --- a/arch/arm/boot/dts/bcm5301x.dtsi
> +++ b/arch/arm/boot/dts/bcm5301x.dtsi
> @@ -489,6 +489,10 @@ srab: ethernet-switch@18007000 {
>   		status = "disabled";
>   
>   		/* ports are defined in board DTS */
> +		ports {
> +			#address-cells = <1>;
> +			#size-cells = <0>;
> +		};

You can drop those two lines from board files now I believe.

grep "ports {" arch/arm/boot/dts/bcm470*
+ arch/arm/boot/dts/bcm953012er.dts
Florian Fainelli Nov. 10, 2020, 3:46 p.m. UTC | #2
On 11/10/2020 1:31 AM, Rafał Miłecki wrote:
>  10.11.2020 04:31, Florian Fainelli wrote:
>> Provide an empty 'ports' container node with the correct #address-cells
>> and #size-cells properties. This silences the following warning:
>>
>> arch/arm/boot/dts/bcm4708-asus-rt-ac56u.dt.yaml:
>> ethernet-switch@18007000: 'oneOf' conditional failed, one must be fixed:
>>          'ports' is a required property
>>          'ethernet-ports' is a required property
>>          From schema:
>> Documentation/devicetree/bindings/net/dsa/b53.yaml
>>
>> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
>> ---
>>   arch/arm/boot/dts/bcm5301x.dtsi | 4 ++++
>>   1 file changed, 4 insertions(+)
>>
>> diff --git a/arch/arm/boot/dts/bcm5301x.dtsi
>> b/arch/arm/boot/dts/bcm5301x.dtsi
>> index 807580dd89f5..89993a8a6765 100644
>> --- a/arch/arm/boot/dts/bcm5301x.dtsi
>> +++ b/arch/arm/boot/dts/bcm5301x.dtsi
>> @@ -489,6 +489,10 @@ srab: ethernet-switch@18007000 {
>>           status = "disabled";
>>             /* ports are defined in board DTS */
>> +        ports {
>> +            #address-cells = <1>;
>> +            #size-cells = <0>;
>> +        };
> 
> You can drop those two lines from board files now I believe.
> 
> grep "ports {" arch/arm/boot/dts/bcm470*
> + arch/arm/boot/dts/bcm953012er.dts

Yes, indeed, thanks!
Vladimir Oltean Nov. 10, 2020, 10:12 p.m. UTC | #3
On Mon, Nov 09, 2020 at 07:31:08PM -0800, Florian Fainelli wrote:
> Provide an empty 'ports' container node with the correct #address-cells
> and #size-cells properties. This silences the following warning:
> 
> arch/arm/boot/dts/bcm4708-asus-rt-ac56u.dt.yaml:
> ethernet-switch@18007000: 'oneOf' conditional failed, one must be fixed:
>         'ports' is a required property
>         'ethernet-ports' is a required property
>         From schema:
> Documentation/devicetree/bindings/net/dsa/b53.yaml
> 
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
> ---
>  arch/arm/boot/dts/bcm5301x.dtsi | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/bcm5301x.dtsi b/arch/arm/boot/dts/bcm5301x.dtsi
> index 807580dd89f5..89993a8a6765 100644
> --- a/arch/arm/boot/dts/bcm5301x.dtsi
> +++ b/arch/arm/boot/dts/bcm5301x.dtsi
> @@ -489,6 +489,10 @@ srab: ethernet-switch@18007000 {
>  		status = "disabled";
>  
>  		/* ports are defined in board DTS */
> +		ports {
> +			#address-cells = <1>;
> +			#size-cells = <0>;
> +		};

This look a bit 'lone wolf' here. Not sure how much time you intend to
spend on this, but FWIW, others prefer to declare all ports in the SoC
DTSI with status = "disabled", and just enable the ones used per-board,
and add labels and PHY handles also per-board. Example: fsl-ls1028a.dtsi
and fsl-ls1028a-rdb.dts.

>  	};
>  
>  	rng: rng@18004000 {
> -- 
> 2.25.1
>
Florian Fainelli Nov. 10, 2020, 10:13 p.m. UTC | #4
On 11/10/20 2:12 PM, Vladimir Oltean wrote:
> On Mon, Nov 09, 2020 at 07:31:08PM -0800, Florian Fainelli wrote:
>> Provide an empty 'ports' container node with the correct #address-cells
>> and #size-cells properties. This silences the following warning:
>>
>> arch/arm/boot/dts/bcm4708-asus-rt-ac56u.dt.yaml:
>> ethernet-switch@18007000: 'oneOf' conditional failed, one must be fixed:
>>         'ports' is a required property
>>         'ethernet-ports' is a required property
>>         From schema:
>> Documentation/devicetree/bindings/net/dsa/b53.yaml
>>
>> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
>> ---
>>  arch/arm/boot/dts/bcm5301x.dtsi | 4 ++++
>>  1 file changed, 4 insertions(+)
>>
>> diff --git a/arch/arm/boot/dts/bcm5301x.dtsi b/arch/arm/boot/dts/bcm5301x.dtsi
>> index 807580dd89f5..89993a8a6765 100644
>> --- a/arch/arm/boot/dts/bcm5301x.dtsi
>> +++ b/arch/arm/boot/dts/bcm5301x.dtsi
>> @@ -489,6 +489,10 @@ srab: ethernet-switch@18007000 {
>>  		status = "disabled";
>>  
>>  		/* ports are defined in board DTS */
>> +		ports {
>> +			#address-cells = <1>;
>> +			#size-cells = <0>;
>> +		};
> 
> This look a bit 'lone wolf' here. Not sure how much time you intend to
> spend on this, but FWIW, others prefer to declare all ports in the SoC
> DTSI with status = "disabled", and just enable the ones used per-board,
> and add labels and PHY handles also per-board. Example: fsl-ls1028a.dtsi
> and fsl-ls1028a-rdb.dts.

That's a good suggestion, I could do that.
Florian Fainelli Nov. 11, 2020, 1:48 a.m. UTC | #5
On 11/10/2020 2:13 PM, Florian Fainelli wrote:
> On 11/10/20 2:12 PM, Vladimir Oltean wrote:
>> On Mon, Nov 09, 2020 at 07:31:08PM -0800, Florian Fainelli wrote:
>>> Provide an empty 'ports' container node with the correct #address-cells
>>> and #size-cells properties. This silences the following warning:
>>>
>>> arch/arm/boot/dts/bcm4708-asus-rt-ac56u.dt.yaml:
>>> ethernet-switch@18007000: 'oneOf' conditional failed, one must be fixed:
>>>         'ports' is a required property
>>>         'ethernet-ports' is a required property
>>>         From schema:
>>> Documentation/devicetree/bindings/net/dsa/b53.yaml
>>>
>>> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
>>> ---
>>>  arch/arm/boot/dts/bcm5301x.dtsi | 4 ++++
>>>  1 file changed, 4 insertions(+)
>>>
>>> diff --git a/arch/arm/boot/dts/bcm5301x.dtsi b/arch/arm/boot/dts/bcm5301x.dtsi
>>> index 807580dd89f5..89993a8a6765 100644
>>> --- a/arch/arm/boot/dts/bcm5301x.dtsi
>>> +++ b/arch/arm/boot/dts/bcm5301x.dtsi
>>> @@ -489,6 +489,10 @@ srab: ethernet-switch@18007000 {
>>>  		status = "disabled";
>>>  
>>>  		/* ports are defined in board DTS */
>>> +		ports {
>>> +			#address-cells = <1>;
>>> +			#size-cells = <0>;
>>> +		};
>>
>> This look a bit 'lone wolf' here. Not sure how much time you intend to
>> spend on this, but FWIW, others prefer to declare all ports in the SoC
>> DTSI with status = "disabled", and just enable the ones used per-board,
>> and add labels and PHY handles also per-board. Example: fsl-ls1028a.dtsi
>> and fsl-ls1028a-rdb.dts.
> 
> That's a good suggestion, I could do that.

There is quite a bit of variation between designs and how the ports are
assigned and it would end up being quite verbose, so I will punt that
for now.
Rafał Miłecki Nov. 11, 2020, 12:27 p.m. UTC | #6
On 11.11.2020 02:48, Florian Fainelli wrote:
> On 11/10/2020 2:13 PM, Florian Fainelli wrote:
>> On 11/10/20 2:12 PM, Vladimir Oltean wrote:
>>> On Mon, Nov 09, 2020 at 07:31:08PM -0800, Florian Fainelli wrote:
>>>> Provide an empty 'ports' container node with the correct #address-cells
>>>> and #size-cells properties. This silences the following warning:
>>>>
>>>> arch/arm/boot/dts/bcm4708-asus-rt-ac56u.dt.yaml:
>>>> ethernet-switch@18007000: 'oneOf' conditional failed, one must be fixed:
>>>>          'ports' is a required property
>>>>          'ethernet-ports' is a required property
>>>>          From schema:
>>>> Documentation/devicetree/bindings/net/dsa/b53.yaml
>>>>
>>>> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
>>>> ---
>>>>   arch/arm/boot/dts/bcm5301x.dtsi | 4 ++++
>>>>   1 file changed, 4 insertions(+)
>>>>
>>>> diff --git a/arch/arm/boot/dts/bcm5301x.dtsi b/arch/arm/boot/dts/bcm5301x.dtsi
>>>> index 807580dd89f5..89993a8a6765 100644
>>>> --- a/arch/arm/boot/dts/bcm5301x.dtsi
>>>> +++ b/arch/arm/boot/dts/bcm5301x.dtsi
>>>> @@ -489,6 +489,10 @@ srab: ethernet-switch@18007000 {
>>>>   		status = "disabled";
>>>>   
>>>>   		/* ports are defined in board DTS */
>>>> +		ports {
>>>> +			#address-cells = <1>;
>>>> +			#size-cells = <0>;
>>>> +		};
>>>
>>> This look a bit 'lone wolf' here. Not sure how much time you intend to
>>> spend on this, but FWIW, others prefer to declare all ports in the SoC
>>> DTSI with status = "disabled", and just enable the ones used per-board,
>>> and add labels and PHY handles also per-board. Example: fsl-ls1028a.dtsi
>>> and fsl-ls1028a-rdb.dts.
>>
>> That's a good suggestion, I could do that.
> 
> There is quite a bit of variation between designs and how the ports are
> assigned and it would end up being quite verbose, so I will punt that
> for now.

I agree with Florian, boards (vendors) use ports really randomly so pretty
much every device needs that defined from the scratch.
diff mbox series

Patch

diff --git a/arch/arm/boot/dts/bcm5301x.dtsi b/arch/arm/boot/dts/bcm5301x.dtsi
index 807580dd89f5..89993a8a6765 100644
--- a/arch/arm/boot/dts/bcm5301x.dtsi
+++ b/arch/arm/boot/dts/bcm5301x.dtsi
@@ -489,6 +489,10 @@  srab: ethernet-switch@18007000 {
 		status = "disabled";
 
 		/* ports are defined in board DTS */
+		ports {
+			#address-cells = <1>;
+			#size-cells = <0>;
+		};
 	};
 
 	rng: rng@18004000 {