public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Li Ye-B37916 <b37916@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 3/5] arm:imx-common introduce a new function to set gpr
Date: Sat, 1 Nov 2014 15:39:36 +0800	[thread overview]
Message-ID: <54548E38.3080106@freescale.com> (raw)
In-Reply-To: <1414808359-4750-4-git-send-email-Peng.Fan@freescale.com>

Hi Peng,

 

On 11/1/2014 10:19 AM, Peng Fan wrote:
> Add a new function mxc_iomux_set_gpr_register to
> set the iomux gpr register.
>
> 32-bit general purpose registers according to SoC
> requirements for any usage.
>
> Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
> Signed-off-by: Ye.Li <B37916@freescale.com>
> Signed-off-by: Nitin Garg <nitin.garg@freescale.com>
> ---
>  arch/arm/imx-common/iomux-v3.c | 25 +++++++++++++++++++++++++
>  1 file changed, 25 insertions(+)
>
> diff --git a/arch/arm/imx-common/iomux-v3.c b/arch/arm/imx-common/iomux-v3.c
> index 22cd11a..b27aab8 100644
> --- a/arch/arm/imx-common/iomux-v3.c
> +++ b/arch/arm/imx-common/iomux-v3.c
> @@ -77,3 +77,28 @@ void imx_iomux_v3_setup_multiple_pads(iomux_v3_cfg_t const *pad_list,
>  		p += stride;
>  	}
>  }
> +
> +/*
> + * Configure the IOMUX General Purpose Registers.
> + *
> + * @group, which gpr register to configure.
> + * @start_bit, the first bit to set
> + * @num_bits, how many bits to set
> + * @value, the value will be set to [start_bits...start_bits+num_bits-1]
> + */
> +void mxc_iomux_set_gpr_register(int group, int start_bit, int num_bits,
> +				int value)
> +{
> +	int i = 0;
> +	u32 reg;
> +
> +	reg = readl(base + group * 4);
> +	while (num_bits) {
> +		reg &= ~(1 << (start_bit + i));
> +		i++;
> +		num_bits--;
> +	}
> +
> +	reg |= (value << start_bit);
> +	writel(reg, base + group * 4);
> +}
This function is already in my previous patch (http://patchwork.ozlabs.org/patch/405013/). The function name is changed to imx_iomux_set_gpr_register. 

 

Best regards,

Ye Li

  reply	other threads:[~2014-11-01  7:39 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-01  2:19 [U-Boot] [PATCH 0/5] add usb support for mx6 board Peng Fan
2014-11-01  2:19 ` [U-Boot] [PATCH 1/5] imx:mx6sxsabresd add usb support Peng Fan
2014-11-01  7:45   ` Li Ye-B37916
2014-11-01 13:45   ` Fabio Estevam
2014-11-03 12:28   ` Stefano Babic
2014-11-03 13:32     ` Peng Fan
2014-11-01  2:19 ` [U-Boot] [PATCH 2/5] imx:mx6slevk " Peng Fan
2014-11-01 13:44   ` Fabio Estevam
2014-11-01  2:19 ` [U-Boot] [PATCH 3/5] arm:imx-common introduce a new function to set gpr Peng Fan
2014-11-01  7:39   ` Li Ye-B37916 [this message]
2014-11-01 10:49     ` Peng Fan
2014-11-01 13:44   ` Wolfgang Denk
2014-11-01  2:19 ` [U-Boot] [PATCH 4/5] imx:mx6qarm2 add usb support Peng Fan
2014-11-01  2:19 ` [U-Boot] [PATCH 5/5] imx:mx6sabresd " Peng Fan

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=54548E38.3080106@freescale.com \
    --to=b37916@freescale.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