All of lore.kernel.org
 help / color / mirror / Atom feed
From: shawn.guo@linaro.org (Shawn Guo)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: imx: correct Audio/Video PLL rate calculation formula
Date: Wed, 29 Apr 2015 14:08:58 +0800	[thread overview]
Message-ID: <20150429060857.GB27573@dragon> (raw)
In-Reply-To: <20150428094657.GA15036@shlinux1.ap.freescale.net>

Hi Anson,

On Tue, Apr 28, 2015 at 05:47:00PM +0800, Anson Huang wrote:
> On Mon, Apr 27, 2015 at 10:29:43PM +0800, Shawn Guo wrote:
> > On Fri, Apr 24, 2015 at 01:34:15AM +0800, Anson Huang wrote:
> > > The audio/video PLL's rate calculation formula is as below in RM:
> > > 
> > > Fref * (DIV_SELECT + NUM / DENOM),
> > > 
> > > in original clk-pllv3's code, below code is used:
> > > 
> > > (parent_rate * div) + ((parent_rate / mfd) * mfn
> > > 
> > > as it does NOT consider the float data using div, so below
> > > calculation formula should be used as a decent method:
> > > 
> > > (parent_rate * div) + ((parent_rate * mfn) / mfd)
> > > 
> > > and we also need to consider parent_rate * mfd may exceed
> > > a 32 bit value, 64 bit value should be used.
> > 
> > Can you provide some real world data (PLL output frequency) to
> > demonstrate the difference between old and new formula?
> > 
> > Shawn
> > 
> 
> I happen to meet this issue on i.MX7D, on i.MX7D, DRAM PLL is a
> Audio/Video type PLL, the target freq is 1066MHz, the register
> settings are as below:
> 
> PLL_DDRn: 8060202C   -> div = 0x2C
> DDR_NUM: 06AAAC4D    -> mfn = 0x6AAAC4D
> DDR_DENOM: 100003EC  -> mfd = 0x100003EC
> 
> parent_rate = 24MHz.
> 
> with old formula, the (parent_rate / mfd) * mfn = 0
> with new formula, the (parent_rate * mfn) / mfd = 10
> 
> so old formula gets PLL_DDR = 1056MHz, new formuls gets
> PLL_DDR = 1066MHz.
> 
> For other Audio/Video PLL, the result is also different, but
> the difference is less then 1MHz.
> 
> That is why I do this patch.

Okay.  Can you please add these data into commit log and resend the
patch?  Also, all i.MX clock drivers are being moved into
drivers/clk/imx/, so please rebase your patch on my imx/clk-move
branch.

Shawn

      parent reply	other threads:[~2015-04-29  6:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-23 17:34 [PATCH] ARM: imx: correct Audio/Video PLL rate calculation formula Anson Huang
2015-04-27 14:29 ` Shawn Guo
     [not found]   ` <20150428094657.GA15036@shlinux1.ap.freescale.net>
2015-04-29  6:08     ` Shawn Guo [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=20150429060857.GB27573@dragon \
    --to=shawn.guo@linaro.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 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.