public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Stefano Babic <sbabic@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] mx5 iomux: Fix GPIO with SION
Date: Fri, 17 Aug 2012 13:39:04 +0200	[thread overview]
Message-ID: <502E2D58.1090004@denx.de> (raw)
In-Reply-To: <553308062.2400317.1344952122645.JavaMail.root@advansee.com>

On 14/08/2012 15:48, Beno?t Th?baudeau wrote:
> IOMUX_CONFIG_GPIO may be used together with IOMUX_CONFIG_SION, so don't break
> the iomux function value set to the register in this case.
> 
> Define the value of IOMUX_CONFIG_GPIO in a way showing that it should have
> only 1 bit set.
> 
> Signed-off-by: Beno?t Th?baudeau <benoit.thebaudeau@advansee.com>
> Cc: Stefano Babic <sbabic@denx.de>
> ---

Hi Beno?t,

to my understanding. The SION bit is used to set a predefined function,
independently from the value of the iomux. So I have the choice to set
the SION bit or I select the function I want, including GPIO, clearing
the SION bit, and setting optionally the daisy chain register if the
GPIO requires.

So why should we use both SION and GPIO ?

Regards,
Stefano

>  .../arch/arm/cpu/armv7/mx5/iomux.c                 |    5 +++--
>  .../arch/arm/include/asm/arch-mx5/iomux.h          |    2 +-
>  2 files changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git u-boot-4d3c95f.orig/arch/arm/cpu/armv7/mx5/iomux.c u-boot-4d3c95f/arch/arm/cpu/armv7/mx5/iomux.c
> index d4e3bbb..7adf08f 100644
> --- u-boot-4d3c95f.orig/arch/arm/cpu/armv7/mx5/iomux.c
> +++ u-boot-4d3c95f/arch/arm/cpu/armv7/mx5/iomux.c
> @@ -124,8 +124,9 @@ static void iomux_config_mux(iomux_pin_name_t pin, iomux_pin_cfg_t cfg)
>  
>  	if ((mux_reg > get_mux_end()) || (mux_reg < IOMUXSW_MUX_CTL))
>  		return ;
> -	if (cfg == IOMUX_CONFIG_GPIO)
> -		writel(PIN_TO_ALT_GPIO(pin), mux_reg);
> +	if (cfg & IOMUX_CONFIG_GPIO)
> +		writel((cfg & ~IOMUX_CONFIG_GPIO) | PIN_TO_ALT_GPIO(pin),
> +			mux_reg);
>  	else
>  		writel(cfg, mux_reg);
>  }
> diff --git u-boot-4d3c95f.orig/arch/arm/include/asm/arch-mx5/iomux.h u-boot-4d3c95f/arch/arm/include/asm/arch-mx5/iomux.h
> index e3765a3..8b6e56a 100644
> --- u-boot-4d3c95f.orig/arch/arm/include/asm/arch-mx5/iomux.h
> +++ u-boot-4d3c95f/arch/arm/include/asm/arch-mx5/iomux.h
> @@ -40,7 +40,7 @@ typedef enum iomux_config {
>  	IOMUX_CONFIG_ALT5,	/*!< used as alternate function 5 */
>  	IOMUX_CONFIG_ALT6,	/*!< used as alternate function 6 */
>  	IOMUX_CONFIG_ALT7,	/*!< used as alternate function 7 */
> -	IOMUX_CONFIG_GPIO,	/*!< added to help user use GPIO mode */
> +	IOMUX_CONFIG_GPIO = 0x1 << 3,	/*!< added to help user use GPIO mode */
>  	IOMUX_CONFIG_SION = 0x1 << 4,	/*!< used as LOOPBACK:MUX SION bit */
>  } iomux_pin_cfg_t;
>  
> 


-- 
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================

  reply	other threads:[~2012-08-17 11:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-14 13:48 [U-Boot] [PATCH] mx5 iomux: Fix GPIO with SION Benoît Thébaudeau
2012-08-17 11:39 ` Stefano Babic [this message]
2012-08-17 16:21   ` Benoît Thébaudeau
2012-08-17 20:06     ` Stefano Babic
2012-08-17 20:21       ` Benoît Thébaudeau

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=502E2D58.1090004@denx.de \
    --to=sbabic@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox