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 */
203 /* PHY PCS common registers */
209 /* PHY PCS lane registers */
216 /* PHY PMA common registers */
221 /* PHY PMA lane registers */
343 struct phy *phy; member
413 u32 offset = reg << ctx->reg_offset_shift; in cdns_regmap_write()
415 writew(val, ctx->base + offset); in cdns_regmap_write()
423 u32 offset = reg << ctx->reg_offset_shift; in cdns_regmap_read()
425 *val = readw(ctx->base + offset); in cdns_regmap_read()
537 static int cdns_sierra_phy_init(struct phy *gphy) in cdns_sierra_phy_init()
540 struct cdns_sierra_phy *phy = dev_get_drvdata(gphy->dev.parent); in cdns_sierra_phy_init() local
541 const struct cdns_sierra_data *init_data = phy->init_data; in cdns_sierra_phy_init()
543 enum cdns_sierra_phy_type phy_type = ins->phy_type; in cdns_sierra_phy_init()
544 enum cdns_sierra_ssc_mode ssc = ins->ssc_mode; in cdns_sierra_phy_init()
552 /* Initialise the PHY registers, unless auto configured */ in cdns_sierra_phy_init()
553 if (phy->autoconf || phy->already_configured || phy->nsubnodes > 1) in cdns_sierra_phy_init()
556 clk_set_rate(phy->input_clks[CMN_REFCLK_DIG_DIV], 25000000); in cdns_sierra_phy_init()
557 clk_set_rate(phy->input_clks[CMN_REFCLK1_DIG_DIV], 25000000); in cdns_sierra_phy_init()
559 /* PHY PCS common registers configurations */ in cdns_sierra_phy_init()
560 pcs_cmn_vals = init_data->pcs_cmn_vals[phy_type][TYPE_NONE][ssc]; in cdns_sierra_phy_init()
562 reg_pairs = pcs_cmn_vals->reg_pairs; in cdns_sierra_phy_init()
563 num_regs = pcs_cmn_vals->num_regs; in cdns_sierra_phy_init()
564 regmap = phy->regmap_phy_pcs_common_cdb; in cdns_sierra_phy_init()
569 /* PHY PMA lane registers configurations */ in cdns_sierra_phy_init()
570 phy_pma_ln_vals = init_data->phy_pma_ln_vals[phy_type][TYPE_NONE][ssc]; in cdns_sierra_phy_init()
572 reg_pairs = phy_pma_ln_vals->reg_pairs; in cdns_sierra_phy_init()
573 num_regs = phy_pma_ln_vals->num_regs; in cdns_sierra_phy_init()
574 for (i = 0; i < ins->num_lanes; i++) { in cdns_sierra_phy_init()
575 regmap = phy->regmap_phy_pma_lane_cdb[i + ins->mlane]; in cdns_sierra_phy_init()
581 /* PMA common registers configurations */ in cdns_sierra_phy_init()
582 pma_cmn_vals = init_data->pma_cmn_vals[phy_type][TYPE_NONE][ssc]; in cdns_sierra_phy_init()
584 reg_pairs = pma_cmn_vals->reg_pairs; in cdns_sierra_phy_init()
585 num_regs = pma_cmn_vals->num_regs; in cdns_sierra_phy_init()
586 regmap = phy->regmap_common_cdb; in cdns_sierra_phy_init()
591 /* PMA lane registers configurations */ in cdns_sierra_phy_init()
592 pma_ln_vals = init_data->pma_ln_vals[phy_type][TYPE_NONE][ssc]; in cdns_sierra_phy_init()
594 reg_pairs = pma_ln_vals->reg_pairs; in cdns_sierra_phy_init()
595 num_regs = pma_ln_vals->num_regs; in cdns_sierra_phy_init()
596 for (i = 0; i < ins->num_lanes; i++) { in cdns_sierra_phy_init()
597 regmap = phy->regmap_lane_cdb[i + ins->mlane]; in cdns_sierra_phy_init()
606 static int cdns_sierra_phy_on(struct phy *gphy) in cdns_sierra_phy_on()
608 struct cdns_sierra_phy *sp = dev_get_drvdata(gphy->dev.parent); in cdns_sierra_phy_on()
610 struct device *dev = sp->dev; in cdns_sierra_phy_on()
614 if (sp->nsubnodes == 1) { in cdns_sierra_phy_on()
615 /* Take the PHY out of reset */ in cdns_sierra_phy_on()
616 ret = reset_control_deassert(sp->phy_rst); in cdns_sierra_phy_on()
618 dev_err(dev, "Failed to take the PHY out of reset\n"); in cdns_sierra_phy_on()
623 /* Take the PHY lane group out of reset */ in cdns_sierra_phy_on()
624 ret = reset_control_deassert(ins->lnk_rst); in cdns_sierra_phy_on()
626 dev_err(dev, "Failed to take the PHY lane out of reset\n"); in cdns_sierra_phy_on()
630 if (ins->phy_type == TYPE_PCIE || ins->phy_type == TYPE_USB) { in cdns_sierra_phy_on()
631 ret = regmap_field_read_poll_timeout(sp->phy_iso_link_ctrl_1[ins->mlane], in cdns_sierra_phy_on()
634 dev_err(dev, "Timeout waiting for PHY status ready\n"); in cdns_sierra_phy_on()
643 ret = regmap_field_read_poll_timeout(sp->pma_cmn_ready, val, val, in cdns_sierra_phy_on()
650 ret = regmap_field_read_poll_timeout(sp->pllctrl_lock[ins->mlane], in cdns_sierra_phy_on()
658 static int cdns_sierra_phy_off(struct phy *gphy) in cdns_sierra_phy_off()
662 return reset_control_assert(ins->lnk_rst); in cdns_sierra_phy_off()
665 static int cdns_sierra_phy_reset(struct phy *gphy) in cdns_sierra_phy_reset()
667 struct cdns_sierra_phy *sp = dev_get_drvdata(gphy->dev.parent); in cdns_sierra_phy_reset()
669 reset_control_assert(sp->phy_rst); in cdns_sierra_phy_reset()
670 reset_control_deassert(sp->phy_rst); in cdns_sierra_phy_reset()
682 static int cdns_sierra_noop_phy_on(struct phy *gphy) in cdns_sierra_noop_phy_on()
697 struct regmap_field *plllc1en_field = mux->plllc1en_field; in cdns_sierra_pll_mux_get_parent()
698 struct regmap_field *termen_field = mux->termen_field; in cdns_sierra_pll_mux_get_parent()
699 struct regmap_field *field = mux->pfdclk_sel_preg; in cdns_sierra_pll_mux_get_parent()
721 struct regmap_field *plllc1en_field = mux->plllc1en_field; in cdns_sierra_pll_mux_set_parent()
722 struct regmap_field *termen_field = mux->termen_field; in cdns_sierra_pll_mux_set_parent()
723 struct regmap_field *field = mux->pfdclk_sel_preg; in cdns_sierra_pll_mux_set_parent()
756 struct device *dev = sp->dev; in cdns_sierra_pll_mux_register()
763 return -ENOMEM; in cdns_sierra_pll_mux_register()
767 init = &mux->clk_data; in cdns_sierra_pll_mux_register()
769 init->ops = &cdns_sierra_pll_mux_ops; in cdns_sierra_pll_mux_register()
770 init->flags = CLK_SET_RATE_NO_REPARENT; in cdns_sierra_pll_mux_register()
771 init->parent_data = pll_mux_parent_data[clk_index]; in cdns_sierra_pll_mux_register()
772 init->num_parents = SIERRA_NUM_CMN_PLLC_PARENTS; in cdns_sierra_pll_mux_register()
773 init->name = clk_name; in cdns_sierra_pll_mux_register()
775 mux->pfdclk_sel_preg = pfdclk1_sel_field; in cdns_sierra_pll_mux_register()
776 mux->plllc1en_field = plllc1en_field; in cdns_sierra_pll_mux_register()
777 mux->termen_field = termen_field; in cdns_sierra_pll_mux_register()
778 mux->hw.init = init; in cdns_sierra_pll_mux_register()
780 ret = devm_clk_hw_register(dev, &mux->hw); in cdns_sierra_pll_mux_register()
784 sp->clk_data.hws[clk_index] = &mux->hw; in cdns_sierra_pll_mux_register()
786 sp->pll_clks[clk_index] = devm_clk_hw_get_clk(dev, &mux->hw, in cdns_sierra_pll_mux_register()
797 struct device *dev = sp->dev; in cdns_sierra_phy_register_pll_mux()
802 pfdclk1_sel_field = sp->cmn_plllc_pfdclk1_sel_preg[i]; in cdns_sierra_phy_register_pll_mux()
803 plllc1en_field = sp->cmn_refrcv_refclk_plllc1en_preg[i]; in cdns_sierra_phy_register_pll_mux()
804 termen_field = sp->cmn_refrcv_refclk_termen_preg[i]; in cdns_sierra_phy_register_pll_mux()
821 regmap_field_write(derived_refclk->cmn_plllc_clk1_en_preg, 0x1); in cdns_sierra_derived_refclk_enable()
824 regmap_field_write(derived_refclk->cmn_plllc_clk1outdiv_preg, 0x2E); in cdns_sierra_derived_refclk_enable()
833 regmap_field_write(derived_refclk->cmn_plllc_clk1_en_preg, 0); in cdns_sierra_derived_refclk_disable()
841 regmap_field_read(derived_refclk->cmn_plllc_clk1_en_preg, &val); in cdns_sierra_derived_refclk_is_enabled()
855 struct device *dev = sp->dev; in cdns_sierra_derived_refclk_register()
864 return -ENOMEM; in cdns_sierra_derived_refclk_register()
869 init = &derived_refclk->clk_data; in cdns_sierra_derived_refclk_register()
871 init->ops = &cdns_sierra_derived_refclk_ops; in cdns_sierra_derived_refclk_register()
872 init->flags = 0; in cdns_sierra_derived_refclk_register()
873 init->name = clk_name; in cdns_sierra_derived_refclk_register()
875 regmap = sp->regmap_common_cdb; in cdns_sierra_derived_refclk_register()
882 derived_refclk->cmn_plllc_clk1outdiv_preg = field; in cdns_sierra_derived_refclk_register()
889 derived_refclk->cmn_plllc_clk1_en_preg = field; in cdns_sierra_derived_refclk_register()
891 derived_refclk->hw.init = init; in cdns_sierra_derived_refclk_register()
893 ret = devm_clk_hw_register(dev, &derived_refclk->hw); in cdns_sierra_derived_refclk_register()
897 sp->clk_data.hws[CDNS_SIERRA_DERIVED_REFCLK] = &derived_refclk->hw; in cdns_sierra_derived_refclk_register()
904 struct device *dev = sp->dev; in cdns_sierra_clk_unregister()
905 struct device_node *node = dev->of_node; in cdns_sierra_clk_unregister()
912 struct device *dev = sp->dev; in cdns_sierra_clk_register()
913 struct device_node *node = dev->of_node; in cdns_sierra_clk_register()
928 sp->clk_data.num = CDNS_SIERRA_OUTPUT_CLOCKS; in cdns_sierra_clk_register()
930 &sp->clk_data); in cdns_sierra_clk_register()
932 dev_err(dev, "Failed to add clock provider: %s\n", node->name); in cdns_sierra_clk_register()
942 if (of_property_read_u32(child, "reg", &inst->mlane)) in cdns_sierra_get_optional()
943 return -EINVAL; in cdns_sierra_get_optional()
945 if (of_property_read_u32(child, "cdns,num-lanes", &inst->num_lanes)) in cdns_sierra_get_optional()
946 return -EINVAL; in cdns_sierra_get_optional()
948 if (of_property_read_u32(child, "cdns,phy-type", &phy_type)) in cdns_sierra_get_optional()
949 return -EINVAL; in cdns_sierra_get_optional()
953 inst->phy_type = TYPE_PCIE; in cdns_sierra_get_optional()
956 inst->phy_type = TYPE_USB; in cdns_sierra_get_optional()
959 inst->phy_type = TYPE_SGMII; in cdns_sierra_get_optional()
962 inst->phy_type = TYPE_QSGMII; in cdns_sierra_get_optional()
965 return -EINVAL; in cdns_sierra_get_optional()
968 inst->ssc_mode = EXTERNAL_SSC; in cdns_sierra_get_optional()
969 of_property_read_u32(child, "cdns,ssc-mode", &inst->ssc_mode); in cdns_sierra_get_optional()
982 return ERR_PTR(-ENOMEM); in cdns_regmap_init()
984 ctx->dev = dev; in cdns_regmap_init()
985 ctx->base = base + block_offset; in cdns_regmap_init()
986 ctx->reg_offset_shift = reg_offset_shift; in cdns_regmap_init()
993 struct device *dev = sp->dev; in cdns_regfield_init()
999 regmap = sp->regmap_common_cdb; in cdns_regfield_init()
1005 sp->macro_id_type = field; in cdns_regfield_init()
1014 sp->cmn_plllc_pfdclk1_sel_preg[i] = field; in cdns_regfield_init()
1022 sp->cmn_refrcv_refclk_plllc1en_preg[i] = field; in cdns_regfield_init()
1030 sp->cmn_refrcv_refclk_termen_preg[i] = field; in cdns_regfield_init()
1033 regmap = sp->regmap_phy_pcs_common_cdb; in cdns_regfield_init()
1039 sp->phy_pll_cfg_1 = field; in cdns_regfield_init()
1041 regmap = sp->regmap_phy_pma_common_cdb; in cdns_regfield_init()
1047 sp->pma_cmn_ready = field; in cdns_regfield_init()
1050 regmap = sp->regmap_lane_cdb[i]; in cdns_regfield_init()
1056 sp->pllctrl_lock[i] = field; in cdns_regfield_init()
1060 regmap = sp->regmap_phy_pcs_lane_cdb[i]; in cdns_regfield_init()
1066 sp->phy_iso_link_ctrl_1[i] = field; in cdns_regfield_init()
1076 struct device *dev = sp->dev; in cdns_regmap_init_blocks()
1091 sp->regmap_lane_cdb[i] = regmap; in cdns_regmap_init_blocks()
1101 sp->regmap_common_cdb = regmap; in cdns_regmap_init_blocks()
1107 dev_err(dev, "Failed to init PHY PCS common CDB regmap\n"); in cdns_regmap_init_blocks()
1110 sp->regmap_phy_pcs_common_cdb = regmap; in cdns_regmap_init_blocks()
1119 dev_err(dev, "Failed to init PHY PCS lane CDB regmap\n"); in cdns_regmap_init_blocks()
1122 sp->regmap_phy_pcs_lane_cdb[i] = regmap; in cdns_regmap_init_blocks()
1129 dev_err(dev, "Failed to init PHY PMA common CDB regmap\n"); in cdns_regmap_init_blocks()
1132 sp->regmap_phy_pma_common_cdb = regmap; in cdns_regmap_init_blocks()
1141 dev_err(dev, "Failed to init PHY PMA lane CDB regmap\n"); in cdns_regmap_init_blocks()
1144 sp->regmap_phy_pma_lane_cdb[i] = regmap; in cdns_regmap_init_blocks()
1162 sp->input_clks[CMN_REFCLK_DIG_DIV] = clk; in cdns_sierra_phy_get_clocks()
1170 sp->input_clks[CMN_REFCLK1_DIG_DIV] = clk; in cdns_sierra_phy_get_clocks()
1177 struct device *dev = sp->dev; in cdns_sierra_phy_clk()
1186 sp->input_clks[PHY_CLK] = clk; in cdns_sierra_phy_clk()
1188 ret = clk_prepare_enable(sp->input_clks[PHY_CLK]); in cdns_sierra_phy_clk()
1199 ret = clk_prepare_enable(sp->pll_clks[CDNS_SIERRA_PLL_CMNLC]); in cdns_sierra_phy_enable_clocks()
1203 ret = clk_prepare_enable(sp->pll_clks[CDNS_SIERRA_PLL_CMNLC1]); in cdns_sierra_phy_enable_clocks()
1210 clk_disable_unprepare(sp->pll_clks[CDNS_SIERRA_PLL_CMNLC]); in cdns_sierra_phy_enable_clocks()
1217 clk_disable_unprepare(sp->pll_clks[CDNS_SIERRA_PLL_CMNLC1]); in cdns_sierra_phy_disable_clocks()
1218 clk_disable_unprepare(sp->pll_clks[CDNS_SIERRA_PLL_CMNLC]); in cdns_sierra_phy_disable_clocks()
1219 if (!sp->already_configured) in cdns_sierra_phy_disable_clocks()
1220 clk_disable_unprepare(sp->input_clks[PHY_CLK]); in cdns_sierra_phy_disable_clocks()
1233 sp->phy_rst = rst; in cdns_sierra_phy_get_resets()
1240 sp->apb_rst = rst; in cdns_sierra_phy_get_resets()
1247 const struct cdns_sierra_data *init_data = sp->init_data; in cdns_sierra_phy_configure_multilink()
1259 if (sp->nsubnodes != 2) in cdns_sierra_phy_configure_multilink()
1260 return -EINVAL; in cdns_sierra_phy_configure_multilink()
1262 clk_set_rate(sp->input_clks[CMN_REFCLK_DIG_DIV], 25000000); in cdns_sierra_phy_configure_multilink()
1263 clk_set_rate(sp->input_clks[CMN_REFCLK1_DIG_DIV], 25000000); in cdns_sierra_phy_configure_multilink()
1265 /* PHY configured to use both PLL LC and LC1 */ in cdns_sierra_phy_configure_multilink()
1266 regmap_field_write(sp->phy_pll_cfg_1, 0x1); in cdns_sierra_phy_configure_multilink()
1268 phy_t1 = sp->phys[0].phy_type; in cdns_sierra_phy_configure_multilink()
1269 phy_t2 = sp->phys[1].phy_type; in cdns_sierra_phy_configure_multilink()
1272 * PHY configuration for multi-link operation is done in two steps. in cdns_sierra_phy_configure_multilink()
1273 * 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()
1274 * Sierra PHY has 2 PLLs, viz. PLLLC and PLLLC1. So in this case, PLLLC is used for PCIe in cdns_sierra_phy_configure_multilink()
1275 * and PLLLC1 is used for QSGMII. PHY is configured in two steps as described below. in cdns_sierra_phy_configure_multilink()
1279 * This will configure PHY registers associated for PCIe (i.e. first protocol) in cdns_sierra_phy_configure_multilink()
1280 * involving PLLLC registers and registers for first 2 lanes of PHY. in cdns_sierra_phy_configure_multilink()
1284 * This will configure PHY registers associated for QSGMII (i.e. second protocol) in cdns_sierra_phy_configure_multilink()
1285 * involving PLLLC1 registers and registers for other 2 lanes of PHY. in cdns_sierra_phy_configure_multilink()
1287 * This completes the PHY configuration for multilink operation. This approach enables in cdns_sierra_phy_configure_multilink()
1288 * dividing the large number of PHY register configurations into protocol specific in cdns_sierra_phy_configure_multilink()
1291 for (node = 0; node < sp->nsubnodes; node++) { in cdns_sierra_phy_configure_multilink()
1294 * If first link with phy_t1 is configured, then configure the PHY for in cdns_sierra_phy_configure_multilink()
1300 mlane = sp->phys[node].mlane; in cdns_sierra_phy_configure_multilink()
1301 ssc = sp->phys[node].ssc_mode; in cdns_sierra_phy_configure_multilink()
1302 num_lanes = sp->phys[node].num_lanes; in cdns_sierra_phy_configure_multilink()
1304 /* PHY PCS common registers configurations */ in cdns_sierra_phy_configure_multilink()
1305 pcs_cmn_vals = init_data->pcs_cmn_vals[phy_t1][phy_t2][ssc]; in cdns_sierra_phy_configure_multilink()
1307 reg_pairs = pcs_cmn_vals->reg_pairs; in cdns_sierra_phy_configure_multilink()
1308 num_regs = pcs_cmn_vals->num_regs; in cdns_sierra_phy_configure_multilink()
1309 regmap = sp->regmap_phy_pcs_common_cdb; in cdns_sierra_phy_configure_multilink()
1314 /* PHY PMA lane registers configurations */ in cdns_sierra_phy_configure_multilink()
1315 phy_pma_ln_vals = init_data->phy_pma_ln_vals[phy_t1][phy_t2][ssc]; in cdns_sierra_phy_configure_multilink()
1317 reg_pairs = phy_pma_ln_vals->reg_pairs; in cdns_sierra_phy_configure_multilink()
1318 num_regs = phy_pma_ln_vals->num_regs; in cdns_sierra_phy_configure_multilink()
1320 regmap = sp->regmap_phy_pma_lane_cdb[i + mlane]; in cdns_sierra_phy_configure_multilink()
1326 /* PMA common registers configurations */ in cdns_sierra_phy_configure_multilink()
1327 pma_cmn_vals = init_data->pma_cmn_vals[phy_t1][phy_t2][ssc]; in cdns_sierra_phy_configure_multilink()
1329 reg_pairs = pma_cmn_vals->reg_pairs; in cdns_sierra_phy_configure_multilink()
1330 num_regs = pma_cmn_vals->num_regs; in cdns_sierra_phy_configure_multilink()
1331 regmap = sp->regmap_common_cdb; in cdns_sierra_phy_configure_multilink()
1336 /* PMA lane registers configurations */ in cdns_sierra_phy_configure_multilink()
1337 pma_ln_vals = init_data->pma_ln_vals[phy_t1][phy_t2][ssc]; in cdns_sierra_phy_configure_multilink()
1339 reg_pairs = pma_ln_vals->reg_pairs; in cdns_sierra_phy_configure_multilink()
1340 num_regs = pma_ln_vals->num_regs; in cdns_sierra_phy_configure_multilink()
1342 regmap = sp->regmap_lane_cdb[i + mlane]; in cdns_sierra_phy_configure_multilink()
1349 reset_control_deassert(sp->phys[node].lnk_rst); in cdns_sierra_phy_configure_multilink()
1352 /* Take the PHY out of reset */ in cdns_sierra_phy_configure_multilink()
1353 ret = reset_control_deassert(sp->phy_rst); in cdns_sierra_phy_configure_multilink()
1364 struct device *dev = &pdev->dev; in cdns_sierra_phy_probe()
1369 struct device_node *dn = dev->of_node, *child; in cdns_sierra_phy_probe()
1372 return -ENODEV; in cdns_sierra_phy_probe()
1374 /* Get init data for this PHY */ in cdns_sierra_phy_probe()
1377 return -EINVAL; in cdns_sierra_phy_probe()
1383 return -ENOMEM; in cdns_sierra_phy_probe()
1385 sp->dev = dev; in cdns_sierra_phy_probe()
1386 sp->init_data = data; in cdns_sierra_phy_probe()
1394 ret = cdns_regmap_init_blocks(sp, base, data->block_offset_shift, in cdns_sierra_phy_probe()
1395 data->reg_offset_shift); in cdns_sierra_phy_probe()
1417 regmap_field_read(sp->pma_cmn_ready, &sp->already_configured); in cdns_sierra_phy_probe()
1419 if (!sp->already_configured) { in cdns_sierra_phy_probe()
1429 reset_control_deassert(sp->apb_rst); in cdns_sierra_phy_probe()
1432 /* Check that PHY is present */ in cdns_sierra_phy_probe()
1433 regmap_field_read(sp->macro_id_type, &id_value); in cdns_sierra_phy_probe()
1434 if (sp->init_data->id_value != id_value) { in cdns_sierra_phy_probe()
1435 ret = -EINVAL; in cdns_sierra_phy_probe()
1439 sp->autoconf = of_property_read_bool(dn, "cdns,autoconf"); in cdns_sierra_phy_probe()
1442 struct phy *gphy; in cdns_sierra_phy_probe()
1444 if (!(of_node_name_eq(child, "phy") || in cdns_sierra_phy_probe()
1448 sp->phys[node].lnk_rst = in cdns_sierra_phy_probe()
1451 if (IS_ERR(sp->phys[node].lnk_rst)) { in cdns_sierra_phy_probe()
1453 child->full_name); in cdns_sierra_phy_probe()
1454 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()
1465 reset_control_put(sp->phys[node].lnk_rst); in cdns_sierra_phy_probe()
1470 sp->num_lanes += sp->phys[node].num_lanes; in cdns_sierra_phy_probe()
1472 if (!sp->already_configured) in cdns_sierra_phy_probe()
1479 reset_control_put(sp->phys[node].lnk_rst); in cdns_sierra_phy_probe()
1482 sp->phys[node].phy = gphy; in cdns_sierra_phy_probe()
1483 phy_set_drvdata(gphy, &sp->phys[node]); in cdns_sierra_phy_probe()
1487 sp->nsubnodes = node; in cdns_sierra_phy_probe()
1489 if (sp->num_lanes > SIERRA_MAX_LANES) { in cdns_sierra_phy_probe()
1490 ret = -EINVAL; in cdns_sierra_phy_probe()
1495 /* If more than one subnode, configure the PHY as multilink */ in cdns_sierra_phy_probe()
1496 if (!sp->already_configured && !sp->autoconf && sp->nsubnodes > 1) { in cdns_sierra_phy_probe()
1512 while (--node >= 0) in cdns_sierra_phy_probe()
1513 reset_control_put(sp->phys[node].lnk_rst); in cdns_sierra_phy_probe()
1515 if (!sp->already_configured) in cdns_sierra_phy_probe()
1516 reset_control_assert(sp->apb_rst); in cdns_sierra_phy_probe()
1526 struct cdns_sierra_phy *phy = platform_get_drvdata(pdev); in cdns_sierra_phy_remove() local
1529 reset_control_assert(phy->phy_rst); in cdns_sierra_phy_remove()
1530 reset_control_assert(phy->apb_rst); in cdns_sierra_phy_remove()
1531 pm_runtime_disable(&pdev->dev); in cdns_sierra_phy_remove()
1533 cdns_sierra_phy_disable_clocks(phy); in cdns_sierra_phy_remove()
1538 for (i = 0; i < phy->nsubnodes; i++) { in cdns_sierra_phy_remove()
1539 reset_control_assert(phy->phys[i].lnk_rst); in cdns_sierra_phy_remove()
1540 reset_control_put(phy->phys[i].lnk_rst); in cdns_sierra_phy_remove()
1543 cdns_sierra_clk_unregister(phy); in cdns_sierra_phy_remove()
1546 /* SGMII PHY PMA lane configuration */
1611 /* QSGMII PHY PMA lane configuration */
1677 /* PCIE PHY PCS common configuration */
2426 /* SGMII PHY common configuration */
2451 /* SGMII PHY lane configuration */
2723 .compatible = "cdns,sierra-phy-t0",
2727 .compatible = "ti,sierra-phy-t0",
2738 .name = "cdns-sierra-phy",
2746 MODULE_DESCRIPTION("CDNS sierra phy driver");