blob: 9c88cde5e2572b792e8eee866702ff85e4915e61 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Masahiro Yamadabb2ff9d2014-10-03 19:21:06 +09002/*
Masahiro Yamadab4eda202016-10-17 22:18:03 +09003 * Copyright (C) 2011-2015 Panasonic Corporation
4 * Copyright (C) 2015-2016 Socionext Inc.
5 * Author: Masahiro Yamada <yamada.masahiro@socionext.com>
Masahiro Yamadabb2ff9d2014-10-03 19:21:06 +09006 */
7
Masahiro Yamada663a23f2015-05-29 17:30:00 +09008#include <linux/io.h>
Masahiro Yamadaefdf3402016-01-09 01:51:13 +09009
10#include "../init.h"
11#include "../sc-regs.h"
Masahiro Yamadabb2ff9d2014-10-03 19:21:06 +090012
Masahiro Yamada98905692016-03-30 20:17:02 +090013void uniphier_ld4_clk_init(void)
Masahiro Yamadabb2ff9d2014-10-03 19:21:06 +090014{
15 u32 tmp;
16
17 /* deassert reset */
18 tmp = readl(SC_RSTCTRL);
Masahiro Yamadac04368f2015-02-27 02:26:51 +090019#ifdef CONFIG_NAND_DENALI
20 tmp |= SC_RSTCTRL_NRST_NAND;
21#endif
Masahiro Yamadabb2ff9d2014-10-03 19:21:06 +090022 writel(tmp, SC_RSTCTRL);
23 readl(SC_RSTCTRL); /* dummy read */
24
Masahiro Yamada1c6a5e42016-03-30 20:17:42 +090025 /* provide clocks */
Masahiro Yamadabb2ff9d2014-10-03 19:21:06 +090026 tmp = readl(SC_CLKCTRL);
Masahiro Yamadac04368f2015-02-27 02:26:51 +090027#ifdef CONFIG_NAND_DENALI
28 tmp |= SC_CLKCTRL_CEN_NAND;
29#endif
Masahiro Yamadabb2ff9d2014-10-03 19:21:06 +090030 writel(tmp, SC_CLKCTRL);
31 readl(SC_CLKCTRL); /* dummy read */
32}