2 * Copyright (C) 2011-2015 Panasonic Corporation
3 * Author: Masahiro Yamada <yamada.m@jp.panasonic.com>
5 * SPDX-License-Identifier: GPL-2.0+
9 #include <mach/sc-regs.h>
11 void clkrst_init(void)
16 tmp = readl(SC_RSTCTRL);
17 #ifdef CONFIG_USB_XHCI_UNIPHIER
18 tmp |= SC_RSTCTRL_NRST_USB3B0 | SC_RSTCTRL_NRST_USB3C0 |
21 #ifdef CONFIG_UNIPHIER_ETH
22 tmp |= SC_RSTCTRL_NRST_ETHER;
24 #ifdef CONFIG_USB_EHCI_UNIPHIER
25 tmp |= SC_RSTCTRL_NRST_STDMAC;
27 #ifdef CONFIG_NAND_DENALI
28 tmp |= SC_RSTCTRL_NRST_NAND;
30 writel(tmp, SC_RSTCTRL);
31 readl(SC_RSTCTRL); /* dummy read */
33 #ifdef CONFIG_USB_XHCI_UNIPHIER
34 tmp = readl(SC_RSTCTRL2);
35 tmp |= SC_RSTCTRL2_NRST_USB3B1 | SC_RSTCTRL2_NRST_USB3C1;
36 writel(tmp, SC_RSTCTRL2);
37 readl(SC_RSTCTRL2); /* dummy read */
41 tmp = readl(SC_CLKCTRL);
42 #ifdef CONFIG_USB_XHCI_UNIPHIER
43 tmp |= SC_CLKCTRL_CEN_USB31 | SC_CLKCTRL_CEN_USB30 |
46 #ifdef CONFIG_UNIPHIER_ETH
47 tmp |= SC_CLKCTRL_CEN_ETHER;
49 #ifdef CONFIG_USB_EHCI_UNIPHIER
50 tmp |= SC_CLKCTRL_CEN_MIO | SC_CLKCTRL_CEN_STDMAC;
52 #ifdef CONFIG_NAND_DENALI
53 tmp |= SC_CLKCTRL_CEN_NAND;
55 writel(tmp, SC_CLKCTRL);
56 readl(SC_CLKCTRL); /* dummy read */