2018-05-06 17:58:06 -04:00
|
|
|
// SPDX-License-Identifier: GPL-2.0+
|
2014-10-03 19:21:06 +09:00
|
|
|
/*
|
2016-10-17 22:18:03 +09:00
|
|
|
* Copyright (C) 2011-2015 Panasonic Corporation
|
|
|
|
* Copyright (C) 2015-2016 Socionext Inc.
|
|
|
|
* Author: Masahiro Yamada <yamada.masahiro@socionext.com>
|
2014-10-03 19:21:06 +09:00
|
|
|
*/
|
|
|
|
|
2015-05-29 17:30:00 +09:00
|
|
|
#include <linux/io.h>
|
2016-01-09 01:51:13 +09:00
|
|
|
|
|
|
|
#include "../init.h"
|
|
|
|
#include "../sc-regs.h"
|
2014-10-03 19:21:06 +09:00
|
|
|
|
2016-03-30 20:17:02 +09:00
|
|
|
void uniphier_ld4_clk_init(void)
|
2014-10-03 19:21:06 +09:00
|
|
|
{
|
|
|
|
u32 tmp;
|
|
|
|
|
|
|
|
/* deassert reset */
|
2019-07-10 20:07:41 +09:00
|
|
|
tmp = readl(sc_base + SC_RSTCTRL);
|
2015-02-27 02:26:51 +09:00
|
|
|
#ifdef CONFIG_NAND_DENALI
|
|
|
|
tmp |= SC_RSTCTRL_NRST_NAND;
|
|
|
|
#endif
|
2019-07-10 20:07:41 +09:00
|
|
|
writel(tmp, sc_base + SC_RSTCTRL);
|
|
|
|
readl(sc_base + SC_RSTCTRL); /* dummy read */
|
2014-10-03 19:21:06 +09:00
|
|
|
|
2016-03-30 20:17:42 +09:00
|
|
|
/* provide clocks */
|
2019-07-10 20:07:41 +09:00
|
|
|
tmp = readl(sc_base + SC_CLKCTRL);
|
2015-02-27 02:26:51 +09:00
|
|
|
#ifdef CONFIG_NAND_DENALI
|
|
|
|
tmp |= SC_CLKCTRL_CEN_NAND;
|
|
|
|
#endif
|
2019-07-10 20:07:41 +09:00
|
|
|
writel(tmp, sc_base + SC_CLKCTRL);
|
|
|
|
readl(sc_base + SC_CLKCTRL); /* dummy read */
|
2014-10-03 19:21:06 +09:00
|
|
|
}
|