From patchwork Mon May 7 07:26:06 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Virdi X-Patchwork-Id: 157230 X-Patchwork-Delegate: sr@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 2A6BDB6FC5 for ; Mon, 7 May 2012 17:26:48 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8018B28098; Mon, 7 May 2012 09:26:44 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YGCUxyiFHyo1; Mon, 7 May 2012 09:26:43 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 58B412808B; Mon, 7 May 2012 09:26:42 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9F00528086 for ; Mon, 7 May 2012 09:26:38 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Oxe0Rla-MMvT for ; Mon, 7 May 2012 09:26:38 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from eu1sys200aog106.obsmtp.com (eu1sys200aog106.obsmtp.com [207.126.144.121]) by theia.denx.de (Postfix) with ESMTPS id 4665F28088 for ; Mon, 7 May 2012 09:26:35 +0200 (CEST) Received: from beta.dmz-ap.st.com ([138.198.100.35]) (using TLSv1) by eu1sys200aob106.postini.com ([207.126.147.11]) with SMTP ID DSNKT6d5KM4V9N2mp4OPTn5epzD090QytUj5@postini.com; Mon, 07 May 2012 07:26:37 UTC Received: from zeta.dmz-ap.st.com (ns6.st.com [138.198.234.13]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 6CF29D7; Mon, 7 May 2012 07:18:08 +0000 (GMT) Received: from Webmail-ap.st.com (eapex1hubcas2.st.com [10.80.176.10]) by zeta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 4D151C2D; Mon, 7 May 2012 07:26:29 +0000 (GMT) Received: from localhost (10.199.7.86) by Webmail-ap.st.com (10.80.176.7) with Microsoft SMTP Server (TLS) id 8.3.192.1; Mon, 7 May 2012 15:26:18 +0800 From: Amit Virdi To: Date: Mon, 7 May 2012 12:56:06 +0530 Message-ID: <3a0f0bea129713110ae7ab4ade4274e21e722399.1336374946.git.amit.virdi@st.com> X-Mailer: git-send-email 1.7.2.2 In-Reply-To: References: MIME-Version: 1.0 Cc: scottwood@freescale.com, Amit Virdi , sr@denx.de, spear-devel@list.st.com Subject: [U-Boot] [PATCH V2 1/4] ARM: Define change_bit routine X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de From: Vipin KUMAR change_bit routine is left implementation dependent until now. This routine 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 Signed-off-by: Amit Virdi --- arch/arm/include/asm/bitops.h | 11 +++++++++-- 1 files changed, 9 insertions(+), 2 deletions(-) diff --git a/arch/arm/include/asm/bitops.h b/arch/arm/include/asm/bitops.h index 879e20e..8ce1405 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,15 @@ static inline void __change_bit(int nr, volatile void *addr) *p ^= mask; } +static inline void change_bit(int nr, volatile void *addr) +{ + unsigned long flags; + + local_irq_save(flags); + __change_bit(nr, addr); + local_irq_restore(flags); +} + static inline int __test_and_set_bit(int nr, volatile void *addr) { unsigned long mask = BIT_MASK(nr);