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 v3 1/3] iomux-v3: Place pad control definitions into common file
Date: Thu, 25 Apr 2013 23:51:22 +0200 (CEST)	[thread overview]
Message-ID: <1038807210.259252.1366926682083.JavaMail.root@advansee.com> (raw)
In-Reply-To: <39456465.257907.1366921970551.JavaMail.root@advansee.com>

On Thursday, April 25, 2013 10:32:50 PM, Beno?t Th?baudeau wrote:
> Hi Stefano,
> 
> On Thursday, April 25, 2013 10:27:12 PM, Stefano Babic wrote:
> > On 10/04/2013 21:32, festevam at gmail.com wrote:
> > > From: Fabio Estevam <fabio.estevam@freescale.com>
> > > 
> > > Instead of having the same PAD control definition in each MX6 variant pin
> > > file,
> > > place it into a common location.
> > > 
> > > Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> > > ---
> > 
> > Hi Fabio,
> > 
> > > Changes since v2:
> > > - None
> > > Changes since v1:
> > > - Add missing IOMUX_CONFIG_SION definition to avoid breakage on mx6dl
> > > 
> > >  arch/arm/include/asm/arch-mx6/mx6dl_pins.h |   27
> > >  ---------------------------
> > >  arch/arm/include/asm/arch-mx6/mx6q_pins.h  |   27
> > >  ---------------------------
> > >  arch/arm/include/asm/imx-common/iomux-v3.h |   27
> > >  ++++++++++++++++++++++++++-
> > >  3 files changed, 26 insertions(+), 55 deletions(-)
> > > 
> > > diff --git a/arch/arm/include/asm/arch-mx6/mx6dl_pins.h
> > > b/arch/arm/include/asm/arch-mx6/mx6dl_pins.h
> > > index 9846f1b..0ed12f3 100644
> > > --- a/arch/arm/include/asm/arch-mx6/mx6dl_pins.h
> > > +++ b/arch/arm/include/asm/arch-mx6/mx6dl_pins.h
> > > @@ -22,33 +22,6 @@
> > >  
> > >  #include <asm/imx-common/iomux-v3.h>
> > >  
> > > -/* Use to set PAD control */
> > > -#define PAD_CTL_HYS		(1 << 16)
> > > -#define PAD_CTL_PUS_100K_DOWN	(0 << 14)
> > > -#define PAD_CTL_PUS_47K_UP	(1 << 14)
> > > -#define PAD_CTL_PUS_100K_UP	(2 << 14)
> > > -#define PAD_CTL_PUS_22K_UP	(3 << 14)
> > > -
> > > -#define PAD_CTL_PUE		(1 << 13)
> > > -#define PAD_CTL_PKE		(1 << 12)
> > > -#define PAD_CTL_ODE		(1 << 11)
> > > -#define PAD_CTL_SPEED_LOW	(1 << 6)
> > > -#define PAD_CTL_SPEED_MED	(2 << 6)
> > > -#define PAD_CTL_SPEED_HIGH	(3 << 6)
> > > -#define PAD_CTL_DSE_DISABLE	(0 << 3)
> > > -#define PAD_CTL_DSE_240ohm	(1 << 3)
> > > -#define PAD_CTL_DSE_120ohm	(2 << 3)
> > > -#define PAD_CTL_DSE_80ohm	(3 << 3)
> > > -#define PAD_CTL_DSE_60ohm	(4 << 3)
> > > -#define PAD_CTL_DSE_48ohm	(5 << 3)
> > > -#define PAD_CTL_DSE_40ohm	(6 << 3)
> > > -#define PAD_CTL_DSE_34ohm	(7 << 3)
> > > -#define PAD_CTL_SRE_FAST	(1 << 0)
> > > -#define PAD_CTL_SRE_SLOW	(0 << 0)
> > > -
> > 
> > I have applied this patch and I have found now that this breaks some
> > MX51 boards, such as efika. In fact, the same defines are set also in
> > /home/stefano/Projects/imx/u-boot-imx/include/asm/arch/iomux-mx51.h.
> > 
> > Checking in the manual, I see that values in iomux-mx51.h are correct,
> > and they simply differs from the ones of MX6. We can simply add a #ifdef
> > CONFIG_MX51 in arch/arm/include/asm/imx-common/iomux-v3.h to fix it, but
> > anyway I suppose that the mx51evk does not work correctly. Can you take
> > a look at this issue ?
> 
> I have already made a patch for that among other things. I will post it
> tomorrow.

My patch consists in moving all iomux-v3 imx pad control definitions to
iomux-v3.h, like this:
#ifdef CONFIG_MX6
#define mx6 pad control stuff, which is common to mx6x
#else
#define non-mx6 pad control stuff, which is common to mx25/35/5x
#endif

I have also integrated PKE and PUE to pull value definitions on i.MX6, just like
on i.MX51 and in mainline Linux, which made me notice that some mx6 boards
define a SPI_PAD_CTRL with PAD_CTL_PUS_100K_DOWN but without PAD_CTL_PKE and
PAD_CTL_PUE, which means that no pull is actually enabled. Hence, I have just
dropped the PAD_CTL_PUS_100K_DOWN from those SPI_PAD_CTRL in order to have no
change of behavior, but there might be a bug to fix on those boards.

I am working on converting mx25/35/5x to imx-common iomux-v3. I have noticed in
arch/arm/cpu/armv7/mx5/iomux.c some "is_soc_rev(CHIP_REV_2_0)" that make this
change quite complicated for mx51. There is no such thing in mainline Linux.
Fabio, is it OK to drop this support for older mx51 revisions in mainline
U-Boot?

Best regards,
Beno?t

  reply	other threads:[~2013-04-25 21:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-10 19:32 [U-Boot] [PATCH v3 1/3] iomux-v3: Place pad control definitions into common file festevam at gmail.com
2013-04-25 20:27 ` Stefano Babic
2013-04-25 20:32   ` Benoît Thébaudeau
2013-04-25 21:51     ` Benoît Thébaudeau [this message]
2013-04-25 22:00       ` Fabio Estevam
2013-04-26  6:50     ` Stefano Babic

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=1038807210.259252.1366926682083.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