mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-12-04 10:30:32 +00:00
174deb768c
The A31 has a new module called PRCM, or Power, Reset Control Module. This module controls clocks and resets for RTC block modules, and also PLL biasing in the main clock module. This patch adds the register definitions, and also enables the clocks and resets for the RTC block PIO (pin controller) and P2WI (push-pull 2 wire interface) which is used to talk to the PMIC. Signed-off-by: Oliver Schinagl <oliver@schinagl.nl> Signed-off-by: Hans de Goede <hdegoede@redhat.com> [wens@csie.org: spacing fixes reported by checkpatch.pl] [wens@csie.org: Use setbits helper in PRCM init function] [wens@csie.org: rephrase commit message to explain what the hardware supports and what we actually enable] Signed-off-by: Chen-Yu Tsai <wens@csie.org> Acked-by: Ian Campbell <ijc@hellion.org.uk>
33 lines
835 B
C
33 lines
835 B
C
/*
|
|
* Sunxi A31 Power Management Unit
|
|
*
|
|
* (C) Copyright 2013 Oliver Schinagl <oliver@schinagl.nl>
|
|
* http://linux-sunxi.org
|
|
*
|
|
* Based on sun6i sources and earlier U-Boot Allwinner A10 SPL work
|
|
*
|
|
* (C) Copyright 2006-2013
|
|
* Allwinner Technology Co., Ltd. <www.allwinnertech.com>
|
|
* Berg Xing <bergxing@allwinnertech.com>
|
|
* Tom Cubie <tangliang@allwinnertech.com>
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0+
|
|
*/
|
|
|
|
#include <common.h>
|
|
#include <errno.h>
|
|
#include <asm/io.h>
|
|
#include <asm/arch/cpu.h>
|
|
#include <asm/arch/prcm.h>
|
|
#include <asm/arch/sys_proto.h>
|
|
|
|
void prcm_init_apb0(void)
|
|
{
|
|
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);
|
|
}
|