diff options
author | juhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2008-07-21 17:08:14 +0000 |
---|---|---|
committer | juhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2008-07-21 17:08:14 +0000 |
commit | 546b5ed544503182a9b3e981bc11feebd6042b21 (patch) | |
tree | 10ae3895974888be85ce09abee24fe67b5fbd813 /target/linux/ar71xx/files/arch/mips/ar71xx/ar71xx.c | |
parent | 541dcce6ec450a2aceaf1b42b67b16ebfc9730aa (diff) |
surprise :p
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@11894 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/ar71xx/files/arch/mips/ar71xx/ar71xx.c')
-rw-r--r-- | target/linux/ar71xx/files/arch/mips/ar71xx/ar71xx.c | 55 |
1 files changed, 55 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 new file mode 100644 index 000000000..c88225c5f --- /dev/null +++ b/target/linux/ar71xx/files/arch/mips/ar71xx/ar71xx.c @@ -0,0 +1,55 @@ +/* + * AR71xx SoC routines + * + * Copyright (C) 2008 Gabor Juhos <juhosg@openwrt.org> + * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org> + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published + * by the Free Software Foundation. + */ + +#include <linux/kernel.h> +#include <linux/module.h> +#include <linux/types.h> + +#include <asm/mach-ar71xx/ar71xx.h> + +void __iomem *ar71xx_ddr_base; +void __iomem *ar71xx_pll_base; +void __iomem *ar71xx_reset_base; +void __iomem *ar71xx_gpio_base; +void __iomem *ar71xx_usb_ctrl_base; + +void ar71xx_device_stop(u32 mask) +{ + unsigned long flags; + + local_irq_save(flags); + ar71xx_reset_wr(RESET_REG_RESET_MODULE, + ar71xx_reset_rr(RESET_REG_RESET_MODULE) | mask); + local_irq_restore(flags); +} +EXPORT_SYMBOL_GPL(ar71xx_device_stop); + +void ar71xx_device_start(u32 mask) +{ + unsigned long flags; + + local_irq_save(flags); + ar71xx_reset_wr(RESET_REG_RESET_MODULE, + ar71xx_reset_rr(RESET_REG_RESET_MODULE) & ~mask); + local_irq_restore(flags); +} +EXPORT_SYMBOL_GPL(ar71xx_device_start); + +void ar71xx_ddr_flush(u32 reg) +{ + ar71xx_ddr_wr(reg, 1); + while ((ar71xx_ddr_rr(reg) & 0x1)); + + ar71xx_ddr_wr(reg, 1); + while ((ar71xx_ddr_rr(reg) & 0x1)); +} +EXPORT_SYMBOL_GPL(ar71xx_ddr_flush); + |