Blame view
arch/arm/mach-uniphier/ph1-pro4/clkrst_init.c
1.27 KB
5894ca007 ARM: UniPhier: ad... |
1 |
/* |
198a97a6a ARM: UniPhier: sp... |
2 |
* Copyright (C) 2011-2015 Panasonic Corporation |
5894ca007 ARM: UniPhier: ad... |
3 4 5 6 |
* Author: Masahiro Yamada <yamada.m@jp.panasonic.com> * * SPDX-License-Identifier: GPL-2.0+ */ |
5894ca007 ARM: UniPhier: ad... |
7 |
#include <asm/io.h> |
a86ac9540 ARM: UniPhier: in... |
8 |
#include <mach/sc-regs.h> |
5894ca007 ARM: UniPhier: ad... |
9 10 11 12 13 14 15 |
void clkrst_init(void) { u32 tmp; /* deassert reset */ tmp = readl(SC_RSTCTRL); |
1535163a4 ARM: UniPhier: en... |
16 17 18 19 |
#ifdef CONFIG_USB_XHCI_UNIPHIER tmp |= SC_RSTCTRL_NRST_USB3B0 | SC_RSTCTRL_NRST_USB3C0 | SC_RSTCTRL_NRST_GIO; #endif |
198a97a6a ARM: UniPhier: sp... |
20 21 22 |
#ifdef CONFIG_UNIPHIER_ETH tmp |= SC_RSTCTRL_NRST_ETHER; #endif |
42ca6982f ARM: UniPhier: en... |
23 24 25 |
#ifdef CONFIG_USB_EHCI_UNIPHIER tmp |= SC_RSTCTRL_NRST_STDMAC; #endif |
198a97a6a ARM: UniPhier: sp... |
26 27 28 |
#ifdef CONFIG_NAND_DENALI tmp |= SC_RSTCTRL_NRST_NAND; #endif |
5894ca007 ARM: UniPhier: ad... |
29 30 |
writel(tmp, SC_RSTCTRL); readl(SC_RSTCTRL); /* dummy read */ |
1535163a4 ARM: UniPhier: en... |
31 32 33 34 35 36 |
#ifdef CONFIG_USB_XHCI_UNIPHIER tmp = readl(SC_RSTCTRL2); tmp |= SC_RSTCTRL2_NRST_USB3B1 | SC_RSTCTRL2_NRST_USB3C1; writel(tmp, SC_RSTCTRL2); readl(SC_RSTCTRL2); /* dummy read */ #endif |
5894ca007 ARM: UniPhier: ad... |
37 38 |
/* privide clocks */ tmp = readl(SC_CLKCTRL); |
1535163a4 ARM: UniPhier: en... |
39 40 41 42 |
#ifdef CONFIG_USB_XHCI_UNIPHIER tmp |= SC_CLKCTRL_CEN_USB31 | SC_CLKCTRL_CEN_USB30 | SC_CLKCTRL_CEN_GIO; #endif |
198a97a6a ARM: UniPhier: sp... |
43 44 45 46 |
#ifdef CONFIG_UNIPHIER_ETH tmp |= SC_CLKCTRL_CEN_ETHER; #endif #ifdef CONFIG_USB_EHCI_UNIPHIER |
42ca6982f ARM: UniPhier: en... |
47 |
tmp |= SC_CLKCTRL_CEN_MIO | SC_CLKCTRL_CEN_STDMAC; |
198a97a6a ARM: UniPhier: sp... |
48 49 50 51 |
#endif #ifdef CONFIG_NAND_DENALI tmp |= SC_CLKCTRL_CEN_NAND; #endif |
5894ca007 ARM: UniPhier: ad... |
52 53 54 |
writel(tmp, SC_CLKCTRL); readl(SC_CLKCTRL); /* dummy read */ } |