* [PATCH net-next v4 1/3] dt-bindings: net: fec: add pps channel property
2024-10-04 15:24 [PATCH net-next v4 0/3] net: fec: add PPS channel configuration Francesco Dolcini
@ 2024-10-04 15:24 ` Francesco Dolcini
2024-10-04 15:56 ` Conor Dooley
2024-10-04 15:24 ` [PATCH net-next v4 2/3] net: fec: refactor PPS channel configuration Francesco Dolcini
` (2 subsequent siblings)
3 siblings, 1 reply; 8+ messages in thread
From: Francesco Dolcini @ 2024-10-04 15:24 UTC (permalink / raw)
To: Wei Fang, Shenwei Wang, Clark Wang, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
Fabio Estevam, Richard Cochran, Linux Team
Cc: Francesco Dolcini, imx, netdev, devicetree, linux-kernel,
linux-arm-kernel
From: Francesco Dolcini <francesco.dolcini@toradex.com>
Add fsl,pps-channel property to select where to connect the PPS signal.
This depends on the internal SoC routing and on the board, for example
on the i.MX8 SoC it can be connected to an external pin (using channel 1)
or to internal eDMA as DMA request (channel 0).
Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
---
v4: improve commit message and explain why this is needed, as requested by
Conor Dooley.
v3: no changes
v2: no changes
---
Documentation/devicetree/bindings/net/fsl,fec.yaml | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/Documentation/devicetree/bindings/net/fsl,fec.yaml b/Documentation/devicetree/bindings/net/fsl,fec.yaml
index 5536c06139ca..24e863fdbdab 100644
--- a/Documentation/devicetree/bindings/net/fsl,fec.yaml
+++ b/Documentation/devicetree/bindings/net/fsl,fec.yaml
@@ -183,6 +183,13 @@ properties:
description:
Register bits of stop mode control, the format is <&gpr req_gpr req_bit>.
+ fsl,pps-channel:
+ $ref: /schemas/types.yaml#/definitions/uint32
+ default: 0
+ description:
+ Specifies to which timer instance the PPS signal is routed.
+ enum: [0, 1, 2, 3]
+
mdio:
$ref: mdio.yaml#
unevaluatedProperties: false
--
2.39.5
^ permalink raw reply related [flat|nested] 8+ messages in thread* Re: [PATCH net-next v4 1/3] dt-bindings: net: fec: add pps channel property
2024-10-04 15:24 ` [PATCH net-next v4 1/3] dt-bindings: net: fec: add pps channel property Francesco Dolcini
@ 2024-10-04 15:56 ` Conor Dooley
0 siblings, 0 replies; 8+ messages in thread
From: Conor Dooley @ 2024-10-04 15:56 UTC (permalink / raw)
To: Francesco Dolcini
Cc: Wei Fang, Shenwei Wang, Clark Wang, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
Fabio Estevam, Richard Cochran, Linux Team, Francesco Dolcini,
imx, netdev, devicetree, linux-kernel, linux-arm-kernel
[-- Attachment #1: Type: text/plain, Size: 535 bytes --]
On Fri, Oct 04, 2024 at 05:24:17PM +0200, Francesco Dolcini wrote:
> From: Francesco Dolcini <francesco.dolcini@toradex.com>
>
> Add fsl,pps-channel property to select where to connect the PPS signal.
> This depends on the internal SoC routing and on the board, for example
> on the i.MX8 SoC it can be connected to an external pin (using channel 1)
> or to internal eDMA as DMA request (channel 0).
>
> Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH net-next v4 2/3] net: fec: refactor PPS channel configuration
2024-10-04 15:24 [PATCH net-next v4 0/3] net: fec: add PPS channel configuration Francesco Dolcini
2024-10-04 15:24 ` [PATCH net-next v4 1/3] dt-bindings: net: fec: add pps channel property Francesco Dolcini
@ 2024-10-04 15:24 ` Francesco Dolcini
2024-10-04 16:06 ` Csókás Bence
2024-10-04 15:24 ` [PATCH net-next v4 3/3] net: fec: make PPS channel configurable Francesco Dolcini
2024-10-08 10:40 ` [PATCH net-next v4 0/3] net: fec: add PPS channel configuration patchwork-bot+netdevbpf
3 siblings, 1 reply; 8+ messages in thread
From: Francesco Dolcini @ 2024-10-04 15:24 UTC (permalink / raw)
To: Wei Fang, Shenwei Wang, Clark Wang, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
Fabio Estevam, Richard Cochran, Linux Team
Cc: Francesco Dolcini, imx, netdev, devicetree, linux-kernel,
linux-arm-kernel, Frank Li
From: Francesco Dolcini <francesco.dolcini@toradex.com>
Preparation patch to allow for PPS channel configuration, no functional
change intended.
Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
---
v4: no changes
v3: no changes
v2: add Reviewed-by
---
drivers/net/ethernet/freescale/fec_ptp.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/freescale/fec_ptp.c b/drivers/net/ethernet/freescale/fec_ptp.c
index 4cffda363a14..ce7aa2c38c7f 100644
--- a/drivers/net/ethernet/freescale/fec_ptp.c
+++ b/drivers/net/ethernet/freescale/fec_ptp.c
@@ -84,8 +84,7 @@
#define FEC_CC_MULT (1 << 31)
#define FEC_COUNTER_PERIOD (1 << 31)
#define PPS_OUPUT_RELOAD_PERIOD NSEC_PER_SEC
-#define FEC_CHANNLE_0 0
-#define DEFAULT_PPS_CHANNEL FEC_CHANNLE_0
+#define DEFAULT_PPS_CHANNEL 0
#define FEC_PTP_MAX_NSEC_PERIOD 4000000000ULL
#define FEC_PTP_MAX_NSEC_COUNTER 0x80000000ULL
@@ -524,8 +523,9 @@ 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->pps_channel = DEFAULT_PPS_CHANNEL;
fep->reload_period = PPS_OUPUT_RELOAD_PERIOD;
ret = fec_ptp_enable_pps(fep, on);
@@ -536,10 +536,9 @@ static int fec_ptp_enable(struct ptp_clock_info *ptp,
if (rq->perout.flags)
return -EOPNOTSUPP;
- if (rq->perout.index != DEFAULT_PPS_CHANNEL)
+ if (rq->perout.index != fep->pps_channel)
return -EOPNOTSUPP;
- fep->pps_channel = DEFAULT_PPS_CHANNEL;
period.tv_sec = rq->perout.period.sec;
period.tv_nsec = rq->perout.period.nsec;
period_ns = timespec64_to_ns(&period);
--
2.39.5
^ permalink raw reply related [flat|nested] 8+ messages in thread* Re: [PATCH net-next v4 2/3] net: fec: refactor PPS channel configuration
2024-10-04 15:24 ` [PATCH net-next v4 2/3] net: fec: refactor PPS channel configuration Francesco Dolcini
@ 2024-10-04 16:06 ` Csókás Bence
0 siblings, 0 replies; 8+ messages in thread
From: Csókás Bence @ 2024-10-04 16:06 UTC (permalink / raw)
To: Francesco Dolcini, Wei Fang, Shenwei Wang, Clark Wang,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Shawn Guo,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Richard Cochran, Linux Team
Cc: Francesco Dolcini, imx, netdev, devicetree, linux-kernel,
linux-arm-kernel, Frank Li
On 2024. 10. 04. 17:24, Francesco Dolcini wrote:
> From: Francesco Dolcini <francesco.dolcini@toradex.com>
>
> Preparation patch to allow for PPS channel configuration, no functional
> change intended.
>
> Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
> Reviewed-by: Frank Li <Frank.Li@nxp.com>
Reviewed-by: Csókás, Bence <csokas.bence@prolan.hu>
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH net-next v4 3/3] net: fec: make PPS channel configurable
2024-10-04 15:24 [PATCH net-next v4 0/3] net: fec: add PPS channel configuration Francesco Dolcini
2024-10-04 15:24 ` [PATCH net-next v4 1/3] dt-bindings: net: fec: add pps channel property Francesco Dolcini
2024-10-04 15:24 ` [PATCH net-next v4 2/3] net: fec: refactor PPS channel configuration Francesco Dolcini
@ 2024-10-04 15:24 ` Francesco Dolcini
2024-10-04 16:06 ` Csókás Bence
2024-10-08 10:40 ` [PATCH net-next v4 0/3] net: fec: add PPS channel configuration patchwork-bot+netdevbpf
3 siblings, 1 reply; 8+ messages in thread
From: Francesco Dolcini @ 2024-10-04 15:24 UTC (permalink / raw)
To: Wei Fang, Shenwei Wang, Clark Wang, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
Fabio Estevam, Richard Cochran, Linux Team
Cc: Francesco Dolcini, imx, netdev, devicetree, linux-kernel,
linux-arm-kernel, Frank Li, Rafael Beims
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.
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Tested-by: Rafael Beims <rafael.beims@toradex.com>
Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
---
v4: no changes
v3: no changes
v2: add Reviewed|Tested-by
---
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 ce7aa2c38c7f..aea24575e840 100644
--- a/drivers/net/ethernet/freescale/fec_ptp.c
+++ b/drivers/net/ethernet/freescale/fec_ptp.c
@@ -523,8 +523,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;
@@ -706,12 +704,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.5
^ permalink raw reply related [flat|nested] 8+ messages in thread* Re: [PATCH net-next v4 3/3] net: fec: make PPS channel configurable
2024-10-04 15:24 ` [PATCH net-next v4 3/3] net: fec: make PPS channel configurable Francesco Dolcini
@ 2024-10-04 16:06 ` Csókás Bence
0 siblings, 0 replies; 8+ messages in thread
From: Csókás Bence @ 2024-10-04 16:06 UTC (permalink / raw)
To: Francesco Dolcini, Wei Fang, Shenwei Wang, Clark Wang,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Shawn Guo,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Richard Cochran, Linux Team
Cc: Francesco Dolcini, imx, netdev, devicetree, linux-kernel,
linux-arm-kernel, Frank Li, Rafael Beims
On 2024. 10. 04. 17:24, 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.
>
> Reviewed-by: Frank Li <Frank.Li@nxp.com>
> Tested-by: Rafael Beims <rafael.beims@toradex.com>
> Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Csókás, Bence <csokas.bence@prolan.hu>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH net-next v4 0/3] net: fec: add PPS channel configuration
2024-10-04 15:24 [PATCH net-next v4 0/3] net: fec: add PPS channel configuration Francesco Dolcini
` (2 preceding siblings ...)
2024-10-04 15:24 ` [PATCH net-next v4 3/3] net: fec: make PPS channel configurable Francesco Dolcini
@ 2024-10-08 10:40 ` patchwork-bot+netdevbpf
3 siblings, 0 replies; 8+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-10-08 10:40 UTC (permalink / raw)
To: Francesco Dolcini
Cc: wei.fang, shenwei.wang, xiaoning.wang, davem, edumazet, kuba,
pabeni, robh, krzk+dt, conor+dt, shawnguo, s.hauer, kernel,
festevam, richardcochran, linux-imx, francesco.dolcini, imx,
netdev, devicetree, linux-kernel, linux-arm-kernel
Hello:
This series was applied to netdev/net-next.git (main)
by Paolo Abeni <pabeni@redhat.com>:
On Fri, 4 Oct 2024 17:24:16 +0200 you wrote:
> From: Francesco Dolcini <francesco.dolcini@toradex.com>
>
> Make the FEC Ethernet PPS channel configurable from device tree.
>
> v3: https://lore.kernel.org/all/20240809094804.391441-1-francesco@dolcini.it/
> v2: https://lore.kernel.org/all/20240809091844.387824-1-francesco@dolcini.it/
> v1: https://lore.kernel.org/all/20240807144349.297342-1-francesco@dolcini.it/
>
> [...]
Here is the summary with links:
- [net-next,v4,1/3] dt-bindings: net: fec: add pps channel property
https://git.kernel.org/netdev/net-next/c/1aa772be0444
- [net-next,v4,2/3] net: fec: refactor PPS channel configuration
https://git.kernel.org/netdev/net-next/c/bf8ca67e2167
- [net-next,v4,3/3] net: fec: make PPS channel configurable
https://git.kernel.org/netdev/net-next/c/566c2d83887f
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 8+ messages in thread