mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Chris Packham <Chris.Packham@alliedtelesis.co.nz>
Cc: "hkallweit1@gmail.com" <hkallweit1@gmail.com>,
	"linux@armlinux.org.uk" <linux@armlinux.org.uk>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"edumazet@google.com" <edumazet@google.com>,
	"kuba@kernel.org" <kuba@kernel.org>,
	"pabeni@redhat.com" <pabeni@redhat.com>,
	"daniel@makrotopia.org" <daniel@makrotopia.org>,
	"markus.stockhausen@gmx.de" <markus.stockhausen@gmx.de>,
	"sander@svanheule.net" <sander@svanheule.net>,
	netdev <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v10] net: mdio: Add RTL9300 MDIO driver
Date: Thu, 13 Mar 2025 21:35:05 +0100	[thread overview]
Message-ID: <be39bb63-446e-4c6a-9bb9-a823f0a482be@lunn.ch> (raw)
In-Reply-To: <5ea333ec-c2e4-4715-8a44-0fd2c77a4f3c@alliedtelesis.co.nz>

On Thu, Mar 13, 2025 at 07:54:39PM +0000, Chris Packham wrote:
> +cc netdev, lkml
> 
> On 14/03/2025 01:34, Andrew Lunn wrote:
> >> +	/* Put the interfaces into C45 mode if required */
> >> +	glb_ctrl_mask = GENMASK(19, 16);
> >> +	for (i = 0; i < MAX_SMI_BUSSES; i++)
> >> +		if (priv->smi_bus_is_c45[i])
> >> +			glb_ctrl_val |= GLB_CTRL_INTF_SEL(i);
> >> +
> >> +	fwnode_for_each_child_node(node, child)
> >> +		if (fwnode_device_is_compatible(child, "ethernet-phy-ieee802.3-c45"))
> >> +			priv->smi_bus_is_c45[mdio_bus] = true;
> >> +
> > This needs more explanation. Some PHYs mix C22 and C45, e.g. the > 1G
> > speed support registers are in the C45 address space, but <= 1G is in
> > the C22 space. And 1G PHYs which support EEE need access to C45 space
> > for the EEE registers.
> 
> Ah good point. The MDIO interfaces are either in GPHY (i.e. clause 22) 
> or 10GPHY mode (i.e. clause 45). This does mean we can't support support 
> both c45 and c22 on the same MDIO bus (whether that's one PHY that 
> supports both or two different PHYs). I'll add a comment to that effect 
> and I should probably only provide bus->read/write or 
> bus->read_c45/write_c45 depending on the mode.

Is there more to it than this? Because why not just set the mode per
bus transaction?

	Andrew

  reply	other threads:[~2025-03-13 20:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20250313010726.2181302-1-chris.packham@alliedtelesis.co.nz>
     [not found] ` <f7c7f28b-f2b0-464a-a621-d4b2f815d206@lunn.ch>
2025-03-13 19:54   ` Chris Packham
2025-03-13 20:35     ` Andrew Lunn [this message]
2025-03-13 20:37       ` Chris Packham
2025-03-13 20:40         ` Andrew Lunn
2025-03-13 20:44           ` Chris Packham
2025-03-13 22:07             ` Andrew Lunn
2025-03-13 22:53               ` Chris Packham
2025-03-13 23:01               ` Daniel Golle

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=be39bb63-446e-4c6a-9bb9-a823f0a482be@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=Chris.Packham@alliedtelesis.co.nz \
    --cc=daniel@makrotopia.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=markus.stockhausen@gmx.de \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sander@svanheule.net \
    /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

all inboxes | Powered by JetHome®