add SoC specific reset code

SVN-Revision: 13518
owl
Gabor Juhos 2008-12-04 18:13:43 +00:00
parent dedd0dceda
commit d9d111066a
1 changed files with 44 additions and 8 deletions

View File

@ -33,22 +33,58 @@ EXPORT_SYMBOL_GPL(ar71xx_usb_ctrl_base);
void ar71xx_device_stop(u32 mask) void ar71xx_device_stop(u32 mask)
{ {
unsigned long flags; unsigned long flags;
u32 t;
local_irq_save(flags); switch (ar71xx_soc) {
ar71xx_reset_wr(AR71XX_RESET_REG_RESET_MODULE, case AR71XX_SOC_AR7130:
ar71xx_reset_rr(AR71XX_RESET_REG_RESET_MODULE) | mask); case AR71XX_SOC_AR7141:
local_irq_restore(flags); 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); EXPORT_SYMBOL_GPL(ar71xx_device_stop);
void ar71xx_device_start(u32 mask) void ar71xx_device_start(u32 mask)
{ {
unsigned long flags; unsigned long flags;
u32 t;
local_irq_save(flags); switch (ar71xx_soc) {
ar71xx_reset_wr(AR71XX_RESET_REG_RESET_MODULE, case AR71XX_SOC_AR7130:
ar71xx_reset_rr(AR71XX_RESET_REG_RESET_MODULE) & ~mask); case AR71XX_SOC_AR7141:
local_irq_restore(flags); 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_start); EXPORT_SYMBOL_GPL(ar71xx_device_start);