18c2ecf20Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * Copyright (c) 2019 MediaTek Inc.
48c2ecf20Sopenharmony_ci * Author: Wendell Lin <wendell.lin@mediatek.com>
58c2ecf20Sopenharmony_ci */
68c2ecf20Sopenharmony_ci
78c2ecf20Sopenharmony_ci#include <linux/of.h>
88c2ecf20Sopenharmony_ci#include <linux/of_address.h>
98c2ecf20Sopenharmony_ci#include <linux/of_device.h>
108c2ecf20Sopenharmony_ci#include <linux/platform_device.h>
118c2ecf20Sopenharmony_ci
128c2ecf20Sopenharmony_ci#include "clk-mtk.h"
138c2ecf20Sopenharmony_ci#include "clk-mux.h"
148c2ecf20Sopenharmony_ci#include "clk-gate.h"
158c2ecf20Sopenharmony_ci
168c2ecf20Sopenharmony_ci#include <dt-bindings/clock/mt6779-clk.h>
178c2ecf20Sopenharmony_ci
188c2ecf20Sopenharmony_cistatic DEFINE_SPINLOCK(mt6779_clk_lock);
198c2ecf20Sopenharmony_ci
208c2ecf20Sopenharmony_cistatic const struct mtk_fixed_clk top_fixed_clks[] = {
218c2ecf20Sopenharmony_ci	FIXED_CLK(CLK_TOP_CLK26M, "f_f26m_ck", "clk26m", 26000000),
228c2ecf20Sopenharmony_ci};
238c2ecf20Sopenharmony_ci
248c2ecf20Sopenharmony_cistatic const struct mtk_fixed_factor top_divs[] = {
258c2ecf20Sopenharmony_ci	FACTOR(CLK_TOP_CLK13M, "clk13m", "clk26m", 1, 2),
268c2ecf20Sopenharmony_ci	FACTOR(CLK_TOP_F26M_CK_D2, "csw_f26m_ck_d2", "clk26m", 1, 2),
278c2ecf20Sopenharmony_ci	FACTOR(CLK_TOP_MAINPLL_CK, "mainpll_ck", "mainpll", 1, 1),
288c2ecf20Sopenharmony_ci	FACTOR(CLK_TOP_MAINPLL_D2, "mainpll_d2", "mainpll_ck", 1, 2),
298c2ecf20Sopenharmony_ci	FACTOR(CLK_TOP_MAINPLL_D2_D2, "mainpll_d2_d2", "mainpll_d2", 1, 2),
308c2ecf20Sopenharmony_ci	FACTOR(CLK_TOP_MAINPLL_D2_D4, "mainpll_d2_d4", "mainpll_d2", 1, 4),
318c2ecf20Sopenharmony_ci	FACTOR(CLK_TOP_MAINPLL_D2_D8, "mainpll_d2_d8", "mainpll_d2", 1, 8),
328c2ecf20Sopenharmony_ci	FACTOR(CLK_TOP_MAINPLL_D2_D16, "mainpll_d2_d16", "mainpll_d2", 1, 16),
338c2ecf20Sopenharmony_ci	FACTOR(CLK_TOP_MAINPLL_D3, "mainpll_d3", "mainpll", 1, 3),
348c2ecf20Sopenharmony_ci	FACTOR(CLK_TOP_MAINPLL_D3_D2, "mainpll_d3_d2", "mainpll_d3", 1, 2),
358c2ecf20Sopenharmony_ci	FACTOR(CLK_TOP_MAINPLL_D3_D4, "mainpll_d3_d4", "mainpll_d3", 1, 4),
368c2ecf20Sopenharmony_ci	FACTOR(CLK_TOP_MAINPLL_D3_D8, "mainpll_d3_d8", "mainpll_d3", 1, 8),
378c2ecf20Sopenharmony_ci	FACTOR(CLK_TOP_MAINPLL_D5, "mainpll_d5", "mainpll", 1, 5),
388c2ecf20Sopenharmony_ci	FACTOR(CLK_TOP_MAINPLL_D5_D2, "mainpll_d5_d2", "mainpll_d5", 1, 2),
398c2ecf20Sopenharmony_ci	FACTOR(CLK_TOP_MAINPLL_D5_D4, "mainpll_d5_d4", "mainpll_d5", 1, 4),
408c2ecf20Sopenharmony_ci	FACTOR(CLK_TOP_MAINPLL_D7, "mainpll_d7", "mainpll", 1, 7),
418c2ecf20Sopenharmony_ci	FACTOR(CLK_TOP_MAINPLL_D7_D2, "mainpll_d7_d2", "mainpll_d7", 1, 2),
428c2ecf20Sopenharmony_ci	FACTOR(CLK_TOP_MAINPLL_D7_D4, "mainpll_d7_d4", "mainpll_d7", 1, 4),
438c2ecf20Sopenharmony_ci	FACTOR(CLK_TOP_UNIVPLL_CK, "univpll", "univ2pll", 1, 2),
448c2ecf20Sopenharmony_ci	FACTOR(CLK_TOP_UNIVPLL_D2, "univpll_d2", "univpll", 1, 2),
458c2ecf20Sopenharmony_ci	FACTOR(CLK_TOP_UNIVPLL_D2_D2, "univpll_d2_d2", "univpll_d2", 1, 2),
468c2ecf20Sopenharmony_ci	FACTOR(CLK_TOP_UNIVPLL_D2_D4, "univpll_d2_d4", "univpll_d2", 1, 4),
478c2ecf20Sopenharmony_ci	FACTOR(CLK_TOP_UNIVPLL_D2_D8, "univpll_d2_d8", "univpll_d2", 1, 8),
488c2ecf20Sopenharmony_ci	FACTOR(CLK_TOP_UNIVPLL_D3, "univpll_d3", "univpll", 1, 3),
498c2ecf20Sopenharmony_ci	FACTOR(CLK_TOP_UNIVPLL_D3_D2, "univpll_d3_d2", "univpll_d3", 1, 2),
508c2ecf20Sopenharmony_ci	FACTOR(CLK_TOP_UNIVPLL_D3_D4, "univpll_d3_d4", "univpll_d3", 1, 4),
518c2ecf20Sopenharmony_ci	FACTOR(CLK_TOP_UNIVPLL_D3_D8, "univpll_d3_d8", "univpll_d3", 1, 8),
528c2ecf20Sopenharmony_ci	FACTOR(CLK_TOP_UNIVPLL_D3_D16, "univpll_d3_d16", "univpll_d3", 1, 16),
538c2ecf20Sopenharmony_ci	FACTOR(CLK_TOP_UNIVPLL_D5, "univpll_d5", "univpll", 1, 5),
548c2ecf20Sopenharmony_ci	FACTOR(CLK_TOP_UNIVPLL_D5_D2, "univpll_d5_d2", "univpll_d5", 1, 2),
558c2ecf20Sopenharmony_ci	FACTOR(CLK_TOP_UNIVPLL_D5_D4, "univpll_d5_d4", "univpll_d5", 1, 4),
568c2ecf20Sopenharmony_ci	FACTOR(CLK_TOP_UNIVPLL_D5_D8, "univpll_d5_d8", "univpll_d5", 1, 8),
578c2ecf20Sopenharmony_ci	FACTOR(CLK_TOP_UNIVPLL_D7, "univpll_d7", "univpll", 1, 7),
588c2ecf20Sopenharmony_ci	FACTOR(CLK_TOP_UNIVP_192M_CK, "univpll_192m_ck", "univ2pll", 1, 13),
598c2ecf20Sopenharmony_ci	FACTOR(CLK_TOP_UNIVP_192M_D2, "univpll_192m_d2", "univpll_192m_ck",
608c2ecf20Sopenharmony_ci	       1, 2),
618c2ecf20Sopenharmony_ci	FACTOR(CLK_TOP_UNIVP_192M_D4, "univpll_192m_d4", "univpll_192m_ck",
628c2ecf20Sopenharmony_ci	       1, 4),
638c2ecf20Sopenharmony_ci	FACTOR(CLK_TOP_UNIVP_192M_D8, "univpll_192m_d8", "univpll_192m_ck",
648c2ecf20Sopenharmony_ci	       1, 8),
658c2ecf20Sopenharmony_ci	FACTOR(CLK_TOP_UNIVP_192M_D16, "univpll_192m_d16", "univpll_192m_ck",
668c2ecf20Sopenharmony_ci	       1, 16),
678c2ecf20Sopenharmony_ci	FACTOR(CLK_TOP_UNIVP_192M_D32, "univpll_192m_d32", "univpll_192m_ck",
688c2ecf20Sopenharmony_ci	       1, 32),
698c2ecf20Sopenharmony_ci	FACTOR(CLK_TOP_APLL1_CK, "apll1_ck", "apll1", 1, 1),
708c2ecf20Sopenharmony_ci	FACTOR(CLK_TOP_APLL1_D2, "apll1_d2", "apll1", 1, 2),
718c2ecf20Sopenharmony_ci	FACTOR(CLK_TOP_APLL1_D4, "apll1_d4", "apll1", 1, 4),
728c2ecf20Sopenharmony_ci	FACTOR(CLK_TOP_APLL1_D8, "apll1_d8", "apll1", 1, 8),
738c2ecf20Sopenharmony_ci	FACTOR(CLK_TOP_APLL2_CK, "apll2_ck", "apll2", 1, 1),
748c2ecf20Sopenharmony_ci	FACTOR(CLK_TOP_APLL2_D2, "apll2_d2", "apll2", 1, 2),
758c2ecf20Sopenharmony_ci	FACTOR(CLK_TOP_APLL2_D4, "apll2_d4", "apll2", 1, 4),
768c2ecf20Sopenharmony_ci	FACTOR(CLK_TOP_APLL2_D8, "apll2_d8", "apll2", 1, 8),
778c2ecf20Sopenharmony_ci	FACTOR(CLK_TOP_TVDPLL_CK, "tvdpll_ck", "tvdpll", 1, 1),
788c2ecf20Sopenharmony_ci	FACTOR(CLK_TOP_TVDPLL_D2, "tvdpll_d2", "tvdpll_ck", 1, 2),
798c2ecf20Sopenharmony_ci	FACTOR(CLK_TOP_TVDPLL_D4, "tvdpll_d4", "tvdpll", 1, 4),
808c2ecf20Sopenharmony_ci	FACTOR(CLK_TOP_TVDPLL_D8, "tvdpll_d8", "tvdpll", 1, 8),
818c2ecf20Sopenharmony_ci	FACTOR(CLK_TOP_TVDPLL_D16, "tvdpll_d16", "tvdpll", 1, 16),
828c2ecf20Sopenharmony_ci	FACTOR(CLK_TOP_MMPLL_CK, "mmpll_ck", "mmpll", 1, 1),
838c2ecf20Sopenharmony_ci	FACTOR(CLK_TOP_MMPLL_D4, "mmpll_d4", "mmpll", 1, 4),
848c2ecf20Sopenharmony_ci	FACTOR(CLK_TOP_MMPLL_D4_D2, "mmpll_d4_d2", "mmpll_d4", 1, 2),
858c2ecf20Sopenharmony_ci	FACTOR(CLK_TOP_MMPLL_D4_D4, "mmpll_d4_d4", "mmpll_d4", 1, 4),
868c2ecf20Sopenharmony_ci	FACTOR(CLK_TOP_MMPLL_D5, "mmpll_d5", "mmpll", 1, 5),
878c2ecf20Sopenharmony_ci	FACTOR(CLK_TOP_MMPLL_D5_D2, "mmpll_d5_d2", "mmpll_d5", 1, 2),
888c2ecf20Sopenharmony_ci	FACTOR(CLK_TOP_MMPLL_D5_D4, "mmpll_d5_d4", "mmpll_d5", 1, 4),
898c2ecf20Sopenharmony_ci	FACTOR(CLK_TOP_MMPLL_D6, "mmpll_d6", "mmpll", 1, 6),
908c2ecf20Sopenharmony_ci	FACTOR(CLK_TOP_MMPLL_D7, "mmpll_d7", "mmpll", 1, 7),
918c2ecf20Sopenharmony_ci	FACTOR(CLK_TOP_MFGPLL_CK, "mfgpll_ck", "mfgpll", 1, 1),
928c2ecf20Sopenharmony_ci	FACTOR(CLK_TOP_ADSPPLL_CK, "adsppll_ck", "adsppll", 1, 1),
938c2ecf20Sopenharmony_ci	FACTOR(CLK_TOP_ADSPPLL_D4, "adsppll_d4", "adsppll", 1, 4),
948c2ecf20Sopenharmony_ci	FACTOR(CLK_TOP_ADSPPLL_D5, "adsppll_d5", "adsppll", 1, 5),
958c2ecf20Sopenharmony_ci	FACTOR(CLK_TOP_ADSPPLL_D6, "adsppll_d6", "adsppll", 1, 6),
968c2ecf20Sopenharmony_ci	FACTOR(CLK_TOP_MSDCPLL_CK, "msdcpll_ck", "msdcpll", 1, 1),
978c2ecf20Sopenharmony_ci	FACTOR(CLK_TOP_MSDCPLL_D2, "msdcpll_d2", "msdcpll", 1, 2),
988c2ecf20Sopenharmony_ci	FACTOR(CLK_TOP_MSDCPLL_D4, "msdcpll_d4", "msdcpll", 1, 4),
998c2ecf20Sopenharmony_ci	FACTOR(CLK_TOP_MSDCPLL_D8, "msdcpll_d8", "msdcpll", 1, 8),
1008c2ecf20Sopenharmony_ci	FACTOR(CLK_TOP_MSDCPLL_D16, "msdcpll_d16", "msdcpll", 1, 16),
1018c2ecf20Sopenharmony_ci	FACTOR(CLK_TOP_AD_OSC_CK, "ad_osc_ck", "osc", 1, 1),
1028c2ecf20Sopenharmony_ci	FACTOR(CLK_TOP_OSC_D2, "osc_d2", "osc", 1, 2),
1038c2ecf20Sopenharmony_ci	FACTOR(CLK_TOP_OSC_D4, "osc_d4", "osc", 1, 4),
1048c2ecf20Sopenharmony_ci	FACTOR(CLK_TOP_OSC_D8, "osc_d8", "osc", 1, 8),
1058c2ecf20Sopenharmony_ci	FACTOR(CLK_TOP_OSC_D10, "osc_d10", "osc", 1, 10),
1068c2ecf20Sopenharmony_ci	FACTOR(CLK_TOP_OSC_D16, "osc_d16", "osc", 1, 16),
1078c2ecf20Sopenharmony_ci	FACTOR(CLK_TOP_AD_OSC2_CK, "ad_osc2_ck", "osc2", 1, 1),
1088c2ecf20Sopenharmony_ci	FACTOR(CLK_TOP_OSC2_D2, "osc2_d2", "osc2", 1, 2),
1098c2ecf20Sopenharmony_ci	FACTOR(CLK_TOP_OSC2_D3, "osc2_d3", "osc2", 1, 3),
1108c2ecf20Sopenharmony_ci	FACTOR(CLK_TOP_TVDPLL_MAINPLL_D2_CK, "tvdpll_mainpll_d2_ck",
1118c2ecf20Sopenharmony_ci	       "tvdpll", 1, 1),
1128c2ecf20Sopenharmony_ci	FACTOR(CLK_TOP_FMEM_466M_CK, "fmem_466m_ck", "fmem", 1, 1),
1138c2ecf20Sopenharmony_ci};
1148c2ecf20Sopenharmony_ci
1158c2ecf20Sopenharmony_cistatic const char * const axi_parents[] = {
1168c2ecf20Sopenharmony_ci	"clk26m",
1178c2ecf20Sopenharmony_ci	"mainpll_d2_d4",
1188c2ecf20Sopenharmony_ci	"mainpll_d7",
1198c2ecf20Sopenharmony_ci	"osc_d4"
1208c2ecf20Sopenharmony_ci};
1218c2ecf20Sopenharmony_ci
1228c2ecf20Sopenharmony_cistatic const char * const mm_parents[] = {
1238c2ecf20Sopenharmony_ci	"clk26m",
1248c2ecf20Sopenharmony_ci	"tvdpll_mainpll_d2_ck",
1258c2ecf20Sopenharmony_ci	"mmpll_d7",
1268c2ecf20Sopenharmony_ci	"mmpll_d5_d2",
1278c2ecf20Sopenharmony_ci	"mainpll_d2_d2",
1288c2ecf20Sopenharmony_ci	"mainpll_d3_d2"
1298c2ecf20Sopenharmony_ci};
1308c2ecf20Sopenharmony_ci
1318c2ecf20Sopenharmony_cistatic const char * const scp_parents[] = {
1328c2ecf20Sopenharmony_ci	"clk26m",
1338c2ecf20Sopenharmony_ci	"univpll_d2_d8",
1348c2ecf20Sopenharmony_ci	"mainpll_d2_d4",
1358c2ecf20Sopenharmony_ci	"mainpll_d3",
1368c2ecf20Sopenharmony_ci	"univpll_d3",
1378c2ecf20Sopenharmony_ci	"ad_osc2_ck",
1388c2ecf20Sopenharmony_ci	"osc2_d2",
1398c2ecf20Sopenharmony_ci	"osc2_d3"
1408c2ecf20Sopenharmony_ci};
1418c2ecf20Sopenharmony_ci
1428c2ecf20Sopenharmony_cistatic const char * const img_parents[] = {
1438c2ecf20Sopenharmony_ci	"clk26m",
1448c2ecf20Sopenharmony_ci	"mainpll_d2",
1458c2ecf20Sopenharmony_ci	"mainpll_d2",
1468c2ecf20Sopenharmony_ci	"univpll_d3",
1478c2ecf20Sopenharmony_ci	"mainpll_d3",
1488c2ecf20Sopenharmony_ci	"mmpll_d5_d2",
1498c2ecf20Sopenharmony_ci	"tvdpll_mainpll_d2_ck",
1508c2ecf20Sopenharmony_ci	"mainpll_d5"
1518c2ecf20Sopenharmony_ci};
1528c2ecf20Sopenharmony_ci
1538c2ecf20Sopenharmony_cistatic const char * const ipe_parents[] = {
1548c2ecf20Sopenharmony_ci	"clk26m",
1558c2ecf20Sopenharmony_ci	"mainpll_d2",
1568c2ecf20Sopenharmony_ci	"mmpll_d7",
1578c2ecf20Sopenharmony_ci	"univpll_d3",
1588c2ecf20Sopenharmony_ci	"mainpll_d3",
1598c2ecf20Sopenharmony_ci	"mmpll_d5_d2",
1608c2ecf20Sopenharmony_ci	"mainpll_d2_d2",
1618c2ecf20Sopenharmony_ci	"mainpll_d5"
1628c2ecf20Sopenharmony_ci};
1638c2ecf20Sopenharmony_ci
1648c2ecf20Sopenharmony_cistatic const char * const dpe_parents[] = {
1658c2ecf20Sopenharmony_ci	"clk26m",
1668c2ecf20Sopenharmony_ci	"mainpll_d2",
1678c2ecf20Sopenharmony_ci	"mmpll_d7",
1688c2ecf20Sopenharmony_ci	"univpll_d3",
1698c2ecf20Sopenharmony_ci	"mainpll_d3",
1708c2ecf20Sopenharmony_ci	"mmpll_d5_d2",
1718c2ecf20Sopenharmony_ci	"mainpll_d2_d2",
1728c2ecf20Sopenharmony_ci	"mainpll_d5"
1738c2ecf20Sopenharmony_ci};
1748c2ecf20Sopenharmony_ci
1758c2ecf20Sopenharmony_cistatic const char * const cam_parents[] = {
1768c2ecf20Sopenharmony_ci	"clk26m",
1778c2ecf20Sopenharmony_ci	"mainpll_d2",
1788c2ecf20Sopenharmony_ci	"mmpll_d6",
1798c2ecf20Sopenharmony_ci	"mainpll_d3",
1808c2ecf20Sopenharmony_ci	"mmpll_d7",
1818c2ecf20Sopenharmony_ci	"univpll_d3",
1828c2ecf20Sopenharmony_ci	"mmpll_d5_d2",
1838c2ecf20Sopenharmony_ci	"adsppll_d5",
1848c2ecf20Sopenharmony_ci	"tvdpll_mainpll_d2_ck",
1858c2ecf20Sopenharmony_ci	"univpll_d3_d2"
1868c2ecf20Sopenharmony_ci};
1878c2ecf20Sopenharmony_ci
1888c2ecf20Sopenharmony_cistatic const char * const ccu_parents[] = {
1898c2ecf20Sopenharmony_ci	"clk26m",
1908c2ecf20Sopenharmony_ci	"mainpll_d2",
1918c2ecf20Sopenharmony_ci	"mmpll_d6",
1928c2ecf20Sopenharmony_ci	"mainpll_d3",
1938c2ecf20Sopenharmony_ci	"mmpll_d7",
1948c2ecf20Sopenharmony_ci	"univpll_d3",
1958c2ecf20Sopenharmony_ci	"mmpll_d5_d2",
1968c2ecf20Sopenharmony_ci	"mainpll_d2_d2",
1978c2ecf20Sopenharmony_ci	"adsppll_d5",
1988c2ecf20Sopenharmony_ci	"univpll_d3_d2"
1998c2ecf20Sopenharmony_ci};
2008c2ecf20Sopenharmony_ci
2018c2ecf20Sopenharmony_cistatic const char * const dsp_parents[] = {
2028c2ecf20Sopenharmony_ci	"clk26m",
2038c2ecf20Sopenharmony_ci	"univpll_d3_d8",
2048c2ecf20Sopenharmony_ci	"univpll_d3_d4",
2058c2ecf20Sopenharmony_ci	"mainpll_d2_d4",
2068c2ecf20Sopenharmony_ci	"univpll_d3_d2",
2078c2ecf20Sopenharmony_ci	"mainpll_d2_d2",
2088c2ecf20Sopenharmony_ci	"univpll_d2_d2",
2098c2ecf20Sopenharmony_ci	"mainpll_d3",
2108c2ecf20Sopenharmony_ci	"univpll_d3",
2118c2ecf20Sopenharmony_ci	"mmpll_d7",
2128c2ecf20Sopenharmony_ci	"mmpll_d6",
2138c2ecf20Sopenharmony_ci	"adsppll_d5",
2148c2ecf20Sopenharmony_ci	"tvdpll_ck",
2158c2ecf20Sopenharmony_ci	"tvdpll_mainpll_d2_ck",
2168c2ecf20Sopenharmony_ci	"univpll_d2",
2178c2ecf20Sopenharmony_ci	"adsppll_d4"
2188c2ecf20Sopenharmony_ci};
2198c2ecf20Sopenharmony_ci
2208c2ecf20Sopenharmony_cistatic const char * const dsp1_parents[] = {
2218c2ecf20Sopenharmony_ci	"clk26m",
2228c2ecf20Sopenharmony_ci	"univpll_d3_d8",
2238c2ecf20Sopenharmony_ci	"univpll_d3_d4",
2248c2ecf20Sopenharmony_ci	"mainpll_d2_d4",
2258c2ecf20Sopenharmony_ci	"univpll_d3_d2",
2268c2ecf20Sopenharmony_ci	"mainpll_d2_d2",
2278c2ecf20Sopenharmony_ci	"univpll_d2_d2",
2288c2ecf20Sopenharmony_ci	"mainpll_d3",
2298c2ecf20Sopenharmony_ci	"univpll_d3",
2308c2ecf20Sopenharmony_ci	"mmpll_d7",
2318c2ecf20Sopenharmony_ci	"mmpll_d6",
2328c2ecf20Sopenharmony_ci	"adsppll_d5",
2338c2ecf20Sopenharmony_ci	"tvdpll_ck",
2348c2ecf20Sopenharmony_ci	"tvdpll_mainpll_d2_ck",
2358c2ecf20Sopenharmony_ci	"univpll_d2",
2368c2ecf20Sopenharmony_ci	"adsppll_d4"
2378c2ecf20Sopenharmony_ci};
2388c2ecf20Sopenharmony_ci
2398c2ecf20Sopenharmony_cistatic const char * const dsp2_parents[] = {
2408c2ecf20Sopenharmony_ci	"clk26m",
2418c2ecf20Sopenharmony_ci	"univpll_d3_d8",
2428c2ecf20Sopenharmony_ci	"univpll_d3_d4",
2438c2ecf20Sopenharmony_ci	"mainpll_d2_d4",
2448c2ecf20Sopenharmony_ci	"univpll_d3_d2",
2458c2ecf20Sopenharmony_ci	"mainpll_d2_d2",
2468c2ecf20Sopenharmony_ci	"univpll_d2_d2",
2478c2ecf20Sopenharmony_ci	"mainpll_d3",
2488c2ecf20Sopenharmony_ci	"univpll_d3",
2498c2ecf20Sopenharmony_ci	"mmpll_d7",
2508c2ecf20Sopenharmony_ci	"mmpll_d6",
2518c2ecf20Sopenharmony_ci	"adsppll_d5",
2528c2ecf20Sopenharmony_ci	"tvdpll_ck",
2538c2ecf20Sopenharmony_ci	"tvdpll_mainpll_d2_ck",
2548c2ecf20Sopenharmony_ci	"univpll_d2",
2558c2ecf20Sopenharmony_ci	"adsppll_d4"
2568c2ecf20Sopenharmony_ci};
2578c2ecf20Sopenharmony_ci
2588c2ecf20Sopenharmony_cistatic const char * const dsp3_parents[] = {
2598c2ecf20Sopenharmony_ci	"clk26m",
2608c2ecf20Sopenharmony_ci	"univpll_d3_d8",
2618c2ecf20Sopenharmony_ci	"mainpll_d2_d4",
2628c2ecf20Sopenharmony_ci	"univpll_d3_d2",
2638c2ecf20Sopenharmony_ci	"mainpll_d2_d2",
2648c2ecf20Sopenharmony_ci	"univpll_d2_d2",
2658c2ecf20Sopenharmony_ci	"mainpll_d3",
2668c2ecf20Sopenharmony_ci	"univpll_d3",
2678c2ecf20Sopenharmony_ci	"mmpll_d7",
2688c2ecf20Sopenharmony_ci	"mmpll_d6",
2698c2ecf20Sopenharmony_ci	"mainpll_d2",
2708c2ecf20Sopenharmony_ci	"tvdpll_ck",
2718c2ecf20Sopenharmony_ci	"tvdpll_mainpll_d2_ck",
2728c2ecf20Sopenharmony_ci	"univpll_d2",
2738c2ecf20Sopenharmony_ci	"adsppll_d4",
2748c2ecf20Sopenharmony_ci	"mmpll_d4"
2758c2ecf20Sopenharmony_ci};
2768c2ecf20Sopenharmony_ci
2778c2ecf20Sopenharmony_cistatic const char * const ipu_if_parents[] = {
2788c2ecf20Sopenharmony_ci	"clk26m",
2798c2ecf20Sopenharmony_ci	"univpll_d3_d8",
2808c2ecf20Sopenharmony_ci	"univpll_d3_d4",
2818c2ecf20Sopenharmony_ci	"mainpll_d2_d4",
2828c2ecf20Sopenharmony_ci	"univpll_d3_d2",
2838c2ecf20Sopenharmony_ci	"mainpll_d2_d2",
2848c2ecf20Sopenharmony_ci	"univpll_d2_d2",
2858c2ecf20Sopenharmony_ci	"mainpll_d3",
2868c2ecf20Sopenharmony_ci	"univpll_d3",
2878c2ecf20Sopenharmony_ci	"mmpll_d7",
2888c2ecf20Sopenharmony_ci	"mmpll_d6",
2898c2ecf20Sopenharmony_ci	"adsppll_d5",
2908c2ecf20Sopenharmony_ci	"tvdpll_ck",
2918c2ecf20Sopenharmony_ci	"tvdpll_mainpll_d2_ck",
2928c2ecf20Sopenharmony_ci	"univpll_d2",
2938c2ecf20Sopenharmony_ci	"adsppll_d4"
2948c2ecf20Sopenharmony_ci};
2958c2ecf20Sopenharmony_ci
2968c2ecf20Sopenharmony_cistatic const char * const mfg_parents[] = {
2978c2ecf20Sopenharmony_ci	"clk26m",
2988c2ecf20Sopenharmony_ci	"mfgpll_ck",
2998c2ecf20Sopenharmony_ci	"univpll_d3",
3008c2ecf20Sopenharmony_ci	"mainpll_d5"
3018c2ecf20Sopenharmony_ci};
3028c2ecf20Sopenharmony_ci
3038c2ecf20Sopenharmony_cistatic const char * const f52m_mfg_parents[] = {
3048c2ecf20Sopenharmony_ci	"clk26m",
3058c2ecf20Sopenharmony_ci	"univpll_d3_d2",
3068c2ecf20Sopenharmony_ci	"univpll_d3_d4",
3078c2ecf20Sopenharmony_ci	"univpll_d3_d8"
3088c2ecf20Sopenharmony_ci};
3098c2ecf20Sopenharmony_ci
3108c2ecf20Sopenharmony_cistatic const char * const camtg_parents[] = {
3118c2ecf20Sopenharmony_ci	"clk26m",
3128c2ecf20Sopenharmony_ci	"univpll_192m_d8",
3138c2ecf20Sopenharmony_ci	"univpll_d3_d8",
3148c2ecf20Sopenharmony_ci	"univpll_192m_d4",
3158c2ecf20Sopenharmony_ci	"univpll_d3_d16",
3168c2ecf20Sopenharmony_ci	"csw_f26m_ck_d2",
3178c2ecf20Sopenharmony_ci	"univpll_192m_d16",
3188c2ecf20Sopenharmony_ci	"univpll_192m_d32"
3198c2ecf20Sopenharmony_ci};
3208c2ecf20Sopenharmony_ci
3218c2ecf20Sopenharmony_cistatic const char * const camtg2_parents[] = {
3228c2ecf20Sopenharmony_ci	"clk26m",
3238c2ecf20Sopenharmony_ci	"univpll_192m_d8",
3248c2ecf20Sopenharmony_ci	"univpll_d3_d8",
3258c2ecf20Sopenharmony_ci	"univpll_192m_d4",
3268c2ecf20Sopenharmony_ci	"univpll_d3_d16",
3278c2ecf20Sopenharmony_ci	"csw_f26m_ck_d2",
3288c2ecf20Sopenharmony_ci	"univpll_192m_d16",
3298c2ecf20Sopenharmony_ci	"univpll_192m_d32"
3308c2ecf20Sopenharmony_ci};
3318c2ecf20Sopenharmony_ci
3328c2ecf20Sopenharmony_cistatic const char * const camtg3_parents[] = {
3338c2ecf20Sopenharmony_ci	"clk26m",
3348c2ecf20Sopenharmony_ci	"univpll_192m_d8",
3358c2ecf20Sopenharmony_ci	"univpll_d3_d8",
3368c2ecf20Sopenharmony_ci	"univpll_192m_d4",
3378c2ecf20Sopenharmony_ci	"univpll_d3_d16",
3388c2ecf20Sopenharmony_ci	"csw_f26m_ck_d2",
3398c2ecf20Sopenharmony_ci	"univpll_192m_d16",
3408c2ecf20Sopenharmony_ci	"univpll_192m_d32"
3418c2ecf20Sopenharmony_ci};
3428c2ecf20Sopenharmony_ci
3438c2ecf20Sopenharmony_cistatic const char * const camtg4_parents[] = {
3448c2ecf20Sopenharmony_ci	"clk26m",
3458c2ecf20Sopenharmony_ci	"univpll_192m_d8",
3468c2ecf20Sopenharmony_ci	"univpll_d3_d8",
3478c2ecf20Sopenharmony_ci	"univpll_192m_d4",
3488c2ecf20Sopenharmony_ci	"univpll_d3_d16",
3498c2ecf20Sopenharmony_ci	"csw_f26m_ck_d2",
3508c2ecf20Sopenharmony_ci	"univpll_192m_d16",
3518c2ecf20Sopenharmony_ci	"univpll_192m_d32"
3528c2ecf20Sopenharmony_ci};
3538c2ecf20Sopenharmony_ci
3548c2ecf20Sopenharmony_cistatic const char * const uart_parents[] = {
3558c2ecf20Sopenharmony_ci	"clk26m",
3568c2ecf20Sopenharmony_ci	"univpll_d3_d8"
3578c2ecf20Sopenharmony_ci};
3588c2ecf20Sopenharmony_ci
3598c2ecf20Sopenharmony_cistatic const char * const spi_parents[] = {
3608c2ecf20Sopenharmony_ci	"clk26m",
3618c2ecf20Sopenharmony_ci	"mainpll_d5_d2",
3628c2ecf20Sopenharmony_ci	"mainpll_d3_d4",
3638c2ecf20Sopenharmony_ci	"msdcpll_d4"
3648c2ecf20Sopenharmony_ci};
3658c2ecf20Sopenharmony_ci
3668c2ecf20Sopenharmony_cistatic const char * const msdc50_hclk_parents[] = {
3678c2ecf20Sopenharmony_ci	"clk26m",
3688c2ecf20Sopenharmony_ci	"mainpll_d2_d2",
3698c2ecf20Sopenharmony_ci	"mainpll_d3_d2"
3708c2ecf20Sopenharmony_ci};
3718c2ecf20Sopenharmony_ci
3728c2ecf20Sopenharmony_cistatic const char * const msdc50_0_parents[] = {
3738c2ecf20Sopenharmony_ci	"clk26m",
3748c2ecf20Sopenharmony_ci	"msdcpll_ck",
3758c2ecf20Sopenharmony_ci	"msdcpll_d2",
3768c2ecf20Sopenharmony_ci	"univpll_d2_d4",
3778c2ecf20Sopenharmony_ci	"mainpll_d3_d2",
3788c2ecf20Sopenharmony_ci	"univpll_d2_d2"
3798c2ecf20Sopenharmony_ci};
3808c2ecf20Sopenharmony_ci
3818c2ecf20Sopenharmony_cistatic const char * const msdc30_1_parents[] = {
3828c2ecf20Sopenharmony_ci	"clk26m",
3838c2ecf20Sopenharmony_ci	"univpll_d3_d2",
3848c2ecf20Sopenharmony_ci	"mainpll_d3_d2",
3858c2ecf20Sopenharmony_ci	"mainpll_d7",
3868c2ecf20Sopenharmony_ci	"msdcpll_d2"
3878c2ecf20Sopenharmony_ci};
3888c2ecf20Sopenharmony_ci
3898c2ecf20Sopenharmony_cistatic const char * const audio_parents[] = {
3908c2ecf20Sopenharmony_ci	"clk26m",
3918c2ecf20Sopenharmony_ci	"mainpll_d5_d4",
3928c2ecf20Sopenharmony_ci	"mainpll_d7_d4",
3938c2ecf20Sopenharmony_ci	"mainpll_d2_d16"
3948c2ecf20Sopenharmony_ci};
3958c2ecf20Sopenharmony_ci
3968c2ecf20Sopenharmony_cistatic const char * const aud_intbus_parents[] = {
3978c2ecf20Sopenharmony_ci	"clk26m",
3988c2ecf20Sopenharmony_ci	"mainpll_d2_d4",
3998c2ecf20Sopenharmony_ci	"mainpll_d7_d2"
4008c2ecf20Sopenharmony_ci};
4018c2ecf20Sopenharmony_ci
4028c2ecf20Sopenharmony_cistatic const char * const fpwrap_ulposc_parents[] = {
4038c2ecf20Sopenharmony_ci	"osc_d10",
4048c2ecf20Sopenharmony_ci	"clk26m",
4058c2ecf20Sopenharmony_ci	"osc_d4",
4068c2ecf20Sopenharmony_ci	"osc_d8",
4078c2ecf20Sopenharmony_ci	"osc_d16"
4088c2ecf20Sopenharmony_ci};
4098c2ecf20Sopenharmony_ci
4108c2ecf20Sopenharmony_cistatic const char * const atb_parents[] = {
4118c2ecf20Sopenharmony_ci	"clk26m",
4128c2ecf20Sopenharmony_ci	"mainpll_d2_d2",
4138c2ecf20Sopenharmony_ci	"mainpll_d5"
4148c2ecf20Sopenharmony_ci};
4158c2ecf20Sopenharmony_ci
4168c2ecf20Sopenharmony_cistatic const char * const sspm_parents[] = {
4178c2ecf20Sopenharmony_ci	"clk26m",
4188c2ecf20Sopenharmony_ci	"univpll_d2_d4",
4198c2ecf20Sopenharmony_ci	"mainpll_d2_d2",
4208c2ecf20Sopenharmony_ci	"univpll_d2_d2",
4218c2ecf20Sopenharmony_ci	"mainpll_d3"
4228c2ecf20Sopenharmony_ci};
4238c2ecf20Sopenharmony_ci
4248c2ecf20Sopenharmony_cistatic const char * const dpi0_parents[] = {
4258c2ecf20Sopenharmony_ci	"clk26m",
4268c2ecf20Sopenharmony_ci	"tvdpll_d2",
4278c2ecf20Sopenharmony_ci	"tvdpll_d4",
4288c2ecf20Sopenharmony_ci	"tvdpll_d8",
4298c2ecf20Sopenharmony_ci	"tvdpll_d16"
4308c2ecf20Sopenharmony_ci};
4318c2ecf20Sopenharmony_ci
4328c2ecf20Sopenharmony_cistatic const char * const scam_parents[] = {
4338c2ecf20Sopenharmony_ci	"clk26m",
4348c2ecf20Sopenharmony_ci	"mainpll_d5_d2"
4358c2ecf20Sopenharmony_ci};
4368c2ecf20Sopenharmony_ci
4378c2ecf20Sopenharmony_cistatic const char * const disppwm_parents[] = {
4388c2ecf20Sopenharmony_ci	"clk26m",
4398c2ecf20Sopenharmony_ci	"univpll_d3_d4",
4408c2ecf20Sopenharmony_ci	"osc_d2",
4418c2ecf20Sopenharmony_ci	"osc_d4",
4428c2ecf20Sopenharmony_ci	"osc_d16"
4438c2ecf20Sopenharmony_ci};
4448c2ecf20Sopenharmony_ci
4458c2ecf20Sopenharmony_cistatic const char * const usb_top_parents[] = {
4468c2ecf20Sopenharmony_ci	"clk26m",
4478c2ecf20Sopenharmony_ci	"univpll_d5_d4",
4488c2ecf20Sopenharmony_ci	"univpll_d3_d4",
4498c2ecf20Sopenharmony_ci	"univpll_d5_d2"
4508c2ecf20Sopenharmony_ci};
4518c2ecf20Sopenharmony_ci
4528c2ecf20Sopenharmony_cistatic const char * const ssusb_top_xhci_parents[] = {
4538c2ecf20Sopenharmony_ci	"clk26m",
4548c2ecf20Sopenharmony_ci	"univpll_d5_d4",
4558c2ecf20Sopenharmony_ci	"univpll_d3_d4",
4568c2ecf20Sopenharmony_ci	"univpll_d5_d2"
4578c2ecf20Sopenharmony_ci};
4588c2ecf20Sopenharmony_ci
4598c2ecf20Sopenharmony_cistatic const char * const spm_parents[] = {
4608c2ecf20Sopenharmony_ci	"clk26m",
4618c2ecf20Sopenharmony_ci	"osc_d8",
4628c2ecf20Sopenharmony_ci	"mainpll_d2_d8"
4638c2ecf20Sopenharmony_ci};
4648c2ecf20Sopenharmony_ci
4658c2ecf20Sopenharmony_cistatic const char * const i2c_parents[] = {
4668c2ecf20Sopenharmony_ci	"clk26m",
4678c2ecf20Sopenharmony_ci	"mainpll_d2_d8",
4688c2ecf20Sopenharmony_ci	"univpll_d5_d2"
4698c2ecf20Sopenharmony_ci};
4708c2ecf20Sopenharmony_ci
4718c2ecf20Sopenharmony_cistatic const char * const seninf_parents[] = {
4728c2ecf20Sopenharmony_ci	"clk26m",
4738c2ecf20Sopenharmony_ci	"univpll_d7",
4748c2ecf20Sopenharmony_ci	"univpll_d3_d2",
4758c2ecf20Sopenharmony_ci	"univpll_d2_d2",
4768c2ecf20Sopenharmony_ci	"mainpll_d3",
4778c2ecf20Sopenharmony_ci	"mmpll_d4_d2",
4788c2ecf20Sopenharmony_ci	"mmpll_d7",
4798c2ecf20Sopenharmony_ci	"mmpll_d6"
4808c2ecf20Sopenharmony_ci};
4818c2ecf20Sopenharmony_ci
4828c2ecf20Sopenharmony_cistatic const char * const seninf1_parents[] = {
4838c2ecf20Sopenharmony_ci	"clk26m",
4848c2ecf20Sopenharmony_ci	"univpll_d7",
4858c2ecf20Sopenharmony_ci	"univpll_d3_d2",
4868c2ecf20Sopenharmony_ci	"univpll_d2_d2",
4878c2ecf20Sopenharmony_ci	"mainpll_d3",
4888c2ecf20Sopenharmony_ci	"mmpll_d4_d2",
4898c2ecf20Sopenharmony_ci	"mmpll_d7",
4908c2ecf20Sopenharmony_ci	"mmpll_d6"
4918c2ecf20Sopenharmony_ci};
4928c2ecf20Sopenharmony_ci
4938c2ecf20Sopenharmony_cistatic const char * const seninf2_parents[] = {
4948c2ecf20Sopenharmony_ci	"clk26m",
4958c2ecf20Sopenharmony_ci	"univpll_d7",
4968c2ecf20Sopenharmony_ci	"univpll_d3_d2",
4978c2ecf20Sopenharmony_ci	"univpll_d2_d2",
4988c2ecf20Sopenharmony_ci	"mainpll_d3",
4998c2ecf20Sopenharmony_ci	"mmpll_d4_d2",
5008c2ecf20Sopenharmony_ci	"mmpll_d7",
5018c2ecf20Sopenharmony_ci	"mmpll_d6"
5028c2ecf20Sopenharmony_ci};
5038c2ecf20Sopenharmony_ci
5048c2ecf20Sopenharmony_cistatic const char * const dxcc_parents[] = {
5058c2ecf20Sopenharmony_ci	"clk26m",
5068c2ecf20Sopenharmony_ci	"mainpll_d2_d2",
5078c2ecf20Sopenharmony_ci	"mainpll_d2_d4",
5088c2ecf20Sopenharmony_ci	"mainpll_d2_d8"
5098c2ecf20Sopenharmony_ci};
5108c2ecf20Sopenharmony_ci
5118c2ecf20Sopenharmony_cistatic const char * const aud_engen1_parents[] = {
5128c2ecf20Sopenharmony_ci	"clk26m",
5138c2ecf20Sopenharmony_ci	"apll1_d2",
5148c2ecf20Sopenharmony_ci	"apll1_d4",
5158c2ecf20Sopenharmony_ci	"apll1_d8"
5168c2ecf20Sopenharmony_ci};
5178c2ecf20Sopenharmony_ci
5188c2ecf20Sopenharmony_cistatic const char * const aud_engen2_parents[] = {
5198c2ecf20Sopenharmony_ci	"clk26m",
5208c2ecf20Sopenharmony_ci	"apll2_d2",
5218c2ecf20Sopenharmony_ci	"apll2_d4",
5228c2ecf20Sopenharmony_ci	"apll2_d8"
5238c2ecf20Sopenharmony_ci};
5248c2ecf20Sopenharmony_ci
5258c2ecf20Sopenharmony_cistatic const char * const faes_ufsfde_parents[] = {
5268c2ecf20Sopenharmony_ci	"clk26m",
5278c2ecf20Sopenharmony_ci	"mainpll_d2",
5288c2ecf20Sopenharmony_ci	"mainpll_d2_d2",
5298c2ecf20Sopenharmony_ci	"mainpll_d3",
5308c2ecf20Sopenharmony_ci	"mainpll_d2_d4",
5318c2ecf20Sopenharmony_ci	"univpll_d3"
5328c2ecf20Sopenharmony_ci};
5338c2ecf20Sopenharmony_ci
5348c2ecf20Sopenharmony_cistatic const char * const fufs_parents[] = {
5358c2ecf20Sopenharmony_ci	"clk26m",
5368c2ecf20Sopenharmony_ci	"mainpll_d2_d4",
5378c2ecf20Sopenharmony_ci	"mainpll_d2_d8",
5388c2ecf20Sopenharmony_ci	"mainpll_d2_d16"
5398c2ecf20Sopenharmony_ci};
5408c2ecf20Sopenharmony_ci
5418c2ecf20Sopenharmony_cistatic const char * const aud_1_parents[] = {
5428c2ecf20Sopenharmony_ci	"clk26m",
5438c2ecf20Sopenharmony_ci	"apll1_ck"
5448c2ecf20Sopenharmony_ci};
5458c2ecf20Sopenharmony_ci
5468c2ecf20Sopenharmony_cistatic const char * const aud_2_parents[] = {
5478c2ecf20Sopenharmony_ci	"clk26m",
5488c2ecf20Sopenharmony_ci	"apll2_ck"
5498c2ecf20Sopenharmony_ci};
5508c2ecf20Sopenharmony_ci
5518c2ecf20Sopenharmony_cistatic const char * const adsp_parents[] = {
5528c2ecf20Sopenharmony_ci	"clk26m",
5538c2ecf20Sopenharmony_ci	"mainpll_d3",
5548c2ecf20Sopenharmony_ci	"univpll_d2_d4",
5558c2ecf20Sopenharmony_ci	"univpll_d2",
5568c2ecf20Sopenharmony_ci	"mmpll_d4",
5578c2ecf20Sopenharmony_ci	"adsppll_d4",
5588c2ecf20Sopenharmony_ci	"adsppll_d6"
5598c2ecf20Sopenharmony_ci};
5608c2ecf20Sopenharmony_ci
5618c2ecf20Sopenharmony_cistatic const char * const dpmaif_parents[] = {
5628c2ecf20Sopenharmony_ci	"clk26m",
5638c2ecf20Sopenharmony_ci	"univpll_d2_d4",
5648c2ecf20Sopenharmony_ci	"mainpll_d3",
5658c2ecf20Sopenharmony_ci	"mainpll_d2_d2",
5668c2ecf20Sopenharmony_ci	"univpll_d2_d2",
5678c2ecf20Sopenharmony_ci	"univpll_d3"
5688c2ecf20Sopenharmony_ci};
5698c2ecf20Sopenharmony_ci
5708c2ecf20Sopenharmony_cistatic const char * const venc_parents[] = {
5718c2ecf20Sopenharmony_ci	"clk26m",
5728c2ecf20Sopenharmony_ci	"mmpll_d7",
5738c2ecf20Sopenharmony_ci	"mainpll_d3",
5748c2ecf20Sopenharmony_ci	"univpll_d2_d2",
5758c2ecf20Sopenharmony_ci	"mainpll_d2_d2",
5768c2ecf20Sopenharmony_ci	"univpll_d3",
5778c2ecf20Sopenharmony_ci	"mmpll_d6",
5788c2ecf20Sopenharmony_ci	"mainpll_d5",
5798c2ecf20Sopenharmony_ci	"mainpll_d3_d2",
5808c2ecf20Sopenharmony_ci	"mmpll_d4_d2",
5818c2ecf20Sopenharmony_ci	"univpll_d2_d4",
5828c2ecf20Sopenharmony_ci	"mmpll_d5",
5838c2ecf20Sopenharmony_ci	"univpll_192m_d2"
5848c2ecf20Sopenharmony_ci
5858c2ecf20Sopenharmony_ci};
5868c2ecf20Sopenharmony_ci
5878c2ecf20Sopenharmony_cistatic const char * const vdec_parents[] = {
5888c2ecf20Sopenharmony_ci	"clk26m",
5898c2ecf20Sopenharmony_ci	"univpll_d2_d4",
5908c2ecf20Sopenharmony_ci	"mainpll_d3",
5918c2ecf20Sopenharmony_ci	"univpll_d2_d2",
5928c2ecf20Sopenharmony_ci	"mainpll_d2_d2",
5938c2ecf20Sopenharmony_ci	"univpll_d3",
5948c2ecf20Sopenharmony_ci	"univpll_d5",
5958c2ecf20Sopenharmony_ci	"univpll_d5_d2",
5968c2ecf20Sopenharmony_ci	"mainpll_d2",
5978c2ecf20Sopenharmony_ci	"univpll_d2",
5988c2ecf20Sopenharmony_ci	"univpll_192m_d2"
5998c2ecf20Sopenharmony_ci};
6008c2ecf20Sopenharmony_ci
6018c2ecf20Sopenharmony_cistatic const char * const camtm_parents[] = {
6028c2ecf20Sopenharmony_ci	"clk26m",
6038c2ecf20Sopenharmony_ci	"univpll_d7",
6048c2ecf20Sopenharmony_ci	"univpll_d3_d2",
6058c2ecf20Sopenharmony_ci	"univpll_d2_d2"
6068c2ecf20Sopenharmony_ci};
6078c2ecf20Sopenharmony_ci
6088c2ecf20Sopenharmony_cistatic const char * const pwm_parents[] = {
6098c2ecf20Sopenharmony_ci	"clk26m",
6108c2ecf20Sopenharmony_ci	"univpll_d2_d8"
6118c2ecf20Sopenharmony_ci};
6128c2ecf20Sopenharmony_ci
6138c2ecf20Sopenharmony_cistatic const char * const audio_h_parents[] = {
6148c2ecf20Sopenharmony_ci	"clk26m",
6158c2ecf20Sopenharmony_ci	"univpll_d7",
6168c2ecf20Sopenharmony_ci	"apll1_ck",
6178c2ecf20Sopenharmony_ci	"apll2_ck"
6188c2ecf20Sopenharmony_ci};
6198c2ecf20Sopenharmony_ci
6208c2ecf20Sopenharmony_cistatic const char * const camtg5_parents[] = {
6218c2ecf20Sopenharmony_ci	"clk26m",
6228c2ecf20Sopenharmony_ci	"univpll_192m_d8",
6238c2ecf20Sopenharmony_ci	"univpll_d3_d8",
6248c2ecf20Sopenharmony_ci	"univpll_192m_d4",
6258c2ecf20Sopenharmony_ci	"univpll_d3_d16",
6268c2ecf20Sopenharmony_ci	"csw_f26m_ck_d2",
6278c2ecf20Sopenharmony_ci	"univpll_192m_d16",
6288c2ecf20Sopenharmony_ci	"univpll_192m_d32"
6298c2ecf20Sopenharmony_ci};
6308c2ecf20Sopenharmony_ci
6318c2ecf20Sopenharmony_ci/*
6328c2ecf20Sopenharmony_ci * CRITICAL CLOCK:
6338c2ecf20Sopenharmony_ci * axi_sel is the main bus clock of whole SOC.
6348c2ecf20Sopenharmony_ci * spm_sel is the clock of the always-on co-processor.
6358c2ecf20Sopenharmony_ci * sspm_sel is the clock of the always-on co-processor.
6368c2ecf20Sopenharmony_ci */
6378c2ecf20Sopenharmony_cistatic const struct mtk_mux top_muxes[] = {
6388c2ecf20Sopenharmony_ci	/* CLK_CFG_0 */
6398c2ecf20Sopenharmony_ci	MUX_GATE_CLR_SET_UPD_FLAGS(CLK_TOP_AXI, "axi_sel", axi_parents,
6408c2ecf20Sopenharmony_ci				   0x20, 0x24, 0x28, 0, 2, 7,
6418c2ecf20Sopenharmony_ci				   0x004, 0, CLK_IS_CRITICAL),
6428c2ecf20Sopenharmony_ci	MUX_GATE_CLR_SET_UPD(CLK_TOP_MM, "mm_sel", mm_parents,
6438c2ecf20Sopenharmony_ci			     0x20, 0x24, 0x28, 8, 3, 15, 0x004, 1),
6448c2ecf20Sopenharmony_ci	MUX_GATE_CLR_SET_UPD(CLK_TOP_SCP, "scp_sel", scp_parents,
6458c2ecf20Sopenharmony_ci			     0x20, 0x24, 0x28, 16, 3, 23, 0x004, 2),
6468c2ecf20Sopenharmony_ci	/* CLK_CFG_1 */
6478c2ecf20Sopenharmony_ci	MUX_GATE_CLR_SET_UPD(CLK_TOP_IMG, "img_sel", img_parents,
6488c2ecf20Sopenharmony_ci			     0x30, 0x34, 0x38, 0, 3, 7, 0x004, 4),
6498c2ecf20Sopenharmony_ci	MUX_GATE_CLR_SET_UPD(CLK_TOP_IPE, "ipe_sel", ipe_parents,
6508c2ecf20Sopenharmony_ci			     0x30, 0x34, 0x38, 8, 3, 15, 0x004, 5),
6518c2ecf20Sopenharmony_ci	MUX_GATE_CLR_SET_UPD(CLK_TOP_DPE, "dpe_sel", dpe_parents,
6528c2ecf20Sopenharmony_ci			     0x30, 0x34, 0x38, 16, 3, 23, 0x004, 6),
6538c2ecf20Sopenharmony_ci	MUX_GATE_CLR_SET_UPD(CLK_TOP_CAM, "cam_sel", cam_parents,
6548c2ecf20Sopenharmony_ci			     0x30, 0x34, 0x38, 24, 4, 31, 0x004, 7),
6558c2ecf20Sopenharmony_ci	/* CLK_CFG_2 */
6568c2ecf20Sopenharmony_ci	MUX_GATE_CLR_SET_UPD(CLK_TOP_CCU, "ccu_sel", ccu_parents,
6578c2ecf20Sopenharmony_ci			     0x40, 0x44, 0x48, 0, 4, 7, 0x004, 8),
6588c2ecf20Sopenharmony_ci	MUX_GATE_CLR_SET_UPD(CLK_TOP_DSP, "dsp_sel", dsp_parents,
6598c2ecf20Sopenharmony_ci			     0x40, 0x44, 0x48, 8, 4, 15, 0x004, 9),
6608c2ecf20Sopenharmony_ci	MUX_GATE_CLR_SET_UPD(CLK_TOP_DSP1, "dsp1_sel", dsp1_parents,
6618c2ecf20Sopenharmony_ci			     0x40, 0x44, 0x48, 16, 4, 23, 0x004, 10),
6628c2ecf20Sopenharmony_ci	MUX_GATE_CLR_SET_UPD(CLK_TOP_DSP2, "dsp2_sel", dsp2_parents,
6638c2ecf20Sopenharmony_ci			     0x40, 0x44, 0x48, 24, 4, 31, 0x004, 11),
6648c2ecf20Sopenharmony_ci	/* CLK_CFG_3 */
6658c2ecf20Sopenharmony_ci	MUX_GATE_CLR_SET_UPD(CLK_TOP_DSP3, "dsp3_sel", dsp3_parents,
6668c2ecf20Sopenharmony_ci			     0x50, 0x54, 0x58, 0, 4, 7, 0x004, 12),
6678c2ecf20Sopenharmony_ci	MUX_GATE_CLR_SET_UPD(CLK_TOP_IPU_IF, "ipu_if_sel", ipu_if_parents,
6688c2ecf20Sopenharmony_ci			     0x50, 0x54, 0x58, 8, 4, 15, 0x004, 13),
6698c2ecf20Sopenharmony_ci	MUX_GATE_CLR_SET_UPD(CLK_TOP_MFG, "mfg_sel", mfg_parents,
6708c2ecf20Sopenharmony_ci			     0x50, 0x54, 0x58, 16, 2, 23, 0x004, 14),
6718c2ecf20Sopenharmony_ci	MUX_GATE_CLR_SET_UPD(CLK_TOP_F52M_MFG, "f52m_mfg_sel",
6728c2ecf20Sopenharmony_ci			     f52m_mfg_parents, 0x50, 0x54, 0x58,
6738c2ecf20Sopenharmony_ci			     24, 2, 31, 0x004, 15),
6748c2ecf20Sopenharmony_ci	/* CLK_CFG_4 */
6758c2ecf20Sopenharmony_ci	MUX_GATE_CLR_SET_UPD(CLK_TOP_CAMTG, "camtg_sel", camtg_parents,
6768c2ecf20Sopenharmony_ci			     0x60, 0x64, 0x68, 0, 3, 7, 0x004, 16),
6778c2ecf20Sopenharmony_ci	MUX_GATE_CLR_SET_UPD(CLK_TOP_CAMTG2, "camtg2_sel", camtg2_parents,
6788c2ecf20Sopenharmony_ci			     0x60, 0x64, 0x68, 8, 3, 15, 0x004, 17),
6798c2ecf20Sopenharmony_ci	MUX_GATE_CLR_SET_UPD(CLK_TOP_CAMTG3, "camtg3_sel", camtg3_parents,
6808c2ecf20Sopenharmony_ci			     0x60, 0x64, 0x68, 16, 3, 23, 0x004, 18),
6818c2ecf20Sopenharmony_ci	MUX_GATE_CLR_SET_UPD(CLK_TOP_CAMTG4, "camtg4_sel", camtg4_parents,
6828c2ecf20Sopenharmony_ci			     0x60, 0x64, 0x68, 24, 3, 31, 0x004, 19),
6838c2ecf20Sopenharmony_ci	/* CLK_CFG_5 */
6848c2ecf20Sopenharmony_ci	MUX_GATE_CLR_SET_UPD(CLK_TOP_UART, "uart_sel", uart_parents,
6858c2ecf20Sopenharmony_ci			     0x70, 0x74, 0x78, 0, 1, 7, 0x004, 20),
6868c2ecf20Sopenharmony_ci	MUX_GATE_CLR_SET_UPD(CLK_TOP_SPI, "spi_sel", spi_parents,
6878c2ecf20Sopenharmony_ci			     0x70, 0x74, 0x78, 8, 2, 15, 0x004, 21),
6888c2ecf20Sopenharmony_ci	MUX_GATE_CLR_SET_UPD(CLK_TOP_MSDC50_0_HCLK, "msdc50_hclk_sel",
6898c2ecf20Sopenharmony_ci			     msdc50_hclk_parents, 0x70, 0x74, 0x78,
6908c2ecf20Sopenharmony_ci			     16, 2, 23, 0x004, 22),
6918c2ecf20Sopenharmony_ci	MUX_GATE_CLR_SET_UPD(CLK_TOP_MSDC50_0, "msdc50_0_sel",
6928c2ecf20Sopenharmony_ci			     msdc50_0_parents, 0x70, 0x74, 0x78,
6938c2ecf20Sopenharmony_ci			     24, 3, 31, 0x004, 23),
6948c2ecf20Sopenharmony_ci	/* CLK_CFG_6 */
6958c2ecf20Sopenharmony_ci	MUX_GATE_CLR_SET_UPD(CLK_TOP_MSDC30_1, "msdc30_1_sel",
6968c2ecf20Sopenharmony_ci			     msdc30_1_parents, 0x80, 0x84, 0x88,
6978c2ecf20Sopenharmony_ci			     0, 3, 7, 0x004, 24),
6988c2ecf20Sopenharmony_ci	MUX_GATE_CLR_SET_UPD(CLK_TOP_AUD, "audio_sel", audio_parents,
6998c2ecf20Sopenharmony_ci			     0x80, 0x84, 0x88, 8, 2, 15, 0x004, 25),
7008c2ecf20Sopenharmony_ci	MUX_GATE_CLR_SET_UPD(CLK_TOP_AUD_INTBUS, "aud_intbus_sel",
7018c2ecf20Sopenharmony_ci			     aud_intbus_parents, 0x80, 0x84, 0x88,
7028c2ecf20Sopenharmony_ci			     16, 2, 23, 0x004, 26),
7038c2ecf20Sopenharmony_ci	MUX_GATE_CLR_SET_UPD(CLK_TOP_FPWRAP_ULPOSC, "fpwrap_ulposc_sel",
7048c2ecf20Sopenharmony_ci			     fpwrap_ulposc_parents, 0x80, 0x84, 0x88,
7058c2ecf20Sopenharmony_ci			     24, 3, 31, 0x004, 27),
7068c2ecf20Sopenharmony_ci	/* CLK_CFG_7 */
7078c2ecf20Sopenharmony_ci	MUX_GATE_CLR_SET_UPD(CLK_TOP_ATB, "atb_sel", atb_parents,
7088c2ecf20Sopenharmony_ci			     0x90, 0x94, 0x98, 0, 2, 7, 0x004, 28),
7098c2ecf20Sopenharmony_ci	MUX_GATE_CLR_SET_UPD_FLAGS(CLK_TOP_SSPM, "sspm_sel", sspm_parents,
7108c2ecf20Sopenharmony_ci				   0x90, 0x94, 0x98, 8, 3, 15,
7118c2ecf20Sopenharmony_ci				   0x004, 29, CLK_IS_CRITICAL),
7128c2ecf20Sopenharmony_ci	MUX_GATE_CLR_SET_UPD(CLK_TOP_DPI0, "dpi0_sel", dpi0_parents,
7138c2ecf20Sopenharmony_ci			     0x90, 0x94, 0x98, 16, 3, 23, 0x004, 30),
7148c2ecf20Sopenharmony_ci	MUX_GATE_CLR_SET_UPD(CLK_TOP_SCAM, "scam_sel", scam_parents,
7158c2ecf20Sopenharmony_ci			     0x90, 0x94, 0x98, 24, 1, 31, 0x004, 0),
7168c2ecf20Sopenharmony_ci	/* CLK_CFG_8 */
7178c2ecf20Sopenharmony_ci	MUX_GATE_CLR_SET_UPD(CLK_TOP_DISP_PWM, "disppwm_sel",
7188c2ecf20Sopenharmony_ci			     disppwm_parents, 0xa0, 0xa4, 0xa8,
7198c2ecf20Sopenharmony_ci			     0, 3, 7, 0x008, 1),
7208c2ecf20Sopenharmony_ci	MUX_GATE_CLR_SET_UPD(CLK_TOP_USB_TOP, "usb_top_sel",
7218c2ecf20Sopenharmony_ci			     usb_top_parents, 0xa0, 0xa4, 0xa8,
7228c2ecf20Sopenharmony_ci			     8, 2, 15, 0x008, 2),
7238c2ecf20Sopenharmony_ci	MUX_GATE_CLR_SET_UPD(CLK_TOP_SSUSB_TOP_XHCI, "ssusb_top_xhci_sel",
7248c2ecf20Sopenharmony_ci			     ssusb_top_xhci_parents, 0xa0, 0xa4, 0xa8,
7258c2ecf20Sopenharmony_ci			     16, 2, 23, 0x008, 3),
7268c2ecf20Sopenharmony_ci	MUX_GATE_CLR_SET_UPD_FLAGS(CLK_TOP_SPM, "spm_sel", spm_parents,
7278c2ecf20Sopenharmony_ci				   0xa0, 0xa4, 0xa8, 24, 2, 31,
7288c2ecf20Sopenharmony_ci				   0x008, 4, CLK_IS_CRITICAL),
7298c2ecf20Sopenharmony_ci	/* CLK_CFG_9 */
7308c2ecf20Sopenharmony_ci	MUX_GATE_CLR_SET_UPD(CLK_TOP_I2C, "i2c_sel", i2c_parents,
7318c2ecf20Sopenharmony_ci			     0xb0, 0xb4, 0xb8, 0, 2, 7, 0x008, 5),
7328c2ecf20Sopenharmony_ci	MUX_GATE_CLR_SET_UPD(CLK_TOP_SENINF, "seninf_sel", seninf_parents,
7338c2ecf20Sopenharmony_ci			     0xb0, 0xb4, 0xb8, 8, 2, 15, 0x008, 6),
7348c2ecf20Sopenharmony_ci	MUX_GATE_CLR_SET_UPD(CLK_TOP_SENINF1, "seninf1_sel",
7358c2ecf20Sopenharmony_ci			     seninf1_parents, 0xb0, 0xb4, 0xb8,
7368c2ecf20Sopenharmony_ci			     16, 2, 23, 0x008, 7),
7378c2ecf20Sopenharmony_ci	MUX_GATE_CLR_SET_UPD(CLK_TOP_SENINF2, "seninf2_sel",
7388c2ecf20Sopenharmony_ci			     seninf2_parents, 0xb0, 0xb4, 0xb8,
7398c2ecf20Sopenharmony_ci			     24, 2, 31, 0x008, 8),
7408c2ecf20Sopenharmony_ci	/* CLK_CFG_10 */
7418c2ecf20Sopenharmony_ci	MUX_GATE_CLR_SET_UPD(CLK_TOP_DXCC, "dxcc_sel", dxcc_parents,
7428c2ecf20Sopenharmony_ci			     0xc0, 0xc4, 0xc8, 0, 2, 7, 0x008, 9),
7438c2ecf20Sopenharmony_ci	MUX_GATE_CLR_SET_UPD(CLK_TOP_AUD_ENG1, "aud_eng1_sel",
7448c2ecf20Sopenharmony_ci			     aud_engen1_parents, 0xc0, 0xc4, 0xc8,
7458c2ecf20Sopenharmony_ci			     8, 2, 15, 0x008, 10),
7468c2ecf20Sopenharmony_ci	MUX_GATE_CLR_SET_UPD(CLK_TOP_AUD_ENG2, "aud_eng2_sel",
7478c2ecf20Sopenharmony_ci			     aud_engen2_parents, 0xc0, 0xc4, 0xc8,
7488c2ecf20Sopenharmony_ci			     16, 2, 23, 0x008, 11),
7498c2ecf20Sopenharmony_ci	MUX_GATE_CLR_SET_UPD(CLK_TOP_FAES_UFSFDE, "faes_ufsfde_sel",
7508c2ecf20Sopenharmony_ci			     faes_ufsfde_parents, 0xc0, 0xc4, 0xc8,
7518c2ecf20Sopenharmony_ci			     24, 3, 31,
7528c2ecf20Sopenharmony_ci			     0x008, 12),
7538c2ecf20Sopenharmony_ci	/* CLK_CFG_11 */
7548c2ecf20Sopenharmony_ci	MUX_GATE_CLR_SET_UPD(CLK_TOP_FUFS, "fufs_sel", fufs_parents,
7558c2ecf20Sopenharmony_ci			     0xd0, 0xd4, 0xd8, 0, 2, 7, 0x008, 13),
7568c2ecf20Sopenharmony_ci	MUX_GATE_CLR_SET_UPD(CLK_TOP_AUD_1, "aud_1_sel", aud_1_parents,
7578c2ecf20Sopenharmony_ci			     0xd0, 0xd4, 0xd8, 8, 1, 15, 0x008, 14),
7588c2ecf20Sopenharmony_ci	MUX_GATE_CLR_SET_UPD(CLK_TOP_AUD_2, "aud_2_sel", aud_2_parents,
7598c2ecf20Sopenharmony_ci			     0xd0, 0xd4, 0xd8, 16, 1, 23, 0x008, 15),
7608c2ecf20Sopenharmony_ci	MUX_GATE_CLR_SET_UPD(CLK_TOP_ADSP, "adsp_sel", adsp_parents,
7618c2ecf20Sopenharmony_ci			     0xd0, 0xd4, 0xd8, 24, 3, 31, 0x008, 16),
7628c2ecf20Sopenharmony_ci	/* CLK_CFG_12 */
7638c2ecf20Sopenharmony_ci	MUX_GATE_CLR_SET_UPD(CLK_TOP_DPMAIF, "dpmaif_sel", dpmaif_parents,
7648c2ecf20Sopenharmony_ci			     0xe0, 0xe4, 0xe8, 0, 3, 7, 0x008, 17),
7658c2ecf20Sopenharmony_ci	MUX_GATE_CLR_SET_UPD(CLK_TOP_VENC, "venc_sel", venc_parents,
7668c2ecf20Sopenharmony_ci			     0xe0, 0xe4, 0xe8, 8, 4, 15, 0x008, 18),
7678c2ecf20Sopenharmony_ci	MUX_GATE_CLR_SET_UPD(CLK_TOP_VDEC, "vdec_sel", vdec_parents,
7688c2ecf20Sopenharmony_ci			     0xe0, 0xe4, 0xe8, 16, 4, 23, 0x008, 19),
7698c2ecf20Sopenharmony_ci	MUX_GATE_CLR_SET_UPD(CLK_TOP_CAMTM, "camtm_sel", camtm_parents,
7708c2ecf20Sopenharmony_ci			     0xe0, 0xe4, 0xe8, 24, 2, 31, 0x004, 20),
7718c2ecf20Sopenharmony_ci	/* CLK_CFG_13 */
7728c2ecf20Sopenharmony_ci	MUX_GATE_CLR_SET_UPD(CLK_TOP_PWM, "pwm_sel", pwm_parents,
7738c2ecf20Sopenharmony_ci			     0xf0, 0xf4, 0xf8, 0, 1, 7, 0x008, 21),
7748c2ecf20Sopenharmony_ci	MUX_GATE_CLR_SET_UPD(CLK_TOP_AUD_H, "audio_h_sel",
7758c2ecf20Sopenharmony_ci			     audio_h_parents, 0xf0, 0xf4, 0xf8,
7768c2ecf20Sopenharmony_ci			     8, 2, 15, 0x008, 22),
7778c2ecf20Sopenharmony_ci	MUX_GATE_CLR_SET_UPD(CLK_TOP_CAMTG5, "camtg5_sel", camtg5_parents,
7788c2ecf20Sopenharmony_ci			     0xf0, 0xf4, 0xf8, 24, 3, 31, 0x008, 24),
7798c2ecf20Sopenharmony_ci};
7808c2ecf20Sopenharmony_ci
7818c2ecf20Sopenharmony_cistatic const char * const i2s0_m_ck_parents[] = {
7828c2ecf20Sopenharmony_ci	"aud_1_sel",
7838c2ecf20Sopenharmony_ci	"aud_2_sel"
7848c2ecf20Sopenharmony_ci};
7858c2ecf20Sopenharmony_ci
7868c2ecf20Sopenharmony_cistatic const char * const i2s1_m_ck_parents[] = {
7878c2ecf20Sopenharmony_ci	"aud_1_sel",
7888c2ecf20Sopenharmony_ci	"aud_2_sel"
7898c2ecf20Sopenharmony_ci};
7908c2ecf20Sopenharmony_ci
7918c2ecf20Sopenharmony_cistatic const char * const i2s2_m_ck_parents[] = {
7928c2ecf20Sopenharmony_ci	"aud_1_sel",
7938c2ecf20Sopenharmony_ci	"aud_2_sel"
7948c2ecf20Sopenharmony_ci};
7958c2ecf20Sopenharmony_ci
7968c2ecf20Sopenharmony_cistatic const char * const i2s3_m_ck_parents[] = {
7978c2ecf20Sopenharmony_ci	"aud_1_sel",
7988c2ecf20Sopenharmony_ci	"aud_2_sel"
7998c2ecf20Sopenharmony_ci};
8008c2ecf20Sopenharmony_ci
8018c2ecf20Sopenharmony_cistatic const char * const i2s4_m_ck_parents[] = {
8028c2ecf20Sopenharmony_ci	"aud_1_sel",
8038c2ecf20Sopenharmony_ci	"aud_2_sel"
8048c2ecf20Sopenharmony_ci};
8058c2ecf20Sopenharmony_ci
8068c2ecf20Sopenharmony_cistatic const char * const i2s5_m_ck_parents[] = {
8078c2ecf20Sopenharmony_ci	"aud_1_sel",
8088c2ecf20Sopenharmony_ci	"aud_2_sel"
8098c2ecf20Sopenharmony_ci};
8108c2ecf20Sopenharmony_ci
8118c2ecf20Sopenharmony_cistatic const struct mtk_composite top_aud_muxes[] = {
8128c2ecf20Sopenharmony_ci	MUX(CLK_TOP_I2S0_M_SEL, "i2s0_m_ck_sel", i2s0_m_ck_parents,
8138c2ecf20Sopenharmony_ci	    0x320, 8, 1),
8148c2ecf20Sopenharmony_ci	MUX(CLK_TOP_I2S1_M_SEL, "i2s1_m_ck_sel", i2s1_m_ck_parents,
8158c2ecf20Sopenharmony_ci	    0x320, 9, 1),
8168c2ecf20Sopenharmony_ci	MUX(CLK_TOP_I2S2_M_SEL, "i2s2_m_ck_sel", i2s2_m_ck_parents,
8178c2ecf20Sopenharmony_ci	    0x320, 10, 1),
8188c2ecf20Sopenharmony_ci	MUX(CLK_TOP_I2S3_M_SEL, "i2s3_m_ck_sel", i2s3_m_ck_parents,
8198c2ecf20Sopenharmony_ci	    0x320, 11, 1),
8208c2ecf20Sopenharmony_ci	MUX(CLK_TOP_I2S4_M_SEL, "i2s4_m_ck_sel", i2s4_m_ck_parents,
8218c2ecf20Sopenharmony_ci	    0x320, 12, 1),
8228c2ecf20Sopenharmony_ci	MUX(CLK_TOP_I2S5_M_SEL, "i2s5_m_ck_sel", i2s5_m_ck_parents,
8238c2ecf20Sopenharmony_ci	    0x328, 20, 1),
8248c2ecf20Sopenharmony_ci};
8258c2ecf20Sopenharmony_ci
8268c2ecf20Sopenharmony_cistatic struct mtk_composite top_aud_divs[] = {
8278c2ecf20Sopenharmony_ci	DIV_GATE(CLK_TOP_APLL12_DIV0, "apll12_div0", "i2s0_m_ck_sel",
8288c2ecf20Sopenharmony_ci		 0x320, 2, 0x324, 8, 0),
8298c2ecf20Sopenharmony_ci	DIV_GATE(CLK_TOP_APLL12_DIV1, "apll12_div1", "i2s1_m_ck_sel",
8308c2ecf20Sopenharmony_ci		 0x320, 3, 0x324, 8, 8),
8318c2ecf20Sopenharmony_ci	DIV_GATE(CLK_TOP_APLL12_DIV2, "apll12_div2", "i2s2_m_ck_sel",
8328c2ecf20Sopenharmony_ci		 0x320, 4, 0x324, 8, 16),
8338c2ecf20Sopenharmony_ci	DIV_GATE(CLK_TOP_APLL12_DIV3, "apll12_div3", "i2s3_m_ck_sel",
8348c2ecf20Sopenharmony_ci		 0x320, 5, 0x324, 8, 24),
8358c2ecf20Sopenharmony_ci	DIV_GATE(CLK_TOP_APLL12_DIV4, "apll12_div4", "i2s4_m_ck_sel",
8368c2ecf20Sopenharmony_ci		 0x320, 6, 0x328, 8, 0),
8378c2ecf20Sopenharmony_ci	DIV_GATE(CLK_TOP_APLL12_DIVB, "apll12_divb", "apll12_div4",
8388c2ecf20Sopenharmony_ci		 0x320, 7, 0x328, 8, 8),
8398c2ecf20Sopenharmony_ci	DIV_GATE(CLK_TOP_APLL12_DIV5, "apll12_div5", "i2s5_m_ck_sel",
8408c2ecf20Sopenharmony_ci		 0x328, 16, 0x328, 4, 28),
8418c2ecf20Sopenharmony_ci};
8428c2ecf20Sopenharmony_ci
8438c2ecf20Sopenharmony_cistatic const struct mtk_gate_regs infra0_cg_regs = {
8448c2ecf20Sopenharmony_ci	.set_ofs = 0x80,
8458c2ecf20Sopenharmony_ci	.clr_ofs = 0x84,
8468c2ecf20Sopenharmony_ci	.sta_ofs = 0x90,
8478c2ecf20Sopenharmony_ci};
8488c2ecf20Sopenharmony_ci
8498c2ecf20Sopenharmony_cistatic const struct mtk_gate_regs infra1_cg_regs = {
8508c2ecf20Sopenharmony_ci	.set_ofs = 0x88,
8518c2ecf20Sopenharmony_ci	.clr_ofs = 0x8c,
8528c2ecf20Sopenharmony_ci	.sta_ofs = 0x94,
8538c2ecf20Sopenharmony_ci};
8548c2ecf20Sopenharmony_ci
8558c2ecf20Sopenharmony_cistatic const struct mtk_gate_regs infra2_cg_regs = {
8568c2ecf20Sopenharmony_ci	.set_ofs = 0xa4,
8578c2ecf20Sopenharmony_ci	.clr_ofs = 0xa8,
8588c2ecf20Sopenharmony_ci	.sta_ofs = 0xac,
8598c2ecf20Sopenharmony_ci};
8608c2ecf20Sopenharmony_ci
8618c2ecf20Sopenharmony_cistatic const struct mtk_gate_regs infra3_cg_regs = {
8628c2ecf20Sopenharmony_ci	.set_ofs = 0xc0,
8638c2ecf20Sopenharmony_ci	.clr_ofs = 0xc4,
8648c2ecf20Sopenharmony_ci	.sta_ofs = 0xc8,
8658c2ecf20Sopenharmony_ci};
8668c2ecf20Sopenharmony_ci
8678c2ecf20Sopenharmony_ci#define GATE_INFRA0(_id, _name, _parent, _shift)		\
8688c2ecf20Sopenharmony_ci	GATE_MTK(_id, _name, _parent, &infra0_cg_regs, _shift,	\
8698c2ecf20Sopenharmony_ci		&mtk_clk_gate_ops_setclr)
8708c2ecf20Sopenharmony_ci#define GATE_INFRA1(_id, _name, _parent, _shift)		\
8718c2ecf20Sopenharmony_ci	GATE_MTK(_id, _name, _parent, &infra1_cg_regs, _shift,	\
8728c2ecf20Sopenharmony_ci		&mtk_clk_gate_ops_setclr)
8738c2ecf20Sopenharmony_ci#define GATE_INFRA2(_id, _name, _parent, _shift)		\
8748c2ecf20Sopenharmony_ci	GATE_MTK(_id, _name, _parent, &infra2_cg_regs, _shift,	\
8758c2ecf20Sopenharmony_ci		&mtk_clk_gate_ops_setclr)
8768c2ecf20Sopenharmony_ci#define GATE_INFRA3(_id, _name, _parent, _shift)		\
8778c2ecf20Sopenharmony_ci	GATE_MTK(_id, _name, _parent, &infra3_cg_regs, _shift,	\
8788c2ecf20Sopenharmony_ci		&mtk_clk_gate_ops_setclr)
8798c2ecf20Sopenharmony_ci
8808c2ecf20Sopenharmony_cistatic const struct mtk_gate infra_clks[] = {
8818c2ecf20Sopenharmony_ci	/* INFRA0 */
8828c2ecf20Sopenharmony_ci	GATE_INFRA0(CLK_INFRA_PMIC_TMR, "infra_pmic_tmr",
8838c2ecf20Sopenharmony_ci		    "axi_sel", 0),
8848c2ecf20Sopenharmony_ci	GATE_INFRA0(CLK_INFRA_PMIC_AP, "infra_pmic_ap",
8858c2ecf20Sopenharmony_ci		    "axi_sel", 1),
8868c2ecf20Sopenharmony_ci	GATE_INFRA0(CLK_INFRA_PMIC_MD, "infra_pmic_md",
8878c2ecf20Sopenharmony_ci		    "axi_sel", 2),
8888c2ecf20Sopenharmony_ci	GATE_INFRA0(CLK_INFRA_PMIC_CONN, "infra_pmic_conn",
8898c2ecf20Sopenharmony_ci		    "axi_sel", 3),
8908c2ecf20Sopenharmony_ci	GATE_INFRA0(CLK_INFRA_SCPSYS, "infra_scp",
8918c2ecf20Sopenharmony_ci		    "axi_sel", 4),
8928c2ecf20Sopenharmony_ci	GATE_INFRA0(CLK_INFRA_SEJ, "infra_sej",
8938c2ecf20Sopenharmony_ci		    "f_f26m_ck", 5),
8948c2ecf20Sopenharmony_ci	GATE_INFRA0(CLK_INFRA_APXGPT, "infra_apxgpt",
8958c2ecf20Sopenharmony_ci		    "axi_sel", 6),
8968c2ecf20Sopenharmony_ci	GATE_INFRA0(CLK_INFRA_ICUSB, "infra_icusb",
8978c2ecf20Sopenharmony_ci		    "axi_sel", 8),
8988c2ecf20Sopenharmony_ci	GATE_INFRA0(CLK_INFRA_GCE, "infra_gce",
8998c2ecf20Sopenharmony_ci		    "axi_sel", 9),
9008c2ecf20Sopenharmony_ci	GATE_INFRA0(CLK_INFRA_THERM, "infra_therm",
9018c2ecf20Sopenharmony_ci		    "axi_sel", 10),
9028c2ecf20Sopenharmony_ci	GATE_INFRA0(CLK_INFRA_I2C0, "infra_i2c0",
9038c2ecf20Sopenharmony_ci		    "i2c_sel", 11),
9048c2ecf20Sopenharmony_ci	GATE_INFRA0(CLK_INFRA_I2C1, "infra_i2c1",
9058c2ecf20Sopenharmony_ci		    "i2c_sel", 12),
9068c2ecf20Sopenharmony_ci	GATE_INFRA0(CLK_INFRA_I2C2, "infra_i2c2",
9078c2ecf20Sopenharmony_ci		    "i2c_sel", 13),
9088c2ecf20Sopenharmony_ci	GATE_INFRA0(CLK_INFRA_I2C3, "infra_i2c3",
9098c2ecf20Sopenharmony_ci		    "i2c_sel", 14),
9108c2ecf20Sopenharmony_ci	GATE_INFRA0(CLK_INFRA_PWM_HCLK, "infra_pwm_hclk",
9118c2ecf20Sopenharmony_ci		    "pwm_sel", 15),
9128c2ecf20Sopenharmony_ci	GATE_INFRA0(CLK_INFRA_PWM1, "infra_pwm1",
9138c2ecf20Sopenharmony_ci		    "pwm_sel", 16),
9148c2ecf20Sopenharmony_ci	GATE_INFRA0(CLK_INFRA_PWM2, "infra_pwm2",
9158c2ecf20Sopenharmony_ci		    "pwm_sel", 17),
9168c2ecf20Sopenharmony_ci	GATE_INFRA0(CLK_INFRA_PWM3, "infra_pwm3",
9178c2ecf20Sopenharmony_ci		    "pwm_sel", 18),
9188c2ecf20Sopenharmony_ci	GATE_INFRA0(CLK_INFRA_PWM4, "infra_pwm4",
9198c2ecf20Sopenharmony_ci		    "pwm_sel", 19),
9208c2ecf20Sopenharmony_ci	GATE_INFRA0(CLK_INFRA_PWM, "infra_pwm",
9218c2ecf20Sopenharmony_ci		    "pwm_sel", 21),
9228c2ecf20Sopenharmony_ci	GATE_INFRA0(CLK_INFRA_UART0, "infra_uart0",
9238c2ecf20Sopenharmony_ci		    "uart_sel", 22),
9248c2ecf20Sopenharmony_ci	GATE_INFRA0(CLK_INFRA_UART1, "infra_uart1",
9258c2ecf20Sopenharmony_ci		    "uart_sel", 23),
9268c2ecf20Sopenharmony_ci	GATE_INFRA0(CLK_INFRA_UART2, "infra_uart2",
9278c2ecf20Sopenharmony_ci		    "uart_sel", 24),
9288c2ecf20Sopenharmony_ci	GATE_INFRA0(CLK_INFRA_UART3, "infra_uart3",
9298c2ecf20Sopenharmony_ci		    "uart_sel", 25),
9308c2ecf20Sopenharmony_ci	GATE_INFRA0(CLK_INFRA_GCE_26M, "infra_gce_26m",
9318c2ecf20Sopenharmony_ci		    "axi_sel", 27),
9328c2ecf20Sopenharmony_ci	GATE_INFRA0(CLK_INFRA_CQ_DMA_FPC, "infra_cqdma_fpc",
9338c2ecf20Sopenharmony_ci		    "axi_sel", 28),
9348c2ecf20Sopenharmony_ci	GATE_INFRA0(CLK_INFRA_BTIF, "infra_btif",
9358c2ecf20Sopenharmony_ci		    "axi_sel", 31),
9368c2ecf20Sopenharmony_ci	/* INFRA1 */
9378c2ecf20Sopenharmony_ci	GATE_INFRA1(CLK_INFRA_SPI0, "infra_spi0",
9388c2ecf20Sopenharmony_ci		    "spi_sel", 1),
9398c2ecf20Sopenharmony_ci	GATE_INFRA1(CLK_INFRA_MSDC0, "infra_msdc0",
9408c2ecf20Sopenharmony_ci		    "msdc50_hclk_sel", 2),
9418c2ecf20Sopenharmony_ci	GATE_INFRA1(CLK_INFRA_MSDC1, "infra_msdc1",
9428c2ecf20Sopenharmony_ci		    "axi_sel", 4),
9438c2ecf20Sopenharmony_ci	GATE_INFRA1(CLK_INFRA_MSDC2, "infra_msdc2",
9448c2ecf20Sopenharmony_ci		    "axi_sel", 5),
9458c2ecf20Sopenharmony_ci	GATE_INFRA1(CLK_INFRA_MSDC0_SCK, "infra_msdc0_sck",
9468c2ecf20Sopenharmony_ci		    "msdc50_0_sel", 6),
9478c2ecf20Sopenharmony_ci	GATE_INFRA1(CLK_INFRA_DVFSRC, "infra_dvfsrc",
9488c2ecf20Sopenharmony_ci		    "f_f26m_ck", 7),
9498c2ecf20Sopenharmony_ci	GATE_INFRA1(CLK_INFRA_GCPU, "infra_gcpu",
9508c2ecf20Sopenharmony_ci		    "axi_sel", 8),
9518c2ecf20Sopenharmony_ci	GATE_INFRA1(CLK_INFRA_TRNG, "infra_trng",
9528c2ecf20Sopenharmony_ci		    "axi_sel", 9),
9538c2ecf20Sopenharmony_ci	GATE_INFRA1(CLK_INFRA_AUXADC, "infra_auxadc",
9548c2ecf20Sopenharmony_ci		    "f_f26m_ck", 10),
9558c2ecf20Sopenharmony_ci	GATE_INFRA1(CLK_INFRA_CPUM, "infra_cpum",
9568c2ecf20Sopenharmony_ci		    "axi_sel", 11),
9578c2ecf20Sopenharmony_ci	GATE_INFRA1(CLK_INFRA_CCIF1_AP, "infra_ccif1_ap",
9588c2ecf20Sopenharmony_ci		    "axi_sel", 12),
9598c2ecf20Sopenharmony_ci	GATE_INFRA1(CLK_INFRA_CCIF1_MD, "infra_ccif1_md",
9608c2ecf20Sopenharmony_ci		    "axi_sel", 13),
9618c2ecf20Sopenharmony_ci	GATE_INFRA1(CLK_INFRA_AUXADC_MD, "infra_auxadc_md",
9628c2ecf20Sopenharmony_ci		    "f_f26m_ck", 14),
9638c2ecf20Sopenharmony_ci	GATE_INFRA1(CLK_INFRA_MSDC1_SCK, "infra_msdc1_sck",
9648c2ecf20Sopenharmony_ci		    "msdc30_1_sel", 16),
9658c2ecf20Sopenharmony_ci	GATE_INFRA1(CLK_INFRA_MSDC2_SCK, "infra_msdc2_sck",
9668c2ecf20Sopenharmony_ci		    "msdc30_2_sel", 17),
9678c2ecf20Sopenharmony_ci	GATE_INFRA1(CLK_INFRA_AP_DMA, "infra_apdma",
9688c2ecf20Sopenharmony_ci		    "axi_sel", 18),
9698c2ecf20Sopenharmony_ci	GATE_INFRA1(CLK_INFRA_XIU, "infra_xiu",
9708c2ecf20Sopenharmony_ci		    "axi_sel", 19),
9718c2ecf20Sopenharmony_ci	GATE_INFRA1(CLK_INFRA_DEVICE_APC, "infra_device_apc",
9728c2ecf20Sopenharmony_ci		    "axi_sel", 20),
9738c2ecf20Sopenharmony_ci	GATE_INFRA1(CLK_INFRA_CCIF_AP, "infra_ccif_ap",
9748c2ecf20Sopenharmony_ci		    "axi_sel", 23),
9758c2ecf20Sopenharmony_ci	GATE_INFRA1(CLK_INFRA_DEBUGSYS, "infra_debugsys",
9768c2ecf20Sopenharmony_ci		    "axi_sel", 24),
9778c2ecf20Sopenharmony_ci	GATE_INFRA1(CLK_INFRA_AUD, "infra_audio",
9788c2ecf20Sopenharmony_ci		    "axi_sel", 25),
9798c2ecf20Sopenharmony_ci	GATE_INFRA1(CLK_INFRA_CCIF_MD, "infra_ccif_md",
9808c2ecf20Sopenharmony_ci		    "axi_sel", 26),
9818c2ecf20Sopenharmony_ci	GATE_INFRA1(CLK_INFRA_DXCC_SEC_CORE, "infra_dxcc_sec_core",
9828c2ecf20Sopenharmony_ci		    "dxcc_sel", 27),
9838c2ecf20Sopenharmony_ci	GATE_INFRA1(CLK_INFRA_DXCC_AO, "infra_dxcc_ao",
9848c2ecf20Sopenharmony_ci		    "dxcc_sel", 28),
9858c2ecf20Sopenharmony_ci	GATE_INFRA1(CLK_INFRA_DEVMPU_BCLK, "infra_devmpu_bclk",
9868c2ecf20Sopenharmony_ci		    "axi_sel", 30),
9878c2ecf20Sopenharmony_ci	GATE_INFRA1(CLK_INFRA_DRAMC_F26M, "infra_dramc_f26m",
9888c2ecf20Sopenharmony_ci		    "f_f26m_ck", 31),
9898c2ecf20Sopenharmony_ci	/* INFRA2 */
9908c2ecf20Sopenharmony_ci	GATE_INFRA2(CLK_INFRA_IRTX, "infra_irtx",
9918c2ecf20Sopenharmony_ci		    "f_f26m_ck", 0),
9928c2ecf20Sopenharmony_ci	GATE_INFRA2(CLK_INFRA_USB, "infra_usb",
9938c2ecf20Sopenharmony_ci		    "usb_top_sel", 1),
9948c2ecf20Sopenharmony_ci	GATE_INFRA2(CLK_INFRA_DISP_PWM, "infra_disppwm",
9958c2ecf20Sopenharmony_ci		    "axi_sel", 2),
9968c2ecf20Sopenharmony_ci	GATE_INFRA2(CLK_INFRA_AUD_26M_BCLK,
9978c2ecf20Sopenharmony_ci		    "infracfg_ao_audio_26m_bclk", "f_f26m_ck", 4),
9988c2ecf20Sopenharmony_ci	GATE_INFRA2(CLK_INFRA_SPI1, "infra_spi1",
9998c2ecf20Sopenharmony_ci		    "spi_sel", 6),
10008c2ecf20Sopenharmony_ci	GATE_INFRA2(CLK_INFRA_I2C4, "infra_i2c4",
10018c2ecf20Sopenharmony_ci		    "i2c_sel", 7),
10028c2ecf20Sopenharmony_ci	GATE_INFRA2(CLK_INFRA_MODEM_TEMP_SHARE, "infra_md_tmp_share",
10038c2ecf20Sopenharmony_ci		    "f_f26m_ck", 8),
10048c2ecf20Sopenharmony_ci	GATE_INFRA2(CLK_INFRA_SPI2, "infra_spi2",
10058c2ecf20Sopenharmony_ci		    "spi_sel", 9),
10068c2ecf20Sopenharmony_ci	GATE_INFRA2(CLK_INFRA_SPI3, "infra_spi3",
10078c2ecf20Sopenharmony_ci		    "spi_sel", 10),
10088c2ecf20Sopenharmony_ci	GATE_INFRA2(CLK_INFRA_UNIPRO_SCK, "infra_unipro_sck",
10098c2ecf20Sopenharmony_ci		    "fufs_sel", 11),
10108c2ecf20Sopenharmony_ci	GATE_INFRA2(CLK_INFRA_UNIPRO_TICK, "infra_unipro_tick",
10118c2ecf20Sopenharmony_ci		    "fufs_sel", 12),
10128c2ecf20Sopenharmony_ci	GATE_INFRA2(CLK_INFRA_UFS_MP_SAP_BCLK, "infra_ufs_mp_sap_bck",
10138c2ecf20Sopenharmony_ci		    "fufs_sel", 13),
10148c2ecf20Sopenharmony_ci	GATE_INFRA2(CLK_INFRA_MD32_BCLK, "infra_md32_bclk",
10158c2ecf20Sopenharmony_ci		    "axi_sel", 14),
10168c2ecf20Sopenharmony_ci	GATE_INFRA2(CLK_INFRA_UNIPRO_MBIST, "infra_unipro_mbist",
10178c2ecf20Sopenharmony_ci		    "axi_sel", 16),
10188c2ecf20Sopenharmony_ci	GATE_INFRA2(CLK_INFRA_SSPM_BUS_HCLK, "infra_sspm_bus_hclk",
10198c2ecf20Sopenharmony_ci		    "axi_sel", 17),
10208c2ecf20Sopenharmony_ci	GATE_INFRA2(CLK_INFRA_I2C5, "infra_i2c5",
10218c2ecf20Sopenharmony_ci		    "i2c_sel", 18),
10228c2ecf20Sopenharmony_ci	GATE_INFRA2(CLK_INFRA_I2C5_ARBITER, "infra_i2c5_arbiter",
10238c2ecf20Sopenharmony_ci		    "i2c_sel", 19),
10248c2ecf20Sopenharmony_ci	GATE_INFRA2(CLK_INFRA_I2C5_IMM, "infra_i2c5_imm",
10258c2ecf20Sopenharmony_ci		    "i2c_sel", 20),
10268c2ecf20Sopenharmony_ci	GATE_INFRA2(CLK_INFRA_I2C1_ARBITER, "infra_i2c1_arbiter",
10278c2ecf20Sopenharmony_ci		    "i2c_sel", 21),
10288c2ecf20Sopenharmony_ci	GATE_INFRA2(CLK_INFRA_I2C1_IMM, "infra_i2c1_imm",
10298c2ecf20Sopenharmony_ci		    "i2c_sel", 22),
10308c2ecf20Sopenharmony_ci	GATE_INFRA2(CLK_INFRA_I2C2_ARBITER, "infra_i2c2_arbiter",
10318c2ecf20Sopenharmony_ci		    "i2c_sel", 23),
10328c2ecf20Sopenharmony_ci	GATE_INFRA2(CLK_INFRA_I2C2_IMM, "infra_i2c2_imm",
10338c2ecf20Sopenharmony_ci		    "i2c_sel", 24),
10348c2ecf20Sopenharmony_ci	GATE_INFRA2(CLK_INFRA_SPI4, "infra_spi4",
10358c2ecf20Sopenharmony_ci		    "spi_sel", 25),
10368c2ecf20Sopenharmony_ci	GATE_INFRA2(CLK_INFRA_SPI5, "infra_spi5",
10378c2ecf20Sopenharmony_ci		    "spi_sel", 26),
10388c2ecf20Sopenharmony_ci	GATE_INFRA2(CLK_INFRA_CQ_DMA, "infra_cqdma",
10398c2ecf20Sopenharmony_ci		    "axi_sel", 27),
10408c2ecf20Sopenharmony_ci	GATE_INFRA2(CLK_INFRA_UFS, "infra_ufs",
10418c2ecf20Sopenharmony_ci		    "fufs_sel", 28),
10428c2ecf20Sopenharmony_ci	GATE_INFRA2(CLK_INFRA_AES_UFSFDE, "infra_aes_ufsfde",
10438c2ecf20Sopenharmony_ci		    "faes_ufsfde_sel", 29),
10448c2ecf20Sopenharmony_ci	GATE_INFRA2(CLK_INFRA_UFS_TICK, "infra_ufs_tick",
10458c2ecf20Sopenharmony_ci		    "fufs_sel", 30),
10468c2ecf20Sopenharmony_ci	GATE_INFRA2(CLK_INFRA_SSUSB_XHCI, "infra_ssusb_xhci",
10478c2ecf20Sopenharmony_ci		    "ssusb_top_xhci_sel", 31),
10488c2ecf20Sopenharmony_ci	/* INFRA3 */
10498c2ecf20Sopenharmony_ci	GATE_INFRA3(CLK_INFRA_MSDC0_SELF, "infra_msdc0_self",
10508c2ecf20Sopenharmony_ci		    "msdc50_0_sel", 0),
10518c2ecf20Sopenharmony_ci	GATE_INFRA3(CLK_INFRA_MSDC1_SELF, "infra_msdc1_self",
10528c2ecf20Sopenharmony_ci		    "msdc50_0_sel", 1),
10538c2ecf20Sopenharmony_ci	GATE_INFRA3(CLK_INFRA_MSDC2_SELF, "infra_msdc2_self",
10548c2ecf20Sopenharmony_ci		    "msdc50_0_sel", 2),
10558c2ecf20Sopenharmony_ci	GATE_INFRA3(CLK_INFRA_SSPM_26M_SELF, "infra_sspm_26m_self",
10568c2ecf20Sopenharmony_ci		    "f_f26m_ck", 3),
10578c2ecf20Sopenharmony_ci	GATE_INFRA3(CLK_INFRA_SSPM_32K_SELF, "infra_sspm_32k_self",
10588c2ecf20Sopenharmony_ci		    "f_f26m_ck", 4),
10598c2ecf20Sopenharmony_ci	GATE_INFRA3(CLK_INFRA_UFS_AXI, "infra_ufs_axi",
10608c2ecf20Sopenharmony_ci		    "axi_sel", 5),
10618c2ecf20Sopenharmony_ci	GATE_INFRA3(CLK_INFRA_I2C6, "infra_i2c6",
10628c2ecf20Sopenharmony_ci		    "i2c_sel", 6),
10638c2ecf20Sopenharmony_ci	GATE_INFRA3(CLK_INFRA_AP_MSDC0, "infra_ap_msdc0",
10648c2ecf20Sopenharmony_ci		    "msdc50_hclk_sel", 7),
10658c2ecf20Sopenharmony_ci	GATE_INFRA3(CLK_INFRA_MD_MSDC0, "infra_md_msdc0",
10668c2ecf20Sopenharmony_ci		    "msdc50_hclk_sel", 8),
10678c2ecf20Sopenharmony_ci	GATE_INFRA3(CLK_INFRA_CCIF2_AP, "infra_ccif2_ap",
10688c2ecf20Sopenharmony_ci		    "axi_sel", 16),
10698c2ecf20Sopenharmony_ci	GATE_INFRA3(CLK_INFRA_CCIF2_MD, "infra_ccif2_md",
10708c2ecf20Sopenharmony_ci		    "axi_sel", 17),
10718c2ecf20Sopenharmony_ci	GATE_INFRA3(CLK_INFRA_CCIF3_AP, "infra_ccif3_ap",
10728c2ecf20Sopenharmony_ci		    "axi_sel", 18),
10738c2ecf20Sopenharmony_ci	GATE_INFRA3(CLK_INFRA_CCIF3_MD, "infra_ccif3_md",
10748c2ecf20Sopenharmony_ci		    "axi_sel", 19),
10758c2ecf20Sopenharmony_ci	GATE_INFRA3(CLK_INFRA_SEJ_F13M, "infra_sej_f13m",
10768c2ecf20Sopenharmony_ci		    "f_f26m_ck", 20),
10778c2ecf20Sopenharmony_ci	GATE_INFRA3(CLK_INFRA_AES_BCLK, "infra_aes_bclk",
10788c2ecf20Sopenharmony_ci		    "axi_sel", 21),
10798c2ecf20Sopenharmony_ci	GATE_INFRA3(CLK_INFRA_I2C7, "infra_i2c7",
10808c2ecf20Sopenharmony_ci		    "i2c_sel", 22),
10818c2ecf20Sopenharmony_ci	GATE_INFRA3(CLK_INFRA_I2C8, "infra_i2c8",
10828c2ecf20Sopenharmony_ci		    "i2c_sel", 23),
10838c2ecf20Sopenharmony_ci	GATE_INFRA3(CLK_INFRA_FBIST2FPC, "infra_fbist2fpc",
10848c2ecf20Sopenharmony_ci		    "msdc50_0_sel", 24),
10858c2ecf20Sopenharmony_ci	GATE_INFRA3(CLK_INFRA_DPMAIF_CK, "infra_dpmaif",
10868c2ecf20Sopenharmony_ci		    "dpmaif_sel", 26),
10878c2ecf20Sopenharmony_ci	GATE_INFRA3(CLK_INFRA_FADSP, "infra_fadsp",
10888c2ecf20Sopenharmony_ci		    "adsp_sel", 27),
10898c2ecf20Sopenharmony_ci	GATE_INFRA3(CLK_INFRA_CCIF4_AP, "infra_ccif4_ap",
10908c2ecf20Sopenharmony_ci		    "axi_sel", 28),
10918c2ecf20Sopenharmony_ci	GATE_INFRA3(CLK_INFRA_CCIF4_MD, "infra_ccif4_md",
10928c2ecf20Sopenharmony_ci		    "axi_sel", 29),
10938c2ecf20Sopenharmony_ci	GATE_INFRA3(CLK_INFRA_SPI6, "infra_spi6",
10948c2ecf20Sopenharmony_ci		    "spi_sel", 30),
10958c2ecf20Sopenharmony_ci	GATE_INFRA3(CLK_INFRA_SPI7, "infra_spi7",
10968c2ecf20Sopenharmony_ci		    "spi_sel", 31),
10978c2ecf20Sopenharmony_ci};
10988c2ecf20Sopenharmony_ci
10998c2ecf20Sopenharmony_cistatic const struct mtk_gate_regs apmixed_cg_regs = {
11008c2ecf20Sopenharmony_ci	.set_ofs = 0x20,
11018c2ecf20Sopenharmony_ci	.clr_ofs = 0x20,
11028c2ecf20Sopenharmony_ci	.sta_ofs = 0x20,
11038c2ecf20Sopenharmony_ci};
11048c2ecf20Sopenharmony_ci
11058c2ecf20Sopenharmony_ci#define GATE_APMIXED_FLAGS(_id, _name, _parent, _shift, _flags)	\
11068c2ecf20Sopenharmony_ci	GATE_MTK_FLAGS(_id, _name, _parent, &apmixed_cg_regs,		\
11078c2ecf20Sopenharmony_ci		_shift, &mtk_clk_gate_ops_no_setclr_inv, _flags)
11088c2ecf20Sopenharmony_ci
11098c2ecf20Sopenharmony_ci#define GATE_APMIXED(_id, _name, _parent, _shift)	\
11108c2ecf20Sopenharmony_ci	GATE_APMIXED_FLAGS(_id, _name, _parent, _shift,	0)
11118c2ecf20Sopenharmony_ci
11128c2ecf20Sopenharmony_ci/*
11138c2ecf20Sopenharmony_ci * CRITICAL CLOCK:
11148c2ecf20Sopenharmony_ci * apmixed_appll26m is the toppest clock gate of all PLLs.
11158c2ecf20Sopenharmony_ci */
11168c2ecf20Sopenharmony_cistatic const struct mtk_gate apmixed_clks[] = {
11178c2ecf20Sopenharmony_ci	GATE_APMIXED(CLK_APMIXED_SSUSB26M, "apmixed_ssusb26m",
11188c2ecf20Sopenharmony_ci		     "f_f26m_ck", 4),
11198c2ecf20Sopenharmony_ci	GATE_APMIXED_FLAGS(CLK_APMIXED_APPLL26M, "apmixed_appll26m",
11208c2ecf20Sopenharmony_ci			   "f_f26m_ck", 5, CLK_IS_CRITICAL),
11218c2ecf20Sopenharmony_ci	GATE_APMIXED(CLK_APMIXED_MIPIC0_26M, "apmixed_mipic026m",
11228c2ecf20Sopenharmony_ci		     "f_f26m_ck", 6),
11238c2ecf20Sopenharmony_ci	GATE_APMIXED(CLK_APMIXED_MDPLLGP26M, "apmixed_mdpll26m",
11248c2ecf20Sopenharmony_ci		     "f_f26m_ck", 7),
11258c2ecf20Sopenharmony_ci	GATE_APMIXED(CLK_APMIXED_MM_F26M, "apmixed_mmsys26m",
11268c2ecf20Sopenharmony_ci		     "f_f26m_ck", 8),
11278c2ecf20Sopenharmony_ci	GATE_APMIXED(CLK_APMIXED_UFS26M, "apmixed_ufs26m",
11288c2ecf20Sopenharmony_ci		     "f_f26m_ck", 9),
11298c2ecf20Sopenharmony_ci	GATE_APMIXED(CLK_APMIXED_MIPIC1_26M, "apmixed_mipic126m",
11308c2ecf20Sopenharmony_ci		     "f_f26m_ck", 11),
11318c2ecf20Sopenharmony_ci	GATE_APMIXED(CLK_APMIXED_MEMPLL26M, "apmixed_mempll26m",
11328c2ecf20Sopenharmony_ci		     "f_f26m_ck", 13),
11338c2ecf20Sopenharmony_ci	GATE_APMIXED(CLK_APMIXED_CLKSQ_LVPLL_26M, "apmixed_lvpll26m",
11348c2ecf20Sopenharmony_ci		     "f_f26m_ck", 14),
11358c2ecf20Sopenharmony_ci	GATE_APMIXED(CLK_APMIXED_MIPID0_26M, "apmixed_mipid026m",
11368c2ecf20Sopenharmony_ci		     "f_f26m_ck", 16),
11378c2ecf20Sopenharmony_ci	GATE_APMIXED(CLK_APMIXED_MIPID1_26M, "apmixed_mipid126m",
11388c2ecf20Sopenharmony_ci		     "f_f26m_ck", 17),
11398c2ecf20Sopenharmony_ci};
11408c2ecf20Sopenharmony_ci
11418c2ecf20Sopenharmony_ci#define MT6779_PLL_FMAX		(3800UL * MHZ)
11428c2ecf20Sopenharmony_ci#define MT6779_PLL_FMIN		(1500UL * MHZ)
11438c2ecf20Sopenharmony_ci
11448c2ecf20Sopenharmony_ci#define PLL_B(_id, _name, _reg, _pwr_reg, _en_mask, _flags,		\
11458c2ecf20Sopenharmony_ci			_rst_bar_mask, _pcwbits, _pcwibits, _pd_reg,	\
11468c2ecf20Sopenharmony_ci			_pd_shift, _tuner_reg,  _tuner_en_reg,		\
11478c2ecf20Sopenharmony_ci			_tuner_en_bit, _pcw_reg, _pcw_shift,		\
11488c2ecf20Sopenharmony_ci			_pcw_chg_reg, _div_table) {			\
11498c2ecf20Sopenharmony_ci		.id = _id,						\
11508c2ecf20Sopenharmony_ci		.name = _name,						\
11518c2ecf20Sopenharmony_ci		.reg = _reg,						\
11528c2ecf20Sopenharmony_ci		.pwr_reg = _pwr_reg,					\
11538c2ecf20Sopenharmony_ci		.en_mask = _en_mask,					\
11548c2ecf20Sopenharmony_ci		.flags = _flags,					\
11558c2ecf20Sopenharmony_ci		.rst_bar_mask = _rst_bar_mask,				\
11568c2ecf20Sopenharmony_ci		.fmax = MT6779_PLL_FMAX,				\
11578c2ecf20Sopenharmony_ci		.fmin = MT6779_PLL_FMIN,				\
11588c2ecf20Sopenharmony_ci		.pcwbits = _pcwbits,					\
11598c2ecf20Sopenharmony_ci		.pcwibits = _pcwibits,					\
11608c2ecf20Sopenharmony_ci		.pd_reg = _pd_reg,					\
11618c2ecf20Sopenharmony_ci		.pd_shift = _pd_shift,					\
11628c2ecf20Sopenharmony_ci		.tuner_reg = _tuner_reg,				\
11638c2ecf20Sopenharmony_ci		.tuner_en_reg = _tuner_en_reg,				\
11648c2ecf20Sopenharmony_ci		.tuner_en_bit = _tuner_en_bit,				\
11658c2ecf20Sopenharmony_ci		.pcw_reg = _pcw_reg,					\
11668c2ecf20Sopenharmony_ci		.pcw_shift = _pcw_shift,				\
11678c2ecf20Sopenharmony_ci		.pcw_chg_reg = _pcw_chg_reg,				\
11688c2ecf20Sopenharmony_ci		.div_table = _div_table,				\
11698c2ecf20Sopenharmony_ci	}
11708c2ecf20Sopenharmony_ci
11718c2ecf20Sopenharmony_ci#define PLL(_id, _name, _reg, _pwr_reg, _en_mask, _flags,		\
11728c2ecf20Sopenharmony_ci			_rst_bar_mask, _pcwbits, _pcwibits, _pd_reg,	\
11738c2ecf20Sopenharmony_ci			_pd_shift, _tuner_reg, _tuner_en_reg,		\
11748c2ecf20Sopenharmony_ci			_tuner_en_bit, _pcw_reg, _pcw_shift,		\
11758c2ecf20Sopenharmony_ci			_pcw_chg_reg)					\
11768c2ecf20Sopenharmony_ci		PLL_B(_id, _name, _reg, _pwr_reg, _en_mask, _flags,	\
11778c2ecf20Sopenharmony_ci			_rst_bar_mask, _pcwbits, _pcwibits, _pd_reg,	\
11788c2ecf20Sopenharmony_ci			_pd_shift, _tuner_reg, _tuner_en_reg,		\
11798c2ecf20Sopenharmony_ci			_tuner_en_bit, _pcw_reg, _pcw_shift,		\
11808c2ecf20Sopenharmony_ci			_pcw_chg_reg, NULL)
11818c2ecf20Sopenharmony_ci
11828c2ecf20Sopenharmony_cistatic const struct mtk_pll_data plls[] = {
11838c2ecf20Sopenharmony_ci	PLL(CLK_APMIXED_ARMPLL_LL, "armpll_ll", 0x0200, 0x020C, BIT(0),
11848c2ecf20Sopenharmony_ci	    PLL_AO, 0, 22, 8, 0x0204, 24, 0, 0, 0, 0x0204, 0, 0),
11858c2ecf20Sopenharmony_ci	PLL(CLK_APMIXED_ARMPLL_BL, "armpll_bl", 0x0210, 0x021C, BIT(0),
11868c2ecf20Sopenharmony_ci	    PLL_AO, 0, 22, 8, 0x0214, 24, 0, 0, 0, 0x0214, 0, 0),
11878c2ecf20Sopenharmony_ci	PLL(CLK_APMIXED_CCIPLL, "ccipll", 0x02A0, 0x02AC, BIT(0),
11888c2ecf20Sopenharmony_ci	    PLL_AO, 0, 22, 8, 0x02A4, 24, 0, 0, 0, 0x02A4, 0, 0),
11898c2ecf20Sopenharmony_ci	PLL(CLK_APMIXED_MAINPLL, "mainpll", 0x0230, 0x023C, BIT(0),
11908c2ecf20Sopenharmony_ci	    (HAVE_RST_BAR), BIT(24), 22, 8, 0x0234, 24, 0, 0, 0,
11918c2ecf20Sopenharmony_ci	    0x0234, 0, 0),
11928c2ecf20Sopenharmony_ci	PLL(CLK_APMIXED_UNIV2PLL, "univ2pll", 0x0240, 0x024C, BIT(0),
11938c2ecf20Sopenharmony_ci	    (HAVE_RST_BAR), BIT(24), 22, 8, 0x0244, 24,
11948c2ecf20Sopenharmony_ci	    0, 0, 0, 0x0244, 0, 0),
11958c2ecf20Sopenharmony_ci	PLL(CLK_APMIXED_MFGPLL, "mfgpll", 0x0250, 0x025C, BIT(0),
11968c2ecf20Sopenharmony_ci	    0, 0, 22, 8, 0x0254, 24, 0, 0, 0, 0x0254, 0, 0),
11978c2ecf20Sopenharmony_ci	PLL(CLK_APMIXED_MSDCPLL, "msdcpll", 0x0260, 0x026C, BIT(0),
11988c2ecf20Sopenharmony_ci	    0, 0, 22, 8, 0x0264, 24, 0, 0, 0, 0x0264, 0, 0),
11998c2ecf20Sopenharmony_ci	PLL(CLK_APMIXED_TVDPLL, "tvdpll", 0x0270, 0x027C, BIT(0),
12008c2ecf20Sopenharmony_ci	    0, 0, 22, 8, 0x0274, 24, 0, 0, 0, 0x0274, 0, 0),
12018c2ecf20Sopenharmony_ci	PLL(CLK_APMIXED_ADSPPLL, "adsppll", 0x02b0, 0x02bC, BIT(0),
12028c2ecf20Sopenharmony_ci	    (HAVE_RST_BAR), BIT(23), 22, 8, 0x02b4, 24,
12038c2ecf20Sopenharmony_ci	    0, 0, 0, 0x02b4, 0, 0),
12048c2ecf20Sopenharmony_ci	PLL(CLK_APMIXED_MMPLL, "mmpll", 0x0280, 0x028C, BIT(0),
12058c2ecf20Sopenharmony_ci	    (HAVE_RST_BAR), BIT(23), 22, 8, 0x0284, 24,
12068c2ecf20Sopenharmony_ci	    0, 0, 0, 0x0284, 0, 0),
12078c2ecf20Sopenharmony_ci	PLL(CLK_APMIXED_APLL1, "apll1", 0x02C0, 0x02D0, BIT(0),
12088c2ecf20Sopenharmony_ci	    0, 0, 32, 8, 0x02C0, 1, 0, 0x14, 0, 0x02C4, 0, 0x2C0),
12098c2ecf20Sopenharmony_ci	PLL(CLK_APMIXED_APLL2, "apll2", 0x02D4, 0x02E4, BIT(0),
12108c2ecf20Sopenharmony_ci	    0, 0, 32, 8, 0x02D4, 1, 0, 0x14, 1, 0x02D8, 0, 0x02D4),
12118c2ecf20Sopenharmony_ci};
12128c2ecf20Sopenharmony_ci
12138c2ecf20Sopenharmony_cistatic int clk_mt6779_apmixed_probe(struct platform_device *pdev)
12148c2ecf20Sopenharmony_ci{
12158c2ecf20Sopenharmony_ci	struct clk_onecell_data *clk_data;
12168c2ecf20Sopenharmony_ci	struct device_node *node = pdev->dev.of_node;
12178c2ecf20Sopenharmony_ci
12188c2ecf20Sopenharmony_ci	clk_data = mtk_alloc_clk_data(CLK_APMIXED_NR_CLK);
12198c2ecf20Sopenharmony_ci	if (!clk_data)
12208c2ecf20Sopenharmony_ci		return -ENOMEM;
12218c2ecf20Sopenharmony_ci
12228c2ecf20Sopenharmony_ci	mtk_clk_register_plls(node, plls, ARRAY_SIZE(plls), clk_data);
12238c2ecf20Sopenharmony_ci
12248c2ecf20Sopenharmony_ci	mtk_clk_register_gates(node, apmixed_clks,
12258c2ecf20Sopenharmony_ci			       ARRAY_SIZE(apmixed_clks), clk_data);
12268c2ecf20Sopenharmony_ci
12278c2ecf20Sopenharmony_ci	return of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
12288c2ecf20Sopenharmony_ci}
12298c2ecf20Sopenharmony_ci
12308c2ecf20Sopenharmony_cistatic int clk_mt6779_top_probe(struct platform_device *pdev)
12318c2ecf20Sopenharmony_ci{
12328c2ecf20Sopenharmony_ci	void __iomem *base;
12338c2ecf20Sopenharmony_ci	struct clk_onecell_data *clk_data;
12348c2ecf20Sopenharmony_ci	struct device_node *node = pdev->dev.of_node;
12358c2ecf20Sopenharmony_ci
12368c2ecf20Sopenharmony_ci	base = devm_platform_ioremap_resource(pdev, 0);
12378c2ecf20Sopenharmony_ci	if (IS_ERR(base))
12388c2ecf20Sopenharmony_ci		return PTR_ERR(base);
12398c2ecf20Sopenharmony_ci
12408c2ecf20Sopenharmony_ci	clk_data = mtk_alloc_clk_data(CLK_TOP_NR_CLK);
12418c2ecf20Sopenharmony_ci	if (!clk_data)
12428c2ecf20Sopenharmony_ci		return -ENOMEM;
12438c2ecf20Sopenharmony_ci
12448c2ecf20Sopenharmony_ci	mtk_clk_register_fixed_clks(top_fixed_clks, ARRAY_SIZE(top_fixed_clks),
12458c2ecf20Sopenharmony_ci				    clk_data);
12468c2ecf20Sopenharmony_ci
12478c2ecf20Sopenharmony_ci	mtk_clk_register_factors(top_divs, ARRAY_SIZE(top_divs), clk_data);
12488c2ecf20Sopenharmony_ci
12498c2ecf20Sopenharmony_ci	mtk_clk_register_muxes(top_muxes, ARRAY_SIZE(top_muxes),
12508c2ecf20Sopenharmony_ci			       node, &mt6779_clk_lock, clk_data);
12518c2ecf20Sopenharmony_ci
12528c2ecf20Sopenharmony_ci	mtk_clk_register_composites(top_aud_muxes, ARRAY_SIZE(top_aud_muxes),
12538c2ecf20Sopenharmony_ci				    base, &mt6779_clk_lock, clk_data);
12548c2ecf20Sopenharmony_ci
12558c2ecf20Sopenharmony_ci	mtk_clk_register_composites(top_aud_divs, ARRAY_SIZE(top_aud_divs),
12568c2ecf20Sopenharmony_ci				    base, &mt6779_clk_lock, clk_data);
12578c2ecf20Sopenharmony_ci
12588c2ecf20Sopenharmony_ci	return of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
12598c2ecf20Sopenharmony_ci}
12608c2ecf20Sopenharmony_ci
12618c2ecf20Sopenharmony_cistatic int clk_mt6779_infra_probe(struct platform_device *pdev)
12628c2ecf20Sopenharmony_ci{
12638c2ecf20Sopenharmony_ci	struct clk_onecell_data *clk_data;
12648c2ecf20Sopenharmony_ci	struct device_node *node = pdev->dev.of_node;
12658c2ecf20Sopenharmony_ci
12668c2ecf20Sopenharmony_ci	clk_data = mtk_alloc_clk_data(CLK_INFRA_NR_CLK);
12678c2ecf20Sopenharmony_ci
12688c2ecf20Sopenharmony_ci	mtk_clk_register_gates(node, infra_clks, ARRAY_SIZE(infra_clks),
12698c2ecf20Sopenharmony_ci			       clk_data);
12708c2ecf20Sopenharmony_ci
12718c2ecf20Sopenharmony_ci	return of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
12728c2ecf20Sopenharmony_ci}
12738c2ecf20Sopenharmony_ci
12748c2ecf20Sopenharmony_cistatic const struct of_device_id of_match_clk_mt6779[] = {
12758c2ecf20Sopenharmony_ci	{
12768c2ecf20Sopenharmony_ci		.compatible = "mediatek,mt6779-apmixed",
12778c2ecf20Sopenharmony_ci		.data = clk_mt6779_apmixed_probe,
12788c2ecf20Sopenharmony_ci	}, {
12798c2ecf20Sopenharmony_ci		.compatible = "mediatek,mt6779-topckgen",
12808c2ecf20Sopenharmony_ci		.data = clk_mt6779_top_probe,
12818c2ecf20Sopenharmony_ci	}, {
12828c2ecf20Sopenharmony_ci		.compatible = "mediatek,mt6779-infracfg_ao",
12838c2ecf20Sopenharmony_ci		.data = clk_mt6779_infra_probe,
12848c2ecf20Sopenharmony_ci	}, {
12858c2ecf20Sopenharmony_ci		/* sentinel */
12868c2ecf20Sopenharmony_ci	}
12878c2ecf20Sopenharmony_ci};
12888c2ecf20Sopenharmony_ci
12898c2ecf20Sopenharmony_cistatic int clk_mt6779_probe(struct platform_device *pdev)
12908c2ecf20Sopenharmony_ci{
12918c2ecf20Sopenharmony_ci	int (*clk_probe)(struct platform_device *pdev);
12928c2ecf20Sopenharmony_ci	int r;
12938c2ecf20Sopenharmony_ci
12948c2ecf20Sopenharmony_ci	clk_probe = of_device_get_match_data(&pdev->dev);
12958c2ecf20Sopenharmony_ci	if (!clk_probe)
12968c2ecf20Sopenharmony_ci		return -EINVAL;
12978c2ecf20Sopenharmony_ci
12988c2ecf20Sopenharmony_ci	r = clk_probe(pdev);
12998c2ecf20Sopenharmony_ci	if (r)
13008c2ecf20Sopenharmony_ci		dev_err(&pdev->dev,
13018c2ecf20Sopenharmony_ci			"could not register clock provider: %s: %d\n",
13028c2ecf20Sopenharmony_ci			pdev->name, r);
13038c2ecf20Sopenharmony_ci
13048c2ecf20Sopenharmony_ci	return r;
13058c2ecf20Sopenharmony_ci}
13068c2ecf20Sopenharmony_ci
13078c2ecf20Sopenharmony_cistatic struct platform_driver clk_mt6779_drv = {
13088c2ecf20Sopenharmony_ci	.probe = clk_mt6779_probe,
13098c2ecf20Sopenharmony_ci	.driver = {
13108c2ecf20Sopenharmony_ci		.name = "clk-mt6779",
13118c2ecf20Sopenharmony_ci		.of_match_table = of_match_clk_mt6779,
13128c2ecf20Sopenharmony_ci	},
13138c2ecf20Sopenharmony_ci};
13148c2ecf20Sopenharmony_ci
13158c2ecf20Sopenharmony_cistatic int __init clk_mt6779_init(void)
13168c2ecf20Sopenharmony_ci{
13178c2ecf20Sopenharmony_ci	return platform_driver_register(&clk_mt6779_drv);
13188c2ecf20Sopenharmony_ci}
13198c2ecf20Sopenharmony_ci
13208c2ecf20Sopenharmony_ciarch_initcall(clk_mt6779_init);
1321