From patchwork Thu Mar 31 17:31:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 64807 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp285765lbc; Thu, 31 Mar 2016 10:32:34 -0700 (PDT) X-Received: by 10.98.71.156 with SMTP id p28mr23756886pfi.139.1459445552612; Thu, 31 Mar 2016 10:32:32 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p73si15306883pfi.213.2016.03.31.10.32.32; Thu, 31 Mar 2016 10:32:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757434AbcCaRca (ORCPT + 8 others); Thu, 31 Mar 2016 13:32:30 -0400 Received: from mail-wm0-f47.google.com ([74.125.82.47]:37116 "EHLO mail-wm0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757961AbcCaRb6 (ORCPT ); Thu, 31 Mar 2016 13:31:58 -0400 Received: by mail-wm0-f47.google.com with SMTP id p65so123706414wmp.0 for ; Thu, 31 Mar 2016 10:31:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=pC3rrvf2m/KfJ6p+8ScqH9Voqa44OjGREwmPOQs/fn0=; b=hJWpVWdjlwy5tKdU5l9ObLFUlKeYoMJitTXe4ouNUdHF+BxvdfAeMIgyN4y2lHOTfo V5OyAULukSxCRCdKBob61/xp9YeDlN1IbhrMyOkWXlrzKYRxq5MWLC6ceOeHrm0e+RNn EY7RCHADTE8A8E/cQTK69GKJ4WLmPxb6fF5iM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=pC3rrvf2m/KfJ6p+8ScqH9Voqa44OjGREwmPOQs/fn0=; b=cMK8nCRJIE/F/3quYjHjwWZ0UFkUUvWatFrS55OamnsHtjZCH613awhNEW6MDstOSK swlzWlpZf5AYV1ZfV+zXDYvf2fC1kewaxX6zbCtBIDtCiwcIfn4VnP+/YcC2sImXxZgu oYEQ7dKxR74Ty0TQ0ke7Kn0fNa7LN38QIZqaJcHr3JOA43V6xDwT43+W+tfKsd9EvwW6 nJc9S2Vw755Z8/LhS9wLKhPXjlO3mN0wR5ZyugCYQDTJ2lMXzqlu9UpgvOkw36i7sxWy qFeH+yV20Ql59ebXmmIjUIiibSc8MHGO4nlVa9w/+d+Zi8Y9QKiFqy61wpt7JJ7nFdjI 5FGw== X-Gm-Message-State: AD7BkJL/PmDe4Y6zKuuUSyy1nrOUkSKpX+cx1gIefvLxBZVaSLRgnvPjLicoSV9kUCr3lYmt X-Received: by 10.28.3.138 with SMTP id 132mr145741wmd.20.1459445516248; Thu, 31 Mar 2016 10:31:56 -0700 (PDT) Received: from localhost.localdomain (host-92-17-247-99.as13285.net. [92.17.247.99]) by smtp.gmail.com with ESMTPSA id gb9sm10024236wjb.26.2016.03.31.10.31.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 31 Mar 2016 10:31:55 -0700 (PDT) From: Srinivas Kandagatla To: Tejun Heo , linux-ide@vger.kernel.org Cc: Rob Herring , Andy Gross , Hans de Goede , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, jmaggard10@gmail.com, Srinivas Kandagatla Subject: [PATCH v2 2/3] ata: ahci-platform: Add ports-implemented DT bindings. Date: Thu, 31 Mar 2016 18:31:39 +0100 Message-Id: <1459445500-9071-3-git-send-email-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1459445500-9071-1-git-send-email-srinivas.kandagatla@linaro.org> References: <1459445500-9071-1-git-send-email-srinivas.kandagatla@linaro.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org On some SOCs PORTS_IMPL register value is never programmed by the firmware and left at zero value. Which means that no sata ports are available for software. AHCI driver used to cope up with this by fabricating the port_map if the PORTS_IMPL register is read zero, but recent patch broke this workaround as zero value was valid for NVMe disks. This patch adds ports-implemented DT bindings as workaround for this issue in a way that DT can can override the PORTS_IMPL register in cases where the firmware did not program it already. Fixes: 566d1827df2e ("libata: disable forced PORTS_IMPL for >= AHCI 1.3) Signed-off-by: Srinivas Kandagatla --- Documentation/devicetree/bindings/ata/ahci-platform.txt | 4 ++++ drivers/ata/ahci_platform.c | 3 +++ 2 files changed, 7 insertions(+) -- 2.5.0 -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/Documentation/devicetree/bindings/ata/ahci-platform.txt b/Documentation/devicetree/bindings/ata/ahci-platform.txt index 30df832..87adfb2 100644 --- a/Documentation/devicetree/bindings/ata/ahci-platform.txt +++ b/Documentation/devicetree/bindings/ata/ahci-platform.txt @@ -32,6 +32,10 @@ Optional properties: - target-supply : regulator for SATA target power - phys : reference to the SATA PHY node - phy-names : must be "sata-phy" +- ports-implemented : Mask that indicates which ports that the HBA supports + are available for software to use. Useful if PORTS_IMPL + is not programmed by the BIOS, which is true with + some embedded SOC's. Required properties when using sub-nodes: - #address-cells : number of cells to encode an address diff --git a/drivers/ata/ahci_platform.c b/drivers/ata/ahci_platform.c index 4044233..62a04c8 100644 --- a/drivers/ata/ahci_platform.c +++ b/drivers/ata/ahci_platform.c @@ -51,6 +51,9 @@ static int ahci_probe(struct platform_device *pdev) if (rc) return rc; + of_property_read_u32(dev->of_node, + "ports-implemented", &hpriv->force_port_map); + if (of_device_is_compatible(dev->of_node, "hisilicon,hisi-ahci")) hpriv->flags |= AHCI_HFLAG_NO_FBS | AHCI_HFLAG_NO_NCQ;