18c2ecf20Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0-only
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * Unisoc SC9863A clock driver
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * Copyright (C) 2019 Unisoc, Inc.
68c2ecf20Sopenharmony_ci * Author: Chunyan Zhang <chunyan.zhang@unisoc.com>
78c2ecf20Sopenharmony_ci */
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_ci#include <linux/clk-provider.h>
108c2ecf20Sopenharmony_ci#include <linux/err.h>
118c2ecf20Sopenharmony_ci#include <linux/io.h>
128c2ecf20Sopenharmony_ci#include <linux/module.h>
138c2ecf20Sopenharmony_ci#include <linux/platform_device.h>
148c2ecf20Sopenharmony_ci#include <linux/slab.h>
158c2ecf20Sopenharmony_ci
168c2ecf20Sopenharmony_ci#include <dt-bindings/clock/sprd,sc9863a-clk.h>
178c2ecf20Sopenharmony_ci
188c2ecf20Sopenharmony_ci#include "common.h"
198c2ecf20Sopenharmony_ci#include "composite.h"
208c2ecf20Sopenharmony_ci#include "div.h"
218c2ecf20Sopenharmony_ci#include "gate.h"
228c2ecf20Sopenharmony_ci#include "mux.h"
238c2ecf20Sopenharmony_ci#include "pll.h"
248c2ecf20Sopenharmony_ci
258c2ecf20Sopenharmony_ci/* mpll*_gate clocks control cpu cores, they were enabled by default */
268c2ecf20Sopenharmony_cistatic SPRD_PLL_SC_GATE_CLK_FW_NAME(mpll0_gate, "mpll0-gate", "ext-26m", 0x94,
278c2ecf20Sopenharmony_ci				    0x1000, BIT(0), CLK_IGNORE_UNUSED, 0, 240);
288c2ecf20Sopenharmony_cistatic SPRD_PLL_SC_GATE_CLK_FW_NAME(dpll0_gate, "dpll0-gate", "ext-26m", 0x98,
298c2ecf20Sopenharmony_ci				    0x1000, BIT(0), 0, 0, 240);
308c2ecf20Sopenharmony_cistatic SPRD_PLL_SC_GATE_CLK_FW_NAME(lpll_gate, "lpll-gate", "ext-26m", 0x9c,
318c2ecf20Sopenharmony_ci				    0x1000, BIT(0), 0, 0, 240);
328c2ecf20Sopenharmony_cistatic SPRD_PLL_SC_GATE_CLK_FW_NAME(gpll_gate, "gpll-gate", "ext-26m", 0xa8,
338c2ecf20Sopenharmony_ci				    0x1000, BIT(0), 0, 0, 240);
348c2ecf20Sopenharmony_cistatic SPRD_PLL_SC_GATE_CLK_FW_NAME(dpll1_gate, "dpll1-gate", "ext-26m", 0x1dc,
358c2ecf20Sopenharmony_ci				    0x1000, BIT(0), 0, 0, 240);
368c2ecf20Sopenharmony_cistatic SPRD_PLL_SC_GATE_CLK_FW_NAME(mpll1_gate, "mpll1-gate", "ext-26m", 0x1e0,
378c2ecf20Sopenharmony_ci				    0x1000, BIT(0), CLK_IGNORE_UNUSED, 0, 240);
388c2ecf20Sopenharmony_cistatic SPRD_PLL_SC_GATE_CLK_FW_NAME(mpll2_gate, "mpll2-gate", "ext-26m", 0x1e4,
398c2ecf20Sopenharmony_ci				    0x1000, BIT(0), CLK_IGNORE_UNUSED, 0, 240);
408c2ecf20Sopenharmony_cistatic SPRD_PLL_SC_GATE_CLK_FW_NAME(isppll_gate, "isppll-gate", "ext-26m",
418c2ecf20Sopenharmony_ci				    0x1e8, 0x1000, BIT(0), 0, 0, 240);
428c2ecf20Sopenharmony_ci
438c2ecf20Sopenharmony_cistatic struct sprd_clk_common *sc9863a_pmu_gate_clks[] = {
448c2ecf20Sopenharmony_ci	/* address base is 0x402b0000 */
458c2ecf20Sopenharmony_ci	&mpll0_gate.common,
468c2ecf20Sopenharmony_ci	&dpll0_gate.common,
478c2ecf20Sopenharmony_ci	&lpll_gate.common,
488c2ecf20Sopenharmony_ci	&gpll_gate.common,
498c2ecf20Sopenharmony_ci	&dpll1_gate.common,
508c2ecf20Sopenharmony_ci	&mpll1_gate.common,
518c2ecf20Sopenharmony_ci	&mpll2_gate.common,
528c2ecf20Sopenharmony_ci	&isppll_gate.common,
538c2ecf20Sopenharmony_ci};
548c2ecf20Sopenharmony_ci
558c2ecf20Sopenharmony_cistatic struct clk_hw_onecell_data sc9863a_pmu_gate_hws = {
568c2ecf20Sopenharmony_ci	.hws	= {
578c2ecf20Sopenharmony_ci		[CLK_MPLL0_GATE]	= &mpll0_gate.common.hw,
588c2ecf20Sopenharmony_ci		[CLK_DPLL0_GATE]	= &dpll0_gate.common.hw,
598c2ecf20Sopenharmony_ci		[CLK_LPLL_GATE]		= &lpll_gate.common.hw,
608c2ecf20Sopenharmony_ci		[CLK_GPLL_GATE]		= &gpll_gate.common.hw,
618c2ecf20Sopenharmony_ci		[CLK_DPLL1_GATE]	= &dpll1_gate.common.hw,
628c2ecf20Sopenharmony_ci		[CLK_MPLL1_GATE]	= &mpll1_gate.common.hw,
638c2ecf20Sopenharmony_ci		[CLK_MPLL2_GATE]	= &mpll2_gate.common.hw,
648c2ecf20Sopenharmony_ci		[CLK_ISPPLL_GATE]	= &isppll_gate.common.hw,
658c2ecf20Sopenharmony_ci	},
668c2ecf20Sopenharmony_ci	.num	= CLK_PMU_APB_NUM,
678c2ecf20Sopenharmony_ci};
688c2ecf20Sopenharmony_ci
698c2ecf20Sopenharmony_cistatic const struct sprd_clk_desc sc9863a_pmu_gate_desc = {
708c2ecf20Sopenharmony_ci	.clk_clks	= sc9863a_pmu_gate_clks,
718c2ecf20Sopenharmony_ci	.num_clk_clks	= ARRAY_SIZE(sc9863a_pmu_gate_clks),
728c2ecf20Sopenharmony_ci	.hw_clks        = &sc9863a_pmu_gate_hws,
738c2ecf20Sopenharmony_ci};
748c2ecf20Sopenharmony_ci
758c2ecf20Sopenharmony_cistatic const u64 itable[5] = {4, 1000000000, 1200000000,
768c2ecf20Sopenharmony_ci			      1400000000, 1600000000};
778c2ecf20Sopenharmony_ci
788c2ecf20Sopenharmony_cistatic const struct clk_bit_field f_twpll[PLL_FACT_MAX] = {
798c2ecf20Sopenharmony_ci	{ .shift = 95,	.width = 1 },	/* lock_done	*/
808c2ecf20Sopenharmony_ci	{ .shift = 0,	.width = 1 },	/* div_s	*/
818c2ecf20Sopenharmony_ci	{ .shift = 1,	.width = 1 },	/* mod_en	*/
828c2ecf20Sopenharmony_ci	{ .shift = 2,	.width = 1 },	/* sdm_en	*/
838c2ecf20Sopenharmony_ci	{ .shift = 0,	.width = 0 },	/* refin	*/
848c2ecf20Sopenharmony_ci	{ .shift = 3,	.width = 3 },	/* ibias	*/
858c2ecf20Sopenharmony_ci	{ .shift = 8,	.width = 11 },	/* n		*/
868c2ecf20Sopenharmony_ci	{ .shift = 55,	.width = 7 },	/* nint		*/
878c2ecf20Sopenharmony_ci	{ .shift = 32,	.width = 23},	/* kint		*/
888c2ecf20Sopenharmony_ci	{ .shift = 0,	.width = 0 },	/* prediv	*/
898c2ecf20Sopenharmony_ci	{ .shift = 0,	.width = 0 },	/* postdiv	*/
908c2ecf20Sopenharmony_ci};
918c2ecf20Sopenharmony_cistatic SPRD_PLL_FW_NAME(twpll, "twpll", "ext-26m", 0x4, 3, itable,
928c2ecf20Sopenharmony_ci			f_twpll, 240, 1000, 1000, 0, 0);
938c2ecf20Sopenharmony_cistatic CLK_FIXED_FACTOR_HW(twpll_768m, "twpll-768m", &twpll.common.hw, 2, 1, 0);
948c2ecf20Sopenharmony_cistatic CLK_FIXED_FACTOR_HW(twpll_384m, "twpll-384m", &twpll.common.hw, 4, 1, 0);
958c2ecf20Sopenharmony_cistatic CLK_FIXED_FACTOR_HW(twpll_192m, "twpll-192m", &twpll.common.hw, 8, 1, 0);
968c2ecf20Sopenharmony_cistatic CLK_FIXED_FACTOR_HW(twpll_96m, "twpll-96m", &twpll.common.hw, 16, 1, 0);
978c2ecf20Sopenharmony_cistatic CLK_FIXED_FACTOR_HW(twpll_48m, "twpll-48m", &twpll.common.hw, 32, 1, 0);
988c2ecf20Sopenharmony_cistatic CLK_FIXED_FACTOR_HW(twpll_24m, "twpll-24m", &twpll.common.hw, 64, 1, 0);
998c2ecf20Sopenharmony_cistatic CLK_FIXED_FACTOR_HW(twpll_12m, "twpll-12m", &twpll.common.hw, 128, 1, 0);
1008c2ecf20Sopenharmony_cistatic CLK_FIXED_FACTOR_HW(twpll_512m, "twpll-512m", &twpll.common.hw, 3, 1, 0);
1018c2ecf20Sopenharmony_cistatic CLK_FIXED_FACTOR_HW(twpll_256m, "twpll-256m", &twpll.common.hw, 6, 1, 0);
1028c2ecf20Sopenharmony_cistatic CLK_FIXED_FACTOR_HW(twpll_128m, "twpll-128m", &twpll.common.hw, 12, 1, 0);
1038c2ecf20Sopenharmony_cistatic CLK_FIXED_FACTOR_HW(twpll_64m, "twpll-64m", &twpll.common.hw, 24, 1, 0);
1048c2ecf20Sopenharmony_cistatic CLK_FIXED_FACTOR_HW(twpll_307m2, "twpll-307m2", &twpll.common.hw, 5, 1, 0);
1058c2ecf20Sopenharmony_cistatic CLK_FIXED_FACTOR_HW(twpll_219m4, "twpll-219m4", &twpll.common.hw, 7, 1, 0);
1068c2ecf20Sopenharmony_cistatic CLK_FIXED_FACTOR_HW(twpll_170m6, "twpll-170m6", &twpll.common.hw, 9, 1, 0);
1078c2ecf20Sopenharmony_cistatic CLK_FIXED_FACTOR_HW(twpll_153m6, "twpll-153m6", &twpll.common.hw, 10, 1, 0);
1088c2ecf20Sopenharmony_cistatic CLK_FIXED_FACTOR_HW(twpll_76m8, "twpll-76m8", &twpll.common.hw, 20, 1, 0);
1098c2ecf20Sopenharmony_cistatic CLK_FIXED_FACTOR_HW(twpll_51m2, "twpll-51m2", &twpll.common.hw, 30, 1, 0);
1108c2ecf20Sopenharmony_cistatic CLK_FIXED_FACTOR_HW(twpll_38m4, "twpll-38m4", &twpll.common.hw, 40, 1, 0);
1118c2ecf20Sopenharmony_cistatic CLK_FIXED_FACTOR_HW(twpll_19m2, "twpll-19m2", &twpll.common.hw, 80, 1, 0);
1128c2ecf20Sopenharmony_ci
1138c2ecf20Sopenharmony_cistatic const struct clk_bit_field f_lpll[PLL_FACT_MAX] = {
1148c2ecf20Sopenharmony_ci	{ .shift = 95,	.width = 1 },	/* lock_done	*/
1158c2ecf20Sopenharmony_ci	{ .shift = 0,	.width = 1 },	/* div_s	*/
1168c2ecf20Sopenharmony_ci	{ .shift = 1,	.width = 1 },	/* mod_en	*/
1178c2ecf20Sopenharmony_ci	{ .shift = 2,	.width = 1 },	/* sdm_en	*/
1188c2ecf20Sopenharmony_ci	{ .shift = 0,	.width = 0 },	/* refin	*/
1198c2ecf20Sopenharmony_ci	{ .shift = 6,	.width = 2 },	/* ibias	*/
1208c2ecf20Sopenharmony_ci	{ .shift = 8,	.width = 11 },	/* n		*/
1218c2ecf20Sopenharmony_ci	{ .shift = 55,	.width = 7 },	/* nint		*/
1228c2ecf20Sopenharmony_ci	{ .shift = 32,	.width = 23},	/* kint		*/
1238c2ecf20Sopenharmony_ci	{ .shift = 0,	.width = 0 },	/* prediv	*/
1248c2ecf20Sopenharmony_ci	{ .shift = 0,	.width = 0 },	/* postdiv	*/
1258c2ecf20Sopenharmony_ci};
1268c2ecf20Sopenharmony_cistatic SPRD_PLL_HW(lpll, "lpll", &lpll_gate.common.hw, 0x20, 3, itable,
1278c2ecf20Sopenharmony_ci		   f_lpll, 240, 1000, 1000, 0, 0);
1288c2ecf20Sopenharmony_cistatic CLK_FIXED_FACTOR_HW(lpll_409m6, "lpll-409m6", &lpll.common.hw, 3, 1, 0);
1298c2ecf20Sopenharmony_cistatic CLK_FIXED_FACTOR_HW(lpll_245m76, "lpll-245m76", &lpll.common.hw, 5, 1, 0);
1308c2ecf20Sopenharmony_ci
1318c2ecf20Sopenharmony_cistatic const struct clk_bit_field f_gpll[PLL_FACT_MAX] = {
1328c2ecf20Sopenharmony_ci	{ .shift = 95,	.width = 1 },	/* lock_done	*/
1338c2ecf20Sopenharmony_ci	{ .shift = 0,	.width = 1 },	/* div_s	*/
1348c2ecf20Sopenharmony_ci	{ .shift = 1,	.width = 1 },	/* mod_en	*/
1358c2ecf20Sopenharmony_ci	{ .shift = 2,	.width = 1 },	/* sdm_en	*/
1368c2ecf20Sopenharmony_ci	{ .shift = 0,	.width = 0 },	/* refin	*/
1378c2ecf20Sopenharmony_ci	{ .shift = 6,	.width = 2 },	/* ibias	*/
1388c2ecf20Sopenharmony_ci	{ .shift = 8,	.width = 11 },	/* n		*/
1398c2ecf20Sopenharmony_ci	{ .shift = 55,	.width = 7 },	/* nint		*/
1408c2ecf20Sopenharmony_ci	{ .shift = 32,	.width = 23},	/* kint		*/
1418c2ecf20Sopenharmony_ci	{ .shift = 0,	.width = 0 },	/* prediv	*/
1428c2ecf20Sopenharmony_ci	{ .shift = 80,	.width = 1 },	/* postdiv	*/
1438c2ecf20Sopenharmony_ci};
1448c2ecf20Sopenharmony_cistatic SPRD_PLL_HW(gpll, "gpll", &gpll_gate.common.hw, 0x38, 3, itable,
1458c2ecf20Sopenharmony_ci		   f_gpll, 240, 1000, 1000, 1, 400000000);
1468c2ecf20Sopenharmony_ci
1478c2ecf20Sopenharmony_cistatic SPRD_PLL_HW(isppll, "isppll", &isppll_gate.common.hw, 0x50, 3, itable,
1488c2ecf20Sopenharmony_ci		   f_gpll, 240, 1000, 1000, 0, 0);
1498c2ecf20Sopenharmony_cistatic CLK_FIXED_FACTOR_HW(isppll_468m, "isppll-468m", &isppll.common.hw, 2, 1, 0);
1508c2ecf20Sopenharmony_ci
1518c2ecf20Sopenharmony_cistatic struct sprd_clk_common *sc9863a_pll_clks[] = {
1528c2ecf20Sopenharmony_ci	/* address base is 0x40353000 */
1538c2ecf20Sopenharmony_ci	&twpll.common,
1548c2ecf20Sopenharmony_ci	&lpll.common,
1558c2ecf20Sopenharmony_ci	&gpll.common,
1568c2ecf20Sopenharmony_ci	&isppll.common,
1578c2ecf20Sopenharmony_ci};
1588c2ecf20Sopenharmony_ci
1598c2ecf20Sopenharmony_cistatic struct clk_hw_onecell_data sc9863a_pll_hws = {
1608c2ecf20Sopenharmony_ci	.hws	= {
1618c2ecf20Sopenharmony_ci		[CLK_TWPLL]		= &twpll.common.hw,
1628c2ecf20Sopenharmony_ci		[CLK_TWPLL_768M]	= &twpll_768m.hw,
1638c2ecf20Sopenharmony_ci		[CLK_TWPLL_384M]	= &twpll_384m.hw,
1648c2ecf20Sopenharmony_ci		[CLK_TWPLL_192M]	= &twpll_192m.hw,
1658c2ecf20Sopenharmony_ci		[CLK_TWPLL_96M]		= &twpll_96m.hw,
1668c2ecf20Sopenharmony_ci		[CLK_TWPLL_48M]		= &twpll_48m.hw,
1678c2ecf20Sopenharmony_ci		[CLK_TWPLL_24M]		= &twpll_24m.hw,
1688c2ecf20Sopenharmony_ci		[CLK_TWPLL_12M]		= &twpll_12m.hw,
1698c2ecf20Sopenharmony_ci		[CLK_TWPLL_512M]	= &twpll_512m.hw,
1708c2ecf20Sopenharmony_ci		[CLK_TWPLL_256M]	= &twpll_256m.hw,
1718c2ecf20Sopenharmony_ci		[CLK_TWPLL_128M]	= &twpll_128m.hw,
1728c2ecf20Sopenharmony_ci		[CLK_TWPLL_64M]		= &twpll_64m.hw,
1738c2ecf20Sopenharmony_ci		[CLK_TWPLL_307M2]	= &twpll_307m2.hw,
1748c2ecf20Sopenharmony_ci		[CLK_TWPLL_219M4]	= &twpll_219m4.hw,
1758c2ecf20Sopenharmony_ci		[CLK_TWPLL_170M6]	= &twpll_170m6.hw,
1768c2ecf20Sopenharmony_ci		[CLK_TWPLL_153M6]	= &twpll_153m6.hw,
1778c2ecf20Sopenharmony_ci		[CLK_TWPLL_76M8]	= &twpll_76m8.hw,
1788c2ecf20Sopenharmony_ci		[CLK_TWPLL_51M2]	= &twpll_51m2.hw,
1798c2ecf20Sopenharmony_ci		[CLK_TWPLL_38M4]	= &twpll_38m4.hw,
1808c2ecf20Sopenharmony_ci		[CLK_TWPLL_19M2]	= &twpll_19m2.hw,
1818c2ecf20Sopenharmony_ci		[CLK_LPLL]		= &lpll.common.hw,
1828c2ecf20Sopenharmony_ci		[CLK_LPLL_409M6]	= &lpll_409m6.hw,
1838c2ecf20Sopenharmony_ci		[CLK_LPLL_245M76]	= &lpll_245m76.hw,
1848c2ecf20Sopenharmony_ci		[CLK_GPLL]		= &gpll.common.hw,
1858c2ecf20Sopenharmony_ci		[CLK_ISPPLL]		= &isppll.common.hw,
1868c2ecf20Sopenharmony_ci		[CLK_ISPPLL_468M]	= &isppll_468m.hw,
1878c2ecf20Sopenharmony_ci
1888c2ecf20Sopenharmony_ci	},
1898c2ecf20Sopenharmony_ci	.num	= CLK_ANLG_PHY_G1_NUM,
1908c2ecf20Sopenharmony_ci};
1918c2ecf20Sopenharmony_ci
1928c2ecf20Sopenharmony_cistatic const struct sprd_clk_desc sc9863a_pll_desc = {
1938c2ecf20Sopenharmony_ci	.clk_clks	= sc9863a_pll_clks,
1948c2ecf20Sopenharmony_ci	.num_clk_clks	= ARRAY_SIZE(sc9863a_pll_clks),
1958c2ecf20Sopenharmony_ci	.hw_clks        = &sc9863a_pll_hws,
1968c2ecf20Sopenharmony_ci};
1978c2ecf20Sopenharmony_ci
1988c2ecf20Sopenharmony_cistatic const u64 itable_mpll[6] = {5, 1000000000, 1200000000, 1400000000,
1998c2ecf20Sopenharmony_ci				   1600000000, 1800000000};
2008c2ecf20Sopenharmony_cistatic SPRD_PLL_HW(mpll0, "mpll0", &mpll0_gate.common.hw, 0x0, 3, itable_mpll,
2018c2ecf20Sopenharmony_ci		   f_gpll, 240, 1000, 1000, 1, 1000000000);
2028c2ecf20Sopenharmony_cistatic SPRD_PLL_HW(mpll1, "mpll1", &mpll1_gate.common.hw, 0x18, 3, itable_mpll,
2038c2ecf20Sopenharmony_ci		   f_gpll, 240, 1000, 1000, 1, 1000000000);
2048c2ecf20Sopenharmony_cistatic SPRD_PLL_HW(mpll2, "mpll2", &mpll2_gate.common.hw, 0x30, 3, itable_mpll,
2058c2ecf20Sopenharmony_ci		   f_gpll, 240, 1000, 1000, 1, 1000000000);
2068c2ecf20Sopenharmony_cistatic CLK_FIXED_FACTOR_HW(mpll2_675m, "mpll2-675m", &mpll2.common.hw, 2, 1, 0);
2078c2ecf20Sopenharmony_ci
2088c2ecf20Sopenharmony_cistatic struct sprd_clk_common *sc9863a_mpll_clks[] = {
2098c2ecf20Sopenharmony_ci	/* address base is 0x40359000 */
2108c2ecf20Sopenharmony_ci	&mpll0.common,
2118c2ecf20Sopenharmony_ci	&mpll1.common,
2128c2ecf20Sopenharmony_ci	&mpll2.common,
2138c2ecf20Sopenharmony_ci};
2148c2ecf20Sopenharmony_ci
2158c2ecf20Sopenharmony_cistatic struct clk_hw_onecell_data sc9863a_mpll_hws = {
2168c2ecf20Sopenharmony_ci	.hws	= {
2178c2ecf20Sopenharmony_ci		[CLK_MPLL0]		= &mpll0.common.hw,
2188c2ecf20Sopenharmony_ci		[CLK_MPLL1]		= &mpll1.common.hw,
2198c2ecf20Sopenharmony_ci		[CLK_MPLL2]		= &mpll2.common.hw,
2208c2ecf20Sopenharmony_ci		[CLK_MPLL2_675M]	= &mpll2_675m.hw,
2218c2ecf20Sopenharmony_ci
2228c2ecf20Sopenharmony_ci	},
2238c2ecf20Sopenharmony_ci	.num	= CLK_ANLG_PHY_G4_NUM,
2248c2ecf20Sopenharmony_ci};
2258c2ecf20Sopenharmony_ci
2268c2ecf20Sopenharmony_cistatic const struct sprd_clk_desc sc9863a_mpll_desc = {
2278c2ecf20Sopenharmony_ci	.clk_clks	= sc9863a_mpll_clks,
2288c2ecf20Sopenharmony_ci	.num_clk_clks	= ARRAY_SIZE(sc9863a_mpll_clks),
2298c2ecf20Sopenharmony_ci	.hw_clks        = &sc9863a_mpll_hws,
2308c2ecf20Sopenharmony_ci};
2318c2ecf20Sopenharmony_ci
2328c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_FW_NAME(audio_gate,	"audio-gate",	"ext-26m",
2338c2ecf20Sopenharmony_ci				0x4, 0x1000, BIT(8), 0, 0);
2348c2ecf20Sopenharmony_ci
2358c2ecf20Sopenharmony_cistatic SPRD_PLL_FW_NAME(rpll, "rpll", "ext-26m", 0x10,
2368c2ecf20Sopenharmony_ci			3, itable, f_lpll, 240, 1000, 1000, 0, 0);
2378c2ecf20Sopenharmony_ci
2388c2ecf20Sopenharmony_cistatic CLK_FIXED_FACTOR_HW(rpll_390m, "rpll-390m", &rpll.common.hw, 2, 1, 0);
2398c2ecf20Sopenharmony_cistatic CLK_FIXED_FACTOR_HW(rpll_260m, "rpll-260m", &rpll.common.hw, 3, 1, 0);
2408c2ecf20Sopenharmony_cistatic CLK_FIXED_FACTOR_HW(rpll_195m, "rpll-195m", &rpll.common.hw, 4, 1, 0);
2418c2ecf20Sopenharmony_cistatic CLK_FIXED_FACTOR_HW(rpll_26m, "rpll-26m", &rpll.common.hw, 30, 1, 0);
2428c2ecf20Sopenharmony_ci
2438c2ecf20Sopenharmony_cistatic struct sprd_clk_common *sc9863a_rpll_clks[] = {
2448c2ecf20Sopenharmony_ci	/* address base is 0x4035c000 */
2458c2ecf20Sopenharmony_ci	&audio_gate.common,
2468c2ecf20Sopenharmony_ci	&rpll.common,
2478c2ecf20Sopenharmony_ci};
2488c2ecf20Sopenharmony_ci
2498c2ecf20Sopenharmony_cistatic struct clk_hw_onecell_data sc9863a_rpll_hws = {
2508c2ecf20Sopenharmony_ci	.hws	= {
2518c2ecf20Sopenharmony_ci		[CLK_AUDIO_GATE]	= &audio_gate.common.hw,
2528c2ecf20Sopenharmony_ci		[CLK_RPLL]		= &rpll.common.hw,
2538c2ecf20Sopenharmony_ci		[CLK_RPLL_390M]		= &rpll_390m.hw,
2548c2ecf20Sopenharmony_ci		[CLK_RPLL_260M]		= &rpll_260m.hw,
2558c2ecf20Sopenharmony_ci		[CLK_RPLL_195M]		= &rpll_195m.hw,
2568c2ecf20Sopenharmony_ci		[CLK_RPLL_26M]		= &rpll_26m.hw,
2578c2ecf20Sopenharmony_ci	},
2588c2ecf20Sopenharmony_ci	.num	= CLK_ANLG_PHY_G5_NUM,
2598c2ecf20Sopenharmony_ci};
2608c2ecf20Sopenharmony_ci
2618c2ecf20Sopenharmony_cistatic const struct sprd_clk_desc sc9863a_rpll_desc = {
2628c2ecf20Sopenharmony_ci	.clk_clks	= sc9863a_rpll_clks,
2638c2ecf20Sopenharmony_ci	.num_clk_clks	= ARRAY_SIZE(sc9863a_rpll_clks),
2648c2ecf20Sopenharmony_ci	.hw_clks        = &sc9863a_rpll_hws,
2658c2ecf20Sopenharmony_ci};
2668c2ecf20Sopenharmony_ci
2678c2ecf20Sopenharmony_cistatic const u64 itable_dpll[5] = {4, 1211000000, 1320000000, 1570000000,
2688c2ecf20Sopenharmony_ci				   1866000000};
2698c2ecf20Sopenharmony_cistatic SPRD_PLL_HW(dpll0, "dpll0", &dpll0_gate.common.hw, 0x0, 3, itable_dpll,
2708c2ecf20Sopenharmony_ci		   f_lpll, 240, 1000, 1000, 0, 0);
2718c2ecf20Sopenharmony_cistatic SPRD_PLL_HW(dpll1, "dpll1", &dpll1_gate.common.hw, 0x18, 3, itable_dpll,
2728c2ecf20Sopenharmony_ci		   f_lpll, 240, 1000, 1000, 0, 0);
2738c2ecf20Sopenharmony_ci
2748c2ecf20Sopenharmony_cistatic CLK_FIXED_FACTOR_HW(dpll0_933m, "dpll0-933m", &dpll0.common.hw, 2, 1, 0);
2758c2ecf20Sopenharmony_cistatic CLK_FIXED_FACTOR_HW(dpll0_622m3, "dpll0-622m3", &dpll0.common.hw, 3, 1, 0);
2768c2ecf20Sopenharmony_cistatic CLK_FIXED_FACTOR_HW(dpll1_400m, "dpll1-400m", &dpll0.common.hw, 4, 1, 0);
2778c2ecf20Sopenharmony_cistatic CLK_FIXED_FACTOR_HW(dpll1_266m7, "dpll1-266m7", &dpll0.common.hw, 6, 1, 0);
2788c2ecf20Sopenharmony_cistatic CLK_FIXED_FACTOR_HW(dpll1_123m1, "dpll1-123m1", &dpll0.common.hw, 13, 1, 0);
2798c2ecf20Sopenharmony_cistatic CLK_FIXED_FACTOR_HW(dpll1_50m, "dpll1-50m", &dpll0.common.hw, 32, 1, 0);
2808c2ecf20Sopenharmony_ci
2818c2ecf20Sopenharmony_cistatic struct sprd_clk_common *sc9863a_dpll_clks[] = {
2828c2ecf20Sopenharmony_ci	/* address base is 0x40363000 */
2838c2ecf20Sopenharmony_ci	&dpll0.common,
2848c2ecf20Sopenharmony_ci	&dpll1.common,
2858c2ecf20Sopenharmony_ci};
2868c2ecf20Sopenharmony_ci
2878c2ecf20Sopenharmony_cistatic struct clk_hw_onecell_data sc9863a_dpll_hws = {
2888c2ecf20Sopenharmony_ci	.hws	= {
2898c2ecf20Sopenharmony_ci		[CLK_DPLL0]		= &dpll0.common.hw,
2908c2ecf20Sopenharmony_ci		[CLK_DPLL1]		= &dpll1.common.hw,
2918c2ecf20Sopenharmony_ci		[CLK_DPLL0_933M]	= &dpll0_933m.hw,
2928c2ecf20Sopenharmony_ci		[CLK_DPLL0_622M3]	= &dpll0_622m3.hw,
2938c2ecf20Sopenharmony_ci		[CLK_DPLL0_400M]	= &dpll1_400m.hw,
2948c2ecf20Sopenharmony_ci		[CLK_DPLL0_266M7]	= &dpll1_266m7.hw,
2958c2ecf20Sopenharmony_ci		[CLK_DPLL0_123M1]	= &dpll1_123m1.hw,
2968c2ecf20Sopenharmony_ci		[CLK_DPLL0_50M]		= &dpll1_50m.hw,
2978c2ecf20Sopenharmony_ci
2988c2ecf20Sopenharmony_ci	},
2998c2ecf20Sopenharmony_ci	.num	= CLK_ANLG_PHY_G7_NUM,
3008c2ecf20Sopenharmony_ci};
3018c2ecf20Sopenharmony_ci
3028c2ecf20Sopenharmony_cistatic const struct sprd_clk_desc sc9863a_dpll_desc = {
3038c2ecf20Sopenharmony_ci	.clk_clks	= sc9863a_dpll_clks,
3048c2ecf20Sopenharmony_ci	.num_clk_clks	= ARRAY_SIZE(sc9863a_dpll_clks),
3058c2ecf20Sopenharmony_ci	.hw_clks        = &sc9863a_dpll_hws,
3068c2ecf20Sopenharmony_ci};
3078c2ecf20Sopenharmony_ci
3088c2ecf20Sopenharmony_cistatic CLK_FIXED_FACTOR_FW_NAME(clk_6m5, "clk-6m5", "ext-26m", 4, 1, 0);
3098c2ecf20Sopenharmony_cistatic CLK_FIXED_FACTOR_FW_NAME(clk_4m3, "clk-4m3", "ext-26m", 6, 1, 0);
3108c2ecf20Sopenharmony_cistatic CLK_FIXED_FACTOR_FW_NAME(clk_2m, "clk-2m", "ext-26m", 13, 1, 0);
3118c2ecf20Sopenharmony_cistatic CLK_FIXED_FACTOR_FW_NAME(clk_250k, "clk-250k", "ext-26m", 104, 1, 0);
3128c2ecf20Sopenharmony_cistatic CLK_FIXED_FACTOR_FW_NAME(rco_25m, "rco-25m", "rco-100m",	4, 1, 0);
3138c2ecf20Sopenharmony_cistatic CLK_FIXED_FACTOR_FW_NAME(rco_4m, "rco-4m", "rco-100m", 25, 1, 0);
3148c2ecf20Sopenharmony_cistatic CLK_FIXED_FACTOR_FW_NAME(rco_2m, "rco-2m", "rco-100m", 50, 1, 0);
3158c2ecf20Sopenharmony_ci
3168c2ecf20Sopenharmony_ci#define SC9863A_MUX_FLAG	\
3178c2ecf20Sopenharmony_ci	(CLK_GET_RATE_NOCACHE | CLK_SET_RATE_NO_REPARENT)
3188c2ecf20Sopenharmony_ci
3198c2ecf20Sopenharmony_cistatic CLK_FIXED_FACTOR_FW_NAME(clk_13m, "clk-13m", "ext-26m", 2, 1, 0);
3208c2ecf20Sopenharmony_cistatic const struct clk_parent_data emc_clk_parents[] = {
3218c2ecf20Sopenharmony_ci	{ .fw_name = "ext-26m" },
3228c2ecf20Sopenharmony_ci	{ .hw = &twpll_384m.hw  },
3238c2ecf20Sopenharmony_ci	{ .hw = &twpll_512m.hw  },
3248c2ecf20Sopenharmony_ci	{ .hw = &twpll_768m.hw  },
3258c2ecf20Sopenharmony_ci	{ .hw = &twpll.common.hw  },
3268c2ecf20Sopenharmony_ci};
3278c2ecf20Sopenharmony_cistatic SPRD_MUX_CLK_DATA(emc_clk, "emc-clk", emc_clk_parents, 0x220,
3288c2ecf20Sopenharmony_ci			 0, 3, SC9863A_MUX_FLAG);
3298c2ecf20Sopenharmony_ci
3308c2ecf20Sopenharmony_cistatic const struct clk_parent_data aon_apb_parents[] = {
3318c2ecf20Sopenharmony_ci	{ .hw = &rco_4m.hw  },
3328c2ecf20Sopenharmony_ci	{ .hw = &rco_25m.hw  },
3338c2ecf20Sopenharmony_ci	{ .fw_name = "ext-26m" },
3348c2ecf20Sopenharmony_ci	{ .hw = &twpll_96m.hw  },
3358c2ecf20Sopenharmony_ci	{ .fw_name = "rco-100m" },
3368c2ecf20Sopenharmony_ci	{ .hw = &twpll_128m.hw  },
3378c2ecf20Sopenharmony_ci};
3388c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK_DATA(aon_apb, "aon-apb", aon_apb_parents, 0x224,
3398c2ecf20Sopenharmony_ci			  0, 3, 8, 2, 0);
3408c2ecf20Sopenharmony_ci
3418c2ecf20Sopenharmony_cistatic const struct clk_parent_data adi_parents[] = {
3428c2ecf20Sopenharmony_ci	{ .hw = &rco_4m.hw  },
3438c2ecf20Sopenharmony_ci	{ .hw = &rco_25m.hw  },
3448c2ecf20Sopenharmony_ci	{ .fw_name = "ext-26m" },
3458c2ecf20Sopenharmony_ci	{ .hw = &twpll_38m4.hw  },
3468c2ecf20Sopenharmony_ci	{ .hw = &twpll_51m2.hw  },
3478c2ecf20Sopenharmony_ci};
3488c2ecf20Sopenharmony_cistatic SPRD_MUX_CLK_DATA(adi_clk, "adi-clk", adi_parents, 0x228,
3498c2ecf20Sopenharmony_ci			 0, 3, SC9863A_MUX_FLAG);
3508c2ecf20Sopenharmony_ci
3518c2ecf20Sopenharmony_cistatic const struct clk_parent_data aux_parents[] = {
3528c2ecf20Sopenharmony_ci	{ .fw_name = "ext-32k" },
3538c2ecf20Sopenharmony_ci	{ .hw = &rpll_26m.hw  },
3548c2ecf20Sopenharmony_ci	{ .fw_name = "ext-26m" },
3558c2ecf20Sopenharmony_ci};
3568c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK_DATA(aux0_clk, "aux0-clk", aux_parents, 0x22c,
3578c2ecf20Sopenharmony_ci			  0, 5, 8, 4, 0);
3588c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK_DATA(aux1_clk, "aux1-clk", aux_parents, 0x230,
3598c2ecf20Sopenharmony_ci			  0, 5, 8, 4, 0);
3608c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK_DATA(aux2_clk, "aux2-clk", aux_parents, 0x234,
3618c2ecf20Sopenharmony_ci			  0, 5, 8, 4, 0);
3628c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK_DATA(probe_clk, "probe-clk", aux_parents, 0x238,
3638c2ecf20Sopenharmony_ci			  0, 5, 8, 4, 0);
3648c2ecf20Sopenharmony_ci
3658c2ecf20Sopenharmony_cistatic const struct clk_parent_data pwm_parents[] = {
3668c2ecf20Sopenharmony_ci	{ .fw_name = "ext-32k" },
3678c2ecf20Sopenharmony_ci	{ .hw = &rpll_26m.hw  },
3688c2ecf20Sopenharmony_ci	{ .fw_name = "ext-26m" },
3698c2ecf20Sopenharmony_ci	{ .hw = &twpll_48m.hw  },
3708c2ecf20Sopenharmony_ci};
3718c2ecf20Sopenharmony_cistatic SPRD_MUX_CLK_DATA(pwm0_clk, "pwm0-clk", pwm_parents, 0x23c,
3728c2ecf20Sopenharmony_ci			 0, 2, SC9863A_MUX_FLAG);
3738c2ecf20Sopenharmony_cistatic SPRD_MUX_CLK_DATA(pwm1_clk, "pwm1-clk", pwm_parents, 0x240,
3748c2ecf20Sopenharmony_ci			 0, 2, SC9863A_MUX_FLAG);
3758c2ecf20Sopenharmony_cistatic SPRD_MUX_CLK_DATA(pwm2_clk, "pwm2-clk", pwm_parents, 0x244,
3768c2ecf20Sopenharmony_ci			 0, 2, SC9863A_MUX_FLAG);
3778c2ecf20Sopenharmony_ci
3788c2ecf20Sopenharmony_cistatic const struct clk_parent_data aon_thm_parents[] = {
3798c2ecf20Sopenharmony_ci	{ .fw_name = "ext-32k" },
3808c2ecf20Sopenharmony_ci	{ .hw = &clk_250k.hw  },
3818c2ecf20Sopenharmony_ci};
3828c2ecf20Sopenharmony_cistatic SPRD_MUX_CLK_DATA(aon_thm_clk, "aon-thm-clk", aon_thm_parents, 0x25c,
3838c2ecf20Sopenharmony_ci			 0, 1, SC9863A_MUX_FLAG);
3848c2ecf20Sopenharmony_ci
3858c2ecf20Sopenharmony_cistatic const struct clk_parent_data audif_parents[] = {
3868c2ecf20Sopenharmony_ci	{ .fw_name = "ext-26m" },
3878c2ecf20Sopenharmony_ci	{ .hw = &twpll_38m4.hw  },
3888c2ecf20Sopenharmony_ci	{ .hw = &twpll_51m2.hw  },
3898c2ecf20Sopenharmony_ci};
3908c2ecf20Sopenharmony_cistatic SPRD_MUX_CLK_DATA(audif_clk, "audif-clk", audif_parents, 0x264,
3918c2ecf20Sopenharmony_ci			 0, 2, SC9863A_MUX_FLAG);
3928c2ecf20Sopenharmony_ci
3938c2ecf20Sopenharmony_cistatic const struct clk_parent_data cpu_dap_parents[] = {
3948c2ecf20Sopenharmony_ci	{ .hw = &rco_4m.hw  },
3958c2ecf20Sopenharmony_ci	{ .hw = &rco_25m.hw  },
3968c2ecf20Sopenharmony_ci	{ .fw_name = "ext-26m" },
3978c2ecf20Sopenharmony_ci	{ .hw = &twpll_76m8.hw  },
3988c2ecf20Sopenharmony_ci	{ .fw_name = "rco-100m" },
3998c2ecf20Sopenharmony_ci	{ .hw = &twpll_128m.hw  },
4008c2ecf20Sopenharmony_ci	{ .hw = &twpll_153m6.hw  },
4018c2ecf20Sopenharmony_ci};
4028c2ecf20Sopenharmony_cistatic SPRD_MUX_CLK_DATA(cpu_dap_clk, "cpu-dap-clk", cpu_dap_parents, 0x26c,
4038c2ecf20Sopenharmony_ci			 0, 3, SC9863A_MUX_FLAG);
4048c2ecf20Sopenharmony_ci
4058c2ecf20Sopenharmony_cistatic const struct clk_parent_data cpu_ts_parents[] = {
4068c2ecf20Sopenharmony_ci	{ .fw_name = "ext-32k" },
4078c2ecf20Sopenharmony_ci	{ .fw_name = "ext-26m" },
4088c2ecf20Sopenharmony_ci	{ .hw = &twpll_128m.hw  },
4098c2ecf20Sopenharmony_ci	{ .hw = &twpll_153m6.hw  },
4108c2ecf20Sopenharmony_ci};
4118c2ecf20Sopenharmony_cistatic SPRD_MUX_CLK_DATA(cpu_ts_clk, "cpu-ts-clk", cpu_ts_parents, 0x274,
4128c2ecf20Sopenharmony_ci			 0, 2, SC9863A_MUX_FLAG);
4138c2ecf20Sopenharmony_ci
4148c2ecf20Sopenharmony_cistatic const struct clk_parent_data djtag_tck_parents[] = {
4158c2ecf20Sopenharmony_ci	{ .hw = &rco_4m.hw  },
4168c2ecf20Sopenharmony_ci	{ .fw_name = "ext-26m" },
4178c2ecf20Sopenharmony_ci};
4188c2ecf20Sopenharmony_cistatic SPRD_MUX_CLK_DATA(djtag_tck_clk, "djtag-tck-clk", djtag_tck_parents, 0x28c,
4198c2ecf20Sopenharmony_ci			 0, 1, SC9863A_MUX_FLAG);
4208c2ecf20Sopenharmony_ci
4218c2ecf20Sopenharmony_cistatic const struct clk_parent_data emc_ref_parents[] = {
4228c2ecf20Sopenharmony_ci	{ .hw = &clk_6m5.hw  },
4238c2ecf20Sopenharmony_ci	{ .hw = &clk_13m.hw  },
4248c2ecf20Sopenharmony_ci	{ .fw_name = "ext-26m" },
4258c2ecf20Sopenharmony_ci};
4268c2ecf20Sopenharmony_cistatic SPRD_MUX_CLK_DATA(emc_ref_clk, "emc-ref-clk", emc_ref_parents, 0x29c,
4278c2ecf20Sopenharmony_ci			 0, 2, SC9863A_MUX_FLAG);
4288c2ecf20Sopenharmony_ci
4298c2ecf20Sopenharmony_cistatic const struct clk_parent_data cssys_parents[] = {
4308c2ecf20Sopenharmony_ci	{ .hw = &rco_4m.hw  },
4318c2ecf20Sopenharmony_ci	{ .fw_name = "ext-26m" },
4328c2ecf20Sopenharmony_ci	{ .hw = &twpll_96m.hw  },
4338c2ecf20Sopenharmony_ci	{ .fw_name = "rco-100m" },
4348c2ecf20Sopenharmony_ci	{ .hw = &twpll_128m.hw  },
4358c2ecf20Sopenharmony_ci	{ .hw = &twpll_153m6.hw  },
4368c2ecf20Sopenharmony_ci	{ .hw = &twpll_384m.hw  },
4378c2ecf20Sopenharmony_ci	{ .hw = &twpll_512m.hw  },
4388c2ecf20Sopenharmony_ci	{ .hw = &mpll2_675m.hw  },
4398c2ecf20Sopenharmony_ci};
4408c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK_DATA(cssys_clk, "cssys-clk", cssys_parents, 0x2a0,
4418c2ecf20Sopenharmony_ci			  0, 4, 8, 2, 0);
4428c2ecf20Sopenharmony_ci
4438c2ecf20Sopenharmony_cistatic const struct clk_parent_data aon_pmu_parents[] = {
4448c2ecf20Sopenharmony_ci	{ .fw_name = "ext-32k" },
4458c2ecf20Sopenharmony_ci	{ .hw = &rco_4m.hw  },
4468c2ecf20Sopenharmony_ci	{ .fw_name = "ext-4m" },
4478c2ecf20Sopenharmony_ci};
4488c2ecf20Sopenharmony_cistatic SPRD_MUX_CLK_DATA(aon_pmu_clk, "aon-pmu-clk", aon_pmu_parents, 0x2a8,
4498c2ecf20Sopenharmony_ci			 0, 2, SC9863A_MUX_FLAG);
4508c2ecf20Sopenharmony_ci
4518c2ecf20Sopenharmony_cistatic const struct clk_parent_data pmu_26m_parents[] = {
4528c2ecf20Sopenharmony_ci	{ .hw = &rco_4m.hw  },
4538c2ecf20Sopenharmony_ci	{ .hw = &rco_25m.hw  },
4548c2ecf20Sopenharmony_ci	{ .fw_name = "ext-26m" },
4558c2ecf20Sopenharmony_ci};
4568c2ecf20Sopenharmony_cistatic SPRD_MUX_CLK_DATA(pmu_26m_clk, "26m-pmu-clk", pmu_26m_parents, 0x2ac,
4578c2ecf20Sopenharmony_ci			 0, 2, SC9863A_MUX_FLAG);
4588c2ecf20Sopenharmony_ci
4598c2ecf20Sopenharmony_cistatic const struct clk_parent_data aon_tmr_parents[] = {
4608c2ecf20Sopenharmony_ci	{ .hw = &rco_4m.hw  },
4618c2ecf20Sopenharmony_ci	{ .fw_name = "ext-26m" },
4628c2ecf20Sopenharmony_ci};
4638c2ecf20Sopenharmony_cistatic SPRD_MUX_CLK_DATA(aon_tmr_clk, "aon-tmr-clk", aon_tmr_parents, 0x2b0,
4648c2ecf20Sopenharmony_ci			 0, 1, SC9863A_MUX_FLAG);
4658c2ecf20Sopenharmony_ci
4668c2ecf20Sopenharmony_cistatic const struct clk_parent_data power_cpu_parents[] = {
4678c2ecf20Sopenharmony_ci	{ .fw_name = "ext-26m" },
4688c2ecf20Sopenharmony_ci	{ .hw = &rco_25m.hw  },
4698c2ecf20Sopenharmony_ci	{ .fw_name = "rco-100m" },
4708c2ecf20Sopenharmony_ci	{ .hw = &twpll_128m.hw  },
4718c2ecf20Sopenharmony_ci};
4728c2ecf20Sopenharmony_cistatic SPRD_MUX_CLK_DATA(power_cpu_clk, "power-cpu-clk", power_cpu_parents, 0x2c4,
4738c2ecf20Sopenharmony_ci			 0, 2, SC9863A_MUX_FLAG);
4748c2ecf20Sopenharmony_ci
4758c2ecf20Sopenharmony_cistatic const struct clk_parent_data ap_axi_parents[] = {
4768c2ecf20Sopenharmony_ci	{ .fw_name = "ext-26m" },
4778c2ecf20Sopenharmony_ci	{ .hw = &twpll_76m8.hw  },
4788c2ecf20Sopenharmony_ci	{ .hw = &twpll_128m.hw  },
4798c2ecf20Sopenharmony_ci	{ .hw = &twpll_256m.hw  },
4808c2ecf20Sopenharmony_ci};
4818c2ecf20Sopenharmony_cistatic SPRD_MUX_CLK_DATA(ap_axi, "ap-axi", ap_axi_parents, 0x2c8,
4828c2ecf20Sopenharmony_ci			 0, 2, SC9863A_MUX_FLAG);
4838c2ecf20Sopenharmony_ci
4848c2ecf20Sopenharmony_cistatic const struct clk_parent_data sdio_parents[] = {
4858c2ecf20Sopenharmony_ci	{ .fw_name = "ext-26m" },
4868c2ecf20Sopenharmony_ci	{ .hw = &twpll_307m2.hw  },
4878c2ecf20Sopenharmony_ci	{ .hw = &twpll_384m.hw  },
4888c2ecf20Sopenharmony_ci	{ .hw = &rpll_390m.hw  },
4898c2ecf20Sopenharmony_ci	{ .hw = &dpll1_400m.hw  },
4908c2ecf20Sopenharmony_ci	{ .hw = &lpll_409m6.hw  },
4918c2ecf20Sopenharmony_ci};
4928c2ecf20Sopenharmony_cistatic SPRD_MUX_CLK_DATA(sdio0_2x, "sdio0-2x", sdio_parents, 0x2cc,
4938c2ecf20Sopenharmony_ci			 0, 3, SC9863A_MUX_FLAG);
4948c2ecf20Sopenharmony_cistatic SPRD_MUX_CLK_DATA(sdio1_2x, "sdio1-2x", sdio_parents, 0x2d4,
4958c2ecf20Sopenharmony_ci			 0, 3, SC9863A_MUX_FLAG);
4968c2ecf20Sopenharmony_cistatic SPRD_MUX_CLK_DATA(sdio2_2x, "sdio2-2x", sdio_parents, 0x2dc,
4978c2ecf20Sopenharmony_ci			 0, 3, SC9863A_MUX_FLAG);
4988c2ecf20Sopenharmony_cistatic SPRD_MUX_CLK_DATA(emmc_2x, "emmc-2x", sdio_parents, 0x2e4,
4998c2ecf20Sopenharmony_ci			 0, 3, SC9863A_MUX_FLAG);
5008c2ecf20Sopenharmony_ci
5018c2ecf20Sopenharmony_cistatic const struct clk_parent_data dpu_parents[] = {
5028c2ecf20Sopenharmony_ci	{ .hw = &twpll_153m6.hw  },
5038c2ecf20Sopenharmony_ci	{ .hw = &twpll_192m.hw  },
5048c2ecf20Sopenharmony_ci	{ .hw = &twpll_256m.hw  },
5058c2ecf20Sopenharmony_ci	{ .hw = &twpll_384m.hw  },
5068c2ecf20Sopenharmony_ci};
5078c2ecf20Sopenharmony_cistatic SPRD_MUX_CLK_DATA(dpu_clk, "dpu", dpu_parents, 0x2f4,
5088c2ecf20Sopenharmony_ci			 0, 2, SC9863A_MUX_FLAG);
5098c2ecf20Sopenharmony_ci
5108c2ecf20Sopenharmony_cistatic const struct clk_parent_data dpu_dpi_parents[] = {
5118c2ecf20Sopenharmony_ci	{ .hw = &twpll_128m.hw  },
5128c2ecf20Sopenharmony_ci	{ .hw = &twpll_153m6.hw  },
5138c2ecf20Sopenharmony_ci	{ .hw = &twpll_192m.hw  },
5148c2ecf20Sopenharmony_ci};
5158c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK_DATA(dpu_dpi, "dpu-dpi", dpu_dpi_parents, 0x2f8,
5168c2ecf20Sopenharmony_ci			  0, 2, 8, 4, 0);
5178c2ecf20Sopenharmony_ci
5188c2ecf20Sopenharmony_cistatic const struct clk_parent_data otg_ref_parents[] = {
5198c2ecf20Sopenharmony_ci	{ .hw = &twpll_12m.hw  },
5208c2ecf20Sopenharmony_ci	{ .fw_name = "ext-26m" },
5218c2ecf20Sopenharmony_ci};
5228c2ecf20Sopenharmony_cistatic SPRD_MUX_CLK_DATA(otg_ref_clk, "otg-ref-clk", otg_ref_parents, 0x308,
5238c2ecf20Sopenharmony_ci			 0, 1, SC9863A_MUX_FLAG);
5248c2ecf20Sopenharmony_ci
5258c2ecf20Sopenharmony_cistatic const struct clk_parent_data sdphy_apb_parents[] = {
5268c2ecf20Sopenharmony_ci	{ .fw_name = "ext-26m" },
5278c2ecf20Sopenharmony_ci	{ .hw = &twpll_48m.hw  },
5288c2ecf20Sopenharmony_ci};
5298c2ecf20Sopenharmony_cistatic SPRD_MUX_CLK_DATA(sdphy_apb_clk, "sdphy-apb-clk", sdphy_apb_parents, 0x330,
5308c2ecf20Sopenharmony_ci			 0, 1, SC9863A_MUX_FLAG);
5318c2ecf20Sopenharmony_ci
5328c2ecf20Sopenharmony_cistatic const struct clk_parent_data alg_io_apb_parents[] = {
5338c2ecf20Sopenharmony_ci	{ .hw = &rco_4m.hw  },
5348c2ecf20Sopenharmony_ci	{ .fw_name = "ext-26m" },
5358c2ecf20Sopenharmony_ci	{ .hw = &twpll_48m.hw  },
5368c2ecf20Sopenharmony_ci	{ .hw = &twpll_96m.hw  },
5378c2ecf20Sopenharmony_ci};
5388c2ecf20Sopenharmony_cistatic SPRD_MUX_CLK_DATA(alg_io_apb_clk, "alg-io-apb-clk", alg_io_apb_parents, 0x33c,
5398c2ecf20Sopenharmony_ci			 0, 1, SC9863A_MUX_FLAG);
5408c2ecf20Sopenharmony_ci
5418c2ecf20Sopenharmony_cistatic const struct clk_parent_data gpu_parents[] = {
5428c2ecf20Sopenharmony_ci	{ .hw = &twpll_153m6.hw  },
5438c2ecf20Sopenharmony_ci	{ .hw = &twpll_192m.hw  },
5448c2ecf20Sopenharmony_ci	{ .hw = &twpll_256m.hw  },
5458c2ecf20Sopenharmony_ci	{ .hw = &twpll_307m2.hw  },
5468c2ecf20Sopenharmony_ci	{ .hw = &twpll_384m.hw  },
5478c2ecf20Sopenharmony_ci	{ .hw = &twpll_512m.hw  },
5488c2ecf20Sopenharmony_ci	{ .hw = &gpll.common.hw  },
5498c2ecf20Sopenharmony_ci};
5508c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK_DATA(gpu_core, "gpu-core", gpu_parents, 0x344,
5518c2ecf20Sopenharmony_ci			  0, 3, 8, 2, 0);
5528c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK_DATA(gpu_soc, "gpu-soc", gpu_parents, 0x348,
5538c2ecf20Sopenharmony_ci			  0, 3, 8, 2, 0);
5548c2ecf20Sopenharmony_ci
5558c2ecf20Sopenharmony_cistatic const struct clk_parent_data mm_emc_parents[] = {
5568c2ecf20Sopenharmony_ci	{ .fw_name = "ext-26m" },
5578c2ecf20Sopenharmony_ci	{ .hw = &twpll_384m.hw  },
5588c2ecf20Sopenharmony_ci	{ .hw = &isppll_468m.hw  },
5598c2ecf20Sopenharmony_ci	{ .hw = &twpll_512m.hw  },
5608c2ecf20Sopenharmony_ci};
5618c2ecf20Sopenharmony_cistatic SPRD_MUX_CLK_DATA(mm_emc, "mm-emc", mm_emc_parents, 0x350,
5628c2ecf20Sopenharmony_ci			 0, 2, SC9863A_MUX_FLAG);
5638c2ecf20Sopenharmony_ci
5648c2ecf20Sopenharmony_cistatic const struct clk_parent_data mm_ahb_parents[] = {
5658c2ecf20Sopenharmony_ci	{ .fw_name = "ext-26m" },
5668c2ecf20Sopenharmony_ci	{ .hw = &twpll_96m.hw  },
5678c2ecf20Sopenharmony_ci	{ .hw = &twpll_128m.hw  },
5688c2ecf20Sopenharmony_ci	{ .hw = &twpll_153m6.hw  },
5698c2ecf20Sopenharmony_ci};
5708c2ecf20Sopenharmony_cistatic SPRD_MUX_CLK_DATA(mm_ahb, "mm-ahb", mm_ahb_parents, 0x354,
5718c2ecf20Sopenharmony_ci			 0, 2, SC9863A_MUX_FLAG);
5728c2ecf20Sopenharmony_ci
5738c2ecf20Sopenharmony_cistatic const struct clk_parent_data bpc_clk_parents[] = {
5748c2ecf20Sopenharmony_ci	{ .hw = &twpll_192m.hw  },
5758c2ecf20Sopenharmony_ci	{ .hw = &twpll_307m2.hw  },
5768c2ecf20Sopenharmony_ci	{ .hw = &twpll_384m.hw  },
5778c2ecf20Sopenharmony_ci	{ .hw = &isppll_468m.hw  },
5788c2ecf20Sopenharmony_ci	{ .hw = &dpll0_622m3.hw  },
5798c2ecf20Sopenharmony_ci};
5808c2ecf20Sopenharmony_cistatic SPRD_MUX_CLK_DATA(bpc_clk, "bpc-clk", bpc_clk_parents, 0x358,
5818c2ecf20Sopenharmony_ci			 0, 3, SC9863A_MUX_FLAG);
5828c2ecf20Sopenharmony_ci
5838c2ecf20Sopenharmony_cistatic const struct clk_parent_data dcam_if_parents[] = {
5848c2ecf20Sopenharmony_ci	{ .hw = &twpll_192m.hw  },
5858c2ecf20Sopenharmony_ci	{ .hw = &twpll_256m.hw  },
5868c2ecf20Sopenharmony_ci	{ .hw = &twpll_307m2.hw  },
5878c2ecf20Sopenharmony_ci	{ .hw = &twpll_384m.hw  },
5888c2ecf20Sopenharmony_ci};
5898c2ecf20Sopenharmony_cistatic SPRD_MUX_CLK_DATA(dcam_if_clk, "dcam-if-clk", dcam_if_parents, 0x35c,
5908c2ecf20Sopenharmony_ci			 0, 2, SC9863A_MUX_FLAG);
5918c2ecf20Sopenharmony_ci
5928c2ecf20Sopenharmony_cistatic const struct clk_parent_data isp_parents[] = {
5938c2ecf20Sopenharmony_ci	{ .hw = &twpll_128m.hw  },
5948c2ecf20Sopenharmony_ci	{ .hw = &twpll_256m.hw  },
5958c2ecf20Sopenharmony_ci	{ .hw = &twpll_307m2.hw  },
5968c2ecf20Sopenharmony_ci	{ .hw = &twpll_384m.hw  },
5978c2ecf20Sopenharmony_ci	{ .hw = &isppll_468m.hw  },
5988c2ecf20Sopenharmony_ci};
5998c2ecf20Sopenharmony_cistatic SPRD_MUX_CLK_DATA(isp_clk, "isp-clk", isp_parents, 0x360,
6008c2ecf20Sopenharmony_ci			 0, 3, SC9863A_MUX_FLAG);
6018c2ecf20Sopenharmony_ci
6028c2ecf20Sopenharmony_cistatic const struct clk_parent_data jpg_parents[] = {
6038c2ecf20Sopenharmony_ci	{ .hw = &twpll_76m8.hw  },
6048c2ecf20Sopenharmony_ci	{ .hw = &twpll_128m.hw  },
6058c2ecf20Sopenharmony_ci	{ .hw = &twpll_256m.hw  },
6068c2ecf20Sopenharmony_ci	{ .hw = &twpll_307m2.hw  },
6078c2ecf20Sopenharmony_ci};
6088c2ecf20Sopenharmony_cistatic SPRD_MUX_CLK_DATA(jpg_clk, "jpg-clk", jpg_parents, 0x364,
6098c2ecf20Sopenharmony_ci			 0, 2, SC9863A_MUX_FLAG);
6108c2ecf20Sopenharmony_cistatic SPRD_MUX_CLK_DATA(cpp_clk, "cpp-clk", jpg_parents, 0x368,
6118c2ecf20Sopenharmony_ci			 0, 2, SC9863A_MUX_FLAG);
6128c2ecf20Sopenharmony_ci
6138c2ecf20Sopenharmony_cistatic const struct clk_parent_data sensor_parents[] = {
6148c2ecf20Sopenharmony_ci	{ .fw_name = "ext-26m" },
6158c2ecf20Sopenharmony_ci	{ .hw = &twpll_48m.hw  },
6168c2ecf20Sopenharmony_ci	{ .hw = &twpll_76m8.hw  },
6178c2ecf20Sopenharmony_ci	{ .hw = &twpll_96m.hw  },
6188c2ecf20Sopenharmony_ci};
6198c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK_DATA(sensor0_clk, "sensor0-clk", sensor_parents, 0x36c,
6208c2ecf20Sopenharmony_ci			  0, 2, 8, 3, 0);
6218c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK_DATA(sensor1_clk, "sensor1-clk", sensor_parents, 0x370,
6228c2ecf20Sopenharmony_ci			  0, 2, 8, 3, 0);
6238c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK_DATA(sensor2_clk, "sensor2-clk", sensor_parents, 0x374,
6248c2ecf20Sopenharmony_ci			  0, 2, 8, 3, 0);
6258c2ecf20Sopenharmony_ci
6268c2ecf20Sopenharmony_cistatic const struct clk_parent_data mm_vemc_parents[] = {
6278c2ecf20Sopenharmony_ci	{ .fw_name = "ext-26m" },
6288c2ecf20Sopenharmony_ci	{ .hw = &twpll_307m2.hw  },
6298c2ecf20Sopenharmony_ci	{ .hw = &twpll_384m.hw  },
6308c2ecf20Sopenharmony_ci	{ .hw = &isppll_468m.hw  },
6318c2ecf20Sopenharmony_ci};
6328c2ecf20Sopenharmony_cistatic SPRD_MUX_CLK_DATA(mm_vemc, "mm-vemc", mm_vemc_parents, 0x378,
6338c2ecf20Sopenharmony_ci			 0, 2, SC9863A_MUX_FLAG);
6348c2ecf20Sopenharmony_ci
6358c2ecf20Sopenharmony_cistatic SPRD_MUX_CLK_DATA(mm_vahb, "mm-vahb", mm_ahb_parents, 0x37c,
6368c2ecf20Sopenharmony_ci			 0, 2, SC9863A_MUX_FLAG);
6378c2ecf20Sopenharmony_ci
6388c2ecf20Sopenharmony_cistatic const struct clk_parent_data vsp_parents[] = {
6398c2ecf20Sopenharmony_ci	{ .hw = &twpll_76m8.hw  },
6408c2ecf20Sopenharmony_ci	{ .hw = &twpll_128m.hw  },
6418c2ecf20Sopenharmony_ci	{ .hw = &twpll_256m.hw  },
6428c2ecf20Sopenharmony_ci	{ .hw = &twpll_307m2.hw  },
6438c2ecf20Sopenharmony_ci	{ .hw = &twpll_384m.hw  },
6448c2ecf20Sopenharmony_ci};
6458c2ecf20Sopenharmony_cistatic SPRD_MUX_CLK_DATA(clk_vsp, "vsp-clk", vsp_parents, 0x380,
6468c2ecf20Sopenharmony_ci			 0, 3, SC9863A_MUX_FLAG);
6478c2ecf20Sopenharmony_ci
6488c2ecf20Sopenharmony_cistatic const struct clk_parent_data core_parents[] = {
6498c2ecf20Sopenharmony_ci	{ .fw_name = "ext-26m" },
6508c2ecf20Sopenharmony_ci	{ .hw = &twpll_512m.hw  },
6518c2ecf20Sopenharmony_ci	{ .hw = &twpll_768m.hw  },
6528c2ecf20Sopenharmony_ci	{ .hw = &lpll.common.hw  },
6538c2ecf20Sopenharmony_ci	{ .hw = &dpll0.common.hw  },
6548c2ecf20Sopenharmony_ci	{ .hw = &mpll2.common.hw  },
6558c2ecf20Sopenharmony_ci	{ .hw = &mpll0.common.hw  },
6568c2ecf20Sopenharmony_ci	{ .hw = &mpll1.common.hw  },
6578c2ecf20Sopenharmony_ci};
6588c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK_DATA(core0_clk, "core0-clk", core_parents, 0xa20,
6598c2ecf20Sopenharmony_ci			  0, 3, 8, 3, 0);
6608c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK_DATA(core1_clk, "core1-clk", core_parents, 0xa24,
6618c2ecf20Sopenharmony_ci			  0, 3, 8, 3, 0);
6628c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK_DATA(core2_clk, "core2-clk", core_parents, 0xa28,
6638c2ecf20Sopenharmony_ci			  0, 3, 8, 3, 0);
6648c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK_DATA(core3_clk, "core3-clk", core_parents, 0xa2c,
6658c2ecf20Sopenharmony_ci			  0, 3, 8, 3, 0);
6668c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK_DATA(core4_clk, "core4-clk", core_parents, 0xa30,
6678c2ecf20Sopenharmony_ci			  0, 3, 8, 3, 0);
6688c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK_DATA(core5_clk, "core5-clk", core_parents, 0xa34,
6698c2ecf20Sopenharmony_ci			  0, 3, 8, 3, 0);
6708c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK_DATA(core6_clk, "core6-clk", core_parents, 0xa38,
6718c2ecf20Sopenharmony_ci			  0, 3, 8, 3, 0);
6728c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK_DATA(core7_clk, "core7-clk", core_parents, 0xa3c,
6738c2ecf20Sopenharmony_ci			  0, 3, 8, 3, 0);
6748c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK_DATA(scu_clk, "scu-clk", core_parents, 0xa40,
6758c2ecf20Sopenharmony_ci			  0, 3, 8, 3, 0);
6768c2ecf20Sopenharmony_ci
6778c2ecf20Sopenharmony_cistatic SPRD_DIV_CLK_HW(ace_clk, "ace-clk", &scu_clk.common.hw, 0xa44,
6788c2ecf20Sopenharmony_ci		       8, 3, 0);
6798c2ecf20Sopenharmony_cistatic SPRD_DIV_CLK_HW(axi_periph_clk, "axi-periph-clk", &scu_clk.common.hw, 0xa48,
6808c2ecf20Sopenharmony_ci		       8, 3, 0);
6818c2ecf20Sopenharmony_cistatic SPRD_DIV_CLK_HW(axi_acp_clk, "axi-acp-clk", &scu_clk.common.hw, 0xa4c,
6828c2ecf20Sopenharmony_ci		       8, 3, 0);
6838c2ecf20Sopenharmony_ci
6848c2ecf20Sopenharmony_cistatic const struct clk_parent_data atb_parents[] = {
6858c2ecf20Sopenharmony_ci	{ .fw_name = "ext-26m" },
6868c2ecf20Sopenharmony_ci	{ .hw = &twpll_384m.hw  },
6878c2ecf20Sopenharmony_ci	{ .hw = &twpll_512m.hw  },
6888c2ecf20Sopenharmony_ci	{ .hw = &mpll2.common.hw  },
6898c2ecf20Sopenharmony_ci};
6908c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK_DATA(atb_clk, "atb-clk", atb_parents, 0xa50,
6918c2ecf20Sopenharmony_ci			  0, 2, 8, 3, 0);
6928c2ecf20Sopenharmony_cistatic SPRD_DIV_CLK_HW(debug_apb_clk, "debug-apb-clk", &atb_clk.common.hw, 0xa54,
6938c2ecf20Sopenharmony_ci		       8, 3, 0);
6948c2ecf20Sopenharmony_ci
6958c2ecf20Sopenharmony_cistatic const struct clk_parent_data gic_parents[] = {
6968c2ecf20Sopenharmony_ci	{ .fw_name = "ext-26m" },
6978c2ecf20Sopenharmony_ci	{ .hw = &twpll_153m6.hw  },
6988c2ecf20Sopenharmony_ci	{ .hw = &twpll_384m.hw  },
6998c2ecf20Sopenharmony_ci	{ .hw = &twpll_512m.hw  },
7008c2ecf20Sopenharmony_ci};
7018c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK_DATA(gic_clk, "gic-clk", gic_parents, 0xa58,
7028c2ecf20Sopenharmony_ci			  0, 2, 8, 3, 0);
7038c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK_DATA(periph_clk, "periph-clk", gic_parents, 0xa5c,
7048c2ecf20Sopenharmony_ci			  0, 2, 8, 3, 0);
7058c2ecf20Sopenharmony_ci
7068c2ecf20Sopenharmony_cistatic struct sprd_clk_common *sc9863a_aon_clks[] = {
7078c2ecf20Sopenharmony_ci	/* address base is 0x402d0000 */
7088c2ecf20Sopenharmony_ci	&emc_clk.common,
7098c2ecf20Sopenharmony_ci	&aon_apb.common,
7108c2ecf20Sopenharmony_ci	&adi_clk.common,
7118c2ecf20Sopenharmony_ci	&aux0_clk.common,
7128c2ecf20Sopenharmony_ci	&aux1_clk.common,
7138c2ecf20Sopenharmony_ci	&aux2_clk.common,
7148c2ecf20Sopenharmony_ci	&probe_clk.common,
7158c2ecf20Sopenharmony_ci	&pwm0_clk.common,
7168c2ecf20Sopenharmony_ci	&pwm1_clk.common,
7178c2ecf20Sopenharmony_ci	&pwm2_clk.common,
7188c2ecf20Sopenharmony_ci	&aon_thm_clk.common,
7198c2ecf20Sopenharmony_ci	&audif_clk.common,
7208c2ecf20Sopenharmony_ci	&cpu_dap_clk.common,
7218c2ecf20Sopenharmony_ci	&cpu_ts_clk.common,
7228c2ecf20Sopenharmony_ci	&djtag_tck_clk.common,
7238c2ecf20Sopenharmony_ci	&emc_ref_clk.common,
7248c2ecf20Sopenharmony_ci	&cssys_clk.common,
7258c2ecf20Sopenharmony_ci	&aon_pmu_clk.common,
7268c2ecf20Sopenharmony_ci	&pmu_26m_clk.common,
7278c2ecf20Sopenharmony_ci	&aon_tmr_clk.common,
7288c2ecf20Sopenharmony_ci	&power_cpu_clk.common,
7298c2ecf20Sopenharmony_ci	&ap_axi.common,
7308c2ecf20Sopenharmony_ci	&sdio0_2x.common,
7318c2ecf20Sopenharmony_ci	&sdio1_2x.common,
7328c2ecf20Sopenharmony_ci	&sdio2_2x.common,
7338c2ecf20Sopenharmony_ci	&emmc_2x.common,
7348c2ecf20Sopenharmony_ci	&dpu_clk.common,
7358c2ecf20Sopenharmony_ci	&dpu_dpi.common,
7368c2ecf20Sopenharmony_ci	&otg_ref_clk.common,
7378c2ecf20Sopenharmony_ci	&sdphy_apb_clk.common,
7388c2ecf20Sopenharmony_ci	&alg_io_apb_clk.common,
7398c2ecf20Sopenharmony_ci	&gpu_core.common,
7408c2ecf20Sopenharmony_ci	&gpu_soc.common,
7418c2ecf20Sopenharmony_ci	&mm_emc.common,
7428c2ecf20Sopenharmony_ci	&mm_ahb.common,
7438c2ecf20Sopenharmony_ci	&bpc_clk.common,
7448c2ecf20Sopenharmony_ci	&dcam_if_clk.common,
7458c2ecf20Sopenharmony_ci	&isp_clk.common,
7468c2ecf20Sopenharmony_ci	&jpg_clk.common,
7478c2ecf20Sopenharmony_ci	&cpp_clk.common,
7488c2ecf20Sopenharmony_ci	&sensor0_clk.common,
7498c2ecf20Sopenharmony_ci	&sensor1_clk.common,
7508c2ecf20Sopenharmony_ci	&sensor2_clk.common,
7518c2ecf20Sopenharmony_ci	&mm_vemc.common,
7528c2ecf20Sopenharmony_ci	&mm_vahb.common,
7538c2ecf20Sopenharmony_ci	&clk_vsp.common,
7548c2ecf20Sopenharmony_ci	&core0_clk.common,
7558c2ecf20Sopenharmony_ci	&core1_clk.common,
7568c2ecf20Sopenharmony_ci	&core2_clk.common,
7578c2ecf20Sopenharmony_ci	&core3_clk.common,
7588c2ecf20Sopenharmony_ci	&core4_clk.common,
7598c2ecf20Sopenharmony_ci	&core5_clk.common,
7608c2ecf20Sopenharmony_ci	&core6_clk.common,
7618c2ecf20Sopenharmony_ci	&core7_clk.common,
7628c2ecf20Sopenharmony_ci	&scu_clk.common,
7638c2ecf20Sopenharmony_ci	&ace_clk.common,
7648c2ecf20Sopenharmony_ci	&axi_periph_clk.common,
7658c2ecf20Sopenharmony_ci	&axi_acp_clk.common,
7668c2ecf20Sopenharmony_ci	&atb_clk.common,
7678c2ecf20Sopenharmony_ci	&debug_apb_clk.common,
7688c2ecf20Sopenharmony_ci	&gic_clk.common,
7698c2ecf20Sopenharmony_ci	&periph_clk.common,
7708c2ecf20Sopenharmony_ci};
7718c2ecf20Sopenharmony_ci
7728c2ecf20Sopenharmony_cistatic struct clk_hw_onecell_data sc9863a_aon_clk_hws = {
7738c2ecf20Sopenharmony_ci	.hws	= {
7748c2ecf20Sopenharmony_ci		[CLK_13M]		= &clk_13m.hw,
7758c2ecf20Sopenharmony_ci		[CLK_6M5]		= &clk_6m5.hw,
7768c2ecf20Sopenharmony_ci		[CLK_4M3]		= &clk_4m3.hw,
7778c2ecf20Sopenharmony_ci		[CLK_2M]		= &clk_2m.hw,
7788c2ecf20Sopenharmony_ci		[CLK_250K]		= &clk_250k.hw,
7798c2ecf20Sopenharmony_ci		[CLK_RCO_25M]		= &rco_25m.hw,
7808c2ecf20Sopenharmony_ci		[CLK_RCO_4M]		= &rco_4m.hw,
7818c2ecf20Sopenharmony_ci		[CLK_RCO_2M]		= &rco_2m.hw,
7828c2ecf20Sopenharmony_ci		[CLK_EMC]		= &emc_clk.common.hw,
7838c2ecf20Sopenharmony_ci		[CLK_AON_APB]		= &aon_apb.common.hw,
7848c2ecf20Sopenharmony_ci		[CLK_ADI]		= &adi_clk.common.hw,
7858c2ecf20Sopenharmony_ci		[CLK_AUX0]		= &aux0_clk.common.hw,
7868c2ecf20Sopenharmony_ci		[CLK_AUX1]		= &aux1_clk.common.hw,
7878c2ecf20Sopenharmony_ci		[CLK_AUX2]		= &aux2_clk.common.hw,
7888c2ecf20Sopenharmony_ci		[CLK_PROBE]		= &probe_clk.common.hw,
7898c2ecf20Sopenharmony_ci		[CLK_PWM0]		= &pwm0_clk.common.hw,
7908c2ecf20Sopenharmony_ci		[CLK_PWM1]		= &pwm1_clk.common.hw,
7918c2ecf20Sopenharmony_ci		[CLK_PWM2]		= &pwm2_clk.common.hw,
7928c2ecf20Sopenharmony_ci		[CLK_AON_THM]		= &aon_thm_clk.common.hw,
7938c2ecf20Sopenharmony_ci		[CLK_AUDIF]		= &audif_clk.common.hw,
7948c2ecf20Sopenharmony_ci		[CLK_CPU_DAP]		= &cpu_dap_clk.common.hw,
7958c2ecf20Sopenharmony_ci		[CLK_CPU_TS]		= &cpu_ts_clk.common.hw,
7968c2ecf20Sopenharmony_ci		[CLK_DJTAG_TCK]		= &djtag_tck_clk.common.hw,
7978c2ecf20Sopenharmony_ci		[CLK_EMC_REF]		= &emc_ref_clk.common.hw,
7988c2ecf20Sopenharmony_ci		[CLK_CSSYS]		= &cssys_clk.common.hw,
7998c2ecf20Sopenharmony_ci		[CLK_AON_PMU]		= &aon_pmu_clk.common.hw,
8008c2ecf20Sopenharmony_ci		[CLK_PMU_26M]		= &pmu_26m_clk.common.hw,
8018c2ecf20Sopenharmony_ci		[CLK_AON_TMR]		= &aon_tmr_clk.common.hw,
8028c2ecf20Sopenharmony_ci		[CLK_POWER_CPU]		= &power_cpu_clk.common.hw,
8038c2ecf20Sopenharmony_ci		[CLK_AP_AXI]		= &ap_axi.common.hw,
8048c2ecf20Sopenharmony_ci		[CLK_SDIO0_2X]		= &sdio0_2x.common.hw,
8058c2ecf20Sopenharmony_ci		[CLK_SDIO1_2X]		= &sdio1_2x.common.hw,
8068c2ecf20Sopenharmony_ci		[CLK_SDIO2_2X]		= &sdio2_2x.common.hw,
8078c2ecf20Sopenharmony_ci		[CLK_EMMC_2X]		= &emmc_2x.common.hw,
8088c2ecf20Sopenharmony_ci		[CLK_DPU]		= &dpu_clk.common.hw,
8098c2ecf20Sopenharmony_ci		[CLK_DPU_DPI]		= &dpu_dpi.common.hw,
8108c2ecf20Sopenharmony_ci		[CLK_OTG_REF]		= &otg_ref_clk.common.hw,
8118c2ecf20Sopenharmony_ci		[CLK_SDPHY_APB]		= &sdphy_apb_clk.common.hw,
8128c2ecf20Sopenharmony_ci		[CLK_ALG_IO_APB]	= &alg_io_apb_clk.common.hw,
8138c2ecf20Sopenharmony_ci		[CLK_GPU_CORE]		= &gpu_core.common.hw,
8148c2ecf20Sopenharmony_ci		[CLK_GPU_SOC]		= &gpu_soc.common.hw,
8158c2ecf20Sopenharmony_ci		[CLK_MM_EMC]		= &mm_emc.common.hw,
8168c2ecf20Sopenharmony_ci		[CLK_MM_AHB]		= &mm_ahb.common.hw,
8178c2ecf20Sopenharmony_ci		[CLK_BPC]		= &bpc_clk.common.hw,
8188c2ecf20Sopenharmony_ci		[CLK_DCAM_IF]		= &dcam_if_clk.common.hw,
8198c2ecf20Sopenharmony_ci		[CLK_ISP]		= &isp_clk.common.hw,
8208c2ecf20Sopenharmony_ci		[CLK_JPG]		= &jpg_clk.common.hw,
8218c2ecf20Sopenharmony_ci		[CLK_CPP]		= &cpp_clk.common.hw,
8228c2ecf20Sopenharmony_ci		[CLK_SENSOR0]		= &sensor0_clk.common.hw,
8238c2ecf20Sopenharmony_ci		[CLK_SENSOR1]		= &sensor1_clk.common.hw,
8248c2ecf20Sopenharmony_ci		[CLK_SENSOR2]		= &sensor2_clk.common.hw,
8258c2ecf20Sopenharmony_ci		[CLK_MM_VEMC]		= &mm_vemc.common.hw,
8268c2ecf20Sopenharmony_ci		[CLK_MM_VAHB]		= &mm_vahb.common.hw,
8278c2ecf20Sopenharmony_ci		[CLK_VSP]		= &clk_vsp.common.hw,
8288c2ecf20Sopenharmony_ci		[CLK_CORE0]		= &core0_clk.common.hw,
8298c2ecf20Sopenharmony_ci		[CLK_CORE1]		= &core1_clk.common.hw,
8308c2ecf20Sopenharmony_ci		[CLK_CORE2]		= &core2_clk.common.hw,
8318c2ecf20Sopenharmony_ci		[CLK_CORE3]		= &core3_clk.common.hw,
8328c2ecf20Sopenharmony_ci		[CLK_CORE4]		= &core4_clk.common.hw,
8338c2ecf20Sopenharmony_ci		[CLK_CORE5]		= &core5_clk.common.hw,
8348c2ecf20Sopenharmony_ci		[CLK_CORE6]		= &core6_clk.common.hw,
8358c2ecf20Sopenharmony_ci		[CLK_CORE7]		= &core7_clk.common.hw,
8368c2ecf20Sopenharmony_ci		[CLK_SCU]		= &scu_clk.common.hw,
8378c2ecf20Sopenharmony_ci		[CLK_ACE]		= &ace_clk.common.hw,
8388c2ecf20Sopenharmony_ci		[CLK_AXI_PERIPH]	= &axi_periph_clk.common.hw,
8398c2ecf20Sopenharmony_ci		[CLK_AXI_ACP]		= &axi_acp_clk.common.hw,
8408c2ecf20Sopenharmony_ci		[CLK_ATB]		= &atb_clk.common.hw,
8418c2ecf20Sopenharmony_ci		[CLK_DEBUG_APB]		= &debug_apb_clk.common.hw,
8428c2ecf20Sopenharmony_ci		[CLK_GIC]		= &gic_clk.common.hw,
8438c2ecf20Sopenharmony_ci		[CLK_PERIPH]		= &periph_clk.common.hw,
8448c2ecf20Sopenharmony_ci	},
8458c2ecf20Sopenharmony_ci	.num	= CLK_AON_CLK_NUM,
8468c2ecf20Sopenharmony_ci};
8478c2ecf20Sopenharmony_ci
8488c2ecf20Sopenharmony_cistatic const struct sprd_clk_desc sc9863a_aon_clk_desc = {
8498c2ecf20Sopenharmony_ci	.clk_clks	= sc9863a_aon_clks,
8508c2ecf20Sopenharmony_ci	.num_clk_clks	= ARRAY_SIZE(sc9863a_aon_clks),
8518c2ecf20Sopenharmony_ci	.hw_clks	= &sc9863a_aon_clk_hws,
8528c2ecf20Sopenharmony_ci};
8538c2ecf20Sopenharmony_ci
8548c2ecf20Sopenharmony_cistatic const struct clk_parent_data ap_apb_parents[] = {
8558c2ecf20Sopenharmony_ci	{ .fw_name = "ext-26m" },
8568c2ecf20Sopenharmony_ci	{ .hw = &twpll_64m.hw  },
8578c2ecf20Sopenharmony_ci	{ .hw = &twpll_96m.hw  },
8588c2ecf20Sopenharmony_ci	{ .hw = &twpll_128m.hw  },
8598c2ecf20Sopenharmony_ci};
8608c2ecf20Sopenharmony_cistatic SPRD_MUX_CLK_DATA(ap_apb, "ap-apb", ap_apb_parents, 0x20,
8618c2ecf20Sopenharmony_ci			 0, 2, SC9863A_MUX_FLAG);
8628c2ecf20Sopenharmony_ci
8638c2ecf20Sopenharmony_cistatic const struct clk_parent_data ap_ce_parents[] = {
8648c2ecf20Sopenharmony_ci	{ .fw_name = "ext-26m" },
8658c2ecf20Sopenharmony_ci	{ .hw = &twpll_256m.hw  },
8668c2ecf20Sopenharmony_ci};
8678c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK_DATA(ap_ce, "ap-ce", ap_ce_parents, 0x24,
8688c2ecf20Sopenharmony_ci			  0, 1, 8, 3, 0);
8698c2ecf20Sopenharmony_ci
8708c2ecf20Sopenharmony_cistatic const struct clk_parent_data nandc_ecc_parents[] = {
8718c2ecf20Sopenharmony_ci	{ .fw_name = "ext-26m" },
8728c2ecf20Sopenharmony_ci	{ .hw = &twpll_256m.hw  },
8738c2ecf20Sopenharmony_ci	{ .hw = &twpll_307m2.hw  },
8748c2ecf20Sopenharmony_ci};
8758c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK_DATA(nandc_ecc, "nandc-ecc", nandc_ecc_parents, 0x28,
8768c2ecf20Sopenharmony_ci			  0, 2, 8, 3, 0);
8778c2ecf20Sopenharmony_ci
8788c2ecf20Sopenharmony_cistatic const struct clk_parent_data nandc_26m_parents[] = {
8798c2ecf20Sopenharmony_ci	{ .fw_name = "ext-32k" },
8808c2ecf20Sopenharmony_ci	{ .fw_name = "ext-26m" },
8818c2ecf20Sopenharmony_ci};
8828c2ecf20Sopenharmony_cistatic SPRD_MUX_CLK_DATA(nandc_26m, "nandc-26m", nandc_26m_parents, 0x2c,
8838c2ecf20Sopenharmony_ci			 0, 1, SC9863A_MUX_FLAG);
8848c2ecf20Sopenharmony_cistatic SPRD_MUX_CLK_DATA(emmc_32k, "emmc-32k", nandc_26m_parents, 0x30,
8858c2ecf20Sopenharmony_ci			 0, 1, SC9863A_MUX_FLAG);
8868c2ecf20Sopenharmony_cistatic SPRD_MUX_CLK_DATA(sdio0_32k, "sdio0-32k", nandc_26m_parents, 0x34,
8878c2ecf20Sopenharmony_ci			 0, 1, SC9863A_MUX_FLAG);
8888c2ecf20Sopenharmony_cistatic SPRD_MUX_CLK_DATA(sdio1_32k, "sdio1-32k", nandc_26m_parents, 0x38,
8898c2ecf20Sopenharmony_ci			 0, 1, SC9863A_MUX_FLAG);
8908c2ecf20Sopenharmony_cistatic SPRD_MUX_CLK_DATA(sdio2_32k, "sdio2-32k", nandc_26m_parents, 0x3c,
8918c2ecf20Sopenharmony_ci			 0, 1, SC9863A_MUX_FLAG);
8928c2ecf20Sopenharmony_ci
8938c2ecf20Sopenharmony_cistatic SPRD_GATE_CLK_HW(otg_utmi, "otg-utmi", &aon_apb.common.hw, 0x40,
8948c2ecf20Sopenharmony_ci			BIT(16), 0, 0);
8958c2ecf20Sopenharmony_ci
8968c2ecf20Sopenharmony_cistatic const struct clk_parent_data ap_uart_parents[] = {
8978c2ecf20Sopenharmony_ci	{ .fw_name = "ext-26m" },
8988c2ecf20Sopenharmony_ci	{ .hw = &twpll_48m.hw  },
8998c2ecf20Sopenharmony_ci	{ .hw = &twpll_51m2.hw  },
9008c2ecf20Sopenharmony_ci	{ .hw = &twpll_96m.hw  },
9018c2ecf20Sopenharmony_ci};
9028c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK_DATA(ap_uart0,	"ap-uart0",	ap_uart_parents, 0x44,
9038c2ecf20Sopenharmony_ci			  0, 2, 8, 3, 0);
9048c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK_DATA(ap_uart1,	"ap-uart1",	ap_uart_parents, 0x48,
9058c2ecf20Sopenharmony_ci			  0, 2, 8, 3, 0);
9068c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK_DATA(ap_uart2,	"ap-uart2",	ap_uart_parents, 0x4c,
9078c2ecf20Sopenharmony_ci			  0, 2, 8, 3, 0);
9088c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK_DATA(ap_uart3,	"ap-uart3",	ap_uart_parents, 0x50,
9098c2ecf20Sopenharmony_ci			  0, 2, 8, 3, 0);
9108c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK_DATA(ap_uart4,	"ap-uart4",	ap_uart_parents, 0x54,
9118c2ecf20Sopenharmony_ci			  0, 2, 8, 3, 0);
9128c2ecf20Sopenharmony_ci
9138c2ecf20Sopenharmony_cistatic const struct clk_parent_data i2c_parents[] = {
9148c2ecf20Sopenharmony_ci	{ .fw_name = "ext-26m" },
9158c2ecf20Sopenharmony_ci	{ .hw = &twpll_48m.hw  },
9168c2ecf20Sopenharmony_ci	{ .hw = &twpll_51m2.hw  },
9178c2ecf20Sopenharmony_ci	{ .hw = &twpll_153m6.hw  },
9188c2ecf20Sopenharmony_ci};
9198c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK_DATA(ap_i2c0, "ap-i2c0", i2c_parents, 0x58,
9208c2ecf20Sopenharmony_ci			  0, 2, 8, 3, 0);
9218c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK_DATA(ap_i2c1, "ap-i2c1", i2c_parents, 0x5c,
9228c2ecf20Sopenharmony_ci			  0, 2, 8, 3, 0);
9238c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK_DATA(ap_i2c2, "ap-i2c2", i2c_parents, 0x60,
9248c2ecf20Sopenharmony_ci			  0, 2, 8, 3, 0);
9258c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK_DATA(ap_i2c3, "ap-i2c3", i2c_parents, 0x64,
9268c2ecf20Sopenharmony_ci			  0, 2, 8, 3, 0);
9278c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK_DATA(ap_i2c4, "ap-i2c4", i2c_parents, 0x68,
9288c2ecf20Sopenharmony_ci			  0, 2, 8, 3, 0);
9298c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK_DATA(ap_i2c5, "ap-i2c5", i2c_parents, 0x6c,
9308c2ecf20Sopenharmony_ci			  0, 2, 8, 3, 0);
9318c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK_DATA(ap_i2c6, "ap-i2c6", i2c_parents, 0x70,
9328c2ecf20Sopenharmony_ci			  0, 2, 8, 3, 0);
9338c2ecf20Sopenharmony_ci
9348c2ecf20Sopenharmony_cistatic const struct clk_parent_data spi_parents[] = {
9358c2ecf20Sopenharmony_ci	{ .fw_name = "ext-26m" },
9368c2ecf20Sopenharmony_ci	{ .hw = &twpll_128m.hw  },
9378c2ecf20Sopenharmony_ci	{ .hw = &twpll_153m6.hw  },
9388c2ecf20Sopenharmony_ci	{ .hw = &twpll_192m.hw  },
9398c2ecf20Sopenharmony_ci};
9408c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK_DATA(ap_spi0, "ap-spi0", spi_parents, 0x74,
9418c2ecf20Sopenharmony_ci			  0, 2, 8, 3, 0);
9428c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK_DATA(ap_spi1, "ap-spi1", spi_parents, 0x78,
9438c2ecf20Sopenharmony_ci			  0, 2, 8, 3, 0);
9448c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK_DATA(ap_spi2, "ap-spi2", spi_parents, 0x7c,
9458c2ecf20Sopenharmony_ci			  0, 2, 8, 3, 0);
9468c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK_DATA(ap_spi3, "ap-spi3", spi_parents, 0x80,
9478c2ecf20Sopenharmony_ci			  0, 2, 8, 3, 0);
9488c2ecf20Sopenharmony_ci
9498c2ecf20Sopenharmony_cistatic const struct clk_parent_data iis_parents[] = {
9508c2ecf20Sopenharmony_ci	{ .fw_name = "ext-26m" },
9518c2ecf20Sopenharmony_ci	{ .hw = &twpll_128m.hw  },
9528c2ecf20Sopenharmony_ci	{ .hw = &twpll_153m6.hw  },
9538c2ecf20Sopenharmony_ci};
9548c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK_DATA(ap_iis0, "ap-iis0", iis_parents, 0x84,
9558c2ecf20Sopenharmony_ci			  0, 2, 8, 3, 0);
9568c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK_DATA(ap_iis1, "ap-iis1", iis_parents, 0x88,
9578c2ecf20Sopenharmony_ci			  0, 2, 8, 3, 0);
9588c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK_DATA(ap_iis2, "ap-iis2", iis_parents, 0x8c,
9598c2ecf20Sopenharmony_ci			  0, 2, 8, 3, 0);
9608c2ecf20Sopenharmony_ci
9618c2ecf20Sopenharmony_cistatic const struct clk_parent_data sim0_parents[] = {
9628c2ecf20Sopenharmony_ci	{ .fw_name = "ext-26m" },
9638c2ecf20Sopenharmony_ci	{ .hw = &twpll_51m2.hw  },
9648c2ecf20Sopenharmony_ci	{ .hw = &twpll_64m.hw  },
9658c2ecf20Sopenharmony_ci	{ .hw = &twpll_96m.hw  },
9668c2ecf20Sopenharmony_ci	{ .hw = &twpll_128m.hw  },
9678c2ecf20Sopenharmony_ci};
9688c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK_DATA(sim0, "sim0", sim0_parents, 0x90,
9698c2ecf20Sopenharmony_ci			  0, 3, 8, 3, 0);
9708c2ecf20Sopenharmony_ci
9718c2ecf20Sopenharmony_cistatic const struct clk_parent_data sim0_32k_parents[] = {
9728c2ecf20Sopenharmony_ci	{ .fw_name = "ext-32k" },
9738c2ecf20Sopenharmony_ci	{ .fw_name = "ext-26m" },
9748c2ecf20Sopenharmony_ci};
9758c2ecf20Sopenharmony_cistatic SPRD_MUX_CLK_DATA(sim0_32k, "sim0-32k", sim0_32k_parents, 0x94,
9768c2ecf20Sopenharmony_ci			 0, 1, SC9863A_MUX_FLAG);
9778c2ecf20Sopenharmony_ci
9788c2ecf20Sopenharmony_cistatic struct sprd_clk_common *sc9863a_ap_clks[] = {
9798c2ecf20Sopenharmony_ci	/* address base is 0x21500000 */
9808c2ecf20Sopenharmony_ci	&ap_apb.common,
9818c2ecf20Sopenharmony_ci	&ap_ce.common,
9828c2ecf20Sopenharmony_ci	&nandc_ecc.common,
9838c2ecf20Sopenharmony_ci	&nandc_26m.common,
9848c2ecf20Sopenharmony_ci	&emmc_32k.common,
9858c2ecf20Sopenharmony_ci	&sdio0_32k.common,
9868c2ecf20Sopenharmony_ci	&sdio1_32k.common,
9878c2ecf20Sopenharmony_ci	&sdio2_32k.common,
9888c2ecf20Sopenharmony_ci	&otg_utmi.common,
9898c2ecf20Sopenharmony_ci	&ap_uart0.common,
9908c2ecf20Sopenharmony_ci	&ap_uart1.common,
9918c2ecf20Sopenharmony_ci	&ap_uart2.common,
9928c2ecf20Sopenharmony_ci	&ap_uart3.common,
9938c2ecf20Sopenharmony_ci	&ap_uart4.common,
9948c2ecf20Sopenharmony_ci	&ap_i2c0.common,
9958c2ecf20Sopenharmony_ci	&ap_i2c1.common,
9968c2ecf20Sopenharmony_ci	&ap_i2c2.common,
9978c2ecf20Sopenharmony_ci	&ap_i2c3.common,
9988c2ecf20Sopenharmony_ci	&ap_i2c4.common,
9998c2ecf20Sopenharmony_ci	&ap_i2c5.common,
10008c2ecf20Sopenharmony_ci	&ap_i2c6.common,
10018c2ecf20Sopenharmony_ci	&ap_spi0.common,
10028c2ecf20Sopenharmony_ci	&ap_spi1.common,
10038c2ecf20Sopenharmony_ci	&ap_spi2.common,
10048c2ecf20Sopenharmony_ci	&ap_spi3.common,
10058c2ecf20Sopenharmony_ci	&ap_iis0.common,
10068c2ecf20Sopenharmony_ci	&ap_iis1.common,
10078c2ecf20Sopenharmony_ci	&ap_iis2.common,
10088c2ecf20Sopenharmony_ci	&sim0.common,
10098c2ecf20Sopenharmony_ci	&sim0_32k.common,
10108c2ecf20Sopenharmony_ci};
10118c2ecf20Sopenharmony_ci
10128c2ecf20Sopenharmony_cistatic struct clk_hw_onecell_data sc9863a_ap_clk_hws = {
10138c2ecf20Sopenharmony_ci	.hws	= {
10148c2ecf20Sopenharmony_ci		[CLK_AP_APB]	= &ap_apb.common.hw,
10158c2ecf20Sopenharmony_ci		[CLK_AP_CE]	= &ap_ce.common.hw,
10168c2ecf20Sopenharmony_ci		[CLK_NANDC_ECC]	= &nandc_ecc.common.hw,
10178c2ecf20Sopenharmony_ci		[CLK_NANDC_26M]	= &nandc_26m.common.hw,
10188c2ecf20Sopenharmony_ci		[CLK_EMMC_32K]	= &emmc_32k.common.hw,
10198c2ecf20Sopenharmony_ci		[CLK_SDIO0_32K]	= &sdio0_32k.common.hw,
10208c2ecf20Sopenharmony_ci		[CLK_SDIO1_32K]	= &sdio1_32k.common.hw,
10218c2ecf20Sopenharmony_ci		[CLK_SDIO2_32K]	= &sdio2_32k.common.hw,
10228c2ecf20Sopenharmony_ci		[CLK_OTG_UTMI]	= &otg_utmi.common.hw,
10238c2ecf20Sopenharmony_ci		[CLK_AP_UART0]	= &ap_uart0.common.hw,
10248c2ecf20Sopenharmony_ci		[CLK_AP_UART1]	= &ap_uart1.common.hw,
10258c2ecf20Sopenharmony_ci		[CLK_AP_UART2]	= &ap_uart2.common.hw,
10268c2ecf20Sopenharmony_ci		[CLK_AP_UART3]	= &ap_uart3.common.hw,
10278c2ecf20Sopenharmony_ci		[CLK_AP_UART4]	= &ap_uart4.common.hw,
10288c2ecf20Sopenharmony_ci		[CLK_AP_I2C0]	= &ap_i2c0.common.hw,
10298c2ecf20Sopenharmony_ci		[CLK_AP_I2C1]	= &ap_i2c1.common.hw,
10308c2ecf20Sopenharmony_ci		[CLK_AP_I2C2]	= &ap_i2c2.common.hw,
10318c2ecf20Sopenharmony_ci		[CLK_AP_I2C3]	= &ap_i2c3.common.hw,
10328c2ecf20Sopenharmony_ci		[CLK_AP_I2C4]	= &ap_i2c4.common.hw,
10338c2ecf20Sopenharmony_ci		[CLK_AP_I2C5]	= &ap_i2c5.common.hw,
10348c2ecf20Sopenharmony_ci		[CLK_AP_I2C6]	= &ap_i2c6.common.hw,
10358c2ecf20Sopenharmony_ci		[CLK_AP_SPI0]	= &ap_spi0.common.hw,
10368c2ecf20Sopenharmony_ci		[CLK_AP_SPI1]	= &ap_spi1.common.hw,
10378c2ecf20Sopenharmony_ci		[CLK_AP_SPI2]	= &ap_spi2.common.hw,
10388c2ecf20Sopenharmony_ci		[CLK_AP_SPI3]	= &ap_spi3.common.hw,
10398c2ecf20Sopenharmony_ci		[CLK_AP_IIS0]	= &ap_iis0.common.hw,
10408c2ecf20Sopenharmony_ci		[CLK_AP_IIS1]	= &ap_iis1.common.hw,
10418c2ecf20Sopenharmony_ci		[CLK_AP_IIS2]	= &ap_iis2.common.hw,
10428c2ecf20Sopenharmony_ci		[CLK_SIM0]	= &sim0.common.hw,
10438c2ecf20Sopenharmony_ci		[CLK_SIM0_32K]	= &sim0_32k.common.hw,
10448c2ecf20Sopenharmony_ci	},
10458c2ecf20Sopenharmony_ci	.num	= CLK_AP_CLK_NUM,
10468c2ecf20Sopenharmony_ci};
10478c2ecf20Sopenharmony_ci
10488c2ecf20Sopenharmony_cistatic const struct sprd_clk_desc sc9863a_ap_clk_desc = {
10498c2ecf20Sopenharmony_ci	.clk_clks	= sc9863a_ap_clks,
10508c2ecf20Sopenharmony_ci	.num_clk_clks	= ARRAY_SIZE(sc9863a_ap_clks),
10518c2ecf20Sopenharmony_ci	.hw_clks	= &sc9863a_ap_clk_hws,
10528c2ecf20Sopenharmony_ci};
10538c2ecf20Sopenharmony_ci
10548c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(otg_eb, "otg-eb", &ap_axi.common.hw, 0x0, 0x1000,
10558c2ecf20Sopenharmony_ci			   BIT(4), 0, 0);
10568c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(dma_eb, "dma-eb", &ap_axi.common.hw, 0x0, 0x1000,
10578c2ecf20Sopenharmony_ci			   BIT(5), 0, 0);
10588c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(ce_eb, "ce-eb", &ap_axi.common.hw, 0x0, 0x1000,
10598c2ecf20Sopenharmony_ci			   BIT(6), 0, 0);
10608c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(nandc_eb, "nandc-eb", &ap_axi.common.hw, 0x0, 0x1000,
10618c2ecf20Sopenharmony_ci			   BIT(7), 0, 0);
10628c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(sdio0_eb, "sdio0-eb", &ap_axi.common.hw, 0x0, 0x1000,
10638c2ecf20Sopenharmony_ci			   BIT(8), 0, 0);
10648c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(sdio1_eb, "sdio1-eb", &ap_axi.common.hw, 0x0, 0x1000,
10658c2ecf20Sopenharmony_ci			   BIT(9), 0, 0);
10668c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(sdio2_eb, "sdio2-eb", &ap_axi.common.hw, 0x0, 0x1000,
10678c2ecf20Sopenharmony_ci			   BIT(10), 0, 0);
10688c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(emmc_eb, "emmc-eb", &ap_axi.common.hw, 0x0, 0x1000,
10698c2ecf20Sopenharmony_ci			   BIT(11), 0, 0);
10708c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(emmc_32k_eb, "emmc-32k-eb", &ap_axi.common.hw, 0x0,
10718c2ecf20Sopenharmony_ci			   0x1000, BIT(27), 0, 0);
10728c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(sdio0_32k_eb, "sdio0-32k-eb", &ap_axi.common.hw, 0x0,
10738c2ecf20Sopenharmony_ci			   0x1000, BIT(28), 0, 0);
10748c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(sdio1_32k_eb, "sdio1-32k-eb", &ap_axi.common.hw, 0x0,
10758c2ecf20Sopenharmony_ci			   0x1000, BIT(29), 0, 0);
10768c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(sdio2_32k_eb, "sdio2-32k-eb", &ap_axi.common.hw, 0x0,
10778c2ecf20Sopenharmony_ci			   0x1000, BIT(30), 0, 0);
10788c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(nandc_26m_eb, "nandc-26m-eb", &ap_axi.common.hw, 0x0,
10798c2ecf20Sopenharmony_ci			   0x1000, BIT(31), 0, 0);
10808c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(dma_eb2, "dma-eb2", &ap_axi.common.hw, 0x18,
10818c2ecf20Sopenharmony_ci			   0x1000, BIT(0), 0, 0);
10828c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(ce_eb2, "ce-eb2", &ap_axi.common.hw, 0x18,
10838c2ecf20Sopenharmony_ci			   0x1000, BIT(1), 0, 0);
10848c2ecf20Sopenharmony_ci
10858c2ecf20Sopenharmony_cistatic struct sprd_clk_common *sc9863a_apahb_gate_clks[] = {
10868c2ecf20Sopenharmony_ci	/* address base is 0x20e00000 */
10878c2ecf20Sopenharmony_ci	&otg_eb.common,
10888c2ecf20Sopenharmony_ci	&dma_eb.common,
10898c2ecf20Sopenharmony_ci	&ce_eb.common,
10908c2ecf20Sopenharmony_ci	&nandc_eb.common,
10918c2ecf20Sopenharmony_ci	&sdio0_eb.common,
10928c2ecf20Sopenharmony_ci	&sdio1_eb.common,
10938c2ecf20Sopenharmony_ci	&sdio2_eb.common,
10948c2ecf20Sopenharmony_ci	&emmc_eb.common,
10958c2ecf20Sopenharmony_ci	&emmc_32k_eb.common,
10968c2ecf20Sopenharmony_ci	&sdio0_32k_eb.common,
10978c2ecf20Sopenharmony_ci	&sdio1_32k_eb.common,
10988c2ecf20Sopenharmony_ci	&sdio2_32k_eb.common,
10998c2ecf20Sopenharmony_ci	&nandc_26m_eb.common,
11008c2ecf20Sopenharmony_ci	&dma_eb2.common,
11018c2ecf20Sopenharmony_ci	&ce_eb2.common,
11028c2ecf20Sopenharmony_ci};
11038c2ecf20Sopenharmony_ci
11048c2ecf20Sopenharmony_cistatic struct clk_hw_onecell_data sc9863a_apahb_gate_hws = {
11058c2ecf20Sopenharmony_ci	.hws	= {
11068c2ecf20Sopenharmony_ci		[CLK_OTG_EB]		= &otg_eb.common.hw,
11078c2ecf20Sopenharmony_ci		[CLK_DMA_EB]		= &dma_eb.common.hw,
11088c2ecf20Sopenharmony_ci		[CLK_CE_EB]		= &ce_eb.common.hw,
11098c2ecf20Sopenharmony_ci		[CLK_NANDC_EB]		= &nandc_eb.common.hw,
11108c2ecf20Sopenharmony_ci		[CLK_SDIO0_EB]		= &sdio0_eb.common.hw,
11118c2ecf20Sopenharmony_ci		[CLK_SDIO1_EB]		= &sdio1_eb.common.hw,
11128c2ecf20Sopenharmony_ci		[CLK_SDIO2_EB]		= &sdio2_eb.common.hw,
11138c2ecf20Sopenharmony_ci		[CLK_EMMC_EB]		= &emmc_eb.common.hw,
11148c2ecf20Sopenharmony_ci		[CLK_EMMC_32K_EB]	= &emmc_32k_eb.common.hw,
11158c2ecf20Sopenharmony_ci		[CLK_SDIO0_32K_EB]	= &sdio0_32k_eb.common.hw,
11168c2ecf20Sopenharmony_ci		[CLK_SDIO1_32K_EB]	= &sdio1_32k_eb.common.hw,
11178c2ecf20Sopenharmony_ci		[CLK_SDIO2_32K_EB]	= &sdio2_32k_eb.common.hw,
11188c2ecf20Sopenharmony_ci		[CLK_NANDC_26M_EB]	= &nandc_26m_eb.common.hw,
11198c2ecf20Sopenharmony_ci		[CLK_DMA_EB2]		= &dma_eb2.common.hw,
11208c2ecf20Sopenharmony_ci		[CLK_CE_EB2]		= &ce_eb2.common.hw,
11218c2ecf20Sopenharmony_ci	},
11228c2ecf20Sopenharmony_ci	.num	= CLK_AP_AHB_GATE_NUM,
11238c2ecf20Sopenharmony_ci};
11248c2ecf20Sopenharmony_ci
11258c2ecf20Sopenharmony_cistatic const struct sprd_clk_desc sc9863a_apahb_gate_desc = {
11268c2ecf20Sopenharmony_ci	.clk_clks	= sc9863a_apahb_gate_clks,
11278c2ecf20Sopenharmony_ci	.num_clk_clks	= ARRAY_SIZE(sc9863a_apahb_gate_clks),
11288c2ecf20Sopenharmony_ci	.hw_clks	= &sc9863a_apahb_gate_hws,
11298c2ecf20Sopenharmony_ci};
11308c2ecf20Sopenharmony_ci
11318c2ecf20Sopenharmony_ci/* aon gate clocks */
11328c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(gpio_eb, "gpio-eb",	&aon_apb.common.hw,
11338c2ecf20Sopenharmony_ci			   0x0, 0x1000, BIT(3), 0, 0);
11348c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(pwm0_eb,	"pwm0-eb",	&aon_apb.common.hw,
11358c2ecf20Sopenharmony_ci			   0x0, 0x1000, BIT(4), 0, 0);
11368c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(pwm1_eb,	"pwm1-eb",	&aon_apb.common.hw,
11378c2ecf20Sopenharmony_ci			   0x0, 0x1000, BIT(5), CLK_IGNORE_UNUSED, 0);
11388c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(pwm2_eb,	"pwm2-eb",	&aon_apb.common.hw, 0x0,
11398c2ecf20Sopenharmony_ci			   0x1000, BIT(6), 0, 0);
11408c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(pwm3_eb,	"pwm3-eb",	&aon_apb.common.hw, 0x0,
11418c2ecf20Sopenharmony_ci			   0x1000, BIT(7), 0, 0);
11428c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(kpd_eb,	"kpd-eb",	&aon_apb.common.hw, 0x0,
11438c2ecf20Sopenharmony_ci			   0x1000, BIT(8), 0, 0);
11448c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(aon_syst_eb,	"aon-syst-eb",	&aon_apb.common.hw, 0x0,
11458c2ecf20Sopenharmony_ci			   0x1000, BIT(9), CLK_IGNORE_UNUSED, 0);
11468c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(ap_syst_eb,	"ap-syst-eb",	&aon_apb.common.hw, 0x0,
11478c2ecf20Sopenharmony_ci			   0x1000, BIT(10), CLK_IGNORE_UNUSED, 0);
11488c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(aon_tmr_eb,	"aon-tmr-eb",	&aon_apb.common.hw, 0x0,
11498c2ecf20Sopenharmony_ci			   0x1000, BIT(11), CLK_IGNORE_UNUSED, 0);
11508c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(efuse_eb,	"efuse-eb",	&aon_apb.common.hw, 0x0,
11518c2ecf20Sopenharmony_ci			   0x1000, BIT(13), CLK_IGNORE_UNUSED, 0);
11528c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(eic_eb,	"eic-eb",	&aon_apb.common.hw, 0x0,
11538c2ecf20Sopenharmony_ci			   0x1000, BIT(14), CLK_IGNORE_UNUSED, 0);
11548c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(intc_eb,	"intc-eb",	&aon_apb.common.hw, 0x0,
11558c2ecf20Sopenharmony_ci			   0x1000, BIT(15), CLK_IGNORE_UNUSED, 0);
11568c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(adi_eb,	"adi-eb",	&aon_apb.common.hw, 0x0,
11578c2ecf20Sopenharmony_ci			   0x1000, BIT(16), CLK_IGNORE_UNUSED, 0);
11588c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(audif_eb,	"audif-eb",	&aon_apb.common.hw, 0x0,
11598c2ecf20Sopenharmony_ci			   0x1000, BIT(17), 0, 0);
11608c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(aud_eb,	"aud-eb",	&aon_apb.common.hw, 0x0,
11618c2ecf20Sopenharmony_ci			   0x1000, BIT(18), 0, 0);
11628c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(vbc_eb,	"vbc-eb",	&aon_apb.common.hw, 0x0,
11638c2ecf20Sopenharmony_ci			   0x1000, BIT(19), 0, 0);
11648c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(pin_eb,	"pin-eb",	&aon_apb.common.hw, 0x0,
11658c2ecf20Sopenharmony_ci			   0x1000, BIT(20), CLK_IGNORE_UNUSED, 0);
11668c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(ap_wdg_eb,	"ap-wdg-eb",	&aon_apb.common.hw, 0x0,
11678c2ecf20Sopenharmony_ci			   0x1000, BIT(24), 0, 0);
11688c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(mm_eb,	"mm-eb",	&aon_apb.common.hw, 0x0,
11698c2ecf20Sopenharmony_ci			   0x1000, BIT(25), CLK_IGNORE_UNUSED, 0);
11708c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(aon_apb_ckg_eb, "aon-apb-ckg-eb", &aon_apb.common.hw,
11718c2ecf20Sopenharmony_ci			   0x0, 0x1000, BIT(26), CLK_IGNORE_UNUSED, 0);
11728c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(ca53_ts0_eb, "ca53-ts0-eb",	&aon_apb.common.hw,
11738c2ecf20Sopenharmony_ci			   0x0, 0x1000, BIT(28), CLK_IGNORE_UNUSED, 0);
11748c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(ca53_ts1_eb, "ca53-ts1-eb",	&aon_apb.common.hw,
11758c2ecf20Sopenharmony_ci			   0x0, 0x1000, BIT(29), CLK_IGNORE_UNUSED, 0);
11768c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(ca53_dap_eb, "ca53-dap-eb",	&aon_apb.common.hw,
11778c2ecf20Sopenharmony_ci			   0x0, 0x1000, BIT(30), CLK_IGNORE_UNUSED, 0);
11788c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(pmu_eb,	"pmu-eb",	&aon_apb.common.hw,
11798c2ecf20Sopenharmony_ci			   0x4, 0x1000, BIT(0), CLK_IGNORE_UNUSED, 0);
11808c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(thm_eb,	"thm-eb",	&aon_apb.common.hw,
11818c2ecf20Sopenharmony_ci			   0x4, 0x1000, BIT(1), CLK_IGNORE_UNUSED, 0);
11828c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(aux0_eb,	"aux0-eb",	&aon_apb.common.hw,
11838c2ecf20Sopenharmony_ci			   0x4, 0x1000, BIT(2), CLK_IGNORE_UNUSED, 0);
11848c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(aux1_eb,	"aux1-eb",	&aon_apb.common.hw,
11858c2ecf20Sopenharmony_ci			   0x4, 0x1000, BIT(3), 0, 0);
11868c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(aux2_eb,	"aux2-eb",	&aon_apb.common.hw,
11878c2ecf20Sopenharmony_ci			   0x4, 0x1000, BIT(4), CLK_IGNORE_UNUSED, 0);
11888c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(probe_eb,	"probe-eb",	&aon_apb.common.hw,
11898c2ecf20Sopenharmony_ci			   0x4, 0x1000, BIT(5), 0, 0);
11908c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(emc_ref_eb,	"emc-ref-eb",	&aon_apb.common.hw,
11918c2ecf20Sopenharmony_ci			   0x4, 0x1000, BIT(7), CLK_IGNORE_UNUSED, 0);
11928c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(ca53_wdg_eb,	"ca53-wdg-eb",	&aon_apb.common.hw,
11938c2ecf20Sopenharmony_ci			   0x4, 0x1000, BIT(8), CLK_IGNORE_UNUSED, 0);
11948c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(ap_tmr1_eb,	"ap-tmr1-eb",	&aon_apb.common.hw,
11958c2ecf20Sopenharmony_ci			   0x4, 0x1000, BIT(9), 0, 0);
11968c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(ap_tmr2_eb,	"ap-tmr2-eb",	&aon_apb.common.hw,
11978c2ecf20Sopenharmony_ci			   0x4, 0x1000, BIT(10), 0, 0);
11988c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(disp_emc_eb,	"disp-emc-eb",	&aon_apb.common.hw,
11998c2ecf20Sopenharmony_ci			   0x4, 0x1000, BIT(11), 0, 0);
12008c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(zip_emc_eb,	"zip-emc-eb",	&aon_apb.common.hw,
12018c2ecf20Sopenharmony_ci			   0x4, 0x1000, BIT(12), 0, 0);
12028c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(gsp_emc_eb,	"gsp-emc-eb",	&aon_apb.common.hw,
12038c2ecf20Sopenharmony_ci			   0x4, 0x1000, BIT(13), 0, 0);
12048c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(mm_vsp_eb,	"mm-vsp-eb",	&aon_apb.common.hw,
12058c2ecf20Sopenharmony_ci			   0x4, 0x1000, BIT(14), 0, 0);
12068c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(mdar_eb,	"mdar-eb",	&aon_apb.common.hw,
12078c2ecf20Sopenharmony_ci			   0x4, 0x1000, BIT(17), 0, 0);
12088c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(rtc4m0_cal_eb, "rtc4m0-cal-eb", &aon_apb.common.hw,
12098c2ecf20Sopenharmony_ci			   0x4, 0x1000, BIT(18), 0, 0);
12108c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(rtc4m1_cal_eb, "rtc4m1-cal-eb", &aon_apb.common.hw,
12118c2ecf20Sopenharmony_ci			   0x4, 0x1000, BIT(19), 0, 0);
12128c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(djtag_eb,	"djtag-eb",	&aon_apb.common.hw,
12138c2ecf20Sopenharmony_ci			   0x4, 0x1000, BIT(20), 0, 0);
12148c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(mbox_eb,	"mbox-eb",	&aon_apb.common.hw,
12158c2ecf20Sopenharmony_ci			   0x4, 0x1000, BIT(21), 0, 0);
12168c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(aon_dma_eb,	"aon-dma-eb",	&aon_apb.common.hw,
12178c2ecf20Sopenharmony_ci			   0x4, 0x1000, BIT(22), 0, 0);
12188c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(aon_apb_def_eb, "aon-apb-def-eb", &aon_apb.common.hw,
12198c2ecf20Sopenharmony_ci			   0x4, 0x1000, BIT(25), 0, 0);
12208c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(ca5_ts0_eb,	"ca5-ts0-eb",	&aon_apb.common.hw,
12218c2ecf20Sopenharmony_ci			   0x4, 0x1000, BIT(26), 0, 0);
12228c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(dbg_eb,	"dbg-eb",	&aon_apb.common.hw,
12238c2ecf20Sopenharmony_ci			   0x4, 0x1000, BIT(28), 0, 0);
12248c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(dbg_emc_eb,	"dbg-emc-eb",	&aon_apb.common.hw,
12258c2ecf20Sopenharmony_ci			   0x4, 0x1000, BIT(29), 0, 0);
12268c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(cross_trig_eb, "cross-trig-eb", &aon_apb.common.hw,
12278c2ecf20Sopenharmony_ci			   0x4, 0x1000, BIT(30), 0, 0);
12288c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(serdes_dphy_eb, "serdes-dphy-eb", &aon_apb.common.hw,
12298c2ecf20Sopenharmony_ci			   0x4, 0x1000, BIT(31), 0, 0);
12308c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(arch_rtc_eb,	"arch-rtc-eb",	&aon_apb.common.hw,
12318c2ecf20Sopenharmony_ci			   0x10, 0x1000, BIT(0), CLK_IGNORE_UNUSED, 0);
12328c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(kpd_rtc_eb,	"kpd-rtc-eb",	&aon_apb.common.hw,
12338c2ecf20Sopenharmony_ci			   0x10, 0x1000, BIT(1), 0, 0);
12348c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(aon_syst_rtc_eb, "aon-syst-rtc-eb", &aon_apb.common.hw,
12358c2ecf20Sopenharmony_ci			   0x10, 0x1000, BIT(2), CLK_IGNORE_UNUSED, 0);
12368c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(ap_syst_rtc_eb, "ap-syst-rtc-eb", &aon_apb.common.hw,
12378c2ecf20Sopenharmony_ci			   0x10, 0x1000, BIT(3), CLK_IGNORE_UNUSED, 0);
12388c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(aon_tmr_rtc_eb, "aon-tmr-rtc-eb", &aon_apb.common.hw,
12398c2ecf20Sopenharmony_ci			   0x10, 0x1000, BIT(4), CLK_IGNORE_UNUSED, 0);
12408c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(ap_tmr0_rtc_eb, "ap-tmr0-rtc-eb", &aon_apb.common.hw,
12418c2ecf20Sopenharmony_ci			   0x10, 0x1000, BIT(5), 0, 0);
12428c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(eic_rtc_eb, "eic-rtc-eb",	&aon_apb.common.hw,
12438c2ecf20Sopenharmony_ci			   0x10, 0x1000, BIT(6), CLK_IGNORE_UNUSED, 0);
12448c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(eic_rtcdv5_eb, "eic-rtcdv5-eb", &aon_apb.common.hw,
12458c2ecf20Sopenharmony_ci			   0x10, 0x1000, BIT(7), CLK_IGNORE_UNUSED, 0);
12468c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(ap_wdg_rtc_eb, "ap-wdg-rtc-eb", &aon_apb.common.hw,
12478c2ecf20Sopenharmony_ci			   0x10, 0x1000, BIT(8), CLK_IGNORE_UNUSED, 0);
12488c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(ca53_wdg_rtc_eb, "ca53-wdg-rtc-eb", &aon_apb.common.hw,
12498c2ecf20Sopenharmony_ci			   0x10, 0x1000, BIT(9), CLK_IGNORE_UNUSED, 0);
12508c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(thm_rtc_eb, "thm-rtc-eb",	&aon_apb.common.hw,
12518c2ecf20Sopenharmony_ci			   0x10, 0x1000, BIT(10), 0, 0);
12528c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(athma_rtc_eb, "athma-rtc-eb", &aon_apb.common.hw,
12538c2ecf20Sopenharmony_ci			   0x10, 0x1000, BIT(11), 0, 0);
12548c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(gthma_rtc_eb, "gthma-rtc-eb", &aon_apb.common.hw,
12558c2ecf20Sopenharmony_ci			   0x10, 0x1000, BIT(12), 0, 0);
12568c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(athma_rtc_a_eb, "athma-rtc-a-eb", &aon_apb.common.hw,
12578c2ecf20Sopenharmony_ci			   0x10, 0x1000, BIT(13), 0, 0);
12588c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(gthma_rtc_a_eb, "gthma-rtc-a-eb", &aon_apb.common.hw,
12598c2ecf20Sopenharmony_ci			   0x10, 0x1000, BIT(14), 0, 0);
12608c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(ap_tmr1_rtc_eb, "ap-tmr1-rtc-eb", &aon_apb.common.hw,
12618c2ecf20Sopenharmony_ci			   0x10, 0x1000, BIT(15), 0, 0);
12628c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(ap_tmr2_rtc_eb, "ap-tmr2-rtc-eb", &aon_apb.common.hw,
12638c2ecf20Sopenharmony_ci			   0x10, 0x1000, BIT(16), 0, 0);
12648c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(dxco_lc_rtc_eb, "dxco-lc-rtc-eb", &aon_apb.common.hw,
12658c2ecf20Sopenharmony_ci			   0x10, 0x1000, BIT(17), 0, 0);
12668c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(bb_cal_rtc_eb, "bb-cal-rtc-eb", &aon_apb.common.hw,
12678c2ecf20Sopenharmony_ci			   0x10, 0x1000, BIT(18), 0, 0);
12688c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(gpu_eb, "gpu-eb", &aon_apb.common.hw, 0x50,
12698c2ecf20Sopenharmony_ci			   0x1000, BIT(0), 0, 0);
12708c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(disp_eb, "disp-eb", &aon_apb.common.hw, 0x50,
12718c2ecf20Sopenharmony_ci			   0x1000, BIT(2), 0, 0);
12728c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(mm_emc_eb, "mm-emc-eb", &aon_apb.common.hw, 0x50,
12738c2ecf20Sopenharmony_ci			   0x1000, BIT(3), 0, 0);
12748c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(power_cpu_eb, "power-cpu-eb", &aon_apb.common.hw, 0x50,
12758c2ecf20Sopenharmony_ci			   0x1000, BIT(10), CLK_IGNORE_UNUSED, 0);
12768c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(hw_i2c_eb, "hw-i2c-eb", &aon_apb.common.hw, 0x50,
12778c2ecf20Sopenharmony_ci			   0x1000, BIT(11), 0, 0);
12788c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(mm_vsp_emc_eb, "mm-vsp-emc-eb", &aon_apb.common.hw, 0x50,
12798c2ecf20Sopenharmony_ci			   0x1000, BIT(14), 0, 0);
12808c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(vsp_eb, "vsp-eb", &aon_apb.common.hw, 0x50,
12818c2ecf20Sopenharmony_ci			   0x1000, BIT(16), 0, 0);
12828c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(cssys_eb, "cssys-eb", &aon_apb.common.hw, 0xb0,
12838c2ecf20Sopenharmony_ci			   0x1000, BIT(4), 0, 0);
12848c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(dmc_eb, "dmc-eb", &aon_apb.common.hw, 0xb0,
12858c2ecf20Sopenharmony_ci			   0x1000, BIT(5), CLK_IGNORE_UNUSED, 0);
12868c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(rosc_eb, "rosc-eb", &aon_apb.common.hw, 0xb0,
12878c2ecf20Sopenharmony_ci			   0x1000, BIT(7), 0, 0);
12888c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(s_d_cfg_eb, "s-d-cfg-eb", &aon_apb.common.hw, 0xb0,
12898c2ecf20Sopenharmony_ci			   0x1000, BIT(8), 0, 0);
12908c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(s_d_ref_eb, "s-d-ref-eb", &aon_apb.common.hw, 0xb0,
12918c2ecf20Sopenharmony_ci			   0x1000, BIT(9), 0, 0);
12928c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(b_dma_eb, "b-dma-eb", &aon_apb.common.hw, 0xb0,
12938c2ecf20Sopenharmony_ci			   0x1000, BIT(10), 0, 0);
12948c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(anlg_eb, "anlg-eb", &aon_apb.common.hw, 0xb0,
12958c2ecf20Sopenharmony_ci			   0x1000, BIT(11), CLK_IGNORE_UNUSED, 0);
12968c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(anlg_apb_eb, "anlg-apb-eb", &aon_apb.common.hw, 0xb0,
12978c2ecf20Sopenharmony_ci			   0x1000, BIT(13), 0, 0);
12988c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(bsmtmr_eb, "bsmtmr-eb", &aon_apb.common.hw, 0xb0,
12998c2ecf20Sopenharmony_ci			   0x1000, BIT(14), 0, 0);
13008c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(ap_axi_eb, "ap-axi-eb", &aon_apb.common.hw, 0xb0,
13018c2ecf20Sopenharmony_ci			   0x1000, BIT(15), CLK_IGNORE_UNUSED, 0);
13028c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(ap_intc0_eb, "ap-intc0-eb", &aon_apb.common.hw, 0xb0,
13038c2ecf20Sopenharmony_ci			   0x1000, BIT(16), CLK_IGNORE_UNUSED, 0);
13048c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(ap_intc1_eb, "ap-intc1-eb", &aon_apb.common.hw, 0xb0,
13058c2ecf20Sopenharmony_ci			   0x1000, BIT(17), CLK_IGNORE_UNUSED, 0);
13068c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(ap_intc2_eb, "ap-intc2-eb", &aon_apb.common.hw, 0xb0,
13078c2ecf20Sopenharmony_ci			   0x1000, BIT(18), CLK_IGNORE_UNUSED, 0);
13088c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(ap_intc3_eb, "ap-intc3-eb", &aon_apb.common.hw, 0xb0,
13098c2ecf20Sopenharmony_ci			   0x1000, BIT(19), CLK_IGNORE_UNUSED, 0);
13108c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(ap_intc4_eb, "ap-intc4-eb", &aon_apb.common.hw, 0xb0,
13118c2ecf20Sopenharmony_ci			   0x1000, BIT(20), CLK_IGNORE_UNUSED, 0);
13128c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(ap_intc5_eb, "ap-intc5-eb", &aon_apb.common.hw, 0xb0,
13138c2ecf20Sopenharmony_ci			   0x1000, BIT(21), CLK_IGNORE_UNUSED, 0);
13148c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(scc_eb, "scc-eb", &aon_apb.common.hw, 0xb0,
13158c2ecf20Sopenharmony_ci			   0x1000, BIT(22), 0, 0);
13168c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(dphy_cfg_eb, "dphy-cfg-eb", &aon_apb.common.hw, 0xb0,
13178c2ecf20Sopenharmony_ci			   0x1000, BIT(23), 0, 0);
13188c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(dphy_ref_eb, "dphy-ref-eb", &aon_apb.common.hw, 0xb0,
13198c2ecf20Sopenharmony_ci			   0x1000, BIT(24), 0, 0);
13208c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(cphy_cfg_eb, "cphy-cfg-eb", &aon_apb.common.hw, 0xb0,
13218c2ecf20Sopenharmony_ci			   0x1000, BIT(25), 0, 0);
13228c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(otg_ref_eb, "otg-ref-eb", &aon_apb.common.hw, 0xb0,
13238c2ecf20Sopenharmony_ci			   0x1000, BIT(26), 0, 0);
13248c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(serdes_eb, "serdes-eb", &aon_apb.common.hw, 0xb0,
13258c2ecf20Sopenharmony_ci			   0x1000, BIT(27), 0, 0);
13268c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(aon_ap_emc_eb, "aon-ap-emc-eb", &aon_apb.common.hw, 0xb0,
13278c2ecf20Sopenharmony_ci			   0x1000, BIT(28), 0, 0);
13288c2ecf20Sopenharmony_cistatic struct sprd_clk_common *sc9863a_aonapb_gate_clks[] = {
13298c2ecf20Sopenharmony_ci	/* address base is 0x402e0000 */
13308c2ecf20Sopenharmony_ci	&gpio_eb.common,
13318c2ecf20Sopenharmony_ci	&pwm0_eb.common,
13328c2ecf20Sopenharmony_ci	&pwm1_eb.common,
13338c2ecf20Sopenharmony_ci	&pwm2_eb.common,
13348c2ecf20Sopenharmony_ci	&pwm3_eb.common,
13358c2ecf20Sopenharmony_ci	&kpd_eb.common,
13368c2ecf20Sopenharmony_ci	&aon_syst_eb.common,
13378c2ecf20Sopenharmony_ci	&ap_syst_eb.common,
13388c2ecf20Sopenharmony_ci	&aon_tmr_eb.common,
13398c2ecf20Sopenharmony_ci	&efuse_eb.common,
13408c2ecf20Sopenharmony_ci	&eic_eb.common,
13418c2ecf20Sopenharmony_ci	&intc_eb.common,
13428c2ecf20Sopenharmony_ci	&adi_eb.common,
13438c2ecf20Sopenharmony_ci	&audif_eb.common,
13448c2ecf20Sopenharmony_ci	&aud_eb.common,
13458c2ecf20Sopenharmony_ci	&vbc_eb.common,
13468c2ecf20Sopenharmony_ci	&pin_eb.common,
13478c2ecf20Sopenharmony_ci	&ap_wdg_eb.common,
13488c2ecf20Sopenharmony_ci	&mm_eb.common,
13498c2ecf20Sopenharmony_ci	&aon_apb_ckg_eb.common,
13508c2ecf20Sopenharmony_ci	&ca53_ts0_eb.common,
13518c2ecf20Sopenharmony_ci	&ca53_ts1_eb.common,
13528c2ecf20Sopenharmony_ci	&ca53_dap_eb.common,
13538c2ecf20Sopenharmony_ci	&pmu_eb.common,
13548c2ecf20Sopenharmony_ci	&thm_eb.common,
13558c2ecf20Sopenharmony_ci	&aux0_eb.common,
13568c2ecf20Sopenharmony_ci	&aux1_eb.common,
13578c2ecf20Sopenharmony_ci	&aux2_eb.common,
13588c2ecf20Sopenharmony_ci	&probe_eb.common,
13598c2ecf20Sopenharmony_ci	&emc_ref_eb.common,
13608c2ecf20Sopenharmony_ci	&ca53_wdg_eb.common,
13618c2ecf20Sopenharmony_ci	&ap_tmr1_eb.common,
13628c2ecf20Sopenharmony_ci	&ap_tmr2_eb.common,
13638c2ecf20Sopenharmony_ci	&disp_emc_eb.common,
13648c2ecf20Sopenharmony_ci	&zip_emc_eb.common,
13658c2ecf20Sopenharmony_ci	&gsp_emc_eb.common,
13668c2ecf20Sopenharmony_ci	&mm_vsp_eb.common,
13678c2ecf20Sopenharmony_ci	&mdar_eb.common,
13688c2ecf20Sopenharmony_ci	&rtc4m0_cal_eb.common,
13698c2ecf20Sopenharmony_ci	&rtc4m1_cal_eb.common,
13708c2ecf20Sopenharmony_ci	&djtag_eb.common,
13718c2ecf20Sopenharmony_ci	&mbox_eb.common,
13728c2ecf20Sopenharmony_ci	&aon_dma_eb.common,
13738c2ecf20Sopenharmony_ci	&aon_apb_def_eb.common,
13748c2ecf20Sopenharmony_ci	&ca5_ts0_eb.common,
13758c2ecf20Sopenharmony_ci	&dbg_eb.common,
13768c2ecf20Sopenharmony_ci	&dbg_emc_eb.common,
13778c2ecf20Sopenharmony_ci	&cross_trig_eb.common,
13788c2ecf20Sopenharmony_ci	&serdes_dphy_eb.common,
13798c2ecf20Sopenharmony_ci	&arch_rtc_eb.common,
13808c2ecf20Sopenharmony_ci	&kpd_rtc_eb.common,
13818c2ecf20Sopenharmony_ci	&aon_syst_rtc_eb.common,
13828c2ecf20Sopenharmony_ci	&ap_syst_rtc_eb.common,
13838c2ecf20Sopenharmony_ci	&aon_tmr_rtc_eb.common,
13848c2ecf20Sopenharmony_ci	&ap_tmr0_rtc_eb.common,
13858c2ecf20Sopenharmony_ci	&eic_rtc_eb.common,
13868c2ecf20Sopenharmony_ci	&eic_rtcdv5_eb.common,
13878c2ecf20Sopenharmony_ci	&ap_wdg_rtc_eb.common,
13888c2ecf20Sopenharmony_ci	&ca53_wdg_rtc_eb.common,
13898c2ecf20Sopenharmony_ci	&thm_rtc_eb.common,
13908c2ecf20Sopenharmony_ci	&athma_rtc_eb.common,
13918c2ecf20Sopenharmony_ci	&gthma_rtc_eb.common,
13928c2ecf20Sopenharmony_ci	&athma_rtc_a_eb.common,
13938c2ecf20Sopenharmony_ci	&gthma_rtc_a_eb.common,
13948c2ecf20Sopenharmony_ci	&ap_tmr1_rtc_eb.common,
13958c2ecf20Sopenharmony_ci	&ap_tmr2_rtc_eb.common,
13968c2ecf20Sopenharmony_ci	&dxco_lc_rtc_eb.common,
13978c2ecf20Sopenharmony_ci	&bb_cal_rtc_eb.common,
13988c2ecf20Sopenharmony_ci	&gpu_eb.common,
13998c2ecf20Sopenharmony_ci	&disp_eb.common,
14008c2ecf20Sopenharmony_ci	&mm_emc_eb.common,
14018c2ecf20Sopenharmony_ci	&power_cpu_eb.common,
14028c2ecf20Sopenharmony_ci	&hw_i2c_eb.common,
14038c2ecf20Sopenharmony_ci	&mm_vsp_emc_eb.common,
14048c2ecf20Sopenharmony_ci	&vsp_eb.common,
14058c2ecf20Sopenharmony_ci	&cssys_eb.common,
14068c2ecf20Sopenharmony_ci	&dmc_eb.common,
14078c2ecf20Sopenharmony_ci	&rosc_eb.common,
14088c2ecf20Sopenharmony_ci	&s_d_cfg_eb.common,
14098c2ecf20Sopenharmony_ci	&s_d_ref_eb.common,
14108c2ecf20Sopenharmony_ci	&b_dma_eb.common,
14118c2ecf20Sopenharmony_ci	&anlg_eb.common,
14128c2ecf20Sopenharmony_ci	&anlg_apb_eb.common,
14138c2ecf20Sopenharmony_ci	&bsmtmr_eb.common,
14148c2ecf20Sopenharmony_ci	&ap_axi_eb.common,
14158c2ecf20Sopenharmony_ci	&ap_intc0_eb.common,
14168c2ecf20Sopenharmony_ci	&ap_intc1_eb.common,
14178c2ecf20Sopenharmony_ci	&ap_intc2_eb.common,
14188c2ecf20Sopenharmony_ci	&ap_intc3_eb.common,
14198c2ecf20Sopenharmony_ci	&ap_intc4_eb.common,
14208c2ecf20Sopenharmony_ci	&ap_intc5_eb.common,
14218c2ecf20Sopenharmony_ci	&scc_eb.common,
14228c2ecf20Sopenharmony_ci	&dphy_cfg_eb.common,
14238c2ecf20Sopenharmony_ci	&dphy_ref_eb.common,
14248c2ecf20Sopenharmony_ci	&cphy_cfg_eb.common,
14258c2ecf20Sopenharmony_ci	&otg_ref_eb.common,
14268c2ecf20Sopenharmony_ci	&serdes_eb.common,
14278c2ecf20Sopenharmony_ci	&aon_ap_emc_eb.common,
14288c2ecf20Sopenharmony_ci};
14298c2ecf20Sopenharmony_ci
14308c2ecf20Sopenharmony_cistatic struct clk_hw_onecell_data sc9863a_aonapb_gate_hws = {
14318c2ecf20Sopenharmony_ci	.hws	= {
14328c2ecf20Sopenharmony_ci		[CLK_GPIO_EB]		= &gpio_eb.common.hw,
14338c2ecf20Sopenharmony_ci		[CLK_PWM0_EB]		= &pwm0_eb.common.hw,
14348c2ecf20Sopenharmony_ci		[CLK_PWM1_EB]		= &pwm1_eb.common.hw,
14358c2ecf20Sopenharmony_ci		[CLK_PWM2_EB]		= &pwm2_eb.common.hw,
14368c2ecf20Sopenharmony_ci		[CLK_PWM3_EB]		= &pwm3_eb.common.hw,
14378c2ecf20Sopenharmony_ci		[CLK_KPD_EB]		= &kpd_eb.common.hw,
14388c2ecf20Sopenharmony_ci		[CLK_AON_SYST_EB]	= &aon_syst_eb.common.hw,
14398c2ecf20Sopenharmony_ci		[CLK_AP_SYST_EB]	= &ap_syst_eb.common.hw,
14408c2ecf20Sopenharmony_ci		[CLK_AON_TMR_EB]	= &aon_tmr_eb.common.hw,
14418c2ecf20Sopenharmony_ci		[CLK_EFUSE_EB]		= &efuse_eb.common.hw,
14428c2ecf20Sopenharmony_ci		[CLK_EIC_EB]		= &eic_eb.common.hw,
14438c2ecf20Sopenharmony_ci		[CLK_INTC_EB]		= &intc_eb.common.hw,
14448c2ecf20Sopenharmony_ci		[CLK_ADI_EB]		= &adi_eb.common.hw,
14458c2ecf20Sopenharmony_ci		[CLK_AUDIF_EB]		= &audif_eb.common.hw,
14468c2ecf20Sopenharmony_ci		[CLK_AUD_EB]		= &aud_eb.common.hw,
14478c2ecf20Sopenharmony_ci		[CLK_VBC_EB]		= &vbc_eb.common.hw,
14488c2ecf20Sopenharmony_ci		[CLK_PIN_EB]		= &pin_eb.common.hw,
14498c2ecf20Sopenharmony_ci		[CLK_AP_WDG_EB]		= &ap_wdg_eb.common.hw,
14508c2ecf20Sopenharmony_ci		[CLK_MM_EB]		= &mm_eb.common.hw,
14518c2ecf20Sopenharmony_ci		[CLK_AON_APB_CKG_EB]	= &aon_apb_ckg_eb.common.hw,
14528c2ecf20Sopenharmony_ci		[CLK_CA53_TS0_EB]	= &ca53_ts0_eb.common.hw,
14538c2ecf20Sopenharmony_ci		[CLK_CA53_TS1_EB]	= &ca53_ts1_eb.common.hw,
14548c2ecf20Sopenharmony_ci		[CLK_CS53_DAP_EB]	= &ca53_dap_eb.common.hw,
14558c2ecf20Sopenharmony_ci		[CLK_PMU_EB]		= &pmu_eb.common.hw,
14568c2ecf20Sopenharmony_ci		[CLK_THM_EB]		= &thm_eb.common.hw,
14578c2ecf20Sopenharmony_ci		[CLK_AUX0_EB]		= &aux0_eb.common.hw,
14588c2ecf20Sopenharmony_ci		[CLK_AUX1_EB]		= &aux1_eb.common.hw,
14598c2ecf20Sopenharmony_ci		[CLK_AUX2_EB]		= &aux2_eb.common.hw,
14608c2ecf20Sopenharmony_ci		[CLK_PROBE_EB]		= &probe_eb.common.hw,
14618c2ecf20Sopenharmony_ci		[CLK_EMC_REF_EB]	= &emc_ref_eb.common.hw,
14628c2ecf20Sopenharmony_ci		[CLK_CA53_WDG_EB]	= &ca53_wdg_eb.common.hw,
14638c2ecf20Sopenharmony_ci		[CLK_AP_TMR1_EB]	= &ap_tmr1_eb.common.hw,
14648c2ecf20Sopenharmony_ci		[CLK_AP_TMR2_EB]	= &ap_tmr2_eb.common.hw,
14658c2ecf20Sopenharmony_ci		[CLK_DISP_EMC_EB]	= &disp_emc_eb.common.hw,
14668c2ecf20Sopenharmony_ci		[CLK_ZIP_EMC_EB]	= &zip_emc_eb.common.hw,
14678c2ecf20Sopenharmony_ci		[CLK_GSP_EMC_EB]	= &gsp_emc_eb.common.hw,
14688c2ecf20Sopenharmony_ci		[CLK_MM_VSP_EB]		= &mm_vsp_eb.common.hw,
14698c2ecf20Sopenharmony_ci		[CLK_MDAR_EB]		= &mdar_eb.common.hw,
14708c2ecf20Sopenharmony_ci		[CLK_RTC4M0_CAL_EB]	= &rtc4m0_cal_eb.common.hw,
14718c2ecf20Sopenharmony_ci		[CLK_RTC4M1_CAL_EB]	= &rtc4m1_cal_eb.common.hw,
14728c2ecf20Sopenharmony_ci		[CLK_DJTAG_EB]		= &djtag_eb.common.hw,
14738c2ecf20Sopenharmony_ci		[CLK_MBOX_EB]		= &mbox_eb.common.hw,
14748c2ecf20Sopenharmony_ci		[CLK_AON_DMA_EB]	= &aon_dma_eb.common.hw,
14758c2ecf20Sopenharmony_ci		[CLK_AON_APB_DEF_EB]	= &aon_apb_def_eb.common.hw,
14768c2ecf20Sopenharmony_ci		[CLK_CA5_TS0_EB]	= &ca5_ts0_eb.common.hw,
14778c2ecf20Sopenharmony_ci		[CLK_DBG_EB]		= &dbg_eb.common.hw,
14788c2ecf20Sopenharmony_ci		[CLK_DBG_EMC_EB]	= &dbg_emc_eb.common.hw,
14798c2ecf20Sopenharmony_ci		[CLK_CROSS_TRIG_EB]	= &cross_trig_eb.common.hw,
14808c2ecf20Sopenharmony_ci		[CLK_SERDES_DPHY_EB]	= &serdes_dphy_eb.common.hw,
14818c2ecf20Sopenharmony_ci		[CLK_ARCH_RTC_EB]	= &arch_rtc_eb.common.hw,
14828c2ecf20Sopenharmony_ci		[CLK_KPD_RTC_EB]	= &kpd_rtc_eb.common.hw,
14838c2ecf20Sopenharmony_ci		[CLK_AON_SYST_RTC_EB]	= &aon_syst_rtc_eb.common.hw,
14848c2ecf20Sopenharmony_ci		[CLK_AP_SYST_RTC_EB]	= &ap_syst_rtc_eb.common.hw,
14858c2ecf20Sopenharmony_ci		[CLK_AON_TMR_RTC_EB]	= &aon_tmr_rtc_eb.common.hw,
14868c2ecf20Sopenharmony_ci		[CLK_AP_TMR0_RTC_EB]	= &ap_tmr0_rtc_eb.common.hw,
14878c2ecf20Sopenharmony_ci		[CLK_EIC_RTC_EB]	= &eic_rtc_eb.common.hw,
14888c2ecf20Sopenharmony_ci		[CLK_EIC_RTCDV5_EB]	= &eic_rtcdv5_eb.common.hw,
14898c2ecf20Sopenharmony_ci		[CLK_AP_WDG_RTC_EB]	= &ap_wdg_rtc_eb.common.hw,
14908c2ecf20Sopenharmony_ci		[CLK_CA53_WDG_RTC_EB]	= &ca53_wdg_rtc_eb.common.hw,
14918c2ecf20Sopenharmony_ci		[CLK_THM_RTC_EB]	= &thm_rtc_eb.common.hw,
14928c2ecf20Sopenharmony_ci		[CLK_ATHMA_RTC_EB]	= &athma_rtc_eb.common.hw,
14938c2ecf20Sopenharmony_ci		[CLK_GTHMA_RTC_EB]	= &gthma_rtc_eb.common.hw,
14948c2ecf20Sopenharmony_ci		[CLK_ATHMA_RTC_A_EB]	= &athma_rtc_a_eb.common.hw,
14958c2ecf20Sopenharmony_ci		[CLK_GTHMA_RTC_A_EB]	= &gthma_rtc_a_eb.common.hw,
14968c2ecf20Sopenharmony_ci		[CLK_AP_TMR1_RTC_EB]	= &ap_tmr1_rtc_eb.common.hw,
14978c2ecf20Sopenharmony_ci		[CLK_AP_TMR2_RTC_EB]	= &ap_tmr2_rtc_eb.common.hw,
14988c2ecf20Sopenharmony_ci		[CLK_DXCO_LC_RTC_EB]	= &dxco_lc_rtc_eb.common.hw,
14998c2ecf20Sopenharmony_ci		[CLK_BB_CAL_RTC_EB]	= &bb_cal_rtc_eb.common.hw,
15008c2ecf20Sopenharmony_ci		[CLK_GNU_EB]		= &gpu_eb.common.hw,
15018c2ecf20Sopenharmony_ci		[CLK_DISP_EB]		= &disp_eb.common.hw,
15028c2ecf20Sopenharmony_ci		[CLK_MM_EMC_EB]		= &mm_emc_eb.common.hw,
15038c2ecf20Sopenharmony_ci		[CLK_POWER_CPU_EB]	= &power_cpu_eb.common.hw,
15048c2ecf20Sopenharmony_ci		[CLK_HW_I2C_EB]		= &hw_i2c_eb.common.hw,
15058c2ecf20Sopenharmony_ci		[CLK_MM_VSP_EMC_EB]	= &mm_vsp_emc_eb.common.hw,
15068c2ecf20Sopenharmony_ci		[CLK_VSP_EB]		= &vsp_eb.common.hw,
15078c2ecf20Sopenharmony_ci		[CLK_CSSYS_EB]		= &cssys_eb.common.hw,
15088c2ecf20Sopenharmony_ci		[CLK_DMC_EB]		= &dmc_eb.common.hw,
15098c2ecf20Sopenharmony_ci		[CLK_ROSC_EB]		= &rosc_eb.common.hw,
15108c2ecf20Sopenharmony_ci		[CLK_S_D_CFG_EB]	= &s_d_cfg_eb.common.hw,
15118c2ecf20Sopenharmony_ci		[CLK_S_D_REF_EB]	= &s_d_ref_eb.common.hw,
15128c2ecf20Sopenharmony_ci		[CLK_B_DMA_EB]		= &b_dma_eb.common.hw,
15138c2ecf20Sopenharmony_ci		[CLK_ANLG_EB]		= &anlg_eb.common.hw,
15148c2ecf20Sopenharmony_ci		[CLK_ANLG_APB_EB]	= &anlg_apb_eb.common.hw,
15158c2ecf20Sopenharmony_ci		[CLK_BSMTMR_EB]		= &bsmtmr_eb.common.hw,
15168c2ecf20Sopenharmony_ci		[CLK_AP_AXI_EB]		= &ap_axi_eb.common.hw,
15178c2ecf20Sopenharmony_ci		[CLK_AP_INTC0_EB]	= &ap_intc0_eb.common.hw,
15188c2ecf20Sopenharmony_ci		[CLK_AP_INTC1_EB]	= &ap_intc1_eb.common.hw,
15198c2ecf20Sopenharmony_ci		[CLK_AP_INTC2_EB]	= &ap_intc2_eb.common.hw,
15208c2ecf20Sopenharmony_ci		[CLK_AP_INTC3_EB]	= &ap_intc3_eb.common.hw,
15218c2ecf20Sopenharmony_ci		[CLK_AP_INTC4_EB]	= &ap_intc4_eb.common.hw,
15228c2ecf20Sopenharmony_ci		[CLK_AP_INTC5_EB]	= &ap_intc5_eb.common.hw,
15238c2ecf20Sopenharmony_ci		[CLK_SCC_EB]		= &scc_eb.common.hw,
15248c2ecf20Sopenharmony_ci		[CLK_DPHY_CFG_EB]	= &dphy_cfg_eb.common.hw,
15258c2ecf20Sopenharmony_ci		[CLK_DPHY_REF_EB]	= &dphy_ref_eb.common.hw,
15268c2ecf20Sopenharmony_ci		[CLK_CPHY_CFG_EB]	= &cphy_cfg_eb.common.hw,
15278c2ecf20Sopenharmony_ci		[CLK_OTG_REF_EB]	= &otg_ref_eb.common.hw,
15288c2ecf20Sopenharmony_ci		[CLK_SERDES_EB]		= &serdes_eb.common.hw,
15298c2ecf20Sopenharmony_ci		[CLK_AON_AP_EMC_EB]	= &aon_ap_emc_eb.common.hw,
15308c2ecf20Sopenharmony_ci	},
15318c2ecf20Sopenharmony_ci	.num	= CLK_AON_APB_GATE_NUM,
15328c2ecf20Sopenharmony_ci};
15338c2ecf20Sopenharmony_ci
15348c2ecf20Sopenharmony_cistatic const struct sprd_clk_desc sc9863a_aonapb_gate_desc = {
15358c2ecf20Sopenharmony_ci	.clk_clks	= sc9863a_aonapb_gate_clks,
15368c2ecf20Sopenharmony_ci	.num_clk_clks	= ARRAY_SIZE(sc9863a_aonapb_gate_clks),
15378c2ecf20Sopenharmony_ci	.hw_clks	= &sc9863a_aonapb_gate_hws,
15388c2ecf20Sopenharmony_ci};
15398c2ecf20Sopenharmony_ci
15408c2ecf20Sopenharmony_ci/* mm gate clocks */
15418c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(mahb_ckg_eb, "mahb-ckg-eb", &mm_ahb.common.hw, 0x0, 0x1000,
15428c2ecf20Sopenharmony_ci			   BIT(0), 0, 0);
15438c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(mdcam_eb, "mdcam-eb", &mm_ahb.common.hw, 0x0, 0x1000,
15448c2ecf20Sopenharmony_ci			   BIT(1), 0, 0);
15458c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(misp_eb, "misp-eb", &mm_ahb.common.hw, 0x0, 0x1000,
15468c2ecf20Sopenharmony_ci			   BIT(2), 0, 0);
15478c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(mahbcsi_eb, "mahbcsi-eb", &mm_ahb.common.hw, 0x0, 0x1000,
15488c2ecf20Sopenharmony_ci			   BIT(3), 0, 0);
15498c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(mcsi_s_eb, "mcsi-s-eb", &mm_ahb.common.hw, 0x0, 0x1000,
15508c2ecf20Sopenharmony_ci			   BIT(4), 0, 0);
15518c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_HW(mcsi_t_eb, "mcsi-t-eb", &mm_ahb.common.hw, 0x0, 0x1000,
15528c2ecf20Sopenharmony_ci			   BIT(5), 0, 0);
15538c2ecf20Sopenharmony_cistatic SPRD_GATE_CLK_HW(dcam_axi_eb, "dcam-axi-eb", &mm_ahb.common.hw, 0x8,
15548c2ecf20Sopenharmony_ci			BIT(0), 0, 0);
15558c2ecf20Sopenharmony_cistatic SPRD_GATE_CLK_HW(isp_axi_eb, "isp-axi-eb", &mm_ahb.common.hw, 0x8,
15568c2ecf20Sopenharmony_ci			BIT(1), 0, 0);
15578c2ecf20Sopenharmony_cistatic SPRD_GATE_CLK_HW(mcsi_eb, "mcsi-eb", &mm_ahb.common.hw, 0x8,
15588c2ecf20Sopenharmony_ci			BIT(2), 0, 0);
15598c2ecf20Sopenharmony_cistatic SPRD_GATE_CLK_HW(mcsi_s_ckg_eb, "mcsi-s-ckg-eb", &mm_ahb.common.hw, 0x8,
15608c2ecf20Sopenharmony_ci			BIT(3), 0, 0);
15618c2ecf20Sopenharmony_cistatic SPRD_GATE_CLK_HW(mcsi_t_ckg_eb, "mcsi-t-ckg-eb", &mm_ahb.common.hw, 0x8,
15628c2ecf20Sopenharmony_ci			BIT(4), 0, 0);
15638c2ecf20Sopenharmony_cistatic SPRD_GATE_CLK_HW(sensor0_eb, "sensor0-eb", &mm_ahb.common.hw, 0x8,
15648c2ecf20Sopenharmony_ci			BIT(5), 0, 0);
15658c2ecf20Sopenharmony_cistatic SPRD_GATE_CLK_HW(sensor1_eb, "sensor1-eb", &mm_ahb.common.hw, 0x8,
15668c2ecf20Sopenharmony_ci			BIT(6), 0, 0);
15678c2ecf20Sopenharmony_cistatic SPRD_GATE_CLK_HW(sensor2_eb, "sensor2-eb", &mm_ahb.common.hw, 0x8,
15688c2ecf20Sopenharmony_ci			BIT(7), 0, 0);
15698c2ecf20Sopenharmony_cistatic SPRD_GATE_CLK_HW(mcphy_cfg_eb, "mcphy-cfg-eb", &mm_ahb.common.hw, 0x8,
15708c2ecf20Sopenharmony_ci			BIT(8), 0, 0);
15718c2ecf20Sopenharmony_ci
15728c2ecf20Sopenharmony_cistatic struct sprd_clk_common *sc9863a_mm_gate_clks[] = {
15738c2ecf20Sopenharmony_ci	/* address base is 0x60800000 */
15748c2ecf20Sopenharmony_ci	&mahb_ckg_eb.common,
15758c2ecf20Sopenharmony_ci	&mdcam_eb.common,
15768c2ecf20Sopenharmony_ci	&misp_eb.common,
15778c2ecf20Sopenharmony_ci	&mahbcsi_eb.common,
15788c2ecf20Sopenharmony_ci	&mcsi_s_eb.common,
15798c2ecf20Sopenharmony_ci	&mcsi_t_eb.common,
15808c2ecf20Sopenharmony_ci	&dcam_axi_eb.common,
15818c2ecf20Sopenharmony_ci	&isp_axi_eb.common,
15828c2ecf20Sopenharmony_ci	&mcsi_eb.common,
15838c2ecf20Sopenharmony_ci	&mcsi_s_ckg_eb.common,
15848c2ecf20Sopenharmony_ci	&mcsi_t_ckg_eb.common,
15858c2ecf20Sopenharmony_ci	&sensor0_eb.common,
15868c2ecf20Sopenharmony_ci	&sensor1_eb.common,
15878c2ecf20Sopenharmony_ci	&sensor2_eb.common,
15888c2ecf20Sopenharmony_ci	&mcphy_cfg_eb.common,
15898c2ecf20Sopenharmony_ci};
15908c2ecf20Sopenharmony_ci
15918c2ecf20Sopenharmony_cistatic struct clk_hw_onecell_data sc9863a_mm_gate_hws = {
15928c2ecf20Sopenharmony_ci	.hws	= {
15938c2ecf20Sopenharmony_ci		[CLK_MAHB_CKG_EB]	= &mahb_ckg_eb.common.hw,
15948c2ecf20Sopenharmony_ci		[CLK_MDCAM_EB]		= &mdcam_eb.common.hw,
15958c2ecf20Sopenharmony_ci		[CLK_MISP_EB]		= &misp_eb.common.hw,
15968c2ecf20Sopenharmony_ci		[CLK_MAHBCSI_EB]	= &mahbcsi_eb.common.hw,
15978c2ecf20Sopenharmony_ci		[CLK_MCSI_S_EB]		= &mcsi_s_eb.common.hw,
15988c2ecf20Sopenharmony_ci		[CLK_MCSI_T_EB]		= &mcsi_t_eb.common.hw,
15998c2ecf20Sopenharmony_ci		[CLK_DCAM_AXI_EB]	= &dcam_axi_eb.common.hw,
16008c2ecf20Sopenharmony_ci		[CLK_ISP_AXI_EB]	= &isp_axi_eb.common.hw,
16018c2ecf20Sopenharmony_ci		[CLK_MCSI_EB]		= &mcsi_eb.common.hw,
16028c2ecf20Sopenharmony_ci		[CLK_MCSI_S_CKG_EB]	= &mcsi_s_ckg_eb.common.hw,
16038c2ecf20Sopenharmony_ci		[CLK_MCSI_T_CKG_EB]	= &mcsi_t_ckg_eb.common.hw,
16048c2ecf20Sopenharmony_ci		[CLK_SENSOR0_EB]	= &sensor0_eb.common.hw,
16058c2ecf20Sopenharmony_ci		[CLK_SENSOR1_EB]	= &sensor1_eb.common.hw,
16068c2ecf20Sopenharmony_ci		[CLK_SENSOR2_EB]	= &sensor2_eb.common.hw,
16078c2ecf20Sopenharmony_ci		[CLK_MCPHY_CFG_EB]	= &mcphy_cfg_eb.common.hw,
16088c2ecf20Sopenharmony_ci	},
16098c2ecf20Sopenharmony_ci	.num	= CLK_MM_GATE_NUM,
16108c2ecf20Sopenharmony_ci};
16118c2ecf20Sopenharmony_ci
16128c2ecf20Sopenharmony_cistatic const struct sprd_clk_desc sc9863a_mm_gate_desc = {
16138c2ecf20Sopenharmony_ci	.clk_clks	= sc9863a_mm_gate_clks,
16148c2ecf20Sopenharmony_ci	.num_clk_clks	= ARRAY_SIZE(sc9863a_mm_gate_clks),
16158c2ecf20Sopenharmony_ci	.hw_clks	= &sc9863a_mm_gate_hws,
16168c2ecf20Sopenharmony_ci};
16178c2ecf20Sopenharmony_ci
16188c2ecf20Sopenharmony_ci/* camera sensor clocks */
16198c2ecf20Sopenharmony_cistatic SPRD_GATE_CLK_HW(mipi_csi_clk, "mipi-csi-clk", &mahb_ckg_eb.common.hw,
16208c2ecf20Sopenharmony_ci			0x20, BIT(16), 0, SPRD_GATE_NON_AON);
16218c2ecf20Sopenharmony_cistatic SPRD_GATE_CLK_HW(mipi_csi_s_clk, "mipi-csi-s-clk", &mahb_ckg_eb.common.hw,
16228c2ecf20Sopenharmony_ci			0x24, BIT(16), 0, SPRD_GATE_NON_AON);
16238c2ecf20Sopenharmony_cistatic SPRD_GATE_CLK_HW(mipi_csi_m_clk, "mipi-csi-m-clk", &mahb_ckg_eb.common.hw,
16248c2ecf20Sopenharmony_ci			0x28, BIT(16), 0, SPRD_GATE_NON_AON);
16258c2ecf20Sopenharmony_ci
16268c2ecf20Sopenharmony_cistatic struct sprd_clk_common *sc9863a_mm_clk_clks[] = {
16278c2ecf20Sopenharmony_ci	/* address base is 0x60900000 */
16288c2ecf20Sopenharmony_ci	&mipi_csi_clk.common,
16298c2ecf20Sopenharmony_ci	&mipi_csi_s_clk.common,
16308c2ecf20Sopenharmony_ci	&mipi_csi_m_clk.common,
16318c2ecf20Sopenharmony_ci};
16328c2ecf20Sopenharmony_ci
16338c2ecf20Sopenharmony_cistatic struct clk_hw_onecell_data sc9863a_mm_clk_hws = {
16348c2ecf20Sopenharmony_ci	.hws	= {
16358c2ecf20Sopenharmony_ci		[CLK_MIPI_CSI]		= &mipi_csi_clk.common.hw,
16368c2ecf20Sopenharmony_ci		[CLK_MIPI_CSI_S]	= &mipi_csi_s_clk.common.hw,
16378c2ecf20Sopenharmony_ci		[CLK_MIPI_CSI_M]	= &mipi_csi_m_clk.common.hw,
16388c2ecf20Sopenharmony_ci	},
16398c2ecf20Sopenharmony_ci	.num	= CLK_MM_CLK_NUM,
16408c2ecf20Sopenharmony_ci};
16418c2ecf20Sopenharmony_ci
16428c2ecf20Sopenharmony_cistatic const struct sprd_clk_desc sc9863a_mm_clk_desc = {
16438c2ecf20Sopenharmony_ci	.clk_clks	= sc9863a_mm_clk_clks,
16448c2ecf20Sopenharmony_ci	.num_clk_clks	= ARRAY_SIZE(sc9863a_mm_clk_clks),
16458c2ecf20Sopenharmony_ci	.hw_clks	= &sc9863a_mm_clk_hws,
16468c2ecf20Sopenharmony_ci};
16478c2ecf20Sopenharmony_ci
16488c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_FW_NAME(sim0_eb,	"sim0-eb",	"ext-26m", 0x0,
16498c2ecf20Sopenharmony_ci				0x1000, BIT(0), 0, 0);
16508c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_FW_NAME(iis0_eb,	"iis0-eb",	"ext-26m", 0x0,
16518c2ecf20Sopenharmony_ci				0x1000, BIT(1), 0, 0);
16528c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_FW_NAME(iis1_eb,	"iis1-eb",	"ext-26m", 0x0,
16538c2ecf20Sopenharmony_ci				0x1000, BIT(2), 0, 0);
16548c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_FW_NAME(iis2_eb,	"iis2-eb",	"ext-26m", 0x0,
16558c2ecf20Sopenharmony_ci				0x1000, BIT(3), 0, 0);
16568c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_FW_NAME(spi0_eb,	"spi0-eb",	"ext-26m", 0x0,
16578c2ecf20Sopenharmony_ci				0x1000, BIT(5), 0, 0);
16588c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_FW_NAME(spi1_eb,	"spi1-eb",	"ext-26m", 0x0,
16598c2ecf20Sopenharmony_ci				0x1000, BIT(6), 0, 0);
16608c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_FW_NAME(spi2_eb,	"spi2-eb",	"ext-26m", 0x0,
16618c2ecf20Sopenharmony_ci				0x1000, BIT(7), 0, 0);
16628c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_FW_NAME(i2c0_eb,	"i2c0-eb",	"ext-26m", 0x0,
16638c2ecf20Sopenharmony_ci				0x1000, BIT(8), 0, 0);
16648c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_FW_NAME(i2c1_eb,	"i2c1-eb",	"ext-26m", 0x0,
16658c2ecf20Sopenharmony_ci				0x1000, BIT(9), 0, 0);
16668c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_FW_NAME(i2c2_eb,	"i2c2-eb",	"ext-26m", 0x0,
16678c2ecf20Sopenharmony_ci				0x1000, BIT(10), 0, 0);
16688c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_FW_NAME(i2c3_eb,	"i2c3-eb",	"ext-26m", 0x0,
16698c2ecf20Sopenharmony_ci				0x1000, BIT(11), 0, 0);
16708c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_FW_NAME(i2c4_eb,	"i2c4-eb",	"ext-26m", 0x0,
16718c2ecf20Sopenharmony_ci				0x1000, BIT(12), 0, 0);
16728c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_FW_NAME(uart0_eb,	"uart0-eb",	"ext-26m", 0x0,
16738c2ecf20Sopenharmony_ci				0x1000, BIT(13), 0, 0);
16748c2ecf20Sopenharmony_ci/* uart1_eb is for console, don't gate even if unused */
16758c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_FW_NAME(uart1_eb,	"uart1-eb",	"ext-26m", 0x0,
16768c2ecf20Sopenharmony_ci				0x1000, BIT(14), CLK_IGNORE_UNUSED, 0);
16778c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_FW_NAME(uart2_eb,	"uart2-eb",	"ext-26m", 0x0,
16788c2ecf20Sopenharmony_ci				0x1000, BIT(15), 0, 0);
16798c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_FW_NAME(uart3_eb,	"uart3-eb",	"ext-26m", 0x0,
16808c2ecf20Sopenharmony_ci				0x1000, BIT(16), 0, 0);
16818c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_FW_NAME(uart4_eb,	"uart4-eb",	"ext-26m", 0x0,
16828c2ecf20Sopenharmony_ci				0x1000, BIT(17), 0, 0);
16838c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_FW_NAME(sim0_32k_eb,	"sim0_32k-eb",	"ext-26m", 0x0,
16848c2ecf20Sopenharmony_ci				0x1000, BIT(18), 0, 0);
16858c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_FW_NAME(spi3_eb,	"spi3-eb",	"ext-26m", 0x0,
16868c2ecf20Sopenharmony_ci				0x1000, BIT(19), 0, 0);
16878c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_FW_NAME(i2c5_eb,	"i2c5-eb",	"ext-26m", 0x0,
16888c2ecf20Sopenharmony_ci				0x1000, BIT(20), 0, 0);
16898c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK_FW_NAME(i2c6_eb,	"i2c6-eb",	"ext-26m", 0x0,
16908c2ecf20Sopenharmony_ci				0x1000, BIT(21), 0, 0);
16918c2ecf20Sopenharmony_ci
16928c2ecf20Sopenharmony_cistatic struct sprd_clk_common *sc9863a_apapb_gate[] = {
16938c2ecf20Sopenharmony_ci	/* address base is 0x71300000 */
16948c2ecf20Sopenharmony_ci	&sim0_eb.common,
16958c2ecf20Sopenharmony_ci	&iis0_eb.common,
16968c2ecf20Sopenharmony_ci	&iis1_eb.common,
16978c2ecf20Sopenharmony_ci	&iis2_eb.common,
16988c2ecf20Sopenharmony_ci	&spi0_eb.common,
16998c2ecf20Sopenharmony_ci	&spi1_eb.common,
17008c2ecf20Sopenharmony_ci	&spi2_eb.common,
17018c2ecf20Sopenharmony_ci	&i2c0_eb.common,
17028c2ecf20Sopenharmony_ci	&i2c1_eb.common,
17038c2ecf20Sopenharmony_ci	&i2c2_eb.common,
17048c2ecf20Sopenharmony_ci	&i2c3_eb.common,
17058c2ecf20Sopenharmony_ci	&i2c4_eb.common,
17068c2ecf20Sopenharmony_ci	&uart0_eb.common,
17078c2ecf20Sopenharmony_ci	&uart1_eb.common,
17088c2ecf20Sopenharmony_ci	&uart2_eb.common,
17098c2ecf20Sopenharmony_ci	&uart3_eb.common,
17108c2ecf20Sopenharmony_ci	&uart4_eb.common,
17118c2ecf20Sopenharmony_ci	&sim0_32k_eb.common,
17128c2ecf20Sopenharmony_ci	&spi3_eb.common,
17138c2ecf20Sopenharmony_ci	&i2c5_eb.common,
17148c2ecf20Sopenharmony_ci	&i2c6_eb.common,
17158c2ecf20Sopenharmony_ci};
17168c2ecf20Sopenharmony_ci
17178c2ecf20Sopenharmony_cistatic struct clk_hw_onecell_data sc9863a_apapb_gate_hws = {
17188c2ecf20Sopenharmony_ci	.hws	= {
17198c2ecf20Sopenharmony_ci		[CLK_SIM0_EB]		= &sim0_eb.common.hw,
17208c2ecf20Sopenharmony_ci		[CLK_IIS0_EB]		= &iis0_eb.common.hw,
17218c2ecf20Sopenharmony_ci		[CLK_IIS1_EB]		= &iis1_eb.common.hw,
17228c2ecf20Sopenharmony_ci		[CLK_IIS2_EB]		= &iis2_eb.common.hw,
17238c2ecf20Sopenharmony_ci		[CLK_SPI0_EB]		= &spi0_eb.common.hw,
17248c2ecf20Sopenharmony_ci		[CLK_SPI1_EB]		= &spi1_eb.common.hw,
17258c2ecf20Sopenharmony_ci		[CLK_SPI2_EB]		= &spi2_eb.common.hw,
17268c2ecf20Sopenharmony_ci		[CLK_I2C0_EB]		= &i2c0_eb.common.hw,
17278c2ecf20Sopenharmony_ci		[CLK_I2C1_EB]		= &i2c1_eb.common.hw,
17288c2ecf20Sopenharmony_ci		[CLK_I2C2_EB]		= &i2c2_eb.common.hw,
17298c2ecf20Sopenharmony_ci		[CLK_I2C3_EB]		= &i2c3_eb.common.hw,
17308c2ecf20Sopenharmony_ci		[CLK_I2C4_EB]		= &i2c4_eb.common.hw,
17318c2ecf20Sopenharmony_ci		[CLK_UART0_EB]		= &uart0_eb.common.hw,
17328c2ecf20Sopenharmony_ci		[CLK_UART1_EB]		= &uart1_eb.common.hw,
17338c2ecf20Sopenharmony_ci		[CLK_UART2_EB]		= &uart2_eb.common.hw,
17348c2ecf20Sopenharmony_ci		[CLK_UART3_EB]		= &uart3_eb.common.hw,
17358c2ecf20Sopenharmony_ci		[CLK_UART4_EB]		= &uart4_eb.common.hw,
17368c2ecf20Sopenharmony_ci		[CLK_SIM0_32K_EB]	= &sim0_32k_eb.common.hw,
17378c2ecf20Sopenharmony_ci		[CLK_SPI3_EB]		= &spi3_eb.common.hw,
17388c2ecf20Sopenharmony_ci		[CLK_I2C5_EB]		= &i2c5_eb.common.hw,
17398c2ecf20Sopenharmony_ci		[CLK_I2C6_EB]		= &i2c6_eb.common.hw,
17408c2ecf20Sopenharmony_ci	},
17418c2ecf20Sopenharmony_ci	.num	= CLK_AP_APB_GATE_NUM,
17428c2ecf20Sopenharmony_ci};
17438c2ecf20Sopenharmony_ci
17448c2ecf20Sopenharmony_cistatic const struct sprd_clk_desc sc9863a_apapb_gate_desc = {
17458c2ecf20Sopenharmony_ci	.clk_clks	= sc9863a_apapb_gate,
17468c2ecf20Sopenharmony_ci	.num_clk_clks	= ARRAY_SIZE(sc9863a_apapb_gate),
17478c2ecf20Sopenharmony_ci	.hw_clks	= &sc9863a_apapb_gate_hws,
17488c2ecf20Sopenharmony_ci};
17498c2ecf20Sopenharmony_ci
17508c2ecf20Sopenharmony_cistatic const struct of_device_id sprd_sc9863a_clk_ids[] = {
17518c2ecf20Sopenharmony_ci	{ .compatible = "sprd,sc9863a-ap-clk",	/* 0x21500000 */
17528c2ecf20Sopenharmony_ci	  .data = &sc9863a_ap_clk_desc },
17538c2ecf20Sopenharmony_ci	{ .compatible = "sprd,sc9863a-pmu-gate",	/* 0x402b0000 */
17548c2ecf20Sopenharmony_ci	  .data = &sc9863a_pmu_gate_desc },
17558c2ecf20Sopenharmony_ci	{ .compatible = "sprd,sc9863a-pll",	/* 0x40353000 */
17568c2ecf20Sopenharmony_ci	  .data = &sc9863a_pll_desc },
17578c2ecf20Sopenharmony_ci	{ .compatible = "sprd,sc9863a-mpll",	/* 0x40359000 */
17588c2ecf20Sopenharmony_ci	  .data = &sc9863a_mpll_desc },
17598c2ecf20Sopenharmony_ci	{ .compatible = "sprd,sc9863a-rpll",	/* 0x4035c000 */
17608c2ecf20Sopenharmony_ci	  .data = &sc9863a_rpll_desc },
17618c2ecf20Sopenharmony_ci	{ .compatible = "sprd,sc9863a-dpll",	/* 0x40363000 */
17628c2ecf20Sopenharmony_ci	  .data = &sc9863a_dpll_desc },
17638c2ecf20Sopenharmony_ci	{ .compatible = "sprd,sc9863a-aon-clk",	/* 0x402d0000 */
17648c2ecf20Sopenharmony_ci	  .data = &sc9863a_aon_clk_desc },
17658c2ecf20Sopenharmony_ci	{ .compatible = "sprd,sc9863a-apahb-gate",	/* 0x20e00000 */
17668c2ecf20Sopenharmony_ci	  .data = &sc9863a_apahb_gate_desc },
17678c2ecf20Sopenharmony_ci	{ .compatible = "sprd,sc9863a-aonapb-gate",	/* 0x402e0000 */
17688c2ecf20Sopenharmony_ci	  .data = &sc9863a_aonapb_gate_desc },
17698c2ecf20Sopenharmony_ci	{ .compatible = "sprd,sc9863a-mm-gate",	/* 0x60800000 */
17708c2ecf20Sopenharmony_ci	  .data = &sc9863a_mm_gate_desc },
17718c2ecf20Sopenharmony_ci	{ .compatible = "sprd,sc9863a-mm-clk",	/* 0x60900000 */
17728c2ecf20Sopenharmony_ci	  .data = &sc9863a_mm_clk_desc },
17738c2ecf20Sopenharmony_ci	{ .compatible = "sprd,sc9863a-apapb-gate",	/* 0x71300000 */
17748c2ecf20Sopenharmony_ci	  .data = &sc9863a_apapb_gate_desc },
17758c2ecf20Sopenharmony_ci	{ }
17768c2ecf20Sopenharmony_ci};
17778c2ecf20Sopenharmony_ciMODULE_DEVICE_TABLE(of, sprd_sc9863a_clk_ids);
17788c2ecf20Sopenharmony_ci
17798c2ecf20Sopenharmony_cistatic int sc9863a_clk_probe(struct platform_device *pdev)
17808c2ecf20Sopenharmony_ci{
17818c2ecf20Sopenharmony_ci	const struct sprd_clk_desc *desc;
17828c2ecf20Sopenharmony_ci	int ret;
17838c2ecf20Sopenharmony_ci
17848c2ecf20Sopenharmony_ci	desc = device_get_match_data(&pdev->dev);
17858c2ecf20Sopenharmony_ci	if (!desc)
17868c2ecf20Sopenharmony_ci		return -ENODEV;
17878c2ecf20Sopenharmony_ci
17888c2ecf20Sopenharmony_ci	ret = sprd_clk_regmap_init(pdev, desc);
17898c2ecf20Sopenharmony_ci	if (ret)
17908c2ecf20Sopenharmony_ci		return ret;
17918c2ecf20Sopenharmony_ci
17928c2ecf20Sopenharmony_ci	return sprd_clk_probe(&pdev->dev, desc->hw_clks);
17938c2ecf20Sopenharmony_ci}
17948c2ecf20Sopenharmony_ci
17958c2ecf20Sopenharmony_cistatic struct platform_driver sc9863a_clk_driver = {
17968c2ecf20Sopenharmony_ci	.probe	= sc9863a_clk_probe,
17978c2ecf20Sopenharmony_ci	.driver	= {
17988c2ecf20Sopenharmony_ci		.name	= "sc9863a-clk",
17998c2ecf20Sopenharmony_ci		.of_match_table	= sprd_sc9863a_clk_ids,
18008c2ecf20Sopenharmony_ci	},
18018c2ecf20Sopenharmony_ci};
18028c2ecf20Sopenharmony_cimodule_platform_driver(sc9863a_clk_driver);
18038c2ecf20Sopenharmony_ci
18048c2ecf20Sopenharmony_ciMODULE_DESCRIPTION("Spreadtrum SC9863A Clock Driver");
18058c2ecf20Sopenharmony_ciMODULE_LICENSE("GPL v2");
1806