All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 25/37] arm: rmobile: Add support TMU base timer function
Date: Tue, 21 Aug 2012 10:42:26 +0900	[thread overview]
Message-ID: <CABMQnV+ajB_mu3NmdjDkv-R41W9i=GORYKMiboYko5Q779+gfA@mail.gmail.com> (raw)
In-Reply-To: <20120820191859.8068b1b54ed57551b1310952@freescale.com>

Hi,

On Tue, Aug 21, 2012 at 9:18 AM, Kim Phillips
<kim.phillips@freescale.com> wrote:
> On Mon, 20 Aug 2012 00:21:10 +0900
> Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com> wrote:
>
>> On Tue, Aug 14, 2012 at 8:26 AM, Kim Phillips
>> <kim.phillips@freescale.com> wrote:
>> > On Fri, 10 Aug 2012 16:16:12 +0900
>> > Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com> wrote:
>> >
>> >> Some rmobile SoC has TMU base timer function. This supports TMU.
>> >>
>> >> Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
>> >> ---
>> >>  V2: Set COBJS one object per line, and sort the list.
>> >>
>> >>  arch/arm/cpu/armv7/rmobile/Makefile           |    4 +-
>> >>  arch/arm/cpu/armv7/rmobile/timer_tmu.c        |  161 +++++++++++++++++++++++++
>> >
>> > this is a copy of arch/sh/lib/time.c but with proper struct tmu_regs
>> > instead of #defines; is it not possible to refactor & merge the two?
>>
>> I am going to merge next work.
>
> not sure what this means, but usually u-boot development favours
> initially refactoring common code rather than duplicating it, and
> then refactoring it (although I wouldn't know where common timer code
> across arches could live).

OK, I will work about this.
maybe, I think that timer common code of SH was moved to drivers/timer.

>
>> >> +int timer_init(void)
>> >> +{
>> >> +     /* Divide clock by CONFIG_SYS_TMU_CLK_DIV */
>> >> +     u16 bit = 0;
>> >> +
>> >> +     switch (CONFIG_SYS_TMU_CLK_DIV) {
>> >> +     case 1024:
>> >> +             bit = 4;
>> >> +             break;
>> >> +     case 256:
>> >> +             bit = 3;
>> >> +             break;
>> >> +     case 64:
>> >> +             bit = 2;
>> >> +             break;
>> >> +     case 16:
>> >> +             bit = 1;
>> >> +             break;
>> >> +     case 4:
>> >> +     default:
>> >> +             break;
>> >> +     }
>> >
>> > Can this be broken down into a shift operation?
>>
>> Sorry, I can not understand this.
>> This means not using swtich but using shift operation?
>
> Sorry, I meant this: (ffs(CONFIG_SYS_TMU_CLK_DIV) >> 1) - 1
>

I see. Thanks for your point. I forgot ffs().

Best regards,
  Nobuhiro
-- 
Nobuhiro Iwamatsu

  reply	other threads:[~2012-08-21  1:42 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-10  7:16 [U-Boot] [PATCH v3] arm: rmobile: Add basic support for Renesas R-Mobile Nobuhiro Iwamatsu
2012-08-10  7:16 ` [U-Boot] [PATCH v2] arm: rmobile: Add support PFC of Renesas R8A7740 Nobuhiro Iwamatsu
2012-08-10  7:16 ` [U-Boot] [PATCH v2] arm: rmobile: Add support PFC of Renesas SH73A0 Nobuhiro Iwamatsu
2012-08-10  7:16 ` [U-Boot] [PATCH v2] arm: rmobile: Add support Renesas R8A7740 Nobuhiro Iwamatsu
2012-08-10  7:16 ` [U-Boot] [PATCH v2] arm: rmobile: Add support Renesas SH73A0 Nobuhiro Iwamatsu
2012-08-10  7:16 ` [U-Boot] [PATCH 25/37] arm: rmobile: Add support TMU base timer function Nobuhiro Iwamatsu
2012-08-13 23:26   ` Kim Phillips
2012-08-19 15:21     ` Nobuhiro Iwamatsu
2012-08-21  0:18       ` Kim Phillips
2012-08-21  1:42         ` Nobuhiro Iwamatsu [this message]
2012-08-10  7:16 ` [U-Boot] [PATCH v2] sh: Add support pin function control using GPIO Nobuhiro Iwamatsu

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='CABMQnV+ajB_mu3NmdjDkv-R41W9i=GORYKMiboYko5Q779+gfA@mail.gmail.com' \
    --to=nobuhiro.iwamatsu.yj@renesas.com \
    --cc=u-boot@lists.denx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.