public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: sean.wang@mediatek.com
Cc: john@phrozen.org, davem@davemloft.net, nbd@openwrt.org,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-mediatek@lists.infradead.org
Subject: Re: [PATCH net-next 3/4] net-next: mediatek: add support for MediaTek MT7622 SoC
Date: Wed, 12 Jul 2017 17:00:09 +0200	[thread overview]
Message-ID: <20170712150009.GE2557@lunn.ch> (raw)
In-Reply-To: <42912dfa706f0d1f1bbe152da71dc00c0a4e18cc.1499829241.git.sean.wang@mediatek.com>

Hi Sean

>  static void mtk_phy_link_adjust(struct net_device *dev)
>  {
>  	struct mtk_mac *mac = netdev_priv(dev);
> @@ -269,6 +311,7 @@ static int mtk_phy_connect(struct net_device *dev)
>  	if (!np)
>  		return -ENODEV;
>  
> +	mac->ge_mode = 0;
>  	switch (of_get_phy_mode(np)) {
>  	case PHY_INTERFACE_MODE_TRGMII:
>  		mac->trgmii = true;
> @@ -276,7 +319,15 @@ static int mtk_phy_connect(struct net_device *dev)
>  	case PHY_INTERFACE_MODE_RGMII_RXID:
>  	case PHY_INTERFACE_MODE_RGMII_ID:
>  	case PHY_INTERFACE_MODE_RGMII:
> -		mac->ge_mode = 0;
> +		break;
> +	case PHY_INTERFACE_MODE_SGMII:
> +		if (MTK_HAS_CAPS(eth->soc->caps, MTK_SGMII))
> +			mtk_gmac_sgmii_hw_setup(eth, mac->id);
> +		break;

> +	case PHY_INTERFACE_MODE_INTERNAL:
> +		if (MTK_HAS_CAPS(eth->soc->caps, MTK_GMAC1_ESW) && !mac->id)
> +			/* Setup the path through ESW internal switch */
> +			mtk_w32(eth, MTK_MUX_TO_ESW, MTK_MAC_MISC);

This bit is interesting. Generally, there is no PHY at all between the
MAC and the switch. So i don't think this is correct. Please can you
take this out for the moment, until you actually add support for the
switch. We can discuss it then, when we see the bigger picture.

	Andrew

  reply	other threads:[~2017-07-12 15:00 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-12  3:37 [PATCH net-next 0/4] net-next: mediatek: add support for ethernet on MT7622 SoC sean.wang
2017-07-12  3:37 ` [PATCH net-next 1/4] dt-bindings: net: mediatek: add support for MediaTek MT7623 and " sean.wang
2017-07-12  3:37 ` [PATCH net-next 2/4] net-next: mediatek: add platform data to adapt into various hardware sean.wang
2017-07-12  4:19   ` Florian Fainelli
2017-07-12 14:50   ` Andrew Lunn
2017-07-15  1:47     ` Sean Wang
2017-07-12  3:37 ` [PATCH net-next 3/4] net-next: mediatek: add support for MediaTek MT7622 SoC sean.wang
2017-07-12 15:00   ` Andrew Lunn [this message]
2017-07-12  3:37 ` [PATCH net-next 4/4] MAINTAINERS: add Sean/Nelson as MediaTek ethernet maintainers sean.wang
2017-07-12  3:53 ` [PATCH net-next 0/4] net-next: mediatek: add support for ethernet on MT7622 SoC David Miller

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=20170712150009.GE2557@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=john@phrozen.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=nbd@openwrt.org \
    --cc=netdev@vger.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