From patchwork Mon Apr 21 04:01:42 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 28665 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f71.google.com (mail-qa0-f71.google.com [209.85.216.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 03EC2203AB for ; Mon, 21 Apr 2014 04:03:17 +0000 (UTC) Received: by mail-qa0-f71.google.com with SMTP id j7sf15612591qaq.10 for ; Sun, 20 Apr 2014 21:03:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=H/FbGAeuGFbLcmRqbeBSLRm9R6jD8zPmW2dt5TnQg48=; b=g5p49VFfN8MCbZSWd+LlFnRb8cN4y0L+8TSdS/PbnQy6CpKsNiG2dhbfGSm7Ftwcd3 L2gOZt+r6iHBq++G+FORvL/LZ25DXRSAgQq3s0o+vVCnPOEC7jas3dk+xHBhfJB4Z++p m0HJv3Cp0mifcIlI926Xm2RGS+awkyUFPPfsmQLgT/nPtxeFiY+ibd9X3CAXyvgaxngg hSGop3xPADzuhkO3bhwLtjDHWAIlgQmdX3CQG6iBNj+60nxCiG/YD8jQqAcLrZHQTvwL XEmGXFlD3JPb9Y78Bskw7PokxWdclV/tyCYKWNCEhdxpATwx6RT7YJRtjy7ILG0l4zNa f3AA== X-Gm-Message-State: ALoCoQnk+sDL7RIpSl+z4eF2q3UedfI80XIn/7AFVwh6HaR5zmiSGUEiJvdyYmWanhMH0NT1qkzt X-Received: by 10.236.86.67 with SMTP id v43mr16187103yhe.41.1398052997742; Sun, 20 Apr 2014 21:03:17 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.83.137 with SMTP id j9ls2300666qgd.70.gmail; Sun, 20 Apr 2014 21:03:17 -0700 (PDT) X-Received: by 10.58.202.133 with SMTP id ki5mr27295627vec.19.1398052997648; Sun, 20 Apr 2014 21:03:17 -0700 (PDT) Received: from mail-ve0-f169.google.com (mail-ve0-f169.google.com [209.85.128.169]) by mx.google.com with ESMTPS id tv3si6054019vdc.198.2014.04.20.21.03.17 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 20 Apr 2014 21:03:17 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.169 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.169; Received: by mail-ve0-f169.google.com with SMTP id pa12so7299523veb.0 for ; Sun, 20 Apr 2014 21:03:17 -0700 (PDT) X-Received: by 10.52.78.231 with SMTP id e7mr201361vdx.28.1398052997514; Sun, 20 Apr 2014 21:03:17 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp265188vcb; Sun, 20 Apr 2014 21:03:17 -0700 (PDT) X-Received: by 10.68.220.103 with SMTP id pv7mr15167972pbc.17.1398052995108; Sun, 20 Apr 2014 21:03:15 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id qf4si20087357pbb.180.2014.04.20.21.03.14; Sun, 20 Apr 2014 21:03:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751482AbaDUECu (ORCPT + 26 others); Mon, 21 Apr 2014 00:02:50 -0400 Received: from mail-pb0-f48.google.com ([209.85.160.48]:41578 "EHLO mail-pb0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751231AbaDUECE (ORCPT ); Mon, 21 Apr 2014 00:02:04 -0400 Received: by mail-pb0-f48.google.com with SMTP id md12so3312190pbc.35 for ; Sun, 20 Apr 2014 21:02:03 -0700 (PDT) X-Received: by 10.68.202.194 with SMTP id kk2mr441179pbc.156.1398052923500; Sun, 20 Apr 2014 21:02:03 -0700 (PDT) Received: from localhost.localdomain ([218.17.215.175]) by mx.google.com with ESMTPSA id yo9sm179742023pab.16.2014.04.20.21.01.58 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 20 Apr 2014 21:02:02 -0700 (PDT) From: Kefeng Wang To: Tejun Heo Cc: Hans de Goede , linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org, wangkefeng.wang@huawei.com Subject: [PATCH v3 2/2] ahci: add support for Hisilicon sata Date: Mon, 21 Apr 2014 12:01:42 +0800 Message-Id: <1398052903-10322-3-git-send-email-kefeng.wang@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1398052903-10322-1-git-send-email-kefeng.wang@linaro.org> References: <1398052903-10322-1-git-send-email-kefeng.wang@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: kefeng.wang@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.169 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , The hip04 SoC of hisilicon has an AHCI compliant SATA controller, and it is compliant with the ahci 1.3 and sata 3.0 specification. There is a wrong bit in HOST_CAP of hip04 sata controller, which enable unsupported feature of FBS, use AHCI_HFLAG_NO_FBS hflag to disable it. Cc: Hans de Geode Signed-off-by: Kefeng Wang --- .../devicetree/bindings/ata/ahci-platform.txt | 3 ++- drivers/ata/ahci_platform.c | 10 ++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Documentation/devicetree/bindings/ata/ahci-platform.txt b/Documentation/devicetree/bindings/ata/ahci-platform.txt index 48b285f..aab1d70 100644 --- a/Documentation/devicetree/bindings/ata/ahci-platform.txt +++ b/Documentation/devicetree/bindings/ata/ahci-platform.txt @@ -7,7 +7,8 @@ Required properties: - compatible : compatible list, one of "snps,spear-ahci", "snps,exynos5440-ahci", "ibm,476gtr-ahci", "allwinner,sun4i-a10-ahci", "fsl,imx53-ahci" - "fsl,imx6q-ahci" or "snps,dwc-ahci" + "fsl,imx6q-ahci", "snps,dwc-ahci" or + "hisilicon,hisi-ahci" - interrupts : - reg : diff --git a/drivers/ata/ahci_platform.c b/drivers/ata/ahci_platform.c index ef67e79..48b9feb 100644 --- a/drivers/ata/ahci_platform.c +++ b/drivers/ata/ahci_platform.c @@ -17,11 +17,12 @@ #include #include #include +#include #include #include #include "ahci.h" -static const struct ata_port_info ahci_port_info = { +static struct ata_port_info ahci_port_info = { .flags = AHCI_FLAG_COMMON, .pio_mask = ATA_PIO4, .udma_mask = ATA_UDMA6, @@ -32,6 +33,7 @@ static int ahci_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct ahci_platform_data *pdata = dev_get_platdata(dev); + struct ata_port_info *pi = &ahci_port_info; struct ahci_host_priv *hpriv; int rc; @@ -55,7 +57,10 @@ static int ahci_probe(struct platform_device *pdev) goto disable_resources; } - rc = ahci_platform_init_host(pdev, hpriv, &ahci_port_info, 0, 0); + if (of_device_is_compatible(dev->of_node, "hisilicon,hisi-ahci")) + pi->private_data = (void *)AHCI_HFLAG_NO_FBS; + + rc = ahci_platform_init_host(pdev, hpriv, pi, 0, 0); if (rc) goto pdata_exit; @@ -76,6 +81,7 @@ static const struct of_device_id ahci_of_match[] = { { .compatible = "snps,exynos5440-ahci", }, { .compatible = "ibm,476gtr-ahci", }, { .compatible = "snps,dwc-ahci", }, + { .compatible = "hisilicon,hisi-ahci", }, {}, }; MODULE_DEVICE_TABLE(of, ahci_of_match);