public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: "Benoît Thébaudeau" <benoit.thebaudeau@advansee.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 3/4] mx5: Add NAND clock handling
Date: Mon, 25 Feb 2013 20:27:47 +0100 (CET)	[thread overview]
Message-ID: <1372065745.106540.1361820467501.JavaMail.root@advansee.com> (raw)
In-Reply-To: <1361816397-8661-3-git-send-email-marex@denx.de>

Dear Marek Vasut,

On Monday, February 25, 2013 7:19:56 PM, Marek Vasut wrote:
> Augment the MX5 clock code with function to enable and configure
> NFC clock. This is necessary to get NFC working on MX5.
> 
> Signed-off-by: Marek Vasut <marex@denx.de>
> Cc: Beno?t Th?baudeau <benoit.thebaudeau@advansee.com>
> Cc: Fabio Estevam <fabio.estevam@freescale.com>
> Cc: Stefano Babic <sbabic@denx.de>
> ---
>  arch/arm/cpu/armv7/mx5/clock.c        |   12 ++++++++++--
>  arch/arm/include/asm/arch-mx5/clock.h |    1 +
>  2 files changed, 11 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm/cpu/armv7/mx5/clock.c b/arch/arm/cpu/armv7/mx5/clock.c
> index 76c2c52..f768fc9 100644
> --- a/arch/arm/cpu/armv7/mx5/clock.c
> +++ b/arch/arm/cpu/armv7/mx5/clock.c
> @@ -739,10 +739,11 @@ static int config_core_clk(u32 ref, u32 freq)
>  static int config_nfc_clk(u32 nfc_clk)
>  {
>  	u32 parent_rate = get_emi_slow_clk();
> -	u32 div = parent_rate / nfc_clk;
> +	u32 div;
>  
> -	if (nfc_clk <= 0)
> +	if (nfc_clk == 0)
>  		return -EINVAL;
> +	div = parent_rate / nfc_clk;
>  	if (div == 0)
>  		div++;
>  	if (parent_rate / div > NFC_CLK_MAX)
> @@ -755,6 +756,13 @@ static int config_nfc_clk(u32 nfc_clk)
>  	return 0;
>  }
>  
> +void enable_nfc_clk(unsigned char enable)
> +{
> +	unsigned int cg = enable ? MXC_CCM_CCGR_CG_ON : MXC_CCM_CCGR_CG_OFF;
> +
> +	clrsetbits_le32(&mxc_ccm->CCGR5, MXC_CCM_CCGR_CG_MASK << 20, cg << 20);

Please use MXC_CCM_CCGR5_EMI_ENFC(MXC_CCM_CCGR_CG_MASK) and
MXC_CCM_CCGR_CG_MASK(cg).

> +}
> +
>  /* Config main_bus_clock for periphs */
>  static int config_periph_clk(u32 ref, u32 freq)
>  {
> diff --git a/arch/arm/include/asm/arch-mx5/clock.h
> b/arch/arm/include/asm/arch-mx5/clock.h
> index 9cdfb48..6910192 100644
> --- a/arch/arm/include/asm/arch-mx5/clock.h
> +++ b/arch/arm/include/asm/arch-mx5/clock.h
> @@ -68,5 +68,6 @@ void set_usboh3_clk(void);
>  void enable_usboh3_clk(unsigned char enable);
>  void mxc_set_sata_internal_clock(void);
>  int enable_i2c_clk(unsigned char enable, unsigned i2c_num);
> +void enable_nfc_clk(unsigned char enable);
>  
>  #endif /* __ASM_ARCH_CLOCK_H */
> --
> 1.7.10.4
> 
> 

Best regards,
Beno?t

  reply	other threads:[~2013-02-25 19:27 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-25 18:19 [U-Boot] [PATCH 1/4] common: imx: Implement generic u-boot.nand target Marek Vasut
2013-02-25 18:19 ` [U-Boot] [PATCH 2/4] imx: Align the imximage header and payload to multiples of 4k Marek Vasut
2013-02-25 19:13   ` Benoît Thébaudeau
2013-02-25 21:07     ` Marek Vasut
2013-02-25 21:16       ` Benoît Thébaudeau
2013-02-25 18:19 ` [U-Boot] [PATCH 3/4] mx5: Add NAND clock handling Marek Vasut
2013-02-25 19:27   ` Benoît Thébaudeau [this message]
2013-02-25 18:24 ` [U-Boot] [PATCH 4/4] mx5: Add support for DENX M53EVK Marek Vasut
2013-02-25 19:33   ` Benoît Thébaudeau
2013-02-26 13:52   ` Fabio Estevam
2013-02-26 19:32   ` Fabio Estevam
2013-04-14 17:20     ` Marek Vasut
2013-04-14 19:07       ` Wolfgang Denk
2013-04-14 19:18         ` Marek Vasut
2013-02-25 18:51 ` [U-Boot] [PATCH 1/4] common: imx: Implement generic u-boot.nand target Benoît Thébaudeau
2013-02-25 21:09   ` Marek Vasut
2013-02-25 21:13     ` Benoît Thébaudeau
2013-02-26  1:02   ` [U-Boot] patch error wanxs
2013-02-25 20:10 ` [U-Boot] [PATCH 1/4] common: imx: Implement generic u-boot.nand target Scott Wood
2013-02-25 21:10   ` Marek Vasut
2013-02-25 22:15     ` Scott Wood
2013-02-25 23:03       ` Marek Vasut
2013-02-25 23:07         ` Scott Wood
2013-02-25 23:50           ` Benoît Thébaudeau
2013-02-26  7:19             ` Marek Vasut
2013-02-26 11:33               ` Benoît Thébaudeau
2013-02-27 17:33                 ` Tom Rini
2013-02-28 18:50                   ` Marek Vasut
2013-02-28 18:53                     ` Tom Rini
2013-02-26  7:17           ` Marek Vasut
2013-02-26 23:10             ` Scott Wood
2013-02-27 22:18 ` Benoît Thébaudeau
2013-02-27 23:44   ` Tom Rini
2013-02-27 23:47     ` Benoît Thébaudeau
2013-02-28 12:18       ` Benoît Thébaudeau
2013-02-28 14:03   ` Tom Rini
2013-02-28 15:24     ` Benoît Thébaudeau
2013-02-28 16:06       ` Benoît Thébaudeau
2013-02-28 16:21         ` Tom Rini
2013-02-28 16:29           ` Benoît Thébaudeau
2013-02-28 16:42             ` Tom Rini

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=1372065745.106540.1361820467501.JavaMail.root@advansee.com \
    --to=benoit.thebaudeau@advansee.com \
    --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