linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Anton Vorontsov <cbouatmailru@gmail.com>
To: Anton Vorontsov <avorontsov@ru.mvista.com>
Cc: linuxppc-dev@ozlabs.org
Subject: Re: [PATCH 1/5] [POWERPC] sysdev: implement FSL GTM support
Date: Fri, 18 Apr 2008 02:47:40 +0400	[thread overview]
Message-ID: <20080417224740.GA25323@zarina> (raw)
In-Reply-To: <20080417192832.GA28286@polina.dev.rtsoft.ru>

On Thu, Apr 17, 2008 at 11:28:32PM +0400, Anton Vorontsov wrote:
> GTM stands for General-purpose Timers Module and able to generate
> timer{1,2,3,4} interrupts. These timers are used by the drivers that
> need time precise interrupts (like for USB transactions scheduling for
> the Freescale USB Host controller as found in some QE and CPM chips),
> or these timers could be used as wakeup events from the CPU deep-sleep
> mode.
> 
> Things unimplemented:
> 1. Cascaded (32 bit) timers (1-2, 3-4).
>    This is straightforward to implement when needed, two timers should
>    be marked as "requested" and configured as appropriate.
> 2. Super-cascaded (64 bit) timers (1-2-3-4).
>    This is also straightforward to implement when needed, all timers
>    should be marked as "requested" and configured as appropriate.
> 
> Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
> ---
>  Documentation/powerpc/booting-without-of.txt |   32 +++-
>  arch/powerpc/Kconfig                         |    5 +
>  arch/powerpc/sysdev/Makefile                 |    1 +
>  arch/powerpc/sysdev/fsl_gtm.c                |  362 ++++++++++++++++++++++++++
>  include/asm-powerpc/fsl_gtm.h                |  108 ++++++++
>  5 files changed, 507 insertions(+), 1 deletions(-)
>  create mode 100644 arch/powerpc/sysdev/fsl_gtm.c
>  create mode 100644 include/asm-powerpc/fsl_gtm.h
> 
> diff --git a/Documentation/powerpc/booting-without-of.txt b/Documentation/powerpc/booting-without-of.txt
> index 4cc7800..827b630 100644
> --- a/Documentation/powerpc/booting-without-of.txt
> +++ b/Documentation/powerpc/booting-without-of.txt
[...]
> +/**
> + * gtm_reset_timer16 - reset 16 bit timer with arbitrary precision
> + * @tmr:	pointer to the gtm_timer structure obtained from gtm_get_timer
> + * @usec:	timer interval in microseconds
> + * @reload:	if set, the timer will reset upon expiry rather than
> + *         	continue running free.
> + *
> + * This function (re)sets the GTM timer so that it counts up to the requested
> + * interval value, and fires the interrupt when the value is reached. This
> + * function will reduce the precision of the timer as needed in order for the
> + * requested timeout to fit in a 16-bit register.
> + */
> +int gtm_reset_timer16(struct gtm_timer *tmr, unsigned long usec, bool reload)
> +{
> +	/* quite obvious, frequency which is enough for µSec precision */
> +	int freq = 1000000;
> +	unsigned int bit;
> +
> +	bit = fls_long(usec);
> +	if (bit > 15) {
> +		freq >>= bit - 15;
> +		usec >>= bit - 15;
> +	}

if (!freq)
	return -EINVAL;

> +	return gtm_reset_ref_timer16(tmr, freq, usec, reload);
> +}
> +EXPORT_SYMBOL(gtm_reset_timer16);

-- 
Anton Vorontsov
email: cbouatmailru@gmail.com
irc://irc.freenode.net/bd2

  reply	other threads:[~2008-04-17 22:47 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-17 19:26 [PATCH 0/5] Few more patches for Kumar's powerpc.git Anton Vorontsov
2008-04-17 19:28 ` [PATCH 1/5] [POWERPC] sysdev: implement FSL GTM support Anton Vorontsov
2008-04-17 22:47   ` Anton Vorontsov [this message]
2008-04-18  4:19     ` Kumar Gala
2008-04-18  9:54       ` Anton Vorontsov
2008-04-17 19:28 ` [PATCH 2/5] [POWERPC] QE: add support for QE USB clocks routing Anton Vorontsov
2008-04-17 19:56   ` Timur Tabi
2008-04-17 19:59     ` Scott Wood
2008-04-17 20:04       ` Timur Tabi
2008-04-17 20:14         ` Scott Wood
2008-04-17 20:17           ` Timur Tabi
2008-04-17 20:26             ` Scott Wood
2008-04-17 20:47     ` Dale Farnsworth
2008-04-17 20:49       ` Timur Tabi
2008-04-17 20:54         ` Dale Farnsworth
2008-04-17 21:48     ` Anton Vorontsov
2008-04-17 22:00       ` Timur Tabi
2008-04-17 19:28 ` [PATCH 3/5] [POWERPC] QE: split par_io_config_pin() Anton Vorontsov
2008-04-17 21:53   ` Kumar Gala
2008-04-17 22:35     ` Anton Vorontsov
2008-04-17 19:29 ` [PATCH 4/5] [POWERPC] QE: implement support for the GPIO LIB API Anton Vorontsov
2008-04-17 22:35   ` Kumar Gala
2008-04-17 22:41     ` Anton Vorontsov
2008-04-18  2:21       ` Kumar Gala
2008-04-17 19:29 ` [PATCH 5/5] [POWERPC] 83xx: new board support: MPC8360E-RDK Anton Vorontsov
  -- strict thread matches above, loose matches on Subject: below --
2008-04-18 19:06 [PATCH 0/5 v2] Few more patches for Kumar's powerpc.git Anton Vorontsov
2008-04-18 19:09 ` [PATCH 1/5] [POWERPC] sysdev: implement FSL GTM support Anton Vorontsov
2008-04-21 14:03   ` Grant Likely
2008-04-21 14:28     ` Anton Vorontsov
2008-04-21 16:28       ` Segher Boessenkool
2008-04-21 18:39     ` Scott Wood
2008-04-21 23:27       ` Grant Likely

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=20080417224740.GA25323@zarina \
    --to=cbouatmailru@gmail.com \
    --cc=avorontsov@ru.mvista.com \
    --cc=linuxppc-dev@ozlabs.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).