Lines Matching +full:phy +full:- +full:pma
1 // SPDX-License-Identifier: GPL-2.0
3 * Cadence Sierra PHY Driver
10 #include <linux/clk-provider.h>
15 #include <linux/phy/phy.h>
23 #include <dt-bindings/phy/phy.h>
24 #include <dt-bindings/phy/phy-cadence.h>
29 /* PHY register offsets */
204 /* PHY PCS common registers */
210 /* PHY PCS lane registers */
217 /* PHY PMA common registers */
222 /* PHY PMA lane registers */
344 struct phy *phy; member
414 u32 offset = reg << ctx->reg_offset_shift; in cdns_regmap_write()
416 writew(val, ctx->base + offset); in cdns_regmap_write()
424 u32 offset = reg << ctx->reg_offset_shift; in cdns_regmap_read()
426 *val = readw(ctx->base + offset); in cdns_regmap_read()
538 static int cdns_sierra_phy_init(struct phy *gphy) in cdns_sierra_phy_init()
541 struct cdns_sierra_phy *phy = dev_get_drvdata(gphy->dev.parent); in cdns_sierra_phy_init() local
542 const struct cdns_sierra_data *init_data = phy->init_data; in cdns_sierra_phy_init()
544 enum cdns_sierra_phy_type phy_type = ins->phy_type; in cdns_sierra_phy_init()
546 enum cdns_sierra_ssc_mode ssc = ins->ssc_mode; in cdns_sierra_phy_init()
553 /* Initialise the PHY registers, unless auto configured */ in cdns_sierra_phy_init()
554 if (phy->autoconf || phy->already_configured || phy->nsubnodes > 1) in cdns_sierra_phy_init()
557 clk_set_rate(phy->input_clks[CMN_REFCLK_DIG_DIV], 25000000); in cdns_sierra_phy_init()
558 clk_set_rate(phy->input_clks[CMN_REFCLK1_DIG_DIV], 25000000); in cdns_sierra_phy_init()
560 /* PHY PCS common registers configurations */ in cdns_sierra_phy_init()
561 pcs_cmn_vals = init_data->pcs_cmn_vals[phy_type][TYPE_NONE][ssc]; in cdns_sierra_phy_init()
563 reg_pairs = pcs_cmn_vals->reg_pairs; in cdns_sierra_phy_init()
564 num_regs = pcs_cmn_vals->num_regs; in cdns_sierra_phy_init()
565 regmap = phy->regmap_phy_pcs_common_cdb; in cdns_sierra_phy_init()
570 /* PHY PMA lane registers configurations */ in cdns_sierra_phy_init()
571 phy_pma_ln_vals = init_data->phy_pma_ln_vals[phy_type][TYPE_NONE][ssc]; in cdns_sierra_phy_init()
573 reg_pairs = phy_pma_ln_vals->reg_pairs; in cdns_sierra_phy_init()
574 num_regs = phy_pma_ln_vals->num_regs; in cdns_sierra_phy_init()
575 for (i = 0; i < ins->num_lanes; i++) { in cdns_sierra_phy_init()
576 regmap = phy->regmap_phy_pma_lane_cdb[i + ins->mlane]; in cdns_sierra_phy_init()
582 /* PMA common registers configurations */ in cdns_sierra_phy_init()
583 pma_cmn_vals = init_data->pma_cmn_vals[phy_type][TYPE_NONE][ssc]; in cdns_sierra_phy_init()
585 reg_pairs = pma_cmn_vals->reg_pairs; in cdns_sierra_phy_init()
586 num_regs = pma_cmn_vals->num_regs; in cdns_sierra_phy_init()
587 regmap = phy->regmap_common_cdb; in cdns_sierra_phy_init()
592 /* PMA lane registers configurations */ in cdns_sierra_phy_init()
593 pma_ln_vals = init_data->pma_ln_vals[phy_type][TYPE_NONE][ssc]; in cdns_sierra_phy_init()
595 reg_pairs = pma_ln_vals->reg_pairs; in cdns_sierra_phy_init()
596 num_regs = pma_ln_vals->num_regs; in cdns_sierra_phy_init()
597 for (i = 0; i < ins->num_lanes; i++) { in cdns_sierra_phy_init()
598 regmap = phy->regmap_lane_cdb[i + ins->mlane]; in cdns_sierra_phy_init()
607 static int cdns_sierra_phy_on(struct phy *gphy) in cdns_sierra_phy_on()
609 struct cdns_sierra_phy *sp = dev_get_drvdata(gphy->dev.parent); in cdns_sierra_phy_on()
611 struct device *dev = sp->dev; in cdns_sierra_phy_on()
615 if (sp->nsubnodes == 1) { in cdns_sierra_phy_on()
616 /* Take the PHY out of reset */ in cdns_sierra_phy_on()
617 ret = reset_control_deassert(sp->phy_rst); in cdns_sierra_phy_on()
619 dev_err(dev, "Failed to take the PHY out of reset\n"); in cdns_sierra_phy_on()
624 /* Take the PHY lane group out of reset */ in cdns_sierra_phy_on()
625 ret = reset_control_deassert(ins->lnk_rst); in cdns_sierra_phy_on()
627 dev_err(dev, "Failed to take the PHY lane out of reset\n"); in cdns_sierra_phy_on()
631 if (ins->phy_type == TYPE_PCIE || ins->phy_type == TYPE_USB) { in cdns_sierra_phy_on()
632 ret = regmap_field_read_poll_timeout(sp->phy_iso_link_ctrl_1[ins->mlane], in cdns_sierra_phy_on()
635 dev_err(dev, "Timeout waiting for PHY status ready\n"); in cdns_sierra_phy_on()
644 ret = regmap_field_read_poll_timeout(sp->pma_cmn_ready, val, val, in cdns_sierra_phy_on()
651 ret = regmap_field_read_poll_timeout(sp->pllctrl_lock[ins->mlane], in cdns_sierra_phy_on()
659 static int cdns_sierra_phy_off(struct phy *gphy) in cdns_sierra_phy_off()
663 return reset_control_assert(ins->lnk_rst); in cdns_sierra_phy_off()
666 static int cdns_sierra_phy_reset(struct phy *gphy) in cdns_sierra_phy_reset()
668 struct cdns_sierra_phy *sp = dev_get_drvdata(gphy->dev.parent); in cdns_sierra_phy_reset()
670 reset_control_assert(sp->phy_rst); in cdns_sierra_phy_reset()
671 reset_control_deassert(sp->phy_rst); in cdns_sierra_phy_reset()
683 static int cdns_sierra_noop_phy_on(struct phy *gphy) in cdns_sierra_noop_phy_on()
698 struct regmap_field *plllc1en_field = mux->plllc1en_field; in cdns_sierra_pll_mux_get_parent()
699 struct regmap_field *termen_field = mux->termen_field; in cdns_sierra_pll_mux_get_parent()
700 struct regmap_field *field = mux->pfdclk_sel_preg; in cdns_sierra_pll_mux_get_parent()
722 struct regmap_field *plllc1en_field = mux->plllc1en_field; in cdns_sierra_pll_mux_set_parent()
723 struct regmap_field *termen_field = mux->termen_field; in cdns_sierra_pll_mux_set_parent()
724 struct regmap_field *field = mux->pfdclk_sel_preg; in cdns_sierra_pll_mux_set_parent()
757 struct device *dev = sp->dev; in cdns_sierra_pll_mux_register()
764 return -ENOMEM; in cdns_sierra_pll_mux_register()
768 init = &mux->clk_data; in cdns_sierra_pll_mux_register()
770 init->ops = &cdns_sierra_pll_mux_ops; in cdns_sierra_pll_mux_register()
771 init->flags = CLK_SET_RATE_NO_REPARENT; in cdns_sierra_pll_mux_register()
772 init->parent_data = pll_mux_parent_data[clk_index]; in cdns_sierra_pll_mux_register()
773 init->num_parents = SIERRA_NUM_CMN_PLLC_PARENTS; in cdns_sierra_pll_mux_register()
774 init->name = clk_name; in cdns_sierra_pll_mux_register()
776 mux->pfdclk_sel_preg = pfdclk1_sel_field; in cdns_sierra_pll_mux_register()
777 mux->plllc1en_field = plllc1en_field; in cdns_sierra_pll_mux_register()
778 mux->termen_field = termen_field; in cdns_sierra_pll_mux_register()
779 mux->hw.init = init; in cdns_sierra_pll_mux_register()
781 ret = devm_clk_hw_register(dev, &mux->hw); in cdns_sierra_pll_mux_register()
785 sp->clk_data.hws[clk_index] = &mux->hw; in cdns_sierra_pll_mux_register()
787 sp->pll_clks[clk_index] = devm_clk_hw_get_clk(dev, &mux->hw, in cdns_sierra_pll_mux_register()
798 struct device *dev = sp->dev; in cdns_sierra_phy_register_pll_mux()
803 pfdclk1_sel_field = sp->cmn_plllc_pfdclk1_sel_preg[i]; in cdns_sierra_phy_register_pll_mux()
804 plllc1en_field = sp->cmn_refrcv_refclk_plllc1en_preg[i]; in cdns_sierra_phy_register_pll_mux()
805 termen_field = sp->cmn_refrcv_refclk_termen_preg[i]; in cdns_sierra_phy_register_pll_mux()
822 regmap_field_write(derived_refclk->cmn_plllc_clk1_en_preg, 0x1); in cdns_sierra_derived_refclk_enable()
825 regmap_field_write(derived_refclk->cmn_plllc_clk1outdiv_preg, 0x2E); in cdns_sierra_derived_refclk_enable()
834 regmap_field_write(derived_refclk->cmn_plllc_clk1_en_preg, 0); in cdns_sierra_derived_refclk_disable()
842 regmap_field_read(derived_refclk->cmn_plllc_clk1_en_preg, &val); in cdns_sierra_derived_refclk_is_enabled()
856 struct device *dev = sp->dev; in cdns_sierra_derived_refclk_register()
865 return -ENOMEM; in cdns_sierra_derived_refclk_register()
870 init = &derived_refclk->clk_data; in cdns_sierra_derived_refclk_register()
872 init->ops = &cdns_sierra_derived_refclk_ops; in cdns_sierra_derived_refclk_register()
873 init->flags = 0; in cdns_sierra_derived_refclk_register()
874 init->name = clk_name; in cdns_sierra_derived_refclk_register()
876 regmap = sp->regmap_common_cdb; in cdns_sierra_derived_refclk_register()
883 derived_refclk->cmn_plllc_clk1outdiv_preg = field; in cdns_sierra_derived_refclk_register()
890 derived_refclk->cmn_plllc_clk1_en_preg = field; in cdns_sierra_derived_refclk_register()
892 derived_refclk->hw.init = init; in cdns_sierra_derived_refclk_register()
894 ret = devm_clk_hw_register(dev, &derived_refclk->hw); in cdns_sierra_derived_refclk_register()
898 sp->clk_data.hws[CDNS_SIERRA_DERIVED_REFCLK] = &derived_refclk->hw; in cdns_sierra_derived_refclk_register()
905 struct device *dev = sp->dev; in cdns_sierra_clk_unregister()
906 struct device_node *node = dev->of_node; in cdns_sierra_clk_unregister()
913 struct device *dev = sp->dev; in cdns_sierra_clk_register()
914 struct device_node *node = dev->of_node; in cdns_sierra_clk_register()
929 sp->clk_data.num = CDNS_SIERRA_OUTPUT_CLOCKS; in cdns_sierra_clk_register()
931 &sp->clk_data); in cdns_sierra_clk_register()
933 dev_err(dev, "Failed to add clock provider: %s\n", node->name); in cdns_sierra_clk_register()
943 if (of_property_read_u32(child, "reg", &inst->mlane)) in cdns_sierra_get_optional()
944 return -EINVAL; in cdns_sierra_get_optional()
946 if (of_property_read_u32(child, "cdns,num-lanes", &inst->num_lanes)) in cdns_sierra_get_optional()
947 return -EINVAL; in cdns_sierra_get_optional()
949 if (of_property_read_u32(child, "cdns,phy-type", &phy_type)) in cdns_sierra_get_optional()
950 return -EINVAL; in cdns_sierra_get_optional()
954 inst->phy_type = TYPE_PCIE; in cdns_sierra_get_optional()
957 inst->phy_type = TYPE_USB; in cdns_sierra_get_optional()
960 inst->phy_type = TYPE_SGMII; in cdns_sierra_get_optional()
963 inst->phy_type = TYPE_QSGMII; in cdns_sierra_get_optional()
966 return -EINVAL; in cdns_sierra_get_optional()
969 inst->ssc_mode = EXTERNAL_SSC; in cdns_sierra_get_optional()
970 of_property_read_u32(child, "cdns,ssc-mode", &inst->ssc_mode); in cdns_sierra_get_optional()
983 return ERR_PTR(-ENOMEM); in cdns_regmap_init()
985 ctx->dev = dev; in cdns_regmap_init()
986 ctx->base = base + block_offset; in cdns_regmap_init()
987 ctx->reg_offset_shift = reg_offset_shift; in cdns_regmap_init()
994 struct device *dev = sp->dev; in cdns_regfield_init()
1000 regmap = sp->regmap_common_cdb; in cdns_regfield_init()
1006 sp->macro_id_type = field; in cdns_regfield_init()
1015 sp->cmn_plllc_pfdclk1_sel_preg[i] = field; in cdns_regfield_init()
1023 sp->cmn_refrcv_refclk_plllc1en_preg[i] = field; in cdns_regfield_init()
1031 sp->cmn_refrcv_refclk_termen_preg[i] = field; in cdns_regfield_init()
1034 regmap = sp->regmap_phy_pcs_common_cdb; in cdns_regfield_init()
1040 sp->phy_pll_cfg_1 = field; in cdns_regfield_init()
1042 regmap = sp->regmap_phy_pma_common_cdb; in cdns_regfield_init()
1048 sp->pma_cmn_ready = field; in cdns_regfield_init()
1051 regmap = sp->regmap_lane_cdb[i]; in cdns_regfield_init()
1057 sp->pllctrl_lock[i] = field; in cdns_regfield_init()
1061 regmap = sp->regmap_phy_pcs_lane_cdb[i]; in cdns_regfield_init()
1067 sp->phy_iso_link_ctrl_1[i] = field; in cdns_regfield_init()
1077 struct device *dev = sp->dev; in cdns_regmap_init_blocks()
1092 sp->regmap_lane_cdb[i] = regmap; in cdns_regmap_init_blocks()
1102 sp->regmap_common_cdb = regmap; in cdns_regmap_init_blocks()
1108 dev_err(dev, "Failed to init PHY PCS common CDB regmap\n"); in cdns_regmap_init_blocks()
1111 sp->regmap_phy_pcs_common_cdb = regmap; in cdns_regmap_init_blocks()
1120 dev_err(dev, "Failed to init PHY PCS lane CDB regmap\n"); in cdns_regmap_init_blocks()
1123 sp->regmap_phy_pcs_lane_cdb[i] = regmap; in cdns_regmap_init_blocks()
1130 dev_err(dev, "Failed to init PHY PMA common CDB regmap\n"); in cdns_regmap_init_blocks()
1133 sp->regmap_phy_pma_common_cdb = regmap; in cdns_regmap_init_blocks()
1142 dev_err(dev, "Failed to init PHY PMA lane CDB regmap\n"); in cdns_regmap_init_blocks()
1145 sp->regmap_phy_pma_lane_cdb[i] = regmap; in cdns_regmap_init_blocks()
1163 sp->input_clks[CMN_REFCLK_DIG_DIV] = clk; in cdns_sierra_phy_get_clocks()
1171 sp->input_clks[CMN_REFCLK1_DIG_DIV] = clk; in cdns_sierra_phy_get_clocks()
1178 struct device *dev = sp->dev; in cdns_sierra_phy_clk()
1187 sp->input_clks[PHY_CLK] = clk; in cdns_sierra_phy_clk()
1189 ret = clk_prepare_enable(sp->input_clks[PHY_CLK]); in cdns_sierra_phy_clk()
1200 ret = clk_prepare_enable(sp->pll_clks[CDNS_SIERRA_PLL_CMNLC]); in cdns_sierra_phy_enable_clocks()
1204 ret = clk_prepare_enable(sp->pll_clks[CDNS_SIERRA_PLL_CMNLC1]); in cdns_sierra_phy_enable_clocks()
1211 clk_disable_unprepare(sp->pll_clks[CDNS_SIERRA_PLL_CMNLC]); in cdns_sierra_phy_enable_clocks()
1218 clk_disable_unprepare(sp->pll_clks[CDNS_SIERRA_PLL_CMNLC1]); in cdns_sierra_phy_disable_clocks()
1219 clk_disable_unprepare(sp->pll_clks[CDNS_SIERRA_PLL_CMNLC]); in cdns_sierra_phy_disable_clocks()
1220 if (!sp->already_configured) in cdns_sierra_phy_disable_clocks()
1221 clk_disable_unprepare(sp->input_clks[PHY_CLK]); in cdns_sierra_phy_disable_clocks()
1234 sp->phy_rst = rst; in cdns_sierra_phy_get_resets()
1241 sp->apb_rst = rst; in cdns_sierra_phy_get_resets()
1249 const struct cdns_sierra_data *init_data = sp->init_data; in cdns_sierra_phy_configure_multilink()
1260 if (sp->nsubnodes != 2) in cdns_sierra_phy_configure_multilink()
1261 return -EINVAL; in cdns_sierra_phy_configure_multilink()
1263 clk_set_rate(sp->input_clks[CMN_REFCLK_DIG_DIV], 25000000); in cdns_sierra_phy_configure_multilink()
1264 clk_set_rate(sp->input_clks[CMN_REFCLK1_DIG_DIV], 25000000); in cdns_sierra_phy_configure_multilink()
1266 /* PHY configured to use both PLL LC and LC1 */ in cdns_sierra_phy_configure_multilink()
1267 regmap_field_write(sp->phy_pll_cfg_1, 0x1); in cdns_sierra_phy_configure_multilink()
1269 phy_t1 = sp->phys[0].phy_type; in cdns_sierra_phy_configure_multilink()
1270 phy_t2 = sp->phys[1].phy_type; in cdns_sierra_phy_configure_multilink()
1273 * PHY configuration for multi-link operation is done in two steps. in cdns_sierra_phy_configure_multilink()
1274 * e.g. Consider a case for a 4 lane PHY with PCIe using 2 lanes and QSGMII other 2 lanes. in cdns_sierra_phy_configure_multilink()
1275 * Sierra PHY has 2 PLLs, viz. PLLLC and PLLLC1. So in this case, PLLLC is used for PCIe in cdns_sierra_phy_configure_multilink()
1276 * and PLLLC1 is used for QSGMII. PHY is configured in two steps as described below. in cdns_sierra_phy_configure_multilink()
1280 * This will configure PHY registers associated for PCIe (i.e. first protocol) in cdns_sierra_phy_configure_multilink()
1281 * involving PLLLC registers and registers for first 2 lanes of PHY. in cdns_sierra_phy_configure_multilink()
1285 * This will configure PHY registers associated for QSGMII (i.e. second protocol) in cdns_sierra_phy_configure_multilink()
1286 * involving PLLLC1 registers and registers for other 2 lanes of PHY. in cdns_sierra_phy_configure_multilink()
1288 * This completes the PHY configuration for multilink operation. This approach enables in cdns_sierra_phy_configure_multilink()
1289 * dividing the large number of PHY register configurations into protocol specific in cdns_sierra_phy_configure_multilink()
1292 for (node = 0; node < sp->nsubnodes; node++) { in cdns_sierra_phy_configure_multilink()
1295 * If first link with phy_t1 is configured, then configure the PHY for in cdns_sierra_phy_configure_multilink()
1301 mlane = sp->phys[node].mlane; in cdns_sierra_phy_configure_multilink()
1302 ssc = sp->phys[node].ssc_mode; in cdns_sierra_phy_configure_multilink()
1303 num_lanes = sp->phys[node].num_lanes; in cdns_sierra_phy_configure_multilink()
1305 /* PHY PCS common registers configurations */ in cdns_sierra_phy_configure_multilink()
1306 pcs_cmn_vals = init_data->pcs_cmn_vals[phy_t1][phy_t2][ssc]; in cdns_sierra_phy_configure_multilink()
1308 reg_pairs = pcs_cmn_vals->reg_pairs; in cdns_sierra_phy_configure_multilink()
1309 num_regs = pcs_cmn_vals->num_regs; in cdns_sierra_phy_configure_multilink()
1310 regmap = sp->regmap_phy_pcs_common_cdb; in cdns_sierra_phy_configure_multilink()
1315 /* PHY PMA lane registers configurations */ in cdns_sierra_phy_configure_multilink()
1316 phy_pma_ln_vals = init_data->phy_pma_ln_vals[phy_t1][phy_t2][ssc]; in cdns_sierra_phy_configure_multilink()
1318 reg_pairs = phy_pma_ln_vals->reg_pairs; in cdns_sierra_phy_configure_multilink()
1319 num_regs = phy_pma_ln_vals->num_regs; in cdns_sierra_phy_configure_multilink()
1321 regmap = sp->regmap_phy_pma_lane_cdb[i + mlane]; in cdns_sierra_phy_configure_multilink()
1327 /* PMA common registers configurations */ in cdns_sierra_phy_configure_multilink()
1328 pma_cmn_vals = init_data->pma_cmn_vals[phy_t1][phy_t2][ssc]; in cdns_sierra_phy_configure_multilink()
1330 reg_pairs = pma_cmn_vals->reg_pairs; in cdns_sierra_phy_configure_multilink()
1331 num_regs = pma_cmn_vals->num_regs; in cdns_sierra_phy_configure_multilink()
1332 regmap = sp->regmap_common_cdb; in cdns_sierra_phy_configure_multilink()
1337 /* PMA lane registers configurations */ in cdns_sierra_phy_configure_multilink()
1338 pma_ln_vals = init_data->pma_ln_vals[phy_t1][phy_t2][ssc]; in cdns_sierra_phy_configure_multilink()
1340 reg_pairs = pma_ln_vals->reg_pairs; in cdns_sierra_phy_configure_multilink()
1341 num_regs = pma_ln_vals->num_regs; in cdns_sierra_phy_configure_multilink()
1343 regmap = sp->regmap_lane_cdb[i + mlane]; in cdns_sierra_phy_configure_multilink()
1350 reset_control_deassert(sp->phys[node].lnk_rst); in cdns_sierra_phy_configure_multilink()
1353 /* Take the PHY out of reset */ in cdns_sierra_phy_configure_multilink()
1354 ret = reset_control_deassert(sp->phy_rst); in cdns_sierra_phy_configure_multilink()
1365 struct device *dev = &pdev->dev; in cdns_sierra_phy_probe()
1370 struct device_node *dn = dev->of_node; in cdns_sierra_phy_probe()
1373 return -ENODEV; in cdns_sierra_phy_probe()
1375 /* Get init data for this PHY */ in cdns_sierra_phy_probe()
1378 return -EINVAL; in cdns_sierra_phy_probe()
1384 return -ENOMEM; in cdns_sierra_phy_probe()
1386 sp->dev = dev; in cdns_sierra_phy_probe()
1387 sp->init_data = data; in cdns_sierra_phy_probe()
1395 ret = cdns_regmap_init_blocks(sp, base, data->block_offset_shift, in cdns_sierra_phy_probe()
1396 data->reg_offset_shift); in cdns_sierra_phy_probe()
1418 regmap_field_read(sp->pma_cmn_ready, &sp->already_configured); in cdns_sierra_phy_probe()
1420 if (!sp->already_configured) { in cdns_sierra_phy_probe()
1430 reset_control_deassert(sp->apb_rst); in cdns_sierra_phy_probe()
1433 /* Check that PHY is present */ in cdns_sierra_phy_probe()
1434 regmap_field_read(sp->macro_id_type, &id_value); in cdns_sierra_phy_probe()
1435 if (sp->init_data->id_value != id_value) { in cdns_sierra_phy_probe()
1436 ret = -EINVAL; in cdns_sierra_phy_probe()
1440 sp->autoconf = of_property_read_bool(dn, "cdns,autoconf"); in cdns_sierra_phy_probe()
1443 struct phy *gphy; in cdns_sierra_phy_probe()
1445 if (!(of_node_name_eq(child, "phy") || in cdns_sierra_phy_probe()
1449 sp->phys[node].lnk_rst = in cdns_sierra_phy_probe()
1452 if (IS_ERR(sp->phys[node].lnk_rst)) { in cdns_sierra_phy_probe()
1454 child->full_name); in cdns_sierra_phy_probe()
1455 ret = PTR_ERR(sp->phys[node].lnk_rst); in cdns_sierra_phy_probe()
1459 if (!sp->autoconf) { in cdns_sierra_phy_probe()
1460 ret = cdns_sierra_get_optional(&sp->phys[node], child); in cdns_sierra_phy_probe()
1463 child->name); in cdns_sierra_phy_probe()
1464 reset_control_put(sp->phys[node].lnk_rst); in cdns_sierra_phy_probe()
1469 sp->num_lanes += sp->phys[node].num_lanes; in cdns_sierra_phy_probe()
1471 if (!sp->already_configured) in cdns_sierra_phy_probe()
1477 reset_control_put(sp->phys[node].lnk_rst); in cdns_sierra_phy_probe()
1480 sp->phys[node].phy = gphy; in cdns_sierra_phy_probe()
1481 phy_set_drvdata(gphy, &sp->phys[node]); in cdns_sierra_phy_probe()
1485 sp->nsubnodes = node; in cdns_sierra_phy_probe()
1487 if (sp->num_lanes > SIERRA_MAX_LANES) { in cdns_sierra_phy_probe()
1488 ret = -EINVAL; in cdns_sierra_phy_probe()
1493 /* If more than one subnode, configure the PHY as multilink */ in cdns_sierra_phy_probe()
1494 if (!sp->already_configured && !sp->autoconf && sp->nsubnodes > 1) { in cdns_sierra_phy_probe()
1510 while (--node >= 0) in cdns_sierra_phy_probe()
1511 reset_control_put(sp->phys[node].lnk_rst); in cdns_sierra_phy_probe()
1513 if (!sp->already_configured) in cdns_sierra_phy_probe()
1514 reset_control_assert(sp->apb_rst); in cdns_sierra_phy_probe()
1524 struct cdns_sierra_phy *phy = platform_get_drvdata(pdev); in cdns_sierra_phy_remove() local
1527 reset_control_assert(phy->phy_rst); in cdns_sierra_phy_remove()
1528 reset_control_assert(phy->apb_rst); in cdns_sierra_phy_remove()
1529 pm_runtime_disable(&pdev->dev); in cdns_sierra_phy_remove()
1531 cdns_sierra_phy_disable_clocks(phy); in cdns_sierra_phy_remove()
1536 for (i = 0; i < phy->nsubnodes; i++) { in cdns_sierra_phy_remove()
1537 reset_control_assert(phy->phys[i].lnk_rst); in cdns_sierra_phy_remove()
1538 reset_control_put(phy->phys[i].lnk_rst); in cdns_sierra_phy_remove()
1541 cdns_sierra_clk_unregister(phy); in cdns_sierra_phy_remove()
1544 /* SGMII PHY PMA lane configuration */
1609 /* QSGMII PHY PMA lane configuration */
1675 /* PCIE PHY PCS common configuration */
2424 /* SGMII PHY common configuration */
2449 /* SGMII PHY lane configuration */
2721 .compatible = "cdns,sierra-phy-t0",
2725 .compatible = "ti,sierra-phy-t0",
2736 .name = "cdns-sierra-phy",
2744 MODULE_DESCRIPTION("CDNS sierra phy driver");