mirror of
https://github.com/torvalds/linux.git
synced 2026-05-23 22:52:19 +02:00
Merge branch 'net-phy-tja11xx-add-support-for-tja1102s'
Dimitri Fedrau via says: ==================== net: phy: tja11xx: add support for TJA1102S - add support for TJA1102S - enable PHY in sleep mode for TJA1102S v1: https://lore.kernel.org/20250303-tja1102s-support-v1-0-180e945396e0@liebherr.com ==================== Link: https://patch.msgid.link/20250304-tja1102s-support-v2-0-cd3e61ab920f@liebherr.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
commit
fca9fe1aae
|
|
@ -21,12 +21,14 @@
|
|||
#define PHY_ID_TJA1100 0x0180dc40
|
||||
#define PHY_ID_TJA1101 0x0180dd00
|
||||
#define PHY_ID_TJA1102 0x0180dc80
|
||||
#define PHY_ID_TJA1102S 0x0180dc90
|
||||
|
||||
#define MII_ECTRL 17
|
||||
#define MII_ECTRL_LINK_CONTROL BIT(15)
|
||||
#define MII_ECTRL_POWER_MODE_MASK GENMASK(14, 11)
|
||||
#define MII_ECTRL_POWER_MODE_NO_CHANGE (0x0 << 11)
|
||||
#define MII_ECTRL_POWER_MODE_NORMAL (0x3 << 11)
|
||||
#define MII_ECTRL_POWER_MODE_SLEEP (0xa << 11)
|
||||
#define MII_ECTRL_POWER_MODE_STANDBY (0xc << 11)
|
||||
#define MII_ECTRL_CABLE_TEST BIT(5)
|
||||
#define MII_ECTRL_CONFIG_EN BIT(2)
|
||||
|
|
@ -78,6 +80,9 @@
|
|||
#define MII_COMMCFG 27
|
||||
#define MII_COMMCFG_AUTO_OP BIT(15)
|
||||
|
||||
#define MII_CFG3 28
|
||||
#define MII_CFG3_PHY_EN BIT(0)
|
||||
|
||||
/* Configure REF_CLK as input in RMII mode */
|
||||
#define TJA110X_RMII_MODE_REFCLK_IN BIT(0)
|
||||
|
||||
|
|
@ -179,6 +184,14 @@ static int tja11xx_wakeup(struct phy_device *phydev)
|
|||
return ret;
|
||||
|
||||
return tja11xx_enable_link_control(phydev);
|
||||
case MII_ECTRL_POWER_MODE_SLEEP:
|
||||
switch (phydev->phy_id & PHY_ID_MASK) {
|
||||
case PHY_ID_TJA1102S:
|
||||
/* Enable PHY, maybe it is disabled due to pin strapping */
|
||||
return phy_set_bits(phydev, MII_CFG3, MII_CFG3_PHY_EN);
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
@ -316,6 +329,7 @@ static int tja11xx_config_init(struct phy_device *phydev)
|
|||
if (ret)
|
||||
return ret;
|
||||
break;
|
||||
case PHY_ID_TJA1102S:
|
||||
case PHY_ID_TJA1101:
|
||||
reg_mask = MII_CFG1_INTERFACE_MODE_MASK;
|
||||
ret = tja11xx_get_interface_mode(phydev);
|
||||
|
|
@ -883,6 +897,29 @@ static struct phy_driver tja11xx_driver[] = {
|
|||
.handle_interrupt = tja11xx_handle_interrupt,
|
||||
.cable_test_start = tja11xx_cable_test_start,
|
||||
.cable_test_get_status = tja11xx_cable_test_get_status,
|
||||
}, {
|
||||
PHY_ID_MATCH_MODEL(PHY_ID_TJA1102S),
|
||||
.name = "NXP TJA1102S",
|
||||
.features = PHY_BASIC_T1_FEATURES,
|
||||
.flags = PHY_POLL_CABLE_TEST,
|
||||
.probe = tja11xx_probe,
|
||||
.soft_reset = tja11xx_soft_reset,
|
||||
.config_aneg = tja11xx_config_aneg,
|
||||
.config_init = tja11xx_config_init,
|
||||
.read_status = tja11xx_read_status,
|
||||
.get_sqi = tja11xx_get_sqi,
|
||||
.get_sqi_max = tja11xx_get_sqi_max,
|
||||
.suspend = genphy_suspend,
|
||||
.resume = genphy_resume,
|
||||
.set_loopback = genphy_loopback,
|
||||
/* Statistics */
|
||||
.get_sset_count = tja11xx_get_sset_count,
|
||||
.get_strings = tja11xx_get_strings,
|
||||
.get_stats = tja11xx_get_stats,
|
||||
.config_intr = tja11xx_config_intr,
|
||||
.handle_interrupt = tja11xx_handle_interrupt,
|
||||
.cable_test_start = tja11xx_cable_test_start,
|
||||
.cable_test_get_status = tja11xx_cable_test_get_status,
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -892,6 +929,7 @@ static const struct mdio_device_id __maybe_unused tja11xx_tbl[] = {
|
|||
{ PHY_ID_MATCH_MODEL(PHY_ID_TJA1100) },
|
||||
{ PHY_ID_MATCH_MODEL(PHY_ID_TJA1101) },
|
||||
{ PHY_ID_MATCH_MODEL(PHY_ID_TJA1102) },
|
||||
{ PHY_ID_MATCH_MODEL(PHY_ID_TJA1102S) },
|
||||
{ }
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user