1*4882a593Smuzhiyun /* 2*4882a593Smuzhiyun * Copyright (C) 2011-2015 Panasonic Corporation 3*4882a593Smuzhiyun * Copyright (C) 2015-2016 Socionext Inc. 4*4882a593Smuzhiyun * Author: Masahiro Yamada <yamada.masahiro@socionext.com> 5*4882a593Smuzhiyun * 6*4882a593Smuzhiyun * SPDX-License-Identifier: GPL-2.0+ 7*4882a593Smuzhiyun */ 8*4882a593Smuzhiyun 9*4882a593Smuzhiyun #include <linux/io.h> 10*4882a593Smuzhiyun 11*4882a593Smuzhiyun #include "../init.h" 12*4882a593Smuzhiyun #include "../sc-regs.h" 13*4882a593Smuzhiyun uniphier_ld4_clk_init(void)14*4882a593Smuzhiyunvoid uniphier_ld4_clk_init(void) 15*4882a593Smuzhiyun { 16*4882a593Smuzhiyun u32 tmp; 17*4882a593Smuzhiyun 18*4882a593Smuzhiyun /* deassert reset */ 19*4882a593Smuzhiyun tmp = readl(SC_RSTCTRL); 20*4882a593Smuzhiyun #ifdef CONFIG_UNIPHIER_ETH 21*4882a593Smuzhiyun tmp |= SC_RSTCTRL_NRST_ETHER; 22*4882a593Smuzhiyun #endif 23*4882a593Smuzhiyun #ifdef CONFIG_NAND_DENALI 24*4882a593Smuzhiyun tmp |= SC_RSTCTRL_NRST_NAND; 25*4882a593Smuzhiyun #endif 26*4882a593Smuzhiyun writel(tmp, SC_RSTCTRL); 27*4882a593Smuzhiyun readl(SC_RSTCTRL); /* dummy read */ 28*4882a593Smuzhiyun 29*4882a593Smuzhiyun /* provide clocks */ 30*4882a593Smuzhiyun tmp = readl(SC_CLKCTRL); 31*4882a593Smuzhiyun #ifdef CONFIG_UNIPHIER_ETH 32*4882a593Smuzhiyun tmp |= SC_CLKCTRL_CEN_ETHER; 33*4882a593Smuzhiyun #endif 34*4882a593Smuzhiyun #ifdef CONFIG_USB_EHCI_HCD 35*4882a593Smuzhiyun tmp |= SC_CLKCTRL_CEN_MIO | SC_CLKCTRL_CEN_STDMAC; 36*4882a593Smuzhiyun #endif 37*4882a593Smuzhiyun #ifdef CONFIG_NAND_DENALI 38*4882a593Smuzhiyun tmp |= SC_CLKCTRL_CEN_NAND; 39*4882a593Smuzhiyun #endif 40*4882a593Smuzhiyun writel(tmp, SC_CLKCTRL); 41*4882a593Smuzhiyun readl(SC_CLKCTRL); /* dummy read */ 42*4882a593Smuzhiyun } 43