public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3] mxs: timrot: Add support to i.MX23
Date: Mon, 25 Feb 2013 01:14:08 +0100	[thread overview]
Message-ID: <201302250114.09037.marex@denx.de> (raw)
In-Reply-To: <1361733427-9537-1-git-send-email-f.koliqi@gmail.com>

Dear Fadil Berisha,

> From: Fadil Berisha <f.koliqi@gmail.com>
> 
> This patch add timer support to i.MX23 and complete bit fields and values
> on regs-timrot.h.
> Testet on imx23-olinuxino board.
> 
> Signed-off-by: Fadil Berisha <f.koliqi@gmail.com>

Boring nits below, fix them and add my ack in the next version:

Acked-by: Marek Vasut <marex@denx.de>

btw. if you don't want to add --cc="" to the git send-email command line, just 
put lines in format of:

Cc: Us Er <e@ma.il>

in the git commit message just below the "Signed-off-by:". Just run git log on 
most of the mxs-related files and you'll see how it's done.

> ---
> v2 - Updated the struct mxs_timrot_regs so the mapping works for all
> registers v3 - Revert macro MX28_INCREMENTER_HZ,
> MX28_HW_DIGCTL_MICROSECONDS and fix whitespaces
> 
>  arch/arm/cpu/arm926ejs/mxs/timer.c          |   23 +++++-
>  arch/arm/include/asm/arch-mxs/regs-timrot.h |  101
> +++++++++++++++++++++++++++ 2 files changed, 122 insertions(+), 2
> deletions(-)
> 
> diff --git a/arch/arm/cpu/arm926ejs/mxs/timer.c
> b/arch/arm/cpu/arm926ejs/mxs/timer.c index 4ed75e6..f41ad1c 100644
> --- a/arch/arm/cpu/arm926ejs/mxs/timer.c
> +++ b/arch/arm/cpu/arm926ejs/mxs/timer.c
> @@ -32,7 +32,11 @@
>  #include <asm/arch/sys_proto.h>
> 
>  /* Maximum fixed count */
> -#define TIMER_LOAD_VAL	0xffffffff
> +#if defined(CONFIG_MX23)
> +#define TIMER_LOAD_VAL 0xffff
> +#elif defined(CONFIG_MX28)
> +#define TIMER_LOAD_VAL 0xffffffff
> +#endif
> 
>  DECLARE_GLOBAL_DATA_PTR;
> 
> @@ -69,7 +73,11 @@ int timer_init(void)
>  	mxs_reset_block(&timrot_regs->hw_timrot_rotctrl_reg);
> 
>  	/* Set fixed_count to 0 */
> +#if defined(CONFIG_MX23)
> +	writel(0, &timrot_regs->hw_timrot_timcount0);
> +#elif defined(CONFIG_MX28)
>  	writel(0, &timrot_regs->hw_timrot_fixed_count0);
> +#endif
> 
>  	/* Set UPDATE bit and 1Khz frequency */
>  	writel(TIMROT_TIMCTRLn_UPDATE | TIMROT_TIMCTRLn_RELOAD |
> @@ -77,7 +85,11 @@ int timer_init(void)
>  		&timrot_regs->hw_timrot_timctrl0);
> 
>  	/* Set fixed_count to maximal value */
> +#if defined(CONFIG_MX23)
> +	writel(TIMER_LOAD_VAL-1, &timrot_regs->hw_timrot_timcount0);

Put a space here ... 'TIMER_LOAD_VAL - 1'

> +#elif defined(CONFIG_MX28)
>  	writel(TIMER_LOAD_VAL, &timrot_regs->hw_timrot_fixed_count0);
> +#endif
> 
>  	return 0;
>  }
> @@ -86,9 +98,16 @@ unsigned long long get_ticks(void)
>  {
>  	struct mxs_timrot_regs *timrot_regs =
>  		(struct mxs_timrot_regs *)MXS_TIMROT_BASE;
> +	uint32_t now;
> 
>  	/* Current tick value */
> -	uint32_t now = readl(&timrot_regs->hw_timrot_running_count0);
> +#if defined(CONFIG_MX23)
> +	/* upper bits are the valid */

/* Upper bits are the valid ones. */

> +	now = readl(&timrot_regs->hw_timrot_timcount0) >>
> +		TIMROT_RUNNING_COUNTn_RUNNING_COUNT_OFFSET;
> +#elif defined(CONFIG_MX28)
> +	now = readl(&timrot_regs->hw_timrot_running_count0);
> +#endif
> 
>  	if (lastdec >= now) {
>  		/*

[...]

      reply	other threads:[~2013-02-25  0:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-24 19:17 [U-Boot] [PATCH v3] mxs: timrot: Add support to i.MX23 Fadil Berisha
2013-02-25  0:14 ` Marek Vasut [this message]

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=201302250114.09037.marex@denx.de \
    --to=marex@denx.de \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox