xref: /freebsd/sys/dev/clk/rockchip/rk3399_pmucru.c (revision be82b3a0)
177f22241SEmmanuel Vadot /*-
277f22241SEmmanuel Vadot  * SPDX-License-Identifier: BSD-2-Clause
377f22241SEmmanuel Vadot  *
477f22241SEmmanuel Vadot  * Copyright (c) 2018 Emmanuel Vadot <manu@freebsd.org>
577f22241SEmmanuel Vadot  * Copyright (c) 2018 Val Packett <val@packett.cool>
677f22241SEmmanuel Vadot  *
777f22241SEmmanuel Vadot  * Redistribution and use in source and binary forms, with or without
877f22241SEmmanuel Vadot  * modification, are permitted provided that the following conditions
977f22241SEmmanuel Vadot  * are met:
1077f22241SEmmanuel Vadot  * 1. Redistributions of source code must retain the above copyright
1177f22241SEmmanuel Vadot  *    notice, this list of conditions and the following disclaimer.
1277f22241SEmmanuel Vadot  * 2. Redistributions in binary form must reproduce the above copyright
1377f22241SEmmanuel Vadot  *    notice, this list of conditions and the following disclaimer in the
1477f22241SEmmanuel Vadot  *    documentation and/or other materials provided with the distribution.
1577f22241SEmmanuel Vadot  *
1677f22241SEmmanuel Vadot  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
1777f22241SEmmanuel Vadot  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
1877f22241SEmmanuel Vadot  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
1977f22241SEmmanuel Vadot  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
2077f22241SEmmanuel Vadot  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
2177f22241SEmmanuel Vadot  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
2277f22241SEmmanuel Vadot  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
2377f22241SEmmanuel Vadot  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
2477f22241SEmmanuel Vadot  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2577f22241SEmmanuel Vadot  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2677f22241SEmmanuel Vadot  * SUCH DAMAGE.
2777f22241SEmmanuel Vadot  */
2877f22241SEmmanuel Vadot 
2977f22241SEmmanuel Vadot #include <sys/param.h>
3077f22241SEmmanuel Vadot #include <sys/systm.h>
3177f22241SEmmanuel Vadot #include <sys/bus.h>
3277f22241SEmmanuel Vadot #include <sys/rman.h>
3377f22241SEmmanuel Vadot #include <sys/kernel.h>
3477f22241SEmmanuel Vadot #include <sys/module.h>
3577f22241SEmmanuel Vadot #include <machine/bus.h>
3677f22241SEmmanuel Vadot 
3777f22241SEmmanuel Vadot #include <dev/fdt/simplebus.h>
3877f22241SEmmanuel Vadot 
3977f22241SEmmanuel Vadot #include <dev/ofw/ofw_bus.h>
4077f22241SEmmanuel Vadot #include <dev/ofw/ofw_bus_subr.h>
4177f22241SEmmanuel Vadot 
42be82b3a0SEmmanuel Vadot #include <dev/clk/clk_div.h>
43be82b3a0SEmmanuel Vadot #include <dev/clk/clk_fixed.h>
44be82b3a0SEmmanuel Vadot #include <dev/clk/clk_mux.h>
4577f22241SEmmanuel Vadot 
4677f22241SEmmanuel Vadot #include <dev/clk/rockchip/rk_cru.h>
4777f22241SEmmanuel Vadot 
4877f22241SEmmanuel Vadot #define	CRU_CLKSEL_CON(x)	(0x80 + (x) * 0x4)
4977f22241SEmmanuel Vadot #define	CRU_CLKGATE_CON(x)	(0x100 + (x) * 0x4)
5077f22241SEmmanuel Vadot 
5177f22241SEmmanuel Vadot #define	PLL_PPLL		1
5277f22241SEmmanuel Vadot #define	SCLK_32K_SUSPEND_PMU	2
5377f22241SEmmanuel Vadot #define	SCLK_SPI3_PMU		3
5477f22241SEmmanuel Vadot #define	SCLK_TIMER12_PMU	4
5577f22241SEmmanuel Vadot #define	SCLK_TIMER13_PMU	5
5677f22241SEmmanuel Vadot #define	SCLK_UART4_PMU		6
5777f22241SEmmanuel Vadot #define	SCLK_PVTM_PMU		7
5877f22241SEmmanuel Vadot #define	SCLK_WIFI_PMU		8
5977f22241SEmmanuel Vadot #define	SCLK_I2C0_PMU		9
6077f22241SEmmanuel Vadot #define	SCLK_I2C4_PMU		10
6177f22241SEmmanuel Vadot #define	SCLK_I2C8_PMU		11
6277f22241SEmmanuel Vadot 
6377f22241SEmmanuel Vadot #define	PCLK_PMU_SRC		19
6477f22241SEmmanuel Vadot #define	PCLK_PMU		20
6577f22241SEmmanuel Vadot #define	PCLK_PMUGRF_PMU		21
6677f22241SEmmanuel Vadot #define	PCLK_INTMEM1_PMU	22
6777f22241SEmmanuel Vadot #define	PCLK_GPIO0_PMU		23
6877f22241SEmmanuel Vadot #define	PCLK_GPIO1_PMU		24
6977f22241SEmmanuel Vadot #define	PCLK_SGRF_PMU		25
7077f22241SEmmanuel Vadot #define	PCLK_NOC_PMU		26
7177f22241SEmmanuel Vadot #define	PCLK_I2C0_PMU		27
7277f22241SEmmanuel Vadot #define	PCLK_I2C4_PMU		28
7377f22241SEmmanuel Vadot #define	PCLK_I2C8_PMU		29
7477f22241SEmmanuel Vadot #define	PCLK_RKPWM_PMU		30
7577f22241SEmmanuel Vadot #define	PCLK_SPI3_PMU		31
7677f22241SEmmanuel Vadot #define	PCLK_TIMER_PMU		32
7777f22241SEmmanuel Vadot #define	PCLK_MAILBOX_PMU	33
7877f22241SEmmanuel Vadot #define	PCLK_UART4_PMU		34
7977f22241SEmmanuel Vadot #define	PCLK_WDT_M0_PMU		35
8077f22241SEmmanuel Vadot 
8177f22241SEmmanuel Vadot #define	FCLK_CM0S_SRC_PMU	44
8277f22241SEmmanuel Vadot #define	FCLK_CM0S_PMU		45
8377f22241SEmmanuel Vadot #define	SCLK_CM0S_PMU		46
8477f22241SEmmanuel Vadot #define	HCLK_CM0S_PMU		47
8577f22241SEmmanuel Vadot #define	DCLK_CM0S_PMU		48
8677f22241SEmmanuel Vadot #define	PCLK_INTR_ARB_PMU	49
8777f22241SEmmanuel Vadot #define	HCLK_NOC_PMU		50
8877f22241SEmmanuel Vadot 
8977f22241SEmmanuel Vadot /* GATES */
9077f22241SEmmanuel Vadot static struct rk_cru_gate rk3399_pmu_gates[] = {
9177f22241SEmmanuel Vadot 	/* PMUCRU_CLKGATE_CON0 */
9277f22241SEmmanuel Vadot 	/* 0 Reserved */
9377f22241SEmmanuel Vadot 	/* 1 fclk_cm0s_pmu_ppll_src_en */
9477f22241SEmmanuel Vadot 	GATE(SCLK_SPI3_PMU, "clk_spi3_pmu", "clk_spi3_c", 0, 2),
9577f22241SEmmanuel Vadot 	GATE(SCLK_TIMER12_PMU, "clk_timer0_pmu", "clk_timer_sel", 0, 3),
9677f22241SEmmanuel Vadot 	GATE(SCLK_TIMER13_PMU, "clk_timer1_pmu", "clk_timer_sel", 0, 4),
9777f22241SEmmanuel Vadot 	GATE(SCLK_UART4_PMU, "clk_uart4_pmu", "clk_uart4_sel", 0, 5),
9877f22241SEmmanuel Vadot 	GATE(0, "clk_uart4_frac", "clk_uart4_frac_frac", 0, 6),
9977f22241SEmmanuel Vadot 	/* 7 clk_pvtm_pmu_en */
10077f22241SEmmanuel Vadot 	GATE(SCLK_WIFI_PMU, "clk_wifi_pmu", "clk_wifi_sel", 0, 8),
10177f22241SEmmanuel Vadot 	GATE(SCLK_I2C0_PMU, "clk_i2c0_src", "clk_i2c0_div", 0, 9),
10277f22241SEmmanuel Vadot 	GATE(SCLK_I2C4_PMU, "clk_i2c4_src", "clk_i2c4_div", 0, 10),
10377f22241SEmmanuel Vadot 	GATE(SCLK_I2C8_PMU, "clk_i2c8_src", "clk_i2c8_div", 0, 11),
10477f22241SEmmanuel Vadot 	/* 12:15 Reserved */
10577f22241SEmmanuel Vadot 
10677f22241SEmmanuel Vadot 	/* PMUCRU_CLKGATE_CON1 */
10777f22241SEmmanuel Vadot 	GATE(PCLK_PMU, "pclk_pmu", "pclk_pmu_src", 1, 0),
10877f22241SEmmanuel Vadot 	/* 1 pclk_pmugrf_en */
10977f22241SEmmanuel Vadot 	/* 2 pclk_intmem1_en */
11077f22241SEmmanuel Vadot 	GATE(PCLK_GPIO0_PMU, "pclk_gpio0_pmu", "pclk_pmu_src", 1, 3),
11177f22241SEmmanuel Vadot 	GATE(PCLK_GPIO1_PMU, "pclk_gpio1_pmu", "pclk_pmu_src", 1, 4),
11277f22241SEmmanuel Vadot 	/* 5 pclk_sgrf_en */
11377f22241SEmmanuel Vadot 	/* 6 pclk_noc_pmu_en */
11477f22241SEmmanuel Vadot 	GATE(PCLK_I2C0_PMU, "pclk_i2c0_pmu", "pclk_pmu_src", 1, 7),
11577f22241SEmmanuel Vadot 	GATE(PCLK_I2C4_PMU, "pclk_i2c4_pmu", "pclk_pmu_src", 1, 8),
11677f22241SEmmanuel Vadot 	GATE(PCLK_I2C8_PMU, "pclk_i2c8_pmu", "pclk_pmu_src", 1, 9),
11777f22241SEmmanuel Vadot 	GATE(PCLK_RKPWM_PMU, "pclk_rkpwm_pmu", "pclk_pmu_src", 1, 10),
11877f22241SEmmanuel Vadot 	GATE(PCLK_SPI3_PMU, "pclk_spi3_pmu", "pclk_pmu_src", 1, 11),
11977f22241SEmmanuel Vadot 	GATE(PCLK_TIMER_PMU, "pclk_timer_pmu", "pclk_pmu_src", 1, 12),
12077f22241SEmmanuel Vadot 	GATE(PCLK_MAILBOX_PMU, "pclk_mailbox_pmu", "pclk_pmu_src", 1, 13),
12177f22241SEmmanuel Vadot 	/* 14 pclk_uartm0_en */
12277f22241SEmmanuel Vadot 	/* 15 pclk_wdt_m0_pmu_en */
12377f22241SEmmanuel Vadot 
12477f22241SEmmanuel Vadot 	/* PMUCRU_CLKGATE_CON2 */
12577f22241SEmmanuel Vadot 	/* 0 fclk_cm0s_en */
12677f22241SEmmanuel Vadot 	/* 1 sclk_cm0s_en */
12777f22241SEmmanuel Vadot 	/* 2 hclk_cm0s_en */
12877f22241SEmmanuel Vadot 	/* 3 dclk_cm0s_en */
12977f22241SEmmanuel Vadot 	/* 4 Reserved */
13077f22241SEmmanuel Vadot 	/* 5 hclk_noc_pmu_en */
13177f22241SEmmanuel Vadot 	/* 6:15 Reserved */
13277f22241SEmmanuel Vadot };
13377f22241SEmmanuel Vadot 
13477f22241SEmmanuel Vadot /*
13577f22241SEmmanuel Vadot  * PLLs
13677f22241SEmmanuel Vadot  */
13777f22241SEmmanuel Vadot 
13877f22241SEmmanuel Vadot static struct rk_clk_pll_rate rk3399_pll_rates[] = {
13977f22241SEmmanuel Vadot 	{
14077f22241SEmmanuel Vadot 		.freq = 2208000000,
14177f22241SEmmanuel Vadot 		.refdiv = 1,
14277f22241SEmmanuel Vadot 		.fbdiv = 92,
14377f22241SEmmanuel Vadot 		.postdiv1 = 1,
14477f22241SEmmanuel Vadot 		.postdiv2 = 1,
14577f22241SEmmanuel Vadot 		.dsmpd = 1,
14677f22241SEmmanuel Vadot 	},
14777f22241SEmmanuel Vadot 	{
14877f22241SEmmanuel Vadot 		.freq = 2184000000,
14977f22241SEmmanuel Vadot 		.refdiv = 1,
15077f22241SEmmanuel Vadot 		.fbdiv = 91,
15177f22241SEmmanuel Vadot 		.postdiv1 = 1,
15277f22241SEmmanuel Vadot 		.postdiv2 = 1,
15377f22241SEmmanuel Vadot 		.dsmpd = 1,
15477f22241SEmmanuel Vadot 	},
15577f22241SEmmanuel Vadot 	{
15677f22241SEmmanuel Vadot 		.freq = 2160000000,
15777f22241SEmmanuel Vadot 		.refdiv = 1,
15877f22241SEmmanuel Vadot 		.fbdiv = 90,
15977f22241SEmmanuel Vadot 		.postdiv1 = 1,
16077f22241SEmmanuel Vadot 		.postdiv2 = 1,
16177f22241SEmmanuel Vadot 		.dsmpd = 1,
16277f22241SEmmanuel Vadot 	},
16377f22241SEmmanuel Vadot 	{
16477f22241SEmmanuel Vadot 		.freq = 2136000000,
16577f22241SEmmanuel Vadot 		.refdiv = 1,
16677f22241SEmmanuel Vadot 		.fbdiv = 89,
16777f22241SEmmanuel Vadot 		.postdiv1 = 1,
16877f22241SEmmanuel Vadot 		.postdiv2 = 1,
16977f22241SEmmanuel Vadot 		.dsmpd = 1,
17077f22241SEmmanuel Vadot 	},
17177f22241SEmmanuel Vadot 	{
17277f22241SEmmanuel Vadot 		.freq = 2112000000,
17377f22241SEmmanuel Vadot 		.refdiv = 1,
17477f22241SEmmanuel Vadot 		.fbdiv = 88,
17577f22241SEmmanuel Vadot 		.postdiv1 = 1,
17677f22241SEmmanuel Vadot 		.postdiv2 = 1,
17777f22241SEmmanuel Vadot 		.dsmpd = 1,
17877f22241SEmmanuel Vadot 	},
17977f22241SEmmanuel Vadot 	{
18077f22241SEmmanuel Vadot 		.freq = 2088000000,
18177f22241SEmmanuel Vadot 		.refdiv = 1,
18277f22241SEmmanuel Vadot 		.fbdiv = 87,
18377f22241SEmmanuel Vadot 		.postdiv1 = 1,
18477f22241SEmmanuel Vadot 		.postdiv2 = 1,
18577f22241SEmmanuel Vadot 		.dsmpd = 1,
18677f22241SEmmanuel Vadot 	},
18777f22241SEmmanuel Vadot 	{
18877f22241SEmmanuel Vadot 		.freq = 2064000000,
18977f22241SEmmanuel Vadot 		.refdiv = 1,
19077f22241SEmmanuel Vadot 		.fbdiv = 86,
19177f22241SEmmanuel Vadot 		.postdiv1 = 1,
19277f22241SEmmanuel Vadot 		.postdiv2 = 1,
19377f22241SEmmanuel Vadot 		.dsmpd = 1,
19477f22241SEmmanuel Vadot 	},
19577f22241SEmmanuel Vadot 	{
19677f22241SEmmanuel Vadot 		.freq = 2040000000,
19777f22241SEmmanuel Vadot 		.refdiv = 1,
19877f22241SEmmanuel Vadot 		.fbdiv = 85,
19977f22241SEmmanuel Vadot 		.postdiv1 = 1,
20077f22241SEmmanuel Vadot 		.postdiv2 = 1,
20177f22241SEmmanuel Vadot 		.dsmpd = 1,
20277f22241SEmmanuel Vadot 	},
20377f22241SEmmanuel Vadot 	{
20477f22241SEmmanuel Vadot 		.freq = 2016000000,
20577f22241SEmmanuel Vadot 		.refdiv = 1,
20677f22241SEmmanuel Vadot 		.fbdiv = 84,
20777f22241SEmmanuel Vadot 		.postdiv1 = 1,
20877f22241SEmmanuel Vadot 		.postdiv2 = 1,
20977f22241SEmmanuel Vadot 		.dsmpd = 1,
21077f22241SEmmanuel Vadot 	},
21177f22241SEmmanuel Vadot 	{
21277f22241SEmmanuel Vadot 		.freq = 1992000000,
21377f22241SEmmanuel Vadot 		.refdiv = 1,
21477f22241SEmmanuel Vadot 		.fbdiv = 83,
21577f22241SEmmanuel Vadot 		.postdiv1 = 1,
21677f22241SEmmanuel Vadot 		.postdiv2 = 1,
21777f22241SEmmanuel Vadot 		.dsmpd = 1,
21877f22241SEmmanuel Vadot 	},
21977f22241SEmmanuel Vadot 	{
22077f22241SEmmanuel Vadot 		.freq = 1968000000,
22177f22241SEmmanuel Vadot 		.refdiv = 1,
22277f22241SEmmanuel Vadot 		.fbdiv = 82,
22377f22241SEmmanuel Vadot 		.postdiv1 = 1,
22477f22241SEmmanuel Vadot 		.postdiv2 = 1,
22577f22241SEmmanuel Vadot 		.dsmpd = 1,
22677f22241SEmmanuel Vadot 	},
22777f22241SEmmanuel Vadot 	{
22877f22241SEmmanuel Vadot 		.freq = 1944000000,
22977f22241SEmmanuel Vadot 		.refdiv = 1,
23077f22241SEmmanuel Vadot 		.fbdiv = 81,
23177f22241SEmmanuel Vadot 		.postdiv1 = 1,
23277f22241SEmmanuel Vadot 		.postdiv2 = 1,
23377f22241SEmmanuel Vadot 		.dsmpd = 1,
23477f22241SEmmanuel Vadot 	},
23577f22241SEmmanuel Vadot 	{
23677f22241SEmmanuel Vadot 		.freq = 1920000000,
23777f22241SEmmanuel Vadot 		.refdiv = 1,
23877f22241SEmmanuel Vadot 		.fbdiv = 80,
23977f22241SEmmanuel Vadot 		.postdiv1 = 1,
24077f22241SEmmanuel Vadot 		.postdiv2 = 1,
24177f22241SEmmanuel Vadot 		.dsmpd = 1,
24277f22241SEmmanuel Vadot 	},
24377f22241SEmmanuel Vadot 	{
24477f22241SEmmanuel Vadot 		.freq = 1896000000,
24577f22241SEmmanuel Vadot 		.refdiv = 1,
24677f22241SEmmanuel Vadot 		.fbdiv = 79,
24777f22241SEmmanuel Vadot 		.postdiv1 = 1,
24877f22241SEmmanuel Vadot 		.postdiv2 = 1,
24977f22241SEmmanuel Vadot 		.dsmpd = 1,
25077f22241SEmmanuel Vadot 	},
25177f22241SEmmanuel Vadot 	{
25277f22241SEmmanuel Vadot 		.freq = 1872000000,
25377f22241SEmmanuel Vadot 		.refdiv = 1,
25477f22241SEmmanuel Vadot 		.fbdiv = 78,
25577f22241SEmmanuel Vadot 		.postdiv1 = 1,
25677f22241SEmmanuel Vadot 		.postdiv2 = 1,
25777f22241SEmmanuel Vadot 		.dsmpd = 1,
25877f22241SEmmanuel Vadot 	},
25977f22241SEmmanuel Vadot 	{
26077f22241SEmmanuel Vadot 		.freq = 1848000000,
26177f22241SEmmanuel Vadot 		.refdiv = 1,
26277f22241SEmmanuel Vadot 		.fbdiv = 77,
26377f22241SEmmanuel Vadot 		.postdiv1 = 1,
26477f22241SEmmanuel Vadot 		.postdiv2 = 1,
26577f22241SEmmanuel Vadot 		.dsmpd = 1,
26677f22241SEmmanuel Vadot 	},
26777f22241SEmmanuel Vadot 	{
26877f22241SEmmanuel Vadot 		.freq = 1824000000,
26977f22241SEmmanuel Vadot 		.refdiv = 1,
27077f22241SEmmanuel Vadot 		.fbdiv = 76,
27177f22241SEmmanuel Vadot 		.postdiv1 = 1,
27277f22241SEmmanuel Vadot 		.postdiv2 = 1,
27377f22241SEmmanuel Vadot 		.dsmpd = 1,
27477f22241SEmmanuel Vadot 	},
27577f22241SEmmanuel Vadot 	{
27677f22241SEmmanuel Vadot 		.freq = 1800000000,
27777f22241SEmmanuel Vadot 		.refdiv = 1,
27877f22241SEmmanuel Vadot 		.fbdiv = 75,
27977f22241SEmmanuel Vadot 		.postdiv1 = 1,
28077f22241SEmmanuel Vadot 		.postdiv2 = 1,
28177f22241SEmmanuel Vadot 		.dsmpd = 1,
28277f22241SEmmanuel Vadot 	},
28377f22241SEmmanuel Vadot 	{
28477f22241SEmmanuel Vadot 		.freq = 1776000000,
28577f22241SEmmanuel Vadot 		.refdiv = 1,
28677f22241SEmmanuel Vadot 		.fbdiv = 74,
28777f22241SEmmanuel Vadot 		.postdiv1 = 1,
28877f22241SEmmanuel Vadot 		.postdiv2 = 1,
28977f22241SEmmanuel Vadot 		.dsmpd = 1,
29077f22241SEmmanuel Vadot 	},
29177f22241SEmmanuel Vadot 	{
29277f22241SEmmanuel Vadot 		.freq = 1752000000,
29377f22241SEmmanuel Vadot 		.refdiv = 1,
29477f22241SEmmanuel Vadot 		.fbdiv = 73,
29577f22241SEmmanuel Vadot 		.postdiv1 = 1,
29677f22241SEmmanuel Vadot 		.postdiv2 = 1,
29777f22241SEmmanuel Vadot 		.dsmpd = 1,
29877f22241SEmmanuel Vadot 	},
29977f22241SEmmanuel Vadot 	{
30077f22241SEmmanuel Vadot 		.freq = 1728000000,
30177f22241SEmmanuel Vadot 		.refdiv = 1,
30277f22241SEmmanuel Vadot 		.fbdiv = 72,
30377f22241SEmmanuel Vadot 		.postdiv1 = 1,
30477f22241SEmmanuel Vadot 		.postdiv2 = 1,
30577f22241SEmmanuel Vadot 		.dsmpd = 1,
30677f22241SEmmanuel Vadot 	},
30777f22241SEmmanuel Vadot 	{
30877f22241SEmmanuel Vadot 		.freq = 1704000000,
30977f22241SEmmanuel Vadot 		.refdiv = 1,
31077f22241SEmmanuel Vadot 		.fbdiv = 71,
31177f22241SEmmanuel Vadot 		.postdiv1 = 1,
31277f22241SEmmanuel Vadot 		.postdiv2 = 1,
31377f22241SEmmanuel Vadot 		.dsmpd = 1,
31477f22241SEmmanuel Vadot 	},
31577f22241SEmmanuel Vadot 	{
31677f22241SEmmanuel Vadot 		.freq = 1680000000,
31777f22241SEmmanuel Vadot 		.refdiv = 1,
31877f22241SEmmanuel Vadot 		.fbdiv = 70,
31977f22241SEmmanuel Vadot 		.postdiv1 = 1,
32077f22241SEmmanuel Vadot 		.postdiv2 = 1,
32177f22241SEmmanuel Vadot 		.dsmpd = 1,
32277f22241SEmmanuel Vadot 	},
32377f22241SEmmanuel Vadot 	{
32477f22241SEmmanuel Vadot 		.freq = 1656000000,
32577f22241SEmmanuel Vadot 		.refdiv = 1,
32677f22241SEmmanuel Vadot 		.fbdiv = 69,
32777f22241SEmmanuel Vadot 		.postdiv1 = 1,
32877f22241SEmmanuel Vadot 		.postdiv2 = 1,
32977f22241SEmmanuel Vadot 		.dsmpd = 1,
33077f22241SEmmanuel Vadot 	},
33177f22241SEmmanuel Vadot 	{
33277f22241SEmmanuel Vadot 		.freq = 1632000000,
33377f22241SEmmanuel Vadot 		.refdiv = 1,
33477f22241SEmmanuel Vadot 		.fbdiv = 68,
33577f22241SEmmanuel Vadot 		.postdiv1 = 1,
33677f22241SEmmanuel Vadot 		.postdiv2 = 1,
33777f22241SEmmanuel Vadot 		.dsmpd = 1,
33877f22241SEmmanuel Vadot 	},
33977f22241SEmmanuel Vadot 	{
34077f22241SEmmanuel Vadot 		.freq = 1608000000,
34177f22241SEmmanuel Vadot 		.refdiv = 1,
34277f22241SEmmanuel Vadot 		.fbdiv = 67,
34377f22241SEmmanuel Vadot 		.postdiv1 = 1,
34477f22241SEmmanuel Vadot 		.postdiv2 = 1,
34577f22241SEmmanuel Vadot 		.dsmpd = 1,
34677f22241SEmmanuel Vadot 	},
34777f22241SEmmanuel Vadot 	{
34877f22241SEmmanuel Vadot 		.freq = 1600000000,
34977f22241SEmmanuel Vadot 		.refdiv = 3,
35077f22241SEmmanuel Vadot 		.fbdiv = 200,
35177f22241SEmmanuel Vadot 		.postdiv1 = 1,
35277f22241SEmmanuel Vadot 		.postdiv2 = 1,
35377f22241SEmmanuel Vadot 		.dsmpd = 1,
35477f22241SEmmanuel Vadot 	},
35577f22241SEmmanuel Vadot 	{
35677f22241SEmmanuel Vadot 		.freq = 1584000000,
35777f22241SEmmanuel Vadot 		.refdiv = 1,
35877f22241SEmmanuel Vadot 		.fbdiv = 66,
35977f22241SEmmanuel Vadot 		.postdiv1 = 1,
36077f22241SEmmanuel Vadot 		.postdiv2 = 1,
36177f22241SEmmanuel Vadot 		.dsmpd = 1,
36277f22241SEmmanuel Vadot 	},
36377f22241SEmmanuel Vadot 	{
36477f22241SEmmanuel Vadot 		.freq = 1560000000,
36577f22241SEmmanuel Vadot 		.refdiv = 1,
36677f22241SEmmanuel Vadot 		.fbdiv = 65,
36777f22241SEmmanuel Vadot 		.postdiv1 = 1,
36877f22241SEmmanuel Vadot 		.postdiv2 = 1,
36977f22241SEmmanuel Vadot 		.dsmpd = 1,
37077f22241SEmmanuel Vadot 	},
37177f22241SEmmanuel Vadot 	{
37277f22241SEmmanuel Vadot 		.freq = 1536000000,
37377f22241SEmmanuel Vadot 		.refdiv = 1,
37477f22241SEmmanuel Vadot 		.fbdiv = 64,
37577f22241SEmmanuel Vadot 		.postdiv1 = 1,
37677f22241SEmmanuel Vadot 		.postdiv2 = 1,
37777f22241SEmmanuel Vadot 		.dsmpd = 1,
37877f22241SEmmanuel Vadot 	},
37977f22241SEmmanuel Vadot 	{
38077f22241SEmmanuel Vadot 		.freq = 1512000000,
38177f22241SEmmanuel Vadot 		.refdiv = 1,
38277f22241SEmmanuel Vadot 		.fbdiv = 63,
38377f22241SEmmanuel Vadot 		.postdiv1 = 1,
38477f22241SEmmanuel Vadot 		.postdiv2 = 1,
38577f22241SEmmanuel Vadot 		.dsmpd = 1,
38677f22241SEmmanuel Vadot 	},
38777f22241SEmmanuel Vadot 	{
38877f22241SEmmanuel Vadot 		.freq = 1488000000,
38977f22241SEmmanuel Vadot 		.refdiv = 1,
39077f22241SEmmanuel Vadot 		.fbdiv = 62,
39177f22241SEmmanuel Vadot 		.postdiv1 = 1,
39277f22241SEmmanuel Vadot 		.postdiv2 = 1,
39377f22241SEmmanuel Vadot 		.dsmpd = 1,
39477f22241SEmmanuel Vadot 	},
39577f22241SEmmanuel Vadot 	{
39677f22241SEmmanuel Vadot 		.freq = 1464000000,
39777f22241SEmmanuel Vadot 		.refdiv = 1,
39877f22241SEmmanuel Vadot 		.fbdiv = 61,
39977f22241SEmmanuel Vadot 		.postdiv1 = 1,
40077f22241SEmmanuel Vadot 		.postdiv2 = 1,
40177f22241SEmmanuel Vadot 		.dsmpd = 1,
40277f22241SEmmanuel Vadot 	},
40377f22241SEmmanuel Vadot 	{
40477f22241SEmmanuel Vadot 		.freq = 1440000000,
40577f22241SEmmanuel Vadot 		.refdiv = 1,
40677f22241SEmmanuel Vadot 		.fbdiv = 60,
40777f22241SEmmanuel Vadot 		.postdiv1 = 1,
40877f22241SEmmanuel Vadot 		.postdiv2 = 1,
40977f22241SEmmanuel Vadot 		.dsmpd = 1,
41077f22241SEmmanuel Vadot 	},
41177f22241SEmmanuel Vadot 	{
41277f22241SEmmanuel Vadot 		.freq = 1416000000,
41377f22241SEmmanuel Vadot 		.refdiv = 1,
41477f22241SEmmanuel Vadot 		.fbdiv = 59,
41577f22241SEmmanuel Vadot 		.postdiv1 = 1,
41677f22241SEmmanuel Vadot 		.postdiv2 = 1,
41777f22241SEmmanuel Vadot 		.dsmpd = 1,
41877f22241SEmmanuel Vadot 	},
41977f22241SEmmanuel Vadot 	{
42077f22241SEmmanuel Vadot 		.freq = 1392000000,
42177f22241SEmmanuel Vadot 		.refdiv = 1,
42277f22241SEmmanuel Vadot 		.fbdiv = 58,
42377f22241SEmmanuel Vadot 		.postdiv1 = 1,
42477f22241SEmmanuel Vadot 		.postdiv2 = 1,
42577f22241SEmmanuel Vadot 		.dsmpd = 1,
42677f22241SEmmanuel Vadot 	},
42777f22241SEmmanuel Vadot 	{
42877f22241SEmmanuel Vadot 		.freq = 1368000000,
42977f22241SEmmanuel Vadot 		.refdiv = 1,
43077f22241SEmmanuel Vadot 		.fbdiv = 57,
43177f22241SEmmanuel Vadot 		.postdiv1 = 1,
43277f22241SEmmanuel Vadot 		.postdiv2 = 1,
43377f22241SEmmanuel Vadot 		.dsmpd = 1,
43477f22241SEmmanuel Vadot 	},
43577f22241SEmmanuel Vadot 	{
43677f22241SEmmanuel Vadot 		.freq = 1344000000,
43777f22241SEmmanuel Vadot 		.refdiv = 1,
43877f22241SEmmanuel Vadot 		.fbdiv = 56,
43977f22241SEmmanuel Vadot 		.postdiv1 = 1,
44077f22241SEmmanuel Vadot 		.postdiv2 = 1,
44177f22241SEmmanuel Vadot 		.dsmpd = 1,
44277f22241SEmmanuel Vadot 	},
44377f22241SEmmanuel Vadot 	{
44477f22241SEmmanuel Vadot 		.freq = 1320000000,
44577f22241SEmmanuel Vadot 		.refdiv = 1,
44677f22241SEmmanuel Vadot 		.fbdiv = 55,
44777f22241SEmmanuel Vadot 		.postdiv1 = 1,
44877f22241SEmmanuel Vadot 		.postdiv2 = 1,
44977f22241SEmmanuel Vadot 		.dsmpd = 1,
45077f22241SEmmanuel Vadot 	},
45177f22241SEmmanuel Vadot 	{
45277f22241SEmmanuel Vadot 		.freq = 1296000000,
45377f22241SEmmanuel Vadot 		.refdiv = 1,
45477f22241SEmmanuel Vadot 		.fbdiv = 54,
45577f22241SEmmanuel Vadot 		.postdiv1 = 1,
45677f22241SEmmanuel Vadot 		.postdiv2 = 1,
45777f22241SEmmanuel Vadot 		.dsmpd = 1,
45877f22241SEmmanuel Vadot 	},
45977f22241SEmmanuel Vadot 	{
46077f22241SEmmanuel Vadot 		.freq = 1272000000,
46177f22241SEmmanuel Vadot 		.refdiv = 1,
46277f22241SEmmanuel Vadot 		.fbdiv = 53,
46377f22241SEmmanuel Vadot 		.postdiv1 = 1,
46477f22241SEmmanuel Vadot 		.postdiv2 = 1,
46577f22241SEmmanuel Vadot 		.dsmpd = 1,
46677f22241SEmmanuel Vadot 	},
46777f22241SEmmanuel Vadot 	{
46877f22241SEmmanuel Vadot 		.freq = 1248000000,
46977f22241SEmmanuel Vadot 		.refdiv = 1,
47077f22241SEmmanuel Vadot 		.fbdiv = 52,
47177f22241SEmmanuel Vadot 		.postdiv1 = 1,
47277f22241SEmmanuel Vadot 		.postdiv2 = 1,
47377f22241SEmmanuel Vadot 		.dsmpd = 1,
47477f22241SEmmanuel Vadot 	},
47577f22241SEmmanuel Vadot 	{
47677f22241SEmmanuel Vadot 		.freq = 1200000000,
47777f22241SEmmanuel Vadot 		.refdiv = 1,
47877f22241SEmmanuel Vadot 		.fbdiv = 50,
47977f22241SEmmanuel Vadot 		.postdiv1 = 1,
48077f22241SEmmanuel Vadot 		.postdiv2 = 1,
48177f22241SEmmanuel Vadot 		.dsmpd = 1,
48277f22241SEmmanuel Vadot 	},
48377f22241SEmmanuel Vadot 	{
48477f22241SEmmanuel Vadot 		.freq = 1188000000,
48577f22241SEmmanuel Vadot 		.refdiv = 2,
48677f22241SEmmanuel Vadot 		.fbdiv = 99,
48777f22241SEmmanuel Vadot 		.postdiv1 = 1,
48877f22241SEmmanuel Vadot 		.postdiv2 = 1,
48977f22241SEmmanuel Vadot 		.dsmpd = 1,
49077f22241SEmmanuel Vadot 	},
49177f22241SEmmanuel Vadot 	{
49277f22241SEmmanuel Vadot 		.freq = 1104000000,
49377f22241SEmmanuel Vadot 		.refdiv = 1,
49477f22241SEmmanuel Vadot 		.fbdiv = 46,
49577f22241SEmmanuel Vadot 		.postdiv1 = 1,
49677f22241SEmmanuel Vadot 		.postdiv2 = 1,
49777f22241SEmmanuel Vadot 		.dsmpd = 1,
49877f22241SEmmanuel Vadot 	},
49977f22241SEmmanuel Vadot 	{
50077f22241SEmmanuel Vadot 		.freq = 1100000000,
50177f22241SEmmanuel Vadot 		.refdiv = 12,
50277f22241SEmmanuel Vadot 		.fbdiv = 550,
50377f22241SEmmanuel Vadot 		.postdiv1 = 1,
50477f22241SEmmanuel Vadot 		.postdiv2 = 1,
50577f22241SEmmanuel Vadot 		.dsmpd = 1,
50677f22241SEmmanuel Vadot 	},
50777f22241SEmmanuel Vadot 	{
50877f22241SEmmanuel Vadot 		.freq = 1008000000,
50977f22241SEmmanuel Vadot 		.refdiv = 1,
51077f22241SEmmanuel Vadot 		.fbdiv = 84,
51177f22241SEmmanuel Vadot 		.postdiv1 = 2,
51277f22241SEmmanuel Vadot 		.postdiv2 = 1,
51377f22241SEmmanuel Vadot 		.dsmpd = 1,
51477f22241SEmmanuel Vadot 	},
51577f22241SEmmanuel Vadot 	{
51677f22241SEmmanuel Vadot 		.freq = 1000000000,
51777f22241SEmmanuel Vadot 		.refdiv = 1,
51877f22241SEmmanuel Vadot 		.fbdiv = 125,
51977f22241SEmmanuel Vadot 		.postdiv1 = 3,
52077f22241SEmmanuel Vadot 		.postdiv2 = 1,
52177f22241SEmmanuel Vadot 		.dsmpd = 1,
52277f22241SEmmanuel Vadot 	},
52377f22241SEmmanuel Vadot 	{
52477f22241SEmmanuel Vadot 		.freq = 984000000,
52577f22241SEmmanuel Vadot 		.refdiv = 1,
52677f22241SEmmanuel Vadot 		.fbdiv = 82,
52777f22241SEmmanuel Vadot 		.postdiv1 = 2,
52877f22241SEmmanuel Vadot 		.postdiv2 = 1,
52977f22241SEmmanuel Vadot 		.dsmpd = 1,
53077f22241SEmmanuel Vadot 	},
53177f22241SEmmanuel Vadot 	{
53277f22241SEmmanuel Vadot 		.freq = 960000000,
53377f22241SEmmanuel Vadot 		.refdiv = 1,
53477f22241SEmmanuel Vadot 		.fbdiv = 80,
53577f22241SEmmanuel Vadot 		.postdiv1 = 2,
53677f22241SEmmanuel Vadot 		.postdiv2 = 1,
53777f22241SEmmanuel Vadot 		.dsmpd = 1,
53877f22241SEmmanuel Vadot 	},
53977f22241SEmmanuel Vadot 	{
54077f22241SEmmanuel Vadot 		.freq = 936000000,
54177f22241SEmmanuel Vadot 		.refdiv = 1,
54277f22241SEmmanuel Vadot 		.fbdiv = 78,
54377f22241SEmmanuel Vadot 		.postdiv1 = 2,
54477f22241SEmmanuel Vadot 		.postdiv2 = 1,
54577f22241SEmmanuel Vadot 		.dsmpd = 1,
54677f22241SEmmanuel Vadot 	},
54777f22241SEmmanuel Vadot 	{
54877f22241SEmmanuel Vadot 		.freq = 912000000,
54977f22241SEmmanuel Vadot 		.refdiv = 1,
55077f22241SEmmanuel Vadot 		.fbdiv = 76,
55177f22241SEmmanuel Vadot 		.postdiv1 = 2,
55277f22241SEmmanuel Vadot 		.postdiv2 = 1,
55377f22241SEmmanuel Vadot 		.dsmpd = 1,
55477f22241SEmmanuel Vadot 	},
55577f22241SEmmanuel Vadot 	{
55677f22241SEmmanuel Vadot 		.freq = 900000000,
55777f22241SEmmanuel Vadot 		.refdiv = 4,
55877f22241SEmmanuel Vadot 		.fbdiv = 300,
55977f22241SEmmanuel Vadot 		.postdiv1 = 2,
56077f22241SEmmanuel Vadot 		.postdiv2 = 1,
56177f22241SEmmanuel Vadot 		.dsmpd = 1,
56277f22241SEmmanuel Vadot 	},
56377f22241SEmmanuel Vadot 	{
56477f22241SEmmanuel Vadot 		.freq = 888000000,
56577f22241SEmmanuel Vadot 		.refdiv = 1,
56677f22241SEmmanuel Vadot 		.fbdiv = 74,
56777f22241SEmmanuel Vadot 		.postdiv1 = 2,
56877f22241SEmmanuel Vadot 		.postdiv2 = 1,
56977f22241SEmmanuel Vadot 		.dsmpd = 1,
57077f22241SEmmanuel Vadot 	},
57177f22241SEmmanuel Vadot 	{
57277f22241SEmmanuel Vadot 		.freq = 864000000,
57377f22241SEmmanuel Vadot 		.refdiv = 1,
57477f22241SEmmanuel Vadot 		.fbdiv = 72,
57577f22241SEmmanuel Vadot 		.postdiv1 = 2,
57677f22241SEmmanuel Vadot 		.postdiv2 = 1,
57777f22241SEmmanuel Vadot 		.dsmpd = 1,
57877f22241SEmmanuel Vadot 	},
57977f22241SEmmanuel Vadot 	{
58077f22241SEmmanuel Vadot 		.freq = 840000000,
58177f22241SEmmanuel Vadot 		.refdiv = 1,
58277f22241SEmmanuel Vadot 		.fbdiv = 70,
58377f22241SEmmanuel Vadot 		.postdiv1 = 2,
58477f22241SEmmanuel Vadot 		.postdiv2 = 1,
58577f22241SEmmanuel Vadot 		.dsmpd = 1,
58677f22241SEmmanuel Vadot 	},
58777f22241SEmmanuel Vadot 	{
58877f22241SEmmanuel Vadot 		.freq = 816000000,
58977f22241SEmmanuel Vadot 		.refdiv = 1,
59077f22241SEmmanuel Vadot 		.fbdiv = 68,
59177f22241SEmmanuel Vadot 		.postdiv1 = 2,
59277f22241SEmmanuel Vadot 		.postdiv2 = 1,
59377f22241SEmmanuel Vadot 		.dsmpd = 1,
59477f22241SEmmanuel Vadot 	},
59577f22241SEmmanuel Vadot 	{
59677f22241SEmmanuel Vadot 		.freq = 800000000,
59777f22241SEmmanuel Vadot 		.refdiv = 1,
59877f22241SEmmanuel Vadot 		.fbdiv = 100,
59977f22241SEmmanuel Vadot 		.postdiv1 = 3,
60077f22241SEmmanuel Vadot 		.postdiv2 = 1,
60177f22241SEmmanuel Vadot 		.dsmpd = 1,
60277f22241SEmmanuel Vadot 	},
60377f22241SEmmanuel Vadot 	{
60477f22241SEmmanuel Vadot 		.freq = 700000000,
60577f22241SEmmanuel Vadot 		.refdiv = 6,
60677f22241SEmmanuel Vadot 		.fbdiv = 350,
60777f22241SEmmanuel Vadot 		.postdiv1 = 2,
60877f22241SEmmanuel Vadot 		.postdiv2 = 1,
60977f22241SEmmanuel Vadot 		.dsmpd = 1,
61077f22241SEmmanuel Vadot 	},
61177f22241SEmmanuel Vadot 	{
61277f22241SEmmanuel Vadot 		.freq = 696000000,
61377f22241SEmmanuel Vadot 		.refdiv = 1,
61477f22241SEmmanuel Vadot 		.fbdiv = 58,
61577f22241SEmmanuel Vadot 		.postdiv1 = 2,
61677f22241SEmmanuel Vadot 		.postdiv2 = 1,
61777f22241SEmmanuel Vadot 		.dsmpd = 1,
61877f22241SEmmanuel Vadot 	},
61977f22241SEmmanuel Vadot 	{
62077f22241SEmmanuel Vadot 		.freq = 676000000,
62177f22241SEmmanuel Vadot 		.refdiv = 3,
62277f22241SEmmanuel Vadot 		.fbdiv = 169,
62377f22241SEmmanuel Vadot 		.postdiv1 = 2,
62477f22241SEmmanuel Vadot 		.postdiv2 = 1,
62577f22241SEmmanuel Vadot 		.dsmpd = 1,
62677f22241SEmmanuel Vadot 	},
62777f22241SEmmanuel Vadot 	{
62877f22241SEmmanuel Vadot 		.freq = 600000000,
62977f22241SEmmanuel Vadot 		.refdiv = 1,
63077f22241SEmmanuel Vadot 		.fbdiv = 75,
63177f22241SEmmanuel Vadot 		.postdiv1 = 3,
63277f22241SEmmanuel Vadot 		.postdiv2 = 1,
63377f22241SEmmanuel Vadot 		.dsmpd = 1,
63477f22241SEmmanuel Vadot 	},
63577f22241SEmmanuel Vadot 	{
63677f22241SEmmanuel Vadot 		.freq = 594000000,
63777f22241SEmmanuel Vadot 		.refdiv = 1,
63877f22241SEmmanuel Vadot 		.fbdiv = 99,
63977f22241SEmmanuel Vadot 		.postdiv1 = 4,
64077f22241SEmmanuel Vadot 		.postdiv2 = 1,
64177f22241SEmmanuel Vadot 		.dsmpd = 1,
64277f22241SEmmanuel Vadot 	},
64377f22241SEmmanuel Vadot 	{
64477f22241SEmmanuel Vadot 		.freq = 533250000,
64577f22241SEmmanuel Vadot 		.refdiv = 8,
64677f22241SEmmanuel Vadot 		.fbdiv = 711,
64777f22241SEmmanuel Vadot 		.postdiv1 = 4,
64877f22241SEmmanuel Vadot 		.postdiv2 = 1,
64977f22241SEmmanuel Vadot 		.dsmpd = 1,
65077f22241SEmmanuel Vadot 	},
65177f22241SEmmanuel Vadot 	{
65277f22241SEmmanuel Vadot 		.freq = 504000000,
65377f22241SEmmanuel Vadot 		.refdiv = 1,
65477f22241SEmmanuel Vadot 		.fbdiv = 63,
65577f22241SEmmanuel Vadot 		.postdiv1 = 3,
65677f22241SEmmanuel Vadot 		.postdiv2 = 1,
65777f22241SEmmanuel Vadot 		.dsmpd = 1,
65877f22241SEmmanuel Vadot 	},
65977f22241SEmmanuel Vadot 	{
66077f22241SEmmanuel Vadot 		.freq = 500000000,
66177f22241SEmmanuel Vadot 		.refdiv = 6,
66277f22241SEmmanuel Vadot 		.fbdiv = 250,
66377f22241SEmmanuel Vadot 		.postdiv1 = 2,
66477f22241SEmmanuel Vadot 		.postdiv2 = 1,
66577f22241SEmmanuel Vadot 		.dsmpd = 1,
66677f22241SEmmanuel Vadot 	},
66777f22241SEmmanuel Vadot 	{
66877f22241SEmmanuel Vadot 		.freq = 408000000,
66977f22241SEmmanuel Vadot 		.refdiv = 1,
67077f22241SEmmanuel Vadot 		.fbdiv = 68,
67177f22241SEmmanuel Vadot 		.postdiv1 = 2,
67277f22241SEmmanuel Vadot 		.postdiv2 = 2,
67377f22241SEmmanuel Vadot 		.dsmpd = 1,
67477f22241SEmmanuel Vadot 	},
67577f22241SEmmanuel Vadot 	{
67677f22241SEmmanuel Vadot 		.freq = 312000000,
67777f22241SEmmanuel Vadot 		.refdiv = 1,
67877f22241SEmmanuel Vadot 		.fbdiv = 52,
67977f22241SEmmanuel Vadot 		.postdiv1 = 2,
68077f22241SEmmanuel Vadot 		.postdiv2 = 2,
68177f22241SEmmanuel Vadot 		.dsmpd = 1,
68277f22241SEmmanuel Vadot 	},
68377f22241SEmmanuel Vadot 	{
68477f22241SEmmanuel Vadot 		.freq = 297000000,
68577f22241SEmmanuel Vadot 		.refdiv = 1,
68677f22241SEmmanuel Vadot 		.fbdiv = 99,
68777f22241SEmmanuel Vadot 		.postdiv1 = 4,
68877f22241SEmmanuel Vadot 		.postdiv2 = 2,
68977f22241SEmmanuel Vadot 		.dsmpd = 1,
69077f22241SEmmanuel Vadot 	},
69177f22241SEmmanuel Vadot 	{
69277f22241SEmmanuel Vadot 		.freq = 216000000,
69377f22241SEmmanuel Vadot 		.refdiv = 1,
69477f22241SEmmanuel Vadot 		.fbdiv = 72,
69577f22241SEmmanuel Vadot 		.postdiv1 = 4,
69677f22241SEmmanuel Vadot 		.postdiv2 = 2,
69777f22241SEmmanuel Vadot 		.dsmpd = 1,
69877f22241SEmmanuel Vadot 	},
69977f22241SEmmanuel Vadot 	{
70077f22241SEmmanuel Vadot 		.freq = 148500000,
70177f22241SEmmanuel Vadot 		.refdiv = 1,
70277f22241SEmmanuel Vadot 		.fbdiv = 99,
70377f22241SEmmanuel Vadot 		.postdiv1 = 4,
70477f22241SEmmanuel Vadot 		.postdiv2 = 4,
70577f22241SEmmanuel Vadot 		.dsmpd = 1,
70677f22241SEmmanuel Vadot 	},
70777f22241SEmmanuel Vadot 	{
70877f22241SEmmanuel Vadot 		.freq = 106500000,
70977f22241SEmmanuel Vadot 		.refdiv = 1,
71077f22241SEmmanuel Vadot 		.fbdiv = 71,
71177f22241SEmmanuel Vadot 		.postdiv1 = 4,
71277f22241SEmmanuel Vadot 		.postdiv2 = 4,
71377f22241SEmmanuel Vadot 		.dsmpd = 1,
71477f22241SEmmanuel Vadot 	},
71577f22241SEmmanuel Vadot 	{
71677f22241SEmmanuel Vadot 		.freq = 96000000,
71777f22241SEmmanuel Vadot 		.refdiv = 1,
71877f22241SEmmanuel Vadot 		.fbdiv = 64,
71977f22241SEmmanuel Vadot 		.postdiv1 = 4,
72077f22241SEmmanuel Vadot 		.postdiv2 = 4,
72177f22241SEmmanuel Vadot 		.dsmpd = 1,
72277f22241SEmmanuel Vadot 	},
72377f22241SEmmanuel Vadot 	{
72477f22241SEmmanuel Vadot 		.freq = 74250000,
72577f22241SEmmanuel Vadot 		.refdiv = 2,
72677f22241SEmmanuel Vadot 		.fbdiv = 99,
72777f22241SEmmanuel Vadot 		.postdiv1 = 4,
72877f22241SEmmanuel Vadot 		.postdiv2 = 4,
72977f22241SEmmanuel Vadot 		.dsmpd = 1,
73077f22241SEmmanuel Vadot 	},
73177f22241SEmmanuel Vadot 	{
73277f22241SEmmanuel Vadot 		.freq = 65000000,
73377f22241SEmmanuel Vadot 		.refdiv = 1,
73477f22241SEmmanuel Vadot 		.fbdiv = 65,
73577f22241SEmmanuel Vadot 		.postdiv1 = 6,
73677f22241SEmmanuel Vadot 		.postdiv2 = 4,
73777f22241SEmmanuel Vadot 		.dsmpd = 1,
73877f22241SEmmanuel Vadot 	},
73977f22241SEmmanuel Vadot 	{
74077f22241SEmmanuel Vadot 		.freq = 54000000,
74177f22241SEmmanuel Vadot 		.refdiv = 1,
74277f22241SEmmanuel Vadot 		.fbdiv = 54,
74377f22241SEmmanuel Vadot 		.postdiv1 = 6,
74477f22241SEmmanuel Vadot 		.postdiv2 = 4,
74577f22241SEmmanuel Vadot 		.dsmpd = 1,
74677f22241SEmmanuel Vadot 	},
74777f22241SEmmanuel Vadot 	{
74877f22241SEmmanuel Vadot 		.freq = 27000000,
74977f22241SEmmanuel Vadot 		.refdiv = 1,
75077f22241SEmmanuel Vadot 		.fbdiv = 27,
75177f22241SEmmanuel Vadot 		.postdiv1 = 6,
75277f22241SEmmanuel Vadot 		.postdiv2 = 4,
75377f22241SEmmanuel Vadot 		.dsmpd = 1,
75477f22241SEmmanuel Vadot 	},
75577f22241SEmmanuel Vadot 	{},
75677f22241SEmmanuel Vadot };
75777f22241SEmmanuel Vadot 
75877f22241SEmmanuel Vadot PLIST(xin24m_p) = {"xin24m"};
75977f22241SEmmanuel Vadot PLIST(xin24m_xin32k_p) = {"xin24m", "xin32k"};
76077f22241SEmmanuel Vadot PLIST(xin24m_ppll_p) = {"xin24m", "ppll"};
76177f22241SEmmanuel Vadot PLIST(uart4_p) = {"clk_uart4_c", "clk_uart4_frac", "xin24m"};
76277f22241SEmmanuel Vadot PLIST(wifi_p) = {"clk_wifi_c", "clk_wifi_frac"};
76377f22241SEmmanuel Vadot 
76477f22241SEmmanuel Vadot static struct rk_clk_pll_def ppll = {
76577f22241SEmmanuel Vadot 	.clkdef = {
76677f22241SEmmanuel Vadot 		.id = PLL_PPLL,
76777f22241SEmmanuel Vadot 		.name = "ppll",
76877f22241SEmmanuel Vadot 		.parent_names = xin24m_p,
76977f22241SEmmanuel Vadot 		.parent_cnt = nitems(xin24m_p),
77077f22241SEmmanuel Vadot 	},
77177f22241SEmmanuel Vadot 	.base_offset = 0x00,
77277f22241SEmmanuel Vadot 
77377f22241SEmmanuel Vadot 	.rates = rk3399_pll_rates,
77477f22241SEmmanuel Vadot };
77577f22241SEmmanuel Vadot 
77677f22241SEmmanuel Vadot static struct rk_clk rk3399_pmu_clks[] = {
77777f22241SEmmanuel Vadot 	/* Linked clocks */
77877f22241SEmmanuel Vadot 	LINK("xin32k"),
77977f22241SEmmanuel Vadot 
78077f22241SEmmanuel Vadot 	{
78177f22241SEmmanuel Vadot 		.type = RK3399_CLK_PLL,
78277f22241SEmmanuel Vadot 		.clk.pll = &ppll
78377f22241SEmmanuel Vadot 	},
78477f22241SEmmanuel Vadot 
78577f22241SEmmanuel Vadot 	/* PMUCRU_CLKSEL_CON0 */
78677f22241SEmmanuel Vadot 	CDIV(PCLK_PMU_SRC, "pclk_pmu_src", "ppll", 0, 0, 0, 5),
78777f22241SEmmanuel Vadot 	/* 5:7 Reserved */
78877f22241SEmmanuel Vadot 	/* 8:12 cm0s_div */
78977f22241SEmmanuel Vadot 	/* 13:14 Reserved */
79077f22241SEmmanuel Vadot 	/* 15 cm0s_clk_pll_sel */
79177f22241SEmmanuel Vadot 
79277f22241SEmmanuel Vadot 	/* PMUCRU_CLKSEL_CON1 */
79377f22241SEmmanuel Vadot 	COMP(0, "clk_spi3_c", xin24m_ppll_p, 0, 1, 0, 7, 7, 1),
79477f22241SEmmanuel Vadot 	COMP(0, "clk_wifi_c", xin24m_ppll_p, 0, 1, 8, 5, 13, 1),
79577f22241SEmmanuel Vadot 	MUX(0, "clk_wifi_sel", wifi_p, 0, 1, 14, 1),
79677f22241SEmmanuel Vadot 	MUX(0, "clk_timer_sel", xin24m_xin32k_p, 0, 1, 15, 1),
79777f22241SEmmanuel Vadot 
79877f22241SEmmanuel Vadot 	/* PMUCRU_CLKSEL_CON2 */
79977f22241SEmmanuel Vadot 	CDIV(0, "clk_i2c0_div", "ppll", 0, 2, 0, 7),
80077f22241SEmmanuel Vadot 	/* 7 Reserved */
80177f22241SEmmanuel Vadot 	CDIV(0, "clk_i2c8_div", "ppll", 0, 2, 8, 7),
80277f22241SEmmanuel Vadot 	/* 15 Reserved */
80377f22241SEmmanuel Vadot 
80477f22241SEmmanuel Vadot 	/* PMUCRU_CLKSEL_CON3 */
80577f22241SEmmanuel Vadot 	CDIV(0, "clk_i2c4_div", "ppll", 0, 3, 0, 7),
80677f22241SEmmanuel Vadot 	/* 7:15 Reserved */
80777f22241SEmmanuel Vadot 
80877f22241SEmmanuel Vadot 	/* PMUCRU_CLKSEL_CON4 */
80977f22241SEmmanuel Vadot 	/* 0:9 clk_32k_suspend_div */
81077f22241SEmmanuel Vadot 	/* 10:14 Reserved */
81177f22241SEmmanuel Vadot 	/* 15 clk_32k_suspend_sel */
81277f22241SEmmanuel Vadot 
81377f22241SEmmanuel Vadot 	/* PMUCRU_CLKSEL_CON5 */
81477f22241SEmmanuel Vadot 	COMP(0, "clk_uart4_c", xin24m_ppll_p, 0, 5, 0, 7, 10, 1),
81577f22241SEmmanuel Vadot 	/* 7 Reserved */
81677f22241SEmmanuel Vadot 	MUX(0, "clk_uart4_sel", uart4_p, 0, 5, 8, 2),
81777f22241SEmmanuel Vadot 	/* 11:15 Reserved */
81877f22241SEmmanuel Vadot 
81977f22241SEmmanuel Vadot 	/* PMUCRU_CLKFRAC_CON0 / PMUCRU_CLKSEL_CON6 */
82077f22241SEmmanuel Vadot 	FRACT(0, "clk_uart4_frac_frac", "clk_uart4_sel", 0, 6),
82177f22241SEmmanuel Vadot 
82277f22241SEmmanuel Vadot 	/* PMUCRU_CLKFRAC_CON1 / PMUCRU_CLKSEL_CON7 */
82377f22241SEmmanuel Vadot 	FRACT(0, "clk_wifi_frac", "clk_wifi_c", 0, 7),
82477f22241SEmmanuel Vadot };
82577f22241SEmmanuel Vadot 
82677f22241SEmmanuel Vadot static int
rk3399_pmucru_probe(device_t dev)82777f22241SEmmanuel Vadot rk3399_pmucru_probe(device_t dev)
82877f22241SEmmanuel Vadot {
82977f22241SEmmanuel Vadot 
83077f22241SEmmanuel Vadot 	if (!ofw_bus_status_okay(dev))
83177f22241SEmmanuel Vadot 		return (ENXIO);
83277f22241SEmmanuel Vadot 
83377f22241SEmmanuel Vadot 	if (ofw_bus_is_compatible(dev, "rockchip,rk3399-pmucru")) {
83477f22241SEmmanuel Vadot 		device_set_desc(dev, "Rockchip RK3399 PMU Clock and Reset Unit");
83577f22241SEmmanuel Vadot 		return (BUS_PROBE_DEFAULT);
83677f22241SEmmanuel Vadot 	}
83777f22241SEmmanuel Vadot 
83877f22241SEmmanuel Vadot 	return (ENXIO);
83977f22241SEmmanuel Vadot }
84077f22241SEmmanuel Vadot 
84177f22241SEmmanuel Vadot static int
rk3399_pmucru_attach(device_t dev)84277f22241SEmmanuel Vadot rk3399_pmucru_attach(device_t dev)
84377f22241SEmmanuel Vadot {
84477f22241SEmmanuel Vadot 	struct rk_cru_softc *sc;
84577f22241SEmmanuel Vadot 
84677f22241SEmmanuel Vadot 	sc = device_get_softc(dev);
84777f22241SEmmanuel Vadot 	sc->dev = dev;
84877f22241SEmmanuel Vadot 
84977f22241SEmmanuel Vadot 	sc->gates = rk3399_pmu_gates;
85077f22241SEmmanuel Vadot 	sc->ngates = nitems(rk3399_pmu_gates);
85177f22241SEmmanuel Vadot 
85277f22241SEmmanuel Vadot 	sc->clks = rk3399_pmu_clks;
85377f22241SEmmanuel Vadot 	sc->nclks = nitems(rk3399_pmu_clks);
85477f22241SEmmanuel Vadot 
85577f22241SEmmanuel Vadot 	sc->reset_offset = 0x110;
85677f22241SEmmanuel Vadot 	sc->reset_num = 30;
85777f22241SEmmanuel Vadot 
85877f22241SEmmanuel Vadot 	return (rk_cru_attach(dev));
85977f22241SEmmanuel Vadot }
86077f22241SEmmanuel Vadot 
86177f22241SEmmanuel Vadot static device_method_t rk3399_pmucru_methods[] = {
86277f22241SEmmanuel Vadot 	/* Device interface */
86377f22241SEmmanuel Vadot 	DEVMETHOD(device_probe,		rk3399_pmucru_probe),
86477f22241SEmmanuel Vadot 	DEVMETHOD(device_attach,	rk3399_pmucru_attach),
86577f22241SEmmanuel Vadot 
86677f22241SEmmanuel Vadot 	DEVMETHOD_END
86777f22241SEmmanuel Vadot };
86877f22241SEmmanuel Vadot 
86977f22241SEmmanuel Vadot DEFINE_CLASS_1(rk3399_pmucru, rk3399_pmucru_driver, rk3399_pmucru_methods,
87077f22241SEmmanuel Vadot   sizeof(struct rk_cru_softc), rk_cru_driver);
87177f22241SEmmanuel Vadot 
87277f22241SEmmanuel Vadot EARLY_DRIVER_MODULE(rk3399_pmucru, simplebus, rk3399_pmucru_driver, 0, 0,
87377f22241SEmmanuel Vadot     BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE);
874