Tom Rini | 83d290c | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Masahiro Yamada | 28f40d4 | 2015-09-22 00:27:40 +0900 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (C) 2015 Masahiro Yamada <yamada.masahiro@socionext.com> |
Masahiro Yamada | 28f40d4 | 2015-09-22 00:27:40 +0900 | [diff] [blame] | 4 | */ |
| 5 | |
| 6 | #include <linux/io.h> |
Masahiro Yamada | 107b3fb | 2016-01-09 01:51:13 +0900 | [diff] [blame] | 7 | |
| 8 | #include "../init.h" |
| 9 | #include "../sc-regs.h" |
Masahiro Yamada | 28f40d4 | 2015-09-22 00:27:40 +0900 | [diff] [blame] | 10 | |
Masahiro Yamada | 5b66006 | 2016-03-30 20:17:02 +0900 | [diff] [blame] | 11 | void uniphier_pro5_clk_init(void) |
Masahiro Yamada | 28f40d4 | 2015-09-22 00:27:40 +0900 | [diff] [blame] | 12 | { |
Masahiro Yamada | 5bacb44 | 2020-01-30 00:55:57 +0900 | [diff] [blame] | 13 | #ifdef CONFIG_USB_DWC3_UNIPHIER |
Masahiro Yamada | 28f40d4 | 2015-09-22 00:27:40 +0900 | [diff] [blame] | 14 | u32 tmp; |
| 15 | |
| 16 | /* deassert reset */ |
Masahiro Yamada | 739ba41 | 2019-07-10 20:07:41 +0900 | [diff] [blame] | 17 | tmp = readl(sc_base + SC_RSTCTRL); |
Masahiro Yamada | 28f40d4 | 2015-09-22 00:27:40 +0900 | [diff] [blame] | 18 | tmp |= SC_RSTCTRL_NRST_USB3B0 | SC_RSTCTRL_NRST_GIO; |
Masahiro Yamada | 739ba41 | 2019-07-10 20:07:41 +0900 | [diff] [blame] | 19 | writel(tmp, sc_base + SC_RSTCTRL); |
| 20 | readl(sc_base + SC_RSTCTRL); /* dummy read */ |
Masahiro Yamada | 28f40d4 | 2015-09-22 00:27:40 +0900 | [diff] [blame] | 21 | |
Masahiro Yamada | 739ba41 | 2019-07-10 20:07:41 +0900 | [diff] [blame] | 22 | tmp = readl(sc_base + SC_RSTCTRL2); |
Masahiro Yamada | 28f40d4 | 2015-09-22 00:27:40 +0900 | [diff] [blame] | 23 | tmp |= SC_RSTCTRL2_NRST_USB3B1; |
Masahiro Yamada | 739ba41 | 2019-07-10 20:07:41 +0900 | [diff] [blame] | 24 | writel(tmp, sc_base + SC_RSTCTRL2); |
| 25 | readl(sc_base + SC_RSTCTRL2); /* dummy read */ |
Masahiro Yamada | 28f40d4 | 2015-09-22 00:27:40 +0900 | [diff] [blame] | 26 | |
Masahiro Yamada | 6797630 | 2016-03-30 20:17:42 +0900 | [diff] [blame] | 27 | /* provide clocks */ |
Masahiro Yamada | 739ba41 | 2019-07-10 20:07:41 +0900 | [diff] [blame] | 28 | tmp = readl(sc_base + SC_CLKCTRL); |
Masahiro Yamada | 28f40d4 | 2015-09-22 00:27:40 +0900 | [diff] [blame] | 29 | tmp |= SC_CLKCTRL_CEN_USB31 | SC_CLKCTRL_CEN_USB30 | |
| 30 | SC_CLKCTRL_CEN_GIO; |
Masahiro Yamada | 739ba41 | 2019-07-10 20:07:41 +0900 | [diff] [blame] | 31 | writel(tmp, sc_base + SC_CLKCTRL); |
| 32 | readl(sc_base + SC_CLKCTRL); /* dummy read */ |
Masahiro Yamada | 5bacb44 | 2020-01-30 00:55:57 +0900 | [diff] [blame] | 33 | #endif |
Masahiro Yamada | 28f40d4 | 2015-09-22 00:27:40 +0900 | [diff] [blame] | 34 | } |