1 // SPDX-License-Identifier: GPL-2.0+
3 * Sunxi A31 Power Management Unit
5 * (C) Copyright 2013 Oliver Schinagl <oliver@schinagl.nl>
6 * http://linux-sunxi.org
8 * Based on sun6i sources and earlier U-Boot Allwinner A10 SPL work
10 * (C) Copyright 2006-2013
11 * Allwinner Technology Co., Ltd. <www.allwinnertech.com>
12 * Berg Xing <bergxing@allwinnertech.com>
13 * Tom Cubie <tangliang@allwinnertech.com>
19 #include <asm/arch/cpu.h>
20 #include <asm/arch/prcm.h>
21 #include <asm/arch/sys_proto.h>
23 /* APB0 clock gate and reset bit offsets are the same. */
24 void prcm_apb0_enable(u32 flags)
26 struct sunxi_prcm_reg *prcm =
27 (struct sunxi_prcm_reg *)SUNXI_PRCM_BASE;
29 /* open the clock for module */
30 setbits_le32(&prcm->apb0_gate, flags);
32 /* deassert reset for module */
33 setbits_le32(&prcm->apb0_reset, flags);
36 void prcm_apb0_disable(u32 flags)
38 struct sunxi_prcm_reg *prcm =
39 (struct sunxi_prcm_reg *)SUNXI_PRCM_BASE;
41 /* assert reset for module */
42 clrbits_le32(&prcm->apb0_reset, flags);
44 /* close the clock for module */
45 clrbits_le32(&prcm->apb0_gate, flags);