18c2ecf20Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0-or-later 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * Copyright (c) 2019 Rockchip Electronics Co. Ltd. 48c2ecf20Sopenharmony_ci * Author: Finley Xiao <finley.xiao@rock-chips.com> 58c2ecf20Sopenharmony_ci */ 68c2ecf20Sopenharmony_ci 78c2ecf20Sopenharmony_ci#include <linux/clk-provider.h> 88c2ecf20Sopenharmony_ci#include <linux/io.h> 98c2ecf20Sopenharmony_ci#include <linux/of.h> 108c2ecf20Sopenharmony_ci#include <linux/of_address.h> 118c2ecf20Sopenharmony_ci#include <linux/syscore_ops.h> 128c2ecf20Sopenharmony_ci#include <dt-bindings/clock/rk3308-cru.h> 138c2ecf20Sopenharmony_ci#include "clk.h" 148c2ecf20Sopenharmony_ci 158c2ecf20Sopenharmony_ci#define RK3308_GRF_SOC_STATUS0 0x380 168c2ecf20Sopenharmony_ci 178c2ecf20Sopenharmony_cienum rk3308_plls { 188c2ecf20Sopenharmony_ci apll, dpll, vpll0, vpll1, 198c2ecf20Sopenharmony_ci}; 208c2ecf20Sopenharmony_ci 218c2ecf20Sopenharmony_cistatic struct rockchip_pll_rate_table rk3308_pll_rates[] = { 228c2ecf20Sopenharmony_ci /* _mhz, _refdiv, _fbdiv, _postdiv1, _postdiv2, _dsmpd, _frac */ 238c2ecf20Sopenharmony_ci RK3036_PLL_RATE(1608000000, 1, 67, 1, 1, 1, 0), 248c2ecf20Sopenharmony_ci RK3036_PLL_RATE(1584000000, 1, 66, 1, 1, 1, 0), 258c2ecf20Sopenharmony_ci RK3036_PLL_RATE(1560000000, 1, 65, 1, 1, 1, 0), 268c2ecf20Sopenharmony_ci RK3036_PLL_RATE(1536000000, 1, 64, 1, 1, 1, 0), 278c2ecf20Sopenharmony_ci RK3036_PLL_RATE(1512000000, 1, 63, 1, 1, 1, 0), 288c2ecf20Sopenharmony_ci RK3036_PLL_RATE(1488000000, 1, 62, 1, 1, 1, 0), 298c2ecf20Sopenharmony_ci RK3036_PLL_RATE(1464000000, 1, 61, 1, 1, 1, 0), 308c2ecf20Sopenharmony_ci RK3036_PLL_RATE(1440000000, 1, 60, 1, 1, 1, 0), 318c2ecf20Sopenharmony_ci RK3036_PLL_RATE(1416000000, 1, 59, 1, 1, 1, 0), 328c2ecf20Sopenharmony_ci RK3036_PLL_RATE(1392000000, 1, 58, 1, 1, 1, 0), 338c2ecf20Sopenharmony_ci RK3036_PLL_RATE(1368000000, 1, 57, 1, 1, 1, 0), 348c2ecf20Sopenharmony_ci RK3036_PLL_RATE(1344000000, 1, 56, 1, 1, 1, 0), 358c2ecf20Sopenharmony_ci RK3036_PLL_RATE(1320000000, 1, 55, 1, 1, 1, 0), 368c2ecf20Sopenharmony_ci RK3036_PLL_RATE(1296000000, 1, 54, 1, 1, 1, 0), 378c2ecf20Sopenharmony_ci RK3036_PLL_RATE(1272000000, 1, 53, 1, 1, 1, 0), 388c2ecf20Sopenharmony_ci RK3036_PLL_RATE(1248000000, 1, 52, 1, 1, 1, 0), 398c2ecf20Sopenharmony_ci RK3036_PLL_RATE(1200000000, 1, 50, 1, 1, 1, 0), 408c2ecf20Sopenharmony_ci RK3036_PLL_RATE(1188000000, 2, 99, 1, 1, 1, 0), 418c2ecf20Sopenharmony_ci RK3036_PLL_RATE(1104000000, 1, 46, 1, 1, 1, 0), 428c2ecf20Sopenharmony_ci RK3036_PLL_RATE(1100000000, 12, 550, 1, 1, 1, 0), 438c2ecf20Sopenharmony_ci RK3036_PLL_RATE(1008000000, 1, 84, 2, 1, 1, 0), 448c2ecf20Sopenharmony_ci RK3036_PLL_RATE(1000000000, 6, 500, 2, 1, 1, 0), 458c2ecf20Sopenharmony_ci RK3036_PLL_RATE(984000000, 1, 82, 2, 1, 1, 0), 468c2ecf20Sopenharmony_ci RK3036_PLL_RATE(960000000, 1, 80, 2, 1, 1, 0), 478c2ecf20Sopenharmony_ci RK3036_PLL_RATE(936000000, 1, 78, 2, 1, 1, 0), 488c2ecf20Sopenharmony_ci RK3036_PLL_RATE(912000000, 1, 76, 2, 1, 1, 0), 498c2ecf20Sopenharmony_ci RK3036_PLL_RATE(900000000, 4, 300, 2, 1, 1, 0), 508c2ecf20Sopenharmony_ci RK3036_PLL_RATE(888000000, 1, 74, 2, 1, 1, 0), 518c2ecf20Sopenharmony_ci RK3036_PLL_RATE(864000000, 1, 72, 2, 1, 1, 0), 528c2ecf20Sopenharmony_ci RK3036_PLL_RATE(840000000, 1, 70, 2, 1, 1, 0), 538c2ecf20Sopenharmony_ci RK3036_PLL_RATE(816000000, 1, 68, 2, 1, 1, 0), 548c2ecf20Sopenharmony_ci RK3036_PLL_RATE(800000000, 6, 400, 2, 1, 1, 0), 558c2ecf20Sopenharmony_ci RK3036_PLL_RATE(700000000, 6, 350, 2, 1, 1, 0), 568c2ecf20Sopenharmony_ci RK3036_PLL_RATE(696000000, 1, 58, 2, 1, 1, 0), 578c2ecf20Sopenharmony_ci RK3036_PLL_RATE(624000000, 1, 52, 2, 1, 1, 0), 588c2ecf20Sopenharmony_ci RK3036_PLL_RATE(600000000, 1, 75, 3, 1, 1, 0), 598c2ecf20Sopenharmony_ci RK3036_PLL_RATE(594000000, 2, 99, 2, 1, 1, 0), 608c2ecf20Sopenharmony_ci RK3036_PLL_RATE(504000000, 1, 63, 3, 1, 1, 0), 618c2ecf20Sopenharmony_ci RK3036_PLL_RATE(500000000, 6, 250, 2, 1, 1, 0), 628c2ecf20Sopenharmony_ci RK3036_PLL_RATE(408000000, 1, 68, 2, 2, 1, 0), 638c2ecf20Sopenharmony_ci RK3036_PLL_RATE(312000000, 1, 52, 2, 2, 1, 0), 648c2ecf20Sopenharmony_ci RK3036_PLL_RATE(216000000, 1, 72, 4, 2, 1, 0), 658c2ecf20Sopenharmony_ci RK3036_PLL_RATE(96000000, 1, 64, 4, 4, 1, 0), 668c2ecf20Sopenharmony_ci { /* sentinel */ }, 678c2ecf20Sopenharmony_ci}; 688c2ecf20Sopenharmony_ci 698c2ecf20Sopenharmony_ci#define RK3308_DIV_ACLKM_MASK 0x7 708c2ecf20Sopenharmony_ci#define RK3308_DIV_ACLKM_SHIFT 12 718c2ecf20Sopenharmony_ci#define RK3308_DIV_PCLK_DBG_MASK 0xf 728c2ecf20Sopenharmony_ci#define RK3308_DIV_PCLK_DBG_SHIFT 8 738c2ecf20Sopenharmony_ci 748c2ecf20Sopenharmony_ci#define RK3308_CLKSEL0(_aclk_core, _pclk_dbg) \ 758c2ecf20Sopenharmony_ci{ \ 768c2ecf20Sopenharmony_ci .reg = RK3308_CLKSEL_CON(0), \ 778c2ecf20Sopenharmony_ci .val = HIWORD_UPDATE(_aclk_core, RK3308_DIV_ACLKM_MASK, \ 788c2ecf20Sopenharmony_ci RK3308_DIV_ACLKM_SHIFT) | \ 798c2ecf20Sopenharmony_ci HIWORD_UPDATE(_pclk_dbg, RK3308_DIV_PCLK_DBG_MASK, \ 808c2ecf20Sopenharmony_ci RK3308_DIV_PCLK_DBG_SHIFT), \ 818c2ecf20Sopenharmony_ci} 828c2ecf20Sopenharmony_ci 838c2ecf20Sopenharmony_ci#define RK3308_CPUCLK_RATE(_prate, _aclk_core, _pclk_dbg) \ 848c2ecf20Sopenharmony_ci{ \ 858c2ecf20Sopenharmony_ci .prate = _prate, \ 868c2ecf20Sopenharmony_ci .divs = { \ 878c2ecf20Sopenharmony_ci RK3308_CLKSEL0(_aclk_core, _pclk_dbg), \ 888c2ecf20Sopenharmony_ci }, \ 898c2ecf20Sopenharmony_ci} 908c2ecf20Sopenharmony_ci 918c2ecf20Sopenharmony_cistatic struct rockchip_cpuclk_rate_table rk3308_cpuclk_rates[] __initdata = { 928c2ecf20Sopenharmony_ci RK3308_CPUCLK_RATE(1608000000, 1, 7), 938c2ecf20Sopenharmony_ci RK3308_CPUCLK_RATE(1512000000, 1, 7), 948c2ecf20Sopenharmony_ci RK3308_CPUCLK_RATE(1488000000, 1, 5), 958c2ecf20Sopenharmony_ci RK3308_CPUCLK_RATE(1416000000, 1, 5), 968c2ecf20Sopenharmony_ci RK3308_CPUCLK_RATE(1392000000, 1, 5), 978c2ecf20Sopenharmony_ci RK3308_CPUCLK_RATE(1296000000, 1, 5), 988c2ecf20Sopenharmony_ci RK3308_CPUCLK_RATE(1200000000, 1, 5), 998c2ecf20Sopenharmony_ci RK3308_CPUCLK_RATE(1104000000, 1, 5), 1008c2ecf20Sopenharmony_ci RK3308_CPUCLK_RATE(1008000000, 1, 5), 1018c2ecf20Sopenharmony_ci RK3308_CPUCLK_RATE(912000000, 1, 5), 1028c2ecf20Sopenharmony_ci RK3308_CPUCLK_RATE(816000000, 1, 3), 1038c2ecf20Sopenharmony_ci RK3308_CPUCLK_RATE(696000000, 1, 3), 1048c2ecf20Sopenharmony_ci RK3308_CPUCLK_RATE(600000000, 1, 3), 1058c2ecf20Sopenharmony_ci RK3308_CPUCLK_RATE(408000000, 1, 1), 1068c2ecf20Sopenharmony_ci RK3308_CPUCLK_RATE(312000000, 1, 1), 1078c2ecf20Sopenharmony_ci RK3308_CPUCLK_RATE(216000000, 1, 1), 1088c2ecf20Sopenharmony_ci RK3308_CPUCLK_RATE(96000000, 1, 1), 1098c2ecf20Sopenharmony_ci}; 1108c2ecf20Sopenharmony_ci 1118c2ecf20Sopenharmony_cistatic const struct rockchip_cpuclk_reg_data rk3308_cpuclk_data = { 1128c2ecf20Sopenharmony_ci .core_reg = RK3308_CLKSEL_CON(0), 1138c2ecf20Sopenharmony_ci .div_core_shift = 0, 1148c2ecf20Sopenharmony_ci .div_core_mask = 0xf, 1158c2ecf20Sopenharmony_ci .mux_core_alt = 1, 1168c2ecf20Sopenharmony_ci .mux_core_main = 0, 1178c2ecf20Sopenharmony_ci .mux_core_shift = 6, 1188c2ecf20Sopenharmony_ci .mux_core_mask = 0x3, 1198c2ecf20Sopenharmony_ci}; 1208c2ecf20Sopenharmony_ci 1218c2ecf20Sopenharmony_ciPNAME(mux_pll_p) = { "xin24m" }; 1228c2ecf20Sopenharmony_ciPNAME(mux_usb480m_p) = { "xin24m", "usb480m_phy", "clk_rtc32k" }; 1238c2ecf20Sopenharmony_ciPNAME(mux_armclk_p) = { "apll_core", "vpll0_core", "vpll1_core" }; 1248c2ecf20Sopenharmony_ciPNAME(mux_dpll_vpll0_p) = { "dpll", "vpll0" }; 1258c2ecf20Sopenharmony_ciPNAME(mux_dpll_vpll0_xin24m_p) = { "dpll", "vpll0", "xin24m" }; 1268c2ecf20Sopenharmony_ciPNAME(mux_dpll_vpll0_vpll1_p) = { "dpll", "vpll0", "vpll1" }; 1278c2ecf20Sopenharmony_ciPNAME(mux_dpll_vpll0_vpll1_xin24m_p) = { "dpll", "vpll0", "vpll1", "xin24m" }; 1288c2ecf20Sopenharmony_ciPNAME(mux_dpll_vpll0_vpll1_usb480m_xin24m_p) = { "dpll", "vpll0", "vpll1", "usb480m", "xin24m" }; 1298c2ecf20Sopenharmony_ciPNAME(mux_vpll0_vpll1_p) = { "vpll0", "vpll1" }; 1308c2ecf20Sopenharmony_ciPNAME(mux_vpll0_vpll1_xin24m_p) = { "vpll0", "vpll1", "xin24m" }; 1318c2ecf20Sopenharmony_ciPNAME(mux_uart0_p) = { "clk_uart0_src", "dummy", "clk_uart0_frac" }; 1328c2ecf20Sopenharmony_ciPNAME(mux_uart1_p) = { "clk_uart1_src", "dummy", "clk_uart1_frac" }; 1338c2ecf20Sopenharmony_ciPNAME(mux_uart2_p) = { "clk_uart2_src", "dummy", "clk_uart2_frac" }; 1348c2ecf20Sopenharmony_ciPNAME(mux_uart3_p) = { "clk_uart3_src", "dummy", "clk_uart3_frac" }; 1358c2ecf20Sopenharmony_ciPNAME(mux_uart4_p) = { "clk_uart4_src", "dummy", "clk_uart4_frac" }; 1368c2ecf20Sopenharmony_ciPNAME(mux_dclk_vop_p) = { "dclk_vop_src", "dclk_vop_frac", "xin24m" }; 1378c2ecf20Sopenharmony_ciPNAME(mux_nandc_p) = { "clk_nandc_div", "clk_nandc_div50" }; 1388c2ecf20Sopenharmony_ciPNAME(mux_sdmmc_p) = { "clk_sdmmc_div", "clk_sdmmc_div50" }; 1398c2ecf20Sopenharmony_ciPNAME(mux_sdio_p) = { "clk_sdio_div", "clk_sdio_div50" }; 1408c2ecf20Sopenharmony_ciPNAME(mux_emmc_p) = { "clk_emmc_div", "clk_emmc_div50" }; 1418c2ecf20Sopenharmony_ciPNAME(mux_mac_p) = { "clk_mac_src", "mac_clkin" }; 1428c2ecf20Sopenharmony_ciPNAME(mux_mac_rmii_sel_p) = { "clk_mac_rx_tx_div20", "clk_mac_rx_tx_div2" }; 1438c2ecf20Sopenharmony_ciPNAME(mux_ddrstdby_p) = { "clk_ddrphy1x_out", "clk_ddr_stdby_div4" }; 1448c2ecf20Sopenharmony_ciPNAME(mux_rtc32k_p) = { "xin32k", "clk_pvtm_32k", "clk_rtc32k_frac", "clk_rtc32k_div" }; 1458c2ecf20Sopenharmony_ciPNAME(mux_usbphy_ref_p) = { "xin24m", "clk_usbphy_ref_src" }; 1468c2ecf20Sopenharmony_ciPNAME(mux_wifi_src_p) = { "clk_wifi_dpll", "clk_wifi_vpll0" }; 1478c2ecf20Sopenharmony_ciPNAME(mux_wifi_p) = { "clk_wifi_osc", "clk_wifi_src" }; 1488c2ecf20Sopenharmony_ciPNAME(mux_pdm_p) = { "clk_pdm_src", "clk_pdm_frac" }; 1498c2ecf20Sopenharmony_ciPNAME(mux_i2s0_8ch_tx_p) = { "clk_i2s0_8ch_tx_src", "clk_i2s0_8ch_tx_frac", "mclk_i2s0_8ch_in" }; 1508c2ecf20Sopenharmony_ciPNAME(mux_i2s0_8ch_tx_rx_p) = { "clk_i2s0_8ch_tx_mux", "clk_i2s0_8ch_rx_mux"}; 1518c2ecf20Sopenharmony_ciPNAME(mux_i2s0_8ch_tx_out_p) = { "clk_i2s0_8ch_tx", "xin12m" }; 1528c2ecf20Sopenharmony_ciPNAME(mux_i2s0_8ch_rx_p) = { "clk_i2s0_8ch_rx_src", "clk_i2s0_8ch_rx_frac", "mclk_i2s0_8ch_in" }; 1538c2ecf20Sopenharmony_ciPNAME(mux_i2s0_8ch_rx_tx_p) = { "clk_i2s0_8ch_rx_mux", "clk_i2s0_8ch_tx_mux"}; 1548c2ecf20Sopenharmony_ciPNAME(mux_i2s1_8ch_tx_p) = { "clk_i2s1_8ch_tx_src", "clk_i2s1_8ch_tx_frac", "mclk_i2s1_8ch_in" }; 1558c2ecf20Sopenharmony_ciPNAME(mux_i2s1_8ch_tx_rx_p) = { "clk_i2s1_8ch_tx_mux", "clk_i2s1_8ch_rx_mux"}; 1568c2ecf20Sopenharmony_ciPNAME(mux_i2s1_8ch_tx_out_p) = { "clk_i2s1_8ch_tx", "xin12m" }; 1578c2ecf20Sopenharmony_ciPNAME(mux_i2s1_8ch_rx_p) = { "clk_i2s1_8ch_rx_src", "clk_i2s1_8ch_rx_frac", "mclk_i2s1_8ch_in" }; 1588c2ecf20Sopenharmony_ciPNAME(mux_i2s1_8ch_rx_tx_p) = { "clk_i2s1_8ch_rx_mux", "clk_i2s1_8ch_tx_mux"}; 1598c2ecf20Sopenharmony_ciPNAME(mux_i2s2_8ch_tx_p) = { "clk_i2s2_8ch_tx_src", "clk_i2s2_8ch_tx_frac", "mclk_i2s2_8ch_in" }; 1608c2ecf20Sopenharmony_ciPNAME(mux_i2s2_8ch_tx_rx_p) = { "clk_i2s2_8ch_tx_mux", "clk_i2s2_8ch_rx_mux"}; 1618c2ecf20Sopenharmony_ciPNAME(mux_i2s2_8ch_tx_out_p) = { "clk_i2s2_8ch_tx", "xin12m" }; 1628c2ecf20Sopenharmony_ciPNAME(mux_i2s2_8ch_rx_p) = { "clk_i2s2_8ch_rx_src", "clk_i2s2_8ch_rx_frac", "mclk_i2s2_8ch_in" }; 1638c2ecf20Sopenharmony_ciPNAME(mux_i2s2_8ch_rx_tx_p) = { "clk_i2s2_8ch_rx_mux", "clk_i2s2_8ch_tx_mux"}; 1648c2ecf20Sopenharmony_ciPNAME(mux_i2s3_8ch_tx_p) = { "clk_i2s3_8ch_tx_src", "clk_i2s3_8ch_tx_frac", "mclk_i2s3_8ch_in" }; 1658c2ecf20Sopenharmony_ciPNAME(mux_i2s3_8ch_tx_rx_p) = { "clk_i2s3_8ch_tx_mux", "clk_i2s3_8ch_rx_mux"}; 1668c2ecf20Sopenharmony_ciPNAME(mux_i2s3_8ch_tx_out_p) = { "clk_i2s3_8ch_tx", "xin12m" }; 1678c2ecf20Sopenharmony_ciPNAME(mux_i2s3_8ch_rx_p) = { "clk_i2s3_8ch_rx_src", "clk_i2s3_8ch_rx_frac", "mclk_i2s3_8ch_in" }; 1688c2ecf20Sopenharmony_ciPNAME(mux_i2s3_8ch_rx_tx_p) = { "clk_i2s3_8ch_rx_mux", "clk_i2s3_8ch_tx_mux"}; 1698c2ecf20Sopenharmony_ciPNAME(mux_i2s0_2ch_p) = { "clk_i2s0_2ch_src", "clk_i2s0_2ch_frac", "mclk_i2s0_2ch_in" }; 1708c2ecf20Sopenharmony_ciPNAME(mux_i2s0_2ch_out_p) = { "clk_i2s0_2ch", "xin12m" }; 1718c2ecf20Sopenharmony_ciPNAME(mux_i2s1_2ch_p) = { "clk_i2s1_2ch_src", "clk_i2s1_2ch_frac", "mclk_i2s1_2ch_in"}; 1728c2ecf20Sopenharmony_ciPNAME(mux_i2s1_2ch_out_p) = { "clk_i2s1_2ch", "xin12m" }; 1738c2ecf20Sopenharmony_ciPNAME(mux_spdif_tx_src_p) = { "clk_spdif_tx_div", "clk_spdif_tx_div50" }; 1748c2ecf20Sopenharmony_ciPNAME(mux_spdif_tx_p) = { "clk_spdif_tx_src", "clk_spdif_tx_frac", "mclk_i2s0_2ch_in" }; 1758c2ecf20Sopenharmony_ciPNAME(mux_spdif_rx_src_p) = { "clk_spdif_rx_div", "clk_spdif_rx_div50" }; 1768c2ecf20Sopenharmony_ciPNAME(mux_spdif_rx_p) = { "clk_spdif_rx_src", "clk_spdif_rx_frac" }; 1778c2ecf20Sopenharmony_ci 1788c2ecf20Sopenharmony_cistatic struct rockchip_pll_clock rk3308_pll_clks[] __initdata = { 1798c2ecf20Sopenharmony_ci [apll] = PLL(pll_rk3328, PLL_APLL, "apll", mux_pll_p, 1808c2ecf20Sopenharmony_ci 0, RK3308_PLL_CON(0), 1818c2ecf20Sopenharmony_ci RK3308_MODE_CON, 0, 0, 0, rk3308_pll_rates), 1828c2ecf20Sopenharmony_ci [dpll] = PLL(pll_rk3328, PLL_DPLL, "dpll", mux_pll_p, 1838c2ecf20Sopenharmony_ci 0, RK3308_PLL_CON(8), 1848c2ecf20Sopenharmony_ci RK3308_MODE_CON, 2, 1, 0, rk3308_pll_rates), 1858c2ecf20Sopenharmony_ci [vpll0] = PLL(pll_rk3328, PLL_VPLL0, "vpll0", mux_pll_p, 1868c2ecf20Sopenharmony_ci 0, RK3308_PLL_CON(16), 1878c2ecf20Sopenharmony_ci RK3308_MODE_CON, 4, 2, 0, rk3308_pll_rates), 1888c2ecf20Sopenharmony_ci [vpll1] = PLL(pll_rk3328, PLL_VPLL1, "vpll1", mux_pll_p, 1898c2ecf20Sopenharmony_ci 0, RK3308_PLL_CON(24), 1908c2ecf20Sopenharmony_ci RK3308_MODE_CON, 6, 3, 0, rk3308_pll_rates), 1918c2ecf20Sopenharmony_ci}; 1928c2ecf20Sopenharmony_ci 1938c2ecf20Sopenharmony_ci#define MFLAGS CLK_MUX_HIWORD_MASK 1948c2ecf20Sopenharmony_ci#define DFLAGS CLK_DIVIDER_HIWORD_MASK 1958c2ecf20Sopenharmony_ci#define GFLAGS (CLK_GATE_HIWORD_MASK | CLK_GATE_SET_TO_DISABLE) 1968c2ecf20Sopenharmony_ci 1978c2ecf20Sopenharmony_cistatic struct rockchip_clk_branch rk3308_uart0_fracmux __initdata = 1988c2ecf20Sopenharmony_ci MUX(0, "clk_uart0_mux", mux_uart0_p, CLK_SET_RATE_PARENT, 1998c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(11), 14, 2, MFLAGS); 2008c2ecf20Sopenharmony_ci 2018c2ecf20Sopenharmony_cistatic struct rockchip_clk_branch rk3308_uart1_fracmux __initdata = 2028c2ecf20Sopenharmony_ci MUX(0, "clk_uart1_mux", mux_uart1_p, CLK_SET_RATE_PARENT, 2038c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(14), 14, 2, MFLAGS); 2048c2ecf20Sopenharmony_ci 2058c2ecf20Sopenharmony_cistatic struct rockchip_clk_branch rk3308_uart2_fracmux __initdata = 2068c2ecf20Sopenharmony_ci MUX(0, "clk_uart2_mux", mux_uart2_p, CLK_SET_RATE_PARENT, 2078c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(17), 14, 2, MFLAGS); 2088c2ecf20Sopenharmony_ci 2098c2ecf20Sopenharmony_cistatic struct rockchip_clk_branch rk3308_uart3_fracmux __initdata = 2108c2ecf20Sopenharmony_ci MUX(0, "clk_uart3_mux", mux_uart3_p, CLK_SET_RATE_PARENT, 2118c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(20), 14, 2, MFLAGS); 2128c2ecf20Sopenharmony_ci 2138c2ecf20Sopenharmony_cistatic struct rockchip_clk_branch rk3308_uart4_fracmux __initdata = 2148c2ecf20Sopenharmony_ci MUX(0, "clk_uart4_mux", mux_uart4_p, CLK_SET_RATE_PARENT, 2158c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(23), 14, 2, MFLAGS); 2168c2ecf20Sopenharmony_ci 2178c2ecf20Sopenharmony_cistatic struct rockchip_clk_branch rk3308_dclk_vop_fracmux __initdata = 2188c2ecf20Sopenharmony_ci MUX(0, "dclk_vop_mux", mux_dclk_vop_p, CLK_SET_RATE_PARENT, 2198c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(8), 14, 2, MFLAGS); 2208c2ecf20Sopenharmony_ci 2218c2ecf20Sopenharmony_cistatic struct rockchip_clk_branch rk3308_rtc32k_fracmux __initdata = 2228c2ecf20Sopenharmony_ci MUX(SCLK_RTC32K, "clk_rtc32k", mux_rtc32k_p, CLK_SET_RATE_PARENT, 2238c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(2), 8, 2, MFLAGS); 2248c2ecf20Sopenharmony_ci 2258c2ecf20Sopenharmony_cistatic struct rockchip_clk_branch rk3308_pdm_fracmux __initdata = 2268c2ecf20Sopenharmony_ci MUX(0, "clk_pdm_mux", mux_pdm_p, CLK_SET_RATE_PARENT, 2278c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(46), 15, 1, MFLAGS); 2288c2ecf20Sopenharmony_ci 2298c2ecf20Sopenharmony_cistatic struct rockchip_clk_branch rk3308_i2s0_8ch_tx_fracmux __initdata = 2308c2ecf20Sopenharmony_ci MUX(SCLK_I2S0_8CH_TX_MUX, "clk_i2s0_8ch_tx_mux", mux_i2s0_8ch_tx_p, CLK_SET_RATE_PARENT, 2318c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(52), 10, 2, MFLAGS); 2328c2ecf20Sopenharmony_ci 2338c2ecf20Sopenharmony_cistatic struct rockchip_clk_branch rk3308_i2s0_8ch_rx_fracmux __initdata = 2348c2ecf20Sopenharmony_ci MUX(SCLK_I2S0_8CH_RX_MUX, "clk_i2s0_8ch_rx_mux", mux_i2s0_8ch_rx_p, CLK_SET_RATE_PARENT, 2358c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(54), 10, 2, MFLAGS); 2368c2ecf20Sopenharmony_ci 2378c2ecf20Sopenharmony_cistatic struct rockchip_clk_branch rk3308_i2s1_8ch_tx_fracmux __initdata = 2388c2ecf20Sopenharmony_ci MUX(SCLK_I2S1_8CH_TX_MUX, "clk_i2s1_8ch_tx_mux", mux_i2s1_8ch_tx_p, CLK_SET_RATE_PARENT, 2398c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(56), 10, 2, MFLAGS); 2408c2ecf20Sopenharmony_ci 2418c2ecf20Sopenharmony_cistatic struct rockchip_clk_branch rk3308_i2s1_8ch_rx_fracmux __initdata = 2428c2ecf20Sopenharmony_ci MUX(SCLK_I2S1_8CH_RX_MUX, "clk_i2s1_8ch_rx_mux", mux_i2s1_8ch_rx_p, CLK_SET_RATE_PARENT, 2438c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(58), 10, 2, MFLAGS); 2448c2ecf20Sopenharmony_ci 2458c2ecf20Sopenharmony_cistatic struct rockchip_clk_branch rk3308_i2s2_8ch_tx_fracmux __initdata = 2468c2ecf20Sopenharmony_ci MUX(SCLK_I2S2_8CH_TX_MUX, "clk_i2s2_8ch_tx_mux", mux_i2s2_8ch_tx_p, CLK_SET_RATE_PARENT, 2478c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(60), 10, 2, MFLAGS); 2488c2ecf20Sopenharmony_ci 2498c2ecf20Sopenharmony_cistatic struct rockchip_clk_branch rk3308_i2s2_8ch_rx_fracmux __initdata = 2508c2ecf20Sopenharmony_ci MUX(SCLK_I2S2_8CH_RX_MUX, "clk_i2s2_8ch_rx_mux", mux_i2s2_8ch_rx_p, CLK_SET_RATE_PARENT, 2518c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(62), 10, 2, MFLAGS); 2528c2ecf20Sopenharmony_ci 2538c2ecf20Sopenharmony_cistatic struct rockchip_clk_branch rk3308_i2s3_8ch_tx_fracmux __initdata = 2548c2ecf20Sopenharmony_ci MUX(SCLK_I2S3_8CH_TX_MUX, "clk_i2s3_8ch_tx_mux", mux_i2s3_8ch_tx_p, CLK_SET_RATE_PARENT, 2558c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(64), 10, 2, MFLAGS); 2568c2ecf20Sopenharmony_ci 2578c2ecf20Sopenharmony_cistatic struct rockchip_clk_branch rk3308_i2s3_8ch_rx_fracmux __initdata = 2588c2ecf20Sopenharmony_ci MUX(SCLK_I2S3_8CH_RX_MUX, "clk_i2s3_8ch_rx_mux", mux_i2s3_8ch_rx_p, CLK_SET_RATE_PARENT, 2598c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(66), 10, 2, MFLAGS); 2608c2ecf20Sopenharmony_ci 2618c2ecf20Sopenharmony_cistatic struct rockchip_clk_branch rk3308_i2s0_2ch_fracmux __initdata = 2628c2ecf20Sopenharmony_ci MUX(0, "clk_i2s0_2ch_mux", mux_i2s0_2ch_p, CLK_SET_RATE_PARENT, 2638c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(68), 10, 2, MFLAGS); 2648c2ecf20Sopenharmony_ci 2658c2ecf20Sopenharmony_cistatic struct rockchip_clk_branch rk3308_i2s1_2ch_fracmux __initdata = 2668c2ecf20Sopenharmony_ci MUX(0, "clk_i2s1_2ch_mux", mux_i2s1_2ch_p, CLK_SET_RATE_PARENT, 2678c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(70), 10, 2, MFLAGS); 2688c2ecf20Sopenharmony_ci 2698c2ecf20Sopenharmony_cistatic struct rockchip_clk_branch rk3308_spdif_tx_fracmux __initdata = 2708c2ecf20Sopenharmony_ci MUX(0, "clk_spdif_tx_mux", mux_spdif_tx_p, CLK_SET_RATE_PARENT, 2718c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(48), 14, 2, MFLAGS); 2728c2ecf20Sopenharmony_ci 2738c2ecf20Sopenharmony_cistatic struct rockchip_clk_branch rk3308_spdif_rx_fracmux __initdata = 2748c2ecf20Sopenharmony_ci MUX(0, "clk_spdif_rx_mux", mux_spdif_rx_p, CLK_SET_RATE_PARENT, 2758c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(50), 15, 1, MFLAGS); 2768c2ecf20Sopenharmony_ci 2778c2ecf20Sopenharmony_ci 2788c2ecf20Sopenharmony_cistatic struct rockchip_clk_branch rk3308_clk_branches[] __initdata = { 2798c2ecf20Sopenharmony_ci /* 2808c2ecf20Sopenharmony_ci * Clock-Architecture Diagram 1 2818c2ecf20Sopenharmony_ci */ 2828c2ecf20Sopenharmony_ci 2838c2ecf20Sopenharmony_ci MUX(USB480M, "usb480m", mux_usb480m_p, CLK_SET_RATE_PARENT, 2848c2ecf20Sopenharmony_ci RK3308_MODE_CON, 8, 2, MFLAGS), 2858c2ecf20Sopenharmony_ci FACTOR(0, "xin12m", "xin24m", 0, 1, 2), 2868c2ecf20Sopenharmony_ci 2878c2ecf20Sopenharmony_ci /* 2888c2ecf20Sopenharmony_ci * Clock-Architecture Diagram 2 2898c2ecf20Sopenharmony_ci */ 2908c2ecf20Sopenharmony_ci 2918c2ecf20Sopenharmony_ci GATE(0, "apll_core", "apll", CLK_IGNORE_UNUSED, 2928c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(0), 0, GFLAGS), 2938c2ecf20Sopenharmony_ci GATE(0, "vpll0_core", "vpll0", CLK_IGNORE_UNUSED, 2948c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(0), 0, GFLAGS), 2958c2ecf20Sopenharmony_ci GATE(0, "vpll1_core", "vpll1", CLK_IGNORE_UNUSED, 2968c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(0), 0, GFLAGS), 2978c2ecf20Sopenharmony_ci COMPOSITE_NOMUX(0, "pclk_core_dbg", "armclk", CLK_IGNORE_UNUSED, 2988c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(0), 8, 4, DFLAGS | CLK_DIVIDER_READ_ONLY, 2998c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(0), 2, GFLAGS), 3008c2ecf20Sopenharmony_ci COMPOSITE_NOMUX(0, "aclk_core", "armclk", CLK_IGNORE_UNUSED, 3018c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(0), 12, 3, DFLAGS | CLK_DIVIDER_READ_ONLY, 3028c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(0), 1, GFLAGS), 3038c2ecf20Sopenharmony_ci 3048c2ecf20Sopenharmony_ci GATE(0, "clk_jtag", "jtag_clkin", CLK_IGNORE_UNUSED, 3058c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(0), 3, GFLAGS), 3068c2ecf20Sopenharmony_ci 3078c2ecf20Sopenharmony_ci GATE(SCLK_PVTM_CORE, "clk_pvtm_core", "xin24m", 0, 3088c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(0), 4, GFLAGS), 3098c2ecf20Sopenharmony_ci 3108c2ecf20Sopenharmony_ci /* 3118c2ecf20Sopenharmony_ci * Clock-Architecture Diagram 3 3128c2ecf20Sopenharmony_ci */ 3138c2ecf20Sopenharmony_ci 3148c2ecf20Sopenharmony_ci COMPOSITE_NODIV(ACLK_BUS_SRC, "clk_bus_src", mux_dpll_vpll0_vpll1_p, CLK_IGNORE_UNUSED, 3158c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(5), 6, 2, MFLAGS, 3168c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(1), 0, GFLAGS), 3178c2ecf20Sopenharmony_ci COMPOSITE_NOMUX(PCLK_BUS, "pclk_bus", "clk_bus_src", CLK_IGNORE_UNUSED, 3188c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(6), 8, 5, DFLAGS, 3198c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(1), 3, GFLAGS), 3208c2ecf20Sopenharmony_ci GATE(PCLK_DDR, "pclk_ddr", "pclk_bus", CLK_IGNORE_UNUSED, 3218c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(4), 15, GFLAGS), 3228c2ecf20Sopenharmony_ci COMPOSITE_NOMUX(HCLK_BUS, "hclk_bus", "clk_bus_src", CLK_IGNORE_UNUSED, 3238c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(6), 0, 5, DFLAGS, 3248c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(1), 2, GFLAGS), 3258c2ecf20Sopenharmony_ci COMPOSITE_NOMUX(ACLK_BUS, "aclk_bus", "clk_bus_src", CLK_IGNORE_UNUSED, 3268c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(5), 0, 5, DFLAGS, 3278c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(1), 1, GFLAGS), 3288c2ecf20Sopenharmony_ci 3298c2ecf20Sopenharmony_ci COMPOSITE(0, "clk_uart0_src", mux_dpll_vpll0_vpll1_usb480m_xin24m_p, 0, 3308c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(10), 13, 3, MFLAGS, 0, 5, DFLAGS, 3318c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(1), 9, GFLAGS), 3328c2ecf20Sopenharmony_ci COMPOSITE_FRACMUX(0, "clk_uart0_frac", "clk_uart0_src", CLK_SET_RATE_PARENT, 3338c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(12), 0, 3348c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(1), 11, GFLAGS, 3358c2ecf20Sopenharmony_ci &rk3308_uart0_fracmux), 3368c2ecf20Sopenharmony_ci GATE(SCLK_UART0, "clk_uart0", "clk_uart0_mux", 0, 3378c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(1), 12, GFLAGS), 3388c2ecf20Sopenharmony_ci 3398c2ecf20Sopenharmony_ci COMPOSITE(0, "clk_uart1_src", mux_dpll_vpll0_vpll1_usb480m_xin24m_p, 0, 3408c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(13), 13, 3, MFLAGS, 0, 5, DFLAGS, 3418c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(1), 13, GFLAGS), 3428c2ecf20Sopenharmony_ci COMPOSITE_FRACMUX(0, "clk_uart1_frac", "clk_uart1_src", CLK_SET_RATE_PARENT, 3438c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(15), 0, 3448c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(1), 15, GFLAGS, 3458c2ecf20Sopenharmony_ci &rk3308_uart1_fracmux), 3468c2ecf20Sopenharmony_ci GATE(SCLK_UART1, "clk_uart1", "clk_uart1_mux", 0, 3478c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(2), 0, GFLAGS), 3488c2ecf20Sopenharmony_ci 3498c2ecf20Sopenharmony_ci COMPOSITE(0, "clk_uart2_src", mux_dpll_vpll0_vpll1_usb480m_xin24m_p, 0, 3508c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(16), 13, 3, MFLAGS, 0, 5, DFLAGS, 3518c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(2), 1, GFLAGS), 3528c2ecf20Sopenharmony_ci COMPOSITE_FRACMUX(0, "clk_uart2_frac", "clk_uart2_src", CLK_SET_RATE_PARENT, 3538c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(18), 0, 3548c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(2), 3, GFLAGS, 3558c2ecf20Sopenharmony_ci &rk3308_uart2_fracmux), 3568c2ecf20Sopenharmony_ci GATE(SCLK_UART2, "clk_uart2", "clk_uart2_mux", CLK_SET_RATE_PARENT, 3578c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(2), 4, GFLAGS), 3588c2ecf20Sopenharmony_ci 3598c2ecf20Sopenharmony_ci COMPOSITE(0, "clk_uart3_src", mux_dpll_vpll0_vpll1_usb480m_xin24m_p, 0, 3608c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(19), 13, 3, MFLAGS, 0, 5, DFLAGS, 3618c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(2), 5, GFLAGS), 3628c2ecf20Sopenharmony_ci COMPOSITE_FRACMUX(0, "clk_uart3_frac", "clk_uart3_src", CLK_SET_RATE_PARENT, 3638c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(21), 0, 3648c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(2), 7, GFLAGS, 3658c2ecf20Sopenharmony_ci &rk3308_uart3_fracmux), 3668c2ecf20Sopenharmony_ci GATE(SCLK_UART3, "clk_uart3", "clk_uart3_mux", 0, 3678c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(2), 8, GFLAGS), 3688c2ecf20Sopenharmony_ci 3698c2ecf20Sopenharmony_ci COMPOSITE(0, "clk_uart4_src", mux_dpll_vpll0_vpll1_usb480m_xin24m_p, 0, 3708c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(22), 13, 3, MFLAGS, 0, 5, DFLAGS, 3718c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(2), 9, GFLAGS), 3728c2ecf20Sopenharmony_ci COMPOSITE_FRACMUX(0, "clk_uart4_frac", "clk_uart4_src", CLK_SET_RATE_PARENT, 3738c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(24), 0, 3748c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(2), 11, GFLAGS, 3758c2ecf20Sopenharmony_ci &rk3308_uart4_fracmux), 3768c2ecf20Sopenharmony_ci GATE(SCLK_UART4, "clk_uart4", "clk_uart4_mux", 0, 3778c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(2), 12, GFLAGS), 3788c2ecf20Sopenharmony_ci 3798c2ecf20Sopenharmony_ci COMPOSITE(SCLK_I2C0, "clk_i2c0", mux_dpll_vpll0_xin24m_p, 0, 3808c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(25), 14, 2, MFLAGS, 0, 7, DFLAGS, 3818c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(2), 13, GFLAGS), 3828c2ecf20Sopenharmony_ci COMPOSITE(SCLK_I2C1, "clk_i2c1", mux_dpll_vpll0_xin24m_p, 0, 3838c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(26), 14, 2, MFLAGS, 0, 7, DFLAGS, 3848c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(2), 14, GFLAGS), 3858c2ecf20Sopenharmony_ci COMPOSITE(SCLK_I2C2, "clk_i2c2", mux_dpll_vpll0_xin24m_p, 0, 3868c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(27), 14, 2, MFLAGS, 0, 7, DFLAGS, 3878c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(2), 15, GFLAGS), 3888c2ecf20Sopenharmony_ci COMPOSITE(SCLK_I2C3, "clk_i2c3", mux_dpll_vpll0_xin24m_p, 0, 3898c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(28), 14, 2, MFLAGS, 0, 7, DFLAGS, 3908c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(3), 0, GFLAGS), 3918c2ecf20Sopenharmony_ci 3928c2ecf20Sopenharmony_ci COMPOSITE(SCLK_PWM0, "clk_pwm0", mux_dpll_vpll0_xin24m_p, 0, 3938c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(29), 14, 2, MFLAGS, 0, 7, DFLAGS, 3948c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(3), 1, GFLAGS), 3958c2ecf20Sopenharmony_ci COMPOSITE(SCLK_PWM1, "clk_pwm1", mux_dpll_vpll0_xin24m_p, 0, 3968c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(74), 14, 2, MFLAGS, 0, 7, DFLAGS, 3978c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(15), 0, GFLAGS), 3988c2ecf20Sopenharmony_ci COMPOSITE(SCLK_PWM2, "clk_pwm2", mux_dpll_vpll0_xin24m_p, 0, 3998c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(75), 14, 2, MFLAGS, 0, 7, DFLAGS, 4008c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(15), 1, GFLAGS), 4018c2ecf20Sopenharmony_ci 4028c2ecf20Sopenharmony_ci COMPOSITE(SCLK_SPI0, "clk_spi0", mux_dpll_vpll0_xin24m_p, 0, 4038c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(30), 14, 2, MFLAGS, 0, 7, DFLAGS, 4048c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(3), 2, GFLAGS), 4058c2ecf20Sopenharmony_ci COMPOSITE(SCLK_SPI1, "clk_spi1", mux_dpll_vpll0_xin24m_p, 0, 4068c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(31), 14, 2, MFLAGS, 0, 7, DFLAGS, 4078c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(3), 3, GFLAGS), 4088c2ecf20Sopenharmony_ci COMPOSITE(SCLK_SPI2, "clk_spi2", mux_dpll_vpll0_xin24m_p, 0, 4098c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(32), 14, 2, MFLAGS, 0, 7, DFLAGS, 4108c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(3), 4, GFLAGS), 4118c2ecf20Sopenharmony_ci 4128c2ecf20Sopenharmony_ci GATE(SCLK_TIMER0, "sclk_timer0", "xin24m", 0, 4138c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(3), 10, GFLAGS), 4148c2ecf20Sopenharmony_ci GATE(SCLK_TIMER1, "sclk_timer1", "xin24m", 0, 4158c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(3), 11, GFLAGS), 4168c2ecf20Sopenharmony_ci GATE(SCLK_TIMER2, "sclk_timer2", "xin24m", 0, 4178c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(3), 12, GFLAGS), 4188c2ecf20Sopenharmony_ci GATE(SCLK_TIMER3, "sclk_timer3", "xin24m", 0, 4198c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(3), 13, GFLAGS), 4208c2ecf20Sopenharmony_ci GATE(SCLK_TIMER4, "sclk_timer4", "xin24m", 0, 4218c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(3), 14, GFLAGS), 4228c2ecf20Sopenharmony_ci GATE(SCLK_TIMER5, "sclk_timer5", "xin24m", 0, 4238c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(3), 15, GFLAGS), 4248c2ecf20Sopenharmony_ci 4258c2ecf20Sopenharmony_ci COMPOSITE_NOMUX(SCLK_TSADC, "clk_tsadc", "xin24m", 0, 4268c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(33), 0, 11, DFLAGS, 4278c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(3), 5, GFLAGS), 4288c2ecf20Sopenharmony_ci COMPOSITE_NOMUX(SCLK_SARADC, "clk_saradc", "xin24m", 0, 4298c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(34), 0, 11, DFLAGS, 4308c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(3), 6, GFLAGS), 4318c2ecf20Sopenharmony_ci 4328c2ecf20Sopenharmony_ci COMPOSITE_NOMUX(SCLK_OTP, "clk_otp", "xin24m", 0, 4338c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(35), 0, 4, DFLAGS, 4348c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(3), 7, GFLAGS), 4358c2ecf20Sopenharmony_ci COMPOSITE_NOMUX(SCLK_OTP_USR, "clk_otp_usr", "clk_otp", 0, 4368c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(35), 4, 2, DFLAGS, 4378c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(3), 8, GFLAGS), 4388c2ecf20Sopenharmony_ci 4398c2ecf20Sopenharmony_ci GATE(SCLK_CPU_BOOST, "clk_cpu_boost", "xin24m", CLK_IGNORE_UNUSED, 4408c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(3), 9, GFLAGS), 4418c2ecf20Sopenharmony_ci 4428c2ecf20Sopenharmony_ci COMPOSITE(SCLK_CRYPTO, "clk_crypto", mux_dpll_vpll0_vpll1_p, 0, 4438c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(7), 6, 2, MFLAGS, 0, 5, DFLAGS, 4448c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(1), 4, GFLAGS), 4458c2ecf20Sopenharmony_ci COMPOSITE(SCLK_CRYPTO_APK, "clk_crypto_apk", mux_dpll_vpll0_vpll1_p, 0, 4468c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(7), 14, 2, MFLAGS, 8, 5, DFLAGS, 4478c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(1), 5, GFLAGS), 4488c2ecf20Sopenharmony_ci 4498c2ecf20Sopenharmony_ci COMPOSITE(0, "dclk_vop_src", mux_dpll_vpll0_vpll1_p, 0, 4508c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(8), 10, 2, MFLAGS, 0, 8, DFLAGS, 4518c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(1), 6, GFLAGS), 4528c2ecf20Sopenharmony_ci COMPOSITE_FRACMUX(0, "dclk_vop_frac", "dclk_vop_src", CLK_SET_RATE_PARENT, 4538c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(9), 0, 4548c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(1), 7, GFLAGS, 4558c2ecf20Sopenharmony_ci &rk3308_dclk_vop_fracmux), 4568c2ecf20Sopenharmony_ci GATE(DCLK_VOP, "dclk_vop", "dclk_vop_mux", 0, 4578c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(1), 8, GFLAGS), 4588c2ecf20Sopenharmony_ci 4598c2ecf20Sopenharmony_ci /* 4608c2ecf20Sopenharmony_ci * Clock-Architecture Diagram 4 4618c2ecf20Sopenharmony_ci */ 4628c2ecf20Sopenharmony_ci 4638c2ecf20Sopenharmony_ci COMPOSITE_NODIV(ACLK_PERI_SRC, "clk_peri_src", mux_dpll_vpll0_vpll1_p, CLK_IGNORE_UNUSED, 4648c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(36), 6, 2, MFLAGS, 4658c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(8), 0, GFLAGS), 4668c2ecf20Sopenharmony_ci COMPOSITE_NOMUX(ACLK_PERI, "aclk_peri", "clk_peri_src", CLK_IGNORE_UNUSED, 4678c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(36), 0, 5, DFLAGS, 4688c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(8), 1, GFLAGS), 4698c2ecf20Sopenharmony_ci COMPOSITE_NOMUX(HCLK_PERI, "hclk_peri", "clk_peri_src", CLK_IGNORE_UNUSED, 4708c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(37), 0, 5, DFLAGS, 4718c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(8), 2, GFLAGS), 4728c2ecf20Sopenharmony_ci COMPOSITE_NOMUX(PCLK_PERI, "pclk_peri", "clk_peri_src", CLK_IGNORE_UNUSED, 4738c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(37), 8, 5, DFLAGS, 4748c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(8), 3, GFLAGS), 4758c2ecf20Sopenharmony_ci 4768c2ecf20Sopenharmony_ci COMPOSITE(SCLK_NANDC_DIV, "clk_nandc_div", mux_dpll_vpll0_vpll1_p, CLK_IGNORE_UNUSED, 4778c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(38), 6, 2, MFLAGS, 0, 5, DFLAGS, 4788c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(8), 4, GFLAGS), 4798c2ecf20Sopenharmony_ci COMPOSITE(SCLK_NANDC_DIV50, "clk_nandc_div50", mux_dpll_vpll0_vpll1_p, CLK_IGNORE_UNUSED, 4808c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(38), 6, 2, MFLAGS, 0, 5, DFLAGS, 4818c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(8), 4, GFLAGS), 4828c2ecf20Sopenharmony_ci COMPOSITE_NODIV(SCLK_NANDC, "clk_nandc", mux_nandc_p, CLK_SET_RATE_PARENT | CLK_SET_RATE_NO_REPARENT, 4838c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(38), 15, 1, MFLAGS, 4848c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(8), 5, GFLAGS), 4858c2ecf20Sopenharmony_ci 4868c2ecf20Sopenharmony_ci COMPOSITE(SCLK_SDMMC_DIV, "clk_sdmmc_div", mux_dpll_vpll0_vpll1_xin24m_p, CLK_IGNORE_UNUSED, 4878c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(39), 8, 2, MFLAGS, 0, 8, DFLAGS, 4888c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(8), 6, GFLAGS), 4898c2ecf20Sopenharmony_ci COMPOSITE(SCLK_SDMMC_DIV50, "clk_sdmmc_div50", mux_dpll_vpll0_vpll1_xin24m_p, CLK_IGNORE_UNUSED, 4908c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(39), 8, 2, MFLAGS, 0, 8, DFLAGS, 4918c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(8), 6, GFLAGS), 4928c2ecf20Sopenharmony_ci COMPOSITE_NODIV(SCLK_SDMMC, "clk_sdmmc", mux_sdmmc_p, CLK_SET_RATE_PARENT | CLK_SET_RATE_NO_REPARENT, 4938c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(39), 15, 1, MFLAGS, 4948c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(8), 7, GFLAGS), 4958c2ecf20Sopenharmony_ci MMC(SCLK_SDMMC_DRV, "sdmmc_drv", "clk_sdmmc", RK3308_SDMMC_CON0, 1), 4968c2ecf20Sopenharmony_ci MMC(SCLK_SDMMC_SAMPLE, "sdmmc_sample", "clk_sdmmc", RK3308_SDMMC_CON1, 1), 4978c2ecf20Sopenharmony_ci 4988c2ecf20Sopenharmony_ci COMPOSITE(SCLK_SDIO_DIV, "clk_sdio_div", mux_dpll_vpll0_vpll1_xin24m_p, CLK_IGNORE_UNUSED, 4998c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(40), 8, 2, MFLAGS, 0, 8, DFLAGS, 5008c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(8), 8, GFLAGS), 5018c2ecf20Sopenharmony_ci COMPOSITE(SCLK_SDIO_DIV50, "clk_sdio_div50", mux_dpll_vpll0_vpll1_xin24m_p, CLK_IGNORE_UNUSED, 5028c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(40), 8, 2, MFLAGS, 0, 8, DFLAGS, 5038c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(8), 8, GFLAGS), 5048c2ecf20Sopenharmony_ci COMPOSITE_NODIV(SCLK_SDIO, "clk_sdio", mux_sdio_p, CLK_SET_RATE_PARENT | CLK_SET_RATE_NO_REPARENT, 5058c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(40), 15, 1, MFLAGS, 5068c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(8), 9, GFLAGS), 5078c2ecf20Sopenharmony_ci MMC(SCLK_SDIO_DRV, "sdio_drv", "clk_sdio", RK3308_SDIO_CON0, 1), 5088c2ecf20Sopenharmony_ci MMC(SCLK_SDIO_SAMPLE, "sdio_sample", "clk_sdio", RK3308_SDIO_CON1, 1), 5098c2ecf20Sopenharmony_ci 5108c2ecf20Sopenharmony_ci COMPOSITE(SCLK_EMMC_DIV, "clk_emmc_div", mux_dpll_vpll0_vpll1_xin24m_p, CLK_IGNORE_UNUSED, 5118c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(41), 8, 2, MFLAGS, 0, 8, DFLAGS, 5128c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(8), 10, GFLAGS), 5138c2ecf20Sopenharmony_ci COMPOSITE(SCLK_EMMC_DIV50, "clk_emmc_div50", mux_dpll_vpll0_vpll1_xin24m_p, CLK_IGNORE_UNUSED, 5148c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(41), 8, 2, MFLAGS, 0, 8, DFLAGS, 5158c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(8), 10, GFLAGS), 5168c2ecf20Sopenharmony_ci COMPOSITE_NODIV(SCLK_EMMC, "clk_emmc", mux_emmc_p, CLK_SET_RATE_PARENT | CLK_SET_RATE_NO_REPARENT, 5178c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(41), 15, 1, MFLAGS, 5188c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(8), 11, GFLAGS), 5198c2ecf20Sopenharmony_ci MMC(SCLK_EMMC_DRV, "emmc_drv", "clk_emmc", RK3308_EMMC_CON0, 1), 5208c2ecf20Sopenharmony_ci MMC(SCLK_EMMC_SAMPLE, "emmc_sample", "clk_emmc", RK3308_EMMC_CON1, 1), 5218c2ecf20Sopenharmony_ci 5228c2ecf20Sopenharmony_ci COMPOSITE(SCLK_SFC, "clk_sfc", mux_dpll_vpll0_vpll1_p, 0, 5238c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(42), 14, 2, MFLAGS, 0, 7, DFLAGS, 5248c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(8), 12, GFLAGS), 5258c2ecf20Sopenharmony_ci 5268c2ecf20Sopenharmony_ci GATE(SCLK_OTG_ADP, "clk_otg_adp", "clk_rtc32k", 0, 5278c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(8), 13, GFLAGS), 5288c2ecf20Sopenharmony_ci 5298c2ecf20Sopenharmony_ci COMPOSITE(SCLK_MAC_SRC, "clk_mac_src", mux_dpll_vpll0_vpll1_p, 0, 5308c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(43), 6, 2, MFLAGS, 0, 5, DFLAGS, 5318c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(8), 14, GFLAGS), 5328c2ecf20Sopenharmony_ci MUX(SCLK_MAC, "clk_mac", mux_mac_p, CLK_SET_RATE_PARENT, 5338c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(43), 14, 1, MFLAGS), 5348c2ecf20Sopenharmony_ci GATE(SCLK_MAC_REF, "clk_mac_ref", "clk_mac", 0, 5358c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(9), 1, GFLAGS), 5368c2ecf20Sopenharmony_ci GATE(SCLK_MAC_RX_TX, "clk_mac_rx_tx", "clk_mac", 0, 5378c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(9), 0, GFLAGS), 5388c2ecf20Sopenharmony_ci FACTOR(0, "clk_mac_rx_tx_div2", "clk_mac_rx_tx", 0, 1, 2), 5398c2ecf20Sopenharmony_ci FACTOR(0, "clk_mac_rx_tx_div20", "clk_mac_rx_tx", 0, 1, 20), 5408c2ecf20Sopenharmony_ci MUX(SCLK_MAC_RMII, "clk_mac_rmii_sel", mux_mac_rmii_sel_p, CLK_SET_RATE_PARENT, 5418c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(43), 15, 1, MFLAGS), 5428c2ecf20Sopenharmony_ci 5438c2ecf20Sopenharmony_ci COMPOSITE(SCLK_OWIRE, "clk_owire", mux_dpll_vpll0_xin24m_p, 0, 5448c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(44), 14, 2, MFLAGS, 8, 6, DFLAGS, 5458c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(8), 15, GFLAGS), 5468c2ecf20Sopenharmony_ci 5478c2ecf20Sopenharmony_ci /* 5488c2ecf20Sopenharmony_ci * Clock-Architecture Diagram 5 5498c2ecf20Sopenharmony_ci */ 5508c2ecf20Sopenharmony_ci 5518c2ecf20Sopenharmony_ci GATE(0, "clk_ddr_mon_timer", "xin24m", CLK_IGNORE_UNUSED, 5528c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(0), 12, GFLAGS), 5538c2ecf20Sopenharmony_ci 5548c2ecf20Sopenharmony_ci GATE(0, "clk_ddr_mon", "clk_ddrphy1x_out", CLK_IGNORE_UNUSED, 5558c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(4), 10, GFLAGS), 5568c2ecf20Sopenharmony_ci GATE(0, "clk_ddr_upctrl", "clk_ddrphy1x_out", CLK_IGNORE_UNUSED, 5578c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(4), 11, GFLAGS), 5588c2ecf20Sopenharmony_ci GATE(0, "clk_ddr_msch", "clk_ddrphy1x_out", CLK_IGNORE_UNUSED, 5598c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(4), 12, GFLAGS), 5608c2ecf20Sopenharmony_ci GATE(0, "clk_ddr_msch_peribus", "clk_ddrphy1x_out", CLK_IGNORE_UNUSED, 5618c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(4), 13, GFLAGS), 5628c2ecf20Sopenharmony_ci 5638c2ecf20Sopenharmony_ci COMPOSITE(SCLK_DDRCLK, "clk_ddrphy4x_src", mux_dpll_vpll0_vpll1_p, CLK_IGNORE_UNUSED, 5648c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(1), 6, 2, MFLAGS, 0, 3, DFLAGS, 5658c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(0), 10, GFLAGS), 5668c2ecf20Sopenharmony_ci GATE(0, "clk_ddrphy4x", "clk_ddrphy4x_src", CLK_IGNORE_UNUSED, 5678c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(0), 11, GFLAGS), 5688c2ecf20Sopenharmony_ci FACTOR_GATE(0, "clk_ddr_stdby_div4", "clk_ddrphy4x", CLK_IGNORE_UNUSED, 1, 4, 5698c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(0), 13, GFLAGS), 5708c2ecf20Sopenharmony_ci COMPOSITE_NODIV(0, "clk_ddrstdby", mux_ddrstdby_p, CLK_IGNORE_UNUSED, 5718c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(1), 8, 1, MFLAGS, 5728c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(4), 14, GFLAGS), 5738c2ecf20Sopenharmony_ci 5748c2ecf20Sopenharmony_ci /* 5758c2ecf20Sopenharmony_ci * Clock-Architecture Diagram 6 5768c2ecf20Sopenharmony_ci */ 5778c2ecf20Sopenharmony_ci 5788c2ecf20Sopenharmony_ci GATE(PCLK_PMU, "pclk_pmu", "pclk_bus", CLK_IGNORE_UNUSED, 5798c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(4), 5, GFLAGS), 5808c2ecf20Sopenharmony_ci GATE(SCLK_PMU, "clk_pmu", "pclk_bus", CLK_IGNORE_UNUSED, 5818c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(4), 6, GFLAGS), 5828c2ecf20Sopenharmony_ci 5838c2ecf20Sopenharmony_ci COMPOSITE_FRACMUX(0, "clk_rtc32k_frac", "xin24m", CLK_IGNORE_UNUSED, 5848c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(3), 0, 5858c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(4), 3, GFLAGS, 5868c2ecf20Sopenharmony_ci &rk3308_rtc32k_fracmux), 5878c2ecf20Sopenharmony_ci MUX(0, "clk_rtc32k_div_src", mux_vpll0_vpll1_p, 0, 5888c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(2), 10, 1, MFLAGS), 5898c2ecf20Sopenharmony_ci COMPOSITE_NOMUX(0, "clk_rtc32k_div", "clk_rtc32k_div_src", CLK_IGNORE_UNUSED | CLK_SET_RATE_PARENT, 5908c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(4), 0, 16, DFLAGS, 5918c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(4), 2, GFLAGS), 5928c2ecf20Sopenharmony_ci 5938c2ecf20Sopenharmony_ci COMPOSITE(0, "clk_usbphy_ref_src", mux_dpll_vpll0_p, 0, 5948c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(72), 6, 1, MFLAGS, 0, 6, DFLAGS, 5958c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(4), 7, GFLAGS), 5968c2ecf20Sopenharmony_ci COMPOSITE_NODIV(SCLK_USBPHY_REF, "clk_usbphy_ref", mux_usbphy_ref_p, CLK_SET_RATE_PARENT, 5978c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(72), 7, 1, MFLAGS, 5988c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(4), 8, GFLAGS), 5998c2ecf20Sopenharmony_ci 6008c2ecf20Sopenharmony_ci GATE(0, "clk_wifi_dpll", "dpll", 0, 6018c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(15), 2, GFLAGS), 6028c2ecf20Sopenharmony_ci GATE(0, "clk_wifi_vpll0", "vpll0", 0, 6038c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(15), 3, GFLAGS), 6048c2ecf20Sopenharmony_ci GATE(0, "clk_wifi_osc", "xin24m", 0, 6058c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(15), 4, GFLAGS), 6068c2ecf20Sopenharmony_ci COMPOSITE(0, "clk_wifi_src", mux_wifi_src_p, 0, 6078c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(44), 6, 1, MFLAGS, 0, 6, DFLAGS, 6088c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(4), 0, GFLAGS), 6098c2ecf20Sopenharmony_ci COMPOSITE_NODIV(SCLK_WIFI, "clk_wifi", mux_wifi_p, CLK_SET_RATE_PARENT, 6108c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(44), 7, 1, MFLAGS, 6118c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(4), 1, GFLAGS), 6128c2ecf20Sopenharmony_ci 6138c2ecf20Sopenharmony_ci GATE(SCLK_PVTM_PMU, "clk_pvtm_pmu", "xin24m", 0, 6148c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(4), 4, GFLAGS), 6158c2ecf20Sopenharmony_ci 6168c2ecf20Sopenharmony_ci /* 6178c2ecf20Sopenharmony_ci * Clock-Architecture Diagram 7 6188c2ecf20Sopenharmony_ci */ 6198c2ecf20Sopenharmony_ci 6208c2ecf20Sopenharmony_ci COMPOSITE_NODIV(0, "clk_audio_src", mux_vpll0_vpll1_xin24m_p, 0, 6218c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(45), 6, 2, MFLAGS, 6228c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(10), 0, GFLAGS), 6238c2ecf20Sopenharmony_ci COMPOSITE_NOMUX(HCLK_AUDIO, "hclk_audio", "clk_audio_src", 0, 6248c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(45), 0, 5, DFLAGS, 6258c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(10), 1, GFLAGS), 6268c2ecf20Sopenharmony_ci COMPOSITE_NOMUX(PCLK_AUDIO, "pclk_audio", "clk_audio_src", 0, 6278c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(45), 8, 5, DFLAGS, 6288c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(10), 2, GFLAGS), 6298c2ecf20Sopenharmony_ci 6308c2ecf20Sopenharmony_ci COMPOSITE(0, "clk_pdm_src", mux_vpll0_vpll1_xin24m_p, 0, 6318c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(46), 8, 2, MFLAGS, 0, 7, DFLAGS, 6328c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(10), 3, GFLAGS), 6338c2ecf20Sopenharmony_ci COMPOSITE_FRACMUX(0, "clk_pdm_frac", "clk_pdm_src", CLK_SET_RATE_PARENT, 6348c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(47), 0, 6358c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(10), 4, GFLAGS, 6368c2ecf20Sopenharmony_ci &rk3308_pdm_fracmux), 6378c2ecf20Sopenharmony_ci GATE(SCLK_PDM, "clk_pdm", "clk_pdm_mux", 0, 6388c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(10), 5, GFLAGS), 6398c2ecf20Sopenharmony_ci 6408c2ecf20Sopenharmony_ci COMPOSITE(SCLK_I2S0_8CH_TX_SRC, "clk_i2s0_8ch_tx_src", mux_vpll0_vpll1_xin24m_p, 0, 6418c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(52), 8, 2, MFLAGS, 0, 7, DFLAGS, 6428c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(10), 12, GFLAGS), 6438c2ecf20Sopenharmony_ci COMPOSITE_FRACMUX(0, "clk_i2s0_8ch_tx_frac", "clk_i2s0_8ch_tx_src", CLK_SET_RATE_PARENT, 6448c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(53), 0, 6458c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(10), 13, GFLAGS, 6468c2ecf20Sopenharmony_ci &rk3308_i2s0_8ch_tx_fracmux), 6478c2ecf20Sopenharmony_ci COMPOSITE_NODIV(SCLK_I2S0_8CH_TX, "clk_i2s0_8ch_tx", mux_i2s0_8ch_tx_rx_p, CLK_SET_RATE_PARENT, 6488c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(52), 12, 1, MFLAGS, 6498c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(10), 14, GFLAGS), 6508c2ecf20Sopenharmony_ci COMPOSITE_NODIV(SCLK_I2S0_8CH_TX_OUT, "clk_i2s0_8ch_tx_out", mux_i2s0_8ch_tx_out_p, CLK_SET_RATE_PARENT, 6518c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(52), 15, 1, MFLAGS, 6528c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(10), 15, GFLAGS), 6538c2ecf20Sopenharmony_ci 6548c2ecf20Sopenharmony_ci COMPOSITE(SCLK_I2S0_8CH_RX_SRC, "clk_i2s0_8ch_rx_src", mux_vpll0_vpll1_xin24m_p, 0, 6558c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(54), 8, 2, MFLAGS, 0, 7, DFLAGS, 6568c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(11), 0, GFLAGS), 6578c2ecf20Sopenharmony_ci COMPOSITE_FRACMUX(0, "clk_i2s0_8ch_rx_frac", "clk_i2s0_8ch_rx_src", CLK_SET_RATE_PARENT, 6588c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(55), 0, 6598c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(11), 1, GFLAGS, 6608c2ecf20Sopenharmony_ci &rk3308_i2s0_8ch_rx_fracmux), 6618c2ecf20Sopenharmony_ci COMPOSITE_NODIV(SCLK_I2S0_8CH_RX, "clk_i2s0_8ch_rx", mux_i2s0_8ch_rx_tx_p, CLK_SET_RATE_PARENT, 6628c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(54), 12, 1, MFLAGS, 6638c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(11), 2, GFLAGS), 6648c2ecf20Sopenharmony_ci GATE(SCLK_I2S0_8CH_RX_OUT, "clk_i2s0_8ch_rx_out", "clk_i2s0_8ch_rx", 0, 6658c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(11), 3, GFLAGS), 6668c2ecf20Sopenharmony_ci 6678c2ecf20Sopenharmony_ci COMPOSITE(SCLK_I2S1_8CH_TX_SRC, "clk_i2s1_8ch_tx_src", mux_vpll0_vpll1_xin24m_p, 0, 6688c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(56), 8, 2, MFLAGS, 0, 7, DFLAGS, 6698c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(11), 4, GFLAGS), 6708c2ecf20Sopenharmony_ci COMPOSITE_FRACMUX(0, "clk_i2s1_8ch_tx_frac", "clk_i2s1_8ch_tx_src", CLK_SET_RATE_PARENT, 6718c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(57), 0, 6728c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(11), 5, GFLAGS, 6738c2ecf20Sopenharmony_ci &rk3308_i2s1_8ch_tx_fracmux), 6748c2ecf20Sopenharmony_ci COMPOSITE_NODIV(SCLK_I2S1_8CH_TX, "clk_i2s1_8ch_tx", mux_i2s1_8ch_tx_rx_p, CLK_SET_RATE_PARENT, 6758c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(56), 12, 1, MFLAGS, 6768c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(11), 6, GFLAGS), 6778c2ecf20Sopenharmony_ci COMPOSITE_NODIV(SCLK_I2S1_8CH_TX_OUT, "clk_i2s1_8ch_tx_out", mux_i2s1_8ch_tx_out_p, CLK_SET_RATE_PARENT, 6788c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(56), 15, 1, MFLAGS, 6798c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(11), 7, GFLAGS), 6808c2ecf20Sopenharmony_ci 6818c2ecf20Sopenharmony_ci COMPOSITE(SCLK_I2S1_8CH_RX_SRC, "clk_i2s1_8ch_rx_src", mux_vpll0_vpll1_xin24m_p, 0, 6828c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(58), 8, 2, MFLAGS, 0, 7, DFLAGS, 6838c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(11), 8, GFLAGS), 6848c2ecf20Sopenharmony_ci COMPOSITE_FRACMUX(0, "clk_i2s1_8ch_rx_frac", "clk_i2s1_8ch_rx_src", CLK_SET_RATE_PARENT, 6858c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(59), 0, 6868c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(11), 9, GFLAGS, 6878c2ecf20Sopenharmony_ci &rk3308_i2s1_8ch_rx_fracmux), 6888c2ecf20Sopenharmony_ci COMPOSITE_NODIV(SCLK_I2S1_8CH_RX, "clk_i2s1_8ch_rx", mux_i2s1_8ch_rx_tx_p, CLK_SET_RATE_PARENT, 6898c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(58), 12, 1, MFLAGS, 6908c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(11), 10, GFLAGS), 6918c2ecf20Sopenharmony_ci GATE(SCLK_I2S1_8CH_RX_OUT, "clk_i2s1_8ch_rx_out", "clk_i2s1_8ch_rx", 0, 6928c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(11), 11, GFLAGS), 6938c2ecf20Sopenharmony_ci 6948c2ecf20Sopenharmony_ci COMPOSITE(SCLK_I2S2_8CH_TX_SRC, "clk_i2s2_8ch_tx_src", mux_vpll0_vpll1_xin24m_p, 0, 6958c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(60), 8, 2, MFLAGS, 0, 7, DFLAGS, 6968c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(11), 12, GFLAGS), 6978c2ecf20Sopenharmony_ci COMPOSITE_FRACMUX(0, "clk_i2s2_8ch_tx_frac", "clk_i2s2_8ch_tx_src", CLK_SET_RATE_PARENT, 6988c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(61), 0, 6998c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(11), 13, GFLAGS, 7008c2ecf20Sopenharmony_ci &rk3308_i2s2_8ch_tx_fracmux), 7018c2ecf20Sopenharmony_ci COMPOSITE_NODIV(SCLK_I2S2_8CH_TX, "clk_i2s2_8ch_tx", mux_i2s2_8ch_tx_rx_p, CLK_SET_RATE_PARENT, 7028c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(60), 12, 1, MFLAGS, 7038c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(11), 14, GFLAGS), 7048c2ecf20Sopenharmony_ci COMPOSITE_NODIV(SCLK_I2S2_8CH_TX_OUT, "clk_i2s2_8ch_tx_out", mux_i2s2_8ch_tx_out_p, CLK_SET_RATE_PARENT, 7058c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(60), 15, 1, MFLAGS, 7068c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(11), 15, GFLAGS), 7078c2ecf20Sopenharmony_ci 7088c2ecf20Sopenharmony_ci COMPOSITE(SCLK_I2S2_8CH_RX_SRC, "clk_i2s2_8ch_rx_src", mux_vpll0_vpll1_xin24m_p, 0, 7098c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(62), 8, 2, MFLAGS, 0, 7, DFLAGS, 7108c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(12), 0, GFLAGS), 7118c2ecf20Sopenharmony_ci COMPOSITE_FRACMUX(0, "clk_i2s2_8ch_rx_frac", "clk_i2s2_8ch_rx_src", CLK_SET_RATE_PARENT, 7128c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(63), 0, 7138c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(12), 1, GFLAGS, 7148c2ecf20Sopenharmony_ci &rk3308_i2s2_8ch_rx_fracmux), 7158c2ecf20Sopenharmony_ci COMPOSITE_NODIV(SCLK_I2S2_8CH_RX, "clk_i2s2_8ch_rx", mux_i2s2_8ch_rx_tx_p, CLK_SET_RATE_PARENT, 7168c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(62), 12, 1, MFLAGS, 7178c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(12), 2, GFLAGS), 7188c2ecf20Sopenharmony_ci GATE(SCLK_I2S2_8CH_RX_OUT, "clk_i2s2_8ch_rx_out", "clk_i2s2_8ch_rx", 0, 7198c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(12), 3, GFLAGS), 7208c2ecf20Sopenharmony_ci 7218c2ecf20Sopenharmony_ci COMPOSITE(SCLK_I2S3_8CH_TX_SRC, "clk_i2s3_8ch_tx_src", mux_vpll0_vpll1_xin24m_p, 0, 7228c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(64), 8, 2, MFLAGS, 0, 7, DFLAGS, 7238c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(12), 4, GFLAGS), 7248c2ecf20Sopenharmony_ci COMPOSITE_FRACMUX(0, "clk_i2s3_8ch_tx_frac", "clk_i2s3_8ch_tx_src", CLK_SET_RATE_PARENT, 7258c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(65), 0, 7268c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(12), 5, GFLAGS, 7278c2ecf20Sopenharmony_ci &rk3308_i2s3_8ch_tx_fracmux), 7288c2ecf20Sopenharmony_ci COMPOSITE_NODIV(SCLK_I2S3_8CH_TX, "clk_i2s3_8ch_tx", mux_i2s3_8ch_tx_rx_p, CLK_SET_RATE_PARENT, 7298c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(64), 12, 1, MFLAGS, 7308c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(12), 6, GFLAGS), 7318c2ecf20Sopenharmony_ci COMPOSITE_NODIV(SCLK_I2S3_8CH_TX_OUT, "clk_i2s3_8ch_tx_out", mux_i2s3_8ch_tx_out_p, CLK_SET_RATE_PARENT, 7328c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(64), 15, 1, MFLAGS, 7338c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(12), 7, GFLAGS), 7348c2ecf20Sopenharmony_ci 7358c2ecf20Sopenharmony_ci COMPOSITE(SCLK_I2S3_8CH_RX_SRC, "clk_i2s3_8ch_rx_src", mux_vpll0_vpll1_xin24m_p, 0, 7368c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(66), 8, 2, MFLAGS, 0, 7, DFLAGS, 7378c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(12), 8, GFLAGS), 7388c2ecf20Sopenharmony_ci COMPOSITE_FRACMUX(0, "clk_i2s3_8ch_rx_frac", "clk_i2s3_8ch_rx_src", CLK_SET_RATE_PARENT, 7398c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(67), 0, 7408c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(12), 9, GFLAGS, 7418c2ecf20Sopenharmony_ci &rk3308_i2s3_8ch_rx_fracmux), 7428c2ecf20Sopenharmony_ci COMPOSITE_NODIV(SCLK_I2S3_8CH_RX, "clk_i2s3_8ch_rx", mux_i2s3_8ch_rx_tx_p, CLK_SET_RATE_PARENT, 7438c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(66), 12, 1, MFLAGS, 7448c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(12), 10, GFLAGS), 7458c2ecf20Sopenharmony_ci GATE(SCLK_I2S3_8CH_RX_OUT, "clk_i2s3_8ch_rx_out", "clk_i2s3_8ch_rx", 0, 7468c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(12), 11, GFLAGS), 7478c2ecf20Sopenharmony_ci 7488c2ecf20Sopenharmony_ci COMPOSITE(SCLK_I2S0_2CH_SRC, "clk_i2s0_2ch_src", mux_vpll0_vpll1_xin24m_p, 0, 7498c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(68), 8, 2, MFLAGS, 0, 7, DFLAGS, 7508c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(12), 12, GFLAGS), 7518c2ecf20Sopenharmony_ci COMPOSITE_FRACMUX(0, "clk_i2s0_2ch_frac", "clk_i2s0_2ch_src", CLK_SET_RATE_PARENT, 7528c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(69), 0, 7538c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(12), 13, GFLAGS, 7548c2ecf20Sopenharmony_ci &rk3308_i2s0_2ch_fracmux), 7558c2ecf20Sopenharmony_ci GATE(SCLK_I2S0_2CH, "clk_i2s0_2ch", "clk_i2s0_2ch_mux", 0, 7568c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(12), 14, GFLAGS), 7578c2ecf20Sopenharmony_ci COMPOSITE_NODIV(SCLK_I2S0_2CH_OUT, "clk_i2s0_2ch_out", mux_i2s0_2ch_out_p, CLK_SET_RATE_PARENT, 7588c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(68), 15, 1, MFLAGS, 7598c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(12), 15, GFLAGS), 7608c2ecf20Sopenharmony_ci 7618c2ecf20Sopenharmony_ci COMPOSITE(SCLK_I2S1_2CH_SRC, "clk_i2s1_2ch_src", mux_vpll0_vpll1_xin24m_p, 0, 7628c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(70), 8, 2, MFLAGS, 0, 7, DFLAGS, 7638c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(13), 0, GFLAGS), 7648c2ecf20Sopenharmony_ci COMPOSITE_FRACMUX(0, "clk_i2s1_2ch_frac", "clk_i2s1_2ch_src", CLK_SET_RATE_PARENT, 7658c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(71), 0, 7668c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(13), 1, GFLAGS, 7678c2ecf20Sopenharmony_ci &rk3308_i2s1_2ch_fracmux), 7688c2ecf20Sopenharmony_ci GATE(SCLK_I2S1_2CH, "clk_i2s1_2ch", "clk_i2s1_2ch_mux", 0, 7698c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(13), 2, GFLAGS), 7708c2ecf20Sopenharmony_ci COMPOSITE_NODIV(SCLK_I2S1_2CH_OUT, "clk_i2s1_2ch_out", mux_i2s1_2ch_out_p, CLK_SET_RATE_PARENT, 7718c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(70), 15, 1, MFLAGS, 7728c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(13), 3, GFLAGS), 7738c2ecf20Sopenharmony_ci 7748c2ecf20Sopenharmony_ci COMPOSITE(SCLK_SPDIF_TX_DIV, "clk_spdif_tx_div", mux_vpll0_vpll1_xin24m_p, CLK_IGNORE_UNUSED, 7758c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(48), 8, 2, MFLAGS, 0, 7, DFLAGS, 7768c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(10), 6, GFLAGS), 7778c2ecf20Sopenharmony_ci COMPOSITE(SCLK_SPDIF_TX_DIV50, "clk_spdif_tx_div50", mux_vpll0_vpll1_xin24m_p, CLK_IGNORE_UNUSED, 7788c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(48), 8, 2, MFLAGS, 0, 7, DFLAGS, 7798c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(10), 6, GFLAGS), 7808c2ecf20Sopenharmony_ci MUX(0, "clk_spdif_tx_src", mux_spdif_tx_src_p, CLK_SET_RATE_PARENT | CLK_SET_RATE_NO_REPARENT, 7818c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(48), 12, 1, MFLAGS), 7828c2ecf20Sopenharmony_ci COMPOSITE_FRACMUX(0, "clk_spdif_tx_frac", "clk_spdif_tx_src", CLK_SET_RATE_PARENT, 7838c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(49), 0, 7848c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(10), 7, GFLAGS, 7858c2ecf20Sopenharmony_ci &rk3308_spdif_tx_fracmux), 7868c2ecf20Sopenharmony_ci GATE(SCLK_SPDIF_TX, "clk_spdif_tx", "clk_spdif_tx_mux", 0, 7878c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(10), 8, GFLAGS), 7888c2ecf20Sopenharmony_ci 7898c2ecf20Sopenharmony_ci COMPOSITE(SCLK_SPDIF_RX_DIV, "clk_spdif_rx_div", mux_vpll0_vpll1_xin24m_p, CLK_IGNORE_UNUSED, 7908c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(50), 8, 2, MFLAGS, 0, 7, DFLAGS, 7918c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(10), 9, GFLAGS), 7928c2ecf20Sopenharmony_ci COMPOSITE(SCLK_SPDIF_RX_DIV50, "clk_spdif_rx_div50", mux_vpll0_vpll1_xin24m_p, CLK_IGNORE_UNUSED, 7938c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(50), 8, 2, MFLAGS, 0, 7, DFLAGS, 7948c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(10), 9, GFLAGS), 7958c2ecf20Sopenharmony_ci MUX(0, "clk_spdif_rx_src", mux_spdif_rx_src_p, CLK_SET_RATE_PARENT | CLK_SET_RATE_NO_REPARENT, 7968c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(50), 14, 1, MFLAGS), 7978c2ecf20Sopenharmony_ci COMPOSITE_FRACMUX(0, "clk_spdif_rx_frac", "clk_spdif_rx_src", CLK_SET_RATE_PARENT, 7988c2ecf20Sopenharmony_ci RK3308_CLKSEL_CON(51), 0, 7998c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(10), 10, GFLAGS, 8008c2ecf20Sopenharmony_ci &rk3308_spdif_rx_fracmux), 8018c2ecf20Sopenharmony_ci GATE(SCLK_SPDIF_RX, "clk_spdif_rx", "clk_spdif_rx_mux", 0, 8028c2ecf20Sopenharmony_ci RK3308_CLKGATE_CON(10), 11, GFLAGS), 8038c2ecf20Sopenharmony_ci 8048c2ecf20Sopenharmony_ci /* 8058c2ecf20Sopenharmony_ci * Clock-Architecture Diagram 8 8068c2ecf20Sopenharmony_ci */ 8078c2ecf20Sopenharmony_ci 8088c2ecf20Sopenharmony_ci GATE(0, "aclk_core_niu", "aclk_core", CLK_IGNORE_UNUSED, RK3308_CLKGATE_CON(0), 5, GFLAGS), 8098c2ecf20Sopenharmony_ci GATE(0, "pclk_core_dbg_niu", "aclk_core", CLK_IGNORE_UNUSED, RK3308_CLKGATE_CON(0), 6, GFLAGS), 8108c2ecf20Sopenharmony_ci GATE(0, "pclk_core_dbg_daplite", "pclk_core_dbg", CLK_IGNORE_UNUSED, RK3308_CLKGATE_CON(0), 7, GFLAGS), 8118c2ecf20Sopenharmony_ci GATE(0, "aclk_core_perf", "pclk_core_dbg", CLK_IGNORE_UNUSED, RK3308_CLKGATE_CON(0), 8, GFLAGS), 8128c2ecf20Sopenharmony_ci GATE(0, "pclk_core_grf", "pclk_core_dbg", CLK_IGNORE_UNUSED, RK3308_CLKGATE_CON(0), 9, GFLAGS), 8138c2ecf20Sopenharmony_ci 8148c2ecf20Sopenharmony_ci GATE(0, "aclk_peri_niu", "aclk_peri", CLK_IGNORE_UNUSED, RK3308_CLKGATE_CON(9), 2, GFLAGS), 8158c2ecf20Sopenharmony_ci GATE(0, "aclk_peribus_niu", "aclk_peri", CLK_IGNORE_UNUSED, RK3308_CLKGATE_CON(9), 3, GFLAGS), 8168c2ecf20Sopenharmony_ci GATE(ACLK_MAC, "aclk_mac", "aclk_peri", 0, RK3308_CLKGATE_CON(9), 4, GFLAGS), 8178c2ecf20Sopenharmony_ci 8188c2ecf20Sopenharmony_ci GATE(0, "hclk_peri_niu", "hclk_peri", CLK_IGNORE_UNUSED, RK3308_CLKGATE_CON(9), 5, GFLAGS), 8198c2ecf20Sopenharmony_ci GATE(HCLK_NANDC, "hclk_nandc", "hclk_peri", 0, RK3308_CLKGATE_CON(9), 6, GFLAGS), 8208c2ecf20Sopenharmony_ci GATE(HCLK_SDMMC, "hclk_sdmmc", "hclk_peri", 0, RK3308_CLKGATE_CON(9), 7, GFLAGS), 8218c2ecf20Sopenharmony_ci GATE(HCLK_SDIO, "hclk_sdio", "hclk_peri", 0, RK3308_CLKGATE_CON(9), 8, GFLAGS), 8228c2ecf20Sopenharmony_ci GATE(HCLK_EMMC, "hclk_emmc", "hclk_peri", 0, RK3308_CLKGATE_CON(9), 9, GFLAGS), 8238c2ecf20Sopenharmony_ci GATE(HCLK_SFC, "hclk_sfc", "hclk_peri", 0, RK3308_CLKGATE_CON(9), 10, GFLAGS), 8248c2ecf20Sopenharmony_ci GATE(HCLK_OTG, "hclk_otg", "hclk_peri", 0, RK3308_CLKGATE_CON(9), 11, GFLAGS), 8258c2ecf20Sopenharmony_ci GATE(HCLK_HOST, "hclk_host", "hclk_peri", 0, RK3308_CLKGATE_CON(9), 12, GFLAGS), 8268c2ecf20Sopenharmony_ci GATE(HCLK_HOST_ARB, "hclk_host_arb", "hclk_peri", 0, RK3308_CLKGATE_CON(9), 13, GFLAGS), 8278c2ecf20Sopenharmony_ci 8288c2ecf20Sopenharmony_ci GATE(0, "pclk_peri_niu", "pclk_peri", CLK_IGNORE_UNUSED, RK3308_CLKGATE_CON(9), 14, GFLAGS), 8298c2ecf20Sopenharmony_ci GATE(PCLK_MAC, "pclk_mac", "pclk_peri", 0, RK3308_CLKGATE_CON(9), 15, GFLAGS), 8308c2ecf20Sopenharmony_ci 8318c2ecf20Sopenharmony_ci GATE(0, "hclk_audio_niu", "hclk_audio", CLK_IGNORE_UNUSED, RK3308_CLKGATE_CON(14), 0, GFLAGS), 8328c2ecf20Sopenharmony_ci GATE(HCLK_PDM, "hclk_pdm", "hclk_audio", 0, RK3308_CLKGATE_CON(14), 1, GFLAGS), 8338c2ecf20Sopenharmony_ci GATE(HCLK_SPDIFTX, "hclk_spdiftx", "hclk_audio", 0, RK3308_CLKGATE_CON(14), 2, GFLAGS), 8348c2ecf20Sopenharmony_ci GATE(HCLK_SPDIFRX, "hclk_spdifrx", "hclk_audio", 0, RK3308_CLKGATE_CON(14), 3, GFLAGS), 8358c2ecf20Sopenharmony_ci GATE(HCLK_I2S0_8CH, "hclk_i2s0_8ch", "hclk_audio", 0, RK3308_CLKGATE_CON(14), 4, GFLAGS), 8368c2ecf20Sopenharmony_ci GATE(HCLK_I2S1_8CH, "hclk_i2s1_8ch", "hclk_audio", 0, RK3308_CLKGATE_CON(14), 5, GFLAGS), 8378c2ecf20Sopenharmony_ci GATE(HCLK_I2S2_8CH, "hclk_i2s2_8ch", "hclk_audio", 0, RK3308_CLKGATE_CON(14), 6, GFLAGS), 8388c2ecf20Sopenharmony_ci GATE(HCLK_I2S3_8CH, "hclk_i2s3_8ch", "hclk_audio", 0, RK3308_CLKGATE_CON(14), 7, GFLAGS), 8398c2ecf20Sopenharmony_ci GATE(HCLK_I2S0_2CH, "hclk_i2s0_2ch", "hclk_audio", 0, RK3308_CLKGATE_CON(14), 8, GFLAGS), 8408c2ecf20Sopenharmony_ci GATE(HCLK_I2S1_2CH, "hclk_i2s1_2ch", "hclk_audio", 0, RK3308_CLKGATE_CON(14), 9, GFLAGS), 8418c2ecf20Sopenharmony_ci GATE(HCLK_VAD, "hclk_vad", "hclk_audio", 0, RK3308_CLKGATE_CON(14), 10, GFLAGS), 8428c2ecf20Sopenharmony_ci 8438c2ecf20Sopenharmony_ci GATE(0, "pclk_audio_niu", "pclk_audio", CLK_IGNORE_UNUSED, RK3308_CLKGATE_CON(14), 11, GFLAGS), 8448c2ecf20Sopenharmony_ci GATE(PCLK_ACODEC, "pclk_acodec", "pclk_audio", 0, RK3308_CLKGATE_CON(14), 12, GFLAGS), 8458c2ecf20Sopenharmony_ci 8468c2ecf20Sopenharmony_ci GATE(0, "aclk_bus_niu", "aclk_bus", CLK_IGNORE_UNUSED, RK3308_CLKGATE_CON(5), 0, GFLAGS), 8478c2ecf20Sopenharmony_ci GATE(0, "aclk_intmem", "aclk_bus", CLK_IGNORE_UNUSED, RK3308_CLKGATE_CON(5), 1, GFLAGS), 8488c2ecf20Sopenharmony_ci GATE(ACLK_CRYPTO, "aclk_crypto", "aclk_bus", 0, RK3308_CLKGATE_CON(5), 2, GFLAGS), 8498c2ecf20Sopenharmony_ci GATE(ACLK_VOP, "aclk_vop", "aclk_bus", 0, RK3308_CLKGATE_CON(5), 3, GFLAGS), 8508c2ecf20Sopenharmony_ci GATE(0, "aclk_gic", "aclk_bus", CLK_IGNORE_UNUSED, RK3308_CLKGATE_CON(5), 4, GFLAGS), 8518c2ecf20Sopenharmony_ci /* aclk_dmaci0 is controlled by sgrf_clkgat_con. */ 8528c2ecf20Sopenharmony_ci SGRF_GATE(ACLK_DMAC0, "aclk_dmac0", "aclk_bus"), 8538c2ecf20Sopenharmony_ci /* aclk_dmac1 is controlled by sgrf_clkgat_con. */ 8548c2ecf20Sopenharmony_ci SGRF_GATE(ACLK_DMAC1, "aclk_dmac1", "aclk_bus"), 8558c2ecf20Sopenharmony_ci /* watchdog pclk is controlled by sgrf_clkgat_con. */ 8568c2ecf20Sopenharmony_ci SGRF_GATE(PCLK_WDT, "pclk_wdt", "pclk_bus"), 8578c2ecf20Sopenharmony_ci 8588c2ecf20Sopenharmony_ci GATE(0, "hclk_bus_niu", "hclk_bus", CLK_IGNORE_UNUSED, RK3308_CLKGATE_CON(5), 5, GFLAGS), 8598c2ecf20Sopenharmony_ci GATE(0, "hclk_rom", "hclk_bus", CLK_IGNORE_UNUSED, RK3308_CLKGATE_CON(5), 6, GFLAGS), 8608c2ecf20Sopenharmony_ci GATE(HCLK_CRYPTO, "hclk_crypto", "hclk_bus", 0, RK3308_CLKGATE_CON(5), 7, GFLAGS), 8618c2ecf20Sopenharmony_ci GATE(HCLK_VOP, "hclk_vop", "hclk_bus", 0, RK3308_CLKGATE_CON(5), 8, GFLAGS), 8628c2ecf20Sopenharmony_ci 8638c2ecf20Sopenharmony_ci GATE(0, "pclk_bus_niu", "pclk_bus", CLK_IGNORE_UNUSED, RK3308_CLKGATE_CON(5), 9, GFLAGS), 8648c2ecf20Sopenharmony_ci GATE(PCLK_UART0, "pclk_uart0", "pclk_bus", 0, RK3308_CLKGATE_CON(5), 10, GFLAGS), 8658c2ecf20Sopenharmony_ci GATE(PCLK_UART1, "pclk_uart1", "pclk_bus", 0, RK3308_CLKGATE_CON(5), 11, GFLAGS), 8668c2ecf20Sopenharmony_ci GATE(PCLK_UART2, "pclk_uart2", "pclk_bus", 0, RK3308_CLKGATE_CON(5), 12, GFLAGS), 8678c2ecf20Sopenharmony_ci GATE(PCLK_UART3, "pclk_uart3", "pclk_bus", 0, RK3308_CLKGATE_CON(5), 13, GFLAGS), 8688c2ecf20Sopenharmony_ci GATE(PCLK_UART4, "pclk_uart4", "pclk_bus", 0, RK3308_CLKGATE_CON(5), 14, GFLAGS), 8698c2ecf20Sopenharmony_ci GATE(PCLK_I2C0, "pclk_i2c0", "pclk_bus", 0, RK3308_CLKGATE_CON(5), 15, GFLAGS), 8708c2ecf20Sopenharmony_ci GATE(PCLK_I2C1, "pclk_i2c1", "pclk_bus", 0, RK3308_CLKGATE_CON(6), 0, GFLAGS), 8718c2ecf20Sopenharmony_ci GATE(PCLK_I2C2, "pclk_i2c2", "pclk_bus", 0, RK3308_CLKGATE_CON(6), 1, GFLAGS), 8728c2ecf20Sopenharmony_ci GATE(PCLK_I2C3, "pclk_i2c3", "pclk_bus", 0, RK3308_CLKGATE_CON(6), 2, GFLAGS), 8738c2ecf20Sopenharmony_ci GATE(PCLK_PWM0, "pclk_pwm0", "pclk_bus", 0, RK3308_CLKGATE_CON(6), 3, GFLAGS), 8748c2ecf20Sopenharmony_ci GATE(PCLK_SPI0, "pclk_spi0", "pclk_bus", 0, RK3308_CLKGATE_CON(6), 4, GFLAGS), 8758c2ecf20Sopenharmony_ci GATE(PCLK_SPI1, "pclk_spi1", "pclk_bus", 0, RK3308_CLKGATE_CON(6), 5, GFLAGS), 8768c2ecf20Sopenharmony_ci GATE(PCLK_SPI2, "pclk_spi2", "pclk_bus", 0, RK3308_CLKGATE_CON(6), 6, GFLAGS), 8778c2ecf20Sopenharmony_ci GATE(PCLK_SARADC, "pclk_saradc", "pclk_bus", 0, RK3308_CLKGATE_CON(6), 7, GFLAGS), 8788c2ecf20Sopenharmony_ci GATE(PCLK_TSADC, "pclk_tsadc", "pclk_bus", 0, RK3308_CLKGATE_CON(6), 8, GFLAGS), 8798c2ecf20Sopenharmony_ci GATE(PCLK_TIMER, "pclk_timer", "pclk_bus", 0, RK3308_CLKGATE_CON(6), 9, GFLAGS), 8808c2ecf20Sopenharmony_ci GATE(PCLK_OTP_NS, "pclk_otp_ns", "pclk_bus", 0, RK3308_CLKGATE_CON(6), 10, GFLAGS), 8818c2ecf20Sopenharmony_ci GATE(PCLK_GPIO0, "pclk_gpio0", "pclk_bus", 0, RK3308_CLKGATE_CON(6), 12, GFLAGS), 8828c2ecf20Sopenharmony_ci GATE(PCLK_GPIO1, "pclk_gpio1", "pclk_bus", 0, RK3308_CLKGATE_CON(6), 13, GFLAGS), 8838c2ecf20Sopenharmony_ci GATE(PCLK_GPIO2, "pclk_gpio2", "pclk_bus", 0, RK3308_CLKGATE_CON(6), 14, GFLAGS), 8848c2ecf20Sopenharmony_ci GATE(PCLK_GPIO3, "pclk_gpio3", "pclk_bus", 0, RK3308_CLKGATE_CON(6), 15, GFLAGS), 8858c2ecf20Sopenharmony_ci GATE(PCLK_GPIO4, "pclk_gpio4", "pclk_bus", 0, RK3308_CLKGATE_CON(7), 0, GFLAGS), 8868c2ecf20Sopenharmony_ci GATE(PCLK_SGRF, "pclk_sgrf", "pclk_bus", CLK_IGNORE_UNUSED, RK3308_CLKGATE_CON(7), 1, GFLAGS), 8878c2ecf20Sopenharmony_ci GATE(PCLK_GRF, "pclk_grf", "pclk_bus", CLK_IGNORE_UNUSED, RK3308_CLKGATE_CON(7), 2, GFLAGS), 8888c2ecf20Sopenharmony_ci GATE(PCLK_USBSD_DET, "pclk_usbsd_det", "pclk_bus", CLK_IGNORE_UNUSED, RK3308_CLKGATE_CON(7), 3, GFLAGS), 8898c2ecf20Sopenharmony_ci GATE(PCLK_DDR_UPCTL, "pclk_ddr_upctl", "pclk_bus", CLK_IGNORE_UNUSED, RK3308_CLKGATE_CON(7), 4, GFLAGS), 8908c2ecf20Sopenharmony_ci GATE(PCLK_DDR_MON, "pclk_ddr_mon", "pclk_bus", CLK_IGNORE_UNUSED, RK3308_CLKGATE_CON(7), 5, GFLAGS), 8918c2ecf20Sopenharmony_ci GATE(PCLK_DDRPHY, "pclk_ddrphy", "pclk_bus", CLK_IGNORE_UNUSED, RK3308_CLKGATE_CON(7), 6, GFLAGS), 8928c2ecf20Sopenharmony_ci GATE(PCLK_DDR_STDBY, "pclk_ddr_stdby", "pclk_bus", CLK_IGNORE_UNUSED, RK3308_CLKGATE_CON(7), 7, GFLAGS), 8938c2ecf20Sopenharmony_ci GATE(PCLK_USB_GRF, "pclk_usb_grf", "pclk_bus", CLK_IGNORE_UNUSED, RK3308_CLKGATE_CON(7), 8, GFLAGS), 8948c2ecf20Sopenharmony_ci GATE(PCLK_CRU, "pclk_cru", "pclk_bus", CLK_IGNORE_UNUSED, RK3308_CLKGATE_CON(7), 9, GFLAGS), 8958c2ecf20Sopenharmony_ci GATE(PCLK_OTP_PHY, "pclk_otp_phy", "pclk_bus", 0, RK3308_CLKGATE_CON(7), 10, GFLAGS), 8968c2ecf20Sopenharmony_ci GATE(PCLK_CPU_BOOST, "pclk_cpu_boost", "pclk_bus", CLK_IGNORE_UNUSED, RK3308_CLKGATE_CON(7), 11, GFLAGS), 8978c2ecf20Sopenharmony_ci GATE(PCLK_PWM1, "pclk_pwm1", "pclk_bus", CLK_IGNORE_UNUSED, RK3308_CLKGATE_CON(7), 12, GFLAGS), 8988c2ecf20Sopenharmony_ci GATE(PCLK_PWM2, "pclk_pwm2", "pclk_bus", CLK_IGNORE_UNUSED, RK3308_CLKGATE_CON(7), 13, GFLAGS), 8998c2ecf20Sopenharmony_ci GATE(PCLK_CAN, "pclk_can", "pclk_bus", CLK_IGNORE_UNUSED, RK3308_CLKGATE_CON(7), 14, GFLAGS), 9008c2ecf20Sopenharmony_ci GATE(PCLK_OWIRE, "pclk_owire", "pclk_bus", CLK_IGNORE_UNUSED, RK3308_CLKGATE_CON(7), 15, GFLAGS), 9018c2ecf20Sopenharmony_ci}; 9028c2ecf20Sopenharmony_ci 9038c2ecf20Sopenharmony_cistatic const char *const rk3308_critical_clocks[] __initconst = { 9048c2ecf20Sopenharmony_ci "aclk_bus", 9058c2ecf20Sopenharmony_ci "hclk_bus", 9068c2ecf20Sopenharmony_ci "pclk_bus", 9078c2ecf20Sopenharmony_ci "aclk_peri", 9088c2ecf20Sopenharmony_ci "hclk_peri", 9098c2ecf20Sopenharmony_ci "pclk_peri", 9108c2ecf20Sopenharmony_ci "hclk_audio", 9118c2ecf20Sopenharmony_ci "pclk_audio", 9128c2ecf20Sopenharmony_ci "sclk_ddrc", 9138c2ecf20Sopenharmony_ci}; 9148c2ecf20Sopenharmony_ci 9158c2ecf20Sopenharmony_cistatic void __init rk3308_clk_init(struct device_node *np) 9168c2ecf20Sopenharmony_ci{ 9178c2ecf20Sopenharmony_ci struct rockchip_clk_provider *ctx; 9188c2ecf20Sopenharmony_ci void __iomem *reg_base; 9198c2ecf20Sopenharmony_ci 9208c2ecf20Sopenharmony_ci reg_base = of_iomap(np, 0); 9218c2ecf20Sopenharmony_ci if (!reg_base) { 9228c2ecf20Sopenharmony_ci pr_err("%s: could not map cru region\n", __func__); 9238c2ecf20Sopenharmony_ci return; 9248c2ecf20Sopenharmony_ci } 9258c2ecf20Sopenharmony_ci 9268c2ecf20Sopenharmony_ci ctx = rockchip_clk_init(np, reg_base, CLK_NR_CLKS); 9278c2ecf20Sopenharmony_ci if (IS_ERR(ctx)) { 9288c2ecf20Sopenharmony_ci pr_err("%s: rockchip clk init failed\n", __func__); 9298c2ecf20Sopenharmony_ci iounmap(reg_base); 9308c2ecf20Sopenharmony_ci return; 9318c2ecf20Sopenharmony_ci } 9328c2ecf20Sopenharmony_ci 9338c2ecf20Sopenharmony_ci rockchip_clk_register_plls(ctx, rk3308_pll_clks, 9348c2ecf20Sopenharmony_ci ARRAY_SIZE(rk3308_pll_clks), 9358c2ecf20Sopenharmony_ci RK3308_GRF_SOC_STATUS0); 9368c2ecf20Sopenharmony_ci rockchip_clk_register_branches(ctx, rk3308_clk_branches, 9378c2ecf20Sopenharmony_ci ARRAY_SIZE(rk3308_clk_branches)); 9388c2ecf20Sopenharmony_ci rockchip_clk_protect_critical(rk3308_critical_clocks, 9398c2ecf20Sopenharmony_ci ARRAY_SIZE(rk3308_critical_clocks)); 9408c2ecf20Sopenharmony_ci 9418c2ecf20Sopenharmony_ci rockchip_clk_register_armclk(ctx, ARMCLK, "armclk", 9428c2ecf20Sopenharmony_ci mux_armclk_p, ARRAY_SIZE(mux_armclk_p), 9438c2ecf20Sopenharmony_ci &rk3308_cpuclk_data, rk3308_cpuclk_rates, 9448c2ecf20Sopenharmony_ci ARRAY_SIZE(rk3308_cpuclk_rates)); 9458c2ecf20Sopenharmony_ci 9468c2ecf20Sopenharmony_ci rockchip_register_softrst(np, 10, reg_base + RK3308_SOFTRST_CON(0), 9478c2ecf20Sopenharmony_ci ROCKCHIP_SOFTRST_HIWORD_MASK); 9488c2ecf20Sopenharmony_ci 9498c2ecf20Sopenharmony_ci rockchip_register_restart_notifier(ctx, RK3308_GLB_SRST_FST, NULL); 9508c2ecf20Sopenharmony_ci 9518c2ecf20Sopenharmony_ci rockchip_clk_of_add_provider(np, ctx); 9528c2ecf20Sopenharmony_ci} 9538c2ecf20Sopenharmony_ci 9548c2ecf20Sopenharmony_ciCLK_OF_DECLARE(rk3308_cru, "rockchip,rk3308-cru", rk3308_clk_init); 955