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