[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230306201905.yothcuxokzlk3mcq@skbuf>
Date: Mon, 6 Mar 2023 22:19:05 +0200
From: Vladimir Oltean <olteanv@...il.com>
To: Arınç ÜNAL <arinc.unal@...nc9.com>
Cc: Sean Wang <sean.wang@...iatek.com>,
Landen Chao <Landen.Chao@...iatek.com>,
DENG Qingfang <dqfext@...il.com>, Andrew Lunn <andrew@...n.ch>,
Florian Fainelli <f.fainelli@...il.com>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Matthias Brugger <matthias.bgg@...il.com>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@...labora.com>,
Russell King <linux@...linux.org.uk>,
Russell King <rmk+kernel@...linux.org.uk>,
René van Dorst <opensource@...rst.com>,
Alexander Couzens <lynxis@...0.eu>,
Ilya Lipnitskiy <ilya.lipnitskiy@...il.com>,
Richard van Schagen <richard@...terhints.com>,
Frank Wunderlich <frank-w@...lic-files.de>,
erkin.bozoglu@...ont.com, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-mediatek@...ts.infradead.org
Subject: Re: [RFC PATCH net] net: dsa: mt7530: move PLL setup out of port 6
pad configuration
On Mon, Mar 06, 2023 at 08:03:54PM +0300, Arınç ÜNAL wrote:
> Looking at the Wikipedia page for Media-independent interface [0], the data
> interface must be clocked at 125 MHz for gigabit MIIs, which I believe what
> the "PLL" here refers to. trgmii needs higher frequency in some cases so if
> both CPU ports are enabled, the table would be:
>
> priv->p5_interface priv->p6_interface ncpo1 value
> gmii rgmii 125MHz
> mii rgmii 125MHz
> rgmii rgmii 125MHz
> gmii trgmii 125-250MHz
> mii trgmii 125-250MHz
> rgmii trgmii 125-250MHz
>
> [0] https://en.wikipedia.org/wiki/Media-independent_interface#GMII
Wikipedia will only tell you what the frequency of the interface signals
needs to be. That is useful to keep in mind, but without information from
the datasheet regarding what the SoC's clock distribution tree looks like,
it's hard to know how that interface clock is derived from internal PLLs
and ultimately from the oscillators. I was hoping that was the kind of
information you could provide. The manuals I have access to, through charity,
don't say anything on that front.
Since I don't know what I'm commenting on, I'll stop commenting any further.
> > right now, you let the p6_interface logic overwrite the ncpo1 selected
> > by the p5_interface logic like crazy, and it's not clear to me that this
> > is what you want.
>
> This seems to be fine as p6 sets the frequency either the same or higher.
(...)
> This looks much better, thanks a lot! The only missing part is setting the
> PLL frequency when only port 5 is enabled.
True. Although with the limited information I have, I'm not sure that
the ncpo1 value written into CORE_PLL_GROUP5 is needed by port5 either
way. The fact that you claim port5 works when ncpo1 ranges from 125 to
250 MHz tells me that it's either very tolerant of the ncpo1 value
(through mechanisms unknown to me), or simply unaffected by it (more
likely ATM). Since I don't have any details regarding the value, I'd
just like to treat the configuration procedure as plain code, and not
make any changes until there's a proof that they're needed.
> I'll test it regardless.
Thanks.
Powered by blists - more mailing lists