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: Daniel Golle <daniel@makrotopia.org>,
	"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>,
	"sander@svanheule.net" <sander@svanheule.net>,
	"markus.stockhausen@gmx.de" <markus.stockhausen@gmx.de>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: [PATCH net-next v9] net: mdio: Add RTL9300 MDIO driver
Date: Thu, 13 Mar 2025 14:05:46 +0100	[thread overview]
Message-ID: <478cf6c2-8461-46f8-bcde-d89032c35d63@lunn.ch> (raw)
In-Reply-To: <7269cf0f-21c6-45e1-a1f3-5463bdd9fd5c@alliedtelesis.co.nz>

> Ah I get it. It's about tracking the current page for a particular 
> device address and using that instead of 0xfff in 
> FIELD_PREP(PHY_CTRL_MAIN_PAGE, 0xfff). I'm not sure it's going to work 
> generically. Realtek switches know about Realtek PHYs but I've seen 
> plenty of other PHYs that do paging via addresses other than 0x1f 
> (Marvell 88E1111 for example uses 0x1d for its extaddr, some Broadcom 
> PHYs seem to use 0x1c). I'm not sure how many systems are mixing vendors 
> for C22 PHYs (the Zyxel boards seem to have Marvell AQR 10G PHYs but 
> that's C45).

It is worse than that. The switch needs to change the page itself:

static int rtlgen_read_status(struct phy_device *phydev)
{
        int ret, val;

        ret = genphy_read_status(phydev);
        if (ret < 0)
                return ret;

        if (!phydev->link)
                return 0;

        val = phy_read_paged(phydev, 0xa43, 0x12);
        if (val < 0)
                return val;

        rtlgen_decode_physr(phydev, val);

It needs to read register 0x12 from page 0xa43.

I do agree this cannot work in the general case. Which is why i asked
about what the limitations are for configuring the MAC in software.

	Andrew

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

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-09 23:25 Chris Packham
2025-03-10  1:31 ` Daniel Golle
2025-03-10  2:07   ` Chris Packham
2025-03-10 15:28     ` Daniel Golle
2025-03-13  1:04       ` Chris Packham
2025-03-13 13:05         ` Andrew Lunn [this message]
2025-03-10 16:32     ` Andrew Lunn
2025-03-10 16:34     ` Russell King (Oracle)
2025-03-10 16:27   ` Andrew Lunn
2025-03-10 18:06 ` Christophe JAILLET
2025-03-10 18:15   ` Russell King (Oracle)

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=478cf6c2-8461-46f8-bcde-d89032c35d63@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®