From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: Andrew Lunn <andrew@lunn.ch>, Vivien Didelot <vivien.didelot@gmail.com>
Cc: "Florian Fainelli" <f.fainelli@gmail.com>,
"Marek Behún" <kabel@kernel.org>,
"Vladimir Oltean" <olteanv@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
"Jakub Kicinski" <kuba@kernel.org>,
netdev@vger.kernel.org
Subject: [PATCH net-next 0/4] net: dsa: mv88e6xxx: convert to phylink_generic_validate()
Date: Thu, 3 Feb 2022 13:29:40 +0000 [thread overview]
Message-ID: <YfvYxNAkOZ6aNxql@shell.armlinux.org.uk> (raw)
Hi,
The overall objective of this series is to convert the mv88e6xxx DSA
driver to use phylink_generic_validate().
Patch 1 adds a new helper mv88e6352_g2_scratch_port_has_serdes() which
indicates whether an 88e6352 port has a serdes associated with it. This
is necessary as ports 4 and 5 will normally be in automedia mode, where
the CMODE field in the port status register will change e.g. between 15
(internal PHY) and 9 (1000base-X) depending on whether the serdes has
link.
The existing code caches the cmode field, and depending whether the
serdes has link at probe time, determines whether we allow things such
as the serdes statistics to be accessed. This means if the link isn't
up at probe time, the serdes is essentially unavailable.
Patch 1 addresses this by reading the pin configuration to find out
whether the serdes is attached to port 4 or port 5.
Patch 2 is a joint effort between myself and Marek Behún, adding the
supported interfaces and MAC capabilities to all mv88e6xxx supported
switch devices. This is slightly more restrictive than the original
code as we didn't used to care too much about the interface mode, but
with this we do - which is why we must know if there's a serdes
associated now.
Patch 3 switches mv88e6xxx to use the generic validation by removing
the initialisation of the phylink_validate pointer in the dsa_ops
struct.
Patch 4 updates the statistics code to use the new helper in patch 1,
so the serdes statistics are available even if the link was down at
driver probe time.
drivers/net/dsa/mv88e6xxx/chip.c | 350 ++++++++++++++++++----------
drivers/net/dsa/mv88e6xxx/chip.h | 5 +-
drivers/net/dsa/mv88e6xxx/global2.h | 3 +
drivers/net/dsa/mv88e6xxx/global2_scratch.c | 28 +++
drivers/net/dsa/mv88e6xxx/port.h | 5 +
drivers/net/dsa/mv88e6xxx/serdes.c | 43 ++--
6 files changed, 294 insertions(+), 140 deletions(-)
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!
next reply other threads:[~2022-02-03 13:29 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-03 13:29 Russell King (Oracle) [this message]
2022-02-03 13:30 ` [PATCH net-next 1/4] net: dsa: mv88e6xxx: add mv88e6352_g2_scratch_port_has_serdes() Russell King (Oracle)
2022-02-03 13:41 ` Andrew Lunn
2022-02-03 13:30 ` [PATCH net-next 2/4] net: dsa: mv88e6xxx: populate supported_interfaces and mac_capabilities Russell King (Oracle)
2022-02-03 13:51 ` Andrew Lunn
2022-02-03 13:30 ` [PATCH net-next 3/4] net: dsa: mv88e6xxx: convert to phylink_generic_validate() Russell King (Oracle)
2022-02-03 13:30 ` [PATCH net-next 4/4] net: dsa: mv88e6xxx: improve 88e6352 serdes statistics detection Russell King (Oracle)
2022-02-03 13:53 ` Andrew Lunn
2022-02-03 14:20 ` [PATCH net-next 0/4] net: dsa: mv88e6xxx: convert to phylink_generic_validate() patchwork-bot+netdevbpf
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=YfvYxNAkOZ6aNxql@shell.armlinux.org.uk \
--to=linux@armlinux.org.uk \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=kabel@kernel.org \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--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).