From c89aff54c076ff28bf1d0ea64dc416febd6c29b4 Mon Sep 17 00:00:00 2001 From: nbd Date: Tue, 17 Jul 2012 11:35:34 -0400 Subject: [PATCH 106/123] 503-MIPS-ath79-add-flash-acquire-release Import of the above patch from openwrt trunk, as of this commit: ---------- commit c1d79f64eed0a7ac36b5b9bca52275b397bec424 Author: nbd Date: Mon Jul 16 16:26:51 2012 +0000 uboot-ar71xx: fix compile on recent mac os x versions git-svn-id: svn://svn.openwrt.org/openwrt/trunk@32750 3c298f89-4303-0410-b956-a3cf2f4a3e73 ---------- Path to patch in the repo is: target/linux/ar71xx/patches-3.3 Repo is: git://nbd.name/openwrt.git Signed-off-by: Paul Gortmaker --- arch/mips/ath79/common.c | 13 +++++++++++++ arch/mips/include/asm/mach-ath79/ath79.h | 3 +++ 2 files changed, 16 insertions(+) diff --git a/arch/mips/ath79/common.c b/arch/mips/ath79/common.c index 5a4adfc..ee98b57 100644 --- a/arch/mips/ath79/common.c +++ b/arch/mips/ath79/common.c @@ -22,6 +22,7 @@ #include "common.h" static DEFINE_SPINLOCK(ath79_device_reset_lock); +static DEFINE_MUTEX(ath79_flash_mutex); u32 ath79_cpu_freq; EXPORT_SYMBOL_GPL(ath79_cpu_freq); @@ -107,3 +108,15 @@ void ath79_device_reset_clear(u32 mask) spin_unlock_irqrestore(&ath79_device_reset_lock, flags); } EXPORT_SYMBOL_GPL(ath79_device_reset_clear); + +void ath79_flash_acquire(void) +{ + mutex_lock(&ath79_flash_mutex); +} +EXPORT_SYMBOL_GPL(ath79_flash_acquire); + +void ath79_flash_release(void) +{ + mutex_unlock(&ath79_flash_mutex); +} +EXPORT_SYMBOL_GPL(ath79_flash_release); diff --git a/arch/mips/include/asm/mach-ath79/ath79.h b/arch/mips/include/asm/mach-ath79/ath79.h index a02a333..1c33574 100644 --- a/arch/mips/include/asm/mach-ath79/ath79.h +++ b/arch/mips/include/asm/mach-ath79/ath79.h @@ -126,4 +126,7 @@ static inline u32 ath79_reset_rr(unsigned reg) void ath79_device_reset_set(u32 mask); void ath79_device_reset_clear(u32 mask); +void ath79_flash_acquire(void); +void ath79_flash_release(void); + #endif /* __ASM_MACH_ATH79_H */ -- 1.7.9.7