1 // SPDX-License-Identifier: GPL-2.0
2 /* NXP TJA1100 BroadRReach PHY driver
6 #include <linux/delay.h>
7 #include <linux/ethtool.h>
8 #include <linux/ethtool_netlink.h>
9 #include <linux/kernel.h>
10 #include <linux/mdio.h>
11 #include <linux/mii.h>
12 #include <linux/module.h>
14 #include <linux/phy.h>
15 #include <linux/hwmon.h>
16 #include <linux/bitfield.h>
17 #include <linux/of_mdio.h>
18 #include <linux/of_irq.h>
20 #define PHY_ID_MASK 0xfffffff0
21 #define PHY_ID_TJA1100 0x0180dc40
22 #define PHY_ID_TJA1101 0x0180dd00
23 #define PHY_ID_TJA1102 0x0180dc80
26 #define MII_ECTRL_LINK_CONTROL BIT(15)
27 #define MII_ECTRL_POWER_MODE_MASK GENMASK(14, 11)
28 #define MII_ECTRL_POWER_MODE_NO_CHANGE (0x0 << 11)
29 #define MII_ECTRL_POWER_MODE_NORMAL (0x3 << 11)
30 #define MII_ECTRL_POWER_MODE_STANDBY (0xc << 11)
31 #define MII_ECTRL_CABLE_TEST BIT(5)
32 #define MII_ECTRL_CONFIG_EN BIT(2)
33 #define MII_ECTRL_WAKE_REQUEST BIT(0)
36 #define MII_CFG1_MASTER_SLAVE BIT(15)
37 #define MII_CFG1_AUTO_OP BIT(14)
38 #define MII_CFG1_INTERFACE_MODE_MASK GENMASK(9, 8)
39 #define MII_CFG1_MII_MODE (0x0 << 8)
40 #define MII_CFG1_RMII_MODE_REFCLK_IN BIT(8)
41 #define MII_CFG1_RMII_MODE_REFCLK_OUT BIT(9)
42 #define MII_CFG1_REVMII_MODE GENMASK(9, 8)
43 #define MII_CFG1_SLEEP_CONFIRM BIT(6)
44 #define MII_CFG1_LED_MODE_MASK GENMASK(5, 4)
45 #define MII_CFG1_LED_MODE_LINKUP 0
46 #define MII_CFG1_LED_ENABLE BIT(3)
49 #define MII_CFG2_SLEEP_REQUEST_TO GENMASK(1, 0)
50 #define MII_CFG2_SLEEP_REQUEST_TO_16MS 0x3
53 #define MII_INTSRC_LINK_FAIL BIT(10)
54 #define MII_INTSRC_LINK_UP BIT(9)
55 #define MII_INTSRC_MASK (MII_INTSRC_LINK_FAIL | MII_INTSRC_LINK_UP)
56 #define MII_INTSRC_UV_ERR BIT(3)
57 #define MII_INTSRC_TEMP_ERR BIT(1)
60 #define MII_INTEN_LINK_FAIL BIT(10)
61 #define MII_INTEN_LINK_UP BIT(9)
62 #define MII_INTEN_UV_ERR BIT(3)
63 #define MII_INTEN_TEMP_ERR BIT(1)
65 #define MII_COMMSTAT 23
66 #define MII_COMMSTAT_LINK_UP BIT(15)
67 #define MII_COMMSTAT_SQI_STATE GENMASK(7, 5)
68 #define MII_COMMSTAT_SQI_MAX 7
70 #define MII_GENSTAT 24
71 #define MII_GENSTAT_PLL_LOCKED BIT(14)
73 #define MII_EXTSTAT 25
74 #define MII_EXTSTAT_SHORT_DETECT BIT(8)
75 #define MII_EXTSTAT_OPEN_DETECT BIT(7)
76 #define MII_EXTSTAT_POLARITY_DETECT BIT(6)
78 #define MII_COMMCFG 27
79 #define MII_COMMCFG_AUTO_OP BIT(15)
81 /* Configure REF_CLK as input in RMII mode */
82 #define TJA110X_RMII_MODE_REFCLK_IN BIT(0)
86 struct device *hwmon_dev;
87 struct phy_device *phydev;
88 struct work_struct phy_register_work;
92 struct tja11xx_phy_stats {
99 static struct tja11xx_phy_stats tja11xx_hw_stats[] = {
100 { "phy_symbol_error_count", 20, 0, GENMASK(15, 0) },
101 { "phy_polarity_detect", 25, 6, BIT(6) },
102 { "phy_open_detect", 25, 7, BIT(7) },
103 { "phy_short_detect", 25, 8, BIT(8) },
104 { "phy_rem_rcvr_count", 26, 0, GENMASK(7, 0) },
105 { "phy_loc_rcvr_count", 26, 8, GENMASK(15, 8) },
108 static int tja11xx_check(struct phy_device *phydev, u8 reg, u16 mask, u16 set)
112 return phy_read_poll_timeout(phydev, reg, val, (val & mask) == set,
116 static int phy_modify_check(struct phy_device *phydev, u8 reg,
121 ret = phy_modify(phydev, reg, mask, set);
125 return tja11xx_check(phydev, reg, mask, set);
128 static int tja11xx_enable_reg_write(struct phy_device *phydev)
130 return phy_set_bits(phydev, MII_ECTRL, MII_ECTRL_CONFIG_EN);
133 static int tja11xx_enable_link_control(struct phy_device *phydev)
135 return phy_set_bits(phydev, MII_ECTRL, MII_ECTRL_LINK_CONTROL);
138 static int tja11xx_disable_link_control(struct phy_device *phydev)
140 return phy_clear_bits(phydev, MII_ECTRL, MII_ECTRL_LINK_CONTROL);
143 static int tja11xx_wakeup(struct phy_device *phydev)
147 ret = phy_read(phydev, MII_ECTRL);
151 switch (ret & MII_ECTRL_POWER_MODE_MASK) {
152 case MII_ECTRL_POWER_MODE_NO_CHANGE:
154 case MII_ECTRL_POWER_MODE_NORMAL:
155 ret = phy_set_bits(phydev, MII_ECTRL, MII_ECTRL_WAKE_REQUEST);
159 ret = phy_clear_bits(phydev, MII_ECTRL, MII_ECTRL_WAKE_REQUEST);
163 case MII_ECTRL_POWER_MODE_STANDBY:
164 ret = phy_modify_check(phydev, MII_ECTRL,
165 MII_ECTRL_POWER_MODE_MASK,
166 MII_ECTRL_POWER_MODE_STANDBY);
170 ret = phy_modify(phydev, MII_ECTRL, MII_ECTRL_POWER_MODE_MASK,
171 MII_ECTRL_POWER_MODE_NORMAL);
175 ret = phy_modify_check(phydev, MII_GENSTAT,
176 MII_GENSTAT_PLL_LOCKED,
177 MII_GENSTAT_PLL_LOCKED);
181 return tja11xx_enable_link_control(phydev);
189 static int tja11xx_soft_reset(struct phy_device *phydev)
193 ret = tja11xx_enable_reg_write(phydev);
197 return genphy_soft_reset(phydev);
200 static int tja11xx_config_aneg_cable_test(struct phy_device *phydev)
202 bool finished = false;
208 if (!phydev->drv->cable_test_start ||
209 !phydev->drv->cable_test_get_status)
212 ret = ethnl_cable_test_alloc(phydev, ETHTOOL_MSG_CABLE_TEST_NTF);
216 ret = phydev->drv->cable_test_start(phydev);
220 /* According to the documentation this test takes 100 usec */
221 usleep_range(100, 200);
223 ret = phydev->drv->cable_test_get_status(phydev, &finished);
228 ethnl_cable_test_finished(phydev);
233 static int tja11xx_config_aneg(struct phy_device *phydev)
235 int ret, changed = 0;
238 switch (phydev->master_slave_set) {
239 case MASTER_SLAVE_CFG_MASTER_FORCE:
240 ctl |= MII_CFG1_MASTER_SLAVE;
242 case MASTER_SLAVE_CFG_SLAVE_FORCE:
244 case MASTER_SLAVE_CFG_UNKNOWN:
245 case MASTER_SLAVE_CFG_UNSUPPORTED:
248 phydev_warn(phydev, "Unsupported Master/Slave mode\n");
252 changed = phy_modify_changed(phydev, MII_CFG1, MII_CFG1_MASTER_SLAVE, ctl);
257 ret = tja11xx_config_aneg_cable_test(phydev);
261 return __genphy_config_aneg(phydev, changed);
264 static int tja11xx_get_interface_mode(struct phy_device *phydev)
266 struct tja11xx_priv *priv = phydev->priv;
269 switch (phydev->interface) {
270 case PHY_INTERFACE_MODE_MII:
271 mii_mode = MII_CFG1_MII_MODE;
273 case PHY_INTERFACE_MODE_REVMII:
274 mii_mode = MII_CFG1_REVMII_MODE;
276 case PHY_INTERFACE_MODE_RMII:
277 if (priv->flags & TJA110X_RMII_MODE_REFCLK_IN)
278 mii_mode = MII_CFG1_RMII_MODE_REFCLK_IN;
280 mii_mode = MII_CFG1_RMII_MODE_REFCLK_OUT;
289 static int tja11xx_config_init(struct phy_device *phydev)
291 u16 reg_mask, reg_val;
294 ret = tja11xx_enable_reg_write(phydev);
298 phydev->autoneg = AUTONEG_DISABLE;
299 phydev->speed = SPEED_100;
300 phydev->duplex = DUPLEX_FULL;
302 switch (phydev->phy_id & PHY_ID_MASK) {
304 reg_mask = MII_CFG1_AUTO_OP | MII_CFG1_LED_MODE_MASK |
306 reg_val = MII_CFG1_AUTO_OP | MII_CFG1_LED_MODE_LINKUP |
309 reg_mask |= MII_CFG1_INTERFACE_MODE_MASK;
310 ret = tja11xx_get_interface_mode(phydev);
314 reg_val |= (ret & 0xffff);
315 ret = phy_modify(phydev, MII_CFG1, reg_mask, reg_val);
320 reg_mask = MII_CFG1_INTERFACE_MODE_MASK;
321 ret = tja11xx_get_interface_mode(phydev);
325 reg_val = ret & 0xffff;
326 ret = phy_modify(phydev, MII_CFG1, reg_mask, reg_val);
331 ret = phy_set_bits(phydev, MII_COMMCFG, MII_COMMCFG_AUTO_OP);
339 ret = phy_clear_bits(phydev, MII_CFG1, MII_CFG1_SLEEP_CONFIRM);
343 ret = phy_modify(phydev, MII_CFG2, MII_CFG2_SLEEP_REQUEST_TO,
344 MII_CFG2_SLEEP_REQUEST_TO_16MS);
348 ret = tja11xx_wakeup(phydev);
352 /* ACK interrupts by reading the status register */
353 ret = phy_read(phydev, MII_INTSRC);
360 static int tja11xx_read_status(struct phy_device *phydev)
364 phydev->master_slave_get = MASTER_SLAVE_CFG_UNKNOWN;
365 phydev->master_slave_state = MASTER_SLAVE_STATE_UNSUPPORTED;
367 ret = genphy_update_link(phydev);
371 ret = phy_read(phydev, MII_CFG1);
375 if (ret & MII_CFG1_MASTER_SLAVE)
376 phydev->master_slave_get = MASTER_SLAVE_CFG_MASTER_FORCE;
378 phydev->master_slave_get = MASTER_SLAVE_CFG_SLAVE_FORCE;
381 ret = phy_read(phydev, MII_COMMSTAT);
385 if (!(ret & MII_COMMSTAT_LINK_UP))
392 static int tja11xx_get_sqi(struct phy_device *phydev)
396 ret = phy_read(phydev, MII_COMMSTAT);
400 return FIELD_GET(MII_COMMSTAT_SQI_STATE, ret);
403 static int tja11xx_get_sqi_max(struct phy_device *phydev)
405 return MII_COMMSTAT_SQI_MAX;
408 static int tja11xx_get_sset_count(struct phy_device *phydev)
410 return ARRAY_SIZE(tja11xx_hw_stats);
413 static void tja11xx_get_strings(struct phy_device *phydev, u8 *data)
417 for (i = 0; i < ARRAY_SIZE(tja11xx_hw_stats); i++) {
418 strncpy(data + i * ETH_GSTRING_LEN,
419 tja11xx_hw_stats[i].string, ETH_GSTRING_LEN);
423 static void tja11xx_get_stats(struct phy_device *phydev,
424 struct ethtool_stats *stats, u64 *data)
428 for (i = 0; i < ARRAY_SIZE(tja11xx_hw_stats); i++) {
429 ret = phy_read(phydev, tja11xx_hw_stats[i].reg);
433 data[i] = ret & tja11xx_hw_stats[i].mask;
434 data[i] >>= tja11xx_hw_stats[i].off;
439 static int tja11xx_hwmon_read(struct device *dev,
440 enum hwmon_sensor_types type,
441 u32 attr, int channel, long *value)
443 struct phy_device *phydev = dev_get_drvdata(dev);
446 if (type == hwmon_in && attr == hwmon_in_lcrit_alarm) {
447 ret = phy_read(phydev, MII_INTSRC);
451 *value = !!(ret & MII_INTSRC_TEMP_ERR);
455 if (type == hwmon_temp && attr == hwmon_temp_crit_alarm) {
456 ret = phy_read(phydev, MII_INTSRC);
460 *value = !!(ret & MII_INTSRC_UV_ERR);
467 static umode_t tja11xx_hwmon_is_visible(const void *data,
468 enum hwmon_sensor_types type,
469 u32 attr, int channel)
471 if (type == hwmon_in && attr == hwmon_in_lcrit_alarm)
474 if (type == hwmon_temp && attr == hwmon_temp_crit_alarm)
480 static const struct hwmon_channel_info *tja11xx_hwmon_info[] = {
481 HWMON_CHANNEL_INFO(in, HWMON_I_LCRIT_ALARM),
482 HWMON_CHANNEL_INFO(temp, HWMON_T_CRIT_ALARM),
486 static const struct hwmon_ops tja11xx_hwmon_hwmon_ops = {
487 .is_visible = tja11xx_hwmon_is_visible,
488 .read = tja11xx_hwmon_read,
491 static const struct hwmon_chip_info tja11xx_hwmon_chip_info = {
492 .ops = &tja11xx_hwmon_hwmon_ops,
493 .info = tja11xx_hwmon_info,
496 static int tja11xx_hwmon_register(struct phy_device *phydev,
497 struct tja11xx_priv *priv)
499 struct device *dev = &phydev->mdio.dev;
501 priv->hwmon_name = devm_hwmon_sanitize_name(dev, dev_name(dev));
502 if (IS_ERR(priv->hwmon_name))
503 return PTR_ERR(priv->hwmon_name);
506 devm_hwmon_device_register_with_info(dev, priv->hwmon_name,
508 &tja11xx_hwmon_chip_info,
511 return PTR_ERR_OR_ZERO(priv->hwmon_dev);
514 static int tja11xx_parse_dt(struct phy_device *phydev)
516 struct device_node *node = phydev->mdio.dev.of_node;
517 struct tja11xx_priv *priv = phydev->priv;
519 if (!IS_ENABLED(CONFIG_OF_MDIO))
522 if (of_property_read_bool(node, "nxp,rmii-refclk-in"))
523 priv->flags |= TJA110X_RMII_MODE_REFCLK_IN;
528 static int tja11xx_probe(struct phy_device *phydev)
530 struct device *dev = &phydev->mdio.dev;
531 struct tja11xx_priv *priv;
534 priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
538 priv->phydev = phydev;
541 ret = tja11xx_parse_dt(phydev);
545 return tja11xx_hwmon_register(phydev, priv);
548 static void tja1102_p1_register(struct work_struct *work)
550 struct tja11xx_priv *priv = container_of(work, struct tja11xx_priv,
552 struct phy_device *phydev_phy0 = priv->phydev;
553 struct mii_bus *bus = phydev_phy0->mdio.bus;
554 struct device *dev = &phydev_phy0->mdio.dev;
555 struct device_node *np = dev->of_node;
556 struct device_node *child;
559 for_each_available_child_of_node(np, child) {
560 struct phy_device *phy;
563 addr = of_mdio_parse_addr(dev, child);
565 dev_err(dev, "Can't parse addr\n");
567 } else if (addr != phydev_phy0->mdio.addr + 1) {
568 /* Currently we care only about double PHY chip TJA1102.
569 * If some day NXP will decide to bring chips with more
570 * PHYs, this logic should be reworked.
572 dev_err(dev, "Unexpected address. Should be: %i\n",
573 phydev_phy0->mdio.addr + 1);
577 if (mdiobus_is_registered_device(bus, addr)) {
578 dev_err(dev, "device is already registered\n");
582 /* Real PHY ID of Port 1 is 0 */
583 phy = phy_device_create(bus, addr, PHY_ID_TJA1102, false, NULL);
585 dev_err(dev, "Can't create PHY device for Port 1: %i\n",
590 /* Overwrite parent device. phy_device_create() set parent to
591 * the mii_bus->dev, which is not correct in case.
593 phy->mdio.dev.parent = dev;
595 ret = of_mdiobus_phy_device_register(bus, phy, child, addr);
597 /* All resources needed for Port 1 should be already
598 * available for Port 0. Both ports use the same
599 * interrupt line, so -EPROBE_DEFER would make no sense
602 dev_err(dev, "Can't register Port 1. Unexpected error: %i\n",
604 phy_device_free(phy);
609 static int tja1102_p0_probe(struct phy_device *phydev)
611 struct device *dev = &phydev->mdio.dev;
612 struct tja11xx_priv *priv;
615 priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
619 priv->phydev = phydev;
620 INIT_WORK(&priv->phy_register_work, tja1102_p1_register);
622 ret = tja11xx_hwmon_register(phydev, priv);
626 schedule_work(&priv->phy_register_work);
631 static int tja1102_match_phy_device(struct phy_device *phydev, bool port0)
635 if ((phydev->phy_id & PHY_ID_MASK) != PHY_ID_TJA1102)
638 ret = phy_read(phydev, MII_PHYSID2);
642 /* TJA1102 Port 1 has phyid 0 and doesn't support temperature
643 * and undervoltage alarms.
651 static int tja1102_p0_match_phy_device(struct phy_device *phydev)
653 return tja1102_match_phy_device(phydev, true);
656 static int tja1102_p1_match_phy_device(struct phy_device *phydev)
658 return tja1102_match_phy_device(phydev, false);
661 static int tja11xx_ack_interrupt(struct phy_device *phydev)
665 ret = phy_read(phydev, MII_INTSRC);
667 return (ret < 0) ? ret : 0;
670 static int tja11xx_config_intr(struct phy_device *phydev)
675 if (phydev->interrupts == PHY_INTERRUPT_ENABLED) {
676 err = tja11xx_ack_interrupt(phydev);
680 value = MII_INTEN_LINK_FAIL | MII_INTEN_LINK_UP |
681 MII_INTEN_UV_ERR | MII_INTEN_TEMP_ERR;
682 err = phy_write(phydev, MII_INTEN, value);
684 err = phy_write(phydev, MII_INTEN, value);
688 err = tja11xx_ack_interrupt(phydev);
694 static irqreturn_t tja11xx_handle_interrupt(struct phy_device *phydev)
696 struct device *dev = &phydev->mdio.dev;
699 irq_status = phy_read(phydev, MII_INTSRC);
700 if (irq_status < 0) {
705 if (irq_status & MII_INTSRC_TEMP_ERR)
706 dev_warn(dev, "Overtemperature error detected (temp > 155C°).\n");
707 if (irq_status & MII_INTSRC_UV_ERR)
708 dev_warn(dev, "Undervoltage error detected.\n");
710 if (!(irq_status & MII_INTSRC_MASK))
713 phy_trigger_machine(phydev);
718 static int tja11xx_cable_test_start(struct phy_device *phydev)
722 ret = phy_clear_bits(phydev, MII_COMMCFG, MII_COMMCFG_AUTO_OP);
726 ret = tja11xx_wakeup(phydev);
730 ret = tja11xx_disable_link_control(phydev);
734 return phy_set_bits(phydev, MII_ECTRL, MII_ECTRL_CABLE_TEST);
738 * | BI_DA+ | BI_DA- | Result
739 * | open | open | open
740 * | + short to - | - short to + | short
741 * | short to Vdd | open | open
742 * | open | shot to Vdd | open
743 * | short to Vdd | short to Vdd | short
744 * | shot to GND | open | open
745 * | open | shot to GND | open
746 * | short to GND | shot to GND | short
747 * | connected to active link partner (master) | shot and open
749 static int tja11xx_cable_test_report_trans(u32 result)
751 u32 mask = MII_EXTSTAT_SHORT_DETECT | MII_EXTSTAT_OPEN_DETECT;
753 if ((result & mask) == mask) {
754 /* connected to active link partner (master) */
755 return ETHTOOL_A_CABLE_RESULT_CODE_UNSPEC;
756 } else if ((result & mask) == 0) {
757 return ETHTOOL_A_CABLE_RESULT_CODE_OK;
758 } else if (result & MII_EXTSTAT_SHORT_DETECT) {
759 return ETHTOOL_A_CABLE_RESULT_CODE_SAME_SHORT;
760 } else if (result & MII_EXTSTAT_OPEN_DETECT) {
761 return ETHTOOL_A_CABLE_RESULT_CODE_OPEN;
763 return ETHTOOL_A_CABLE_RESULT_CODE_UNSPEC;
767 static int tja11xx_cable_test_report(struct phy_device *phydev)
771 ret = phy_read(phydev, MII_EXTSTAT);
775 ethnl_cable_test_result(phydev, ETHTOOL_A_CABLE_PAIR_A,
776 tja11xx_cable_test_report_trans(ret));
781 static int tja11xx_cable_test_get_status(struct phy_device *phydev,
788 ret = phy_read(phydev, MII_ECTRL);
792 if (!(ret & MII_ECTRL_CABLE_TEST)) {
795 ret = phy_set_bits(phydev, MII_COMMCFG, MII_COMMCFG_AUTO_OP);
799 return tja11xx_cable_test_report(phydev);
805 static struct phy_driver tja11xx_driver[] = {
807 PHY_ID_MATCH_MODEL(PHY_ID_TJA1100),
808 .name = "NXP TJA1100",
809 .features = PHY_BASIC_T1_FEATURES,
810 .probe = tja11xx_probe,
811 .soft_reset = tja11xx_soft_reset,
812 .config_aneg = tja11xx_config_aneg,
813 .config_init = tja11xx_config_init,
814 .read_status = tja11xx_read_status,
815 .get_sqi = tja11xx_get_sqi,
816 .get_sqi_max = tja11xx_get_sqi_max,
817 .suspend = genphy_suspend,
818 .resume = genphy_resume,
819 .set_loopback = genphy_loopback,
821 .get_sset_count = tja11xx_get_sset_count,
822 .get_strings = tja11xx_get_strings,
823 .get_stats = tja11xx_get_stats,
825 PHY_ID_MATCH_MODEL(PHY_ID_TJA1101),
826 .name = "NXP TJA1101",
827 .features = PHY_BASIC_T1_FEATURES,
828 .probe = tja11xx_probe,
829 .soft_reset = tja11xx_soft_reset,
830 .config_aneg = tja11xx_config_aneg,
831 .config_init = tja11xx_config_init,
832 .read_status = tja11xx_read_status,
833 .get_sqi = tja11xx_get_sqi,
834 .get_sqi_max = tja11xx_get_sqi_max,
835 .suspend = genphy_suspend,
836 .resume = genphy_resume,
837 .set_loopback = genphy_loopback,
839 .get_sset_count = tja11xx_get_sset_count,
840 .get_strings = tja11xx_get_strings,
841 .get_stats = tja11xx_get_stats,
843 .name = "NXP TJA1102 Port 0",
844 .features = PHY_BASIC_T1_FEATURES,
845 .flags = PHY_POLL_CABLE_TEST,
846 .probe = tja1102_p0_probe,
847 .soft_reset = tja11xx_soft_reset,
848 .config_aneg = tja11xx_config_aneg,
849 .config_init = tja11xx_config_init,
850 .read_status = tja11xx_read_status,
851 .get_sqi = tja11xx_get_sqi,
852 .get_sqi_max = tja11xx_get_sqi_max,
853 .match_phy_device = tja1102_p0_match_phy_device,
854 .suspend = genphy_suspend,
855 .resume = genphy_resume,
856 .set_loopback = genphy_loopback,
858 .get_sset_count = tja11xx_get_sset_count,
859 .get_strings = tja11xx_get_strings,
860 .get_stats = tja11xx_get_stats,
861 .config_intr = tja11xx_config_intr,
862 .handle_interrupt = tja11xx_handle_interrupt,
863 .cable_test_start = tja11xx_cable_test_start,
864 .cable_test_get_status = tja11xx_cable_test_get_status,
866 .name = "NXP TJA1102 Port 1",
867 .features = PHY_BASIC_T1_FEATURES,
868 .flags = PHY_POLL_CABLE_TEST,
869 /* currently no probe for Port 1 is need */
870 .soft_reset = tja11xx_soft_reset,
871 .config_aneg = tja11xx_config_aneg,
872 .config_init = tja11xx_config_init,
873 .read_status = tja11xx_read_status,
874 .get_sqi = tja11xx_get_sqi,
875 .get_sqi_max = tja11xx_get_sqi_max,
876 .match_phy_device = tja1102_p1_match_phy_device,
877 .suspend = genphy_suspend,
878 .resume = genphy_resume,
879 .set_loopback = genphy_loopback,
881 .get_sset_count = tja11xx_get_sset_count,
882 .get_strings = tja11xx_get_strings,
883 .get_stats = tja11xx_get_stats,
884 .config_intr = tja11xx_config_intr,
885 .handle_interrupt = tja11xx_handle_interrupt,
886 .cable_test_start = tja11xx_cable_test_start,
887 .cable_test_get_status = tja11xx_cable_test_get_status,
891 module_phy_driver(tja11xx_driver);
893 static struct mdio_device_id __maybe_unused tja11xx_tbl[] = {
894 { PHY_ID_MATCH_MODEL(PHY_ID_TJA1100) },
895 { PHY_ID_MATCH_MODEL(PHY_ID_TJA1101) },
896 { PHY_ID_MATCH_MODEL(PHY_ID_TJA1102) },
900 MODULE_DEVICE_TABLE(mdio, tja11xx_tbl);
903 MODULE_DESCRIPTION("NXP TJA11xx BoardR-Reach PHY driver");
904 MODULE_LICENSE("GPL");