1 // SPDX-License-Identifier: GPL-2.0+
2 /*
3  * Copyright (C) 2016-2017 Socionext Inc.
4  */
5 
6 #include <spl.h>
7 #include <linux/io.h>
8 
9 #include "../init.h"
10 #include "../sc-regs.h"
11 
uniphier_pxs2_dram_clk_init(void)12 void uniphier_pxs2_dram_clk_init(void)
13 {
14 	u32 tmp;
15 
16 	/* deassert reset */
17 	tmp = readl(sc_base + SC_RSTCTRL4);
18 	tmp |= SC_RSTCTRL4_NRST_UMCSB | SC_RSTCTRL4_NRST_UMCA2 |
19 	       SC_RSTCTRL4_NRST_UMCA1 | SC_RSTCTRL4_NRST_UMCA0 |
20 	       SC_RSTCTRL4_NRST_UMC32 | SC_RSTCTRL4_NRST_UMC31 |
21 	       SC_RSTCTRL4_NRST_UMC30;
22 	writel(tmp, sc_base + SC_RSTCTRL4);
23 	readl(sc_base + SC_RSTCTRL4); /* dummy read */
24 
25 	/* provide clocks */
26 	tmp = readl(sc_base + SC_CLKCTRL4);
27 	tmp |= SC_CLKCTRL4_CEN_UMCSB | SC_CLKCTRL4_CEN_UMC2 |
28 	       SC_CLKCTRL4_CEN_UMC1 | SC_CLKCTRL4_CEN_UMC0;
29 	writel(tmp, sc_base + SC_CLKCTRL4);
30 	readl(sc_base + SC_CLKCTRL4); /* dummy read */
31 }
32