Masahiro Yamada | bb2ff9d | 2014-10-03 19:21:06 +0900 | [diff] [blame] | 1 | /* |
Masahiro Yamada | c04368f | 2015-02-27 02:26:51 +0900 | [diff] [blame^] | 2 | * Copyright (C) 2011-2015 Panasonic Corporation |
Masahiro Yamada | bb2ff9d | 2014-10-03 19:21:06 +0900 | [diff] [blame] | 3 | * Author: Masahiro Yamada <yamada.m@jp.panasonic.com> |
| 4 | * |
| 5 | * SPDX-License-Identifier: GPL-2.0+ |
| 6 | */ |
| 7 | |
Masahiro Yamada | bb2ff9d | 2014-10-03 19:21:06 +0900 | [diff] [blame] | 8 | #include <asm/io.h> |
Masahiro Yamada | 95387e2 | 2015-02-27 02:26:44 +0900 | [diff] [blame] | 9 | #include <mach/sc-regs.h> |
Masahiro Yamada | bb2ff9d | 2014-10-03 19:21:06 +0900 | [diff] [blame] | 10 | |
| 11 | void clkrst_init(void) |
| 12 | { |
| 13 | u32 tmp; |
| 14 | |
| 15 | /* deassert reset */ |
| 16 | tmp = readl(SC_RSTCTRL); |
Masahiro Yamada | c04368f | 2015-02-27 02:26:51 +0900 | [diff] [blame^] | 17 | #ifdef CONFIG_UNIPHIER_ETH |
| 18 | tmp |= SC_RSTCTRL_NRST_ETHER; |
| 19 | #endif |
| 20 | #ifdef CONFIG_NAND_DENALI |
| 21 | tmp |= SC_RSTCTRL_NRST_NAND; |
| 22 | #endif |
Masahiro Yamada | bb2ff9d | 2014-10-03 19:21:06 +0900 | [diff] [blame] | 23 | writel(tmp, SC_RSTCTRL); |
| 24 | readl(SC_RSTCTRL); /* dummy read */ |
| 25 | |
| 26 | /* privide clocks */ |
| 27 | tmp = readl(SC_CLKCTRL); |
Masahiro Yamada | c04368f | 2015-02-27 02:26:51 +0900 | [diff] [blame^] | 28 | #ifdef CONFIG_UNIPHIER_ETH |
| 29 | tmp |= SC_CLKCTRL_CEN_ETHER; |
| 30 | #endif |
| 31 | #ifdef CONFIG_USB_EHCI_UNIPHIER |
| 32 | tmp |= SC_CLKCTRL_CEN_MIO; |
| 33 | #endif |
| 34 | #ifdef CONFIG_NAND_DENALI |
| 35 | tmp |= SC_CLKCTRL_CEN_NAND; |
| 36 | #endif |
Masahiro Yamada | bb2ff9d | 2014-10-03 19:21:06 +0900 | [diff] [blame] | 37 | writel(tmp, SC_CLKCTRL); |
| 38 | readl(SC_CLKCTRL); /* dummy read */ |
| 39 | } |