Commit 0b703008 authored by David S. Miller's avatar David S. Miller

Merge branch 'tja1103-improvewmentsa'

Vladimir Oltean says:

====================
Fixes and improvements to TJA1103 PHY driver

This series contains:
- an erratum workaround for the TJA1103 PHY integrated in SJA1110
- an adaptation of the driver so it prints less unnecessary information
  when probing on SJA1110
- a PTP RX timestamping bug fix and a clarification patch

Targeting net-next since the PHY support is currently in net-next only.

Changes in v3:
Added one more patch which improves the readability of
nxp_c45_reconstruct_ts.

Changes in v2:
Added a comment to the hardware workaround procedure.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents ed0141d1 0b5f0f29
...@@ -325,7 +325,7 @@ static void nxp_c45_reconstruct_ts(struct timespec64 *ts, ...@@ -325,7 +325,7 @@ static void nxp_c45_reconstruct_ts(struct timespec64 *ts,
{ {
ts->tv_nsec = hwts->nsec; ts->tv_nsec = hwts->nsec;
if ((ts->tv_sec & TS_SEC_MASK) < (hwts->sec & TS_SEC_MASK)) if ((ts->tv_sec & TS_SEC_MASK) < (hwts->sec & TS_SEC_MASK))
ts->tv_sec -= BIT(2); ts->tv_sec -= TS_SEC_MASK + 1;
ts->tv_sec &= ~TS_SEC_MASK; ts->tv_sec &= ~TS_SEC_MASK;
ts->tv_sec |= hwts->sec & TS_SEC_MASK; ts->tv_sec |= hwts->sec & TS_SEC_MASK;
} }
...@@ -427,8 +427,8 @@ static long nxp_c45_do_aux_work(struct ptp_clock_info *ptp) ...@@ -427,8 +427,8 @@ static long nxp_c45_do_aux_work(struct ptp_clock_info *ptp)
nxp_c45_process_txts(priv, &hwts); nxp_c45_process_txts(priv, &hwts);
} }
nxp_c45_ptp_gettimex64(&priv->caps, &ts, NULL);
while ((skb = skb_dequeue(&priv->rx_queue)) != NULL) { while ((skb = skb_dequeue(&priv->rx_queue)) != NULL) {
nxp_c45_ptp_gettimex64(&priv->caps, &ts, NULL);
ts_raw = __be32_to_cpu(NXP_C45_SKB_CB(skb)->header->reserved2); ts_raw = __be32_to_cpu(NXP_C45_SKB_CB(skb)->header->reserved2);
hwts.sec = ts_raw >> 30; hwts.sec = ts_raw >> 30;
hwts.nsec = ts_raw & GENMASK(29, 0); hwts.nsec = ts_raw & GENMASK(29, 0);
...@@ -1035,6 +1035,12 @@ static int nxp_c45_config_init(struct phy_device *phydev) ...@@ -1035,6 +1035,12 @@ static int nxp_c45_config_init(struct phy_device *phydev)
return ret; return ret;
} }
/* Bug workaround for SJA1110 rev B: enable write access
* to MDIO_MMD_PMAPMD
*/
phy_write_mmd(phydev, MDIO_MMD_VEND1, 0x01F8, 1);
phy_write_mmd(phydev, MDIO_MMD_VEND1, 0x01F9, 2);
phy_set_bits_mmd(phydev, MDIO_MMD_VEND1, VEND1_PHY_CONFIG, phy_set_bits_mmd(phydev, MDIO_MMD_VEND1, VEND1_PHY_CONFIG,
PHY_CONFIG_AUTO); PHY_CONFIG_AUTO);
...@@ -1090,7 +1096,7 @@ static int nxp_c45_probe(struct phy_device *phydev) ...@@ -1090,7 +1096,7 @@ static int nxp_c45_probe(struct phy_device *phydev)
VEND1_PORT_ABILITIES); VEND1_PORT_ABILITIES);
ptp_ability = !!(ptp_ability & PTP_ABILITY); ptp_ability = !!(ptp_ability & PTP_ABILITY);
if (!ptp_ability) { if (!ptp_ability) {
phydev_info(phydev, "the phy does not support PTP"); phydev_dbg(phydev, "the phy does not support PTP");
goto no_ptp_support; goto no_ptp_support;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment