Re: [PATCH] dt-bindings: net: dsa: realtek-smi: convert to YAML schema

From: Alvin Šipraga
Date: Wed Feb 09 2022 - 11:49:28 EST


Hi,

Rob Herring <robh@xxxxxxxxxx> writes:

>> >
>> > > +
>> > > + interrupts:
>> > > + description: TODO
>> >
>> > You have to define how many interrupts and what they are.
>>
>> I didn't write the interruption code and Linus and Alvin might help here.
>>
>> The switch has a single interrupt pin that signals an interruption happened.
>
> Then it's 1 interrupt?

Correct. The switch has one physcical interrupt signal.

>
>> The code reads a register to multiplex to these interruptions:
>>
>> INT_TYPE_LINK_STATUS = 0,
>> INT_TYPE_METER_EXCEED,
>> INT_TYPE_LEARN_LIMIT,
>> INT_TYPE_LINK_SPEED,
>> INT_TYPE_CONGEST,
>> INT_TYPE_GREEN_FEATURE,
>> INT_TYPE_LOOP_DETECT,
>> INT_TYPE_8051,
>> INT_TYPE_CABLE_DIAG,
>> INT_TYPE_ACL,
>> INT_TYPE_RESERVED, /* Unused */
>> INT_TYPE_SLIENT,
>
> Unless the DT needs to route all these interrupts to multiple nodes,
> then the switch needs to be an interrupt-controller.

Yes, it is an interrupt-controller, and an interrupt-parent to the phy
nodes.

>
>>
>> And most of them, but not all, multiplex again to each port.
>
> Now I'm lost. So it's 1 per port, not 1 for the switch?

There is one physical interrupt signal for these switches. In the switch
driver IRQ handler, some registers are inspected to decide what type of
event it is. Luiz pasted the enum of possible interrupt types in his
mail above. Most of these events are ignored, or are otherwise internal
to the switch driver. But in some cases, the interrupt is actually for
one of the embedded PHYs in the switch. That's why we make the switch
an interrupt-controller.

So, in summary:

- one interrupt for the switch
- the switch is an interrupt-controller
- ... and is the interrupt-parent for the phy nodes.

The rest is internal details and shouldn't matter, as far as my
understanding of device tree bindings goes. Happy to be corrected
though.

Kind regards,
Alvin