18c2ecf20Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * Copyright (c) 2015 Endless Mobile, Inc.
48c2ecf20Sopenharmony_ci * Author: Carlo Caione <carlo@endlessm.com>
58c2ecf20Sopenharmony_ci *
68c2ecf20Sopenharmony_ci * Copyright (c) 2016 BayLibre, Inc.
78c2ecf20Sopenharmony_ci * Michael Turquette <mturquette@baylibre.com>
88c2ecf20Sopenharmony_ci */
98c2ecf20Sopenharmony_ci
108c2ecf20Sopenharmony_ci#include <linux/clk.h>
118c2ecf20Sopenharmony_ci#include <linux/clk-provider.h>
128c2ecf20Sopenharmony_ci#include <linux/init.h>
138c2ecf20Sopenharmony_ci#include <linux/mfd/syscon.h>
148c2ecf20Sopenharmony_ci#include <linux/of_address.h>
158c2ecf20Sopenharmony_ci#include <linux/reset-controller.h>
168c2ecf20Sopenharmony_ci#include <linux/slab.h>
178c2ecf20Sopenharmony_ci#include <linux/regmap.h>
188c2ecf20Sopenharmony_ci
198c2ecf20Sopenharmony_ci#include "meson8b.h"
208c2ecf20Sopenharmony_ci#include "clk-regmap.h"
218c2ecf20Sopenharmony_ci#include "clk-pll.h"
228c2ecf20Sopenharmony_ci#include "clk-mpll.h"
238c2ecf20Sopenharmony_ci
248c2ecf20Sopenharmony_cistatic DEFINE_SPINLOCK(meson_clk_lock);
258c2ecf20Sopenharmony_ci
268c2ecf20Sopenharmony_cistruct meson8b_clk_reset {
278c2ecf20Sopenharmony_ci	struct reset_controller_dev reset;
288c2ecf20Sopenharmony_ci	struct regmap *regmap;
298c2ecf20Sopenharmony_ci};
308c2ecf20Sopenharmony_ci
318c2ecf20Sopenharmony_cistatic const struct pll_params_table sys_pll_params_table[] = {
328c2ecf20Sopenharmony_ci	PLL_PARAMS(50, 1),
338c2ecf20Sopenharmony_ci	PLL_PARAMS(51, 1),
348c2ecf20Sopenharmony_ci	PLL_PARAMS(52, 1),
358c2ecf20Sopenharmony_ci	PLL_PARAMS(53, 1),
368c2ecf20Sopenharmony_ci	PLL_PARAMS(54, 1),
378c2ecf20Sopenharmony_ci	PLL_PARAMS(55, 1),
388c2ecf20Sopenharmony_ci	PLL_PARAMS(56, 1),
398c2ecf20Sopenharmony_ci	PLL_PARAMS(57, 1),
408c2ecf20Sopenharmony_ci	PLL_PARAMS(58, 1),
418c2ecf20Sopenharmony_ci	PLL_PARAMS(59, 1),
428c2ecf20Sopenharmony_ci	PLL_PARAMS(60, 1),
438c2ecf20Sopenharmony_ci	PLL_PARAMS(61, 1),
448c2ecf20Sopenharmony_ci	PLL_PARAMS(62, 1),
458c2ecf20Sopenharmony_ci	PLL_PARAMS(63, 1),
468c2ecf20Sopenharmony_ci	PLL_PARAMS(64, 1),
478c2ecf20Sopenharmony_ci	PLL_PARAMS(65, 1),
488c2ecf20Sopenharmony_ci	PLL_PARAMS(66, 1),
498c2ecf20Sopenharmony_ci	PLL_PARAMS(67, 1),
508c2ecf20Sopenharmony_ci	PLL_PARAMS(68, 1),
518c2ecf20Sopenharmony_ci	PLL_PARAMS(84, 1),
528c2ecf20Sopenharmony_ci	{ /* sentinel */ },
538c2ecf20Sopenharmony_ci};
548c2ecf20Sopenharmony_ci
558c2ecf20Sopenharmony_cistatic struct clk_fixed_rate meson8b_xtal = {
568c2ecf20Sopenharmony_ci	.fixed_rate = 24000000,
578c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
588c2ecf20Sopenharmony_ci		.name = "xtal",
598c2ecf20Sopenharmony_ci		.num_parents = 0,
608c2ecf20Sopenharmony_ci		.ops = &clk_fixed_rate_ops,
618c2ecf20Sopenharmony_ci	},
628c2ecf20Sopenharmony_ci};
638c2ecf20Sopenharmony_ci
648c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_fixed_pll_dco = {
658c2ecf20Sopenharmony_ci	.data = &(struct meson_clk_pll_data){
668c2ecf20Sopenharmony_ci		.en = {
678c2ecf20Sopenharmony_ci			.reg_off = HHI_MPLL_CNTL,
688c2ecf20Sopenharmony_ci			.shift   = 30,
698c2ecf20Sopenharmony_ci			.width   = 1,
708c2ecf20Sopenharmony_ci		},
718c2ecf20Sopenharmony_ci		.m = {
728c2ecf20Sopenharmony_ci			.reg_off = HHI_MPLL_CNTL,
738c2ecf20Sopenharmony_ci			.shift   = 0,
748c2ecf20Sopenharmony_ci			.width   = 9,
758c2ecf20Sopenharmony_ci		},
768c2ecf20Sopenharmony_ci		.n = {
778c2ecf20Sopenharmony_ci			.reg_off = HHI_MPLL_CNTL,
788c2ecf20Sopenharmony_ci			.shift   = 9,
798c2ecf20Sopenharmony_ci			.width   = 5,
808c2ecf20Sopenharmony_ci		},
818c2ecf20Sopenharmony_ci		.frac = {
828c2ecf20Sopenharmony_ci			.reg_off = HHI_MPLL_CNTL2,
838c2ecf20Sopenharmony_ci			.shift   = 0,
848c2ecf20Sopenharmony_ci			.width   = 12,
858c2ecf20Sopenharmony_ci		},
868c2ecf20Sopenharmony_ci		.l = {
878c2ecf20Sopenharmony_ci			.reg_off = HHI_MPLL_CNTL,
888c2ecf20Sopenharmony_ci			.shift   = 31,
898c2ecf20Sopenharmony_ci			.width   = 1,
908c2ecf20Sopenharmony_ci		},
918c2ecf20Sopenharmony_ci		.rst = {
928c2ecf20Sopenharmony_ci			.reg_off = HHI_MPLL_CNTL,
938c2ecf20Sopenharmony_ci			.shift   = 29,
948c2ecf20Sopenharmony_ci			.width   = 1,
958c2ecf20Sopenharmony_ci		},
968c2ecf20Sopenharmony_ci	},
978c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
988c2ecf20Sopenharmony_ci		.name = "fixed_pll_dco",
998c2ecf20Sopenharmony_ci		.ops = &meson_clk_pll_ro_ops,
1008c2ecf20Sopenharmony_ci		.parent_data = &(const struct clk_parent_data) {
1018c2ecf20Sopenharmony_ci			.fw_name = "xtal",
1028c2ecf20Sopenharmony_ci			.name = "xtal",
1038c2ecf20Sopenharmony_ci			.index = -1,
1048c2ecf20Sopenharmony_ci		},
1058c2ecf20Sopenharmony_ci		.num_parents = 1,
1068c2ecf20Sopenharmony_ci	},
1078c2ecf20Sopenharmony_ci};
1088c2ecf20Sopenharmony_ci
1098c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_fixed_pll = {
1108c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_div_data){
1118c2ecf20Sopenharmony_ci		.offset = HHI_MPLL_CNTL,
1128c2ecf20Sopenharmony_ci		.shift = 16,
1138c2ecf20Sopenharmony_ci		.width = 2,
1148c2ecf20Sopenharmony_ci		.flags = CLK_DIVIDER_POWER_OF_TWO,
1158c2ecf20Sopenharmony_ci	},
1168c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
1178c2ecf20Sopenharmony_ci		.name = "fixed_pll",
1188c2ecf20Sopenharmony_ci		.ops = &clk_regmap_divider_ro_ops,
1198c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
1208c2ecf20Sopenharmony_ci			&meson8b_fixed_pll_dco.hw
1218c2ecf20Sopenharmony_ci		},
1228c2ecf20Sopenharmony_ci		.num_parents = 1,
1238c2ecf20Sopenharmony_ci		/*
1248c2ecf20Sopenharmony_ci		 * This clock won't ever change at runtime so
1258c2ecf20Sopenharmony_ci		 * CLK_SET_RATE_PARENT is not required
1268c2ecf20Sopenharmony_ci		 */
1278c2ecf20Sopenharmony_ci	},
1288c2ecf20Sopenharmony_ci};
1298c2ecf20Sopenharmony_ci
1308c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_hdmi_pll_dco = {
1318c2ecf20Sopenharmony_ci	.data = &(struct meson_clk_pll_data){
1328c2ecf20Sopenharmony_ci		.en = {
1338c2ecf20Sopenharmony_ci			.reg_off = HHI_VID_PLL_CNTL,
1348c2ecf20Sopenharmony_ci			.shift   = 30,
1358c2ecf20Sopenharmony_ci			.width   = 1,
1368c2ecf20Sopenharmony_ci		},
1378c2ecf20Sopenharmony_ci		.m = {
1388c2ecf20Sopenharmony_ci			.reg_off = HHI_VID_PLL_CNTL,
1398c2ecf20Sopenharmony_ci			.shift   = 0,
1408c2ecf20Sopenharmony_ci			.width   = 9,
1418c2ecf20Sopenharmony_ci		},
1428c2ecf20Sopenharmony_ci		.n = {
1438c2ecf20Sopenharmony_ci			.reg_off = HHI_VID_PLL_CNTL,
1448c2ecf20Sopenharmony_ci			.shift   = 10,
1458c2ecf20Sopenharmony_ci			.width   = 5,
1468c2ecf20Sopenharmony_ci		},
1478c2ecf20Sopenharmony_ci		.frac = {
1488c2ecf20Sopenharmony_ci			.reg_off = HHI_VID_PLL_CNTL2,
1498c2ecf20Sopenharmony_ci			.shift   = 0,
1508c2ecf20Sopenharmony_ci			.width   = 12,
1518c2ecf20Sopenharmony_ci		},
1528c2ecf20Sopenharmony_ci		.l = {
1538c2ecf20Sopenharmony_ci			.reg_off = HHI_VID_PLL_CNTL,
1548c2ecf20Sopenharmony_ci			.shift   = 31,
1558c2ecf20Sopenharmony_ci			.width   = 1,
1568c2ecf20Sopenharmony_ci		},
1578c2ecf20Sopenharmony_ci		.rst = {
1588c2ecf20Sopenharmony_ci			.reg_off = HHI_VID_PLL_CNTL,
1598c2ecf20Sopenharmony_ci			.shift   = 29,
1608c2ecf20Sopenharmony_ci			.width   = 1,
1618c2ecf20Sopenharmony_ci		},
1628c2ecf20Sopenharmony_ci	},
1638c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
1648c2ecf20Sopenharmony_ci		/* sometimes also called "HPLL" or "HPLL PLL" */
1658c2ecf20Sopenharmony_ci		.name = "hdmi_pll_dco",
1668c2ecf20Sopenharmony_ci		.ops = &meson_clk_pll_ro_ops,
1678c2ecf20Sopenharmony_ci		.parent_data = &(const struct clk_parent_data) {
1688c2ecf20Sopenharmony_ci			.fw_name = "xtal",
1698c2ecf20Sopenharmony_ci			.name = "xtal",
1708c2ecf20Sopenharmony_ci			.index = -1,
1718c2ecf20Sopenharmony_ci		},
1728c2ecf20Sopenharmony_ci		.num_parents = 1,
1738c2ecf20Sopenharmony_ci	},
1748c2ecf20Sopenharmony_ci};
1758c2ecf20Sopenharmony_ci
1768c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_hdmi_pll_lvds_out = {
1778c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_div_data){
1788c2ecf20Sopenharmony_ci		.offset = HHI_VID_PLL_CNTL,
1798c2ecf20Sopenharmony_ci		.shift = 16,
1808c2ecf20Sopenharmony_ci		.width = 2,
1818c2ecf20Sopenharmony_ci		.flags = CLK_DIVIDER_POWER_OF_TWO,
1828c2ecf20Sopenharmony_ci	},
1838c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
1848c2ecf20Sopenharmony_ci		.name = "hdmi_pll_lvds_out",
1858c2ecf20Sopenharmony_ci		.ops = &clk_regmap_divider_ro_ops,
1868c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
1878c2ecf20Sopenharmony_ci			&meson8b_hdmi_pll_dco.hw
1888c2ecf20Sopenharmony_ci		},
1898c2ecf20Sopenharmony_ci		.num_parents = 1,
1908c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
1918c2ecf20Sopenharmony_ci	},
1928c2ecf20Sopenharmony_ci};
1938c2ecf20Sopenharmony_ci
1948c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_hdmi_pll_hdmi_out = {
1958c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_div_data){
1968c2ecf20Sopenharmony_ci		.offset = HHI_VID_PLL_CNTL,
1978c2ecf20Sopenharmony_ci		.shift = 18,
1988c2ecf20Sopenharmony_ci		.width = 2,
1998c2ecf20Sopenharmony_ci		.flags = CLK_DIVIDER_POWER_OF_TWO,
2008c2ecf20Sopenharmony_ci	},
2018c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
2028c2ecf20Sopenharmony_ci		.name = "hdmi_pll_hdmi_out",
2038c2ecf20Sopenharmony_ci		.ops = &clk_regmap_divider_ro_ops,
2048c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
2058c2ecf20Sopenharmony_ci			&meson8b_hdmi_pll_dco.hw
2068c2ecf20Sopenharmony_ci		},
2078c2ecf20Sopenharmony_ci		.num_parents = 1,
2088c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
2098c2ecf20Sopenharmony_ci	},
2108c2ecf20Sopenharmony_ci};
2118c2ecf20Sopenharmony_ci
2128c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_sys_pll_dco = {
2138c2ecf20Sopenharmony_ci	.data = &(struct meson_clk_pll_data){
2148c2ecf20Sopenharmony_ci		.en = {
2158c2ecf20Sopenharmony_ci			.reg_off = HHI_SYS_PLL_CNTL,
2168c2ecf20Sopenharmony_ci			.shift   = 30,
2178c2ecf20Sopenharmony_ci			.width   = 1,
2188c2ecf20Sopenharmony_ci		},
2198c2ecf20Sopenharmony_ci		.m = {
2208c2ecf20Sopenharmony_ci			.reg_off = HHI_SYS_PLL_CNTL,
2218c2ecf20Sopenharmony_ci			.shift   = 0,
2228c2ecf20Sopenharmony_ci			.width   = 9,
2238c2ecf20Sopenharmony_ci		},
2248c2ecf20Sopenharmony_ci		.n = {
2258c2ecf20Sopenharmony_ci			.reg_off = HHI_SYS_PLL_CNTL,
2268c2ecf20Sopenharmony_ci			.shift   = 9,
2278c2ecf20Sopenharmony_ci			.width   = 5,
2288c2ecf20Sopenharmony_ci		},
2298c2ecf20Sopenharmony_ci		.l = {
2308c2ecf20Sopenharmony_ci			.reg_off = HHI_SYS_PLL_CNTL,
2318c2ecf20Sopenharmony_ci			.shift   = 31,
2328c2ecf20Sopenharmony_ci			.width   = 1,
2338c2ecf20Sopenharmony_ci		},
2348c2ecf20Sopenharmony_ci		.rst = {
2358c2ecf20Sopenharmony_ci			.reg_off = HHI_SYS_PLL_CNTL,
2368c2ecf20Sopenharmony_ci			.shift   = 29,
2378c2ecf20Sopenharmony_ci			.width   = 1,
2388c2ecf20Sopenharmony_ci		},
2398c2ecf20Sopenharmony_ci		.table = sys_pll_params_table,
2408c2ecf20Sopenharmony_ci	},
2418c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
2428c2ecf20Sopenharmony_ci		.name = "sys_pll_dco",
2438c2ecf20Sopenharmony_ci		.ops = &meson_clk_pll_ops,
2448c2ecf20Sopenharmony_ci		.parent_data = &(const struct clk_parent_data) {
2458c2ecf20Sopenharmony_ci			.fw_name = "xtal",
2468c2ecf20Sopenharmony_ci			.name = "xtal",
2478c2ecf20Sopenharmony_ci			.index = -1,
2488c2ecf20Sopenharmony_ci		},
2498c2ecf20Sopenharmony_ci		.num_parents = 1,
2508c2ecf20Sopenharmony_ci	},
2518c2ecf20Sopenharmony_ci};
2528c2ecf20Sopenharmony_ci
2538c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_sys_pll = {
2548c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_div_data){
2558c2ecf20Sopenharmony_ci		.offset = HHI_SYS_PLL_CNTL,
2568c2ecf20Sopenharmony_ci		.shift = 16,
2578c2ecf20Sopenharmony_ci		.width = 2,
2588c2ecf20Sopenharmony_ci		.flags = CLK_DIVIDER_POWER_OF_TWO,
2598c2ecf20Sopenharmony_ci	},
2608c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
2618c2ecf20Sopenharmony_ci		.name = "sys_pll",
2628c2ecf20Sopenharmony_ci		.ops = &clk_regmap_divider_ops,
2638c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
2648c2ecf20Sopenharmony_ci			&meson8b_sys_pll_dco.hw
2658c2ecf20Sopenharmony_ci		},
2668c2ecf20Sopenharmony_ci		.num_parents = 1,
2678c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
2688c2ecf20Sopenharmony_ci	},
2698c2ecf20Sopenharmony_ci};
2708c2ecf20Sopenharmony_ci
2718c2ecf20Sopenharmony_cistatic struct clk_fixed_factor meson8b_fclk_div2_div = {
2728c2ecf20Sopenharmony_ci	.mult = 1,
2738c2ecf20Sopenharmony_ci	.div = 2,
2748c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
2758c2ecf20Sopenharmony_ci		.name = "fclk_div2_div",
2768c2ecf20Sopenharmony_ci		.ops = &clk_fixed_factor_ops,
2778c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
2788c2ecf20Sopenharmony_ci			&meson8b_fixed_pll.hw
2798c2ecf20Sopenharmony_ci		},
2808c2ecf20Sopenharmony_ci		.num_parents = 1,
2818c2ecf20Sopenharmony_ci	},
2828c2ecf20Sopenharmony_ci};
2838c2ecf20Sopenharmony_ci
2848c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_fclk_div2 = {
2858c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_gate_data){
2868c2ecf20Sopenharmony_ci		.offset = HHI_MPLL_CNTL6,
2878c2ecf20Sopenharmony_ci		.bit_idx = 27,
2888c2ecf20Sopenharmony_ci	},
2898c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
2908c2ecf20Sopenharmony_ci		.name = "fclk_div2",
2918c2ecf20Sopenharmony_ci		.ops = &clk_regmap_gate_ops,
2928c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
2938c2ecf20Sopenharmony_ci			&meson8b_fclk_div2_div.hw
2948c2ecf20Sopenharmony_ci		},
2958c2ecf20Sopenharmony_ci		.num_parents = 1,
2968c2ecf20Sopenharmony_ci	},
2978c2ecf20Sopenharmony_ci};
2988c2ecf20Sopenharmony_ci
2998c2ecf20Sopenharmony_cistatic struct clk_fixed_factor meson8b_fclk_div3_div = {
3008c2ecf20Sopenharmony_ci	.mult = 1,
3018c2ecf20Sopenharmony_ci	.div = 3,
3028c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
3038c2ecf20Sopenharmony_ci		.name = "fclk_div3_div",
3048c2ecf20Sopenharmony_ci		.ops = &clk_fixed_factor_ops,
3058c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
3068c2ecf20Sopenharmony_ci			&meson8b_fixed_pll.hw
3078c2ecf20Sopenharmony_ci		},
3088c2ecf20Sopenharmony_ci		.num_parents = 1,
3098c2ecf20Sopenharmony_ci	},
3108c2ecf20Sopenharmony_ci};
3118c2ecf20Sopenharmony_ci
3128c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_fclk_div3 = {
3138c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_gate_data){
3148c2ecf20Sopenharmony_ci		.offset = HHI_MPLL_CNTL6,
3158c2ecf20Sopenharmony_ci		.bit_idx = 28,
3168c2ecf20Sopenharmony_ci	},
3178c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
3188c2ecf20Sopenharmony_ci		.name = "fclk_div3",
3198c2ecf20Sopenharmony_ci		.ops = &clk_regmap_gate_ops,
3208c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
3218c2ecf20Sopenharmony_ci			&meson8b_fclk_div3_div.hw
3228c2ecf20Sopenharmony_ci		},
3238c2ecf20Sopenharmony_ci		.num_parents = 1,
3248c2ecf20Sopenharmony_ci	},
3258c2ecf20Sopenharmony_ci};
3268c2ecf20Sopenharmony_ci
3278c2ecf20Sopenharmony_cistatic struct clk_fixed_factor meson8b_fclk_div4_div = {
3288c2ecf20Sopenharmony_ci	.mult = 1,
3298c2ecf20Sopenharmony_ci	.div = 4,
3308c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
3318c2ecf20Sopenharmony_ci		.name = "fclk_div4_div",
3328c2ecf20Sopenharmony_ci		.ops = &clk_fixed_factor_ops,
3338c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
3348c2ecf20Sopenharmony_ci			&meson8b_fixed_pll.hw
3358c2ecf20Sopenharmony_ci		},
3368c2ecf20Sopenharmony_ci		.num_parents = 1,
3378c2ecf20Sopenharmony_ci	},
3388c2ecf20Sopenharmony_ci};
3398c2ecf20Sopenharmony_ci
3408c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_fclk_div4 = {
3418c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_gate_data){
3428c2ecf20Sopenharmony_ci		.offset = HHI_MPLL_CNTL6,
3438c2ecf20Sopenharmony_ci		.bit_idx = 29,
3448c2ecf20Sopenharmony_ci	},
3458c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
3468c2ecf20Sopenharmony_ci		.name = "fclk_div4",
3478c2ecf20Sopenharmony_ci		.ops = &clk_regmap_gate_ops,
3488c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
3498c2ecf20Sopenharmony_ci			&meson8b_fclk_div4_div.hw
3508c2ecf20Sopenharmony_ci		},
3518c2ecf20Sopenharmony_ci		.num_parents = 1,
3528c2ecf20Sopenharmony_ci	},
3538c2ecf20Sopenharmony_ci};
3548c2ecf20Sopenharmony_ci
3558c2ecf20Sopenharmony_cistatic struct clk_fixed_factor meson8b_fclk_div5_div = {
3568c2ecf20Sopenharmony_ci	.mult = 1,
3578c2ecf20Sopenharmony_ci	.div = 5,
3588c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
3598c2ecf20Sopenharmony_ci		.name = "fclk_div5_div",
3608c2ecf20Sopenharmony_ci		.ops = &clk_fixed_factor_ops,
3618c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
3628c2ecf20Sopenharmony_ci			&meson8b_fixed_pll.hw
3638c2ecf20Sopenharmony_ci		},
3648c2ecf20Sopenharmony_ci		.num_parents = 1,
3658c2ecf20Sopenharmony_ci	},
3668c2ecf20Sopenharmony_ci};
3678c2ecf20Sopenharmony_ci
3688c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_fclk_div5 = {
3698c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_gate_data){
3708c2ecf20Sopenharmony_ci		.offset = HHI_MPLL_CNTL6,
3718c2ecf20Sopenharmony_ci		.bit_idx = 30,
3728c2ecf20Sopenharmony_ci	},
3738c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
3748c2ecf20Sopenharmony_ci		.name = "fclk_div5",
3758c2ecf20Sopenharmony_ci		.ops = &clk_regmap_gate_ops,
3768c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
3778c2ecf20Sopenharmony_ci			&meson8b_fclk_div5_div.hw
3788c2ecf20Sopenharmony_ci		},
3798c2ecf20Sopenharmony_ci		.num_parents = 1,
3808c2ecf20Sopenharmony_ci	},
3818c2ecf20Sopenharmony_ci};
3828c2ecf20Sopenharmony_ci
3838c2ecf20Sopenharmony_cistatic struct clk_fixed_factor meson8b_fclk_div7_div = {
3848c2ecf20Sopenharmony_ci	.mult = 1,
3858c2ecf20Sopenharmony_ci	.div = 7,
3868c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
3878c2ecf20Sopenharmony_ci		.name = "fclk_div7_div",
3888c2ecf20Sopenharmony_ci		.ops = &clk_fixed_factor_ops,
3898c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
3908c2ecf20Sopenharmony_ci			&meson8b_fixed_pll.hw
3918c2ecf20Sopenharmony_ci		},
3928c2ecf20Sopenharmony_ci		.num_parents = 1,
3938c2ecf20Sopenharmony_ci	},
3948c2ecf20Sopenharmony_ci};
3958c2ecf20Sopenharmony_ci
3968c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_fclk_div7 = {
3978c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_gate_data){
3988c2ecf20Sopenharmony_ci		.offset = HHI_MPLL_CNTL6,
3998c2ecf20Sopenharmony_ci		.bit_idx = 31,
4008c2ecf20Sopenharmony_ci	},
4018c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
4028c2ecf20Sopenharmony_ci		.name = "fclk_div7",
4038c2ecf20Sopenharmony_ci		.ops = &clk_regmap_gate_ops,
4048c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
4058c2ecf20Sopenharmony_ci			&meson8b_fclk_div7_div.hw
4068c2ecf20Sopenharmony_ci		},
4078c2ecf20Sopenharmony_ci		.num_parents = 1,
4088c2ecf20Sopenharmony_ci	},
4098c2ecf20Sopenharmony_ci};
4108c2ecf20Sopenharmony_ci
4118c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_mpll_prediv = {
4128c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_div_data){
4138c2ecf20Sopenharmony_ci		.offset = HHI_MPLL_CNTL5,
4148c2ecf20Sopenharmony_ci		.shift = 12,
4158c2ecf20Sopenharmony_ci		.width = 1,
4168c2ecf20Sopenharmony_ci	},
4178c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
4188c2ecf20Sopenharmony_ci		.name = "mpll_prediv",
4198c2ecf20Sopenharmony_ci		.ops = &clk_regmap_divider_ro_ops,
4208c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
4218c2ecf20Sopenharmony_ci			&meson8b_fixed_pll.hw
4228c2ecf20Sopenharmony_ci		},
4238c2ecf20Sopenharmony_ci		.num_parents = 1,
4248c2ecf20Sopenharmony_ci	},
4258c2ecf20Sopenharmony_ci};
4268c2ecf20Sopenharmony_ci
4278c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_mpll0_div = {
4288c2ecf20Sopenharmony_ci	.data = &(struct meson_clk_mpll_data){
4298c2ecf20Sopenharmony_ci		.sdm = {
4308c2ecf20Sopenharmony_ci			.reg_off = HHI_MPLL_CNTL7,
4318c2ecf20Sopenharmony_ci			.shift   = 0,
4328c2ecf20Sopenharmony_ci			.width   = 14,
4338c2ecf20Sopenharmony_ci		},
4348c2ecf20Sopenharmony_ci		.sdm_en = {
4358c2ecf20Sopenharmony_ci			.reg_off = HHI_MPLL_CNTL7,
4368c2ecf20Sopenharmony_ci			.shift   = 15,
4378c2ecf20Sopenharmony_ci			.width   = 1,
4388c2ecf20Sopenharmony_ci		},
4398c2ecf20Sopenharmony_ci		.n2 = {
4408c2ecf20Sopenharmony_ci			.reg_off = HHI_MPLL_CNTL7,
4418c2ecf20Sopenharmony_ci			.shift   = 16,
4428c2ecf20Sopenharmony_ci			.width   = 9,
4438c2ecf20Sopenharmony_ci		},
4448c2ecf20Sopenharmony_ci		.ssen = {
4458c2ecf20Sopenharmony_ci			.reg_off = HHI_MPLL_CNTL,
4468c2ecf20Sopenharmony_ci			.shift   = 25,
4478c2ecf20Sopenharmony_ci			.width   = 1,
4488c2ecf20Sopenharmony_ci		},
4498c2ecf20Sopenharmony_ci		.lock = &meson_clk_lock,
4508c2ecf20Sopenharmony_ci	},
4518c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
4528c2ecf20Sopenharmony_ci		.name = "mpll0_div",
4538c2ecf20Sopenharmony_ci		.ops = &meson_clk_mpll_ops,
4548c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
4558c2ecf20Sopenharmony_ci			&meson8b_mpll_prediv.hw
4568c2ecf20Sopenharmony_ci		},
4578c2ecf20Sopenharmony_ci		.num_parents = 1,
4588c2ecf20Sopenharmony_ci	},
4598c2ecf20Sopenharmony_ci};
4608c2ecf20Sopenharmony_ci
4618c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_mpll0 = {
4628c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_gate_data){
4638c2ecf20Sopenharmony_ci		.offset = HHI_MPLL_CNTL7,
4648c2ecf20Sopenharmony_ci		.bit_idx = 14,
4658c2ecf20Sopenharmony_ci	},
4668c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
4678c2ecf20Sopenharmony_ci		.name = "mpll0",
4688c2ecf20Sopenharmony_ci		.ops = &clk_regmap_gate_ops,
4698c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
4708c2ecf20Sopenharmony_ci			&meson8b_mpll0_div.hw
4718c2ecf20Sopenharmony_ci		},
4728c2ecf20Sopenharmony_ci		.num_parents = 1,
4738c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
4748c2ecf20Sopenharmony_ci	},
4758c2ecf20Sopenharmony_ci};
4768c2ecf20Sopenharmony_ci
4778c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_mpll1_div = {
4788c2ecf20Sopenharmony_ci	.data = &(struct meson_clk_mpll_data){
4798c2ecf20Sopenharmony_ci		.sdm = {
4808c2ecf20Sopenharmony_ci			.reg_off = HHI_MPLL_CNTL8,
4818c2ecf20Sopenharmony_ci			.shift   = 0,
4828c2ecf20Sopenharmony_ci			.width   = 14,
4838c2ecf20Sopenharmony_ci		},
4848c2ecf20Sopenharmony_ci		.sdm_en = {
4858c2ecf20Sopenharmony_ci			.reg_off = HHI_MPLL_CNTL8,
4868c2ecf20Sopenharmony_ci			.shift   = 15,
4878c2ecf20Sopenharmony_ci			.width   = 1,
4888c2ecf20Sopenharmony_ci		},
4898c2ecf20Sopenharmony_ci		.n2 = {
4908c2ecf20Sopenharmony_ci			.reg_off = HHI_MPLL_CNTL8,
4918c2ecf20Sopenharmony_ci			.shift   = 16,
4928c2ecf20Sopenharmony_ci			.width   = 9,
4938c2ecf20Sopenharmony_ci		},
4948c2ecf20Sopenharmony_ci		.lock = &meson_clk_lock,
4958c2ecf20Sopenharmony_ci	},
4968c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
4978c2ecf20Sopenharmony_ci		.name = "mpll1_div",
4988c2ecf20Sopenharmony_ci		.ops = &meson_clk_mpll_ops,
4998c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
5008c2ecf20Sopenharmony_ci			&meson8b_mpll_prediv.hw
5018c2ecf20Sopenharmony_ci		},
5028c2ecf20Sopenharmony_ci		.num_parents = 1,
5038c2ecf20Sopenharmony_ci	},
5048c2ecf20Sopenharmony_ci};
5058c2ecf20Sopenharmony_ci
5068c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_mpll1 = {
5078c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_gate_data){
5088c2ecf20Sopenharmony_ci		.offset = HHI_MPLL_CNTL8,
5098c2ecf20Sopenharmony_ci		.bit_idx = 14,
5108c2ecf20Sopenharmony_ci	},
5118c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
5128c2ecf20Sopenharmony_ci		.name = "mpll1",
5138c2ecf20Sopenharmony_ci		.ops = &clk_regmap_gate_ops,
5148c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
5158c2ecf20Sopenharmony_ci			&meson8b_mpll1_div.hw
5168c2ecf20Sopenharmony_ci		},
5178c2ecf20Sopenharmony_ci		.num_parents = 1,
5188c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
5198c2ecf20Sopenharmony_ci	},
5208c2ecf20Sopenharmony_ci};
5218c2ecf20Sopenharmony_ci
5228c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_mpll2_div = {
5238c2ecf20Sopenharmony_ci	.data = &(struct meson_clk_mpll_data){
5248c2ecf20Sopenharmony_ci		.sdm = {
5258c2ecf20Sopenharmony_ci			.reg_off = HHI_MPLL_CNTL9,
5268c2ecf20Sopenharmony_ci			.shift   = 0,
5278c2ecf20Sopenharmony_ci			.width   = 14,
5288c2ecf20Sopenharmony_ci		},
5298c2ecf20Sopenharmony_ci		.sdm_en = {
5308c2ecf20Sopenharmony_ci			.reg_off = HHI_MPLL_CNTL9,
5318c2ecf20Sopenharmony_ci			.shift   = 15,
5328c2ecf20Sopenharmony_ci			.width   = 1,
5338c2ecf20Sopenharmony_ci		},
5348c2ecf20Sopenharmony_ci		.n2 = {
5358c2ecf20Sopenharmony_ci			.reg_off = HHI_MPLL_CNTL9,
5368c2ecf20Sopenharmony_ci			.shift   = 16,
5378c2ecf20Sopenharmony_ci			.width   = 9,
5388c2ecf20Sopenharmony_ci		},
5398c2ecf20Sopenharmony_ci		.lock = &meson_clk_lock,
5408c2ecf20Sopenharmony_ci	},
5418c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
5428c2ecf20Sopenharmony_ci		.name = "mpll2_div",
5438c2ecf20Sopenharmony_ci		.ops = &meson_clk_mpll_ops,
5448c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
5458c2ecf20Sopenharmony_ci			&meson8b_mpll_prediv.hw
5468c2ecf20Sopenharmony_ci		},
5478c2ecf20Sopenharmony_ci		.num_parents = 1,
5488c2ecf20Sopenharmony_ci	},
5498c2ecf20Sopenharmony_ci};
5508c2ecf20Sopenharmony_ci
5518c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_mpll2 = {
5528c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_gate_data){
5538c2ecf20Sopenharmony_ci		.offset = HHI_MPLL_CNTL9,
5548c2ecf20Sopenharmony_ci		.bit_idx = 14,
5558c2ecf20Sopenharmony_ci	},
5568c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
5578c2ecf20Sopenharmony_ci		.name = "mpll2",
5588c2ecf20Sopenharmony_ci		.ops = &clk_regmap_gate_ops,
5598c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
5608c2ecf20Sopenharmony_ci			&meson8b_mpll2_div.hw
5618c2ecf20Sopenharmony_ci		},
5628c2ecf20Sopenharmony_ci		.num_parents = 1,
5638c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
5648c2ecf20Sopenharmony_ci	},
5658c2ecf20Sopenharmony_ci};
5668c2ecf20Sopenharmony_ci
5678c2ecf20Sopenharmony_cistatic u32 mux_table_clk81[]	= { 6, 5, 7 };
5688c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_mpeg_clk_sel = {
5698c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_mux_data){
5708c2ecf20Sopenharmony_ci		.offset = HHI_MPEG_CLK_CNTL,
5718c2ecf20Sopenharmony_ci		.mask = 0x7,
5728c2ecf20Sopenharmony_ci		.shift = 12,
5738c2ecf20Sopenharmony_ci		.table = mux_table_clk81,
5748c2ecf20Sopenharmony_ci	},
5758c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
5768c2ecf20Sopenharmony_ci		.name = "mpeg_clk_sel",
5778c2ecf20Sopenharmony_ci		.ops = &clk_regmap_mux_ro_ops,
5788c2ecf20Sopenharmony_ci		/*
5798c2ecf20Sopenharmony_ci		 * FIXME bits 14:12 selects from 8 possible parents:
5808c2ecf20Sopenharmony_ci		 * xtal, 1'b0 (wtf), fclk_div7, mpll_clkout1, mpll_clkout2,
5818c2ecf20Sopenharmony_ci		 * fclk_div4, fclk_div3, fclk_div5
5828c2ecf20Sopenharmony_ci		 */
5838c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
5848c2ecf20Sopenharmony_ci			&meson8b_fclk_div3.hw,
5858c2ecf20Sopenharmony_ci			&meson8b_fclk_div4.hw,
5868c2ecf20Sopenharmony_ci			&meson8b_fclk_div5.hw,
5878c2ecf20Sopenharmony_ci		},
5888c2ecf20Sopenharmony_ci		.num_parents = 3,
5898c2ecf20Sopenharmony_ci	},
5908c2ecf20Sopenharmony_ci};
5918c2ecf20Sopenharmony_ci
5928c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_mpeg_clk_div = {
5938c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_div_data){
5948c2ecf20Sopenharmony_ci		.offset = HHI_MPEG_CLK_CNTL,
5958c2ecf20Sopenharmony_ci		.shift = 0,
5968c2ecf20Sopenharmony_ci		.width = 7,
5978c2ecf20Sopenharmony_ci	},
5988c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
5998c2ecf20Sopenharmony_ci		.name = "mpeg_clk_div",
6008c2ecf20Sopenharmony_ci		.ops = &clk_regmap_divider_ro_ops,
6018c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
6028c2ecf20Sopenharmony_ci			&meson8b_mpeg_clk_sel.hw
6038c2ecf20Sopenharmony_ci		},
6048c2ecf20Sopenharmony_ci		.num_parents = 1,
6058c2ecf20Sopenharmony_ci	},
6068c2ecf20Sopenharmony_ci};
6078c2ecf20Sopenharmony_ci
6088c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_clk81 = {
6098c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_gate_data){
6108c2ecf20Sopenharmony_ci		.offset = HHI_MPEG_CLK_CNTL,
6118c2ecf20Sopenharmony_ci		.bit_idx = 7,
6128c2ecf20Sopenharmony_ci	},
6138c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
6148c2ecf20Sopenharmony_ci		.name = "clk81",
6158c2ecf20Sopenharmony_ci		.ops = &clk_regmap_gate_ops,
6168c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
6178c2ecf20Sopenharmony_ci			&meson8b_mpeg_clk_div.hw
6188c2ecf20Sopenharmony_ci		},
6198c2ecf20Sopenharmony_ci		.num_parents = 1,
6208c2ecf20Sopenharmony_ci		.flags = CLK_IS_CRITICAL,
6218c2ecf20Sopenharmony_ci	},
6228c2ecf20Sopenharmony_ci};
6238c2ecf20Sopenharmony_ci
6248c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_cpu_in_sel = {
6258c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_mux_data){
6268c2ecf20Sopenharmony_ci		.offset = HHI_SYS_CPU_CLK_CNTL0,
6278c2ecf20Sopenharmony_ci		.mask = 0x1,
6288c2ecf20Sopenharmony_ci		.shift = 0,
6298c2ecf20Sopenharmony_ci	},
6308c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
6318c2ecf20Sopenharmony_ci		.name = "cpu_in_sel",
6328c2ecf20Sopenharmony_ci		.ops = &clk_regmap_mux_ops,
6338c2ecf20Sopenharmony_ci		.parent_data = (const struct clk_parent_data[]) {
6348c2ecf20Sopenharmony_ci			{ .fw_name = "xtal", .name = "xtal", .index = -1, },
6358c2ecf20Sopenharmony_ci			{ .hw = &meson8b_sys_pll.hw, },
6368c2ecf20Sopenharmony_ci		},
6378c2ecf20Sopenharmony_ci		.num_parents = 2,
6388c2ecf20Sopenharmony_ci		.flags = (CLK_SET_RATE_PARENT |
6398c2ecf20Sopenharmony_ci			  CLK_SET_RATE_NO_REPARENT),
6408c2ecf20Sopenharmony_ci	},
6418c2ecf20Sopenharmony_ci};
6428c2ecf20Sopenharmony_ci
6438c2ecf20Sopenharmony_cistatic struct clk_fixed_factor meson8b_cpu_in_div2 = {
6448c2ecf20Sopenharmony_ci	.mult = 1,
6458c2ecf20Sopenharmony_ci	.div = 2,
6468c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
6478c2ecf20Sopenharmony_ci		.name = "cpu_in_div2",
6488c2ecf20Sopenharmony_ci		.ops = &clk_fixed_factor_ops,
6498c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
6508c2ecf20Sopenharmony_ci			&meson8b_cpu_in_sel.hw
6518c2ecf20Sopenharmony_ci		},
6528c2ecf20Sopenharmony_ci		.num_parents = 1,
6538c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
6548c2ecf20Sopenharmony_ci	},
6558c2ecf20Sopenharmony_ci};
6568c2ecf20Sopenharmony_ci
6578c2ecf20Sopenharmony_cistatic struct clk_fixed_factor meson8b_cpu_in_div3 = {
6588c2ecf20Sopenharmony_ci	.mult = 1,
6598c2ecf20Sopenharmony_ci	.div = 3,
6608c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
6618c2ecf20Sopenharmony_ci		.name = "cpu_in_div3",
6628c2ecf20Sopenharmony_ci		.ops = &clk_fixed_factor_ops,
6638c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
6648c2ecf20Sopenharmony_ci			&meson8b_cpu_in_sel.hw
6658c2ecf20Sopenharmony_ci		},
6668c2ecf20Sopenharmony_ci		.num_parents = 1,
6678c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
6688c2ecf20Sopenharmony_ci	},
6698c2ecf20Sopenharmony_ci};
6708c2ecf20Sopenharmony_ci
6718c2ecf20Sopenharmony_cistatic const struct clk_div_table cpu_scale_table[] = {
6728c2ecf20Sopenharmony_ci	{ .val = 1, .div = 4 },
6738c2ecf20Sopenharmony_ci	{ .val = 2, .div = 6 },
6748c2ecf20Sopenharmony_ci	{ .val = 3, .div = 8 },
6758c2ecf20Sopenharmony_ci	{ .val = 4, .div = 10 },
6768c2ecf20Sopenharmony_ci	{ .val = 5, .div = 12 },
6778c2ecf20Sopenharmony_ci	{ .val = 6, .div = 14 },
6788c2ecf20Sopenharmony_ci	{ .val = 7, .div = 16 },
6798c2ecf20Sopenharmony_ci	{ .val = 8, .div = 18 },
6808c2ecf20Sopenharmony_ci	{ /* sentinel */ },
6818c2ecf20Sopenharmony_ci};
6828c2ecf20Sopenharmony_ci
6838c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_cpu_scale_div = {
6848c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_div_data){
6858c2ecf20Sopenharmony_ci		.offset =  HHI_SYS_CPU_CLK_CNTL1,
6868c2ecf20Sopenharmony_ci		.shift = 20,
6878c2ecf20Sopenharmony_ci		.width = 10,
6888c2ecf20Sopenharmony_ci		.table = cpu_scale_table,
6898c2ecf20Sopenharmony_ci		.flags = CLK_DIVIDER_ALLOW_ZERO,
6908c2ecf20Sopenharmony_ci	},
6918c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
6928c2ecf20Sopenharmony_ci		.name = "cpu_scale_div",
6938c2ecf20Sopenharmony_ci		.ops = &clk_regmap_divider_ops,
6948c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
6958c2ecf20Sopenharmony_ci			&meson8b_cpu_in_sel.hw
6968c2ecf20Sopenharmony_ci		},
6978c2ecf20Sopenharmony_ci		.num_parents = 1,
6988c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
6998c2ecf20Sopenharmony_ci	},
7008c2ecf20Sopenharmony_ci};
7018c2ecf20Sopenharmony_ci
7028c2ecf20Sopenharmony_cistatic u32 mux_table_cpu_scale_out_sel[] = { 0, 1, 3 };
7038c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_cpu_scale_out_sel = {
7048c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_mux_data){
7058c2ecf20Sopenharmony_ci		.offset = HHI_SYS_CPU_CLK_CNTL0,
7068c2ecf20Sopenharmony_ci		.mask = 0x3,
7078c2ecf20Sopenharmony_ci		.shift = 2,
7088c2ecf20Sopenharmony_ci		.table = mux_table_cpu_scale_out_sel,
7098c2ecf20Sopenharmony_ci	},
7108c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
7118c2ecf20Sopenharmony_ci		.name = "cpu_scale_out_sel",
7128c2ecf20Sopenharmony_ci		.ops = &clk_regmap_mux_ops,
7138c2ecf20Sopenharmony_ci		/*
7148c2ecf20Sopenharmony_ci		 * NOTE: We are skipping the parent with value 0x2 (which is
7158c2ecf20Sopenharmony_ci		 * meson8b_cpu_in_div3) because it results in a duty cycle of
7168c2ecf20Sopenharmony_ci		 * 33% which makes the system unstable and can result in a
7178c2ecf20Sopenharmony_ci		 * lockup of the whole system.
7188c2ecf20Sopenharmony_ci		 */
7198c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
7208c2ecf20Sopenharmony_ci			&meson8b_cpu_in_sel.hw,
7218c2ecf20Sopenharmony_ci			&meson8b_cpu_in_div2.hw,
7228c2ecf20Sopenharmony_ci			&meson8b_cpu_scale_div.hw,
7238c2ecf20Sopenharmony_ci		},
7248c2ecf20Sopenharmony_ci		.num_parents = 3,
7258c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
7268c2ecf20Sopenharmony_ci	},
7278c2ecf20Sopenharmony_ci};
7288c2ecf20Sopenharmony_ci
7298c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_cpu_clk = {
7308c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_mux_data){
7318c2ecf20Sopenharmony_ci		.offset = HHI_SYS_CPU_CLK_CNTL0,
7328c2ecf20Sopenharmony_ci		.mask = 0x1,
7338c2ecf20Sopenharmony_ci		.shift = 7,
7348c2ecf20Sopenharmony_ci	},
7358c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
7368c2ecf20Sopenharmony_ci		.name = "cpu_clk",
7378c2ecf20Sopenharmony_ci		.ops = &clk_regmap_mux_ops,
7388c2ecf20Sopenharmony_ci		.parent_data = (const struct clk_parent_data[]) {
7398c2ecf20Sopenharmony_ci			{ .fw_name = "xtal", .name = "xtal", .index = -1, },
7408c2ecf20Sopenharmony_ci			{ .hw = &meson8b_cpu_scale_out_sel.hw, },
7418c2ecf20Sopenharmony_ci		},
7428c2ecf20Sopenharmony_ci		.num_parents = 2,
7438c2ecf20Sopenharmony_ci		.flags = (CLK_SET_RATE_PARENT |
7448c2ecf20Sopenharmony_ci			  CLK_SET_RATE_NO_REPARENT |
7458c2ecf20Sopenharmony_ci			  CLK_IS_CRITICAL),
7468c2ecf20Sopenharmony_ci	},
7478c2ecf20Sopenharmony_ci};
7488c2ecf20Sopenharmony_ci
7498c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_nand_clk_sel = {
7508c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_mux_data){
7518c2ecf20Sopenharmony_ci		.offset = HHI_NAND_CLK_CNTL,
7528c2ecf20Sopenharmony_ci		.mask = 0x7,
7538c2ecf20Sopenharmony_ci		.shift = 9,
7548c2ecf20Sopenharmony_ci		.flags = CLK_MUX_ROUND_CLOSEST,
7558c2ecf20Sopenharmony_ci	},
7568c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
7578c2ecf20Sopenharmony_ci		.name = "nand_clk_sel",
7588c2ecf20Sopenharmony_ci		.ops = &clk_regmap_mux_ops,
7598c2ecf20Sopenharmony_ci		/* FIXME all other parents are unknown: */
7608c2ecf20Sopenharmony_ci		.parent_data = (const struct clk_parent_data[]) {
7618c2ecf20Sopenharmony_ci			{ .hw = &meson8b_fclk_div4.hw, },
7628c2ecf20Sopenharmony_ci			{ .hw = &meson8b_fclk_div3.hw, },
7638c2ecf20Sopenharmony_ci			{ .hw = &meson8b_fclk_div5.hw, },
7648c2ecf20Sopenharmony_ci			{ .hw = &meson8b_fclk_div7.hw, },
7658c2ecf20Sopenharmony_ci			{ .fw_name = "xtal", .name = "xtal", .index = -1, },
7668c2ecf20Sopenharmony_ci		},
7678c2ecf20Sopenharmony_ci		.num_parents = 5,
7688c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
7698c2ecf20Sopenharmony_ci	},
7708c2ecf20Sopenharmony_ci};
7718c2ecf20Sopenharmony_ci
7728c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_nand_clk_div = {
7738c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_div_data){
7748c2ecf20Sopenharmony_ci		.offset =  HHI_NAND_CLK_CNTL,
7758c2ecf20Sopenharmony_ci		.shift = 0,
7768c2ecf20Sopenharmony_ci		.width = 7,
7778c2ecf20Sopenharmony_ci		.flags = CLK_DIVIDER_ROUND_CLOSEST,
7788c2ecf20Sopenharmony_ci	},
7798c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
7808c2ecf20Sopenharmony_ci		.name = "nand_clk_div",
7818c2ecf20Sopenharmony_ci		.ops = &clk_regmap_divider_ops,
7828c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
7838c2ecf20Sopenharmony_ci			&meson8b_nand_clk_sel.hw
7848c2ecf20Sopenharmony_ci		},
7858c2ecf20Sopenharmony_ci		.num_parents = 1,
7868c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
7878c2ecf20Sopenharmony_ci	},
7888c2ecf20Sopenharmony_ci};
7898c2ecf20Sopenharmony_ci
7908c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_nand_clk_gate = {
7918c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_gate_data){
7928c2ecf20Sopenharmony_ci		.offset = HHI_NAND_CLK_CNTL,
7938c2ecf20Sopenharmony_ci		.bit_idx = 8,
7948c2ecf20Sopenharmony_ci	},
7958c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
7968c2ecf20Sopenharmony_ci		.name = "nand_clk_gate",
7978c2ecf20Sopenharmony_ci		.ops = &clk_regmap_gate_ops,
7988c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
7998c2ecf20Sopenharmony_ci			&meson8b_nand_clk_div.hw
8008c2ecf20Sopenharmony_ci		},
8018c2ecf20Sopenharmony_ci		.num_parents = 1,
8028c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
8038c2ecf20Sopenharmony_ci	},
8048c2ecf20Sopenharmony_ci};
8058c2ecf20Sopenharmony_ci
8068c2ecf20Sopenharmony_cistatic struct clk_fixed_factor meson8b_cpu_clk_div2 = {
8078c2ecf20Sopenharmony_ci	.mult = 1,
8088c2ecf20Sopenharmony_ci	.div = 2,
8098c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
8108c2ecf20Sopenharmony_ci		.name = "cpu_clk_div2",
8118c2ecf20Sopenharmony_ci		.ops = &clk_fixed_factor_ops,
8128c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
8138c2ecf20Sopenharmony_ci			&meson8b_cpu_clk.hw
8148c2ecf20Sopenharmony_ci		},
8158c2ecf20Sopenharmony_ci		.num_parents = 1,
8168c2ecf20Sopenharmony_ci	},
8178c2ecf20Sopenharmony_ci};
8188c2ecf20Sopenharmony_ci
8198c2ecf20Sopenharmony_cistatic struct clk_fixed_factor meson8b_cpu_clk_div3 = {
8208c2ecf20Sopenharmony_ci	.mult = 1,
8218c2ecf20Sopenharmony_ci	.div = 3,
8228c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
8238c2ecf20Sopenharmony_ci		.name = "cpu_clk_div3",
8248c2ecf20Sopenharmony_ci		.ops = &clk_fixed_factor_ops,
8258c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
8268c2ecf20Sopenharmony_ci			&meson8b_cpu_clk.hw
8278c2ecf20Sopenharmony_ci		},
8288c2ecf20Sopenharmony_ci		.num_parents = 1,
8298c2ecf20Sopenharmony_ci	},
8308c2ecf20Sopenharmony_ci};
8318c2ecf20Sopenharmony_ci
8328c2ecf20Sopenharmony_cistatic struct clk_fixed_factor meson8b_cpu_clk_div4 = {
8338c2ecf20Sopenharmony_ci	.mult = 1,
8348c2ecf20Sopenharmony_ci	.div = 4,
8358c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
8368c2ecf20Sopenharmony_ci		.name = "cpu_clk_div4",
8378c2ecf20Sopenharmony_ci		.ops = &clk_fixed_factor_ops,
8388c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
8398c2ecf20Sopenharmony_ci			&meson8b_cpu_clk.hw
8408c2ecf20Sopenharmony_ci		},
8418c2ecf20Sopenharmony_ci		.num_parents = 1,
8428c2ecf20Sopenharmony_ci	},
8438c2ecf20Sopenharmony_ci};
8448c2ecf20Sopenharmony_ci
8458c2ecf20Sopenharmony_cistatic struct clk_fixed_factor meson8b_cpu_clk_div5 = {
8468c2ecf20Sopenharmony_ci	.mult = 1,
8478c2ecf20Sopenharmony_ci	.div = 5,
8488c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
8498c2ecf20Sopenharmony_ci		.name = "cpu_clk_div5",
8508c2ecf20Sopenharmony_ci		.ops = &clk_fixed_factor_ops,
8518c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
8528c2ecf20Sopenharmony_ci			&meson8b_cpu_clk.hw
8538c2ecf20Sopenharmony_ci		},
8548c2ecf20Sopenharmony_ci		.num_parents = 1,
8558c2ecf20Sopenharmony_ci	},
8568c2ecf20Sopenharmony_ci};
8578c2ecf20Sopenharmony_ci
8588c2ecf20Sopenharmony_cistatic struct clk_fixed_factor meson8b_cpu_clk_div6 = {
8598c2ecf20Sopenharmony_ci	.mult = 1,
8608c2ecf20Sopenharmony_ci	.div = 6,
8618c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
8628c2ecf20Sopenharmony_ci		.name = "cpu_clk_div6",
8638c2ecf20Sopenharmony_ci		.ops = &clk_fixed_factor_ops,
8648c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
8658c2ecf20Sopenharmony_ci			&meson8b_cpu_clk.hw
8668c2ecf20Sopenharmony_ci		},
8678c2ecf20Sopenharmony_ci		.num_parents = 1,
8688c2ecf20Sopenharmony_ci	},
8698c2ecf20Sopenharmony_ci};
8708c2ecf20Sopenharmony_ci
8718c2ecf20Sopenharmony_cistatic struct clk_fixed_factor meson8b_cpu_clk_div7 = {
8728c2ecf20Sopenharmony_ci	.mult = 1,
8738c2ecf20Sopenharmony_ci	.div = 7,
8748c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
8758c2ecf20Sopenharmony_ci		.name = "cpu_clk_div7",
8768c2ecf20Sopenharmony_ci		.ops = &clk_fixed_factor_ops,
8778c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
8788c2ecf20Sopenharmony_ci			&meson8b_cpu_clk.hw
8798c2ecf20Sopenharmony_ci		},
8808c2ecf20Sopenharmony_ci		.num_parents = 1,
8818c2ecf20Sopenharmony_ci	},
8828c2ecf20Sopenharmony_ci};
8838c2ecf20Sopenharmony_ci
8848c2ecf20Sopenharmony_cistatic struct clk_fixed_factor meson8b_cpu_clk_div8 = {
8858c2ecf20Sopenharmony_ci	.mult = 1,
8868c2ecf20Sopenharmony_ci	.div = 8,
8878c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
8888c2ecf20Sopenharmony_ci		.name = "cpu_clk_div8",
8898c2ecf20Sopenharmony_ci		.ops = &clk_fixed_factor_ops,
8908c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
8918c2ecf20Sopenharmony_ci			&meson8b_cpu_clk.hw
8928c2ecf20Sopenharmony_ci		},
8938c2ecf20Sopenharmony_ci		.num_parents = 1,
8948c2ecf20Sopenharmony_ci	},
8958c2ecf20Sopenharmony_ci};
8968c2ecf20Sopenharmony_ci
8978c2ecf20Sopenharmony_cistatic u32 mux_table_apb[] = { 1, 2, 3, 4, 5, 6, 7 };
8988c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_apb_clk_sel = {
8998c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_mux_data){
9008c2ecf20Sopenharmony_ci		.offset = HHI_SYS_CPU_CLK_CNTL1,
9018c2ecf20Sopenharmony_ci		.mask = 0x7,
9028c2ecf20Sopenharmony_ci		.shift = 3,
9038c2ecf20Sopenharmony_ci		.table = mux_table_apb,
9048c2ecf20Sopenharmony_ci	},
9058c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
9068c2ecf20Sopenharmony_ci		.name = "apb_clk_sel",
9078c2ecf20Sopenharmony_ci		.ops = &clk_regmap_mux_ops,
9088c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
9098c2ecf20Sopenharmony_ci			&meson8b_cpu_clk_div2.hw,
9108c2ecf20Sopenharmony_ci			&meson8b_cpu_clk_div3.hw,
9118c2ecf20Sopenharmony_ci			&meson8b_cpu_clk_div4.hw,
9128c2ecf20Sopenharmony_ci			&meson8b_cpu_clk_div5.hw,
9138c2ecf20Sopenharmony_ci			&meson8b_cpu_clk_div6.hw,
9148c2ecf20Sopenharmony_ci			&meson8b_cpu_clk_div7.hw,
9158c2ecf20Sopenharmony_ci			&meson8b_cpu_clk_div8.hw,
9168c2ecf20Sopenharmony_ci		},
9178c2ecf20Sopenharmony_ci		.num_parents = 7,
9188c2ecf20Sopenharmony_ci	},
9198c2ecf20Sopenharmony_ci};
9208c2ecf20Sopenharmony_ci
9218c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_apb_clk_gate = {
9228c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_gate_data){
9238c2ecf20Sopenharmony_ci		.offset = HHI_SYS_CPU_CLK_CNTL1,
9248c2ecf20Sopenharmony_ci		.bit_idx = 16,
9258c2ecf20Sopenharmony_ci		.flags = CLK_GATE_SET_TO_DISABLE,
9268c2ecf20Sopenharmony_ci	},
9278c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
9288c2ecf20Sopenharmony_ci		.name = "apb_clk_dis",
9298c2ecf20Sopenharmony_ci		.ops = &clk_regmap_gate_ro_ops,
9308c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
9318c2ecf20Sopenharmony_ci			&meson8b_apb_clk_sel.hw
9328c2ecf20Sopenharmony_ci		},
9338c2ecf20Sopenharmony_ci		.num_parents = 1,
9348c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
9358c2ecf20Sopenharmony_ci	},
9368c2ecf20Sopenharmony_ci};
9378c2ecf20Sopenharmony_ci
9388c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_periph_clk_sel = {
9398c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_mux_data){
9408c2ecf20Sopenharmony_ci		.offset = HHI_SYS_CPU_CLK_CNTL1,
9418c2ecf20Sopenharmony_ci		.mask = 0x7,
9428c2ecf20Sopenharmony_ci		.shift = 6,
9438c2ecf20Sopenharmony_ci	},
9448c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
9458c2ecf20Sopenharmony_ci		.name = "periph_clk_sel",
9468c2ecf20Sopenharmony_ci		.ops = &clk_regmap_mux_ops,
9478c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
9488c2ecf20Sopenharmony_ci			&meson8b_cpu_clk_div2.hw,
9498c2ecf20Sopenharmony_ci			&meson8b_cpu_clk_div3.hw,
9508c2ecf20Sopenharmony_ci			&meson8b_cpu_clk_div4.hw,
9518c2ecf20Sopenharmony_ci			&meson8b_cpu_clk_div5.hw,
9528c2ecf20Sopenharmony_ci			&meson8b_cpu_clk_div6.hw,
9538c2ecf20Sopenharmony_ci			&meson8b_cpu_clk_div7.hw,
9548c2ecf20Sopenharmony_ci			&meson8b_cpu_clk_div8.hw,
9558c2ecf20Sopenharmony_ci		},
9568c2ecf20Sopenharmony_ci		.num_parents = 7,
9578c2ecf20Sopenharmony_ci	},
9588c2ecf20Sopenharmony_ci};
9598c2ecf20Sopenharmony_ci
9608c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_periph_clk_gate = {
9618c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_gate_data){
9628c2ecf20Sopenharmony_ci		.offset = HHI_SYS_CPU_CLK_CNTL1,
9638c2ecf20Sopenharmony_ci		.bit_idx = 17,
9648c2ecf20Sopenharmony_ci		.flags = CLK_GATE_SET_TO_DISABLE,
9658c2ecf20Sopenharmony_ci	},
9668c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
9678c2ecf20Sopenharmony_ci		.name = "periph_clk_dis",
9688c2ecf20Sopenharmony_ci		.ops = &clk_regmap_gate_ro_ops,
9698c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
9708c2ecf20Sopenharmony_ci			&meson8b_periph_clk_sel.hw
9718c2ecf20Sopenharmony_ci		},
9728c2ecf20Sopenharmony_ci		.num_parents = 1,
9738c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
9748c2ecf20Sopenharmony_ci	},
9758c2ecf20Sopenharmony_ci};
9768c2ecf20Sopenharmony_ci
9778c2ecf20Sopenharmony_cistatic u32 mux_table_axi[] = { 1, 2, 3, 4, 5, 6, 7 };
9788c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_axi_clk_sel = {
9798c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_mux_data){
9808c2ecf20Sopenharmony_ci		.offset = HHI_SYS_CPU_CLK_CNTL1,
9818c2ecf20Sopenharmony_ci		.mask = 0x7,
9828c2ecf20Sopenharmony_ci		.shift = 9,
9838c2ecf20Sopenharmony_ci		.table = mux_table_axi,
9848c2ecf20Sopenharmony_ci	},
9858c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
9868c2ecf20Sopenharmony_ci		.name = "axi_clk_sel",
9878c2ecf20Sopenharmony_ci		.ops = &clk_regmap_mux_ops,
9888c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
9898c2ecf20Sopenharmony_ci			&meson8b_cpu_clk_div2.hw,
9908c2ecf20Sopenharmony_ci			&meson8b_cpu_clk_div3.hw,
9918c2ecf20Sopenharmony_ci			&meson8b_cpu_clk_div4.hw,
9928c2ecf20Sopenharmony_ci			&meson8b_cpu_clk_div5.hw,
9938c2ecf20Sopenharmony_ci			&meson8b_cpu_clk_div6.hw,
9948c2ecf20Sopenharmony_ci			&meson8b_cpu_clk_div7.hw,
9958c2ecf20Sopenharmony_ci			&meson8b_cpu_clk_div8.hw,
9968c2ecf20Sopenharmony_ci		},
9978c2ecf20Sopenharmony_ci		.num_parents = 7,
9988c2ecf20Sopenharmony_ci	},
9998c2ecf20Sopenharmony_ci};
10008c2ecf20Sopenharmony_ci
10018c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_axi_clk_gate = {
10028c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_gate_data){
10038c2ecf20Sopenharmony_ci		.offset = HHI_SYS_CPU_CLK_CNTL1,
10048c2ecf20Sopenharmony_ci		.bit_idx = 18,
10058c2ecf20Sopenharmony_ci		.flags = CLK_GATE_SET_TO_DISABLE,
10068c2ecf20Sopenharmony_ci	},
10078c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
10088c2ecf20Sopenharmony_ci		.name = "axi_clk_dis",
10098c2ecf20Sopenharmony_ci		.ops = &clk_regmap_gate_ro_ops,
10108c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
10118c2ecf20Sopenharmony_ci			&meson8b_axi_clk_sel.hw
10128c2ecf20Sopenharmony_ci		},
10138c2ecf20Sopenharmony_ci		.num_parents = 1,
10148c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
10158c2ecf20Sopenharmony_ci	},
10168c2ecf20Sopenharmony_ci};
10178c2ecf20Sopenharmony_ci
10188c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_l2_dram_clk_sel = {
10198c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_mux_data){
10208c2ecf20Sopenharmony_ci		.offset = HHI_SYS_CPU_CLK_CNTL1,
10218c2ecf20Sopenharmony_ci		.mask = 0x7,
10228c2ecf20Sopenharmony_ci		.shift = 12,
10238c2ecf20Sopenharmony_ci	},
10248c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
10258c2ecf20Sopenharmony_ci		.name = "l2_dram_clk_sel",
10268c2ecf20Sopenharmony_ci		.ops = &clk_regmap_mux_ops,
10278c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
10288c2ecf20Sopenharmony_ci			&meson8b_cpu_clk_div2.hw,
10298c2ecf20Sopenharmony_ci			&meson8b_cpu_clk_div3.hw,
10308c2ecf20Sopenharmony_ci			&meson8b_cpu_clk_div4.hw,
10318c2ecf20Sopenharmony_ci			&meson8b_cpu_clk_div5.hw,
10328c2ecf20Sopenharmony_ci			&meson8b_cpu_clk_div6.hw,
10338c2ecf20Sopenharmony_ci			&meson8b_cpu_clk_div7.hw,
10348c2ecf20Sopenharmony_ci			&meson8b_cpu_clk_div8.hw,
10358c2ecf20Sopenharmony_ci		},
10368c2ecf20Sopenharmony_ci		.num_parents = 7,
10378c2ecf20Sopenharmony_ci	},
10388c2ecf20Sopenharmony_ci};
10398c2ecf20Sopenharmony_ci
10408c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_l2_dram_clk_gate = {
10418c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_gate_data){
10428c2ecf20Sopenharmony_ci		.offset = HHI_SYS_CPU_CLK_CNTL1,
10438c2ecf20Sopenharmony_ci		.bit_idx = 19,
10448c2ecf20Sopenharmony_ci		.flags = CLK_GATE_SET_TO_DISABLE,
10458c2ecf20Sopenharmony_ci	},
10468c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
10478c2ecf20Sopenharmony_ci		.name = "l2_dram_clk_dis",
10488c2ecf20Sopenharmony_ci		.ops = &clk_regmap_gate_ro_ops,
10498c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
10508c2ecf20Sopenharmony_ci			&meson8b_l2_dram_clk_sel.hw
10518c2ecf20Sopenharmony_ci		},
10528c2ecf20Sopenharmony_ci		.num_parents = 1,
10538c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
10548c2ecf20Sopenharmony_ci	},
10558c2ecf20Sopenharmony_ci};
10568c2ecf20Sopenharmony_ci
10578c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_vid_pll_in_sel = {
10588c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_mux_data){
10598c2ecf20Sopenharmony_ci		.offset = HHI_VID_DIVIDER_CNTL,
10608c2ecf20Sopenharmony_ci		.mask = 0x1,
10618c2ecf20Sopenharmony_ci		.shift = 15,
10628c2ecf20Sopenharmony_ci	},
10638c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
10648c2ecf20Sopenharmony_ci		.name = "vid_pll_in_sel",
10658c2ecf20Sopenharmony_ci		.ops = &clk_regmap_mux_ro_ops,
10668c2ecf20Sopenharmony_ci		/*
10678c2ecf20Sopenharmony_ci		 * TODO: depending on the SoC there is also a second parent:
10688c2ecf20Sopenharmony_ci		 * Meson8: unknown
10698c2ecf20Sopenharmony_ci		 * Meson8b: hdmi_pll_dco
10708c2ecf20Sopenharmony_ci		 * Meson8m2: vid2_pll
10718c2ecf20Sopenharmony_ci		 */
10728c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
10738c2ecf20Sopenharmony_ci			&meson8b_hdmi_pll_lvds_out.hw
10748c2ecf20Sopenharmony_ci		},
10758c2ecf20Sopenharmony_ci		.num_parents = 1,
10768c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
10778c2ecf20Sopenharmony_ci	},
10788c2ecf20Sopenharmony_ci};
10798c2ecf20Sopenharmony_ci
10808c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_vid_pll_in_en = {
10818c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_gate_data){
10828c2ecf20Sopenharmony_ci		.offset = HHI_VID_DIVIDER_CNTL,
10838c2ecf20Sopenharmony_ci		.bit_idx = 16,
10848c2ecf20Sopenharmony_ci	},
10858c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
10868c2ecf20Sopenharmony_ci		.name = "vid_pll_in_en",
10878c2ecf20Sopenharmony_ci		.ops = &clk_regmap_gate_ro_ops,
10888c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
10898c2ecf20Sopenharmony_ci			&meson8b_vid_pll_in_sel.hw
10908c2ecf20Sopenharmony_ci		},
10918c2ecf20Sopenharmony_ci		.num_parents = 1,
10928c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
10938c2ecf20Sopenharmony_ci	},
10948c2ecf20Sopenharmony_ci};
10958c2ecf20Sopenharmony_ci
10968c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_vid_pll_pre_div = {
10978c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_div_data){
10988c2ecf20Sopenharmony_ci		.offset =  HHI_VID_DIVIDER_CNTL,
10998c2ecf20Sopenharmony_ci		.shift = 4,
11008c2ecf20Sopenharmony_ci		.width = 3,
11018c2ecf20Sopenharmony_ci	},
11028c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
11038c2ecf20Sopenharmony_ci		.name = "vid_pll_pre_div",
11048c2ecf20Sopenharmony_ci		.ops = &clk_regmap_divider_ro_ops,
11058c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
11068c2ecf20Sopenharmony_ci			&meson8b_vid_pll_in_en.hw
11078c2ecf20Sopenharmony_ci		},
11088c2ecf20Sopenharmony_ci		.num_parents = 1,
11098c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
11108c2ecf20Sopenharmony_ci	},
11118c2ecf20Sopenharmony_ci};
11128c2ecf20Sopenharmony_ci
11138c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_vid_pll_post_div = {
11148c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_div_data){
11158c2ecf20Sopenharmony_ci		.offset =  HHI_VID_DIVIDER_CNTL,
11168c2ecf20Sopenharmony_ci		.shift = 12,
11178c2ecf20Sopenharmony_ci		.width = 3,
11188c2ecf20Sopenharmony_ci	},
11198c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
11208c2ecf20Sopenharmony_ci		.name = "vid_pll_post_div",
11218c2ecf20Sopenharmony_ci		.ops = &clk_regmap_divider_ro_ops,
11228c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
11238c2ecf20Sopenharmony_ci			&meson8b_vid_pll_pre_div.hw
11248c2ecf20Sopenharmony_ci		},
11258c2ecf20Sopenharmony_ci		.num_parents = 1,
11268c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
11278c2ecf20Sopenharmony_ci	},
11288c2ecf20Sopenharmony_ci};
11298c2ecf20Sopenharmony_ci
11308c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_vid_pll = {
11318c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_mux_data){
11328c2ecf20Sopenharmony_ci		.offset = HHI_VID_DIVIDER_CNTL,
11338c2ecf20Sopenharmony_ci		.mask = 0x3,
11348c2ecf20Sopenharmony_ci		.shift = 8,
11358c2ecf20Sopenharmony_ci	},
11368c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
11378c2ecf20Sopenharmony_ci		.name = "vid_pll",
11388c2ecf20Sopenharmony_ci		.ops = &clk_regmap_mux_ro_ops,
11398c2ecf20Sopenharmony_ci		/* TODO: parent 0x2 is vid_pll_pre_div_mult7_div2 */
11408c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
11418c2ecf20Sopenharmony_ci			&meson8b_vid_pll_pre_div.hw,
11428c2ecf20Sopenharmony_ci			&meson8b_vid_pll_post_div.hw,
11438c2ecf20Sopenharmony_ci		},
11448c2ecf20Sopenharmony_ci		.num_parents = 2,
11458c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
11468c2ecf20Sopenharmony_ci	},
11478c2ecf20Sopenharmony_ci};
11488c2ecf20Sopenharmony_ci
11498c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_vid_pll_final_div = {
11508c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_div_data){
11518c2ecf20Sopenharmony_ci		.offset =  HHI_VID_CLK_DIV,
11528c2ecf20Sopenharmony_ci		.shift = 0,
11538c2ecf20Sopenharmony_ci		.width = 8,
11548c2ecf20Sopenharmony_ci	},
11558c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
11568c2ecf20Sopenharmony_ci		.name = "vid_pll_final_div",
11578c2ecf20Sopenharmony_ci		.ops = &clk_regmap_divider_ro_ops,
11588c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
11598c2ecf20Sopenharmony_ci			&meson8b_vid_pll.hw
11608c2ecf20Sopenharmony_ci		},
11618c2ecf20Sopenharmony_ci		.num_parents = 1,
11628c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
11638c2ecf20Sopenharmony_ci	},
11648c2ecf20Sopenharmony_ci};
11658c2ecf20Sopenharmony_ci
11668c2ecf20Sopenharmony_cistatic const struct clk_hw *meson8b_vclk_mux_parent_hws[] = {
11678c2ecf20Sopenharmony_ci	&meson8b_vid_pll_final_div.hw,
11688c2ecf20Sopenharmony_ci	&meson8b_fclk_div4.hw,
11698c2ecf20Sopenharmony_ci	&meson8b_fclk_div3.hw,
11708c2ecf20Sopenharmony_ci	&meson8b_fclk_div5.hw,
11718c2ecf20Sopenharmony_ci	&meson8b_vid_pll_final_div.hw,
11728c2ecf20Sopenharmony_ci	&meson8b_fclk_div7.hw,
11738c2ecf20Sopenharmony_ci	&meson8b_mpll1.hw,
11748c2ecf20Sopenharmony_ci};
11758c2ecf20Sopenharmony_ci
11768c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_vclk_in_sel = {
11778c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_mux_data){
11788c2ecf20Sopenharmony_ci		.offset = HHI_VID_CLK_CNTL,
11798c2ecf20Sopenharmony_ci		.mask = 0x7,
11808c2ecf20Sopenharmony_ci		.shift = 16,
11818c2ecf20Sopenharmony_ci	},
11828c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
11838c2ecf20Sopenharmony_ci		.name = "vclk_in_sel",
11848c2ecf20Sopenharmony_ci		.ops = &clk_regmap_mux_ro_ops,
11858c2ecf20Sopenharmony_ci		.parent_hws = meson8b_vclk_mux_parent_hws,
11868c2ecf20Sopenharmony_ci		.num_parents = ARRAY_SIZE(meson8b_vclk_mux_parent_hws),
11878c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
11888c2ecf20Sopenharmony_ci	},
11898c2ecf20Sopenharmony_ci};
11908c2ecf20Sopenharmony_ci
11918c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_vclk_in_en = {
11928c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_gate_data){
11938c2ecf20Sopenharmony_ci		.offset = HHI_VID_CLK_DIV,
11948c2ecf20Sopenharmony_ci		.bit_idx = 16,
11958c2ecf20Sopenharmony_ci	},
11968c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
11978c2ecf20Sopenharmony_ci		.name = "vclk_in_en",
11988c2ecf20Sopenharmony_ci		.ops = &clk_regmap_gate_ro_ops,
11998c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
12008c2ecf20Sopenharmony_ci			&meson8b_vclk_in_sel.hw
12018c2ecf20Sopenharmony_ci		},
12028c2ecf20Sopenharmony_ci		.num_parents = 1,
12038c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
12048c2ecf20Sopenharmony_ci	},
12058c2ecf20Sopenharmony_ci};
12068c2ecf20Sopenharmony_ci
12078c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_vclk_en = {
12088c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_gate_data){
12098c2ecf20Sopenharmony_ci		.offset = HHI_VID_CLK_CNTL,
12108c2ecf20Sopenharmony_ci		.bit_idx = 19,
12118c2ecf20Sopenharmony_ci	},
12128c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
12138c2ecf20Sopenharmony_ci		.name = "vclk_en",
12148c2ecf20Sopenharmony_ci		.ops = &clk_regmap_gate_ro_ops,
12158c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
12168c2ecf20Sopenharmony_ci			&meson8b_vclk_in_en.hw
12178c2ecf20Sopenharmony_ci		},
12188c2ecf20Sopenharmony_ci		.num_parents = 1,
12198c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
12208c2ecf20Sopenharmony_ci	},
12218c2ecf20Sopenharmony_ci};
12228c2ecf20Sopenharmony_ci
12238c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_vclk_div1_gate = {
12248c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_gate_data){
12258c2ecf20Sopenharmony_ci		.offset = HHI_VID_CLK_CNTL,
12268c2ecf20Sopenharmony_ci		.bit_idx = 0,
12278c2ecf20Sopenharmony_ci	},
12288c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
12298c2ecf20Sopenharmony_ci		.name = "vclk_div1_en",
12308c2ecf20Sopenharmony_ci		.ops = &clk_regmap_gate_ro_ops,
12318c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
12328c2ecf20Sopenharmony_ci			&meson8b_vclk_en.hw
12338c2ecf20Sopenharmony_ci		},
12348c2ecf20Sopenharmony_ci		.num_parents = 1,
12358c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
12368c2ecf20Sopenharmony_ci	},
12378c2ecf20Sopenharmony_ci};
12388c2ecf20Sopenharmony_ci
12398c2ecf20Sopenharmony_cistatic struct clk_fixed_factor meson8b_vclk_div2_div = {
12408c2ecf20Sopenharmony_ci	.mult = 1,
12418c2ecf20Sopenharmony_ci	.div = 2,
12428c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
12438c2ecf20Sopenharmony_ci		.name = "vclk_div2",
12448c2ecf20Sopenharmony_ci		.ops = &clk_fixed_factor_ops,
12458c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
12468c2ecf20Sopenharmony_ci			&meson8b_vclk_en.hw
12478c2ecf20Sopenharmony_ci		},
12488c2ecf20Sopenharmony_ci		.num_parents = 1,
12498c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
12508c2ecf20Sopenharmony_ci	}
12518c2ecf20Sopenharmony_ci};
12528c2ecf20Sopenharmony_ci
12538c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_vclk_div2_div_gate = {
12548c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_gate_data){
12558c2ecf20Sopenharmony_ci		.offset = HHI_VID_CLK_CNTL,
12568c2ecf20Sopenharmony_ci		.bit_idx = 1,
12578c2ecf20Sopenharmony_ci	},
12588c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
12598c2ecf20Sopenharmony_ci		.name = "vclk_div2_en",
12608c2ecf20Sopenharmony_ci		.ops = &clk_regmap_gate_ro_ops,
12618c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
12628c2ecf20Sopenharmony_ci			&meson8b_vclk_div2_div.hw
12638c2ecf20Sopenharmony_ci		},
12648c2ecf20Sopenharmony_ci		.num_parents = 1,
12658c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
12668c2ecf20Sopenharmony_ci	},
12678c2ecf20Sopenharmony_ci};
12688c2ecf20Sopenharmony_ci
12698c2ecf20Sopenharmony_cistatic struct clk_fixed_factor meson8b_vclk_div4_div = {
12708c2ecf20Sopenharmony_ci	.mult = 1,
12718c2ecf20Sopenharmony_ci	.div = 4,
12728c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
12738c2ecf20Sopenharmony_ci		.name = "vclk_div4",
12748c2ecf20Sopenharmony_ci		.ops = &clk_fixed_factor_ops,
12758c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
12768c2ecf20Sopenharmony_ci			&meson8b_vclk_en.hw
12778c2ecf20Sopenharmony_ci		},
12788c2ecf20Sopenharmony_ci		.num_parents = 1,
12798c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
12808c2ecf20Sopenharmony_ci	}
12818c2ecf20Sopenharmony_ci};
12828c2ecf20Sopenharmony_ci
12838c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_vclk_div4_div_gate = {
12848c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_gate_data){
12858c2ecf20Sopenharmony_ci		.offset = HHI_VID_CLK_CNTL,
12868c2ecf20Sopenharmony_ci		.bit_idx = 2,
12878c2ecf20Sopenharmony_ci	},
12888c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
12898c2ecf20Sopenharmony_ci		.name = "vclk_div4_en",
12908c2ecf20Sopenharmony_ci		.ops = &clk_regmap_gate_ro_ops,
12918c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
12928c2ecf20Sopenharmony_ci			&meson8b_vclk_div4_div.hw
12938c2ecf20Sopenharmony_ci		},
12948c2ecf20Sopenharmony_ci		.num_parents = 1,
12958c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
12968c2ecf20Sopenharmony_ci	},
12978c2ecf20Sopenharmony_ci};
12988c2ecf20Sopenharmony_ci
12998c2ecf20Sopenharmony_cistatic struct clk_fixed_factor meson8b_vclk_div6_div = {
13008c2ecf20Sopenharmony_ci	.mult = 1,
13018c2ecf20Sopenharmony_ci	.div = 6,
13028c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
13038c2ecf20Sopenharmony_ci		.name = "vclk_div6",
13048c2ecf20Sopenharmony_ci		.ops = &clk_fixed_factor_ops,
13058c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
13068c2ecf20Sopenharmony_ci			&meson8b_vclk_en.hw
13078c2ecf20Sopenharmony_ci		},
13088c2ecf20Sopenharmony_ci		.num_parents = 1,
13098c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
13108c2ecf20Sopenharmony_ci	}
13118c2ecf20Sopenharmony_ci};
13128c2ecf20Sopenharmony_ci
13138c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_vclk_div6_div_gate = {
13148c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_gate_data){
13158c2ecf20Sopenharmony_ci		.offset = HHI_VID_CLK_CNTL,
13168c2ecf20Sopenharmony_ci		.bit_idx = 3,
13178c2ecf20Sopenharmony_ci	},
13188c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
13198c2ecf20Sopenharmony_ci		.name = "vclk_div6_en",
13208c2ecf20Sopenharmony_ci		.ops = &clk_regmap_gate_ro_ops,
13218c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
13228c2ecf20Sopenharmony_ci			&meson8b_vclk_div6_div.hw
13238c2ecf20Sopenharmony_ci		},
13248c2ecf20Sopenharmony_ci		.num_parents = 1,
13258c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
13268c2ecf20Sopenharmony_ci	},
13278c2ecf20Sopenharmony_ci};
13288c2ecf20Sopenharmony_ci
13298c2ecf20Sopenharmony_cistatic struct clk_fixed_factor meson8b_vclk_div12_div = {
13308c2ecf20Sopenharmony_ci	.mult = 1,
13318c2ecf20Sopenharmony_ci	.div = 12,
13328c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
13338c2ecf20Sopenharmony_ci		.name = "vclk_div12",
13348c2ecf20Sopenharmony_ci		.ops = &clk_fixed_factor_ops,
13358c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
13368c2ecf20Sopenharmony_ci			&meson8b_vclk_en.hw
13378c2ecf20Sopenharmony_ci		},
13388c2ecf20Sopenharmony_ci		.num_parents = 1,
13398c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
13408c2ecf20Sopenharmony_ci	}
13418c2ecf20Sopenharmony_ci};
13428c2ecf20Sopenharmony_ci
13438c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_vclk_div12_div_gate = {
13448c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_gate_data){
13458c2ecf20Sopenharmony_ci		.offset = HHI_VID_CLK_CNTL,
13468c2ecf20Sopenharmony_ci		.bit_idx = 4,
13478c2ecf20Sopenharmony_ci	},
13488c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
13498c2ecf20Sopenharmony_ci		.name = "vclk_div12_en",
13508c2ecf20Sopenharmony_ci		.ops = &clk_regmap_gate_ro_ops,
13518c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
13528c2ecf20Sopenharmony_ci			&meson8b_vclk_div12_div.hw
13538c2ecf20Sopenharmony_ci		},
13548c2ecf20Sopenharmony_ci		.num_parents = 1,
13558c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
13568c2ecf20Sopenharmony_ci	},
13578c2ecf20Sopenharmony_ci};
13588c2ecf20Sopenharmony_ci
13598c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_vclk2_in_sel = {
13608c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_mux_data){
13618c2ecf20Sopenharmony_ci		.offset = HHI_VIID_CLK_CNTL,
13628c2ecf20Sopenharmony_ci		.mask = 0x7,
13638c2ecf20Sopenharmony_ci		.shift = 16,
13648c2ecf20Sopenharmony_ci	},
13658c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
13668c2ecf20Sopenharmony_ci		.name = "vclk2_in_sel",
13678c2ecf20Sopenharmony_ci		.ops = &clk_regmap_mux_ro_ops,
13688c2ecf20Sopenharmony_ci		.parent_hws = meson8b_vclk_mux_parent_hws,
13698c2ecf20Sopenharmony_ci		.num_parents = ARRAY_SIZE(meson8b_vclk_mux_parent_hws),
13708c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
13718c2ecf20Sopenharmony_ci	},
13728c2ecf20Sopenharmony_ci};
13738c2ecf20Sopenharmony_ci
13748c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_vclk2_clk_in_en = {
13758c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_gate_data){
13768c2ecf20Sopenharmony_ci		.offset = HHI_VIID_CLK_DIV,
13778c2ecf20Sopenharmony_ci		.bit_idx = 16,
13788c2ecf20Sopenharmony_ci	},
13798c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
13808c2ecf20Sopenharmony_ci		.name = "vclk2_in_en",
13818c2ecf20Sopenharmony_ci		.ops = &clk_regmap_gate_ro_ops,
13828c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
13838c2ecf20Sopenharmony_ci			&meson8b_vclk2_in_sel.hw
13848c2ecf20Sopenharmony_ci		},
13858c2ecf20Sopenharmony_ci		.num_parents = 1,
13868c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
13878c2ecf20Sopenharmony_ci	},
13888c2ecf20Sopenharmony_ci};
13898c2ecf20Sopenharmony_ci
13908c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_vclk2_clk_en = {
13918c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_gate_data){
13928c2ecf20Sopenharmony_ci		.offset = HHI_VIID_CLK_DIV,
13938c2ecf20Sopenharmony_ci		.bit_idx = 19,
13948c2ecf20Sopenharmony_ci	},
13958c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
13968c2ecf20Sopenharmony_ci		.name = "vclk2_en",
13978c2ecf20Sopenharmony_ci		.ops = &clk_regmap_gate_ro_ops,
13988c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
13998c2ecf20Sopenharmony_ci			&meson8b_vclk2_clk_in_en.hw
14008c2ecf20Sopenharmony_ci		},
14018c2ecf20Sopenharmony_ci		.num_parents = 1,
14028c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
14038c2ecf20Sopenharmony_ci	},
14048c2ecf20Sopenharmony_ci};
14058c2ecf20Sopenharmony_ci
14068c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_vclk2_div1_gate = {
14078c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_gate_data){
14088c2ecf20Sopenharmony_ci		.offset = HHI_VIID_CLK_DIV,
14098c2ecf20Sopenharmony_ci		.bit_idx = 0,
14108c2ecf20Sopenharmony_ci	},
14118c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
14128c2ecf20Sopenharmony_ci		.name = "vclk2_div1_en",
14138c2ecf20Sopenharmony_ci		.ops = &clk_regmap_gate_ro_ops,
14148c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
14158c2ecf20Sopenharmony_ci			&meson8b_vclk2_clk_en.hw
14168c2ecf20Sopenharmony_ci		},
14178c2ecf20Sopenharmony_ci		.num_parents = 1,
14188c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
14198c2ecf20Sopenharmony_ci	},
14208c2ecf20Sopenharmony_ci};
14218c2ecf20Sopenharmony_ci
14228c2ecf20Sopenharmony_cistatic struct clk_fixed_factor meson8b_vclk2_div2_div = {
14238c2ecf20Sopenharmony_ci	.mult = 1,
14248c2ecf20Sopenharmony_ci	.div = 2,
14258c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
14268c2ecf20Sopenharmony_ci		.name = "vclk2_div2",
14278c2ecf20Sopenharmony_ci		.ops = &clk_fixed_factor_ops,
14288c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
14298c2ecf20Sopenharmony_ci			&meson8b_vclk2_clk_en.hw
14308c2ecf20Sopenharmony_ci		},
14318c2ecf20Sopenharmony_ci		.num_parents = 1,
14328c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
14338c2ecf20Sopenharmony_ci	}
14348c2ecf20Sopenharmony_ci};
14358c2ecf20Sopenharmony_ci
14368c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_vclk2_div2_div_gate = {
14378c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_gate_data){
14388c2ecf20Sopenharmony_ci		.offset = HHI_VIID_CLK_DIV,
14398c2ecf20Sopenharmony_ci		.bit_idx = 1,
14408c2ecf20Sopenharmony_ci	},
14418c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
14428c2ecf20Sopenharmony_ci		.name = "vclk2_div2_en",
14438c2ecf20Sopenharmony_ci		.ops = &clk_regmap_gate_ro_ops,
14448c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
14458c2ecf20Sopenharmony_ci			&meson8b_vclk2_div2_div.hw
14468c2ecf20Sopenharmony_ci		},
14478c2ecf20Sopenharmony_ci		.num_parents = 1,
14488c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
14498c2ecf20Sopenharmony_ci	},
14508c2ecf20Sopenharmony_ci};
14518c2ecf20Sopenharmony_ci
14528c2ecf20Sopenharmony_cistatic struct clk_fixed_factor meson8b_vclk2_div4_div = {
14538c2ecf20Sopenharmony_ci	.mult = 1,
14548c2ecf20Sopenharmony_ci	.div = 4,
14558c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
14568c2ecf20Sopenharmony_ci		.name = "vclk2_div4",
14578c2ecf20Sopenharmony_ci		.ops = &clk_fixed_factor_ops,
14588c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
14598c2ecf20Sopenharmony_ci			&meson8b_vclk2_clk_en.hw
14608c2ecf20Sopenharmony_ci		},
14618c2ecf20Sopenharmony_ci		.num_parents = 1,
14628c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
14638c2ecf20Sopenharmony_ci	}
14648c2ecf20Sopenharmony_ci};
14658c2ecf20Sopenharmony_ci
14668c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_vclk2_div4_div_gate = {
14678c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_gate_data){
14688c2ecf20Sopenharmony_ci		.offset = HHI_VIID_CLK_DIV,
14698c2ecf20Sopenharmony_ci		.bit_idx = 2,
14708c2ecf20Sopenharmony_ci	},
14718c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
14728c2ecf20Sopenharmony_ci		.name = "vclk2_div4_en",
14738c2ecf20Sopenharmony_ci		.ops = &clk_regmap_gate_ro_ops,
14748c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
14758c2ecf20Sopenharmony_ci			&meson8b_vclk2_div4_div.hw
14768c2ecf20Sopenharmony_ci		},
14778c2ecf20Sopenharmony_ci		.num_parents = 1,
14788c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
14798c2ecf20Sopenharmony_ci	},
14808c2ecf20Sopenharmony_ci};
14818c2ecf20Sopenharmony_ci
14828c2ecf20Sopenharmony_cistatic struct clk_fixed_factor meson8b_vclk2_div6_div = {
14838c2ecf20Sopenharmony_ci	.mult = 1,
14848c2ecf20Sopenharmony_ci	.div = 6,
14858c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
14868c2ecf20Sopenharmony_ci		.name = "vclk2_div6",
14878c2ecf20Sopenharmony_ci		.ops = &clk_fixed_factor_ops,
14888c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
14898c2ecf20Sopenharmony_ci			&meson8b_vclk2_clk_en.hw
14908c2ecf20Sopenharmony_ci		},
14918c2ecf20Sopenharmony_ci		.num_parents = 1,
14928c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
14938c2ecf20Sopenharmony_ci	}
14948c2ecf20Sopenharmony_ci};
14958c2ecf20Sopenharmony_ci
14968c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_vclk2_div6_div_gate = {
14978c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_gate_data){
14988c2ecf20Sopenharmony_ci		.offset = HHI_VIID_CLK_DIV,
14998c2ecf20Sopenharmony_ci		.bit_idx = 3,
15008c2ecf20Sopenharmony_ci	},
15018c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
15028c2ecf20Sopenharmony_ci		.name = "vclk2_div6_en",
15038c2ecf20Sopenharmony_ci		.ops = &clk_regmap_gate_ro_ops,
15048c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
15058c2ecf20Sopenharmony_ci			&meson8b_vclk2_div6_div.hw
15068c2ecf20Sopenharmony_ci		},
15078c2ecf20Sopenharmony_ci		.num_parents = 1,
15088c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
15098c2ecf20Sopenharmony_ci	},
15108c2ecf20Sopenharmony_ci};
15118c2ecf20Sopenharmony_ci
15128c2ecf20Sopenharmony_cistatic struct clk_fixed_factor meson8b_vclk2_div12_div = {
15138c2ecf20Sopenharmony_ci	.mult = 1,
15148c2ecf20Sopenharmony_ci	.div = 12,
15158c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
15168c2ecf20Sopenharmony_ci		.name = "vclk2_div12",
15178c2ecf20Sopenharmony_ci		.ops = &clk_fixed_factor_ops,
15188c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
15198c2ecf20Sopenharmony_ci			&meson8b_vclk2_clk_en.hw
15208c2ecf20Sopenharmony_ci		},
15218c2ecf20Sopenharmony_ci		.num_parents = 1,
15228c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
15238c2ecf20Sopenharmony_ci	}
15248c2ecf20Sopenharmony_ci};
15258c2ecf20Sopenharmony_ci
15268c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_vclk2_div12_div_gate = {
15278c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_gate_data){
15288c2ecf20Sopenharmony_ci		.offset = HHI_VIID_CLK_DIV,
15298c2ecf20Sopenharmony_ci		.bit_idx = 4,
15308c2ecf20Sopenharmony_ci	},
15318c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
15328c2ecf20Sopenharmony_ci		.name = "vclk2_div12_en",
15338c2ecf20Sopenharmony_ci		.ops = &clk_regmap_gate_ro_ops,
15348c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
15358c2ecf20Sopenharmony_ci			&meson8b_vclk2_div12_div.hw
15368c2ecf20Sopenharmony_ci		},
15378c2ecf20Sopenharmony_ci		.num_parents = 1,
15388c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
15398c2ecf20Sopenharmony_ci	},
15408c2ecf20Sopenharmony_ci};
15418c2ecf20Sopenharmony_ci
15428c2ecf20Sopenharmony_cistatic const struct clk_hw *meson8b_vclk_enc_mux_parent_hws[] = {
15438c2ecf20Sopenharmony_ci	&meson8b_vclk_div1_gate.hw,
15448c2ecf20Sopenharmony_ci	&meson8b_vclk_div2_div_gate.hw,
15458c2ecf20Sopenharmony_ci	&meson8b_vclk_div4_div_gate.hw,
15468c2ecf20Sopenharmony_ci	&meson8b_vclk_div6_div_gate.hw,
15478c2ecf20Sopenharmony_ci	&meson8b_vclk_div12_div_gate.hw,
15488c2ecf20Sopenharmony_ci};
15498c2ecf20Sopenharmony_ci
15508c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_cts_enct_sel = {
15518c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_mux_data){
15528c2ecf20Sopenharmony_ci		.offset = HHI_VID_CLK_DIV,
15538c2ecf20Sopenharmony_ci		.mask = 0xf,
15548c2ecf20Sopenharmony_ci		.shift = 20,
15558c2ecf20Sopenharmony_ci	},
15568c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
15578c2ecf20Sopenharmony_ci		.name = "cts_enct_sel",
15588c2ecf20Sopenharmony_ci		.ops = &clk_regmap_mux_ro_ops,
15598c2ecf20Sopenharmony_ci		.parent_hws = meson8b_vclk_enc_mux_parent_hws,
15608c2ecf20Sopenharmony_ci		.num_parents = ARRAY_SIZE(meson8b_vclk_enc_mux_parent_hws),
15618c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
15628c2ecf20Sopenharmony_ci	},
15638c2ecf20Sopenharmony_ci};
15648c2ecf20Sopenharmony_ci
15658c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_cts_enct = {
15668c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_gate_data){
15678c2ecf20Sopenharmony_ci		.offset = HHI_VID_CLK_CNTL2,
15688c2ecf20Sopenharmony_ci		.bit_idx = 1,
15698c2ecf20Sopenharmony_ci	},
15708c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
15718c2ecf20Sopenharmony_ci		.name = "cts_enct",
15728c2ecf20Sopenharmony_ci		.ops = &clk_regmap_gate_ro_ops,
15738c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
15748c2ecf20Sopenharmony_ci			&meson8b_cts_enct_sel.hw
15758c2ecf20Sopenharmony_ci		},
15768c2ecf20Sopenharmony_ci		.num_parents = 1,
15778c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
15788c2ecf20Sopenharmony_ci	},
15798c2ecf20Sopenharmony_ci};
15808c2ecf20Sopenharmony_ci
15818c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_cts_encp_sel = {
15828c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_mux_data){
15838c2ecf20Sopenharmony_ci		.offset = HHI_VID_CLK_DIV,
15848c2ecf20Sopenharmony_ci		.mask = 0xf,
15858c2ecf20Sopenharmony_ci		.shift = 24,
15868c2ecf20Sopenharmony_ci	},
15878c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
15888c2ecf20Sopenharmony_ci		.name = "cts_encp_sel",
15898c2ecf20Sopenharmony_ci		.ops = &clk_regmap_mux_ro_ops,
15908c2ecf20Sopenharmony_ci		.parent_hws = meson8b_vclk_enc_mux_parent_hws,
15918c2ecf20Sopenharmony_ci		.num_parents = ARRAY_SIZE(meson8b_vclk_enc_mux_parent_hws),
15928c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
15938c2ecf20Sopenharmony_ci	},
15948c2ecf20Sopenharmony_ci};
15958c2ecf20Sopenharmony_ci
15968c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_cts_encp = {
15978c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_gate_data){
15988c2ecf20Sopenharmony_ci		.offset = HHI_VID_CLK_CNTL2,
15998c2ecf20Sopenharmony_ci		.bit_idx = 2,
16008c2ecf20Sopenharmony_ci	},
16018c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
16028c2ecf20Sopenharmony_ci		.name = "cts_encp",
16038c2ecf20Sopenharmony_ci		.ops = &clk_regmap_gate_ro_ops,
16048c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
16058c2ecf20Sopenharmony_ci			&meson8b_cts_encp_sel.hw
16068c2ecf20Sopenharmony_ci		},
16078c2ecf20Sopenharmony_ci		.num_parents = 1,
16088c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
16098c2ecf20Sopenharmony_ci	},
16108c2ecf20Sopenharmony_ci};
16118c2ecf20Sopenharmony_ci
16128c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_cts_enci_sel = {
16138c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_mux_data){
16148c2ecf20Sopenharmony_ci		.offset = HHI_VID_CLK_DIV,
16158c2ecf20Sopenharmony_ci		.mask = 0xf,
16168c2ecf20Sopenharmony_ci		.shift = 28,
16178c2ecf20Sopenharmony_ci	},
16188c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
16198c2ecf20Sopenharmony_ci		.name = "cts_enci_sel",
16208c2ecf20Sopenharmony_ci		.ops = &clk_regmap_mux_ro_ops,
16218c2ecf20Sopenharmony_ci		.parent_hws = meson8b_vclk_enc_mux_parent_hws,
16228c2ecf20Sopenharmony_ci		.num_parents = ARRAY_SIZE(meson8b_vclk_enc_mux_parent_hws),
16238c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
16248c2ecf20Sopenharmony_ci	},
16258c2ecf20Sopenharmony_ci};
16268c2ecf20Sopenharmony_ci
16278c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_cts_enci = {
16288c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_gate_data){
16298c2ecf20Sopenharmony_ci		.offset = HHI_VID_CLK_CNTL2,
16308c2ecf20Sopenharmony_ci		.bit_idx = 0,
16318c2ecf20Sopenharmony_ci	},
16328c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
16338c2ecf20Sopenharmony_ci		.name = "cts_enci",
16348c2ecf20Sopenharmony_ci		.ops = &clk_regmap_gate_ro_ops,
16358c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
16368c2ecf20Sopenharmony_ci			&meson8b_cts_enci_sel.hw
16378c2ecf20Sopenharmony_ci		},
16388c2ecf20Sopenharmony_ci		.num_parents = 1,
16398c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
16408c2ecf20Sopenharmony_ci	},
16418c2ecf20Sopenharmony_ci};
16428c2ecf20Sopenharmony_ci
16438c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_hdmi_tx_pixel_sel = {
16448c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_mux_data){
16458c2ecf20Sopenharmony_ci		.offset = HHI_HDMI_CLK_CNTL,
16468c2ecf20Sopenharmony_ci		.mask = 0xf,
16478c2ecf20Sopenharmony_ci		.shift = 16,
16488c2ecf20Sopenharmony_ci	},
16498c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
16508c2ecf20Sopenharmony_ci		.name = "hdmi_tx_pixel_sel",
16518c2ecf20Sopenharmony_ci		.ops = &clk_regmap_mux_ro_ops,
16528c2ecf20Sopenharmony_ci		.parent_hws = meson8b_vclk_enc_mux_parent_hws,
16538c2ecf20Sopenharmony_ci		.num_parents = ARRAY_SIZE(meson8b_vclk_enc_mux_parent_hws),
16548c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
16558c2ecf20Sopenharmony_ci	},
16568c2ecf20Sopenharmony_ci};
16578c2ecf20Sopenharmony_ci
16588c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_hdmi_tx_pixel = {
16598c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_gate_data){
16608c2ecf20Sopenharmony_ci		.offset = HHI_VID_CLK_CNTL2,
16618c2ecf20Sopenharmony_ci		.bit_idx = 5,
16628c2ecf20Sopenharmony_ci	},
16638c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
16648c2ecf20Sopenharmony_ci		.name = "hdmi_tx_pixel",
16658c2ecf20Sopenharmony_ci		.ops = &clk_regmap_gate_ro_ops,
16668c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
16678c2ecf20Sopenharmony_ci			&meson8b_hdmi_tx_pixel_sel.hw
16688c2ecf20Sopenharmony_ci		},
16698c2ecf20Sopenharmony_ci		.num_parents = 1,
16708c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
16718c2ecf20Sopenharmony_ci	},
16728c2ecf20Sopenharmony_ci};
16738c2ecf20Sopenharmony_ci
16748c2ecf20Sopenharmony_cistatic const struct clk_hw *meson8b_vclk2_enc_mux_parent_hws[] = {
16758c2ecf20Sopenharmony_ci	&meson8b_vclk2_div1_gate.hw,
16768c2ecf20Sopenharmony_ci	&meson8b_vclk2_div2_div_gate.hw,
16778c2ecf20Sopenharmony_ci	&meson8b_vclk2_div4_div_gate.hw,
16788c2ecf20Sopenharmony_ci	&meson8b_vclk2_div6_div_gate.hw,
16798c2ecf20Sopenharmony_ci	&meson8b_vclk2_div12_div_gate.hw,
16808c2ecf20Sopenharmony_ci};
16818c2ecf20Sopenharmony_ci
16828c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_cts_encl_sel = {
16838c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_mux_data){
16848c2ecf20Sopenharmony_ci		.offset = HHI_VIID_CLK_DIV,
16858c2ecf20Sopenharmony_ci		.mask = 0xf,
16868c2ecf20Sopenharmony_ci		.shift = 12,
16878c2ecf20Sopenharmony_ci	},
16888c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
16898c2ecf20Sopenharmony_ci		.name = "cts_encl_sel",
16908c2ecf20Sopenharmony_ci		.ops = &clk_regmap_mux_ro_ops,
16918c2ecf20Sopenharmony_ci		.parent_hws = meson8b_vclk2_enc_mux_parent_hws,
16928c2ecf20Sopenharmony_ci		.num_parents = ARRAY_SIZE(meson8b_vclk2_enc_mux_parent_hws),
16938c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
16948c2ecf20Sopenharmony_ci	},
16958c2ecf20Sopenharmony_ci};
16968c2ecf20Sopenharmony_ci
16978c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_cts_encl = {
16988c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_gate_data){
16998c2ecf20Sopenharmony_ci		.offset = HHI_VID_CLK_CNTL2,
17008c2ecf20Sopenharmony_ci		.bit_idx = 3,
17018c2ecf20Sopenharmony_ci	},
17028c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
17038c2ecf20Sopenharmony_ci		.name = "cts_encl",
17048c2ecf20Sopenharmony_ci		.ops = &clk_regmap_gate_ro_ops,
17058c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
17068c2ecf20Sopenharmony_ci			&meson8b_cts_encl_sel.hw
17078c2ecf20Sopenharmony_ci		},
17088c2ecf20Sopenharmony_ci		.num_parents = 1,
17098c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
17108c2ecf20Sopenharmony_ci	},
17118c2ecf20Sopenharmony_ci};
17128c2ecf20Sopenharmony_ci
17138c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_cts_vdac0_sel = {
17148c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_mux_data){
17158c2ecf20Sopenharmony_ci		.offset = HHI_VIID_CLK_DIV,
17168c2ecf20Sopenharmony_ci		.mask = 0xf,
17178c2ecf20Sopenharmony_ci		.shift = 28,
17188c2ecf20Sopenharmony_ci	},
17198c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
17208c2ecf20Sopenharmony_ci		.name = "cts_vdac0_sel",
17218c2ecf20Sopenharmony_ci		.ops = &clk_regmap_mux_ro_ops,
17228c2ecf20Sopenharmony_ci		.parent_hws = meson8b_vclk2_enc_mux_parent_hws,
17238c2ecf20Sopenharmony_ci		.num_parents = ARRAY_SIZE(meson8b_vclk2_enc_mux_parent_hws),
17248c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
17258c2ecf20Sopenharmony_ci	},
17268c2ecf20Sopenharmony_ci};
17278c2ecf20Sopenharmony_ci
17288c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_cts_vdac0 = {
17298c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_gate_data){
17308c2ecf20Sopenharmony_ci		.offset = HHI_VID_CLK_CNTL2,
17318c2ecf20Sopenharmony_ci		.bit_idx = 4,
17328c2ecf20Sopenharmony_ci	},
17338c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
17348c2ecf20Sopenharmony_ci		.name = "cts_vdac0",
17358c2ecf20Sopenharmony_ci		.ops = &clk_regmap_gate_ro_ops,
17368c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
17378c2ecf20Sopenharmony_ci			&meson8b_cts_vdac0_sel.hw
17388c2ecf20Sopenharmony_ci		},
17398c2ecf20Sopenharmony_ci		.num_parents = 1,
17408c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
17418c2ecf20Sopenharmony_ci	},
17428c2ecf20Sopenharmony_ci};
17438c2ecf20Sopenharmony_ci
17448c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_hdmi_sys_sel = {
17458c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_mux_data){
17468c2ecf20Sopenharmony_ci		.offset = HHI_HDMI_CLK_CNTL,
17478c2ecf20Sopenharmony_ci		.mask = 0x3,
17488c2ecf20Sopenharmony_ci		.shift = 9,
17498c2ecf20Sopenharmony_ci		.flags = CLK_MUX_ROUND_CLOSEST,
17508c2ecf20Sopenharmony_ci	},
17518c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
17528c2ecf20Sopenharmony_ci		.name = "hdmi_sys_sel",
17538c2ecf20Sopenharmony_ci		.ops = &clk_regmap_mux_ops,
17548c2ecf20Sopenharmony_ci		/* FIXME: all other parents are unknown */
17558c2ecf20Sopenharmony_ci		.parent_data = &(const struct clk_parent_data) {
17568c2ecf20Sopenharmony_ci			.fw_name = "xtal",
17578c2ecf20Sopenharmony_ci			.name = "xtal",
17588c2ecf20Sopenharmony_ci			.index = -1,
17598c2ecf20Sopenharmony_ci		},
17608c2ecf20Sopenharmony_ci		.num_parents = 1,
17618c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_NO_REPARENT,
17628c2ecf20Sopenharmony_ci	},
17638c2ecf20Sopenharmony_ci};
17648c2ecf20Sopenharmony_ci
17658c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_hdmi_sys_div = {
17668c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_div_data){
17678c2ecf20Sopenharmony_ci		.offset = HHI_HDMI_CLK_CNTL,
17688c2ecf20Sopenharmony_ci		.shift = 0,
17698c2ecf20Sopenharmony_ci		.width = 7,
17708c2ecf20Sopenharmony_ci	},
17718c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
17728c2ecf20Sopenharmony_ci		.name = "hdmi_sys_div",
17738c2ecf20Sopenharmony_ci		.ops = &clk_regmap_divider_ops,
17748c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
17758c2ecf20Sopenharmony_ci			&meson8b_hdmi_sys_sel.hw
17768c2ecf20Sopenharmony_ci		},
17778c2ecf20Sopenharmony_ci		.num_parents = 1,
17788c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
17798c2ecf20Sopenharmony_ci	},
17808c2ecf20Sopenharmony_ci};
17818c2ecf20Sopenharmony_ci
17828c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_hdmi_sys = {
17838c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_gate_data){
17848c2ecf20Sopenharmony_ci		.offset = HHI_HDMI_CLK_CNTL,
17858c2ecf20Sopenharmony_ci		.bit_idx = 8,
17868c2ecf20Sopenharmony_ci	},
17878c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data) {
17888c2ecf20Sopenharmony_ci		.name = "hdmi_sys",
17898c2ecf20Sopenharmony_ci		.ops = &clk_regmap_gate_ops,
17908c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
17918c2ecf20Sopenharmony_ci			&meson8b_hdmi_sys_div.hw
17928c2ecf20Sopenharmony_ci		},
17938c2ecf20Sopenharmony_ci		.num_parents = 1,
17948c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
17958c2ecf20Sopenharmony_ci	},
17968c2ecf20Sopenharmony_ci};
17978c2ecf20Sopenharmony_ci
17988c2ecf20Sopenharmony_ci/*
17998c2ecf20Sopenharmony_ci * The MALI IP is clocked by two identical clocks (mali_0 and mali_1)
18008c2ecf20Sopenharmony_ci * muxed by a glitch-free switch on Meson8b and Meson8m2. The CCF can
18018c2ecf20Sopenharmony_ci * actually manage this glitch-free mux because it does top-to-bottom
18028c2ecf20Sopenharmony_ci * updates the each clock tree and switches to the "inactive" one when
18038c2ecf20Sopenharmony_ci * CLK_SET_RATE_GATE is set.
18048c2ecf20Sopenharmony_ci * Meson8 only has mali_0 and no glitch-free mux.
18058c2ecf20Sopenharmony_ci */
18068c2ecf20Sopenharmony_cistatic const struct clk_parent_data meson8b_mali_0_1_parent_data[] = {
18078c2ecf20Sopenharmony_ci	{ .fw_name = "xtal", .name = "xtal", .index = -1, },
18088c2ecf20Sopenharmony_ci	{ .hw = &meson8b_mpll2.hw, },
18098c2ecf20Sopenharmony_ci	{ .hw = &meson8b_mpll1.hw, },
18108c2ecf20Sopenharmony_ci	{ .hw = &meson8b_fclk_div7.hw, },
18118c2ecf20Sopenharmony_ci	{ .hw = &meson8b_fclk_div4.hw, },
18128c2ecf20Sopenharmony_ci	{ .hw = &meson8b_fclk_div3.hw, },
18138c2ecf20Sopenharmony_ci	{ .hw = &meson8b_fclk_div5.hw, },
18148c2ecf20Sopenharmony_ci};
18158c2ecf20Sopenharmony_ci
18168c2ecf20Sopenharmony_cistatic u32 meson8b_mali_0_1_mux_table[] = { 0, 2, 3, 4, 5, 6, 7 };
18178c2ecf20Sopenharmony_ci
18188c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_mali_0_sel = {
18198c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_mux_data){
18208c2ecf20Sopenharmony_ci		.offset = HHI_MALI_CLK_CNTL,
18218c2ecf20Sopenharmony_ci		.mask = 0x7,
18228c2ecf20Sopenharmony_ci		.shift = 9,
18238c2ecf20Sopenharmony_ci		.table = meson8b_mali_0_1_mux_table,
18248c2ecf20Sopenharmony_ci	},
18258c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
18268c2ecf20Sopenharmony_ci		.name = "mali_0_sel",
18278c2ecf20Sopenharmony_ci		.ops = &clk_regmap_mux_ops,
18288c2ecf20Sopenharmony_ci		.parent_data = meson8b_mali_0_1_parent_data,
18298c2ecf20Sopenharmony_ci		.num_parents = ARRAY_SIZE(meson8b_mali_0_1_parent_data),
18308c2ecf20Sopenharmony_ci		/*
18318c2ecf20Sopenharmony_ci		 * Don't propagate rate changes up because the only changeable
18328c2ecf20Sopenharmony_ci		 * parents are mpll1 and mpll2 but we need those for audio and
18338c2ecf20Sopenharmony_ci		 * RGMII (Ethernet). We don't want to change the audio or
18348c2ecf20Sopenharmony_ci		 * Ethernet clocks when setting the GPU frequency.
18358c2ecf20Sopenharmony_ci		 */
18368c2ecf20Sopenharmony_ci		.flags = 0,
18378c2ecf20Sopenharmony_ci	},
18388c2ecf20Sopenharmony_ci};
18398c2ecf20Sopenharmony_ci
18408c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_mali_0_div = {
18418c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_div_data){
18428c2ecf20Sopenharmony_ci		.offset = HHI_MALI_CLK_CNTL,
18438c2ecf20Sopenharmony_ci		.shift = 0,
18448c2ecf20Sopenharmony_ci		.width = 7,
18458c2ecf20Sopenharmony_ci	},
18468c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
18478c2ecf20Sopenharmony_ci		.name = "mali_0_div",
18488c2ecf20Sopenharmony_ci		.ops = &clk_regmap_divider_ops,
18498c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
18508c2ecf20Sopenharmony_ci			&meson8b_mali_0_sel.hw
18518c2ecf20Sopenharmony_ci		},
18528c2ecf20Sopenharmony_ci		.num_parents = 1,
18538c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
18548c2ecf20Sopenharmony_ci	},
18558c2ecf20Sopenharmony_ci};
18568c2ecf20Sopenharmony_ci
18578c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_mali_0 = {
18588c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_gate_data){
18598c2ecf20Sopenharmony_ci		.offset = HHI_MALI_CLK_CNTL,
18608c2ecf20Sopenharmony_ci		.bit_idx = 8,
18618c2ecf20Sopenharmony_ci	},
18628c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
18638c2ecf20Sopenharmony_ci		.name = "mali_0",
18648c2ecf20Sopenharmony_ci		.ops = &clk_regmap_gate_ops,
18658c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
18668c2ecf20Sopenharmony_ci			&meson8b_mali_0_div.hw
18678c2ecf20Sopenharmony_ci		},
18688c2ecf20Sopenharmony_ci		.num_parents = 1,
18698c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_GATE | CLK_SET_RATE_PARENT,
18708c2ecf20Sopenharmony_ci	},
18718c2ecf20Sopenharmony_ci};
18728c2ecf20Sopenharmony_ci
18738c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_mali_1_sel = {
18748c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_mux_data){
18758c2ecf20Sopenharmony_ci		.offset = HHI_MALI_CLK_CNTL,
18768c2ecf20Sopenharmony_ci		.mask = 0x7,
18778c2ecf20Sopenharmony_ci		.shift = 25,
18788c2ecf20Sopenharmony_ci		.table = meson8b_mali_0_1_mux_table,
18798c2ecf20Sopenharmony_ci	},
18808c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
18818c2ecf20Sopenharmony_ci		.name = "mali_1_sel",
18828c2ecf20Sopenharmony_ci		.ops = &clk_regmap_mux_ops,
18838c2ecf20Sopenharmony_ci		.parent_data = meson8b_mali_0_1_parent_data,
18848c2ecf20Sopenharmony_ci		.num_parents = ARRAY_SIZE(meson8b_mali_0_1_parent_data),
18858c2ecf20Sopenharmony_ci		/*
18868c2ecf20Sopenharmony_ci		 * Don't propagate rate changes up because the only changeable
18878c2ecf20Sopenharmony_ci		 * parents are mpll1 and mpll2 but we need those for audio and
18888c2ecf20Sopenharmony_ci		 * RGMII (Ethernet). We don't want to change the audio or
18898c2ecf20Sopenharmony_ci		 * Ethernet clocks when setting the GPU frequency.
18908c2ecf20Sopenharmony_ci		 */
18918c2ecf20Sopenharmony_ci		.flags = 0,
18928c2ecf20Sopenharmony_ci	},
18938c2ecf20Sopenharmony_ci};
18948c2ecf20Sopenharmony_ci
18958c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_mali_1_div = {
18968c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_div_data){
18978c2ecf20Sopenharmony_ci		.offset = HHI_MALI_CLK_CNTL,
18988c2ecf20Sopenharmony_ci		.shift = 16,
18998c2ecf20Sopenharmony_ci		.width = 7,
19008c2ecf20Sopenharmony_ci	},
19018c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
19028c2ecf20Sopenharmony_ci		.name = "mali_1_div",
19038c2ecf20Sopenharmony_ci		.ops = &clk_regmap_divider_ops,
19048c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
19058c2ecf20Sopenharmony_ci			&meson8b_mali_1_sel.hw
19068c2ecf20Sopenharmony_ci		},
19078c2ecf20Sopenharmony_ci		.num_parents = 1,
19088c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
19098c2ecf20Sopenharmony_ci	},
19108c2ecf20Sopenharmony_ci};
19118c2ecf20Sopenharmony_ci
19128c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_mali_1 = {
19138c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_gate_data){
19148c2ecf20Sopenharmony_ci		.offset = HHI_MALI_CLK_CNTL,
19158c2ecf20Sopenharmony_ci		.bit_idx = 24,
19168c2ecf20Sopenharmony_ci	},
19178c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
19188c2ecf20Sopenharmony_ci		.name = "mali_1",
19198c2ecf20Sopenharmony_ci		.ops = &clk_regmap_gate_ops,
19208c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
19218c2ecf20Sopenharmony_ci			&meson8b_mali_1_div.hw
19228c2ecf20Sopenharmony_ci		},
19238c2ecf20Sopenharmony_ci		.num_parents = 1,
19248c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_GATE | CLK_SET_RATE_PARENT,
19258c2ecf20Sopenharmony_ci	},
19268c2ecf20Sopenharmony_ci};
19278c2ecf20Sopenharmony_ci
19288c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_mali = {
19298c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_mux_data){
19308c2ecf20Sopenharmony_ci		.offset = HHI_MALI_CLK_CNTL,
19318c2ecf20Sopenharmony_ci		.mask = 1,
19328c2ecf20Sopenharmony_ci		.shift = 31,
19338c2ecf20Sopenharmony_ci	},
19348c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
19358c2ecf20Sopenharmony_ci		.name = "mali",
19368c2ecf20Sopenharmony_ci		.ops = &clk_regmap_mux_ops,
19378c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
19388c2ecf20Sopenharmony_ci			&meson8b_mali_0.hw,
19398c2ecf20Sopenharmony_ci			&meson8b_mali_1.hw,
19408c2ecf20Sopenharmony_ci		},
19418c2ecf20Sopenharmony_ci		.num_parents = 2,
19428c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
19438c2ecf20Sopenharmony_ci	},
19448c2ecf20Sopenharmony_ci};
19458c2ecf20Sopenharmony_ci
19468c2ecf20Sopenharmony_cistatic const struct reg_sequence meson8m2_gp_pll_init_regs[] = {
19478c2ecf20Sopenharmony_ci	{ .reg = HHI_GP_PLL_CNTL2,	.def = 0x59c88000 },
19488c2ecf20Sopenharmony_ci	{ .reg = HHI_GP_PLL_CNTL3,	.def = 0xca463823 },
19498c2ecf20Sopenharmony_ci	{ .reg = HHI_GP_PLL_CNTL4,	.def = 0x0286a027 },
19508c2ecf20Sopenharmony_ci	{ .reg = HHI_GP_PLL_CNTL5,	.def = 0x00003000 },
19518c2ecf20Sopenharmony_ci};
19528c2ecf20Sopenharmony_ci
19538c2ecf20Sopenharmony_cistatic const struct pll_params_table meson8m2_gp_pll_params_table[] = {
19548c2ecf20Sopenharmony_ci	PLL_PARAMS(182, 3),
19558c2ecf20Sopenharmony_ci	{ /* sentinel */ },
19568c2ecf20Sopenharmony_ci};
19578c2ecf20Sopenharmony_ci
19588c2ecf20Sopenharmony_cistatic struct clk_regmap meson8m2_gp_pll_dco = {
19598c2ecf20Sopenharmony_ci	.data = &(struct meson_clk_pll_data){
19608c2ecf20Sopenharmony_ci		.en = {
19618c2ecf20Sopenharmony_ci			.reg_off = HHI_GP_PLL_CNTL,
19628c2ecf20Sopenharmony_ci			.shift   = 30,
19638c2ecf20Sopenharmony_ci			.width   = 1,
19648c2ecf20Sopenharmony_ci		},
19658c2ecf20Sopenharmony_ci		.m = {
19668c2ecf20Sopenharmony_ci			.reg_off = HHI_GP_PLL_CNTL,
19678c2ecf20Sopenharmony_ci			.shift   = 0,
19688c2ecf20Sopenharmony_ci			.width   = 9,
19698c2ecf20Sopenharmony_ci		},
19708c2ecf20Sopenharmony_ci		.n = {
19718c2ecf20Sopenharmony_ci			.reg_off = HHI_GP_PLL_CNTL,
19728c2ecf20Sopenharmony_ci			.shift   = 9,
19738c2ecf20Sopenharmony_ci			.width   = 5,
19748c2ecf20Sopenharmony_ci		},
19758c2ecf20Sopenharmony_ci		.l = {
19768c2ecf20Sopenharmony_ci			.reg_off = HHI_GP_PLL_CNTL,
19778c2ecf20Sopenharmony_ci			.shift   = 31,
19788c2ecf20Sopenharmony_ci			.width   = 1,
19798c2ecf20Sopenharmony_ci		},
19808c2ecf20Sopenharmony_ci		.rst = {
19818c2ecf20Sopenharmony_ci			.reg_off = HHI_GP_PLL_CNTL,
19828c2ecf20Sopenharmony_ci			.shift   = 29,
19838c2ecf20Sopenharmony_ci			.width   = 1,
19848c2ecf20Sopenharmony_ci		},
19858c2ecf20Sopenharmony_ci		.table = meson8m2_gp_pll_params_table,
19868c2ecf20Sopenharmony_ci		.init_regs = meson8m2_gp_pll_init_regs,
19878c2ecf20Sopenharmony_ci		.init_count = ARRAY_SIZE(meson8m2_gp_pll_init_regs),
19888c2ecf20Sopenharmony_ci	},
19898c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
19908c2ecf20Sopenharmony_ci		.name = "gp_pll_dco",
19918c2ecf20Sopenharmony_ci		.ops = &meson_clk_pll_ops,
19928c2ecf20Sopenharmony_ci		.parent_data = &(const struct clk_parent_data) {
19938c2ecf20Sopenharmony_ci			.fw_name = "xtal",
19948c2ecf20Sopenharmony_ci			.name = "xtal",
19958c2ecf20Sopenharmony_ci			.index = -1,
19968c2ecf20Sopenharmony_ci		},
19978c2ecf20Sopenharmony_ci		.num_parents = 1,
19988c2ecf20Sopenharmony_ci	},
19998c2ecf20Sopenharmony_ci};
20008c2ecf20Sopenharmony_ci
20018c2ecf20Sopenharmony_cistatic struct clk_regmap meson8m2_gp_pll = {
20028c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_div_data){
20038c2ecf20Sopenharmony_ci		.offset = HHI_GP_PLL_CNTL,
20048c2ecf20Sopenharmony_ci		.shift = 16,
20058c2ecf20Sopenharmony_ci		.width = 2,
20068c2ecf20Sopenharmony_ci		.flags = CLK_DIVIDER_POWER_OF_TWO,
20078c2ecf20Sopenharmony_ci	},
20088c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
20098c2ecf20Sopenharmony_ci		.name = "gp_pll",
20108c2ecf20Sopenharmony_ci		.ops = &clk_regmap_divider_ops,
20118c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
20128c2ecf20Sopenharmony_ci			&meson8m2_gp_pll_dco.hw
20138c2ecf20Sopenharmony_ci		},
20148c2ecf20Sopenharmony_ci		.num_parents = 1,
20158c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
20168c2ecf20Sopenharmony_ci	},
20178c2ecf20Sopenharmony_ci};
20188c2ecf20Sopenharmony_ci
20198c2ecf20Sopenharmony_cistatic const struct clk_hw *meson8b_vpu_0_1_parent_hws[] = {
20208c2ecf20Sopenharmony_ci	&meson8b_fclk_div4.hw,
20218c2ecf20Sopenharmony_ci	&meson8b_fclk_div3.hw,
20228c2ecf20Sopenharmony_ci	&meson8b_fclk_div5.hw,
20238c2ecf20Sopenharmony_ci	&meson8b_fclk_div7.hw,
20248c2ecf20Sopenharmony_ci};
20258c2ecf20Sopenharmony_ci
20268c2ecf20Sopenharmony_cistatic const struct clk_hw *mmeson8m2_vpu_0_1_parent_hws[] = {
20278c2ecf20Sopenharmony_ci	&meson8b_fclk_div4.hw,
20288c2ecf20Sopenharmony_ci	&meson8b_fclk_div3.hw,
20298c2ecf20Sopenharmony_ci	&meson8b_fclk_div5.hw,
20308c2ecf20Sopenharmony_ci	&meson8m2_gp_pll.hw,
20318c2ecf20Sopenharmony_ci};
20328c2ecf20Sopenharmony_ci
20338c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_vpu_0_sel = {
20348c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_mux_data){
20358c2ecf20Sopenharmony_ci		.offset = HHI_VPU_CLK_CNTL,
20368c2ecf20Sopenharmony_ci		.mask = 0x3,
20378c2ecf20Sopenharmony_ci		.shift = 9,
20388c2ecf20Sopenharmony_ci	},
20398c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
20408c2ecf20Sopenharmony_ci		.name = "vpu_0_sel",
20418c2ecf20Sopenharmony_ci		.ops = &clk_regmap_mux_ops,
20428c2ecf20Sopenharmony_ci		.parent_hws = meson8b_vpu_0_1_parent_hws,
20438c2ecf20Sopenharmony_ci		.num_parents = ARRAY_SIZE(meson8b_vpu_0_1_parent_hws),
20448c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
20458c2ecf20Sopenharmony_ci	},
20468c2ecf20Sopenharmony_ci};
20478c2ecf20Sopenharmony_ci
20488c2ecf20Sopenharmony_cistatic struct clk_regmap meson8m2_vpu_0_sel = {
20498c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_mux_data){
20508c2ecf20Sopenharmony_ci		.offset = HHI_VPU_CLK_CNTL,
20518c2ecf20Sopenharmony_ci		.mask = 0x3,
20528c2ecf20Sopenharmony_ci		.shift = 9,
20538c2ecf20Sopenharmony_ci	},
20548c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
20558c2ecf20Sopenharmony_ci		.name = "vpu_0_sel",
20568c2ecf20Sopenharmony_ci		.ops = &clk_regmap_mux_ops,
20578c2ecf20Sopenharmony_ci		.parent_hws = mmeson8m2_vpu_0_1_parent_hws,
20588c2ecf20Sopenharmony_ci		.num_parents = ARRAY_SIZE(mmeson8m2_vpu_0_1_parent_hws),
20598c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
20608c2ecf20Sopenharmony_ci	},
20618c2ecf20Sopenharmony_ci};
20628c2ecf20Sopenharmony_ci
20638c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_vpu_0_div = {
20648c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_div_data){
20658c2ecf20Sopenharmony_ci		.offset = HHI_VPU_CLK_CNTL,
20668c2ecf20Sopenharmony_ci		.shift = 0,
20678c2ecf20Sopenharmony_ci		.width = 7,
20688c2ecf20Sopenharmony_ci	},
20698c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
20708c2ecf20Sopenharmony_ci		.name = "vpu_0_div",
20718c2ecf20Sopenharmony_ci		.ops = &clk_regmap_divider_ops,
20728c2ecf20Sopenharmony_ci		.parent_data = &(const struct clk_parent_data) {
20738c2ecf20Sopenharmony_ci			/*
20748c2ecf20Sopenharmony_ci			 * Note:
20758c2ecf20Sopenharmony_ci			 * meson8b and meson8m2 have different vpu_0_sels (with
20768c2ecf20Sopenharmony_ci			 * different struct clk_hw). We fallback to the global
20778c2ecf20Sopenharmony_ci			 * naming string mechanism so vpu_0_div picks up the
20788c2ecf20Sopenharmony_ci			 * appropriate one.
20798c2ecf20Sopenharmony_ci			 */
20808c2ecf20Sopenharmony_ci			.name = "vpu_0_sel",
20818c2ecf20Sopenharmony_ci			.index = -1,
20828c2ecf20Sopenharmony_ci		},
20838c2ecf20Sopenharmony_ci		.num_parents = 1,
20848c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
20858c2ecf20Sopenharmony_ci	},
20868c2ecf20Sopenharmony_ci};
20878c2ecf20Sopenharmony_ci
20888c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_vpu_0 = {
20898c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_gate_data){
20908c2ecf20Sopenharmony_ci		.offset = HHI_VPU_CLK_CNTL,
20918c2ecf20Sopenharmony_ci		.bit_idx = 8,
20928c2ecf20Sopenharmony_ci	},
20938c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data) {
20948c2ecf20Sopenharmony_ci		.name = "vpu_0",
20958c2ecf20Sopenharmony_ci		.ops = &clk_regmap_gate_ops,
20968c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
20978c2ecf20Sopenharmony_ci			&meson8b_vpu_0_div.hw
20988c2ecf20Sopenharmony_ci		},
20998c2ecf20Sopenharmony_ci		.num_parents = 1,
21008c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_GATE | CLK_SET_RATE_PARENT,
21018c2ecf20Sopenharmony_ci	},
21028c2ecf20Sopenharmony_ci};
21038c2ecf20Sopenharmony_ci
21048c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_vpu_1_sel = {
21058c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_mux_data){
21068c2ecf20Sopenharmony_ci		.offset = HHI_VPU_CLK_CNTL,
21078c2ecf20Sopenharmony_ci		.mask = 0x3,
21088c2ecf20Sopenharmony_ci		.shift = 25,
21098c2ecf20Sopenharmony_ci	},
21108c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
21118c2ecf20Sopenharmony_ci		.name = "vpu_1_sel",
21128c2ecf20Sopenharmony_ci		.ops = &clk_regmap_mux_ops,
21138c2ecf20Sopenharmony_ci		.parent_hws = meson8b_vpu_0_1_parent_hws,
21148c2ecf20Sopenharmony_ci		.num_parents = ARRAY_SIZE(meson8b_vpu_0_1_parent_hws),
21158c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
21168c2ecf20Sopenharmony_ci	},
21178c2ecf20Sopenharmony_ci};
21188c2ecf20Sopenharmony_ci
21198c2ecf20Sopenharmony_cistatic struct clk_regmap meson8m2_vpu_1_sel = {
21208c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_mux_data){
21218c2ecf20Sopenharmony_ci		.offset = HHI_VPU_CLK_CNTL,
21228c2ecf20Sopenharmony_ci		.mask = 0x3,
21238c2ecf20Sopenharmony_ci		.shift = 25,
21248c2ecf20Sopenharmony_ci	},
21258c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
21268c2ecf20Sopenharmony_ci		.name = "vpu_1_sel",
21278c2ecf20Sopenharmony_ci		.ops = &clk_regmap_mux_ops,
21288c2ecf20Sopenharmony_ci		.parent_hws = mmeson8m2_vpu_0_1_parent_hws,
21298c2ecf20Sopenharmony_ci		.num_parents = ARRAY_SIZE(mmeson8m2_vpu_0_1_parent_hws),
21308c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
21318c2ecf20Sopenharmony_ci	},
21328c2ecf20Sopenharmony_ci};
21338c2ecf20Sopenharmony_ci
21348c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_vpu_1_div = {
21358c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_div_data){
21368c2ecf20Sopenharmony_ci		.offset = HHI_VPU_CLK_CNTL,
21378c2ecf20Sopenharmony_ci		.shift = 16,
21388c2ecf20Sopenharmony_ci		.width = 7,
21398c2ecf20Sopenharmony_ci	},
21408c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
21418c2ecf20Sopenharmony_ci		.name = "vpu_1_div",
21428c2ecf20Sopenharmony_ci		.ops = &clk_regmap_divider_ops,
21438c2ecf20Sopenharmony_ci		.parent_data = &(const struct clk_parent_data) {
21448c2ecf20Sopenharmony_ci			/*
21458c2ecf20Sopenharmony_ci			 * Note:
21468c2ecf20Sopenharmony_ci			 * meson8b and meson8m2 have different vpu_1_sels (with
21478c2ecf20Sopenharmony_ci			 * different struct clk_hw). We fallback to the global
21488c2ecf20Sopenharmony_ci			 * naming string mechanism so vpu_1_div picks up the
21498c2ecf20Sopenharmony_ci			 * appropriate one.
21508c2ecf20Sopenharmony_ci			 */
21518c2ecf20Sopenharmony_ci			.name = "vpu_1_sel",
21528c2ecf20Sopenharmony_ci			.index = -1,
21538c2ecf20Sopenharmony_ci		},
21548c2ecf20Sopenharmony_ci		.num_parents = 1,
21558c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
21568c2ecf20Sopenharmony_ci	},
21578c2ecf20Sopenharmony_ci};
21588c2ecf20Sopenharmony_ci
21598c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_vpu_1 = {
21608c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_gate_data){
21618c2ecf20Sopenharmony_ci		.offset = HHI_VPU_CLK_CNTL,
21628c2ecf20Sopenharmony_ci		.bit_idx = 24,
21638c2ecf20Sopenharmony_ci	},
21648c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data) {
21658c2ecf20Sopenharmony_ci		.name = "vpu_1",
21668c2ecf20Sopenharmony_ci		.ops = &clk_regmap_gate_ops,
21678c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
21688c2ecf20Sopenharmony_ci			&meson8b_vpu_1_div.hw
21698c2ecf20Sopenharmony_ci		},
21708c2ecf20Sopenharmony_ci		.num_parents = 1,
21718c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_GATE | CLK_SET_RATE_PARENT,
21728c2ecf20Sopenharmony_ci	},
21738c2ecf20Sopenharmony_ci};
21748c2ecf20Sopenharmony_ci
21758c2ecf20Sopenharmony_ci/*
21768c2ecf20Sopenharmony_ci * The VPU clock has two two identical clock trees (vpu_0 and vpu_1)
21778c2ecf20Sopenharmony_ci * muxed by a glitch-free switch on Meson8b and Meson8m2. The CCF can
21788c2ecf20Sopenharmony_ci * actually manage this glitch-free mux because it does top-to-bottom
21798c2ecf20Sopenharmony_ci * updates the each clock tree and switches to the "inactive" one when
21808c2ecf20Sopenharmony_ci * CLK_SET_RATE_GATE is set.
21818c2ecf20Sopenharmony_ci * Meson8 only has vpu_0 and no glitch-free mux.
21828c2ecf20Sopenharmony_ci */
21838c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_vpu = {
21848c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_mux_data){
21858c2ecf20Sopenharmony_ci		.offset = HHI_VPU_CLK_CNTL,
21868c2ecf20Sopenharmony_ci		.mask = 1,
21878c2ecf20Sopenharmony_ci		.shift = 31,
21888c2ecf20Sopenharmony_ci	},
21898c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
21908c2ecf20Sopenharmony_ci		.name = "vpu",
21918c2ecf20Sopenharmony_ci		.ops = &clk_regmap_mux_ops,
21928c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
21938c2ecf20Sopenharmony_ci			&meson8b_vpu_0.hw,
21948c2ecf20Sopenharmony_ci			&meson8b_vpu_1.hw,
21958c2ecf20Sopenharmony_ci		},
21968c2ecf20Sopenharmony_ci		.num_parents = 2,
21978c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
21988c2ecf20Sopenharmony_ci	},
21998c2ecf20Sopenharmony_ci};
22008c2ecf20Sopenharmony_ci
22018c2ecf20Sopenharmony_cistatic const struct clk_hw *meson8b_vdec_parent_hws[] = {
22028c2ecf20Sopenharmony_ci	&meson8b_fclk_div4.hw,
22038c2ecf20Sopenharmony_ci	&meson8b_fclk_div3.hw,
22048c2ecf20Sopenharmony_ci	&meson8b_fclk_div5.hw,
22058c2ecf20Sopenharmony_ci	&meson8b_fclk_div7.hw,
22068c2ecf20Sopenharmony_ci	&meson8b_mpll2.hw,
22078c2ecf20Sopenharmony_ci	&meson8b_mpll1.hw,
22088c2ecf20Sopenharmony_ci};
22098c2ecf20Sopenharmony_ci
22108c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_vdec_1_sel = {
22118c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_mux_data){
22128c2ecf20Sopenharmony_ci		.offset = HHI_VDEC_CLK_CNTL,
22138c2ecf20Sopenharmony_ci		.mask = 0x3,
22148c2ecf20Sopenharmony_ci		.shift = 9,
22158c2ecf20Sopenharmony_ci		.flags = CLK_MUX_ROUND_CLOSEST,
22168c2ecf20Sopenharmony_ci	},
22178c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
22188c2ecf20Sopenharmony_ci		.name = "vdec_1_sel",
22198c2ecf20Sopenharmony_ci		.ops = &clk_regmap_mux_ops,
22208c2ecf20Sopenharmony_ci		.parent_hws = meson8b_vdec_parent_hws,
22218c2ecf20Sopenharmony_ci		.num_parents = ARRAY_SIZE(meson8b_vdec_parent_hws),
22228c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
22238c2ecf20Sopenharmony_ci	},
22248c2ecf20Sopenharmony_ci};
22258c2ecf20Sopenharmony_ci
22268c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_vdec_1_1_div = {
22278c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_div_data){
22288c2ecf20Sopenharmony_ci		.offset = HHI_VDEC_CLK_CNTL,
22298c2ecf20Sopenharmony_ci		.shift = 0,
22308c2ecf20Sopenharmony_ci		.width = 7,
22318c2ecf20Sopenharmony_ci		.flags = CLK_DIVIDER_ROUND_CLOSEST,
22328c2ecf20Sopenharmony_ci	},
22338c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
22348c2ecf20Sopenharmony_ci		.name = "vdec_1_1_div",
22358c2ecf20Sopenharmony_ci		.ops = &clk_regmap_divider_ops,
22368c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
22378c2ecf20Sopenharmony_ci			&meson8b_vdec_1_sel.hw
22388c2ecf20Sopenharmony_ci		},
22398c2ecf20Sopenharmony_ci		.num_parents = 1,
22408c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
22418c2ecf20Sopenharmony_ci	},
22428c2ecf20Sopenharmony_ci};
22438c2ecf20Sopenharmony_ci
22448c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_vdec_1_1 = {
22458c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_gate_data){
22468c2ecf20Sopenharmony_ci		.offset = HHI_VDEC_CLK_CNTL,
22478c2ecf20Sopenharmony_ci		.bit_idx = 8,
22488c2ecf20Sopenharmony_ci	},
22498c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data) {
22508c2ecf20Sopenharmony_ci		.name = "vdec_1_1",
22518c2ecf20Sopenharmony_ci		.ops = &clk_regmap_gate_ops,
22528c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
22538c2ecf20Sopenharmony_ci			&meson8b_vdec_1_1_div.hw
22548c2ecf20Sopenharmony_ci		},
22558c2ecf20Sopenharmony_ci		.num_parents = 1,
22568c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
22578c2ecf20Sopenharmony_ci	},
22588c2ecf20Sopenharmony_ci};
22598c2ecf20Sopenharmony_ci
22608c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_vdec_1_2_div = {
22618c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_div_data){
22628c2ecf20Sopenharmony_ci		.offset = HHI_VDEC3_CLK_CNTL,
22638c2ecf20Sopenharmony_ci		.shift = 0,
22648c2ecf20Sopenharmony_ci		.width = 7,
22658c2ecf20Sopenharmony_ci		.flags = CLK_DIVIDER_ROUND_CLOSEST,
22668c2ecf20Sopenharmony_ci	},
22678c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
22688c2ecf20Sopenharmony_ci		.name = "vdec_1_2_div",
22698c2ecf20Sopenharmony_ci		.ops = &clk_regmap_divider_ops,
22708c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
22718c2ecf20Sopenharmony_ci			&meson8b_vdec_1_sel.hw
22728c2ecf20Sopenharmony_ci		},
22738c2ecf20Sopenharmony_ci		.num_parents = 1,
22748c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
22758c2ecf20Sopenharmony_ci	},
22768c2ecf20Sopenharmony_ci};
22778c2ecf20Sopenharmony_ci
22788c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_vdec_1_2 = {
22798c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_gate_data){
22808c2ecf20Sopenharmony_ci		.offset = HHI_VDEC3_CLK_CNTL,
22818c2ecf20Sopenharmony_ci		.bit_idx = 8,
22828c2ecf20Sopenharmony_ci	},
22838c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data) {
22848c2ecf20Sopenharmony_ci		.name = "vdec_1_2",
22858c2ecf20Sopenharmony_ci		.ops = &clk_regmap_gate_ops,
22868c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
22878c2ecf20Sopenharmony_ci			&meson8b_vdec_1_2_div.hw
22888c2ecf20Sopenharmony_ci		},
22898c2ecf20Sopenharmony_ci		.num_parents = 1,
22908c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
22918c2ecf20Sopenharmony_ci	},
22928c2ecf20Sopenharmony_ci};
22938c2ecf20Sopenharmony_ci
22948c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_vdec_1 = {
22958c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_mux_data){
22968c2ecf20Sopenharmony_ci		.offset = HHI_VDEC3_CLK_CNTL,
22978c2ecf20Sopenharmony_ci		.mask = 0x1,
22988c2ecf20Sopenharmony_ci		.shift = 15,
22998c2ecf20Sopenharmony_ci		.flags = CLK_MUX_ROUND_CLOSEST,
23008c2ecf20Sopenharmony_ci	},
23018c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
23028c2ecf20Sopenharmony_ci		.name = "vdec_1",
23038c2ecf20Sopenharmony_ci		.ops = &clk_regmap_mux_ops,
23048c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
23058c2ecf20Sopenharmony_ci			&meson8b_vdec_1_1.hw,
23068c2ecf20Sopenharmony_ci			&meson8b_vdec_1_2.hw,
23078c2ecf20Sopenharmony_ci		},
23088c2ecf20Sopenharmony_ci		.num_parents = 2,
23098c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
23108c2ecf20Sopenharmony_ci	},
23118c2ecf20Sopenharmony_ci};
23128c2ecf20Sopenharmony_ci
23138c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_vdec_hcodec_sel = {
23148c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_mux_data){
23158c2ecf20Sopenharmony_ci		.offset = HHI_VDEC_CLK_CNTL,
23168c2ecf20Sopenharmony_ci		.mask = 0x3,
23178c2ecf20Sopenharmony_ci		.shift = 25,
23188c2ecf20Sopenharmony_ci		.flags = CLK_MUX_ROUND_CLOSEST,
23198c2ecf20Sopenharmony_ci	},
23208c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
23218c2ecf20Sopenharmony_ci		.name = "vdec_hcodec_sel",
23228c2ecf20Sopenharmony_ci		.ops = &clk_regmap_mux_ops,
23238c2ecf20Sopenharmony_ci		.parent_hws = meson8b_vdec_parent_hws,
23248c2ecf20Sopenharmony_ci		.num_parents = ARRAY_SIZE(meson8b_vdec_parent_hws),
23258c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
23268c2ecf20Sopenharmony_ci	},
23278c2ecf20Sopenharmony_ci};
23288c2ecf20Sopenharmony_ci
23298c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_vdec_hcodec_div = {
23308c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_div_data){
23318c2ecf20Sopenharmony_ci		.offset = HHI_VDEC_CLK_CNTL,
23328c2ecf20Sopenharmony_ci		.shift = 16,
23338c2ecf20Sopenharmony_ci		.width = 7,
23348c2ecf20Sopenharmony_ci		.flags = CLK_DIVIDER_ROUND_CLOSEST,
23358c2ecf20Sopenharmony_ci	},
23368c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
23378c2ecf20Sopenharmony_ci		.name = "vdec_hcodec_div",
23388c2ecf20Sopenharmony_ci		.ops = &clk_regmap_divider_ops,
23398c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
23408c2ecf20Sopenharmony_ci			&meson8b_vdec_hcodec_sel.hw
23418c2ecf20Sopenharmony_ci		},
23428c2ecf20Sopenharmony_ci		.num_parents = 1,
23438c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
23448c2ecf20Sopenharmony_ci	},
23458c2ecf20Sopenharmony_ci};
23468c2ecf20Sopenharmony_ci
23478c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_vdec_hcodec = {
23488c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_gate_data){
23498c2ecf20Sopenharmony_ci		.offset = HHI_VDEC_CLK_CNTL,
23508c2ecf20Sopenharmony_ci		.bit_idx = 24,
23518c2ecf20Sopenharmony_ci	},
23528c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data) {
23538c2ecf20Sopenharmony_ci		.name = "vdec_hcodec",
23548c2ecf20Sopenharmony_ci		.ops = &clk_regmap_gate_ops,
23558c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
23568c2ecf20Sopenharmony_ci			&meson8b_vdec_hcodec_div.hw
23578c2ecf20Sopenharmony_ci		},
23588c2ecf20Sopenharmony_ci		.num_parents = 1,
23598c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
23608c2ecf20Sopenharmony_ci	},
23618c2ecf20Sopenharmony_ci};
23628c2ecf20Sopenharmony_ci
23638c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_vdec_2_sel = {
23648c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_mux_data){
23658c2ecf20Sopenharmony_ci		.offset = HHI_VDEC2_CLK_CNTL,
23668c2ecf20Sopenharmony_ci		.mask = 0x3,
23678c2ecf20Sopenharmony_ci		.shift = 9,
23688c2ecf20Sopenharmony_ci		.flags = CLK_MUX_ROUND_CLOSEST,
23698c2ecf20Sopenharmony_ci	},
23708c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
23718c2ecf20Sopenharmony_ci		.name = "vdec_2_sel",
23728c2ecf20Sopenharmony_ci		.ops = &clk_regmap_mux_ops,
23738c2ecf20Sopenharmony_ci		.parent_hws = meson8b_vdec_parent_hws,
23748c2ecf20Sopenharmony_ci		.num_parents = ARRAY_SIZE(meson8b_vdec_parent_hws),
23758c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
23768c2ecf20Sopenharmony_ci	},
23778c2ecf20Sopenharmony_ci};
23788c2ecf20Sopenharmony_ci
23798c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_vdec_2_div = {
23808c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_div_data){
23818c2ecf20Sopenharmony_ci		.offset = HHI_VDEC2_CLK_CNTL,
23828c2ecf20Sopenharmony_ci		.shift = 0,
23838c2ecf20Sopenharmony_ci		.width = 7,
23848c2ecf20Sopenharmony_ci		.flags = CLK_DIVIDER_ROUND_CLOSEST,
23858c2ecf20Sopenharmony_ci	},
23868c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
23878c2ecf20Sopenharmony_ci		.name = "vdec_2_div",
23888c2ecf20Sopenharmony_ci		.ops = &clk_regmap_divider_ops,
23898c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
23908c2ecf20Sopenharmony_ci			&meson8b_vdec_2_sel.hw
23918c2ecf20Sopenharmony_ci		},
23928c2ecf20Sopenharmony_ci		.num_parents = 1,
23938c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
23948c2ecf20Sopenharmony_ci	},
23958c2ecf20Sopenharmony_ci};
23968c2ecf20Sopenharmony_ci
23978c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_vdec_2 = {
23988c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_gate_data){
23998c2ecf20Sopenharmony_ci		.offset = HHI_VDEC2_CLK_CNTL,
24008c2ecf20Sopenharmony_ci		.bit_idx = 8,
24018c2ecf20Sopenharmony_ci	},
24028c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data) {
24038c2ecf20Sopenharmony_ci		.name = "vdec_2",
24048c2ecf20Sopenharmony_ci		.ops = &clk_regmap_gate_ops,
24058c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
24068c2ecf20Sopenharmony_ci			&meson8b_vdec_2_div.hw
24078c2ecf20Sopenharmony_ci		},
24088c2ecf20Sopenharmony_ci		.num_parents = 1,
24098c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
24108c2ecf20Sopenharmony_ci	},
24118c2ecf20Sopenharmony_ci};
24128c2ecf20Sopenharmony_ci
24138c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_vdec_hevc_sel = {
24148c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_mux_data){
24158c2ecf20Sopenharmony_ci		.offset = HHI_VDEC2_CLK_CNTL,
24168c2ecf20Sopenharmony_ci		.mask = 0x3,
24178c2ecf20Sopenharmony_ci		.shift = 25,
24188c2ecf20Sopenharmony_ci		.flags = CLK_MUX_ROUND_CLOSEST,
24198c2ecf20Sopenharmony_ci	},
24208c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
24218c2ecf20Sopenharmony_ci		.name = "vdec_hevc_sel",
24228c2ecf20Sopenharmony_ci		.ops = &clk_regmap_mux_ops,
24238c2ecf20Sopenharmony_ci		.parent_hws = meson8b_vdec_parent_hws,
24248c2ecf20Sopenharmony_ci		.num_parents = ARRAY_SIZE(meson8b_vdec_parent_hws),
24258c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
24268c2ecf20Sopenharmony_ci	},
24278c2ecf20Sopenharmony_ci};
24288c2ecf20Sopenharmony_ci
24298c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_vdec_hevc_div = {
24308c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_div_data){
24318c2ecf20Sopenharmony_ci		.offset = HHI_VDEC2_CLK_CNTL,
24328c2ecf20Sopenharmony_ci		.shift = 16,
24338c2ecf20Sopenharmony_ci		.width = 7,
24348c2ecf20Sopenharmony_ci		.flags = CLK_DIVIDER_ROUND_CLOSEST,
24358c2ecf20Sopenharmony_ci	},
24368c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
24378c2ecf20Sopenharmony_ci		.name = "vdec_hevc_div",
24388c2ecf20Sopenharmony_ci		.ops = &clk_regmap_divider_ops,
24398c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
24408c2ecf20Sopenharmony_ci			&meson8b_vdec_hevc_sel.hw
24418c2ecf20Sopenharmony_ci		},
24428c2ecf20Sopenharmony_ci		.num_parents = 1,
24438c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
24448c2ecf20Sopenharmony_ci	},
24458c2ecf20Sopenharmony_ci};
24468c2ecf20Sopenharmony_ci
24478c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_vdec_hevc_en = {
24488c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_gate_data){
24498c2ecf20Sopenharmony_ci		.offset = HHI_VDEC2_CLK_CNTL,
24508c2ecf20Sopenharmony_ci		.bit_idx = 24,
24518c2ecf20Sopenharmony_ci	},
24528c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data) {
24538c2ecf20Sopenharmony_ci		.name = "vdec_hevc_en",
24548c2ecf20Sopenharmony_ci		.ops = &clk_regmap_gate_ops,
24558c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
24568c2ecf20Sopenharmony_ci			&meson8b_vdec_hevc_div.hw
24578c2ecf20Sopenharmony_ci		},
24588c2ecf20Sopenharmony_ci		.num_parents = 1,
24598c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
24608c2ecf20Sopenharmony_ci	},
24618c2ecf20Sopenharmony_ci};
24628c2ecf20Sopenharmony_ci
24638c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_vdec_hevc = {
24648c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_mux_data){
24658c2ecf20Sopenharmony_ci		.offset = HHI_VDEC2_CLK_CNTL,
24668c2ecf20Sopenharmony_ci		.mask = 0x1,
24678c2ecf20Sopenharmony_ci		.shift = 31,
24688c2ecf20Sopenharmony_ci		.flags = CLK_MUX_ROUND_CLOSEST,
24698c2ecf20Sopenharmony_ci	},
24708c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
24718c2ecf20Sopenharmony_ci		.name = "vdec_hevc",
24728c2ecf20Sopenharmony_ci		.ops = &clk_regmap_mux_ops,
24738c2ecf20Sopenharmony_ci		/* TODO: The second parent is currently unknown */
24748c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
24758c2ecf20Sopenharmony_ci			&meson8b_vdec_hevc_en.hw
24768c2ecf20Sopenharmony_ci		},
24778c2ecf20Sopenharmony_ci		.num_parents = 1,
24788c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
24798c2ecf20Sopenharmony_ci	},
24808c2ecf20Sopenharmony_ci};
24818c2ecf20Sopenharmony_ci
24828c2ecf20Sopenharmony_ci/* TODO: the clock at index 0 is "DDR_PLL" which we don't support yet */
24838c2ecf20Sopenharmony_cistatic const struct clk_hw *meson8b_cts_amclk_parent_hws[] = {
24848c2ecf20Sopenharmony_ci	&meson8b_mpll0.hw,
24858c2ecf20Sopenharmony_ci	&meson8b_mpll1.hw,
24868c2ecf20Sopenharmony_ci	&meson8b_mpll2.hw
24878c2ecf20Sopenharmony_ci};
24888c2ecf20Sopenharmony_ci
24898c2ecf20Sopenharmony_cistatic u32 meson8b_cts_amclk_mux_table[] = { 1, 2, 3 };
24908c2ecf20Sopenharmony_ci
24918c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_cts_amclk_sel = {
24928c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_mux_data){
24938c2ecf20Sopenharmony_ci		.offset = HHI_AUD_CLK_CNTL,
24948c2ecf20Sopenharmony_ci		.mask = 0x3,
24958c2ecf20Sopenharmony_ci		.shift = 9,
24968c2ecf20Sopenharmony_ci		.table = meson8b_cts_amclk_mux_table,
24978c2ecf20Sopenharmony_ci		.flags = CLK_MUX_ROUND_CLOSEST,
24988c2ecf20Sopenharmony_ci	},
24998c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
25008c2ecf20Sopenharmony_ci		.name = "cts_amclk_sel",
25018c2ecf20Sopenharmony_ci		.ops = &clk_regmap_mux_ops,
25028c2ecf20Sopenharmony_ci		.parent_hws = meson8b_cts_amclk_parent_hws,
25038c2ecf20Sopenharmony_ci		.num_parents = ARRAY_SIZE(meson8b_cts_amclk_parent_hws),
25048c2ecf20Sopenharmony_ci	},
25058c2ecf20Sopenharmony_ci};
25068c2ecf20Sopenharmony_ci
25078c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_cts_amclk_div = {
25088c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_div_data) {
25098c2ecf20Sopenharmony_ci		.offset = HHI_AUD_CLK_CNTL,
25108c2ecf20Sopenharmony_ci		.shift = 0,
25118c2ecf20Sopenharmony_ci		.width = 8,
25128c2ecf20Sopenharmony_ci		.flags = CLK_DIVIDER_ROUND_CLOSEST,
25138c2ecf20Sopenharmony_ci	},
25148c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
25158c2ecf20Sopenharmony_ci		.name = "cts_amclk_div",
25168c2ecf20Sopenharmony_ci		.ops = &clk_regmap_divider_ops,
25178c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
25188c2ecf20Sopenharmony_ci			&meson8b_cts_amclk_sel.hw
25198c2ecf20Sopenharmony_ci		},
25208c2ecf20Sopenharmony_ci		.num_parents = 1,
25218c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
25228c2ecf20Sopenharmony_ci	},
25238c2ecf20Sopenharmony_ci};
25248c2ecf20Sopenharmony_ci
25258c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_cts_amclk = {
25268c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_gate_data){
25278c2ecf20Sopenharmony_ci		.offset = HHI_AUD_CLK_CNTL,
25288c2ecf20Sopenharmony_ci		.bit_idx = 8,
25298c2ecf20Sopenharmony_ci	},
25308c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
25318c2ecf20Sopenharmony_ci		.name = "cts_amclk",
25328c2ecf20Sopenharmony_ci		.ops = &clk_regmap_gate_ops,
25338c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
25348c2ecf20Sopenharmony_ci			&meson8b_cts_amclk_div.hw
25358c2ecf20Sopenharmony_ci		},
25368c2ecf20Sopenharmony_ci		.num_parents = 1,
25378c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
25388c2ecf20Sopenharmony_ci	},
25398c2ecf20Sopenharmony_ci};
25408c2ecf20Sopenharmony_ci
25418c2ecf20Sopenharmony_ci/* TODO: the clock at index 0 is "DDR_PLL" which we don't support yet */
25428c2ecf20Sopenharmony_cistatic const struct clk_hw *meson8b_cts_mclk_i958_parent_hws[] = {
25438c2ecf20Sopenharmony_ci	&meson8b_mpll0.hw,
25448c2ecf20Sopenharmony_ci	&meson8b_mpll1.hw,
25458c2ecf20Sopenharmony_ci	&meson8b_mpll2.hw
25468c2ecf20Sopenharmony_ci};
25478c2ecf20Sopenharmony_ci
25488c2ecf20Sopenharmony_cistatic u32 meson8b_cts_mclk_i958_mux_table[] = { 1, 2, 3 };
25498c2ecf20Sopenharmony_ci
25508c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_cts_mclk_i958_sel = {
25518c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_mux_data){
25528c2ecf20Sopenharmony_ci		.offset = HHI_AUD_CLK_CNTL2,
25538c2ecf20Sopenharmony_ci		.mask = 0x3,
25548c2ecf20Sopenharmony_ci		.shift = 25,
25558c2ecf20Sopenharmony_ci		.table = meson8b_cts_mclk_i958_mux_table,
25568c2ecf20Sopenharmony_ci		.flags = CLK_MUX_ROUND_CLOSEST,
25578c2ecf20Sopenharmony_ci	},
25588c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data) {
25598c2ecf20Sopenharmony_ci		.name = "cts_mclk_i958_sel",
25608c2ecf20Sopenharmony_ci		.ops = &clk_regmap_mux_ops,
25618c2ecf20Sopenharmony_ci		.parent_hws = meson8b_cts_mclk_i958_parent_hws,
25628c2ecf20Sopenharmony_ci		.num_parents = ARRAY_SIZE(meson8b_cts_mclk_i958_parent_hws),
25638c2ecf20Sopenharmony_ci	},
25648c2ecf20Sopenharmony_ci};
25658c2ecf20Sopenharmony_ci
25668c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_cts_mclk_i958_div = {
25678c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_div_data){
25688c2ecf20Sopenharmony_ci		.offset = HHI_AUD_CLK_CNTL2,
25698c2ecf20Sopenharmony_ci		.shift = 16,
25708c2ecf20Sopenharmony_ci		.width = 8,
25718c2ecf20Sopenharmony_ci		.flags = CLK_DIVIDER_ROUND_CLOSEST,
25728c2ecf20Sopenharmony_ci	},
25738c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data) {
25748c2ecf20Sopenharmony_ci		.name = "cts_mclk_i958_div",
25758c2ecf20Sopenharmony_ci		.ops = &clk_regmap_divider_ops,
25768c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
25778c2ecf20Sopenharmony_ci			&meson8b_cts_mclk_i958_sel.hw
25788c2ecf20Sopenharmony_ci		},
25798c2ecf20Sopenharmony_ci		.num_parents = 1,
25808c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
25818c2ecf20Sopenharmony_ci	},
25828c2ecf20Sopenharmony_ci};
25838c2ecf20Sopenharmony_ci
25848c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_cts_mclk_i958 = {
25858c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_gate_data){
25868c2ecf20Sopenharmony_ci		.offset = HHI_AUD_CLK_CNTL2,
25878c2ecf20Sopenharmony_ci		.bit_idx = 24,
25888c2ecf20Sopenharmony_ci	},
25898c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
25908c2ecf20Sopenharmony_ci		.name = "cts_mclk_i958",
25918c2ecf20Sopenharmony_ci		.ops = &clk_regmap_gate_ops,
25928c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
25938c2ecf20Sopenharmony_ci			&meson8b_cts_mclk_i958_div.hw
25948c2ecf20Sopenharmony_ci		},
25958c2ecf20Sopenharmony_ci		.num_parents = 1,
25968c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT,
25978c2ecf20Sopenharmony_ci	},
25988c2ecf20Sopenharmony_ci};
25998c2ecf20Sopenharmony_ci
26008c2ecf20Sopenharmony_cistatic struct clk_regmap meson8b_cts_i958 = {
26018c2ecf20Sopenharmony_ci	.data = &(struct clk_regmap_mux_data){
26028c2ecf20Sopenharmony_ci		.offset = HHI_AUD_CLK_CNTL2,
26038c2ecf20Sopenharmony_ci		.mask = 0x1,
26048c2ecf20Sopenharmony_ci		.shift = 27,
26058c2ecf20Sopenharmony_ci		},
26068c2ecf20Sopenharmony_ci	.hw.init = &(struct clk_init_data){
26078c2ecf20Sopenharmony_ci		.name = "cts_i958",
26088c2ecf20Sopenharmony_ci		.ops = &clk_regmap_mux_ops,
26098c2ecf20Sopenharmony_ci		.parent_hws = (const struct clk_hw *[]) {
26108c2ecf20Sopenharmony_ci			&meson8b_cts_amclk.hw,
26118c2ecf20Sopenharmony_ci			&meson8b_cts_mclk_i958.hw
26128c2ecf20Sopenharmony_ci		},
26138c2ecf20Sopenharmony_ci		.num_parents = 2,
26148c2ecf20Sopenharmony_ci		/*
26158c2ecf20Sopenharmony_ci		 * The parent is specific to origin of the audio data. Let the
26168c2ecf20Sopenharmony_ci		 * consumer choose the appropriate parent.
26178c2ecf20Sopenharmony_ci		 */
26188c2ecf20Sopenharmony_ci		.flags = CLK_SET_RATE_PARENT | CLK_SET_RATE_NO_REPARENT,
26198c2ecf20Sopenharmony_ci	},
26208c2ecf20Sopenharmony_ci};
26218c2ecf20Sopenharmony_ci
26228c2ecf20Sopenharmony_ci#define MESON_GATE(_name, _reg, _bit) \
26238c2ecf20Sopenharmony_ci	MESON_PCLK(_name, _reg, _bit, &meson8b_clk81.hw)
26248c2ecf20Sopenharmony_ci
26258c2ecf20Sopenharmony_ci/* Everything Else (EE) domain gates */
26268c2ecf20Sopenharmony_ci
26278c2ecf20Sopenharmony_cistatic MESON_GATE(meson8b_ddr, HHI_GCLK_MPEG0, 0);
26288c2ecf20Sopenharmony_cistatic MESON_GATE(meson8b_dos, HHI_GCLK_MPEG0, 1);
26298c2ecf20Sopenharmony_cistatic MESON_GATE(meson8b_isa, HHI_GCLK_MPEG0, 5);
26308c2ecf20Sopenharmony_cistatic MESON_GATE(meson8b_pl301, HHI_GCLK_MPEG0, 6);
26318c2ecf20Sopenharmony_cistatic MESON_GATE(meson8b_periphs, HHI_GCLK_MPEG0, 7);
26328c2ecf20Sopenharmony_cistatic MESON_GATE(meson8b_spicc, HHI_GCLK_MPEG0, 8);
26338c2ecf20Sopenharmony_cistatic MESON_GATE(meson8b_i2c, HHI_GCLK_MPEG0, 9);
26348c2ecf20Sopenharmony_cistatic MESON_GATE(meson8b_sar_adc, HHI_GCLK_MPEG0, 10);
26358c2ecf20Sopenharmony_cistatic MESON_GATE(meson8b_smart_card, HHI_GCLK_MPEG0, 11);
26368c2ecf20Sopenharmony_cistatic MESON_GATE(meson8b_rng0, HHI_GCLK_MPEG0, 12);
26378c2ecf20Sopenharmony_cistatic MESON_GATE(meson8b_uart0, HHI_GCLK_MPEG0, 13);
26388c2ecf20Sopenharmony_cistatic MESON_GATE(meson8b_sdhc, HHI_GCLK_MPEG0, 14);
26398c2ecf20Sopenharmony_cistatic MESON_GATE(meson8b_stream, HHI_GCLK_MPEG0, 15);
26408c2ecf20Sopenharmony_cistatic MESON_GATE(meson8b_async_fifo, HHI_GCLK_MPEG0, 16);
26418c2ecf20Sopenharmony_cistatic MESON_GATE(meson8b_sdio, HHI_GCLK_MPEG0, 17);
26428c2ecf20Sopenharmony_cistatic MESON_GATE(meson8b_abuf, HHI_GCLK_MPEG0, 18);
26438c2ecf20Sopenharmony_cistatic MESON_GATE(meson8b_hiu_iface, HHI_GCLK_MPEG0, 19);
26448c2ecf20Sopenharmony_cistatic MESON_GATE(meson8b_assist_misc, HHI_GCLK_MPEG0, 23);
26458c2ecf20Sopenharmony_cistatic MESON_GATE(meson8b_spi, HHI_GCLK_MPEG0, 30);
26468c2ecf20Sopenharmony_ci
26478c2ecf20Sopenharmony_cistatic MESON_GATE(meson8b_i2s_spdif, HHI_GCLK_MPEG1, 2);
26488c2ecf20Sopenharmony_cistatic MESON_GATE(meson8b_eth, HHI_GCLK_MPEG1, 3);
26498c2ecf20Sopenharmony_cistatic MESON_GATE(meson8b_demux, HHI_GCLK_MPEG1, 4);
26508c2ecf20Sopenharmony_cistatic MESON_GATE(meson8b_blkmv, HHI_GCLK_MPEG1, 14);
26518c2ecf20Sopenharmony_cistatic MESON_GATE(meson8b_aiu, HHI_GCLK_MPEG1, 15);
26528c2ecf20Sopenharmony_cistatic MESON_GATE(meson8b_uart1, HHI_GCLK_MPEG1, 16);
26538c2ecf20Sopenharmony_cistatic MESON_GATE(meson8b_g2d, HHI_GCLK_MPEG1, 20);
26548c2ecf20Sopenharmony_cistatic MESON_GATE(meson8b_usb0, HHI_GCLK_MPEG1, 21);
26558c2ecf20Sopenharmony_cistatic MESON_GATE(meson8b_usb1, HHI_GCLK_MPEG1, 22);
26568c2ecf20Sopenharmony_cistatic MESON_GATE(meson8b_reset, HHI_GCLK_MPEG1, 23);
26578c2ecf20Sopenharmony_cistatic MESON_GATE(meson8b_nand, HHI_GCLK_MPEG1, 24);
26588c2ecf20Sopenharmony_cistatic MESON_GATE(meson8b_dos_parser, HHI_GCLK_MPEG1, 25);
26598c2ecf20Sopenharmony_cistatic MESON_GATE(meson8b_usb, HHI_GCLK_MPEG1, 26);
26608c2ecf20Sopenharmony_cistatic MESON_GATE(meson8b_vdin1, HHI_GCLK_MPEG1, 28);
26618c2ecf20Sopenharmony_cistatic MESON_GATE(meson8b_ahb_arb0, HHI_GCLK_MPEG1, 29);
26628c2ecf20Sopenharmony_cistatic MESON_GATE(meson8b_efuse, HHI_GCLK_MPEG1, 30);
26638c2ecf20Sopenharmony_cistatic MESON_GATE(meson8b_boot_rom, HHI_GCLK_MPEG1, 31);
26648c2ecf20Sopenharmony_ci
26658c2ecf20Sopenharmony_cistatic MESON_GATE(meson8b_ahb_data_bus, HHI_GCLK_MPEG2, 1);
26668c2ecf20Sopenharmony_cistatic MESON_GATE(meson8b_ahb_ctrl_bus, HHI_GCLK_MPEG2, 2);
26678c2ecf20Sopenharmony_cistatic MESON_GATE(meson8b_hdmi_intr_sync, HHI_GCLK_MPEG2, 3);
26688c2ecf20Sopenharmony_cistatic MESON_GATE(meson8b_hdmi_pclk, HHI_GCLK_MPEG2, 4);
26698c2ecf20Sopenharmony_cistatic MESON_GATE(meson8b_usb1_ddr_bridge, HHI_GCLK_MPEG2, 8);
26708c2ecf20Sopenharmony_cistatic MESON_GATE(meson8b_usb0_ddr_bridge, HHI_GCLK_MPEG2, 9);
26718c2ecf20Sopenharmony_cistatic MESON_GATE(meson8b_mmc_pclk, HHI_GCLK_MPEG2, 11);
26728c2ecf20Sopenharmony_cistatic MESON_GATE(meson8b_dvin, HHI_GCLK_MPEG2, 12);
26738c2ecf20Sopenharmony_cistatic MESON_GATE(meson8b_uart2, HHI_GCLK_MPEG2, 15);
26748c2ecf20Sopenharmony_cistatic MESON_GATE(meson8b_sana, HHI_GCLK_MPEG2, 22);
26758c2ecf20Sopenharmony_cistatic MESON_GATE(meson8b_vpu_intr, HHI_GCLK_MPEG2, 25);
26768c2ecf20Sopenharmony_cistatic MESON_GATE(meson8b_sec_ahb_ahb3_bridge, HHI_GCLK_MPEG2, 26);
26778c2ecf20Sopenharmony_cistatic MESON_GATE(meson8b_clk81_a9, HHI_GCLK_MPEG2, 29);
26788c2ecf20Sopenharmony_ci
26798c2ecf20Sopenharmony_cistatic MESON_GATE(meson8b_vclk2_venci0, HHI_GCLK_OTHER, 1);
26808c2ecf20Sopenharmony_cistatic MESON_GATE(meson8b_vclk2_venci1, HHI_GCLK_OTHER, 2);
26818c2ecf20Sopenharmony_cistatic MESON_GATE(meson8b_vclk2_vencp0, HHI_GCLK_OTHER, 3);
26828c2ecf20Sopenharmony_cistatic MESON_GATE(meson8b_vclk2_vencp1, HHI_GCLK_OTHER, 4);
26838c2ecf20Sopenharmony_cistatic MESON_GATE(meson8b_gclk_venci_int, HHI_GCLK_OTHER, 8);
26848c2ecf20Sopenharmony_cistatic MESON_GATE(meson8b_gclk_vencp_int, HHI_GCLK_OTHER, 9);
26858c2ecf20Sopenharmony_cistatic MESON_GATE(meson8b_dac_clk, HHI_GCLK_OTHER, 10);
26868c2ecf20Sopenharmony_cistatic MESON_GATE(meson8b_aoclk_gate, HHI_GCLK_OTHER, 14);
26878c2ecf20Sopenharmony_cistatic MESON_GATE(meson8b_iec958_gate, HHI_GCLK_OTHER, 16);
26888c2ecf20Sopenharmony_cistatic MESON_GATE(meson8b_enc480p, HHI_GCLK_OTHER, 20);
26898c2ecf20Sopenharmony_cistatic MESON_GATE(meson8b_rng1, HHI_GCLK_OTHER, 21);
26908c2ecf20Sopenharmony_cistatic MESON_GATE(meson8b_gclk_vencl_int, HHI_GCLK_OTHER, 22);
26918c2ecf20Sopenharmony_cistatic MESON_GATE(meson8b_vclk2_venclmcc, HHI_GCLK_OTHER, 24);
26928c2ecf20Sopenharmony_cistatic MESON_GATE(meson8b_vclk2_vencl, HHI_GCLK_OTHER, 25);
26938c2ecf20Sopenharmony_cistatic MESON_GATE(meson8b_vclk2_other, HHI_GCLK_OTHER, 26);
26948c2ecf20Sopenharmony_cistatic MESON_GATE(meson8b_edp, HHI_GCLK_OTHER, 31);
26958c2ecf20Sopenharmony_ci
26968c2ecf20Sopenharmony_ci/* AIU gates */
26978c2ecf20Sopenharmony_ci#define MESON_AIU_GLUE_GATE(_name, _reg, _bit) \
26988c2ecf20Sopenharmony_ci	MESON_PCLK(_name, _reg, _bit, &meson8b_aiu_glue.hw)
26998c2ecf20Sopenharmony_ci
27008c2ecf20Sopenharmony_cistatic MESON_PCLK(meson8b_aiu_glue, HHI_GCLK_MPEG1, 6, &meson8b_aiu.hw);
27018c2ecf20Sopenharmony_cistatic MESON_AIU_GLUE_GATE(meson8b_iec958, HHI_GCLK_MPEG1, 7);
27028c2ecf20Sopenharmony_cistatic MESON_AIU_GLUE_GATE(meson8b_i2s_out, HHI_GCLK_MPEG1, 8);
27038c2ecf20Sopenharmony_cistatic MESON_AIU_GLUE_GATE(meson8b_amclk, HHI_GCLK_MPEG1, 9);
27048c2ecf20Sopenharmony_cistatic MESON_AIU_GLUE_GATE(meson8b_aififo2, HHI_GCLK_MPEG1, 10);
27058c2ecf20Sopenharmony_cistatic MESON_AIU_GLUE_GATE(meson8b_mixer, HHI_GCLK_MPEG1, 11);
27068c2ecf20Sopenharmony_cistatic MESON_AIU_GLUE_GATE(meson8b_mixer_iface, HHI_GCLK_MPEG1, 12);
27078c2ecf20Sopenharmony_cistatic MESON_AIU_GLUE_GATE(meson8b_adc, HHI_GCLK_MPEG1, 13);
27088c2ecf20Sopenharmony_ci
27098c2ecf20Sopenharmony_ci/* Always On (AO) domain gates */
27108c2ecf20Sopenharmony_ci
27118c2ecf20Sopenharmony_cistatic MESON_GATE(meson8b_ao_media_cpu, HHI_GCLK_AO, 0);
27128c2ecf20Sopenharmony_cistatic MESON_GATE(meson8b_ao_ahb_sram, HHI_GCLK_AO, 1);
27138c2ecf20Sopenharmony_cistatic MESON_GATE(meson8b_ao_ahb_bus, HHI_GCLK_AO, 2);
27148c2ecf20Sopenharmony_cistatic MESON_GATE(meson8b_ao_iface, HHI_GCLK_AO, 3);
27158c2ecf20Sopenharmony_ci
27168c2ecf20Sopenharmony_cistatic struct clk_hw_onecell_data meson8_hw_onecell_data = {
27178c2ecf20Sopenharmony_ci	.hws = {
27188c2ecf20Sopenharmony_ci		[CLKID_XTAL] = &meson8b_xtal.hw,
27198c2ecf20Sopenharmony_ci		[CLKID_PLL_FIXED] = &meson8b_fixed_pll.hw,
27208c2ecf20Sopenharmony_ci		[CLKID_PLL_VID] = &meson8b_vid_pll.hw,
27218c2ecf20Sopenharmony_ci		[CLKID_PLL_SYS] = &meson8b_sys_pll.hw,
27228c2ecf20Sopenharmony_ci		[CLKID_FCLK_DIV2] = &meson8b_fclk_div2.hw,
27238c2ecf20Sopenharmony_ci		[CLKID_FCLK_DIV3] = &meson8b_fclk_div3.hw,
27248c2ecf20Sopenharmony_ci		[CLKID_FCLK_DIV4] = &meson8b_fclk_div4.hw,
27258c2ecf20Sopenharmony_ci		[CLKID_FCLK_DIV5] = &meson8b_fclk_div5.hw,
27268c2ecf20Sopenharmony_ci		[CLKID_FCLK_DIV7] = &meson8b_fclk_div7.hw,
27278c2ecf20Sopenharmony_ci		[CLKID_CPUCLK] = &meson8b_cpu_clk.hw,
27288c2ecf20Sopenharmony_ci		[CLKID_MPEG_SEL] = &meson8b_mpeg_clk_sel.hw,
27298c2ecf20Sopenharmony_ci		[CLKID_MPEG_DIV] = &meson8b_mpeg_clk_div.hw,
27308c2ecf20Sopenharmony_ci		[CLKID_CLK81] = &meson8b_clk81.hw,
27318c2ecf20Sopenharmony_ci		[CLKID_DDR]		    = &meson8b_ddr.hw,
27328c2ecf20Sopenharmony_ci		[CLKID_DOS]		    = &meson8b_dos.hw,
27338c2ecf20Sopenharmony_ci		[CLKID_ISA]		    = &meson8b_isa.hw,
27348c2ecf20Sopenharmony_ci		[CLKID_PL301]		    = &meson8b_pl301.hw,
27358c2ecf20Sopenharmony_ci		[CLKID_PERIPHS]		    = &meson8b_periphs.hw,
27368c2ecf20Sopenharmony_ci		[CLKID_SPICC]		    = &meson8b_spicc.hw,
27378c2ecf20Sopenharmony_ci		[CLKID_I2C]		    = &meson8b_i2c.hw,
27388c2ecf20Sopenharmony_ci		[CLKID_SAR_ADC]		    = &meson8b_sar_adc.hw,
27398c2ecf20Sopenharmony_ci		[CLKID_SMART_CARD]	    = &meson8b_smart_card.hw,
27408c2ecf20Sopenharmony_ci		[CLKID_RNG0]		    = &meson8b_rng0.hw,
27418c2ecf20Sopenharmony_ci		[CLKID_UART0]		    = &meson8b_uart0.hw,
27428c2ecf20Sopenharmony_ci		[CLKID_SDHC]		    = &meson8b_sdhc.hw,
27438c2ecf20Sopenharmony_ci		[CLKID_STREAM]		    = &meson8b_stream.hw,
27448c2ecf20Sopenharmony_ci		[CLKID_ASYNC_FIFO]	    = &meson8b_async_fifo.hw,
27458c2ecf20Sopenharmony_ci		[CLKID_SDIO]		    = &meson8b_sdio.hw,
27468c2ecf20Sopenharmony_ci		[CLKID_ABUF]		    = &meson8b_abuf.hw,
27478c2ecf20Sopenharmony_ci		[CLKID_HIU_IFACE]	    = &meson8b_hiu_iface.hw,
27488c2ecf20Sopenharmony_ci		[CLKID_ASSIST_MISC]	    = &meson8b_assist_misc.hw,
27498c2ecf20Sopenharmony_ci		[CLKID_SPI]		    = &meson8b_spi.hw,
27508c2ecf20Sopenharmony_ci		[CLKID_I2S_SPDIF]	    = &meson8b_i2s_spdif.hw,
27518c2ecf20Sopenharmony_ci		[CLKID_ETH]		    = &meson8b_eth.hw,
27528c2ecf20Sopenharmony_ci		[CLKID_DEMUX]		    = &meson8b_demux.hw,
27538c2ecf20Sopenharmony_ci		[CLKID_AIU_GLUE]	    = &meson8b_aiu_glue.hw,
27548c2ecf20Sopenharmony_ci		[CLKID_IEC958]		    = &meson8b_iec958.hw,
27558c2ecf20Sopenharmony_ci		[CLKID_I2S_OUT]		    = &meson8b_i2s_out.hw,
27568c2ecf20Sopenharmony_ci		[CLKID_AMCLK]		    = &meson8b_amclk.hw,
27578c2ecf20Sopenharmony_ci		[CLKID_AIFIFO2]		    = &meson8b_aififo2.hw,
27588c2ecf20Sopenharmony_ci		[CLKID_MIXER]		    = &meson8b_mixer.hw,
27598c2ecf20Sopenharmony_ci		[CLKID_MIXER_IFACE]	    = &meson8b_mixer_iface.hw,
27608c2ecf20Sopenharmony_ci		[CLKID_ADC]		    = &meson8b_adc.hw,
27618c2ecf20Sopenharmony_ci		[CLKID_BLKMV]		    = &meson8b_blkmv.hw,
27628c2ecf20Sopenharmony_ci		[CLKID_AIU]		    = &meson8b_aiu.hw,
27638c2ecf20Sopenharmony_ci		[CLKID_UART1]		    = &meson8b_uart1.hw,
27648c2ecf20Sopenharmony_ci		[CLKID_G2D]		    = &meson8b_g2d.hw,
27658c2ecf20Sopenharmony_ci		[CLKID_USB0]		    = &meson8b_usb0.hw,
27668c2ecf20Sopenharmony_ci		[CLKID_USB1]		    = &meson8b_usb1.hw,
27678c2ecf20Sopenharmony_ci		[CLKID_RESET]		    = &meson8b_reset.hw,
27688c2ecf20Sopenharmony_ci		[CLKID_NAND]		    = &meson8b_nand.hw,
27698c2ecf20Sopenharmony_ci		[CLKID_DOS_PARSER]	    = &meson8b_dos_parser.hw,
27708c2ecf20Sopenharmony_ci		[CLKID_USB]		    = &meson8b_usb.hw,
27718c2ecf20Sopenharmony_ci		[CLKID_VDIN1]		    = &meson8b_vdin1.hw,
27728c2ecf20Sopenharmony_ci		[CLKID_AHB_ARB0]	    = &meson8b_ahb_arb0.hw,
27738c2ecf20Sopenharmony_ci		[CLKID_EFUSE]		    = &meson8b_efuse.hw,
27748c2ecf20Sopenharmony_ci		[CLKID_BOOT_ROM]	    = &meson8b_boot_rom.hw,
27758c2ecf20Sopenharmony_ci		[CLKID_AHB_DATA_BUS]	    = &meson8b_ahb_data_bus.hw,
27768c2ecf20Sopenharmony_ci		[CLKID_AHB_CTRL_BUS]	    = &meson8b_ahb_ctrl_bus.hw,
27778c2ecf20Sopenharmony_ci		[CLKID_HDMI_INTR_SYNC]	    = &meson8b_hdmi_intr_sync.hw,
27788c2ecf20Sopenharmony_ci		[CLKID_HDMI_PCLK]	    = &meson8b_hdmi_pclk.hw,
27798c2ecf20Sopenharmony_ci		[CLKID_USB1_DDR_BRIDGE]	    = &meson8b_usb1_ddr_bridge.hw,
27808c2ecf20Sopenharmony_ci		[CLKID_USB0_DDR_BRIDGE]	    = &meson8b_usb0_ddr_bridge.hw,
27818c2ecf20Sopenharmony_ci		[CLKID_MMC_PCLK]	    = &meson8b_mmc_pclk.hw,
27828c2ecf20Sopenharmony_ci		[CLKID_DVIN]		    = &meson8b_dvin.hw,
27838c2ecf20Sopenharmony_ci		[CLKID_UART2]		    = &meson8b_uart2.hw,
27848c2ecf20Sopenharmony_ci		[CLKID_SANA]		    = &meson8b_sana.hw,
27858c2ecf20Sopenharmony_ci		[CLKID_VPU_INTR]	    = &meson8b_vpu_intr.hw,
27868c2ecf20Sopenharmony_ci		[CLKID_SEC_AHB_AHB3_BRIDGE] = &meson8b_sec_ahb_ahb3_bridge.hw,
27878c2ecf20Sopenharmony_ci		[CLKID_CLK81_A9]	    = &meson8b_clk81_a9.hw,
27888c2ecf20Sopenharmony_ci		[CLKID_VCLK2_VENCI0]	    = &meson8b_vclk2_venci0.hw,
27898c2ecf20Sopenharmony_ci		[CLKID_VCLK2_VENCI1]	    = &meson8b_vclk2_venci1.hw,
27908c2ecf20Sopenharmony_ci		[CLKID_VCLK2_VENCP0]	    = &meson8b_vclk2_vencp0.hw,
27918c2ecf20Sopenharmony_ci		[CLKID_VCLK2_VENCP1]	    = &meson8b_vclk2_vencp1.hw,
27928c2ecf20Sopenharmony_ci		[CLKID_GCLK_VENCI_INT]	    = &meson8b_gclk_venci_int.hw,
27938c2ecf20Sopenharmony_ci		[CLKID_GCLK_VENCP_INT]	    = &meson8b_gclk_vencp_int.hw,
27948c2ecf20Sopenharmony_ci		[CLKID_DAC_CLK]		    = &meson8b_dac_clk.hw,
27958c2ecf20Sopenharmony_ci		[CLKID_AOCLK_GATE]	    = &meson8b_aoclk_gate.hw,
27968c2ecf20Sopenharmony_ci		[CLKID_IEC958_GATE]	    = &meson8b_iec958_gate.hw,
27978c2ecf20Sopenharmony_ci		[CLKID_ENC480P]		    = &meson8b_enc480p.hw,
27988c2ecf20Sopenharmony_ci		[CLKID_RNG1]		    = &meson8b_rng1.hw,
27998c2ecf20Sopenharmony_ci		[CLKID_GCLK_VENCL_INT]	    = &meson8b_gclk_vencl_int.hw,
28008c2ecf20Sopenharmony_ci		[CLKID_VCLK2_VENCLMCC]	    = &meson8b_vclk2_venclmcc.hw,
28018c2ecf20Sopenharmony_ci		[CLKID_VCLK2_VENCL]	    = &meson8b_vclk2_vencl.hw,
28028c2ecf20Sopenharmony_ci		[CLKID_VCLK2_OTHER]	    = &meson8b_vclk2_other.hw,
28038c2ecf20Sopenharmony_ci		[CLKID_EDP]		    = &meson8b_edp.hw,
28048c2ecf20Sopenharmony_ci		[CLKID_AO_MEDIA_CPU]	    = &meson8b_ao_media_cpu.hw,
28058c2ecf20Sopenharmony_ci		[CLKID_AO_AHB_SRAM]	    = &meson8b_ao_ahb_sram.hw,
28068c2ecf20Sopenharmony_ci		[CLKID_AO_AHB_BUS]	    = &meson8b_ao_ahb_bus.hw,
28078c2ecf20Sopenharmony_ci		[CLKID_AO_IFACE]	    = &meson8b_ao_iface.hw,
28088c2ecf20Sopenharmony_ci		[CLKID_MPLL0]		    = &meson8b_mpll0.hw,
28098c2ecf20Sopenharmony_ci		[CLKID_MPLL1]		    = &meson8b_mpll1.hw,
28108c2ecf20Sopenharmony_ci		[CLKID_MPLL2]		    = &meson8b_mpll2.hw,
28118c2ecf20Sopenharmony_ci		[CLKID_MPLL0_DIV]	    = &meson8b_mpll0_div.hw,
28128c2ecf20Sopenharmony_ci		[CLKID_MPLL1_DIV]	    = &meson8b_mpll1_div.hw,
28138c2ecf20Sopenharmony_ci		[CLKID_MPLL2_DIV]	    = &meson8b_mpll2_div.hw,
28148c2ecf20Sopenharmony_ci		[CLKID_CPU_IN_SEL]	    = &meson8b_cpu_in_sel.hw,
28158c2ecf20Sopenharmony_ci		[CLKID_CPU_IN_DIV2]	    = &meson8b_cpu_in_div2.hw,
28168c2ecf20Sopenharmony_ci		[CLKID_CPU_IN_DIV3]	    = &meson8b_cpu_in_div3.hw,
28178c2ecf20Sopenharmony_ci		[CLKID_CPU_SCALE_DIV]	    = &meson8b_cpu_scale_div.hw,
28188c2ecf20Sopenharmony_ci		[CLKID_CPU_SCALE_OUT_SEL]   = &meson8b_cpu_scale_out_sel.hw,
28198c2ecf20Sopenharmony_ci		[CLKID_MPLL_PREDIV]	    = &meson8b_mpll_prediv.hw,
28208c2ecf20Sopenharmony_ci		[CLKID_FCLK_DIV2_DIV]	    = &meson8b_fclk_div2_div.hw,
28218c2ecf20Sopenharmony_ci		[CLKID_FCLK_DIV3_DIV]	    = &meson8b_fclk_div3_div.hw,
28228c2ecf20Sopenharmony_ci		[CLKID_FCLK_DIV4_DIV]	    = &meson8b_fclk_div4_div.hw,
28238c2ecf20Sopenharmony_ci		[CLKID_FCLK_DIV5_DIV]	    = &meson8b_fclk_div5_div.hw,
28248c2ecf20Sopenharmony_ci		[CLKID_FCLK_DIV7_DIV]	    = &meson8b_fclk_div7_div.hw,
28258c2ecf20Sopenharmony_ci		[CLKID_NAND_SEL]	    = &meson8b_nand_clk_sel.hw,
28268c2ecf20Sopenharmony_ci		[CLKID_NAND_DIV]	    = &meson8b_nand_clk_div.hw,
28278c2ecf20Sopenharmony_ci		[CLKID_NAND_CLK]	    = &meson8b_nand_clk_gate.hw,
28288c2ecf20Sopenharmony_ci		[CLKID_PLL_FIXED_DCO]	    = &meson8b_fixed_pll_dco.hw,
28298c2ecf20Sopenharmony_ci		[CLKID_HDMI_PLL_DCO]	    = &meson8b_hdmi_pll_dco.hw,
28308c2ecf20Sopenharmony_ci		[CLKID_PLL_SYS_DCO]	    = &meson8b_sys_pll_dco.hw,
28318c2ecf20Sopenharmony_ci		[CLKID_CPU_CLK_DIV2]	    = &meson8b_cpu_clk_div2.hw,
28328c2ecf20Sopenharmony_ci		[CLKID_CPU_CLK_DIV3]	    = &meson8b_cpu_clk_div3.hw,
28338c2ecf20Sopenharmony_ci		[CLKID_CPU_CLK_DIV4]	    = &meson8b_cpu_clk_div4.hw,
28348c2ecf20Sopenharmony_ci		[CLKID_CPU_CLK_DIV5]	    = &meson8b_cpu_clk_div5.hw,
28358c2ecf20Sopenharmony_ci		[CLKID_CPU_CLK_DIV6]	    = &meson8b_cpu_clk_div6.hw,
28368c2ecf20Sopenharmony_ci		[CLKID_CPU_CLK_DIV7]	    = &meson8b_cpu_clk_div7.hw,
28378c2ecf20Sopenharmony_ci		[CLKID_CPU_CLK_DIV8]	    = &meson8b_cpu_clk_div8.hw,
28388c2ecf20Sopenharmony_ci		[CLKID_APB_SEL]		    = &meson8b_apb_clk_sel.hw,
28398c2ecf20Sopenharmony_ci		[CLKID_APB]		    = &meson8b_apb_clk_gate.hw,
28408c2ecf20Sopenharmony_ci		[CLKID_PERIPH_SEL]	    = &meson8b_periph_clk_sel.hw,
28418c2ecf20Sopenharmony_ci		[CLKID_PERIPH]		    = &meson8b_periph_clk_gate.hw,
28428c2ecf20Sopenharmony_ci		[CLKID_AXI_SEL]		    = &meson8b_axi_clk_sel.hw,
28438c2ecf20Sopenharmony_ci		[CLKID_AXI]		    = &meson8b_axi_clk_gate.hw,
28448c2ecf20Sopenharmony_ci		[CLKID_L2_DRAM_SEL]	    = &meson8b_l2_dram_clk_sel.hw,
28458c2ecf20Sopenharmony_ci		[CLKID_L2_DRAM]		    = &meson8b_l2_dram_clk_gate.hw,
28468c2ecf20Sopenharmony_ci		[CLKID_HDMI_PLL_LVDS_OUT]   = &meson8b_hdmi_pll_lvds_out.hw,
28478c2ecf20Sopenharmony_ci		[CLKID_HDMI_PLL_HDMI_OUT]   = &meson8b_hdmi_pll_hdmi_out.hw,
28488c2ecf20Sopenharmony_ci		[CLKID_VID_PLL_IN_SEL]	    = &meson8b_vid_pll_in_sel.hw,
28498c2ecf20Sopenharmony_ci		[CLKID_VID_PLL_IN_EN]	    = &meson8b_vid_pll_in_en.hw,
28508c2ecf20Sopenharmony_ci		[CLKID_VID_PLL_PRE_DIV]	    = &meson8b_vid_pll_pre_div.hw,
28518c2ecf20Sopenharmony_ci		[CLKID_VID_PLL_POST_DIV]    = &meson8b_vid_pll_post_div.hw,
28528c2ecf20Sopenharmony_ci		[CLKID_VID_PLL_FINAL_DIV]   = &meson8b_vid_pll_final_div.hw,
28538c2ecf20Sopenharmony_ci		[CLKID_VCLK_IN_SEL]	    = &meson8b_vclk_in_sel.hw,
28548c2ecf20Sopenharmony_ci		[CLKID_VCLK_IN_EN]	    = &meson8b_vclk_in_en.hw,
28558c2ecf20Sopenharmony_ci		[CLKID_VCLK_EN]		    = &meson8b_vclk_en.hw,
28568c2ecf20Sopenharmony_ci		[CLKID_VCLK_DIV1]	    = &meson8b_vclk_div1_gate.hw,
28578c2ecf20Sopenharmony_ci		[CLKID_VCLK_DIV2_DIV]	    = &meson8b_vclk_div2_div.hw,
28588c2ecf20Sopenharmony_ci		[CLKID_VCLK_DIV2]	    = &meson8b_vclk_div2_div_gate.hw,
28598c2ecf20Sopenharmony_ci		[CLKID_VCLK_DIV4_DIV]	    = &meson8b_vclk_div4_div.hw,
28608c2ecf20Sopenharmony_ci		[CLKID_VCLK_DIV4]	    = &meson8b_vclk_div4_div_gate.hw,
28618c2ecf20Sopenharmony_ci		[CLKID_VCLK_DIV6_DIV]	    = &meson8b_vclk_div6_div.hw,
28628c2ecf20Sopenharmony_ci		[CLKID_VCLK_DIV6]	    = &meson8b_vclk_div6_div_gate.hw,
28638c2ecf20Sopenharmony_ci		[CLKID_VCLK_DIV12_DIV]	    = &meson8b_vclk_div12_div.hw,
28648c2ecf20Sopenharmony_ci		[CLKID_VCLK_DIV12]	    = &meson8b_vclk_div12_div_gate.hw,
28658c2ecf20Sopenharmony_ci		[CLKID_VCLK2_IN_SEL]	    = &meson8b_vclk2_in_sel.hw,
28668c2ecf20Sopenharmony_ci		[CLKID_VCLK2_IN_EN]	    = &meson8b_vclk2_clk_in_en.hw,
28678c2ecf20Sopenharmony_ci		[CLKID_VCLK2_EN]	    = &meson8b_vclk2_clk_en.hw,
28688c2ecf20Sopenharmony_ci		[CLKID_VCLK2_DIV1]	    = &meson8b_vclk2_div1_gate.hw,
28698c2ecf20Sopenharmony_ci		[CLKID_VCLK2_DIV2_DIV]	    = &meson8b_vclk2_div2_div.hw,
28708c2ecf20Sopenharmony_ci		[CLKID_VCLK2_DIV2]	    = &meson8b_vclk2_div2_div_gate.hw,
28718c2ecf20Sopenharmony_ci		[CLKID_VCLK2_DIV4_DIV]	    = &meson8b_vclk2_div4_div.hw,
28728c2ecf20Sopenharmony_ci		[CLKID_VCLK2_DIV4]	    = &meson8b_vclk2_div4_div_gate.hw,
28738c2ecf20Sopenharmony_ci		[CLKID_VCLK2_DIV6_DIV]	    = &meson8b_vclk2_div6_div.hw,
28748c2ecf20Sopenharmony_ci		[CLKID_VCLK2_DIV6]	    = &meson8b_vclk2_div6_div_gate.hw,
28758c2ecf20Sopenharmony_ci		[CLKID_VCLK2_DIV12_DIV]	    = &meson8b_vclk2_div12_div.hw,
28768c2ecf20Sopenharmony_ci		[CLKID_VCLK2_DIV12]	    = &meson8b_vclk2_div12_div_gate.hw,
28778c2ecf20Sopenharmony_ci		[CLKID_CTS_ENCT_SEL]	    = &meson8b_cts_enct_sel.hw,
28788c2ecf20Sopenharmony_ci		[CLKID_CTS_ENCT]	    = &meson8b_cts_enct.hw,
28798c2ecf20Sopenharmony_ci		[CLKID_CTS_ENCP_SEL]	    = &meson8b_cts_encp_sel.hw,
28808c2ecf20Sopenharmony_ci		[CLKID_CTS_ENCP]	    = &meson8b_cts_encp.hw,
28818c2ecf20Sopenharmony_ci		[CLKID_CTS_ENCI_SEL]	    = &meson8b_cts_enci_sel.hw,
28828c2ecf20Sopenharmony_ci		[CLKID_CTS_ENCI]	    = &meson8b_cts_enci.hw,
28838c2ecf20Sopenharmony_ci		[CLKID_HDMI_TX_PIXEL_SEL]   = &meson8b_hdmi_tx_pixel_sel.hw,
28848c2ecf20Sopenharmony_ci		[CLKID_HDMI_TX_PIXEL]	    = &meson8b_hdmi_tx_pixel.hw,
28858c2ecf20Sopenharmony_ci		[CLKID_CTS_ENCL_SEL]	    = &meson8b_cts_encl_sel.hw,
28868c2ecf20Sopenharmony_ci		[CLKID_CTS_ENCL]	    = &meson8b_cts_encl.hw,
28878c2ecf20Sopenharmony_ci		[CLKID_CTS_VDAC0_SEL]	    = &meson8b_cts_vdac0_sel.hw,
28888c2ecf20Sopenharmony_ci		[CLKID_CTS_VDAC0]	    = &meson8b_cts_vdac0.hw,
28898c2ecf20Sopenharmony_ci		[CLKID_HDMI_SYS_SEL]	    = &meson8b_hdmi_sys_sel.hw,
28908c2ecf20Sopenharmony_ci		[CLKID_HDMI_SYS_DIV]	    = &meson8b_hdmi_sys_div.hw,
28918c2ecf20Sopenharmony_ci		[CLKID_HDMI_SYS]	    = &meson8b_hdmi_sys.hw,
28928c2ecf20Sopenharmony_ci		[CLKID_MALI_0_SEL]	    = &meson8b_mali_0_sel.hw,
28938c2ecf20Sopenharmony_ci		[CLKID_MALI_0_DIV]	    = &meson8b_mali_0_div.hw,
28948c2ecf20Sopenharmony_ci		[CLKID_MALI]		    = &meson8b_mali_0.hw,
28958c2ecf20Sopenharmony_ci		[CLKID_VPU_0_SEL]	    = &meson8b_vpu_0_sel.hw,
28968c2ecf20Sopenharmony_ci		[CLKID_VPU_0_DIV]	    = &meson8b_vpu_0_div.hw,
28978c2ecf20Sopenharmony_ci		[CLKID_VPU]		    = &meson8b_vpu_0.hw,
28988c2ecf20Sopenharmony_ci		[CLKID_VDEC_1_SEL]	    = &meson8b_vdec_1_sel.hw,
28998c2ecf20Sopenharmony_ci		[CLKID_VDEC_1_1_DIV]	    = &meson8b_vdec_1_1_div.hw,
29008c2ecf20Sopenharmony_ci		[CLKID_VDEC_1]	   	    = &meson8b_vdec_1_1.hw,
29018c2ecf20Sopenharmony_ci		[CLKID_VDEC_HCODEC_SEL]	    = &meson8b_vdec_hcodec_sel.hw,
29028c2ecf20Sopenharmony_ci		[CLKID_VDEC_HCODEC_DIV]	    = &meson8b_vdec_hcodec_div.hw,
29038c2ecf20Sopenharmony_ci		[CLKID_VDEC_HCODEC]	    = &meson8b_vdec_hcodec.hw,
29048c2ecf20Sopenharmony_ci		[CLKID_VDEC_2_SEL]	    = &meson8b_vdec_2_sel.hw,
29058c2ecf20Sopenharmony_ci		[CLKID_VDEC_2_DIV]	    = &meson8b_vdec_2_div.hw,
29068c2ecf20Sopenharmony_ci		[CLKID_VDEC_2]	    	    = &meson8b_vdec_2.hw,
29078c2ecf20Sopenharmony_ci		[CLKID_VDEC_HEVC_SEL]	    = &meson8b_vdec_hevc_sel.hw,
29088c2ecf20Sopenharmony_ci		[CLKID_VDEC_HEVC_DIV]	    = &meson8b_vdec_hevc_div.hw,
29098c2ecf20Sopenharmony_ci		[CLKID_VDEC_HEVC_EN]	    = &meson8b_vdec_hevc_en.hw,
29108c2ecf20Sopenharmony_ci		[CLKID_VDEC_HEVC]	    = &meson8b_vdec_hevc.hw,
29118c2ecf20Sopenharmony_ci		[CLKID_CTS_AMCLK_SEL]	    = &meson8b_cts_amclk_sel.hw,
29128c2ecf20Sopenharmony_ci		[CLKID_CTS_AMCLK_DIV]	    = &meson8b_cts_amclk_div.hw,
29138c2ecf20Sopenharmony_ci		[CLKID_CTS_AMCLK]	    = &meson8b_cts_amclk.hw,
29148c2ecf20Sopenharmony_ci		[CLKID_CTS_MCLK_I958_SEL]   = &meson8b_cts_mclk_i958_sel.hw,
29158c2ecf20Sopenharmony_ci		[CLKID_CTS_MCLK_I958_DIV]   = &meson8b_cts_mclk_i958_div.hw,
29168c2ecf20Sopenharmony_ci		[CLKID_CTS_MCLK_I958]	    = &meson8b_cts_mclk_i958.hw,
29178c2ecf20Sopenharmony_ci		[CLKID_CTS_I958]	    = &meson8b_cts_i958.hw,
29188c2ecf20Sopenharmony_ci		[CLK_NR_CLKS]		    = NULL,
29198c2ecf20Sopenharmony_ci	},
29208c2ecf20Sopenharmony_ci	.num = CLK_NR_CLKS,
29218c2ecf20Sopenharmony_ci};
29228c2ecf20Sopenharmony_ci
29238c2ecf20Sopenharmony_cistatic struct clk_hw_onecell_data meson8b_hw_onecell_data = {
29248c2ecf20Sopenharmony_ci	.hws = {
29258c2ecf20Sopenharmony_ci		[CLKID_XTAL] = &meson8b_xtal.hw,
29268c2ecf20Sopenharmony_ci		[CLKID_PLL_FIXED] = &meson8b_fixed_pll.hw,
29278c2ecf20Sopenharmony_ci		[CLKID_PLL_VID] = &meson8b_vid_pll.hw,
29288c2ecf20Sopenharmony_ci		[CLKID_PLL_SYS] = &meson8b_sys_pll.hw,
29298c2ecf20Sopenharmony_ci		[CLKID_FCLK_DIV2] = &meson8b_fclk_div2.hw,
29308c2ecf20Sopenharmony_ci		[CLKID_FCLK_DIV3] = &meson8b_fclk_div3.hw,
29318c2ecf20Sopenharmony_ci		[CLKID_FCLK_DIV4] = &meson8b_fclk_div4.hw,
29328c2ecf20Sopenharmony_ci		[CLKID_FCLK_DIV5] = &meson8b_fclk_div5.hw,
29338c2ecf20Sopenharmony_ci		[CLKID_FCLK_DIV7] = &meson8b_fclk_div7.hw,
29348c2ecf20Sopenharmony_ci		[CLKID_CPUCLK] = &meson8b_cpu_clk.hw,
29358c2ecf20Sopenharmony_ci		[CLKID_MPEG_SEL] = &meson8b_mpeg_clk_sel.hw,
29368c2ecf20Sopenharmony_ci		[CLKID_MPEG_DIV] = &meson8b_mpeg_clk_div.hw,
29378c2ecf20Sopenharmony_ci		[CLKID_CLK81] = &meson8b_clk81.hw,
29388c2ecf20Sopenharmony_ci		[CLKID_DDR]		    = &meson8b_ddr.hw,
29398c2ecf20Sopenharmony_ci		[CLKID_DOS]		    = &meson8b_dos.hw,
29408c2ecf20Sopenharmony_ci		[CLKID_ISA]		    = &meson8b_isa.hw,
29418c2ecf20Sopenharmony_ci		[CLKID_PL301]		    = &meson8b_pl301.hw,
29428c2ecf20Sopenharmony_ci		[CLKID_PERIPHS]		    = &meson8b_periphs.hw,
29438c2ecf20Sopenharmony_ci		[CLKID_SPICC]		    = &meson8b_spicc.hw,
29448c2ecf20Sopenharmony_ci		[CLKID_I2C]		    = &meson8b_i2c.hw,
29458c2ecf20Sopenharmony_ci		[CLKID_SAR_ADC]		    = &meson8b_sar_adc.hw,
29468c2ecf20Sopenharmony_ci		[CLKID_SMART_CARD]	    = &meson8b_smart_card.hw,
29478c2ecf20Sopenharmony_ci		[CLKID_RNG0]		    = &meson8b_rng0.hw,
29488c2ecf20Sopenharmony_ci		[CLKID_UART0]		    = &meson8b_uart0.hw,
29498c2ecf20Sopenharmony_ci		[CLKID_SDHC]		    = &meson8b_sdhc.hw,
29508c2ecf20Sopenharmony_ci		[CLKID_STREAM]		    = &meson8b_stream.hw,
29518c2ecf20Sopenharmony_ci		[CLKID_ASYNC_FIFO]	    = &meson8b_async_fifo.hw,
29528c2ecf20Sopenharmony_ci		[CLKID_SDIO]		    = &meson8b_sdio.hw,
29538c2ecf20Sopenharmony_ci		[CLKID_ABUF]		    = &meson8b_abuf.hw,
29548c2ecf20Sopenharmony_ci		[CLKID_HIU_IFACE]	    = &meson8b_hiu_iface.hw,
29558c2ecf20Sopenharmony_ci		[CLKID_ASSIST_MISC]	    = &meson8b_assist_misc.hw,
29568c2ecf20Sopenharmony_ci		[CLKID_SPI]		    = &meson8b_spi.hw,
29578c2ecf20Sopenharmony_ci		[CLKID_I2S_SPDIF]	    = &meson8b_i2s_spdif.hw,
29588c2ecf20Sopenharmony_ci		[CLKID_ETH]		    = &meson8b_eth.hw,
29598c2ecf20Sopenharmony_ci		[CLKID_DEMUX]		    = &meson8b_demux.hw,
29608c2ecf20Sopenharmony_ci		[CLKID_AIU_GLUE]	    = &meson8b_aiu_glue.hw,
29618c2ecf20Sopenharmony_ci		[CLKID_IEC958]		    = &meson8b_iec958.hw,
29628c2ecf20Sopenharmony_ci		[CLKID_I2S_OUT]		    = &meson8b_i2s_out.hw,
29638c2ecf20Sopenharmony_ci		[CLKID_AMCLK]		    = &meson8b_amclk.hw,
29648c2ecf20Sopenharmony_ci		[CLKID_AIFIFO2]		    = &meson8b_aififo2.hw,
29658c2ecf20Sopenharmony_ci		[CLKID_MIXER]		    = &meson8b_mixer.hw,
29668c2ecf20Sopenharmony_ci		[CLKID_MIXER_IFACE]	    = &meson8b_mixer_iface.hw,
29678c2ecf20Sopenharmony_ci		[CLKID_ADC]		    = &meson8b_adc.hw,
29688c2ecf20Sopenharmony_ci		[CLKID_BLKMV]		    = &meson8b_blkmv.hw,
29698c2ecf20Sopenharmony_ci		[CLKID_AIU]		    = &meson8b_aiu.hw,
29708c2ecf20Sopenharmony_ci		[CLKID_UART1]		    = &meson8b_uart1.hw,
29718c2ecf20Sopenharmony_ci		[CLKID_G2D]		    = &meson8b_g2d.hw,
29728c2ecf20Sopenharmony_ci		[CLKID_USB0]		    = &meson8b_usb0.hw,
29738c2ecf20Sopenharmony_ci		[CLKID_USB1]		    = &meson8b_usb1.hw,
29748c2ecf20Sopenharmony_ci		[CLKID_RESET]		    = &meson8b_reset.hw,
29758c2ecf20Sopenharmony_ci		[CLKID_NAND]		    = &meson8b_nand.hw,
29768c2ecf20Sopenharmony_ci		[CLKID_DOS_PARSER]	    = &meson8b_dos_parser.hw,
29778c2ecf20Sopenharmony_ci		[CLKID_USB]		    = &meson8b_usb.hw,
29788c2ecf20Sopenharmony_ci		[CLKID_VDIN1]		    = &meson8b_vdin1.hw,
29798c2ecf20Sopenharmony_ci		[CLKID_AHB_ARB0]	    = &meson8b_ahb_arb0.hw,
29808c2ecf20Sopenharmony_ci		[CLKID_EFUSE]		    = &meson8b_efuse.hw,
29818c2ecf20Sopenharmony_ci		[CLKID_BOOT_ROM]	    = &meson8b_boot_rom.hw,
29828c2ecf20Sopenharmony_ci		[CLKID_AHB_DATA_BUS]	    = &meson8b_ahb_data_bus.hw,
29838c2ecf20Sopenharmony_ci		[CLKID_AHB_CTRL_BUS]	    = &meson8b_ahb_ctrl_bus.hw,
29848c2ecf20Sopenharmony_ci		[CLKID_HDMI_INTR_SYNC]	    = &meson8b_hdmi_intr_sync.hw,
29858c2ecf20Sopenharmony_ci		[CLKID_HDMI_PCLK]	    = &meson8b_hdmi_pclk.hw,
29868c2ecf20Sopenharmony_ci		[CLKID_USB1_DDR_BRIDGE]	    = &meson8b_usb1_ddr_bridge.hw,
29878c2ecf20Sopenharmony_ci		[CLKID_USB0_DDR_BRIDGE]	    = &meson8b_usb0_ddr_bridge.hw,
29888c2ecf20Sopenharmony_ci		[CLKID_MMC_PCLK]	    = &meson8b_mmc_pclk.hw,
29898c2ecf20Sopenharmony_ci		[CLKID_DVIN]		    = &meson8b_dvin.hw,
29908c2ecf20Sopenharmony_ci		[CLKID_UART2]		    = &meson8b_uart2.hw,
29918c2ecf20Sopenharmony_ci		[CLKID_SANA]		    = &meson8b_sana.hw,
29928c2ecf20Sopenharmony_ci		[CLKID_VPU_INTR]	    = &meson8b_vpu_intr.hw,
29938c2ecf20Sopenharmony_ci		[CLKID_SEC_AHB_AHB3_BRIDGE] = &meson8b_sec_ahb_ahb3_bridge.hw,
29948c2ecf20Sopenharmony_ci		[CLKID_CLK81_A9]	    = &meson8b_clk81_a9.hw,
29958c2ecf20Sopenharmony_ci		[CLKID_VCLK2_VENCI0]	    = &meson8b_vclk2_venci0.hw,
29968c2ecf20Sopenharmony_ci		[CLKID_VCLK2_VENCI1]	    = &meson8b_vclk2_venci1.hw,
29978c2ecf20Sopenharmony_ci		[CLKID_VCLK2_VENCP0]	    = &meson8b_vclk2_vencp0.hw,
29988c2ecf20Sopenharmony_ci		[CLKID_VCLK2_VENCP1]	    = &meson8b_vclk2_vencp1.hw,
29998c2ecf20Sopenharmony_ci		[CLKID_GCLK_VENCI_INT]	    = &meson8b_gclk_venci_int.hw,
30008c2ecf20Sopenharmony_ci		[CLKID_GCLK_VENCP_INT]	    = &meson8b_gclk_vencp_int.hw,
30018c2ecf20Sopenharmony_ci		[CLKID_DAC_CLK]		    = &meson8b_dac_clk.hw,
30028c2ecf20Sopenharmony_ci		[CLKID_AOCLK_GATE]	    = &meson8b_aoclk_gate.hw,
30038c2ecf20Sopenharmony_ci		[CLKID_IEC958_GATE]	    = &meson8b_iec958_gate.hw,
30048c2ecf20Sopenharmony_ci		[CLKID_ENC480P]		    = &meson8b_enc480p.hw,
30058c2ecf20Sopenharmony_ci		[CLKID_RNG1]		    = &meson8b_rng1.hw,
30068c2ecf20Sopenharmony_ci		[CLKID_GCLK_VENCL_INT]	    = &meson8b_gclk_vencl_int.hw,
30078c2ecf20Sopenharmony_ci		[CLKID_VCLK2_VENCLMCC]	    = &meson8b_vclk2_venclmcc.hw,
30088c2ecf20Sopenharmony_ci		[CLKID_VCLK2_VENCL]	    = &meson8b_vclk2_vencl.hw,
30098c2ecf20Sopenharmony_ci		[CLKID_VCLK2_OTHER]	    = &meson8b_vclk2_other.hw,
30108c2ecf20Sopenharmony_ci		[CLKID_EDP]		    = &meson8b_edp.hw,
30118c2ecf20Sopenharmony_ci		[CLKID_AO_MEDIA_CPU]	    = &meson8b_ao_media_cpu.hw,
30128c2ecf20Sopenharmony_ci		[CLKID_AO_AHB_SRAM]	    = &meson8b_ao_ahb_sram.hw,
30138c2ecf20Sopenharmony_ci		[CLKID_AO_AHB_BUS]	    = &meson8b_ao_ahb_bus.hw,
30148c2ecf20Sopenharmony_ci		[CLKID_AO_IFACE]	    = &meson8b_ao_iface.hw,
30158c2ecf20Sopenharmony_ci		[CLKID_MPLL0]		    = &meson8b_mpll0.hw,
30168c2ecf20Sopenharmony_ci		[CLKID_MPLL1]		    = &meson8b_mpll1.hw,
30178c2ecf20Sopenharmony_ci		[CLKID_MPLL2]		    = &meson8b_mpll2.hw,
30188c2ecf20Sopenharmony_ci		[CLKID_MPLL0_DIV]	    = &meson8b_mpll0_div.hw,
30198c2ecf20Sopenharmony_ci		[CLKID_MPLL1_DIV]	    = &meson8b_mpll1_div.hw,
30208c2ecf20Sopenharmony_ci		[CLKID_MPLL2_DIV]	    = &meson8b_mpll2_div.hw,
30218c2ecf20Sopenharmony_ci		[CLKID_CPU_IN_SEL]	    = &meson8b_cpu_in_sel.hw,
30228c2ecf20Sopenharmony_ci		[CLKID_CPU_IN_DIV2]	    = &meson8b_cpu_in_div2.hw,
30238c2ecf20Sopenharmony_ci		[CLKID_CPU_IN_DIV3]	    = &meson8b_cpu_in_div3.hw,
30248c2ecf20Sopenharmony_ci		[CLKID_CPU_SCALE_DIV]	    = &meson8b_cpu_scale_div.hw,
30258c2ecf20Sopenharmony_ci		[CLKID_CPU_SCALE_OUT_SEL]   = &meson8b_cpu_scale_out_sel.hw,
30268c2ecf20Sopenharmony_ci		[CLKID_MPLL_PREDIV]	    = &meson8b_mpll_prediv.hw,
30278c2ecf20Sopenharmony_ci		[CLKID_FCLK_DIV2_DIV]	    = &meson8b_fclk_div2_div.hw,
30288c2ecf20Sopenharmony_ci		[CLKID_FCLK_DIV3_DIV]	    = &meson8b_fclk_div3_div.hw,
30298c2ecf20Sopenharmony_ci		[CLKID_FCLK_DIV4_DIV]	    = &meson8b_fclk_div4_div.hw,
30308c2ecf20Sopenharmony_ci		[CLKID_FCLK_DIV5_DIV]	    = &meson8b_fclk_div5_div.hw,
30318c2ecf20Sopenharmony_ci		[CLKID_FCLK_DIV7_DIV]	    = &meson8b_fclk_div7_div.hw,
30328c2ecf20Sopenharmony_ci		[CLKID_NAND_SEL]	    = &meson8b_nand_clk_sel.hw,
30338c2ecf20Sopenharmony_ci		[CLKID_NAND_DIV]	    = &meson8b_nand_clk_div.hw,
30348c2ecf20Sopenharmony_ci		[CLKID_NAND_CLK]	    = &meson8b_nand_clk_gate.hw,
30358c2ecf20Sopenharmony_ci		[CLKID_PLL_FIXED_DCO]	    = &meson8b_fixed_pll_dco.hw,
30368c2ecf20Sopenharmony_ci		[CLKID_HDMI_PLL_DCO]	    = &meson8b_hdmi_pll_dco.hw,
30378c2ecf20Sopenharmony_ci		[CLKID_PLL_SYS_DCO]	    = &meson8b_sys_pll_dco.hw,
30388c2ecf20Sopenharmony_ci		[CLKID_CPU_CLK_DIV2]	    = &meson8b_cpu_clk_div2.hw,
30398c2ecf20Sopenharmony_ci		[CLKID_CPU_CLK_DIV3]	    = &meson8b_cpu_clk_div3.hw,
30408c2ecf20Sopenharmony_ci		[CLKID_CPU_CLK_DIV4]	    = &meson8b_cpu_clk_div4.hw,
30418c2ecf20Sopenharmony_ci		[CLKID_CPU_CLK_DIV5]	    = &meson8b_cpu_clk_div5.hw,
30428c2ecf20Sopenharmony_ci		[CLKID_CPU_CLK_DIV6]	    = &meson8b_cpu_clk_div6.hw,
30438c2ecf20Sopenharmony_ci		[CLKID_CPU_CLK_DIV7]	    = &meson8b_cpu_clk_div7.hw,
30448c2ecf20Sopenharmony_ci		[CLKID_CPU_CLK_DIV8]	    = &meson8b_cpu_clk_div8.hw,
30458c2ecf20Sopenharmony_ci		[CLKID_APB_SEL]		    = &meson8b_apb_clk_sel.hw,
30468c2ecf20Sopenharmony_ci		[CLKID_APB]		    = &meson8b_apb_clk_gate.hw,
30478c2ecf20Sopenharmony_ci		[CLKID_PERIPH_SEL]	    = &meson8b_periph_clk_sel.hw,
30488c2ecf20Sopenharmony_ci		[CLKID_PERIPH]		    = &meson8b_periph_clk_gate.hw,
30498c2ecf20Sopenharmony_ci		[CLKID_AXI_SEL]		    = &meson8b_axi_clk_sel.hw,
30508c2ecf20Sopenharmony_ci		[CLKID_AXI]		    = &meson8b_axi_clk_gate.hw,
30518c2ecf20Sopenharmony_ci		[CLKID_L2_DRAM_SEL]	    = &meson8b_l2_dram_clk_sel.hw,
30528c2ecf20Sopenharmony_ci		[CLKID_L2_DRAM]		    = &meson8b_l2_dram_clk_gate.hw,
30538c2ecf20Sopenharmony_ci		[CLKID_HDMI_PLL_LVDS_OUT]   = &meson8b_hdmi_pll_lvds_out.hw,
30548c2ecf20Sopenharmony_ci		[CLKID_HDMI_PLL_HDMI_OUT]   = &meson8b_hdmi_pll_hdmi_out.hw,
30558c2ecf20Sopenharmony_ci		[CLKID_VID_PLL_IN_SEL]	    = &meson8b_vid_pll_in_sel.hw,
30568c2ecf20Sopenharmony_ci		[CLKID_VID_PLL_IN_EN]	    = &meson8b_vid_pll_in_en.hw,
30578c2ecf20Sopenharmony_ci		[CLKID_VID_PLL_PRE_DIV]	    = &meson8b_vid_pll_pre_div.hw,
30588c2ecf20Sopenharmony_ci		[CLKID_VID_PLL_POST_DIV]    = &meson8b_vid_pll_post_div.hw,
30598c2ecf20Sopenharmony_ci		[CLKID_VID_PLL_FINAL_DIV]   = &meson8b_vid_pll_final_div.hw,
30608c2ecf20Sopenharmony_ci		[CLKID_VCLK_IN_SEL]	    = &meson8b_vclk_in_sel.hw,
30618c2ecf20Sopenharmony_ci		[CLKID_VCLK_IN_EN]	    = &meson8b_vclk_in_en.hw,
30628c2ecf20Sopenharmony_ci		[CLKID_VCLK_EN]		    = &meson8b_vclk_en.hw,
30638c2ecf20Sopenharmony_ci		[CLKID_VCLK_DIV1]	    = &meson8b_vclk_div1_gate.hw,
30648c2ecf20Sopenharmony_ci		[CLKID_VCLK_DIV2_DIV]	    = &meson8b_vclk_div2_div.hw,
30658c2ecf20Sopenharmony_ci		[CLKID_VCLK_DIV2]	    = &meson8b_vclk_div2_div_gate.hw,
30668c2ecf20Sopenharmony_ci		[CLKID_VCLK_DIV4_DIV]	    = &meson8b_vclk_div4_div.hw,
30678c2ecf20Sopenharmony_ci		[CLKID_VCLK_DIV4]	    = &meson8b_vclk_div4_div_gate.hw,
30688c2ecf20Sopenharmony_ci		[CLKID_VCLK_DIV6_DIV]	    = &meson8b_vclk_div6_div.hw,
30698c2ecf20Sopenharmony_ci		[CLKID_VCLK_DIV6]	    = &meson8b_vclk_div6_div_gate.hw,
30708c2ecf20Sopenharmony_ci		[CLKID_VCLK_DIV12_DIV]	    = &meson8b_vclk_div12_div.hw,
30718c2ecf20Sopenharmony_ci		[CLKID_VCLK_DIV12]	    = &meson8b_vclk_div12_div_gate.hw,
30728c2ecf20Sopenharmony_ci		[CLKID_VCLK2_IN_SEL]	    = &meson8b_vclk2_in_sel.hw,
30738c2ecf20Sopenharmony_ci		[CLKID_VCLK2_IN_EN]	    = &meson8b_vclk2_clk_in_en.hw,
30748c2ecf20Sopenharmony_ci		[CLKID_VCLK2_EN]	    = &meson8b_vclk2_clk_en.hw,
30758c2ecf20Sopenharmony_ci		[CLKID_VCLK2_DIV1]	    = &meson8b_vclk2_div1_gate.hw,
30768c2ecf20Sopenharmony_ci		[CLKID_VCLK2_DIV2_DIV]	    = &meson8b_vclk2_div2_div.hw,
30778c2ecf20Sopenharmony_ci		[CLKID_VCLK2_DIV2]	    = &meson8b_vclk2_div2_div_gate.hw,
30788c2ecf20Sopenharmony_ci		[CLKID_VCLK2_DIV4_DIV]	    = &meson8b_vclk2_div4_div.hw,
30798c2ecf20Sopenharmony_ci		[CLKID_VCLK2_DIV4]	    = &meson8b_vclk2_div4_div_gate.hw,
30808c2ecf20Sopenharmony_ci		[CLKID_VCLK2_DIV6_DIV]	    = &meson8b_vclk2_div6_div.hw,
30818c2ecf20Sopenharmony_ci		[CLKID_VCLK2_DIV6]	    = &meson8b_vclk2_div6_div_gate.hw,
30828c2ecf20Sopenharmony_ci		[CLKID_VCLK2_DIV12_DIV]	    = &meson8b_vclk2_div12_div.hw,
30838c2ecf20Sopenharmony_ci		[CLKID_VCLK2_DIV12]	    = &meson8b_vclk2_div12_div_gate.hw,
30848c2ecf20Sopenharmony_ci		[CLKID_CTS_ENCT_SEL]	    = &meson8b_cts_enct_sel.hw,
30858c2ecf20Sopenharmony_ci		[CLKID_CTS_ENCT]	    = &meson8b_cts_enct.hw,
30868c2ecf20Sopenharmony_ci		[CLKID_CTS_ENCP_SEL]	    = &meson8b_cts_encp_sel.hw,
30878c2ecf20Sopenharmony_ci		[CLKID_CTS_ENCP]	    = &meson8b_cts_encp.hw,
30888c2ecf20Sopenharmony_ci		[CLKID_CTS_ENCI_SEL]	    = &meson8b_cts_enci_sel.hw,
30898c2ecf20Sopenharmony_ci		[CLKID_CTS_ENCI]	    = &meson8b_cts_enci.hw,
30908c2ecf20Sopenharmony_ci		[CLKID_HDMI_TX_PIXEL_SEL]   = &meson8b_hdmi_tx_pixel_sel.hw,
30918c2ecf20Sopenharmony_ci		[CLKID_HDMI_TX_PIXEL]	    = &meson8b_hdmi_tx_pixel.hw,
30928c2ecf20Sopenharmony_ci		[CLKID_CTS_ENCL_SEL]	    = &meson8b_cts_encl_sel.hw,
30938c2ecf20Sopenharmony_ci		[CLKID_CTS_ENCL]	    = &meson8b_cts_encl.hw,
30948c2ecf20Sopenharmony_ci		[CLKID_CTS_VDAC0_SEL]	    = &meson8b_cts_vdac0_sel.hw,
30958c2ecf20Sopenharmony_ci		[CLKID_CTS_VDAC0]	    = &meson8b_cts_vdac0.hw,
30968c2ecf20Sopenharmony_ci		[CLKID_HDMI_SYS_SEL]	    = &meson8b_hdmi_sys_sel.hw,
30978c2ecf20Sopenharmony_ci		[CLKID_HDMI_SYS_DIV]	    = &meson8b_hdmi_sys_div.hw,
30988c2ecf20Sopenharmony_ci		[CLKID_HDMI_SYS]	    = &meson8b_hdmi_sys.hw,
30998c2ecf20Sopenharmony_ci		[CLKID_MALI_0_SEL]	    = &meson8b_mali_0_sel.hw,
31008c2ecf20Sopenharmony_ci		[CLKID_MALI_0_DIV]	    = &meson8b_mali_0_div.hw,
31018c2ecf20Sopenharmony_ci		[CLKID_MALI_0]		    = &meson8b_mali_0.hw,
31028c2ecf20Sopenharmony_ci		[CLKID_MALI_1_SEL]	    = &meson8b_mali_1_sel.hw,
31038c2ecf20Sopenharmony_ci		[CLKID_MALI_1_DIV]	    = &meson8b_mali_1_div.hw,
31048c2ecf20Sopenharmony_ci		[CLKID_MALI_1]		    = &meson8b_mali_1.hw,
31058c2ecf20Sopenharmony_ci		[CLKID_MALI]		    = &meson8b_mali.hw,
31068c2ecf20Sopenharmony_ci		[CLKID_VPU_0_SEL]	    = &meson8b_vpu_0_sel.hw,
31078c2ecf20Sopenharmony_ci		[CLKID_VPU_0_DIV]	    = &meson8b_vpu_0_div.hw,
31088c2ecf20Sopenharmony_ci		[CLKID_VPU_0]		    = &meson8b_vpu_0.hw,
31098c2ecf20Sopenharmony_ci		[CLKID_VPU_1_SEL]	    = &meson8b_vpu_1_sel.hw,
31108c2ecf20Sopenharmony_ci		[CLKID_VPU_1_DIV]	    = &meson8b_vpu_1_div.hw,
31118c2ecf20Sopenharmony_ci		[CLKID_VPU_1]		    = &meson8b_vpu_1.hw,
31128c2ecf20Sopenharmony_ci		[CLKID_VPU]		    = &meson8b_vpu.hw,
31138c2ecf20Sopenharmony_ci		[CLKID_VDEC_1_SEL]	    = &meson8b_vdec_1_sel.hw,
31148c2ecf20Sopenharmony_ci		[CLKID_VDEC_1_1_DIV]	    = &meson8b_vdec_1_1_div.hw,
31158c2ecf20Sopenharmony_ci		[CLKID_VDEC_1_1]	    = &meson8b_vdec_1_1.hw,
31168c2ecf20Sopenharmony_ci		[CLKID_VDEC_1_2_DIV]	    = &meson8b_vdec_1_2_div.hw,
31178c2ecf20Sopenharmony_ci		[CLKID_VDEC_1_2]	    = &meson8b_vdec_1_2.hw,
31188c2ecf20Sopenharmony_ci		[CLKID_VDEC_1]	    	    = &meson8b_vdec_1.hw,
31198c2ecf20Sopenharmony_ci		[CLKID_VDEC_HCODEC_SEL]	    = &meson8b_vdec_hcodec_sel.hw,
31208c2ecf20Sopenharmony_ci		[CLKID_VDEC_HCODEC_DIV]	    = &meson8b_vdec_hcodec_div.hw,
31218c2ecf20Sopenharmony_ci		[CLKID_VDEC_HCODEC]	    = &meson8b_vdec_hcodec.hw,
31228c2ecf20Sopenharmony_ci		[CLKID_VDEC_2_SEL]	    = &meson8b_vdec_2_sel.hw,
31238c2ecf20Sopenharmony_ci		[CLKID_VDEC_2_DIV]	    = &meson8b_vdec_2_div.hw,
31248c2ecf20Sopenharmony_ci		[CLKID_VDEC_2]	    	    = &meson8b_vdec_2.hw,
31258c2ecf20Sopenharmony_ci		[CLKID_VDEC_HEVC_SEL]	    = &meson8b_vdec_hevc_sel.hw,
31268c2ecf20Sopenharmony_ci		[CLKID_VDEC_HEVC_DIV]	    = &meson8b_vdec_hevc_div.hw,
31278c2ecf20Sopenharmony_ci		[CLKID_VDEC_HEVC_EN]	    = &meson8b_vdec_hevc_en.hw,
31288c2ecf20Sopenharmony_ci		[CLKID_VDEC_HEVC]	    = &meson8b_vdec_hevc.hw,
31298c2ecf20Sopenharmony_ci		[CLKID_CTS_AMCLK_SEL]	    = &meson8b_cts_amclk_sel.hw,
31308c2ecf20Sopenharmony_ci		[CLKID_CTS_AMCLK_DIV]	    = &meson8b_cts_amclk_div.hw,
31318c2ecf20Sopenharmony_ci		[CLKID_CTS_AMCLK]	    = &meson8b_cts_amclk.hw,
31328c2ecf20Sopenharmony_ci		[CLKID_CTS_MCLK_I958_SEL]   = &meson8b_cts_mclk_i958_sel.hw,
31338c2ecf20Sopenharmony_ci		[CLKID_CTS_MCLK_I958_DIV]   = &meson8b_cts_mclk_i958_div.hw,
31348c2ecf20Sopenharmony_ci		[CLKID_CTS_MCLK_I958]	    = &meson8b_cts_mclk_i958.hw,
31358c2ecf20Sopenharmony_ci		[CLKID_CTS_I958]	    = &meson8b_cts_i958.hw,
31368c2ecf20Sopenharmony_ci		[CLK_NR_CLKS]		    = NULL,
31378c2ecf20Sopenharmony_ci	},
31388c2ecf20Sopenharmony_ci	.num = CLK_NR_CLKS,
31398c2ecf20Sopenharmony_ci};
31408c2ecf20Sopenharmony_ci
31418c2ecf20Sopenharmony_cistatic struct clk_hw_onecell_data meson8m2_hw_onecell_data = {
31428c2ecf20Sopenharmony_ci	.hws = {
31438c2ecf20Sopenharmony_ci		[CLKID_XTAL] = &meson8b_xtal.hw,
31448c2ecf20Sopenharmony_ci		[CLKID_PLL_FIXED] = &meson8b_fixed_pll.hw,
31458c2ecf20Sopenharmony_ci		[CLKID_PLL_VID] = &meson8b_vid_pll.hw,
31468c2ecf20Sopenharmony_ci		[CLKID_PLL_SYS] = &meson8b_sys_pll.hw,
31478c2ecf20Sopenharmony_ci		[CLKID_FCLK_DIV2] = &meson8b_fclk_div2.hw,
31488c2ecf20Sopenharmony_ci		[CLKID_FCLK_DIV3] = &meson8b_fclk_div3.hw,
31498c2ecf20Sopenharmony_ci		[CLKID_FCLK_DIV4] = &meson8b_fclk_div4.hw,
31508c2ecf20Sopenharmony_ci		[CLKID_FCLK_DIV5] = &meson8b_fclk_div5.hw,
31518c2ecf20Sopenharmony_ci		[CLKID_FCLK_DIV7] = &meson8b_fclk_div7.hw,
31528c2ecf20Sopenharmony_ci		[CLKID_CPUCLK] = &meson8b_cpu_clk.hw,
31538c2ecf20Sopenharmony_ci		[CLKID_MPEG_SEL] = &meson8b_mpeg_clk_sel.hw,
31548c2ecf20Sopenharmony_ci		[CLKID_MPEG_DIV] = &meson8b_mpeg_clk_div.hw,
31558c2ecf20Sopenharmony_ci		[CLKID_CLK81] = &meson8b_clk81.hw,
31568c2ecf20Sopenharmony_ci		[CLKID_DDR]		    = &meson8b_ddr.hw,
31578c2ecf20Sopenharmony_ci		[CLKID_DOS]		    = &meson8b_dos.hw,
31588c2ecf20Sopenharmony_ci		[CLKID_ISA]		    = &meson8b_isa.hw,
31598c2ecf20Sopenharmony_ci		[CLKID_PL301]		    = &meson8b_pl301.hw,
31608c2ecf20Sopenharmony_ci		[CLKID_PERIPHS]		    = &meson8b_periphs.hw,
31618c2ecf20Sopenharmony_ci		[CLKID_SPICC]		    = &meson8b_spicc.hw,
31628c2ecf20Sopenharmony_ci		[CLKID_I2C]		    = &meson8b_i2c.hw,
31638c2ecf20Sopenharmony_ci		[CLKID_SAR_ADC]		    = &meson8b_sar_adc.hw,
31648c2ecf20Sopenharmony_ci		[CLKID_SMART_CARD]	    = &meson8b_smart_card.hw,
31658c2ecf20Sopenharmony_ci		[CLKID_RNG0]		    = &meson8b_rng0.hw,
31668c2ecf20Sopenharmony_ci		[CLKID_UART0]		    = &meson8b_uart0.hw,
31678c2ecf20Sopenharmony_ci		[CLKID_SDHC]		    = &meson8b_sdhc.hw,
31688c2ecf20Sopenharmony_ci		[CLKID_STREAM]		    = &meson8b_stream.hw,
31698c2ecf20Sopenharmony_ci		[CLKID_ASYNC_FIFO]	    = &meson8b_async_fifo.hw,
31708c2ecf20Sopenharmony_ci		[CLKID_SDIO]		    = &meson8b_sdio.hw,
31718c2ecf20Sopenharmony_ci		[CLKID_ABUF]		    = &meson8b_abuf.hw,
31728c2ecf20Sopenharmony_ci		[CLKID_HIU_IFACE]	    = &meson8b_hiu_iface.hw,
31738c2ecf20Sopenharmony_ci		[CLKID_ASSIST_MISC]	    = &meson8b_assist_misc.hw,
31748c2ecf20Sopenharmony_ci		[CLKID_SPI]		    = &meson8b_spi.hw,
31758c2ecf20Sopenharmony_ci		[CLKID_I2S_SPDIF]	    = &meson8b_i2s_spdif.hw,
31768c2ecf20Sopenharmony_ci		[CLKID_ETH]		    = &meson8b_eth.hw,
31778c2ecf20Sopenharmony_ci		[CLKID_DEMUX]		    = &meson8b_demux.hw,
31788c2ecf20Sopenharmony_ci		[CLKID_AIU_GLUE]	    = &meson8b_aiu_glue.hw,
31798c2ecf20Sopenharmony_ci		[CLKID_IEC958]		    = &meson8b_iec958.hw,
31808c2ecf20Sopenharmony_ci		[CLKID_I2S_OUT]		    = &meson8b_i2s_out.hw,
31818c2ecf20Sopenharmony_ci		[CLKID_AMCLK]		    = &meson8b_amclk.hw,
31828c2ecf20Sopenharmony_ci		[CLKID_AIFIFO2]		    = &meson8b_aififo2.hw,
31838c2ecf20Sopenharmony_ci		[CLKID_MIXER]		    = &meson8b_mixer.hw,
31848c2ecf20Sopenharmony_ci		[CLKID_MIXER_IFACE]	    = &meson8b_mixer_iface.hw,
31858c2ecf20Sopenharmony_ci		[CLKID_ADC]		    = &meson8b_adc.hw,
31868c2ecf20Sopenharmony_ci		[CLKID_BLKMV]		    = &meson8b_blkmv.hw,
31878c2ecf20Sopenharmony_ci		[CLKID_AIU]		    = &meson8b_aiu.hw,
31888c2ecf20Sopenharmony_ci		[CLKID_UART1]		    = &meson8b_uart1.hw,
31898c2ecf20Sopenharmony_ci		[CLKID_G2D]		    = &meson8b_g2d.hw,
31908c2ecf20Sopenharmony_ci		[CLKID_USB0]		    = &meson8b_usb0.hw,
31918c2ecf20Sopenharmony_ci		[CLKID_USB1]		    = &meson8b_usb1.hw,
31928c2ecf20Sopenharmony_ci		[CLKID_RESET]		    = &meson8b_reset.hw,
31938c2ecf20Sopenharmony_ci		[CLKID_NAND]		    = &meson8b_nand.hw,
31948c2ecf20Sopenharmony_ci		[CLKID_DOS_PARSER]	    = &meson8b_dos_parser.hw,
31958c2ecf20Sopenharmony_ci		[CLKID_USB]		    = &meson8b_usb.hw,
31968c2ecf20Sopenharmony_ci		[CLKID_VDIN1]		    = &meson8b_vdin1.hw,
31978c2ecf20Sopenharmony_ci		[CLKID_AHB_ARB0]	    = &meson8b_ahb_arb0.hw,
31988c2ecf20Sopenharmony_ci		[CLKID_EFUSE]		    = &meson8b_efuse.hw,
31998c2ecf20Sopenharmony_ci		[CLKID_BOOT_ROM]	    = &meson8b_boot_rom.hw,
32008c2ecf20Sopenharmony_ci		[CLKID_AHB_DATA_BUS]	    = &meson8b_ahb_data_bus.hw,
32018c2ecf20Sopenharmony_ci		[CLKID_AHB_CTRL_BUS]	    = &meson8b_ahb_ctrl_bus.hw,
32028c2ecf20Sopenharmony_ci		[CLKID_HDMI_INTR_SYNC]	    = &meson8b_hdmi_intr_sync.hw,
32038c2ecf20Sopenharmony_ci		[CLKID_HDMI_PCLK]	    = &meson8b_hdmi_pclk.hw,
32048c2ecf20Sopenharmony_ci		[CLKID_USB1_DDR_BRIDGE]	    = &meson8b_usb1_ddr_bridge.hw,
32058c2ecf20Sopenharmony_ci		[CLKID_USB0_DDR_BRIDGE]	    = &meson8b_usb0_ddr_bridge.hw,
32068c2ecf20Sopenharmony_ci		[CLKID_MMC_PCLK]	    = &meson8b_mmc_pclk.hw,
32078c2ecf20Sopenharmony_ci		[CLKID_DVIN]		    = &meson8b_dvin.hw,
32088c2ecf20Sopenharmony_ci		[CLKID_UART2]		    = &meson8b_uart2.hw,
32098c2ecf20Sopenharmony_ci		[CLKID_SANA]		    = &meson8b_sana.hw,
32108c2ecf20Sopenharmony_ci		[CLKID_VPU_INTR]	    = &meson8b_vpu_intr.hw,
32118c2ecf20Sopenharmony_ci		[CLKID_SEC_AHB_AHB3_BRIDGE] = &meson8b_sec_ahb_ahb3_bridge.hw,
32128c2ecf20Sopenharmony_ci		[CLKID_CLK81_A9]	    = &meson8b_clk81_a9.hw,
32138c2ecf20Sopenharmony_ci		[CLKID_VCLK2_VENCI0]	    = &meson8b_vclk2_venci0.hw,
32148c2ecf20Sopenharmony_ci		[CLKID_VCLK2_VENCI1]	    = &meson8b_vclk2_venci1.hw,
32158c2ecf20Sopenharmony_ci		[CLKID_VCLK2_VENCP0]	    = &meson8b_vclk2_vencp0.hw,
32168c2ecf20Sopenharmony_ci		[CLKID_VCLK2_VENCP1]	    = &meson8b_vclk2_vencp1.hw,
32178c2ecf20Sopenharmony_ci		[CLKID_GCLK_VENCI_INT]	    = &meson8b_gclk_venci_int.hw,
32188c2ecf20Sopenharmony_ci		[CLKID_GCLK_VENCP_INT]	    = &meson8b_gclk_vencp_int.hw,
32198c2ecf20Sopenharmony_ci		[CLKID_DAC_CLK]		    = &meson8b_dac_clk.hw,
32208c2ecf20Sopenharmony_ci		[CLKID_AOCLK_GATE]	    = &meson8b_aoclk_gate.hw,
32218c2ecf20Sopenharmony_ci		[CLKID_IEC958_GATE]	    = &meson8b_iec958_gate.hw,
32228c2ecf20Sopenharmony_ci		[CLKID_ENC480P]		    = &meson8b_enc480p.hw,
32238c2ecf20Sopenharmony_ci		[CLKID_RNG1]		    = &meson8b_rng1.hw,
32248c2ecf20Sopenharmony_ci		[CLKID_GCLK_VENCL_INT]	    = &meson8b_gclk_vencl_int.hw,
32258c2ecf20Sopenharmony_ci		[CLKID_VCLK2_VENCLMCC]	    = &meson8b_vclk2_venclmcc.hw,
32268c2ecf20Sopenharmony_ci		[CLKID_VCLK2_VENCL]	    = &meson8b_vclk2_vencl.hw,
32278c2ecf20Sopenharmony_ci		[CLKID_VCLK2_OTHER]	    = &meson8b_vclk2_other.hw,
32288c2ecf20Sopenharmony_ci		[CLKID_EDP]		    = &meson8b_edp.hw,
32298c2ecf20Sopenharmony_ci		[CLKID_AO_MEDIA_CPU]	    = &meson8b_ao_media_cpu.hw,
32308c2ecf20Sopenharmony_ci		[CLKID_AO_AHB_SRAM]	    = &meson8b_ao_ahb_sram.hw,
32318c2ecf20Sopenharmony_ci		[CLKID_AO_AHB_BUS]	    = &meson8b_ao_ahb_bus.hw,
32328c2ecf20Sopenharmony_ci		[CLKID_AO_IFACE]	    = &meson8b_ao_iface.hw,
32338c2ecf20Sopenharmony_ci		[CLKID_MPLL0]		    = &meson8b_mpll0.hw,
32348c2ecf20Sopenharmony_ci		[CLKID_MPLL1]		    = &meson8b_mpll1.hw,
32358c2ecf20Sopenharmony_ci		[CLKID_MPLL2]		    = &meson8b_mpll2.hw,
32368c2ecf20Sopenharmony_ci		[CLKID_MPLL0_DIV]	    = &meson8b_mpll0_div.hw,
32378c2ecf20Sopenharmony_ci		[CLKID_MPLL1_DIV]	    = &meson8b_mpll1_div.hw,
32388c2ecf20Sopenharmony_ci		[CLKID_MPLL2_DIV]	    = &meson8b_mpll2_div.hw,
32398c2ecf20Sopenharmony_ci		[CLKID_CPU_IN_SEL]	    = &meson8b_cpu_in_sel.hw,
32408c2ecf20Sopenharmony_ci		[CLKID_CPU_IN_DIV2]	    = &meson8b_cpu_in_div2.hw,
32418c2ecf20Sopenharmony_ci		[CLKID_CPU_IN_DIV3]	    = &meson8b_cpu_in_div3.hw,
32428c2ecf20Sopenharmony_ci		[CLKID_CPU_SCALE_DIV]	    = &meson8b_cpu_scale_div.hw,
32438c2ecf20Sopenharmony_ci		[CLKID_CPU_SCALE_OUT_SEL]   = &meson8b_cpu_scale_out_sel.hw,
32448c2ecf20Sopenharmony_ci		[CLKID_MPLL_PREDIV]	    = &meson8b_mpll_prediv.hw,
32458c2ecf20Sopenharmony_ci		[CLKID_FCLK_DIV2_DIV]	    = &meson8b_fclk_div2_div.hw,
32468c2ecf20Sopenharmony_ci		[CLKID_FCLK_DIV3_DIV]	    = &meson8b_fclk_div3_div.hw,
32478c2ecf20Sopenharmony_ci		[CLKID_FCLK_DIV4_DIV]	    = &meson8b_fclk_div4_div.hw,
32488c2ecf20Sopenharmony_ci		[CLKID_FCLK_DIV5_DIV]	    = &meson8b_fclk_div5_div.hw,
32498c2ecf20Sopenharmony_ci		[CLKID_FCLK_DIV7_DIV]	    = &meson8b_fclk_div7_div.hw,
32508c2ecf20Sopenharmony_ci		[CLKID_NAND_SEL]	    = &meson8b_nand_clk_sel.hw,
32518c2ecf20Sopenharmony_ci		[CLKID_NAND_DIV]	    = &meson8b_nand_clk_div.hw,
32528c2ecf20Sopenharmony_ci		[CLKID_NAND_CLK]	    = &meson8b_nand_clk_gate.hw,
32538c2ecf20Sopenharmony_ci		[CLKID_PLL_FIXED_DCO]	    = &meson8b_fixed_pll_dco.hw,
32548c2ecf20Sopenharmony_ci		[CLKID_HDMI_PLL_DCO]	    = &meson8b_hdmi_pll_dco.hw,
32558c2ecf20Sopenharmony_ci		[CLKID_PLL_SYS_DCO]	    = &meson8b_sys_pll_dco.hw,
32568c2ecf20Sopenharmony_ci		[CLKID_CPU_CLK_DIV2]	    = &meson8b_cpu_clk_div2.hw,
32578c2ecf20Sopenharmony_ci		[CLKID_CPU_CLK_DIV3]	    = &meson8b_cpu_clk_div3.hw,
32588c2ecf20Sopenharmony_ci		[CLKID_CPU_CLK_DIV4]	    = &meson8b_cpu_clk_div4.hw,
32598c2ecf20Sopenharmony_ci		[CLKID_CPU_CLK_DIV5]	    = &meson8b_cpu_clk_div5.hw,
32608c2ecf20Sopenharmony_ci		[CLKID_CPU_CLK_DIV6]	    = &meson8b_cpu_clk_div6.hw,
32618c2ecf20Sopenharmony_ci		[CLKID_CPU_CLK_DIV7]	    = &meson8b_cpu_clk_div7.hw,
32628c2ecf20Sopenharmony_ci		[CLKID_CPU_CLK_DIV8]	    = &meson8b_cpu_clk_div8.hw,
32638c2ecf20Sopenharmony_ci		[CLKID_APB_SEL]		    = &meson8b_apb_clk_sel.hw,
32648c2ecf20Sopenharmony_ci		[CLKID_APB]		    = &meson8b_apb_clk_gate.hw,
32658c2ecf20Sopenharmony_ci		[CLKID_PERIPH_SEL]	    = &meson8b_periph_clk_sel.hw,
32668c2ecf20Sopenharmony_ci		[CLKID_PERIPH]		    = &meson8b_periph_clk_gate.hw,
32678c2ecf20Sopenharmony_ci		[CLKID_AXI_SEL]		    = &meson8b_axi_clk_sel.hw,
32688c2ecf20Sopenharmony_ci		[CLKID_AXI]		    = &meson8b_axi_clk_gate.hw,
32698c2ecf20Sopenharmony_ci		[CLKID_L2_DRAM_SEL]	    = &meson8b_l2_dram_clk_sel.hw,
32708c2ecf20Sopenharmony_ci		[CLKID_L2_DRAM]		    = &meson8b_l2_dram_clk_gate.hw,
32718c2ecf20Sopenharmony_ci		[CLKID_HDMI_PLL_LVDS_OUT]   = &meson8b_hdmi_pll_lvds_out.hw,
32728c2ecf20Sopenharmony_ci		[CLKID_HDMI_PLL_HDMI_OUT]   = &meson8b_hdmi_pll_hdmi_out.hw,
32738c2ecf20Sopenharmony_ci		[CLKID_VID_PLL_IN_SEL]	    = &meson8b_vid_pll_in_sel.hw,
32748c2ecf20Sopenharmony_ci		[CLKID_VID_PLL_IN_EN]	    = &meson8b_vid_pll_in_en.hw,
32758c2ecf20Sopenharmony_ci		[CLKID_VID_PLL_PRE_DIV]	    = &meson8b_vid_pll_pre_div.hw,
32768c2ecf20Sopenharmony_ci		[CLKID_VID_PLL_POST_DIV]    = &meson8b_vid_pll_post_div.hw,
32778c2ecf20Sopenharmony_ci		[CLKID_VID_PLL_FINAL_DIV]   = &meson8b_vid_pll_final_div.hw,
32788c2ecf20Sopenharmony_ci		[CLKID_VCLK_IN_SEL]	    = &meson8b_vclk_in_sel.hw,
32798c2ecf20Sopenharmony_ci		[CLKID_VCLK_IN_EN]	    = &meson8b_vclk_in_en.hw,
32808c2ecf20Sopenharmony_ci		[CLKID_VCLK_EN]		    = &meson8b_vclk_en.hw,
32818c2ecf20Sopenharmony_ci		[CLKID_VCLK_DIV1]	    = &meson8b_vclk_div1_gate.hw,
32828c2ecf20Sopenharmony_ci		[CLKID_VCLK_DIV2_DIV]	    = &meson8b_vclk_div2_div.hw,
32838c2ecf20Sopenharmony_ci		[CLKID_VCLK_DIV2]	    = &meson8b_vclk_div2_div_gate.hw,
32848c2ecf20Sopenharmony_ci		[CLKID_VCLK_DIV4_DIV]	    = &meson8b_vclk_div4_div.hw,
32858c2ecf20Sopenharmony_ci		[CLKID_VCLK_DIV4]	    = &meson8b_vclk_div4_div_gate.hw,
32868c2ecf20Sopenharmony_ci		[CLKID_VCLK_DIV6_DIV]	    = &meson8b_vclk_div6_div.hw,
32878c2ecf20Sopenharmony_ci		[CLKID_VCLK_DIV6]	    = &meson8b_vclk_div6_div_gate.hw,
32888c2ecf20Sopenharmony_ci		[CLKID_VCLK_DIV12_DIV]	    = &meson8b_vclk_div12_div.hw,
32898c2ecf20Sopenharmony_ci		[CLKID_VCLK_DIV12]	    = &meson8b_vclk_div12_div_gate.hw,
32908c2ecf20Sopenharmony_ci		[CLKID_VCLK2_IN_SEL]	    = &meson8b_vclk2_in_sel.hw,
32918c2ecf20Sopenharmony_ci		[CLKID_VCLK2_IN_EN]	    = &meson8b_vclk2_clk_in_en.hw,
32928c2ecf20Sopenharmony_ci		[CLKID_VCLK2_EN]	    = &meson8b_vclk2_clk_en.hw,
32938c2ecf20Sopenharmony_ci		[CLKID_VCLK2_DIV1]	    = &meson8b_vclk2_div1_gate.hw,
32948c2ecf20Sopenharmony_ci		[CLKID_VCLK2_DIV2_DIV]	    = &meson8b_vclk2_div2_div.hw,
32958c2ecf20Sopenharmony_ci		[CLKID_VCLK2_DIV2]	    = &meson8b_vclk2_div2_div_gate.hw,
32968c2ecf20Sopenharmony_ci		[CLKID_VCLK2_DIV4_DIV]	    = &meson8b_vclk2_div4_div.hw,
32978c2ecf20Sopenharmony_ci		[CLKID_VCLK2_DIV4]	    = &meson8b_vclk2_div4_div_gate.hw,
32988c2ecf20Sopenharmony_ci		[CLKID_VCLK2_DIV6_DIV]	    = &meson8b_vclk2_div6_div.hw,
32998c2ecf20Sopenharmony_ci		[CLKID_VCLK2_DIV6]	    = &meson8b_vclk2_div6_div_gate.hw,
33008c2ecf20Sopenharmony_ci		[CLKID_VCLK2_DIV12_DIV]	    = &meson8b_vclk2_div12_div.hw,
33018c2ecf20Sopenharmony_ci		[CLKID_VCLK2_DIV12]	    = &meson8b_vclk2_div12_div_gate.hw,
33028c2ecf20Sopenharmony_ci		[CLKID_CTS_ENCT_SEL]	    = &meson8b_cts_enct_sel.hw,
33038c2ecf20Sopenharmony_ci		[CLKID_CTS_ENCT]	    = &meson8b_cts_enct.hw,
33048c2ecf20Sopenharmony_ci		[CLKID_CTS_ENCP_SEL]	    = &meson8b_cts_encp_sel.hw,
33058c2ecf20Sopenharmony_ci		[CLKID_CTS_ENCP]	    = &meson8b_cts_encp.hw,
33068c2ecf20Sopenharmony_ci		[CLKID_CTS_ENCI_SEL]	    = &meson8b_cts_enci_sel.hw,
33078c2ecf20Sopenharmony_ci		[CLKID_CTS_ENCI]	    = &meson8b_cts_enci.hw,
33088c2ecf20Sopenharmony_ci		[CLKID_HDMI_TX_PIXEL_SEL]   = &meson8b_hdmi_tx_pixel_sel.hw,
33098c2ecf20Sopenharmony_ci		[CLKID_HDMI_TX_PIXEL]	    = &meson8b_hdmi_tx_pixel.hw,
33108c2ecf20Sopenharmony_ci		[CLKID_CTS_ENCL_SEL]	    = &meson8b_cts_encl_sel.hw,
33118c2ecf20Sopenharmony_ci		[CLKID_CTS_ENCL]	    = &meson8b_cts_encl.hw,
33128c2ecf20Sopenharmony_ci		[CLKID_CTS_VDAC0_SEL]	    = &meson8b_cts_vdac0_sel.hw,
33138c2ecf20Sopenharmony_ci		[CLKID_CTS_VDAC0]	    = &meson8b_cts_vdac0.hw,
33148c2ecf20Sopenharmony_ci		[CLKID_HDMI_SYS_SEL]	    = &meson8b_hdmi_sys_sel.hw,
33158c2ecf20Sopenharmony_ci		[CLKID_HDMI_SYS_DIV]	    = &meson8b_hdmi_sys_div.hw,
33168c2ecf20Sopenharmony_ci		[CLKID_HDMI_SYS]	    = &meson8b_hdmi_sys.hw,
33178c2ecf20Sopenharmony_ci		[CLKID_MALI_0_SEL]	    = &meson8b_mali_0_sel.hw,
33188c2ecf20Sopenharmony_ci		[CLKID_MALI_0_DIV]	    = &meson8b_mali_0_div.hw,
33198c2ecf20Sopenharmony_ci		[CLKID_MALI_0]		    = &meson8b_mali_0.hw,
33208c2ecf20Sopenharmony_ci		[CLKID_MALI_1_SEL]	    = &meson8b_mali_1_sel.hw,
33218c2ecf20Sopenharmony_ci		[CLKID_MALI_1_DIV]	    = &meson8b_mali_1_div.hw,
33228c2ecf20Sopenharmony_ci		[CLKID_MALI_1]		    = &meson8b_mali_1.hw,
33238c2ecf20Sopenharmony_ci		[CLKID_MALI]		    = &meson8b_mali.hw,
33248c2ecf20Sopenharmony_ci		[CLKID_GP_PLL_DCO]	    = &meson8m2_gp_pll_dco.hw,
33258c2ecf20Sopenharmony_ci		[CLKID_GP_PLL]		    = &meson8m2_gp_pll.hw,
33268c2ecf20Sopenharmony_ci		[CLKID_VPU_0_SEL]	    = &meson8m2_vpu_0_sel.hw,
33278c2ecf20Sopenharmony_ci		[CLKID_VPU_0_DIV]	    = &meson8b_vpu_0_div.hw,
33288c2ecf20Sopenharmony_ci		[CLKID_VPU_0]		    = &meson8b_vpu_0.hw,
33298c2ecf20Sopenharmony_ci		[CLKID_VPU_1_SEL]	    = &meson8m2_vpu_1_sel.hw,
33308c2ecf20Sopenharmony_ci		[CLKID_VPU_1_DIV]	    = &meson8b_vpu_1_div.hw,
33318c2ecf20Sopenharmony_ci		[CLKID_VPU_1]		    = &meson8b_vpu_1.hw,
33328c2ecf20Sopenharmony_ci		[CLKID_VPU]		    = &meson8b_vpu.hw,
33338c2ecf20Sopenharmony_ci		[CLKID_VDEC_1_SEL]	    = &meson8b_vdec_1_sel.hw,
33348c2ecf20Sopenharmony_ci		[CLKID_VDEC_1_1_DIV]	    = &meson8b_vdec_1_1_div.hw,
33358c2ecf20Sopenharmony_ci		[CLKID_VDEC_1_1]	    = &meson8b_vdec_1_1.hw,
33368c2ecf20Sopenharmony_ci		[CLKID_VDEC_1_2_DIV]	    = &meson8b_vdec_1_2_div.hw,
33378c2ecf20Sopenharmony_ci		[CLKID_VDEC_1_2]	    = &meson8b_vdec_1_2.hw,
33388c2ecf20Sopenharmony_ci		[CLKID_VDEC_1]	    	    = &meson8b_vdec_1.hw,
33398c2ecf20Sopenharmony_ci		[CLKID_VDEC_HCODEC_SEL]	    = &meson8b_vdec_hcodec_sel.hw,
33408c2ecf20Sopenharmony_ci		[CLKID_VDEC_HCODEC_DIV]	    = &meson8b_vdec_hcodec_div.hw,
33418c2ecf20Sopenharmony_ci		[CLKID_VDEC_HCODEC]	    = &meson8b_vdec_hcodec.hw,
33428c2ecf20Sopenharmony_ci		[CLKID_VDEC_2_SEL]	    = &meson8b_vdec_2_sel.hw,
33438c2ecf20Sopenharmony_ci		[CLKID_VDEC_2_DIV]	    = &meson8b_vdec_2_div.hw,
33448c2ecf20Sopenharmony_ci		[CLKID_VDEC_2]	    	    = &meson8b_vdec_2.hw,
33458c2ecf20Sopenharmony_ci		[CLKID_VDEC_HEVC_SEL]	    = &meson8b_vdec_hevc_sel.hw,
33468c2ecf20Sopenharmony_ci		[CLKID_VDEC_HEVC_DIV]	    = &meson8b_vdec_hevc_div.hw,
33478c2ecf20Sopenharmony_ci		[CLKID_VDEC_HEVC_EN]	    = &meson8b_vdec_hevc_en.hw,
33488c2ecf20Sopenharmony_ci		[CLKID_VDEC_HEVC]	    = &meson8b_vdec_hevc.hw,
33498c2ecf20Sopenharmony_ci		[CLKID_CTS_AMCLK_SEL]	    = &meson8b_cts_amclk_sel.hw,
33508c2ecf20Sopenharmony_ci		[CLKID_CTS_AMCLK_DIV]	    = &meson8b_cts_amclk_div.hw,
33518c2ecf20Sopenharmony_ci		[CLKID_CTS_AMCLK]	    = &meson8b_cts_amclk.hw,
33528c2ecf20Sopenharmony_ci		[CLKID_CTS_MCLK_I958_SEL]   = &meson8b_cts_mclk_i958_sel.hw,
33538c2ecf20Sopenharmony_ci		[CLKID_CTS_MCLK_I958_DIV]   = &meson8b_cts_mclk_i958_div.hw,
33548c2ecf20Sopenharmony_ci		[CLKID_CTS_MCLK_I958]	    = &meson8b_cts_mclk_i958.hw,
33558c2ecf20Sopenharmony_ci		[CLKID_CTS_I958]	    = &meson8b_cts_i958.hw,
33568c2ecf20Sopenharmony_ci		[CLK_NR_CLKS]		    = NULL,
33578c2ecf20Sopenharmony_ci	},
33588c2ecf20Sopenharmony_ci	.num = CLK_NR_CLKS,
33598c2ecf20Sopenharmony_ci};
33608c2ecf20Sopenharmony_ci
33618c2ecf20Sopenharmony_cistatic struct clk_regmap *const meson8b_clk_regmaps[] = {
33628c2ecf20Sopenharmony_ci	&meson8b_clk81,
33638c2ecf20Sopenharmony_ci	&meson8b_ddr,
33648c2ecf20Sopenharmony_ci	&meson8b_dos,
33658c2ecf20Sopenharmony_ci	&meson8b_isa,
33668c2ecf20Sopenharmony_ci	&meson8b_pl301,
33678c2ecf20Sopenharmony_ci	&meson8b_periphs,
33688c2ecf20Sopenharmony_ci	&meson8b_spicc,
33698c2ecf20Sopenharmony_ci	&meson8b_i2c,
33708c2ecf20Sopenharmony_ci	&meson8b_sar_adc,
33718c2ecf20Sopenharmony_ci	&meson8b_smart_card,
33728c2ecf20Sopenharmony_ci	&meson8b_rng0,
33738c2ecf20Sopenharmony_ci	&meson8b_uart0,
33748c2ecf20Sopenharmony_ci	&meson8b_sdhc,
33758c2ecf20Sopenharmony_ci	&meson8b_stream,
33768c2ecf20Sopenharmony_ci	&meson8b_async_fifo,
33778c2ecf20Sopenharmony_ci	&meson8b_sdio,
33788c2ecf20Sopenharmony_ci	&meson8b_abuf,
33798c2ecf20Sopenharmony_ci	&meson8b_hiu_iface,
33808c2ecf20Sopenharmony_ci	&meson8b_assist_misc,
33818c2ecf20Sopenharmony_ci	&meson8b_spi,
33828c2ecf20Sopenharmony_ci	&meson8b_i2s_spdif,
33838c2ecf20Sopenharmony_ci	&meson8b_eth,
33848c2ecf20Sopenharmony_ci	&meson8b_demux,
33858c2ecf20Sopenharmony_ci	&meson8b_aiu_glue,
33868c2ecf20Sopenharmony_ci	&meson8b_iec958,
33878c2ecf20Sopenharmony_ci	&meson8b_i2s_out,
33888c2ecf20Sopenharmony_ci	&meson8b_amclk,
33898c2ecf20Sopenharmony_ci	&meson8b_aififo2,
33908c2ecf20Sopenharmony_ci	&meson8b_mixer,
33918c2ecf20Sopenharmony_ci	&meson8b_mixer_iface,
33928c2ecf20Sopenharmony_ci	&meson8b_adc,
33938c2ecf20Sopenharmony_ci	&meson8b_blkmv,
33948c2ecf20Sopenharmony_ci	&meson8b_aiu,
33958c2ecf20Sopenharmony_ci	&meson8b_uart1,
33968c2ecf20Sopenharmony_ci	&meson8b_g2d,
33978c2ecf20Sopenharmony_ci	&meson8b_usb0,
33988c2ecf20Sopenharmony_ci	&meson8b_usb1,
33998c2ecf20Sopenharmony_ci	&meson8b_reset,
34008c2ecf20Sopenharmony_ci	&meson8b_nand,
34018c2ecf20Sopenharmony_ci	&meson8b_dos_parser,
34028c2ecf20Sopenharmony_ci	&meson8b_usb,
34038c2ecf20Sopenharmony_ci	&meson8b_vdin1,
34048c2ecf20Sopenharmony_ci	&meson8b_ahb_arb0,
34058c2ecf20Sopenharmony_ci	&meson8b_efuse,
34068c2ecf20Sopenharmony_ci	&meson8b_boot_rom,
34078c2ecf20Sopenharmony_ci	&meson8b_ahb_data_bus,
34088c2ecf20Sopenharmony_ci	&meson8b_ahb_ctrl_bus,
34098c2ecf20Sopenharmony_ci	&meson8b_hdmi_intr_sync,
34108c2ecf20Sopenharmony_ci	&meson8b_hdmi_pclk,
34118c2ecf20Sopenharmony_ci	&meson8b_usb1_ddr_bridge,
34128c2ecf20Sopenharmony_ci	&meson8b_usb0_ddr_bridge,
34138c2ecf20Sopenharmony_ci	&meson8b_mmc_pclk,
34148c2ecf20Sopenharmony_ci	&meson8b_dvin,
34158c2ecf20Sopenharmony_ci	&meson8b_uart2,
34168c2ecf20Sopenharmony_ci	&meson8b_sana,
34178c2ecf20Sopenharmony_ci	&meson8b_vpu_intr,
34188c2ecf20Sopenharmony_ci	&meson8b_sec_ahb_ahb3_bridge,
34198c2ecf20Sopenharmony_ci	&meson8b_clk81_a9,
34208c2ecf20Sopenharmony_ci	&meson8b_vclk2_venci0,
34218c2ecf20Sopenharmony_ci	&meson8b_vclk2_venci1,
34228c2ecf20Sopenharmony_ci	&meson8b_vclk2_vencp0,
34238c2ecf20Sopenharmony_ci	&meson8b_vclk2_vencp1,
34248c2ecf20Sopenharmony_ci	&meson8b_gclk_venci_int,
34258c2ecf20Sopenharmony_ci	&meson8b_gclk_vencp_int,
34268c2ecf20Sopenharmony_ci	&meson8b_dac_clk,
34278c2ecf20Sopenharmony_ci	&meson8b_aoclk_gate,
34288c2ecf20Sopenharmony_ci	&meson8b_iec958_gate,
34298c2ecf20Sopenharmony_ci	&meson8b_enc480p,
34308c2ecf20Sopenharmony_ci	&meson8b_rng1,
34318c2ecf20Sopenharmony_ci	&meson8b_gclk_vencl_int,
34328c2ecf20Sopenharmony_ci	&meson8b_vclk2_venclmcc,
34338c2ecf20Sopenharmony_ci	&meson8b_vclk2_vencl,
34348c2ecf20Sopenharmony_ci	&meson8b_vclk2_other,
34358c2ecf20Sopenharmony_ci	&meson8b_edp,
34368c2ecf20Sopenharmony_ci	&meson8b_ao_media_cpu,
34378c2ecf20Sopenharmony_ci	&meson8b_ao_ahb_sram,
34388c2ecf20Sopenharmony_ci	&meson8b_ao_ahb_bus,
34398c2ecf20Sopenharmony_ci	&meson8b_ao_iface,
34408c2ecf20Sopenharmony_ci	&meson8b_mpeg_clk_div,
34418c2ecf20Sopenharmony_ci	&meson8b_mpeg_clk_sel,
34428c2ecf20Sopenharmony_ci	&meson8b_mpll0,
34438c2ecf20Sopenharmony_ci	&meson8b_mpll1,
34448c2ecf20Sopenharmony_ci	&meson8b_mpll2,
34458c2ecf20Sopenharmony_ci	&meson8b_mpll0_div,
34468c2ecf20Sopenharmony_ci	&meson8b_mpll1_div,
34478c2ecf20Sopenharmony_ci	&meson8b_mpll2_div,
34488c2ecf20Sopenharmony_ci	&meson8b_fixed_pll,
34498c2ecf20Sopenharmony_ci	&meson8b_sys_pll,
34508c2ecf20Sopenharmony_ci	&meson8b_cpu_in_sel,
34518c2ecf20Sopenharmony_ci	&meson8b_cpu_scale_div,
34528c2ecf20Sopenharmony_ci	&meson8b_cpu_scale_out_sel,
34538c2ecf20Sopenharmony_ci	&meson8b_cpu_clk,
34548c2ecf20Sopenharmony_ci	&meson8b_mpll_prediv,
34558c2ecf20Sopenharmony_ci	&meson8b_fclk_div2,
34568c2ecf20Sopenharmony_ci	&meson8b_fclk_div3,
34578c2ecf20Sopenharmony_ci	&meson8b_fclk_div4,
34588c2ecf20Sopenharmony_ci	&meson8b_fclk_div5,
34598c2ecf20Sopenharmony_ci	&meson8b_fclk_div7,
34608c2ecf20Sopenharmony_ci	&meson8b_nand_clk_sel,
34618c2ecf20Sopenharmony_ci	&meson8b_nand_clk_div,
34628c2ecf20Sopenharmony_ci	&meson8b_nand_clk_gate,
34638c2ecf20Sopenharmony_ci	&meson8b_fixed_pll_dco,
34648c2ecf20Sopenharmony_ci	&meson8b_hdmi_pll_dco,
34658c2ecf20Sopenharmony_ci	&meson8b_sys_pll_dco,
34668c2ecf20Sopenharmony_ci	&meson8b_apb_clk_sel,
34678c2ecf20Sopenharmony_ci	&meson8b_apb_clk_gate,
34688c2ecf20Sopenharmony_ci	&meson8b_periph_clk_sel,
34698c2ecf20Sopenharmony_ci	&meson8b_periph_clk_gate,
34708c2ecf20Sopenharmony_ci	&meson8b_axi_clk_sel,
34718c2ecf20Sopenharmony_ci	&meson8b_axi_clk_gate,
34728c2ecf20Sopenharmony_ci	&meson8b_l2_dram_clk_sel,
34738c2ecf20Sopenharmony_ci	&meson8b_l2_dram_clk_gate,
34748c2ecf20Sopenharmony_ci	&meson8b_hdmi_pll_lvds_out,
34758c2ecf20Sopenharmony_ci	&meson8b_hdmi_pll_hdmi_out,
34768c2ecf20Sopenharmony_ci	&meson8b_vid_pll_in_sel,
34778c2ecf20Sopenharmony_ci	&meson8b_vid_pll_in_en,
34788c2ecf20Sopenharmony_ci	&meson8b_vid_pll_pre_div,
34798c2ecf20Sopenharmony_ci	&meson8b_vid_pll_post_div,
34808c2ecf20Sopenharmony_ci	&meson8b_vid_pll,
34818c2ecf20Sopenharmony_ci	&meson8b_vid_pll_final_div,
34828c2ecf20Sopenharmony_ci	&meson8b_vclk_in_sel,
34838c2ecf20Sopenharmony_ci	&meson8b_vclk_in_en,
34848c2ecf20Sopenharmony_ci	&meson8b_vclk_en,
34858c2ecf20Sopenharmony_ci	&meson8b_vclk_div1_gate,
34868c2ecf20Sopenharmony_ci	&meson8b_vclk_div2_div_gate,
34878c2ecf20Sopenharmony_ci	&meson8b_vclk_div4_div_gate,
34888c2ecf20Sopenharmony_ci	&meson8b_vclk_div6_div_gate,
34898c2ecf20Sopenharmony_ci	&meson8b_vclk_div12_div_gate,
34908c2ecf20Sopenharmony_ci	&meson8b_vclk2_in_sel,
34918c2ecf20Sopenharmony_ci	&meson8b_vclk2_clk_in_en,
34928c2ecf20Sopenharmony_ci	&meson8b_vclk2_clk_en,
34938c2ecf20Sopenharmony_ci	&meson8b_vclk2_div1_gate,
34948c2ecf20Sopenharmony_ci	&meson8b_vclk2_div2_div_gate,
34958c2ecf20Sopenharmony_ci	&meson8b_vclk2_div4_div_gate,
34968c2ecf20Sopenharmony_ci	&meson8b_vclk2_div6_div_gate,
34978c2ecf20Sopenharmony_ci	&meson8b_vclk2_div12_div_gate,
34988c2ecf20Sopenharmony_ci	&meson8b_cts_enct_sel,
34998c2ecf20Sopenharmony_ci	&meson8b_cts_enct,
35008c2ecf20Sopenharmony_ci	&meson8b_cts_encp_sel,
35018c2ecf20Sopenharmony_ci	&meson8b_cts_encp,
35028c2ecf20Sopenharmony_ci	&meson8b_cts_enci_sel,
35038c2ecf20Sopenharmony_ci	&meson8b_cts_enci,
35048c2ecf20Sopenharmony_ci	&meson8b_hdmi_tx_pixel_sel,
35058c2ecf20Sopenharmony_ci	&meson8b_hdmi_tx_pixel,
35068c2ecf20Sopenharmony_ci	&meson8b_cts_encl_sel,
35078c2ecf20Sopenharmony_ci	&meson8b_cts_encl,
35088c2ecf20Sopenharmony_ci	&meson8b_cts_vdac0_sel,
35098c2ecf20Sopenharmony_ci	&meson8b_cts_vdac0,
35108c2ecf20Sopenharmony_ci	&meson8b_hdmi_sys_sel,
35118c2ecf20Sopenharmony_ci	&meson8b_hdmi_sys_div,
35128c2ecf20Sopenharmony_ci	&meson8b_hdmi_sys,
35138c2ecf20Sopenharmony_ci	&meson8b_mali_0_sel,
35148c2ecf20Sopenharmony_ci	&meson8b_mali_0_div,
35158c2ecf20Sopenharmony_ci	&meson8b_mali_0,
35168c2ecf20Sopenharmony_ci	&meson8b_mali_1_sel,
35178c2ecf20Sopenharmony_ci	&meson8b_mali_1_div,
35188c2ecf20Sopenharmony_ci	&meson8b_mali_1,
35198c2ecf20Sopenharmony_ci	&meson8b_mali,
35208c2ecf20Sopenharmony_ci	&meson8m2_gp_pll_dco,
35218c2ecf20Sopenharmony_ci	&meson8m2_gp_pll,
35228c2ecf20Sopenharmony_ci	&meson8b_vpu_0_sel,
35238c2ecf20Sopenharmony_ci	&meson8m2_vpu_0_sel,
35248c2ecf20Sopenharmony_ci	&meson8b_vpu_0_div,
35258c2ecf20Sopenharmony_ci	&meson8b_vpu_0,
35268c2ecf20Sopenharmony_ci	&meson8b_vpu_1_sel,
35278c2ecf20Sopenharmony_ci	&meson8m2_vpu_1_sel,
35288c2ecf20Sopenharmony_ci	&meson8b_vpu_1_div,
35298c2ecf20Sopenharmony_ci	&meson8b_vpu_1,
35308c2ecf20Sopenharmony_ci	&meson8b_vpu,
35318c2ecf20Sopenharmony_ci	&meson8b_vdec_1_sel,
35328c2ecf20Sopenharmony_ci	&meson8b_vdec_1_1_div,
35338c2ecf20Sopenharmony_ci	&meson8b_vdec_1_1,
35348c2ecf20Sopenharmony_ci	&meson8b_vdec_1_2_div,
35358c2ecf20Sopenharmony_ci	&meson8b_vdec_1_2,
35368c2ecf20Sopenharmony_ci	&meson8b_vdec_1,
35378c2ecf20Sopenharmony_ci	&meson8b_vdec_hcodec_sel,
35388c2ecf20Sopenharmony_ci	&meson8b_vdec_hcodec_div,
35398c2ecf20Sopenharmony_ci	&meson8b_vdec_hcodec,
35408c2ecf20Sopenharmony_ci	&meson8b_vdec_2_sel,
35418c2ecf20Sopenharmony_ci	&meson8b_vdec_2_div,
35428c2ecf20Sopenharmony_ci	&meson8b_vdec_2,
35438c2ecf20Sopenharmony_ci	&meson8b_vdec_hevc_sel,
35448c2ecf20Sopenharmony_ci	&meson8b_vdec_hevc_div,
35458c2ecf20Sopenharmony_ci	&meson8b_vdec_hevc_en,
35468c2ecf20Sopenharmony_ci	&meson8b_vdec_hevc,
35478c2ecf20Sopenharmony_ci	&meson8b_cts_amclk,
35488c2ecf20Sopenharmony_ci	&meson8b_cts_amclk_sel,
35498c2ecf20Sopenharmony_ci	&meson8b_cts_amclk_div,
35508c2ecf20Sopenharmony_ci	&meson8b_cts_mclk_i958_sel,
35518c2ecf20Sopenharmony_ci	&meson8b_cts_mclk_i958_div,
35528c2ecf20Sopenharmony_ci	&meson8b_cts_mclk_i958,
35538c2ecf20Sopenharmony_ci	&meson8b_cts_i958,
35548c2ecf20Sopenharmony_ci};
35558c2ecf20Sopenharmony_ci
35568c2ecf20Sopenharmony_cistatic const struct meson8b_clk_reset_line {
35578c2ecf20Sopenharmony_ci	u32 reg;
35588c2ecf20Sopenharmony_ci	u8 bit_idx;
35598c2ecf20Sopenharmony_ci	bool active_low;
35608c2ecf20Sopenharmony_ci} meson8b_clk_reset_bits[] = {
35618c2ecf20Sopenharmony_ci	[CLKC_RESET_L2_CACHE_SOFT_RESET] = {
35628c2ecf20Sopenharmony_ci		.reg = HHI_SYS_CPU_CLK_CNTL0,
35638c2ecf20Sopenharmony_ci		.bit_idx = 30,
35648c2ecf20Sopenharmony_ci		.active_low = false,
35658c2ecf20Sopenharmony_ci	},
35668c2ecf20Sopenharmony_ci	[CLKC_RESET_AXI_64_TO_128_BRIDGE_A5_SOFT_RESET] = {
35678c2ecf20Sopenharmony_ci		.reg = HHI_SYS_CPU_CLK_CNTL0,
35688c2ecf20Sopenharmony_ci		.bit_idx = 29,
35698c2ecf20Sopenharmony_ci		.active_low = false,
35708c2ecf20Sopenharmony_ci	},
35718c2ecf20Sopenharmony_ci	[CLKC_RESET_SCU_SOFT_RESET] = {
35728c2ecf20Sopenharmony_ci		.reg = HHI_SYS_CPU_CLK_CNTL0,
35738c2ecf20Sopenharmony_ci		.bit_idx = 28,
35748c2ecf20Sopenharmony_ci		.active_low = false,
35758c2ecf20Sopenharmony_ci	},
35768c2ecf20Sopenharmony_ci	[CLKC_RESET_CPU3_SOFT_RESET] = {
35778c2ecf20Sopenharmony_ci		.reg = HHI_SYS_CPU_CLK_CNTL0,
35788c2ecf20Sopenharmony_ci		.bit_idx = 27,
35798c2ecf20Sopenharmony_ci		.active_low = false,
35808c2ecf20Sopenharmony_ci	},
35818c2ecf20Sopenharmony_ci	[CLKC_RESET_CPU2_SOFT_RESET] = {
35828c2ecf20Sopenharmony_ci		.reg = HHI_SYS_CPU_CLK_CNTL0,
35838c2ecf20Sopenharmony_ci		.bit_idx = 26,
35848c2ecf20Sopenharmony_ci		.active_low = false,
35858c2ecf20Sopenharmony_ci	},
35868c2ecf20Sopenharmony_ci	[CLKC_RESET_CPU1_SOFT_RESET] = {
35878c2ecf20Sopenharmony_ci		.reg = HHI_SYS_CPU_CLK_CNTL0,
35888c2ecf20Sopenharmony_ci		.bit_idx = 25,
35898c2ecf20Sopenharmony_ci		.active_low = false,
35908c2ecf20Sopenharmony_ci	},
35918c2ecf20Sopenharmony_ci	[CLKC_RESET_CPU0_SOFT_RESET] = {
35928c2ecf20Sopenharmony_ci		.reg = HHI_SYS_CPU_CLK_CNTL0,
35938c2ecf20Sopenharmony_ci		.bit_idx = 24,
35948c2ecf20Sopenharmony_ci		.active_low = false,
35958c2ecf20Sopenharmony_ci	},
35968c2ecf20Sopenharmony_ci	[CLKC_RESET_A5_GLOBAL_RESET] = {
35978c2ecf20Sopenharmony_ci		.reg = HHI_SYS_CPU_CLK_CNTL0,
35988c2ecf20Sopenharmony_ci		.bit_idx = 18,
35998c2ecf20Sopenharmony_ci		.active_low = false,
36008c2ecf20Sopenharmony_ci	},
36018c2ecf20Sopenharmony_ci	[CLKC_RESET_A5_AXI_SOFT_RESET] = {
36028c2ecf20Sopenharmony_ci		.reg = HHI_SYS_CPU_CLK_CNTL0,
36038c2ecf20Sopenharmony_ci		.bit_idx = 17,
36048c2ecf20Sopenharmony_ci		.active_low = false,
36058c2ecf20Sopenharmony_ci	},
36068c2ecf20Sopenharmony_ci	[CLKC_RESET_A5_ABP_SOFT_RESET] = {
36078c2ecf20Sopenharmony_ci		.reg = HHI_SYS_CPU_CLK_CNTL0,
36088c2ecf20Sopenharmony_ci		.bit_idx = 16,
36098c2ecf20Sopenharmony_ci		.active_low = false,
36108c2ecf20Sopenharmony_ci	},
36118c2ecf20Sopenharmony_ci	[CLKC_RESET_AXI_64_TO_128_BRIDGE_MMC_SOFT_RESET] = {
36128c2ecf20Sopenharmony_ci		.reg = HHI_SYS_CPU_CLK_CNTL1,
36138c2ecf20Sopenharmony_ci		.bit_idx = 30,
36148c2ecf20Sopenharmony_ci		.active_low = false,
36158c2ecf20Sopenharmony_ci	},
36168c2ecf20Sopenharmony_ci	[CLKC_RESET_VID_CLK_CNTL_SOFT_RESET] = {
36178c2ecf20Sopenharmony_ci		.reg = HHI_VID_CLK_CNTL,
36188c2ecf20Sopenharmony_ci		.bit_idx = 15,
36198c2ecf20Sopenharmony_ci		.active_low = false,
36208c2ecf20Sopenharmony_ci	},
36218c2ecf20Sopenharmony_ci	[CLKC_RESET_VID_DIVIDER_CNTL_SOFT_RESET_POST] = {
36228c2ecf20Sopenharmony_ci		.reg = HHI_VID_DIVIDER_CNTL,
36238c2ecf20Sopenharmony_ci		.bit_idx = 7,
36248c2ecf20Sopenharmony_ci		.active_low = false,
36258c2ecf20Sopenharmony_ci	},
36268c2ecf20Sopenharmony_ci	[CLKC_RESET_VID_DIVIDER_CNTL_SOFT_RESET_PRE] = {
36278c2ecf20Sopenharmony_ci		.reg = HHI_VID_DIVIDER_CNTL,
36288c2ecf20Sopenharmony_ci		.bit_idx = 3,
36298c2ecf20Sopenharmony_ci		.active_low = false,
36308c2ecf20Sopenharmony_ci	},
36318c2ecf20Sopenharmony_ci	[CLKC_RESET_VID_DIVIDER_CNTL_RESET_N_POST] = {
36328c2ecf20Sopenharmony_ci		.reg = HHI_VID_DIVIDER_CNTL,
36338c2ecf20Sopenharmony_ci		.bit_idx = 1,
36348c2ecf20Sopenharmony_ci		.active_low = true,
36358c2ecf20Sopenharmony_ci	},
36368c2ecf20Sopenharmony_ci	[CLKC_RESET_VID_DIVIDER_CNTL_RESET_N_PRE] = {
36378c2ecf20Sopenharmony_ci		.reg = HHI_VID_DIVIDER_CNTL,
36388c2ecf20Sopenharmony_ci		.bit_idx = 0,
36398c2ecf20Sopenharmony_ci		.active_low = true,
36408c2ecf20Sopenharmony_ci	},
36418c2ecf20Sopenharmony_ci};
36428c2ecf20Sopenharmony_ci
36438c2ecf20Sopenharmony_cistatic int meson8b_clk_reset_update(struct reset_controller_dev *rcdev,
36448c2ecf20Sopenharmony_ci				    unsigned long id, bool assert)
36458c2ecf20Sopenharmony_ci{
36468c2ecf20Sopenharmony_ci	struct meson8b_clk_reset *meson8b_clk_reset =
36478c2ecf20Sopenharmony_ci		container_of(rcdev, struct meson8b_clk_reset, reset);
36488c2ecf20Sopenharmony_ci	const struct meson8b_clk_reset_line *reset;
36498c2ecf20Sopenharmony_ci	unsigned int value = 0;
36508c2ecf20Sopenharmony_ci	unsigned long flags;
36518c2ecf20Sopenharmony_ci
36528c2ecf20Sopenharmony_ci	if (id >= ARRAY_SIZE(meson8b_clk_reset_bits))
36538c2ecf20Sopenharmony_ci		return -EINVAL;
36548c2ecf20Sopenharmony_ci
36558c2ecf20Sopenharmony_ci	reset = &meson8b_clk_reset_bits[id];
36568c2ecf20Sopenharmony_ci
36578c2ecf20Sopenharmony_ci	if (assert != reset->active_low)
36588c2ecf20Sopenharmony_ci		value = BIT(reset->bit_idx);
36598c2ecf20Sopenharmony_ci
36608c2ecf20Sopenharmony_ci	spin_lock_irqsave(&meson_clk_lock, flags);
36618c2ecf20Sopenharmony_ci
36628c2ecf20Sopenharmony_ci	regmap_update_bits(meson8b_clk_reset->regmap, reset->reg,
36638c2ecf20Sopenharmony_ci			   BIT(reset->bit_idx), value);
36648c2ecf20Sopenharmony_ci
36658c2ecf20Sopenharmony_ci	spin_unlock_irqrestore(&meson_clk_lock, flags);
36668c2ecf20Sopenharmony_ci
36678c2ecf20Sopenharmony_ci	return 0;
36688c2ecf20Sopenharmony_ci}
36698c2ecf20Sopenharmony_ci
36708c2ecf20Sopenharmony_cistatic int meson8b_clk_reset_assert(struct reset_controller_dev *rcdev,
36718c2ecf20Sopenharmony_ci				     unsigned long id)
36728c2ecf20Sopenharmony_ci{
36738c2ecf20Sopenharmony_ci	return meson8b_clk_reset_update(rcdev, id, true);
36748c2ecf20Sopenharmony_ci}
36758c2ecf20Sopenharmony_ci
36768c2ecf20Sopenharmony_cistatic int meson8b_clk_reset_deassert(struct reset_controller_dev *rcdev,
36778c2ecf20Sopenharmony_ci				       unsigned long id)
36788c2ecf20Sopenharmony_ci{
36798c2ecf20Sopenharmony_ci	return meson8b_clk_reset_update(rcdev, id, false);
36808c2ecf20Sopenharmony_ci}
36818c2ecf20Sopenharmony_ci
36828c2ecf20Sopenharmony_cistatic const struct reset_control_ops meson8b_clk_reset_ops = {
36838c2ecf20Sopenharmony_ci	.assert = meson8b_clk_reset_assert,
36848c2ecf20Sopenharmony_ci	.deassert = meson8b_clk_reset_deassert,
36858c2ecf20Sopenharmony_ci};
36868c2ecf20Sopenharmony_ci
36878c2ecf20Sopenharmony_cistruct meson8b_nb_data {
36888c2ecf20Sopenharmony_ci	struct notifier_block nb;
36898c2ecf20Sopenharmony_ci	struct clk_hw *cpu_clk;
36908c2ecf20Sopenharmony_ci};
36918c2ecf20Sopenharmony_ci
36928c2ecf20Sopenharmony_cistatic int meson8b_cpu_clk_notifier_cb(struct notifier_block *nb,
36938c2ecf20Sopenharmony_ci				       unsigned long event, void *data)
36948c2ecf20Sopenharmony_ci{
36958c2ecf20Sopenharmony_ci	struct meson8b_nb_data *nb_data =
36968c2ecf20Sopenharmony_ci		container_of(nb, struct meson8b_nb_data, nb);
36978c2ecf20Sopenharmony_ci	struct clk_hw *parent_clk;
36988c2ecf20Sopenharmony_ci	int ret;
36998c2ecf20Sopenharmony_ci
37008c2ecf20Sopenharmony_ci	switch (event) {
37018c2ecf20Sopenharmony_ci	case PRE_RATE_CHANGE:
37028c2ecf20Sopenharmony_ci		/* xtal */
37038c2ecf20Sopenharmony_ci		parent_clk = clk_hw_get_parent_by_index(nb_data->cpu_clk, 0);
37048c2ecf20Sopenharmony_ci		break;
37058c2ecf20Sopenharmony_ci
37068c2ecf20Sopenharmony_ci	case POST_RATE_CHANGE:
37078c2ecf20Sopenharmony_ci		/* cpu_scale_out_sel */
37088c2ecf20Sopenharmony_ci		parent_clk = clk_hw_get_parent_by_index(nb_data->cpu_clk, 1);
37098c2ecf20Sopenharmony_ci		break;
37108c2ecf20Sopenharmony_ci
37118c2ecf20Sopenharmony_ci	default:
37128c2ecf20Sopenharmony_ci		return NOTIFY_DONE;
37138c2ecf20Sopenharmony_ci	}
37148c2ecf20Sopenharmony_ci
37158c2ecf20Sopenharmony_ci	ret = clk_hw_set_parent(nb_data->cpu_clk, parent_clk);
37168c2ecf20Sopenharmony_ci	if (ret)
37178c2ecf20Sopenharmony_ci		return notifier_from_errno(ret);
37188c2ecf20Sopenharmony_ci
37198c2ecf20Sopenharmony_ci	udelay(100);
37208c2ecf20Sopenharmony_ci
37218c2ecf20Sopenharmony_ci	return NOTIFY_OK;
37228c2ecf20Sopenharmony_ci}
37238c2ecf20Sopenharmony_ci
37248c2ecf20Sopenharmony_cistatic struct meson8b_nb_data meson8b_cpu_nb_data = {
37258c2ecf20Sopenharmony_ci	.nb.notifier_call = meson8b_cpu_clk_notifier_cb,
37268c2ecf20Sopenharmony_ci};
37278c2ecf20Sopenharmony_ci
37288c2ecf20Sopenharmony_cistatic const struct regmap_config clkc_regmap_config = {
37298c2ecf20Sopenharmony_ci	.reg_bits       = 32,
37308c2ecf20Sopenharmony_ci	.val_bits       = 32,
37318c2ecf20Sopenharmony_ci	.reg_stride     = 4,
37328c2ecf20Sopenharmony_ci};
37338c2ecf20Sopenharmony_ci
37348c2ecf20Sopenharmony_cistatic void __init meson8b_clkc_init_common(struct device_node *np,
37358c2ecf20Sopenharmony_ci			struct clk_hw_onecell_data *clk_hw_onecell_data)
37368c2ecf20Sopenharmony_ci{
37378c2ecf20Sopenharmony_ci	struct meson8b_clk_reset *rstc;
37388c2ecf20Sopenharmony_ci	struct device_node *parent_np;
37398c2ecf20Sopenharmony_ci	const char *notifier_clk_name;
37408c2ecf20Sopenharmony_ci	struct clk *notifier_clk;
37418c2ecf20Sopenharmony_ci	void __iomem *clk_base;
37428c2ecf20Sopenharmony_ci	struct regmap *map;
37438c2ecf20Sopenharmony_ci	int i, ret;
37448c2ecf20Sopenharmony_ci
37458c2ecf20Sopenharmony_ci	parent_np = of_get_parent(np);
37468c2ecf20Sopenharmony_ci	map = syscon_node_to_regmap(parent_np);
37478c2ecf20Sopenharmony_ci	of_node_put(parent_np);
37488c2ecf20Sopenharmony_ci	if (IS_ERR(map)) {
37498c2ecf20Sopenharmony_ci		pr_info("failed to get HHI regmap - Trying obsolete regs\n");
37508c2ecf20Sopenharmony_ci
37518c2ecf20Sopenharmony_ci		/* Generic clocks, PLLs and some of the reset-bits */
37528c2ecf20Sopenharmony_ci		clk_base = of_iomap(np, 1);
37538c2ecf20Sopenharmony_ci		if (!clk_base) {
37548c2ecf20Sopenharmony_ci			pr_err("%s: Unable to map clk base\n", __func__);
37558c2ecf20Sopenharmony_ci			return;
37568c2ecf20Sopenharmony_ci		}
37578c2ecf20Sopenharmony_ci
37588c2ecf20Sopenharmony_ci		map = regmap_init_mmio(NULL, clk_base, &clkc_regmap_config);
37598c2ecf20Sopenharmony_ci		if (IS_ERR(map))
37608c2ecf20Sopenharmony_ci			return;
37618c2ecf20Sopenharmony_ci	}
37628c2ecf20Sopenharmony_ci
37638c2ecf20Sopenharmony_ci	rstc = kzalloc(sizeof(*rstc), GFP_KERNEL);
37648c2ecf20Sopenharmony_ci	if (!rstc)
37658c2ecf20Sopenharmony_ci		return;
37668c2ecf20Sopenharmony_ci
37678c2ecf20Sopenharmony_ci	/* Reset Controller */
37688c2ecf20Sopenharmony_ci	rstc->regmap = map;
37698c2ecf20Sopenharmony_ci	rstc->reset.ops = &meson8b_clk_reset_ops;
37708c2ecf20Sopenharmony_ci	rstc->reset.nr_resets = ARRAY_SIZE(meson8b_clk_reset_bits);
37718c2ecf20Sopenharmony_ci	rstc->reset.of_node = np;
37728c2ecf20Sopenharmony_ci	ret = reset_controller_register(&rstc->reset);
37738c2ecf20Sopenharmony_ci	if (ret) {
37748c2ecf20Sopenharmony_ci		pr_err("%s: Failed to register clkc reset controller: %d\n",
37758c2ecf20Sopenharmony_ci		       __func__, ret);
37768c2ecf20Sopenharmony_ci		return;
37778c2ecf20Sopenharmony_ci	}
37788c2ecf20Sopenharmony_ci
37798c2ecf20Sopenharmony_ci	/* Populate regmap for the regmap backed clocks */
37808c2ecf20Sopenharmony_ci	for (i = 0; i < ARRAY_SIZE(meson8b_clk_regmaps); i++)
37818c2ecf20Sopenharmony_ci		meson8b_clk_regmaps[i]->map = map;
37828c2ecf20Sopenharmony_ci
37838c2ecf20Sopenharmony_ci	/*
37848c2ecf20Sopenharmony_ci	 * always skip CLKID_UNUSED and also skip XTAL if the .dtb provides the
37858c2ecf20Sopenharmony_ci	 * XTAL clock as input.
37868c2ecf20Sopenharmony_ci	 */
37878c2ecf20Sopenharmony_ci	if (!IS_ERR(of_clk_get_by_name(np, "xtal")))
37888c2ecf20Sopenharmony_ci		i = CLKID_PLL_FIXED;
37898c2ecf20Sopenharmony_ci	else
37908c2ecf20Sopenharmony_ci		i = CLKID_XTAL;
37918c2ecf20Sopenharmony_ci
37928c2ecf20Sopenharmony_ci	/* register all clks */
37938c2ecf20Sopenharmony_ci	for (; i < CLK_NR_CLKS; i++) {
37948c2ecf20Sopenharmony_ci		/* array might be sparse */
37958c2ecf20Sopenharmony_ci		if (!clk_hw_onecell_data->hws[i])
37968c2ecf20Sopenharmony_ci			continue;
37978c2ecf20Sopenharmony_ci
37988c2ecf20Sopenharmony_ci		ret = of_clk_hw_register(np, clk_hw_onecell_data->hws[i]);
37998c2ecf20Sopenharmony_ci		if (ret)
38008c2ecf20Sopenharmony_ci			return;
38018c2ecf20Sopenharmony_ci	}
38028c2ecf20Sopenharmony_ci
38038c2ecf20Sopenharmony_ci	meson8b_cpu_nb_data.cpu_clk = clk_hw_onecell_data->hws[CLKID_CPUCLK];
38048c2ecf20Sopenharmony_ci
38058c2ecf20Sopenharmony_ci	/*
38068c2ecf20Sopenharmony_ci	 * FIXME we shouldn't program the muxes in notifier handlers. The
38078c2ecf20Sopenharmony_ci	 * tricky programming sequence will be handled by the forthcoming
38088c2ecf20Sopenharmony_ci	 * coordinated clock rates mechanism once that feature is released.
38098c2ecf20Sopenharmony_ci	 */
38108c2ecf20Sopenharmony_ci	notifier_clk_name = clk_hw_get_name(&meson8b_cpu_scale_out_sel.hw);
38118c2ecf20Sopenharmony_ci	notifier_clk = __clk_lookup(notifier_clk_name);
38128c2ecf20Sopenharmony_ci	ret = clk_notifier_register(notifier_clk, &meson8b_cpu_nb_data.nb);
38138c2ecf20Sopenharmony_ci	if (ret) {
38148c2ecf20Sopenharmony_ci		pr_err("%s: failed to register the CPU clock notifier\n",
38158c2ecf20Sopenharmony_ci		       __func__);
38168c2ecf20Sopenharmony_ci		return;
38178c2ecf20Sopenharmony_ci	}
38188c2ecf20Sopenharmony_ci
38198c2ecf20Sopenharmony_ci	ret = of_clk_add_hw_provider(np, of_clk_hw_onecell_get,
38208c2ecf20Sopenharmony_ci				     clk_hw_onecell_data);
38218c2ecf20Sopenharmony_ci	if (ret)
38228c2ecf20Sopenharmony_ci		pr_err("%s: failed to register clock provider\n", __func__);
38238c2ecf20Sopenharmony_ci}
38248c2ecf20Sopenharmony_ci
38258c2ecf20Sopenharmony_cistatic void __init meson8_clkc_init(struct device_node *np)
38268c2ecf20Sopenharmony_ci{
38278c2ecf20Sopenharmony_ci	return meson8b_clkc_init_common(np, &meson8_hw_onecell_data);
38288c2ecf20Sopenharmony_ci}
38298c2ecf20Sopenharmony_ci
38308c2ecf20Sopenharmony_cistatic void __init meson8b_clkc_init(struct device_node *np)
38318c2ecf20Sopenharmony_ci{
38328c2ecf20Sopenharmony_ci	return meson8b_clkc_init_common(np, &meson8b_hw_onecell_data);
38338c2ecf20Sopenharmony_ci}
38348c2ecf20Sopenharmony_ci
38358c2ecf20Sopenharmony_cistatic void __init meson8m2_clkc_init(struct device_node *np)
38368c2ecf20Sopenharmony_ci{
38378c2ecf20Sopenharmony_ci	return meson8b_clkc_init_common(np, &meson8m2_hw_onecell_data);
38388c2ecf20Sopenharmony_ci}
38398c2ecf20Sopenharmony_ci
38408c2ecf20Sopenharmony_ciCLK_OF_DECLARE_DRIVER(meson8_clkc, "amlogic,meson8-clkc",
38418c2ecf20Sopenharmony_ci		      meson8_clkc_init);
38428c2ecf20Sopenharmony_ciCLK_OF_DECLARE_DRIVER(meson8b_clkc, "amlogic,meson8b-clkc",
38438c2ecf20Sopenharmony_ci		      meson8b_clkc_init);
38448c2ecf20Sopenharmony_ciCLK_OF_DECLARE_DRIVER(meson8m2_clkc, "amlogic,meson8m2-clkc",
38458c2ecf20Sopenharmony_ci		      meson8m2_clkc_init);
3846