blob: 75eaab7d290c4781723778d276f83021d707b125 [file] [log] [blame]
Masahiro Yamada1fe65d32015-09-22 00:27:41 +09001/*
Masahiro Yamadaddb19002017-01-15 14:59:03 +09002 * Copyright (C) 2016-2017 Socionext Inc.
Masahiro Yamada1fe65d32015-09-22 00:27:41 +09003 *
4 * SPDX-License-Identifier: GPL-2.0+
5 */
6
7#include <common.h>
8#include <spl.h>
9#include <linux/io.h>
Masahiro Yamadaefdf3402016-01-09 01:51:13 +090010
11#include "../init.h"
12#include "../sc-regs.h"
Masahiro Yamada1fe65d32015-09-22 00:27:41 +090013
Masahiro Yamadaddb19002017-01-15 14:59:03 +090014void uniphier_pxs2_dram_clk_init(void)
Masahiro Yamada1fe65d32015-09-22 00:27:41 +090015{
16 u32 tmp;
17
18 /* deassert reset */
Masahiro Yamada1fe65d32015-09-22 00:27:41 +090019 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 Yamada1c6a5e42016-03-30 20:17:42 +090027 /* provide clocks */
Masahiro Yamada1fe65d32015-09-22 00:27:41 +090028 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 Yamada1fe65d32015-09-22 00:27:41 +090033}