From: Suman Tripathi <stripathi@apm.com>
To: olof@lixom.net, tj@kernel.org, arnd@arndb.de
Cc: linux-scsi@vger.kernel.org, linux-ide@vger.kernel.org,
devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
mlangsdo@redhat.com, jcm@redhat.com, patches@apm.com,
Suman Tripathi <stripathi@apm.com>
Subject: [PATCH v1] ata: ahci_xgene: Add AHCI Support for second generation of APM X-Gene SoC
Date: Wed, 1 Apr 2015 20:18:02 +0530 [thread overview]
Message-ID: <1427899682-10912-2-git-send-email-stripathi@apm.com> (raw)
In-Reply-To: <1427899682-10912-1-git-send-email-stripathi@apm.com>
This patch enables full AHCI feature support for APM X-Gene SoC SATA host host
controller. The following errata's are removed:
1. 2a0bdff6b95 ("ahci-xgene: fix the dma state machine lockup for the
IDENTIFY DEVICE PIO mode command")
2. 09c32aaa368 ("ahci_xgene: Fix the dma state machine lockup for the
ATA_CMD_SMART PIO mode command")
3. 1540035da71 ("ahci_xgene: Implement the xgene_ahci_poll_reg_val to
support PMP")
4. a3a84bc7c88 ("ahci_xgene: Implement the workaround to support PMP
enumeration and discovery")
5. 1102407bb71 ("ahci_xgene: Fix the DMA state machine lockup for the
ATA_CMD_PACKET PIO mode command")
6. 72f79f9e35b ("ahci_xgene: Removing NCQ support from the APM X-Gene SoC
AHCI SATA Host Controller driver")
In addition, enable PMP support for second generation APM X-Gene SoC.
Signed-off-by : Suman Tripathi <stripathi@apm.com>
---
drivers/ata/ahci_xgene.c | 21 ++++++++++++++++++++-
1 file changed, 20 insertions(+), 1 deletion(-)
diff --git a/drivers/ata/ahci_xgene.c b/drivers/ata/ahci_xgene.c
index 2e8bb60..0be47b0 100644
--- a/drivers/ata/ahci_xgene.c
+++ b/drivers/ata/ahci_xgene.c
@@ -28,6 +28,8 @@
#include <linux/of_address.h>
#include <linux/of_irq.h>
#include <linux/phy/phy.h>
+#include <asm/cputype.h>
+
#include "ahci.h"
#define DRV_NAME "xgene-ahci"
@@ -94,6 +96,11 @@ struct xgene_ahci_context {
void __iomem *csr_mux; /* MUX CSR address of IP */
};
+static bool xgene_ahci_version1(void)
+{
+ return MIDR_VARIANT(read_cpuid_id()) == 0 ? true : false;
+}
+
static int xgene_ahci_init_memram(struct xgene_ahci_context *ctx)
{
dev_dbg(ctx->dev, "Release memory from shutdown\n");
@@ -703,7 +710,19 @@ static int xgene_ahci_probe(struct platform_device *pdev)
/* Configure the host controller */
xgene_ahci_hw_init(hpriv);
skip_clk_phy:
- hpriv->flags = AHCI_HFLAG_NO_PMP | AHCI_HFLAG_NO_NCQ;
+
+ if (xgene_ahci_version1()) {
+ /*
+ * Override the callbacks due to
+ * XGENE1 ERRATA's.
+ */
+ hpriv->flags |= AHCI_HFLAG_NO_NCQ;
+ xgene_ahci_ops.qc_issue = xgene_ahci_qc_issue;
+ xgene_ahci_ops.softreset = xgene_ahci_softreset;
+ xgene_ahci_ops.pmp_softreset = xgene_ahci_pmp_softreset;
+ } else {
+ hpriv->flags |= AHCI_HFLAG_YES_FBS;
+ }
rc = ahci_platform_init_host(pdev, hpriv, &xgene_ahci_port_info,
&ahci_platform_sht);
--
1.8.2.1
next prev parent reply other threads:[~2015-04-01 14:48 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-01 14:48 [PATCH v1] ata: ahci_xgene: Enable native NCQ and FBS for second generation of X-Gene SoC Suman Tripathi
2015-04-01 14:48 ` Suman Tripathi [this message]
2015-04-01 16:13 ` [PATCH v1] ata: ahci_xgene: Add AHCI Support for second generation of APM " Tejun Heo
2015-04-01 16:31 ` Tejun Heo
2015-04-01 16:37 ` Suman Tripathi
[not found] ` <20150401163116.GT9974-piEFEHQLUPpN0TnZuCh8vA@public.gmane.org>
2015-04-01 16:39 ` Russell King - ARM Linux
2015-04-01 16:47 ` Tejun Heo
[not found] ` <20150401163956.GE24899-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2015-04-01 17:00 ` Catalin Marinas
[not found] ` <20150401170032.GC28616-M2fw3Uu6cmfZROr8t4l/smS4ubULX0JqMm0uRHvK7Nw@public.gmane.org>
2015-04-01 17:07 ` Mark Rutland
2015-04-01 17:30 ` Russell King - ARM Linux
2015-04-01 18:18 ` Catalin Marinas
2015-04-01 18:28 ` Mark Rutland
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=1427899682-10912-2-git-send-email-stripathi@apm.com \
--to=stripathi@apm.com \
--cc=arnd@arndb.de \
--cc=devicetree@vger.kernel.org \
--cc=jcm@redhat.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-ide@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=mlangsdo@redhat.com \
--cc=olof@lixom.net \
--cc=patches@apm.com \
--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).