LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Robert ABEL <rabel@cit-ec.uni-bielefeld.de>
To: rogerq@ti.com, linux-omap@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, tony@atomide.com,
	linux@arm.linux.org.uk,
	Robert ABEL <rabel@cit-ec.uni-bielefeld.de>
Subject: [PATCH 5/8 v2] ARM OMAP2+ GPMC: change get_gpmc_timing_reg output for DTS
Date: Tue, 24 Feb 2015 21:05:27 +0100	[thread overview]
Message-ID: <1424808331-17592-5-git-send-email-rabel@cit-ec.uni-bielefeld.de> (raw)
In-Reply-To: <1424808331-17592-4-git-send-email-rabel@cit-ec.uni-bielefeld.de>

DTS output was formatted to require additional work when copy-pasting into DTS.
Nano-second timings were removed, because they were not a confidence interval nor
an indication what timing values would result in the same #ticks

Signed-off-by: Robert ABEL <rabel@cit-ec.uni-bielefeld.de>
---
 drivers/memory/omap-gpmc.c | 33 +++++++++++++++++++++++----------
 1 file changed, 23 insertions(+), 10 deletions(-)

diff --git a/drivers/memory/omap-gpmc.c b/drivers/memory/omap-gpmc.c
index b5c8305..ff1a1e7 100644
--- a/drivers/memory/omap-gpmc.c
+++ b/drivers/memory/omap-gpmc.c
@@ -337,32 +337,45 @@ static void gpmc_cs_bool_timings(int cs, const struct gpmc_bool_timings *p)
 }
 
 #ifdef DEBUG
+/**
+ * get_gpmc_timing_reg - read a timing parameter and print DTS settings for it.
+ * @cs      Chip Select Region
+ * @reg     GPMC_CS_CONFIGn register offset.
+ * @st_bit  Start Bit
+ * @end_bit End Bit. Must be >= @st_bit.
+ * @name    DTS node name, w/o "gpmc,"
+ * @raw     Raw Format Option.
+ *          raw format:  gpmc,name = <value>
+ *          tick format: gpmc,name = <value> /&zwj;* x ticks *&zwj;/
+ * @noval   Parameter values equal to 0 are not printed.
+ * @shift   Parameter value left shifts @shift, which is then printed instead of value.
+ *
+ */
 static int get_gpmc_timing_reg(int cs, int reg, int st_bit, int end_bit,
 			       bool raw, bool noval, int shift,
 			       const char *name)
 {
 	u32 l;
-	int nr_bits, max_value, mask;
+	int nr_bits;
+	int mask;
 
 	l = gpmc_cs_read_reg(cs, reg);
 	nr_bits = end_bit - st_bit + 1;
-	max_value = (1 << nr_bits) - 1;
-	mask = max_value << st_bit;
-	l = (l & mask) >> st_bit;
+	mask = (1 << nr_bits) - 1;;
+	l = (l >> st_bit) & mask;
 	if (shift)
 		l = (shift << l);
 	if (noval && (l == 0))
 		return 0;
 	if (!raw) {
-		unsigned int time_ns_min, time_ns, time_ns_max;
+		/* DTS tick format for timings in ns */
+		unsigned int time_ns;
 
-		time_ns_min = gpmc_ticks_to_ns(l ? l - 1 : 0);
 		time_ns = gpmc_ticks_to_ns(l);
-		time_ns_max = gpmc_ticks_to_ns(l + 1 > max_value ?
-					       max_value : l + 1);
-		pr_info("gpmc,%s = <%u> (%u - %u ns, %i ticks)\n",
-			name, time_ns, time_ns_min, time_ns_max, l);
+		pr_info("gpmc,%s = <%u> /* %i ticks */\n",
+			name, time_ns, l);
 	} else {
+		/* raw format */
 		pr_info("gpmc,%s = <%u>\n", name, l);
 	}
 
-- 
2.3.0


  reply	other threads:[~2015-02-24 20:08 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-24 20:05 [PATCH 0/8 v2] ARM OMAP2+ GPMC: fixes and bus children Robert ABEL
2015-02-24 20:05 ` [PATCH 1/8 v2] ARM OMAP2+ GPMC: don't undef DEBUG Robert ABEL
2015-02-24 20:05   ` [PATCH 3/8 v2] ARM OMAP2+ GPMC: add bus children Robert ABEL
2015-02-24 20:05     ` [PATCH 4/8 v2] ARM OMAP2+ GPMC: fix debug output alignment Robert ABEL
2015-02-24 20:05       ` Robert ABEL [this message]
2015-02-24 20:05         ` [PATCH 6/8 v2] ARM OMAP2+ GPMC: always program GPMCFCLKDIVIDER Robert ABEL
2015-02-24 20:05           ` [PATCH 7/8 v2] ARM OMAP2+ GPMC: calculate GPMCFCLKDIVIDER based on WAITMONITORINGTIME Robert ABEL
2015-02-24 20:05             ` [PATCH 8/8 v2] ARM OMAP2+ GPMC: fix WAITMONITORINGTIME divider bug Robert ABEL
2015-02-24 20:05               ` [PATCH 9/8 v2] ARM OMAP2+ GPMC: fix programming/showing reserved timing parameters Robert ABEL
2015-02-25 10:44                 ` Roger Quadros
2015-02-25 15:17                   ` Robert Abel
2015-02-25 16:09                     ` Roger Quadros
2015-02-25 16:58               ` [PATCH 8/8 v2] ARM OMAP2+ GPMC: fix WAITMONITORINGTIME divider bug Roger Quadros
2015-02-25 17:07                 ` Robert Abel
2015-02-25 17:17                   ` Roger Quadros
2015-02-25 17:22                     ` Robert Abel
2015-02-25 17:27                       ` Roger Quadros
2015-02-25 16:33             ` [PATCH 7/8 v2] ARM OMAP2+ GPMC: calculate GPMCFCLKDIVIDER based on WAITMONITORINGTIME Roger Quadros
2015-02-25 17:20               ` Roger Quadros
2015-02-25 17:24                 ` Robert Abel
2015-02-25 17:20               ` Robert Abel
2015-02-26 11:34                 ` Roger Quadros
2015-02-25 13:31           ` [PATCH 6/8 v2] ARM OMAP2+ GPMC: always program GPMCFCLKDIVIDER Roger Quadros
2015-02-25 13:24         ` [PATCH 5/8 v2] ARM OMAP2+ GPMC: change get_gpmc_timing_reg output for DTS Roger Quadros
2015-02-25 15:23           ` Tony Lindgren
2015-02-25 16:26             ` Robert Abel
2015-02-25 13:05       ` [PATCH 4/8 v2] ARM OMAP2+ GPMC: fix debug output alignment Roger Quadros
2015-02-25 12:02     ` [PATCH 3/8 v2] ARM OMAP2+ GPMC: add bus children Roger Quadros
2015-02-25 15:06       ` Robert Abel
2015-02-25 16:18         ` Roger Quadros
2015-02-25 16:23           ` Robert Abel
2015-02-25 16:26             ` Roger Quadros
2015-02-25 11:01   ` [PATCH 1/8 v2] ARM OMAP2+ GPMC: don't undef DEBUG Roger Quadros
2015-02-24 20:07 ` [PATCH 0/8 v2] ARM OMAP2+ GPMC: fixes and bus children Robert Abel

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=1424808331-17592-5-git-send-email-rabel@cit-ec.uni-bielefeld.de \
    --to=rabel@cit-ec.uni-bielefeld.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=rogerq@ti.com \
    --cc=tony@atomide.com \
    --subject='Re: [PATCH 5/8 v2] ARM OMAP2+ GPMC: change get_gpmc_timing_reg output for DTS' \
    /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

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).