Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Masahiro Yamada | 1fe65d3 | 2015-09-22 00:27:41 +0900 | [diff] [blame] | 2 | /* |
Masahiro Yamada | ddb1900 | 2017-01-15 14:59:03 +0900 | [diff] [blame] | 3 | * Copyright (C) 2016-2017 Socionext Inc. |
Masahiro Yamada | 1fe65d3 | 2015-09-22 00:27:41 +0900 | [diff] [blame] | 4 | */ |
| 5 | |
| 6 | #include <common.h> |
| 7 | #include <spl.h> |
| 8 | #include <linux/io.h> |
Masahiro Yamada | efdf340 | 2016-01-09 01:51:13 +0900 | [diff] [blame] | 9 | |
| 10 | #include "../init.h" |
| 11 | #include "../sc-regs.h" |
Masahiro Yamada | 1fe65d3 | 2015-09-22 00:27:41 +0900 | [diff] [blame] | 12 | |
Masahiro Yamada | ddb1900 | 2017-01-15 14:59:03 +0900 | [diff] [blame] | 13 | void uniphier_pxs2_dram_clk_init(void) |
Masahiro Yamada | 1fe65d3 | 2015-09-22 00:27:41 +0900 | [diff] [blame] | 14 | { |
| 15 | u32 tmp; |
| 16 | |
| 17 | /* deassert reset */ |
Masahiro Yamada | c84024c | 2019-07-10 20:07:41 +0900 | [diff] [blame] | 18 | tmp = readl(sc_base + SC_RSTCTRL4); |
Masahiro Yamada | 1fe65d3 | 2015-09-22 00:27:41 +0900 | [diff] [blame] | 19 | tmp |= SC_RSTCTRL4_NRST_UMCSB | SC_RSTCTRL4_NRST_UMCA2 | |
| 20 | SC_RSTCTRL4_NRST_UMCA1 | SC_RSTCTRL4_NRST_UMCA0 | |
| 21 | SC_RSTCTRL4_NRST_UMC32 | SC_RSTCTRL4_NRST_UMC31 | |
| 22 | SC_RSTCTRL4_NRST_UMC30; |
Masahiro Yamada | c84024c | 2019-07-10 20:07:41 +0900 | [diff] [blame] | 23 | writel(tmp, sc_base + SC_RSTCTRL4); |
| 24 | readl(sc_base + SC_RSTCTRL4); /* dummy read */ |
Masahiro Yamada | 1fe65d3 | 2015-09-22 00:27:41 +0900 | [diff] [blame] | 25 | |
Masahiro Yamada | 1c6a5e4 | 2016-03-30 20:17:42 +0900 | [diff] [blame] | 26 | /* provide clocks */ |
Masahiro Yamada | c84024c | 2019-07-10 20:07:41 +0900 | [diff] [blame] | 27 | tmp = readl(sc_base + SC_CLKCTRL4); |
Masahiro Yamada | 1fe65d3 | 2015-09-22 00:27:41 +0900 | [diff] [blame] | 28 | tmp |= SC_CLKCTRL4_CEN_UMCSB | SC_CLKCTRL4_CEN_UMC2 | |
| 29 | SC_CLKCTRL4_CEN_UMC1 | SC_CLKCTRL4_CEN_UMC0; |
Masahiro Yamada | c84024c | 2019-07-10 20:07:41 +0900 | [diff] [blame] | 30 | writel(tmp, sc_base + SC_CLKCTRL4); |
| 31 | readl(sc_base + SC_CLKCTRL4); /* dummy read */ |
Masahiro Yamada | 1fe65d3 | 2015-09-22 00:27:41 +0900 | [diff] [blame] | 32 | } |