Netdev List
 help / color / mirror / Atom feed
From: Frank Li <Frank.li@nxp.com>
To: Francesco Dolcini <francesco@dolcini.it>
Cc: Wei Fang <wei.fang@nxp.com>, Shenwei Wang <shenwei.wang@nxp.com>,
	Clark Wang <xiaoning.wang@nxp.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Richard Cochran <richardcochran@gmail.com>,
	Francesco Dolcini <francesco.dolcini@toradex.com>,
	imx@lists.linux.dev, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1 3/4] net: fec: make PPS channel configurable
Date: Wed, 7 Aug 2024 11:25:49 -0400	[thread overview]
Message-ID: <ZrOR/eqZgaYxfPaL@lizhi-Precision-Tower-5810> (raw)
In-Reply-To: <20240807144349.297342-4-francesco@dolcini.it>

On Wed, Aug 07, 2024 at 04:43:48PM +0200, Francesco Dolcini wrote:
> From: Francesco Dolcini <francesco.dolcini@toradex.com>
>
> Depending on the SoC where the FEC is integrated into the PPS channel
> might be routed to different timer instances. Make this configurable
> from the devicetree.
>
> When the related DT property is not present fallback to the previous
> default and use channel 0.
>
> Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>

Reviewed-by: Frank Li <Frank.Li@nxp.com>

> ---
>  drivers/net/ethernet/freescale/fec_ptp.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/freescale/fec_ptp.c b/drivers/net/ethernet/freescale/fec_ptp.c
> index 6f0f8bf61752..8e17fd0c8e6d 100644
> --- a/drivers/net/ethernet/freescale/fec_ptp.c
> +++ b/drivers/net/ethernet/freescale/fec_ptp.c
> @@ -529,8 +529,6 @@ static int fec_ptp_enable(struct ptp_clock_info *ptp,
>  	unsigned long flags;
>  	int ret = 0;
>
> -	fep->pps_channel = DEFAULT_PPS_CHANNEL;
> -
>  	if (rq->type == PTP_CLK_REQ_PPS) {
>  		fep->reload_period = PPS_OUPUT_RELOAD_PERIOD;
>
> @@ -712,12 +710,16 @@ void fec_ptp_init(struct platform_device *pdev, int irq_idx)
>  {
>  	struct net_device *ndev = platform_get_drvdata(pdev);
>  	struct fec_enet_private *fep = netdev_priv(ndev);
> +	struct device_node *np = fep->pdev->dev.of_node;
>  	int irq;
>  	int ret;
>
>  	fep->ptp_caps.owner = THIS_MODULE;
>  	strscpy(fep->ptp_caps.name, "fec ptp", sizeof(fep->ptp_caps.name));
>
> +	fep->pps_channel = DEFAULT_PPS_CHANNEL;
> +	of_property_read_u32(np, "fsl,pps-channel", &fep->pps_channel);
> +
>  	fep->ptp_caps.max_adj = 250000000;
>  	fep->ptp_caps.n_alarm = 0;
>  	fep->ptp_caps.n_ext_ts = 0;
> --
> 2.39.2
>

  reply	other threads:[~2024-08-07 15:26 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-07 14:43 [PATCH v1 0/4] net: fec: add PPS channel configuration Francesco Dolcini
2024-08-07 14:43 ` [PATCH v1 1/4] dt-bindings: net: fec: add pps channel property Francesco Dolcini
2024-08-07 14:43 ` [PATCH v1 2/4] net: fec: refactor PPS channel configuration Francesco Dolcini
2024-08-07 15:24   ` Frank Li
2024-08-07 14:43 ` [PATCH v1 3/4] net: fec: make PPS channel configurable Francesco Dolcini
2024-08-07 15:25   ` Frank Li [this message]
2024-08-07 20:40   ` Rafael Beims
2024-08-08 21:57 ` [PATCH v1 0/4] net: fec: add PPS channel configuration Francesco Dolcini
2024-08-09  2:58   ` Jakub Kicinski

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=ZrOR/eqZgaYxfPaL@lizhi-Precision-Tower-5810 \
    --to=frank.li@nxp.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=francesco.dolcini@toradex.com \
    --cc=francesco@dolcini.it \
    --cc=imx@lists.linux.dev \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=richardcochran@gmail.com \
    --cc=shenwei.wang@nxp.com \
    --cc=wei.fang@nxp.com \
    --cc=xiaoning.wang@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