From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 5/6] arm: mx5: Add NAND clock handling
Date: Fri, 19 Apr 2013 13:18:06 +0200 [thread overview]
Message-ID: <201304191318.06457.marex@denx.de> (raw)
In-Reply-To: <1000802118.1870337.1366362490297.JavaMail.root@advansee.com>
Dear Beno?t Th?baudeau,
> On Friday, April 19, 2013 11:02:03 AM, Beno?t Th?baudeau wrote:
> > Dear Marek Vasut,
> >
> > On Friday, April 19, 2013 6:10:54 AM, 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: Albert ARIBAUD <albert.u.boot@aribaud.net>
> > > Cc: Beno?t Th?baudeau <benoit.thebaudeau@advansee.com>
> > > Cc: Fabio Estevam <fabio.estevam@freescale.com>
> > > Cc: Scott Wood <scottwood@freescale.com>
> > > Cc: Stefano Babic <sbabic@denx.de>
> > > Cc: Tom Rini <trini@ti.com>
> > > ---
> > >
> > > arch/arm/cpu/armv7/mx5/clock.c | 14 ++++++++++++--
> > > arch/arm/include/asm/arch-mx5/clock.h | 1 +
> > > 2 files changed, 13 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/arch/arm/cpu/armv7/mx5/clock.c
> > > b/arch/arm/cpu/armv7/mx5/clock.c
> > > index 76c2c52..431756e 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,15 @@ 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_CCGR5_EMI_ENFC(MXC_CCM_CCGR_CG_MASK),
> > > + MXC_CCM_CCGR5_EMI_ENFC(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.11.7
> >
> > Reviewed-by: Beno?t Th?baudeau <benoit.thebaudeau@advansee.com>
>
> Actually, this code is correct, but why is it needed? Indeed, this clock is
> already ungated by arch/arm/cpu/armv7/mx5/lowlevel_init.S.
This is not good, the code should be moved away from the assembly.
> Also, your board
> seems to be hardware-bootable only from NAND
This is incorrect, it is bootable from SD card as well.
> so in this case the boot ROM
> also ungates this clock itself.
We can not rely on that.
next prev parent reply other threads:[~2013-04-19 11:18 UTC|newest]
Thread overview: 59+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-19 4:10 [U-Boot] [PATCH 1/6] imx: Align the imximage header and payload to multiples of 4k Marek Vasut
2013-04-19 4:10 ` [U-Boot] [PATCH 2/6] nand: Add SPL_NAND support to mxc_nand_spl Marek Vasut
2013-04-19 8:38 ` Benoît Thébaudeau
2013-04-19 9:35 ` Benoît Thébaudeau
2013-04-19 11:14 ` Marek Vasut
2013-04-19 11:55 ` Benoît Thébaudeau
2013-04-19 13:46 ` Benoît Thébaudeau
2013-04-19 17:08 ` Marek Vasut
2013-04-20 13:00 ` Benoît Thébaudeau
2013-04-19 17:06 ` Marek Vasut
2013-04-20 13:06 ` Benoît Thébaudeau
2013-04-20 17:09 ` Marek Vasut
2013-04-19 13:00 ` Philip Paeps
2013-04-19 14:48 ` Philip Paeps
2013-04-19 14:53 ` Benoît Thébaudeau
2013-04-19 15:09 ` Philip Paeps
2013-04-19 15:21 ` Benoît Thébaudeau
2013-04-19 15:28 ` Benoît Thébaudeau
2013-04-19 15:41 ` Philip Paeps
2013-04-19 16:20 ` Tom Rini
2013-04-19 17:11 ` Marek Vasut
2013-04-19 4:10 ` [U-Boot] [PATCH 3/6] arm: imx: Fix u-boot-with-nand-spl.imx target Marek Vasut
2013-04-19 8:56 ` Benoît Thébaudeau
2013-04-19 11:16 ` Marek Vasut
2013-04-19 11:42 ` Benoît Thébaudeau
2013-04-19 11:51 ` Marek Vasut
2013-04-19 11:55 ` Tom Rini
2013-04-19 17:04 ` Marek Vasut
2013-04-19 4:10 ` [U-Boot] [PATCH 4/6] arm: mx5: Add SPL support code to MX5 Marek Vasut
2013-04-19 9:03 ` Benoît Thébaudeau
2013-04-19 13:10 ` Philip Paeps
2013-04-20 10:28 ` Marek Vasut
2013-04-21 0:38 ` Marek Vasut
2013-05-05 16:06 ` Stefano Babic
2013-04-19 4:10 ` [U-Boot] [PATCH 5/6] arm: mx5: Add NAND clock handling Marek Vasut
2013-04-19 9:02 ` Benoît Thébaudeau
2013-04-19 9:08 ` Benoît Thébaudeau
2013-04-19 11:18 ` Marek Vasut [this message]
2013-04-19 11:32 ` Benoît Thébaudeau
2013-05-05 16:04 ` Stefano Babic
2013-04-19 4:10 ` [U-Boot] [PATCH 6/6] arm: mx5: Add support for DENX M53EVK Marek Vasut
2013-04-19 5:52 ` Wolfgang Denk
2013-04-19 11:58 ` Marek Vasut
2013-04-19 12:58 ` Wolfgang Denk
2013-04-21 0:43 ` Marek Vasut
2013-04-21 6:35 ` Wolfgang Denk
2013-04-21 14:42 ` Marek Vasut
2013-04-21 22:13 ` Wolfgang Denk
2013-04-21 23:09 ` Marek Vasut
2013-04-22 11:19 ` Wolfgang Denk
2013-04-25 19:07 ` Marek Vasut
2013-04-19 9:22 ` Benoît Thébaudeau
2013-04-19 11:44 ` Marek Vasut
2013-04-19 12:54 ` Benoît Thébaudeau
2013-04-19 13:56 ` Benoît Thébaudeau
2013-04-19 14:49 ` Fabio Estevam
2013-04-21 2:32 ` Marek Vasut
2013-04-19 8:15 ` [U-Boot] [PATCH 1/6] imx: Align the imximage header and payload to multiples of 4k Benoît Thébaudeau
-- strict thread matches above, loose matches on Subject: below --
2013-04-21 15:52 [U-Boot] [PATCH V2 " Marek Vasut
2013-04-21 15:52 ` [U-Boot] [PATCH 5/6] arm: mx5: Add NAND clock handling Marek Vasut
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=201304191318.06457.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 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.