public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
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:56:06 +0100	[thread overview]
Message-ID: <201202061356.06397.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.
> 
> ioreg = (io == MXC_IOCLK0) is not the same. The actual value of
> io != MXC_IOCLK0 it compiler implementation depending.
> 
> > 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.
> 
> > 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.
> 
> Cheers,
> 
>         Robert.

btw. a quick hint:

git reset HEAD^
git add -p

Add only the reg32 changes, commit, add the rest, commit. Send ;-)

M

  parent reply	other threads:[~2012-02-06 12:56 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
2012-02-06 13:03       ` Robert Deliën
2012-02-06 13:15         ` Marek Vasut
2012-02-06 12:56     ` Marek Vasut [this message]
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=201202061356.06397.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox