Netdev List
 help / color / mirror / Atom feed
From: Daniel Golle <daniel@makrotopia.org>
To: Joris Vaisvila <joey@tinyisr.com>
Cc: netdev@vger.kernel.org, horms@kernel.org, pabeni@redhat.com,
	kuba@kernel.org, edumazet@google.com, davem@davemloft.net,
	olteanv@gmail.com, "Andrew Lunn" <andrew@lunn.ch>,
	devicetree@vger.kernel.org, "Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Arınç ÜNAL" <arinc.unal@arinc9.com>,
	"Landen Chao" <Landen.Chao@mediatek.com>,
	"DENG Qingfang" <dqfext@gmail.com>,
	"Sean Wang" <sean.wang@mediatek.com>
Subject: Re: [PATCH net-next v5 2/4] net: phy: mediatek: add phy driver for MT7628 built-in Fast Ethernet PHYs
Date: Sat, 13 Jun 2026 19:49:13 +0100	[thread overview]
Message-ID: <ai2mKe-fC2D_6pc8@makrotopia.org> (raw)
In-Reply-To: <20260613181845.111877-3-joey@tinyisr.com>

On Sat, Jun 13, 2026 at 09:18:43PM +0300, Joris Vaisvila wrote:
> The Fast Ethernet PHYs present in the MT7628 SoCs require an
> undocumented bit to be set before they can establish 100mbps links.
> 
> This commit adds the Kconfig option MEDIATEK_FE_SOC_PHY and the
> corresponding driver mtk-fe-soc.c.
> 
> Signed-off-by: Joris Vaisvila <joey@tinyisr.com>
> Reviewed-by: Andrew Lunn <andrew@lunn.ch>

Reviewed-by: Daniel Golle <daniel@makrotopia.org>

> [...]
> diff --git a/drivers/net/phy/mediatek/mtk-fe-soc.c b/drivers/net/phy/mediatek/mtk-fe-soc.c
> new file mode 100644
> index 000000000000..9eb4960bcaad
> --- /dev/null
> +++ b/drivers/net/phy/mediatek/mtk-fe-soc.c
> @@ -0,0 +1,50 @@
> +// SPDX-License-Identifier: GPL-2.0-only
> +/*
> + * Driver for MT7628 Embedded Switch internal Fast Ethernet PHYs
> + */
> +#include <linux/module.h>
> +#include <linux/phy.h>
> +
> +#define MTK_FPHY_ID_MT7628	0x03a29410
> +#define MTK_EXT_PAGE_ACCESS	0x1f
> +
> +static int mt7628_phy_read_page(struct phy_device *phydev)
> +{
> +	return __phy_read(phydev, MTK_EXT_PAGE_ACCESS);
> +}
> +
> +static int mt7628_phy_write_page(struct phy_device *phydev, int page)
> +{
> +	return __phy_write(phydev, MTK_EXT_PAGE_ACCESS, page);
> +}
> +
> +static int mt7628_phy_config_init(struct phy_device *phydev)
> +{
> +	/*
> +	 * This undocumented bit is required for the PHYs to be able to
> +	 * establish 100mbps links.
> +	 */
> +	return phy_modify_paged(phydev, 0x8000, 30, BIT(13), BIT(13));

As there is only that single use I don't think it justifies introducing
a phy_set_bits_paged helper just for that, but that's my opinion...

  reply	other threads:[~2026-06-13 18:49 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-13 18:18 [PATCH net-next v5 0/4] net: dsa: mt7628 embedded switch initial support Joris Vaisvila
2026-06-13 18:18 ` [PATCH net-next v5 1/4] dt-bindings: net: dsa: add MT7628 ESW Joris Vaisvila
2026-06-13 18:18 ` [PATCH net-next v5 2/4] net: phy: mediatek: add phy driver for MT7628 built-in Fast Ethernet PHYs Joris Vaisvila
2026-06-13 18:49   ` Daniel Golle [this message]
2026-06-13 18:18 ` [PATCH net-next v5 3/4] net: dsa: initial MT7628 tagging driver Joris Vaisvila
2026-06-13 18:49   ` Daniel Golle
2026-06-13 18:18 ` [PATCH net-next v5 4/4] net: dsa: initial support for MT7628 embedded switch Joris Vaisvila
2026-06-13 18:52   ` 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=ai2mKe-fC2D_6pc8@makrotopia.org \
    --to=daniel@makrotopia.org \
    --cc=Landen.Chao@mediatek.com \
    --cc=andrew@lunn.ch \
    --cc=arinc.unal@arinc9.com \
    --cc=conor+dt@kernel.org \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=dqfext@gmail.com \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=joey@tinyisr.com \
    --cc=krzk+dt@kernel.org \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=pabeni@redhat.com \
    --cc=robh@kernel.org \
    --cc=sean.wang@mediatek.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