From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752830AbbBYNZR (ORCPT ); Wed, 25 Feb 2015 08:25:17 -0500 Received: from comal.ext.ti.com ([198.47.26.152]:35296 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751705AbbBYNZN (ORCPT ); Wed, 25 Feb 2015 08:25:13 -0500 Message-ID: <54EDCD29.3010404@ti.com> Date: Wed, 25 Feb 2015 15:24:57 +0200 From: Roger Quadros User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Robert ABEL , CC: , , Subject: Re: [PATCH 5/8 v2] ARM OMAP2+ GPMC: change get_gpmc_timing_reg output for DTS References: <1424808331-17592-1-git-send-email-rabel@cit-ec.uni-bielefeld.de> <1424808331-17592-2-git-send-email-rabel@cit-ec.uni-bielefeld.de> <1424808331-17592-3-git-send-email-rabel@cit-ec.uni-bielefeld.de> <1424808331-17592-4-git-send-email-rabel@cit-ec.uni-bielefeld.de> <1424808331-17592-5-git-send-email-rabel@cit-ec.uni-bielefeld.de> In-Reply-To: <1424808331-17592-5-git-send-email-rabel@cit-ec.uni-bielefeld.de> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 24/02/15 22:05, Robert ABEL wrote: > 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 If they were not is it possible to dump min,max timings that will result in the same ticks? Otherwise patch is fine. cheers, -roger > > Signed-off-by: Robert ABEL > --- > 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 = > + * tick format: gpmc,name = /‍* x ticks *‍/ > + * @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); > } > >