18c2ecf20Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0 28c2ecf20Sopenharmony_ci// 38c2ecf20Sopenharmony_ci// Spreatrum SC9860 clock driver 48c2ecf20Sopenharmony_ci// 58c2ecf20Sopenharmony_ci// Copyright (C) 2017 Spreadtrum, Inc. 68c2ecf20Sopenharmony_ci// Author: Chunyan Zhang <chunyan.zhang@spreadtrum.com> 78c2ecf20Sopenharmony_ci 88c2ecf20Sopenharmony_ci#include <linux/clk-provider.h> 98c2ecf20Sopenharmony_ci#include <linux/err.h> 108c2ecf20Sopenharmony_ci#include <linux/io.h> 118c2ecf20Sopenharmony_ci#include <linux/module.h> 128c2ecf20Sopenharmony_ci#include <linux/of_device.h> 138c2ecf20Sopenharmony_ci#include <linux/platform_device.h> 148c2ecf20Sopenharmony_ci#include <linux/slab.h> 158c2ecf20Sopenharmony_ci 168c2ecf20Sopenharmony_ci#include <dt-bindings/clock/sprd,sc9860-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_cistatic CLK_FIXED_FACTOR(fac_4m, "fac-4m", "ext-26m", 268c2ecf20Sopenharmony_ci 6, 1, 0); 278c2ecf20Sopenharmony_cistatic CLK_FIXED_FACTOR(fac_2m, "fac-2m", "ext-26m", 288c2ecf20Sopenharmony_ci 13, 1, 0); 298c2ecf20Sopenharmony_cistatic CLK_FIXED_FACTOR(fac_1m, "fac-1m", "ext-26m", 308c2ecf20Sopenharmony_ci 26, 1, 0); 318c2ecf20Sopenharmony_cistatic CLK_FIXED_FACTOR(fac_250k, "fac-250k", "ext-26m", 328c2ecf20Sopenharmony_ci 104, 1, 0); 338c2ecf20Sopenharmony_cistatic CLK_FIXED_FACTOR(fac_rpll0_26m, "rpll0-26m", "ext-26m", 348c2ecf20Sopenharmony_ci 1, 1, 0); 358c2ecf20Sopenharmony_cistatic CLK_FIXED_FACTOR(fac_rpll1_26m, "rpll1-26m", "ext-26m", 368c2ecf20Sopenharmony_ci 1, 1, 0); 378c2ecf20Sopenharmony_cistatic CLK_FIXED_FACTOR(fac_rco_25m, "rco-25m", "ext-rc0-100m", 388c2ecf20Sopenharmony_ci 4, 1, 0); 398c2ecf20Sopenharmony_cistatic CLK_FIXED_FACTOR(fac_rco_4m, "rco-4m", "ext-rc0-100m", 408c2ecf20Sopenharmony_ci 25, 1, 0); 418c2ecf20Sopenharmony_cistatic CLK_FIXED_FACTOR(fac_rco_2m, "rco-2m", "ext-rc0-100m", 428c2ecf20Sopenharmony_ci 50, 1, 0); 438c2ecf20Sopenharmony_cistatic CLK_FIXED_FACTOR(fac_3k2, "fac-3k2", "ext-32k", 448c2ecf20Sopenharmony_ci 10, 1, 0); 458c2ecf20Sopenharmony_cistatic CLK_FIXED_FACTOR(fac_1k, "fac-1k", "ext-32k", 468c2ecf20Sopenharmony_ci 32, 1, 0); 478c2ecf20Sopenharmony_ci 488c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(mpll0_gate, "mpll0-gate", "ext-26m", 0xb0, 498c2ecf20Sopenharmony_ci 0x1000, BIT(2), CLK_IGNORE_UNUSED, 0); 508c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(mpll1_gate, "mpll1-gate", "ext-26m", 0xb0, 518c2ecf20Sopenharmony_ci 0x1000, BIT(18), CLK_IGNORE_UNUSED, 0); 528c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(dpll0_gate, "dpll0-gate", "ext-26m", 0xb4, 538c2ecf20Sopenharmony_ci 0x1000, BIT(2), CLK_IGNORE_UNUSED, 0); 548c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(dpll1_gate, "dpll1-gate", "ext-26m", 0xb4, 558c2ecf20Sopenharmony_ci 0x1000, BIT(18), CLK_IGNORE_UNUSED, 0); 568c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(ltepll0_gate, "ltepll0-gate", "ext-26m", 0xb8, 578c2ecf20Sopenharmony_ci 0x1000, BIT(2), CLK_IGNORE_UNUSED, 0); 588c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(twpll_gate, "twpll-gate", "ext-26m", 0xbc, 598c2ecf20Sopenharmony_ci 0x1000, BIT(2), CLK_IGNORE_UNUSED, 0); 608c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(ltepll1_gate, "ltepll1-gate", "ext-26m", 0x10c, 618c2ecf20Sopenharmony_ci 0x1000, BIT(2), CLK_IGNORE_UNUSED, 0); 628c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(rpll0_gate, "rpll0-gate", "ext-26m", 0x16c, 638c2ecf20Sopenharmony_ci 0x1000, BIT(2), 0, 0); 648c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(rpll1_gate, "rpll1-gate", "ext-26m", 0x16c, 658c2ecf20Sopenharmony_ci 0x1000, BIT(18), 0, 0); 668c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(cppll_gate, "cppll-gate", "ext-26m", 0x2b4, 678c2ecf20Sopenharmony_ci 0x1000, BIT(2), CLK_IGNORE_UNUSED, 0); 688c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(gpll_gate, "gpll-gate", "ext-26m", 0x32c, 698c2ecf20Sopenharmony_ci 0x1000, BIT(0), CLK_IGNORE_UNUSED, CLK_GATE_SET_TO_DISABLE); 708c2ecf20Sopenharmony_ci 718c2ecf20Sopenharmony_cistatic struct sprd_clk_common *sc9860_pmu_gate_clks[] = { 728c2ecf20Sopenharmony_ci /* address base is 0x402b0000 */ 738c2ecf20Sopenharmony_ci &mpll0_gate.common, 748c2ecf20Sopenharmony_ci &mpll1_gate.common, 758c2ecf20Sopenharmony_ci &dpll0_gate.common, 768c2ecf20Sopenharmony_ci &dpll1_gate.common, 778c2ecf20Sopenharmony_ci <epll0_gate.common, 788c2ecf20Sopenharmony_ci &twpll_gate.common, 798c2ecf20Sopenharmony_ci <epll1_gate.common, 808c2ecf20Sopenharmony_ci &rpll0_gate.common, 818c2ecf20Sopenharmony_ci &rpll1_gate.common, 828c2ecf20Sopenharmony_ci &cppll_gate.common, 838c2ecf20Sopenharmony_ci &gpll_gate.common, 848c2ecf20Sopenharmony_ci}; 858c2ecf20Sopenharmony_ci 868c2ecf20Sopenharmony_cistatic struct clk_hw_onecell_data sc9860_pmu_gate_hws = { 878c2ecf20Sopenharmony_ci .hws = { 888c2ecf20Sopenharmony_ci [CLK_FAC_4M] = &fac_4m.hw, 898c2ecf20Sopenharmony_ci [CLK_FAC_2M] = &fac_2m.hw, 908c2ecf20Sopenharmony_ci [CLK_FAC_1M] = &fac_1m.hw, 918c2ecf20Sopenharmony_ci [CLK_FAC_250K] = &fac_250k.hw, 928c2ecf20Sopenharmony_ci [CLK_FAC_RPLL0_26M] = &fac_rpll0_26m.hw, 938c2ecf20Sopenharmony_ci [CLK_FAC_RPLL1_26M] = &fac_rpll1_26m.hw, 948c2ecf20Sopenharmony_ci [CLK_FAC_RCO25M] = &fac_rco_25m.hw, 958c2ecf20Sopenharmony_ci [CLK_FAC_RCO4M] = &fac_rco_4m.hw, 968c2ecf20Sopenharmony_ci [CLK_FAC_RCO2M] = &fac_rco_2m.hw, 978c2ecf20Sopenharmony_ci [CLK_FAC_3K2] = &fac_3k2.hw, 988c2ecf20Sopenharmony_ci [CLK_FAC_1K] = &fac_1k.hw, 998c2ecf20Sopenharmony_ci [CLK_MPLL0_GATE] = &mpll0_gate.common.hw, 1008c2ecf20Sopenharmony_ci [CLK_MPLL1_GATE] = &mpll1_gate.common.hw, 1018c2ecf20Sopenharmony_ci [CLK_DPLL0_GATE] = &dpll0_gate.common.hw, 1028c2ecf20Sopenharmony_ci [CLK_DPLL1_GATE] = &dpll1_gate.common.hw, 1038c2ecf20Sopenharmony_ci [CLK_LTEPLL0_GATE] = <epll0_gate.common.hw, 1048c2ecf20Sopenharmony_ci [CLK_TWPLL_GATE] = &twpll_gate.common.hw, 1058c2ecf20Sopenharmony_ci [CLK_LTEPLL1_GATE] = <epll1_gate.common.hw, 1068c2ecf20Sopenharmony_ci [CLK_RPLL0_GATE] = &rpll0_gate.common.hw, 1078c2ecf20Sopenharmony_ci [CLK_RPLL1_GATE] = &rpll1_gate.common.hw, 1088c2ecf20Sopenharmony_ci [CLK_CPPLL_GATE] = &cppll_gate.common.hw, 1098c2ecf20Sopenharmony_ci [CLK_GPLL_GATE] = &gpll_gate.common.hw, 1108c2ecf20Sopenharmony_ci }, 1118c2ecf20Sopenharmony_ci .num = CLK_PMU_GATE_NUM, 1128c2ecf20Sopenharmony_ci}; 1138c2ecf20Sopenharmony_ci 1148c2ecf20Sopenharmony_cistatic const struct sprd_clk_desc sc9860_pmu_gate_desc = { 1158c2ecf20Sopenharmony_ci .clk_clks = sc9860_pmu_gate_clks, 1168c2ecf20Sopenharmony_ci .num_clk_clks = ARRAY_SIZE(sc9860_pmu_gate_clks), 1178c2ecf20Sopenharmony_ci .hw_clks = &sc9860_pmu_gate_hws, 1188c2ecf20Sopenharmony_ci}; 1198c2ecf20Sopenharmony_ci 1208c2ecf20Sopenharmony_ci/* GPLL/LPLL/DPLL/RPLL/CPLL */ 1218c2ecf20Sopenharmony_cistatic const u64 itable1[4] = {3, 780000000, 988000000, 1196000000}; 1228c2ecf20Sopenharmony_ci 1238c2ecf20Sopenharmony_ci/* TWPLL/MPLL0/MPLL1 */ 1248c2ecf20Sopenharmony_cistatic const u64 itable2[4] = {3, 1638000000, 2080000000, 2600000000UL}; 1258c2ecf20Sopenharmony_ci 1268c2ecf20Sopenharmony_cistatic const struct clk_bit_field f_mpll0[PLL_FACT_MAX] = { 1278c2ecf20Sopenharmony_ci { .shift = 20, .width = 1 }, /* lock_done */ 1288c2ecf20Sopenharmony_ci { .shift = 19, .width = 1 }, /* div_s */ 1298c2ecf20Sopenharmony_ci { .shift = 18, .width = 1 }, /* mod_en */ 1308c2ecf20Sopenharmony_ci { .shift = 17, .width = 1 }, /* sdm_en */ 1318c2ecf20Sopenharmony_ci { .shift = 0, .width = 0 }, /* refin */ 1328c2ecf20Sopenharmony_ci { .shift = 11, .width = 2 }, /* ibias */ 1338c2ecf20Sopenharmony_ci { .shift = 0, .width = 7 }, /* n */ 1348c2ecf20Sopenharmony_ci { .shift = 57, .width = 7 }, /* nint */ 1358c2ecf20Sopenharmony_ci { .shift = 32, .width = 23}, /* kint */ 1368c2ecf20Sopenharmony_ci { .shift = 0, .width = 0 }, /* prediv */ 1378c2ecf20Sopenharmony_ci { .shift = 56, .width = 1 }, /* postdiv */ 1388c2ecf20Sopenharmony_ci}; 1398c2ecf20Sopenharmony_cistatic SPRD_PLL_WITH_ITABLE_K_FVCO(mpll0_clk, "mpll0", "mpll0-gate", 0x24, 1408c2ecf20Sopenharmony_ci 2, itable2, f_mpll0, 200, 1418c2ecf20Sopenharmony_ci 1000, 1000, 1, 1300000000); 1428c2ecf20Sopenharmony_ci 1438c2ecf20Sopenharmony_cistatic const struct clk_bit_field f_mpll1[PLL_FACT_MAX] = { 1448c2ecf20Sopenharmony_ci { .shift = 20, .width = 1 }, /* lock_done */ 1458c2ecf20Sopenharmony_ci { .shift = 19, .width = 1 }, /* div_s */ 1468c2ecf20Sopenharmony_ci { .shift = 18, .width = 1 }, /* mod_en */ 1478c2ecf20Sopenharmony_ci { .shift = 17, .width = 1 }, /* sdm_en */ 1488c2ecf20Sopenharmony_ci { .shift = 0, .width = 0 }, /* refin */ 1498c2ecf20Sopenharmony_ci { .shift = 11, .width = 2 }, /* ibias */ 1508c2ecf20Sopenharmony_ci { .shift = 0, .width = 7 }, /* n */ 1518c2ecf20Sopenharmony_ci { .shift = 57, .width = 7 }, /* nint */ 1528c2ecf20Sopenharmony_ci { .shift = 32, .width = 23}, /* kint */ 1538c2ecf20Sopenharmony_ci { .shift = 56, .width = 1 }, /* prediv */ 1548c2ecf20Sopenharmony_ci { .shift = 0, .width = 0 }, /* postdiv */ 1558c2ecf20Sopenharmony_ci}; 1568c2ecf20Sopenharmony_cistatic SPRD_PLL_WITH_ITABLE_1K(mpll1_clk, "mpll1", "mpll1-gate", 0x2c, 1578c2ecf20Sopenharmony_ci 2, itable2, f_mpll1, 200); 1588c2ecf20Sopenharmony_ci 1598c2ecf20Sopenharmony_cistatic const struct clk_bit_field f_dpll[PLL_FACT_MAX] = { 1608c2ecf20Sopenharmony_ci { .shift = 16, .width = 1 }, /* lock_done */ 1618c2ecf20Sopenharmony_ci { .shift = 15, .width = 1 }, /* div_s */ 1628c2ecf20Sopenharmony_ci { .shift = 14, .width = 1 }, /* mod_en */ 1638c2ecf20Sopenharmony_ci { .shift = 13, .width = 1 }, /* sdm_en */ 1648c2ecf20Sopenharmony_ci { .shift = 0, .width = 0 }, /* refin */ 1658c2ecf20Sopenharmony_ci { .shift = 8, .width = 2 }, /* ibias */ 1668c2ecf20Sopenharmony_ci { .shift = 0, .width = 7 }, /* n */ 1678c2ecf20Sopenharmony_ci { .shift = 57, .width = 7 }, /* nint */ 1688c2ecf20Sopenharmony_ci { .shift = 32, .width = 23}, /* kint */ 1698c2ecf20Sopenharmony_ci { .shift = 0, .width = 0 }, /* prediv */ 1708c2ecf20Sopenharmony_ci { .shift = 0, .width = 0 }, /* postdiv */ 1718c2ecf20Sopenharmony_ci}; 1728c2ecf20Sopenharmony_cistatic SPRD_PLL_WITH_ITABLE_1K(dpll0_clk, "dpll0", "dpll0-gate", 0x34, 1738c2ecf20Sopenharmony_ci 2, itable1, f_dpll, 200); 1748c2ecf20Sopenharmony_ci 1758c2ecf20Sopenharmony_cistatic SPRD_PLL_WITH_ITABLE_1K(dpll1_clk, "dpll1", "dpll1-gate", 0x3c, 1768c2ecf20Sopenharmony_ci 2, itable1, f_dpll, 200); 1778c2ecf20Sopenharmony_ci 1788c2ecf20Sopenharmony_cistatic const struct clk_bit_field f_rpll[PLL_FACT_MAX] = { 1798c2ecf20Sopenharmony_ci { .shift = 0, .width = 1 }, /* lock_done */ 1808c2ecf20Sopenharmony_ci { .shift = 3, .width = 1 }, /* div_s */ 1818c2ecf20Sopenharmony_ci { .shift = 80, .width = 1 }, /* mod_en */ 1828c2ecf20Sopenharmony_ci { .shift = 81, .width = 1 }, /* sdm_en */ 1838c2ecf20Sopenharmony_ci { .shift = 0, .width = 0 }, /* refin */ 1848c2ecf20Sopenharmony_ci { .shift = 14, .width = 2 }, /* ibias */ 1858c2ecf20Sopenharmony_ci { .shift = 16, .width = 7 }, /* n */ 1868c2ecf20Sopenharmony_ci { .shift = 4, .width = 7 }, /* nint */ 1878c2ecf20Sopenharmony_ci { .shift = 32, .width = 23}, /* kint */ 1888c2ecf20Sopenharmony_ci { .shift = 0, .width = 0 }, /* prediv */ 1898c2ecf20Sopenharmony_ci { .shift = 0, .width = 0 }, /* postdiv */ 1908c2ecf20Sopenharmony_ci}; 1918c2ecf20Sopenharmony_cistatic SPRD_PLL_WITH_ITABLE_1K(rpll0_clk, "rpll0", "rpll0-gate", 0x44, 1928c2ecf20Sopenharmony_ci 3, itable1, f_rpll, 200); 1938c2ecf20Sopenharmony_ci 1948c2ecf20Sopenharmony_cistatic SPRD_PLL_WITH_ITABLE_1K(rpll1_clk, "rpll1", "rpll1-gate", 0x50, 1958c2ecf20Sopenharmony_ci 3, itable1, f_rpll, 200); 1968c2ecf20Sopenharmony_ci 1978c2ecf20Sopenharmony_cistatic const struct clk_bit_field f_twpll[PLL_FACT_MAX] = { 1988c2ecf20Sopenharmony_ci { .shift = 21, .width = 1 }, /* lock_done */ 1998c2ecf20Sopenharmony_ci { .shift = 20, .width = 1 }, /* div_s */ 2008c2ecf20Sopenharmony_ci { .shift = 19, .width = 1 }, /* mod_en */ 2018c2ecf20Sopenharmony_ci { .shift = 18, .width = 1 }, /* sdm_en */ 2028c2ecf20Sopenharmony_ci { .shift = 0, .width = 0 }, /* refin */ 2038c2ecf20Sopenharmony_ci { .shift = 13, .width = 2 }, /* ibias */ 2048c2ecf20Sopenharmony_ci { .shift = 0, .width = 7 }, /* n */ 2058c2ecf20Sopenharmony_ci { .shift = 57, .width = 7 }, /* nint */ 2068c2ecf20Sopenharmony_ci { .shift = 32, .width = 23}, /* kint */ 2078c2ecf20Sopenharmony_ci { .shift = 0, .width = 0 }, /* prediv */ 2088c2ecf20Sopenharmony_ci { .shift = 0, .width = 0 }, /* postdiv */ 2098c2ecf20Sopenharmony_ci}; 2108c2ecf20Sopenharmony_cistatic SPRD_PLL_WITH_ITABLE_1K(twpll_clk, "twpll", "twpll-gate", 0x5c, 2118c2ecf20Sopenharmony_ci 2, itable2, f_twpll, 200); 2128c2ecf20Sopenharmony_ci 2138c2ecf20Sopenharmony_cistatic const struct clk_bit_field f_ltepll[PLL_FACT_MAX] = { 2148c2ecf20Sopenharmony_ci { .shift = 31, .width = 1 }, /* lock_done */ 2158c2ecf20Sopenharmony_ci { .shift = 27, .width = 1 }, /* div_s */ 2168c2ecf20Sopenharmony_ci { .shift = 26, .width = 1 }, /* mod_en */ 2178c2ecf20Sopenharmony_ci { .shift = 25, .width = 1 }, /* sdm_en */ 2188c2ecf20Sopenharmony_ci { .shift = 0, .width = 0 }, /* refin */ 2198c2ecf20Sopenharmony_ci { .shift = 20, .width = 2 }, /* ibias */ 2208c2ecf20Sopenharmony_ci { .shift = 0, .width = 7 }, /* n */ 2218c2ecf20Sopenharmony_ci { .shift = 57, .width = 7 }, /* nint */ 2228c2ecf20Sopenharmony_ci { .shift = 32, .width = 23}, /* kint */ 2238c2ecf20Sopenharmony_ci { .shift = 0, .width = 0 }, /* prediv */ 2248c2ecf20Sopenharmony_ci { .shift = 0, .width = 0 }, /* postdiv */ 2258c2ecf20Sopenharmony_ci}; 2268c2ecf20Sopenharmony_cistatic SPRD_PLL_WITH_ITABLE_1K(ltepll0_clk, "ltepll0", "ltepll0-gate", 2278c2ecf20Sopenharmony_ci 0x64, 2, itable1, 2288c2ecf20Sopenharmony_ci f_ltepll, 200); 2298c2ecf20Sopenharmony_cistatic SPRD_PLL_WITH_ITABLE_1K(ltepll1_clk, "ltepll1", "ltepll1-gate", 2308c2ecf20Sopenharmony_ci 0x6c, 2, itable1, 2318c2ecf20Sopenharmony_ci f_ltepll, 200); 2328c2ecf20Sopenharmony_ci 2338c2ecf20Sopenharmony_cistatic const struct clk_bit_field f_gpll[PLL_FACT_MAX] = { 2348c2ecf20Sopenharmony_ci { .shift = 18, .width = 1 }, /* lock_done */ 2358c2ecf20Sopenharmony_ci { .shift = 15, .width = 1 }, /* div_s */ 2368c2ecf20Sopenharmony_ci { .shift = 14, .width = 1 }, /* mod_en */ 2378c2ecf20Sopenharmony_ci { .shift = 13, .width = 1 }, /* sdm_en */ 2388c2ecf20Sopenharmony_ci { .shift = 0, .width = 0 }, /* refin */ 2398c2ecf20Sopenharmony_ci { .shift = 8, .width = 2 }, /* ibias */ 2408c2ecf20Sopenharmony_ci { .shift = 0, .width = 7 }, /* n */ 2418c2ecf20Sopenharmony_ci { .shift = 57, .width = 7 }, /* nint */ 2428c2ecf20Sopenharmony_ci { .shift = 32, .width = 23}, /* kint */ 2438c2ecf20Sopenharmony_ci { .shift = 0, .width = 0 }, /* prediv */ 2448c2ecf20Sopenharmony_ci { .shift = 17, .width = 1 }, /* postdiv */ 2458c2ecf20Sopenharmony_ci}; 2468c2ecf20Sopenharmony_cistatic SPRD_PLL_WITH_ITABLE_K_FVCO(gpll_clk, "gpll", "gpll-gate", 0x9c, 2478c2ecf20Sopenharmony_ci 2, itable1, f_gpll, 200, 2488c2ecf20Sopenharmony_ci 1000, 1000, 1, 600000000); 2498c2ecf20Sopenharmony_ci 2508c2ecf20Sopenharmony_cistatic const struct clk_bit_field f_cppll[PLL_FACT_MAX] = { 2518c2ecf20Sopenharmony_ci { .shift = 17, .width = 1 }, /* lock_done */ 2528c2ecf20Sopenharmony_ci { .shift = 15, .width = 1 }, /* div_s */ 2538c2ecf20Sopenharmony_ci { .shift = 14, .width = 1 }, /* mod_en */ 2548c2ecf20Sopenharmony_ci { .shift = 13, .width = 1 }, /* sdm_en */ 2558c2ecf20Sopenharmony_ci { .shift = 0, .width = 0 }, /* refin */ 2568c2ecf20Sopenharmony_ci { .shift = 8, .width = 2 }, /* ibias */ 2578c2ecf20Sopenharmony_ci { .shift = 0, .width = 7 }, /* n */ 2588c2ecf20Sopenharmony_ci { .shift = 57, .width = 7 }, /* nint */ 2598c2ecf20Sopenharmony_ci { .shift = 32, .width = 23}, /* kint */ 2608c2ecf20Sopenharmony_ci { .shift = 0, .width = 0 }, /* prediv */ 2618c2ecf20Sopenharmony_ci { .shift = 0, .width = 0 }, /* postdiv */ 2628c2ecf20Sopenharmony_ci}; 2638c2ecf20Sopenharmony_cistatic SPRD_PLL_WITH_ITABLE_1K(cppll_clk, "cppll", "cppll-gate", 0xc4, 2648c2ecf20Sopenharmony_ci 2, itable1, f_cppll, 200); 2658c2ecf20Sopenharmony_ci 2668c2ecf20Sopenharmony_cistatic CLK_FIXED_FACTOR(gpll_42m5, "gpll-42m5", "gpll", 20, 1, 0); 2678c2ecf20Sopenharmony_cistatic CLK_FIXED_FACTOR(twpll_768m, "twpll-768m", "twpll", 2, 1, 0); 2688c2ecf20Sopenharmony_cistatic CLK_FIXED_FACTOR(twpll_384m, "twpll-384m", "twpll", 4, 1, 0); 2698c2ecf20Sopenharmony_cistatic CLK_FIXED_FACTOR(twpll_192m, "twpll-192m", "twpll", 8, 1, 0); 2708c2ecf20Sopenharmony_cistatic CLK_FIXED_FACTOR(twpll_96m, "twpll-96m", "twpll", 16, 1, 0); 2718c2ecf20Sopenharmony_cistatic CLK_FIXED_FACTOR(twpll_48m, "twpll-48m", "twpll", 32, 1, 0); 2728c2ecf20Sopenharmony_cistatic CLK_FIXED_FACTOR(twpll_24m, "twpll-24m", "twpll", 64, 1, 0); 2738c2ecf20Sopenharmony_cistatic CLK_FIXED_FACTOR(twpll_12m, "twpll-12m", "twpll", 128, 1, 0); 2748c2ecf20Sopenharmony_cistatic CLK_FIXED_FACTOR(twpll_512m, "twpll-512m", "twpll", 3, 1, 0); 2758c2ecf20Sopenharmony_cistatic CLK_FIXED_FACTOR(twpll_256m, "twpll-256m", "twpll", 6, 1, 0); 2768c2ecf20Sopenharmony_cistatic CLK_FIXED_FACTOR(twpll_128m, "twpll-128m", "twpll", 12, 1, 0); 2778c2ecf20Sopenharmony_cistatic CLK_FIXED_FACTOR(twpll_64m, "twpll-64m", "twpll", 24, 1, 0); 2788c2ecf20Sopenharmony_cistatic CLK_FIXED_FACTOR(twpll_307m2, "twpll-307m2", "twpll", 5, 1, 0); 2798c2ecf20Sopenharmony_cistatic CLK_FIXED_FACTOR(twpll_153m6, "twpll-153m6", "twpll", 10, 1, 0); 2808c2ecf20Sopenharmony_cistatic CLK_FIXED_FACTOR(twpll_76m8, "twpll-76m8", "twpll", 20, 1, 0); 2818c2ecf20Sopenharmony_cistatic CLK_FIXED_FACTOR(twpll_51m2, "twpll-51m2", "twpll", 30, 1, 0); 2828c2ecf20Sopenharmony_cistatic CLK_FIXED_FACTOR(twpll_38m4, "twpll-38m4", "twpll", 40, 1, 0); 2838c2ecf20Sopenharmony_cistatic CLK_FIXED_FACTOR(twpll_19m2, "twpll-19m2", "twpll", 80, 1, 0); 2848c2ecf20Sopenharmony_cistatic CLK_FIXED_FACTOR(l0_614m4, "l0-614m4", "ltepll0", 2, 1, 0); 2858c2ecf20Sopenharmony_cistatic CLK_FIXED_FACTOR(l0_409m6, "l0-409m6", "ltepll0", 3, 1, 0); 2868c2ecf20Sopenharmony_cistatic CLK_FIXED_FACTOR(l0_38m, "l0-38m", "ltepll0", 32, 1, 0); 2878c2ecf20Sopenharmony_cistatic CLK_FIXED_FACTOR(l1_38m, "l1-38m", "ltepll1", 32, 1, 0); 2888c2ecf20Sopenharmony_cistatic CLK_FIXED_FACTOR(rpll0_192m, "rpll0-192m", "rpll0", 6, 1, 0); 2898c2ecf20Sopenharmony_cistatic CLK_FIXED_FACTOR(rpll0_96m, "rpll0-96m", "rpll0", 12, 1, 0); 2908c2ecf20Sopenharmony_cistatic CLK_FIXED_FACTOR(rpll0_48m, "rpll0-48m", "rpll0", 24, 1, 0); 2918c2ecf20Sopenharmony_cistatic CLK_FIXED_FACTOR(rpll1_468m, "rpll1-468m", "rpll1", 2, 1, 0); 2928c2ecf20Sopenharmony_cistatic CLK_FIXED_FACTOR(rpll1_192m, "rpll1-192m", "rpll1", 6, 1, 0); 2938c2ecf20Sopenharmony_cistatic CLK_FIXED_FACTOR(rpll1_96m, "rpll1-96m", "rpll1", 12, 1, 0); 2948c2ecf20Sopenharmony_cistatic CLK_FIXED_FACTOR(rpll1_64m, "rpll1-64m", "rpll1", 18, 1, 0); 2958c2ecf20Sopenharmony_cistatic CLK_FIXED_FACTOR(rpll1_48m, "rpll1-48m", "rpll1", 24, 1, 0); 2968c2ecf20Sopenharmony_cistatic CLK_FIXED_FACTOR(dpll0_50m, "dpll0-50m", "dpll0", 16, 1, 0); 2978c2ecf20Sopenharmony_cistatic CLK_FIXED_FACTOR(dpll1_50m, "dpll1-50m", "dpll1", 16, 1, 0); 2988c2ecf20Sopenharmony_cistatic CLK_FIXED_FACTOR(cppll_50m, "cppll-50m", "cppll", 18, 1, 0); 2998c2ecf20Sopenharmony_cistatic CLK_FIXED_FACTOR(m0_39m, "m0-39m", "mpll0", 32, 1, 0); 3008c2ecf20Sopenharmony_cistatic CLK_FIXED_FACTOR(m1_63m, "m1-63m", "mpll1", 32, 1, 0); 3018c2ecf20Sopenharmony_ci 3028c2ecf20Sopenharmony_cistatic struct sprd_clk_common *sc9860_pll_clks[] = { 3038c2ecf20Sopenharmony_ci /* address base is 0x40400000 */ 3048c2ecf20Sopenharmony_ci &mpll0_clk.common, 3058c2ecf20Sopenharmony_ci &mpll1_clk.common, 3068c2ecf20Sopenharmony_ci &dpll0_clk.common, 3078c2ecf20Sopenharmony_ci &dpll1_clk.common, 3088c2ecf20Sopenharmony_ci &rpll0_clk.common, 3098c2ecf20Sopenharmony_ci &rpll1_clk.common, 3108c2ecf20Sopenharmony_ci &twpll_clk.common, 3118c2ecf20Sopenharmony_ci <epll0_clk.common, 3128c2ecf20Sopenharmony_ci <epll1_clk.common, 3138c2ecf20Sopenharmony_ci &gpll_clk.common, 3148c2ecf20Sopenharmony_ci &cppll_clk.common, 3158c2ecf20Sopenharmony_ci}; 3168c2ecf20Sopenharmony_ci 3178c2ecf20Sopenharmony_cistatic struct clk_hw_onecell_data sc9860_pll_hws = { 3188c2ecf20Sopenharmony_ci .hws = { 3198c2ecf20Sopenharmony_ci [CLK_MPLL0] = &mpll0_clk.common.hw, 3208c2ecf20Sopenharmony_ci [CLK_MPLL1] = &mpll1_clk.common.hw, 3218c2ecf20Sopenharmony_ci [CLK_DPLL0] = &dpll0_clk.common.hw, 3228c2ecf20Sopenharmony_ci [CLK_DPLL1] = &dpll1_clk.common.hw, 3238c2ecf20Sopenharmony_ci [CLK_RPLL0] = &rpll0_clk.common.hw, 3248c2ecf20Sopenharmony_ci [CLK_RPLL1] = &rpll1_clk.common.hw, 3258c2ecf20Sopenharmony_ci [CLK_TWPLL] = &twpll_clk.common.hw, 3268c2ecf20Sopenharmony_ci [CLK_LTEPLL0] = <epll0_clk.common.hw, 3278c2ecf20Sopenharmony_ci [CLK_LTEPLL1] = <epll1_clk.common.hw, 3288c2ecf20Sopenharmony_ci [CLK_GPLL] = &gpll_clk.common.hw, 3298c2ecf20Sopenharmony_ci [CLK_CPPLL] = &cppll_clk.common.hw, 3308c2ecf20Sopenharmony_ci [CLK_GPLL_42M5] = &gpll_42m5.hw, 3318c2ecf20Sopenharmony_ci [CLK_TWPLL_768M] = &twpll_768m.hw, 3328c2ecf20Sopenharmony_ci [CLK_TWPLL_384M] = &twpll_384m.hw, 3338c2ecf20Sopenharmony_ci [CLK_TWPLL_192M] = &twpll_192m.hw, 3348c2ecf20Sopenharmony_ci [CLK_TWPLL_96M] = &twpll_96m.hw, 3358c2ecf20Sopenharmony_ci [CLK_TWPLL_48M] = &twpll_48m.hw, 3368c2ecf20Sopenharmony_ci [CLK_TWPLL_24M] = &twpll_24m.hw, 3378c2ecf20Sopenharmony_ci [CLK_TWPLL_12M] = &twpll_12m.hw, 3388c2ecf20Sopenharmony_ci [CLK_TWPLL_512M] = &twpll_512m.hw, 3398c2ecf20Sopenharmony_ci [CLK_TWPLL_256M] = &twpll_256m.hw, 3408c2ecf20Sopenharmony_ci [CLK_TWPLL_128M] = &twpll_128m.hw, 3418c2ecf20Sopenharmony_ci [CLK_TWPLL_64M] = &twpll_64m.hw, 3428c2ecf20Sopenharmony_ci [CLK_TWPLL_307M2] = &twpll_307m2.hw, 3438c2ecf20Sopenharmony_ci [CLK_TWPLL_153M6] = &twpll_153m6.hw, 3448c2ecf20Sopenharmony_ci [CLK_TWPLL_76M8] = &twpll_76m8.hw, 3458c2ecf20Sopenharmony_ci [CLK_TWPLL_51M2] = &twpll_51m2.hw, 3468c2ecf20Sopenharmony_ci [CLK_TWPLL_38M4] = &twpll_38m4.hw, 3478c2ecf20Sopenharmony_ci [CLK_TWPLL_19M2] = &twpll_19m2.hw, 3488c2ecf20Sopenharmony_ci [CLK_L0_614M4] = &l0_614m4.hw, 3498c2ecf20Sopenharmony_ci [CLK_L0_409M6] = &l0_409m6.hw, 3508c2ecf20Sopenharmony_ci [CLK_L0_38M] = &l0_38m.hw, 3518c2ecf20Sopenharmony_ci [CLK_L1_38M] = &l1_38m.hw, 3528c2ecf20Sopenharmony_ci [CLK_RPLL0_192M] = &rpll0_192m.hw, 3538c2ecf20Sopenharmony_ci [CLK_RPLL0_96M] = &rpll0_96m.hw, 3548c2ecf20Sopenharmony_ci [CLK_RPLL0_48M] = &rpll0_48m.hw, 3558c2ecf20Sopenharmony_ci [CLK_RPLL1_468M] = &rpll1_468m.hw, 3568c2ecf20Sopenharmony_ci [CLK_RPLL1_192M] = &rpll1_192m.hw, 3578c2ecf20Sopenharmony_ci [CLK_RPLL1_96M] = &rpll1_96m.hw, 3588c2ecf20Sopenharmony_ci [CLK_RPLL1_64M] = &rpll1_64m.hw, 3598c2ecf20Sopenharmony_ci [CLK_RPLL1_48M] = &rpll1_48m.hw, 3608c2ecf20Sopenharmony_ci [CLK_DPLL0_50M] = &dpll0_50m.hw, 3618c2ecf20Sopenharmony_ci [CLK_DPLL1_50M] = &dpll1_50m.hw, 3628c2ecf20Sopenharmony_ci [CLK_CPPLL_50M] = &cppll_50m.hw, 3638c2ecf20Sopenharmony_ci [CLK_M0_39M] = &m0_39m.hw, 3648c2ecf20Sopenharmony_ci [CLK_M1_63M] = &m1_63m.hw, 3658c2ecf20Sopenharmony_ci }, 3668c2ecf20Sopenharmony_ci .num = CLK_PLL_NUM, 3678c2ecf20Sopenharmony_ci}; 3688c2ecf20Sopenharmony_ci 3698c2ecf20Sopenharmony_cistatic const struct sprd_clk_desc sc9860_pll_desc = { 3708c2ecf20Sopenharmony_ci .clk_clks = sc9860_pll_clks, 3718c2ecf20Sopenharmony_ci .num_clk_clks = ARRAY_SIZE(sc9860_pll_clks), 3728c2ecf20Sopenharmony_ci .hw_clks = &sc9860_pll_hws, 3738c2ecf20Sopenharmony_ci}; 3748c2ecf20Sopenharmony_ci 3758c2ecf20Sopenharmony_ci#define SC9860_MUX_FLAG \ 3768c2ecf20Sopenharmony_ci (CLK_GET_RATE_NOCACHE | CLK_SET_RATE_NO_REPARENT) 3778c2ecf20Sopenharmony_ci 3788c2ecf20Sopenharmony_cistatic const char * const ap_apb_parents[] = { "ext-26m", "twpll-64m", 3798c2ecf20Sopenharmony_ci "twpll-96m", "twpll-128m" }; 3808c2ecf20Sopenharmony_cistatic SPRD_MUX_CLK(ap_apb, "ap-apb", ap_apb_parents, 3818c2ecf20Sopenharmony_ci 0x20, 0, 1, SC9860_MUX_FLAG); 3828c2ecf20Sopenharmony_ci 3838c2ecf20Sopenharmony_cistatic const char * const ap_apb_usb3[] = { "ext-32k", "twpll-24m" }; 3848c2ecf20Sopenharmony_cistatic SPRD_MUX_CLK(ap_usb3, "ap-usb3", ap_apb_usb3, 3858c2ecf20Sopenharmony_ci 0x2c, 0, 1, SC9860_MUX_FLAG); 3868c2ecf20Sopenharmony_ci 3878c2ecf20Sopenharmony_cistatic const char * const uart_parents[] = { "ext-26m", "twpll-48m", 3888c2ecf20Sopenharmony_ci "twpll-51m2", "twpll-96m" }; 3898c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK(uart0_clk, "uart0", uart_parents, 0x30, 3908c2ecf20Sopenharmony_ci 0, 2, 8, 3, 0); 3918c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK(uart1_clk, "uart1", uart_parents, 0x34, 3928c2ecf20Sopenharmony_ci 0, 2, 8, 3, 0); 3938c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK(uart2_clk, "uart2", uart_parents, 0x38, 3948c2ecf20Sopenharmony_ci 0, 2, 8, 3, 0); 3958c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK(uart3_clk, "uart3", uart_parents, 0x3c, 3968c2ecf20Sopenharmony_ci 0, 2, 8, 3, 0); 3978c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK(uart4_clk, "uart4", uart_parents, 0x40, 3988c2ecf20Sopenharmony_ci 0, 2, 8, 3, 0); 3998c2ecf20Sopenharmony_ci 4008c2ecf20Sopenharmony_cistatic const char * const i2c_parents[] = { "ext-26m", "twpll-48m", 4018c2ecf20Sopenharmony_ci "twpll-51m2", "twpll-153m6" }; 4028c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK(i2c0_clk, "i2c0", i2c_parents, 0x44, 4038c2ecf20Sopenharmony_ci 0, 2, 8, 3, 0); 4048c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK(i2c1_clk, "i2c1", i2c_parents, 0x48, 4058c2ecf20Sopenharmony_ci 0, 2, 8, 3, 0); 4068c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK(i2c2_clk, "i2c2", i2c_parents, 0x4c, 4078c2ecf20Sopenharmony_ci 0, 2, 8, 3, 0); 4088c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK(i2c3_clk, "i2c3", i2c_parents, 0x50, 4098c2ecf20Sopenharmony_ci 0, 2, 8, 3, 0); 4108c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK(i2c4_clk, "i2c4", i2c_parents, 0x54, 4118c2ecf20Sopenharmony_ci 0, 2, 8, 3, 0); 4128c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK(i2c5_clk, "i2c5", i2c_parents, 0x58, 4138c2ecf20Sopenharmony_ci 0, 2, 8, 3, 0); 4148c2ecf20Sopenharmony_ci 4158c2ecf20Sopenharmony_cistatic const char * const spi_parents[] = { "ext-26m", "twpll-128m", 4168c2ecf20Sopenharmony_ci "twpll-153m6", "twpll-192m" }; 4178c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK(spi0_clk, "spi0", spi_parents, 0x5c, 4188c2ecf20Sopenharmony_ci 0, 2, 8, 3, 0); 4198c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK(spi1_clk, "spi1", spi_parents, 0x60, 4208c2ecf20Sopenharmony_ci 0, 2, 8, 3, 0); 4218c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK(spi2_clk, "spi2", spi_parents, 0x64, 4228c2ecf20Sopenharmony_ci 0, 2, 8, 3, 0); 4238c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK(spi3_clk, "spi3", spi_parents, 0x68, 4248c2ecf20Sopenharmony_ci 0, 2, 8, 3, 0); 4258c2ecf20Sopenharmony_ci 4268c2ecf20Sopenharmony_cistatic const char * const iis_parents[] = { "ext-26m", 4278c2ecf20Sopenharmony_ci "twpll-128m", 4288c2ecf20Sopenharmony_ci "twpll-153m6" }; 4298c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK(iis0_clk, "iis0", iis_parents, 0x6c, 4308c2ecf20Sopenharmony_ci 0, 2, 8, 6, 0); 4318c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK(iis1_clk, "iis1", iis_parents, 0x70, 4328c2ecf20Sopenharmony_ci 0, 2, 8, 6, 0); 4338c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK(iis2_clk, "iis2", iis_parents, 0x74, 4348c2ecf20Sopenharmony_ci 0, 2, 8, 6, 0); 4358c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK(iis3_clk, "iis3", iis_parents, 0x78, 4368c2ecf20Sopenharmony_ci 0, 2, 8, 6, 0); 4378c2ecf20Sopenharmony_ci 4388c2ecf20Sopenharmony_cistatic struct sprd_clk_common *sc9860_ap_clks[] = { 4398c2ecf20Sopenharmony_ci /* address base is 0x20000000 */ 4408c2ecf20Sopenharmony_ci &ap_apb.common, 4418c2ecf20Sopenharmony_ci &ap_usb3.common, 4428c2ecf20Sopenharmony_ci &uart0_clk.common, 4438c2ecf20Sopenharmony_ci &uart1_clk.common, 4448c2ecf20Sopenharmony_ci &uart2_clk.common, 4458c2ecf20Sopenharmony_ci &uart3_clk.common, 4468c2ecf20Sopenharmony_ci &uart4_clk.common, 4478c2ecf20Sopenharmony_ci &i2c0_clk.common, 4488c2ecf20Sopenharmony_ci &i2c1_clk.common, 4498c2ecf20Sopenharmony_ci &i2c2_clk.common, 4508c2ecf20Sopenharmony_ci &i2c3_clk.common, 4518c2ecf20Sopenharmony_ci &i2c4_clk.common, 4528c2ecf20Sopenharmony_ci &i2c5_clk.common, 4538c2ecf20Sopenharmony_ci &spi0_clk.common, 4548c2ecf20Sopenharmony_ci &spi1_clk.common, 4558c2ecf20Sopenharmony_ci &spi2_clk.common, 4568c2ecf20Sopenharmony_ci &spi3_clk.common, 4578c2ecf20Sopenharmony_ci &iis0_clk.common, 4588c2ecf20Sopenharmony_ci &iis1_clk.common, 4598c2ecf20Sopenharmony_ci &iis2_clk.common, 4608c2ecf20Sopenharmony_ci &iis3_clk.common, 4618c2ecf20Sopenharmony_ci}; 4628c2ecf20Sopenharmony_ci 4638c2ecf20Sopenharmony_cistatic struct clk_hw_onecell_data sc9860_ap_clk_hws = { 4648c2ecf20Sopenharmony_ci .hws = { 4658c2ecf20Sopenharmony_ci [CLK_AP_APB] = &ap_apb.common.hw, 4668c2ecf20Sopenharmony_ci [CLK_AP_USB3] = &ap_usb3.common.hw, 4678c2ecf20Sopenharmony_ci [CLK_UART0] = &uart0_clk.common.hw, 4688c2ecf20Sopenharmony_ci [CLK_UART1] = &uart1_clk.common.hw, 4698c2ecf20Sopenharmony_ci [CLK_UART2] = &uart2_clk.common.hw, 4708c2ecf20Sopenharmony_ci [CLK_UART3] = &uart3_clk.common.hw, 4718c2ecf20Sopenharmony_ci [CLK_UART4] = &uart4_clk.common.hw, 4728c2ecf20Sopenharmony_ci [CLK_I2C0] = &i2c0_clk.common.hw, 4738c2ecf20Sopenharmony_ci [CLK_I2C1] = &i2c1_clk.common.hw, 4748c2ecf20Sopenharmony_ci [CLK_I2C2] = &i2c2_clk.common.hw, 4758c2ecf20Sopenharmony_ci [CLK_I2C3] = &i2c3_clk.common.hw, 4768c2ecf20Sopenharmony_ci [CLK_I2C4] = &i2c4_clk.common.hw, 4778c2ecf20Sopenharmony_ci [CLK_I2C5] = &i2c5_clk.common.hw, 4788c2ecf20Sopenharmony_ci [CLK_SPI0] = &spi0_clk.common.hw, 4798c2ecf20Sopenharmony_ci [CLK_SPI1] = &spi1_clk.common.hw, 4808c2ecf20Sopenharmony_ci [CLK_SPI2] = &spi2_clk.common.hw, 4818c2ecf20Sopenharmony_ci [CLK_SPI3] = &spi3_clk.common.hw, 4828c2ecf20Sopenharmony_ci [CLK_IIS0] = &iis0_clk.common.hw, 4838c2ecf20Sopenharmony_ci [CLK_IIS1] = &iis1_clk.common.hw, 4848c2ecf20Sopenharmony_ci [CLK_IIS2] = &iis2_clk.common.hw, 4858c2ecf20Sopenharmony_ci [CLK_IIS3] = &iis3_clk.common.hw, 4868c2ecf20Sopenharmony_ci }, 4878c2ecf20Sopenharmony_ci .num = CLK_AP_CLK_NUM, 4888c2ecf20Sopenharmony_ci}; 4898c2ecf20Sopenharmony_ci 4908c2ecf20Sopenharmony_cistatic const struct sprd_clk_desc sc9860_ap_clk_desc = { 4918c2ecf20Sopenharmony_ci .clk_clks = sc9860_ap_clks, 4928c2ecf20Sopenharmony_ci .num_clk_clks = ARRAY_SIZE(sc9860_ap_clks), 4938c2ecf20Sopenharmony_ci .hw_clks = &sc9860_ap_clk_hws, 4948c2ecf20Sopenharmony_ci}; 4958c2ecf20Sopenharmony_ci 4968c2ecf20Sopenharmony_cistatic const char * const aon_apb_parents[] = { "rco-25m", "ext-26m", 4978c2ecf20Sopenharmony_ci "ext-rco-100m", "twpll-96m", 4988c2ecf20Sopenharmony_ci "twpll-128m", 4998c2ecf20Sopenharmony_ci "twpll-153m6" }; 5008c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK(aon_apb, "aon-apb", aon_apb_parents, 0x230, 5018c2ecf20Sopenharmony_ci 0, 3, 8, 2, 0); 5028c2ecf20Sopenharmony_ci 5038c2ecf20Sopenharmony_cistatic const char * const aux_parents[] = { "ext-32k", "rpll0-26m", 5048c2ecf20Sopenharmony_ci "rpll1-26m", "ext-26m", 5058c2ecf20Sopenharmony_ci "cppll-50m", "rco-25m", 5068c2ecf20Sopenharmony_ci "dpll0-50m", "dpll1-50m", 5078c2ecf20Sopenharmony_ci "gpll-42m5", "twpll-48m", 5088c2ecf20Sopenharmony_ci "m0-39m", "m1-63m", 5098c2ecf20Sopenharmony_ci "l0-38m", "l1-38m" }; 5108c2ecf20Sopenharmony_ci 5118c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK(aux0_clk, "aux0", aux_parents, 0x238, 5128c2ecf20Sopenharmony_ci 0, 5, 8, 4, 0); 5138c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK(aux1_clk, "aux1", aux_parents, 0x23c, 5148c2ecf20Sopenharmony_ci 0, 5, 8, 4, 0); 5158c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK(aux2_clk, "aux2", aux_parents, 0x240, 5168c2ecf20Sopenharmony_ci 0, 5, 8, 4, 0); 5178c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK(probe_clk, "probe", aux_parents, 0x244, 5188c2ecf20Sopenharmony_ci 0, 5, 8, 4, 0); 5198c2ecf20Sopenharmony_ci 5208c2ecf20Sopenharmony_cistatic const char * const sp_ahb_parents[] = { "rco-4m", "ext-26m", 5218c2ecf20Sopenharmony_ci "ext-rco-100m", "twpll-96m", 5228c2ecf20Sopenharmony_ci "twpll-128m", 5238c2ecf20Sopenharmony_ci "twpll-153m6" }; 5248c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK(sp_ahb, "sp-ahb", sp_ahb_parents, 0x2d0, 5258c2ecf20Sopenharmony_ci 0, 3, 8, 2, 0); 5268c2ecf20Sopenharmony_ci 5278c2ecf20Sopenharmony_cistatic const char * const cci_parents[] = { "ext-26m", "twpll-384m", 5288c2ecf20Sopenharmony_ci "l0-614m4", "twpll-768m" }; 5298c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK(cci_clk, "cci", cci_parents, 0x300, 5308c2ecf20Sopenharmony_ci 0, 2, 8, 2, 0); 5318c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK(gic_clk, "gic", cci_parents, 0x304, 5328c2ecf20Sopenharmony_ci 0, 2, 8, 2, 0); 5338c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK(cssys_clk, "cssys", cci_parents, 0x310, 5348c2ecf20Sopenharmony_ci 0, 2, 8, 2, 0); 5358c2ecf20Sopenharmony_ci 5368c2ecf20Sopenharmony_cistatic const char * const sdio_2x_parents[] = { "fac-1m", "ext-26m", 5378c2ecf20Sopenharmony_ci "twpll-307m2", "twpll-384m", 5388c2ecf20Sopenharmony_ci "l0-409m6" }; 5398c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK(sdio0_2x, "sdio0-2x", sdio_2x_parents, 0x328, 5408c2ecf20Sopenharmony_ci 0, 3, 8, 4, 0); 5418c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK(sdio1_2x, "sdio1-2x", sdio_2x_parents, 0x330, 5428c2ecf20Sopenharmony_ci 0, 3, 8, 4, 0); 5438c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK(sdio2_2x, "sdio2-2x", sdio_2x_parents, 0x338, 5448c2ecf20Sopenharmony_ci 0, 3, 8, 4, 0); 5458c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK(emmc_2x, "emmc-2x", sdio_2x_parents, 0x340, 5468c2ecf20Sopenharmony_ci 0, 3, 8, 4, 0); 5478c2ecf20Sopenharmony_ci 5488c2ecf20Sopenharmony_cistatic SPRD_DIV_CLK(sdio0_1x, "sdio0-1x", "sdio0-2x", 0x32c, 5498c2ecf20Sopenharmony_ci 8, 1, 0); 5508c2ecf20Sopenharmony_cistatic SPRD_DIV_CLK(sdio1_1x, "sdio1-1x", "sdio1-2x", 0x334, 5518c2ecf20Sopenharmony_ci 8, 1, 0); 5528c2ecf20Sopenharmony_cistatic SPRD_DIV_CLK(sdio2_1x, "sdio2-1x", "sdio2-2x", 0x33c, 5538c2ecf20Sopenharmony_ci 8, 1, 0); 5548c2ecf20Sopenharmony_cistatic SPRD_DIV_CLK(emmc_1x, "emmc-1x", "emmc-2x", 0x344, 5558c2ecf20Sopenharmony_ci 8, 1, 0); 5568c2ecf20Sopenharmony_ci 5578c2ecf20Sopenharmony_cistatic const char * const adi_parents[] = { "rco-4m", "ext-26m", 5588c2ecf20Sopenharmony_ci "rco-25m", "twpll-38m4", 5598c2ecf20Sopenharmony_ci "twpll-51m2" }; 5608c2ecf20Sopenharmony_cistatic SPRD_MUX_CLK(adi_clk, "adi", adi_parents, 0x234, 5618c2ecf20Sopenharmony_ci 0, 3, SC9860_MUX_FLAG); 5628c2ecf20Sopenharmony_ci 5638c2ecf20Sopenharmony_cistatic const char * const pwm_parents[] = { "ext-32k", "ext-26m", 5648c2ecf20Sopenharmony_ci "rco-4m", "rco-25m", 5658c2ecf20Sopenharmony_ci "twpll-48m" }; 5668c2ecf20Sopenharmony_cistatic SPRD_MUX_CLK(pwm0_clk, "pwm0", pwm_parents, 0x248, 5678c2ecf20Sopenharmony_ci 0, 3, SC9860_MUX_FLAG); 5688c2ecf20Sopenharmony_cistatic SPRD_MUX_CLK(pwm1_clk, "pwm1", pwm_parents, 0x24c, 5698c2ecf20Sopenharmony_ci 0, 3, SC9860_MUX_FLAG); 5708c2ecf20Sopenharmony_cistatic SPRD_MUX_CLK(pwm2_clk, "pwm2", pwm_parents, 0x250, 5718c2ecf20Sopenharmony_ci 0, 3, SC9860_MUX_FLAG); 5728c2ecf20Sopenharmony_cistatic SPRD_MUX_CLK(pwm3_clk, "pwm3", pwm_parents, 0x254, 5738c2ecf20Sopenharmony_ci 0, 3, SC9860_MUX_FLAG); 5748c2ecf20Sopenharmony_ci 5758c2ecf20Sopenharmony_cistatic const char * const efuse_parents[] = { "rco-25m", "ext-26m" }; 5768c2ecf20Sopenharmony_cistatic SPRD_MUX_CLK(efuse_clk, "efuse", efuse_parents, 0x258, 5778c2ecf20Sopenharmony_ci 0, 1, SC9860_MUX_FLAG); 5788c2ecf20Sopenharmony_ci 5798c2ecf20Sopenharmony_cistatic const char * const cm3_uart_parents[] = { "rco-4m", "ext-26m", 5808c2ecf20Sopenharmony_ci "rco-100m", "twpll-48m", 5818c2ecf20Sopenharmony_ci "twpll-51m2", "twpll-96m", 5828c2ecf20Sopenharmony_ci "twpll-128m" }; 5838c2ecf20Sopenharmony_cistatic SPRD_MUX_CLK(cm3_uart0, "cm3-uart0", cm3_uart_parents, 0x25c, 5848c2ecf20Sopenharmony_ci 0, 3, SC9860_MUX_FLAG); 5858c2ecf20Sopenharmony_cistatic SPRD_MUX_CLK(cm3_uart1, "cm3-uart1", cm3_uart_parents, 0x260, 5868c2ecf20Sopenharmony_ci 0, 3, SC9860_MUX_FLAG); 5878c2ecf20Sopenharmony_ci 5888c2ecf20Sopenharmony_cistatic const char * const thm_parents[] = { "ext-32k", "fac-250k" }; 5898c2ecf20Sopenharmony_cistatic SPRD_MUX_CLK(thm_clk, "thm", thm_parents, 0x270, 5908c2ecf20Sopenharmony_ci 0, 1, SC9860_MUX_FLAG); 5918c2ecf20Sopenharmony_ci 5928c2ecf20Sopenharmony_cistatic const char * const cm3_i2c_parents[] = { "rco-4m", 5938c2ecf20Sopenharmony_ci "ext-26m", 5948c2ecf20Sopenharmony_ci "rco-100m", 5958c2ecf20Sopenharmony_ci "twpll-48m", 5968c2ecf20Sopenharmony_ci "twpll-51m2", 5978c2ecf20Sopenharmony_ci "twpll-153m6" }; 5988c2ecf20Sopenharmony_cistatic SPRD_MUX_CLK(cm3_i2c0, "cm3-i2c0", cm3_i2c_parents, 0x274, 5998c2ecf20Sopenharmony_ci 0, 3, SC9860_MUX_FLAG); 6008c2ecf20Sopenharmony_cistatic SPRD_MUX_CLK(cm3_i2c1, "cm3-i2c1", cm3_i2c_parents, 0x278, 6018c2ecf20Sopenharmony_ci 0, 3, SC9860_MUX_FLAG); 6028c2ecf20Sopenharmony_cistatic SPRD_MUX_CLK(aon_i2c, "aon-i2c", cm3_i2c_parents, 0x280, 6038c2ecf20Sopenharmony_ci 0, 3, SC9860_MUX_FLAG); 6048c2ecf20Sopenharmony_ci 6058c2ecf20Sopenharmony_cistatic const char * const cm4_spi_parents[] = { "ext-26m", "twpll-96m", 6068c2ecf20Sopenharmony_ci "rco-100m", "twpll-128m", 6078c2ecf20Sopenharmony_ci "twpll-153m6", "twpll-192m" }; 6088c2ecf20Sopenharmony_cistatic SPRD_MUX_CLK(cm4_spi, "cm4-spi", cm4_spi_parents, 0x27c, 6098c2ecf20Sopenharmony_ci 0, 3, SC9860_MUX_FLAG); 6108c2ecf20Sopenharmony_ci 6118c2ecf20Sopenharmony_cistatic SPRD_MUX_CLK(avs_clk, "avs", uart_parents, 0x284, 6128c2ecf20Sopenharmony_ci 0, 2, SC9860_MUX_FLAG); 6138c2ecf20Sopenharmony_ci 6148c2ecf20Sopenharmony_cistatic const char * const ca53_dap_parents[] = { "ext-26m", "rco-4m", 6158c2ecf20Sopenharmony_ci "rco-100m", "twpll-76m8", 6168c2ecf20Sopenharmony_ci "twpll-128m", "twpll-153m6" }; 6178c2ecf20Sopenharmony_cistatic SPRD_MUX_CLK(ca53_dap, "ca53-dap", ca53_dap_parents, 0x288, 6188c2ecf20Sopenharmony_ci 0, 3, SC9860_MUX_FLAG); 6198c2ecf20Sopenharmony_ci 6208c2ecf20Sopenharmony_cistatic const char * const ca53_ts_parents[] = { "ext-32k", "ext-26m", 6218c2ecf20Sopenharmony_ci "clk-twpll-128m", 6228c2ecf20Sopenharmony_ci "clk-twpll-153m6" }; 6238c2ecf20Sopenharmony_cistatic SPRD_MUX_CLK(ca53_ts, "ca53-ts", ca53_ts_parents, 0x290, 6248c2ecf20Sopenharmony_ci 0, 2, SC9860_MUX_FLAG); 6258c2ecf20Sopenharmony_ci 6268c2ecf20Sopenharmony_cistatic const char * const djtag_tck_parents[] = { "rco-4m", "ext-26m" }; 6278c2ecf20Sopenharmony_cistatic SPRD_MUX_CLK(djtag_tck, "djtag-tck", djtag_tck_parents, 0x2c8, 6288c2ecf20Sopenharmony_ci 0, 1, SC9860_MUX_FLAG); 6298c2ecf20Sopenharmony_ci 6308c2ecf20Sopenharmony_cistatic const char * const pmu_parents[] = { "ext-32k", "rco-4m", "clk-4m" }; 6318c2ecf20Sopenharmony_cistatic SPRD_MUX_CLK(pmu_clk, "pmu", pmu_parents, 0x2e0, 6328c2ecf20Sopenharmony_ci 0, 2, SC9860_MUX_FLAG); 6338c2ecf20Sopenharmony_ci 6348c2ecf20Sopenharmony_cistatic const char * const pmu_26m_parents[] = { "rco-25m", "ext-26m" }; 6358c2ecf20Sopenharmony_cistatic SPRD_MUX_CLK(pmu_26m, "pmu-26m", pmu_26m_parents, 0x2e4, 6368c2ecf20Sopenharmony_ci 0, 1, SC9860_MUX_FLAG); 6378c2ecf20Sopenharmony_ci 6388c2ecf20Sopenharmony_cistatic const char * const debounce_parents[] = { "ext-32k", "rco-4m", 6398c2ecf20Sopenharmony_ci "rco-25m", "ext-26m" }; 6408c2ecf20Sopenharmony_cistatic SPRD_MUX_CLK(debounce_clk, "debounce", debounce_parents, 0x2e8, 6418c2ecf20Sopenharmony_ci 0, 2, SC9860_MUX_FLAG); 6428c2ecf20Sopenharmony_ci 6438c2ecf20Sopenharmony_cistatic const char * const otg2_ref_parents[] = { "twpll-12m", "twpll-24m" }; 6448c2ecf20Sopenharmony_cistatic SPRD_MUX_CLK(otg2_ref, "otg2-ref", otg2_ref_parents, 0x2f4, 6458c2ecf20Sopenharmony_ci 0, 1, SC9860_MUX_FLAG); 6468c2ecf20Sopenharmony_ci 6478c2ecf20Sopenharmony_cistatic const char * const usb3_ref_parents[] = { "twpll-24m", "twpll-19m2", 6488c2ecf20Sopenharmony_ci "twpll-48m" }; 6498c2ecf20Sopenharmony_cistatic SPRD_MUX_CLK(usb3_ref, "usb3-ref", usb3_ref_parents, 0x2f8, 6508c2ecf20Sopenharmony_ci 0, 2, SC9860_MUX_FLAG); 6518c2ecf20Sopenharmony_ci 6528c2ecf20Sopenharmony_cistatic const char * const ap_axi_parents[] = { "ext-26m", "twpll-76m8", 6538c2ecf20Sopenharmony_ci "twpll-128m", "twpll-256m" }; 6548c2ecf20Sopenharmony_cistatic SPRD_MUX_CLK(ap_axi, "ap-axi", ap_axi_parents, 0x324, 6558c2ecf20Sopenharmony_ci 0, 2, SC9860_MUX_FLAG); 6568c2ecf20Sopenharmony_ci 6578c2ecf20Sopenharmony_cistatic struct sprd_clk_common *sc9860_aon_prediv[] = { 6588c2ecf20Sopenharmony_ci /* address base is 0x402d0000 */ 6598c2ecf20Sopenharmony_ci &aon_apb.common, 6608c2ecf20Sopenharmony_ci &aux0_clk.common, 6618c2ecf20Sopenharmony_ci &aux1_clk.common, 6628c2ecf20Sopenharmony_ci &aux2_clk.common, 6638c2ecf20Sopenharmony_ci &probe_clk.common, 6648c2ecf20Sopenharmony_ci &sp_ahb.common, 6658c2ecf20Sopenharmony_ci &cci_clk.common, 6668c2ecf20Sopenharmony_ci &gic_clk.common, 6678c2ecf20Sopenharmony_ci &cssys_clk.common, 6688c2ecf20Sopenharmony_ci &sdio0_2x.common, 6698c2ecf20Sopenharmony_ci &sdio1_2x.common, 6708c2ecf20Sopenharmony_ci &sdio2_2x.common, 6718c2ecf20Sopenharmony_ci &emmc_2x.common, 6728c2ecf20Sopenharmony_ci &sdio0_1x.common, 6738c2ecf20Sopenharmony_ci &sdio1_1x.common, 6748c2ecf20Sopenharmony_ci &sdio2_1x.common, 6758c2ecf20Sopenharmony_ci &emmc_1x.common, 6768c2ecf20Sopenharmony_ci &adi_clk.common, 6778c2ecf20Sopenharmony_ci &pwm0_clk.common, 6788c2ecf20Sopenharmony_ci &pwm1_clk.common, 6798c2ecf20Sopenharmony_ci &pwm2_clk.common, 6808c2ecf20Sopenharmony_ci &pwm3_clk.common, 6818c2ecf20Sopenharmony_ci &efuse_clk.common, 6828c2ecf20Sopenharmony_ci &cm3_uart0.common, 6838c2ecf20Sopenharmony_ci &cm3_uart1.common, 6848c2ecf20Sopenharmony_ci &thm_clk.common, 6858c2ecf20Sopenharmony_ci &cm3_i2c0.common, 6868c2ecf20Sopenharmony_ci &cm3_i2c1.common, 6878c2ecf20Sopenharmony_ci &cm4_spi.common, 6888c2ecf20Sopenharmony_ci &aon_i2c.common, 6898c2ecf20Sopenharmony_ci &avs_clk.common, 6908c2ecf20Sopenharmony_ci &ca53_dap.common, 6918c2ecf20Sopenharmony_ci &ca53_ts.common, 6928c2ecf20Sopenharmony_ci &djtag_tck.common, 6938c2ecf20Sopenharmony_ci &pmu_clk.common, 6948c2ecf20Sopenharmony_ci &pmu_26m.common, 6958c2ecf20Sopenharmony_ci &debounce_clk.common, 6968c2ecf20Sopenharmony_ci &otg2_ref.common, 6978c2ecf20Sopenharmony_ci &usb3_ref.common, 6988c2ecf20Sopenharmony_ci &ap_axi.common, 6998c2ecf20Sopenharmony_ci}; 7008c2ecf20Sopenharmony_ci 7018c2ecf20Sopenharmony_cistatic struct clk_hw_onecell_data sc9860_aon_prediv_hws = { 7028c2ecf20Sopenharmony_ci .hws = { 7038c2ecf20Sopenharmony_ci [CLK_AON_APB] = &aon_apb.common.hw, 7048c2ecf20Sopenharmony_ci [CLK_AUX0] = &aux0_clk.common.hw, 7058c2ecf20Sopenharmony_ci [CLK_AUX1] = &aux1_clk.common.hw, 7068c2ecf20Sopenharmony_ci [CLK_AUX2] = &aux2_clk.common.hw, 7078c2ecf20Sopenharmony_ci [CLK_PROBE] = &probe_clk.common.hw, 7088c2ecf20Sopenharmony_ci [CLK_SP_AHB] = &sp_ahb.common.hw, 7098c2ecf20Sopenharmony_ci [CLK_CCI] = &cci_clk.common.hw, 7108c2ecf20Sopenharmony_ci [CLK_GIC] = &gic_clk.common.hw, 7118c2ecf20Sopenharmony_ci [CLK_CSSYS] = &cssys_clk.common.hw, 7128c2ecf20Sopenharmony_ci [CLK_SDIO0_2X] = &sdio0_2x.common.hw, 7138c2ecf20Sopenharmony_ci [CLK_SDIO1_2X] = &sdio1_2x.common.hw, 7148c2ecf20Sopenharmony_ci [CLK_SDIO2_2X] = &sdio2_2x.common.hw, 7158c2ecf20Sopenharmony_ci [CLK_EMMC_2X] = &emmc_2x.common.hw, 7168c2ecf20Sopenharmony_ci [CLK_SDIO0_1X] = &sdio0_1x.common.hw, 7178c2ecf20Sopenharmony_ci [CLK_SDIO1_1X] = &sdio1_1x.common.hw, 7188c2ecf20Sopenharmony_ci [CLK_SDIO2_1X] = &sdio2_1x.common.hw, 7198c2ecf20Sopenharmony_ci [CLK_EMMC_1X] = &emmc_1x.common.hw, 7208c2ecf20Sopenharmony_ci [CLK_ADI] = &adi_clk.common.hw, 7218c2ecf20Sopenharmony_ci [CLK_PWM0] = &pwm0_clk.common.hw, 7228c2ecf20Sopenharmony_ci [CLK_PWM1] = &pwm1_clk.common.hw, 7238c2ecf20Sopenharmony_ci [CLK_PWM2] = &pwm2_clk.common.hw, 7248c2ecf20Sopenharmony_ci [CLK_PWM3] = &pwm3_clk.common.hw, 7258c2ecf20Sopenharmony_ci [CLK_EFUSE] = &efuse_clk.common.hw, 7268c2ecf20Sopenharmony_ci [CLK_CM3_UART0] = &cm3_uart0.common.hw, 7278c2ecf20Sopenharmony_ci [CLK_CM3_UART1] = &cm3_uart1.common.hw, 7288c2ecf20Sopenharmony_ci [CLK_THM] = &thm_clk.common.hw, 7298c2ecf20Sopenharmony_ci [CLK_CM3_I2C0] = &cm3_i2c0.common.hw, 7308c2ecf20Sopenharmony_ci [CLK_CM3_I2C1] = &cm3_i2c1.common.hw, 7318c2ecf20Sopenharmony_ci [CLK_CM4_SPI] = &cm4_spi.common.hw, 7328c2ecf20Sopenharmony_ci [CLK_AON_I2C] = &aon_i2c.common.hw, 7338c2ecf20Sopenharmony_ci [CLK_AVS] = &avs_clk.common.hw, 7348c2ecf20Sopenharmony_ci [CLK_CA53_DAP] = &ca53_dap.common.hw, 7358c2ecf20Sopenharmony_ci [CLK_CA53_TS] = &ca53_ts.common.hw, 7368c2ecf20Sopenharmony_ci [CLK_DJTAG_TCK] = &djtag_tck.common.hw, 7378c2ecf20Sopenharmony_ci [CLK_PMU] = &pmu_clk.common.hw, 7388c2ecf20Sopenharmony_ci [CLK_PMU_26M] = &pmu_26m.common.hw, 7398c2ecf20Sopenharmony_ci [CLK_DEBOUNCE] = &debounce_clk.common.hw, 7408c2ecf20Sopenharmony_ci [CLK_OTG2_REF] = &otg2_ref.common.hw, 7418c2ecf20Sopenharmony_ci [CLK_USB3_REF] = &usb3_ref.common.hw, 7428c2ecf20Sopenharmony_ci [CLK_AP_AXI] = &ap_axi.common.hw, 7438c2ecf20Sopenharmony_ci }, 7448c2ecf20Sopenharmony_ci .num = CLK_AON_PREDIV_NUM, 7458c2ecf20Sopenharmony_ci}; 7468c2ecf20Sopenharmony_ci 7478c2ecf20Sopenharmony_cistatic const struct sprd_clk_desc sc9860_aon_prediv_desc = { 7488c2ecf20Sopenharmony_ci .clk_clks = sc9860_aon_prediv, 7498c2ecf20Sopenharmony_ci .num_clk_clks = ARRAY_SIZE(sc9860_aon_prediv), 7508c2ecf20Sopenharmony_ci .hw_clks = &sc9860_aon_prediv_hws, 7518c2ecf20Sopenharmony_ci}; 7528c2ecf20Sopenharmony_ci 7538c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(usb3_eb, "usb3-eb", "ap-axi", 0x0, 7548c2ecf20Sopenharmony_ci 0x1000, BIT(2), CLK_IGNORE_UNUSED, 0); 7558c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(usb3_suspend, "usb3-suspend", "ap-axi", 0x0, 7568c2ecf20Sopenharmony_ci 0x1000, BIT(3), CLK_IGNORE_UNUSED, 0); 7578c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(usb3_ref_eb, "usb3-ref-eb", "ap-axi", 0x0, 7588c2ecf20Sopenharmony_ci 0x1000, BIT(4), CLK_IGNORE_UNUSED, 0); 7598c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(dma_eb, "dma-eb", "ap-axi", 0x0, 7608c2ecf20Sopenharmony_ci 0x1000, BIT(5), CLK_IGNORE_UNUSED, 0); 7618c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(sdio0_eb, "sdio0-eb", "ap-axi", 0x0, 7628c2ecf20Sopenharmony_ci 0x1000, BIT(7), CLK_IGNORE_UNUSED, 0); 7638c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(sdio1_eb, "sdio1-eb", "ap-axi", 0x0, 7648c2ecf20Sopenharmony_ci 0x1000, BIT(8), CLK_IGNORE_UNUSED, 0); 7658c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(sdio2_eb, "sdio2-eb", "ap-axi", 0x0, 7668c2ecf20Sopenharmony_ci 0x1000, BIT(9), CLK_IGNORE_UNUSED, 0); 7678c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(emmc_eb, "emmc-eb", "ap-axi", 0x0, 7688c2ecf20Sopenharmony_ci 0x1000, BIT(10), CLK_IGNORE_UNUSED, 0); 7698c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(rom_eb, "rom-eb", "ap-axi", 0x0, 7708c2ecf20Sopenharmony_ci 0x1000, BIT(12), CLK_IGNORE_UNUSED, 0); 7718c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(busmon_eb, "busmon-eb", "ap-axi", 0x0, 7728c2ecf20Sopenharmony_ci 0x1000, BIT(13), CLK_IGNORE_UNUSED, 0); 7738c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(cc63s_eb, "cc63s-eb", "ap-axi", 0x0, 7748c2ecf20Sopenharmony_ci 0x1000, BIT(22), CLK_IGNORE_UNUSED, 0); 7758c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(cc63p_eb, "cc63p-eb", "ap-axi", 0x0, 7768c2ecf20Sopenharmony_ci 0x1000, BIT(23), CLK_IGNORE_UNUSED, 0); 7778c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(ce0_eb, "ce0-eb", "ap-axi", 0x0, 7788c2ecf20Sopenharmony_ci 0x1000, BIT(24), CLK_IGNORE_UNUSED, 0); 7798c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(ce1_eb, "ce1-eb", "ap-axi", 0x0, 7808c2ecf20Sopenharmony_ci 0x1000, BIT(25), CLK_IGNORE_UNUSED, 0); 7818c2ecf20Sopenharmony_ci 7828c2ecf20Sopenharmony_cistatic struct sprd_clk_common *sc9860_apahb_gate[] = { 7838c2ecf20Sopenharmony_ci /* address base is 0x20210000 */ 7848c2ecf20Sopenharmony_ci &usb3_eb.common, 7858c2ecf20Sopenharmony_ci &usb3_suspend.common, 7868c2ecf20Sopenharmony_ci &usb3_ref_eb.common, 7878c2ecf20Sopenharmony_ci &dma_eb.common, 7888c2ecf20Sopenharmony_ci &sdio0_eb.common, 7898c2ecf20Sopenharmony_ci &sdio1_eb.common, 7908c2ecf20Sopenharmony_ci &sdio2_eb.common, 7918c2ecf20Sopenharmony_ci &emmc_eb.common, 7928c2ecf20Sopenharmony_ci &rom_eb.common, 7938c2ecf20Sopenharmony_ci &busmon_eb.common, 7948c2ecf20Sopenharmony_ci &cc63s_eb.common, 7958c2ecf20Sopenharmony_ci &cc63p_eb.common, 7968c2ecf20Sopenharmony_ci &ce0_eb.common, 7978c2ecf20Sopenharmony_ci &ce1_eb.common, 7988c2ecf20Sopenharmony_ci}; 7998c2ecf20Sopenharmony_ci 8008c2ecf20Sopenharmony_cistatic struct clk_hw_onecell_data sc9860_apahb_gate_hws = { 8018c2ecf20Sopenharmony_ci .hws = { 8028c2ecf20Sopenharmony_ci [CLK_USB3_EB] = &usb3_eb.common.hw, 8038c2ecf20Sopenharmony_ci [CLK_USB3_SUSPEND_EB] = &usb3_suspend.common.hw, 8048c2ecf20Sopenharmony_ci [CLK_USB3_REF_EB] = &usb3_ref_eb.common.hw, 8058c2ecf20Sopenharmony_ci [CLK_DMA_EB] = &dma_eb.common.hw, 8068c2ecf20Sopenharmony_ci [CLK_SDIO0_EB] = &sdio0_eb.common.hw, 8078c2ecf20Sopenharmony_ci [CLK_SDIO1_EB] = &sdio1_eb.common.hw, 8088c2ecf20Sopenharmony_ci [CLK_SDIO2_EB] = &sdio2_eb.common.hw, 8098c2ecf20Sopenharmony_ci [CLK_EMMC_EB] = &emmc_eb.common.hw, 8108c2ecf20Sopenharmony_ci [CLK_ROM_EB] = &rom_eb.common.hw, 8118c2ecf20Sopenharmony_ci [CLK_BUSMON_EB] = &busmon_eb.common.hw, 8128c2ecf20Sopenharmony_ci [CLK_CC63S_EB] = &cc63s_eb.common.hw, 8138c2ecf20Sopenharmony_ci [CLK_CC63P_EB] = &cc63p_eb.common.hw, 8148c2ecf20Sopenharmony_ci [CLK_CE0_EB] = &ce0_eb.common.hw, 8158c2ecf20Sopenharmony_ci [CLK_CE1_EB] = &ce1_eb.common.hw, 8168c2ecf20Sopenharmony_ci }, 8178c2ecf20Sopenharmony_ci .num = CLK_APAHB_GATE_NUM, 8188c2ecf20Sopenharmony_ci}; 8198c2ecf20Sopenharmony_ci 8208c2ecf20Sopenharmony_cistatic const struct sprd_clk_desc sc9860_apahb_gate_desc = { 8218c2ecf20Sopenharmony_ci .clk_clks = sc9860_apahb_gate, 8228c2ecf20Sopenharmony_ci .num_clk_clks = ARRAY_SIZE(sc9860_apahb_gate), 8238c2ecf20Sopenharmony_ci .hw_clks = &sc9860_apahb_gate_hws, 8248c2ecf20Sopenharmony_ci}; 8258c2ecf20Sopenharmony_ci 8268c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(avs_lit_eb, "avs-lit-eb", "aon-apb", 0x0, 8278c2ecf20Sopenharmony_ci 0x1000, BIT(0), CLK_IGNORE_UNUSED, 0); 8288c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(avs_big_eb, "avs-big-eb", "aon-apb", 0x0, 8298c2ecf20Sopenharmony_ci 0x1000, BIT(1), CLK_IGNORE_UNUSED, 0); 8308c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(ap_intc5_eb, "ap-intc5-eb", "aon-apb", 0x0, 8318c2ecf20Sopenharmony_ci 0x1000, BIT(2), CLK_IGNORE_UNUSED, 0); 8328c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(gpio_eb, "gpio-eb", "aon-apb", 0x0, 8338c2ecf20Sopenharmony_ci 0x1000, BIT(3), CLK_IGNORE_UNUSED, 0); 8348c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(pwm0_eb, "pwm0-eb", "aon-apb", 0x0, 8358c2ecf20Sopenharmony_ci 0x1000, BIT(4), CLK_IGNORE_UNUSED, 0); 8368c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(pwm1_eb, "pwm1-eb", "aon-apb", 0x0, 8378c2ecf20Sopenharmony_ci 0x1000, BIT(5), CLK_IGNORE_UNUSED, 0); 8388c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(pwm2_eb, "pwm2-eb", "aon-apb", 0x0, 8398c2ecf20Sopenharmony_ci 0x1000, BIT(6), CLK_IGNORE_UNUSED, 0); 8408c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(pwm3_eb, "pwm3-eb", "aon-apb", 0x0, 8418c2ecf20Sopenharmony_ci 0x1000, BIT(7), CLK_IGNORE_UNUSED, 0); 8428c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(kpd_eb, "kpd-eb", "aon-apb", 0x0, 8438c2ecf20Sopenharmony_ci 0x1000, BIT(8), CLK_IGNORE_UNUSED, 0); 8448c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(aon_sys_eb, "aon-sys-eb", "aon-apb", 0x0, 8458c2ecf20Sopenharmony_ci 0x1000, BIT(9), CLK_IGNORE_UNUSED, 0); 8468c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(ap_sys_eb, "ap-sys-eb", "aon-apb", 0x0, 8478c2ecf20Sopenharmony_ci 0x1000, BIT(10), CLK_IGNORE_UNUSED, 0); 8488c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(aon_tmr_eb, "aon-tmr-eb", "aon-apb", 0x0, 8498c2ecf20Sopenharmony_ci 0x1000, BIT(11), CLK_IGNORE_UNUSED, 0); 8508c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(ap_tmr0_eb, "ap-tmr0-eb", "aon-apb", 0x0, 8518c2ecf20Sopenharmony_ci 0x1000, BIT(12), CLK_IGNORE_UNUSED, 0); 8528c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(efuse_eb, "efuse-eb", "aon-apb", 0x0, 8538c2ecf20Sopenharmony_ci 0x1000, BIT(13), CLK_IGNORE_UNUSED, 0); 8548c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(eic_eb, "eic-eb", "aon-apb", 0x0, 8558c2ecf20Sopenharmony_ci 0x1000, BIT(14), CLK_IGNORE_UNUSED, 0); 8568c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(pub1_reg_eb, "pub1-reg-eb", "aon-apb", 0x0, 8578c2ecf20Sopenharmony_ci 0x1000, BIT(15), CLK_IGNORE_UNUSED, 0); 8588c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(adi_eb, "adi-eb", "aon-apb", 0x0, 8598c2ecf20Sopenharmony_ci 0x1000, BIT(16), CLK_IGNORE_UNUSED, 0); 8608c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(ap_intc0_eb, "ap-intc0-eb", "aon-apb", 0x0, 8618c2ecf20Sopenharmony_ci 0x1000, BIT(17), CLK_IGNORE_UNUSED, 0); 8628c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(ap_intc1_eb, "ap-intc1-eb", "aon-apb", 0x0, 8638c2ecf20Sopenharmony_ci 0x1000, BIT(18), CLK_IGNORE_UNUSED, 0); 8648c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(ap_intc2_eb, "ap-intc2-eb", "aon-apb", 0x0, 8658c2ecf20Sopenharmony_ci 0x1000, BIT(19), CLK_IGNORE_UNUSED, 0); 8668c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(ap_intc3_eb, "ap-intc3-eb", "aon-apb", 0x0, 8678c2ecf20Sopenharmony_ci 0x1000, BIT(20), CLK_IGNORE_UNUSED, 0); 8688c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(ap_intc4_eb, "ap-intc4-eb", "aon-apb", 0x0, 8698c2ecf20Sopenharmony_ci 0x1000, BIT(21), CLK_IGNORE_UNUSED, 0); 8708c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(splk_eb, "splk-eb", "aon-apb", 0x0, 8718c2ecf20Sopenharmony_ci 0x1000, BIT(22), CLK_IGNORE_UNUSED, 0); 8728c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(mspi_eb, "mspi-eb", "aon-apb", 0x0, 8738c2ecf20Sopenharmony_ci 0x1000, BIT(23), CLK_IGNORE_UNUSED, 0); 8748c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(pub0_reg_eb, "pub0-reg-eb", "aon-apb", 0x0, 8758c2ecf20Sopenharmony_ci 0x1000, BIT(24), CLK_IGNORE_UNUSED, 0); 8768c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(pin_eb, "pin-eb", "aon-apb", 0x0, 8778c2ecf20Sopenharmony_ci 0x1000, BIT(25), CLK_IGNORE_UNUSED, 0); 8788c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(aon_ckg_eb, "aon-ckg-eb", "aon-apb", 0x0, 8798c2ecf20Sopenharmony_ci 0x1000, BIT(26), CLK_IGNORE_UNUSED, 0); 8808c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(gpu_eb, "gpu-eb", "aon-apb", 0x0, 8818c2ecf20Sopenharmony_ci 0x1000, BIT(27), CLK_IGNORE_UNUSED, 0); 8828c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(apcpu_ts0_eb, "apcpu-ts0-eb", "aon-apb", 0x0, 8838c2ecf20Sopenharmony_ci 0x1000, BIT(28), CLK_IGNORE_UNUSED, 0); 8848c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(apcpu_ts1_eb, "apcpu-ts1-eb", "aon-apb", 0x0, 8858c2ecf20Sopenharmony_ci 0x1000, BIT(29), CLK_IGNORE_UNUSED, 0); 8868c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(dap_eb, "dap-eb", "aon-apb", 0x0, 8878c2ecf20Sopenharmony_ci 0x1000, BIT(30), CLK_IGNORE_UNUSED, 0); 8888c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(i2c_eb, "i2c-eb", "aon-apb", 0x0, 8898c2ecf20Sopenharmony_ci 0x1000, BIT(31), CLK_IGNORE_UNUSED, 0); 8908c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(pmu_eb, "pmu-eb", "aon-apb", 0x4, 8918c2ecf20Sopenharmony_ci 0x1000, BIT(0), CLK_IGNORE_UNUSED, 0); 8928c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(thm_eb, "thm-eb", "aon-apb", 0x4, 8938c2ecf20Sopenharmony_ci 0x1000, BIT(1), CLK_IGNORE_UNUSED, 0); 8948c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(aux0_eb, "aux0-eb", "aon-apb", 0x4, 8958c2ecf20Sopenharmony_ci 0x1000, BIT(2), CLK_IGNORE_UNUSED, 0); 8968c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(aux1_eb, "aux1-eb", "aon-apb", 0x4, 8978c2ecf20Sopenharmony_ci 0x1000, BIT(3), CLK_IGNORE_UNUSED, 0); 8988c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(aux2_eb, "aux2-eb", "aon-apb", 0x4, 8998c2ecf20Sopenharmony_ci 0x1000, BIT(4), CLK_IGNORE_UNUSED, 0); 9008c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(probe_eb, "probe-eb", "aon-apb", 0x4, 9018c2ecf20Sopenharmony_ci 0x1000, BIT(5), CLK_IGNORE_UNUSED, 0); 9028c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(gpu0_avs_eb, "gpu0-avs-eb", "aon-apb", 0x4, 9038c2ecf20Sopenharmony_ci 0x1000, BIT(6), CLK_IGNORE_UNUSED, 0); 9048c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(gpu1_avs_eb, "gpu1-avs-eb", "aon-apb", 0x4, 9058c2ecf20Sopenharmony_ci 0x1000, BIT(7), CLK_IGNORE_UNUSED, 0); 9068c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(apcpu_wdg_eb, "apcpu-wdg-eb", "aon-apb", 0x4, 9078c2ecf20Sopenharmony_ci 0x1000, BIT(8), CLK_IGNORE_UNUSED, 0); 9088c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(ap_tmr1_eb, "ap-tmr1-eb", "aon-apb", 0x4, 9098c2ecf20Sopenharmony_ci 0x1000, BIT(9), CLK_IGNORE_UNUSED, 0); 9108c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(ap_tmr2_eb, "ap-tmr2-eb", "aon-apb", 0x4, 9118c2ecf20Sopenharmony_ci 0x1000, BIT(10), CLK_IGNORE_UNUSED, 0); 9128c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(disp_emc_eb, "disp-emc-eb", "aon-apb", 0x4, 9138c2ecf20Sopenharmony_ci 0x1000, BIT(11), CLK_IGNORE_UNUSED, 0); 9148c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(zip_emc_eb, "zip-emc-eb", "aon-apb", 0x4, 9158c2ecf20Sopenharmony_ci 0x1000, BIT(12), CLK_IGNORE_UNUSED, 0); 9168c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(gsp_emc_eb, "gsp-emc-eb", "aon-apb", 0x4, 9178c2ecf20Sopenharmony_ci 0x1000, BIT(13), CLK_IGNORE_UNUSED, 0); 9188c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(osc_aon_eb, "osc-aon-eb", "aon-apb", 0x4, 9198c2ecf20Sopenharmony_ci 0x1000, BIT(14), CLK_IGNORE_UNUSED, 0); 9208c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(lvds_trx_eb, "lvds-trx-eb", "aon-apb", 0x4, 9218c2ecf20Sopenharmony_ci 0x1000, BIT(15), CLK_IGNORE_UNUSED, 0); 9228c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(lvds_tcxo_eb, "lvds-tcxo-eb", "aon-apb", 0x4, 9238c2ecf20Sopenharmony_ci 0x1000, BIT(16), CLK_IGNORE_UNUSED, 0); 9248c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(mdar_eb, "mdar-eb", "aon-apb", 0x4, 9258c2ecf20Sopenharmony_ci 0x1000, BIT(17), CLK_IGNORE_UNUSED, 0); 9268c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(rtc4m0_cal_eb, "rtc4m0-cal-eb", "aon-apb", 0x4, 9278c2ecf20Sopenharmony_ci 0x1000, BIT(18), CLK_IGNORE_UNUSED, 0); 9288c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(rct100m_cal_eb, "rct100m-cal-eb", "aon-apb", 0x4, 9298c2ecf20Sopenharmony_ci 0x1000, BIT(19), CLK_IGNORE_UNUSED, 0); 9308c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(djtag_eb, "djtag-eb", "aon-apb", 0x4, 9318c2ecf20Sopenharmony_ci 0x1000, BIT(20), CLK_IGNORE_UNUSED, 0); 9328c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(mbox_eb, "mbox-eb", "aon-apb", 0x4, 9338c2ecf20Sopenharmony_ci 0x1000, BIT(21), CLK_IGNORE_UNUSED, 0); 9348c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(aon_dma_eb, "aon-dma-eb", "aon-apb", 0x4, 9358c2ecf20Sopenharmony_ci 0x1000, BIT(22), CLK_IGNORE_UNUSED, 0); 9368c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(dbg_emc_eb, "dbg-emc-eb", "aon-apb", 0x4, 9378c2ecf20Sopenharmony_ci 0x1000, BIT(23), CLK_IGNORE_UNUSED, 0); 9388c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(lvds_pll_div_en, "lvds-pll-div-en", "aon-apb", 0x4, 9398c2ecf20Sopenharmony_ci 0x1000, BIT(24), CLK_IGNORE_UNUSED, 0); 9408c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(def_eb, "def-eb", "aon-apb", 0x4, 9418c2ecf20Sopenharmony_ci 0x1000, BIT(25), CLK_IGNORE_UNUSED, 0); 9428c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(aon_apb_rsv0, "aon-apb-rsv0", "aon-apb", 0x4, 9438c2ecf20Sopenharmony_ci 0x1000, BIT(26), CLK_IGNORE_UNUSED, 0); 9448c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(orp_jtag_eb, "orp-jtag-eb", "aon-apb", 0x4, 9458c2ecf20Sopenharmony_ci 0x1000, BIT(27), CLK_IGNORE_UNUSED, 0); 9468c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(vsp_eb, "vsp-eb", "aon-apb", 0x4, 9478c2ecf20Sopenharmony_ci 0x1000, BIT(28), CLK_IGNORE_UNUSED, 0); 9488c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(cam_eb, "cam-eb", "aon-apb", 0x4, 9498c2ecf20Sopenharmony_ci 0x1000, BIT(29), CLK_IGNORE_UNUSED, 0); 9508c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(disp_eb, "disp-eb", "aon-apb", 0x4, 9518c2ecf20Sopenharmony_ci 0x1000, BIT(30), CLK_IGNORE_UNUSED, 0); 9528c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(dbg_axi_if_eb, "dbg-axi-if-eb", "aon-apb", 0x4, 9538c2ecf20Sopenharmony_ci 0x1000, BIT(31), CLK_IGNORE_UNUSED, 0); 9548c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(sdio0_2x_en, "sdio0-2x-en", "aon-apb", 0x13c, 9558c2ecf20Sopenharmony_ci 0x1000, BIT(2), 0, 0); 9568c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(sdio1_2x_en, "sdio1-2x-en", "aon-apb", 0x13c, 9578c2ecf20Sopenharmony_ci 0x1000, BIT(4), 0, 0); 9588c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(sdio2_2x_en, "sdio2-2x-en", "aon-apb", 0x13c, 9598c2ecf20Sopenharmony_ci 0x1000, BIT(6), 0, 0); 9608c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(emmc_2x_en, "emmc-2x-en", "aon-apb", 0x13c, 9618c2ecf20Sopenharmony_ci 0x1000, BIT(9), 0, 0); 9628c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(arch_rtc_eb, "arch-rtc-eb", "aon-apb", 0x10, 9638c2ecf20Sopenharmony_ci 0x1000, BIT(0), CLK_IGNORE_UNUSED, 0); 9648c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(kpb_rtc_eb, "kpb-rtc-eb", "aon-apb", 0x10, 9658c2ecf20Sopenharmony_ci 0x1000, BIT(1), CLK_IGNORE_UNUSED, 0); 9668c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(aon_syst_rtc_eb, "aon-syst-rtc-eb", "aon-apb", 0x10, 9678c2ecf20Sopenharmony_ci 0x1000, BIT(2), CLK_IGNORE_UNUSED, 0); 9688c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(ap_syst_rtc_eb, "ap-syst-rtc-eb", "aon-apb", 0x10, 9698c2ecf20Sopenharmony_ci 0x1000, BIT(3), CLK_IGNORE_UNUSED, 0); 9708c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(aon_tmr_rtc_eb, "aon-tmr-rtc-eb", "aon-apb", 0x10, 9718c2ecf20Sopenharmony_ci 0x1000, BIT(4), CLK_IGNORE_UNUSED, 0); 9728c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(ap_tmr0_rtc_eb, "ap-tmr0-rtc-eb", "aon-apb", 0x10, 9738c2ecf20Sopenharmony_ci 0x1000, BIT(5), CLK_IGNORE_UNUSED, 0); 9748c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(eic_rtc_eb, "eic-rtc-eb", "aon-apb", 0x10, 9758c2ecf20Sopenharmony_ci 0x1000, BIT(6), CLK_IGNORE_UNUSED, 0); 9768c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(eic_rtcdv5_eb, "eic-rtcdv5-eb", "aon-apb", 0x10, 9778c2ecf20Sopenharmony_ci 0x1000, BIT(7), CLK_IGNORE_UNUSED, 0); 9788c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(ap_wdg_rtc_eb, "ap-wdg-rtc-eb", "aon-apb", 0x10, 9798c2ecf20Sopenharmony_ci 0x1000, BIT(9), CLK_IGNORE_UNUSED, 0); 9808c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(ap_tmr1_rtc_eb, "ap-tmr1-rtc-eb", "aon-apb", 0x10, 9818c2ecf20Sopenharmony_ci 0x1000, BIT(15), CLK_IGNORE_UNUSED, 0); 9828c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(ap_tmr2_rtc_eb, "ap-tmr2-rtc-eb", "aon-apb", 0x10, 9838c2ecf20Sopenharmony_ci 0x1000, BIT(16), CLK_IGNORE_UNUSED, 0); 9848c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(dcxo_tmr_rtc_eb, "dcxo-tmr-rtc-eb", "aon-apb", 0x10, 9858c2ecf20Sopenharmony_ci 0x1000, BIT(17), CLK_IGNORE_UNUSED, 0); 9868c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(bb_cal_rtc_eb, "bb-cal-rtc-eb", "aon-apb", 0x10, 9878c2ecf20Sopenharmony_ci 0x1000, BIT(18), CLK_IGNORE_UNUSED, 0); 9888c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(avs_big_rtc_eb, "avs-big-rtc-eb", "aon-apb", 0x10, 9898c2ecf20Sopenharmony_ci 0x1000, BIT(20), CLK_IGNORE_UNUSED, 0); 9908c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(avs_lit_rtc_eb, "avs-lit-rtc-eb", "aon-apb", 0x10, 9918c2ecf20Sopenharmony_ci 0x1000, BIT(21), CLK_IGNORE_UNUSED, 0); 9928c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(avs_gpu0_rtc_eb, "avs-gpu0-rtc-eb", "aon-apb", 0x10, 9938c2ecf20Sopenharmony_ci 0x1000, BIT(22), CLK_IGNORE_UNUSED, 0); 9948c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(avs_gpu1_rtc_eb, "avs-gpu1-rtc-eb", "aon-apb", 0x10, 9958c2ecf20Sopenharmony_ci 0x1000, BIT(23), CLK_IGNORE_UNUSED, 0); 9968c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(gpu_ts_eb, "gpu-ts-eb", "aon-apb", 0x10, 9978c2ecf20Sopenharmony_ci 0x1000, BIT(24), CLK_IGNORE_UNUSED, 0); 9988c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(rtcdv10_eb, "rtcdv10-eb", "aon-apb", 0x10, 9998c2ecf20Sopenharmony_ci 0x1000, BIT(27), CLK_IGNORE_UNUSED, 0); 10008c2ecf20Sopenharmony_ci 10018c2ecf20Sopenharmony_cistatic struct sprd_clk_common *sc9860_aon_gate[] = { 10028c2ecf20Sopenharmony_ci /* address base is 0x402e0000 */ 10038c2ecf20Sopenharmony_ci &avs_lit_eb.common, 10048c2ecf20Sopenharmony_ci &avs_big_eb.common, 10058c2ecf20Sopenharmony_ci &ap_intc5_eb.common, 10068c2ecf20Sopenharmony_ci &gpio_eb.common, 10078c2ecf20Sopenharmony_ci &pwm0_eb.common, 10088c2ecf20Sopenharmony_ci &pwm1_eb.common, 10098c2ecf20Sopenharmony_ci &pwm2_eb.common, 10108c2ecf20Sopenharmony_ci &pwm3_eb.common, 10118c2ecf20Sopenharmony_ci &kpd_eb.common, 10128c2ecf20Sopenharmony_ci &aon_sys_eb.common, 10138c2ecf20Sopenharmony_ci &ap_sys_eb.common, 10148c2ecf20Sopenharmony_ci &aon_tmr_eb.common, 10158c2ecf20Sopenharmony_ci &ap_tmr0_eb.common, 10168c2ecf20Sopenharmony_ci &efuse_eb.common, 10178c2ecf20Sopenharmony_ci &eic_eb.common, 10188c2ecf20Sopenharmony_ci &pub1_reg_eb.common, 10198c2ecf20Sopenharmony_ci &adi_eb.common, 10208c2ecf20Sopenharmony_ci &ap_intc0_eb.common, 10218c2ecf20Sopenharmony_ci &ap_intc1_eb.common, 10228c2ecf20Sopenharmony_ci &ap_intc2_eb.common, 10238c2ecf20Sopenharmony_ci &ap_intc3_eb.common, 10248c2ecf20Sopenharmony_ci &ap_intc4_eb.common, 10258c2ecf20Sopenharmony_ci &splk_eb.common, 10268c2ecf20Sopenharmony_ci &mspi_eb.common, 10278c2ecf20Sopenharmony_ci &pub0_reg_eb.common, 10288c2ecf20Sopenharmony_ci &pin_eb.common, 10298c2ecf20Sopenharmony_ci &aon_ckg_eb.common, 10308c2ecf20Sopenharmony_ci &gpu_eb.common, 10318c2ecf20Sopenharmony_ci &apcpu_ts0_eb.common, 10328c2ecf20Sopenharmony_ci &apcpu_ts1_eb.common, 10338c2ecf20Sopenharmony_ci &dap_eb.common, 10348c2ecf20Sopenharmony_ci &i2c_eb.common, 10358c2ecf20Sopenharmony_ci &pmu_eb.common, 10368c2ecf20Sopenharmony_ci &thm_eb.common, 10378c2ecf20Sopenharmony_ci &aux0_eb.common, 10388c2ecf20Sopenharmony_ci &aux1_eb.common, 10398c2ecf20Sopenharmony_ci &aux2_eb.common, 10408c2ecf20Sopenharmony_ci &probe_eb.common, 10418c2ecf20Sopenharmony_ci &gpu0_avs_eb.common, 10428c2ecf20Sopenharmony_ci &gpu1_avs_eb.common, 10438c2ecf20Sopenharmony_ci &apcpu_wdg_eb.common, 10448c2ecf20Sopenharmony_ci &ap_tmr1_eb.common, 10458c2ecf20Sopenharmony_ci &ap_tmr2_eb.common, 10468c2ecf20Sopenharmony_ci &disp_emc_eb.common, 10478c2ecf20Sopenharmony_ci &zip_emc_eb.common, 10488c2ecf20Sopenharmony_ci &gsp_emc_eb.common, 10498c2ecf20Sopenharmony_ci &osc_aon_eb.common, 10508c2ecf20Sopenharmony_ci &lvds_trx_eb.common, 10518c2ecf20Sopenharmony_ci &lvds_tcxo_eb.common, 10528c2ecf20Sopenharmony_ci &mdar_eb.common, 10538c2ecf20Sopenharmony_ci &rtc4m0_cal_eb.common, 10548c2ecf20Sopenharmony_ci &rct100m_cal_eb.common, 10558c2ecf20Sopenharmony_ci &djtag_eb.common, 10568c2ecf20Sopenharmony_ci &mbox_eb.common, 10578c2ecf20Sopenharmony_ci &aon_dma_eb.common, 10588c2ecf20Sopenharmony_ci &dbg_emc_eb.common, 10598c2ecf20Sopenharmony_ci &lvds_pll_div_en.common, 10608c2ecf20Sopenharmony_ci &def_eb.common, 10618c2ecf20Sopenharmony_ci &aon_apb_rsv0.common, 10628c2ecf20Sopenharmony_ci &orp_jtag_eb.common, 10638c2ecf20Sopenharmony_ci &vsp_eb.common, 10648c2ecf20Sopenharmony_ci &cam_eb.common, 10658c2ecf20Sopenharmony_ci &disp_eb.common, 10668c2ecf20Sopenharmony_ci &dbg_axi_if_eb.common, 10678c2ecf20Sopenharmony_ci &sdio0_2x_en.common, 10688c2ecf20Sopenharmony_ci &sdio1_2x_en.common, 10698c2ecf20Sopenharmony_ci &sdio2_2x_en.common, 10708c2ecf20Sopenharmony_ci &emmc_2x_en.common, 10718c2ecf20Sopenharmony_ci &arch_rtc_eb.common, 10728c2ecf20Sopenharmony_ci &kpb_rtc_eb.common, 10738c2ecf20Sopenharmony_ci &aon_syst_rtc_eb.common, 10748c2ecf20Sopenharmony_ci &ap_syst_rtc_eb.common, 10758c2ecf20Sopenharmony_ci &aon_tmr_rtc_eb.common, 10768c2ecf20Sopenharmony_ci &ap_tmr0_rtc_eb.common, 10778c2ecf20Sopenharmony_ci &eic_rtc_eb.common, 10788c2ecf20Sopenharmony_ci &eic_rtcdv5_eb.common, 10798c2ecf20Sopenharmony_ci &ap_wdg_rtc_eb.common, 10808c2ecf20Sopenharmony_ci &ap_tmr1_rtc_eb.common, 10818c2ecf20Sopenharmony_ci &ap_tmr2_rtc_eb.common, 10828c2ecf20Sopenharmony_ci &dcxo_tmr_rtc_eb.common, 10838c2ecf20Sopenharmony_ci &bb_cal_rtc_eb.common, 10848c2ecf20Sopenharmony_ci &avs_big_rtc_eb.common, 10858c2ecf20Sopenharmony_ci &avs_lit_rtc_eb.common, 10868c2ecf20Sopenharmony_ci &avs_gpu0_rtc_eb.common, 10878c2ecf20Sopenharmony_ci &avs_gpu1_rtc_eb.common, 10888c2ecf20Sopenharmony_ci &gpu_ts_eb.common, 10898c2ecf20Sopenharmony_ci &rtcdv10_eb.common, 10908c2ecf20Sopenharmony_ci}; 10918c2ecf20Sopenharmony_ci 10928c2ecf20Sopenharmony_cistatic struct clk_hw_onecell_data sc9860_aon_gate_hws = { 10938c2ecf20Sopenharmony_ci .hws = { 10948c2ecf20Sopenharmony_ci [CLK_AVS_LIT_EB] = &avs_lit_eb.common.hw, 10958c2ecf20Sopenharmony_ci [CLK_AVS_BIG_EB] = &avs_big_eb.common.hw, 10968c2ecf20Sopenharmony_ci [CLK_AP_INTC5_EB] = &ap_intc5_eb.common.hw, 10978c2ecf20Sopenharmony_ci [CLK_GPIO_EB] = &gpio_eb.common.hw, 10988c2ecf20Sopenharmony_ci [CLK_PWM0_EB] = &pwm0_eb.common.hw, 10998c2ecf20Sopenharmony_ci [CLK_PWM1_EB] = &pwm1_eb.common.hw, 11008c2ecf20Sopenharmony_ci [CLK_PWM2_EB] = &pwm2_eb.common.hw, 11018c2ecf20Sopenharmony_ci [CLK_PWM3_EB] = &pwm3_eb.common.hw, 11028c2ecf20Sopenharmony_ci [CLK_KPD_EB] = &kpd_eb.common.hw, 11038c2ecf20Sopenharmony_ci [CLK_AON_SYS_EB] = &aon_sys_eb.common.hw, 11048c2ecf20Sopenharmony_ci [CLK_AP_SYS_EB] = &ap_sys_eb.common.hw, 11058c2ecf20Sopenharmony_ci [CLK_AON_TMR_EB] = &aon_tmr_eb.common.hw, 11068c2ecf20Sopenharmony_ci [CLK_AP_TMR0_EB] = &ap_tmr0_eb.common.hw, 11078c2ecf20Sopenharmony_ci [CLK_EFUSE_EB] = &efuse_eb.common.hw, 11088c2ecf20Sopenharmony_ci [CLK_EIC_EB] = &eic_eb.common.hw, 11098c2ecf20Sopenharmony_ci [CLK_PUB1_REG_EB] = &pub1_reg_eb.common.hw, 11108c2ecf20Sopenharmony_ci [CLK_ADI_EB] = &adi_eb.common.hw, 11118c2ecf20Sopenharmony_ci [CLK_AP_INTC0_EB] = &ap_intc0_eb.common.hw, 11128c2ecf20Sopenharmony_ci [CLK_AP_INTC1_EB] = &ap_intc1_eb.common.hw, 11138c2ecf20Sopenharmony_ci [CLK_AP_INTC2_EB] = &ap_intc2_eb.common.hw, 11148c2ecf20Sopenharmony_ci [CLK_AP_INTC3_EB] = &ap_intc3_eb.common.hw, 11158c2ecf20Sopenharmony_ci [CLK_AP_INTC4_EB] = &ap_intc4_eb.common.hw, 11168c2ecf20Sopenharmony_ci [CLK_SPLK_EB] = &splk_eb.common.hw, 11178c2ecf20Sopenharmony_ci [CLK_MSPI_EB] = &mspi_eb.common.hw, 11188c2ecf20Sopenharmony_ci [CLK_PUB0_REG_EB] = &pub0_reg_eb.common.hw, 11198c2ecf20Sopenharmony_ci [CLK_PIN_EB] = &pin_eb.common.hw, 11208c2ecf20Sopenharmony_ci [CLK_AON_CKG_EB] = &aon_ckg_eb.common.hw, 11218c2ecf20Sopenharmony_ci [CLK_GPU_EB] = &gpu_eb.common.hw, 11228c2ecf20Sopenharmony_ci [CLK_APCPU_TS0_EB] = &apcpu_ts0_eb.common.hw, 11238c2ecf20Sopenharmony_ci [CLK_APCPU_TS1_EB] = &apcpu_ts1_eb.common.hw, 11248c2ecf20Sopenharmony_ci [CLK_DAP_EB] = &dap_eb.common.hw, 11258c2ecf20Sopenharmony_ci [CLK_I2C_EB] = &i2c_eb.common.hw, 11268c2ecf20Sopenharmony_ci [CLK_PMU_EB] = &pmu_eb.common.hw, 11278c2ecf20Sopenharmony_ci [CLK_THM_EB] = &thm_eb.common.hw, 11288c2ecf20Sopenharmony_ci [CLK_AUX0_EB] = &aux0_eb.common.hw, 11298c2ecf20Sopenharmony_ci [CLK_AUX1_EB] = &aux1_eb.common.hw, 11308c2ecf20Sopenharmony_ci [CLK_AUX2_EB] = &aux2_eb.common.hw, 11318c2ecf20Sopenharmony_ci [CLK_PROBE_EB] = &probe_eb.common.hw, 11328c2ecf20Sopenharmony_ci [CLK_GPU0_AVS_EB] = &gpu0_avs_eb.common.hw, 11338c2ecf20Sopenharmony_ci [CLK_GPU1_AVS_EB] = &gpu1_avs_eb.common.hw, 11348c2ecf20Sopenharmony_ci [CLK_APCPU_WDG_EB] = &apcpu_wdg_eb.common.hw, 11358c2ecf20Sopenharmony_ci [CLK_AP_TMR1_EB] = &ap_tmr1_eb.common.hw, 11368c2ecf20Sopenharmony_ci [CLK_AP_TMR2_EB] = &ap_tmr2_eb.common.hw, 11378c2ecf20Sopenharmony_ci [CLK_DISP_EMC_EB] = &disp_emc_eb.common.hw, 11388c2ecf20Sopenharmony_ci [CLK_ZIP_EMC_EB] = &zip_emc_eb.common.hw, 11398c2ecf20Sopenharmony_ci [CLK_GSP_EMC_EB] = &gsp_emc_eb.common.hw, 11408c2ecf20Sopenharmony_ci [CLK_OSC_AON_EB] = &osc_aon_eb.common.hw, 11418c2ecf20Sopenharmony_ci [CLK_LVDS_TRX_EB] = &lvds_trx_eb.common.hw, 11428c2ecf20Sopenharmony_ci [CLK_LVDS_TCXO_EB] = &lvds_tcxo_eb.common.hw, 11438c2ecf20Sopenharmony_ci [CLK_MDAR_EB] = &mdar_eb.common.hw, 11448c2ecf20Sopenharmony_ci [CLK_RTC4M0_CAL_EB] = &rtc4m0_cal_eb.common.hw, 11458c2ecf20Sopenharmony_ci [CLK_RCT100M_CAL_EB] = &rct100m_cal_eb.common.hw, 11468c2ecf20Sopenharmony_ci [CLK_DJTAG_EB] = &djtag_eb.common.hw, 11478c2ecf20Sopenharmony_ci [CLK_MBOX_EB] = &mbox_eb.common.hw, 11488c2ecf20Sopenharmony_ci [CLK_AON_DMA_EB] = &aon_dma_eb.common.hw, 11498c2ecf20Sopenharmony_ci [CLK_DBG_EMC_EB] = &dbg_emc_eb.common.hw, 11508c2ecf20Sopenharmony_ci [CLK_LVDS_PLL_DIV_EN] = &lvds_pll_div_en.common.hw, 11518c2ecf20Sopenharmony_ci [CLK_DEF_EB] = &def_eb.common.hw, 11528c2ecf20Sopenharmony_ci [CLK_AON_APB_RSV0] = &aon_apb_rsv0.common.hw, 11538c2ecf20Sopenharmony_ci [CLK_ORP_JTAG_EB] = &orp_jtag_eb.common.hw, 11548c2ecf20Sopenharmony_ci [CLK_VSP_EB] = &vsp_eb.common.hw, 11558c2ecf20Sopenharmony_ci [CLK_CAM_EB] = &cam_eb.common.hw, 11568c2ecf20Sopenharmony_ci [CLK_DISP_EB] = &disp_eb.common.hw, 11578c2ecf20Sopenharmony_ci [CLK_DBG_AXI_IF_EB] = &dbg_axi_if_eb.common.hw, 11588c2ecf20Sopenharmony_ci [CLK_SDIO0_2X_EN] = &sdio0_2x_en.common.hw, 11598c2ecf20Sopenharmony_ci [CLK_SDIO1_2X_EN] = &sdio1_2x_en.common.hw, 11608c2ecf20Sopenharmony_ci [CLK_SDIO2_2X_EN] = &sdio2_2x_en.common.hw, 11618c2ecf20Sopenharmony_ci [CLK_EMMC_2X_EN] = &emmc_2x_en.common.hw, 11628c2ecf20Sopenharmony_ci [CLK_ARCH_RTC_EB] = &arch_rtc_eb.common.hw, 11638c2ecf20Sopenharmony_ci [CLK_KPB_RTC_EB] = &kpb_rtc_eb.common.hw, 11648c2ecf20Sopenharmony_ci [CLK_AON_SYST_RTC_EB] = &aon_syst_rtc_eb.common.hw, 11658c2ecf20Sopenharmony_ci [CLK_AP_SYST_RTC_EB] = &ap_syst_rtc_eb.common.hw, 11668c2ecf20Sopenharmony_ci [CLK_AON_TMR_RTC_EB] = &aon_tmr_rtc_eb.common.hw, 11678c2ecf20Sopenharmony_ci [CLK_AP_TMR0_RTC_EB] = &ap_tmr0_rtc_eb.common.hw, 11688c2ecf20Sopenharmony_ci [CLK_EIC_RTC_EB] = &eic_rtc_eb.common.hw, 11698c2ecf20Sopenharmony_ci [CLK_EIC_RTCDV5_EB] = &eic_rtcdv5_eb.common.hw, 11708c2ecf20Sopenharmony_ci [CLK_AP_WDG_RTC_EB] = &ap_wdg_rtc_eb.common.hw, 11718c2ecf20Sopenharmony_ci [CLK_AP_TMR1_RTC_EB] = &ap_tmr1_rtc_eb.common.hw, 11728c2ecf20Sopenharmony_ci [CLK_AP_TMR2_RTC_EB] = &ap_tmr2_rtc_eb.common.hw, 11738c2ecf20Sopenharmony_ci [CLK_DCXO_TMR_RTC_EB] = &dcxo_tmr_rtc_eb.common.hw, 11748c2ecf20Sopenharmony_ci [CLK_BB_CAL_RTC_EB] = &bb_cal_rtc_eb.common.hw, 11758c2ecf20Sopenharmony_ci [CLK_AVS_BIG_RTC_EB] = &avs_big_rtc_eb.common.hw, 11768c2ecf20Sopenharmony_ci [CLK_AVS_LIT_RTC_EB] = &avs_lit_rtc_eb.common.hw, 11778c2ecf20Sopenharmony_ci [CLK_AVS_GPU0_RTC_EB] = &avs_gpu0_rtc_eb.common.hw, 11788c2ecf20Sopenharmony_ci [CLK_AVS_GPU1_RTC_EB] = &avs_gpu1_rtc_eb.common.hw, 11798c2ecf20Sopenharmony_ci [CLK_GPU_TS_EB] = &gpu_ts_eb.common.hw, 11808c2ecf20Sopenharmony_ci [CLK_RTCDV10_EB] = &rtcdv10_eb.common.hw, 11818c2ecf20Sopenharmony_ci }, 11828c2ecf20Sopenharmony_ci .num = CLK_AON_GATE_NUM, 11838c2ecf20Sopenharmony_ci}; 11848c2ecf20Sopenharmony_ci 11858c2ecf20Sopenharmony_cistatic const struct sprd_clk_desc sc9860_aon_gate_desc = { 11868c2ecf20Sopenharmony_ci .clk_clks = sc9860_aon_gate, 11878c2ecf20Sopenharmony_ci .num_clk_clks = ARRAY_SIZE(sc9860_aon_gate), 11888c2ecf20Sopenharmony_ci .hw_clks = &sc9860_aon_gate_hws, 11898c2ecf20Sopenharmony_ci}; 11908c2ecf20Sopenharmony_ci 11918c2ecf20Sopenharmony_cistatic const u8 mcu_table[] = { 0, 1, 2, 3, 4, 8 }; 11928c2ecf20Sopenharmony_cistatic const char * const lit_mcu_parents[] = { "ext-26m", "twpll-512m", 11938c2ecf20Sopenharmony_ci "twpll-768m", "ltepll0", 11948c2ecf20Sopenharmony_ci "twpll", "mpll0" }; 11958c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK_TABLE(lit_mcu, "lit-mcu", lit_mcu_parents, 0x20, 11968c2ecf20Sopenharmony_ci mcu_table, 0, 4, 4, 3, 0); 11978c2ecf20Sopenharmony_ci 11988c2ecf20Sopenharmony_cistatic const char * const big_mcu_parents[] = { "ext-26m", "twpll-512m", 11998c2ecf20Sopenharmony_ci "twpll-768m", "ltepll0", 12008c2ecf20Sopenharmony_ci "twpll", "mpll1" }; 12018c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK_TABLE(big_mcu, "big-mcu", big_mcu_parents, 0x24, 12028c2ecf20Sopenharmony_ci mcu_table, 0, 4, 4, 3, 0); 12038c2ecf20Sopenharmony_ci 12048c2ecf20Sopenharmony_cistatic struct sprd_clk_common *sc9860_aonsecure_clk[] = { 12058c2ecf20Sopenharmony_ci /* address base is 0x40880000 */ 12068c2ecf20Sopenharmony_ci &lit_mcu.common, 12078c2ecf20Sopenharmony_ci &big_mcu.common, 12088c2ecf20Sopenharmony_ci}; 12098c2ecf20Sopenharmony_ci 12108c2ecf20Sopenharmony_cistatic struct clk_hw_onecell_data sc9860_aonsecure_clk_hws = { 12118c2ecf20Sopenharmony_ci .hws = { 12128c2ecf20Sopenharmony_ci [CLK_LIT_MCU] = &lit_mcu.common.hw, 12138c2ecf20Sopenharmony_ci [CLK_BIG_MCU] = &big_mcu.common.hw, 12148c2ecf20Sopenharmony_ci }, 12158c2ecf20Sopenharmony_ci .num = CLK_AONSECURE_NUM, 12168c2ecf20Sopenharmony_ci}; 12178c2ecf20Sopenharmony_ci 12188c2ecf20Sopenharmony_cistatic const struct sprd_clk_desc sc9860_aonsecure_clk_desc = { 12198c2ecf20Sopenharmony_ci .clk_clks = sc9860_aonsecure_clk, 12208c2ecf20Sopenharmony_ci .num_clk_clks = ARRAY_SIZE(sc9860_aonsecure_clk), 12218c2ecf20Sopenharmony_ci .hw_clks = &sc9860_aonsecure_clk_hws, 12228c2ecf20Sopenharmony_ci}; 12238c2ecf20Sopenharmony_ci 12248c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(agcp_iis0_eb, "agcp-iis0-eb", "aon-apb", 12258c2ecf20Sopenharmony_ci 0x0, 0x100, BIT(0), 0, 0); 12268c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(agcp_iis1_eb, "agcp-iis1-eb", "aon-apb", 12278c2ecf20Sopenharmony_ci 0x0, 0x100, BIT(1), 0, 0); 12288c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(agcp_iis2_eb, "agcp-iis2-eb", "aon-apb", 12298c2ecf20Sopenharmony_ci 0x0, 0x100, BIT(2), 0, 0); 12308c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(agcp_iis3_eb, "agcp-iis3-eb", "aon-apb", 12318c2ecf20Sopenharmony_ci 0x0, 0x100, BIT(3), 0, 0); 12328c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(agcp_uart_eb, "agcp-uart-eb", "aon-apb", 12338c2ecf20Sopenharmony_ci 0x0, 0x100, BIT(4), 0, 0); 12348c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(agcp_dmacp_eb, "agcp-dmacp-eb", "aon-apb", 12358c2ecf20Sopenharmony_ci 0x0, 0x100, BIT(5), 0, 0); 12368c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(agcp_dmaap_eb, "agcp-dmaap-eb", "aon-apb", 12378c2ecf20Sopenharmony_ci 0x0, 0x100, BIT(6), 0, 0); 12388c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(agcp_arc48k_eb, "agcp-arc48k-eb", "aon-apb", 12398c2ecf20Sopenharmony_ci 0x0, 0x100, BIT(10), 0, 0); 12408c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(agcp_src44p1k_eb, "agcp-src44p1k-eb", "aon-apb", 12418c2ecf20Sopenharmony_ci 0x0, 0x100, BIT(11), 0, 0); 12428c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(agcp_mcdt_eb, "agcp-mcdt-eb", "aon-apb", 12438c2ecf20Sopenharmony_ci 0x0, 0x100, BIT(12), 0, 0); 12448c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(agcp_vbcifd_eb, "agcp-vbcifd-eb", "aon-apb", 12458c2ecf20Sopenharmony_ci 0x0, 0x100, BIT(13), 0, 0); 12468c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(agcp_vbc_eb, "agcp-vbc-eb", "aon-apb", 12478c2ecf20Sopenharmony_ci 0x0, 0x100, BIT(14), 0, 0); 12488c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(agcp_spinlock_eb, "agcp-spinlock-eb", "aon-apb", 12498c2ecf20Sopenharmony_ci 0x0, 0x100, BIT(15), 0, 0); 12508c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(agcp_icu_eb, "agcp-icu-eb", "aon-apb", 12518c2ecf20Sopenharmony_ci 0x0, 0x100, BIT(16), CLK_IGNORE_UNUSED, 0); 12528c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(agcp_ap_ashb_eb, "agcp-ap-ashb-eb", "aon-apb", 12538c2ecf20Sopenharmony_ci 0x0, 0x100, BIT(17), 0, 0); 12548c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(agcp_cp_ashb_eb, "agcp-cp-ashb-eb", "aon-apb", 12558c2ecf20Sopenharmony_ci 0x0, 0x100, BIT(18), 0, 0); 12568c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(agcp_aud_eb, "agcp-aud-eb", "aon-apb", 12578c2ecf20Sopenharmony_ci 0x0, 0x100, BIT(19), 0, 0); 12588c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(agcp_audif_eb, "agcp-audif-eb", "aon-apb", 12598c2ecf20Sopenharmony_ci 0x0, 0x100, BIT(20), 0, 0); 12608c2ecf20Sopenharmony_ci 12618c2ecf20Sopenharmony_cistatic struct sprd_clk_common *sc9860_agcp_gate[] = { 12628c2ecf20Sopenharmony_ci /* address base is 0x415e0000 */ 12638c2ecf20Sopenharmony_ci &agcp_iis0_eb.common, 12648c2ecf20Sopenharmony_ci &agcp_iis1_eb.common, 12658c2ecf20Sopenharmony_ci &agcp_iis2_eb.common, 12668c2ecf20Sopenharmony_ci &agcp_iis3_eb.common, 12678c2ecf20Sopenharmony_ci &agcp_uart_eb.common, 12688c2ecf20Sopenharmony_ci &agcp_dmacp_eb.common, 12698c2ecf20Sopenharmony_ci &agcp_dmaap_eb.common, 12708c2ecf20Sopenharmony_ci &agcp_arc48k_eb.common, 12718c2ecf20Sopenharmony_ci &agcp_src44p1k_eb.common, 12728c2ecf20Sopenharmony_ci &agcp_mcdt_eb.common, 12738c2ecf20Sopenharmony_ci &agcp_vbcifd_eb.common, 12748c2ecf20Sopenharmony_ci &agcp_vbc_eb.common, 12758c2ecf20Sopenharmony_ci &agcp_spinlock_eb.common, 12768c2ecf20Sopenharmony_ci &agcp_icu_eb.common, 12778c2ecf20Sopenharmony_ci &agcp_ap_ashb_eb.common, 12788c2ecf20Sopenharmony_ci &agcp_cp_ashb_eb.common, 12798c2ecf20Sopenharmony_ci &agcp_aud_eb.common, 12808c2ecf20Sopenharmony_ci &agcp_audif_eb.common, 12818c2ecf20Sopenharmony_ci}; 12828c2ecf20Sopenharmony_ci 12838c2ecf20Sopenharmony_cistatic struct clk_hw_onecell_data sc9860_agcp_gate_hws = { 12848c2ecf20Sopenharmony_ci .hws = { 12858c2ecf20Sopenharmony_ci [CLK_AGCP_IIS0_EB] = &agcp_iis0_eb.common.hw, 12868c2ecf20Sopenharmony_ci [CLK_AGCP_IIS1_EB] = &agcp_iis1_eb.common.hw, 12878c2ecf20Sopenharmony_ci [CLK_AGCP_IIS2_EB] = &agcp_iis2_eb.common.hw, 12888c2ecf20Sopenharmony_ci [CLK_AGCP_IIS3_EB] = &agcp_iis3_eb.common.hw, 12898c2ecf20Sopenharmony_ci [CLK_AGCP_UART_EB] = &agcp_uart_eb.common.hw, 12908c2ecf20Sopenharmony_ci [CLK_AGCP_DMACP_EB] = &agcp_dmacp_eb.common.hw, 12918c2ecf20Sopenharmony_ci [CLK_AGCP_DMAAP_EB] = &agcp_dmaap_eb.common.hw, 12928c2ecf20Sopenharmony_ci [CLK_AGCP_ARC48K_EB] = &agcp_arc48k_eb.common.hw, 12938c2ecf20Sopenharmony_ci [CLK_AGCP_SRC44P1K_EB] = &agcp_src44p1k_eb.common.hw, 12948c2ecf20Sopenharmony_ci [CLK_AGCP_MCDT_EB] = &agcp_mcdt_eb.common.hw, 12958c2ecf20Sopenharmony_ci [CLK_AGCP_VBCIFD_EB] = &agcp_vbcifd_eb.common.hw, 12968c2ecf20Sopenharmony_ci [CLK_AGCP_VBC_EB] = &agcp_vbc_eb.common.hw, 12978c2ecf20Sopenharmony_ci [CLK_AGCP_SPINLOCK_EB] = &agcp_spinlock_eb.common.hw, 12988c2ecf20Sopenharmony_ci [CLK_AGCP_ICU_EB] = &agcp_icu_eb.common.hw, 12998c2ecf20Sopenharmony_ci [CLK_AGCP_AP_ASHB_EB] = &agcp_ap_ashb_eb.common.hw, 13008c2ecf20Sopenharmony_ci [CLK_AGCP_CP_ASHB_EB] = &agcp_cp_ashb_eb.common.hw, 13018c2ecf20Sopenharmony_ci [CLK_AGCP_AUD_EB] = &agcp_aud_eb.common.hw, 13028c2ecf20Sopenharmony_ci [CLK_AGCP_AUDIF_EB] = &agcp_audif_eb.common.hw, 13038c2ecf20Sopenharmony_ci }, 13048c2ecf20Sopenharmony_ci .num = CLK_AGCP_GATE_NUM, 13058c2ecf20Sopenharmony_ci}; 13068c2ecf20Sopenharmony_ci 13078c2ecf20Sopenharmony_cistatic const struct sprd_clk_desc sc9860_agcp_gate_desc = { 13088c2ecf20Sopenharmony_ci .clk_clks = sc9860_agcp_gate, 13098c2ecf20Sopenharmony_ci .num_clk_clks = ARRAY_SIZE(sc9860_agcp_gate), 13108c2ecf20Sopenharmony_ci .hw_clks = &sc9860_agcp_gate_hws, 13118c2ecf20Sopenharmony_ci}; 13128c2ecf20Sopenharmony_ci 13138c2ecf20Sopenharmony_cistatic const char * const gpu_parents[] = { "twpll-512m", 13148c2ecf20Sopenharmony_ci "twpll-768m", 13158c2ecf20Sopenharmony_ci "gpll" }; 13168c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK(gpu_clk, "gpu", gpu_parents, 0x20, 13178c2ecf20Sopenharmony_ci 0, 2, 8, 4, 0); 13188c2ecf20Sopenharmony_ci 13198c2ecf20Sopenharmony_cistatic struct sprd_clk_common *sc9860_gpu_clk[] = { 13208c2ecf20Sopenharmony_ci /* address base is 0x60200000 */ 13218c2ecf20Sopenharmony_ci &gpu_clk.common, 13228c2ecf20Sopenharmony_ci}; 13238c2ecf20Sopenharmony_ci 13248c2ecf20Sopenharmony_cistatic struct clk_hw_onecell_data sc9860_gpu_clk_hws = { 13258c2ecf20Sopenharmony_ci .hws = { 13268c2ecf20Sopenharmony_ci [CLK_GPU] = &gpu_clk.common.hw, 13278c2ecf20Sopenharmony_ci }, 13288c2ecf20Sopenharmony_ci .num = CLK_GPU_NUM, 13298c2ecf20Sopenharmony_ci}; 13308c2ecf20Sopenharmony_ci 13318c2ecf20Sopenharmony_cistatic const struct sprd_clk_desc sc9860_gpu_clk_desc = { 13328c2ecf20Sopenharmony_ci .clk_clks = sc9860_gpu_clk, 13338c2ecf20Sopenharmony_ci .num_clk_clks = ARRAY_SIZE(sc9860_gpu_clk), 13348c2ecf20Sopenharmony_ci .hw_clks = &sc9860_gpu_clk_hws, 13358c2ecf20Sopenharmony_ci}; 13368c2ecf20Sopenharmony_ci 13378c2ecf20Sopenharmony_cistatic const char * const ahb_parents[] = { "ext-26m", "twpll-96m", 13388c2ecf20Sopenharmony_ci "twpll-128m", "twpll-153m6" }; 13398c2ecf20Sopenharmony_cistatic SPRD_MUX_CLK(ahb_vsp, "ahb-vsp", ahb_parents, 0x20, 13408c2ecf20Sopenharmony_ci 0, 2, SC9860_MUX_FLAG); 13418c2ecf20Sopenharmony_ci 13428c2ecf20Sopenharmony_cistatic const char * const vsp_parents[] = { "twpll-76m8", "twpll-128m", 13438c2ecf20Sopenharmony_ci "twpll-256m", "twpll-307m2", 13448c2ecf20Sopenharmony_ci "twpll-384m" }; 13458c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK(vsp_clk, "vsp", vsp_parents, 0x24, 0, 3, 8, 2, 0); 13468c2ecf20Sopenharmony_ci 13478c2ecf20Sopenharmony_cistatic const char * const dispc_parents[] = { "twpll-76m8", "twpll-128m", 13488c2ecf20Sopenharmony_ci "twpll-256m", "twpll-307m2" }; 13498c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK(vsp_enc, "vsp-enc", dispc_parents, 0x28, 0, 2, 8, 2, 0); 13508c2ecf20Sopenharmony_ci 13518c2ecf20Sopenharmony_cistatic const char * const vpp_parents[] = { "twpll-96m", "twpll-153m6", 13528c2ecf20Sopenharmony_ci "twpll-192m", "twpll-256m" }; 13538c2ecf20Sopenharmony_cistatic SPRD_MUX_CLK(vpp_clk, "vpp", vpp_parents, 0x2c, 13548c2ecf20Sopenharmony_ci 0, 2, SC9860_MUX_FLAG); 13558c2ecf20Sopenharmony_cistatic const char * const vsp_26m_parents[] = { "ext-26m" }; 13568c2ecf20Sopenharmony_cistatic SPRD_MUX_CLK(vsp_26m, "vsp-26m", vsp_26m_parents, 0x30, 13578c2ecf20Sopenharmony_ci 0, 1, SC9860_MUX_FLAG); 13588c2ecf20Sopenharmony_ci 13598c2ecf20Sopenharmony_cistatic struct sprd_clk_common *sc9860_vsp_clk[] = { 13608c2ecf20Sopenharmony_ci /* address base is 0x61000000 */ 13618c2ecf20Sopenharmony_ci &ahb_vsp.common, 13628c2ecf20Sopenharmony_ci &vsp_clk.common, 13638c2ecf20Sopenharmony_ci &vsp_enc.common, 13648c2ecf20Sopenharmony_ci &vpp_clk.common, 13658c2ecf20Sopenharmony_ci &vsp_26m.common, 13668c2ecf20Sopenharmony_ci}; 13678c2ecf20Sopenharmony_ci 13688c2ecf20Sopenharmony_cistatic struct clk_hw_onecell_data sc9860_vsp_clk_hws = { 13698c2ecf20Sopenharmony_ci .hws = { 13708c2ecf20Sopenharmony_ci [CLK_AHB_VSP] = &ahb_vsp.common.hw, 13718c2ecf20Sopenharmony_ci [CLK_VSP] = &vsp_clk.common.hw, 13728c2ecf20Sopenharmony_ci [CLK_VSP_ENC] = &vsp_enc.common.hw, 13738c2ecf20Sopenharmony_ci [CLK_VPP] = &vpp_clk.common.hw, 13748c2ecf20Sopenharmony_ci [CLK_VSP_26M] = &vsp_26m.common.hw, 13758c2ecf20Sopenharmony_ci }, 13768c2ecf20Sopenharmony_ci .num = CLK_VSP_NUM, 13778c2ecf20Sopenharmony_ci}; 13788c2ecf20Sopenharmony_ci 13798c2ecf20Sopenharmony_cistatic const struct sprd_clk_desc sc9860_vsp_clk_desc = { 13808c2ecf20Sopenharmony_ci .clk_clks = sc9860_vsp_clk, 13818c2ecf20Sopenharmony_ci .num_clk_clks = ARRAY_SIZE(sc9860_vsp_clk), 13828c2ecf20Sopenharmony_ci .hw_clks = &sc9860_vsp_clk_hws, 13838c2ecf20Sopenharmony_ci}; 13848c2ecf20Sopenharmony_ci 13858c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(vsp_dec_eb, "vsp-dec-eb", "ahb-vsp", 0x0, 13868c2ecf20Sopenharmony_ci 0x1000, BIT(0), 0, 0); 13878c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(vsp_ckg_eb, "vsp-ckg-eb", "ahb-vsp", 0x0, 13888c2ecf20Sopenharmony_ci 0x1000, BIT(1), 0, 0); 13898c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(vsp_mmu_eb, "vsp-mmu-eb", "ahb-vsp", 0x0, 13908c2ecf20Sopenharmony_ci 0x1000, BIT(2), 0, 0); 13918c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(vsp_enc_eb, "vsp-enc-eb", "ahb-vsp", 0x0, 13928c2ecf20Sopenharmony_ci 0x1000, BIT(3), 0, 0); 13938c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(vpp_eb, "vpp-eb", "ahb-vsp", 0x0, 13948c2ecf20Sopenharmony_ci 0x1000, BIT(4), 0, 0); 13958c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(vsp_26m_eb, "vsp-26m-eb", "ahb-vsp", 0x0, 13968c2ecf20Sopenharmony_ci 0x1000, BIT(5), 0, 0); 13978c2ecf20Sopenharmony_cistatic SPRD_GATE_CLK(vsp_axi_gate, "vsp-axi-gate", "ahb-vsp", 0x8, 13988c2ecf20Sopenharmony_ci BIT(0), 0, 0); 13998c2ecf20Sopenharmony_cistatic SPRD_GATE_CLK(vsp_enc_gate, "vsp-enc-gate", "ahb-vsp", 0x8, 14008c2ecf20Sopenharmony_ci BIT(1), 0, 0); 14018c2ecf20Sopenharmony_cistatic SPRD_GATE_CLK(vpp_axi_gate, "vpp-axi-gate", "ahb-vsp", 0x8, 14028c2ecf20Sopenharmony_ci BIT(2), 0, 0); 14038c2ecf20Sopenharmony_cistatic SPRD_GATE_CLK(vsp_bm_gate, "vsp-bm-gate", "ahb-vsp", 0x8, 14048c2ecf20Sopenharmony_ci BIT(8), 0, 0); 14058c2ecf20Sopenharmony_cistatic SPRD_GATE_CLK(vsp_enc_bm_gate, "vsp-enc-bm-gate", "ahb-vsp", 0x8, 14068c2ecf20Sopenharmony_ci BIT(9), 0, 0); 14078c2ecf20Sopenharmony_cistatic SPRD_GATE_CLK(vpp_bm_gate, "vpp-bm-gate", "ahb-vsp", 0x8, 14088c2ecf20Sopenharmony_ci BIT(10), 0, 0); 14098c2ecf20Sopenharmony_ci 14108c2ecf20Sopenharmony_cistatic struct sprd_clk_common *sc9860_vsp_gate[] = { 14118c2ecf20Sopenharmony_ci /* address base is 0x61100000 */ 14128c2ecf20Sopenharmony_ci &vsp_dec_eb.common, 14138c2ecf20Sopenharmony_ci &vsp_ckg_eb.common, 14148c2ecf20Sopenharmony_ci &vsp_mmu_eb.common, 14158c2ecf20Sopenharmony_ci &vsp_enc_eb.common, 14168c2ecf20Sopenharmony_ci &vpp_eb.common, 14178c2ecf20Sopenharmony_ci &vsp_26m_eb.common, 14188c2ecf20Sopenharmony_ci &vsp_axi_gate.common, 14198c2ecf20Sopenharmony_ci &vsp_enc_gate.common, 14208c2ecf20Sopenharmony_ci &vpp_axi_gate.common, 14218c2ecf20Sopenharmony_ci &vsp_bm_gate.common, 14228c2ecf20Sopenharmony_ci &vsp_enc_bm_gate.common, 14238c2ecf20Sopenharmony_ci &vpp_bm_gate.common, 14248c2ecf20Sopenharmony_ci}; 14258c2ecf20Sopenharmony_ci 14268c2ecf20Sopenharmony_cistatic struct clk_hw_onecell_data sc9860_vsp_gate_hws = { 14278c2ecf20Sopenharmony_ci .hws = { 14288c2ecf20Sopenharmony_ci [CLK_VSP_DEC_EB] = &vsp_dec_eb.common.hw, 14298c2ecf20Sopenharmony_ci [CLK_VSP_CKG_EB] = &vsp_ckg_eb.common.hw, 14308c2ecf20Sopenharmony_ci [CLK_VSP_MMU_EB] = &vsp_mmu_eb.common.hw, 14318c2ecf20Sopenharmony_ci [CLK_VSP_ENC_EB] = &vsp_enc_eb.common.hw, 14328c2ecf20Sopenharmony_ci [CLK_VPP_EB] = &vpp_eb.common.hw, 14338c2ecf20Sopenharmony_ci [CLK_VSP_26M_EB] = &vsp_26m_eb.common.hw, 14348c2ecf20Sopenharmony_ci [CLK_VSP_AXI_GATE] = &vsp_axi_gate.common.hw, 14358c2ecf20Sopenharmony_ci [CLK_VSP_ENC_GATE] = &vsp_enc_gate.common.hw, 14368c2ecf20Sopenharmony_ci [CLK_VPP_AXI_GATE] = &vpp_axi_gate.common.hw, 14378c2ecf20Sopenharmony_ci [CLK_VSP_BM_GATE] = &vsp_bm_gate.common.hw, 14388c2ecf20Sopenharmony_ci [CLK_VSP_ENC_BM_GATE] = &vsp_enc_bm_gate.common.hw, 14398c2ecf20Sopenharmony_ci [CLK_VPP_BM_GATE] = &vpp_bm_gate.common.hw, 14408c2ecf20Sopenharmony_ci }, 14418c2ecf20Sopenharmony_ci .num = CLK_VSP_GATE_NUM, 14428c2ecf20Sopenharmony_ci}; 14438c2ecf20Sopenharmony_ci 14448c2ecf20Sopenharmony_cistatic const struct sprd_clk_desc sc9860_vsp_gate_desc = { 14458c2ecf20Sopenharmony_ci .clk_clks = sc9860_vsp_gate, 14468c2ecf20Sopenharmony_ci .num_clk_clks = ARRAY_SIZE(sc9860_vsp_gate), 14478c2ecf20Sopenharmony_ci .hw_clks = &sc9860_vsp_gate_hws, 14488c2ecf20Sopenharmony_ci}; 14498c2ecf20Sopenharmony_ci 14508c2ecf20Sopenharmony_cistatic SPRD_MUX_CLK(ahb_cam, "ahb-cam", ahb_parents, 0x20, 14518c2ecf20Sopenharmony_ci 0, 2, SC9860_MUX_FLAG); 14528c2ecf20Sopenharmony_cistatic const char * const sensor_parents[] = { "ext-26m", "twpll-48m", 14538c2ecf20Sopenharmony_ci "twpll-76m8", "twpll-96m" }; 14548c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK(sensor0_clk, "sensor0", sensor_parents, 0x24, 14558c2ecf20Sopenharmony_ci 0, 2, 8, 3, 0); 14568c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK(sensor1_clk, "sensor1", sensor_parents, 0x28, 14578c2ecf20Sopenharmony_ci 0, 2, 8, 3, 0); 14588c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK(sensor2_clk, "sensor2", sensor_parents, 0x2c, 14598c2ecf20Sopenharmony_ci 0, 2, 8, 3, 0); 14608c2ecf20Sopenharmony_cistatic SPRD_GATE_CLK(mipi_csi0_eb, "mipi-csi0-eb", "ahb-cam", 0x4c, 14618c2ecf20Sopenharmony_ci BIT(16), 0, 0); 14628c2ecf20Sopenharmony_cistatic SPRD_GATE_CLK(mipi_csi1_eb, "mipi-csi1-eb", "ahb-cam", 0x50, 14638c2ecf20Sopenharmony_ci BIT(16), 0, 0); 14648c2ecf20Sopenharmony_ci 14658c2ecf20Sopenharmony_cistatic struct sprd_clk_common *sc9860_cam_clk[] = { 14668c2ecf20Sopenharmony_ci /* address base is 0x62000000 */ 14678c2ecf20Sopenharmony_ci &ahb_cam.common, 14688c2ecf20Sopenharmony_ci &sensor0_clk.common, 14698c2ecf20Sopenharmony_ci &sensor1_clk.common, 14708c2ecf20Sopenharmony_ci &sensor2_clk.common, 14718c2ecf20Sopenharmony_ci &mipi_csi0_eb.common, 14728c2ecf20Sopenharmony_ci &mipi_csi1_eb.common, 14738c2ecf20Sopenharmony_ci}; 14748c2ecf20Sopenharmony_ci 14758c2ecf20Sopenharmony_cistatic struct clk_hw_onecell_data sc9860_cam_clk_hws = { 14768c2ecf20Sopenharmony_ci .hws = { 14778c2ecf20Sopenharmony_ci [CLK_AHB_CAM] = &ahb_cam.common.hw, 14788c2ecf20Sopenharmony_ci [CLK_SENSOR0] = &sensor0_clk.common.hw, 14798c2ecf20Sopenharmony_ci [CLK_SENSOR1] = &sensor1_clk.common.hw, 14808c2ecf20Sopenharmony_ci [CLK_SENSOR2] = &sensor2_clk.common.hw, 14818c2ecf20Sopenharmony_ci [CLK_MIPI_CSI0_EB] = &mipi_csi0_eb.common.hw, 14828c2ecf20Sopenharmony_ci [CLK_MIPI_CSI1_EB] = &mipi_csi1_eb.common.hw, 14838c2ecf20Sopenharmony_ci }, 14848c2ecf20Sopenharmony_ci .num = CLK_CAM_NUM, 14858c2ecf20Sopenharmony_ci}; 14868c2ecf20Sopenharmony_ci 14878c2ecf20Sopenharmony_cistatic const struct sprd_clk_desc sc9860_cam_clk_desc = { 14888c2ecf20Sopenharmony_ci .clk_clks = sc9860_cam_clk, 14898c2ecf20Sopenharmony_ci .num_clk_clks = ARRAY_SIZE(sc9860_cam_clk), 14908c2ecf20Sopenharmony_ci .hw_clks = &sc9860_cam_clk_hws, 14918c2ecf20Sopenharmony_ci}; 14928c2ecf20Sopenharmony_ci 14938c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(dcam0_eb, "dcam0-eb", "ahb-cam", 0x0, 14948c2ecf20Sopenharmony_ci 0x1000, BIT(0), 0, 0); 14958c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(dcam1_eb, "dcam1-eb", "ahb-cam", 0x0, 14968c2ecf20Sopenharmony_ci 0x1000, BIT(1), 0, 0); 14978c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(isp0_eb, "isp0-eb", "ahb-cam", 0x0, 14988c2ecf20Sopenharmony_ci 0x1000, BIT(2), 0, 0); 14998c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(csi0_eb, "csi0-eb", "ahb-cam", 0x0, 15008c2ecf20Sopenharmony_ci 0x1000, BIT(3), 0, 0); 15018c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(csi1_eb, "csi1-eb", "ahb-cam", 0x0, 15028c2ecf20Sopenharmony_ci 0x1000, BIT(4), 0, 0); 15038c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(jpg0_eb, "jpg0-eb", "ahb-cam", 0x0, 15048c2ecf20Sopenharmony_ci 0x1000, BIT(5), 0, 0); 15058c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(jpg1_eb, "jpg1-eb", "ahb-cam", 0x0, 15068c2ecf20Sopenharmony_ci 0x1000, BIT(6), 0, 0); 15078c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(cam_ckg_eb, "cam-ckg-eb", "ahb-cam", 0x0, 15088c2ecf20Sopenharmony_ci 0x1000, BIT(7), 0, 0); 15098c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(cam_mmu_eb, "cam-mmu-eb", "ahb-cam", 0x0, 15108c2ecf20Sopenharmony_ci 0x1000, BIT(8), 0, 0); 15118c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(isp1_eb, "isp1-eb", "ahb-cam", 0x0, 15128c2ecf20Sopenharmony_ci 0x1000, BIT(9), 0, 0); 15138c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(cpp_eb, "cpp-eb", "ahb-cam", 0x0, 15148c2ecf20Sopenharmony_ci 0x1000, BIT(10), 0, 0); 15158c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(mmu_pf_eb, "mmu-pf-eb", "ahb-cam", 0x0, 15168c2ecf20Sopenharmony_ci 0x1000, BIT(11), 0, 0); 15178c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(isp2_eb, "isp2-eb", "ahb-cam", 0x0, 15188c2ecf20Sopenharmony_ci 0x1000, BIT(12), 0, 0); 15198c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(dcam2isp_if_eb, "dcam2isp-if-eb", "ahb-cam", 0x0, 15208c2ecf20Sopenharmony_ci 0x1000, BIT(13), 0, 0); 15218c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(isp2dcam_if_eb, "isp2dcam-if-eb", "ahb-cam", 0x0, 15228c2ecf20Sopenharmony_ci 0x1000, BIT(14), 0, 0); 15238c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(isp_lclk_eb, "isp-lclk-eb", "ahb-cam", 0x0, 15248c2ecf20Sopenharmony_ci 0x1000, BIT(15), 0, 0); 15258c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(isp_iclk_eb, "isp-iclk-eb", "ahb-cam", 0x0, 15268c2ecf20Sopenharmony_ci 0x1000, BIT(16), 0, 0); 15278c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(isp_mclk_eb, "isp-mclk-eb", "ahb-cam", 0x0, 15288c2ecf20Sopenharmony_ci 0x1000, BIT(17), 0, 0); 15298c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(isp_pclk_eb, "isp-pclk-eb", "ahb-cam", 0x0, 15308c2ecf20Sopenharmony_ci 0x1000, BIT(18), 0, 0); 15318c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(isp_isp2dcam_eb, "isp-isp2dcam-eb", "ahb-cam", 0x0, 15328c2ecf20Sopenharmony_ci 0x1000, BIT(19), 0, 0); 15338c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(dcam0_if_eb, "dcam0-if-eb", "ahb-cam", 0x0, 15348c2ecf20Sopenharmony_ci 0x1000, BIT(20), 0, 0); 15358c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(clk26m_if_eb, "clk26m-if-eb", "ahb-cam", 0x0, 15368c2ecf20Sopenharmony_ci 0x1000, BIT(21), 0, 0); 15378c2ecf20Sopenharmony_cistatic SPRD_GATE_CLK(cphy0_gate, "cphy0-gate", "ahb-cam", 0x8, 15388c2ecf20Sopenharmony_ci BIT(0), 0, 0); 15398c2ecf20Sopenharmony_cistatic SPRD_GATE_CLK(mipi_csi0_gate, "mipi-csi0-gate", "ahb-cam", 0x8, 15408c2ecf20Sopenharmony_ci BIT(1), 0, 0); 15418c2ecf20Sopenharmony_cistatic SPRD_GATE_CLK(cphy1_gate, "cphy1-gate", "ahb-cam", 0x8, 15428c2ecf20Sopenharmony_ci BIT(2), 0, 0); 15438c2ecf20Sopenharmony_cistatic SPRD_GATE_CLK(mipi_csi1, "mipi-csi1", "ahb-cam", 0x8, 15448c2ecf20Sopenharmony_ci BIT(3), 0, 0); 15458c2ecf20Sopenharmony_cistatic SPRD_GATE_CLK(dcam0_axi_gate, "dcam0-axi-gate", "ahb-cam", 0x8, 15468c2ecf20Sopenharmony_ci BIT(4), 0, 0); 15478c2ecf20Sopenharmony_cistatic SPRD_GATE_CLK(dcam1_axi_gate, "dcam1-axi-gate", "ahb-cam", 0x8, 15488c2ecf20Sopenharmony_ci BIT(5), 0, 0); 15498c2ecf20Sopenharmony_cistatic SPRD_GATE_CLK(sensor0_gate, "sensor0-gate", "ahb-cam", 0x8, 15508c2ecf20Sopenharmony_ci BIT(6), 0, 0); 15518c2ecf20Sopenharmony_cistatic SPRD_GATE_CLK(sensor1_gate, "sensor1-gate", "ahb-cam", 0x8, 15528c2ecf20Sopenharmony_ci BIT(7), 0, 0); 15538c2ecf20Sopenharmony_cistatic SPRD_GATE_CLK(jpg0_axi_gate, "jpg0-axi-gate", "ahb-cam", 0x8, 15548c2ecf20Sopenharmony_ci BIT(8), 0, 0); 15558c2ecf20Sopenharmony_cistatic SPRD_GATE_CLK(gpg1_axi_gate, "gpg1-axi-gate", "ahb-cam", 0x8, 15568c2ecf20Sopenharmony_ci BIT(9), 0, 0); 15578c2ecf20Sopenharmony_cistatic SPRD_GATE_CLK(isp0_axi_gate, "isp0-axi-gate", "ahb-cam", 0x8, 15588c2ecf20Sopenharmony_ci BIT(10), 0, 0); 15598c2ecf20Sopenharmony_cistatic SPRD_GATE_CLK(isp1_axi_gate, "isp1-axi-gate", "ahb-cam", 0x8, 15608c2ecf20Sopenharmony_ci BIT(11), 0, 0); 15618c2ecf20Sopenharmony_cistatic SPRD_GATE_CLK(isp2_axi_gate, "isp2-axi-gate", "ahb-cam", 0x8, 15628c2ecf20Sopenharmony_ci BIT(12), 0, 0); 15638c2ecf20Sopenharmony_cistatic SPRD_GATE_CLK(cpp_axi_gate, "cpp-axi-gate", "ahb-cam", 0x8, 15648c2ecf20Sopenharmony_ci BIT(13), 0, 0); 15658c2ecf20Sopenharmony_cistatic SPRD_GATE_CLK(d0_if_axi_gate, "d0-if-axi-gate", "ahb-cam", 0x8, 15668c2ecf20Sopenharmony_ci BIT(14), 0, 0); 15678c2ecf20Sopenharmony_cistatic SPRD_GATE_CLK(d2i_if_axi_gate, "d2i-if-axi-gate", "ahb-cam", 0x8, 15688c2ecf20Sopenharmony_ci BIT(15), 0, 0); 15698c2ecf20Sopenharmony_cistatic SPRD_GATE_CLK(i2d_if_axi_gate, "i2d-if-axi-gate", "ahb-cam", 0x8, 15708c2ecf20Sopenharmony_ci BIT(16), 0, 0); 15718c2ecf20Sopenharmony_cistatic SPRD_GATE_CLK(spare_axi_gate, "spare-axi-gate", "ahb-cam", 0x8, 15728c2ecf20Sopenharmony_ci BIT(17), 0, 0); 15738c2ecf20Sopenharmony_cistatic SPRD_GATE_CLK(sensor2_gate, "sensor2-gate", "ahb-cam", 0x8, 15748c2ecf20Sopenharmony_ci BIT(18), 0, 0); 15758c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(d0if_in_d_en, "d0if-in-d-en", "ahb-cam", 0x28, 15768c2ecf20Sopenharmony_ci 0x1000, BIT(0), 0, 0); 15778c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(d1if_in_d_en, "d1if-in-d-en", "ahb-cam", 0x28, 15788c2ecf20Sopenharmony_ci 0x1000, BIT(1), 0, 0); 15798c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(d0if_in_d2i_en, "d0if-in-d2i-en", "ahb-cam", 0x28, 15808c2ecf20Sopenharmony_ci 0x1000, BIT(2), 0, 0); 15818c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(d1if_in_d2i_en, "d1if-in-d2i-en", "ahb-cam", 0x28, 15828c2ecf20Sopenharmony_ci 0x1000, BIT(3), 0, 0); 15838c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(ia_in_d2i_en, "ia-in-d2i-en", "ahb-cam", 0x28, 15848c2ecf20Sopenharmony_ci 0x1000, BIT(4), 0, 0); 15858c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(ib_in_d2i_en, "ib-in-d2i-en", "ahb-cam", 0x28, 15868c2ecf20Sopenharmony_ci 0x1000, BIT(5), 0, 0); 15878c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(ic_in_d2i_en, "ic-in-d2i-en", "ahb-cam", 0x28, 15888c2ecf20Sopenharmony_ci 0x1000, BIT(6), 0, 0); 15898c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(ia_in_i_en, "ia-in-i-en", "ahb-cam", 0x28, 15908c2ecf20Sopenharmony_ci 0x1000, BIT(7), 0, 0); 15918c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(ib_in_i_en, "ib-in-i-en", "ahb-cam", 0x28, 15928c2ecf20Sopenharmony_ci 0x1000, BIT(8), 0, 0); 15938c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(ic_in_i_en, "ic-in-i-en", "ahb-cam", 0x28, 15948c2ecf20Sopenharmony_ci 0x1000, BIT(9), 0, 0); 15958c2ecf20Sopenharmony_ci 15968c2ecf20Sopenharmony_cistatic struct sprd_clk_common *sc9860_cam_gate[] = { 15978c2ecf20Sopenharmony_ci /* address base is 0x62100000 */ 15988c2ecf20Sopenharmony_ci &dcam0_eb.common, 15998c2ecf20Sopenharmony_ci &dcam1_eb.common, 16008c2ecf20Sopenharmony_ci &isp0_eb.common, 16018c2ecf20Sopenharmony_ci &csi0_eb.common, 16028c2ecf20Sopenharmony_ci &csi1_eb.common, 16038c2ecf20Sopenharmony_ci &jpg0_eb.common, 16048c2ecf20Sopenharmony_ci &jpg1_eb.common, 16058c2ecf20Sopenharmony_ci &cam_ckg_eb.common, 16068c2ecf20Sopenharmony_ci &cam_mmu_eb.common, 16078c2ecf20Sopenharmony_ci &isp1_eb.common, 16088c2ecf20Sopenharmony_ci &cpp_eb.common, 16098c2ecf20Sopenharmony_ci &mmu_pf_eb.common, 16108c2ecf20Sopenharmony_ci &isp2_eb.common, 16118c2ecf20Sopenharmony_ci &dcam2isp_if_eb.common, 16128c2ecf20Sopenharmony_ci &isp2dcam_if_eb.common, 16138c2ecf20Sopenharmony_ci &isp_lclk_eb.common, 16148c2ecf20Sopenharmony_ci &isp_iclk_eb.common, 16158c2ecf20Sopenharmony_ci &isp_mclk_eb.common, 16168c2ecf20Sopenharmony_ci &isp_pclk_eb.common, 16178c2ecf20Sopenharmony_ci &isp_isp2dcam_eb.common, 16188c2ecf20Sopenharmony_ci &dcam0_if_eb.common, 16198c2ecf20Sopenharmony_ci &clk26m_if_eb.common, 16208c2ecf20Sopenharmony_ci &cphy0_gate.common, 16218c2ecf20Sopenharmony_ci &mipi_csi0_gate.common, 16228c2ecf20Sopenharmony_ci &cphy1_gate.common, 16238c2ecf20Sopenharmony_ci &mipi_csi1.common, 16248c2ecf20Sopenharmony_ci &dcam0_axi_gate.common, 16258c2ecf20Sopenharmony_ci &dcam1_axi_gate.common, 16268c2ecf20Sopenharmony_ci &sensor0_gate.common, 16278c2ecf20Sopenharmony_ci &sensor1_gate.common, 16288c2ecf20Sopenharmony_ci &jpg0_axi_gate.common, 16298c2ecf20Sopenharmony_ci &gpg1_axi_gate.common, 16308c2ecf20Sopenharmony_ci &isp0_axi_gate.common, 16318c2ecf20Sopenharmony_ci &isp1_axi_gate.common, 16328c2ecf20Sopenharmony_ci &isp2_axi_gate.common, 16338c2ecf20Sopenharmony_ci &cpp_axi_gate.common, 16348c2ecf20Sopenharmony_ci &d0_if_axi_gate.common, 16358c2ecf20Sopenharmony_ci &d2i_if_axi_gate.common, 16368c2ecf20Sopenharmony_ci &i2d_if_axi_gate.common, 16378c2ecf20Sopenharmony_ci &spare_axi_gate.common, 16388c2ecf20Sopenharmony_ci &sensor2_gate.common, 16398c2ecf20Sopenharmony_ci &d0if_in_d_en.common, 16408c2ecf20Sopenharmony_ci &d1if_in_d_en.common, 16418c2ecf20Sopenharmony_ci &d0if_in_d2i_en.common, 16428c2ecf20Sopenharmony_ci &d1if_in_d2i_en.common, 16438c2ecf20Sopenharmony_ci &ia_in_d2i_en.common, 16448c2ecf20Sopenharmony_ci &ib_in_d2i_en.common, 16458c2ecf20Sopenharmony_ci &ic_in_d2i_en.common, 16468c2ecf20Sopenharmony_ci &ia_in_i_en.common, 16478c2ecf20Sopenharmony_ci &ib_in_i_en.common, 16488c2ecf20Sopenharmony_ci &ic_in_i_en.common, 16498c2ecf20Sopenharmony_ci}; 16508c2ecf20Sopenharmony_ci 16518c2ecf20Sopenharmony_cistatic struct clk_hw_onecell_data sc9860_cam_gate_hws = { 16528c2ecf20Sopenharmony_ci .hws = { 16538c2ecf20Sopenharmony_ci [CLK_DCAM0_EB] = &dcam0_eb.common.hw, 16548c2ecf20Sopenharmony_ci [CLK_DCAM1_EB] = &dcam1_eb.common.hw, 16558c2ecf20Sopenharmony_ci [CLK_ISP0_EB] = &isp0_eb.common.hw, 16568c2ecf20Sopenharmony_ci [CLK_CSI0_EB] = &csi0_eb.common.hw, 16578c2ecf20Sopenharmony_ci [CLK_CSI1_EB] = &csi1_eb.common.hw, 16588c2ecf20Sopenharmony_ci [CLK_JPG0_EB] = &jpg0_eb.common.hw, 16598c2ecf20Sopenharmony_ci [CLK_JPG1_EB] = &jpg1_eb.common.hw, 16608c2ecf20Sopenharmony_ci [CLK_CAM_CKG_EB] = &cam_ckg_eb.common.hw, 16618c2ecf20Sopenharmony_ci [CLK_CAM_MMU_EB] = &cam_mmu_eb.common.hw, 16628c2ecf20Sopenharmony_ci [CLK_ISP1_EB] = &isp1_eb.common.hw, 16638c2ecf20Sopenharmony_ci [CLK_CPP_EB] = &cpp_eb.common.hw, 16648c2ecf20Sopenharmony_ci [CLK_MMU_PF_EB] = &mmu_pf_eb.common.hw, 16658c2ecf20Sopenharmony_ci [CLK_ISP2_EB] = &isp2_eb.common.hw, 16668c2ecf20Sopenharmony_ci [CLK_DCAM2ISP_IF_EB] = &dcam2isp_if_eb.common.hw, 16678c2ecf20Sopenharmony_ci [CLK_ISP2DCAM_IF_EB] = &isp2dcam_if_eb.common.hw, 16688c2ecf20Sopenharmony_ci [CLK_ISP_LCLK_EB] = &isp_lclk_eb.common.hw, 16698c2ecf20Sopenharmony_ci [CLK_ISP_ICLK_EB] = &isp_iclk_eb.common.hw, 16708c2ecf20Sopenharmony_ci [CLK_ISP_MCLK_EB] = &isp_mclk_eb.common.hw, 16718c2ecf20Sopenharmony_ci [CLK_ISP_PCLK_EB] = &isp_pclk_eb.common.hw, 16728c2ecf20Sopenharmony_ci [CLK_ISP_ISP2DCAM_EB] = &isp_isp2dcam_eb.common.hw, 16738c2ecf20Sopenharmony_ci [CLK_DCAM0_IF_EB] = &dcam0_if_eb.common.hw, 16748c2ecf20Sopenharmony_ci [CLK_CLK26M_IF_EB] = &clk26m_if_eb.common.hw, 16758c2ecf20Sopenharmony_ci [CLK_CPHY0_GATE] = &cphy0_gate.common.hw, 16768c2ecf20Sopenharmony_ci [CLK_MIPI_CSI0_GATE] = &mipi_csi0_gate.common.hw, 16778c2ecf20Sopenharmony_ci [CLK_CPHY1_GATE] = &cphy1_gate.common.hw, 16788c2ecf20Sopenharmony_ci [CLK_MIPI_CSI1] = &mipi_csi1.common.hw, 16798c2ecf20Sopenharmony_ci [CLK_DCAM0_AXI_GATE] = &dcam0_axi_gate.common.hw, 16808c2ecf20Sopenharmony_ci [CLK_DCAM1_AXI_GATE] = &dcam1_axi_gate.common.hw, 16818c2ecf20Sopenharmony_ci [CLK_SENSOR0_GATE] = &sensor0_gate.common.hw, 16828c2ecf20Sopenharmony_ci [CLK_SENSOR1_GATE] = &sensor1_gate.common.hw, 16838c2ecf20Sopenharmony_ci [CLK_JPG0_AXI_GATE] = &jpg0_axi_gate.common.hw, 16848c2ecf20Sopenharmony_ci [CLK_GPG1_AXI_GATE] = &gpg1_axi_gate.common.hw, 16858c2ecf20Sopenharmony_ci [CLK_ISP0_AXI_GATE] = &isp0_axi_gate.common.hw, 16868c2ecf20Sopenharmony_ci [CLK_ISP1_AXI_GATE] = &isp1_axi_gate.common.hw, 16878c2ecf20Sopenharmony_ci [CLK_ISP2_AXI_GATE] = &isp2_axi_gate.common.hw, 16888c2ecf20Sopenharmony_ci [CLK_CPP_AXI_GATE] = &cpp_axi_gate.common.hw, 16898c2ecf20Sopenharmony_ci [CLK_D0_IF_AXI_GATE] = &d0_if_axi_gate.common.hw, 16908c2ecf20Sopenharmony_ci [CLK_D2I_IF_AXI_GATE] = &d2i_if_axi_gate.common.hw, 16918c2ecf20Sopenharmony_ci [CLK_I2D_IF_AXI_GATE] = &i2d_if_axi_gate.common.hw, 16928c2ecf20Sopenharmony_ci [CLK_SPARE_AXI_GATE] = &spare_axi_gate.common.hw, 16938c2ecf20Sopenharmony_ci [CLK_SENSOR2_GATE] = &sensor2_gate.common.hw, 16948c2ecf20Sopenharmony_ci [CLK_D0IF_IN_D_EN] = &d0if_in_d_en.common.hw, 16958c2ecf20Sopenharmony_ci [CLK_D1IF_IN_D_EN] = &d1if_in_d_en.common.hw, 16968c2ecf20Sopenharmony_ci [CLK_D0IF_IN_D2I_EN] = &d0if_in_d2i_en.common.hw, 16978c2ecf20Sopenharmony_ci [CLK_D1IF_IN_D2I_EN] = &d1if_in_d2i_en.common.hw, 16988c2ecf20Sopenharmony_ci [CLK_IA_IN_D2I_EN] = &ia_in_d2i_en.common.hw, 16998c2ecf20Sopenharmony_ci [CLK_IB_IN_D2I_EN] = &ib_in_d2i_en.common.hw, 17008c2ecf20Sopenharmony_ci [CLK_IC_IN_D2I_EN] = &ic_in_d2i_en.common.hw, 17018c2ecf20Sopenharmony_ci [CLK_IA_IN_I_EN] = &ia_in_i_en.common.hw, 17028c2ecf20Sopenharmony_ci [CLK_IB_IN_I_EN] = &ib_in_i_en.common.hw, 17038c2ecf20Sopenharmony_ci [CLK_IC_IN_I_EN] = &ic_in_i_en.common.hw, 17048c2ecf20Sopenharmony_ci }, 17058c2ecf20Sopenharmony_ci .num = CLK_CAM_GATE_NUM, 17068c2ecf20Sopenharmony_ci}; 17078c2ecf20Sopenharmony_ci 17088c2ecf20Sopenharmony_cistatic const struct sprd_clk_desc sc9860_cam_gate_desc = { 17098c2ecf20Sopenharmony_ci .clk_clks = sc9860_cam_gate, 17108c2ecf20Sopenharmony_ci .num_clk_clks = ARRAY_SIZE(sc9860_cam_gate), 17118c2ecf20Sopenharmony_ci .hw_clks = &sc9860_cam_gate_hws, 17128c2ecf20Sopenharmony_ci}; 17138c2ecf20Sopenharmony_ci 17148c2ecf20Sopenharmony_cistatic SPRD_MUX_CLK(ahb_disp, "ahb-disp", ahb_parents, 0x20, 17158c2ecf20Sopenharmony_ci 0, 2, SC9860_MUX_FLAG); 17168c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK(dispc0_dpi, "dispc0-dpi", dispc_parents, 0x34, 17178c2ecf20Sopenharmony_ci 0, 2, 8, 2, 0); 17188c2ecf20Sopenharmony_cistatic SPRD_COMP_CLK(dispc1_dpi, "dispc1-dpi", dispc_parents, 0x40, 17198c2ecf20Sopenharmony_ci 0, 2, 8, 2, 0); 17208c2ecf20Sopenharmony_ci 17218c2ecf20Sopenharmony_cistatic struct sprd_clk_common *sc9860_disp_clk[] = { 17228c2ecf20Sopenharmony_ci /* address base is 0x63000000 */ 17238c2ecf20Sopenharmony_ci &ahb_disp.common, 17248c2ecf20Sopenharmony_ci &dispc0_dpi.common, 17258c2ecf20Sopenharmony_ci &dispc1_dpi.common, 17268c2ecf20Sopenharmony_ci}; 17278c2ecf20Sopenharmony_ci 17288c2ecf20Sopenharmony_cistatic struct clk_hw_onecell_data sc9860_disp_clk_hws = { 17298c2ecf20Sopenharmony_ci .hws = { 17308c2ecf20Sopenharmony_ci [CLK_AHB_DISP] = &ahb_disp.common.hw, 17318c2ecf20Sopenharmony_ci [CLK_DISPC0_DPI] = &dispc0_dpi.common.hw, 17328c2ecf20Sopenharmony_ci [CLK_DISPC1_DPI] = &dispc1_dpi.common.hw, 17338c2ecf20Sopenharmony_ci }, 17348c2ecf20Sopenharmony_ci .num = CLK_DISP_NUM, 17358c2ecf20Sopenharmony_ci}; 17368c2ecf20Sopenharmony_ci 17378c2ecf20Sopenharmony_cistatic const struct sprd_clk_desc sc9860_disp_clk_desc = { 17388c2ecf20Sopenharmony_ci .clk_clks = sc9860_disp_clk, 17398c2ecf20Sopenharmony_ci .num_clk_clks = ARRAY_SIZE(sc9860_disp_clk), 17408c2ecf20Sopenharmony_ci .hw_clks = &sc9860_disp_clk_hws, 17418c2ecf20Sopenharmony_ci}; 17428c2ecf20Sopenharmony_ci 17438c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(dispc0_eb, "dispc0-eb", "ahb-disp", 0x0, 17448c2ecf20Sopenharmony_ci 0x1000, BIT(0), 0, 0); 17458c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(dispc1_eb, "dispc1-eb", "ahb-disp", 0x0, 17468c2ecf20Sopenharmony_ci 0x1000, BIT(1), 0, 0); 17478c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(dispc_mmu_eb, "dispc-mmu-eb", "ahb-disp", 0x0, 17488c2ecf20Sopenharmony_ci 0x1000, BIT(2), 0, 0); 17498c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(gsp0_eb, "gsp0-eb", "ahb-disp", 0x0, 17508c2ecf20Sopenharmony_ci 0x1000, BIT(3), 0, 0); 17518c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(gsp1_eb, "gsp1-eb", "ahb-disp", 0x0, 17528c2ecf20Sopenharmony_ci 0x1000, BIT(4), 0, 0); 17538c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(gsp0_mmu_eb, "gsp0-mmu-eb", "ahb-disp", 0x0, 17548c2ecf20Sopenharmony_ci 0x1000, BIT(5), 0, 0); 17558c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(gsp1_mmu_eb, "gsp1-mmu-eb", "ahb-disp", 0x0, 17568c2ecf20Sopenharmony_ci 0x1000, BIT(6), 0, 0); 17578c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(dsi0_eb, "dsi0-eb", "ahb-disp", 0x0, 17588c2ecf20Sopenharmony_ci 0x1000, BIT(7), 0, 0); 17598c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(dsi1_eb, "dsi1-eb", "ahb-disp", 0x0, 17608c2ecf20Sopenharmony_ci 0x1000, BIT(8), 0, 0); 17618c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(disp_ckg_eb, "disp-ckg-eb", "ahb-disp", 0x0, 17628c2ecf20Sopenharmony_ci 0x1000, BIT(9), 0, 0); 17638c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(disp_gpu_eb, "disp-gpu-eb", "ahb-disp", 0x0, 17648c2ecf20Sopenharmony_ci 0x1000, BIT(10), 0, 0); 17658c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(gpu_mtx_eb, "gpu-mtx-eb", "ahb-disp", 0x0, 17668c2ecf20Sopenharmony_ci 0x1000, BIT(13), 0, 0); 17678c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(gsp_mtx_eb, "gsp-mtx-eb", "ahb-disp", 0x0, 17688c2ecf20Sopenharmony_ci 0x1000, BIT(14), 0, 0); 17698c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(tmc_mtx_eb, "tmc-mtx-eb", "ahb-disp", 0x0, 17708c2ecf20Sopenharmony_ci 0x1000, BIT(15), 0, 0); 17718c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(dispc_mtx_eb, "dispc-mtx-eb", "ahb-disp", 0x0, 17728c2ecf20Sopenharmony_ci 0x1000, BIT(16), 0, 0); 17738c2ecf20Sopenharmony_cistatic SPRD_GATE_CLK(dphy0_gate, "dphy0-gate", "ahb-disp", 0x8, 17748c2ecf20Sopenharmony_ci BIT(0), 0, 0); 17758c2ecf20Sopenharmony_cistatic SPRD_GATE_CLK(dphy1_gate, "dphy1-gate", "ahb-disp", 0x8, 17768c2ecf20Sopenharmony_ci BIT(1), 0, 0); 17778c2ecf20Sopenharmony_cistatic SPRD_GATE_CLK(gsp0_a_gate, "gsp0-a-gate", "ahb-disp", 0x8, 17788c2ecf20Sopenharmony_ci BIT(2), 0, 0); 17798c2ecf20Sopenharmony_cistatic SPRD_GATE_CLK(gsp1_a_gate, "gsp1-a-gate", "ahb-disp", 0x8, 17808c2ecf20Sopenharmony_ci BIT(3), 0, 0); 17818c2ecf20Sopenharmony_cistatic SPRD_GATE_CLK(gsp0_f_gate, "gsp0-f-gate", "ahb-disp", 0x8, 17828c2ecf20Sopenharmony_ci BIT(4), 0, 0); 17838c2ecf20Sopenharmony_cistatic SPRD_GATE_CLK(gsp1_f_gate, "gsp1-f-gate", "ahb-disp", 0x8, 17848c2ecf20Sopenharmony_ci BIT(5), 0, 0); 17858c2ecf20Sopenharmony_cistatic SPRD_GATE_CLK(d_mtx_f_gate, "d-mtx-f-gate", "ahb-disp", 0x8, 17868c2ecf20Sopenharmony_ci BIT(6), 0, 0); 17878c2ecf20Sopenharmony_cistatic SPRD_GATE_CLK(d_mtx_a_gate, "d-mtx-a-gate", "ahb-disp", 0x8, 17888c2ecf20Sopenharmony_ci BIT(7), 0, 0); 17898c2ecf20Sopenharmony_cistatic SPRD_GATE_CLK(d_noc_f_gate, "d-noc-f-gate", "ahb-disp", 0x8, 17908c2ecf20Sopenharmony_ci BIT(8), 0, 0); 17918c2ecf20Sopenharmony_cistatic SPRD_GATE_CLK(d_noc_a_gate, "d-noc-a-gate", "ahb-disp", 0x8, 17928c2ecf20Sopenharmony_ci BIT(9), 0, 0); 17938c2ecf20Sopenharmony_cistatic SPRD_GATE_CLK(gsp_mtx_f_gate, "gsp-mtx-f-gate", "ahb-disp", 0x8, 17948c2ecf20Sopenharmony_ci BIT(10), 0, 0); 17958c2ecf20Sopenharmony_cistatic SPRD_GATE_CLK(gsp_mtx_a_gate, "gsp-mtx-a-gate", "ahb-disp", 0x8, 17968c2ecf20Sopenharmony_ci BIT(11), 0, 0); 17978c2ecf20Sopenharmony_cistatic SPRD_GATE_CLK(gsp_noc_f_gate, "gsp-noc-f-gate", "ahb-disp", 0x8, 17988c2ecf20Sopenharmony_ci BIT(12), 0, 0); 17998c2ecf20Sopenharmony_cistatic SPRD_GATE_CLK(gsp_noc_a_gate, "gsp-noc-a-gate", "ahb-disp", 0x8, 18008c2ecf20Sopenharmony_ci BIT(13), 0, 0); 18018c2ecf20Sopenharmony_cistatic SPRD_GATE_CLK(dispm0idle_gate, "dispm0idle-gate", "ahb-disp", 0x8, 18028c2ecf20Sopenharmony_ci BIT(14), 0, 0); 18038c2ecf20Sopenharmony_cistatic SPRD_GATE_CLK(gspm0idle_gate, "gspm0idle-gate", "ahb-disp", 0x8, 18048c2ecf20Sopenharmony_ci BIT(15), 0, 0); 18058c2ecf20Sopenharmony_ci 18068c2ecf20Sopenharmony_cistatic struct sprd_clk_common *sc9860_disp_gate[] = { 18078c2ecf20Sopenharmony_ci /* address base is 0x63100000 */ 18088c2ecf20Sopenharmony_ci &dispc0_eb.common, 18098c2ecf20Sopenharmony_ci &dispc1_eb.common, 18108c2ecf20Sopenharmony_ci &dispc_mmu_eb.common, 18118c2ecf20Sopenharmony_ci &gsp0_eb.common, 18128c2ecf20Sopenharmony_ci &gsp1_eb.common, 18138c2ecf20Sopenharmony_ci &gsp0_mmu_eb.common, 18148c2ecf20Sopenharmony_ci &gsp1_mmu_eb.common, 18158c2ecf20Sopenharmony_ci &dsi0_eb.common, 18168c2ecf20Sopenharmony_ci &dsi1_eb.common, 18178c2ecf20Sopenharmony_ci &disp_ckg_eb.common, 18188c2ecf20Sopenharmony_ci &disp_gpu_eb.common, 18198c2ecf20Sopenharmony_ci &gpu_mtx_eb.common, 18208c2ecf20Sopenharmony_ci &gsp_mtx_eb.common, 18218c2ecf20Sopenharmony_ci &tmc_mtx_eb.common, 18228c2ecf20Sopenharmony_ci &dispc_mtx_eb.common, 18238c2ecf20Sopenharmony_ci &dphy0_gate.common, 18248c2ecf20Sopenharmony_ci &dphy1_gate.common, 18258c2ecf20Sopenharmony_ci &gsp0_a_gate.common, 18268c2ecf20Sopenharmony_ci &gsp1_a_gate.common, 18278c2ecf20Sopenharmony_ci &gsp0_f_gate.common, 18288c2ecf20Sopenharmony_ci &gsp1_f_gate.common, 18298c2ecf20Sopenharmony_ci &d_mtx_f_gate.common, 18308c2ecf20Sopenharmony_ci &d_mtx_a_gate.common, 18318c2ecf20Sopenharmony_ci &d_noc_f_gate.common, 18328c2ecf20Sopenharmony_ci &d_noc_a_gate.common, 18338c2ecf20Sopenharmony_ci &gsp_mtx_f_gate.common, 18348c2ecf20Sopenharmony_ci &gsp_mtx_a_gate.common, 18358c2ecf20Sopenharmony_ci &gsp_noc_f_gate.common, 18368c2ecf20Sopenharmony_ci &gsp_noc_a_gate.common, 18378c2ecf20Sopenharmony_ci &dispm0idle_gate.common, 18388c2ecf20Sopenharmony_ci &gspm0idle_gate.common, 18398c2ecf20Sopenharmony_ci}; 18408c2ecf20Sopenharmony_ci 18418c2ecf20Sopenharmony_cistatic struct clk_hw_onecell_data sc9860_disp_gate_hws = { 18428c2ecf20Sopenharmony_ci .hws = { 18438c2ecf20Sopenharmony_ci [CLK_DISPC0_EB] = &dispc0_eb.common.hw, 18448c2ecf20Sopenharmony_ci [CLK_DISPC1_EB] = &dispc1_eb.common.hw, 18458c2ecf20Sopenharmony_ci [CLK_DISPC_MMU_EB] = &dispc_mmu_eb.common.hw, 18468c2ecf20Sopenharmony_ci [CLK_GSP0_EB] = &gsp0_eb.common.hw, 18478c2ecf20Sopenharmony_ci [CLK_GSP1_EB] = &gsp1_eb.common.hw, 18488c2ecf20Sopenharmony_ci [CLK_GSP0_MMU_EB] = &gsp0_mmu_eb.common.hw, 18498c2ecf20Sopenharmony_ci [CLK_GSP1_MMU_EB] = &gsp1_mmu_eb.common.hw, 18508c2ecf20Sopenharmony_ci [CLK_DSI0_EB] = &dsi0_eb.common.hw, 18518c2ecf20Sopenharmony_ci [CLK_DSI1_EB] = &dsi1_eb.common.hw, 18528c2ecf20Sopenharmony_ci [CLK_DISP_CKG_EB] = &disp_ckg_eb.common.hw, 18538c2ecf20Sopenharmony_ci [CLK_DISP_GPU_EB] = &disp_gpu_eb.common.hw, 18548c2ecf20Sopenharmony_ci [CLK_GPU_MTX_EB] = &gpu_mtx_eb.common.hw, 18558c2ecf20Sopenharmony_ci [CLK_GSP_MTX_EB] = &gsp_mtx_eb.common.hw, 18568c2ecf20Sopenharmony_ci [CLK_TMC_MTX_EB] = &tmc_mtx_eb.common.hw, 18578c2ecf20Sopenharmony_ci [CLK_DISPC_MTX_EB] = &dispc_mtx_eb.common.hw, 18588c2ecf20Sopenharmony_ci [CLK_DPHY0_GATE] = &dphy0_gate.common.hw, 18598c2ecf20Sopenharmony_ci [CLK_DPHY1_GATE] = &dphy1_gate.common.hw, 18608c2ecf20Sopenharmony_ci [CLK_GSP0_A_GATE] = &gsp0_a_gate.common.hw, 18618c2ecf20Sopenharmony_ci [CLK_GSP1_A_GATE] = &gsp1_a_gate.common.hw, 18628c2ecf20Sopenharmony_ci [CLK_GSP0_F_GATE] = &gsp0_f_gate.common.hw, 18638c2ecf20Sopenharmony_ci [CLK_GSP1_F_GATE] = &gsp1_f_gate.common.hw, 18648c2ecf20Sopenharmony_ci [CLK_D_MTX_F_GATE] = &d_mtx_f_gate.common.hw, 18658c2ecf20Sopenharmony_ci [CLK_D_MTX_A_GATE] = &d_mtx_a_gate.common.hw, 18668c2ecf20Sopenharmony_ci [CLK_D_NOC_F_GATE] = &d_noc_f_gate.common.hw, 18678c2ecf20Sopenharmony_ci [CLK_D_NOC_A_GATE] = &d_noc_a_gate.common.hw, 18688c2ecf20Sopenharmony_ci [CLK_GSP_MTX_F_GATE] = &gsp_mtx_f_gate.common.hw, 18698c2ecf20Sopenharmony_ci [CLK_GSP_MTX_A_GATE] = &gsp_mtx_a_gate.common.hw, 18708c2ecf20Sopenharmony_ci [CLK_GSP_NOC_F_GATE] = &gsp_noc_f_gate.common.hw, 18718c2ecf20Sopenharmony_ci [CLK_GSP_NOC_A_GATE] = &gsp_noc_a_gate.common.hw, 18728c2ecf20Sopenharmony_ci [CLK_DISPM0IDLE_GATE] = &dispm0idle_gate.common.hw, 18738c2ecf20Sopenharmony_ci [CLK_GSPM0IDLE_GATE] = &gspm0idle_gate.common.hw, 18748c2ecf20Sopenharmony_ci }, 18758c2ecf20Sopenharmony_ci .num = CLK_DISP_GATE_NUM, 18768c2ecf20Sopenharmony_ci}; 18778c2ecf20Sopenharmony_ci 18788c2ecf20Sopenharmony_cistatic const struct sprd_clk_desc sc9860_disp_gate_desc = { 18798c2ecf20Sopenharmony_ci .clk_clks = sc9860_disp_gate, 18808c2ecf20Sopenharmony_ci .num_clk_clks = ARRAY_SIZE(sc9860_disp_gate), 18818c2ecf20Sopenharmony_ci .hw_clks = &sc9860_disp_gate_hws, 18828c2ecf20Sopenharmony_ci}; 18838c2ecf20Sopenharmony_ci 18848c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(sim0_eb, "sim0-eb", "ap-apb", 0x0, 18858c2ecf20Sopenharmony_ci 0x1000, BIT(0), CLK_IGNORE_UNUSED, 0); 18868c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(iis0_eb, "iis0-eb", "ap-apb", 0x0, 18878c2ecf20Sopenharmony_ci 0x1000, BIT(1), CLK_IGNORE_UNUSED, 0); 18888c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(iis1_eb, "iis1-eb", "ap-apb", 0x0, 18898c2ecf20Sopenharmony_ci 0x1000, BIT(2), CLK_IGNORE_UNUSED, 0); 18908c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(iis2_eb, "iis2-eb", "ap-apb", 0x0, 18918c2ecf20Sopenharmony_ci 0x1000, BIT(3), CLK_IGNORE_UNUSED, 0); 18928c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(iis3_eb, "iis3-eb", "ap-apb", 0x0, 18938c2ecf20Sopenharmony_ci 0x1000, BIT(4), CLK_IGNORE_UNUSED, 0); 18948c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(spi0_eb, "spi0-eb", "ap-apb", 0x0, 18958c2ecf20Sopenharmony_ci 0x1000, BIT(5), CLK_IGNORE_UNUSED, 0); 18968c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(spi1_eb, "spi1-eb", "ap-apb", 0x0, 18978c2ecf20Sopenharmony_ci 0x1000, BIT(6), CLK_IGNORE_UNUSED, 0); 18988c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(spi2_eb, "spi2-eb", "ap-apb", 0x0, 18998c2ecf20Sopenharmony_ci 0x1000, BIT(7), CLK_IGNORE_UNUSED, 0); 19008c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(i2c0_eb, "i2c0-eb", "ap-apb", 0x0, 19018c2ecf20Sopenharmony_ci 0x1000, BIT(8), CLK_IGNORE_UNUSED, 0); 19028c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(i2c1_eb, "i2c1-eb", "ap-apb", 0x0, 19038c2ecf20Sopenharmony_ci 0x1000, BIT(9), CLK_IGNORE_UNUSED, 0); 19048c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(i2c2_eb, "i2c2-eb", "ap-apb", 0x0, 19058c2ecf20Sopenharmony_ci 0x1000, BIT(10), CLK_IGNORE_UNUSED, 0); 19068c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(i2c3_eb, "i2c3-eb", "ap-apb", 0x0, 19078c2ecf20Sopenharmony_ci 0x1000, BIT(11), CLK_IGNORE_UNUSED, 0); 19088c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(i2c4_eb, "i2c4-eb", "ap-apb", 0x0, 19098c2ecf20Sopenharmony_ci 0x1000, BIT(12), CLK_IGNORE_UNUSED, 0); 19108c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(i2c5_eb, "i2c5-eb", "ap-apb", 0x0, 19118c2ecf20Sopenharmony_ci 0x1000, BIT(13), CLK_IGNORE_UNUSED, 0); 19128c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(uart0_eb, "uart0-eb", "ap-apb", 0x0, 19138c2ecf20Sopenharmony_ci 0x1000, BIT(14), CLK_IGNORE_UNUSED, 0); 19148c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(uart1_eb, "uart1-eb", "ap-apb", 0x0, 19158c2ecf20Sopenharmony_ci 0x1000, BIT(15), CLK_IGNORE_UNUSED, 0); 19168c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(uart2_eb, "uart2-eb", "ap-apb", 0x0, 19178c2ecf20Sopenharmony_ci 0x1000, BIT(16), CLK_IGNORE_UNUSED, 0); 19188c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(uart3_eb, "uart3-eb", "ap-apb", 0x0, 19198c2ecf20Sopenharmony_ci 0x1000, BIT(17), CLK_IGNORE_UNUSED, 0); 19208c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(uart4_eb, "uart4-eb", "ap-apb", 0x0, 19218c2ecf20Sopenharmony_ci 0x1000, BIT(18), CLK_IGNORE_UNUSED, 0); 19228c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(ap_ckg_eb, "ap-ckg-eb", "ap-apb", 0x0, 19238c2ecf20Sopenharmony_ci 0x1000, BIT(19), CLK_IGNORE_UNUSED, 0); 19248c2ecf20Sopenharmony_cistatic SPRD_SC_GATE_CLK(spi3_eb, "spi3-eb", "ap-apb", 0x0, 19258c2ecf20Sopenharmony_ci 0x1000, BIT(20), CLK_IGNORE_UNUSED, 0); 19268c2ecf20Sopenharmony_ci 19278c2ecf20Sopenharmony_cistatic struct sprd_clk_common *sc9860_apapb_gate[] = { 19288c2ecf20Sopenharmony_ci /* address base is 0x70b00000 */ 19298c2ecf20Sopenharmony_ci &sim0_eb.common, 19308c2ecf20Sopenharmony_ci &iis0_eb.common, 19318c2ecf20Sopenharmony_ci &iis1_eb.common, 19328c2ecf20Sopenharmony_ci &iis2_eb.common, 19338c2ecf20Sopenharmony_ci &iis3_eb.common, 19348c2ecf20Sopenharmony_ci &spi0_eb.common, 19358c2ecf20Sopenharmony_ci &spi1_eb.common, 19368c2ecf20Sopenharmony_ci &spi2_eb.common, 19378c2ecf20Sopenharmony_ci &i2c0_eb.common, 19388c2ecf20Sopenharmony_ci &i2c1_eb.common, 19398c2ecf20Sopenharmony_ci &i2c2_eb.common, 19408c2ecf20Sopenharmony_ci &i2c3_eb.common, 19418c2ecf20Sopenharmony_ci &i2c4_eb.common, 19428c2ecf20Sopenharmony_ci &i2c5_eb.common, 19438c2ecf20Sopenharmony_ci &uart0_eb.common, 19448c2ecf20Sopenharmony_ci &uart1_eb.common, 19458c2ecf20Sopenharmony_ci &uart2_eb.common, 19468c2ecf20Sopenharmony_ci &uart3_eb.common, 19478c2ecf20Sopenharmony_ci &uart4_eb.common, 19488c2ecf20Sopenharmony_ci &ap_ckg_eb.common, 19498c2ecf20Sopenharmony_ci &spi3_eb.common, 19508c2ecf20Sopenharmony_ci}; 19518c2ecf20Sopenharmony_ci 19528c2ecf20Sopenharmony_cistatic struct clk_hw_onecell_data sc9860_apapb_gate_hws = { 19538c2ecf20Sopenharmony_ci .hws = { 19548c2ecf20Sopenharmony_ci [CLK_SIM0_EB] = &sim0_eb.common.hw, 19558c2ecf20Sopenharmony_ci [CLK_IIS0_EB] = &iis0_eb.common.hw, 19568c2ecf20Sopenharmony_ci [CLK_IIS1_EB] = &iis1_eb.common.hw, 19578c2ecf20Sopenharmony_ci [CLK_IIS2_EB] = &iis2_eb.common.hw, 19588c2ecf20Sopenharmony_ci [CLK_IIS3_EB] = &iis3_eb.common.hw, 19598c2ecf20Sopenharmony_ci [CLK_SPI0_EB] = &spi0_eb.common.hw, 19608c2ecf20Sopenharmony_ci [CLK_SPI1_EB] = &spi1_eb.common.hw, 19618c2ecf20Sopenharmony_ci [CLK_SPI2_EB] = &spi2_eb.common.hw, 19628c2ecf20Sopenharmony_ci [CLK_I2C0_EB] = &i2c0_eb.common.hw, 19638c2ecf20Sopenharmony_ci [CLK_I2C1_EB] = &i2c1_eb.common.hw, 19648c2ecf20Sopenharmony_ci [CLK_I2C2_EB] = &i2c2_eb.common.hw, 19658c2ecf20Sopenharmony_ci [CLK_I2C3_EB] = &i2c3_eb.common.hw, 19668c2ecf20Sopenharmony_ci [CLK_I2C4_EB] = &i2c4_eb.common.hw, 19678c2ecf20Sopenharmony_ci [CLK_I2C5_EB] = &i2c5_eb.common.hw, 19688c2ecf20Sopenharmony_ci [CLK_UART0_EB] = &uart0_eb.common.hw, 19698c2ecf20Sopenharmony_ci [CLK_UART1_EB] = &uart1_eb.common.hw, 19708c2ecf20Sopenharmony_ci [CLK_UART2_EB] = &uart2_eb.common.hw, 19718c2ecf20Sopenharmony_ci [CLK_UART3_EB] = &uart3_eb.common.hw, 19728c2ecf20Sopenharmony_ci [CLK_UART4_EB] = &uart4_eb.common.hw, 19738c2ecf20Sopenharmony_ci [CLK_AP_CKG_EB] = &ap_ckg_eb.common.hw, 19748c2ecf20Sopenharmony_ci [CLK_SPI3_EB] = &spi3_eb.common.hw, 19758c2ecf20Sopenharmony_ci }, 19768c2ecf20Sopenharmony_ci .num = CLK_APAPB_GATE_NUM, 19778c2ecf20Sopenharmony_ci}; 19788c2ecf20Sopenharmony_ci 19798c2ecf20Sopenharmony_cistatic const struct sprd_clk_desc sc9860_apapb_gate_desc = { 19808c2ecf20Sopenharmony_ci .clk_clks = sc9860_apapb_gate, 19818c2ecf20Sopenharmony_ci .num_clk_clks = ARRAY_SIZE(sc9860_apapb_gate), 19828c2ecf20Sopenharmony_ci .hw_clks = &sc9860_apapb_gate_hws, 19838c2ecf20Sopenharmony_ci}; 19848c2ecf20Sopenharmony_ci 19858c2ecf20Sopenharmony_cistatic const struct of_device_id sprd_sc9860_clk_ids[] = { 19868c2ecf20Sopenharmony_ci { .compatible = "sprd,sc9860-pmu-gate", /* 0x402b */ 19878c2ecf20Sopenharmony_ci .data = &sc9860_pmu_gate_desc }, 19888c2ecf20Sopenharmony_ci { .compatible = "sprd,sc9860-pll", /* 0x4040 */ 19898c2ecf20Sopenharmony_ci .data = &sc9860_pll_desc }, 19908c2ecf20Sopenharmony_ci { .compatible = "sprd,sc9860-ap-clk", /* 0x2000 */ 19918c2ecf20Sopenharmony_ci .data = &sc9860_ap_clk_desc }, 19928c2ecf20Sopenharmony_ci { .compatible = "sprd,sc9860-aon-prediv", /* 0x402d */ 19938c2ecf20Sopenharmony_ci .data = &sc9860_aon_prediv_desc }, 19948c2ecf20Sopenharmony_ci { .compatible = "sprd,sc9860-apahb-gate", /* 0x2021 */ 19958c2ecf20Sopenharmony_ci .data = &sc9860_apahb_gate_desc }, 19968c2ecf20Sopenharmony_ci { .compatible = "sprd,sc9860-aon-gate", /* 0x402e */ 19978c2ecf20Sopenharmony_ci .data = &sc9860_aon_gate_desc }, 19988c2ecf20Sopenharmony_ci { .compatible = "sprd,sc9860-aonsecure-clk", /* 0x4088 */ 19998c2ecf20Sopenharmony_ci .data = &sc9860_aonsecure_clk_desc }, 20008c2ecf20Sopenharmony_ci { .compatible = "sprd,sc9860-agcp-gate", /* 0x415e */ 20018c2ecf20Sopenharmony_ci .data = &sc9860_agcp_gate_desc }, 20028c2ecf20Sopenharmony_ci { .compatible = "sprd,sc9860-gpu-clk", /* 0x6020 */ 20038c2ecf20Sopenharmony_ci .data = &sc9860_gpu_clk_desc }, 20048c2ecf20Sopenharmony_ci { .compatible = "sprd,sc9860-vsp-clk", /* 0x6100 */ 20058c2ecf20Sopenharmony_ci .data = &sc9860_vsp_clk_desc }, 20068c2ecf20Sopenharmony_ci { .compatible = "sprd,sc9860-vsp-gate", /* 0x6110 */ 20078c2ecf20Sopenharmony_ci .data = &sc9860_vsp_gate_desc }, 20088c2ecf20Sopenharmony_ci { .compatible = "sprd,sc9860-cam-clk", /* 0x6200 */ 20098c2ecf20Sopenharmony_ci .data = &sc9860_cam_clk_desc }, 20108c2ecf20Sopenharmony_ci { .compatible = "sprd,sc9860-cam-gate", /* 0x6210 */ 20118c2ecf20Sopenharmony_ci .data = &sc9860_cam_gate_desc }, 20128c2ecf20Sopenharmony_ci { .compatible = "sprd,sc9860-disp-clk", /* 0x6300 */ 20138c2ecf20Sopenharmony_ci .data = &sc9860_disp_clk_desc }, 20148c2ecf20Sopenharmony_ci { .compatible = "sprd,sc9860-disp-gate", /* 0x6310 */ 20158c2ecf20Sopenharmony_ci .data = &sc9860_disp_gate_desc }, 20168c2ecf20Sopenharmony_ci { .compatible = "sprd,sc9860-apapb-gate", /* 0x70b0 */ 20178c2ecf20Sopenharmony_ci .data = &sc9860_apapb_gate_desc }, 20188c2ecf20Sopenharmony_ci { } 20198c2ecf20Sopenharmony_ci}; 20208c2ecf20Sopenharmony_ciMODULE_DEVICE_TABLE(of, sprd_sc9860_clk_ids); 20218c2ecf20Sopenharmony_ci 20228c2ecf20Sopenharmony_cistatic int sc9860_clk_probe(struct platform_device *pdev) 20238c2ecf20Sopenharmony_ci{ 20248c2ecf20Sopenharmony_ci const struct of_device_id *match; 20258c2ecf20Sopenharmony_ci const struct sprd_clk_desc *desc; 20268c2ecf20Sopenharmony_ci int ret; 20278c2ecf20Sopenharmony_ci 20288c2ecf20Sopenharmony_ci match = of_match_node(sprd_sc9860_clk_ids, pdev->dev.of_node); 20298c2ecf20Sopenharmony_ci if (!match) { 20308c2ecf20Sopenharmony_ci pr_err("%s: of_match_node() failed", __func__); 20318c2ecf20Sopenharmony_ci return -ENODEV; 20328c2ecf20Sopenharmony_ci } 20338c2ecf20Sopenharmony_ci 20348c2ecf20Sopenharmony_ci desc = match->data; 20358c2ecf20Sopenharmony_ci ret = sprd_clk_regmap_init(pdev, desc); 20368c2ecf20Sopenharmony_ci if (ret) 20378c2ecf20Sopenharmony_ci return ret; 20388c2ecf20Sopenharmony_ci 20398c2ecf20Sopenharmony_ci return sprd_clk_probe(&pdev->dev, desc->hw_clks); 20408c2ecf20Sopenharmony_ci} 20418c2ecf20Sopenharmony_ci 20428c2ecf20Sopenharmony_cistatic struct platform_driver sc9860_clk_driver = { 20438c2ecf20Sopenharmony_ci .probe = sc9860_clk_probe, 20448c2ecf20Sopenharmony_ci .driver = { 20458c2ecf20Sopenharmony_ci .name = "sc9860-clk", 20468c2ecf20Sopenharmony_ci .of_match_table = sprd_sc9860_clk_ids, 20478c2ecf20Sopenharmony_ci }, 20488c2ecf20Sopenharmony_ci}; 20498c2ecf20Sopenharmony_cimodule_platform_driver(sc9860_clk_driver); 20508c2ecf20Sopenharmony_ci 20518c2ecf20Sopenharmony_ciMODULE_DESCRIPTION("Spreadtrum SC9860 Clock Driver"); 20528c2ecf20Sopenharmony_ciMODULE_LICENSE("GPL v2"); 20538c2ecf20Sopenharmony_ciMODULE_ALIAS("platform:sc9860-clk"); 2054