linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: ben-linux@fluff.org (Ben Dooks)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/3] s3c64xx: Add SYNCMUX codes for selection source of HCLKx2
Date: Wed, 16 Sep 2009 01:04:44 +0100	[thread overview]
Message-ID: <20090916000444.GL13508@trinity.fluff.org> (raw)
In-Reply-To: <18082112.529381252139591299.JavaMail.weblogic@epml18>

On Sat, Sep 05, 2009 at 08:33:11AM +0000, Kukjin Kim wrote:
> This patch adds SYNCMUX codes for selection source of HCLKx2.
> According to 'Fig 3-2. The block diagram of clock generator' of 6400/6410 UM,
> the source of HCLKx2 is DOUT_APLL or MOUT_MPLL that is decided by SYNCMUX.
> If synchronous mode, it is DOUT_APLL and if asynchronous mode, it is MOUT_MPLL.

Please make sure these descriptions wrap at or before 77 characters.
 
> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
> ---
>  arch/arm/plat-s3c64xx/include/plat/regs-clock.h |    4 ++++
>  arch/arm/plat-s3c64xx/s3c6400-clock.c           |    8 +++++++-
>  2 files changed, 11 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/arm/plat-s3c64xx/include/plat/regs-clock.h b/arch/arm/plat-s3c64xx/include/plat/regs-clock.h
> index ff46e7f..2c3224c 100644
> --- a/arch/arm/plat-s3c64xx/include/plat/regs-clock.h
> +++ b/arch/arm/plat-s3c64xx/include/plat/regs-clock.h
> @@ -33,6 +33,7 @@
>  #define S3C_PCLK_GATE          S3C_CLKREG(0x34)
>  #define S3C_SCLK_GATE          S3C_CLKREG(0x38)
>  #define S3C_MEM0_GATE          S3C_CLKREG(0x3C)
> +#define S3C_OTHERS             S3C_CLKREG(0x900)
> 
>  /* CLKDIV0 */
>  #define S3C6400_CLKDIV0_MFC_MASK       (0xf << 28)
> @@ -182,6 +183,9 @@
>  #define S3C_CLKCON_SCLK_CAM            (1<<2)
>  #define S3C_CLKCON_SCLK_JPEG           (1<<1)
> 
> +/* OTHERS */
> +#define S3C_OTHERS_SYNCMUXSEL_SYNC     (1<<6)
> +
>  /* CLKSRC */
> 
>  #define S3C6400_CLKSRC_APLL_MOUT       (1 << 0)
> diff --git a/arch/arm/plat-s3c64xx/s3c6400-clock.c b/arch/arm/plat-s3c64xx/s3c6400-clock.c
> index a898325..0da2781 100644
> --- a/arch/arm/plat-s3c64xx/s3c6400-clock.c
> +++ b/arch/arm/plat-s3c64xx/s3c6400-clock.c
> @@ -689,7 +689,13 @@ void __init_or_cpufreq s3c6400_setup_clocks(void)
>         printk(KERN_INFO "S3C64XX: PLL settings, A=%ld, M=%ld, E=%ld\n",
>                apll, mpll, epll);
> 
> -       hclk2 = mpll / GET_DIV(clkdiv0, S3C6400_CLKDIV0_HCLK2);
> +       if (__raw_readl(S3C_OTHERS) & S3C_OTHERS_SYNCMUXSEL_SYNC) {
> +               /* Synchronous mode */
> +               hclk2 = apll / GET_DIV(clkdiv0, S3C6400_CLKDIV0_HCLK2);
> +       } else {
> +               /* Asynchronous mode */
> +               hclk2 = mpll / GET_DIV(clkdiv0, S3C6400_CLKDIV0_HCLK2);
> +       }
>         hclk = hclk2 / GET_DIV(clkdiv0, S3C6400_CLKDIV0_HCLK);
>         pclk = hclk2 / GET_DIV(clkdiv0, S3C6400_CLKDIV0_PCLK);

It should also be noted that the clk->parent of hclk2 should also be
correctly setup and any necessary changes to the clock code be made
to reflect this.

-- 
Ben

Q:      What's a light-year?
A:      One-third less calories than a regular year.

      reply	other threads:[~2009-09-16  0:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-05  8:33 [PATCH 3/3] s3c64xx: Add SYNCMUX codes for selection source of HCLKx2 Kukjin Kim
2009-09-16  0:04 ` Ben Dooks [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=20090916000444.GL13508@trinity.fluff.org \
    --to=ben-linux@fluff.org \
    --cc=linux-arm-kernel@lists.infradead.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).