Skip to content

Commit 4562c65

Browse files
Johannes Zinkkuba-moo
authored andcommitted
net: stmmac: fix order of dwmac5 FlexPPS parametrization sequence
So far changing the period by just setting new period values while running did not work. The order as indicated by the publicly available reference manual of the i.MX8MP [1] indicates a sequence: * initiate the programming sequence * set the values for PPS period and start time * start the pulse train generation. This is currently not used in dwmac5_flex_pps_config(), which instead does: * initiate the programming sequence and immediately start the pulse train generation * set the values for PPS period and start time This caused the period values written not to take effect until the FlexPPS output was disabled and re-enabled again. This patch fix the order and allows the period to be set immediately. [1] https://www.nxp.com/webapp/Download?colCode=IMX8MPRM Fixes: 9a8a02c ("net: stmmac: Add Flexible PPS support") Signed-off-by: Johannes Zink <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 2038cc5 commit 4562c65

File tree

1 file changed

+2
-1
lines changed
  • drivers/net/ethernet/stmicro/stmmac

1 file changed

+2
-1
lines changed

drivers/net/ethernet/stmicro/stmmac/dwmac5.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -541,9 +541,9 @@ int dwmac5_flex_pps_config(void __iomem *ioaddr, int index,
541541
return 0;
542542
}
543543

544-
val |= PPSCMDx(index, 0x2);
545544
val |= TRGTMODSELx(index, 0x2);
546545
val |= PPSEN0;
546+
writel(val, ioaddr + MAC_PPS_CONTROL);
547547

548548
writel(cfg->start.tv_sec, ioaddr + MAC_PPSx_TARGET_TIME_SEC(index));
549549

@@ -568,6 +568,7 @@ int dwmac5_flex_pps_config(void __iomem *ioaddr, int index,
568568
writel(period - 1, ioaddr + MAC_PPSx_WIDTH(index));
569569

570570
/* Finally, activate it */
571+
val |= PPSCMDx(index, 0x2);
571572
writel(val, ioaddr + MAC_PPS_CONTROL);
572573
return 0;
573574
}

0 commit comments

Comments
 (0)