2015-02-26 17:26:51 +00:00
|
|
|
/*
|
2015-05-29 08:30:00 +00:00
|
|
|
* Copyright (C) 2011-2015 Masahiro Yamada <yamada.m@jp.panasonic.com>
|
2015-02-26 17:26:51 +00:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: GPL-2.0+
|
|
|
|
*/
|
|
|
|
|
2015-02-26 17:26:52 +00:00
|
|
|
#include <common.h>
|
|
|
|
#include <spl.h>
|
2015-05-29 08:30:00 +00:00
|
|
|
#include <linux/io.h>
|
2015-09-21 15:27:39 +00:00
|
|
|
#include <mach/init.h>
|
2015-02-26 17:26:51 +00:00
|
|
|
#include <mach/sc-regs.h>
|
|
|
|
|
2015-09-21 15:27:39 +00:00
|
|
|
int ph1_ld4_early_clk_init(const struct uniphier_board_data *bd)
|
2015-02-26 17:26:51 +00:00
|
|
|
{
|
|
|
|
u32 tmp;
|
|
|
|
|
|
|
|
/* deassert reset */
|
|
|
|
tmp = readl(SC_RSTCTRL);
|
2015-02-26 17:26:52 +00:00
|
|
|
|
2015-02-26 17:26:51 +00:00
|
|
|
tmp |= SC_RSTCTRL_NRST_UMC1 | SC_RSTCTRL_NRST_UMC0;
|
2015-02-26 17:26:52 +00:00
|
|
|
if (spl_boot_device() != BOOT_DEVICE_NAND)
|
|
|
|
tmp &= ~SC_RSTCTRL_NRST_NAND;
|
2015-02-26 17:26:51 +00:00
|
|
|
writel(tmp, SC_RSTCTRL);
|
|
|
|
readl(SC_RSTCTRL); /* dummy read */
|
|
|
|
|
|
|
|
/* privide clocks */
|
|
|
|
tmp = readl(SC_CLKCTRL);
|
|
|
|
tmp |= SC_CLKCTRL_CEN_UMC | SC_CLKCTRL_CEN_SBC | SC_CLKCTRL_CEN_PERI;
|
|
|
|
writel(tmp, SC_CLKCTRL);
|
|
|
|
readl(SC_CLKCTRL); /* dummy read */
|
2015-09-21 15:27:39 +00:00
|
|
|
|
|
|
|
return 0;
|
2015-02-26 17:26:51 +00:00
|
|
|
}
|