From: Corentin Labbe <clabbe.montjoie@gmail.com>
To: axboe@kernel.dk, hdegoede@redhat.com, kishon@ti.com,
mark.rutland@arm.com, maxime.ripard@bootlin.com,
robh+dt@kernel.org, wens@csie.org, clabbe.montjoie@gmail.com
Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-sunxi@googlegroups.com
Subject: [PATCH v4 07/13] ata: ahci_sunxi: Bypass PHY init when using the new binding
Date: Thu, 30 Aug 2018 21:01:14 +0200 [thread overview]
Message-ID: <20180830190120.722-8-clabbe.montjoie@gmail.com> (raw)
In-Reply-To: <20180830190120.722-1-clabbe.montjoie@gmail.com>
The new binding split sata in two (ahci + PHY).
ahci_sunxi must not mess with PHY when the new binding is in use.
So when we detect sub-nodes, bypass the PHY init code.
This is a temporarly workaround for the period where DT and ata code
will be merged from separate tree.
When both new binding and PHY driver will be merged, a new patch which
remove all PHY code from ahci_sunxi.c will be sent.
Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
---
drivers/ata/ahci_sunxi.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/ata/ahci_sunxi.c b/drivers/ata/ahci_sunxi.c
index 631610b72aa5..a09d189c6dda 100644
--- a/drivers/ata/ahci_sunxi.c
+++ b/drivers/ata/ahci_sunxi.c
@@ -96,6 +96,15 @@ static int ahci_sunxi_phy_init(struct device *dev, void __iomem *reg_base)
u32 reg_val;
int timeout;
+ /*
+ * When using the new binding, the presence of a sata port node
+ * means that PHY is handled by the PHY driver.
+ * */
+ if (of_get_child_count(dev->of_node)) {
+ dev_info(dev, "Bypassing PHY init\n");
+ return 0;
+ }
+
/* This magic is from the original code */
writel(0, reg_base + AHCI_RWCR);
msleep(5);
--
2.16.4
next prev parent reply other threads:[~2018-08-30 19:01 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-30 19:01 [PATCH v4 00/13] ata: ahci_platform: support allwinner R40 AHCI Corentin Labbe
2018-08-30 19:01 ` [PATCH v4 01/13] dt-bindings: ata: ahci-platform: fix indentation of target-supply Corentin Labbe
2018-08-30 19:01 ` [PATCH v4 02/13] ata: ahci_platform: add support for AHCI controller regulator Corentin Labbe
2018-08-30 19:01 ` [PATCH v4 03/13] dt-bindings: ata: ahci-platform: document ahci-supply Corentin Labbe
2018-08-30 19:01 ` [PATCH v4 04/13] phy: Add sun4i-a10-phy-sata driver Corentin Labbe
2018-08-30 19:01 ` [PATCH v4 05/13] dt-bindings: phy: document sun4i-a10-sata-phy Corentin Labbe
2018-08-30 19:01 ` [PATCH v4 06/13] dt-bindings: ata: update ahci_sunxi bindings Corentin Labbe
2018-08-30 19:01 ` Corentin Labbe [this message]
2018-08-30 19:01 ` [PATCH v4 08/13] ata: ahci_sunxi: add support for r40 Corentin Labbe
2018-08-30 19:01 ` [PATCH v4 09/13] ARM: dts: sun8i: r40: add sata node Corentin Labbe
2018-08-31 7:35 ` Maxime Ripard
2018-08-31 7:56 ` Corentin Labbe
2018-08-31 7:58 ` Chen-Yu Tsai
2018-08-31 9:29 ` Corentin Labbe
2018-08-31 11:10 ` Chen-Yu Tsai
2018-08-31 12:57 ` Icenowy Zheng
2018-08-31 10:20 ` maxime.ripard
2018-08-31 10:54 ` Corentin Labbe
2018-08-31 11:31 ` Chen-Yu Tsai
2018-08-31 12:08 ` Corentin Labbe
2018-08-31 12:58 ` Icenowy Zheng
2018-08-30 19:01 ` [PATCH v4 10/13] ARM: dts: sun8i: sun8i-r40-bananapi-m2-ultra: enable AHCI Corentin Labbe
2018-08-30 19:01 ` [PATCH v4 11/13] ARM: dts: sun7i: a20: add sata-port/sata-phy nodes Corentin Labbe
2018-08-30 19:01 ` [PATCH v4 12/13] ARM: dts: sun4i: a10: " Corentin Labbe
2018-08-31 7:37 ` Maxime Ripard
2018-08-31 7:53 ` Corentin Labbe
2018-08-31 10:21 ` Maxime Ripard
2018-08-30 19:01 ` [PATCH v4 13/13 DONOTMERGE] ata: ahci_sunxi: remove PHY code Corentin Labbe
2018-08-30 20:27 ` Hans de Goede
2018-08-30 20:24 ` [PATCH v4 00/13] ata: ahci_platform: support allwinner R40 AHCI Hans de Goede
2018-08-30 20:31 ` Jens Axboe
2018-08-31 2:32 ` Chen-Yu Tsai
2018-08-31 2:52 ` Jens Axboe
2018-08-31 7:40 ` Maxime Ripard
2018-08-31 14:35 ` Jens Axboe
2018-09-03 8:31 ` Maxime Ripard
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=20180830190120.722-8-clabbe.montjoie@gmail.com \
--to=clabbe.montjoie@gmail.com \
--cc=axboe@kernel.dk \
--cc=devicetree@vger.kernel.org \
--cc=hdegoede@redhat.com \
--cc=kishon@ti.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sunxi@googlegroups.com \
--cc=mark.rutland@arm.com \
--cc=maxime.ripard@bootlin.com \
--cc=robh+dt@kernel.org \
--cc=wens@csie.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
all inboxes | Powered by JetHome®