Lines Matching full:dp83867

2 /* Driver for the Texas Instruments DP83867 PHY
19 #include <dt-bindings/net/ti-dp83867.h>
480 struct dp83867_private *dp83867 = phydev->priv; in dp83867_config_port_mirroring() local
482 if (dp83867->port_mirroring == DP83867_PORT_MIRROING_EN) in dp83867_config_port_mirroring()
493 struct dp83867_private *dp83867 = phydev->priv; in dp83867_verify_rgmii_cfg() local
517 dp83867->rx_id_delay == DP83867_RGMII_RX_CLK_DELAY_INV) { in dp83867_verify_rgmii_cfg()
525 dp83867->tx_id_delay == DP83867_RGMII_TX_CLK_DELAY_INV) { in dp83867_verify_rgmii_cfg()
536 struct dp83867_private *dp83867 = phydev->priv; in dp83867_of_init_io_impedance() local
552 dp83867->io_impedance = DP83867_IO_MUX_CFG_IO_IMPEDANCE_MAX; in dp83867_of_init_io_impedance()
554 dp83867->io_impedance = DP83867_IO_MUX_CFG_IO_IMPEDANCE_MIN; in dp83867_of_init_io_impedance()
556 dp83867->io_impedance = -1; /* leave at default */ in dp83867_of_init_io_impedance()
574 dp83867->io_impedance = val; in dp83867_of_init_io_impedance()
581 struct dp83867_private *dp83867 = phydev->priv; in dp83867_of_init() local
591 &dp83867->clk_output_sel); in dp83867_of_init()
594 dp83867->set_clk_output = true; in dp83867_of_init()
598 if (dp83867->clk_output_sel > DP83867_CLK_O_SEL_REF_CLK && in dp83867_of_init()
599 dp83867->clk_output_sel != DP83867_CLK_O_SEL_OFF) { in dp83867_of_init()
601 dp83867->clk_output_sel); in dp83867_of_init()
610 dp83867->rxctrl_strap_quirk = of_property_read_bool(of_node, in dp83867_of_init()
611 "ti,dp83867-rxctrl-strap-quirk"); in dp83867_of_init()
613 dp83867->sgmii_ref_clk_en = of_property_read_bool(of_node, in dp83867_of_init()
616 dp83867->rx_id_delay = DP83867_RGMII_RX_CLK_DELAY_INV; in dp83867_of_init()
618 &dp83867->rx_id_delay); in dp83867_of_init()
619 if (!ret && dp83867->rx_id_delay > DP83867_RGMII_RX_CLK_DELAY_MAX) { in dp83867_of_init()
622 dp83867->rx_id_delay); in dp83867_of_init()
626 dp83867->tx_id_delay = DP83867_RGMII_TX_CLK_DELAY_INV; in dp83867_of_init()
628 &dp83867->tx_id_delay); in dp83867_of_init()
629 if (!ret && dp83867->tx_id_delay > DP83867_RGMII_TX_CLK_DELAY_MAX) { in dp83867_of_init()
632 dp83867->tx_id_delay); in dp83867_of_init()
637 dp83867->port_mirroring = DP83867_PORT_MIRROING_EN; in dp83867_of_init()
640 dp83867->port_mirroring = DP83867_PORT_MIRROING_DIS; in dp83867_of_init()
643 &dp83867->tx_fifo_depth); in dp83867_of_init()
646 &dp83867->tx_fifo_depth); in dp83867_of_init()
648 dp83867->tx_fifo_depth = in dp83867_of_init()
652 if (dp83867->tx_fifo_depth > DP83867_PHYCR_FIFO_DEPTH_MAX) { in dp83867_of_init()
654 dp83867->tx_fifo_depth); in dp83867_of_init()
659 &dp83867->rx_fifo_depth); in dp83867_of_init()
661 dp83867->rx_fifo_depth = DP83867_PHYCR_FIFO_DEPTH_4_B_NIB; in dp83867_of_init()
663 if (dp83867->rx_fifo_depth > DP83867_PHYCR_FIFO_DEPTH_MAX) { in dp83867_of_init()
665 dp83867->rx_fifo_depth); in dp83867_of_init()
674 struct dp83867_private *dp83867 = phydev->priv; in dp83867_of_init() local
683 dp83867->rx_id_delay = delay & DP83867_RGMII_RX_CLK_DELAY_MAX; in dp83867_of_init()
684 dp83867->tx_id_delay = (delay >> DP83867_RGMII_TX_CLK_DELAY_SHIFT) & in dp83867_of_init()
691 dp83867->io_impedance = DP83867_IO_MUX_CFG_IO_IMPEDANCE_MIN / 2; in dp83867_of_init()
697 dp83867->tx_fifo_depth = DP83867_PHYCR_FIFO_DEPTH_4_B_NIB; in dp83867_of_init()
698 dp83867->rx_fifo_depth = DP83867_PHYCR_FIFO_DEPTH_4_B_NIB; in dp83867_of_init()
730 struct dp83867_private *dp83867; in dp83867_probe() local
732 dp83867 = devm_kzalloc(&phydev->mdio.dev, sizeof(*dp83867), in dp83867_probe()
734 if (!dp83867) in dp83867_probe()
737 phydev->priv = dp83867; in dp83867_probe()
744 struct dp83867_private *dp83867 = phydev->priv; in dp83867_config_init() local
759 if (dp83867->rxctrl_strap_quirk) in dp83867_config_init()
784 val |= (dp83867->tx_fifo_depth << in dp83867_config_init()
789 val |= (dp83867->rx_fifo_depth << in dp83867_config_init()
843 if (dp83867->rx_id_delay != DP83867_RGMII_RX_CLK_DELAY_INV) in dp83867_config_init()
844 delay |= dp83867->rx_id_delay; in dp83867_config_init()
845 if (dp83867->tx_id_delay != DP83867_RGMII_TX_CLK_DELAY_INV) in dp83867_config_init()
846 delay |= dp83867->tx_id_delay << in dp83867_config_init()
854 if (dp83867->io_impedance >= 0) in dp83867_config_init()
857 dp83867->io_impedance); in dp83867_config_init()
890 if (dp83867->sgmii_ref_clk_en) in dp83867_config_init()
900 if (dp83867->rxctrl_strap_quirk) in dp83867_config_init()
913 if (dp83867->port_mirroring != DP83867_PORT_MIRROING_KEEP) in dp83867_config_init()
917 if (dp83867->set_clk_output) { in dp83867_config_init()
920 if (dp83867->clk_output_sel == DP83867_CLK_O_SEL_OFF) { in dp83867_config_init()
924 val = dp83867->clk_output_sel << in dp83867_config_init()
970 /* There is a limitation in DP83867 PHY device where SGMII AN is in dp83867_link_change_notify()
1025 .name = "TI DP83867",
1061 MODULE_DESCRIPTION("Texas Instruments DP83867 PHY driver");