aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ar71xx/files
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2009-12-11 20:32:28 +0000
committerGabor Juhos <juhosg@openwrt.org>2009-12-11 20:32:28 +0000
commitb67365f9ac8b42575e489b0613dae3aa960ff4b6 (patch)
treea3b5554e69b9606bdd144b38f33bd9dec104e230 /target/linux/ar71xx/files
parent9e3bcab8f3bc9eb823220ec7da8e8e5e7c579af6 (diff)
downloadupstream-b67365f9ac8b42575e489b0613dae3aa960ff4b6.tar.gz
upstream-b67365f9ac8b42575e489b0613dae3aa960ff4b6.tar.bz2
upstream-b67365f9ac8b42575e489b0613dae3aa960ff4b6.zip
ar71xx: add ar71xx_device_stopped function
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@18757 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/ar71xx/files')
-rw-r--r--target/linux/ar71xx/files/arch/mips/ar71xx/ar71xx.c35
-rw-r--r--target/linux/ar71xx/files/arch/mips/include/asm/mach-ar71xx/ar71xx.h1
2 files changed, 36 insertions, 0 deletions
diff --git a/target/linux/ar71xx/files/arch/mips/ar71xx/ar71xx.c b/target/linux/ar71xx/files/arch/mips/ar71xx/ar71xx.c
index 2a9dff3111..0eddf26fbb 100644
--- a/target/linux/ar71xx/files/arch/mips/ar71xx/ar71xx.c
+++ b/target/linux/ar71xx/files/arch/mips/ar71xx/ar71xx.c
@@ -113,6 +113,41 @@ void ar71xx_device_start(u32 mask)
}
EXPORT_SYMBOL_GPL(ar71xx_device_start);
+int ar71xx_device_stopped(u32 mask)
+{
+ unsigned long flags;
+ u32 t;
+
+ switch (ar71xx_soc) {
+ case AR71XX_SOC_AR7130:
+ case AR71XX_SOC_AR7141:
+ case AR71XX_SOC_AR7161:
+ local_irq_save(flags);
+ t = ar71xx_reset_rr(AR71XX_RESET_REG_RESET_MODULE);
+ local_irq_restore(flags);
+ break;
+
+ case AR71XX_SOC_AR7240:
+ local_irq_save(flags);
+ t = ar71xx_reset_rr(AR724X_RESET_REG_RESET_MODULE);
+ local_irq_restore(flags);
+ break;
+
+ case AR71XX_SOC_AR9130:
+ case AR71XX_SOC_AR9132:
+ local_irq_save(flags);
+ t = ar71xx_reset_rr(AR91XX_RESET_REG_RESET_MODULE);
+ local_irq_restore(flags);
+ break;
+
+ default:
+ BUG();
+ }
+
+ return ((t & mask) == mask);
+}
+EXPORT_SYMBOL_GPL(ar71xx_device_stopped);
+
void ar71xx_ddr_flush(u32 reg)
{
ar71xx_ddr_wr(reg, 1);
diff --git a/target/linux/ar71xx/files/arch/mips/include/asm/mach-ar71xx/ar71xx.h b/target/linux/ar71xx/files/arch/mips/include/asm/mach-ar71xx/ar71xx.h
index 48f6e0a654..e68276698d 100644
--- a/target/linux/ar71xx/files/arch/mips/include/asm/mach-ar71xx/ar71xx.h
+++ b/target/linux/ar71xx/files/arch/mips/include/asm/mach-ar71xx/ar71xx.h
@@ -510,6 +510,7 @@ static inline u32 ar71xx_reset_rr(unsigned reg)
void ar71xx_device_stop(u32 mask);
void ar71xx_device_start(u32 mask);
+int ar71xx_device_stopped(u32 mask);
/*
* SPI block