Hi Rob,

On Mon Jul 13 2020, Rob Herring wrote:
> On Sat, Jul 11, 2020 at 5:59 AM Kurt Kanzenbach <k...@linutronix.de> wrote:
>> How?
>
> I don't know, just call it 'ethernet switch' binding or something.

OK.

>> Yes, it's a conversion of the dsa.txt. I should have stated that more
>> clearly. I didn't remove the .txt file, because it's referenced in all
>> the different switch bindings such as b53.txt, ksz.txt and so on. How to
>> handle that?
>
> Either update them if not many, or make dsa.txt just point to dsa.yaml
> as Andrew mentioned. I haven't looked, but seems like this would be a
> small number.

OK.

>
> Updating all the users to schema is also welcome. :)
>
>> Just to be sure. Instead of
>>
>>   ports {
>>     port@1 {
>>       ...
>>     }
>>   }
>>
>> The following should be possible as well?
>>
>>   ethernet-ports {
>>     port@1 {
>
> Yes, but probably 'ethernet-port@1' here. Or both can be allowed.

I think both should be allowed. No binding is using
ethernet-port. They're all using ethernet-ports and port within
(example: ti,cpsw-switch.yaml).

But, if the binding does allow for ethernet-ports, then the DSA core has
to be adjusted, or? The current code searches only for "ports" (in
dsa_switch_parse_ports_of()).

>
>>       ...
>>     }
>>   }
>>
>> Is there an easy way to add that alternative to the schema? Or does the
>> ethernet-ports property has to be defined as well?
>
> You need a pattern like:
>
> patternProperties:
>   "^(ethernet-)?ports$":
>     ...

I see. Thanks!

>
> You could also make one property a $ref to another, but I prefer the
> above.

That's what I wanted to avoid.

Thanks,
Kurt

Attachment: signature.asc
Description: PGP signature

Reply via email to