1*bd5336e3SHakyeong Kim // SPDX-License-Identifier: GPL-2.0-only
2*bd5336e3SHakyeong Kim /*
3*bd5336e3SHakyeong Kim * Copyright (c) 2025 Samsung Electronics Co., Ltd.
4*bd5336e3SHakyeong Kim * https://www.samsung.com
5*bd5336e3SHakyeong Kim * Copyright (c) 2025 Axis Communications AB.
6*bd5336e3SHakyeong Kim * https://www.axis.com
7*bd5336e3SHakyeong Kim *
8*bd5336e3SHakyeong Kim * Common Clock Framework support for ARTPEC-8 SoC.
9*bd5336e3SHakyeong Kim */
10*bd5336e3SHakyeong Kim
11*bd5336e3SHakyeong Kim #include <linux/clk-provider.h>
12*bd5336e3SHakyeong Kim #include <linux/platform_device.h>
13*bd5336e3SHakyeong Kim #include <dt-bindings/clock/axis,artpec8-clk.h>
14*bd5336e3SHakyeong Kim
15*bd5336e3SHakyeong Kim #include "clk.h"
16*bd5336e3SHakyeong Kim #include "clk-exynos-arm64.h"
17*bd5336e3SHakyeong Kim
18*bd5336e3SHakyeong Kim /* NOTE: Must be equal to the last clock ID increased by one */
19*bd5336e3SHakyeong Kim #define CMU_CMU_NR_CLK (CLK_DOUT_CMU_VPP_CORE + 1)
20*bd5336e3SHakyeong Kim #define CMU_BUS_NR_CLK (CLK_DOUT_BUS_PCLK + 1)
21*bd5336e3SHakyeong Kim #define CMU_CORE_NR_CLK (CLK_DOUT_CORE_PCLK + 1)
22*bd5336e3SHakyeong Kim #define CMU_CPUCL_NR_CLK (CLK_GOUT_CPUCL_CSSYS_IPCLKPORT_ATCLK + 1)
23*bd5336e3SHakyeong Kim #define CMU_FSYS_NR_CLK (CLK_GOUT_FSYS_QSPI_IPCLKPORT_SSI_CLK + 1)
24*bd5336e3SHakyeong Kim #define CMU_IMEM_NR_CLK (CLK_GOUT_IMEM_PCLK_TMU0_APBIF + 1)
25*bd5336e3SHakyeong Kim #define CMU_PERI_NR_CLK (CLK_GOUT_PERI_DMA4DSIM_IPCLKPORT_CLK_AXI_CLK + 1)
26*bd5336e3SHakyeong Kim
27*bd5336e3SHakyeong Kim /* Register Offset definitions for CMU_CMU (0x12400000) */
28*bd5336e3SHakyeong Kim #define PLL_LOCKTIME_PLL_AUDIO 0x0000
29*bd5336e3SHakyeong Kim #define PLL_LOCKTIME_PLL_SHARED0 0x0004
30*bd5336e3SHakyeong Kim #define PLL_LOCKTIME_PLL_SHARED1 0x0008
31*bd5336e3SHakyeong Kim #define PLL_CON0_PLL_AUDIO 0x0100
32*bd5336e3SHakyeong Kim #define PLL_CON0_PLL_SHARED0 0x0120
33*bd5336e3SHakyeong Kim #define PLL_CON0_PLL_SHARED1 0x0140
34*bd5336e3SHakyeong Kim #define CLK_CON_MUX_CLKCMU_2D 0x1000
35*bd5336e3SHakyeong Kim #define CLK_CON_MUX_CLKCMU_3D 0x1004
36*bd5336e3SHakyeong Kim #define CLK_CON_MUX_CLKCMU_BUS 0x1008
37*bd5336e3SHakyeong Kim #define CLK_CON_MUX_CLKCMU_BUS_DLP 0x100c
38*bd5336e3SHakyeong Kim #define CLK_CON_MUX_CLKCMU_CDC_CORE 0x1010
39*bd5336e3SHakyeong Kim #define CLK_CON_MUX_CLKCMU_FSYS_SCAN0 0x1014
40*bd5336e3SHakyeong Kim #define CLK_CON_MUX_CLKCMU_FSYS_SCAN1 0x1018
41*bd5336e3SHakyeong Kim #define CLK_CON_MUX_CLKCMU_IMEM_JPEG 0x101c
42*bd5336e3SHakyeong Kim #define CLK_CON_MUX_CLKCMU_PERI_DISP 0x1020
43*bd5336e3SHakyeong Kim #define CLK_CON_MUX_CLKCMU_CORE_BUS 0x1024
44*bd5336e3SHakyeong Kim #define CLK_CON_MUX_CLKCMU_CORE_DLP 0x1028
45*bd5336e3SHakyeong Kim #define CLK_CON_MUX_CLKCMU_CPUCL_SWITCH 0x1030
46*bd5336e3SHakyeong Kim #define CLK_CON_MUX_CLKCMU_DLP_CORE 0x1034
47*bd5336e3SHakyeong Kim #define CLK_CON_MUX_CLKCMU_FSYS_BUS 0x1038
48*bd5336e3SHakyeong Kim #define CLK_CON_MUX_CLKCMU_FSYS_IP 0x103c
49*bd5336e3SHakyeong Kim #define CLK_CON_MUX_CLKCMU_IMEM_ACLK 0x1054
50*bd5336e3SHakyeong Kim #define CLK_CON_MUX_CLKCMU_MIF_BUSP 0x1080
51*bd5336e3SHakyeong Kim #define CLK_CON_MUX_CLKCMU_MIF_SWITCH 0x1084
52*bd5336e3SHakyeong Kim #define CLK_CON_MUX_CLKCMU_PERI_IP 0x1088
53*bd5336e3SHakyeong Kim #define CLK_CON_MUX_CLKCMU_RSP_CORE 0x108c
54*bd5336e3SHakyeong Kim #define CLK_CON_MUX_CLKCMU_TRFM_CORE 0x1090
55*bd5336e3SHakyeong Kim #define CLK_CON_MUX_CLKCMU_VCA_ACE 0x1094
56*bd5336e3SHakyeong Kim #define CLK_CON_MUX_CLKCMU_VCA_OD 0x1098
57*bd5336e3SHakyeong Kim #define CLK_CON_MUX_CLKCMU_VIO_CORE 0x109c
58*bd5336e3SHakyeong Kim #define CLK_CON_MUX_CLKCMU_VIP0_CORE 0x10a0
59*bd5336e3SHakyeong Kim #define CLK_CON_MUX_CLKCMU_VIP1_CORE 0x10a4
60*bd5336e3SHakyeong Kim #define CLK_CON_MUX_CLKCMU_VPP_CORE 0x10a8
61*bd5336e3SHakyeong Kim
62*bd5336e3SHakyeong Kim #define CLK_CON_DIV_CLKCMU_BUS 0x1800
63*bd5336e3SHakyeong Kim #define CLK_CON_DIV_CLKCMU_BUS_DLP 0x1804
64*bd5336e3SHakyeong Kim #define CLK_CON_DIV_CLKCMU_CDC_CORE 0x1808
65*bd5336e3SHakyeong Kim #define CLK_CON_DIV_CLKCMU_FSYS_SCAN0 0x180c
66*bd5336e3SHakyeong Kim #define CLK_CON_DIV_CLKCMU_FSYS_SCAN1 0x1810
67*bd5336e3SHakyeong Kim #define CLK_CON_DIV_CLKCMU_IMEM_JPEG 0x1814
68*bd5336e3SHakyeong Kim #define CLK_CON_DIV_CLKCMU_MIF_SWITCH 0x1818
69*bd5336e3SHakyeong Kim #define CLK_CON_DIV_CLKCMU_CORE_DLP 0x181c
70*bd5336e3SHakyeong Kim #define CLK_CON_DIV_CLKCMU_CORE_MAIN 0x1820
71*bd5336e3SHakyeong Kim #define CLK_CON_DIV_CLKCMU_PERI_DISP 0x1824
72*bd5336e3SHakyeong Kim #define CLK_CON_DIV_CLKCMU_CPUCL_SWITCH 0x1828
73*bd5336e3SHakyeong Kim #define CLK_CON_DIV_CLKCMU_DLP_CORE 0x182c
74*bd5336e3SHakyeong Kim #define CLK_CON_DIV_CLKCMU_FSYS_BUS 0x1830
75*bd5336e3SHakyeong Kim #define CLK_CON_DIV_CLKCMU_FSYS_IP 0x1834
76*bd5336e3SHakyeong Kim #define CLK_CON_DIV_CLKCMU_VIO_AUDIO 0x1838
77*bd5336e3SHakyeong Kim #define CLK_CON_DIV_CLKCMU_GPU_2D 0x1848
78*bd5336e3SHakyeong Kim #define CLK_CON_DIV_CLKCMU_GPU_3D 0x184c
79*bd5336e3SHakyeong Kim #define CLK_CON_DIV_CLKCMU_IMEM_ACLK 0x1854
80*bd5336e3SHakyeong Kim #define CLK_CON_DIV_CLKCMU_MIF_BUSP 0x1884
81*bd5336e3SHakyeong Kim #define CLK_CON_DIV_CLKCMU_PERI_AUDIO 0x1890
82*bd5336e3SHakyeong Kim #define CLK_CON_DIV_CLKCMU_PERI_IP 0x1894
83*bd5336e3SHakyeong Kim #define CLK_CON_DIV_CLKCMU_RSP_CORE 0x1898
84*bd5336e3SHakyeong Kim #define CLK_CON_DIV_CLKCMU_TRFM_CORE 0x189c
85*bd5336e3SHakyeong Kim #define CLK_CON_DIV_CLKCMU_VCA_ACE 0x18a0
86*bd5336e3SHakyeong Kim #define CLK_CON_DIV_CLKCMU_VCA_OD 0x18a4
87*bd5336e3SHakyeong Kim #define CLK_CON_DIV_CLKCMU_VIO_CORE 0x18ac
88*bd5336e3SHakyeong Kim #define CLK_CON_DIV_CLKCMU_VIP0_CORE 0x18b0
89*bd5336e3SHakyeong Kim #define CLK_CON_DIV_CLKCMU_VIP1_CORE 0x18b4
90*bd5336e3SHakyeong Kim #define CLK_CON_DIV_CLKCMU_VPP_CORE 0x18b8
91*bd5336e3SHakyeong Kim #define CLK_CON_DIV_PLL_SHARED0_DIV2 0x18bc
92*bd5336e3SHakyeong Kim #define CLK_CON_DIV_PLL_SHARED0_DIV3 0x18c0
93*bd5336e3SHakyeong Kim #define CLK_CON_DIV_PLL_SHARED0_DIV4 0x18c4
94*bd5336e3SHakyeong Kim #define CLK_CON_DIV_PLL_SHARED1_DIV2 0x18c8
95*bd5336e3SHakyeong Kim #define CLK_CON_DIV_PLL_SHARED1_DIV3 0x18cc
96*bd5336e3SHakyeong Kim #define CLK_CON_DIV_PLL_SHARED1_DIV4 0x18d0
97*bd5336e3SHakyeong Kim
98*bd5336e3SHakyeong Kim static const unsigned long cmu_cmu_clk_regs[] __initconst = {
99*bd5336e3SHakyeong Kim PLL_LOCKTIME_PLL_AUDIO,
100*bd5336e3SHakyeong Kim PLL_LOCKTIME_PLL_SHARED0,
101*bd5336e3SHakyeong Kim PLL_LOCKTIME_PLL_SHARED1,
102*bd5336e3SHakyeong Kim PLL_CON0_PLL_AUDIO,
103*bd5336e3SHakyeong Kim PLL_CON0_PLL_SHARED0,
104*bd5336e3SHakyeong Kim PLL_CON0_PLL_SHARED1,
105*bd5336e3SHakyeong Kim CLK_CON_MUX_CLKCMU_2D,
106*bd5336e3SHakyeong Kim CLK_CON_MUX_CLKCMU_3D,
107*bd5336e3SHakyeong Kim CLK_CON_MUX_CLKCMU_BUS,
108*bd5336e3SHakyeong Kim CLK_CON_MUX_CLKCMU_BUS_DLP,
109*bd5336e3SHakyeong Kim CLK_CON_MUX_CLKCMU_CDC_CORE,
110*bd5336e3SHakyeong Kim CLK_CON_MUX_CLKCMU_FSYS_SCAN0,
111*bd5336e3SHakyeong Kim CLK_CON_MUX_CLKCMU_FSYS_SCAN1,
112*bd5336e3SHakyeong Kim CLK_CON_MUX_CLKCMU_IMEM_JPEG,
113*bd5336e3SHakyeong Kim CLK_CON_MUX_CLKCMU_PERI_DISP,
114*bd5336e3SHakyeong Kim CLK_CON_MUX_CLKCMU_CORE_BUS,
115*bd5336e3SHakyeong Kim CLK_CON_MUX_CLKCMU_CORE_DLP,
116*bd5336e3SHakyeong Kim CLK_CON_MUX_CLKCMU_CPUCL_SWITCH,
117*bd5336e3SHakyeong Kim CLK_CON_MUX_CLKCMU_DLP_CORE,
118*bd5336e3SHakyeong Kim CLK_CON_MUX_CLKCMU_FSYS_BUS,
119*bd5336e3SHakyeong Kim CLK_CON_MUX_CLKCMU_FSYS_IP,
120*bd5336e3SHakyeong Kim CLK_CON_MUX_CLKCMU_IMEM_ACLK,
121*bd5336e3SHakyeong Kim CLK_CON_MUX_CLKCMU_MIF_BUSP,
122*bd5336e3SHakyeong Kim CLK_CON_MUX_CLKCMU_MIF_SWITCH,
123*bd5336e3SHakyeong Kim CLK_CON_MUX_CLKCMU_PERI_IP,
124*bd5336e3SHakyeong Kim CLK_CON_MUX_CLKCMU_RSP_CORE,
125*bd5336e3SHakyeong Kim CLK_CON_MUX_CLKCMU_TRFM_CORE,
126*bd5336e3SHakyeong Kim CLK_CON_MUX_CLKCMU_VCA_ACE,
127*bd5336e3SHakyeong Kim CLK_CON_MUX_CLKCMU_VCA_OD,
128*bd5336e3SHakyeong Kim CLK_CON_MUX_CLKCMU_VIO_CORE,
129*bd5336e3SHakyeong Kim CLK_CON_MUX_CLKCMU_VIP0_CORE,
130*bd5336e3SHakyeong Kim CLK_CON_MUX_CLKCMU_VIP1_CORE,
131*bd5336e3SHakyeong Kim CLK_CON_MUX_CLKCMU_VPP_CORE,
132*bd5336e3SHakyeong Kim CLK_CON_DIV_CLKCMU_BUS,
133*bd5336e3SHakyeong Kim CLK_CON_DIV_CLKCMU_BUS_DLP,
134*bd5336e3SHakyeong Kim CLK_CON_DIV_CLKCMU_CDC_CORE,
135*bd5336e3SHakyeong Kim CLK_CON_DIV_CLKCMU_FSYS_SCAN0,
136*bd5336e3SHakyeong Kim CLK_CON_DIV_CLKCMU_FSYS_SCAN1,
137*bd5336e3SHakyeong Kim CLK_CON_DIV_CLKCMU_IMEM_JPEG,
138*bd5336e3SHakyeong Kim CLK_CON_DIV_CLKCMU_MIF_SWITCH,
139*bd5336e3SHakyeong Kim CLK_CON_DIV_CLKCMU_CORE_DLP,
140*bd5336e3SHakyeong Kim CLK_CON_DIV_CLKCMU_CORE_MAIN,
141*bd5336e3SHakyeong Kim CLK_CON_DIV_CLKCMU_PERI_DISP,
142*bd5336e3SHakyeong Kim CLK_CON_DIV_CLKCMU_CPUCL_SWITCH,
143*bd5336e3SHakyeong Kim CLK_CON_DIV_CLKCMU_DLP_CORE,
144*bd5336e3SHakyeong Kim CLK_CON_DIV_CLKCMU_FSYS_BUS,
145*bd5336e3SHakyeong Kim CLK_CON_DIV_CLKCMU_FSYS_IP,
146*bd5336e3SHakyeong Kim CLK_CON_DIV_CLKCMU_VIO_AUDIO,
147*bd5336e3SHakyeong Kim CLK_CON_DIV_CLKCMU_GPU_2D,
148*bd5336e3SHakyeong Kim CLK_CON_DIV_CLKCMU_GPU_3D,
149*bd5336e3SHakyeong Kim CLK_CON_DIV_CLKCMU_IMEM_ACLK,
150*bd5336e3SHakyeong Kim CLK_CON_DIV_CLKCMU_MIF_BUSP,
151*bd5336e3SHakyeong Kim CLK_CON_DIV_CLKCMU_PERI_AUDIO,
152*bd5336e3SHakyeong Kim CLK_CON_DIV_CLKCMU_PERI_IP,
153*bd5336e3SHakyeong Kim CLK_CON_DIV_CLKCMU_RSP_CORE,
154*bd5336e3SHakyeong Kim CLK_CON_DIV_CLKCMU_TRFM_CORE,
155*bd5336e3SHakyeong Kim CLK_CON_DIV_CLKCMU_VCA_ACE,
156*bd5336e3SHakyeong Kim CLK_CON_DIV_CLKCMU_VCA_OD,
157*bd5336e3SHakyeong Kim CLK_CON_DIV_CLKCMU_VIO_CORE,
158*bd5336e3SHakyeong Kim CLK_CON_DIV_CLKCMU_VIP0_CORE,
159*bd5336e3SHakyeong Kim CLK_CON_DIV_CLKCMU_VIP1_CORE,
160*bd5336e3SHakyeong Kim CLK_CON_DIV_CLKCMU_VPP_CORE,
161*bd5336e3SHakyeong Kim CLK_CON_DIV_PLL_SHARED0_DIV2,
162*bd5336e3SHakyeong Kim CLK_CON_DIV_PLL_SHARED0_DIV3,
163*bd5336e3SHakyeong Kim CLK_CON_DIV_PLL_SHARED0_DIV4,
164*bd5336e3SHakyeong Kim CLK_CON_DIV_PLL_SHARED1_DIV2,
165*bd5336e3SHakyeong Kim CLK_CON_DIV_PLL_SHARED1_DIV3,
166*bd5336e3SHakyeong Kim CLK_CON_DIV_PLL_SHARED1_DIV4,
167*bd5336e3SHakyeong Kim };
168*bd5336e3SHakyeong Kim
169*bd5336e3SHakyeong Kim static const struct samsung_pll_rate_table artpec8_pll_audio_rates[] __initconst = {
170*bd5336e3SHakyeong Kim PLL_36XX_RATE(25 * MHZ, 589823913U, 47, 1, 1, 12184),
171*bd5336e3SHakyeong Kim PLL_36XX_RATE(25 * MHZ, 393215942U, 47, 3, 0, 12184),
172*bd5336e3SHakyeong Kim PLL_36XX_RATE(25 * MHZ, 294911956U, 47, 1, 2, 12184),
173*bd5336e3SHakyeong Kim PLL_36XX_RATE(25 * MHZ, 100000000U, 32, 2, 2, 0),
174*bd5336e3SHakyeong Kim PLL_36XX_RATE(25 * MHZ, 98303985U, 47, 3, 2, 12184),
175*bd5336e3SHakyeong Kim PLL_36XX_RATE(25 * MHZ, 49151992U, 47, 3, 3, 12184),
176*bd5336e3SHakyeong Kim };
177*bd5336e3SHakyeong Kim
178*bd5336e3SHakyeong Kim static const struct samsung_pll_clock cmu_cmu_pll_clks[] __initconst = {
179*bd5336e3SHakyeong Kim PLL(pll_1017x, CLK_FOUT_SHARED0_PLL, "fout_pll_shared0", "fin_pll",
180*bd5336e3SHakyeong Kim PLL_LOCKTIME_PLL_SHARED0, PLL_CON0_PLL_SHARED0, NULL),
181*bd5336e3SHakyeong Kim PLL(pll_1017x, CLK_FOUT_SHARED1_PLL, "fout_pll_shared1", "fin_pll",
182*bd5336e3SHakyeong Kim PLL_LOCKTIME_PLL_SHARED1, PLL_CON0_PLL_SHARED1, NULL),
183*bd5336e3SHakyeong Kim PLL(pll_1031x, CLK_FOUT_AUDIO_PLL, "fout_pll_audio", "fin_pll",
184*bd5336e3SHakyeong Kim PLL_LOCKTIME_PLL_AUDIO, PLL_CON0_PLL_AUDIO, artpec8_pll_audio_rates),
185*bd5336e3SHakyeong Kim };
186*bd5336e3SHakyeong Kim
187*bd5336e3SHakyeong Kim PNAME(mout_clkcmu_bus_bus_p) = { "dout_pll_shared1_div2", "dout_pll_shared0_div3",
188*bd5336e3SHakyeong Kim "dout_pll_shared1_div3", "dout_pll_shared1_div4" };
189*bd5336e3SHakyeong Kim PNAME(mout_clkcmu_bus_dlp_p) = { "dout_pll_shared0_div2", "dout_pll_shared0_div4",
190*bd5336e3SHakyeong Kim "dout_pll_shared1_div2", "dout_pll_shared1_div4" };
191*bd5336e3SHakyeong Kim PNAME(mout_clkcmu_core_bus_p) = { "dout_pll_shared1_div2", "dout_pll_shared0_div3",
192*bd5336e3SHakyeong Kim "dout_pll_shared0_div4", "dout_pll_shared1_div3" };
193*bd5336e3SHakyeong Kim PNAME(mout_clkcmu_core_dlp_p) = { "dout_pll_shared0_div2", "dout_pll_shared1_div2",
194*bd5336e3SHakyeong Kim "dout_pll_shared0_div3", "dout_pll_shared1_div3" };
195*bd5336e3SHakyeong Kim PNAME(mout_clkcmu_cpucl_switch_p) = { "dout_pll_shared0_div2", "dout_pll_shared1_div2",
196*bd5336e3SHakyeong Kim "dout_pll_shared0_div3", "dout_pll_shared1_div3" };
197*bd5336e3SHakyeong Kim PNAME(mout_clkcmu_fsys_bus_p) = { "dout_pll_shared1_div2", "dout_pll_shared0_div2",
198*bd5336e3SHakyeong Kim "dout_pll_shared1_div4", "dout_pll_shared1_div3" };
199*bd5336e3SHakyeong Kim PNAME(mout_clkcmu_fsys_ip_p) = { "dout_pll_shared0_div2", "dout_pll_shared1_div3",
200*bd5336e3SHakyeong Kim "dout_pll_shared1_div2", "dout_pll_shared0_div3" };
201*bd5336e3SHakyeong Kim PNAME(mout_clkcmu_fsys_scan0_p) = { "dout_pll_shared0_div4", "dout_pll_shared1_div4" };
202*bd5336e3SHakyeong Kim PNAME(mout_clkcmu_fsys_scan1_p) = { "dout_pll_shared0_div4", "dout_pll_shared1_div4" };
203*bd5336e3SHakyeong Kim PNAME(mout_clkcmu_imem_imem_p) = { "dout_pll_shared1_div4", "dout_pll_shared0_div3",
204*bd5336e3SHakyeong Kim "dout_pll_shared1_div3", "dout_pll_shared1_div2" };
205*bd5336e3SHakyeong Kim PNAME(mout_clkcmu_imem_jpeg_p) = { "dout_pll_shared0_div2", "dout_pll_shared0_div3",
206*bd5336e3SHakyeong Kim "dout_pll_shared1_div2", "dout_pll_shared1_div3" };
207*bd5336e3SHakyeong Kim PNAME(mout_clkcmu_cdc_core_p) = { "dout_pll_shared1_div2", "dout_pll_shared0_div3",
208*bd5336e3SHakyeong Kim "dout_pll_shared1_div3", "dout_pll_shared1_div4" };
209*bd5336e3SHakyeong Kim PNAME(mout_clkcmu_dlp_core_p) = { "dout_pll_shared0_div2", "dout_pll_shared1_div2",
210*bd5336e3SHakyeong Kim "dout_pll_shared0_div3", "dout_pll_shared1_div3" };
211*bd5336e3SHakyeong Kim PNAME(mout_clkcmu_3d_p) = { "dout_pll_shared0_div2", "dout_pll_shared1_div2",
212*bd5336e3SHakyeong Kim "dout_pll_shared0_div3", "dout_pll_shared1_div3" };
213*bd5336e3SHakyeong Kim PNAME(mout_clkcmu_2d_p) = { "dout_pll_shared0_div2", "dout_pll_shared1_div2",
214*bd5336e3SHakyeong Kim "dout_pll_shared0_div3", "dout_pll_shared1_div3" };
215*bd5336e3SHakyeong Kim PNAME(mout_clkcmu_mif_switch_p) = { "dout_pll_shared0", "dout_pll_shared1",
216*bd5336e3SHakyeong Kim "dout_pll_shared0_div2", "dout_pll_shared0_div3" };
217*bd5336e3SHakyeong Kim PNAME(mout_clkcmu_mif_busp_p) = { "dout_pll_shared0_div3", "dout_pll_shared1_div4",
218*bd5336e3SHakyeong Kim "dout_pll_shared0_div4", "dout_pll_shared0_div2" };
219*bd5336e3SHakyeong Kim PNAME(mout_clkcmu_peri_disp_p) = { "dout_pll_shared1_div2", "dout_pll_shared0_div2",
220*bd5336e3SHakyeong Kim "dout_pll_shared1_div4", "dout_pll_shared1_div3" };
221*bd5336e3SHakyeong Kim PNAME(mout_clkcmu_peri_ip_p) = { "dout_pll_shared1_div2", "dout_pll_shared0_div4",
222*bd5336e3SHakyeong Kim "dout_pll_shared1_div4", "dout_pll_shared0_div2" };
223*bd5336e3SHakyeong Kim PNAME(mout_clkcmu_rsp_core_p) = { "dout_pll_shared1_div2", "dout_pll_shared0_div3",
224*bd5336e3SHakyeong Kim "dout_pll_shared1_div3", "dout_pll_shared1_div4" };
225*bd5336e3SHakyeong Kim PNAME(mout_clkcmu_trfm_core_p) = { "dout_pll_shared1_div2", "dout_pll_shared0_div3",
226*bd5336e3SHakyeong Kim "dout_pll_shared1_div3", "dout_pll_shared1_div4" };
227*bd5336e3SHakyeong Kim PNAME(mout_clkcmu_vca_ace_p) = { "dout_pll_shared1_div2", "dout_pll_shared0_div3",
228*bd5336e3SHakyeong Kim "dout_pll_shared1_div3", "dout_pll_shared1_div4" };
229*bd5336e3SHakyeong Kim PNAME(mout_clkcmu_vca_od_p) = { "dout_pll_shared1_div2", "dout_pll_shared0_div3",
230*bd5336e3SHakyeong Kim "dout_pll_shared1_div3", "dout_pll_shared1_div4" };
231*bd5336e3SHakyeong Kim PNAME(mout_clkcmu_vio_core_p) = { "dout_pll_shared0_div3", "dout_pll_shared0_div2",
232*bd5336e3SHakyeong Kim "dout_pll_shared1_div2", "dout_pll_shared1_div3" };
233*bd5336e3SHakyeong Kim PNAME(mout_clkcmu_vip0_core_p) = { "dout_pll_shared1_div2", "dout_pll_shared0_div3",
234*bd5336e3SHakyeong Kim "dout_pll_shared1_div3", "dout_pll_shared1_div4" };
235*bd5336e3SHakyeong Kim PNAME(mout_clkcmu_vip1_core_p) = { "dout_pll_shared1_div2", "dout_pll_shared0_div3",
236*bd5336e3SHakyeong Kim "dout_pll_shared1_div3", "dout_pll_shared1_div4" };
237*bd5336e3SHakyeong Kim PNAME(mout_clkcmu_vpp_core_p) = { "dout_pll_shared1_div2", "dout_pll_shared0_div3",
238*bd5336e3SHakyeong Kim "dout_pll_shared1_div3", "dout_pll_shared1_div4" };
239*bd5336e3SHakyeong Kim PNAME(mout_clkcmu_pll_shared0_p) = { "fin_pll", "fout_pll_shared0" };
240*bd5336e3SHakyeong Kim PNAME(mout_clkcmu_pll_shared1_p) = { "fin_pll", "fout_pll_shared1" };
241*bd5336e3SHakyeong Kim PNAME(mout_clkcmu_pll_audio_p) = { "fin_pll", "fout_pll_audio" };
242*bd5336e3SHakyeong Kim
243*bd5336e3SHakyeong Kim static const struct samsung_fixed_factor_clock cmu_fixed_factor_clks[] __initconst = {
244*bd5336e3SHakyeong Kim FFACTOR(CLK_DOUT_CMU_OTP, "dout_clkcmu_otp", "fin_pll", 1, 8, 0),
245*bd5336e3SHakyeong Kim };
246*bd5336e3SHakyeong Kim
247*bd5336e3SHakyeong Kim static const struct samsung_mux_clock cmu_cmu_mux_clks[] __initconst = {
248*bd5336e3SHakyeong Kim MUX(0, "mout_clkcmu_pll_shared0", mout_clkcmu_pll_shared0_p, PLL_CON0_PLL_SHARED0, 4, 1),
249*bd5336e3SHakyeong Kim MUX(0, "mout_clkcmu_pll_shared1", mout_clkcmu_pll_shared1_p, PLL_CON0_PLL_SHARED1, 4, 1),
250*bd5336e3SHakyeong Kim MUX(0, "mout_clkcmu_pll_audio", mout_clkcmu_pll_audio_p, PLL_CON0_PLL_AUDIO, 4, 1),
251*bd5336e3SHakyeong Kim MUX(0, "mout_clkcmu_bus_bus", mout_clkcmu_bus_bus_p, CLK_CON_MUX_CLKCMU_BUS, 0, 2),
252*bd5336e3SHakyeong Kim MUX(0, "mout_clkcmu_bus_dlp", mout_clkcmu_bus_dlp_p, CLK_CON_MUX_CLKCMU_BUS_DLP, 0, 2),
253*bd5336e3SHakyeong Kim MUX(0, "mout_clkcmu_core_bus", mout_clkcmu_core_bus_p, CLK_CON_MUX_CLKCMU_CORE_BUS, 0, 2),
254*bd5336e3SHakyeong Kim MUX(0, "mout_clkcmu_core_dlp", mout_clkcmu_core_dlp_p, CLK_CON_MUX_CLKCMU_CORE_DLP, 0, 2),
255*bd5336e3SHakyeong Kim MUX(0, "mout_clkcmu_cpucl_switch", mout_clkcmu_cpucl_switch_p,
256*bd5336e3SHakyeong Kim CLK_CON_MUX_CLKCMU_CPUCL_SWITCH, 0, 3),
257*bd5336e3SHakyeong Kim MUX(0, "mout_clkcmu_fsys_bus", mout_clkcmu_fsys_bus_p, CLK_CON_MUX_CLKCMU_FSYS_BUS, 0, 2),
258*bd5336e3SHakyeong Kim MUX(0, "mout_clkcmu_fsys_ip", mout_clkcmu_fsys_ip_p, CLK_CON_MUX_CLKCMU_FSYS_IP, 0, 2),
259*bd5336e3SHakyeong Kim MUX(0, "mout_clkcmu_fsys_scan0", mout_clkcmu_fsys_scan0_p,
260*bd5336e3SHakyeong Kim CLK_CON_MUX_CLKCMU_FSYS_SCAN0, 0, 1),
261*bd5336e3SHakyeong Kim MUX(0, "mout_clkcmu_fsys_scan1", mout_clkcmu_fsys_scan1_p,
262*bd5336e3SHakyeong Kim CLK_CON_MUX_CLKCMU_FSYS_SCAN1, 0, 1),
263*bd5336e3SHakyeong Kim MUX(0, "mout_clkcmu_imem_imem", mout_clkcmu_imem_imem_p,
264*bd5336e3SHakyeong Kim CLK_CON_MUX_CLKCMU_IMEM_ACLK, 0, 2),
265*bd5336e3SHakyeong Kim MUX(0, "mout_clkcmu_imem_jpeg", mout_clkcmu_imem_jpeg_p,
266*bd5336e3SHakyeong Kim CLK_CON_MUX_CLKCMU_IMEM_JPEG, 0, 2),
267*bd5336e3SHakyeong Kim nMUX(0, "mout_clkcmu_cdc_core", mout_clkcmu_cdc_core_p, CLK_CON_MUX_CLKCMU_CDC_CORE, 0, 2),
268*bd5336e3SHakyeong Kim nMUX(0, "mout_clkcmu_dlp_core", mout_clkcmu_dlp_core_p, CLK_CON_MUX_CLKCMU_DLP_CORE, 0, 2),
269*bd5336e3SHakyeong Kim MUX(0, "mout_clkcmu_3d", mout_clkcmu_3d_p, CLK_CON_MUX_CLKCMU_3D, 0, 2),
270*bd5336e3SHakyeong Kim MUX(0, "mout_clkcmu_2d", mout_clkcmu_2d_p, CLK_CON_MUX_CLKCMU_2D, 0, 2),
271*bd5336e3SHakyeong Kim MUX(0, "mout_clkcmu_mif_switch", mout_clkcmu_mif_switch_p,
272*bd5336e3SHakyeong Kim CLK_CON_MUX_CLKCMU_MIF_SWITCH, 0, 2),
273*bd5336e3SHakyeong Kim MUX(0, "mout_clkcmu_mif_busp", mout_clkcmu_mif_busp_p, CLK_CON_MUX_CLKCMU_MIF_BUSP, 0, 2),
274*bd5336e3SHakyeong Kim MUX(0, "mout_clkcmu_peri_disp", mout_clkcmu_peri_disp_p,
275*bd5336e3SHakyeong Kim CLK_CON_MUX_CLKCMU_PERI_DISP, 0, 2),
276*bd5336e3SHakyeong Kim MUX(0, "mout_clkcmu_peri_ip", mout_clkcmu_peri_ip_p, CLK_CON_MUX_CLKCMU_PERI_IP, 0, 2),
277*bd5336e3SHakyeong Kim MUX(0, "mout_clkcmu_rsp_core", mout_clkcmu_rsp_core_p, CLK_CON_MUX_CLKCMU_RSP_CORE, 0, 2),
278*bd5336e3SHakyeong Kim nMUX(0, "mout_clkcmu_trfm_core", mout_clkcmu_trfm_core_p,
279*bd5336e3SHakyeong Kim CLK_CON_MUX_CLKCMU_TRFM_CORE, 0, 2),
280*bd5336e3SHakyeong Kim MUX(0, "mout_clkcmu_vca_ace", mout_clkcmu_vca_ace_p, CLK_CON_MUX_CLKCMU_VCA_ACE, 0, 2),
281*bd5336e3SHakyeong Kim MUX(0, "mout_clkcmu_vca_od", mout_clkcmu_vca_od_p, CLK_CON_MUX_CLKCMU_VCA_OD, 0, 2),
282*bd5336e3SHakyeong Kim MUX(0, "mout_clkcmu_vio_core", mout_clkcmu_vio_core_p, CLK_CON_MUX_CLKCMU_VIO_CORE, 0, 2),
283*bd5336e3SHakyeong Kim nMUX(0, "mout_clkcmu_vip0_core", mout_clkcmu_vip0_core_p,
284*bd5336e3SHakyeong Kim CLK_CON_MUX_CLKCMU_VIP0_CORE, 0, 2),
285*bd5336e3SHakyeong Kim nMUX(0, "mout_clkcmu_vip1_core", mout_clkcmu_vip1_core_p,
286*bd5336e3SHakyeong Kim CLK_CON_MUX_CLKCMU_VIP1_CORE, 0, 2),
287*bd5336e3SHakyeong Kim nMUX(0, "mout_clkcmu_vpp_core", mout_clkcmu_vpp_core_p, CLK_CON_MUX_CLKCMU_VPP_CORE, 0, 2),
288*bd5336e3SHakyeong Kim };
289*bd5336e3SHakyeong Kim
290*bd5336e3SHakyeong Kim static const struct samsung_div_clock cmu_cmu_div_clks[] __initconst = {
291*bd5336e3SHakyeong Kim DIV(CLK_DOUT_SHARED0_DIV2, "dout_pll_shared0_div2",
292*bd5336e3SHakyeong Kim "mout_clkcmu_pll_shared0", CLK_CON_DIV_PLL_SHARED0_DIV2, 0, 1),
293*bd5336e3SHakyeong Kim DIV(CLK_DOUT_SHARED0_DIV3, "dout_pll_shared0_div3",
294*bd5336e3SHakyeong Kim "mout_clkcmu_pll_shared0", CLK_CON_DIV_PLL_SHARED0_DIV3, 0, 2),
295*bd5336e3SHakyeong Kim DIV(CLK_DOUT_SHARED0_DIV4, "dout_pll_shared0_div4",
296*bd5336e3SHakyeong Kim "dout_pll_shared0_div2", CLK_CON_DIV_PLL_SHARED0_DIV4, 0, 1),
297*bd5336e3SHakyeong Kim DIV(CLK_DOUT_SHARED1_DIV2, "dout_pll_shared1_div2",
298*bd5336e3SHakyeong Kim "mout_clkcmu_pll_shared1", CLK_CON_DIV_PLL_SHARED1_DIV2, 0, 1),
299*bd5336e3SHakyeong Kim DIV(CLK_DOUT_SHARED1_DIV3, "dout_pll_shared1_div3",
300*bd5336e3SHakyeong Kim "mout_clkcmu_pll_shared1", CLK_CON_DIV_PLL_SHARED1_DIV3, 0, 2),
301*bd5336e3SHakyeong Kim DIV(CLK_DOUT_SHARED1_DIV4, "dout_pll_shared1_div4",
302*bd5336e3SHakyeong Kim "dout_pll_shared1_div2", CLK_CON_DIV_PLL_SHARED1_DIV4, 0, 1),
303*bd5336e3SHakyeong Kim DIV(CLK_DOUT_CMU_BUS, "dout_clkcmu_bus",
304*bd5336e3SHakyeong Kim "mout_clkcmu_bus_bus", CLK_CON_DIV_CLKCMU_BUS, 0, 4),
305*bd5336e3SHakyeong Kim DIV(CLK_DOUT_CMU_BUS_DLP, "dout_clkcmu_bus_dlp",
306*bd5336e3SHakyeong Kim "mout_clkcmu_bus_dlp", CLK_CON_DIV_CLKCMU_BUS_DLP, 0, 4),
307*bd5336e3SHakyeong Kim DIV(CLK_DOUT_CMU_CORE_MAIN, "dout_clkcmu_core_main",
308*bd5336e3SHakyeong Kim "mout_clkcmu_core_bus", CLK_CON_DIV_CLKCMU_CORE_MAIN, 0, 4),
309*bd5336e3SHakyeong Kim DIV(CLK_DOUT_CMU_CORE_DLP, "dout_clkcmu_core_dlp",
310*bd5336e3SHakyeong Kim "mout_clkcmu_core_dlp", CLK_CON_DIV_CLKCMU_CORE_DLP, 0, 4),
311*bd5336e3SHakyeong Kim DIV(CLK_DOUT_CMU_CPUCL_SWITCH, "dout_clkcmu_cpucl_switch",
312*bd5336e3SHakyeong Kim "mout_clkcmu_cpucl_switch", CLK_CON_DIV_CLKCMU_CPUCL_SWITCH, 0, 3),
313*bd5336e3SHakyeong Kim DIV(CLK_DOUT_CMU_FSYS_BUS, "dout_clkcmu_fsys_bus",
314*bd5336e3SHakyeong Kim "mout_clkcmu_fsys_bus", CLK_CON_DIV_CLKCMU_FSYS_BUS, 0, 4),
315*bd5336e3SHakyeong Kim DIV(CLK_DOUT_CMU_FSYS_IP, "dout_clkcmu_fsys_ip",
316*bd5336e3SHakyeong Kim "mout_clkcmu_fsys_ip", CLK_CON_DIV_CLKCMU_FSYS_IP, 0, 9),
317*bd5336e3SHakyeong Kim DIV(CLK_DOUT_CMU_FSYS_SCAN0, "dout_clkcmu_fsys_scan0",
318*bd5336e3SHakyeong Kim "mout_clkcmu_fsys_scan0", CLK_CON_DIV_CLKCMU_FSYS_SCAN0, 0, 4),
319*bd5336e3SHakyeong Kim DIV(CLK_DOUT_CMU_FSYS_SCAN1, "dout_clkcmu_fsys_scan1",
320*bd5336e3SHakyeong Kim "mout_clkcmu_fsys_scan1", CLK_CON_DIV_CLKCMU_FSYS_SCAN1, 0, 4),
321*bd5336e3SHakyeong Kim DIV(CLK_DOUT_CMU_IMEM_ACLK, "dout_clkcmu_imem_aclk",
322*bd5336e3SHakyeong Kim "mout_clkcmu_imem_imem", CLK_CON_DIV_CLKCMU_IMEM_ACLK, 0, 4),
323*bd5336e3SHakyeong Kim DIV(CLK_DOUT_CMU_IMEM_JPEG, "dout_clkcmu_imem_jpeg",
324*bd5336e3SHakyeong Kim "mout_clkcmu_imem_jpeg", CLK_CON_DIV_CLKCMU_IMEM_JPEG, 0, 4),
325*bd5336e3SHakyeong Kim DIV_F(CLK_DOUT_CMU_CDC_CORE, "dout_clkcmu_cdc_core",
326*bd5336e3SHakyeong Kim "mout_clkcmu_cdc_core", CLK_CON_DIV_CLKCMU_CDC_CORE, 0, 4, CLK_SET_RATE_PARENT, 0),
327*bd5336e3SHakyeong Kim DIV_F(CLK_DOUT_CMU_DLP_CORE, "dout_clkcmu_dlp_core",
328*bd5336e3SHakyeong Kim "mout_clkcmu_dlp_core", CLK_CON_DIV_CLKCMU_DLP_CORE, 0, 4, CLK_SET_RATE_PARENT, 0),
329*bd5336e3SHakyeong Kim DIV(CLK_DOUT_CMU_GPU_3D, "dout_clkcmu_gpu_3d",
330*bd5336e3SHakyeong Kim "mout_clkcmu_3d", CLK_CON_DIV_CLKCMU_GPU_3D, 0, 3),
331*bd5336e3SHakyeong Kim DIV(CLK_DOUT_CMU_GPU_2D, "dout_clkcmu_gpu_2d",
332*bd5336e3SHakyeong Kim "mout_clkcmu_2d", CLK_CON_DIV_CLKCMU_GPU_2D, 0, 4),
333*bd5336e3SHakyeong Kim DIV(CLK_DOUT_CMU_MIF_SWITCH, "dout_clkcmu_mif_switch",
334*bd5336e3SHakyeong Kim "mout_clkcmu_mif_switch", CLK_CON_DIV_CLKCMU_MIF_SWITCH, 0, 4),
335*bd5336e3SHakyeong Kim DIV(CLK_DOUT_CMU_MIF_BUSP, "dout_clkcmu_mif_busp",
336*bd5336e3SHakyeong Kim "mout_clkcmu_mif_busp", CLK_CON_DIV_CLKCMU_MIF_BUSP, 0, 3),
337*bd5336e3SHakyeong Kim DIV(CLK_DOUT_CMU_PERI_DISP, "dout_clkcmu_peri_disp",
338*bd5336e3SHakyeong Kim "mout_clkcmu_peri_disp", CLK_CON_DIV_CLKCMU_PERI_DISP, 0, 4),
339*bd5336e3SHakyeong Kim DIV(CLK_DOUT_CMU_PERI_IP, "dout_clkcmu_peri_ip",
340*bd5336e3SHakyeong Kim "mout_clkcmu_peri_ip", CLK_CON_DIV_CLKCMU_PERI_IP, 0, 4),
341*bd5336e3SHakyeong Kim DIV(CLK_DOUT_CMU_PERI_AUDIO, "dout_clkcmu_peri_audio",
342*bd5336e3SHakyeong Kim "mout_clkcmu_pll_audio", CLK_CON_DIV_CLKCMU_PERI_AUDIO, 0, 4),
343*bd5336e3SHakyeong Kim DIV(CLK_DOUT_CMU_RSP_CORE, "dout_clkcmu_rsp_core",
344*bd5336e3SHakyeong Kim "mout_clkcmu_rsp_core", CLK_CON_DIV_CLKCMU_RSP_CORE, 0, 4),
345*bd5336e3SHakyeong Kim DIV_F(CLK_DOUT_CMU_TRFM_CORE, "dout_clkcmu_trfm_core",
346*bd5336e3SHakyeong Kim "mout_clkcmu_trfm_core", CLK_CON_DIV_CLKCMU_TRFM_CORE, 0, 4, CLK_SET_RATE_PARENT, 0),
347*bd5336e3SHakyeong Kim DIV(CLK_DOUT_CMU_VCA_ACE, "dout_clkcmu_vca_ace",
348*bd5336e3SHakyeong Kim "mout_clkcmu_vca_ace", CLK_CON_DIV_CLKCMU_VCA_ACE, 0, 4),
349*bd5336e3SHakyeong Kim DIV(CLK_DOUT_CMU_VCA_OD, "dout_clkcmu_vca_od",
350*bd5336e3SHakyeong Kim "mout_clkcmu_vca_od", CLK_CON_DIV_CLKCMU_VCA_OD, 0, 4),
351*bd5336e3SHakyeong Kim DIV(CLK_DOUT_CMU_VIO_CORE, "dout_clkcmu_vio_core",
352*bd5336e3SHakyeong Kim "mout_clkcmu_vio_core", CLK_CON_DIV_CLKCMU_VIO_CORE, 0, 4),
353*bd5336e3SHakyeong Kim DIV(CLK_DOUT_CMU_VIO_AUDIO, "dout_clkcmu_vio_audio",
354*bd5336e3SHakyeong Kim "mout_clkcmu_pll_audio", CLK_CON_DIV_CLKCMU_VIO_AUDIO, 0, 4),
355*bd5336e3SHakyeong Kim DIV_F(CLK_DOUT_CMU_VIP0_CORE, "dout_clkcmu_vip0_core",
356*bd5336e3SHakyeong Kim "mout_clkcmu_vip0_core", CLK_CON_DIV_CLKCMU_VIP0_CORE, 0, 4, CLK_SET_RATE_PARENT, 0),
357*bd5336e3SHakyeong Kim DIV_F(CLK_DOUT_CMU_VIP1_CORE, "dout_clkcmu_vip1_core",
358*bd5336e3SHakyeong Kim "mout_clkcmu_vip1_core", CLK_CON_DIV_CLKCMU_VIP1_CORE, 0, 4, CLK_SET_RATE_PARENT, 0),
359*bd5336e3SHakyeong Kim DIV_F(CLK_DOUT_CMU_VPP_CORE, "dout_clkcmu_vpp_core",
360*bd5336e3SHakyeong Kim "mout_clkcmu_vpp_core", CLK_CON_DIV_CLKCMU_VPP_CORE, 0, 4, CLK_SET_RATE_PARENT, 0),
361*bd5336e3SHakyeong Kim };
362*bd5336e3SHakyeong Kim
363*bd5336e3SHakyeong Kim static const struct samsung_cmu_info cmu_cmu_info __initconst = {
364*bd5336e3SHakyeong Kim .pll_clks = cmu_cmu_pll_clks,
365*bd5336e3SHakyeong Kim .nr_pll_clks = ARRAY_SIZE(cmu_cmu_pll_clks),
366*bd5336e3SHakyeong Kim .fixed_factor_clks = cmu_fixed_factor_clks,
367*bd5336e3SHakyeong Kim .nr_fixed_factor_clks = ARRAY_SIZE(cmu_fixed_factor_clks),
368*bd5336e3SHakyeong Kim .mux_clks = cmu_cmu_mux_clks,
369*bd5336e3SHakyeong Kim .nr_mux_clks = ARRAY_SIZE(cmu_cmu_mux_clks),
370*bd5336e3SHakyeong Kim .div_clks = cmu_cmu_div_clks,
371*bd5336e3SHakyeong Kim .nr_div_clks = ARRAY_SIZE(cmu_cmu_div_clks),
372*bd5336e3SHakyeong Kim .nr_clk_ids = CMU_CMU_NR_CLK,
373*bd5336e3SHakyeong Kim .clk_regs = cmu_cmu_clk_regs,
374*bd5336e3SHakyeong Kim .nr_clk_regs = ARRAY_SIZE(cmu_cmu_clk_regs),
375*bd5336e3SHakyeong Kim };
376*bd5336e3SHakyeong Kim
377*bd5336e3SHakyeong Kim /* Register Offset definitions for CMU_BUS (0x12c10000) */
378*bd5336e3SHakyeong Kim #define PLL_CON0_MUX_CLK_BUS_ACLK_USER 0x0100
379*bd5336e3SHakyeong Kim #define PLL_CON0_MUX_CLK_BUS_DLP_USER 0x0120
380*bd5336e3SHakyeong Kim #define CLK_CON_DIV_CLK_BUS_PCLK 0x1800
381*bd5336e3SHakyeong Kim
382*bd5336e3SHakyeong Kim static const unsigned long cmu_bus_clk_regs[] __initconst = {
383*bd5336e3SHakyeong Kim PLL_CON0_MUX_CLK_BUS_ACLK_USER,
384*bd5336e3SHakyeong Kim PLL_CON0_MUX_CLK_BUS_DLP_USER,
385*bd5336e3SHakyeong Kim CLK_CON_DIV_CLK_BUS_PCLK,
386*bd5336e3SHakyeong Kim };
387*bd5336e3SHakyeong Kim
388*bd5336e3SHakyeong Kim PNAME(mout_clk_bus_aclk_user_p) = { "fin_pll", "dout_clkcmu_bus" };
389*bd5336e3SHakyeong Kim PNAME(mout_clk_bus_dlp_user_p) = { "fin_pll", "dout_clkcmu_bus_dlp" };
390*bd5336e3SHakyeong Kim
391*bd5336e3SHakyeong Kim static const struct samsung_mux_clock cmu_bus_mux_clks[] __initconst = {
392*bd5336e3SHakyeong Kim MUX(CLK_MOUT_BUS_ACLK_USER, "mout_clk_bus_aclk_user",
393*bd5336e3SHakyeong Kim mout_clk_bus_aclk_user_p, PLL_CON0_MUX_CLK_BUS_ACLK_USER, 4, 1),
394*bd5336e3SHakyeong Kim MUX(CLK_MOUT_BUS_DLP_USER, "mout_clk_bus_dlp_user",
395*bd5336e3SHakyeong Kim mout_clk_bus_dlp_user_p, PLL_CON0_MUX_CLK_BUS_DLP_USER, 4, 1),
396*bd5336e3SHakyeong Kim };
397*bd5336e3SHakyeong Kim
398*bd5336e3SHakyeong Kim static const struct samsung_div_clock cmu_bus_div_clks[] __initconst = {
399*bd5336e3SHakyeong Kim DIV(CLK_DOUT_BUS_PCLK, "dout_clk_bus_pclk", "mout_clk_bus_aclk_user",
400*bd5336e3SHakyeong Kim CLK_CON_DIV_CLK_BUS_PCLK, 0, 4),
401*bd5336e3SHakyeong Kim };
402*bd5336e3SHakyeong Kim
403*bd5336e3SHakyeong Kim static const struct samsung_cmu_info cmu_bus_info __initconst = {
404*bd5336e3SHakyeong Kim .mux_clks = cmu_bus_mux_clks,
405*bd5336e3SHakyeong Kim .nr_mux_clks = ARRAY_SIZE(cmu_bus_mux_clks),
406*bd5336e3SHakyeong Kim .div_clks = cmu_bus_div_clks,
407*bd5336e3SHakyeong Kim .nr_div_clks = ARRAY_SIZE(cmu_bus_div_clks),
408*bd5336e3SHakyeong Kim .nr_clk_ids = CMU_BUS_NR_CLK,
409*bd5336e3SHakyeong Kim .clk_regs = cmu_bus_clk_regs,
410*bd5336e3SHakyeong Kim .nr_clk_regs = ARRAY_SIZE(cmu_bus_clk_regs),
411*bd5336e3SHakyeong Kim };
412*bd5336e3SHakyeong Kim
413*bd5336e3SHakyeong Kim /* Register Offset definitions for CMU_CORE (0x12410000) */
414*bd5336e3SHakyeong Kim #define PLL_CON0_MUX_CLK_CORE_ACLK_USER 0x0100
415*bd5336e3SHakyeong Kim #define PLL_CON0_MUX_CLK_CORE_DLP_USER 0x0120
416*bd5336e3SHakyeong Kim #define CLK_CON_DIV_CLK_CORE_PCLK 0x1800
417*bd5336e3SHakyeong Kim
418*bd5336e3SHakyeong Kim static const unsigned long cmu_core_clk_regs[] __initconst = {
419*bd5336e3SHakyeong Kim PLL_CON0_MUX_CLK_CORE_ACLK_USER,
420*bd5336e3SHakyeong Kim PLL_CON0_MUX_CLK_CORE_DLP_USER,
421*bd5336e3SHakyeong Kim CLK_CON_DIV_CLK_CORE_PCLK,
422*bd5336e3SHakyeong Kim };
423*bd5336e3SHakyeong Kim
424*bd5336e3SHakyeong Kim PNAME(mout_clk_core_aclk_user_p) = { "fin_pll", "dout_clkcmu_core_main" };
425*bd5336e3SHakyeong Kim PNAME(mout_clk_core_dlp_user_p) = { "fin_pll", "dout_clkcmu_core_dlp" };
426*bd5336e3SHakyeong Kim
427*bd5336e3SHakyeong Kim static const struct samsung_mux_clock cmu_core_mux_clks[] __initconst = {
428*bd5336e3SHakyeong Kim MUX(CLK_MOUT_CORE_ACLK_USER, "mout_clk_core_aclk_user",
429*bd5336e3SHakyeong Kim mout_clk_core_aclk_user_p, PLL_CON0_MUX_CLK_CORE_ACLK_USER, 4, 1),
430*bd5336e3SHakyeong Kim MUX(CLK_MOUT_CORE_DLP_USER, "mout_clk_core_dlp_user",
431*bd5336e3SHakyeong Kim mout_clk_core_dlp_user_p, PLL_CON0_MUX_CLK_CORE_DLP_USER, 4, 1),
432*bd5336e3SHakyeong Kim };
433*bd5336e3SHakyeong Kim
434*bd5336e3SHakyeong Kim static const struct samsung_div_clock cmu_core_div_clks[] __initconst = {
435*bd5336e3SHakyeong Kim DIV(CLK_DOUT_CORE_PCLK, "dout_clk_core_pclk",
436*bd5336e3SHakyeong Kim "mout_clk_core_aclk_user", CLK_CON_DIV_CLK_CORE_PCLK, 0, 4),
437*bd5336e3SHakyeong Kim };
438*bd5336e3SHakyeong Kim
439*bd5336e3SHakyeong Kim static const struct samsung_cmu_info cmu_core_info __initconst = {
440*bd5336e3SHakyeong Kim .mux_clks = cmu_core_mux_clks,
441*bd5336e3SHakyeong Kim .nr_mux_clks = ARRAY_SIZE(cmu_core_mux_clks),
442*bd5336e3SHakyeong Kim .div_clks = cmu_core_div_clks,
443*bd5336e3SHakyeong Kim .nr_div_clks = ARRAY_SIZE(cmu_core_div_clks),
444*bd5336e3SHakyeong Kim .nr_clk_ids = CMU_CORE_NR_CLK,
445*bd5336e3SHakyeong Kim .clk_regs = cmu_core_clk_regs,
446*bd5336e3SHakyeong Kim .nr_clk_regs = ARRAY_SIZE(cmu_core_clk_regs),
447*bd5336e3SHakyeong Kim };
448*bd5336e3SHakyeong Kim
449*bd5336e3SHakyeong Kim /* Register Offset definitions for CMU_CPUCL (0x11410000) */
450*bd5336e3SHakyeong Kim #define PLL_LOCKTIME_PLL_CPUCL 0x0000
451*bd5336e3SHakyeong Kim #define PLL_CON0_MUX_CLKCMU_CPUCL_SWITCH_USER 0x0120
452*bd5336e3SHakyeong Kim #define PLL_CON0_PLL_CPUCL 0x0140
453*bd5336e3SHakyeong Kim #define CLK_CON_MUX_CLK_CPUCL_PLL 0x1000
454*bd5336e3SHakyeong Kim #define CLK_CON_DIV_CLK_CLUSTER_ACLK 0x1800
455*bd5336e3SHakyeong Kim #define CLK_CON_DIV_CLK_CLUSTER_CNTCLK 0x1804
456*bd5336e3SHakyeong Kim #define CLK_CON_DIV_CLK_CLUSTER_PCLKDBG 0x1808
457*bd5336e3SHakyeong Kim #define CLK_CON_DIV_CLK_CPUCL_CMUREF 0x180c
458*bd5336e3SHakyeong Kim #define CLK_CON_DIV_CLK_CPUCL_PCLK 0x1814
459*bd5336e3SHakyeong Kim #define CLK_CON_DIV_CLK_CLUSTER_ATCLK 0x1818
460*bd5336e3SHakyeong Kim #define CLK_CON_DIV_CLK_CPUCL_DBG 0x181c
461*bd5336e3SHakyeong Kim #define CLK_CON_DIV_CLK_CPUCL_PCLKDBG 0x1820
462*bd5336e3SHakyeong Kim #define CLK_CON_GAT_CLK_CLUSTER_CPU 0x2008
463*bd5336e3SHakyeong Kim #define CLK_CON_GAT_CLK_CPUCL_SHORTSTOP 0x200c
464*bd5336e3SHakyeong Kim #define CLK_CON_DMYQCH_CON_CSSYS_QCH 0x3008
465*bd5336e3SHakyeong Kim
466*bd5336e3SHakyeong Kim static const unsigned long cmu_cpucl_clk_regs[] __initconst = {
467*bd5336e3SHakyeong Kim PLL_LOCKTIME_PLL_CPUCL,
468*bd5336e3SHakyeong Kim PLL_CON0_MUX_CLKCMU_CPUCL_SWITCH_USER,
469*bd5336e3SHakyeong Kim PLL_CON0_PLL_CPUCL,
470*bd5336e3SHakyeong Kim CLK_CON_MUX_CLK_CPUCL_PLL,
471*bd5336e3SHakyeong Kim CLK_CON_DIV_CLK_CLUSTER_ACLK,
472*bd5336e3SHakyeong Kim CLK_CON_DIV_CLK_CLUSTER_CNTCLK,
473*bd5336e3SHakyeong Kim CLK_CON_DIV_CLK_CLUSTER_PCLKDBG,
474*bd5336e3SHakyeong Kim CLK_CON_DIV_CLK_CPUCL_CMUREF,
475*bd5336e3SHakyeong Kim CLK_CON_DIV_CLK_CPUCL_PCLK,
476*bd5336e3SHakyeong Kim CLK_CON_DIV_CLK_CLUSTER_ATCLK,
477*bd5336e3SHakyeong Kim CLK_CON_DIV_CLK_CPUCL_DBG,
478*bd5336e3SHakyeong Kim CLK_CON_DIV_CLK_CPUCL_PCLKDBG,
479*bd5336e3SHakyeong Kim CLK_CON_GAT_CLK_CLUSTER_CPU,
480*bd5336e3SHakyeong Kim CLK_CON_GAT_CLK_CPUCL_SHORTSTOP,
481*bd5336e3SHakyeong Kim CLK_CON_DMYQCH_CON_CSSYS_QCH,
482*bd5336e3SHakyeong Kim };
483*bd5336e3SHakyeong Kim
484*bd5336e3SHakyeong Kim static const struct samsung_pll_clock cmu_cpucl_pll_clks[] __initconst = {
485*bd5336e3SHakyeong Kim PLL(pll_1017x, CLK_FOUT_CPUCL_PLL, "fout_pll_cpucl", "fin_pll",
486*bd5336e3SHakyeong Kim PLL_LOCKTIME_PLL_CPUCL, PLL_CON0_PLL_CPUCL, NULL),
487*bd5336e3SHakyeong Kim };
488*bd5336e3SHakyeong Kim
489*bd5336e3SHakyeong Kim PNAME(mout_clkcmu_cpucl_switch_user_p) = { "fin_pll", "dout_clkcmu_cpucl_switch" };
490*bd5336e3SHakyeong Kim PNAME(mout_pll_cpucl_p) = { "fin_pll", "fout_pll_cpucl" };
491*bd5336e3SHakyeong Kim PNAME(mout_clk_cpucl_pll_p) = { "mout_pll_cpucl", "mout_clkcmu_cpucl_switch_user" };
492*bd5336e3SHakyeong Kim
493*bd5336e3SHakyeong Kim static const struct samsung_mux_clock cmu_cpucl_mux_clks[] __initconst = {
494*bd5336e3SHakyeong Kim MUX_F(0, "mout_pll_cpucl", mout_pll_cpucl_p, PLL_CON0_PLL_CPUCL, 4, 1,
495*bd5336e3SHakyeong Kim CLK_SET_RATE_PARENT | CLK_RECALC_NEW_RATES, 0),
496*bd5336e3SHakyeong Kim MUX(CLK_MOUT_CPUCL_SWITCH_USER, "mout_clkcmu_cpucl_switch_user",
497*bd5336e3SHakyeong Kim mout_clkcmu_cpucl_switch_user_p, PLL_CON0_MUX_CLKCMU_CPUCL_SWITCH_USER, 4, 1),
498*bd5336e3SHakyeong Kim MUX_F(CLK_MOUT_CPUCL_PLL, "mout_clk_cpucl_pll", mout_clk_cpucl_pll_p,
499*bd5336e3SHakyeong Kim CLK_CON_MUX_CLK_CPUCL_PLL, 0, 1, CLK_SET_RATE_PARENT, 0),
500*bd5336e3SHakyeong Kim };
501*bd5336e3SHakyeong Kim
502*bd5336e3SHakyeong Kim static const struct samsung_fixed_factor_clock cpucl_ffactor_clks[] __initconst = {
503*bd5336e3SHakyeong Kim FFACTOR(CLK_DOUT_CPUCL_CPU, "dout_clk_cpucl_cpu",
504*bd5336e3SHakyeong Kim "mout_clk_cpucl_pll", 1, 1, CLK_SET_RATE_PARENT),
505*bd5336e3SHakyeong Kim };
506*bd5336e3SHakyeong Kim
507*bd5336e3SHakyeong Kim static const struct samsung_div_clock cmu_cpucl_div_clks[] __initconst = {
508*bd5336e3SHakyeong Kim DIV(CLK_DOUT_CPUCL_CLUSTER_ACLK, "dout_clk_cluster_aclk",
509*bd5336e3SHakyeong Kim "dout_clk_cpucl_cpu", CLK_CON_DIV_CLK_CLUSTER_ACLK, 0, 4),
510*bd5336e3SHakyeong Kim DIV(CLK_DOUT_CPUCL_CLUSTER_PCLKDBG, "dout_clk_cluster_pclkdbg",
511*bd5336e3SHakyeong Kim "dout_clk_cpucl_cpu", CLK_CON_DIV_CLK_CLUSTER_PCLKDBG, 0, 4),
512*bd5336e3SHakyeong Kim DIV(CLK_DOUT_CPUCL_CLUSTER_CNTCLK, "dout_clk_cluster_cntclk",
513*bd5336e3SHakyeong Kim "dout_clk_cpucl_cpu", CLK_CON_DIV_CLK_CLUSTER_CNTCLK, 0, 4),
514*bd5336e3SHakyeong Kim DIV(CLK_DOUT_CPUCL_CLUSTER_ATCLK, "dout_clk_cluster_atclk",
515*bd5336e3SHakyeong Kim "dout_clk_cpucl_cpu", CLK_CON_DIV_CLK_CLUSTER_ATCLK, 0, 4),
516*bd5336e3SHakyeong Kim DIV(CLK_DOUT_CPUCL_PCLK, "dout_clk_cpucl_pclk",
517*bd5336e3SHakyeong Kim "dout_clk_cpucl_cpu", CLK_CON_DIV_CLK_CPUCL_PCLK, 0, 4),
518*bd5336e3SHakyeong Kim DIV(CLK_DOUT_CPUCL_CMUREF, "dout_clk_cpucl_cmuref",
519*bd5336e3SHakyeong Kim "dout_clk_cpucl_cpu", CLK_CON_DIV_CLK_CPUCL_CMUREF, 0, 3),
520*bd5336e3SHakyeong Kim DIV(CLK_DOUT_CPUCL_DBG, "dout_clk_cpucl_dbg",
521*bd5336e3SHakyeong Kim "dout_clk_cpucl_cpu", CLK_CON_DIV_CLK_CPUCL_DBG, 0, 4),
522*bd5336e3SHakyeong Kim DIV(CLK_DOUT_CPUCL_PCLKDBG, "dout_clk_cpucl_pclkdbg",
523*bd5336e3SHakyeong Kim "dout_clk_cpucl_dbg", CLK_CON_DIV_CLK_CPUCL_PCLKDBG, 0, 4),
524*bd5336e3SHakyeong Kim };
525*bd5336e3SHakyeong Kim
526*bd5336e3SHakyeong Kim static const struct samsung_gate_clock cmu_cpucl_gate_clks[] __initconst = {
527*bd5336e3SHakyeong Kim GATE(CLK_GOUT_CPUCL_CLUSTER_CPU, "clk_con_gat_clk_cluster_cpu",
528*bd5336e3SHakyeong Kim "clk_con_gat_clk_cpucl_shortstop", CLK_CON_GAT_CLK_CLUSTER_CPU, 21,
529*bd5336e3SHakyeong Kim CLK_SET_RATE_PARENT | CLK_IS_CRITICAL, 0),
530*bd5336e3SHakyeong Kim GATE(CLK_GOUT_CPUCL_SHORTSTOP, "clk_con_gat_clk_cpucl_shortstop",
531*bd5336e3SHakyeong Kim "dout_clk_cpucl_cpu", CLK_CON_GAT_CLK_CPUCL_SHORTSTOP, 21,
532*bd5336e3SHakyeong Kim CLK_SET_RATE_PARENT | CLK_IS_CRITICAL, 0),
533*bd5336e3SHakyeong Kim GATE(CLK_GOUT_CPUCL_CSSYS_IPCLKPORT_PCLKDBG, "cssys_ipclkport_pclkdbg",
534*bd5336e3SHakyeong Kim "dout_clk_cpucl_pclkdbg", CLK_CON_DMYQCH_CON_CSSYS_QCH, 1,
535*bd5336e3SHakyeong Kim CLK_SET_RATE_PARENT | CLK_IS_CRITICAL, 0),
536*bd5336e3SHakyeong Kim GATE(CLK_GOUT_CPUCL_CSSYS_IPCLKPORT_ATCLK, "cssys_ipclkport_atclk",
537*bd5336e3SHakyeong Kim "dout_clk_cpucl_dbg", CLK_CON_DMYQCH_CON_CSSYS_QCH, 1,
538*bd5336e3SHakyeong Kim CLK_SET_RATE_PARENT | CLK_IS_CRITICAL, 0),
539*bd5336e3SHakyeong Kim };
540*bd5336e3SHakyeong Kim
541*bd5336e3SHakyeong Kim static const struct samsung_cmu_info cmu_cpucl_info __initconst = {
542*bd5336e3SHakyeong Kim .pll_clks = cmu_cpucl_pll_clks,
543*bd5336e3SHakyeong Kim .nr_pll_clks = ARRAY_SIZE(cmu_cpucl_pll_clks),
544*bd5336e3SHakyeong Kim .fixed_factor_clks = cpucl_ffactor_clks,
545*bd5336e3SHakyeong Kim .nr_fixed_factor_clks = ARRAY_SIZE(cpucl_ffactor_clks),
546*bd5336e3SHakyeong Kim .mux_clks = cmu_cpucl_mux_clks,
547*bd5336e3SHakyeong Kim .nr_mux_clks = ARRAY_SIZE(cmu_cpucl_mux_clks),
548*bd5336e3SHakyeong Kim .div_clks = cmu_cpucl_div_clks,
549*bd5336e3SHakyeong Kim .nr_div_clks = ARRAY_SIZE(cmu_cpucl_div_clks),
550*bd5336e3SHakyeong Kim .gate_clks = cmu_cpucl_gate_clks,
551*bd5336e3SHakyeong Kim .nr_gate_clks = ARRAY_SIZE(cmu_cpucl_gate_clks),
552*bd5336e3SHakyeong Kim .nr_clk_ids = CMU_CPUCL_NR_CLK,
553*bd5336e3SHakyeong Kim .clk_regs = cmu_cpucl_clk_regs,
554*bd5336e3SHakyeong Kim .nr_clk_regs = ARRAY_SIZE(cmu_cpucl_clk_regs),
555*bd5336e3SHakyeong Kim };
556*bd5336e3SHakyeong Kim
557*bd5336e3SHakyeong Kim /* Register Offset definitions for CMU_FSYS (0x16c10000) */
558*bd5336e3SHakyeong Kim #define PLL_LOCKTIME_PLL_FSYS 0x0004
559*bd5336e3SHakyeong Kim #define PLL_CON0_MUX_CLK_FSYS_BUS_USER 0x0120
560*bd5336e3SHakyeong Kim #define PLL_CON0_MUX_CLK_FSYS_MMC_USER 0x0140
561*bd5336e3SHakyeong Kim #define PLL_CON0_MUX_CLK_FSYS_SCAN0_USER 0x0160
562*bd5336e3SHakyeong Kim #define PLL_CON0_MUX_CLK_FSYS_SCAN1_USER 0x0180
563*bd5336e3SHakyeong Kim #define PLL_CON0_PLL_FSYS 0x01c0
564*bd5336e3SHakyeong Kim #define CLK_CON_DIV_CLK_FSYS_ADC 0x1804
565*bd5336e3SHakyeong Kim #define CLK_CON_DIV_CLK_FSYS_BUS300 0x1808
566*bd5336e3SHakyeong Kim #define CLK_CON_DIV_CLK_FSYS_BUS_QSPI 0x180c
567*bd5336e3SHakyeong Kim #define CLK_CON_DIV_CLK_FSYS_EQOS_25 0x1810
568*bd5336e3SHakyeong Kim #define CLK_CON_DIV_CLK_FSYS_EQOS_2P5 0x1814
569*bd5336e3SHakyeong Kim #define CLK_CON_DIV_CLK_FSYS_EQOS_500 0x1818
570*bd5336e3SHakyeong Kim #define CLK_CON_DIV_CLK_FSYS_EQOS_INT125 0x181c
571*bd5336e3SHakyeong Kim #define CLK_CON_DIV_CLK_FSYS_MMC_CARD0 0x1820
572*bd5336e3SHakyeong Kim #define CLK_CON_DIV_CLK_FSYS_MMC_CARD1 0x1824
573*bd5336e3SHakyeong Kim #define CLK_CON_DIV_CLK_FSYS_OTP_MEM 0x1828
574*bd5336e3SHakyeong Kim #define CLK_CON_DIV_CLK_FSYS_PCIE_PHY_REFCLK_SYSPLL 0x182c
575*bd5336e3SHakyeong Kim #define CLK_CON_DIV_CLK_FSYS_QSPI 0x1830
576*bd5336e3SHakyeong Kim #define CLK_CON_DIV_CLK_FSYS_SCLK_UART 0x1834
577*bd5336e3SHakyeong Kim #define CLK_CON_DIV_CLK_FSYS_SFMC_NAND 0x1838
578*bd5336e3SHakyeong Kim #define CLK_CON_DIV_SCAN_CLK_FSYS_125 0x183c
579*bd5336e3SHakyeong Kim #define CLK_CON_DIV_SCAN_CLK_FSYS_MMC 0x1840
580*bd5336e3SHakyeong Kim #define CLK_CON_DIV_SCAN_CLK_FSYS_PCIE_PIPE 0x1844
581*bd5336e3SHakyeong Kim #define CLK_CON_FSYS_I2C0_IPCLKPORT_I_PCLK 0x2044
582*bd5336e3SHakyeong Kim #define CLK_CON_FSYS_I2C1_IPCLKPORT_I_PCLK 0x2048
583*bd5336e3SHakyeong Kim #define CLK_CON_FSYS_UART0_IPCLKPORT_I_PCLK 0x204c
584*bd5336e3SHakyeong Kim #define CLK_CON_FSYS_UART0_IPCLKPORT_I_SCLK_UART 0x2050
585*bd5336e3SHakyeong Kim #define CLK_CON_MMC0_IPCLKPORT_I_ACLK 0x2070
586*bd5336e3SHakyeong Kim #define CLK_CON_MMC1_IPCLKPORT_I_ACLK 0x2078
587*bd5336e3SHakyeong Kim #define CLK_CON_DWC_PCIE_CTL_INST_0_DBI_ACLK_UG 0x208c
588*bd5336e3SHakyeong Kim #define CLK_CON_DWC_PCIE_CTL_INST_0_MSTR_ACLK_UG 0x2090
589*bd5336e3SHakyeong Kim #define CLK_CON_DWC_PCIE_CTL_INST_0_SLV_ACLK_UG 0x2094
590*bd5336e3SHakyeong Kim #define CLK_CON_PWM_IPCLKPORT_I_PCLK_S0 0x20a0
591*bd5336e3SHakyeong Kim #define CLK_CON_USB20DRD_IPCLKPORT_ACLK_PHYCTRL_20 0x20bc
592*bd5336e3SHakyeong Kim #define CLK_CON_USB20DRD_IPCLKPORT_BUS_CLK_EARLY 0x20c0
593*bd5336e3SHakyeong Kim #define CLK_CON_XHB_AHBBR_IPCLKPORT_CLK 0x20c4
594*bd5336e3SHakyeong Kim #define CLK_CON_XHB_USB_IPCLKPORT_CLK 0x20cc
595*bd5336e3SHakyeong Kim #define CLK_CON_BUS_P_FSYS_IPCLKPORT_QSPICLK 0x201c
596*bd5336e3SHakyeong Kim #define CLK_CON_DMYQCH_CON_EQOS_TOP_QCH 0x3008
597*bd5336e3SHakyeong Kim #define CLK_CON_DMYQCH_CON_MMC0_QCH 0x300c
598*bd5336e3SHakyeong Kim #define CLK_CON_DMYQCH_CON_MMC1_QCH 0x3010
599*bd5336e3SHakyeong Kim #define CLK_CON_DMYQCH_CON_PCIE_TOP_QCH 0x3018
600*bd5336e3SHakyeong Kim #define CLK_CON_DMYQCH_CON_PCIE_TOP_QCH_REF 0x301c
601*bd5336e3SHakyeong Kim #define CLK_CON_DMYQCH_CON_QSPI_QCH 0x3020
602*bd5336e3SHakyeong Kim #define CLK_CON_DMYQCH_CON_SFMC_QCH 0x3024
603*bd5336e3SHakyeong Kim
604*bd5336e3SHakyeong Kim static const unsigned long cmu_fsys_clk_regs[] __initconst = {
605*bd5336e3SHakyeong Kim PLL_LOCKTIME_PLL_FSYS,
606*bd5336e3SHakyeong Kim PLL_CON0_MUX_CLK_FSYS_BUS_USER,
607*bd5336e3SHakyeong Kim PLL_CON0_MUX_CLK_FSYS_MMC_USER,
608*bd5336e3SHakyeong Kim PLL_CON0_MUX_CLK_FSYS_SCAN0_USER,
609*bd5336e3SHakyeong Kim PLL_CON0_MUX_CLK_FSYS_SCAN1_USER,
610*bd5336e3SHakyeong Kim PLL_CON0_PLL_FSYS,
611*bd5336e3SHakyeong Kim CLK_CON_DIV_CLK_FSYS_ADC,
612*bd5336e3SHakyeong Kim CLK_CON_DIV_CLK_FSYS_BUS300,
613*bd5336e3SHakyeong Kim CLK_CON_DIV_CLK_FSYS_BUS_QSPI,
614*bd5336e3SHakyeong Kim CLK_CON_DIV_CLK_FSYS_EQOS_25,
615*bd5336e3SHakyeong Kim CLK_CON_DIV_CLK_FSYS_EQOS_2P5,
616*bd5336e3SHakyeong Kim CLK_CON_DIV_CLK_FSYS_EQOS_500,
617*bd5336e3SHakyeong Kim CLK_CON_DIV_CLK_FSYS_EQOS_INT125,
618*bd5336e3SHakyeong Kim CLK_CON_DIV_CLK_FSYS_MMC_CARD0,
619*bd5336e3SHakyeong Kim CLK_CON_DIV_CLK_FSYS_MMC_CARD1,
620*bd5336e3SHakyeong Kim CLK_CON_DIV_CLK_FSYS_OTP_MEM,
621*bd5336e3SHakyeong Kim CLK_CON_DIV_CLK_FSYS_PCIE_PHY_REFCLK_SYSPLL,
622*bd5336e3SHakyeong Kim CLK_CON_DIV_CLK_FSYS_QSPI,
623*bd5336e3SHakyeong Kim CLK_CON_DIV_CLK_FSYS_SCLK_UART,
624*bd5336e3SHakyeong Kim CLK_CON_DIV_CLK_FSYS_SFMC_NAND,
625*bd5336e3SHakyeong Kim CLK_CON_DIV_SCAN_CLK_FSYS_125,
626*bd5336e3SHakyeong Kim CLK_CON_DIV_SCAN_CLK_FSYS_MMC,
627*bd5336e3SHakyeong Kim CLK_CON_DIV_SCAN_CLK_FSYS_PCIE_PIPE,
628*bd5336e3SHakyeong Kim CLK_CON_FSYS_I2C0_IPCLKPORT_I_PCLK,
629*bd5336e3SHakyeong Kim CLK_CON_FSYS_I2C1_IPCLKPORT_I_PCLK,
630*bd5336e3SHakyeong Kim CLK_CON_FSYS_UART0_IPCLKPORT_I_PCLK,
631*bd5336e3SHakyeong Kim CLK_CON_FSYS_UART0_IPCLKPORT_I_SCLK_UART,
632*bd5336e3SHakyeong Kim CLK_CON_MMC0_IPCLKPORT_I_ACLK,
633*bd5336e3SHakyeong Kim CLK_CON_MMC1_IPCLKPORT_I_ACLK,
634*bd5336e3SHakyeong Kim CLK_CON_DWC_PCIE_CTL_INST_0_DBI_ACLK_UG,
635*bd5336e3SHakyeong Kim CLK_CON_DWC_PCIE_CTL_INST_0_MSTR_ACLK_UG,
636*bd5336e3SHakyeong Kim CLK_CON_DWC_PCIE_CTL_INST_0_SLV_ACLK_UG,
637*bd5336e3SHakyeong Kim CLK_CON_PWM_IPCLKPORT_I_PCLK_S0,
638*bd5336e3SHakyeong Kim CLK_CON_USB20DRD_IPCLKPORT_ACLK_PHYCTRL_20,
639*bd5336e3SHakyeong Kim CLK_CON_USB20DRD_IPCLKPORT_BUS_CLK_EARLY,
640*bd5336e3SHakyeong Kim CLK_CON_XHB_AHBBR_IPCLKPORT_CLK,
641*bd5336e3SHakyeong Kim CLK_CON_XHB_USB_IPCLKPORT_CLK,
642*bd5336e3SHakyeong Kim CLK_CON_BUS_P_FSYS_IPCLKPORT_QSPICLK,
643*bd5336e3SHakyeong Kim CLK_CON_DMYQCH_CON_EQOS_TOP_QCH,
644*bd5336e3SHakyeong Kim CLK_CON_DMYQCH_CON_MMC0_QCH,
645*bd5336e3SHakyeong Kim CLK_CON_DMYQCH_CON_MMC1_QCH,
646*bd5336e3SHakyeong Kim CLK_CON_DMYQCH_CON_PCIE_TOP_QCH,
647*bd5336e3SHakyeong Kim CLK_CON_DMYQCH_CON_PCIE_TOP_QCH_REF,
648*bd5336e3SHakyeong Kim CLK_CON_DMYQCH_CON_QSPI_QCH,
649*bd5336e3SHakyeong Kim CLK_CON_DMYQCH_CON_SFMC_QCH,
650*bd5336e3SHakyeong Kim };
651*bd5336e3SHakyeong Kim
652*bd5336e3SHakyeong Kim static const struct samsung_pll_clock cmu_fsys_pll_clks[] __initconst = {
653*bd5336e3SHakyeong Kim PLL(pll_1017x, CLK_FOUT_FSYS_PLL, "fout_pll_fsys", "fin_pll",
654*bd5336e3SHakyeong Kim PLL_LOCKTIME_PLL_FSYS, PLL_CON0_PLL_FSYS, NULL),
655*bd5336e3SHakyeong Kim };
656*bd5336e3SHakyeong Kim
657*bd5336e3SHakyeong Kim PNAME(mout_fsys_scan0_user_p) = { "fin_pll", "dout_clkcmu_fsys_scan0" };
658*bd5336e3SHakyeong Kim PNAME(mout_fsys_scan1_user_p) = { "fin_pll", "dout_clkcmu_fsys_scan1" };
659*bd5336e3SHakyeong Kim PNAME(mout_fsys_bus_user_p) = { "fin_pll", "dout_clkcmu_fsys_bus" };
660*bd5336e3SHakyeong Kim PNAME(mout_fsys_mmc_user_p) = { "fin_pll", "dout_clkcmu_fsys_ip" };
661*bd5336e3SHakyeong Kim PNAME(mout_fsys_pll_fsys_p) = { "fin_pll", "fout_pll_fsys" };
662*bd5336e3SHakyeong Kim
663*bd5336e3SHakyeong Kim static const struct samsung_mux_clock cmu_fsys_mux_clks[] __initconst = {
664*bd5336e3SHakyeong Kim MUX(0, "mout_clk_pll_fsys", mout_fsys_pll_fsys_p, PLL_CON0_PLL_FSYS, 4, 1),
665*bd5336e3SHakyeong Kim MUX(CLK_MOUT_FSYS_SCAN0_USER, "mout_fsys_scan0_user",
666*bd5336e3SHakyeong Kim mout_fsys_scan0_user_p, PLL_CON0_MUX_CLK_FSYS_SCAN0_USER, 4, 1),
667*bd5336e3SHakyeong Kim MUX(CLK_MOUT_FSYS_SCAN1_USER, "mout_fsys_scan1_user",
668*bd5336e3SHakyeong Kim mout_fsys_scan1_user_p, PLL_CON0_MUX_CLK_FSYS_SCAN1_USER, 4, 1),
669*bd5336e3SHakyeong Kim MUX(CLK_MOUT_FSYS_BUS_USER, "mout_fsys_bus_user",
670*bd5336e3SHakyeong Kim mout_fsys_bus_user_p, PLL_CON0_MUX_CLK_FSYS_BUS_USER, 4, 1),
671*bd5336e3SHakyeong Kim MUX(CLK_MOUT_FSYS_MMC_USER, "mout_fsys_mmc_user",
672*bd5336e3SHakyeong Kim mout_fsys_mmc_user_p, PLL_CON0_MUX_CLK_FSYS_MMC_USER, 4, 1),
673*bd5336e3SHakyeong Kim };
674*bd5336e3SHakyeong Kim
675*bd5336e3SHakyeong Kim static const struct samsung_div_clock cmu_fsys_div_clks[] __initconst = {
676*bd5336e3SHakyeong Kim DIV(CLK_DOUT_FSYS_PCIE_PIPE, "dout_fsys_pcie_pipe", "mout_clk_pll_fsys",
677*bd5336e3SHakyeong Kim CLK_CON_DIV_SCAN_CLK_FSYS_PCIE_PIPE, 0, 4),
678*bd5336e3SHakyeong Kim DIV(CLK_DOUT_FSYS_ADC, "dout_fsys_adc", "mout_clk_pll_fsys",
679*bd5336e3SHakyeong Kim CLK_CON_DIV_CLK_FSYS_ADC, 0, 7),
680*bd5336e3SHakyeong Kim DIV(CLK_DOUT_FSYS_PCIE_PHY_REFCLK_SYSPLL, "dout_fsys_pcie_phy_refclk_syspll",
681*bd5336e3SHakyeong Kim "mout_clk_pll_fsys", CLK_CON_DIV_CLK_FSYS_PCIE_PHY_REFCLK_SYSPLL, 0, 8),
682*bd5336e3SHakyeong Kim DIV(CLK_DOUT_FSYS_QSPI, "dout_fsys_qspi", "mout_fsys_mmc_user",
683*bd5336e3SHakyeong Kim CLK_CON_DIV_CLK_FSYS_QSPI, 0, 4),
684*bd5336e3SHakyeong Kim DIV(CLK_DOUT_FSYS_EQOS_INT125, "dout_fsys_eqos_int125", "mout_clk_pll_fsys",
685*bd5336e3SHakyeong Kim CLK_CON_DIV_CLK_FSYS_EQOS_INT125, 0, 4),
686*bd5336e3SHakyeong Kim DIV(CLK_DOUT_FSYS_OTP_MEM, "dout_fsys_otp_mem", "fin_pll",
687*bd5336e3SHakyeong Kim CLK_CON_DIV_CLK_FSYS_OTP_MEM, 0, 9),
688*bd5336e3SHakyeong Kim DIV(CLK_DOUT_FSYS_SCLK_UART, "dout_fsys_sclk_uart", "mout_clk_pll_fsys",
689*bd5336e3SHakyeong Kim CLK_CON_DIV_CLK_FSYS_SCLK_UART, 0, 10),
690*bd5336e3SHakyeong Kim DIV(CLK_DOUT_FSYS_SFMC_NAND, "dout_fsys_sfmc_nand", "mout_fsys_mmc_user",
691*bd5336e3SHakyeong Kim CLK_CON_DIV_CLK_FSYS_SFMC_NAND, 0, 4),
692*bd5336e3SHakyeong Kim DIV(CLK_DOUT_SCAN_CLK_FSYS_125, "dout_scan_clk_fsys_125", "mout_clk_pll_fsys",
693*bd5336e3SHakyeong Kim CLK_CON_DIV_SCAN_CLK_FSYS_125, 0, 4),
694*bd5336e3SHakyeong Kim DIV(CLK_DOUT_FSYS_SCAN_CLK_MMC, "dout_scan_clk_fsys_mmc", "fout_pll_fsys",
695*bd5336e3SHakyeong Kim CLK_CON_DIV_SCAN_CLK_FSYS_MMC, 0, 4),
696*bd5336e3SHakyeong Kim DIV(CLK_DOUT_FSYS_EQOS_25, "dout_fsys_eqos_25", "dout_fsys_eqos_int125",
697*bd5336e3SHakyeong Kim CLK_CON_DIV_CLK_FSYS_EQOS_25, 0, 4),
698*bd5336e3SHakyeong Kim DIV_F(CLK_DOUT_FSYS_EQOS_2p5, "dout_fsys_eqos_2p5", "dout_fsys_eqos_25",
699*bd5336e3SHakyeong Kim CLK_CON_DIV_CLK_FSYS_EQOS_2P5, 0, 4, CLK_SET_RATE_PARENT, 0),
700*bd5336e3SHakyeong Kim DIV(0, "dout_fsys_eqos_500", "mout_clk_pll_fsys",
701*bd5336e3SHakyeong Kim CLK_CON_DIV_CLK_FSYS_EQOS_500, 0, 4),
702*bd5336e3SHakyeong Kim DIV(CLK_DOUT_FSYS_BUS300, "dout_fsys_bus300", "mout_fsys_bus_user",
703*bd5336e3SHakyeong Kim CLK_CON_DIV_CLK_FSYS_BUS300, 0, 4),
704*bd5336e3SHakyeong Kim DIV(CLK_DOUT_FSYS_BUS_QSPI, "dout_fsys_bus_qspi", "mout_fsys_mmc_user",
705*bd5336e3SHakyeong Kim CLK_CON_DIV_CLK_FSYS_BUS_QSPI, 0, 4),
706*bd5336e3SHakyeong Kim DIV(CLK_DOUT_FSYS_MMC_CARD0, "dout_fsys_mmc_card0", "mout_fsys_mmc_user",
707*bd5336e3SHakyeong Kim CLK_CON_DIV_CLK_FSYS_MMC_CARD0, 0, 10),
708*bd5336e3SHakyeong Kim DIV(CLK_DOUT_FSYS_MMC_CARD1, "dout_fsys_mmc_card1", "mout_fsys_mmc_user",
709*bd5336e3SHakyeong Kim CLK_CON_DIV_CLK_FSYS_MMC_CARD1, 0, 10),
710*bd5336e3SHakyeong Kim };
711*bd5336e3SHakyeong Kim
712*bd5336e3SHakyeong Kim static const struct samsung_gate_clock cmu_fsys_gate_clks[] __initconst = {
713*bd5336e3SHakyeong Kim GATE(CLK_GOUT_FSYS_PCIE_PHY_REFCLK_IN, "pcie_sub_ctrl_inst_0_phy_refclk_in",
714*bd5336e3SHakyeong Kim "dout_fsys_pcie_phy_refclk_syspll", CLK_CON_DMYQCH_CON_PCIE_TOP_QCH_REF, 1,
715*bd5336e3SHakyeong Kim CLK_SET_RATE_PARENT, 0),
716*bd5336e3SHakyeong Kim GATE(CLK_GOUT_FSYS_EQOS_TOP_IPCLKPORT_I_RGMII_TXCLK_2P5,
717*bd5336e3SHakyeong Kim "eqos_top_ipclkport_i_rgmii_txclk_2p5",
718*bd5336e3SHakyeong Kim "dout_fsys_eqos_2p5", CLK_CON_DMYQCH_CON_EQOS_TOP_QCH, 1, CLK_SET_RATE_PARENT, 0),
719*bd5336e3SHakyeong Kim GATE(CLK_GOUT_FSYS_EQOS_TOP_IPCLKPORT_ACLK_I, "eqos_top_ipclkport_aclk_i",
720*bd5336e3SHakyeong Kim "dout_fsys_bus300", CLK_CON_DMYQCH_CON_EQOS_TOP_QCH, 1, CLK_SET_RATE_PARENT, 0),
721*bd5336e3SHakyeong Kim GATE(CLK_GOUT_FSYS_EQOS_TOP_IPCLKPORT_CLK_CSR_I, "eqos_top_ipclkport_clk_csr_i",
722*bd5336e3SHakyeong Kim "dout_fsys_bus300", CLK_CON_DMYQCH_CON_EQOS_TOP_QCH, 1, CLK_SET_RATE_PARENT, 0),
723*bd5336e3SHakyeong Kim GATE(CLK_GOUT_FSYS_PIPE_PAL_INST_0_I_APB_PCLK, "pipe_pal_inst_0_i_apb_pclk",
724*bd5336e3SHakyeong Kim "dout_fsys_bus300", CLK_CON_DMYQCH_CON_PCIE_TOP_QCH, 1, CLK_SET_RATE_PARENT, 0),
725*bd5336e3SHakyeong Kim GATE(CLK_GOUT_FSYS_QSPI_IPCLKPORT_HCLK, "qspi_ipclkport_hclk",
726*bd5336e3SHakyeong Kim "dout_fsys_bus_qspi", CLK_CON_DMYQCH_CON_QSPI_QCH, 1, CLK_SET_RATE_PARENT, 0),
727*bd5336e3SHakyeong Kim GATE(CLK_GOUT_FSYS_QSPI_IPCLKPORT_SSI_CLK, "qspi_ipclkport_ssi_clk",
728*bd5336e3SHakyeong Kim "dout_fsys_qspi", CLK_CON_DMYQCH_CON_QSPI_QCH, 1, CLK_SET_RATE_PARENT, 0),
729*bd5336e3SHakyeong Kim GATE(CLK_GOUT_FSYS_MMC0_IPCLKPORT_SDCLKIN, "mmc0_ipclkport_sdclkin",
730*bd5336e3SHakyeong Kim "dout_fsys_mmc_card0", CLK_CON_DMYQCH_CON_MMC0_QCH, 1, CLK_SET_RATE_PARENT, 0),
731*bd5336e3SHakyeong Kim GATE(CLK_GOUT_FSYS_MMC1_IPCLKPORT_SDCLKIN, "mmc1_ipclkport_sdclkin",
732*bd5336e3SHakyeong Kim "dout_fsys_mmc_card1", CLK_CON_DMYQCH_CON_MMC1_QCH, 1, CLK_SET_RATE_PARENT, 0),
733*bd5336e3SHakyeong Kim GATE(CLK_GOUT_FSYS_SFMC_IPCLKPORT_I_ACLK_NAND, "sfmc_ipclkport_i_aclk_nand",
734*bd5336e3SHakyeong Kim "dout_fsys_sfmc_nand", CLK_CON_DMYQCH_CON_SFMC_QCH, 1, CLK_SET_RATE_PARENT, 0),
735*bd5336e3SHakyeong Kim GATE(CLK_GOUT_FSYS_UART0_SCLK_UART, "uart0_sclk", "dout_fsys_sclk_uart",
736*bd5336e3SHakyeong Kim CLK_CON_FSYS_UART0_IPCLKPORT_I_SCLK_UART, 21,
737*bd5336e3SHakyeong Kim CLK_SET_RATE_PARENT | CLK_IS_CRITICAL, 0),
738*bd5336e3SHakyeong Kim GATE(CLK_GOUT_FSYS_DWC_PCIE_CTL_INST_0_MSTR_ACLK_UG, "dwc_pcie_ctl_inst_0_mstr_aclk_ug",
739*bd5336e3SHakyeong Kim "mout_fsys_bus_user", CLK_CON_DWC_PCIE_CTL_INST_0_MSTR_ACLK_UG, 21,
740*bd5336e3SHakyeong Kim CLK_SET_RATE_PARENT | CLK_IS_CRITICAL, 0),
741*bd5336e3SHakyeong Kim GATE(CLK_GOUT_FSYS_DWC_PCIE_CTL_INXT_0_SLV_ACLK_UG, "dwc_pcie_ctl_inst_0_slv_aclk_ug",
742*bd5336e3SHakyeong Kim "mout_fsys_bus_user", CLK_CON_DWC_PCIE_CTL_INST_0_SLV_ACLK_UG, 21,
743*bd5336e3SHakyeong Kim CLK_SET_RATE_PARENT | CLK_IS_CRITICAL, 0),
744*bd5336e3SHakyeong Kim GATE(CLK_GOUT_FSYS_I2C0_IPCLKPORT_I_PCLK, "fsys_i2c0_ipclkport_i_pclk", "dout_fsys_bus300",
745*bd5336e3SHakyeong Kim CLK_CON_FSYS_I2C0_IPCLKPORT_I_PCLK, 21, CLK_SET_RATE_PARENT | CLK_IS_CRITICAL, 0),
746*bd5336e3SHakyeong Kim GATE(CLK_GOUT_FSYS_I2C1_IPCLKPORT_I_PCLK, "fsys_i2c1_ipclkport_i_pclk", "dout_fsys_bus300",
747*bd5336e3SHakyeong Kim CLK_CON_FSYS_I2C1_IPCLKPORT_I_PCLK, 21, CLK_SET_RATE_PARENT | CLK_IS_CRITICAL, 0),
748*bd5336e3SHakyeong Kim GATE(CLK_GOUT_FSYS_UART0_PCLK, "uart0_pclk", "dout_fsys_bus300",
749*bd5336e3SHakyeong Kim CLK_CON_FSYS_UART0_IPCLKPORT_I_PCLK, 21, CLK_SET_RATE_PARENT | CLK_IS_CRITICAL, 0),
750*bd5336e3SHakyeong Kim GATE(CLK_GOUT_FSYS_MMC0_IPCLKPORT_I_ACLK, "mmc0_ipclkport_i_aclk", "dout_fsys_bus300",
751*bd5336e3SHakyeong Kim CLK_CON_MMC0_IPCLKPORT_I_ACLK, 21, CLK_SET_RATE_PARENT | CLK_IS_CRITICAL, 0),
752*bd5336e3SHakyeong Kim GATE(CLK_GOUT_FSYS_MMC1_IPCLKPORT_I_ACLK, "mmc1_ipclkport_i_aclk", "dout_fsys_bus300",
753*bd5336e3SHakyeong Kim CLK_CON_MMC1_IPCLKPORT_I_ACLK, 21, CLK_SET_RATE_PARENT | CLK_IS_CRITICAL, 0),
754*bd5336e3SHakyeong Kim GATE(CLK_GOUT_FSYS_DWC_PCIE_CTL_INST_0_DBI_ACLK_UG, "dwc_pcie_ctl_inst_0_dbi_aclk_ug",
755*bd5336e3SHakyeong Kim "dout_fsys_bus300", CLK_CON_DWC_PCIE_CTL_INST_0_DBI_ACLK_UG, 21,
756*bd5336e3SHakyeong Kim CLK_SET_RATE_PARENT | CLK_IS_CRITICAL, 0),
757*bd5336e3SHakyeong Kim GATE(CLK_GOUT_FSYS_PWM_IPCLKPORT_I_PCLK_S0, "pwm_ipclkport_i_pclk_s0", "dout_fsys_bus300",
758*bd5336e3SHakyeong Kim CLK_CON_PWM_IPCLKPORT_I_PCLK_S0, 21, CLK_SET_RATE_PARENT | CLK_IS_CRITICAL, 0),
759*bd5336e3SHakyeong Kim GATE(CLK_GOUT_FSYS_USB20DRD_IPCLKPORT_ACLK_PHYCTRL_20, "usb20drd_ipclkport_aclk_phyctrl_20",
760*bd5336e3SHakyeong Kim "dout_fsys_bus300", CLK_CON_USB20DRD_IPCLKPORT_ACLK_PHYCTRL_20, 21,
761*bd5336e3SHakyeong Kim CLK_SET_RATE_PARENT | CLK_IS_CRITICAL, 0),
762*bd5336e3SHakyeong Kim GATE(CLK_GOUT_FSYS_USB20DRD_IPCLKPORT_BUS_CLK_EARLY, "usb20drd_ipclkport_bus_clk_early",
763*bd5336e3SHakyeong Kim "dout_fsys_bus300", CLK_CON_USB20DRD_IPCLKPORT_BUS_CLK_EARLY, 21,
764*bd5336e3SHakyeong Kim CLK_SET_RATE_PARENT | CLK_IS_CRITICAL, 0),
765*bd5336e3SHakyeong Kim GATE(CLK_GOUT_FSYS_XHB_AHBBR_IPCLKPORT_CLK, "xhb_ahbbr_ipclkport_clk", "dout_fsys_bus300",
766*bd5336e3SHakyeong Kim CLK_CON_XHB_AHBBR_IPCLKPORT_CLK, 21, CLK_SET_RATE_PARENT | CLK_IS_CRITICAL, 0),
767*bd5336e3SHakyeong Kim GATE(CLK_GOUT_FSYS_XHB_USB_IPCLKPORT_CLK, "xhb_usb_ipclkport_clk", "dout_fsys_bus300",
768*bd5336e3SHakyeong Kim CLK_CON_XHB_USB_IPCLKPORT_CLK, 21, CLK_SET_RATE_PARENT | CLK_IS_CRITICAL, 0),
769*bd5336e3SHakyeong Kim GATE(CLK_GOUT_FSYS_BUS_QSPI, "bus_p_fsys_ipclkport_qspiclk", "dout_fsys_bus_qspi",
770*bd5336e3SHakyeong Kim CLK_CON_BUS_P_FSYS_IPCLKPORT_QSPICLK, 21, CLK_SET_RATE_PARENT | CLK_IS_CRITICAL, 0),
771*bd5336e3SHakyeong Kim };
772*bd5336e3SHakyeong Kim
773*bd5336e3SHakyeong Kim static const struct samsung_cmu_info cmu_fsys_info __initconst = {
774*bd5336e3SHakyeong Kim .pll_clks = cmu_fsys_pll_clks,
775*bd5336e3SHakyeong Kim .nr_pll_clks = ARRAY_SIZE(cmu_fsys_pll_clks),
776*bd5336e3SHakyeong Kim .mux_clks = cmu_fsys_mux_clks,
777*bd5336e3SHakyeong Kim .nr_mux_clks = ARRAY_SIZE(cmu_fsys_mux_clks),
778*bd5336e3SHakyeong Kim .div_clks = cmu_fsys_div_clks,
779*bd5336e3SHakyeong Kim .nr_div_clks = ARRAY_SIZE(cmu_fsys_div_clks),
780*bd5336e3SHakyeong Kim .gate_clks = cmu_fsys_gate_clks,
781*bd5336e3SHakyeong Kim .nr_gate_clks = ARRAY_SIZE(cmu_fsys_gate_clks),
782*bd5336e3SHakyeong Kim .nr_clk_ids = CMU_FSYS_NR_CLK,
783*bd5336e3SHakyeong Kim .clk_regs = cmu_fsys_clk_regs,
784*bd5336e3SHakyeong Kim .nr_clk_regs = ARRAY_SIZE(cmu_fsys_clk_regs),
785*bd5336e3SHakyeong Kim };
786*bd5336e3SHakyeong Kim
787*bd5336e3SHakyeong Kim /* Register Offset definitions for CMU_IMEM (0x10010000) */
788*bd5336e3SHakyeong Kim #define PLL_CON0_MUX_CLK_IMEM_ACLK_USER 0x0100
789*bd5336e3SHakyeong Kim #define PLL_CON0_MUX_CLK_IMEM_JPEG_USER 0x0120
790*bd5336e3SHakyeong Kim #define CLK_CON_MUX_CLK_IMEM_GIC_CA53 0x1000
791*bd5336e3SHakyeong Kim #define CLK_CON_MUX_CLK_IMEM_GIC_CA5 0x1008
792*bd5336e3SHakyeong Kim #define CLK_CON_MCT_IPCLKPORT_PCLK 0x2038
793*bd5336e3SHakyeong Kim #define CLK_CON_SFRIF_TMU_IMEM_IPCLKPORT_PCLK 0x2044
794*bd5336e3SHakyeong Kim
795*bd5336e3SHakyeong Kim static const unsigned long cmu_imem_clk_regs[] __initconst = {
796*bd5336e3SHakyeong Kim PLL_CON0_MUX_CLK_IMEM_ACLK_USER,
797*bd5336e3SHakyeong Kim PLL_CON0_MUX_CLK_IMEM_JPEG_USER,
798*bd5336e3SHakyeong Kim CLK_CON_MUX_CLK_IMEM_GIC_CA53,
799*bd5336e3SHakyeong Kim CLK_CON_MUX_CLK_IMEM_GIC_CA5,
800*bd5336e3SHakyeong Kim CLK_CON_MCT_IPCLKPORT_PCLK,
801*bd5336e3SHakyeong Kim CLK_CON_SFRIF_TMU_IMEM_IPCLKPORT_PCLK,
802*bd5336e3SHakyeong Kim };
803*bd5336e3SHakyeong Kim
804*bd5336e3SHakyeong Kim PNAME(mout_imem_aclk_user_p) = { "fin_pll", "dout_clkcmu_imem_aclk" };
805*bd5336e3SHakyeong Kim PNAME(mout_imem_gic_ca53_p) = { "mout_imem_aclk_user", "fin_pll" };
806*bd5336e3SHakyeong Kim PNAME(mout_imem_gic_ca5_p) = { "mout_imem_aclk_user", "fin_pll" };
807*bd5336e3SHakyeong Kim PNAME(mout_imem_jpeg_user_p) = { "fin_pll", "dout_clkcmu_imem_jpeg" };
808*bd5336e3SHakyeong Kim
809*bd5336e3SHakyeong Kim static const struct samsung_mux_clock cmu_imem_mux_clks[] __initconst = {
810*bd5336e3SHakyeong Kim MUX(CLK_MOUT_IMEM_ACLK_USER, "mout_imem_aclk_user",
811*bd5336e3SHakyeong Kim mout_imem_aclk_user_p, PLL_CON0_MUX_CLK_IMEM_ACLK_USER, 4, 1),
812*bd5336e3SHakyeong Kim MUX(CLK_MOUT_IMEM_GIC_CA53, "mout_imem_gic_ca53",
813*bd5336e3SHakyeong Kim mout_imem_gic_ca53_p, CLK_CON_MUX_CLK_IMEM_GIC_CA53, 0, 1),
814*bd5336e3SHakyeong Kim MUX(CLK_MOUT_IMEM_GIC_CA5, "mout_imem_gic_ca5",
815*bd5336e3SHakyeong Kim mout_imem_gic_ca5_p, CLK_CON_MUX_CLK_IMEM_GIC_CA5, 0, 1),
816*bd5336e3SHakyeong Kim MUX(CLK_MOUT_IMEM_JPEG_USER, "mout_imem_jpeg_user",
817*bd5336e3SHakyeong Kim mout_imem_jpeg_user_p, PLL_CON0_MUX_CLK_IMEM_JPEG_USER, 4, 1),
818*bd5336e3SHakyeong Kim };
819*bd5336e3SHakyeong Kim
820*bd5336e3SHakyeong Kim static const struct samsung_gate_clock cmu_imem_gate_clks[] __initconst = {
821*bd5336e3SHakyeong Kim GATE(CLK_GOUT_IMEM_MCT_PCLK, "mct_pclk", "mout_imem_aclk_user",
822*bd5336e3SHakyeong Kim CLK_CON_MCT_IPCLKPORT_PCLK, 21, CLK_SET_RATE_PARENT | CLK_IS_CRITICAL, 0),
823*bd5336e3SHakyeong Kim GATE(CLK_GOUT_IMEM_PCLK_TMU0_APBIF, "sfrif_tmu_imem_ipclkport_pclk", "mout_imem_aclk_user",
824*bd5336e3SHakyeong Kim CLK_CON_SFRIF_TMU_IMEM_IPCLKPORT_PCLK, 21, CLK_SET_RATE_PARENT | CLK_IS_CRITICAL, 0),
825*bd5336e3SHakyeong Kim };
826*bd5336e3SHakyeong Kim
827*bd5336e3SHakyeong Kim static const struct samsung_cmu_info cmu_imem_info __initconst = {
828*bd5336e3SHakyeong Kim .mux_clks = cmu_imem_mux_clks,
829*bd5336e3SHakyeong Kim .nr_mux_clks = ARRAY_SIZE(cmu_imem_mux_clks),
830*bd5336e3SHakyeong Kim .gate_clks = cmu_imem_gate_clks,
831*bd5336e3SHakyeong Kim .nr_gate_clks = ARRAY_SIZE(cmu_imem_gate_clks),
832*bd5336e3SHakyeong Kim .nr_clk_ids = CMU_IMEM_NR_CLK,
833*bd5336e3SHakyeong Kim .clk_regs = cmu_imem_clk_regs,
834*bd5336e3SHakyeong Kim .nr_clk_regs = ARRAY_SIZE(cmu_imem_clk_regs),
835*bd5336e3SHakyeong Kim };
836*bd5336e3SHakyeong Kim
artpec8_clk_cmu_imem_init(struct device_node * np)837*bd5336e3SHakyeong Kim static void __init artpec8_clk_cmu_imem_init(struct device_node *np)
838*bd5336e3SHakyeong Kim {
839*bd5336e3SHakyeong Kim samsung_cmu_register_one(np, &cmu_imem_info);
840*bd5336e3SHakyeong Kim }
841*bd5336e3SHakyeong Kim
842*bd5336e3SHakyeong Kim CLK_OF_DECLARE(artpec8_clk_cmu_imem, "axis,artpec8-cmu-imem", artpec8_clk_cmu_imem_init);
843*bd5336e3SHakyeong Kim
844*bd5336e3SHakyeong Kim /* Register Offset definitions for CMU_PERI (0x16410000) */
845*bd5336e3SHakyeong Kim #define PLL_CON0_MUX_CLK_PERI_AUDIO_USER 0x0100
846*bd5336e3SHakyeong Kim #define PLL_CON0_MUX_CLK_PERI_DISP_USER 0x0120
847*bd5336e3SHakyeong Kim #define PLL_CON0_MUX_CLK_PERI_IP_USER 0x0140
848*bd5336e3SHakyeong Kim #define CLK_CON_MUX_CLK_PERI_I2S0 0x1000
849*bd5336e3SHakyeong Kim #define CLK_CON_MUX_CLK_PERI_I2S1 0x1004
850*bd5336e3SHakyeong Kim #define CLK_CON_DIV_CLK_PERI_DSIM 0x1800
851*bd5336e3SHakyeong Kim #define CLK_CON_DIV_CLK_PERI_I2S0 0x1804
852*bd5336e3SHakyeong Kim #define CLK_CON_DIV_CLK_PERI_I2S1 0x1808
853*bd5336e3SHakyeong Kim #define CLK_CON_DIV_CLK_PERI_PCLK 0x180c
854*bd5336e3SHakyeong Kim #define CLK_CON_DIV_CLK_PERI_SPI 0x1810
855*bd5336e3SHakyeong Kim #define CLK_CON_DIV_CLK_PERI_UART1 0x1814
856*bd5336e3SHakyeong Kim #define CLK_CON_DIV_CLK_PERI_UART2 0x1818
857*bd5336e3SHakyeong Kim #define CLK_CON_APB_ASYNC_DSIM_IPCLKPORT_PCLKS 0x2004
858*bd5336e3SHakyeong Kim #define CLK_CON_PERI_I2C2_IPCLKPORT_I_PCLK 0x2030
859*bd5336e3SHakyeong Kim #define CLK_CON_PERI_I2C3_IPCLKPORT_I_PCLK 0x2034
860*bd5336e3SHakyeong Kim #define CLK_CON_PERI_SPI0_IPCLKPORT_I_PCLK 0x2048
861*bd5336e3SHakyeong Kim #define CLK_CON_PERI_SPI0_IPCLKPORT_I_SCLK_SPI 0x204c
862*bd5336e3SHakyeong Kim #define CLK_CON_PERI_UART1_IPCLKPORT_I_PCLK 0x2050
863*bd5336e3SHakyeong Kim #define CLK_CON_PERI_UART1_IPCLKPORT_I_SCLK_UART 0x2054
864*bd5336e3SHakyeong Kim #define CLK_CON_PERI_UART2_IPCLKPORT_I_PCLK 0x2058
865*bd5336e3SHakyeong Kim #define CLK_CON_PERI_UART2_IPCLKPORT_I_SCLK_UART 0x205c
866*bd5336e3SHakyeong Kim #define CLK_CON_DMYQCH_CON_AUDIO_OUT_QCH 0x3000
867*bd5336e3SHakyeong Kim #define CLK_CON_DMYQCH_CON_DMA4DSIM_QCH 0x3004
868*bd5336e3SHakyeong Kim #define CLK_CON_DMYQCH_CON_PERI_I2SSC0_QCH 0x3008
869*bd5336e3SHakyeong Kim #define CLK_CON_DMYQCH_CON_PERI_I2SSC1_QCH 0x300c
870*bd5336e3SHakyeong Kim
871*bd5336e3SHakyeong Kim static const unsigned long cmu_peri_clk_regs[] __initconst = {
872*bd5336e3SHakyeong Kim PLL_CON0_MUX_CLK_PERI_AUDIO_USER,
873*bd5336e3SHakyeong Kim PLL_CON0_MUX_CLK_PERI_DISP_USER,
874*bd5336e3SHakyeong Kim PLL_CON0_MUX_CLK_PERI_IP_USER,
875*bd5336e3SHakyeong Kim CLK_CON_MUX_CLK_PERI_I2S0,
876*bd5336e3SHakyeong Kim CLK_CON_MUX_CLK_PERI_I2S1,
877*bd5336e3SHakyeong Kim CLK_CON_DIV_CLK_PERI_DSIM,
878*bd5336e3SHakyeong Kim CLK_CON_DIV_CLK_PERI_I2S0,
879*bd5336e3SHakyeong Kim CLK_CON_DIV_CLK_PERI_I2S1,
880*bd5336e3SHakyeong Kim CLK_CON_DIV_CLK_PERI_PCLK,
881*bd5336e3SHakyeong Kim CLK_CON_DIV_CLK_PERI_SPI,
882*bd5336e3SHakyeong Kim CLK_CON_DIV_CLK_PERI_UART1,
883*bd5336e3SHakyeong Kim CLK_CON_DIV_CLK_PERI_UART2,
884*bd5336e3SHakyeong Kim CLK_CON_APB_ASYNC_DSIM_IPCLKPORT_PCLKS,
885*bd5336e3SHakyeong Kim CLK_CON_PERI_I2C2_IPCLKPORT_I_PCLK,
886*bd5336e3SHakyeong Kim CLK_CON_PERI_I2C3_IPCLKPORT_I_PCLK,
887*bd5336e3SHakyeong Kim CLK_CON_PERI_SPI0_IPCLKPORT_I_PCLK,
888*bd5336e3SHakyeong Kim CLK_CON_PERI_SPI0_IPCLKPORT_I_SCLK_SPI,
889*bd5336e3SHakyeong Kim CLK_CON_PERI_UART1_IPCLKPORT_I_PCLK,
890*bd5336e3SHakyeong Kim CLK_CON_PERI_UART1_IPCLKPORT_I_SCLK_UART,
891*bd5336e3SHakyeong Kim CLK_CON_PERI_UART2_IPCLKPORT_I_PCLK,
892*bd5336e3SHakyeong Kim CLK_CON_PERI_UART2_IPCLKPORT_I_SCLK_UART,
893*bd5336e3SHakyeong Kim CLK_CON_DMYQCH_CON_AUDIO_OUT_QCH,
894*bd5336e3SHakyeong Kim CLK_CON_DMYQCH_CON_DMA4DSIM_QCH,
895*bd5336e3SHakyeong Kim CLK_CON_DMYQCH_CON_PERI_I2SSC0_QCH,
896*bd5336e3SHakyeong Kim CLK_CON_DMYQCH_CON_PERI_I2SSC1_QCH,
897*bd5336e3SHakyeong Kim };
898*bd5336e3SHakyeong Kim
899*bd5336e3SHakyeong Kim static const struct samsung_fixed_rate_clock peri_fixed_clks[] __initconst = {
900*bd5336e3SHakyeong Kim FRATE(0, "clk_peri_audio", NULL, 0, 100000000),
901*bd5336e3SHakyeong Kim };
902*bd5336e3SHakyeong Kim
903*bd5336e3SHakyeong Kim PNAME(mout_peri_ip_user_p) = { "fin_pll", "dout_clkcmu_peri_ip" };
904*bd5336e3SHakyeong Kim PNAME(mout_peri_audio_user_p) = { "fin_pll", "dout_clkcmu_peri_audio" };
905*bd5336e3SHakyeong Kim PNAME(mout_peri_disp_user_p) = { "fin_pll", "dout_clkcmu_peri_disp" };
906*bd5336e3SHakyeong Kim PNAME(mout_peri_i2s0_p) = { "dout_peri_i2s0", "clk_peri_audio" };
907*bd5336e3SHakyeong Kim PNAME(mout_peri_i2s1_p) = { "dout_peri_i2s1", "clk_peri_audio" };
908*bd5336e3SHakyeong Kim
909*bd5336e3SHakyeong Kim static const struct samsung_mux_clock cmu_peri_mux_clks[] __initconst = {
910*bd5336e3SHakyeong Kim MUX(CLK_MOUT_PERI_IP_USER, "mout_peri_ip_user", mout_peri_ip_user_p,
911*bd5336e3SHakyeong Kim PLL_CON0_MUX_CLK_PERI_IP_USER, 4, 1),
912*bd5336e3SHakyeong Kim MUX(CLK_MOUT_PERI_AUDIO_USER, "mout_peri_audio_user",
913*bd5336e3SHakyeong Kim mout_peri_audio_user_p, PLL_CON0_MUX_CLK_PERI_AUDIO_USER, 4, 1),
914*bd5336e3SHakyeong Kim MUX(CLK_MOUT_PERI_DISP_USER, "mout_peri_disp_user", mout_peri_disp_user_p,
915*bd5336e3SHakyeong Kim PLL_CON0_MUX_CLK_PERI_DISP_USER, 4, 1),
916*bd5336e3SHakyeong Kim MUX(CLK_MOUT_PERI_I2S0, "mout_peri_i2s0", mout_peri_i2s0_p,
917*bd5336e3SHakyeong Kim CLK_CON_MUX_CLK_PERI_I2S0, 0, 1),
918*bd5336e3SHakyeong Kim MUX(CLK_MOUT_PERI_I2S1, "mout_peri_i2s1", mout_peri_i2s1_p,
919*bd5336e3SHakyeong Kim CLK_CON_MUX_CLK_PERI_I2S1, 0, 1),
920*bd5336e3SHakyeong Kim };
921*bd5336e3SHakyeong Kim
922*bd5336e3SHakyeong Kim static const struct samsung_div_clock cmu_peri_div_clks[] __initconst = {
923*bd5336e3SHakyeong Kim DIV(CLK_DOUT_PERI_SPI, "dout_peri_spi", "mout_peri_ip_user",
924*bd5336e3SHakyeong Kim CLK_CON_DIV_CLK_PERI_SPI, 0, 10),
925*bd5336e3SHakyeong Kim DIV(CLK_DOUT_PERI_UART1, "dout_peri_uart1", "mout_peri_ip_user",
926*bd5336e3SHakyeong Kim CLK_CON_DIV_CLK_PERI_UART1, 0, 10),
927*bd5336e3SHakyeong Kim DIV(CLK_DOUT_PERI_UART2, "dout_peri_uart2", "mout_peri_ip_user",
928*bd5336e3SHakyeong Kim CLK_CON_DIV_CLK_PERI_UART2, 0, 10),
929*bd5336e3SHakyeong Kim DIV(CLK_DOUT_PERI_PCLK, "dout_peri_pclk", "mout_peri_ip_user",
930*bd5336e3SHakyeong Kim CLK_CON_DIV_CLK_PERI_PCLK, 0, 4),
931*bd5336e3SHakyeong Kim DIV(CLK_DOUT_PERI_I2S0, "dout_peri_i2s0", "mout_peri_audio_user",
932*bd5336e3SHakyeong Kim CLK_CON_DIV_CLK_PERI_I2S0, 0, 4),
933*bd5336e3SHakyeong Kim DIV(CLK_DOUT_PERI_I2S1, "dout_peri_i2s1", "mout_peri_audio_user",
934*bd5336e3SHakyeong Kim CLK_CON_DIV_CLK_PERI_I2S1, 0, 4),
935*bd5336e3SHakyeong Kim DIV(CLK_DOUT_PERI_DSIM, "dout_peri_dsim", "mout_peri_disp_user",
936*bd5336e3SHakyeong Kim CLK_CON_DIV_CLK_PERI_DSIM, 0, 4),
937*bd5336e3SHakyeong Kim };
938*bd5336e3SHakyeong Kim
939*bd5336e3SHakyeong Kim static const struct samsung_gate_clock cmu_peri_gate_clks[] __initconst = {
940*bd5336e3SHakyeong Kim GATE(CLK_GOUT_PERI_DMA4DSIM_IPCLKPORT_CLK_APB_CLK, "dma4dsim_ipclkport_clk_apb_clk",
941*bd5336e3SHakyeong Kim "dout_peri_pclk", CLK_CON_DMYQCH_CON_DMA4DSIM_QCH, 1, CLK_SET_RATE_PARENT, 0),
942*bd5336e3SHakyeong Kim GATE(CLK_GOUT_PERI_I2SSC0_IPCLKPORT_CLK_HST, "i2ssc0_ipclkport_clk_hst", "dout_peri_pclk",
943*bd5336e3SHakyeong Kim CLK_CON_DMYQCH_CON_PERI_I2SSC0_QCH, 1, CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED, 0),
944*bd5336e3SHakyeong Kim GATE(CLK_GOUT_PERI_I2SSC1_IPCLKPORT_CLK_HST, "i2ssc1_ipclkport_clk_hst", "dout_peri_pclk",
945*bd5336e3SHakyeong Kim CLK_CON_DMYQCH_CON_PERI_I2SSC1_QCH, 1, CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED, 0),
946*bd5336e3SHakyeong Kim GATE(CLK_GOUT_PERI_AUDIO_OUT_IPCLKPORT_CLK, "audio_out_ipclkport_clk",
947*bd5336e3SHakyeong Kim "mout_peri_audio_user", CLK_CON_DMYQCH_CON_AUDIO_OUT_QCH, 1, CLK_SET_RATE_PARENT, 0),
948*bd5336e3SHakyeong Kim GATE(CLK_GOUT_PERI_I2SSC0_IPCLKPORT_CLK, "peri_i2ssc0_ipclkport_clk", "mout_peri_i2s0",
949*bd5336e3SHakyeong Kim CLK_CON_DMYQCH_CON_PERI_I2SSC0_QCH, 1, CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED, 0),
950*bd5336e3SHakyeong Kim GATE(CLK_GOUT_PERI_I2SSC1_IPCLKPORT_CLK, "peri_i2ssc1_ipclkport_clk", "mout_peri_i2s1",
951*bd5336e3SHakyeong Kim CLK_CON_DMYQCH_CON_PERI_I2SSC1_QCH, 1, CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED, 0),
952*bd5336e3SHakyeong Kim GATE(CLK_GOUT_PERI_DMA4DSIM_IPCLKPORT_CLK_AXI_CLK, "dma4dsim_ipclkport_clk_axi_clk",
953*bd5336e3SHakyeong Kim "mout_peri_disp_user", CLK_CON_DMYQCH_CON_DMA4DSIM_QCH, 1, CLK_SET_RATE_PARENT, 0),
954*bd5336e3SHakyeong Kim GATE(CLK_GOUT_PERI_SPI0_SCLK_SPI, "peri_spi0_ipclkport_i_sclk_spi", "dout_peri_spi",
955*bd5336e3SHakyeong Kim CLK_CON_PERI_SPI0_IPCLKPORT_I_SCLK_SPI, 21, CLK_SET_RATE_PARENT | CLK_IS_CRITICAL, 0),
956*bd5336e3SHakyeong Kim GATE(CLK_GOUT_PERI_UART1_SCLK_UART, "uart1_sclk", "dout_peri_uart1",
957*bd5336e3SHakyeong Kim CLK_CON_PERI_UART1_IPCLKPORT_I_SCLK_UART, 21,
958*bd5336e3SHakyeong Kim CLK_SET_RATE_PARENT | CLK_IS_CRITICAL, 0),
959*bd5336e3SHakyeong Kim GATE(CLK_GOUT_PERI_UART2_SCLK_UART, "uart2_sclk", "dout_peri_uart2",
960*bd5336e3SHakyeong Kim CLK_CON_PERI_UART2_IPCLKPORT_I_SCLK_UART, 21,
961*bd5336e3SHakyeong Kim CLK_SET_RATE_PARENT | CLK_IS_CRITICAL, 0),
962*bd5336e3SHakyeong Kim GATE(CLK_GOUT_PERI_APB_ASYNC_DSIM_IPCLKPORT_PCLKS, "apb_async_dsim_ipclkport_pclks",
963*bd5336e3SHakyeong Kim "dout_peri_pclk", CLK_CON_APB_ASYNC_DSIM_IPCLKPORT_PCLKS, 21,
964*bd5336e3SHakyeong Kim CLK_SET_RATE_PARENT | CLK_IS_CRITICAL, 0),
965*bd5336e3SHakyeong Kim GATE(CLK_GOUT_PERI_I2C2_IPCLKPORT_I_PCLK, "peri_i2c2_ipclkport_i_pclk", "dout_peri_pclk",
966*bd5336e3SHakyeong Kim CLK_CON_PERI_I2C2_IPCLKPORT_I_PCLK, 21, CLK_SET_RATE_PARENT | CLK_IS_CRITICAL, 0),
967*bd5336e3SHakyeong Kim GATE(CLK_GOUT_PERI_I2C3_IPCLKPORT_I_PCLK, "peri_i2c3_ipclkport_i_pclk", "dout_peri_pclk",
968*bd5336e3SHakyeong Kim CLK_CON_PERI_I2C3_IPCLKPORT_I_PCLK, 21, CLK_SET_RATE_PARENT | CLK_IS_CRITICAL, 0),
969*bd5336e3SHakyeong Kim GATE(CLK_GOUT_PERI_SPI0_PCLK, "peri_spi0_ipclkport_i_pclk", "dout_peri_pclk",
970*bd5336e3SHakyeong Kim CLK_CON_PERI_SPI0_IPCLKPORT_I_PCLK, 21, CLK_SET_RATE_PARENT | CLK_IS_CRITICAL, 0),
971*bd5336e3SHakyeong Kim GATE(CLK_GOUT_PERI_UART1_PCLK, "uart1_pclk", "dout_peri_pclk",
972*bd5336e3SHakyeong Kim CLK_CON_PERI_UART1_IPCLKPORT_I_PCLK, 21, CLK_SET_RATE_PARENT | CLK_IS_CRITICAL, 0),
973*bd5336e3SHakyeong Kim GATE(CLK_GOUT_PERI_UART2_PCLK, "uart2_pclk", "dout_peri_pclk",
974*bd5336e3SHakyeong Kim CLK_CON_PERI_UART2_IPCLKPORT_I_PCLK, 21, CLK_SET_RATE_PARENT | CLK_IS_CRITICAL, 0),
975*bd5336e3SHakyeong Kim };
976*bd5336e3SHakyeong Kim
977*bd5336e3SHakyeong Kim static const struct samsung_cmu_info cmu_peri_info __initconst = {
978*bd5336e3SHakyeong Kim .mux_clks = cmu_peri_mux_clks,
979*bd5336e3SHakyeong Kim .nr_mux_clks = ARRAY_SIZE(cmu_peri_mux_clks),
980*bd5336e3SHakyeong Kim .div_clks = cmu_peri_div_clks,
981*bd5336e3SHakyeong Kim .nr_div_clks = ARRAY_SIZE(cmu_peri_div_clks),
982*bd5336e3SHakyeong Kim .gate_clks = cmu_peri_gate_clks,
983*bd5336e3SHakyeong Kim .nr_gate_clks = ARRAY_SIZE(cmu_peri_gate_clks),
984*bd5336e3SHakyeong Kim .fixed_clks = peri_fixed_clks,
985*bd5336e3SHakyeong Kim .nr_fixed_clks = ARRAY_SIZE(peri_fixed_clks),
986*bd5336e3SHakyeong Kim .nr_clk_ids = CMU_PERI_NR_CLK,
987*bd5336e3SHakyeong Kim .clk_regs = cmu_peri_clk_regs,
988*bd5336e3SHakyeong Kim .nr_clk_regs = ARRAY_SIZE(cmu_peri_clk_regs),
989*bd5336e3SHakyeong Kim };
990*bd5336e3SHakyeong Kim
991*bd5336e3SHakyeong Kim /**
992*bd5336e3SHakyeong Kim * artpec8_cmu_probe - Probe function for ARTPEC platform clocks
993*bd5336e3SHakyeong Kim * @pdev: Pointer to platform device
994*bd5336e3SHakyeong Kim *
995*bd5336e3SHakyeong Kim * Configure clock hierarchy for clock domains of ARTPEC platform
996*bd5336e3SHakyeong Kim */
artpec8_cmu_probe(struct platform_device * pdev)997*bd5336e3SHakyeong Kim static int __init artpec8_cmu_probe(struct platform_device *pdev)
998*bd5336e3SHakyeong Kim {
999*bd5336e3SHakyeong Kim const struct samsung_cmu_info *info;
1000*bd5336e3SHakyeong Kim struct device *dev = &pdev->dev;
1001*bd5336e3SHakyeong Kim
1002*bd5336e3SHakyeong Kim info = of_device_get_match_data(dev);
1003*bd5336e3SHakyeong Kim exynos_arm64_register_cmu(dev, dev->of_node, info);
1004*bd5336e3SHakyeong Kim
1005*bd5336e3SHakyeong Kim return 0;
1006*bd5336e3SHakyeong Kim }
1007*bd5336e3SHakyeong Kim
1008*bd5336e3SHakyeong Kim static const struct of_device_id artpec8_cmu_of_match[] = {
1009*bd5336e3SHakyeong Kim {
1010*bd5336e3SHakyeong Kim .compatible = "axis,artpec8-cmu-cmu",
1011*bd5336e3SHakyeong Kim .data = &cmu_cmu_info,
1012*bd5336e3SHakyeong Kim }, {
1013*bd5336e3SHakyeong Kim .compatible = "axis,artpec8-cmu-bus",
1014*bd5336e3SHakyeong Kim .data = &cmu_bus_info,
1015*bd5336e3SHakyeong Kim }, {
1016*bd5336e3SHakyeong Kim .compatible = "axis,artpec8-cmu-core",
1017*bd5336e3SHakyeong Kim .data = &cmu_core_info,
1018*bd5336e3SHakyeong Kim }, {
1019*bd5336e3SHakyeong Kim .compatible = "axis,artpec8-cmu-cpucl",
1020*bd5336e3SHakyeong Kim .data = &cmu_cpucl_info,
1021*bd5336e3SHakyeong Kim }, {
1022*bd5336e3SHakyeong Kim .compatible = "axis,artpec8-cmu-fsys",
1023*bd5336e3SHakyeong Kim .data = &cmu_fsys_info,
1024*bd5336e3SHakyeong Kim }, {
1025*bd5336e3SHakyeong Kim .compatible = "axis,artpec8-cmu-peri",
1026*bd5336e3SHakyeong Kim .data = &cmu_peri_info,
1027*bd5336e3SHakyeong Kim }, {
1028*bd5336e3SHakyeong Kim },
1029*bd5336e3SHakyeong Kim };
1030*bd5336e3SHakyeong Kim
1031*bd5336e3SHakyeong Kim static struct platform_driver artpec8_cmu_driver __refdata = {
1032*bd5336e3SHakyeong Kim .driver = {
1033*bd5336e3SHakyeong Kim .name = "artpec8-cmu",
1034*bd5336e3SHakyeong Kim .of_match_table = artpec8_cmu_of_match,
1035*bd5336e3SHakyeong Kim .suppress_bind_attrs = true,
1036*bd5336e3SHakyeong Kim },
1037*bd5336e3SHakyeong Kim .probe = artpec8_cmu_probe,
1038*bd5336e3SHakyeong Kim };
1039*bd5336e3SHakyeong Kim
artpec8_cmu_init(void)1040*bd5336e3SHakyeong Kim static int __init artpec8_cmu_init(void)
1041*bd5336e3SHakyeong Kim {
1042*bd5336e3SHakyeong Kim return platform_driver_register(&artpec8_cmu_driver);
1043*bd5336e3SHakyeong Kim }
1044*bd5336e3SHakyeong Kim core_initcall(artpec8_cmu_init);
1045