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 | /* |
Masahiro Yamada | 78c627c | 2017-01-15 14:59:03 +0900 | [diff] [blame] | 3 | * Copyright (C) 2015-2017 Socionext Inc. |
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 | 78c627c | 2017-01-15 14:59:03 +0900 | [diff] [blame] | 11 | void uniphier_pro5_dram_clk_init(void) |
Masahiro Yamada | 28f40d4 | 2015-09-22 00:27:40 +0900 | [diff] [blame] | 12 | { |
| 13 | u32 tmp; |
| 14 | |
| 15 | /* |
| 16 | * deassert reset |
| 17 | * UMCA2: Ch1 (DDR3) |
| 18 | * UMCA1, UMC31: Ch0 (WIO1) |
| 19 | * UMCA0, UMC30: Ch0 (WIO0) |
| 20 | */ |
Masahiro Yamada | 739ba41 | 2019-07-10 20:07:41 +0900 | [diff] [blame] | 21 | tmp = readl(sc_base + SC_RSTCTRL4); |
Masahiro Yamada | 28f40d4 | 2015-09-22 00:27:40 +0900 | [diff] [blame] | 22 | tmp |= SC_RSTCTRL4_NRST_UMCSB | SC_RSTCTRL4_NRST_UMCA2 | |
| 23 | SC_RSTCTRL4_NRST_UMCA1 | SC_RSTCTRL4_NRST_UMCA0 | |
| 24 | SC_RSTCTRL4_NRST_UMC31 | SC_RSTCTRL4_NRST_UMC30; |
Masahiro Yamada | 739ba41 | 2019-07-10 20:07:41 +0900 | [diff] [blame] | 25 | writel(tmp, sc_base + SC_RSTCTRL4); |
| 26 | readl(sc_base + SC_RSTCTRL4); /* dummy read */ |
Masahiro Yamada | 28f40d4 | 2015-09-22 00:27:40 +0900 | [diff] [blame] | 27 | |
Masahiro Yamada | 6797630 | 2016-03-30 20:17:42 +0900 | [diff] [blame] | 28 | /* provide clocks */ |
Masahiro Yamada | 739ba41 | 2019-07-10 20:07:41 +0900 | [diff] [blame] | 29 | tmp = readl(sc_base + SC_CLKCTRL4); |
Masahiro Yamada | 28f40d4 | 2015-09-22 00:27:40 +0900 | [diff] [blame] | 30 | tmp |= SC_CLKCTRL4_CEN_UMCSB | SC_CLKCTRL4_CEN_UMC1 | |
| 31 | SC_CLKCTRL4_CEN_UMC0; |
Masahiro Yamada | 739ba41 | 2019-07-10 20:07:41 +0900 | [diff] [blame] | 32 | writel(tmp, sc_base + SC_CLKCTRL4); |
| 33 | readl(sc_base + SC_CLKCTRL4); /* dummy read */ |
Masahiro Yamada | 28f40d4 | 2015-09-22 00:27:40 +0900 | [diff] [blame] | 34 | } |