Masahiro Yamada | 1fe65d3 | 2015-09-22 00:27:41 +0900 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright (C) 2015 Masahiro Yamada <yamada.masahiro@socionext.com> |
| 3 | * |
| 4 | * SPDX-License-Identifier: GPL-2.0+ |
| 5 | */ |
| 6 | |
| 7 | #include <linux/io.h> |
| 8 | #include <mach/init.h> |
| 9 | #include <mach/sc-regs.h> |
| 10 | |
| 11 | void proxstream2_clk_init(void) |
| 12 | { |
| 13 | u32 tmp; |
| 14 | |
| 15 | /* deassert reset */ |
| 16 | tmp = readl(SC_RSTCTRL); |
| 17 | #ifdef CONFIG_USB_XHCI_UNIPHIER |
| 18 | tmp |= SC_RSTCTRL_NRST_USB3B0 | SC_RSTCTRL_NRST_GIO; |
| 19 | #endif |
| 20 | #ifdef CONFIG_UNIPHIER_ETH |
| 21 | tmp |= SC_RSTCTRL_NRST_ETHER; |
| 22 | #endif |
| 23 | #ifdef CONFIG_NAND_DENALI |
| 24 | tmp |= SC_RSTCTRL_NRST_NAND; |
| 25 | #endif |
| 26 | writel(tmp, SC_RSTCTRL); |
| 27 | readl(SC_RSTCTRL); /* dummy read */ |
| 28 | |
| 29 | #ifdef CONFIG_USB_XHCI_UNIPHIER |
| 30 | tmp = readl(SC_RSTCTRL2); |
| 31 | tmp |= SC_RSTCTRL2_NRST_USB3B1; |
| 32 | writel(tmp, SC_RSTCTRL2); |
| 33 | readl(SC_RSTCTRL2); /* dummy read */ |
| 34 | #endif |
| 35 | |
| 36 | /* privide clocks */ |
| 37 | tmp = readl(SC_CLKCTRL); |
| 38 | #ifdef CONFIG_USB_XHCI_UNIPHIER |
| 39 | tmp |= SC_CLKCTRL_CEN_USB31 | SC_CLKCTRL_CEN_USB30 | |
| 40 | SC_CLKCTRL_CEN_GIO; |
| 41 | #endif |
| 42 | #ifdef CONFIG_UNIPHIER_ETH |
| 43 | tmp |= SC_CLKCTRL_CEN_ETHER; |
| 44 | #endif |
| 45 | #ifdef CONFIG_NAND_DENALI |
| 46 | tmp |= SC_CLKCTRL_CEN_NAND; |
| 47 | #endif |
| 48 | writel(tmp, SC_CLKCTRL); |
| 49 | readl(SC_CLKCTRL); /* dummy read */ |
| 50 | } |