blob: 75d3e70d6aad5a5b6bfeac336dbd34e1b04f701f [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Masahiro Yamada019df872015-09-22 00:27:41 +09002/*
Masahiro Yamada78c627c2017-01-15 14:59:03 +09003 * Copyright (C) 2016-2017 Socionext Inc.
Masahiro Yamada019df872015-09-22 00:27:41 +09004 */
5
Masahiro Yamada019df872015-09-22 00:27:41 +09006#include <spl.h>
7#include <linux/io.h>
Masahiro Yamada107b3fb2016-01-09 01:51:13 +09008
9#include "../init.h"
10#include "../sc-regs.h"
Masahiro Yamada019df872015-09-22 00:27:41 +090011
Masahiro Yamada78c627c2017-01-15 14:59:03 +090012void uniphier_pxs2_dram_clk_init(void)
Masahiro Yamada019df872015-09-22 00:27:41 +090013{
14 u32 tmp;
15
16 /* deassert reset */
Masahiro Yamada739ba412019-07-10 20:07:41 +090017 tmp = readl(sc_base + SC_RSTCTRL4);
Masahiro Yamada019df872015-09-22 00:27:41 +090018 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;
Masahiro Yamada739ba412019-07-10 20:07:41 +090022 writel(tmp, sc_base + SC_RSTCTRL4);
23 readl(sc_base + SC_RSTCTRL4); /* dummy read */
Masahiro Yamada019df872015-09-22 00:27:41 +090024
Masahiro Yamada67976302016-03-30 20:17:42 +090025 /* provide clocks */
Masahiro Yamada739ba412019-07-10 20:07:41 +090026 tmp = readl(sc_base + SC_CLKCTRL4);
Masahiro Yamada019df872015-09-22 00:27:41 +090027 tmp |= SC_CLKCTRL4_CEN_UMCSB | SC_CLKCTRL4_CEN_UMC2 |
28 SC_CLKCTRL4_CEN_UMC1 | SC_CLKCTRL4_CEN_UMC0;
Masahiro Yamada739ba412019-07-10 20:07:41 +090029 writel(tmp, sc_base + SC_CLKCTRL4);
30 readl(sc_base + SC_CLKCTRL4); /* dummy read */
Masahiro Yamada019df872015-09-22 00:27:41 +090031}