summaryrefslogtreecommitdiff
path: root/arch/arm/cpu/armv7/sunxi/prcm.c
diff options
context:
space:
mode:
authorChen-Yu Tsai <wens@csie.org>2014-10-22 16:47:46 +0800
committerHans de Goede <hdegoede@redhat.com>2014-10-24 09:35:39 +0200
commit472ed0641e73ea5c5b80f9bfa804bfe0f89eca69 (patch)
treefe5b47a857cbe3ccfc1f923bbf8a5f41d758fe35 /arch/arm/cpu/armv7/sunxi/prcm.c
parente373aad32a06110e60af52c58b32d32fe8417bbd (diff)
ARM: sunxi: Allow specifying module in prcm apb0 init function
The prcm apb0 controls multiple modules. Allow specifying which modules to enable clocks and de-assert resets so the function can be reused. Signed-off-by: Chen-Yu Tsai <wens@csie.org> Acked-by: Ian Campbell <ijc@hellion.org.uk>
Diffstat (limited to 'arch/arm/cpu/armv7/sunxi/prcm.c')
-rw-r--r--arch/arm/cpu/armv7/sunxi/prcm.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/arch/arm/cpu/armv7/sunxi/prcm.c b/arch/arm/cpu/armv7/sunxi/prcm.c
index 7b3ee89302..19b4938dc9 100644
--- a/arch/arm/cpu/armv7/sunxi/prcm.c
+++ b/arch/arm/cpu/armv7/sunxi/prcm.c
@@ -21,13 +21,15 @@
#include <asm/arch/prcm.h>
#include <asm/arch/sys_proto.h>
-void prcm_init_apb0(void)
+/* APB0 clock gate and reset bit offsets are the same. */
+void prcm_apb0_enable(u32 flags)
{
struct sunxi_prcm_reg *prcm =
(struct sunxi_prcm_reg *)SUNXI_PRCM_BASE;
- setbits_le32(&prcm->apb0_gate, PRCM_APB0_GATE_P2WI |
- PRCM_APB0_GATE_PIO);
- setbits_le32(&prcm->apb0_reset, PRCM_APB0_RESET_P2WI |
- PRCM_APB0_RESET_PIO);
+ /* open the clock for module */
+ setbits_le32(&prcm->apb0_gate, flags);
+
+ /* deassert reset for module */
+ setbits_le32(&prcm->apb0_reset, flags);
}