public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Scott Wood <scottwood@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH V4 1/4] ARM: Define change_bit routine
Date: Fri, 18 May 2012 10:43:13 -0500	[thread overview]
Message-ID: <4FB66E11.50003@freescale.com> (raw)
In-Reply-To: <cbe6d45427797fa5f4f8ef493006a5d7676e935d.1337320291.git.amit.virdi@st.com>

On 05/18/2012 01:00 AM, Amit Virdi wrote:
> From: Vipin KUMAR <vipin.kumar@st.com>
> 
> change_bit routine is left implementation dependent until now.
> This routine, which is basically a wrapper over __change_bit, is now defined for
> arm platforms in asm-arm/bitops.h
> 
> The Flexible Static memory controller driver, placed in
> mtd/nand/fsmc_nand.c needs this routine. FSMC is a memory controller
> peripheral from ST. The new driver implements the NAND interface part
> of the peripheral.
> 
> Signed-off-by: Vipin Kumar <vipin.kumar@st.com>
> Signed-off-by: Amit Virdi <amit.virdi@st.com>
> ---
>  arch/arm/include/asm/bitops.h |    7 +++++--
>  1 files changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm/include/asm/bitops.h b/arch/arm/include/asm/bitops.h
> index 879e20e..7fe9c6d 100644
> --- a/arch/arm/include/asm/bitops.h
> +++ b/arch/arm/include/asm/bitops.h
> @@ -29,8 +29,6 @@ extern void set_bit(int nr, volatile void * addr);
>  
>  extern void clear_bit(int nr, volatile void * addr);
>  
> -extern void change_bit(int nr, volatile void * addr);
> -
>  static inline void __change_bit(int nr, volatile void *addr)
>  {
>  	unsigned long mask = BIT_MASK(nr);
> @@ -39,6 +37,11 @@ static inline void __change_bit(int nr, volatile void *addr)
>  	*p ^= mask;
>  }
>  
> +static inline void change_bit(int nr, volatile void *addr)
> +{
> +	__change_bit(nr, addr);
> +}
> +
>  static inline int __test_and_set_bit(int nr, volatile void *addr)
>  {
>  	unsigned long mask = BIT_MASK(nr);

While they're not used much, U-Boot does have interrupt support (at
least on powerpc -- not sure about ARM), so this should be atomic
against interrupts.

The NAND driver should be using __change_bit() instead.

-Scott

  reply	other threads:[~2012-05-18 15:43 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-18  6:00 [U-Boot] [PATCH V4 0/4] mtd/NAND: Support for FSMC controller Amit Virdi
2012-05-18  6:00 ` [U-Boot] [PATCH V4 1/4] ARM: Define change_bit routine Amit Virdi
2012-05-18 15:43   ` Scott Wood [this message]
2012-05-22 10:14     ` Amit Virdi
2012-05-22 15:51       ` Wolfgang Denk
2012-05-24  4:18         ` Amit Virdi
2012-05-18  6:00 ` [U-Boot] [PATCH V4 2/4] mtd/NAND: Add FSMC driver support Amit Virdi
2012-05-18  6:00 ` [U-Boot] [PATCH V4 3/4] SPEAr: Configure FSMC driver for NAND interface Amit Virdi
2012-05-18  6:00 ` [U-Boot] [PATCH V4 4/4] mtd/NAND: Remove obsolete SPEAr specific NAND drivers Amit Virdi

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=4FB66E11.50003@freescale.com \
    --to=scottwood@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