Masahiro Yamada | 019df87 | 2015-09-22 00:27:41 +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 | 019df87 | 2015-09-22 00:27:41 +0900 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: GPL-2.0+ |
| 5 | */ |
| 6 | |
| 7 | #include <common.h> |
| 8 | #include <spl.h> |
| 9 | #include <linux/io.h> |
Masahiro Yamada | 107b3fb | 2016-01-09 01:51:13 +0900 | [diff] [blame] | 10 | |
| 11 | #include "../init.h" |
| 12 | #include "../sc-regs.h" |
Masahiro Yamada | 019df87 | 2015-09-22 00:27:41 +0900 | [diff] [blame] | 13 | |
Masahiro Yamada | 78c627c | 2017-01-15 14:59:03 +0900 | [diff] [blame] | 14 | void uniphier_pxs2_dram_clk_init(void) |
Masahiro Yamada | 019df87 | 2015-09-22 00:27:41 +0900 | [diff] [blame] | 15 | { |
| 16 | u32 tmp; |
| 17 | |
| 18 | /* deassert reset */ |
Masahiro Yamada | 019df87 | 2015-09-22 00:27:41 +0900 | [diff] [blame] | 19 | tmp = readl(SC_RSTCTRL4); |
| 20 | tmp |= SC_RSTCTRL4_NRST_UMCSB | SC_RSTCTRL4_NRST_UMCA2 | |
| 21 | SC_RSTCTRL4_NRST_UMCA1 | SC_RSTCTRL4_NRST_UMCA0 | |
| 22 | SC_RSTCTRL4_NRST_UMC32 | SC_RSTCTRL4_NRST_UMC31 | |
| 23 | SC_RSTCTRL4_NRST_UMC30; |
| 24 | writel(tmp, SC_RSTCTRL4); |
| 25 | readl(SC_RSTCTRL4); /* dummy read */ |
| 26 | |
Masahiro Yamada | 6797630 | 2016-03-30 20:17:42 +0900 | [diff] [blame] | 27 | /* provide clocks */ |
Masahiro Yamada | 019df87 | 2015-09-22 00:27:41 +0900 | [diff] [blame] | 28 | tmp = readl(SC_CLKCTRL4); |
| 29 | tmp |= SC_CLKCTRL4_CEN_UMCSB | SC_CLKCTRL4_CEN_UMC2 | |
| 30 | SC_CLKCTRL4_CEN_UMC1 | SC_CLKCTRL4_CEN_UMC0; |
| 31 | writel(tmp, SC_CLKCTRL4); |
| 32 | readl(SC_CLKCTRL4); /* dummy read */ |
Masahiro Yamada | 019df87 | 2015-09-22 00:27:41 +0900 | [diff] [blame] | 33 | } |