[PATCH 3/7] dt-bindings: net: dsa: mediatek,mt7530: add port bindings for MT7988

Krzysztof Kozlowski krzysztof.kozlowski at linaro.org
Fri Apr 7 02:07:16 PDT 2023


On 06/04/2023 21:18, Arınç ÜNAL wrote:
> On 6.04.2023 22:07, Krzysztof Kozlowski wrote:
>> On 06/04/2023 10:01, arinc9.unal at gmail.com wrote:
>>> From: Arınç ÜNAL <arinc.unal at arinc9.com>
>>>
>>> The switch on MT7988 has got only port 6 as a CPU port. The only phy-mode
>>> to be used is internal. Add this.
>>>
>>> Some bindings are incorrect for this switch now, so move them to more
>>> specific places.
>>>
>>> Address the incorrect information of which ports can be used as a user
>>> port. Any port can be used as a user port.
>>>
>>> Signed-off-by: Arınç ÜNAL <arinc.unal at arinc9.com>
>>> ---
>>>   .../bindings/net/dsa/mediatek,mt7530.yaml     | 63 ++++++++++++++-----
>>>   1 file changed, 46 insertions(+), 17 deletions(-)
>>>
>>> diff --git a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
>>> index 7045a98d9593..605888ce2bc6 100644
>>> --- a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
>>> +++ b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
>>> @@ -160,22 +160,6 @@ patternProperties:
>>>         "^(ethernet-)?port@[0-9]+$":
>>>           type: object
>>>   
>>> -        properties:
>>> -          reg:
>>> -            description:
>>> -              Port address described must be 5 or 6 for CPU port and from 0 to 5
>>> -              for user ports.
>>> -
>>> -        allOf:
>>> -          - if:
>>> -              required: [ ethernet ]
>>> -            then:
>>> -              properties:
>>> -                reg:
>>> -                  enum:
>>> -                    - 5
>>> -                    - 6
>>> -
>>
>> I have doubts that the binding is still maintainable/reviewable. First,
>> why do you need all above patterns after removal of entire contents?
> 
> The 'type: object' item is still globally used. I'd have to define that 
> on each definitions, I suppose?

Doesn't it come from dsa.yaml/dsa-port.yaml schema?

> 
>>
>> Second, amount of if-then-if-then located in existing blocks (not
>> top-level) is quite big. I counted if-then-using defs, where defs has
>> patternProps-patternProps-if-then-if-then-properties.... OMG. :)
> 
> Yup, not much to do if we want to keep the information. I'm still 
> maintaining this though. ¯\_(ツ)_/¯

Maybe it should be split into few bindings sharing common part.

Best regards,
Krzysztof




More information about the Linux-mediatek mailing list