]> git.kernelconcepts.de Git - karo-tx-uboot.git/blob - arch/arm/mach-uniphier/ph1-pro4/early_clkrst_init.c
ARM: UniPhier: add empty lowlevel_init to U-boot proper
[karo-tx-uboot.git] / arch / arm / mach-uniphier / ph1-pro4 / early_clkrst_init.c
1 /*
2  * Copyright (C) 2011-2015 Panasonic Corporation
3  *   Author: Masahiro Yamada <yamada.m@jp.panasonic.com>
4  *
5  * SPDX-License-Identifier:     GPL-2.0+
6  */
7
8 #include <common.h>
9 #include <spl.h>
10 #include <asm/io.h>
11 #include <mach/sc-regs.h>
12
13 void early_clkrst_init(void)
14 {
15         u32 tmp;
16
17         /* deassert reset */
18         tmp = readl(SC_RSTCTRL);
19
20         tmp |= SC_RSTCTRL_NRST_UMC1 | SC_RSTCTRL_NRST_UMC0;
21         if (spl_boot_device() != BOOT_DEVICE_NAND)
22                 tmp &= ~SC_RSTCTRL_NRST_NAND;
23         writel(tmp, SC_RSTCTRL);
24         readl(SC_RSTCTRL); /* dummy read */
25
26         /* privide clocks */
27         tmp = readl(SC_CLKCTRL);
28         tmp |= SC_CLKCTRL_CEN_UMC | SC_CLKCTRL_CEN_SBC | SC_CLKCTRL_CEN_PERI;
29         writel(tmp, SC_CLKCTRL);
30         readl(SC_CLKCTRL); /* dummy read */
31 }