Masahiro Yamada | 9d0c2ce | 2016-04-21 14:43:18 +0900 | [diff] [blame] | 1 | /* |
Masahiro Yamada | 78c627c | 2017-01-15 14:59:03 +0900 | [diff] [blame^] | 2 | * Copyright (C) 2016-2017 Socionext Inc. |
Masahiro Yamada | 9d0c2ce | 2016-04-21 14:43:18 +0900 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: GPL-2.0+ |
| 5 | */ |
| 6 | |
| 7 | #include <linux/io.h> |
| 8 | |
| 9 | #include "../init.h" |
| 10 | #include "../sc64-regs.h" |
| 11 | |
Masahiro Yamada | 78c627c | 2017-01-15 14:59:03 +0900 | [diff] [blame^] | 12 | void uniphier_ld20_dram_clk_init(void) |
Masahiro Yamada | 9d0c2ce | 2016-04-21 14:43:18 +0900 | [diff] [blame] | 13 | { |
| 14 | u32 tmp; |
| 15 | |
| 16 | /* deassert reset */ |
| 17 | tmp = readl(SC_RSTCTRL7); |
| 18 | tmp |= SC_RSTCTRL7_UMCSB | SC_RSTCTRL7_UMCA2 | SC_RSTCTRL7_UMCA1 | |
| 19 | SC_RSTCTRL7_UMCA0 | SC_RSTCTRL7_UMC32 | SC_RSTCTRL7_UMC31 | |
| 20 | SC_RSTCTRL7_UMC30; |
| 21 | writel(tmp, SC_RSTCTRL7); |
| 22 | |
| 23 | /* provide clocks */ |
Masahiro Yamada | 9d0c2ce | 2016-04-21 14:43:18 +0900 | [diff] [blame] | 24 | tmp = readl(SC_CLKCTRL7); |
| 25 | tmp |= SC_CLKCTRL7_UMCSB | SC_CLKCTRL7_UMC32 | SC_CLKCTRL7_UMC31 | |
| 26 | SC_CLKCTRL7_UMC30; |
| 27 | writel(tmp, SC_CLKCTRL7); |
Masahiro Yamada | 9d0c2ce | 2016-04-21 14:43:18 +0900 | [diff] [blame] | 28 | } |