blob: 07b916dc9a9c02a4c1b2f82009d321a9cb7efd6b [file] [log] [blame]
Masahiro Yamada78c627c2017-01-15 14:59:03 +09001/*
2 * Copyright (C) 2011-2014 Panasonic Corporation
3 * Copyright (C) 2015-2017 Socionext Inc.
4 *
5 * SPDX-License-Identifier: GPL-2.0+
6 */
7
8#include <common.h>
9#include <spl.h>
10#include <linux/io.h>
11
12#include "../init.h"
13#include "../sc-regs.h"
14
Masahiro Yamada00aa4532017-08-13 09:01:13 +090015void uniphier_ld4_early_clk_init(void)
Masahiro Yamada78c627c2017-01-15 14:59:03 +090016{
17 u32 tmp;
18
19 /* deassert reset */
20 if (spl_boot_device() != BOOT_DEVICE_NAND) {
21 tmp = readl(SC_RSTCTRL);
22 tmp &= ~SC_RSTCTRL_NRST_NAND;
23 writel(tmp, SC_RSTCTRL);
24 };
25
26 /* provide clocks */
27 tmp = readl(SC_CLKCTRL);
28 tmp |= SC_CLKCTRL_CEN_SBC | SC_CLKCTRL_CEN_PERI;
29 writel(tmp, SC_CLKCTRL);
30 readl(SC_CLKCTRL); /* dummy read */
31}