Lines Matching +full:ext +full:- +full:26 +full:m
1 // SPDX-License-Identifier: GPL-2.0
8 #include <linux/clk-provider.h>
15 #include <dt-bindings/clock/ingenic,jz4760-cgu.h>
45 0x0, 0x1, -1, 0x2, -1, -1, -1, 0x3,
61 unsigned int m, n, od, m_max = (1 << pll_info->m_bits) - 2; in jz4760_cgu_calc_m_n_od() local
67 n = clamp_val(n, 2, 1 << pll_info->n_bits); in jz4760_cgu_calc_m_n_od()
70 od = (unsigned int)-1; in jz4760_cgu_calc_m_n_od()
73 m = (rate / MHZ) * (1 << ++od) * n / (parent_rate / MHZ); in jz4760_cgu_calc_m_n_od()
74 } while ((m > m_max || m & 1) && (od < 4)); in jz4760_cgu_calc_m_n_od()
76 if (od < 4 && m >= 4 && m <= m_max) in jz4760_cgu_calc_m_n_od()
80 *pm = m; in jz4760_cgu_calc_m_n_od()
89 [JZ4760_CLK_EXT] = { "ext", CGU_CLK_EXT },
135 .bypass_bit = -1,
153 CGU_REG_CPCCR, 0, 1, 4, 22, -1, -1, 0,
161 CGU_REG_CPCCR, 4, 1, 4, 22, -1, -1, 0,
169 CGU_REG_CPCCR, 24, 1, 4, 22, -1, -1, 0,
177 CGU_REG_CPCCR, 16, 1, 4, 22, -1, -1, 0,
190 CGU_REG_CPCCR, 12, 1, 4, 22, -1, -1, 0,
198 CGU_REG_CPCCR, 8, 1, 4, 22, -1, -1, 0,
209 CGU_REG_CPCCR, 21, 1, 1, 22, -1, -1, 0,
220 .div = { CGU_REG_UHCCDR, 0, 1, 4, -1, -1, -1 },
227 .div = { CGU_REG_GPUCDR, 0, 1, 3, -1, -1, -1 },
234 .div = { CGU_REG_LPCDR, 0, 1, 11, -1, -1, -1 },
252 .div = { CGU_REG_GPSCDR, 0, 1, 4, -1, -1, -1 },
256 /* Those divided clocks can connect to EXT, PLL0 or PLL1 */
260 .parents = { JZ4760_CLK_EXT, -1,
263 .div = { CGU_REG_PCMCDR, 0, 1, 9, -1, -1, -1, BIT(0) },
268 .parents = { JZ4760_CLK_EXT, -1,
271 .div = { CGU_REG_I2SCDR, 0, 1, 9, -1, -1, -1, BIT(0) },
275 .parents = { JZ4760_CLK_EXT, -1,
278 .div = { CGU_REG_USBCDR, 0, 1, 8, -1, -1, -1 },
282 /* Those divided clocks can connect to EXT or PLL0 */
287 .div = { CGU_REG_MSCCDR, 0, 1, 6, -1, -1, -1, BIT(0) },
293 .div = { CGU_REG_SSICDR, 0, 1, 6, -1, -1, -1, BIT(0) },
300 .div = { CGU_REG_CIMCDR, 0, 1, 8, -1, -1, -1 },
301 .gate = { CGU_REG_CLKGR0, 26 },
304 /* Gate-only clocks */
414 "ext/512", CGU_CLK_FIXDIV,
445 CLK_OF_DECLARE_DRIVER(jz4760_cgu, "ingenic,jz4760-cgu", jz4760_cgu_init);
448 CLK_OF_DECLARE_DRIVER(jz4760b_cgu, "ingenic,jz4760b-cgu", jz4760_cgu_init);