From: Vadim Fedorenko <vadim.fedorenko@linux.dev>
To: Parthiban Veerasooran <parthiban.veerasooran@microchip.com>,
andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com,
kuba@kernel.org, pabeni@redhat.com
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net v2 2/2] microchip: lan865x: fix missing Timer Increment config for Rev.B0/B1
Date: Mon, 18 Aug 2025 12:06:39 +0100 [thread overview]
Message-ID: <e4817ccc-bc8e-4a29-b202-ef30d95e8b65@linux.dev> (raw)
In-Reply-To: <20250818060514.52795-3-parthiban.veerasooran@microchip.com>
On 18/08/2025 07:05, Parthiban Veerasooran wrote:
> Fix missing configuration for LAN865x silicon revisions B0 and B1 as per
> Microchip Application Note AN1760 (Rev F, June 2024).
>
> The Timer Increment register was not being set, which is required for
> accurate timestamping. As per the application note, configure the MAC to
> set timestamping at the end of the Start of Frame Delimiter (SFD), and
> set the Timer Increment register to 40 ns (corresponding to a 25 MHz
> internal clock).
>
> Link: https://www.microchip.com/en-us/application-notes/an1760
>
> Fixes: 5cd2340cb6a3 ("microchip: lan865x: add driver support for Microchip's LAN865X MAC-PHY")
> Signed-off-by: Parthiban Veerasooran <parthiban.veerasooran@microchip.com>
> ---
> .../net/ethernet/microchip/lan865x/lan865x.c | 19 +++++++++++++++++++
> 1 file changed, 19 insertions(+)
>
> diff --git a/drivers/net/ethernet/microchip/lan865x/lan865x.c b/drivers/net/ethernet/microchip/lan865x/lan865x.c
> index d03f5a8de58d..84c41f193561 100644
> --- a/drivers/net/ethernet/microchip/lan865x/lan865x.c
> +++ b/drivers/net/ethernet/microchip/lan865x/lan865x.c
> @@ -32,6 +32,10 @@
> /* MAC Specific Addr 1 Top Reg */
> #define LAN865X_REG_MAC_H_SADDR1 0x00010023
>
> +/* MAC TSU Timer Increment Register */
> +#define LAN865X_REG_MAC_TSU_TIMER_INCR 0x00010077
> +#define MAC_TSU_TIMER_INCR_COUNT_NANOSECONDS 0x0028
> +
> struct lan865x_priv {
> struct work_struct multicast_work;
> struct net_device *netdev;
> @@ -346,6 +350,21 @@ static int lan865x_probe(struct spi_device *spi)
> goto free_netdev;
> }
>
> + /* LAN865x Rev.B0/B1 configuration parameters from AN1760
> + * As per the Configuration Application Note AN1760 published in the
> + * link, https://www.microchip.com/en-us/application-notes/an1760
> + * Revision F (DS60001760G - June 2024), configure the MAC to set time
> + * stamping at the end of the Start of Frame Delimiter (SFD) and set the
> + * Timer Increment reg to 40 ns to be used as a 25 MHz internal clock.
> + */
> + ret = oa_tc6_write_register(priv->tc6, LAN865X_REG_MAC_TSU_TIMER_INCR,
> + MAC_TSU_TIMER_INCR_COUNT_NANOSECONDS);
> + if (ret) {
> + dev_err(&spi->dev, "Failed to config TSU Timer Incr reg: %d\n",
> + ret);
> + goto oa_tc6_exit;
> + }
> +
> /* As per the point s3 in the below errata, SPI receive Ethernet frame
> * transfer may halt when starting the next frame in the same data block
> * (chunk) as the end of a previous frame. The RFA field should be
Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
next prev parent reply other threads:[~2025-08-18 11:06 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-18 6:05 [PATCH net v2 0/2] Fixes on the Microchip's LAN865x driver Parthiban Veerasooran
2025-08-18 6:05 ` [PATCH net v2 1/2] microchip: lan865x: fix missing netif_start_queue() call on device open Parthiban Veerasooran
2025-08-18 6:05 ` [PATCH net v2 2/2] microchip: lan865x: fix missing Timer Increment config for Rev.B0/B1 Parthiban Veerasooran
2025-08-18 11:06 ` Vadim Fedorenko [this message]
2025-08-20 3:11 ` [PATCH net v2 0/2] Fixes on the Microchip's LAN865x driver patchwork-bot+netdevbpf
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=e4817ccc-bc8e-4a29-b202-ef30d95e8b65@linux.dev \
--to=vadim.fedorenko@linux.dev \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=parthiban.veerasooran@microchip.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®