linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: Florian Fainelli <f.fainelli@gmail.com>,
	Jens Axboe <axboe@kernel.dk>, Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Kishon Vijay Abraham I <kishon@ti.com>,
	Al Cooper <alcooperx@gmail.com>, Ray Jui <ray.jui@broadcom.com>,
	Tejun Heo <tj@kernel.org>, Fengguang Wu <fengguang.wu@intel.com>,
	Arnd Bergmann <arnd@arndb.de>,
	linux-ide@vger.kernel.org (open list:LIBATA SUBSYSTEM (Serial
	and Parallel ATA drivers)),
	devicetree@vger.kernel.org (open list:OPEN FIRMWARE AND
	FLATTENED DEVICE TREE BINDINGS),
	bcm-kernel-feedback-list@broadcom.com
Subject: [PATCH 5/9] ata: ahci_brcm: Allow optional reset controller to be used
Date: Thu, 20 Sep 2018 12:16:40 -0700	[thread overview]
Message-ID: <20180920191646.18198-7-f.fainelli@gmail.com> (raw)
In-Reply-To: <20180920191646.18198-1-f.fainelli@gmail.com>

On BCM63138, we need to reset the AHCI core prior to start utilizing it,
grab the reset controller device cookie and do that.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/ata/ahci_brcm.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/ata/ahci_brcm.c b/drivers/ata/ahci_brcm.c
index f3d557777d82..d535e87151dc 100644
--- a/drivers/ata/ahci_brcm.c
+++ b/drivers/ata/ahci_brcm.c
@@ -25,6 +25,7 @@
 #include <linux/module.h>
 #include <linux/of.h>
 #include <linux/platform_device.h>
+#include <linux/reset.h>
 #include <linux/string.h>
 
 #include "ahci.h"
@@ -94,6 +95,7 @@ struct brcm_ahci_priv {
 	u32 port_mask;
 	u32 quirks;
 	enum brcm_ahci_version version;
+	struct reset_control *rcdev;
 };
 
 static inline u32 brcm_sata_readreg(void __iomem *addr)
@@ -411,6 +413,10 @@ static int brcm_ahci_probe(struct platform_device *pdev)
 	if (IS_ERR(priv->top_ctrl))
 		return PTR_ERR(priv->top_ctrl);
 
+	priv->rcdev = of_reset_control_get(pdev->dev.of_node, NULL);
+	if (!IS_ERR(priv->rcdev))
+		reset_control_deassert(priv->rcdev);
+
 	if ((priv->version == BRCM_SATA_BCM7425) ||
 		(priv->version == BRCM_SATA_NSP)) {
 		priv->quirks |= BRCM_AHCI_QUIRK_NO_NCQ;
@@ -464,6 +470,9 @@ static int brcm_ahci_remove(struct platform_device *pdev)
 
 	brcm_sata_phys_disable(priv);
 
+	if (!IS_ERR(priv->rcdev))
+		reset_control_assert(priv->rcdev);
+
 	return 0;
 }
 
-- 
2.17.1


  parent reply	other threads:[~2018-09-20 19:17 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-20 19:16 [PATCH 0/9] AHCI and SATA PHY support for BCM63138 Florian Fainelli
2018-09-20 19:16 ` [PATCH 1/9] dt-bindings: phy: Document BCM63138 compatible string Florian Fainelli
2018-09-20 19:16 ` [PATCH 2/9] phy: brcm-sata: allow PHY_BRCM_SATA driver to be built for DSL SoCs Florian Fainelli
2018-09-20 19:16 ` [PATCH 2/9] phy: broadcom: " Florian Fainelli
2018-09-20 19:16 ` [PATCH 3/9] phy: brcm-sata: Add BCM63138 (DSL) PHY init sequence Florian Fainelli
2018-09-20 19:16 ` [PATCH 4/9] dt-bindings: ata: Document BCM63138 compatible string Florian Fainelli
2018-09-20 19:16 ` Florian Fainelli [this message]
2018-09-20 19:16 ` [PATCH 5/9] ata: sata_brcmstb: Allow optional reset controller to be used Florian Fainelli
2018-09-20 19:16 ` [PATCH 6/9] ata: ahci_brcm: Match BCM63138 compatible strings Florian Fainelli
2018-09-20 19:16 ` [PATCH 6/9] ata: ahci_brcmstb: Match 63138 " Florian Fainelli
2018-09-20 19:16 ` [PATCH 7/9] ata: ahci_brcm: Allow using driver or DSL SoCs Florian Fainelli
2018-09-20 19:16 ` [PATCH 8/9] ARM: dts: BCM63xx: enable SATA PHY and AHCI controller Florian Fainelli
2018-10-04 17:22   ` Florian Fainelli
2018-09-20 19:16 ` [PATCH 9/9] ARM: bcm63138: Enable SATA AHCI and PHY Florian Fainelli
2018-10-04 17:23   ` Florian Fainelli
2018-09-20 19:19 ` [PATCH 0/9] AHCI and SATA PHY support for BCM63138 Florian Fainelli
2018-09-25  6:19   ` Kishon Vijay Abraham I
2018-09-25 16:12     ` Florian Fainelli
2018-09-28 22:41       ` Florian Fainelli
2018-09-29  8:56         ` Tejun Heo
2018-09-30  2:35           ` Jens Axboe
2018-09-30  4:22             ` Florian Fainelli

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=20180920191646.18198-7-f.fainelli@gmail.com \
    --to=f.fainelli@gmail.com \
    --cc=alcooperx@gmail.com \
    --cc=arnd@arndb.de \
    --cc=axboe@kernel.dk \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=devicetree@vger.kernel.org \
    --cc=fengguang.wu@intel.com \
    --cc=kishon@ti.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=ray.jui@broadcom.com \
    --cc=robh+dt@kernel.org \
    --cc=tj@kernel.org \
    /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).