All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefano Babic <sbabic@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] mxs_ocotp: Shift the HBUS divider correctly
Date: Wed, 12 Aug 2015 23:18:15 +0200	[thread overview]
Message-ID: <55CBB817.6020102@denx.de> (raw)
In-Reply-To: <1436706011-6233-1-git-send-email-marex@denx.de>



On 12/07/2015 15:00, Marek Vasut wrote:
> From: Chris Smith <chris@zxdesign.info>
> 
> When the original HBUS divider value is retrieved in mxs_ocotp_scale_hclk()
> for the purpose or restoring it back later, the value is not shifted by the
> HBUS divider offset in that register. This is not a problem, since the shift
> is zero on all MXS hardware. Add the shift anyway, for completeness and in
> case FSL ever decides to re-use this driver on future designs.
> 
> Signed-off-by: Chris Smith <chris@zxdesign.info>
> Signed-off-by: Marek Vasut <marex@denx.de>
> Cc: Fabio Estevam <fabio.estevam@freescale.com>
> Cc: Stefano Babic <sbabic@denx.de>
> ---
>  drivers/misc/mxs_ocotp.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/misc/mxs_ocotp.c b/drivers/misc/mxs_ocotp.c
> index 6f0a1d3..6c0d247 100644
> --- a/drivers/misc/mxs_ocotp.c
> +++ b/drivers/misc/mxs_ocotp.c
> @@ -152,6 +152,7 @@ static int mxs_ocotp_scale_hclk(bool enter, uint32_t *val)
>  		/* Return the original HCLK clock speed. */
>  		*val = readl(&clkctrl_regs->hw_clkctrl_hbus);
>  		*val &= CLKCTRL_HBUS_DIV_MASK;
> +		*val >>= CLKCTRL_HBUS_DIV_OFFSET;
>  
>  		/* Scale the HCLK to 454/19 = 23.9 MHz . */
>  		scale_val = (~19) << CLKCTRL_HBUS_DIV_OFFSET;
> 
Applied to u-boot-imx, thanks !

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================

      reply	other threads:[~2015-08-12 21:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-12 13:00 [U-Boot] [PATCH] mxs_ocotp: Shift the HBUS divider correctly Marek Vasut
2015-08-12 21:18 ` Stefano Babic [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=55CBB817.6020102@denx.de \
    --to=sbabic@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 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.