]> git.sur5r.net Git - u-boot/blob - arch/arm/cpu/armv7/sunxi/prcm.c
ARM: sun6i: Add support for the power reset control module found on the A31
[u-boot] / arch / arm / cpu / armv7 / sunxi / prcm.c
1 /*
2  * Sunxi A31 Power Management Unit
3  *
4  * (C) Copyright 2013 Oliver Schinagl <oliver@schinagl.nl>
5  * http://linux-sunxi.org
6  *
7  * Based on sun6i sources and earlier U-Boot Allwinner A10 SPL work
8  *
9  * (C) Copyright 2006-2013
10  * Allwinner Technology Co., Ltd. <www.allwinnertech.com>
11  * Berg Xing <bergxing@allwinnertech.com>
12  * Tom Cubie <tangliang@allwinnertech.com>
13  *
14  * SPDX-License-Identifier:     GPL-2.0+
15  */
16
17 #include <common.h>
18 #include <errno.h>
19 #include <asm/io.h>
20 #include <asm/arch/cpu.h>
21 #include <asm/arch/prcm.h>
22 #include <asm/arch/sys_proto.h>
23
24 void prcm_init_apb0(void)
25 {
26         struct sunxi_prcm_reg *prcm =
27                 (struct sunxi_prcm_reg *)SUNXI_PRCM_BASE;
28
29         setbits_le32(&prcm->apb0_gate, PRCM_APB0_GATE_P2WI |
30                                        PRCM_APB0_GATE_PIO);
31         setbits_le32(&prcm->apb0_reset, PRCM_APB0_RESET_P2WI |
32                                         PRCM_APB0_RESET_PIO);
33 }