devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail.com>
To: Luiz Angelo Daros de Luca <luizluca@gmail.com>,
	Andrew Lunn <andrew@lunn.ch>
Cc: "Alvin Šipraga" <ALSI@bang-olufsen.dk>,
	"Rob Herring" <robh@kernel.org>,
	"Linus Walleij" <linus.walleij@linaro.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"Arnd Bergmann" <arnd@arndb.de>,
	"Olof Johansson" <olof@lixom.net>,
	"Arınç ÜNAL" <arinc.unal@arinc9.com>,
	"Stephen Rothwell" <sfr@canb.auug.org.au>,
	"Vivien Didelot" <vivien.didelot@gmail.com>,
	"Vladimir Oltean" <olteanv@gmail.com>,
	"David S . Miller" <davem@davemloft.net>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"open list:NETWORKING DRIVERS" <netdev@vger.kernel.org>,
	"open list" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] dt-bindings: net: dsa: realtek-smi: convert to YAML schema
Date: Wed, 9 Feb 2022 10:55:43 -0800	[thread overview]
Message-ID: <d5bdb281-6968-b80f-bfc0-ae35a12ebfff@gmail.com> (raw)
In-Reply-To: <CAJq09z49EEMxtBTs9q0sg3nn0VrSi0M=DkQTJ_n=QmgTr1aonw@mail.gmail.com>

On 2/9/22 10:43 AM, Luiz Angelo Daros de Luca wrote:
>>> However, the linux driver today does not care about any of these
>>> interruptions but INT_TYPE_LINK_STATUS. So it simply multiplex only
>>> this the interruption to each port, in a n-cell map (n being number of
>>> ports).
>>> I don't know what to describe here as device-tree should be something
>>> independent of a particular OS or driver.
>>
>> You shouldn't need to know what Linux does to figure this out.
> 
> The Linux driver is masquerading all those interruptions into a single
> "link status changed". If interrupts property is about what the HW
> sends to us, it is a single pin.
> 
>   interrupt-controller:
>    type: object
>    description: |
>      This defines an interrupt controller with an IRQ line (typically
>      a GPIO) that will demultiplex and handle the interrupt from the single
>      interrupt line coming out of one of the Realtek switch chips. It most
>      importantly provides link up/down interrupts to the PHY blocks inside
>      the ASIC.

The de-multiplexing is a software construct/operation, in fact, what the
GPIO line does is multiplex since the line is used as an output to the
next level interrupt controller it connects to.

> 
>    properties:
> 
>      interrupt-controller: true
> 
>      interrupts:
>        maxItems: 1
>        description:
>          A single IRQ line from the switch, either active LOW or HIGH
> 
>      '#address-cells':
>        const: 0
> 
>      '#interrupt-cells':
>        const: 1
> 
>    required:
>      - interrupt-controller
>      - '#address-cells'
>      - '#interrupt-cells'
> 
> Now as it is also an interrupt-controller, shouldn't I document what it emits?

The interrupt controller emits a single output towards the next level,
and you documented that already with these properties. If you want to go
ahead and define what the various interrupt bits map to within the
switch's interrupt controller, you can do that in an
include/dt-bindings/ header file, or you can just open code the numbers.
Up to you.

> I've just sent the new version and we can discuss it there.
> 
>>>  - one interrupt for the switch
>>>  - the switch is an interrupt-controller
>>>  - ... and is the interrupt-parent for the phy nodes.
>>
>> This pattern is pretty common for DSA switches, which have internal
>> PHYs. You can see this in the mv88e6xxx binding for example.
> 
> The issue is that those similar devices are still not in yaml format.

That does not mean we could not update dsa.yaml to list the
'interrupts', 'interrupt-controller' and '#interrupt-cells' properties
and just leave it to the individual YAML bindings to specify the shape
and size of those properties so they don't have to repeat them.
-- 
Florian

      reply	other threads:[~2022-02-09 18:57 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-28  7:26 [PATCH] dt-bindings: net: dsa: realtek-smi: convert to YAML schema Luiz Angelo Daros de Luca
2022-01-02  6:38 ` Linus Walleij
2022-01-04 23:44   ` Luiz Angelo Daros de Luca
2022-01-10 18:09     ` Rob Herring
2022-01-16  0:15     ` Linus Walleij
2022-01-10 18:20 ` Rob Herring
2022-01-29 16:02   ` Luiz Angelo Daros de Luca
2022-01-29 19:35     ` Arınç ÜNAL
2022-01-29 20:52       ` Luiz Angelo Daros de Luca
2022-01-30 17:35         ` Florian Fainelli
2022-01-31  0:49           ` Luiz Angelo Daros de Luca
2022-02-09  8:37           ` Luiz Angelo Daros de Luca
2022-02-09 15:28     ` Rob Herring
2022-02-09 16:49       ` Alvin Šipraga
2022-02-09 17:36         ` Andrew Lunn
2022-02-09 18:43           ` Luiz Angelo Daros de Luca
2022-02-09 18:55             ` Florian Fainelli [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d5bdb281-6968-b80f-bfc0-ae35a12ebfff@gmail.com \
    --to=f.fainelli@gmail.com \
    --cc=ALSI@bang-olufsen.dk \
    --cc=andrew@lunn.ch \
    --cc=arinc.unal@arinc9.com \
    --cc=arnd@arndb.de \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=kuba@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luizluca@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=olof@lixom.net \
    --cc=olteanv@gmail.com \
    --cc=robh@kernel.org \
    --cc=sfr@canb.auug.org.au \
    --cc=vivien.didelot@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).