xref: /linux/drivers/clk/spear/spear1310_clock.c (revision 0b928af1f40f152dd6469f32b7792480048e6b44)
1*0b928af1SViresh Kumar /*
2*0b928af1SViresh Kumar  * arch/arm/mach-spear13xx/spear1310_clock.c
3*0b928af1SViresh Kumar  *
4*0b928af1SViresh Kumar  * SPEAr1310 machine clock framework source file
5*0b928af1SViresh Kumar  *
6*0b928af1SViresh Kumar  * Copyright (C) 2012 ST Microelectronics
7*0b928af1SViresh Kumar  * Viresh Kumar <viresh.kumar@st.com>
8*0b928af1SViresh Kumar  *
9*0b928af1SViresh Kumar  * This file is licensed under the terms of the GNU General Public
10*0b928af1SViresh Kumar  * License version 2. This program is licensed "as is" without any
11*0b928af1SViresh Kumar  * warranty of any kind, whether express or implied.
12*0b928af1SViresh Kumar  */
13*0b928af1SViresh Kumar 
14*0b928af1SViresh Kumar #include <linux/clk.h>
15*0b928af1SViresh Kumar #include <linux/clkdev.h>
16*0b928af1SViresh Kumar #include <linux/err.h>
17*0b928af1SViresh Kumar #include <linux/io.h>
18*0b928af1SViresh Kumar #include <linux/of_platform.h>
19*0b928af1SViresh Kumar #include <linux/spinlock_types.h>
20*0b928af1SViresh Kumar #include <mach/spear.h>
21*0b928af1SViresh Kumar #include "clk.h"
22*0b928af1SViresh Kumar 
23*0b928af1SViresh Kumar /* PLL related registers and bit values */
24*0b928af1SViresh Kumar #define SPEAR1310_PLL_CFG			(VA_MISC_BASE + 0x210)
25*0b928af1SViresh Kumar 	/* PLL_CFG bit values */
26*0b928af1SViresh Kumar 	#define SPEAR1310_CLCD_SYNT_CLK_MASK		1
27*0b928af1SViresh Kumar 	#define SPEAR1310_CLCD_SYNT_CLK_SHIFT		31
28*0b928af1SViresh Kumar 	#define SPEAR1310_RAS_SYNT2_3_CLK_MASK		2
29*0b928af1SViresh Kumar 	#define SPEAR1310_RAS_SYNT2_3_CLK_SHIFT		29
30*0b928af1SViresh Kumar 	#define SPEAR1310_RAS_SYNT_CLK_MASK		2
31*0b928af1SViresh Kumar 	#define SPEAR1310_RAS_SYNT0_1_CLK_SHIFT		27
32*0b928af1SViresh Kumar 	#define SPEAR1310_PLL_CLK_MASK			2
33*0b928af1SViresh Kumar 	#define SPEAR1310_PLL3_CLK_SHIFT		24
34*0b928af1SViresh Kumar 	#define SPEAR1310_PLL2_CLK_SHIFT		22
35*0b928af1SViresh Kumar 	#define SPEAR1310_PLL1_CLK_SHIFT		20
36*0b928af1SViresh Kumar 
37*0b928af1SViresh Kumar #define SPEAR1310_PLL1_CTR			(VA_MISC_BASE + 0x214)
38*0b928af1SViresh Kumar #define SPEAR1310_PLL1_FRQ			(VA_MISC_BASE + 0x218)
39*0b928af1SViresh Kumar #define SPEAR1310_PLL2_CTR			(VA_MISC_BASE + 0x220)
40*0b928af1SViresh Kumar #define SPEAR1310_PLL2_FRQ			(VA_MISC_BASE + 0x224)
41*0b928af1SViresh Kumar #define SPEAR1310_PLL3_CTR			(VA_MISC_BASE + 0x22C)
42*0b928af1SViresh Kumar #define SPEAR1310_PLL3_FRQ			(VA_MISC_BASE + 0x230)
43*0b928af1SViresh Kumar #define SPEAR1310_PLL4_CTR			(VA_MISC_BASE + 0x238)
44*0b928af1SViresh Kumar #define SPEAR1310_PLL4_FRQ			(VA_MISC_BASE + 0x23C)
45*0b928af1SViresh Kumar #define SPEAR1310_PERIP_CLK_CFG			(VA_MISC_BASE + 0x244)
46*0b928af1SViresh Kumar 	/* PERIP_CLK_CFG bit values */
47*0b928af1SViresh Kumar 	#define SPEAR1310_GPT_OSC24_VAL			0
48*0b928af1SViresh Kumar 	#define SPEAR1310_GPT_APB_VAL			1
49*0b928af1SViresh Kumar 	#define SPEAR1310_GPT_CLK_MASK			1
50*0b928af1SViresh Kumar 	#define SPEAR1310_GPT3_CLK_SHIFT		11
51*0b928af1SViresh Kumar 	#define SPEAR1310_GPT2_CLK_SHIFT		10
52*0b928af1SViresh Kumar 	#define SPEAR1310_GPT1_CLK_SHIFT		9
53*0b928af1SViresh Kumar 	#define SPEAR1310_GPT0_CLK_SHIFT		8
54*0b928af1SViresh Kumar 	#define SPEAR1310_UART_CLK_PLL5_VAL		0
55*0b928af1SViresh Kumar 	#define SPEAR1310_UART_CLK_OSC24_VAL		1
56*0b928af1SViresh Kumar 	#define SPEAR1310_UART_CLK_SYNT_VAL		2
57*0b928af1SViresh Kumar 	#define SPEAR1310_UART_CLK_MASK			2
58*0b928af1SViresh Kumar 	#define SPEAR1310_UART_CLK_SHIFT		4
59*0b928af1SViresh Kumar 
60*0b928af1SViresh Kumar 	#define SPEAR1310_AUX_CLK_PLL5_VAL		0
61*0b928af1SViresh Kumar 	#define SPEAR1310_AUX_CLK_SYNT_VAL		1
62*0b928af1SViresh Kumar 	#define SPEAR1310_CLCD_CLK_MASK			2
63*0b928af1SViresh Kumar 	#define SPEAR1310_CLCD_CLK_SHIFT		2
64*0b928af1SViresh Kumar 	#define SPEAR1310_C3_CLK_MASK			1
65*0b928af1SViresh Kumar 	#define SPEAR1310_C3_CLK_SHIFT			1
66*0b928af1SViresh Kumar 
67*0b928af1SViresh Kumar #define SPEAR1310_GMAC_CLK_CFG			(VA_MISC_BASE + 0x248)
68*0b928af1SViresh Kumar 	#define SPEAR1310_GMAC_PHY_IF_SEL_MASK		3
69*0b928af1SViresh Kumar 	#define SPEAR1310_GMAC_PHY_IF_SEL_SHIFT		4
70*0b928af1SViresh Kumar 	#define SPEAR1310_GMAC_PHY_CLK_MASK		1
71*0b928af1SViresh Kumar 	#define SPEAR1310_GMAC_PHY_CLK_SHIFT		3
72*0b928af1SViresh Kumar 	#define SPEAR1310_GMAC_PHY_INPUT_CLK_MASK	2
73*0b928af1SViresh Kumar 	#define SPEAR1310_GMAC_PHY_INPUT_CLK_SHIFT	1
74*0b928af1SViresh Kumar 
75*0b928af1SViresh Kumar #define SPEAR1310_I2S_CLK_CFG			(VA_MISC_BASE + 0x24C)
76*0b928af1SViresh Kumar 	/* I2S_CLK_CFG register mask */
77*0b928af1SViresh Kumar 	#define SPEAR1310_I2S_SCLK_X_MASK		0x1F
78*0b928af1SViresh Kumar 	#define SPEAR1310_I2S_SCLK_X_SHIFT		27
79*0b928af1SViresh Kumar 	#define SPEAR1310_I2S_SCLK_Y_MASK		0x1F
80*0b928af1SViresh Kumar 	#define SPEAR1310_I2S_SCLK_Y_SHIFT		22
81*0b928af1SViresh Kumar 	#define SPEAR1310_I2S_SCLK_EQ_SEL_SHIFT		21
82*0b928af1SViresh Kumar 	#define SPEAR1310_I2S_SCLK_SYNTH_ENB		20
83*0b928af1SViresh Kumar 	#define SPEAR1310_I2S_PRS1_CLK_X_MASK		0xFF
84*0b928af1SViresh Kumar 	#define SPEAR1310_I2S_PRS1_CLK_X_SHIFT		12
85*0b928af1SViresh Kumar 	#define SPEAR1310_I2S_PRS1_CLK_Y_MASK		0xFF
86*0b928af1SViresh Kumar 	#define SPEAR1310_I2S_PRS1_CLK_Y_SHIFT		4
87*0b928af1SViresh Kumar 	#define SPEAR1310_I2S_PRS1_EQ_SEL_SHIFT		3
88*0b928af1SViresh Kumar 	#define SPEAR1310_I2S_REF_SEL_MASK		1
89*0b928af1SViresh Kumar 	#define SPEAR1310_I2S_REF_SHIFT			2
90*0b928af1SViresh Kumar 	#define SPEAR1310_I2S_SRC_CLK_MASK		2
91*0b928af1SViresh Kumar 	#define SPEAR1310_I2S_SRC_CLK_SHIFT		0
92*0b928af1SViresh Kumar 
93*0b928af1SViresh Kumar #define SPEAR1310_C3_CLK_SYNT			(VA_MISC_BASE + 0x250)
94*0b928af1SViresh Kumar #define SPEAR1310_UART_CLK_SYNT			(VA_MISC_BASE + 0x254)
95*0b928af1SViresh Kumar #define SPEAR1310_GMAC_CLK_SYNT			(VA_MISC_BASE + 0x258)
96*0b928af1SViresh Kumar #define SPEAR1310_SDHCI_CLK_SYNT		(VA_MISC_BASE + 0x25C)
97*0b928af1SViresh Kumar #define SPEAR1310_CFXD_CLK_SYNT			(VA_MISC_BASE + 0x260)
98*0b928af1SViresh Kumar #define SPEAR1310_ADC_CLK_SYNT			(VA_MISC_BASE + 0x264)
99*0b928af1SViresh Kumar #define SPEAR1310_AMBA_CLK_SYNT			(VA_MISC_BASE + 0x268)
100*0b928af1SViresh Kumar #define SPEAR1310_CLCD_CLK_SYNT			(VA_MISC_BASE + 0x270)
101*0b928af1SViresh Kumar #define SPEAR1310_RAS_CLK_SYNT0			(VA_MISC_BASE + 0x280)
102*0b928af1SViresh Kumar #define SPEAR1310_RAS_CLK_SYNT1			(VA_MISC_BASE + 0x288)
103*0b928af1SViresh Kumar #define SPEAR1310_RAS_CLK_SYNT2			(VA_MISC_BASE + 0x290)
104*0b928af1SViresh Kumar #define SPEAR1310_RAS_CLK_SYNT3			(VA_MISC_BASE + 0x298)
105*0b928af1SViresh Kumar 	/* Check Fractional synthesizer reg masks */
106*0b928af1SViresh Kumar 
107*0b928af1SViresh Kumar #define SPEAR1310_PERIP1_CLK_ENB		(VA_MISC_BASE + 0x300)
108*0b928af1SViresh Kumar 	/* PERIP1_CLK_ENB register masks */
109*0b928af1SViresh Kumar 	#define SPEAR1310_RTC_CLK_ENB			31
110*0b928af1SViresh Kumar 	#define SPEAR1310_ADC_CLK_ENB			30
111*0b928af1SViresh Kumar 	#define SPEAR1310_C3_CLK_ENB			29
112*0b928af1SViresh Kumar 	#define SPEAR1310_JPEG_CLK_ENB			28
113*0b928af1SViresh Kumar 	#define SPEAR1310_CLCD_CLK_ENB			27
114*0b928af1SViresh Kumar 	#define SPEAR1310_DMA_CLK_ENB			25
115*0b928af1SViresh Kumar 	#define SPEAR1310_GPIO1_CLK_ENB			24
116*0b928af1SViresh Kumar 	#define SPEAR1310_GPIO0_CLK_ENB			23
117*0b928af1SViresh Kumar 	#define SPEAR1310_GPT1_CLK_ENB			22
118*0b928af1SViresh Kumar 	#define SPEAR1310_GPT0_CLK_ENB			21
119*0b928af1SViresh Kumar 	#define SPEAR1310_I2S0_CLK_ENB			20
120*0b928af1SViresh Kumar 	#define SPEAR1310_I2S1_CLK_ENB			19
121*0b928af1SViresh Kumar 	#define SPEAR1310_I2C0_CLK_ENB			18
122*0b928af1SViresh Kumar 	#define SPEAR1310_SSP_CLK_ENB			17
123*0b928af1SViresh Kumar 	#define SPEAR1310_UART_CLK_ENB			15
124*0b928af1SViresh Kumar 	#define SPEAR1310_PCIE_SATA_2_CLK_ENB		14
125*0b928af1SViresh Kumar 	#define SPEAR1310_PCIE_SATA_1_CLK_ENB		13
126*0b928af1SViresh Kumar 	#define SPEAR1310_PCIE_SATA_0_CLK_ENB		12
127*0b928af1SViresh Kumar 	#define SPEAR1310_UOC_CLK_ENB			11
128*0b928af1SViresh Kumar 	#define SPEAR1310_UHC1_CLK_ENB			10
129*0b928af1SViresh Kumar 	#define SPEAR1310_UHC0_CLK_ENB			9
130*0b928af1SViresh Kumar 	#define SPEAR1310_GMAC_CLK_ENB			8
131*0b928af1SViresh Kumar 	#define SPEAR1310_CFXD_CLK_ENB			7
132*0b928af1SViresh Kumar 	#define SPEAR1310_SDHCI_CLK_ENB			6
133*0b928af1SViresh Kumar 	#define SPEAR1310_SMI_CLK_ENB			5
134*0b928af1SViresh Kumar 	#define SPEAR1310_FSMC_CLK_ENB			4
135*0b928af1SViresh Kumar 	#define SPEAR1310_SYSRAM0_CLK_ENB		3
136*0b928af1SViresh Kumar 	#define SPEAR1310_SYSRAM1_CLK_ENB		2
137*0b928af1SViresh Kumar 	#define SPEAR1310_SYSROM_CLK_ENB		1
138*0b928af1SViresh Kumar 	#define SPEAR1310_BUS_CLK_ENB			0
139*0b928af1SViresh Kumar 
140*0b928af1SViresh Kumar #define SPEAR1310_PERIP2_CLK_ENB		(VA_MISC_BASE + 0x304)
141*0b928af1SViresh Kumar 	/* PERIP2_CLK_ENB register masks */
142*0b928af1SViresh Kumar 	#define SPEAR1310_THSENS_CLK_ENB		8
143*0b928af1SViresh Kumar 	#define SPEAR1310_I2S_REF_PAD_CLK_ENB		7
144*0b928af1SViresh Kumar 	#define SPEAR1310_ACP_CLK_ENB			6
145*0b928af1SViresh Kumar 	#define SPEAR1310_GPT3_CLK_ENB			5
146*0b928af1SViresh Kumar 	#define SPEAR1310_GPT2_CLK_ENB			4
147*0b928af1SViresh Kumar 	#define SPEAR1310_KBD_CLK_ENB			3
148*0b928af1SViresh Kumar 	#define SPEAR1310_CPU_DBG_CLK_ENB		2
149*0b928af1SViresh Kumar 	#define SPEAR1310_DDR_CORE_CLK_ENB		1
150*0b928af1SViresh Kumar 	#define SPEAR1310_DDR_CTRL_CLK_ENB		0
151*0b928af1SViresh Kumar 
152*0b928af1SViresh Kumar #define SPEAR1310_RAS_CLK_ENB			(VA_MISC_BASE + 0x310)
153*0b928af1SViresh Kumar 	/* RAS_CLK_ENB register masks */
154*0b928af1SViresh Kumar 	#define SPEAR1310_SYNT3_CLK_ENB			17
155*0b928af1SViresh Kumar 	#define SPEAR1310_SYNT2_CLK_ENB			16
156*0b928af1SViresh Kumar 	#define SPEAR1310_SYNT1_CLK_ENB			15
157*0b928af1SViresh Kumar 	#define SPEAR1310_SYNT0_CLK_ENB			14
158*0b928af1SViresh Kumar 	#define SPEAR1310_PCLK3_CLK_ENB			13
159*0b928af1SViresh Kumar 	#define SPEAR1310_PCLK2_CLK_ENB			12
160*0b928af1SViresh Kumar 	#define SPEAR1310_PCLK1_CLK_ENB			11
161*0b928af1SViresh Kumar 	#define SPEAR1310_PCLK0_CLK_ENB			10
162*0b928af1SViresh Kumar 	#define SPEAR1310_PLL3_CLK_ENB			9
163*0b928af1SViresh Kumar 	#define SPEAR1310_PLL2_CLK_ENB			8
164*0b928af1SViresh Kumar 	#define SPEAR1310_C125M_PAD_CLK_ENB		7
165*0b928af1SViresh Kumar 	#define SPEAR1310_C30M_CLK_ENB			6
166*0b928af1SViresh Kumar 	#define SPEAR1310_C48M_CLK_ENB			5
167*0b928af1SViresh Kumar 	#define SPEAR1310_OSC_25M_CLK_ENB		4
168*0b928af1SViresh Kumar 	#define SPEAR1310_OSC_32K_CLK_ENB		3
169*0b928af1SViresh Kumar 	#define SPEAR1310_OSC_24M_CLK_ENB		2
170*0b928af1SViresh Kumar 	#define SPEAR1310_PCLK_CLK_ENB			1
171*0b928af1SViresh Kumar 	#define SPEAR1310_ACLK_CLK_ENB			0
172*0b928af1SViresh Kumar 
173*0b928af1SViresh Kumar /* RAS Area Control Register */
174*0b928af1SViresh Kumar #define SPEAR1310_RAS_CTRL_REG0			(VA_SPEAR1310_RAS_BASE + 0x000)
175*0b928af1SViresh Kumar 	#define SPEAR1310_SSP1_CLK_MASK			3
176*0b928af1SViresh Kumar 	#define SPEAR1310_SSP1_CLK_SHIFT		26
177*0b928af1SViresh Kumar 	#define SPEAR1310_TDM_CLK_MASK			1
178*0b928af1SViresh Kumar 	#define SPEAR1310_TDM2_CLK_SHIFT		24
179*0b928af1SViresh Kumar 	#define SPEAR1310_TDM1_CLK_SHIFT		23
180*0b928af1SViresh Kumar 	#define SPEAR1310_I2C_CLK_MASK			1
181*0b928af1SViresh Kumar 	#define SPEAR1310_I2C7_CLK_SHIFT		22
182*0b928af1SViresh Kumar 	#define SPEAR1310_I2C6_CLK_SHIFT		21
183*0b928af1SViresh Kumar 	#define SPEAR1310_I2C5_CLK_SHIFT		20
184*0b928af1SViresh Kumar 	#define SPEAR1310_I2C4_CLK_SHIFT		19
185*0b928af1SViresh Kumar 	#define SPEAR1310_I2C3_CLK_SHIFT		18
186*0b928af1SViresh Kumar 	#define SPEAR1310_I2C2_CLK_SHIFT		17
187*0b928af1SViresh Kumar 	#define SPEAR1310_I2C1_CLK_SHIFT		16
188*0b928af1SViresh Kumar 	#define SPEAR1310_GPT64_CLK_MASK		1
189*0b928af1SViresh Kumar 	#define SPEAR1310_GPT64_CLK_SHIFT		15
190*0b928af1SViresh Kumar 	#define SPEAR1310_RAS_UART_CLK_MASK		1
191*0b928af1SViresh Kumar 	#define SPEAR1310_UART5_CLK_SHIFT		14
192*0b928af1SViresh Kumar 	#define SPEAR1310_UART4_CLK_SHIFT		13
193*0b928af1SViresh Kumar 	#define SPEAR1310_UART3_CLK_SHIFT		12
194*0b928af1SViresh Kumar 	#define SPEAR1310_UART2_CLK_SHIFT		11
195*0b928af1SViresh Kumar 	#define SPEAR1310_UART1_CLK_SHIFT		10
196*0b928af1SViresh Kumar 	#define SPEAR1310_PCI_CLK_MASK			1
197*0b928af1SViresh Kumar 	#define SPEAR1310_PCI_CLK_SHIFT			0
198*0b928af1SViresh Kumar 
199*0b928af1SViresh Kumar #define SPEAR1310_RAS_CTRL_REG1			(VA_SPEAR1310_RAS_BASE + 0x004)
200*0b928af1SViresh Kumar 	#define SPEAR1310_PHY_CLK_MASK			0x3
201*0b928af1SViresh Kumar 	#define SPEAR1310_RMII_PHY_CLK_SHIFT		0
202*0b928af1SViresh Kumar 	#define SPEAR1310_SMII_RGMII_PHY_CLK_SHIFT	2
203*0b928af1SViresh Kumar 
204*0b928af1SViresh Kumar #define SPEAR1310_RAS_SW_CLK_CTRL		(VA_SPEAR1310_RAS_BASE + 0x0148)
205*0b928af1SViresh Kumar 	#define SPEAR1310_CAN1_CLK_ENB			25
206*0b928af1SViresh Kumar 	#define SPEAR1310_CAN0_CLK_ENB			24
207*0b928af1SViresh Kumar 	#define SPEAR1310_GPT64_CLK_ENB			23
208*0b928af1SViresh Kumar 	#define SPEAR1310_SSP1_CLK_ENB			22
209*0b928af1SViresh Kumar 	#define SPEAR1310_I2C7_CLK_ENB			21
210*0b928af1SViresh Kumar 	#define SPEAR1310_I2C6_CLK_ENB			20
211*0b928af1SViresh Kumar 	#define SPEAR1310_I2C5_CLK_ENB			19
212*0b928af1SViresh Kumar 	#define SPEAR1310_I2C4_CLK_ENB			18
213*0b928af1SViresh Kumar 	#define SPEAR1310_I2C3_CLK_ENB			17
214*0b928af1SViresh Kumar 	#define SPEAR1310_I2C2_CLK_ENB			16
215*0b928af1SViresh Kumar 	#define SPEAR1310_I2C1_CLK_ENB			15
216*0b928af1SViresh Kumar 	#define SPEAR1310_UART5_CLK_ENB			14
217*0b928af1SViresh Kumar 	#define SPEAR1310_UART4_CLK_ENB			13
218*0b928af1SViresh Kumar 	#define SPEAR1310_UART3_CLK_ENB			12
219*0b928af1SViresh Kumar 	#define SPEAR1310_UART2_CLK_ENB			11
220*0b928af1SViresh Kumar 	#define SPEAR1310_UART1_CLK_ENB			10
221*0b928af1SViresh Kumar 	#define SPEAR1310_RS485_1_CLK_ENB		9
222*0b928af1SViresh Kumar 	#define SPEAR1310_RS485_0_CLK_ENB		8
223*0b928af1SViresh Kumar 	#define SPEAR1310_TDM2_CLK_ENB			7
224*0b928af1SViresh Kumar 	#define SPEAR1310_TDM1_CLK_ENB			6
225*0b928af1SViresh Kumar 	#define SPEAR1310_PCI_CLK_ENB			5
226*0b928af1SViresh Kumar 	#define SPEAR1310_GMII_CLK_ENB			4
227*0b928af1SViresh Kumar 	#define SPEAR1310_MII2_CLK_ENB			3
228*0b928af1SViresh Kumar 	#define SPEAR1310_MII1_CLK_ENB			2
229*0b928af1SViresh Kumar 	#define SPEAR1310_MII0_CLK_ENB			1
230*0b928af1SViresh Kumar 	#define SPEAR1310_ESRAM_CLK_ENB			0
231*0b928af1SViresh Kumar 
232*0b928af1SViresh Kumar static DEFINE_SPINLOCK(_lock);
233*0b928af1SViresh Kumar 
234*0b928af1SViresh Kumar /* pll rate configuration table, in ascending order of rates */
235*0b928af1SViresh Kumar static struct pll_rate_tbl pll_rtbl[] = {
236*0b928af1SViresh Kumar 	/* PCLK 24MHz */
237*0b928af1SViresh Kumar 	{.mode = 0, .m = 0x83, .n = 0x04, .p = 0x5}, /* vco 1572, pll 49.125 MHz */
238*0b928af1SViresh Kumar 	{.mode = 0, .m = 0x7D, .n = 0x06, .p = 0x3}, /* vco 1000, pll 125 MHz */
239*0b928af1SViresh Kumar 	{.mode = 0, .m = 0x64, .n = 0x06, .p = 0x1}, /* vco 800, pll 400 MHz */
240*0b928af1SViresh Kumar 	{.mode = 0, .m = 0x7D, .n = 0x06, .p = 0x1}, /* vco 1000, pll 500 MHz */
241*0b928af1SViresh Kumar 	{.mode = 0, .m = 0xA6, .n = 0x06, .p = 0x1}, /* vco 1328, pll 664 MHz */
242*0b928af1SViresh Kumar 	{.mode = 0, .m = 0xC8, .n = 0x06, .p = 0x1}, /* vco 1600, pll 800 MHz */
243*0b928af1SViresh Kumar 	{.mode = 0, .m = 0x7D, .n = 0x06, .p = 0x0}, /* vco 1, pll 1 GHz */
244*0b928af1SViresh Kumar };
245*0b928af1SViresh Kumar 
246*0b928af1SViresh Kumar /* vco-pll4 rate configuration table, in ascending order of rates */
247*0b928af1SViresh Kumar static struct pll_rate_tbl pll4_rtbl[] = {
248*0b928af1SViresh Kumar 	{.mode = 0, .m = 0x7D, .n = 0x06, .p = 0x2}, /* vco 1000, pll 250 MHz */
249*0b928af1SViresh Kumar 	{.mode = 0, .m = 0xA6, .n = 0x06, .p = 0x2}, /* vco 1328, pll 332 MHz */
250*0b928af1SViresh Kumar 	{.mode = 0, .m = 0xC8, .n = 0x06, .p = 0x2}, /* vco 1600, pll 400 MHz */
251*0b928af1SViresh Kumar 	{.mode = 0, .m = 0x7D, .n = 0x06, .p = 0x0}, /* vco 1, pll 1 GHz */
252*0b928af1SViresh Kumar };
253*0b928af1SViresh Kumar 
254*0b928af1SViresh Kumar /* aux rate configuration table, in ascending order of rates */
255*0b928af1SViresh Kumar static struct aux_rate_tbl aux_rtbl[] = {
256*0b928af1SViresh Kumar 	/* For VCO1div2 = 500 MHz */
257*0b928af1SViresh Kumar 	{.xscale = 10, .yscale = 204, .eq = 0}, /* 12.29 MHz */
258*0b928af1SViresh Kumar 	{.xscale = 4, .yscale = 21, .eq = 0}, /* 48 MHz */
259*0b928af1SViresh Kumar 	{.xscale = 2, .yscale = 6, .eq = 0}, /* 83 MHz */
260*0b928af1SViresh Kumar 	{.xscale = 2, .yscale = 4, .eq = 0}, /* 125 MHz */
261*0b928af1SViresh Kumar 	{.xscale = 1, .yscale = 3, .eq = 1}, /* 166 MHz */
262*0b928af1SViresh Kumar 	{.xscale = 1, .yscale = 2, .eq = 1}, /* 250 MHz */
263*0b928af1SViresh Kumar };
264*0b928af1SViresh Kumar 
265*0b928af1SViresh Kumar /* gmac rate configuration table, in ascending order of rates */
266*0b928af1SViresh Kumar static struct aux_rate_tbl gmac_rtbl[] = {
267*0b928af1SViresh Kumar 	/* For gmac phy input clk */
268*0b928af1SViresh Kumar 	{.xscale = 2, .yscale = 6, .eq = 0}, /* divided by 6 */
269*0b928af1SViresh Kumar 	{.xscale = 2, .yscale = 4, .eq = 0}, /* divided by 4 */
270*0b928af1SViresh Kumar 	{.xscale = 1, .yscale = 3, .eq = 1}, /* divided by 3 */
271*0b928af1SViresh Kumar 	{.xscale = 1, .yscale = 2, .eq = 1}, /* divided by 2 */
272*0b928af1SViresh Kumar };
273*0b928af1SViresh Kumar 
274*0b928af1SViresh Kumar /* clcd rate configuration table, in ascending order of rates */
275*0b928af1SViresh Kumar static struct frac_rate_tbl clcd_rtbl[] = {
276*0b928af1SViresh Kumar 	{.div = 0x14000}, /* 25 Mhz , for vc01div4 = 250 MHz*/
277*0b928af1SViresh Kumar 	{.div = 0x1284B}, /* 27 Mhz , for vc01div4 = 250 MHz*/
278*0b928af1SViresh Kumar 	{.div = 0x0D8D3}, /* 58 Mhz , for vco1div4 = 393 MHz */
279*0b928af1SViresh Kumar 	{.div = 0x0B72C}, /* 58 Mhz , for vco1div4 = 332 MHz */
280*0b928af1SViresh Kumar 	{.div = 0x089EE}, /* 58 Mhz , for vc01div4 = 250 MHz*/
281*0b928af1SViresh Kumar 	{.div = 0x06f1C}, /* 72 Mhz , for vc01div4 = 250 MHz*/
282*0b928af1SViresh Kumar 	{.div = 0x06E58}, /* 58 Mhz , for vco1div4 = 200 MHz */
283*0b928af1SViresh Kumar 	{.div = 0x06c1B}, /* 74 Mhz , for vc01div4 = 250 MHz*/
284*0b928af1SViresh Kumar 	{.div = 0x04A12}, /* 108 Mhz , for vc01div4 = 250 MHz*/
285*0b928af1SViresh Kumar 	{.div = 0x0378E}, /* 144 Mhz , for vc01div4 = 250 MHz*/
286*0b928af1SViresh Kumar };
287*0b928af1SViresh Kumar 
288*0b928af1SViresh Kumar /* i2s prescaler1 masks */
289*0b928af1SViresh Kumar static struct aux_clk_masks i2s_prs1_masks = {
290*0b928af1SViresh Kumar 	.eq_sel_mask = AUX_EQ_SEL_MASK,
291*0b928af1SViresh Kumar 	.eq_sel_shift = SPEAR1310_I2S_PRS1_EQ_SEL_SHIFT,
292*0b928af1SViresh Kumar 	.eq1_mask = AUX_EQ1_SEL,
293*0b928af1SViresh Kumar 	.eq2_mask = AUX_EQ2_SEL,
294*0b928af1SViresh Kumar 	.xscale_sel_mask = SPEAR1310_I2S_PRS1_CLK_X_MASK,
295*0b928af1SViresh Kumar 	.xscale_sel_shift = SPEAR1310_I2S_PRS1_CLK_X_SHIFT,
296*0b928af1SViresh Kumar 	.yscale_sel_mask = SPEAR1310_I2S_PRS1_CLK_Y_MASK,
297*0b928af1SViresh Kumar 	.yscale_sel_shift = SPEAR1310_I2S_PRS1_CLK_Y_SHIFT,
298*0b928af1SViresh Kumar };
299*0b928af1SViresh Kumar 
300*0b928af1SViresh Kumar /* i2s sclk (bit clock) syynthesizers masks */
301*0b928af1SViresh Kumar static struct aux_clk_masks i2s_sclk_masks = {
302*0b928af1SViresh Kumar 	.eq_sel_mask = AUX_EQ_SEL_MASK,
303*0b928af1SViresh Kumar 	.eq_sel_shift = SPEAR1310_I2S_SCLK_EQ_SEL_SHIFT,
304*0b928af1SViresh Kumar 	.eq1_mask = AUX_EQ1_SEL,
305*0b928af1SViresh Kumar 	.eq2_mask = AUX_EQ2_SEL,
306*0b928af1SViresh Kumar 	.xscale_sel_mask = SPEAR1310_I2S_SCLK_X_MASK,
307*0b928af1SViresh Kumar 	.xscale_sel_shift = SPEAR1310_I2S_SCLK_X_SHIFT,
308*0b928af1SViresh Kumar 	.yscale_sel_mask = SPEAR1310_I2S_SCLK_Y_MASK,
309*0b928af1SViresh Kumar 	.yscale_sel_shift = SPEAR1310_I2S_SCLK_Y_SHIFT,
310*0b928af1SViresh Kumar 	.enable_bit = SPEAR1310_I2S_SCLK_SYNTH_ENB,
311*0b928af1SViresh Kumar };
312*0b928af1SViresh Kumar 
313*0b928af1SViresh Kumar /* i2s prs1 aux rate configuration table, in ascending order of rates */
314*0b928af1SViresh Kumar static struct aux_rate_tbl i2s_prs1_rtbl[] = {
315*0b928af1SViresh Kumar 	/* For parent clk = 49.152 MHz */
316*0b928af1SViresh Kumar 	{.xscale = 1, .yscale = 2, .eq = 0}, /* 12.288 MHz */
317*0b928af1SViresh Kumar };
318*0b928af1SViresh Kumar 
319*0b928af1SViresh Kumar /* i2s sclk aux rate configuration table, in ascending order of rates */
320*0b928af1SViresh Kumar static struct aux_rate_tbl i2s_sclk_rtbl[] = {
321*0b928af1SViresh Kumar 	/* For i2s_ref_clk = 12.288MHz */
322*0b928af1SViresh Kumar 	{.xscale = 1, .yscale = 4, .eq = 0}, /* 1.53 MHz */
323*0b928af1SViresh Kumar 	{.xscale = 1, .yscale = 2, .eq = 0}, /* 3.07 Mhz */
324*0b928af1SViresh Kumar };
325*0b928af1SViresh Kumar 
326*0b928af1SViresh Kumar /* adc rate configuration table, in ascending order of rates */
327*0b928af1SViresh Kumar /* possible adc range is 2.5 MHz to 20 MHz. */
328*0b928af1SViresh Kumar static struct aux_rate_tbl adc_rtbl[] = {
329*0b928af1SViresh Kumar 	/* For ahb = 166.67 MHz */
330*0b928af1SViresh Kumar 	{.xscale = 1, .yscale = 31, .eq = 0}, /* 2.68 MHz */
331*0b928af1SViresh Kumar 	{.xscale = 2, .yscale = 21, .eq = 0}, /* 7.94 MHz */
332*0b928af1SViresh Kumar 	{.xscale = 4, .yscale = 21, .eq = 0}, /* 15.87 MHz */
333*0b928af1SViresh Kumar 	{.xscale = 10, .yscale = 42, .eq = 0}, /* 19.84 MHz */
334*0b928af1SViresh Kumar };
335*0b928af1SViresh Kumar 
336*0b928af1SViresh Kumar /* General synth rate configuration table, in ascending order of rates */
337*0b928af1SViresh Kumar static struct frac_rate_tbl gen_rtbl[] = {
338*0b928af1SViresh Kumar 	/* For vco1div4 = 250 MHz */
339*0b928af1SViresh Kumar 	{.div = 0x14000}, /* 25 MHz */
340*0b928af1SViresh Kumar 	{.div = 0x0A000}, /* 50 MHz */
341*0b928af1SViresh Kumar 	{.div = 0x05000}, /* 100 MHz */
342*0b928af1SViresh Kumar 	{.div = 0x02000}, /* 250 MHz */
343*0b928af1SViresh Kumar };
344*0b928af1SViresh Kumar 
345*0b928af1SViresh Kumar /* clock parents */
346*0b928af1SViresh Kumar static const char *vco_parents[] = { "osc_24m_clk", "osc_25m_clk", };
347*0b928af1SViresh Kumar static const char *gpt_parents[] = { "osc_24m_clk", "apb_clk", };
348*0b928af1SViresh Kumar static const char *uart0_parents[] = { "pll5_clk", "uart_synth_gate_clk", };
349*0b928af1SViresh Kumar static const char *c3_parents[] = { "pll5_clk", "c3_synth_gate_clk", };
350*0b928af1SViresh Kumar static const char *gmac_phy_input_parents[] = { "gmii_125m_pad_clk", "pll2_clk",
351*0b928af1SViresh Kumar 	"osc_25m_clk", };
352*0b928af1SViresh Kumar static const char *gmac_phy_parents[] = { "gmac_phy_input_mux_clk",
353*0b928af1SViresh Kumar 	"gmac_phy_synth_gate_clk", };
354*0b928af1SViresh Kumar static const char *clcd_synth_parents[] = { "vco1div4_clk", "pll2_clk", };
355*0b928af1SViresh Kumar static const char *clcd_pixel_parents[] = { "pll5_clk", "clcd_synth_clk", };
356*0b928af1SViresh Kumar static const char *i2s_src_parents[] = { "vco1div2_clk", "none", "pll3_clk",
357*0b928af1SViresh Kumar 	"i2s_src_pad_clk", };
358*0b928af1SViresh Kumar static const char *i2s_ref_parents[] = { "i2s_src_mux_clk", "i2s_prs1_clk", };
359*0b928af1SViresh Kumar static const char *gen_synth0_1_parents[] = { "vco1div4_clk", "vco3div2_clk",
360*0b928af1SViresh Kumar 	"pll3_clk", };
361*0b928af1SViresh Kumar static const char *gen_synth2_3_parents[] = { "vco1div4_clk", "vco3div2_clk",
362*0b928af1SViresh Kumar 	"pll2_clk", };
363*0b928af1SViresh Kumar static const char *rmii_phy_parents[] = { "ras_tx50_clk", "none",
364*0b928af1SViresh Kumar 	"ras_pll2_clk", "ras_synth0_clk", };
365*0b928af1SViresh Kumar static const char *smii_rgmii_phy_parents[] = { "none", "ras_tx125_clk",
366*0b928af1SViresh Kumar 	"ras_pll2_clk", "ras_synth0_clk", };
367*0b928af1SViresh Kumar static const char *uart_parents[] = { "ras_apb_clk", "gen_synth3_clk", };
368*0b928af1SViresh Kumar static const char *i2c_parents[] = { "ras_apb_clk", "gen_synth1_clk", };
369*0b928af1SViresh Kumar static const char *ssp1_parents[] = { "ras_apb_clk", "gen_synth1_clk",
370*0b928af1SViresh Kumar 	"ras_plclk0_clk", };
371*0b928af1SViresh Kumar static const char *pci_parents[] = { "ras_pll3_clk", "gen_synth2_clk", };
372*0b928af1SViresh Kumar static const char *tdm_parents[] = { "ras_pll3_clk", "gen_synth1_clk", };
373*0b928af1SViresh Kumar 
374*0b928af1SViresh Kumar void __init spear1310_clk_init(void)
375*0b928af1SViresh Kumar {
376*0b928af1SViresh Kumar 	struct clk *clk, *clk1;
377*0b928af1SViresh Kumar 
378*0b928af1SViresh Kumar 	clk = clk_register_fixed_rate(NULL, "apb_pclk", NULL, CLK_IS_ROOT, 0);
379*0b928af1SViresh Kumar 	clk_register_clkdev(clk, "apb_pclk", NULL);
380*0b928af1SViresh Kumar 
381*0b928af1SViresh Kumar 	clk = clk_register_fixed_rate(NULL, "osc_32k_clk", NULL, CLK_IS_ROOT,
382*0b928af1SViresh Kumar 			32000);
383*0b928af1SViresh Kumar 	clk_register_clkdev(clk, "osc_32k_clk", NULL);
384*0b928af1SViresh Kumar 
385*0b928af1SViresh Kumar 	clk = clk_register_fixed_rate(NULL, "osc_24m_clk", NULL, CLK_IS_ROOT,
386*0b928af1SViresh Kumar 			24000000);
387*0b928af1SViresh Kumar 	clk_register_clkdev(clk, "osc_24m_clk", NULL);
388*0b928af1SViresh Kumar 
389*0b928af1SViresh Kumar 	clk = clk_register_fixed_rate(NULL, "osc_25m_clk", NULL, CLK_IS_ROOT,
390*0b928af1SViresh Kumar 			25000000);
391*0b928af1SViresh Kumar 	clk_register_clkdev(clk, "osc_25m_clk", NULL);
392*0b928af1SViresh Kumar 
393*0b928af1SViresh Kumar 	clk = clk_register_fixed_rate(NULL, "gmii_125m_pad_clk", NULL,
394*0b928af1SViresh Kumar 			CLK_IS_ROOT, 125000000);
395*0b928af1SViresh Kumar 	clk_register_clkdev(clk, "gmii_125m_pad_clk", NULL);
396*0b928af1SViresh Kumar 
397*0b928af1SViresh Kumar 	clk = clk_register_fixed_rate(NULL, "i2s_src_pad_clk", NULL,
398*0b928af1SViresh Kumar 			CLK_IS_ROOT, 12288000);
399*0b928af1SViresh Kumar 	clk_register_clkdev(clk, "i2s_src_pad_clk", NULL);
400*0b928af1SViresh Kumar 
401*0b928af1SViresh Kumar 	/* clock derived from 32 KHz osc clk */
402*0b928af1SViresh Kumar 	clk = clk_register_gate(NULL, "rtc-spear", "osc_32k_clk", 0,
403*0b928af1SViresh Kumar 			SPEAR1310_PERIP1_CLK_ENB, SPEAR1310_RTC_CLK_ENB, 0,
404*0b928af1SViresh Kumar 			&_lock);
405*0b928af1SViresh Kumar 	clk_register_clkdev(clk, NULL, "fc900000.rtc");
406*0b928af1SViresh Kumar 
407*0b928af1SViresh Kumar 	/* clock derived from 24 or 25 MHz osc clk */
408*0b928af1SViresh Kumar 	/* vco-pll */
409*0b928af1SViresh Kumar 	clk = clk_register_mux(NULL, "vco1_mux_clk", vco_parents,
410*0b928af1SViresh Kumar 			ARRAY_SIZE(vco_parents), 0, SPEAR1310_PLL_CFG,
411*0b928af1SViresh Kumar 			SPEAR1310_PLL1_CLK_SHIFT, SPEAR1310_PLL_CLK_MASK, 0,
412*0b928af1SViresh Kumar 			&_lock);
413*0b928af1SViresh Kumar 	clk_register_clkdev(clk, "vco1_mux_clk", NULL);
414*0b928af1SViresh Kumar 	clk = clk_register_vco_pll("vco1_clk", "pll1_clk", NULL, "vco1_mux_clk",
415*0b928af1SViresh Kumar 			0, SPEAR1310_PLL1_CTR, SPEAR1310_PLL1_FRQ, pll_rtbl,
416*0b928af1SViresh Kumar 			ARRAY_SIZE(pll_rtbl), &_lock, &clk1, NULL);
417*0b928af1SViresh Kumar 	clk_register_clkdev(clk, "vco1_clk", NULL);
418*0b928af1SViresh Kumar 	clk_register_clkdev(clk1, "pll1_clk", NULL);
419*0b928af1SViresh Kumar 
420*0b928af1SViresh Kumar 	clk = clk_register_mux(NULL, "vco2_mux_clk", vco_parents,
421*0b928af1SViresh Kumar 			ARRAY_SIZE(vco_parents), 0, SPEAR1310_PLL_CFG,
422*0b928af1SViresh Kumar 			SPEAR1310_PLL2_CLK_SHIFT, SPEAR1310_PLL_CLK_MASK, 0,
423*0b928af1SViresh Kumar 			&_lock);
424*0b928af1SViresh Kumar 	clk_register_clkdev(clk, "vco2_mux_clk", NULL);
425*0b928af1SViresh Kumar 	clk = clk_register_vco_pll("vco2_clk", "pll2_clk", NULL, "vco2_mux_clk",
426*0b928af1SViresh Kumar 			0, SPEAR1310_PLL2_CTR, SPEAR1310_PLL2_FRQ, pll_rtbl,
427*0b928af1SViresh Kumar 			ARRAY_SIZE(pll_rtbl), &_lock, &clk1, NULL);
428*0b928af1SViresh Kumar 	clk_register_clkdev(clk, "vco2_clk", NULL);
429*0b928af1SViresh Kumar 	clk_register_clkdev(clk1, "pll2_clk", NULL);
430*0b928af1SViresh Kumar 
431*0b928af1SViresh Kumar 	clk = clk_register_mux(NULL, "vco3_mux_clk", vco_parents,
432*0b928af1SViresh Kumar 			ARRAY_SIZE(vco_parents), 0, SPEAR1310_PLL_CFG,
433*0b928af1SViresh Kumar 			SPEAR1310_PLL3_CLK_SHIFT, SPEAR1310_PLL_CLK_MASK, 0,
434*0b928af1SViresh Kumar 			&_lock);
435*0b928af1SViresh Kumar 	clk_register_clkdev(clk, "vco3_mux_clk", NULL);
436*0b928af1SViresh Kumar 	clk = clk_register_vco_pll("vco3_clk", "pll3_clk", NULL, "vco3_mux_clk",
437*0b928af1SViresh Kumar 			0, SPEAR1310_PLL3_CTR, SPEAR1310_PLL3_FRQ, pll_rtbl,
438*0b928af1SViresh Kumar 			ARRAY_SIZE(pll_rtbl), &_lock, &clk1, NULL);
439*0b928af1SViresh Kumar 	clk_register_clkdev(clk, "vco3_clk", NULL);
440*0b928af1SViresh Kumar 	clk_register_clkdev(clk1, "pll3_clk", NULL);
441*0b928af1SViresh Kumar 
442*0b928af1SViresh Kumar 	clk = clk_register_vco_pll("vco4_clk", "pll4_clk", NULL, "osc_24m_clk",
443*0b928af1SViresh Kumar 			0, SPEAR1310_PLL4_CTR, SPEAR1310_PLL4_FRQ, pll4_rtbl,
444*0b928af1SViresh Kumar 			ARRAY_SIZE(pll4_rtbl), &_lock, &clk1, NULL);
445*0b928af1SViresh Kumar 	clk_register_clkdev(clk, "vco4_clk", NULL);
446*0b928af1SViresh Kumar 	clk_register_clkdev(clk1, "pll4_clk", NULL);
447*0b928af1SViresh Kumar 
448*0b928af1SViresh Kumar 	clk = clk_register_fixed_rate(NULL, "pll5_clk", "osc_24m_clk", 0,
449*0b928af1SViresh Kumar 			48000000);
450*0b928af1SViresh Kumar 	clk_register_clkdev(clk, "pll5_clk", NULL);
451*0b928af1SViresh Kumar 
452*0b928af1SViresh Kumar 	clk = clk_register_fixed_rate(NULL, "pll6_clk", "osc_25m_clk", 0,
453*0b928af1SViresh Kumar 			25000000);
454*0b928af1SViresh Kumar 	clk_register_clkdev(clk, "pll6_clk", NULL);
455*0b928af1SViresh Kumar 
456*0b928af1SViresh Kumar 	/* vco div n clocks */
457*0b928af1SViresh Kumar 	clk = clk_register_fixed_factor(NULL, "vco1div2_clk", "vco1_clk", 0, 1,
458*0b928af1SViresh Kumar 			2);
459*0b928af1SViresh Kumar 	clk_register_clkdev(clk, "vco1div2_clk", NULL);
460*0b928af1SViresh Kumar 
461*0b928af1SViresh Kumar 	clk = clk_register_fixed_factor(NULL, "vco1div4_clk", "vco1_clk", 0, 1,
462*0b928af1SViresh Kumar 			4);
463*0b928af1SViresh Kumar 	clk_register_clkdev(clk, "vco1div4_clk", NULL);
464*0b928af1SViresh Kumar 
465*0b928af1SViresh Kumar 	clk = clk_register_fixed_factor(NULL, "vco2div2_clk", "vco2_clk", 0, 1,
466*0b928af1SViresh Kumar 			2);
467*0b928af1SViresh Kumar 	clk_register_clkdev(clk, "vco2div2_clk", NULL);
468*0b928af1SViresh Kumar 
469*0b928af1SViresh Kumar 	clk = clk_register_fixed_factor(NULL, "vco3div2_clk", "vco3_clk", 0, 1,
470*0b928af1SViresh Kumar 			2);
471*0b928af1SViresh Kumar 	clk_register_clkdev(clk, "vco3div2_clk", NULL);
472*0b928af1SViresh Kumar 
473*0b928af1SViresh Kumar 	/* peripherals */
474*0b928af1SViresh Kumar 	clk_register_fixed_factor(NULL, "thermal_clk", "osc_24m_clk", 0, 1,
475*0b928af1SViresh Kumar 			128);
476*0b928af1SViresh Kumar 	clk = clk_register_gate(NULL, "thermal_gate_clk", "thermal_clk", 0,
477*0b928af1SViresh Kumar 			SPEAR1310_PERIP2_CLK_ENB, SPEAR1310_THSENS_CLK_ENB, 0,
478*0b928af1SViresh Kumar 			&_lock);
479*0b928af1SViresh Kumar 	clk_register_clkdev(clk, NULL, "spear_thermal");
480*0b928af1SViresh Kumar 
481*0b928af1SViresh Kumar 	/* clock derived from pll4 clk */
482*0b928af1SViresh Kumar 	clk = clk_register_fixed_factor(NULL, "ddr_clk", "pll4_clk", 0, 1,
483*0b928af1SViresh Kumar 			1);
484*0b928af1SViresh Kumar 	clk_register_clkdev(clk, "ddr_clk", NULL);
485*0b928af1SViresh Kumar 
486*0b928af1SViresh Kumar 	/* clock derived from pll1 clk */
487*0b928af1SViresh Kumar 	clk = clk_register_fixed_factor(NULL, "cpu_clk", "pll1_clk", 0, 1, 2);
488*0b928af1SViresh Kumar 	clk_register_clkdev(clk, "cpu_clk", NULL);
489*0b928af1SViresh Kumar 
490*0b928af1SViresh Kumar 	clk = clk_register_fixed_factor(NULL, "wdt_clk", "cpu_clk", 0, 1,
491*0b928af1SViresh Kumar 			2);
492*0b928af1SViresh Kumar 	clk_register_clkdev(clk, NULL, "ec800620.wdt");
493*0b928af1SViresh Kumar 
494*0b928af1SViresh Kumar 	clk = clk_register_fixed_factor(NULL, "ahb_clk", "pll1_clk", 0, 1,
495*0b928af1SViresh Kumar 			6);
496*0b928af1SViresh Kumar 	clk_register_clkdev(clk, "ahb_clk", NULL);
497*0b928af1SViresh Kumar 
498*0b928af1SViresh Kumar 	clk = clk_register_fixed_factor(NULL, "apb_clk", "pll1_clk", 0, 1,
499*0b928af1SViresh Kumar 			12);
500*0b928af1SViresh Kumar 	clk_register_clkdev(clk, "apb_clk", NULL);
501*0b928af1SViresh Kumar 
502*0b928af1SViresh Kumar 	/* gpt clocks */
503*0b928af1SViresh Kumar 	clk = clk_register_mux(NULL, "gpt0_mux_clk", gpt_parents,
504*0b928af1SViresh Kumar 			ARRAY_SIZE(gpt_parents), 0, SPEAR1310_PERIP_CLK_CFG,
505*0b928af1SViresh Kumar 			SPEAR1310_GPT0_CLK_SHIFT, SPEAR1310_GPT_CLK_MASK, 0,
506*0b928af1SViresh Kumar 			&_lock);
507*0b928af1SViresh Kumar 	clk_register_clkdev(clk, "gpt0_mux_clk", NULL);
508*0b928af1SViresh Kumar 	clk = clk_register_gate(NULL, "gpt0_clk", "gpt0_mux_clk", 0,
509*0b928af1SViresh Kumar 			SPEAR1310_PERIP1_CLK_ENB, SPEAR1310_GPT0_CLK_ENB, 0,
510*0b928af1SViresh Kumar 			&_lock);
511*0b928af1SViresh Kumar 	clk_register_clkdev(clk, NULL, "gpt0");
512*0b928af1SViresh Kumar 
513*0b928af1SViresh Kumar 	clk = clk_register_mux(NULL, "gpt1_mux_clk", gpt_parents,
514*0b928af1SViresh Kumar 			ARRAY_SIZE(gpt_parents), 0, SPEAR1310_PERIP_CLK_CFG,
515*0b928af1SViresh Kumar 			SPEAR1310_GPT1_CLK_SHIFT, SPEAR1310_GPT_CLK_MASK, 0,
516*0b928af1SViresh Kumar 			&_lock);
517*0b928af1SViresh Kumar 	clk_register_clkdev(clk, "gpt1_mux_clk", NULL);
518*0b928af1SViresh Kumar 	clk = clk_register_gate(NULL, "gpt1_clk", "gpt1_mux_clk", 0,
519*0b928af1SViresh Kumar 			SPEAR1310_PERIP1_CLK_ENB, SPEAR1310_GPT1_CLK_ENB, 0,
520*0b928af1SViresh Kumar 			&_lock);
521*0b928af1SViresh Kumar 	clk_register_clkdev(clk, NULL, "gpt1");
522*0b928af1SViresh Kumar 
523*0b928af1SViresh Kumar 	clk = clk_register_mux(NULL, "gpt2_mux_clk", gpt_parents,
524*0b928af1SViresh Kumar 			ARRAY_SIZE(gpt_parents), 0, SPEAR1310_PERIP_CLK_CFG,
525*0b928af1SViresh Kumar 			SPEAR1310_GPT2_CLK_SHIFT, SPEAR1310_GPT_CLK_MASK, 0,
526*0b928af1SViresh Kumar 			&_lock);
527*0b928af1SViresh Kumar 	clk_register_clkdev(clk, "gpt2_mux_clk", NULL);
528*0b928af1SViresh Kumar 	clk = clk_register_gate(NULL, "gpt2_clk", "gpt2_mux_clk", 0,
529*0b928af1SViresh Kumar 			SPEAR1310_PERIP2_CLK_ENB, SPEAR1310_GPT2_CLK_ENB, 0,
530*0b928af1SViresh Kumar 			&_lock);
531*0b928af1SViresh Kumar 	clk_register_clkdev(clk, NULL, "gpt2");
532*0b928af1SViresh Kumar 
533*0b928af1SViresh Kumar 	clk = clk_register_mux(NULL, "gpt3_mux_clk", gpt_parents,
534*0b928af1SViresh Kumar 			ARRAY_SIZE(gpt_parents), 0, SPEAR1310_PERIP_CLK_CFG,
535*0b928af1SViresh Kumar 			SPEAR1310_GPT3_CLK_SHIFT, SPEAR1310_GPT_CLK_MASK, 0,
536*0b928af1SViresh Kumar 			&_lock);
537*0b928af1SViresh Kumar 	clk_register_clkdev(clk, "gpt3_mux_clk", NULL);
538*0b928af1SViresh Kumar 	clk = clk_register_gate(NULL, "gpt3_clk", "gpt3_mux_clk", 0,
539*0b928af1SViresh Kumar 			SPEAR1310_PERIP2_CLK_ENB, SPEAR1310_GPT3_CLK_ENB, 0,
540*0b928af1SViresh Kumar 			&_lock);
541*0b928af1SViresh Kumar 	clk_register_clkdev(clk, NULL, "gpt3");
542*0b928af1SViresh Kumar 
543*0b928af1SViresh Kumar 	/* others */
544*0b928af1SViresh Kumar 	clk = clk_register_aux("uart_synth_clk", "uart_synth_gate_clk",
545*0b928af1SViresh Kumar 			"vco1div2_clk", 0, SPEAR1310_UART_CLK_SYNT, NULL,
546*0b928af1SViresh Kumar 			aux_rtbl, ARRAY_SIZE(aux_rtbl), &_lock, &clk1);
547*0b928af1SViresh Kumar 	clk_register_clkdev(clk, "uart_synth_clk", NULL);
548*0b928af1SViresh Kumar 	clk_register_clkdev(clk1, "uart_synth_gate_clk", NULL);
549*0b928af1SViresh Kumar 
550*0b928af1SViresh Kumar 	clk = clk_register_mux(NULL, "uart0_mux_clk", uart0_parents,
551*0b928af1SViresh Kumar 			ARRAY_SIZE(uart0_parents), 0, SPEAR1310_PERIP_CLK_CFG,
552*0b928af1SViresh Kumar 			SPEAR1310_UART_CLK_SHIFT, SPEAR1310_UART_CLK_MASK, 0,
553*0b928af1SViresh Kumar 			&_lock);
554*0b928af1SViresh Kumar 	clk_register_clkdev(clk, "uart0_mux_clk", NULL);
555*0b928af1SViresh Kumar 
556*0b928af1SViresh Kumar 	clk = clk_register_gate(NULL, "uart0_clk", "uart0_mux_clk", 0,
557*0b928af1SViresh Kumar 			SPEAR1310_PERIP1_CLK_ENB, SPEAR1310_UART_CLK_ENB, 0,
558*0b928af1SViresh Kumar 			&_lock);
559*0b928af1SViresh Kumar 	clk_register_clkdev(clk, NULL, "e0000000.serial");
560*0b928af1SViresh Kumar 
561*0b928af1SViresh Kumar 	clk = clk_register_aux("sdhci_synth_clk", "sdhci_synth_gate_clk",
562*0b928af1SViresh Kumar 			"vco1div2_clk", 0, SPEAR1310_SDHCI_CLK_SYNT, NULL,
563*0b928af1SViresh Kumar 			aux_rtbl, ARRAY_SIZE(aux_rtbl), &_lock, &clk1);
564*0b928af1SViresh Kumar 	clk_register_clkdev(clk, "sdhci_synth_clk", NULL);
565*0b928af1SViresh Kumar 	clk_register_clkdev(clk1, "sdhci_synth_gate_clk", NULL);
566*0b928af1SViresh Kumar 
567*0b928af1SViresh Kumar 	clk = clk_register_gate(NULL, "sdhci_clk", "sdhci_synth_gate_clk", 0,
568*0b928af1SViresh Kumar 			SPEAR1310_PERIP1_CLK_ENB, SPEAR1310_SDHCI_CLK_ENB, 0,
569*0b928af1SViresh Kumar 			&_lock);
570*0b928af1SViresh Kumar 	clk_register_clkdev(clk, NULL, "b3000000.sdhci");
571*0b928af1SViresh Kumar 
572*0b928af1SViresh Kumar 	clk = clk_register_aux("cfxd_synth_clk", "cfxd_synth_gate_clk",
573*0b928af1SViresh Kumar 			"vco1div2_clk", 0, SPEAR1310_CFXD_CLK_SYNT, NULL,
574*0b928af1SViresh Kumar 			aux_rtbl, ARRAY_SIZE(aux_rtbl), &_lock, &clk1);
575*0b928af1SViresh Kumar 	clk_register_clkdev(clk, "cfxd_synth_clk", NULL);
576*0b928af1SViresh Kumar 	clk_register_clkdev(clk1, "cfxd_synth_gate_clk", NULL);
577*0b928af1SViresh Kumar 
578*0b928af1SViresh Kumar 	clk = clk_register_gate(NULL, "cfxd_clk", "cfxd_synth_gate_clk", 0,
579*0b928af1SViresh Kumar 			SPEAR1310_PERIP1_CLK_ENB, SPEAR1310_CFXD_CLK_ENB, 0,
580*0b928af1SViresh Kumar 			&_lock);
581*0b928af1SViresh Kumar 	clk_register_clkdev(clk, NULL, "b2800000.cf");
582*0b928af1SViresh Kumar 	clk_register_clkdev(clk, NULL, "arasan_xd");
583*0b928af1SViresh Kumar 
584*0b928af1SViresh Kumar 	clk = clk_register_aux("c3_synth_clk", "c3_synth_gate_clk",
585*0b928af1SViresh Kumar 			"vco1div2_clk", 0, SPEAR1310_C3_CLK_SYNT, NULL,
586*0b928af1SViresh Kumar 			aux_rtbl, ARRAY_SIZE(aux_rtbl), &_lock, &clk1);
587*0b928af1SViresh Kumar 	clk_register_clkdev(clk, "c3_synth_clk", NULL);
588*0b928af1SViresh Kumar 	clk_register_clkdev(clk1, "c3_synth_gate_clk", NULL);
589*0b928af1SViresh Kumar 
590*0b928af1SViresh Kumar 	clk = clk_register_mux(NULL, "c3_mux_clk", c3_parents,
591*0b928af1SViresh Kumar 			ARRAY_SIZE(c3_parents), 0, SPEAR1310_PERIP_CLK_CFG,
592*0b928af1SViresh Kumar 			SPEAR1310_C3_CLK_SHIFT, SPEAR1310_C3_CLK_MASK, 0,
593*0b928af1SViresh Kumar 			&_lock);
594*0b928af1SViresh Kumar 	clk_register_clkdev(clk, "c3_mux_clk", NULL);
595*0b928af1SViresh Kumar 
596*0b928af1SViresh Kumar 	clk = clk_register_gate(NULL, "c3_clk", "c3_mux_clk", 0,
597*0b928af1SViresh Kumar 			SPEAR1310_PERIP1_CLK_ENB, SPEAR1310_C3_CLK_ENB, 0,
598*0b928af1SViresh Kumar 			&_lock);
599*0b928af1SViresh Kumar 	clk_register_clkdev(clk, NULL, "c3");
600*0b928af1SViresh Kumar 
601*0b928af1SViresh Kumar 	/* gmac */
602*0b928af1SViresh Kumar 	clk = clk_register_mux(NULL, "gmac_phy_input_mux_clk",
603*0b928af1SViresh Kumar 			gmac_phy_input_parents,
604*0b928af1SViresh Kumar 			ARRAY_SIZE(gmac_phy_input_parents), 0,
605*0b928af1SViresh Kumar 			SPEAR1310_GMAC_CLK_CFG,
606*0b928af1SViresh Kumar 			SPEAR1310_GMAC_PHY_INPUT_CLK_SHIFT,
607*0b928af1SViresh Kumar 			SPEAR1310_GMAC_PHY_INPUT_CLK_MASK, 0, &_lock);
608*0b928af1SViresh Kumar 	clk_register_clkdev(clk, "gmac_phy_input_mux_clk", NULL);
609*0b928af1SViresh Kumar 
610*0b928af1SViresh Kumar 	clk = clk_register_aux("gmac_phy_synth_clk", "gmac_phy_synth_gate_clk",
611*0b928af1SViresh Kumar 			"gmac_phy_input_mux_clk", 0, SPEAR1310_GMAC_CLK_SYNT,
612*0b928af1SViresh Kumar 			NULL, gmac_rtbl, ARRAY_SIZE(gmac_rtbl), &_lock, &clk1);
613*0b928af1SViresh Kumar 	clk_register_clkdev(clk, "gmac_phy_synth_clk", NULL);
614*0b928af1SViresh Kumar 	clk_register_clkdev(clk1, "gmac_phy_synth_gate_clk", NULL);
615*0b928af1SViresh Kumar 
616*0b928af1SViresh Kumar 	clk = clk_register_mux(NULL, "gmac_phy_mux_clk", gmac_phy_parents,
617*0b928af1SViresh Kumar 			ARRAY_SIZE(gmac_phy_parents), 0,
618*0b928af1SViresh Kumar 			SPEAR1310_PERIP_CLK_CFG, SPEAR1310_GMAC_PHY_CLK_SHIFT,
619*0b928af1SViresh Kumar 			SPEAR1310_GMAC_PHY_CLK_MASK, 0, &_lock);
620*0b928af1SViresh Kumar 	clk_register_clkdev(clk, NULL, "stmmacphy.0");
621*0b928af1SViresh Kumar 
622*0b928af1SViresh Kumar 	/* clcd */
623*0b928af1SViresh Kumar 	clk = clk_register_mux(NULL, "clcd_synth_mux_clk", clcd_synth_parents,
624*0b928af1SViresh Kumar 			ARRAY_SIZE(clcd_synth_parents), 0,
625*0b928af1SViresh Kumar 			SPEAR1310_CLCD_CLK_SYNT, SPEAR1310_CLCD_SYNT_CLK_SHIFT,
626*0b928af1SViresh Kumar 			SPEAR1310_CLCD_SYNT_CLK_MASK, 0, &_lock);
627*0b928af1SViresh Kumar 	clk_register_clkdev(clk, "clcd_synth_mux_clk", NULL);
628*0b928af1SViresh Kumar 
629*0b928af1SViresh Kumar 	clk = clk_register_frac("clcd_synth_clk", "clcd_synth_mux_clk", 0,
630*0b928af1SViresh Kumar 			SPEAR1310_CLCD_CLK_SYNT, clcd_rtbl,
631*0b928af1SViresh Kumar 			ARRAY_SIZE(clcd_rtbl), &_lock);
632*0b928af1SViresh Kumar 	clk_register_clkdev(clk, "clcd_synth_clk", NULL);
633*0b928af1SViresh Kumar 
634*0b928af1SViresh Kumar 	clk = clk_register_mux(NULL, "clcd_pixel_mux_clk", clcd_pixel_parents,
635*0b928af1SViresh Kumar 			ARRAY_SIZE(clcd_pixel_parents), 0,
636*0b928af1SViresh Kumar 			SPEAR1310_PERIP_CLK_CFG, SPEAR1310_CLCD_CLK_SHIFT,
637*0b928af1SViresh Kumar 			SPEAR1310_CLCD_CLK_MASK, 0, &_lock);
638*0b928af1SViresh Kumar 	clk_register_clkdev(clk, "clcd_pixel_clk", NULL);
639*0b928af1SViresh Kumar 
640*0b928af1SViresh Kumar 	clk = clk_register_gate(NULL, "clcd_clk", "clcd_pixel_mux_clk", 0,
641*0b928af1SViresh Kumar 			SPEAR1310_PERIP1_CLK_ENB, SPEAR1310_CLCD_CLK_ENB, 0,
642*0b928af1SViresh Kumar 			&_lock);
643*0b928af1SViresh Kumar 	clk_register_clkdev(clk, "clcd_clk", NULL);
644*0b928af1SViresh Kumar 
645*0b928af1SViresh Kumar 	/* i2s */
646*0b928af1SViresh Kumar 	clk = clk_register_mux(NULL, "i2s_src_mux_clk", i2s_src_parents,
647*0b928af1SViresh Kumar 			ARRAY_SIZE(i2s_src_parents), 0, SPEAR1310_I2S_CLK_CFG,
648*0b928af1SViresh Kumar 			SPEAR1310_I2S_SRC_CLK_SHIFT, SPEAR1310_I2S_SRC_CLK_MASK,
649*0b928af1SViresh Kumar 			0, &_lock);
650*0b928af1SViresh Kumar 	clk_register_clkdev(clk, "i2s_src_clk", NULL);
651*0b928af1SViresh Kumar 
652*0b928af1SViresh Kumar 	clk = clk_register_aux("i2s_prs1_clk", NULL, "i2s_src_mux_clk", 0,
653*0b928af1SViresh Kumar 			SPEAR1310_I2S_CLK_CFG, &i2s_prs1_masks, i2s_prs1_rtbl,
654*0b928af1SViresh Kumar 			ARRAY_SIZE(i2s_prs1_rtbl), &_lock, NULL);
655*0b928af1SViresh Kumar 	clk_register_clkdev(clk, "i2s_prs1_clk", NULL);
656*0b928af1SViresh Kumar 
657*0b928af1SViresh Kumar 	clk = clk_register_mux(NULL, "i2s_ref_mux_clk", i2s_ref_parents,
658*0b928af1SViresh Kumar 			ARRAY_SIZE(i2s_ref_parents), 0, SPEAR1310_I2S_CLK_CFG,
659*0b928af1SViresh Kumar 			SPEAR1310_I2S_REF_SHIFT, SPEAR1310_I2S_REF_SEL_MASK, 0,
660*0b928af1SViresh Kumar 			&_lock);
661*0b928af1SViresh Kumar 	clk_register_clkdev(clk, "i2s_ref_clk", NULL);
662*0b928af1SViresh Kumar 
663*0b928af1SViresh Kumar 	clk = clk_register_gate(NULL, "i2s_ref_pad_clk", "i2s_ref_mux_clk", 0,
664*0b928af1SViresh Kumar 			SPEAR1310_PERIP2_CLK_ENB, SPEAR1310_I2S_REF_PAD_CLK_ENB,
665*0b928af1SViresh Kumar 			0, &_lock);
666*0b928af1SViresh Kumar 	clk_register_clkdev(clk, "i2s_ref_pad_clk", NULL);
667*0b928af1SViresh Kumar 
668*0b928af1SViresh Kumar 	clk = clk_register_aux("i2s_sclk_clk", "i2s_sclk_gate_clk",
669*0b928af1SViresh Kumar 			"i2s_ref_pad_clk", 0, SPEAR1310_I2S_CLK_CFG,
670*0b928af1SViresh Kumar 			&i2s_sclk_masks, i2s_sclk_rtbl,
671*0b928af1SViresh Kumar 			ARRAY_SIZE(i2s_sclk_rtbl), &_lock, &clk1);
672*0b928af1SViresh Kumar 	clk_register_clkdev(clk, "i2s_sclk_clk", NULL);
673*0b928af1SViresh Kumar 	clk_register_clkdev(clk1, "i2s_sclk_gate_clk", NULL);
674*0b928af1SViresh Kumar 
675*0b928af1SViresh Kumar 	/* clock derived from ahb clk */
676*0b928af1SViresh Kumar 	clk = clk_register_gate(NULL, "i2c0_clk", "ahb_clk", 0,
677*0b928af1SViresh Kumar 			SPEAR1310_PERIP1_CLK_ENB, SPEAR1310_I2C0_CLK_ENB, 0,
678*0b928af1SViresh Kumar 			&_lock);
679*0b928af1SViresh Kumar 	clk_register_clkdev(clk, NULL, "e0280000.i2c");
680*0b928af1SViresh Kumar 
681*0b928af1SViresh Kumar 	clk = clk_register_gate(NULL, "dma_clk", "ahb_clk", 0,
682*0b928af1SViresh Kumar 			SPEAR1310_PERIP1_CLK_ENB, SPEAR1310_DMA_CLK_ENB, 0,
683*0b928af1SViresh Kumar 			&_lock);
684*0b928af1SViresh Kumar 	clk_register_clkdev(clk, NULL, "ea800000.dma");
685*0b928af1SViresh Kumar 	clk_register_clkdev(clk, NULL, "eb000000.dma");
686*0b928af1SViresh Kumar 
687*0b928af1SViresh Kumar 	clk = clk_register_gate(NULL, "jpeg_clk", "ahb_clk", 0,
688*0b928af1SViresh Kumar 			SPEAR1310_PERIP1_CLK_ENB, SPEAR1310_JPEG_CLK_ENB, 0,
689*0b928af1SViresh Kumar 			&_lock);
690*0b928af1SViresh Kumar 	clk_register_clkdev(clk, NULL, "b2000000.jpeg");
691*0b928af1SViresh Kumar 
692*0b928af1SViresh Kumar 	clk = clk_register_gate(NULL, "gmac_clk", "ahb_clk", 0,
693*0b928af1SViresh Kumar 			SPEAR1310_PERIP1_CLK_ENB, SPEAR1310_GMAC_CLK_ENB, 0,
694*0b928af1SViresh Kumar 			&_lock);
695*0b928af1SViresh Kumar 	clk_register_clkdev(clk, NULL, "e2000000.eth");
696*0b928af1SViresh Kumar 
697*0b928af1SViresh Kumar 	clk = clk_register_gate(NULL, "fsmc_clk", "ahb_clk", 0,
698*0b928af1SViresh Kumar 			SPEAR1310_PERIP1_CLK_ENB, SPEAR1310_FSMC_CLK_ENB, 0,
699*0b928af1SViresh Kumar 			&_lock);
700*0b928af1SViresh Kumar 	clk_register_clkdev(clk, NULL, "b0000000.flash");
701*0b928af1SViresh Kumar 
702*0b928af1SViresh Kumar 	clk = clk_register_gate(NULL, "smi_clk", "ahb_clk", 0,
703*0b928af1SViresh Kumar 			SPEAR1310_PERIP1_CLK_ENB, SPEAR1310_SMI_CLK_ENB, 0,
704*0b928af1SViresh Kumar 			&_lock);
705*0b928af1SViresh Kumar 	clk_register_clkdev(clk, NULL, "ea000000.flash");
706*0b928af1SViresh Kumar 
707*0b928af1SViresh Kumar 	clk = clk_register_gate(NULL, "usbh0_clk", "ahb_clk", 0,
708*0b928af1SViresh Kumar 			SPEAR1310_PERIP1_CLK_ENB, SPEAR1310_UHC0_CLK_ENB, 0,
709*0b928af1SViresh Kumar 			&_lock);
710*0b928af1SViresh Kumar 	clk_register_clkdev(clk, "usbh.0_clk", NULL);
711*0b928af1SViresh Kumar 
712*0b928af1SViresh Kumar 	clk = clk_register_gate(NULL, "usbh1_clk", "ahb_clk", 0,
713*0b928af1SViresh Kumar 			SPEAR1310_PERIP1_CLK_ENB, SPEAR1310_UHC1_CLK_ENB, 0,
714*0b928af1SViresh Kumar 			&_lock);
715*0b928af1SViresh Kumar 	clk_register_clkdev(clk, "usbh.1_clk", NULL);
716*0b928af1SViresh Kumar 
717*0b928af1SViresh Kumar 	clk = clk_register_gate(NULL, "uoc_clk", "ahb_clk", 0,
718*0b928af1SViresh Kumar 			SPEAR1310_PERIP1_CLK_ENB, SPEAR1310_UOC_CLK_ENB, 0,
719*0b928af1SViresh Kumar 			&_lock);
720*0b928af1SViresh Kumar 	clk_register_clkdev(clk, NULL, "uoc");
721*0b928af1SViresh Kumar 
722*0b928af1SViresh Kumar 	clk = clk_register_gate(NULL, "pcie_sata_0_clk", "ahb_clk", 0,
723*0b928af1SViresh Kumar 			SPEAR1310_PERIP1_CLK_ENB, SPEAR1310_PCIE_SATA_0_CLK_ENB,
724*0b928af1SViresh Kumar 			0, &_lock);
725*0b928af1SViresh Kumar 	clk_register_clkdev(clk, NULL, "dw_pcie.0");
726*0b928af1SViresh Kumar 	clk_register_clkdev(clk, NULL, "ahci.0");
727*0b928af1SViresh Kumar 
728*0b928af1SViresh Kumar 	clk = clk_register_gate(NULL, "pcie_sata_1_clk", "ahb_clk", 0,
729*0b928af1SViresh Kumar 			SPEAR1310_PERIP1_CLK_ENB, SPEAR1310_PCIE_SATA_1_CLK_ENB,
730*0b928af1SViresh Kumar 			0, &_lock);
731*0b928af1SViresh Kumar 	clk_register_clkdev(clk, NULL, "dw_pcie.1");
732*0b928af1SViresh Kumar 	clk_register_clkdev(clk, NULL, "ahci.1");
733*0b928af1SViresh Kumar 
734*0b928af1SViresh Kumar 	clk = clk_register_gate(NULL, "pcie_sata_2_clk", "ahb_clk", 0,
735*0b928af1SViresh Kumar 			SPEAR1310_PERIP1_CLK_ENB, SPEAR1310_PCIE_SATA_2_CLK_ENB,
736*0b928af1SViresh Kumar 			0, &_lock);
737*0b928af1SViresh Kumar 	clk_register_clkdev(clk, NULL, "dw_pcie.2");
738*0b928af1SViresh Kumar 	clk_register_clkdev(clk, NULL, "ahci.2");
739*0b928af1SViresh Kumar 
740*0b928af1SViresh Kumar 	clk = clk_register_gate(NULL, "sysram0_clk", "ahb_clk", 0,
741*0b928af1SViresh Kumar 			SPEAR1310_PERIP1_CLK_ENB, SPEAR1310_SYSRAM0_CLK_ENB, 0,
742*0b928af1SViresh Kumar 			&_lock);
743*0b928af1SViresh Kumar 	clk_register_clkdev(clk, "sysram0_clk", NULL);
744*0b928af1SViresh Kumar 
745*0b928af1SViresh Kumar 	clk = clk_register_gate(NULL, "sysram1_clk", "ahb_clk", 0,
746*0b928af1SViresh Kumar 			SPEAR1310_PERIP1_CLK_ENB, SPEAR1310_SYSRAM1_CLK_ENB, 0,
747*0b928af1SViresh Kumar 			&_lock);
748*0b928af1SViresh Kumar 	clk_register_clkdev(clk, "sysram1_clk", NULL);
749*0b928af1SViresh Kumar 
750*0b928af1SViresh Kumar 	clk = clk_register_aux("adc_synth_clk", "adc_synth_gate_clk", "ahb_clk",
751*0b928af1SViresh Kumar 			0, SPEAR1310_ADC_CLK_SYNT, NULL, adc_rtbl,
752*0b928af1SViresh Kumar 			ARRAY_SIZE(adc_rtbl), &_lock, &clk1);
753*0b928af1SViresh Kumar 	clk_register_clkdev(clk, "adc_synth_clk", NULL);
754*0b928af1SViresh Kumar 	clk_register_clkdev(clk1, "adc_synth_gate_clk", NULL);
755*0b928af1SViresh Kumar 
756*0b928af1SViresh Kumar 	clk = clk_register_gate(NULL, "adc_clk", "adc_synth_gate_clk", 0,
757*0b928af1SViresh Kumar 			SPEAR1310_PERIP1_CLK_ENB, SPEAR1310_ADC_CLK_ENB, 0,
758*0b928af1SViresh Kumar 			&_lock);
759*0b928af1SViresh Kumar 	clk_register_clkdev(clk, NULL, "adc_clk");
760*0b928af1SViresh Kumar 
761*0b928af1SViresh Kumar 	/* clock derived from apb clk */
762*0b928af1SViresh Kumar 	clk = clk_register_gate(NULL, "ssp0_clk", "apb_clk", 0,
763*0b928af1SViresh Kumar 			SPEAR1310_PERIP1_CLK_ENB, SPEAR1310_SSP_CLK_ENB, 0,
764*0b928af1SViresh Kumar 			&_lock);
765*0b928af1SViresh Kumar 	clk_register_clkdev(clk, NULL, "e0100000.spi");
766*0b928af1SViresh Kumar 
767*0b928af1SViresh Kumar 	clk = clk_register_gate(NULL, "gpio0_clk", "apb_clk", 0,
768*0b928af1SViresh Kumar 			SPEAR1310_PERIP1_CLK_ENB, SPEAR1310_GPIO0_CLK_ENB, 0,
769*0b928af1SViresh Kumar 			&_lock);
770*0b928af1SViresh Kumar 	clk_register_clkdev(clk, NULL, "e0600000.gpio");
771*0b928af1SViresh Kumar 
772*0b928af1SViresh Kumar 	clk = clk_register_gate(NULL, "gpio1_clk", "apb_clk", 0,
773*0b928af1SViresh Kumar 			SPEAR1310_PERIP1_CLK_ENB, SPEAR1310_GPIO1_CLK_ENB, 0,
774*0b928af1SViresh Kumar 			&_lock);
775*0b928af1SViresh Kumar 	clk_register_clkdev(clk, NULL, "e0680000.gpio");
776*0b928af1SViresh Kumar 
777*0b928af1SViresh Kumar 	clk = clk_register_gate(NULL, "i2s0_clk", "apb_clk", 0,
778*0b928af1SViresh Kumar 			SPEAR1310_PERIP1_CLK_ENB, SPEAR1310_I2S0_CLK_ENB, 0,
779*0b928af1SViresh Kumar 			&_lock);
780*0b928af1SViresh Kumar 	clk_register_clkdev(clk, NULL, "e0180000.i2s");
781*0b928af1SViresh Kumar 
782*0b928af1SViresh Kumar 	clk = clk_register_gate(NULL, "i2s1_clk", "apb_clk", 0,
783*0b928af1SViresh Kumar 			SPEAR1310_PERIP1_CLK_ENB, SPEAR1310_I2S1_CLK_ENB, 0,
784*0b928af1SViresh Kumar 			&_lock);
785*0b928af1SViresh Kumar 	clk_register_clkdev(clk, NULL, "e0200000.i2s");
786*0b928af1SViresh Kumar 
787*0b928af1SViresh Kumar 	clk = clk_register_gate(NULL, "kbd_clk", "apb_clk", 0,
788*0b928af1SViresh Kumar 			SPEAR1310_PERIP2_CLK_ENB, SPEAR1310_KBD_CLK_ENB, 0,
789*0b928af1SViresh Kumar 			&_lock);
790*0b928af1SViresh Kumar 	clk_register_clkdev(clk, NULL, "e0300000.kbd");
791*0b928af1SViresh Kumar 
792*0b928af1SViresh Kumar 	/* RAS clks */
793*0b928af1SViresh Kumar 	clk = clk_register_mux(NULL, "gen_synth0_1_mux_clk",
794*0b928af1SViresh Kumar 			gen_synth0_1_parents, ARRAY_SIZE(gen_synth0_1_parents),
795*0b928af1SViresh Kumar 			0, SPEAR1310_PLL_CFG, SPEAR1310_RAS_SYNT0_1_CLK_SHIFT,
796*0b928af1SViresh Kumar 			SPEAR1310_RAS_SYNT_CLK_MASK, 0, &_lock);
797*0b928af1SViresh Kumar 	clk_register_clkdev(clk, "gen_synth0_1_clk", NULL);
798*0b928af1SViresh Kumar 
799*0b928af1SViresh Kumar 	clk = clk_register_mux(NULL, "gen_synth2_3_mux_clk",
800*0b928af1SViresh Kumar 			gen_synth2_3_parents, ARRAY_SIZE(gen_synth2_3_parents),
801*0b928af1SViresh Kumar 			0, SPEAR1310_PLL_CFG, SPEAR1310_RAS_SYNT2_3_CLK_SHIFT,
802*0b928af1SViresh Kumar 			SPEAR1310_RAS_SYNT_CLK_MASK, 0, &_lock);
803*0b928af1SViresh Kumar 	clk_register_clkdev(clk, "gen_synth2_3_clk", NULL);
804*0b928af1SViresh Kumar 
805*0b928af1SViresh Kumar 	clk = clk_register_frac("gen_synth0_clk", "gen_synth0_1_clk", 0,
806*0b928af1SViresh Kumar 			SPEAR1310_RAS_CLK_SYNT0, gen_rtbl, ARRAY_SIZE(gen_rtbl),
807*0b928af1SViresh Kumar 			&_lock);
808*0b928af1SViresh Kumar 	clk_register_clkdev(clk, "gen_synth0_clk", NULL);
809*0b928af1SViresh Kumar 
810*0b928af1SViresh Kumar 	clk = clk_register_frac("gen_synth1_clk", "gen_synth0_1_clk", 0,
811*0b928af1SViresh Kumar 			SPEAR1310_RAS_CLK_SYNT1, gen_rtbl, ARRAY_SIZE(gen_rtbl),
812*0b928af1SViresh Kumar 			&_lock);
813*0b928af1SViresh Kumar 	clk_register_clkdev(clk, "gen_synth1_clk", NULL);
814*0b928af1SViresh Kumar 
815*0b928af1SViresh Kumar 	clk = clk_register_frac("gen_synth2_clk", "gen_synth2_3_clk", 0,
816*0b928af1SViresh Kumar 			SPEAR1310_RAS_CLK_SYNT2, gen_rtbl, ARRAY_SIZE(gen_rtbl),
817*0b928af1SViresh Kumar 			&_lock);
818*0b928af1SViresh Kumar 	clk_register_clkdev(clk, "gen_synth2_clk", NULL);
819*0b928af1SViresh Kumar 
820*0b928af1SViresh Kumar 	clk = clk_register_frac("gen_synth3_clk", "gen_synth2_3_clk", 0,
821*0b928af1SViresh Kumar 			SPEAR1310_RAS_CLK_SYNT3, gen_rtbl, ARRAY_SIZE(gen_rtbl),
822*0b928af1SViresh Kumar 			&_lock);
823*0b928af1SViresh Kumar 	clk_register_clkdev(clk, "gen_synth3_clk", NULL);
824*0b928af1SViresh Kumar 
825*0b928af1SViresh Kumar 	clk = clk_register_gate(NULL, "ras_osc_24m_clk", "osc_24m_clk", 0,
826*0b928af1SViresh Kumar 			SPEAR1310_RAS_CLK_ENB, SPEAR1310_OSC_24M_CLK_ENB, 0,
827*0b928af1SViresh Kumar 			&_lock);
828*0b928af1SViresh Kumar 	clk_register_clkdev(clk, "ras_osc_24m_clk", NULL);
829*0b928af1SViresh Kumar 
830*0b928af1SViresh Kumar 	clk = clk_register_gate(NULL, "ras_osc_25m_clk", "osc_25m_clk", 0,
831*0b928af1SViresh Kumar 			SPEAR1310_RAS_CLK_ENB, SPEAR1310_OSC_25M_CLK_ENB, 0,
832*0b928af1SViresh Kumar 			&_lock);
833*0b928af1SViresh Kumar 	clk_register_clkdev(clk, "ras_osc_25m_clk", NULL);
834*0b928af1SViresh Kumar 
835*0b928af1SViresh Kumar 	clk = clk_register_gate(NULL, "ras_osc_32k_clk", "osc_32k_clk", 0,
836*0b928af1SViresh Kumar 			SPEAR1310_RAS_CLK_ENB, SPEAR1310_OSC_32K_CLK_ENB, 0,
837*0b928af1SViresh Kumar 			&_lock);
838*0b928af1SViresh Kumar 	clk_register_clkdev(clk, "ras_osc_32k_clk", NULL);
839*0b928af1SViresh Kumar 
840*0b928af1SViresh Kumar 	clk = clk_register_gate(NULL, "ras_pll2_clk", "pll2_clk", 0,
841*0b928af1SViresh Kumar 			SPEAR1310_RAS_CLK_ENB, SPEAR1310_PLL2_CLK_ENB, 0,
842*0b928af1SViresh Kumar 			&_lock);
843*0b928af1SViresh Kumar 	clk_register_clkdev(clk, "ras_pll2_clk", NULL);
844*0b928af1SViresh Kumar 
845*0b928af1SViresh Kumar 	clk = clk_register_gate(NULL, "ras_pll3_clk", "pll3_clk", 0,
846*0b928af1SViresh Kumar 			SPEAR1310_RAS_CLK_ENB, SPEAR1310_PLL3_CLK_ENB, 0,
847*0b928af1SViresh Kumar 			&_lock);
848*0b928af1SViresh Kumar 	clk_register_clkdev(clk, "ras_pll3_clk", NULL);
849*0b928af1SViresh Kumar 
850*0b928af1SViresh Kumar 	clk = clk_register_gate(NULL, "ras_tx125_clk", "gmii_125m_pad_clk", 0,
851*0b928af1SViresh Kumar 			SPEAR1310_RAS_CLK_ENB, SPEAR1310_C125M_PAD_CLK_ENB, 0,
852*0b928af1SViresh Kumar 			&_lock);
853*0b928af1SViresh Kumar 	clk_register_clkdev(clk, "ras_tx125_clk", NULL);
854*0b928af1SViresh Kumar 
855*0b928af1SViresh Kumar 	clk = clk_register_fixed_rate(NULL, "ras_30m_fixed_clk", "pll5_clk", 0,
856*0b928af1SViresh Kumar 			30000000);
857*0b928af1SViresh Kumar 	clk = clk_register_gate(NULL, "ras_30m_clk", "ras_30m_fixed_clk", 0,
858*0b928af1SViresh Kumar 			SPEAR1310_RAS_CLK_ENB, SPEAR1310_C30M_CLK_ENB, 0,
859*0b928af1SViresh Kumar 			&_lock);
860*0b928af1SViresh Kumar 	clk_register_clkdev(clk, "ras_30m_clk", NULL);
861*0b928af1SViresh Kumar 
862*0b928af1SViresh Kumar 	clk = clk_register_fixed_rate(NULL, "ras_48m_fixed_clk", "pll5_clk", 0,
863*0b928af1SViresh Kumar 			48000000);
864*0b928af1SViresh Kumar 	clk = clk_register_gate(NULL, "ras_48m_clk", "ras_48m_fixed_clk", 0,
865*0b928af1SViresh Kumar 			SPEAR1310_RAS_CLK_ENB, SPEAR1310_C48M_CLK_ENB, 0,
866*0b928af1SViresh Kumar 			&_lock);
867*0b928af1SViresh Kumar 	clk_register_clkdev(clk, "ras_48m_clk", NULL);
868*0b928af1SViresh Kumar 
869*0b928af1SViresh Kumar 	clk = clk_register_gate(NULL, "ras_ahb_clk", "ahb_clk", 0,
870*0b928af1SViresh Kumar 			SPEAR1310_RAS_CLK_ENB, SPEAR1310_ACLK_CLK_ENB, 0,
871*0b928af1SViresh Kumar 			&_lock);
872*0b928af1SViresh Kumar 	clk_register_clkdev(clk, "ras_ahb_clk", NULL);
873*0b928af1SViresh Kumar 
874*0b928af1SViresh Kumar 	clk = clk_register_gate(NULL, "ras_apb_clk", "apb_clk", 0,
875*0b928af1SViresh Kumar 			SPEAR1310_RAS_CLK_ENB, SPEAR1310_PCLK_CLK_ENB, 0,
876*0b928af1SViresh Kumar 			&_lock);
877*0b928af1SViresh Kumar 	clk_register_clkdev(clk, "ras_apb_clk", NULL);
878*0b928af1SViresh Kumar 
879*0b928af1SViresh Kumar 	clk = clk_register_fixed_rate(NULL, "ras_plclk0_clk", NULL, CLK_IS_ROOT,
880*0b928af1SViresh Kumar 			50000000);
881*0b928af1SViresh Kumar 
882*0b928af1SViresh Kumar 	clk = clk_register_fixed_rate(NULL, "ras_tx50_clk", NULL, CLK_IS_ROOT,
883*0b928af1SViresh Kumar 			50000000);
884*0b928af1SViresh Kumar 
885*0b928af1SViresh Kumar 	clk = clk_register_gate(NULL, "can0_clk", "apb_clk", 0,
886*0b928af1SViresh Kumar 			SPEAR1310_RAS_SW_CLK_CTRL, SPEAR1310_CAN0_CLK_ENB, 0,
887*0b928af1SViresh Kumar 			&_lock);
888*0b928af1SViresh Kumar 	clk_register_clkdev(clk, NULL, "c_can_platform.0");
889*0b928af1SViresh Kumar 
890*0b928af1SViresh Kumar 	clk = clk_register_gate(NULL, "can1_clk", "apb_clk", 0,
891*0b928af1SViresh Kumar 			SPEAR1310_RAS_SW_CLK_CTRL, SPEAR1310_CAN1_CLK_ENB, 0,
892*0b928af1SViresh Kumar 			&_lock);
893*0b928af1SViresh Kumar 	clk_register_clkdev(clk, NULL, "c_can_platform.1");
894*0b928af1SViresh Kumar 
895*0b928af1SViresh Kumar 	clk = clk_register_gate(NULL, "ras_smii0_clk", "ras_ahb_clk", 0,
896*0b928af1SViresh Kumar 			SPEAR1310_RAS_SW_CLK_CTRL, SPEAR1310_MII0_CLK_ENB, 0,
897*0b928af1SViresh Kumar 			&_lock);
898*0b928af1SViresh Kumar 	clk_register_clkdev(clk, NULL, "5c400000.eth");
899*0b928af1SViresh Kumar 
900*0b928af1SViresh Kumar 	clk = clk_register_gate(NULL, "ras_smii1_clk", "ras_ahb_clk", 0,
901*0b928af1SViresh Kumar 			SPEAR1310_RAS_SW_CLK_CTRL, SPEAR1310_MII1_CLK_ENB, 0,
902*0b928af1SViresh Kumar 			&_lock);
903*0b928af1SViresh Kumar 	clk_register_clkdev(clk, NULL, "5c500000.eth");
904*0b928af1SViresh Kumar 
905*0b928af1SViresh Kumar 	clk = clk_register_gate(NULL, "ras_smii2_clk", "ras_ahb_clk", 0,
906*0b928af1SViresh Kumar 			SPEAR1310_RAS_SW_CLK_CTRL, SPEAR1310_MII2_CLK_ENB, 0,
907*0b928af1SViresh Kumar 			&_lock);
908*0b928af1SViresh Kumar 	clk_register_clkdev(clk, NULL, "5c600000.eth");
909*0b928af1SViresh Kumar 
910*0b928af1SViresh Kumar 	clk = clk_register_gate(NULL, "ras_rgmii_clk", "ras_ahb_clk", 0,
911*0b928af1SViresh Kumar 			SPEAR1310_RAS_SW_CLK_CTRL, SPEAR1310_GMII_CLK_ENB, 0,
912*0b928af1SViresh Kumar 			&_lock);
913*0b928af1SViresh Kumar 	clk_register_clkdev(clk, NULL, "5c700000.eth");
914*0b928af1SViresh Kumar 
915*0b928af1SViresh Kumar 	clk = clk_register_mux(NULL, "smii_rgmii_phy_mux_clk",
916*0b928af1SViresh Kumar 			smii_rgmii_phy_parents,
917*0b928af1SViresh Kumar 			ARRAY_SIZE(smii_rgmii_phy_parents), 0,
918*0b928af1SViresh Kumar 			SPEAR1310_RAS_CTRL_REG1,
919*0b928af1SViresh Kumar 			SPEAR1310_SMII_RGMII_PHY_CLK_SHIFT,
920*0b928af1SViresh Kumar 			SPEAR1310_PHY_CLK_MASK, 0, &_lock);
921*0b928af1SViresh Kumar 	clk_register_clkdev(clk, NULL, "stmmacphy.1");
922*0b928af1SViresh Kumar 	clk_register_clkdev(clk, NULL, "stmmacphy.2");
923*0b928af1SViresh Kumar 	clk_register_clkdev(clk, NULL, "stmmacphy.4");
924*0b928af1SViresh Kumar 
925*0b928af1SViresh Kumar 	clk = clk_register_mux(NULL, "rmii_phy_mux_clk", rmii_phy_parents,
926*0b928af1SViresh Kumar 			ARRAY_SIZE(rmii_phy_parents), 0,
927*0b928af1SViresh Kumar 			SPEAR1310_RAS_CTRL_REG1, SPEAR1310_RMII_PHY_CLK_SHIFT,
928*0b928af1SViresh Kumar 			SPEAR1310_PHY_CLK_MASK, 0, &_lock);
929*0b928af1SViresh Kumar 	clk_register_clkdev(clk, NULL, "stmmacphy.3");
930*0b928af1SViresh Kumar 
931*0b928af1SViresh Kumar 	clk = clk_register_mux(NULL, "uart1_mux_clk", uart_parents,
932*0b928af1SViresh Kumar 			ARRAY_SIZE(uart_parents), 0, SPEAR1310_RAS_CTRL_REG0,
933*0b928af1SViresh Kumar 			SPEAR1310_UART1_CLK_SHIFT, SPEAR1310_RAS_UART_CLK_MASK,
934*0b928af1SViresh Kumar 			0, &_lock);
935*0b928af1SViresh Kumar 	clk_register_clkdev(clk, "uart1_mux_clk", NULL);
936*0b928af1SViresh Kumar 
937*0b928af1SViresh Kumar 	clk = clk_register_gate(NULL, "uart1_clk", "uart1_mux_clk", 0,
938*0b928af1SViresh Kumar 			SPEAR1310_RAS_SW_CLK_CTRL, SPEAR1310_UART1_CLK_ENB, 0,
939*0b928af1SViresh Kumar 			&_lock);
940*0b928af1SViresh Kumar 	clk_register_clkdev(clk, NULL, "5c800000.serial");
941*0b928af1SViresh Kumar 
942*0b928af1SViresh Kumar 	clk = clk_register_mux(NULL, "uart2_mux_clk", uart_parents,
943*0b928af1SViresh Kumar 			ARRAY_SIZE(uart_parents), 0, SPEAR1310_RAS_CTRL_REG0,
944*0b928af1SViresh Kumar 			SPEAR1310_UART2_CLK_SHIFT, SPEAR1310_RAS_UART_CLK_MASK,
945*0b928af1SViresh Kumar 			0, &_lock);
946*0b928af1SViresh Kumar 	clk_register_clkdev(clk, "uart2_mux_clk", NULL);
947*0b928af1SViresh Kumar 
948*0b928af1SViresh Kumar 	clk = clk_register_gate(NULL, "uart2_clk", "uart2_mux_clk", 0,
949*0b928af1SViresh Kumar 			SPEAR1310_RAS_SW_CLK_CTRL, SPEAR1310_UART2_CLK_ENB, 0,
950*0b928af1SViresh Kumar 			&_lock);
951*0b928af1SViresh Kumar 	clk_register_clkdev(clk, NULL, "5c900000.serial");
952*0b928af1SViresh Kumar 
953*0b928af1SViresh Kumar 	clk = clk_register_mux(NULL, "uart3_mux_clk", uart_parents,
954*0b928af1SViresh Kumar 			ARRAY_SIZE(uart_parents), 0, SPEAR1310_RAS_CTRL_REG0,
955*0b928af1SViresh Kumar 			SPEAR1310_UART3_CLK_SHIFT, SPEAR1310_RAS_UART_CLK_MASK,
956*0b928af1SViresh Kumar 			0, &_lock);
957*0b928af1SViresh Kumar 	clk_register_clkdev(clk, "uart3_mux_clk", NULL);
958*0b928af1SViresh Kumar 
959*0b928af1SViresh Kumar 	clk = clk_register_gate(NULL, "uart3_clk", "uart3_mux_clk", 0,
960*0b928af1SViresh Kumar 			SPEAR1310_RAS_SW_CLK_CTRL, SPEAR1310_UART3_CLK_ENB, 0,
961*0b928af1SViresh Kumar 			&_lock);
962*0b928af1SViresh Kumar 	clk_register_clkdev(clk, NULL, "5ca00000.serial");
963*0b928af1SViresh Kumar 
964*0b928af1SViresh Kumar 	clk = clk_register_mux(NULL, "uart4_mux_clk", uart_parents,
965*0b928af1SViresh Kumar 			ARRAY_SIZE(uart_parents), 0, SPEAR1310_RAS_CTRL_REG0,
966*0b928af1SViresh Kumar 			SPEAR1310_UART4_CLK_SHIFT, SPEAR1310_RAS_UART_CLK_MASK,
967*0b928af1SViresh Kumar 			0, &_lock);
968*0b928af1SViresh Kumar 	clk_register_clkdev(clk, "uart4_mux_clk", NULL);
969*0b928af1SViresh Kumar 
970*0b928af1SViresh Kumar 	clk = clk_register_gate(NULL, "uart4_clk", "uart4_mux_clk", 0,
971*0b928af1SViresh Kumar 			SPEAR1310_RAS_SW_CLK_CTRL, SPEAR1310_UART4_CLK_ENB, 0,
972*0b928af1SViresh Kumar 			&_lock);
973*0b928af1SViresh Kumar 	clk_register_clkdev(clk, NULL, "5cb00000.serial");
974*0b928af1SViresh Kumar 
975*0b928af1SViresh Kumar 	clk = clk_register_mux(NULL, "uart5_mux_clk", uart_parents,
976*0b928af1SViresh Kumar 			ARRAY_SIZE(uart_parents), 0, SPEAR1310_RAS_CTRL_REG0,
977*0b928af1SViresh Kumar 			SPEAR1310_UART5_CLK_SHIFT, SPEAR1310_RAS_UART_CLK_MASK,
978*0b928af1SViresh Kumar 			0, &_lock);
979*0b928af1SViresh Kumar 	clk_register_clkdev(clk, "uart5_mux_clk", NULL);
980*0b928af1SViresh Kumar 
981*0b928af1SViresh Kumar 	clk = clk_register_gate(NULL, "uart5_clk", "uart5_mux_clk", 0,
982*0b928af1SViresh Kumar 			SPEAR1310_RAS_SW_CLK_CTRL, SPEAR1310_UART5_CLK_ENB, 0,
983*0b928af1SViresh Kumar 			&_lock);
984*0b928af1SViresh Kumar 	clk_register_clkdev(clk, NULL, "5cc00000.serial");
985*0b928af1SViresh Kumar 
986*0b928af1SViresh Kumar 	clk = clk_register_mux(NULL, "i2c1_mux_clk", i2c_parents,
987*0b928af1SViresh Kumar 			ARRAY_SIZE(i2c_parents), 0, SPEAR1310_RAS_CTRL_REG0,
988*0b928af1SViresh Kumar 			SPEAR1310_I2C1_CLK_SHIFT, SPEAR1310_I2C_CLK_MASK, 0,
989*0b928af1SViresh Kumar 			&_lock);
990*0b928af1SViresh Kumar 	clk_register_clkdev(clk, "i2c1_mux_clk", NULL);
991*0b928af1SViresh Kumar 
992*0b928af1SViresh Kumar 	clk = clk_register_gate(NULL, "i2c1_clk", "i2c1_mux_clk", 0,
993*0b928af1SViresh Kumar 			SPEAR1310_RAS_SW_CLK_CTRL, SPEAR1310_I2C1_CLK_ENB, 0,
994*0b928af1SViresh Kumar 			&_lock);
995*0b928af1SViresh Kumar 	clk_register_clkdev(clk, NULL, "5cd00000.i2c");
996*0b928af1SViresh Kumar 
997*0b928af1SViresh Kumar 	clk = clk_register_mux(NULL, "i2c2_mux_clk", i2c_parents,
998*0b928af1SViresh Kumar 			ARRAY_SIZE(i2c_parents), 0, SPEAR1310_RAS_CTRL_REG0,
999*0b928af1SViresh Kumar 			SPEAR1310_I2C2_CLK_SHIFT, SPEAR1310_I2C_CLK_MASK, 0,
1000*0b928af1SViresh Kumar 			&_lock);
1001*0b928af1SViresh Kumar 	clk_register_clkdev(clk, "i2c2_mux_clk", NULL);
1002*0b928af1SViresh Kumar 
1003*0b928af1SViresh Kumar 	clk = clk_register_gate(NULL, "i2c2_clk", "i2c2_mux_clk", 0,
1004*0b928af1SViresh Kumar 			SPEAR1310_RAS_SW_CLK_CTRL, SPEAR1310_I2C2_CLK_ENB, 0,
1005*0b928af1SViresh Kumar 			&_lock);
1006*0b928af1SViresh Kumar 	clk_register_clkdev(clk, NULL, "5ce00000.i2c");
1007*0b928af1SViresh Kumar 
1008*0b928af1SViresh Kumar 	clk = clk_register_mux(NULL, "i2c3_mux_clk", i2c_parents,
1009*0b928af1SViresh Kumar 			ARRAY_SIZE(i2c_parents), 0, SPEAR1310_RAS_CTRL_REG0,
1010*0b928af1SViresh Kumar 			SPEAR1310_I2C3_CLK_SHIFT, SPEAR1310_I2C_CLK_MASK, 0,
1011*0b928af1SViresh Kumar 			&_lock);
1012*0b928af1SViresh Kumar 	clk_register_clkdev(clk, "i2c3_mux_clk", NULL);
1013*0b928af1SViresh Kumar 
1014*0b928af1SViresh Kumar 	clk = clk_register_gate(NULL, "i2c3_clk", "i2c3_mux_clk", 0,
1015*0b928af1SViresh Kumar 			SPEAR1310_RAS_SW_CLK_CTRL, SPEAR1310_I2C3_CLK_ENB, 0,
1016*0b928af1SViresh Kumar 			&_lock);
1017*0b928af1SViresh Kumar 	clk_register_clkdev(clk, NULL, "5cf00000.i2c");
1018*0b928af1SViresh Kumar 
1019*0b928af1SViresh Kumar 	clk = clk_register_mux(NULL, "i2c4_mux_clk", i2c_parents,
1020*0b928af1SViresh Kumar 			ARRAY_SIZE(i2c_parents), 0, SPEAR1310_RAS_CTRL_REG0,
1021*0b928af1SViresh Kumar 			SPEAR1310_I2C4_CLK_SHIFT, SPEAR1310_I2C_CLK_MASK, 0,
1022*0b928af1SViresh Kumar 			&_lock);
1023*0b928af1SViresh Kumar 	clk_register_clkdev(clk, "i2c4_mux_clk", NULL);
1024*0b928af1SViresh Kumar 
1025*0b928af1SViresh Kumar 	clk = clk_register_gate(NULL, "i2c4_clk", "i2c4_mux_clk", 0,
1026*0b928af1SViresh Kumar 			SPEAR1310_RAS_SW_CLK_CTRL, SPEAR1310_I2C4_CLK_ENB, 0,
1027*0b928af1SViresh Kumar 			&_lock);
1028*0b928af1SViresh Kumar 	clk_register_clkdev(clk, NULL, "5d000000.i2c");
1029*0b928af1SViresh Kumar 
1030*0b928af1SViresh Kumar 	clk = clk_register_mux(NULL, "i2c5_mux_clk", i2c_parents,
1031*0b928af1SViresh Kumar 			ARRAY_SIZE(i2c_parents), 0, SPEAR1310_RAS_CTRL_REG0,
1032*0b928af1SViresh Kumar 			SPEAR1310_I2C5_CLK_SHIFT, SPEAR1310_I2C_CLK_MASK, 0,
1033*0b928af1SViresh Kumar 			&_lock);
1034*0b928af1SViresh Kumar 	clk_register_clkdev(clk, "i2c5_mux_clk", NULL);
1035*0b928af1SViresh Kumar 
1036*0b928af1SViresh Kumar 	clk = clk_register_gate(NULL, "i2c5_clk", "i2c5_mux_clk", 0,
1037*0b928af1SViresh Kumar 			SPEAR1310_RAS_SW_CLK_CTRL, SPEAR1310_I2C5_CLK_ENB, 0,
1038*0b928af1SViresh Kumar 			&_lock);
1039*0b928af1SViresh Kumar 	clk_register_clkdev(clk, NULL, "5d100000.i2c");
1040*0b928af1SViresh Kumar 
1041*0b928af1SViresh Kumar 	clk = clk_register_mux(NULL, "i2c6_mux_clk", i2c_parents,
1042*0b928af1SViresh Kumar 			ARRAY_SIZE(i2c_parents), 0, SPEAR1310_RAS_CTRL_REG0,
1043*0b928af1SViresh Kumar 			SPEAR1310_I2C6_CLK_SHIFT, SPEAR1310_I2C_CLK_MASK, 0,
1044*0b928af1SViresh Kumar 			&_lock);
1045*0b928af1SViresh Kumar 	clk_register_clkdev(clk, "i2c6_mux_clk", NULL);
1046*0b928af1SViresh Kumar 
1047*0b928af1SViresh Kumar 	clk = clk_register_gate(NULL, "i2c6_clk", "i2c6_mux_clk", 0,
1048*0b928af1SViresh Kumar 			SPEAR1310_RAS_SW_CLK_CTRL, SPEAR1310_I2C6_CLK_ENB, 0,
1049*0b928af1SViresh Kumar 			&_lock);
1050*0b928af1SViresh Kumar 	clk_register_clkdev(clk, NULL, "5d200000.i2c");
1051*0b928af1SViresh Kumar 
1052*0b928af1SViresh Kumar 	clk = clk_register_mux(NULL, "i2c7_mux_clk", i2c_parents,
1053*0b928af1SViresh Kumar 			ARRAY_SIZE(i2c_parents), 0, SPEAR1310_RAS_CTRL_REG0,
1054*0b928af1SViresh Kumar 			SPEAR1310_I2C7_CLK_SHIFT, SPEAR1310_I2C_CLK_MASK, 0,
1055*0b928af1SViresh Kumar 			&_lock);
1056*0b928af1SViresh Kumar 	clk_register_clkdev(clk, "i2c7_mux_clk", NULL);
1057*0b928af1SViresh Kumar 
1058*0b928af1SViresh Kumar 	clk = clk_register_gate(NULL, "i2c7_clk", "i2c7_mux_clk", 0,
1059*0b928af1SViresh Kumar 			SPEAR1310_RAS_SW_CLK_CTRL, SPEAR1310_I2C7_CLK_ENB, 0,
1060*0b928af1SViresh Kumar 			&_lock);
1061*0b928af1SViresh Kumar 	clk_register_clkdev(clk, NULL, "5d300000.i2c");
1062*0b928af1SViresh Kumar 
1063*0b928af1SViresh Kumar 	clk = clk_register_mux(NULL, "ssp1_mux_clk", ssp1_parents,
1064*0b928af1SViresh Kumar 			ARRAY_SIZE(ssp1_parents), 0, SPEAR1310_RAS_CTRL_REG0,
1065*0b928af1SViresh Kumar 			SPEAR1310_SSP1_CLK_SHIFT, SPEAR1310_SSP1_CLK_MASK, 0,
1066*0b928af1SViresh Kumar 			&_lock);
1067*0b928af1SViresh Kumar 	clk_register_clkdev(clk, "ssp1_mux_clk", NULL);
1068*0b928af1SViresh Kumar 
1069*0b928af1SViresh Kumar 	clk = clk_register_gate(NULL, "ssp1_clk", "ssp1_mux_clk", 0,
1070*0b928af1SViresh Kumar 			SPEAR1310_RAS_SW_CLK_CTRL, SPEAR1310_SSP1_CLK_ENB, 0,
1071*0b928af1SViresh Kumar 			&_lock);
1072*0b928af1SViresh Kumar 	clk_register_clkdev(clk, NULL, "5d400000.spi");
1073*0b928af1SViresh Kumar 
1074*0b928af1SViresh Kumar 	clk = clk_register_mux(NULL, "pci_mux_clk", pci_parents,
1075*0b928af1SViresh Kumar 			ARRAY_SIZE(pci_parents), 0, SPEAR1310_RAS_CTRL_REG0,
1076*0b928af1SViresh Kumar 			SPEAR1310_PCI_CLK_SHIFT, SPEAR1310_PCI_CLK_MASK, 0,
1077*0b928af1SViresh Kumar 			&_lock);
1078*0b928af1SViresh Kumar 	clk_register_clkdev(clk, "pci_mux_clk", NULL);
1079*0b928af1SViresh Kumar 
1080*0b928af1SViresh Kumar 	clk = clk_register_gate(NULL, "pci_clk", "pci_mux_clk", 0,
1081*0b928af1SViresh Kumar 			SPEAR1310_RAS_SW_CLK_CTRL, SPEAR1310_PCI_CLK_ENB, 0,
1082*0b928af1SViresh Kumar 			&_lock);
1083*0b928af1SViresh Kumar 	clk_register_clkdev(clk, NULL, "pci");
1084*0b928af1SViresh Kumar 
1085*0b928af1SViresh Kumar 	clk = clk_register_mux(NULL, "tdm1_mux_clk", tdm_parents,
1086*0b928af1SViresh Kumar 			ARRAY_SIZE(tdm_parents), 0, SPEAR1310_RAS_CTRL_REG0,
1087*0b928af1SViresh Kumar 			SPEAR1310_TDM1_CLK_SHIFT, SPEAR1310_TDM_CLK_MASK, 0,
1088*0b928af1SViresh Kumar 			&_lock);
1089*0b928af1SViresh Kumar 	clk_register_clkdev(clk, "tdm1_mux_clk", NULL);
1090*0b928af1SViresh Kumar 
1091*0b928af1SViresh Kumar 	clk = clk_register_gate(NULL, "tdm1_clk", "tdm1_mux_clk", 0,
1092*0b928af1SViresh Kumar 			SPEAR1310_RAS_SW_CLK_CTRL, SPEAR1310_TDM1_CLK_ENB, 0,
1093*0b928af1SViresh Kumar 			&_lock);
1094*0b928af1SViresh Kumar 	clk_register_clkdev(clk, NULL, "tdm_hdlc.0");
1095*0b928af1SViresh Kumar 
1096*0b928af1SViresh Kumar 	clk = clk_register_mux(NULL, "tdm2_mux_clk", tdm_parents,
1097*0b928af1SViresh Kumar 			ARRAY_SIZE(tdm_parents), 0, SPEAR1310_RAS_CTRL_REG0,
1098*0b928af1SViresh Kumar 			SPEAR1310_TDM2_CLK_SHIFT, SPEAR1310_TDM_CLK_MASK, 0,
1099*0b928af1SViresh Kumar 			&_lock);
1100*0b928af1SViresh Kumar 	clk_register_clkdev(clk, "tdm2_mux_clk", NULL);
1101*0b928af1SViresh Kumar 
1102*0b928af1SViresh Kumar 	clk = clk_register_gate(NULL, "tdm2_clk", "tdm2_mux_clk", 0,
1103*0b928af1SViresh Kumar 			SPEAR1310_RAS_SW_CLK_CTRL, SPEAR1310_TDM2_CLK_ENB, 0,
1104*0b928af1SViresh Kumar 			&_lock);
1105*0b928af1SViresh Kumar 	clk_register_clkdev(clk, NULL, "tdm_hdlc.1");
1106*0b928af1SViresh Kumar }
1107