Lines Matching +full:qcs404 +full:- +full:ethqos
1 // SPDX-License-Identifier: GPL-2.0
2 // Copyright (c) 2018-19, Linaro Limited
109 int (*configure_func)(struct qcom_ethqos *ethqos);
125 static int rgmii_readl(struct qcom_ethqos *ethqos, unsigned int offset) in rgmii_readl() argument
127 return readl(ethqos->rgmii_base + offset); in rgmii_readl()
130 static void rgmii_writel(struct qcom_ethqos *ethqos, in rgmii_writel() argument
133 writel(value, ethqos->rgmii_base + offset); in rgmii_writel()
136 static void rgmii_updatel(struct qcom_ethqos *ethqos, in rgmii_updatel() argument
141 temp = rgmii_readl(ethqos, offset); in rgmii_updatel()
143 rgmii_writel(ethqos, temp, offset); in rgmii_updatel()
148 struct qcom_ethqos *ethqos = priv; in rgmii_dump() local
149 struct device *dev = ðqos->pdev->dev; in rgmii_dump()
153 rgmii_readl(ethqos, RGMII_IO_MACRO_CONFIG)); in rgmii_dump()
155 rgmii_readl(ethqos, SDCC_HC_REG_DLL_CONFIG)); in rgmii_dump()
157 rgmii_readl(ethqos, SDCC_HC_REG_DDR_CONFIG)); in rgmii_dump()
159 rgmii_readl(ethqos, SDCC_HC_REG_DLL_CONFIG2)); in rgmii_dump()
161 rgmii_readl(ethqos, SDC4_STATUS)); in rgmii_dump()
163 rgmii_readl(ethqos, SDCC_USR_CTL)); in rgmii_dump()
165 rgmii_readl(ethqos, RGMII_IO_MACRO_CONFIG2)); in rgmii_dump()
167 rgmii_readl(ethqos, RGMII_IO_MACRO_DEBUG1)); in rgmii_dump()
169 rgmii_readl(ethqos, EMAC_SYSTEM_LOW_POWER_DEBUG)); in rgmii_dump()
178 ethqos_update_link_clk(struct qcom_ethqos *ethqos, unsigned int speed) in ethqos_update_link_clk() argument
180 if (!phy_interface_mode_is_rgmii(ethqos->phy_mode)) in ethqos_update_link_clk()
185 ethqos->link_clk_rate = RGMII_1000_NOM_CLK_FREQ; in ethqos_update_link_clk()
189 ethqos->link_clk_rate = RGMII_ID_MODE_100_LOW_SVS_CLK_FREQ; in ethqos_update_link_clk()
193 ethqos->link_clk_rate = RGMII_ID_MODE_10_LOW_SVS_CLK_FREQ; in ethqos_update_link_clk()
197 clk_set_rate(ethqos->link_clk, ethqos->link_clk_rate); in ethqos_update_link_clk()
201 qcom_ethqos_set_sgmii_loopback(struct qcom_ethqos *ethqos, bool enable) in qcom_ethqos_set_sgmii_loopback() argument
203 if (!ethqos->needs_sgmii_loopback || in qcom_ethqos_set_sgmii_loopback()
204 ethqos->phy_mode != PHY_INTERFACE_MODE_2500BASEX) in qcom_ethqos_set_sgmii_loopback()
207 rgmii_updatel(ethqos, in qcom_ethqos_set_sgmii_loopback()
213 static void ethqos_set_func_clk_en(struct qcom_ethqos *ethqos) in ethqos_set_func_clk_en() argument
215 qcom_ethqos_set_sgmii_loopback(ethqos, true); in ethqos_set_func_clk_en()
216 rgmii_updatel(ethqos, RGMII_CONFIG_FUNC_CLK_EN, in ethqos_set_func_clk_en()
320 static int ethqos_dll_configure(struct qcom_ethqos *ethqos) in ethqos_dll_configure() argument
322 struct device *dev = ðqos->pdev->dev; in ethqos_dll_configure()
327 rgmii_updatel(ethqos, SDCC_DLL_CONFIG_CDR_EN, in ethqos_dll_configure()
331 rgmii_updatel(ethqos, SDCC_DLL_CONFIG_CDR_EXT_EN, in ethqos_dll_configure()
335 rgmii_updatel(ethqos, SDCC_DLL_CONFIG_CK_OUT_EN, in ethqos_dll_configure()
339 rgmii_updatel(ethqos, SDCC_DLL_CONFIG_DLL_EN, in ethqos_dll_configure()
342 if (!ethqos->has_emac_ge_3) { in ethqos_dll_configure()
343 rgmii_updatel(ethqos, SDCC_DLL_MCLK_GATING_EN, in ethqos_dll_configure()
346 rgmii_updatel(ethqos, SDCC_DLL_CDR_FINE_PHASE, in ethqos_dll_configure()
352 val = rgmii_readl(ethqos, SDCC_HC_REG_DLL_CONFIG); in ethqos_dll_configure()
357 retry--; in ethqos_dll_configure()
363 rgmii_updatel(ethqos, SDCC_DLL_CONFIG_CK_OUT_EN, in ethqos_dll_configure()
369 val = rgmii_readl(ethqos, SDCC_HC_REG_DLL_CONFIG); in ethqos_dll_configure()
374 retry--; in ethqos_dll_configure()
380 rgmii_updatel(ethqos, SDCC_DLL_CONFIG2_DDR_CAL_EN, in ethqos_dll_configure()
383 if (!ethqos->has_emac_ge_3) { in ethqos_dll_configure()
384 rgmii_updatel(ethqos, SDCC_DLL_CONFIG2_DLL_CLOCK_DIS, in ethqos_dll_configure()
387 rgmii_updatel(ethqos, SDCC_DLL_CONFIG2_MCLK_FREQ_CALC, in ethqos_dll_configure()
390 rgmii_updatel(ethqos, SDCC_DLL_CONFIG2_DDR_TRAFFIC_INIT_SEL, in ethqos_dll_configure()
393 rgmii_updatel(ethqos, SDCC_DLL_CONFIG2_DDR_TRAFFIC_INIT_SW, in ethqos_dll_configure()
401 static int ethqos_rgmii_macro_init(struct qcom_ethqos *ethqos) in ethqos_rgmii_macro_init() argument
403 struct device *dev = ðqos->pdev->dev; in ethqos_rgmii_macro_init()
408 if (ethqos->phy_mode == PHY_INTERFACE_MODE_RGMII_ID || in ethqos_rgmii_macro_init()
409 ethqos->phy_mode == PHY_INTERFACE_MODE_RGMII_TXID) in ethqos_rgmii_macro_init()
415 rgmii_updatel(ethqos, RGMII_CONFIG2_TX_TO_RX_LOOPBACK_EN, in ethqos_rgmii_macro_init()
419 if (ethqos->rgmii_config_loopback_en) in ethqos_rgmii_macro_init()
425 rgmii_updatel(ethqos, RGMII_CONFIG_INTF_SEL, in ethqos_rgmii_macro_init()
428 switch (ethqos->speed) { in ethqos_rgmii_macro_init()
430 rgmii_updatel(ethqos, RGMII_CONFIG_DDR_MODE, in ethqos_rgmii_macro_init()
432 rgmii_updatel(ethqos, RGMII_CONFIG_BYPASS_TX_ID_EN, in ethqos_rgmii_macro_init()
434 rgmii_updatel(ethqos, RGMII_CONFIG_POS_NEG_DATA_SEL, in ethqos_rgmii_macro_init()
437 rgmii_updatel(ethqos, RGMII_CONFIG_PROG_SWAP, in ethqos_rgmii_macro_init()
439 rgmii_updatel(ethqos, RGMII_CONFIG2_DATA_DIVIDE_CLK_SEL, in ethqos_rgmii_macro_init()
442 rgmii_updatel(ethqos, RGMII_CONFIG2_TX_CLK_PHASE_SHIFT_EN, in ethqos_rgmii_macro_init()
444 rgmii_updatel(ethqos, RGMII_CONFIG2_RSVD_CONFIG15, in ethqos_rgmii_macro_init()
446 rgmii_updatel(ethqos, RGMII_CONFIG2_RX_PROG_SWAP, in ethqos_rgmii_macro_init()
453 if (ethqos->has_emac_ge_3) { in ethqos_rgmii_macro_init()
455 rgmii_updatel(ethqos, SDCC_DDR_CONFIG_PRG_RCLK_DLY, in ethqos_rgmii_macro_init()
459 rgmii_updatel(ethqos, SDCC_DDR_CONFIG_PRG_RCLK_DLY, in ethqos_rgmii_macro_init()
462 rgmii_updatel(ethqos, SDCC_DDR_CONFIG_PRG_DLY_EN, in ethqos_rgmii_macro_init()
465 rgmii_updatel(ethqos, RGMII_CONFIG_LOOPBACK_EN, in ethqos_rgmii_macro_init()
470 rgmii_updatel(ethqos, RGMII_CONFIG_DDR_MODE, in ethqos_rgmii_macro_init()
472 rgmii_updatel(ethqos, RGMII_CONFIG_BYPASS_TX_ID_EN, in ethqos_rgmii_macro_init()
475 rgmii_updatel(ethqos, RGMII_CONFIG_POS_NEG_DATA_SEL, in ethqos_rgmii_macro_init()
477 rgmii_updatel(ethqos, RGMII_CONFIG_PROG_SWAP, in ethqos_rgmii_macro_init()
479 rgmii_updatel(ethqos, RGMII_CONFIG2_DATA_DIVIDE_CLK_SEL, in ethqos_rgmii_macro_init()
481 rgmii_updatel(ethqos, RGMII_CONFIG2_TX_CLK_PHASE_SHIFT_EN, in ethqos_rgmii_macro_init()
483 rgmii_updatel(ethqos, RGMII_CONFIG_MAX_SPD_PRG_2, in ethqos_rgmii_macro_init()
485 rgmii_updatel(ethqos, RGMII_CONFIG2_RSVD_CONFIG15, in ethqos_rgmii_macro_init()
488 if (ethqos->has_emac_ge_3) in ethqos_rgmii_macro_init()
489 rgmii_updatel(ethqos, RGMII_CONFIG2_RX_PROG_SWAP, in ethqos_rgmii_macro_init()
493 rgmii_updatel(ethqos, RGMII_CONFIG2_RX_PROG_SWAP, in ethqos_rgmii_macro_init()
497 rgmii_updatel(ethqos, SDCC_DDR_CONFIG_EXT_PRG_RCLK_DLY_CODE, in ethqos_rgmii_macro_init()
499 rgmii_updatel(ethqos, SDCC_DDR_CONFIG_EXT_PRG_RCLK_DLY, in ethqos_rgmii_macro_init()
502 rgmii_updatel(ethqos, SDCC_DDR_CONFIG_EXT_PRG_RCLK_DLY_EN, in ethqos_rgmii_macro_init()
505 rgmii_updatel(ethqos, RGMII_CONFIG_LOOPBACK_EN, in ethqos_rgmii_macro_init()
510 rgmii_updatel(ethqos, RGMII_CONFIG_DDR_MODE, in ethqos_rgmii_macro_init()
512 rgmii_updatel(ethqos, RGMII_CONFIG_BYPASS_TX_ID_EN, in ethqos_rgmii_macro_init()
515 rgmii_updatel(ethqos, RGMII_CONFIG_POS_NEG_DATA_SEL, in ethqos_rgmii_macro_init()
517 rgmii_updatel(ethqos, RGMII_CONFIG_PROG_SWAP, in ethqos_rgmii_macro_init()
519 rgmii_updatel(ethqos, RGMII_CONFIG2_DATA_DIVIDE_CLK_SEL, in ethqos_rgmii_macro_init()
521 rgmii_updatel(ethqos, RGMII_CONFIG2_TX_CLK_PHASE_SHIFT_EN, in ethqos_rgmii_macro_init()
523 rgmii_updatel(ethqos, RGMII_CONFIG_MAX_SPD_PRG_9, in ethqos_rgmii_macro_init()
526 rgmii_updatel(ethqos, RGMII_CONFIG2_RSVD_CONFIG15, in ethqos_rgmii_macro_init()
528 if (ethqos->has_emac_ge_3) in ethqos_rgmii_macro_init()
529 rgmii_updatel(ethqos, RGMII_CONFIG2_RX_PROG_SWAP, in ethqos_rgmii_macro_init()
533 rgmii_updatel(ethqos, RGMII_CONFIG2_RX_PROG_SWAP, in ethqos_rgmii_macro_init()
536 rgmii_updatel(ethqos, SDCC_DDR_CONFIG_EXT_PRG_RCLK_DLY_CODE, in ethqos_rgmii_macro_init()
538 rgmii_updatel(ethqos, SDCC_DDR_CONFIG_EXT_PRG_RCLK_DLY, in ethqos_rgmii_macro_init()
541 rgmii_updatel(ethqos, SDCC_DDR_CONFIG_EXT_PRG_RCLK_DLY_EN, in ethqos_rgmii_macro_init()
544 rgmii_updatel(ethqos, RGMII_CONFIG_LOOPBACK_EN, in ethqos_rgmii_macro_init()
548 dev_err(dev, "Invalid speed %d\n", ethqos->speed); in ethqos_rgmii_macro_init()
549 return -EINVAL; in ethqos_rgmii_macro_init()
555 static int ethqos_configure_rgmii(struct qcom_ethqos *ethqos) in ethqos_configure_rgmii() argument
557 struct device *dev = ðqos->pdev->dev; in ethqos_configure_rgmii()
562 for (i = 0; i < ethqos->num_por; i++) in ethqos_configure_rgmii()
563 rgmii_writel(ethqos, ethqos->por[i].value, in ethqos_configure_rgmii()
564 ethqos->por[i].offset); in ethqos_configure_rgmii()
565 ethqos_set_func_clk_en(ethqos); in ethqos_configure_rgmii()
570 rgmii_updatel(ethqos, SDCC_DLL_CONFIG_DLL_RST, in ethqos_configure_rgmii()
574 rgmii_updatel(ethqos, SDCC_DLL_CONFIG_PDN, in ethqos_configure_rgmii()
577 if (ethqos->has_emac_ge_3) { in ethqos_configure_rgmii()
578 if (ethqos->speed == SPEED_1000) { in ethqos_configure_rgmii()
579 rgmii_writel(ethqos, 0x1800000, SDCC_TEST_CTL); in ethqos_configure_rgmii()
580 rgmii_writel(ethqos, 0x2C010800, SDCC_USR_CTL); in ethqos_configure_rgmii()
581 rgmii_writel(ethqos, 0xA001, SDCC_HC_REG_DLL_CONFIG2); in ethqos_configure_rgmii()
583 rgmii_writel(ethqos, 0x40010800, SDCC_USR_CTL); in ethqos_configure_rgmii()
584 rgmii_writel(ethqos, 0xA001, SDCC_HC_REG_DLL_CONFIG2); in ethqos_configure_rgmii()
589 rgmii_updatel(ethqos, SDCC_DLL_CONFIG_DLL_RST, 0, in ethqos_configure_rgmii()
593 rgmii_updatel(ethqos, SDCC_DLL_CONFIG_PDN, 0, in ethqos_configure_rgmii()
596 if (ethqos->speed != SPEED_100 && ethqos->speed != SPEED_10) { in ethqos_configure_rgmii()
598 rgmii_updatel(ethqos, SDCC_DLL_CONFIG_DLL_EN, in ethqos_configure_rgmii()
602 rgmii_updatel(ethqos, SDCC_DLL_CONFIG_CK_OUT_EN, in ethqos_configure_rgmii()
607 if (!ethqos->has_emac_ge_3) in ethqos_configure_rgmii()
608 rgmii_updatel(ethqos, GENMASK(26, 24), BIT(26), in ethqos_configure_rgmii()
614 dll_lock = rgmii_readl(ethqos, SDC4_STATUS); in ethqos_configure_rgmii()
617 retry--; in ethqos_configure_rgmii()
623 if (ethqos->speed == SPEED_1000) in ethqos_configure_rgmii()
624 ethqos_dll_configure(ethqos); in ethqos_configure_rgmii()
626 ethqos_rgmii_macro_init(ethqos); in ethqos_configure_rgmii()
631 static void ethqos_set_serdes_speed(struct qcom_ethqos *ethqos, int speed) in ethqos_set_serdes_speed() argument
633 if (ethqos->serdes_speed != speed) { in ethqos_set_serdes_speed()
634 phy_set_speed(ethqos->serdes_phy, speed); in ethqos_set_serdes_speed()
635 ethqos->serdes_speed = speed; in ethqos_set_serdes_speed()
642 static int ethqos_configure_sgmii(struct qcom_ethqos *ethqos) in ethqos_configure_sgmii() argument
644 struct net_device *dev = platform_get_drvdata(ethqos->pdev); in ethqos_configure_sgmii()
648 val = readl(ethqos->mac_base + MAC_CTRL_REG); in ethqos_configure_sgmii()
650 switch (ethqos->speed) { in ethqos_configure_sgmii()
653 rgmii_updatel(ethqos, RGMII_CONFIG2_RGMII_CLK_SEL_CFG, in ethqos_configure_sgmii()
656 ethqos_set_serdes_speed(ethqos, SPEED_2500); in ethqos_configure_sgmii()
657 stmmac_pcs_ctrl_ane(priv, priv->ioaddr, 0, 0, 0); in ethqos_configure_sgmii()
661 rgmii_updatel(ethqos, RGMII_CONFIG2_RGMII_CLK_SEL_CFG, in ethqos_configure_sgmii()
664 ethqos_set_serdes_speed(ethqos, SPEED_1000); in ethqos_configure_sgmii()
665 stmmac_pcs_ctrl_ane(priv, priv->ioaddr, 1, 0, 0); in ethqos_configure_sgmii()
669 ethqos_set_serdes_speed(ethqos, SPEED_1000); in ethqos_configure_sgmii()
670 stmmac_pcs_ctrl_ane(priv, priv->ioaddr, 1, 0, 0); in ethqos_configure_sgmii()
675 rgmii_updatel(ethqos, RGMII_CONFIG_SGMII_CLK_DVDR, in ethqos_configure_sgmii()
679 ethqos_set_serdes_speed(ethqos, SPEED_1000); in ethqos_configure_sgmii()
680 stmmac_pcs_ctrl_ane(priv, priv->ioaddr, 1, 0, 0); in ethqos_configure_sgmii()
684 writel(val, ethqos->mac_base + MAC_CTRL_REG); in ethqos_configure_sgmii()
693 priv->plat->max_speed = 2500; in qcom_ethqos_speed_mode_2500()
694 priv->plat->phy_interface = PHY_INTERFACE_MODE_2500BASEX; in qcom_ethqos_speed_mode_2500()
697 static int ethqos_configure(struct qcom_ethqos *ethqos) in ethqos_configure() argument
699 return ethqos->configure_func(ethqos); in ethqos_configure()
704 struct qcom_ethqos *ethqos = priv; in ethqos_fix_mac_speed() local
706 qcom_ethqos_set_sgmii_loopback(ethqos, false); in ethqos_fix_mac_speed()
707 ethqos->speed = speed; in ethqos_fix_mac_speed()
708 ethqos_update_link_clk(ethqos, speed); in ethqos_fix_mac_speed()
709 ethqos_configure(ethqos); in ethqos_fix_mac_speed()
714 struct qcom_ethqos *ethqos = priv; in qcom_ethqos_serdes_powerup() local
717 ret = phy_init(ethqos->serdes_phy); in qcom_ethqos_serdes_powerup()
721 ret = phy_power_on(ethqos->serdes_phy); in qcom_ethqos_serdes_powerup()
725 return phy_set_speed(ethqos->serdes_phy, ethqos->speed); in qcom_ethqos_serdes_powerup()
730 struct qcom_ethqos *ethqos = priv; in qcom_ethqos_serdes_powerdown() local
732 phy_power_off(ethqos->serdes_phy); in qcom_ethqos_serdes_powerdown()
733 phy_exit(ethqos->serdes_phy); in qcom_ethqos_serdes_powerdown()
738 struct qcom_ethqos *ethqos = priv; in ethqos_clks_config() local
742 ret = clk_prepare_enable(ethqos->link_clk); in ethqos_clks_config()
744 dev_err(ðqos->pdev->dev, "link_clk enable failed\n"); in ethqos_clks_config()
753 ethqos_set_func_clk_en(ethqos); in ethqos_clks_config()
755 clk_disable_unprepare(ethqos->link_clk); in ethqos_clks_config()
768 struct plat_stmmacenet_data *plat_dat = priv->plat; in ethqos_ptp_clk_freq_config()
771 if (!plat_dat->clk_ptp_ref) in ethqos_ptp_clk_freq_config()
775 err = clk_set_rate(plat_dat->clk_ptp_ref, ULONG_MAX); in ethqos_ptp_clk_freq_config()
777 netdev_err(priv->dev, "Failed to max out clk_ptp_ref: %d\n", err); in ethqos_ptp_clk_freq_config()
778 plat_dat->clk_ptp_rate = clk_get_rate(plat_dat->clk_ptp_ref); in ethqos_ptp_clk_freq_config()
780 netdev_dbg(priv->dev, "PTP rate %d\n", plat_dat->clk_ptp_rate); in ethqos_ptp_clk_freq_config()
785 struct device_node *np = pdev->dev.of_node; in qcom_ethqos_probe()
789 struct device *dev = &pdev->dev; in qcom_ethqos_probe()
790 struct qcom_ethqos *ethqos; in qcom_ethqos_probe() local
804 plat_dat->clks_config = ethqos_clks_config; in qcom_ethqos_probe()
806 ethqos = devm_kzalloc(dev, sizeof(*ethqos), GFP_KERNEL); in qcom_ethqos_probe()
807 if (!ethqos) in qcom_ethqos_probe()
808 return -ENOMEM; in qcom_ethqos_probe()
810 ret = of_get_phy_mode(np, ðqos->phy_mode); in qcom_ethqos_probe()
813 switch (ethqos->phy_mode) { in qcom_ethqos_probe()
818 ethqos->configure_func = ethqos_configure_rgmii; in qcom_ethqos_probe()
821 plat_dat->speed_mode_2500 = qcom_ethqos_speed_mode_2500; in qcom_ethqos_probe()
824 ethqos->configure_func = ethqos_configure_sgmii; in qcom_ethqos_probe()
828 phy_modes(ethqos->phy_mode)); in qcom_ethqos_probe()
829 return -EINVAL; in qcom_ethqos_probe()
832 ethqos->pdev = pdev; in qcom_ethqos_probe()
833 ethqos->rgmii_base = devm_platform_ioremap_resource_byname(pdev, "rgmii"); in qcom_ethqos_probe()
834 if (IS_ERR(ethqos->rgmii_base)) in qcom_ethqos_probe()
835 return dev_err_probe(dev, PTR_ERR(ethqos->rgmii_base), in qcom_ethqos_probe()
838 ethqos->mac_base = stmmac_res.addr; in qcom_ethqos_probe()
841 ethqos->por = data->por; in qcom_ethqos_probe()
842 ethqos->num_por = data->num_por; in qcom_ethqos_probe()
843 ethqos->rgmii_config_loopback_en = data->rgmii_config_loopback_en; in qcom_ethqos_probe()
844 ethqos->has_emac_ge_3 = data->has_emac_ge_3; in qcom_ethqos_probe()
845 ethqos->needs_sgmii_loopback = data->needs_sgmii_loopback; in qcom_ethqos_probe()
847 ethqos->link_clk = devm_clk_get(dev, data->link_clk_name ?: "rgmii"); in qcom_ethqos_probe()
848 if (IS_ERR(ethqos->link_clk)) in qcom_ethqos_probe()
849 return dev_err_probe(dev, PTR_ERR(ethqos->link_clk), in qcom_ethqos_probe()
852 ret = ethqos_clks_config(ethqos, true); in qcom_ethqos_probe()
856 ret = devm_add_action_or_reset(dev, ethqos_clks_disable, ethqos); in qcom_ethqos_probe()
860 ethqos->serdes_phy = devm_phy_optional_get(dev, "serdes"); in qcom_ethqos_probe()
861 if (IS_ERR(ethqos->serdes_phy)) in qcom_ethqos_probe()
862 return dev_err_probe(dev, PTR_ERR(ethqos->serdes_phy), in qcom_ethqos_probe()
865 ethqos->speed = SPEED_1000; in qcom_ethqos_probe()
866 ethqos->serdes_speed = SPEED_1000; in qcom_ethqos_probe()
867 ethqos_update_link_clk(ethqos, SPEED_1000); in qcom_ethqos_probe()
868 ethqos_set_func_clk_en(ethqos); in qcom_ethqos_probe()
870 plat_dat->bsp_priv = ethqos; in qcom_ethqos_probe()
871 plat_dat->fix_mac_speed = ethqos_fix_mac_speed; in qcom_ethqos_probe()
872 plat_dat->dump_debug_regs = rgmii_dump; in qcom_ethqos_probe()
873 plat_dat->ptp_clk_freq_config = ethqos_ptp_clk_freq_config; in qcom_ethqos_probe()
874 plat_dat->has_gmac4 = 1; in qcom_ethqos_probe()
875 if (ethqos->has_emac_ge_3) in qcom_ethqos_probe()
876 plat_dat->dwmac4_addrs = &data->dwmac4_addrs; in qcom_ethqos_probe()
877 plat_dat->pmt = 1; in qcom_ethqos_probe()
879 plat_dat->flags |= STMMAC_FLAG_TSO_EN; in qcom_ethqos_probe()
880 if (of_device_is_compatible(np, "qcom,qcs404-ethqos")) in qcom_ethqos_probe()
881 plat_dat->flags |= STMMAC_FLAG_RX_CLK_RUNS_IN_LPI; in qcom_ethqos_probe()
882 if (data->has_integrated_pcs) in qcom_ethqos_probe()
883 plat_dat->flags |= STMMAC_FLAG_HAS_INTEGRATED_PCS; in qcom_ethqos_probe()
884 if (data->dma_addr_width) in qcom_ethqos_probe()
885 plat_dat->host_dma_width = data->dma_addr_width; in qcom_ethqos_probe()
887 if (ethqos->serdes_phy) { in qcom_ethqos_probe()
888 plat_dat->serdes_powerup = qcom_ethqos_serdes_powerup; in qcom_ethqos_probe()
889 plat_dat->serdes_powerdown = qcom_ethqos_serdes_powerdown; in qcom_ethqos_probe()
893 for (i = 1; i < plat_dat->tx_queues_to_use; i++) in qcom_ethqos_probe()
894 plat_dat->tx_queues_cfg[i].tbs_en = 1; in qcom_ethqos_probe()
900 { .compatible = "qcom,qcs404-ethqos", .data = &emac_v2_3_0_data},
901 { .compatible = "qcom,sa8775p-ethqos", .data = &emac_v4_0_0_data},
902 { .compatible = "qcom,sc8280xp-ethqos", .data = &emac_v3_0_0_data},
903 { .compatible = "qcom,sm8150-ethqos", .data = &emac_v2_1_0_data},
911 .name = "qcom-ethqos",
918 MODULE_DESCRIPTION("Qualcomm ETHQOS driver");