Commit 84f55df8 authored by Swapnil Jakhade's avatar Swapnil Jakhade Committed by Vinod Koul

phy: cadence-torrent: Add debug information for PHY configuration

Add debug information in probe regarding PHY configuration parameters
like single link or multilink protocol along with number of lanes
used for each protocol link.
Signed-off-by: default avatarSwapnil Jakhade <sjakhade@cadence.com>
Link: https://lore.kernel.org/r/20210728145454.15945-9-sjakhade@cadence.comSigned-off-by: default avatarVinod Koul <vkoul@kernel.org>
parent 8f3ced2f
......@@ -573,6 +573,24 @@ static const struct coefficients vltg_coeff[4][4] = {
}
};
static const char *cdns_torrent_get_phy_type(enum cdns_torrent_phy_type phy_type)
{
switch (phy_type) {
case TYPE_DP:
return "DisplayPort";
case TYPE_PCIE:
return "PCIe";
case TYPE_SGMII:
return "SGMII";
case TYPE_QSGMII:
return "QSGMII";
case TYPE_USB:
return "USB";
default:
return "None";
}
}
/*
* Set registers responsible for enabling and configuring SSC, with second and
* third register values provided by parameters.
......@@ -2392,10 +2410,9 @@ static int cdns_torrent_phy_probe(struct platform_device *pdev)
init_dp_regmap++;
}
dev_info(dev, "%d lanes, max bit rate %d.%03d Gbps\n",
cdns_phy->phys[node].num_lanes,
cdns_phy->max_bit_rate / 1000,
cdns_phy->max_bit_rate % 1000);
dev_dbg(dev, "DP max bit rate %d.%03d Gbps\n",
cdns_phy->max_bit_rate / 1000,
cdns_phy->max_bit_rate % 1000);
gphy->attrs.bus_width = cdns_phy->phys[node].num_lanes;
gphy->attrs.max_link_rate = cdns_phy->max_bit_rate;
......@@ -2427,6 +2444,17 @@ static int cdns_torrent_phy_probe(struct platform_device *pdev)
goto put_lnk_rst;
}
if (cdns_phy->nsubnodes > 1)
dev_dbg(dev, "Multi-link: %s (%d lanes) & %s (%d lanes)",
cdns_torrent_get_phy_type(cdns_phy->phys[0].phy_type),
cdns_phy->phys[0].num_lanes,
cdns_torrent_get_phy_type(cdns_phy->phys[1].phy_type),
cdns_phy->phys[1].num_lanes);
else
dev_dbg(dev, "Single link: %s (%d lanes)",
cdns_torrent_get_phy_type(cdns_phy->phys[0].phy_type),
cdns_phy->phys[0].num_lanes);
return 0;
put_child:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment