4 * Copyright (C) 2008 Gabor Juhos <juhosg@openwrt.org>
5 * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as published
9 * by the Free Software Foundation.
12 #include <linux/kernel.h>
13 #include <linux/module.h>
14 #include <linux/types.h>
16 #include <asm/mach-ar71xx/ar71xx.h>
18 void __iomem
*ar71xx_ddr_base
;
19 void __iomem
*ar71xx_pll_base
;
20 void __iomem
*ar71xx_reset_base
;
21 void __iomem
*ar71xx_gpio_base
;
22 void __iomem
*ar71xx_usb_ctrl_base
;
24 void ar71xx_device_stop(u32 mask
)
28 local_irq_save(flags
);
29 ar71xx_reset_wr(RESET_REG_RESET_MODULE
,
30 ar71xx_reset_rr(RESET_REG_RESET_MODULE
) | mask
);
31 local_irq_restore(flags
);
33 EXPORT_SYMBOL_GPL(ar71xx_device_stop
);
35 void ar71xx_device_start(u32 mask
)
39 local_irq_save(flags
);
40 ar71xx_reset_wr(RESET_REG_RESET_MODULE
,
41 ar71xx_reset_rr(RESET_REG_RESET_MODULE
) & ~mask
);
42 local_irq_restore(flags
);
44 EXPORT_SYMBOL_GPL(ar71xx_device_start
);
46 void ar71xx_ddr_flush(u32 reg
)
48 ar71xx_ddr_wr(reg
, 1);
49 while ((ar71xx_ddr_rr(reg
) & 0x1));
51 ar71xx_ddr_wr(reg
, 1);
52 while ((ar71xx_ddr_rr(reg
) & 0x1));
54 EXPORT_SYMBOL_GPL(ar71xx_ddr_flush
);