Tom Rini | 83d290c | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Masahiro Yamada | 78c627c | 2017-01-15 14:59:03 +0900 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (C) 2011-2014 Panasonic Corporation |
| 4 | * Copyright (C) 2015-2017 Socionext Inc. |
Masahiro Yamada | 78c627c | 2017-01-15 14:59:03 +0900 | [diff] [blame] | 5 | */ |
| 6 | |
| 7 | #include <common.h> |
| 8 | #include <spl.h> |
| 9 | #include <linux/io.h> |
| 10 | |
| 11 | #include "../init.h" |
| 12 | #include "../sc-regs.h" |
| 13 | |
Masahiro Yamada | 00aa453 | 2017-08-13 09:01:13 +0900 | [diff] [blame] | 14 | void uniphier_ld4_dram_clk_init(void) |
Masahiro Yamada | 78c627c | 2017-01-15 14:59:03 +0900 | [diff] [blame] | 15 | { |
| 16 | u32 tmp; |
| 17 | |
| 18 | /* deassert reset */ |
Masahiro Yamada | 739ba41 | 2019-07-10 20:07:41 +0900 | [diff] [blame] | 19 | tmp = readl(sc_base + SC_RSTCTRL); |
Masahiro Yamada | 78c627c | 2017-01-15 14:59:03 +0900 | [diff] [blame] | 20 | tmp |= SC_RSTCTRL_NRST_UMC1 | SC_RSTCTRL_NRST_UMC0; |
Masahiro Yamada | 739ba41 | 2019-07-10 20:07:41 +0900 | [diff] [blame] | 21 | writel(tmp, sc_base + SC_RSTCTRL); |
| 22 | readl(sc_base + SC_RSTCTRL); /* dummy read */ |
Masahiro Yamada | 78c627c | 2017-01-15 14:59:03 +0900 | [diff] [blame] | 23 | |
| 24 | /* provide clocks */ |
Masahiro Yamada | 739ba41 | 2019-07-10 20:07:41 +0900 | [diff] [blame] | 25 | tmp = readl(sc_base + SC_CLKCTRL); |
Masahiro Yamada | 78c627c | 2017-01-15 14:59:03 +0900 | [diff] [blame] | 26 | tmp |= SC_CLKCTRL_CEN_UMC; |
Masahiro Yamada | 739ba41 | 2019-07-10 20:07:41 +0900 | [diff] [blame] | 27 | writel(tmp, sc_base + SC_CLKCTRL); |
| 28 | readl(sc_base + SC_CLKCTRL); /* dummy read */ |
Masahiro Yamada | 78c627c | 2017-01-15 14:59:03 +0900 | [diff] [blame] | 29 | } |