blob: 37adb37a1f82e9132db2d162e8e6dbb8ca78c0cd [file] [log] [blame]
Masahiro Yamada063eb1e2016-04-21 14:43:18 +09001/*
2 * Copyright (C) 2016 Masahiro Yamada <yamada.masahiro@socionext.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0+
5 */
6
7#include <linux/io.h>
8
9#include "../init.h"
10#include "../sc64-regs.h"
11
12int uniphier_ld20_early_clk_init(const struct uniphier_board_data *bd)
13{
14 u32 tmp;
15
16 /* deassert reset */
17 tmp = readl(SC_RSTCTRL7);
18 tmp |= SC_RSTCTRL7_UMCSB | SC_RSTCTRL7_UMCA2 | SC_RSTCTRL7_UMCA1 |
19 SC_RSTCTRL7_UMCA0 | SC_RSTCTRL7_UMC32 | SC_RSTCTRL7_UMC31 |
20 SC_RSTCTRL7_UMC30;
21 writel(tmp, SC_RSTCTRL7);
22
23 /* provide clocks */
24 tmp = readl(SC_CLKCTRL7);
25 tmp |= SC_CLKCTRL7_UMCSB | SC_CLKCTRL7_UMC32 | SC_CLKCTRL7_UMC31 |
26 SC_CLKCTRL7_UMC30;
27 writel(tmp, SC_CLKCTRL7);
28
29 return 0;
30}