From: Andrew Lunn <andrew@lunn.ch>
To: Furkan Kardame <f.kardame@manjaro.org>
Cc: pgwipeout@gmail.com, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net: phy: add support for Motorcomm yt8531C phy
Date: Tue, 11 Oct 2022 03:51:28 +0200 [thread overview]
Message-ID: <Y0TMIMPJbOETFQ3f@lunn.ch> (raw)
In-Reply-To: <20221009192405.97118-1-f.kardame@manjaro.org>
> +#define YT8531_RGMII_CONFIG1 0xa003
> +
> +/* TX Gig-E Delay is bits 3:0, default 0x1
> + * TX Fast-E Delay is bits 7:4, default 0xf
> + * RX Delay is bits 13:10, default 0x0
> + * Delay = 150ps * N
> + * On = 2000ps, off = 50ps
> + */
> +#define YT8531_DELAY_GE_TX_EN (0xd << 0)
> +#define YT8531_DELAY_GE_TX_DIS (0x0 << 0)
The comments above and the value here don't correspond. These seem to
be enable/disable, which is usually a single bit. Here you have 3 bits
set? And what about the default 0x1?
0xd is 13. 13*150 = 1950, which is about 2000ps?
So YT8531_DELAY_GE_TX_EN is not really enable, it is
YT8531_DELAY_GE_TX_1950_PS, and YT8531_DELAY_GE_TX_DIS should be
YT8531_DELAY_GE_TX_0_PS.
> +#define YT8531_DELAY_FE_TX_EN (0xd << 4)
> +#define YT8531_DELAY_FE_TX_DIS (0x0 << 4)
Default is 0xf?
> +#define YT8531_DELAY_RX_EN (0xd << 10)
> +#define YT8531_DELAY_RX_DIS (0x0 << 10)
> +#define YT8531_DELAY_MASK (GENMASK(13, 10) | GENMASK(7, 0))
Please rework these.
> + ret = __phy_write(phydev, YT8511_PAGE, YT8531_CLKCFG_125M);
> + if (ret < 0)
> + goto err_restore_page;
This if statement is pointless.
> +
> +err_restore_page:
> + return phy_restore_page(phydev, oldpage, ret);
> +}
> +
prev parent reply other threads:[~2022-10-11 1:51 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-09 19:24 [PATCH] net: phy: add support for Motorcomm yt8531C phy Furkan Kardame
2022-10-11 0:46 ` Jakub Kicinski
2022-10-11 1:51 ` Andrew Lunn [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=Y0TMIMPJbOETFQ3f@lunn.ch \
--to=andrew@lunn.ch \
--cc=f.kardame@manjaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pgwipeout@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.