aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2008-12-04 18:13:43 +0000
committerGabor Juhos <juhosg@openwrt.org>2008-12-04 18:13:43 +0000
commitd9d111066a86e47d9913cd9e7d5cd18dadc8af81 (patch)
treefae30507c18e824e659d67bb9e7e504cef0f1b2c
parentdedd0dcedae58600ef20183877942c9e820b5ba4 (diff)
downloadupstream-d9d111066a86e47d9913cd9e7d5cd18dadc8af81.tar.gz
upstream-d9d111066a86e47d9913cd9e7d5cd18dadc8af81.tar.bz2
upstream-d9d111066a86e47d9913cd9e7d5cd18dadc8af81.zip
add SoC specific reset code
SVN-Revision: 13518
-rw-r--r--target/linux/ar71xx/files/arch/mips/ar71xx/ar71xx.c52
1 files changed, 44 insertions, 8 deletions
diff --git a/target/linux/ar71xx/files/arch/mips/ar71xx/ar71xx.c b/target/linux/ar71xx/files/arch/mips/ar71xx/ar71xx.c
index 25ec06205b..f224e82c0c 100644
--- a/target/linux/ar71xx/files/arch/mips/ar71xx/ar71xx.c
+++ b/target/linux/ar71xx/files/arch/mips/ar71xx/ar71xx.c
@@ -33,22 +33,58 @@ EXPORT_SYMBOL_GPL(ar71xx_usb_ctrl_base);
void ar71xx_device_stop(u32 mask)
{
unsigned long flags;
+ u32 t;
- local_irq_save(flags);
- ar71xx_reset_wr(AR71XX_RESET_REG_RESET_MODULE,
- ar71xx_reset_rr(AR71XX_RESET_REG_RESET_MODULE) | mask);
- local_irq_restore(flags);
+ 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);
+ ar71xx_reset_wr(AR71XX_RESET_REG_RESET_MODULE, t | mask);
+ 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);
+ ar71xx_reset_wr(AR91XX_RESET_REG_RESET_MODULE, t | mask);
+ local_irq_restore(flags);
+ break;
+
+ default:
+ BUG();
+ }
}
EXPORT_SYMBOL_GPL(ar71xx_device_stop);
void ar71xx_device_start(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);
+ ar71xx_reset_wr(AR71XX_RESET_REG_RESET_MODULE, t & ~mask);
+ 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);
+ ar71xx_reset_wr(AR91XX_RESET_REG_RESET_MODULE, t & ~mask);
+ local_irq_restore(flags);
+ break;
- local_irq_save(flags);
- ar71xx_reset_wr(AR71XX_RESET_REG_RESET_MODULE,
- ar71xx_reset_rr(AR71XX_RESET_REG_RESET_MODULE) & ~mask);
- local_irq_restore(flags);
+ default:
+ BUG();
+ }
}
EXPORT_SYMBOL_GPL(ar71xx_device_start);