linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anurag Kumar Vulisha <anurag.kumar.vulisha@xilinx.com>
To: <robh+dt@kernel.org>, <pawel.moll@arm.com>,
	<mark.rutland@arm.com>, <ijc+devicetree@hellion.org.uk>,
	<galak@codeaurora.org>, <tj@kernel.org>
Cc: <devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<linux-ide@vger.kernel.org>, <anirudh@xilinx.com>,
	<svemula@xilinx.com>, <punnaia@xilinx.com>,
	Anurag Kumar Vulisha <anuragku@xilinx.com>
Subject: [RFC PATCH] drivers: ata: Read Rx water mark value from device-tree
Date: Sat, 20 Feb 2016 18:48:22 +0530	[thread overview]
Message-ID: <1455974302-7082-1-git-send-email-anuragku@xilinx.com> (raw)

This patch updates the driver to read the RX FIFO watermark value
from device tree. This read value is used by the driver for programming
FIFO RxWaterMark level, which sets the minimum number of free
locations within the RX FIFO.When the rx fifo level crosses the
programmed watermark level, sata controller will transmit HOLDS to
the device asking it to wait.

Signed-off-by: Anurag Kumar Vulisha <anuragku@xilinx.com>
---
 .../devicetree/bindings/ata/ahci-ceva.txt          |    2 ++
 drivers/ata/ahci_ceva.c                            |   10 +++++++++-
 2 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/Documentation/devicetree/bindings/ata/ahci-ceva.txt b/Documentation/devicetree/bindings/ata/ahci-ceva.txt
index 7ca8b97..7e48dfc 100644
--- a/Documentation/devicetree/bindings/ata/ahci-ceva.txt
+++ b/Documentation/devicetree/bindings/ata/ahci-ceva.txt
@@ -8,6 +8,7 @@ Required properties:
 
 Optional properties:
   - ceva,broken-gen2: limit to gen1 speed instead of gen2.
+  - ceva,rx-watermark: RX fifo water mark level for SATA controller.
 
 Examples:
 	ahci@fd0c0000 {
@@ -17,4 +18,5 @@ Examples:
 		interrupts = <0 133 4>;
 		clocks = <&clkc SATA_CLK_ID>;
 		ceva,broken-gen2;
+		ceva,rx-watermark = <0x40>;
 	};
diff --git a/drivers/ata/ahci_ceva.c b/drivers/ata/ahci_ceva.c
index 207649d..ea01f7d 100644
--- a/drivers/ata/ahci_ceva.c
+++ b/drivers/ata/ahci_ceva.c
@@ -88,6 +88,7 @@
 struct ceva_ahci_priv {
 	struct platform_device *ahci_pdev;
 	int flags;
+	u32 rx_watermark;
 };
 
 static struct ata_port_operations ahci_ceva_ops = {
@@ -147,7 +148,7 @@ static void ahci_ceva_setup(struct ahci_host_priv *hpriv)
 		writel(tmp, mmio + AHCI_VEND_PP5C);
 
 		/* Rx Watermark setting  */
-		tmp = PTC_RX_WM_VAL | PTC_RSVD;
+		tmp = cevapriv->rx_watermark | PTC_RSVD;
 		writel(tmp, mmio + AHCI_VEND_PTC);
 
 		/* Default to Gen 2 Speed and Gen 1 if Gen2 is broken */
@@ -187,6 +188,13 @@ static int ceva_ahci_probe(struct platform_device *pdev)
 	if (of_property_read_bool(np, "ceva,broken-gen2"))
 		cevapriv->flags = CEVA_FLAG_BROKEN_GEN2;
 
+	/* Read RX WATERMARK value from device tree */
+	if (of_property_read_u32(np, "ceva,rx-watermark",
+				&cevapriv->rx_watermark) < 0) {
+		/* using default RX water mark, if not in device tree */
+		cevapriv->rx_watermark = PTC_RX_WM_VAL;
+	}
+
 	hpriv->plat_data = cevapriv;
 
 	/* CEVA specific initialization */
-- 
1.7.1

             reply	other threads:[~2016-02-20 13:33 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-20 13:18 Anurag Kumar Vulisha [this message]
2016-02-20 22:34 ` [RFC PATCH] drivers: ata: Read Rx water mark value from device-tree Arnd Bergmann
2016-02-22 10:53   ` Anurag Kumar Vulisha
2016-02-22 15:19     ` Arnd Bergmann
2016-02-23  5:58       ` Anurag Kumar Vulisha
2016-02-23 10:20         ` Arnd Bergmann
2016-02-23 15:29           ` Anurag Kumar Vulisha
2016-02-23 19:29             ` Rob Herring
2016-02-26 13:48               ` Anurag Kumar Vulisha
2016-03-02  5:53               ` Anurag Kumar Vulisha
2016-03-02  8:05                 ` Michal Simek
2016-03-02  9:11                   ` Arnd Bergmann
2016-03-02  9:27                     ` Michal Simek
2016-03-02 11:42                       ` Arnd Bergmann
2016-03-02 11:51                         ` Michal Simek

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=1455974302-7082-1-git-send-email-anuragku@xilinx.com \
    --to=anurag.kumar.vulisha@xilinx.com \
    --cc=anirudh@xilinx.com \
    --cc=anuragku@xilinx.com \
    --cc=devicetree@vger.kernel.org \
    --cc=galak@codeaurora.org \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=pawel.moll@arm.com \
    --cc=punnaia@xilinx.com \
    --cc=robh+dt@kernel.org \
    --cc=svemula@xilinx.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).