From: Marek Vasut <marek.vasut@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/2] v2 i.MX28: Fix ref_cpu clock setup
Date: Mon, 6 Feb 2012 13:49:03 +0100 [thread overview]
Message-ID: <201202061349.03429.marek.vasut@gmail.com> (raw)
In-Reply-To: <6EA3E0BCC03CC34B89B01BD57ECBC718F651F8@POBOX.postoffice.danego.net>
> Hi Marek,
>
> > - if (io == MXC_IOCLK0) {
> > - writel(CLKCTRL_FRAC0_CLKGATEIO0,
> > - &clkctrl_regs->hw_clkctrl_frac0_set);
> > - clrsetbits_le32(&clkctrl_regs->hw_clkctrl_frac0,
> > - CLKCTRL_FRAC0_IO0FRAC_MASK,
> > - div << CLKCTRL_FRAC0_IO0FRAC_OFFSET);
> > - writel(CLKCTRL_FRAC0_CLKGATEIO0,
> > - &clkctrl_regs->hw_clkctrl_frac0_clr);
> > - } else {
> > - writel(CLKCTRL_FRAC0_CLKGATEIO1,
> > - &clkctrl_regs->hw_clkctrl_frac0_set);
> > - clrsetbits_le32(&clkctrl_regs->hw_clkctrl_frac0,
> > - CLKCTRL_FRAC0_IO1FRAC_MASK,
> > - div << CLKCTRL_FRAC0_IO1FRAC_OFFSET);
> > - writel(CLKCTRL_FRAC0_CLKGATEIO1,
> > - &clkctrl_regs->hw_clkctrl_frac0_clr);
> > - }
> >
> > I think you're mixing two things together above. This patch and some kind
> > of a cleanup. But ok, thinking of this, it seems context related.
>
> Yeah, duplicate code didn't feel right. Besides, the code didn't check for
> values larger than MXC_IOCLK0, which is does now.
>
> > > + io_reg = CLKCTRL_FRAC0_IO0 - (io - MXC_IOCLK0);
> >
> > Uh ... ioreg = (io == MXC_IOCLK0) ? something : another; or stuff like
> > that might be better. The math above is really confusing. Or you can
> > even enumerate enum mxs_ioclock so that you won't need this math at all,
> > which is even better.
>
> I came accross an enumerator in the code, but I found that too big of a
> change to slip in, because it alters the external interface. But we're not
> done with the code yet. Plenty of oppertunities left.
Not really, fixing the enumeration should be fine I believe.
>
> ioreg = (io == MXC_IOCLK0) is not the same. The actual value of
> io != MXC_IOCLK0 it compiler implementation depending.
That's why I put the ternary operator there ?
>
> > Can you actually separate out the rename to register_32 and then the
> > fixup patch for register_8?
>
> I'd rather not: I'm down to my neck it work and I don't these two parts in
> my archive so that means manual merging, verifying and for another two
> hours.
It's impossible to review like this though and much more prone to pull in bugs.
>
> > Rest seems ok
>
> Can you see if our server swapped tabs for spaces? It's beyond my grasp how
> M$ considers it a good idea to alter to contents of my email.
It didnt.
>
> Cheers,
>
> Robert.
next prev parent reply other threads:[~2012-02-06 12:49 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <6EA3E0BCC03CC34B89B01BD57ECBC718F65163@POBOX.postoffice.danego.net>
2012-02-06 12:20 ` [U-Boot] [PATCH 1/2] v2 i.MX28: Fix ref_cpu clock setup Marek Vasut
2012-02-06 12:33 ` Robert Deliën
2012-02-06 12:49 ` Marek Vasut [this message]
2012-02-06 13:03 ` Robert Deliën
2012-02-06 13:15 ` Marek Vasut
2012-02-06 12:56 ` Marek Vasut
2012-02-06 14:28 ` Robert Deliën
2012-02-06 14:40 ` Marek Vasut
2012-02-06 12:20 ` Marek Vasut
2012-02-06 12:38 ` Robert Deliën
2012-02-06 12:49 ` 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=201202061349.03429.marek.vasut@gmail.com \
--to=marek.vasut@gmail.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 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.