mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Arınç ÜNAL" <arinc.unal@arinc9.com>
To: Vladimir Oltean <vladimir.oltean@nxp.com>, netdev@vger.kernel.org
Cc: "David S. Miller" <davem@davemloft.net>,
	"Eric Dumazet" <edumazet@google.com>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Paolo Abeni" <pabeni@redhat.com>,
	"Sean Wang" <sean.wang@mediatek.com>,
	"Landen Chao" <Landen.Chao@mediatek.com>,
	"DENG Qingfang" <dqfext@gmail.com>,
	"Andrew Lunn" <andrew@lunn.ch>,
	"Florian Fainelli" <f.fainelli@gmail.com>,
	"Matthias Brugger" <matthias.bgg@gmail.com>,
	"AngeloGioacchino Del Regno"
	<angelogioacchino.delregno@collabora.com>,
	"Russell King" <linux@armlinux.org.uk>,
	"René van Dorst" <opensource@vdorst.com>,
	"Alexander Couzens" <lynxis@fe80.eu>,
	"Ilya Lipnitskiy" <ilya.lipnitskiy@gmail.com>,
	"Richard van Schagen" <richard@routerhints.com>,
	"Frank Wunderlich" <frank-w@public-files.de>,
	erkin.bozoglu@xeront.com, "Greg Ungerer" <gerg@kernel.org>,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org, arinc9.unal@gmail.com
Subject: Re: [PATCH net] net: dsa: mt7530: permit port 5 to work without port 6 on MT7621 SoC
Date: Fri, 14 Apr 2023 15:26:52 +0300	[thread overview]
Message-ID: <60d11eba-9532-48ea-b4ce-28a332f2b7df@arinc9.com> (raw)
In-Reply-To: <20230307155411.868573-1-vladimir.oltean@nxp.com>

On 7.03.2023 18:54, Vladimir Oltean wrote:
> The MT7530 switch from the MT7621 SoC has 2 ports which can be set up as
> internal: port 5 and 6. Arınç reports that the GMAC1 attached to port 5
> receives corrupted frames, unless port 6 (attached to GMAC0) has been
> brought up by the driver. This is true regardless of whether port 5 is
> used as a user port or as a CPU port (carrying DSA tags).
> 
> Offline debugging (blind for me) which began in the linked thread showed
> experimentally that the configuration done by the driver for port 6
> contains a step which is needed by port 5 as well - the write to
> CORE_GSWPLL_GRP2 (note that I've no idea as to what it does, apart from
> the comment "Set core clock into 500Mhz"). Prints put by Arınç show that
> the reset value of CORE_GSWPLL_GRP2 is RG_GSWPLL_POSDIV_500M(1) |
> RG_GSWPLL_FBKDIV_500M(40) (0x128), both on the MCM MT7530 from the
> MT7621 SoC, as well as on the standalone MT7530 from MT7623NI Bananapi
> BPI-R2. Apparently, port 5 on the standalone MT7530 can work under both
> values of the register, while on the MT7621 SoC it cannot.

I finally found out why. Looking at gsw_mt7623.c [0], setting the core 
clock into 500Mhz is done for 40MHz XTAL. With some dev_info code, I was 
able to confirm that the MCM MT7530 on my MT7621 board runs at 40MHz 
whilst the standalone MT7530 on my Bananapi BPI-R2 runs at 25MHz.

[0] 
https://github.com/BPI-SINOVOIP/BPI-R2-bsp/blob/master/linux-mt/drivers/net/ethernet/mediatek/gsw_mt7623.c#L1039

Arınç

      parent reply	other threads:[~2023-04-14 12:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-07 15:54 Vladimir Oltean
2023-03-07 21:11 ` Arınç ÜNAL
2023-03-08 12:09 ` Simon Horman
2023-03-09  7:30 ` patchwork-bot+netdevbpf
2023-04-14 12:26 ` Arınç ÜNAL [this message]

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=60d11eba-9532-48ea-b4ce-28a332f2b7df@arinc9.com \
    --to=arinc.unal@arinc9.com \
    --cc=Landen.Chao@mediatek.com \
    --cc=andrew@lunn.ch \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=arinc9.unal@gmail.com \
    --cc=davem@davemloft.net \
    --cc=dqfext@gmail.com \
    --cc=edumazet@google.com \
    --cc=erkin.bozoglu@xeront.com \
    --cc=f.fainelli@gmail.com \
    --cc=frank-w@public-files.de \
    --cc=gerg@kernel.org \
    --cc=ilya.lipnitskiy@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux@armlinux.org.uk \
    --cc=lynxis@fe80.eu \
    --cc=matthias.bgg@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=opensource@vdorst.com \
    --cc=pabeni@redhat.com \
    --cc=richard@routerhints.com \
    --cc=sean.wang@mediatek.com \
    --cc=vladimir.oltean@nxp.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

all inboxes | Powered by JetHome®