From patchwork Fri Apr 25 08:59:11 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 29036 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f200.google.com (mail-pd0-f200.google.com [209.85.192.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 7DB56202E6 for ; Fri, 25 Apr 2014 09:01:10 +0000 (UTC) Received: by mail-pd0-f200.google.com with SMTP id v10sf6845885pde.3 for ; Fri, 25 Apr 2014 02:01:09 -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=kgdh3XUTw0ND+fZ0Xq1QN7Vgtx6pDGdxsIjECPOce0U=; b=LI46OD0dfuBJJn1u1MnYrElBPE7D9iDXXMYOayka3jHNh0D2JBohg91nRymXbAyOOn KOZXZObHDOhqpeCVO1BtHX68RWcEiSC96ZTw3YRxUADROnx1zqCOhu/0IMsP9zdCGQKN YUwck2TonBvYsIoEtFgUugomio247oJAu3T+zo6pwbLzFaxIzf+ODOHWKkDBJvIJXJPy UXeK1S8POyWwGpHiMZllHqD2jhivt8O0u2O4op09KZe1HDa7IosjpqtEL/Cd3pu0btty gsbLl4Mxu6BJZhZPq3AzXFnwzXoEKqxoz4t8MHyissCynthbM1yE14ntjkodNeNLsyfk 5kuA== X-Gm-Message-State: ALoCoQnsUAhcXtpkojATSJXU7Sd5IyfYrLTCjTz/xJNyeOEHHbaeQjWjxa9tFzd3NrqQOocS47+Q X-Received: by 10.66.189.163 with SMTP id gj3mr2658866pac.32.1398416469705; Fri, 25 Apr 2014 02:01:09 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.84.149 with SMTP id l21ls1244195qgd.81.gmail; Fri, 25 Apr 2014 02:01:09 -0700 (PDT) X-Received: by 10.52.3.129 with SMTP id c1mr186909vdc.37.1398416469523; Fri, 25 Apr 2014 02:01:09 -0700 (PDT) Received: from mail-vc0-f174.google.com (mail-vc0-f174.google.com [209.85.220.174]) by mx.google.com with ESMTPS id tm8si1552928vdc.206.2014.04.25.02.01.09 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 25 Apr 2014 02:01:09 -0700 (PDT) Received-SPF: none (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) client-ip=209.85.220.174; Received: by mail-vc0-f174.google.com with SMTP id ld13so4330934vcb.19 for ; Fri, 25 Apr 2014 02:01:09 -0700 (PDT) X-Received: by 10.52.108.164 with SMTP id hl4mr4830340vdb.25.1398416469437; Fri, 25 Apr 2014 02:01:09 -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 ib8csp81402vcb; Fri, 25 Apr 2014 02:01:08 -0700 (PDT) X-Received: by 10.68.240.99 with SMTP id vz3mr6192464pbc.93.1398416467962; Fri, 25 Apr 2014 02:01:07 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id qd9si4369473pac.269.2014.04.25.02.01.07 for ; Fri, 25 Apr 2014 02:01:07 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752721AbaDYJAw (ORCPT + 28 others); Fri, 25 Apr 2014 05:00:52 -0400 Received: from mail-pd0-f174.google.com ([209.85.192.174]:61400 "EHLO mail-pd0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752575AbaDYJAg (ORCPT ); Fri, 25 Apr 2014 05:00:36 -0400 Received: by mail-pd0-f174.google.com with SMTP id z10so2130336pdj.33 for ; Fri, 25 Apr 2014 02:00:35 -0700 (PDT) X-Received: by 10.66.253.33 with SMTP id zx1mr6409068pac.28.1398416435808; Fri, 25 Apr 2014 02:00:35 -0700 (PDT) Received: from localhost.localdomain ([218.17.215.175]) by mx.google.com with ESMTPSA id ko10sm14443967pbd.0.2014.04.25.02.00.30 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 25 Apr 2014 02:00:35 -0700 (PDT) From: Kefeng Wang To: Tejun Heo , Hans de Goede , Maxime Ripard , linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org Cc: wangkefeng.wang@huawei.com, kefeng.wang@linaro.org, xuwei5@hisilicon.com Subject: [PATCH v6 3/3] ahci: add support for Hisilicon sata Date: Fri, 25 Apr 2014 16:59:11 +0800 Message-Id: <1398416351-30567-4-git-send-email-kefeng.wang@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1398416351-30567-1-git-send-email-kefeng.wang@linaro.org> References: <1398416351-30567-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: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) 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. Signed-off-by: Kefeng Wang --- .../devicetree/bindings/ata/ahci-platform.txt | 3 ++- drivers/ata/ahci_platform.c | 9 ++++++++- 2 files changed, 10 insertions(+), 2 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 a476a1f..ebe505c 100644 --- a/drivers/ata/ahci_platform.c +++ b/drivers/ata/ahci_platform.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -33,6 +34,7 @@ static int ahci_probe(struct platform_device *pdev) struct device *dev = &pdev->dev; struct ahci_platform_data *pdata = dev_get_platdata(dev); struct ahci_host_priv *hpriv; + unsigned long hflags = 0; int rc; hpriv = ahci_platform_get_resources(pdev); @@ -55,7 +57,11 @@ static int ahci_probe(struct platform_device *pdev) goto disable_resources; } - rc = ahci_platform_init_host(pdev, hpriv, &ahci_port_info, 0, 0, 0); + if (of_device_is_compatible(dev->of_node, "hisilicon,hisi-ahci")) + hflags |= AHCI_HFLAG_NO_FBS; + + rc = ahci_platform_init_host(pdev, hpriv, &ahci_port_info, + hflags, 0, 0); if (rc) goto pdata_exit; @@ -76,6 +82,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);