netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lorenzo Bianconi <lorenzo@kernel.org>
To: Andrew Lunn <andrew@lunn.ch>
Cc: netdev@vger.kernel.org, nbd@nbd.name,
	lorenzo.bianconi83@gmail.com, davem@davemloft.net,
	edumazet@google.com, kuba@kernel.org, pabeni@redhat.com,
	conor@kernel.org, linux-arm-kernel@lists.infradead.org,
	robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org,
	conor+dt@kernel.org, devicetree@vger.kernel.org,
	catalin.marinas@arm.com, will@kernel.org, upstream@airoha.com,
	angelogioacchino.delregno@collabora.com,
	benjamin.larsson@genexis.eu, rkannoth@marvell.com,
	sgoutham@marvell.com
Subject: Re: [PATCH v3 net-next 2/2] net: airoha: Introduce ethernet support for EN7581 SoC
Date: Mon, 24 Jun 2024 15:14:35 +0200	[thread overview]
Message-ID: <ZnlxO2yAxkkkejU-@lore-desk> (raw)
In-Reply-To: <e9ae143c-e72f-419b-b4da-2f603a4ccec0@lunn.ch>

[-- Attachment #1: Type: text/plain, Size: 3514 bytes --]

> > > > +static void airoha_fe_oq_rsv_init(struct airoha_eth *eth)
> > > > +{
> > > > +	int i;
> > > > +
> > > > +	/* hw misses PPE2 oq rsv */
> > > > +	airoha_fe_set(eth, REG_FE_PSE_BUF_SET,
> > > > +		      PSE_DEF_RSV_PAGE * PSE_PORT8_QUEUE);
> > > > +
> > > > +	for (i = 0; i < PSE_PORT0_QUEUE; i++)
> > > > +		airoha_fe_set_pse_oq_rsv(eth, 0, i, 0x40);
> > > > +	for (i = 0; i < PSE_PORT1_QUEUE; i++)
> > > > +		airoha_fe_set_pse_oq_rsv(eth, 1, i, 0x40);
> > > > +
> > > > +	for (i = 6; i < PSE_PORT2_QUEUE; i++)
> > > > +		airoha_fe_set_pse_oq_rsv(eth, 2, i, 0);
> > > > +
> > > > +	for (i = 0; i < PSE_PORT3_QUEUE; i++)
> > > > +		airoha_fe_set_pse_oq_rsv(eth, 3, i, 0x40);
> > > 
> > > Code like this is making me wounder about the split between MAC
> > > driver, DSA driver and DSA tag driver. Or if it should actually be a
> > > pure switchdev driver?
> > 
> > airoha_eth driver implements just MAC features (FE and QDMA). Currently we only
> > support the connection to the DSA switch (GDM1). EN7581 SoC relies on mt7530 driver
> > for DSA (I have not posted the patch for mt7530 yet, I will do after airoha_eth
> > ones).
> > 
> > > 
> > > If there some open architecture documentation for this device?
> > > 
> > > What are these ports about?
> > 
> > airoha_fe_oq_rsv_init() (we can improve naming here :) is supposed to configure
> > hw pre-allocated memory for each queue available in Packet Switching Engine
> > (PSE) ports. PSE ports are not switch ports, but SoC internal ports used to
> > connect PSE to different modules. In particular, we are currently implementing
> > just the two connections below:
> > - CDM1 (port0) connects PSE to QDMA1
> > - GDM1 (port1) connects PSE to MT7530 DSA switch
> > 
> > In the future we will post support for GDM2, GDM3 and GDM4 ports that are
> > connecting PSE to exteranl PHY modules.
> 
> I've not looked at the datasheet yet, but maybe add some ASCII art
> diagram of the architecture in the commit message, or even a .rst file
> somewhere under Documentation. It is hard to get the big picture
> looking at just the code, and only the MAC driver without all the
> other parts.

ack, I will do my best :)

> 
> > > > +static int airoha_dev_open(struct net_device *dev)
> > > > +{
> > > > +	struct airoha_eth *eth = netdev_priv(dev);
> > > > +	int err;
> > > > +
> > > > +	if (netdev_uses_dsa(dev))
> > > > +		airoha_fe_set(eth, REG_GDM1_INGRESS_CFG, GDM1_STAG_EN_MASK);
> > > > +	else
> > > > +		airoha_fe_clear(eth, REG_GDM1_INGRESS_CFG, GDM1_STAG_EN_MASK);
> > > 
> > > Does that imply both instances of the GMAC are not connected to the
> > > switch? Can one be used with a PHY?
> > 
> > The check above is used to support configuration where MT7530 DSA switch module
> > is not loaded (I tested this configuration removing the MT7530 DSA switch from
> > board dts and resetting the switch). Since for the moment we just support GDM1
> > port (PSE port connected to the switch) we can probably assume it is always the
> > case and remove this check. In the future we will need this configuration to support
> > GDM2 or GDM3 (PSE port connected to external phy modules). Do you prefer to
> > always set GDM1_STAG_EN_MASK for the moment?
> 
> If it will be needed, then keep it. But it is the sort of thing which
> raises questions, so its good to explain it, either in the commit
> message, or in the code.

ack, I will add it in v4

Regards,
Lorenzo

> 
> 	Andrew

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  reply	other threads:[~2024-06-24 13:14 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-23 16:19 [PATCH v3 net-next 0/2] Introduce EN7581 ethernet support Lorenzo Bianconi
2024-06-23 16:19 ` [PATCH v3 net-next 1/2] dt-bindings: net: airoha: Add EN7581 ethernet controller Lorenzo Bianconi
2024-06-27 22:10   ` Rob Herring
2024-06-28  8:10     ` Lorenzo Bianconi
2024-06-23 16:19 ` [PATCH v3 net-next 2/2] net: airoha: Introduce ethernet support for EN7581 SoC Lorenzo Bianconi
2024-06-23 17:56   ` Andrew Lunn
2024-06-23 23:01     ` Benjamin Larsson
2024-06-24 15:45       ` Andrew Lunn
2024-06-24 19:26         ` Benjamin Larsson
2024-06-28 11:11         ` Lorenzo Bianconi
2024-06-23 23:55     ` Lorenzo Bianconi
2024-06-24 13:05       ` Andrew Lunn
2024-06-24 13:14         ` Lorenzo Bianconi [this message]
2024-06-24 15:57       ` Andrew Lunn
2024-06-24 16:22         ` Lorenzo Bianconi
2024-06-24 13:03   ` Sunil Kovvuri Goutham
2024-06-24 13:10     ` Lorenzo Bianconi
2024-06-26 20:18   ` Simon Horman
2024-06-28 10:02     ` Lorenzo Bianconi

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=ZnlxO2yAxkkkejU-@lore-desk \
    --to=lorenzo@kernel.org \
    --cc=andrew@lunn.ch \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=benjamin.larsson@genexis.eu \
    --cc=catalin.marinas@arm.com \
    --cc=conor+dt@kernel.org \
    --cc=conor@kernel.org \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=edumazet@google.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=lorenzo.bianconi83@gmail.com \
    --cc=nbd@nbd.name \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=rkannoth@marvell.com \
    --cc=robh+dt@kernel.org \
    --cc=sgoutham@marvell.com \
    --cc=upstream@airoha.com \
    --cc=will@kernel.org \
    /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).