From: Andrew Lunn <andrew@lunn.ch>
To: Ong Boon Leong <boon.leong.ong@intel.com>
Cc: Heiner Kallweit <hkallweit1@gmail.com>,
Russell King <linux@armlinux.org.uk>,
"David S . Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next 1/2] net: phy: dp83867: introduce critical chip default init for non-of platform
Date: Tue, 19 Oct 2021 20:51:10 +0200 [thread overview]
Message-ID: <YW8TnjisOh1OEpz+@lunn.ch> (raw)
In-Reply-To: <20211013034128.2094426-2-boon.leong.ong@intel.com>
On Wed, Oct 13, 2021 at 11:41:27AM +0800, Ong Boon Leong wrote:
> From: "Lay, Kuan Loon" <kuan.loon.lay@intel.com>
>
> PHY driver dp83867 has rich supports for OF-platform to fine-tune the PHY
> chip during phy configuration. However, for non-OF platform, certain PHY
> tunable parameters such as IO impedence and RX & TX internal delays are
> critical and should be initialized to its default during PHY driver probe.
>
> Signed-off-by: Lay, Kuan Loon <kuan.loon.lay@intel.com>
> Co-developed-by: Ong Boon Leong <boon.leong.ong@intel.com>
> Tested-by: Clement <clement@intel.com>
> Signed-off-by: Ong Boon Leong <boon.leong.ong@intel.com>
> ---
> drivers/net/phy/dp83867.c | 18 ++++++++++++++++++
> 1 file changed, 18 insertions(+)
>
> diff --git a/drivers/net/phy/dp83867.c b/drivers/net/phy/dp83867.c
> index 6bbc81ad295f..bb4369b75179 100644
> --- a/drivers/net/phy/dp83867.c
> +++ b/drivers/net/phy/dp83867.c
> @@ -619,6 +619,24 @@ static int dp83867_of_init(struct phy_device *phydev)
> #else
> static int dp83867_of_init(struct phy_device *phydev)
> {
> + struct dp83867_private *dp83867 = phydev->priv;
> + u16 delay;
So this is in the stub for when OF is disabled. What about the case
that OF is enabled? I've used DT on x86, even Intel used it for
intel,ce4100 aka falconfalls. So rather than do this in the stub, i
would look at the value of dev->of_node. If it is NULL, do this. That
should always work, and it is how other drivers deal with none OF
cases.
> + /* Per datasheet, IO impedance is default to 50-ohm, so we set the same
> + * here or else the default '0' means highest IO impedence which is wrong.
> + */
> + dp83867->io_impedance = DP83867_IO_MUX_CFG_IO_IMPEDANCE_MIN / 2;
> +
I would prefer you add a new define
DP83867_IO_MUX_CFG_IO_IMPEDANCE_DEFAULT, which then avoids this very
odd looking 1/2 the minimum.
Andrew
next prev parent reply other threads:[~2021-10-19 18:51 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-13 3:41 [PATCH net-next 0/2] net: phy: dp83867 non-OF and loopback support Ong Boon Leong
2021-10-13 3:41 ` [PATCH net-next 1/2] net: phy: dp83867: introduce critical chip default init for non-of platform Ong Boon Leong
2021-10-19 18:51 ` Andrew Lunn [this message]
2021-10-13 3:41 ` [PATCH net-next 2/2] net: phy: dp83867: add generic PHY loopback Ong Boon Leong
2021-10-13 3:48 ` Wong Vee Khee
2021-10-13 6:18 ` Ong, Boon Leong
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=YW8TnjisOh1OEpz+@lunn.ch \
--to=andrew@lunn.ch \
--cc=boon.leong.ong@intel.com \
--cc=davem@davemloft.net \
--cc=hkallweit1@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=netdev@vger.kernel.org \
/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).