Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'net-fec-add-pps-channel-configuration'

Francesco Dolcini says:

====================
net: fec: add PPS channel configuration

Make the FEC Ethernet PPS channel configurable from device tree.
====================

Link: https://patch.msgid.link/20241004152419.79465-1-francesco@dolcini.it
Signed-off-by: Paolo Abeni <pabeni@redhat.com>

+13 -5
+7
Documentation/devicetree/bindings/net/fsl,fec.yaml
··· 183 183 description: 184 184 Register bits of stop mode control, the format is <&gpr req_gpr req_bit>. 185 185 186 + fsl,pps-channel: 187 + $ref: /schemas/types.yaml#/definitions/uint32 188 + default: 0 189 + description: 190 + Specifies to which timer instance the PPS signal is routed. 191 + enum: [0, 1, 2, 3] 192 + 186 193 mdio: 187 194 $ref: mdio.yaml# 188 195 unevaluatedProperties: false
+6 -5
drivers/net/ethernet/freescale/fec_ptp.c
··· 84 84 #define FEC_CC_MULT (1 << 31) 85 85 #define FEC_COUNTER_PERIOD (1 << 31) 86 86 #define PPS_OUPUT_RELOAD_PERIOD NSEC_PER_SEC 87 - #define FEC_CHANNLE_0 0 88 - #define DEFAULT_PPS_CHANNEL FEC_CHANNLE_0 87 + #define DEFAULT_PPS_CHANNEL 0 89 88 90 89 #define FEC_PTP_MAX_NSEC_PERIOD 4000000000ULL 91 90 #define FEC_PTP_MAX_NSEC_COUNTER 0x80000000ULL ··· 524 525 int ret = 0; 525 526 526 527 if (rq->type == PTP_CLK_REQ_PPS) { 527 - fep->pps_channel = DEFAULT_PPS_CHANNEL; 528 528 fep->reload_period = PPS_OUPUT_RELOAD_PERIOD; 529 529 530 530 ret = fec_ptp_enable_pps(fep, on); ··· 534 536 if (rq->perout.flags) 535 537 return -EOPNOTSUPP; 536 538 537 - if (rq->perout.index != DEFAULT_PPS_CHANNEL) 539 + if (rq->perout.index != fep->pps_channel) 538 540 return -EOPNOTSUPP; 539 541 540 - fep->pps_channel = DEFAULT_PPS_CHANNEL; 541 542 period.tv_sec = rq->perout.period.sec; 542 543 period.tv_nsec = rq->perout.period.nsec; 543 544 period_ns = timespec64_to_ns(&period); ··· 704 707 { 705 708 struct net_device *ndev = platform_get_drvdata(pdev); 706 709 struct fec_enet_private *fep = netdev_priv(ndev); 710 + struct device_node *np = fep->pdev->dev.of_node; 707 711 int irq; 708 712 int ret; 709 713 710 714 fep->ptp_caps.owner = THIS_MODULE; 711 715 strscpy(fep->ptp_caps.name, "fec ptp", sizeof(fep->ptp_caps.name)); 716 + 717 + fep->pps_channel = DEFAULT_PPS_CHANNEL; 718 + of_property_read_u32(np, "fsl,pps-channel", &fep->pps_channel); 712 719 713 720 fep->ptp_caps.max_adj = 250000000; 714 721 fep->ptp_caps.n_alarm = 0;