blob: a4507e5fdd77b04ccba250b7b0c35416bc3ac664 [file] [log] [blame]
Jagan Teki9c9aab12023-01-30 20:27:33 +05301/* SPDX-License-Identifier: GPL-2.0 */
2/*
3 * Copyright (c) 2020 Rockchip Electronics Co. Ltd.
4 * Author: Elaine Zhang <zhangqing@rock-chips.com>
5 */
6
7#ifndef _ASM_ARCH_CRU_RK3588_H
8#define _ASM_ARCH_CRU_RK3588_H
9
10#define MHz 1000000
11#define KHz 1000
12#define OSC_HZ (24 * MHz)
13
Jagan Teki9c9aab12023-01-30 20:27:33 +053014#define LPLL_HZ (816 * MHz)
15#define GPLL_HZ (1188 * MHz)
16#define CPLL_HZ (1500 * MHz)
17#define NPLL_HZ (850 * MHz)
18#define PPLL_HZ (1100 * MHz)
Jonas Karlmanb4505902023-04-17 19:07:20 +000019#define SPLL_HZ (702 * MHz)
Jagan Teki9c9aab12023-01-30 20:27:33 +053020
21/* RK3588 pll id */
22enum rk3588_pll_id {
23 B0PLL,
24 B1PLL,
25 LPLL,
26 CPLL,
27 GPLL,
28 NPLL,
29 V0PLL,
30 AUPLL,
31 PPLL,
32 PLL_COUNT,
33};
34
35struct rk3588_clk_info {
36 unsigned long id;
37 char *name;
38 bool is_cru;
39};
40
41struct rk3588_clk_priv {
42 struct rk3588_cru *cru;
43 struct rk3588_grf *grf;
44 ulong ppll_hz;
45 ulong gpll_hz;
46 ulong cpll_hz;
47 ulong npll_hz;
48 ulong v0pll_hz;
49 ulong aupll_hz;
50 ulong armclk_hz;
51 ulong armclk_enter_hz;
52 ulong armclk_init_hz;
53 bool sync_kernel;
54 bool set_armclk_rate;
55};
56
57struct rk3588_pll {
58 unsigned int con0;
59 unsigned int con1;
60 unsigned int con2;
61 unsigned int con3;
62 unsigned int con4;
63 unsigned int reserved0[3];
64};
65
Quentin Schulz29e289c2024-03-11 13:01:55 +010066#define CRU_BASE 0xfd7c0000
67
Jagan Teki9c9aab12023-01-30 20:27:33 +053068struct rk3588_cru {
69 struct rk3588_pll pll[18];
70 unsigned int reserved0[16];/* Address Offset: 0x0240 */
71 unsigned int mode_con00;/* Address Offset: 0x0280 */
72 unsigned int reserved1[31];/* Address Offset: 0x0284 */
73 unsigned int clksel_con[178]; /* Address Offset: 0x0300 */
74 unsigned int reserved2[142];/* Address Offset: 0x05c8 */
75 unsigned int clkgate_con[78];/* Address Offset: 0x0800 */
76 unsigned int reserved3[50];/* Address Offset: 0x0938 */
77 unsigned int softrst_con[78];/* Address Offset: 0x0400 */
78 unsigned int reserved4[50];/* Address Offset: 0x0b38 */
79 unsigned int glb_cnt_th;/* Address Offset: 0x0c00 */
80 unsigned int glb_rst_st;/* Address Offset: 0x0c04 */
81 unsigned int glb_srst_fst;/* Address Offset: 0x0c08 */
82 unsigned int glb_srsr_snd; /* Address Offset: 0x0c0c */
83 unsigned int glb_rst_con;/* Address Offset: 0x0c10 */
84 unsigned int reserved5[4];/* Address Offset: 0x0c14 */
85 unsigned int sdio_con[2];/* Address Offset: 0x0c24 */
86 unsigned int reserved7;/* Address Offset: 0x0c2c */
87 unsigned int sdmmc_con[2];/* Address Offset: 0x0c30 */
88 unsigned int reserved8[48562];/* Address Offset: 0x0c38 */
89 unsigned int pmuclksel_con[21]; /* Address Offset: 0x0100 */
90 unsigned int reserved9[299];/* Address Offset: 0x0c38 */
91 unsigned int pmuclkgate_con[9]; /* Address Offset: 0x0100 */
92};
93
94check_member(rk3588_cru, mode_con00, 0x280);
95check_member(rk3588_cru, pmuclksel_con[1], 0x30304);
96
97struct pll_rate_table {
98 unsigned long rate;
99 unsigned int m;
100 unsigned int p;
101 unsigned int s;
102 unsigned int k;
103};
104
105#define RK3588_PLL_CON(x) ((x) * 0x4)
106#define RK3588_MODE_CON 0x280
107
108#define RK3588_PHP_CRU_BASE 0x8000
109#define RK3588_PMU_CRU_BASE 0x30000
110#define RK3588_BIGCORE0_CRU_BASE 0x50000
111#define RK3588_BIGCORE1_CRU_BASE 0x52000
112#define RK3588_DSU_CRU_BASE 0x58000
113
114#define RK3588_PLL_CON(x) ((x) * 0x4)
115#define RK3588_MODE_CON0 0x280
116#define RK3588_CLKSEL_CON(x) ((x) * 0x4 + 0x300)
117#define RK3588_CLKGATE_CON(x) ((x) * 0x4 + 0x800)
118#define RK3588_SOFTRST_CON(x) ((x) * 0x4 + 0xa00)
119#define RK3588_GLB_CNT_TH 0xc00
120#define RK3588_GLB_SRST_FST 0xc08
121#define RK3588_GLB_SRST_SND 0xc0c
122#define RK3588_GLB_RST_CON 0xc10
123#define RK3588_GLB_RST_ST 0xc04
124#define RK3588_SDIO_CON0 0xC24
125#define RK3588_SDIO_CON1 0xC28
126#define RK3588_SDMMC_CON0 0xC30
127#define RK3588_SDMMC_CON1 0xC34
128
129#define RK3588_PHP_CLKGATE_CON(x) ((x) * 0x4 + RK3588_PHP_CRU_BASE + 0x800)
130#define RK3588_PHP_SOFTRST_CON(x) ((x) * 0x4 + RK3588_PHP_CRU_BASE + 0xa00)
131
132#define RK3588_PMU_PLL_CON(x) ((x) * 0x4 + RK3588_PHP_CRU_BASE)
133#define RK3588_PMU_CLKSEL_CON(x) ((x) * 0x4 + RK3588_PMU_CRU_BASE + 0x300)
134#define RK3588_PMU_CLKGATE_CON(x) ((x) * 0x4 + RK3588_PMU_CRU_BASE + 0x800)
135#define RK3588_PMU_SOFTRST_CON(x) ((x) * 0x4 + RK3588_PMU_CRU_BASE + 0xa00)
136
137#define RK3588_B0_PLL_CON(x) ((x) * 0x4 + RK3588_BIGCORE0_CRU_BASE)
138#define RK3588_B0_PLL_MODE_CON (RK3588_BIGCORE0_CRU_BASE + 0x280)
139#define RK3588_BIGCORE0_CLKSEL_CON(x) ((x) * 0x4 + RK3588_BIGCORE0_CRU_BASE + 0x300)
140#define RK3588_BIGCORE0_CLKGATE_CON(x) ((x) * 0x4 + RK3588_BIGCORE0_CRU_BASE + 0x800)
141#define RK3588_BIGCORE0_SOFTRST_CON(x) ((x) * 0x4 + RK3588_BIGCORE0_CRU_BASE + 0xa00)
142#define RK3588_B1_PLL_CON(x) ((x) * 0x4 + RK3588_BIGCORE1_CRU_BASE)
143#define RK3588_B1_PLL_MODE_CON (RK3588_BIGCORE1_CRU_BASE + 0x280)
144#define RK3588_BIGCORE1_CLKSEL_CON(x) ((x) * 0x4 + RK3588_BIGCORE1_CRU_BASE + 0x300)
145#define RK3588_BIGCORE1_CLKGATE_CON(x) ((x) * 0x4 + RK3588_BIGCORE1_CRU_BASE + 0x800)
146#define RK3588_BIGCORE1_SOFTRST_CON(x) ((x) * 0x4 + RK3588_BIGCORE1_CRU_BASE + 0xa00)
147#define RK3588_LPLL_CON(x) ((x) * 0x4 + RK3588_DSU_CRU_BASE)
148#define RK3588_LPLL_MODE_CON (RK3588_DSU_CRU_BASE + 0x280)
149#define RK3588_DSU_CLKSEL_CON(x) ((x) * 0x4 + RK3588_DSU_CRU_BASE + 0x300)
150#define RK3588_DSU_CLKGATE_CON(x) ((x) * 0x4 + RK3588_DSU_CRU_BASE + 0x800)
151#define RK3588_DSU_SOFTRST_CON(x) ((x) * 0x4 + RK3588_DSU_CRU_BASE + 0xa00)
152
153enum {
154 /* CRU_CLK_SEL8_CON */
155 ACLK_LOW_TOP_ROOT_SRC_SEL_SHIFT = 14,
156 ACLK_LOW_TOP_ROOT_SRC_SEL_MASK = 1 << ACLK_LOW_TOP_ROOT_SRC_SEL_SHIFT,
157 ACLK_LOW_TOP_ROOT_SRC_SEL_GPLL = 0,
158 ACLK_LOW_TOP_ROOT_SRC_SEL_CPLL,
159 ACLK_LOW_TOP_ROOT_DIV_SHIFT = 9,
160 ACLK_LOW_TOP_ROOT_DIV_MASK = 0x1f << ACLK_LOW_TOP_ROOT_DIV_SHIFT,
161 PCLK_TOP_ROOT_SEL_SHIFT = 7,
162 PCLK_TOP_ROOT_SEL_MASK = 3 << PCLK_TOP_ROOT_SEL_SHIFT,
163 PCLK_TOP_ROOT_SEL_100M = 0,
164 PCLK_TOP_ROOT_SEL_50M,
165 PCLK_TOP_ROOT_SEL_24M,
166 ACLK_TOP_ROOT_SRC_SEL_SHIFT = 5,
167 ACLK_TOP_ROOT_SRC_SEL_MASK = 3 << ACLK_TOP_ROOT_SRC_SEL_SHIFT,
168 ACLK_TOP_ROOT_SRC_SEL_GPLL = 0,
169 ACLK_TOP_ROOT_SRC_SEL_CPLL,
170 ACLK_TOP_ROOT_SRC_SEL_AUPLL,
171 ACLK_TOP_ROOT_DIV_SHIFT = 0,
172 ACLK_TOP_ROOT_DIV_MASK = 0x1f << ACLK_TOP_ROOT_DIV_SHIFT,
173
174 /* CRU_CLK_SEL9_CON */
175 ACLK_TOP_S400_SEL_SHIFT = 8,
176 ACLK_TOP_S400_SEL_MASK = 3 << ACLK_TOP_S400_SEL_SHIFT,
177 ACLK_TOP_S400_SEL_400M = 0,
178 ACLK_TOP_S400_SEL_200M,
179 ACLK_TOP_S200_SEL_SHIFT = 6,
180 ACLK_TOP_S200_SEL_MASK = 3 << ACLK_TOP_S200_SEL_SHIFT,
181 ACLK_TOP_S200_SEL_200M = 0,
182 ACLK_TOP_S200_SEL_100M,
183
184 /* CRU_CLK_SEL38_CON */
185 CLK_I2C8_SEL_SHIFT = 13,
186 CLK_I2C8_SEL_MASK = 1 << CLK_I2C8_SEL_SHIFT,
187 CLK_I2C7_SEL_SHIFT = 12,
188 CLK_I2C7_SEL_MASK = 1 << CLK_I2C7_SEL_SHIFT,
189 CLK_I2C6_SEL_SHIFT = 11,
190 CLK_I2C6_SEL_MASK = 1 << CLK_I2C6_SEL_SHIFT,
191 CLK_I2C5_SEL_SHIFT = 10,
192 CLK_I2C5_SEL_MASK = 1 << CLK_I2C5_SEL_SHIFT,
193 CLK_I2C4_SEL_SHIFT = 9,
194 CLK_I2C4_SEL_MASK = 1 << CLK_I2C4_SEL_SHIFT,
195 CLK_I2C3_SEL_SHIFT = 8,
196 CLK_I2C3_SEL_MASK = 1 << CLK_I2C3_SEL_SHIFT,
197 CLK_I2C2_SEL_SHIFT = 7,
198 CLK_I2C2_SEL_MASK = 1 << CLK_I2C2_SEL_SHIFT,
199 CLK_I2C1_SEL_SHIFT = 6,
200 CLK_I2C1_SEL_MASK = 1 << CLK_I2C1_SEL_SHIFT,
201 ACLK_BUS_ROOT_SEL_SHIFT = 5,
202 ACLK_BUS_ROOT_SEL_MASK = 3 << ACLK_BUS_ROOT_SEL_SHIFT,
203 ACLK_BUS_ROOT_SEL_GPLL = 0,
204 ACLK_BUS_ROOT_SEL_CPLL,
205 ACLK_BUS_ROOT_DIV_SHIFT = 0,
206 ACLK_BUS_ROOT_DIV_MASK = 0x1f << ACLK_BUS_ROOT_DIV_SHIFT,
207
208 /* CRU_CLK_SEL40_CON */
209 CLK_SARADC_SEL_SHIFT = 14,
210 CLK_SARADC_SEL_MASK = 0x1 << CLK_SARADC_SEL_SHIFT,
211 CLK_SARADC_SEL_GPLL = 0,
212 CLK_SARADC_SEL_24M,
213 CLK_SARADC_DIV_SHIFT = 6,
214 CLK_SARADC_DIV_MASK = 0xff << CLK_SARADC_DIV_SHIFT,
215
216 /* CRU_CLK_SEL41_CON */
217 CLK_UART_SRC_SEL_SHIFT = 14,
218 CLK_UART_SRC_SEL_MASK = 0x1 << CLK_UART_SRC_SEL_SHIFT,
219 CLK_UART_SRC_SEL_GPLL = 0,
220 CLK_UART_SRC_SEL_CPLL,
221 CLK_UART_SRC_DIV_SHIFT = 9,
222 CLK_UART_SRC_DIV_MASK = 0x1f << CLK_UART_SRC_DIV_SHIFT,
223 CLK_TSADC_SEL_SHIFT = 8,
224 CLK_TSADC_SEL_MASK = 0x1 << CLK_TSADC_SEL_SHIFT,
225 CLK_TSADC_SEL_GPLL = 0,
226 CLK_TSADC_SEL_24M,
227 CLK_TSADC_DIV_SHIFT = 0,
228 CLK_TSADC_DIV_MASK = 0xff << CLK_TSADC_DIV_SHIFT,
229
230 /* CRU_CLK_SEL42_CON */
231 CLK_UART_FRAC_NUMERATOR_SHIFT = 16,
232 CLK_UART_FRAC_NUMERATOR_MASK = 0xffff << 16,
233 CLK_UART_FRAC_DENOMINATOR_SHIFT = 0,
234 CLK_UART_FRAC_DENOMINATOR_MASK = 0xffff,
235
236 /* CRU_CLK_SEL43_CON */
237 CLK_UART_SEL_SHIFT = 0,
238 CLK_UART_SEL_MASK = 0x3 << CLK_UART_SEL_SHIFT,
239 CLK_UART_SEL_SRC = 0,
240 CLK_UART_SEL_FRAC,
241 CLK_UART_SEL_XIN24M,
242
243 /* CRU_CLK_SEL59_CON */
244 CLK_PWM2_SEL_SHIFT = 14,
245 CLK_PWM2_SEL_MASK = 3 << CLK_PWM2_SEL_SHIFT,
246 CLK_PWM1_SEL_SHIFT = 12,
247 CLK_PWM1_SEL_MASK = 3 << CLK_PWM1_SEL_SHIFT,
248 CLK_SPI4_SEL_SHIFT = 10,
249 CLK_SPI4_SEL_MASK = 3 << CLK_SPI4_SEL_SHIFT,
250 CLK_SPI3_SEL_SHIFT = 8,
251 CLK_SPI3_SEL_MASK = 3 << CLK_SPI3_SEL_SHIFT,
252 CLK_SPI2_SEL_SHIFT = 6,
253 CLK_SPI2_SEL_MASK = 3 << CLK_SPI2_SEL_SHIFT,
254 CLK_SPI1_SEL_SHIFT = 4,
255 CLK_SPI1_SEL_MASK = 3 << CLK_SPI1_SEL_SHIFT,
256 CLK_SPI0_SEL_SHIFT = 2,
257 CLK_SPI0_SEL_MASK = 3 << CLK_SPI0_SEL_SHIFT,
258 CLK_SPI_SEL_200M = 0,
259 CLK_SPI_SEL_150M,
260 CLK_SPI_SEL_24M,
261
262 /* CRU_CLK_SEL60_CON */
263 CLK_PWM3_SEL_SHIFT = 0,
264 CLK_PWM3_SEL_MASK = 3 << CLK_PWM3_SEL_SHIFT,
265 CLK_PWM_SEL_100M = 0,
266 CLK_PWM_SEL_50M,
267 CLK_PWM_SEL_24M,
268
269 /* CRU_CLK_SEL62_CON */
270 DCLK_DECOM_SEL_SHIFT = 5,
271 DCLK_DECOM_SEL_MASK = 1 << DCLK_DECOM_SEL_SHIFT,
272 DCLK_DECOM_SEL_GPLL = 0,
273 DCLK_DECOM_SEL_SPLL,
274 DCLK_DECOM_DIV_SHIFT = 0,
275 DCLK_DECOM_DIV_MASK = 0x1F << DCLK_DECOM_DIV_SHIFT,
276
277 /* CRU_CLK_SEL77_CON */
278 CCLK_EMMC_SEL_SHIFT = 14,
279 CCLK_EMMC_SEL_MASK = 3 << CCLK_EMMC_SEL_SHIFT,
280 CCLK_EMMC_SEL_GPLL = 0,
281 CCLK_EMMC_SEL_CPLL,
282 CCLK_EMMC_SEL_24M,
283 CCLK_EMMC_DIV_SHIFT = 8,
284 CCLK_EMMC_DIV_MASK = 0x3f << CCLK_EMMC_DIV_SHIFT,
285
286 /* CRU_CLK_SEL78_CON */
287 SCLK_SFC_SEL_SHIFT = 12,
288 SCLK_SFC_SEL_MASK = 3 << SCLK_SFC_SEL_SHIFT,
289 SCLK_SFC_SEL_GPLL = 0,
290 SCLK_SFC_SEL_CPLL,
291 SCLK_SFC_SEL_24M,
292 SCLK_SFC_DIV_SHIFT = 6,
293 SCLK_SFC_DIV_MASK = 0x3f << SCLK_SFC_DIV_SHIFT,
294 BCLK_EMMC_SEL_SHIFT = 5,
295 BCLK_EMMC_SEL_MASK = 1 << BCLK_EMMC_SEL_SHIFT,
296 BCLK_EMMC_SEL_GPLL = 0,
297 BCLK_EMMC_SEL_CPLL,
298 BCLK_EMMC_DIV_SHIFT = 0,
299 BCLK_EMMC_DIV_MASK = 0x1f << BCLK_EMMC_DIV_SHIFT,
300
301 /* CRU_CLK_SEL81_CON */
302 CLK_GMAC1_PTP_SEL_SHIFT = 13,
303 CLK_GMAC1_PTP_SEL_MASK = 1 << CLK_GMAC1_PTP_SEL_SHIFT,
304 CLK_GMAC1_PTP_SEL_CPLL = 0,
305 CLK_GMAC1_PTP_DIV_SHIFT = 7,
306 CLK_GMAC1_PTP_DIV_MASK = 0x3f << CLK_GMAC1_PTP_DIV_SHIFT,
307 CLK_GMAC0_PTP_SEL_SHIFT = 6,
308 CLK_GMAC0_PTP_SEL_MASK = 1 << CLK_GMAC0_PTP_SEL_SHIFT,
309 CLK_GMAC0_PTP_SEL_CPLL = 0,
310 CLK_GMAC0_PTP_DIV_SHIFT = 0,
311 CLK_GMAC0_PTP_DIV_MASK = 0x3f << CLK_GMAC0_PTP_DIV_SHIFT,
312
313 /* CRU_CLK_SEL83_CON */
314 CLK_GMAC_125M_SEL_SHIFT = 15,
315 CLK_GMAC_125M_SEL_MASK = 1 << CLK_GMAC_125M_SEL_SHIFT,
316 CLK_GMAC_125M_SEL_GPLL = 0,
317 CLK_GMAC_125M_SEL_CPLL,
318 CLK_GMAC_125M_DIV_SHIFT = 8,
319 CLK_GMAC_125M_DIV_MASK = 0x7f << CLK_GMAC_125M_DIV_SHIFT,
320
321 /* CRU_CLK_SEL84_CON */
322 CLK_GMAC_50M_SEL_SHIFT = 7,
323 CLK_GMAC_50M_SEL_MASK = 1 << CLK_GMAC_50M_SEL_SHIFT,
324 CLK_GMAC_50M_SEL_GPLL = 0,
325 CLK_GMAC_50M_SEL_CPLL,
326 CLK_GMAC_50M_DIV_SHIFT = 0,
327 CLK_GMAC_50M_DIV_MASK = 0x7f << CLK_GMAC_50M_DIV_SHIFT,
328
329 /* CRU_CLK_SEL110_CON */
330 HCLK_VOP_ROOT_SEL_SHIFT = 10,
331 HCLK_VOP_ROOT_SEL_MASK = 3 << HCLK_VOP_ROOT_SEL_SHIFT,
332 HCLK_VOP_ROOT_SEL_200M = 0,
333 HCLK_VOP_ROOT_SEL_100M,
334 HCLK_VOP_ROOT_SEL_50M,
335 HCLK_VOP_ROOT_SEL_24M,
336 ACLK_VOP_LOW_ROOT_SEL_SHIFT = 8,
337 ACLK_VOP_LOW_ROOT_SEL_MASK = 3 << ACLK_VOP_LOW_ROOT_SEL_SHIFT,
338 ACLK_VOP_LOW_ROOT_SEL_400M = 0,
339 ACLK_VOP_LOW_ROOT_SEL_200M,
340 ACLK_VOP_LOW_ROOT_SEL_100M,
341 ACLK_VOP_LOW_ROOT_SEL_24M,
342 ACLK_VOP_ROOT_SEL_SHIFT = 5,
343 ACLK_VOP_ROOT_SEL_MASK = 3 << ACLK_VOP_ROOT_SEL_SHIFT,
344 ACLK_VOP_ROOT_SEL_GPLL = 0,
345 ACLK_VOP_ROOT_SEL_CPLL,
346 ACLK_VOP_ROOT_SEL_AUPLL,
347 ACLK_VOP_ROOT_SEL_NPLL,
348 ACLK_VOP_ROOT_SEL_SPLL,
349 ACLK_VOP_ROOT_DIV_SHIFT = 0,
350 ACLK_VOP_ROOT_DIV_MASK = 0x1f << ACLK_VOP_ROOT_DIV_SHIFT,
351
352 /* CRU_CLK_SEL111_CON */
353 DCLK1_VOP_SRC_SEL_SHIFT = 14,
354 DCLK1_VOP_SRC_SEL_MASK = 3 << DCLK1_VOP_SRC_SEL_SHIFT,
355 DCLK1_VOP_SRC_DIV_SHIFT = 9,
356 DCLK1_VOP_SRC_DIV_MASK = 0x1f << DCLK1_VOP_SRC_DIV_SHIFT,
357 DCLK0_VOP_SRC_SEL_SHIFT = 7,
358 DCLK0_VOP_SRC_SEL_MASK = 3 << DCLK0_VOP_SRC_SEL_SHIFT,
359 DCLK_VOP_SRC_SEL_GPLL = 0,
360 DCLK_VOP_SRC_SEL_CPLL,
361 DCLK_VOP_SRC_SEL_V0PLL,
362 DCLK_VOP_SRC_SEL_AUPLL,
363 DCLK0_VOP_SRC_DIV_SHIFT = 0,
364 DCLK0_VOP_SRC_DIV_MASK = 0x7f << DCLK0_VOP_SRC_DIV_SHIFT,
365
366 /* CRU_CLK_SEL112_CON */
367 DCLK2_VOP_SEL_SHIFT = 11,
368 DCLK2_VOP_SEL_MASK = 3 << DCLK2_VOP_SEL_SHIFT,
369 DCLK1_VOP_SEL_SHIFT = 9,
370 DCLK1_VOP_SEL_MASK = 3 << DCLK1_VOP_SEL_SHIFT,
371 DCLK0_VOP_SEL_SHIFT = 7,
372 DCLK0_VOP_SEL_MASK = 3 << DCLK0_VOP_SEL_SHIFT,
373 DCLK2_VOP_SRC_SEL_SHIFT = 5,
374 DCLK2_VOP_SRC_SEL_MASK = 3 << DCLK2_VOP_SRC_SEL_SHIFT,
375 DCLK2_VOP_SRC_DIV_SHIFT = 0,
376 DCLK2_VOP_SRC_DIV_MASK = 0x1f << DCLK2_VOP_SRC_DIV_SHIFT,
377
378 /* CRU_CLK_SEL113_CON */
379 DCLK3_VOP_SRC_SEL_SHIFT = 7,
380 DCLK3_VOP_SRC_SEL_MASK = 3 << DCLK3_VOP_SRC_SEL_SHIFT,
381 DCLK3_VOP_SRC_DIV_SHIFT = 0,
382 DCLK3_VOP_SRC_DIV_MASK = 0x7f << DCLK3_VOP_SRC_DIV_SHIFT,
383
384 /* CRU_CLK_SEL117_CON */
385 CLK_AUX16MHZ_1_DIV_SHIFT = 8,
386 CLK_AUX16MHZ_1_DIV_MASK = 0xff << CLK_AUX16MHZ_1_DIV_SHIFT,
387 CLK_AUX16MHZ_0_DIV_SHIFT = 0,
388 CLK_AUX16MHZ_0_DIV_MASK = 0xff << CLK_AUX16MHZ_0_DIV_SHIFT,
389
390 /* CRU_CLK_SEL165_CON */
391 PCLK_CENTER_ROOT_SEL_SHIFT = 6,
392 PCLK_CENTER_ROOT_SEL_MASK = 3 << PCLK_CENTER_ROOT_SEL_SHIFT,
393 PCLK_CENTER_ROOT_SEL_200M = 0,
394 PCLK_CENTER_ROOT_SEL_100M,
395 PCLK_CENTER_ROOT_SEL_50M,
396 PCLK_CENTER_ROOT_SEL_24M,
397 HCLK_CENTER_ROOT_SEL_SHIFT = 4,
398 HCLK_CENTER_ROOT_SEL_MASK = 3 << HCLK_CENTER_ROOT_SEL_SHIFT,
399 HCLK_CENTER_ROOT_SEL_400M = 0,
400 HCLK_CENTER_ROOT_SEL_200M,
401 HCLK_CENTER_ROOT_SEL_100M,
402 HCLK_CENTER_ROOT_SEL_24M,
403 ACLK_CENTER_LOW_ROOT_SEL_SHIFT = 2,
404 ACLK_CENTER_LOW_ROOT_SEL_MASK = 3 << ACLK_CENTER_LOW_ROOT_SEL_SHIFT,
405 ACLK_CENTER_LOW_ROOT_SEL_500M = 0,
406 ACLK_CENTER_LOW_ROOT_SEL_250M,
407 ACLK_CENTER_LOW_ROOT_SEL_100M,
408 ACLK_CENTER_LOW_ROOT_SEL_24M,
409 ACLK_CENTER_ROOT_SEL_SHIFT = 0,
410 ACLK_CENTER_ROOT_SEL_MASK = 3 << ACLK_CENTER_ROOT_SEL_SHIFT,
411 ACLK_CENTER_ROOT_SEL_700M = 0,
412 ACLK_CENTER_ROOT_SEL_400M,
413 ACLK_CENTER_ROOT_SEL_200M,
414 ACLK_CENTER_ROOT_SEL_24M,
415
416 /* CRU_CLK_SEL172_CON */
417 CCLK_SDIO_SRC_SEL_SHIFT = 8,
418 CCLK_SDIO_SRC_SEL_MASK = 3 << CCLK_SDIO_SRC_SEL_SHIFT,
419 CCLK_SDIO_SRC_SEL_GPLL = 0,
420 CCLK_SDIO_SRC_SEL_CPLL,
421 CCLK_SDIO_SRC_SEL_24M,
422 CCLK_SDIO_SRC_DIV_SHIFT = 2,
423 CCLK_SDIO_SRC_DIV_MASK = 0x3f << CCLK_SDIO_SRC_DIV_SHIFT,
424
425 /* CRU_CLK_SEL176_CON */
426 CLK_PCIE_PHY1_PLL_DIV_SHIFT = 6,
427 CLK_PCIE_PHY1_PLL_DIV_MASK = 0x3f << CLK_PCIE_PHY1_PLL_DIV_SHIFT,
428 CLK_PCIE_PHY0_PLL_DIV_SHIFT = 0,
429 CLK_PCIE_PHY0_PLL_DIV_MASK = 0x3f << CLK_PCIE_PHY0_PLL_DIV_SHIFT,
430
431 /* CRU_CLK_SEL177_CON */
432 CLK_PCIE_PHY2_REF_SEL_SHIFT = 8,
433 CLK_PCIE_PHY2_REF_SEL_MASK = 1 << CLK_PCIE_PHY2_REF_SEL_SHIFT,
434 CLK_PCIE_PHY1_REF_SEL_SHIFT = 7,
435 CLK_PCIE_PHY1_REF_SEL_MASK = 1 << CLK_PCIE_PHY1_REF_SEL_SHIFT,
436 CLK_PCIE_PHY0_REF_SEL_SHIFT = 6,
437 CLK_PCIE_PHY0_REF_SEL_MASK = 1 << CLK_PCIE_PHY0_REF_SEL_SHIFT,
438 CLK_PCIE_PHY_REF_SEL_24M = 0,
439 CLK_PCIE_PHY_REF_SEL_PPLL,
440 CLK_PCIE_PHY2_PLL_DIV_SHIFT = 0,
441 CLK_PCIE_PHY2_PLL_DIV_MASK = 0x3f << CLK_PCIE_PHY2_PLL_DIV_SHIFT,
442
443 /* PMUCRU_CLK_SEL2_CON */
444 CLK_PMU1PWM_SEL_SHIFT = 9,
445 CLK_PMU1PWM_SEL_MASK = 3 << CLK_PMU1PWM_SEL_SHIFT,
446
447 /* PMUCRU_CLK_SEL3_CON */
448 CLK_I2C0_SEL_SHIFT = 6,
449 CLK_I2C0_SEL_MASK = 1 << CLK_I2C0_SEL_SHIFT,
450 CLK_I2C_SEL_200M = 0,
451 CLK_I2C_SEL_100M,
Jonas Karlmanb4505902023-04-17 19:07:20 +0000452
453 /* SECURECRU_CLKSEL_CON01 */
454 SCMI_HCLK_SD_SEL_SHIFT = 2,
455 SCMI_HCLK_SD_SEL_MASK = 3 << SCMI_HCLK_SD_SEL_SHIFT,
456 SCMI_HCLK_SD_SEL_150M = 0,
457 SCMI_HCLK_SD_SEL_100M,
458 SCMI_HCLK_SD_SEL_50M,
459 SCMI_HCLK_SD_SEL_24M,
460
461 /* SECURECRU_CLKSEL_CON03 */
462 SCMI_CCLK_SD_SEL_SHIFT = 12,
463 SCMI_CCLK_SD_SEL_MASK = 3 << SCMI_CCLK_SD_SEL_SHIFT,
464 SCMI_CCLK_SD_SEL_GPLL = 0,
465 SCMI_CCLK_SD_SEL_SPLL,
466 SCMI_CCLK_SD_SEL_24M,
467 SCMI_CCLK_SD_DIV_SHIFT = 6,
468 SCMI_CCLK_SD_DIV_MASK = 0x3f << SCMI_CCLK_SD_DIV_SHIFT,
Jagan Teki9c9aab12023-01-30 20:27:33 +0530469};
470#endif