Skip to content

Commit b268e43

Browse files
vlifshtsgregkh
authored andcommitted
e1000e: set fixed clock frequency indication for Nahum 11 and Nahum 13
[ Upstream commit 688a0d6 ] On some systems with Nahum 11 and Nahum 13 the value of the XTAL clock in the software STRAP is incorrect. This causes the PTP timer to run at the wrong rate and can lead to synchronization issues. The STRAP value is configured by the system firmware, and a firmware update is not always possible. Since the XTAL clock on these systems always runs at 38.4MHz, the driver may ignore the STRAP and just set the correct value. Fixes: cc23f4f ("e1000e: Add support for Meteor Lake") Signed-off-by: Vitaly Lifshits <[email protected]> Tested-by: Mor Bar-Gabay <[email protected]> Reviewed-by: Gil Fine <[email protected]> Signed-off-by: Tony Nguyen <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent d671519 commit b268e43

File tree

2 files changed

+16
-6
lines changed

2 files changed

+16
-6
lines changed

drivers/net/ethernet/intel/e1000e/netdev.c

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3540,9 +3540,6 @@ s32 e1000e_get_base_timinca(struct e1000_adapter *adapter, u32 *timinca)
35403540
case e1000_pch_cnp:
35413541
case e1000_pch_tgp:
35423542
case e1000_pch_adp:
3543-
case e1000_pch_mtp:
3544-
case e1000_pch_lnp:
3545-
case e1000_pch_ptp:
35463543
case e1000_pch_nvp:
35473544
if (er32(TSYNCRXCTL) & E1000_TSYNCRXCTL_SYSCFI) {
35483545
/* Stable 24MHz frequency */
@@ -3558,6 +3555,17 @@ s32 e1000e_get_base_timinca(struct e1000_adapter *adapter, u32 *timinca)
35583555
adapter->cc.shift = shift;
35593556
}
35603557
break;
3558+
case e1000_pch_mtp:
3559+
case e1000_pch_lnp:
3560+
case e1000_pch_ptp:
3561+
/* System firmware can misreport this value, so set it to a
3562+
* stable 38400KHz frequency.
3563+
*/
3564+
incperiod = INCPERIOD_38400KHZ;
3565+
incvalue = INCVALUE_38400KHZ;
3566+
shift = INCVALUE_SHIFT_38400KHZ;
3567+
adapter->cc.shift = shift;
3568+
break;
35613569
case e1000_82574:
35623570
case e1000_82583:
35633571
/* Stable 25MHz frequency */

drivers/net/ethernet/intel/e1000e/ptp.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -295,15 +295,17 @@ void e1000e_ptp_init(struct e1000_adapter *adapter)
295295
case e1000_pch_cnp:
296296
case e1000_pch_tgp:
297297
case e1000_pch_adp:
298-
case e1000_pch_mtp:
299-
case e1000_pch_lnp:
300-
case e1000_pch_ptp:
301298
case e1000_pch_nvp:
302299
if (er32(TSYNCRXCTL) & E1000_TSYNCRXCTL_SYSCFI)
303300
adapter->ptp_clock_info.max_adj = MAX_PPB_24MHZ;
304301
else
305302
adapter->ptp_clock_info.max_adj = MAX_PPB_38400KHZ;
306303
break;
304+
case e1000_pch_mtp:
305+
case e1000_pch_lnp:
306+
case e1000_pch_ptp:
307+
adapter->ptp_clock_info.max_adj = MAX_PPB_38400KHZ;
308+
break;
307309
case e1000_82574:
308310
case e1000_82583:
309311
adapter->ptp_clock_info.max_adj = MAX_PPB_25MHZ;

0 commit comments

Comments
 (0)