From: Swapnil Jakhade <sjakhade@cadence.com>
To: <vkoul@kernel.org>, <kishon@ti.com>, <robh+dt@kernel.org>,
<p.zabel@pengutronix.de>, <linux-kernel@vger.kernel.org>,
<devicetree@vger.kernel.org>
Cc: <mparab@cadence.com>, <sjakhade@cadence.com>,
<yamonkar@cadence.com>, <tomi.valkeinen@ti.com>, <jsarha@ti.com>,
<nsekhar@ti.com>
Subject: [PATCH v3 03/13] phy: cadence-torrent: Add PHY APB reset support
Date: Thu, 17 Sep 2020 09:30:36 +0200 [thread overview]
Message-ID: <1600327846-9733-4-git-send-email-sjakhade@cadence.com> (raw)
In-Reply-To: <1600327846-9733-1-git-send-email-sjakhade@cadence.com>
Add support for PHY APB reset and make it optional.
Signed-off-by: Swapnil Jakhade <sjakhade@cadence.com>
---
drivers/phy/cadence/phy-cadence-torrent.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/drivers/phy/cadence/phy-cadence-torrent.c b/drivers/phy/cadence/phy-cadence-torrent.c
index 9e900f389b08..1d0c9bb7cfa0 100644
--- a/drivers/phy/cadence/phy-cadence-torrent.c
+++ b/drivers/phy/cadence/phy-cadence-torrent.c
@@ -228,6 +228,7 @@ struct cdns_torrent_phy {
void __iomem *sd_base; /* SD0801 registers base */
u32 max_bit_rate; /* Maximum link bit rate to use (in Mbps) */
struct reset_control *phy_rst;
+ struct reset_control *apb_rst;
struct device *dev;
struct clk *clk;
unsigned long ref_clk_rate;
@@ -1883,6 +1884,13 @@ static int cdns_torrent_phy_probe(struct platform_device *pdev)
return PTR_ERR(cdns_phy->phy_rst);
}
+ cdns_phy->apb_rst = devm_reset_control_get_optional(dev, "torrent_apb");
+ if (IS_ERR(cdns_phy->apb_rst)) {
+ dev_err(dev, "%s: failed to get apb reset\n",
+ dev->of_node->full_name);
+ return PTR_ERR(cdns_phy->apb_rst);
+ }
+
cdns_phy->clk = devm_clk_get(dev, "refclk");
if (IS_ERR(cdns_phy->clk)) {
dev_err(dev, "phy ref clock not found\n");
@@ -1907,6 +1915,9 @@ static int cdns_torrent_phy_probe(struct platform_device *pdev)
if (ret)
return ret;
+ /* Enable APB */
+ reset_control_deassert(cdns_phy->apb_rst);
+
for_each_available_child_of_node(dev->of_node, child) {
struct phy *gphy;
@@ -2059,6 +2070,7 @@ static int cdns_torrent_phy_probe(struct platform_device *pdev)
for (i = 0; i < node; i++)
reset_control_put(cdns_phy->phys[i].lnk_rst);
of_node_put(child);
+ reset_control_assert(cdns_phy->apb_rst);
return ret;
}
@@ -2068,6 +2080,7 @@ static int cdns_torrent_phy_remove(struct platform_device *pdev)
int i;
reset_control_assert(cdns_phy->phy_rst);
+ reset_control_assert(cdns_phy->apb_rst);
for (i = 0; i < cdns_phy->nsubnodes; i++) {
reset_control_assert(cdns_phy->phys[i].lnk_rst);
reset_control_put(cdns_phy->phys[i].lnk_rst);
--
2.26.1
next prev parent reply other threads:[~2020-09-17 8:28 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-17 7:30 [PATCH v3 00/13] PHY: Add support for multilink configurations in Cadence Torrent PHY driver Swapnil Jakhade
2020-09-17 7:30 ` [PATCH v3 01/13] phy: cadence-torrent: Add single link PCIe support Swapnil Jakhade
2020-09-17 7:30 ` [PATCH v3 02/13] phy: cadence-torrent: Check cmn_ready assertion during PHY power on Swapnil Jakhade
2020-09-17 7:30 ` Swapnil Jakhade [this message]
2020-09-17 7:30 ` [PATCH v3 04/13] dt-bindings: phy: Add PHY_TYPE_QSGMII definition Swapnil Jakhade
2020-09-17 7:30 ` [PATCH v3 05/13] phy: cadence-torrent: Add support for PHY multilink configuration Swapnil Jakhade
2020-09-17 7:30 ` [PATCH v3 06/13] phy: cadence-torrent: Update PHY reset for " Swapnil Jakhade
2020-09-17 7:30 ` [PATCH v3 07/13] phy: cadence-torrent: Add clk changes " Swapnil Jakhade
2020-09-17 7:30 ` [PATCH v3 08/13] phy: cadence-torrent: Add PHY link configuration sequences for single link Swapnil Jakhade
2020-09-17 7:30 ` [PATCH v3 09/13] phy: cadence-torrent: Configure PHY_PLL_CFG as part of link_cmn_vals Swapnil Jakhade
2020-09-17 7:30 ` [PATCH v3 10/13] phy: cadence-torrent: Add single link SGMII/QSGMII register sequences Swapnil Jakhade
2020-09-17 7:30 ` [PATCH v3 11/13] phy: cadence-torrent: Add single link USB " Swapnil Jakhade
2020-09-17 7:30 ` [PATCH v3 12/13] phy: cadence-torrent: Add PCIe + USB multilink configuration Swapnil Jakhade
2020-09-17 7:30 ` [PATCH v3 13/13] phy: cadence-torrent: Add USB + SGMII/QSGMII " Swapnil Jakhade
2020-09-18 5:17 ` [PATCH v3 00/13] PHY: Add support for multilink configurations in Cadence Torrent PHY driver Vinod Koul
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1600327846-9733-4-git-send-email-sjakhade@cadence.com \
--to=sjakhade@cadence.com \
--cc=devicetree@vger.kernel.org \
--cc=jsarha@ti.com \
--cc=kishon@ti.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mparab@cadence.com \
--cc=nsekhar@ti.com \
--cc=p.zabel@pengutronix.de \
--cc=robh+dt@kernel.org \
--cc=tomi.valkeinen@ti.com \
--cc=vkoul@kernel.org \
--cc=yamonkar@cadence.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).