• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // SPDX-License-Identifier: GPL-2.0+
2 /*
3  * Copyright (C) 2011-2015 Panasonic Corporation
4  * Copyright (C) 2015-2016 Socionext Inc.
5  *   Author: Masahiro Yamada <yamada.masahiro@socionext.com>
6  */
7 
8 #include <linux/io.h>
9 
10 #include "../init.h"
11 #include "../sc-regs.h"
12 
uniphier_pro4_clk_init(void)13 void uniphier_pro4_clk_init(void)
14 {
15 	u32 tmp;
16 
17 	/* deassert reset */
18 	tmp = readl(sc_base + SC_RSTCTRL);
19 #ifdef CONFIG_USB_DWC3_UNIPHIER
20 	tmp |= SC_RSTCTRL_NRST_USB3B0 | SC_RSTCTRL_NRST_USB3C0 |
21 		SC_RSTCTRL_NRST_GIO;
22 #endif
23 #ifdef CONFIG_NAND_DENALI
24 	tmp |= SC_RSTCTRL_NRST_NAND;
25 #endif
26 	writel(tmp, sc_base + SC_RSTCTRL);
27 	readl(sc_base + SC_RSTCTRL); /* dummy read */
28 
29 #ifdef CONFIG_USB_DWC3_UNIPHIER
30 	tmp = readl(sc_base + SC_RSTCTRL2);
31 	tmp |= SC_RSTCTRL2_NRST_USB3B1 | SC_RSTCTRL2_NRST_USB3C1;
32 	writel(tmp, sc_base + SC_RSTCTRL2);
33 	readl(sc_base + SC_RSTCTRL2); /* dummy read */
34 #endif
35 
36 	/* provide clocks */
37 	tmp = readl(sc_base + SC_CLKCTRL);
38 #ifdef CONFIG_USB_DWC3_UNIPHIER
39 	tmp |= SC_CLKCTRL_CEN_USB31 | SC_CLKCTRL_CEN_USB30 |
40 		SC_CLKCTRL_CEN_GIO;
41 #endif
42 #ifdef CONFIG_NAND_DENALI
43 	tmp |= SC_CLKCTRL_CEN_NAND;
44 #endif
45 	writel(tmp, sc_base + SC_CLKCTRL);
46 	readl(sc_base + SC_CLKCTRL); /* dummy read */
47 }
48