18c2ecf20Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0-only 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * Copyright (c) 2014 Samsung Electronics Co., Ltd. 48c2ecf20Sopenharmony_ci * Author: Naveen Krishna Ch <naveenkrishna.ch@gmail.com> 58c2ecf20Sopenharmony_ci*/ 68c2ecf20Sopenharmony_ci 78c2ecf20Sopenharmony_ci#include <linux/clk-provider.h> 88c2ecf20Sopenharmony_ci#include <linux/of.h> 98c2ecf20Sopenharmony_ci 108c2ecf20Sopenharmony_ci#include "clk.h" 118c2ecf20Sopenharmony_ci#include <dt-bindings/clock/exynos7-clk.h> 128c2ecf20Sopenharmony_ci 138c2ecf20Sopenharmony_ci/* Register Offset definitions for CMU_TOPC (0x10570000) */ 148c2ecf20Sopenharmony_ci#define CC_PLL_LOCK 0x0000 158c2ecf20Sopenharmony_ci#define BUS0_PLL_LOCK 0x0004 168c2ecf20Sopenharmony_ci#define BUS1_DPLL_LOCK 0x0008 178c2ecf20Sopenharmony_ci#define MFC_PLL_LOCK 0x000C 188c2ecf20Sopenharmony_ci#define AUD_PLL_LOCK 0x0010 198c2ecf20Sopenharmony_ci#define CC_PLL_CON0 0x0100 208c2ecf20Sopenharmony_ci#define BUS0_PLL_CON0 0x0110 218c2ecf20Sopenharmony_ci#define BUS1_DPLL_CON0 0x0120 228c2ecf20Sopenharmony_ci#define MFC_PLL_CON0 0x0130 238c2ecf20Sopenharmony_ci#define AUD_PLL_CON0 0x0140 248c2ecf20Sopenharmony_ci#define MUX_SEL_TOPC0 0x0200 258c2ecf20Sopenharmony_ci#define MUX_SEL_TOPC1 0x0204 268c2ecf20Sopenharmony_ci#define MUX_SEL_TOPC2 0x0208 278c2ecf20Sopenharmony_ci#define MUX_SEL_TOPC3 0x020C 288c2ecf20Sopenharmony_ci#define DIV_TOPC0 0x0600 298c2ecf20Sopenharmony_ci#define DIV_TOPC1 0x0604 308c2ecf20Sopenharmony_ci#define DIV_TOPC3 0x060C 318c2ecf20Sopenharmony_ci#define ENABLE_ACLK_TOPC0 0x0800 328c2ecf20Sopenharmony_ci#define ENABLE_ACLK_TOPC1 0x0804 338c2ecf20Sopenharmony_ci#define ENABLE_SCLK_TOPC1 0x0A04 348c2ecf20Sopenharmony_ci 358c2ecf20Sopenharmony_cistatic const struct samsung_fixed_factor_clock topc_fixed_factor_clks[] __initconst = { 368c2ecf20Sopenharmony_ci FFACTOR(0, "ffac_topc_bus0_pll_div2", "mout_topc_bus0_pll", 1, 2, 0), 378c2ecf20Sopenharmony_ci FFACTOR(0, "ffac_topc_bus0_pll_div4", 388c2ecf20Sopenharmony_ci "ffac_topc_bus0_pll_div2", 1, 2, 0), 398c2ecf20Sopenharmony_ci FFACTOR(0, "ffac_topc_bus1_pll_div2", "mout_topc_bus1_pll", 1, 2, 0), 408c2ecf20Sopenharmony_ci FFACTOR(0, "ffac_topc_cc_pll_div2", "mout_topc_cc_pll", 1, 2, 0), 418c2ecf20Sopenharmony_ci FFACTOR(0, "ffac_topc_mfc_pll_div2", "mout_topc_mfc_pll", 1, 2, 0), 428c2ecf20Sopenharmony_ci}; 438c2ecf20Sopenharmony_ci 448c2ecf20Sopenharmony_ci/* List of parent clocks for Muxes in CMU_TOPC */ 458c2ecf20Sopenharmony_ciPNAME(mout_topc_aud_pll_ctrl_p) = { "fin_pll", "fout_aud_pll" }; 468c2ecf20Sopenharmony_ciPNAME(mout_topc_bus0_pll_ctrl_p) = { "fin_pll", "fout_bus0_pll" }; 478c2ecf20Sopenharmony_ciPNAME(mout_topc_bus1_pll_ctrl_p) = { "fin_pll", "fout_bus1_pll" }; 488c2ecf20Sopenharmony_ciPNAME(mout_topc_cc_pll_ctrl_p) = { "fin_pll", "fout_cc_pll" }; 498c2ecf20Sopenharmony_ciPNAME(mout_topc_mfc_pll_ctrl_p) = { "fin_pll", "fout_mfc_pll" }; 508c2ecf20Sopenharmony_ci 518c2ecf20Sopenharmony_ciPNAME(mout_topc_group2) = { "mout_topc_bus0_pll_half", 528c2ecf20Sopenharmony_ci "mout_topc_bus1_pll_half", "mout_topc_cc_pll_half", 538c2ecf20Sopenharmony_ci "mout_topc_mfc_pll_half" }; 548c2ecf20Sopenharmony_ci 558c2ecf20Sopenharmony_ciPNAME(mout_topc_bus0_pll_half_p) = { "mout_topc_bus0_pll", 568c2ecf20Sopenharmony_ci "ffac_topc_bus0_pll_div2", "ffac_topc_bus0_pll_div4"}; 578c2ecf20Sopenharmony_ciPNAME(mout_topc_bus1_pll_half_p) = { "mout_topc_bus1_pll", 588c2ecf20Sopenharmony_ci "ffac_topc_bus1_pll_div2"}; 598c2ecf20Sopenharmony_ciPNAME(mout_topc_cc_pll_half_p) = { "mout_topc_cc_pll", 608c2ecf20Sopenharmony_ci "ffac_topc_cc_pll_div2"}; 618c2ecf20Sopenharmony_ciPNAME(mout_topc_mfc_pll_half_p) = { "mout_topc_mfc_pll", 628c2ecf20Sopenharmony_ci "ffac_topc_mfc_pll_div2"}; 638c2ecf20Sopenharmony_ci 648c2ecf20Sopenharmony_ci 658c2ecf20Sopenharmony_ciPNAME(mout_topc_bus0_pll_out_p) = {"mout_topc_bus0_pll", 668c2ecf20Sopenharmony_ci "ffac_topc_bus0_pll_div2"}; 678c2ecf20Sopenharmony_ci 688c2ecf20Sopenharmony_cistatic const unsigned long topc_clk_regs[] __initconst = { 698c2ecf20Sopenharmony_ci CC_PLL_LOCK, 708c2ecf20Sopenharmony_ci BUS0_PLL_LOCK, 718c2ecf20Sopenharmony_ci BUS1_DPLL_LOCK, 728c2ecf20Sopenharmony_ci MFC_PLL_LOCK, 738c2ecf20Sopenharmony_ci AUD_PLL_LOCK, 748c2ecf20Sopenharmony_ci CC_PLL_CON0, 758c2ecf20Sopenharmony_ci BUS0_PLL_CON0, 768c2ecf20Sopenharmony_ci BUS1_DPLL_CON0, 778c2ecf20Sopenharmony_ci MFC_PLL_CON0, 788c2ecf20Sopenharmony_ci AUD_PLL_CON0, 798c2ecf20Sopenharmony_ci MUX_SEL_TOPC0, 808c2ecf20Sopenharmony_ci MUX_SEL_TOPC1, 818c2ecf20Sopenharmony_ci MUX_SEL_TOPC2, 828c2ecf20Sopenharmony_ci MUX_SEL_TOPC3, 838c2ecf20Sopenharmony_ci DIV_TOPC0, 848c2ecf20Sopenharmony_ci DIV_TOPC1, 858c2ecf20Sopenharmony_ci DIV_TOPC3, 868c2ecf20Sopenharmony_ci}; 878c2ecf20Sopenharmony_ci 888c2ecf20Sopenharmony_cistatic const struct samsung_mux_clock topc_mux_clks[] __initconst = { 898c2ecf20Sopenharmony_ci MUX(0, "mout_topc_bus0_pll", mout_topc_bus0_pll_ctrl_p, 908c2ecf20Sopenharmony_ci MUX_SEL_TOPC0, 0, 1), 918c2ecf20Sopenharmony_ci MUX(0, "mout_topc_bus1_pll", mout_topc_bus1_pll_ctrl_p, 928c2ecf20Sopenharmony_ci MUX_SEL_TOPC0, 4, 1), 938c2ecf20Sopenharmony_ci MUX(0, "mout_topc_cc_pll", mout_topc_cc_pll_ctrl_p, 948c2ecf20Sopenharmony_ci MUX_SEL_TOPC0, 8, 1), 958c2ecf20Sopenharmony_ci MUX(0, "mout_topc_mfc_pll", mout_topc_mfc_pll_ctrl_p, 968c2ecf20Sopenharmony_ci MUX_SEL_TOPC0, 12, 1), 978c2ecf20Sopenharmony_ci MUX(0, "mout_topc_bus0_pll_half", mout_topc_bus0_pll_half_p, 988c2ecf20Sopenharmony_ci MUX_SEL_TOPC0, 16, 2), 998c2ecf20Sopenharmony_ci MUX(0, "mout_topc_bus1_pll_half", mout_topc_bus1_pll_half_p, 1008c2ecf20Sopenharmony_ci MUX_SEL_TOPC0, 20, 1), 1018c2ecf20Sopenharmony_ci MUX(0, "mout_topc_cc_pll_half", mout_topc_cc_pll_half_p, 1028c2ecf20Sopenharmony_ci MUX_SEL_TOPC0, 24, 1), 1038c2ecf20Sopenharmony_ci MUX(0, "mout_topc_mfc_pll_half", mout_topc_mfc_pll_half_p, 1048c2ecf20Sopenharmony_ci MUX_SEL_TOPC0, 28, 1), 1058c2ecf20Sopenharmony_ci 1068c2ecf20Sopenharmony_ci MUX(0, "mout_topc_aud_pll", mout_topc_aud_pll_ctrl_p, 1078c2ecf20Sopenharmony_ci MUX_SEL_TOPC1, 0, 1), 1088c2ecf20Sopenharmony_ci MUX(0, "mout_topc_bus0_pll_out", mout_topc_bus0_pll_out_p, 1098c2ecf20Sopenharmony_ci MUX_SEL_TOPC1, 16, 1), 1108c2ecf20Sopenharmony_ci 1118c2ecf20Sopenharmony_ci MUX(0, "mout_aclk_ccore_133", mout_topc_group2, MUX_SEL_TOPC2, 4, 2), 1128c2ecf20Sopenharmony_ci 1138c2ecf20Sopenharmony_ci MUX(0, "mout_aclk_mscl_532", mout_topc_group2, MUX_SEL_TOPC3, 20, 2), 1148c2ecf20Sopenharmony_ci MUX(0, "mout_aclk_peris_66", mout_topc_group2, MUX_SEL_TOPC3, 24, 2), 1158c2ecf20Sopenharmony_ci}; 1168c2ecf20Sopenharmony_ci 1178c2ecf20Sopenharmony_cistatic const struct samsung_div_clock topc_div_clks[] __initconst = { 1188c2ecf20Sopenharmony_ci DIV(DOUT_ACLK_CCORE_133, "dout_aclk_ccore_133", "mout_aclk_ccore_133", 1198c2ecf20Sopenharmony_ci DIV_TOPC0, 4, 4), 1208c2ecf20Sopenharmony_ci 1218c2ecf20Sopenharmony_ci DIV(DOUT_ACLK_MSCL_532, "dout_aclk_mscl_532", "mout_aclk_mscl_532", 1228c2ecf20Sopenharmony_ci DIV_TOPC1, 20, 4), 1238c2ecf20Sopenharmony_ci DIV(DOUT_ACLK_PERIS, "dout_aclk_peris_66", "mout_aclk_peris_66", 1248c2ecf20Sopenharmony_ci DIV_TOPC1, 24, 4), 1258c2ecf20Sopenharmony_ci 1268c2ecf20Sopenharmony_ci DIV(DOUT_SCLK_BUS0_PLL, "dout_sclk_bus0_pll", "mout_topc_bus0_pll_out", 1278c2ecf20Sopenharmony_ci DIV_TOPC3, 0, 4), 1288c2ecf20Sopenharmony_ci DIV(DOUT_SCLK_BUS1_PLL, "dout_sclk_bus1_pll", "mout_topc_bus1_pll", 1298c2ecf20Sopenharmony_ci DIV_TOPC3, 8, 4), 1308c2ecf20Sopenharmony_ci DIV(DOUT_SCLK_CC_PLL, "dout_sclk_cc_pll", "mout_topc_cc_pll", 1318c2ecf20Sopenharmony_ci DIV_TOPC3, 12, 4), 1328c2ecf20Sopenharmony_ci DIV(DOUT_SCLK_MFC_PLL, "dout_sclk_mfc_pll", "mout_topc_mfc_pll", 1338c2ecf20Sopenharmony_ci DIV_TOPC3, 16, 4), 1348c2ecf20Sopenharmony_ci DIV(DOUT_SCLK_AUD_PLL, "dout_sclk_aud_pll", "mout_topc_aud_pll", 1358c2ecf20Sopenharmony_ci DIV_TOPC3, 28, 4), 1368c2ecf20Sopenharmony_ci}; 1378c2ecf20Sopenharmony_ci 1388c2ecf20Sopenharmony_cistatic const struct samsung_pll_rate_table pll1460x_24mhz_tbl[] __initconst = { 1398c2ecf20Sopenharmony_ci PLL_36XX_RATE(24 * MHZ, 491519897, 20, 1, 0, 31457), 1408c2ecf20Sopenharmony_ci {}, 1418c2ecf20Sopenharmony_ci}; 1428c2ecf20Sopenharmony_ci 1438c2ecf20Sopenharmony_cistatic const struct samsung_gate_clock topc_gate_clks[] __initconst = { 1448c2ecf20Sopenharmony_ci GATE(ACLK_CCORE_133, "aclk_ccore_133", "dout_aclk_ccore_133", 1458c2ecf20Sopenharmony_ci ENABLE_ACLK_TOPC0, 4, CLK_IS_CRITICAL, 0), 1468c2ecf20Sopenharmony_ci 1478c2ecf20Sopenharmony_ci GATE(ACLK_MSCL_532, "aclk_mscl_532", "dout_aclk_mscl_532", 1488c2ecf20Sopenharmony_ci ENABLE_ACLK_TOPC1, 20, 0, 0), 1498c2ecf20Sopenharmony_ci 1508c2ecf20Sopenharmony_ci GATE(ACLK_PERIS_66, "aclk_peris_66", "dout_aclk_peris_66", 1518c2ecf20Sopenharmony_ci ENABLE_ACLK_TOPC1, 24, 0, 0), 1528c2ecf20Sopenharmony_ci 1538c2ecf20Sopenharmony_ci GATE(SCLK_AUD_PLL, "sclk_aud_pll", "dout_sclk_aud_pll", 1548c2ecf20Sopenharmony_ci ENABLE_SCLK_TOPC1, 20, 0, 0), 1558c2ecf20Sopenharmony_ci GATE(SCLK_MFC_PLL_B, "sclk_mfc_pll_b", "dout_sclk_mfc_pll", 1568c2ecf20Sopenharmony_ci ENABLE_SCLK_TOPC1, 17, 0, 0), 1578c2ecf20Sopenharmony_ci GATE(SCLK_MFC_PLL_A, "sclk_mfc_pll_a", "dout_sclk_mfc_pll", 1588c2ecf20Sopenharmony_ci ENABLE_SCLK_TOPC1, 16, 0, 0), 1598c2ecf20Sopenharmony_ci GATE(SCLK_BUS1_PLL_B, "sclk_bus1_pll_b", "dout_sclk_bus1_pll", 1608c2ecf20Sopenharmony_ci ENABLE_SCLK_TOPC1, 13, 0, 0), 1618c2ecf20Sopenharmony_ci GATE(SCLK_BUS1_PLL_A, "sclk_bus1_pll_a", "dout_sclk_bus1_pll", 1628c2ecf20Sopenharmony_ci ENABLE_SCLK_TOPC1, 12, 0, 0), 1638c2ecf20Sopenharmony_ci GATE(SCLK_BUS0_PLL_B, "sclk_bus0_pll_b", "dout_sclk_bus0_pll", 1648c2ecf20Sopenharmony_ci ENABLE_SCLK_TOPC1, 5, 0, 0), 1658c2ecf20Sopenharmony_ci GATE(SCLK_BUS0_PLL_A, "sclk_bus0_pll_a", "dout_sclk_bus0_pll", 1668c2ecf20Sopenharmony_ci ENABLE_SCLK_TOPC1, 4, 0, 0), 1678c2ecf20Sopenharmony_ci GATE(SCLK_CC_PLL_B, "sclk_cc_pll_b", "dout_sclk_cc_pll", 1688c2ecf20Sopenharmony_ci ENABLE_SCLK_TOPC1, 1, 0, 0), 1698c2ecf20Sopenharmony_ci GATE(SCLK_CC_PLL_A, "sclk_cc_pll_a", "dout_sclk_cc_pll", 1708c2ecf20Sopenharmony_ci ENABLE_SCLK_TOPC1, 0, 0, 0), 1718c2ecf20Sopenharmony_ci}; 1728c2ecf20Sopenharmony_ci 1738c2ecf20Sopenharmony_cistatic const struct samsung_pll_clock topc_pll_clks[] __initconst = { 1748c2ecf20Sopenharmony_ci PLL(pll_1451x, 0, "fout_bus0_pll", "fin_pll", BUS0_PLL_LOCK, 1758c2ecf20Sopenharmony_ci BUS0_PLL_CON0, NULL), 1768c2ecf20Sopenharmony_ci PLL(pll_1452x, 0, "fout_cc_pll", "fin_pll", CC_PLL_LOCK, 1778c2ecf20Sopenharmony_ci CC_PLL_CON0, NULL), 1788c2ecf20Sopenharmony_ci PLL(pll_1452x, 0, "fout_bus1_pll", "fin_pll", BUS1_DPLL_LOCK, 1798c2ecf20Sopenharmony_ci BUS1_DPLL_CON0, NULL), 1808c2ecf20Sopenharmony_ci PLL(pll_1452x, 0, "fout_mfc_pll", "fin_pll", MFC_PLL_LOCK, 1818c2ecf20Sopenharmony_ci MFC_PLL_CON0, NULL), 1828c2ecf20Sopenharmony_ci PLL(pll_1460x, FOUT_AUD_PLL, "fout_aud_pll", "fin_pll", AUD_PLL_LOCK, 1838c2ecf20Sopenharmony_ci AUD_PLL_CON0, pll1460x_24mhz_tbl), 1848c2ecf20Sopenharmony_ci}; 1858c2ecf20Sopenharmony_ci 1868c2ecf20Sopenharmony_cistatic const struct samsung_cmu_info topc_cmu_info __initconst = { 1878c2ecf20Sopenharmony_ci .pll_clks = topc_pll_clks, 1888c2ecf20Sopenharmony_ci .nr_pll_clks = ARRAY_SIZE(topc_pll_clks), 1898c2ecf20Sopenharmony_ci .mux_clks = topc_mux_clks, 1908c2ecf20Sopenharmony_ci .nr_mux_clks = ARRAY_SIZE(topc_mux_clks), 1918c2ecf20Sopenharmony_ci .div_clks = topc_div_clks, 1928c2ecf20Sopenharmony_ci .nr_div_clks = ARRAY_SIZE(topc_div_clks), 1938c2ecf20Sopenharmony_ci .gate_clks = topc_gate_clks, 1948c2ecf20Sopenharmony_ci .nr_gate_clks = ARRAY_SIZE(topc_gate_clks), 1958c2ecf20Sopenharmony_ci .fixed_factor_clks = topc_fixed_factor_clks, 1968c2ecf20Sopenharmony_ci .nr_fixed_factor_clks = ARRAY_SIZE(topc_fixed_factor_clks), 1978c2ecf20Sopenharmony_ci .nr_clk_ids = TOPC_NR_CLK, 1988c2ecf20Sopenharmony_ci .clk_regs = topc_clk_regs, 1998c2ecf20Sopenharmony_ci .nr_clk_regs = ARRAY_SIZE(topc_clk_regs), 2008c2ecf20Sopenharmony_ci}; 2018c2ecf20Sopenharmony_ci 2028c2ecf20Sopenharmony_cistatic void __init exynos7_clk_topc_init(struct device_node *np) 2038c2ecf20Sopenharmony_ci{ 2048c2ecf20Sopenharmony_ci samsung_cmu_register_one(np, &topc_cmu_info); 2058c2ecf20Sopenharmony_ci} 2068c2ecf20Sopenharmony_ci 2078c2ecf20Sopenharmony_ciCLK_OF_DECLARE(exynos7_clk_topc, "samsung,exynos7-clock-topc", 2088c2ecf20Sopenharmony_ci exynos7_clk_topc_init); 2098c2ecf20Sopenharmony_ci 2108c2ecf20Sopenharmony_ci/* Register Offset definitions for CMU_TOP0 (0x105D0000) */ 2118c2ecf20Sopenharmony_ci#define MUX_SEL_TOP00 0x0200 2128c2ecf20Sopenharmony_ci#define MUX_SEL_TOP01 0x0204 2138c2ecf20Sopenharmony_ci#define MUX_SEL_TOP03 0x020C 2148c2ecf20Sopenharmony_ci#define MUX_SEL_TOP0_PERIC0 0x0230 2158c2ecf20Sopenharmony_ci#define MUX_SEL_TOP0_PERIC1 0x0234 2168c2ecf20Sopenharmony_ci#define MUX_SEL_TOP0_PERIC2 0x0238 2178c2ecf20Sopenharmony_ci#define MUX_SEL_TOP0_PERIC3 0x023C 2188c2ecf20Sopenharmony_ci#define DIV_TOP03 0x060C 2198c2ecf20Sopenharmony_ci#define DIV_TOP0_PERIC0 0x0630 2208c2ecf20Sopenharmony_ci#define DIV_TOP0_PERIC1 0x0634 2218c2ecf20Sopenharmony_ci#define DIV_TOP0_PERIC2 0x0638 2228c2ecf20Sopenharmony_ci#define DIV_TOP0_PERIC3 0x063C 2238c2ecf20Sopenharmony_ci#define ENABLE_ACLK_TOP03 0x080C 2248c2ecf20Sopenharmony_ci#define ENABLE_SCLK_TOP0_PERIC0 0x0A30 2258c2ecf20Sopenharmony_ci#define ENABLE_SCLK_TOP0_PERIC1 0x0A34 2268c2ecf20Sopenharmony_ci#define ENABLE_SCLK_TOP0_PERIC2 0x0A38 2278c2ecf20Sopenharmony_ci#define ENABLE_SCLK_TOP0_PERIC3 0x0A3C 2288c2ecf20Sopenharmony_ci 2298c2ecf20Sopenharmony_ci/* List of parent clocks for Muxes in CMU_TOP0 */ 2308c2ecf20Sopenharmony_ciPNAME(mout_top0_bus0_pll_user_p) = { "fin_pll", "sclk_bus0_pll_a" }; 2318c2ecf20Sopenharmony_ciPNAME(mout_top0_bus1_pll_user_p) = { "fin_pll", "sclk_bus1_pll_a" }; 2328c2ecf20Sopenharmony_ciPNAME(mout_top0_cc_pll_user_p) = { "fin_pll", "sclk_cc_pll_a" }; 2338c2ecf20Sopenharmony_ciPNAME(mout_top0_mfc_pll_user_p) = { "fin_pll", "sclk_mfc_pll_a" }; 2348c2ecf20Sopenharmony_ciPNAME(mout_top0_aud_pll_user_p) = { "fin_pll", "sclk_aud_pll" }; 2358c2ecf20Sopenharmony_ci 2368c2ecf20Sopenharmony_ciPNAME(mout_top0_bus0_pll_half_p) = {"mout_top0_bus0_pll_user", 2378c2ecf20Sopenharmony_ci "ffac_top0_bus0_pll_div2"}; 2388c2ecf20Sopenharmony_ciPNAME(mout_top0_bus1_pll_half_p) = {"mout_top0_bus1_pll_user", 2398c2ecf20Sopenharmony_ci "ffac_top0_bus1_pll_div2"}; 2408c2ecf20Sopenharmony_ciPNAME(mout_top0_cc_pll_half_p) = {"mout_top0_cc_pll_user", 2418c2ecf20Sopenharmony_ci "ffac_top0_cc_pll_div2"}; 2428c2ecf20Sopenharmony_ciPNAME(mout_top0_mfc_pll_half_p) = {"mout_top0_mfc_pll_user", 2438c2ecf20Sopenharmony_ci "ffac_top0_mfc_pll_div2"}; 2448c2ecf20Sopenharmony_ci 2458c2ecf20Sopenharmony_ciPNAME(mout_top0_group1) = {"mout_top0_bus0_pll_half", 2468c2ecf20Sopenharmony_ci "mout_top0_bus1_pll_half", "mout_top0_cc_pll_half", 2478c2ecf20Sopenharmony_ci "mout_top0_mfc_pll_half"}; 2488c2ecf20Sopenharmony_ciPNAME(mout_top0_group3) = {"ioclk_audiocdclk0", 2498c2ecf20Sopenharmony_ci "ioclk_audiocdclk1", "ioclk_spdif_extclk", 2508c2ecf20Sopenharmony_ci "mout_top0_aud_pll_user", "mout_top0_bus0_pll_half", 2518c2ecf20Sopenharmony_ci "mout_top0_bus1_pll_half"}; 2528c2ecf20Sopenharmony_ciPNAME(mout_top0_group4) = {"ioclk_audiocdclk1", "mout_top0_aud_pll_user", 2538c2ecf20Sopenharmony_ci "mout_top0_bus0_pll_half", "mout_top0_bus1_pll_half"}; 2548c2ecf20Sopenharmony_ci 2558c2ecf20Sopenharmony_cistatic const unsigned long top0_clk_regs[] __initconst = { 2568c2ecf20Sopenharmony_ci MUX_SEL_TOP00, 2578c2ecf20Sopenharmony_ci MUX_SEL_TOP01, 2588c2ecf20Sopenharmony_ci MUX_SEL_TOP03, 2598c2ecf20Sopenharmony_ci MUX_SEL_TOP0_PERIC0, 2608c2ecf20Sopenharmony_ci MUX_SEL_TOP0_PERIC1, 2618c2ecf20Sopenharmony_ci MUX_SEL_TOP0_PERIC2, 2628c2ecf20Sopenharmony_ci MUX_SEL_TOP0_PERIC3, 2638c2ecf20Sopenharmony_ci DIV_TOP03, 2648c2ecf20Sopenharmony_ci DIV_TOP0_PERIC0, 2658c2ecf20Sopenharmony_ci DIV_TOP0_PERIC1, 2668c2ecf20Sopenharmony_ci DIV_TOP0_PERIC2, 2678c2ecf20Sopenharmony_ci DIV_TOP0_PERIC3, 2688c2ecf20Sopenharmony_ci ENABLE_SCLK_TOP0_PERIC0, 2698c2ecf20Sopenharmony_ci ENABLE_SCLK_TOP0_PERIC1, 2708c2ecf20Sopenharmony_ci ENABLE_SCLK_TOP0_PERIC2, 2718c2ecf20Sopenharmony_ci ENABLE_SCLK_TOP0_PERIC3, 2728c2ecf20Sopenharmony_ci}; 2738c2ecf20Sopenharmony_ci 2748c2ecf20Sopenharmony_cistatic const struct samsung_mux_clock top0_mux_clks[] __initconst = { 2758c2ecf20Sopenharmony_ci MUX(0, "mout_top0_aud_pll_user", mout_top0_aud_pll_user_p, 2768c2ecf20Sopenharmony_ci MUX_SEL_TOP00, 0, 1), 2778c2ecf20Sopenharmony_ci MUX(0, "mout_top0_mfc_pll_user", mout_top0_mfc_pll_user_p, 2788c2ecf20Sopenharmony_ci MUX_SEL_TOP00, 4, 1), 2798c2ecf20Sopenharmony_ci MUX(0, "mout_top0_cc_pll_user", mout_top0_cc_pll_user_p, 2808c2ecf20Sopenharmony_ci MUX_SEL_TOP00, 8, 1), 2818c2ecf20Sopenharmony_ci MUX(0, "mout_top0_bus1_pll_user", mout_top0_bus1_pll_user_p, 2828c2ecf20Sopenharmony_ci MUX_SEL_TOP00, 12, 1), 2838c2ecf20Sopenharmony_ci MUX(0, "mout_top0_bus0_pll_user", mout_top0_bus0_pll_user_p, 2848c2ecf20Sopenharmony_ci MUX_SEL_TOP00, 16, 1), 2858c2ecf20Sopenharmony_ci 2868c2ecf20Sopenharmony_ci MUX(0, "mout_top0_mfc_pll_half", mout_top0_mfc_pll_half_p, 2878c2ecf20Sopenharmony_ci MUX_SEL_TOP01, 4, 1), 2888c2ecf20Sopenharmony_ci MUX(0, "mout_top0_cc_pll_half", mout_top0_cc_pll_half_p, 2898c2ecf20Sopenharmony_ci MUX_SEL_TOP01, 8, 1), 2908c2ecf20Sopenharmony_ci MUX(0, "mout_top0_bus1_pll_half", mout_top0_bus1_pll_half_p, 2918c2ecf20Sopenharmony_ci MUX_SEL_TOP01, 12, 1), 2928c2ecf20Sopenharmony_ci MUX(0, "mout_top0_bus0_pll_half", mout_top0_bus0_pll_half_p, 2938c2ecf20Sopenharmony_ci MUX_SEL_TOP01, 16, 1), 2948c2ecf20Sopenharmony_ci 2958c2ecf20Sopenharmony_ci MUX(0, "mout_aclk_peric1_66", mout_top0_group1, MUX_SEL_TOP03, 12, 2), 2968c2ecf20Sopenharmony_ci MUX(0, "mout_aclk_peric0_66", mout_top0_group1, MUX_SEL_TOP03, 20, 2), 2978c2ecf20Sopenharmony_ci 2988c2ecf20Sopenharmony_ci MUX(0, "mout_sclk_spdif", mout_top0_group3, MUX_SEL_TOP0_PERIC0, 4, 3), 2998c2ecf20Sopenharmony_ci MUX(0, "mout_sclk_pcm1", mout_top0_group4, MUX_SEL_TOP0_PERIC0, 8, 2), 3008c2ecf20Sopenharmony_ci MUX(0, "mout_sclk_i2s1", mout_top0_group4, MUX_SEL_TOP0_PERIC0, 20, 2), 3018c2ecf20Sopenharmony_ci 3028c2ecf20Sopenharmony_ci MUX(0, "mout_sclk_spi1", mout_top0_group1, MUX_SEL_TOP0_PERIC1, 8, 2), 3038c2ecf20Sopenharmony_ci MUX(0, "mout_sclk_spi0", mout_top0_group1, MUX_SEL_TOP0_PERIC1, 20, 2), 3048c2ecf20Sopenharmony_ci 3058c2ecf20Sopenharmony_ci MUX(0, "mout_sclk_spi3", mout_top0_group1, MUX_SEL_TOP0_PERIC2, 8, 2), 3068c2ecf20Sopenharmony_ci MUX(0, "mout_sclk_spi2", mout_top0_group1, MUX_SEL_TOP0_PERIC2, 20, 2), 3078c2ecf20Sopenharmony_ci MUX(0, "mout_sclk_uart3", mout_top0_group1, MUX_SEL_TOP0_PERIC3, 4, 2), 3088c2ecf20Sopenharmony_ci MUX(0, "mout_sclk_uart2", mout_top0_group1, MUX_SEL_TOP0_PERIC3, 8, 2), 3098c2ecf20Sopenharmony_ci MUX(0, "mout_sclk_uart1", mout_top0_group1, MUX_SEL_TOP0_PERIC3, 12, 2), 3108c2ecf20Sopenharmony_ci MUX(0, "mout_sclk_uart0", mout_top0_group1, MUX_SEL_TOP0_PERIC3, 16, 2), 3118c2ecf20Sopenharmony_ci MUX(0, "mout_sclk_spi4", mout_top0_group1, MUX_SEL_TOP0_PERIC3, 20, 2), 3128c2ecf20Sopenharmony_ci}; 3138c2ecf20Sopenharmony_ci 3148c2ecf20Sopenharmony_cistatic const struct samsung_div_clock top0_div_clks[] __initconst = { 3158c2ecf20Sopenharmony_ci DIV(DOUT_ACLK_PERIC1, "dout_aclk_peric1_66", "mout_aclk_peric1_66", 3168c2ecf20Sopenharmony_ci DIV_TOP03, 12, 6), 3178c2ecf20Sopenharmony_ci DIV(DOUT_ACLK_PERIC0, "dout_aclk_peric0_66", "mout_aclk_peric0_66", 3188c2ecf20Sopenharmony_ci DIV_TOP03, 20, 6), 3198c2ecf20Sopenharmony_ci 3208c2ecf20Sopenharmony_ci DIV(0, "dout_sclk_spdif", "mout_sclk_spdif", DIV_TOP0_PERIC0, 4, 4), 3218c2ecf20Sopenharmony_ci DIV(0, "dout_sclk_pcm1", "mout_sclk_pcm1", DIV_TOP0_PERIC0, 8, 12), 3228c2ecf20Sopenharmony_ci DIV(0, "dout_sclk_i2s1", "mout_sclk_i2s1", DIV_TOP0_PERIC0, 20, 10), 3238c2ecf20Sopenharmony_ci 3248c2ecf20Sopenharmony_ci DIV(0, "dout_sclk_spi1", "mout_sclk_spi1", DIV_TOP0_PERIC1, 8, 12), 3258c2ecf20Sopenharmony_ci DIV(0, "dout_sclk_spi0", "mout_sclk_spi0", DIV_TOP0_PERIC1, 20, 12), 3268c2ecf20Sopenharmony_ci 3278c2ecf20Sopenharmony_ci DIV(0, "dout_sclk_spi3", "mout_sclk_spi3", DIV_TOP0_PERIC2, 8, 12), 3288c2ecf20Sopenharmony_ci DIV(0, "dout_sclk_spi2", "mout_sclk_spi2", DIV_TOP0_PERIC2, 20, 12), 3298c2ecf20Sopenharmony_ci 3308c2ecf20Sopenharmony_ci DIV(0, "dout_sclk_uart3", "mout_sclk_uart3", DIV_TOP0_PERIC3, 4, 4), 3318c2ecf20Sopenharmony_ci DIV(0, "dout_sclk_uart2", "mout_sclk_uart2", DIV_TOP0_PERIC3, 8, 4), 3328c2ecf20Sopenharmony_ci DIV(0, "dout_sclk_uart1", "mout_sclk_uart1", DIV_TOP0_PERIC3, 12, 4), 3338c2ecf20Sopenharmony_ci DIV(0, "dout_sclk_uart0", "mout_sclk_uart0", DIV_TOP0_PERIC3, 16, 4), 3348c2ecf20Sopenharmony_ci DIV(0, "dout_sclk_spi4", "mout_sclk_spi4", DIV_TOP0_PERIC3, 20, 12), 3358c2ecf20Sopenharmony_ci}; 3368c2ecf20Sopenharmony_ci 3378c2ecf20Sopenharmony_cistatic const struct samsung_gate_clock top0_gate_clks[] __initconst = { 3388c2ecf20Sopenharmony_ci GATE(CLK_ACLK_PERIC0_66, "aclk_peric0_66", "dout_aclk_peric0_66", 3398c2ecf20Sopenharmony_ci ENABLE_ACLK_TOP03, 20, CLK_SET_RATE_PARENT, 0), 3408c2ecf20Sopenharmony_ci GATE(CLK_ACLK_PERIC1_66, "aclk_peric1_66", "dout_aclk_peric1_66", 3418c2ecf20Sopenharmony_ci ENABLE_ACLK_TOP03, 12, CLK_SET_RATE_PARENT, 0), 3428c2ecf20Sopenharmony_ci 3438c2ecf20Sopenharmony_ci GATE(CLK_SCLK_SPDIF, "sclk_spdif", "dout_sclk_spdif", 3448c2ecf20Sopenharmony_ci ENABLE_SCLK_TOP0_PERIC0, 4, CLK_SET_RATE_PARENT, 0), 3458c2ecf20Sopenharmony_ci GATE(CLK_SCLK_PCM1, "sclk_pcm1", "dout_sclk_pcm1", 3468c2ecf20Sopenharmony_ci ENABLE_SCLK_TOP0_PERIC0, 8, CLK_SET_RATE_PARENT, 0), 3478c2ecf20Sopenharmony_ci GATE(CLK_SCLK_I2S1, "sclk_i2s1", "dout_sclk_i2s1", 3488c2ecf20Sopenharmony_ci ENABLE_SCLK_TOP0_PERIC0, 20, CLK_SET_RATE_PARENT, 0), 3498c2ecf20Sopenharmony_ci 3508c2ecf20Sopenharmony_ci GATE(CLK_SCLK_SPI1, "sclk_spi1", "dout_sclk_spi1", 3518c2ecf20Sopenharmony_ci ENABLE_SCLK_TOP0_PERIC1, 8, CLK_SET_RATE_PARENT, 0), 3528c2ecf20Sopenharmony_ci GATE(CLK_SCLK_SPI0, "sclk_spi0", "dout_sclk_spi0", 3538c2ecf20Sopenharmony_ci ENABLE_SCLK_TOP0_PERIC1, 20, CLK_SET_RATE_PARENT, 0), 3548c2ecf20Sopenharmony_ci 3558c2ecf20Sopenharmony_ci GATE(CLK_SCLK_SPI3, "sclk_spi3", "dout_sclk_spi3", 3568c2ecf20Sopenharmony_ci ENABLE_SCLK_TOP0_PERIC2, 8, CLK_SET_RATE_PARENT, 0), 3578c2ecf20Sopenharmony_ci GATE(CLK_SCLK_SPI2, "sclk_spi2", "dout_sclk_spi2", 3588c2ecf20Sopenharmony_ci ENABLE_SCLK_TOP0_PERIC2, 20, CLK_SET_RATE_PARENT, 0), 3598c2ecf20Sopenharmony_ci GATE(CLK_SCLK_UART3, "sclk_uart3", "dout_sclk_uart3", 3608c2ecf20Sopenharmony_ci ENABLE_SCLK_TOP0_PERIC3, 4, 0, 0), 3618c2ecf20Sopenharmony_ci GATE(CLK_SCLK_UART2, "sclk_uart2", "dout_sclk_uart2", 3628c2ecf20Sopenharmony_ci ENABLE_SCLK_TOP0_PERIC3, 8, 0, 0), 3638c2ecf20Sopenharmony_ci GATE(CLK_SCLK_UART1, "sclk_uart1", "dout_sclk_uart1", 3648c2ecf20Sopenharmony_ci ENABLE_SCLK_TOP0_PERIC3, 12, 0, 0), 3658c2ecf20Sopenharmony_ci GATE(CLK_SCLK_UART0, "sclk_uart0", "dout_sclk_uart0", 3668c2ecf20Sopenharmony_ci ENABLE_SCLK_TOP0_PERIC3, 16, 0, 0), 3678c2ecf20Sopenharmony_ci GATE(CLK_SCLK_SPI4, "sclk_spi4", "dout_sclk_spi4", 3688c2ecf20Sopenharmony_ci ENABLE_SCLK_TOP0_PERIC3, 20, CLK_SET_RATE_PARENT, 0), 3698c2ecf20Sopenharmony_ci}; 3708c2ecf20Sopenharmony_ci 3718c2ecf20Sopenharmony_cistatic const struct samsung_fixed_factor_clock top0_fixed_factor_clks[] __initconst = { 3728c2ecf20Sopenharmony_ci FFACTOR(0, "ffac_top0_bus0_pll_div2", "mout_top0_bus0_pll_user", 3738c2ecf20Sopenharmony_ci 1, 2, 0), 3748c2ecf20Sopenharmony_ci FFACTOR(0, "ffac_top0_bus1_pll_div2", "mout_top0_bus1_pll_user", 3758c2ecf20Sopenharmony_ci 1, 2, 0), 3768c2ecf20Sopenharmony_ci FFACTOR(0, "ffac_top0_cc_pll_div2", "mout_top0_cc_pll_user", 1, 2, 0), 3778c2ecf20Sopenharmony_ci FFACTOR(0, "ffac_top0_mfc_pll_div2", "mout_top0_mfc_pll_user", 1, 2, 0), 3788c2ecf20Sopenharmony_ci}; 3798c2ecf20Sopenharmony_ci 3808c2ecf20Sopenharmony_cistatic const struct samsung_cmu_info top0_cmu_info __initconst = { 3818c2ecf20Sopenharmony_ci .mux_clks = top0_mux_clks, 3828c2ecf20Sopenharmony_ci .nr_mux_clks = ARRAY_SIZE(top0_mux_clks), 3838c2ecf20Sopenharmony_ci .div_clks = top0_div_clks, 3848c2ecf20Sopenharmony_ci .nr_div_clks = ARRAY_SIZE(top0_div_clks), 3858c2ecf20Sopenharmony_ci .gate_clks = top0_gate_clks, 3868c2ecf20Sopenharmony_ci .nr_gate_clks = ARRAY_SIZE(top0_gate_clks), 3878c2ecf20Sopenharmony_ci .fixed_factor_clks = top0_fixed_factor_clks, 3888c2ecf20Sopenharmony_ci .nr_fixed_factor_clks = ARRAY_SIZE(top0_fixed_factor_clks), 3898c2ecf20Sopenharmony_ci .nr_clk_ids = TOP0_NR_CLK, 3908c2ecf20Sopenharmony_ci .clk_regs = top0_clk_regs, 3918c2ecf20Sopenharmony_ci .nr_clk_regs = ARRAY_SIZE(top0_clk_regs), 3928c2ecf20Sopenharmony_ci}; 3938c2ecf20Sopenharmony_ci 3948c2ecf20Sopenharmony_cistatic void __init exynos7_clk_top0_init(struct device_node *np) 3958c2ecf20Sopenharmony_ci{ 3968c2ecf20Sopenharmony_ci samsung_cmu_register_one(np, &top0_cmu_info); 3978c2ecf20Sopenharmony_ci} 3988c2ecf20Sopenharmony_ci 3998c2ecf20Sopenharmony_ciCLK_OF_DECLARE(exynos7_clk_top0, "samsung,exynos7-clock-top0", 4008c2ecf20Sopenharmony_ci exynos7_clk_top0_init); 4018c2ecf20Sopenharmony_ci 4028c2ecf20Sopenharmony_ci/* Register Offset definitions for CMU_TOP1 (0x105E0000) */ 4038c2ecf20Sopenharmony_ci#define MUX_SEL_TOP10 0x0200 4048c2ecf20Sopenharmony_ci#define MUX_SEL_TOP11 0x0204 4058c2ecf20Sopenharmony_ci#define MUX_SEL_TOP13 0x020C 4068c2ecf20Sopenharmony_ci#define MUX_SEL_TOP1_FSYS0 0x0224 4078c2ecf20Sopenharmony_ci#define MUX_SEL_TOP1_FSYS1 0x0228 4088c2ecf20Sopenharmony_ci#define MUX_SEL_TOP1_FSYS11 0x022C 4098c2ecf20Sopenharmony_ci#define DIV_TOP13 0x060C 4108c2ecf20Sopenharmony_ci#define DIV_TOP1_FSYS0 0x0624 4118c2ecf20Sopenharmony_ci#define DIV_TOP1_FSYS1 0x0628 4128c2ecf20Sopenharmony_ci#define DIV_TOP1_FSYS11 0x062C 4138c2ecf20Sopenharmony_ci#define ENABLE_ACLK_TOP13 0x080C 4148c2ecf20Sopenharmony_ci#define ENABLE_SCLK_TOP1_FSYS0 0x0A24 4158c2ecf20Sopenharmony_ci#define ENABLE_SCLK_TOP1_FSYS1 0x0A28 4168c2ecf20Sopenharmony_ci#define ENABLE_SCLK_TOP1_FSYS11 0x0A2C 4178c2ecf20Sopenharmony_ci 4188c2ecf20Sopenharmony_ci/* List of parent clocks for Muxes in CMU_TOP1 */ 4198c2ecf20Sopenharmony_ciPNAME(mout_top1_bus0_pll_user_p) = { "fin_pll", "sclk_bus0_pll_b" }; 4208c2ecf20Sopenharmony_ciPNAME(mout_top1_bus1_pll_user_p) = { "fin_pll", "sclk_bus1_pll_b" }; 4218c2ecf20Sopenharmony_ciPNAME(mout_top1_cc_pll_user_p) = { "fin_pll", "sclk_cc_pll_b" }; 4228c2ecf20Sopenharmony_ciPNAME(mout_top1_mfc_pll_user_p) = { "fin_pll", "sclk_mfc_pll_b" }; 4238c2ecf20Sopenharmony_ci 4248c2ecf20Sopenharmony_ciPNAME(mout_top1_bus0_pll_half_p) = {"mout_top1_bus0_pll_user", 4258c2ecf20Sopenharmony_ci "ffac_top1_bus0_pll_div2"}; 4268c2ecf20Sopenharmony_ciPNAME(mout_top1_bus1_pll_half_p) = {"mout_top1_bus1_pll_user", 4278c2ecf20Sopenharmony_ci "ffac_top1_bus1_pll_div2"}; 4288c2ecf20Sopenharmony_ciPNAME(mout_top1_cc_pll_half_p) = {"mout_top1_cc_pll_user", 4298c2ecf20Sopenharmony_ci "ffac_top1_cc_pll_div2"}; 4308c2ecf20Sopenharmony_ciPNAME(mout_top1_mfc_pll_half_p) = {"mout_top1_mfc_pll_user", 4318c2ecf20Sopenharmony_ci "ffac_top1_mfc_pll_div2"}; 4328c2ecf20Sopenharmony_ci 4338c2ecf20Sopenharmony_ciPNAME(mout_top1_group1) = {"mout_top1_bus0_pll_half", 4348c2ecf20Sopenharmony_ci "mout_top1_bus1_pll_half", "mout_top1_cc_pll_half", 4358c2ecf20Sopenharmony_ci "mout_top1_mfc_pll_half"}; 4368c2ecf20Sopenharmony_ci 4378c2ecf20Sopenharmony_cistatic const unsigned long top1_clk_regs[] __initconst = { 4388c2ecf20Sopenharmony_ci MUX_SEL_TOP10, 4398c2ecf20Sopenharmony_ci MUX_SEL_TOP11, 4408c2ecf20Sopenharmony_ci MUX_SEL_TOP13, 4418c2ecf20Sopenharmony_ci MUX_SEL_TOP1_FSYS0, 4428c2ecf20Sopenharmony_ci MUX_SEL_TOP1_FSYS1, 4438c2ecf20Sopenharmony_ci MUX_SEL_TOP1_FSYS11, 4448c2ecf20Sopenharmony_ci DIV_TOP13, 4458c2ecf20Sopenharmony_ci DIV_TOP1_FSYS0, 4468c2ecf20Sopenharmony_ci DIV_TOP1_FSYS1, 4478c2ecf20Sopenharmony_ci DIV_TOP1_FSYS11, 4488c2ecf20Sopenharmony_ci ENABLE_ACLK_TOP13, 4498c2ecf20Sopenharmony_ci ENABLE_SCLK_TOP1_FSYS0, 4508c2ecf20Sopenharmony_ci ENABLE_SCLK_TOP1_FSYS1, 4518c2ecf20Sopenharmony_ci ENABLE_SCLK_TOP1_FSYS11, 4528c2ecf20Sopenharmony_ci}; 4538c2ecf20Sopenharmony_ci 4548c2ecf20Sopenharmony_cistatic const struct samsung_mux_clock top1_mux_clks[] __initconst = { 4558c2ecf20Sopenharmony_ci MUX(0, "mout_top1_mfc_pll_user", mout_top1_mfc_pll_user_p, 4568c2ecf20Sopenharmony_ci MUX_SEL_TOP10, 4, 1), 4578c2ecf20Sopenharmony_ci MUX(0, "mout_top1_cc_pll_user", mout_top1_cc_pll_user_p, 4588c2ecf20Sopenharmony_ci MUX_SEL_TOP10, 8, 1), 4598c2ecf20Sopenharmony_ci MUX(0, "mout_top1_bus1_pll_user", mout_top1_bus1_pll_user_p, 4608c2ecf20Sopenharmony_ci MUX_SEL_TOP10, 12, 1), 4618c2ecf20Sopenharmony_ci MUX(0, "mout_top1_bus0_pll_user", mout_top1_bus0_pll_user_p, 4628c2ecf20Sopenharmony_ci MUX_SEL_TOP10, 16, 1), 4638c2ecf20Sopenharmony_ci 4648c2ecf20Sopenharmony_ci MUX(0, "mout_top1_mfc_pll_half", mout_top1_mfc_pll_half_p, 4658c2ecf20Sopenharmony_ci MUX_SEL_TOP11, 4, 1), 4668c2ecf20Sopenharmony_ci MUX(0, "mout_top1_cc_pll_half", mout_top1_cc_pll_half_p, 4678c2ecf20Sopenharmony_ci MUX_SEL_TOP11, 8, 1), 4688c2ecf20Sopenharmony_ci MUX(0, "mout_top1_bus1_pll_half", mout_top1_bus1_pll_half_p, 4698c2ecf20Sopenharmony_ci MUX_SEL_TOP11, 12, 1), 4708c2ecf20Sopenharmony_ci MUX(0, "mout_top1_bus0_pll_half", mout_top1_bus0_pll_half_p, 4718c2ecf20Sopenharmony_ci MUX_SEL_TOP11, 16, 1), 4728c2ecf20Sopenharmony_ci 4738c2ecf20Sopenharmony_ci MUX(0, "mout_aclk_fsys1_200", mout_top1_group1, MUX_SEL_TOP13, 24, 2), 4748c2ecf20Sopenharmony_ci MUX(0, "mout_aclk_fsys0_200", mout_top1_group1, MUX_SEL_TOP13, 28, 2), 4758c2ecf20Sopenharmony_ci 4768c2ecf20Sopenharmony_ci MUX(0, "mout_sclk_phy_fsys0_26m", mout_top1_group1, 4778c2ecf20Sopenharmony_ci MUX_SEL_TOP1_FSYS0, 0, 2), 4788c2ecf20Sopenharmony_ci MUX(0, "mout_sclk_mmc2", mout_top1_group1, MUX_SEL_TOP1_FSYS0, 16, 2), 4798c2ecf20Sopenharmony_ci MUX(0, "mout_sclk_usbdrd300", mout_top1_group1, 4808c2ecf20Sopenharmony_ci MUX_SEL_TOP1_FSYS0, 28, 2), 4818c2ecf20Sopenharmony_ci 4828c2ecf20Sopenharmony_ci MUX(0, "mout_sclk_phy_fsys1", mout_top1_group1, 4838c2ecf20Sopenharmony_ci MUX_SEL_TOP1_FSYS1, 0, 2), 4848c2ecf20Sopenharmony_ci MUX(0, "mout_sclk_ufsunipro20", mout_top1_group1, 4858c2ecf20Sopenharmony_ci MUX_SEL_TOP1_FSYS1, 16, 2), 4868c2ecf20Sopenharmony_ci 4878c2ecf20Sopenharmony_ci MUX(0, "mout_sclk_mmc1", mout_top1_group1, MUX_SEL_TOP1_FSYS11, 0, 2), 4888c2ecf20Sopenharmony_ci MUX(0, "mout_sclk_mmc0", mout_top1_group1, MUX_SEL_TOP1_FSYS11, 12, 2), 4898c2ecf20Sopenharmony_ci MUX(0, "mout_sclk_phy_fsys1_26m", mout_top1_group1, 4908c2ecf20Sopenharmony_ci MUX_SEL_TOP1_FSYS11, 24, 2), 4918c2ecf20Sopenharmony_ci}; 4928c2ecf20Sopenharmony_ci 4938c2ecf20Sopenharmony_cistatic const struct samsung_div_clock top1_div_clks[] __initconst = { 4948c2ecf20Sopenharmony_ci DIV(DOUT_ACLK_FSYS1_200, "dout_aclk_fsys1_200", "mout_aclk_fsys1_200", 4958c2ecf20Sopenharmony_ci DIV_TOP13, 24, 4), 4968c2ecf20Sopenharmony_ci DIV(DOUT_ACLK_FSYS0_200, "dout_aclk_fsys0_200", "mout_aclk_fsys0_200", 4978c2ecf20Sopenharmony_ci DIV_TOP13, 28, 4), 4988c2ecf20Sopenharmony_ci 4998c2ecf20Sopenharmony_ci DIV(DOUT_SCLK_PHY_FSYS1, "dout_sclk_phy_fsys1", 5008c2ecf20Sopenharmony_ci "mout_sclk_phy_fsys1", DIV_TOP1_FSYS1, 0, 6), 5018c2ecf20Sopenharmony_ci 5028c2ecf20Sopenharmony_ci DIV(DOUT_SCLK_UFSUNIPRO20, "dout_sclk_ufsunipro20", 5038c2ecf20Sopenharmony_ci "mout_sclk_ufsunipro20", 5048c2ecf20Sopenharmony_ci DIV_TOP1_FSYS1, 16, 6), 5058c2ecf20Sopenharmony_ci 5068c2ecf20Sopenharmony_ci DIV(DOUT_SCLK_MMC2, "dout_sclk_mmc2", "mout_sclk_mmc2", 5078c2ecf20Sopenharmony_ci DIV_TOP1_FSYS0, 16, 10), 5088c2ecf20Sopenharmony_ci DIV(0, "dout_sclk_usbdrd300", "mout_sclk_usbdrd300", 5098c2ecf20Sopenharmony_ci DIV_TOP1_FSYS0, 28, 4), 5108c2ecf20Sopenharmony_ci 5118c2ecf20Sopenharmony_ci DIV(DOUT_SCLK_MMC1, "dout_sclk_mmc1", "mout_sclk_mmc1", 5128c2ecf20Sopenharmony_ci DIV_TOP1_FSYS11, 0, 10), 5138c2ecf20Sopenharmony_ci DIV(DOUT_SCLK_MMC0, "dout_sclk_mmc0", "mout_sclk_mmc0", 5148c2ecf20Sopenharmony_ci DIV_TOP1_FSYS11, 12, 10), 5158c2ecf20Sopenharmony_ci 5168c2ecf20Sopenharmony_ci DIV(DOUT_SCLK_PHY_FSYS1_26M, "dout_sclk_phy_fsys1_26m", 5178c2ecf20Sopenharmony_ci "mout_sclk_phy_fsys1_26m", DIV_TOP1_FSYS11, 24, 6), 5188c2ecf20Sopenharmony_ci}; 5198c2ecf20Sopenharmony_ci 5208c2ecf20Sopenharmony_cistatic const struct samsung_gate_clock top1_gate_clks[] __initconst = { 5218c2ecf20Sopenharmony_ci GATE(CLK_SCLK_MMC2, "sclk_mmc2", "dout_sclk_mmc2", 5228c2ecf20Sopenharmony_ci ENABLE_SCLK_TOP1_FSYS0, 16, CLK_SET_RATE_PARENT, 0), 5238c2ecf20Sopenharmony_ci GATE(0, "sclk_usbdrd300", "dout_sclk_usbdrd300", 5248c2ecf20Sopenharmony_ci ENABLE_SCLK_TOP1_FSYS0, 28, 0, 0), 5258c2ecf20Sopenharmony_ci 5268c2ecf20Sopenharmony_ci GATE(CLK_SCLK_PHY_FSYS1, "sclk_phy_fsys1", "dout_sclk_phy_fsys1", 5278c2ecf20Sopenharmony_ci ENABLE_SCLK_TOP1_FSYS1, 0, CLK_SET_RATE_PARENT, 0), 5288c2ecf20Sopenharmony_ci 5298c2ecf20Sopenharmony_ci GATE(CLK_SCLK_UFSUNIPRO20, "sclk_ufsunipro20", "dout_sclk_ufsunipro20", 5308c2ecf20Sopenharmony_ci ENABLE_SCLK_TOP1_FSYS1, 16, CLK_SET_RATE_PARENT, 0), 5318c2ecf20Sopenharmony_ci 5328c2ecf20Sopenharmony_ci GATE(CLK_SCLK_MMC1, "sclk_mmc1", "dout_sclk_mmc1", 5338c2ecf20Sopenharmony_ci ENABLE_SCLK_TOP1_FSYS11, 0, CLK_SET_RATE_PARENT, 0), 5348c2ecf20Sopenharmony_ci GATE(CLK_SCLK_MMC0, "sclk_mmc0", "dout_sclk_mmc0", 5358c2ecf20Sopenharmony_ci ENABLE_SCLK_TOP1_FSYS11, 12, CLK_SET_RATE_PARENT, 0), 5368c2ecf20Sopenharmony_ci 5378c2ecf20Sopenharmony_ci GATE(CLK_ACLK_FSYS0_200, "aclk_fsys0_200", "dout_aclk_fsys0_200", 5388c2ecf20Sopenharmony_ci ENABLE_ACLK_TOP13, 28, CLK_SET_RATE_PARENT | 5398c2ecf20Sopenharmony_ci CLK_IS_CRITICAL, 0), 5408c2ecf20Sopenharmony_ci /* 5418c2ecf20Sopenharmony_ci * This clock is required for the CMU_FSYS1 registers access, keep it 5428c2ecf20Sopenharmony_ci * enabled permanently until proper runtime PM support is added. 5438c2ecf20Sopenharmony_ci */ 5448c2ecf20Sopenharmony_ci GATE(CLK_ACLK_FSYS1_200, "aclk_fsys1_200", "dout_aclk_fsys1_200", 5458c2ecf20Sopenharmony_ci ENABLE_ACLK_TOP13, 24, CLK_SET_RATE_PARENT | 5468c2ecf20Sopenharmony_ci CLK_IS_CRITICAL, 0), 5478c2ecf20Sopenharmony_ci 5488c2ecf20Sopenharmony_ci GATE(CLK_SCLK_PHY_FSYS1_26M, "sclk_phy_fsys1_26m", 5498c2ecf20Sopenharmony_ci "dout_sclk_phy_fsys1_26m", ENABLE_SCLK_TOP1_FSYS11, 5508c2ecf20Sopenharmony_ci 24, CLK_SET_RATE_PARENT, 0), 5518c2ecf20Sopenharmony_ci}; 5528c2ecf20Sopenharmony_ci 5538c2ecf20Sopenharmony_cistatic const struct samsung_fixed_factor_clock top1_fixed_factor_clks[] __initconst = { 5548c2ecf20Sopenharmony_ci FFACTOR(0, "ffac_top1_bus0_pll_div2", "mout_top1_bus0_pll_user", 5558c2ecf20Sopenharmony_ci 1, 2, 0), 5568c2ecf20Sopenharmony_ci FFACTOR(0, "ffac_top1_bus1_pll_div2", "mout_top1_bus1_pll_user", 5578c2ecf20Sopenharmony_ci 1, 2, 0), 5588c2ecf20Sopenharmony_ci FFACTOR(0, "ffac_top1_cc_pll_div2", "mout_top1_cc_pll_user", 1, 2, 0), 5598c2ecf20Sopenharmony_ci FFACTOR(0, "ffac_top1_mfc_pll_div2", "mout_top1_mfc_pll_user", 1, 2, 0), 5608c2ecf20Sopenharmony_ci}; 5618c2ecf20Sopenharmony_ci 5628c2ecf20Sopenharmony_cistatic const struct samsung_cmu_info top1_cmu_info __initconst = { 5638c2ecf20Sopenharmony_ci .mux_clks = top1_mux_clks, 5648c2ecf20Sopenharmony_ci .nr_mux_clks = ARRAY_SIZE(top1_mux_clks), 5658c2ecf20Sopenharmony_ci .div_clks = top1_div_clks, 5668c2ecf20Sopenharmony_ci .nr_div_clks = ARRAY_SIZE(top1_div_clks), 5678c2ecf20Sopenharmony_ci .gate_clks = top1_gate_clks, 5688c2ecf20Sopenharmony_ci .nr_gate_clks = ARRAY_SIZE(top1_gate_clks), 5698c2ecf20Sopenharmony_ci .fixed_factor_clks = top1_fixed_factor_clks, 5708c2ecf20Sopenharmony_ci .nr_fixed_factor_clks = ARRAY_SIZE(top1_fixed_factor_clks), 5718c2ecf20Sopenharmony_ci .nr_clk_ids = TOP1_NR_CLK, 5728c2ecf20Sopenharmony_ci .clk_regs = top1_clk_regs, 5738c2ecf20Sopenharmony_ci .nr_clk_regs = ARRAY_SIZE(top1_clk_regs), 5748c2ecf20Sopenharmony_ci}; 5758c2ecf20Sopenharmony_ci 5768c2ecf20Sopenharmony_cistatic void __init exynos7_clk_top1_init(struct device_node *np) 5778c2ecf20Sopenharmony_ci{ 5788c2ecf20Sopenharmony_ci samsung_cmu_register_one(np, &top1_cmu_info); 5798c2ecf20Sopenharmony_ci} 5808c2ecf20Sopenharmony_ci 5818c2ecf20Sopenharmony_ciCLK_OF_DECLARE(exynos7_clk_top1, "samsung,exynos7-clock-top1", 5828c2ecf20Sopenharmony_ci exynos7_clk_top1_init); 5838c2ecf20Sopenharmony_ci 5848c2ecf20Sopenharmony_ci/* Register Offset definitions for CMU_CCORE (0x105B0000) */ 5858c2ecf20Sopenharmony_ci#define MUX_SEL_CCORE 0x0200 5868c2ecf20Sopenharmony_ci#define DIV_CCORE 0x0600 5878c2ecf20Sopenharmony_ci#define ENABLE_ACLK_CCORE0 0x0800 5888c2ecf20Sopenharmony_ci#define ENABLE_ACLK_CCORE1 0x0804 5898c2ecf20Sopenharmony_ci#define ENABLE_PCLK_CCORE 0x0900 5908c2ecf20Sopenharmony_ci 5918c2ecf20Sopenharmony_ci/* 5928c2ecf20Sopenharmony_ci * List of parent clocks for Muxes in CMU_CCORE 5938c2ecf20Sopenharmony_ci */ 5948c2ecf20Sopenharmony_ciPNAME(mout_aclk_ccore_133_user_p) = { "fin_pll", "aclk_ccore_133" }; 5958c2ecf20Sopenharmony_ci 5968c2ecf20Sopenharmony_cistatic const unsigned long ccore_clk_regs[] __initconst = { 5978c2ecf20Sopenharmony_ci MUX_SEL_CCORE, 5988c2ecf20Sopenharmony_ci ENABLE_PCLK_CCORE, 5998c2ecf20Sopenharmony_ci}; 6008c2ecf20Sopenharmony_ci 6018c2ecf20Sopenharmony_cistatic const struct samsung_mux_clock ccore_mux_clks[] __initconst = { 6028c2ecf20Sopenharmony_ci MUX(0, "mout_aclk_ccore_133_user", mout_aclk_ccore_133_user_p, 6038c2ecf20Sopenharmony_ci MUX_SEL_CCORE, 1, 1), 6048c2ecf20Sopenharmony_ci}; 6058c2ecf20Sopenharmony_ci 6068c2ecf20Sopenharmony_cistatic const struct samsung_gate_clock ccore_gate_clks[] __initconst = { 6078c2ecf20Sopenharmony_ci GATE(PCLK_RTC, "pclk_rtc", "mout_aclk_ccore_133_user", 6088c2ecf20Sopenharmony_ci ENABLE_PCLK_CCORE, 8, 0, 0), 6098c2ecf20Sopenharmony_ci}; 6108c2ecf20Sopenharmony_ci 6118c2ecf20Sopenharmony_cistatic const struct samsung_cmu_info ccore_cmu_info __initconst = { 6128c2ecf20Sopenharmony_ci .mux_clks = ccore_mux_clks, 6138c2ecf20Sopenharmony_ci .nr_mux_clks = ARRAY_SIZE(ccore_mux_clks), 6148c2ecf20Sopenharmony_ci .gate_clks = ccore_gate_clks, 6158c2ecf20Sopenharmony_ci .nr_gate_clks = ARRAY_SIZE(ccore_gate_clks), 6168c2ecf20Sopenharmony_ci .nr_clk_ids = CCORE_NR_CLK, 6178c2ecf20Sopenharmony_ci .clk_regs = ccore_clk_regs, 6188c2ecf20Sopenharmony_ci .nr_clk_regs = ARRAY_SIZE(ccore_clk_regs), 6198c2ecf20Sopenharmony_ci}; 6208c2ecf20Sopenharmony_ci 6218c2ecf20Sopenharmony_cistatic void __init exynos7_clk_ccore_init(struct device_node *np) 6228c2ecf20Sopenharmony_ci{ 6238c2ecf20Sopenharmony_ci samsung_cmu_register_one(np, &ccore_cmu_info); 6248c2ecf20Sopenharmony_ci} 6258c2ecf20Sopenharmony_ci 6268c2ecf20Sopenharmony_ciCLK_OF_DECLARE(exynos7_clk_ccore, "samsung,exynos7-clock-ccore", 6278c2ecf20Sopenharmony_ci exynos7_clk_ccore_init); 6288c2ecf20Sopenharmony_ci 6298c2ecf20Sopenharmony_ci/* Register Offset definitions for CMU_PERIC0 (0x13610000) */ 6308c2ecf20Sopenharmony_ci#define MUX_SEL_PERIC0 0x0200 6318c2ecf20Sopenharmony_ci#define ENABLE_PCLK_PERIC0 0x0900 6328c2ecf20Sopenharmony_ci#define ENABLE_SCLK_PERIC0 0x0A00 6338c2ecf20Sopenharmony_ci 6348c2ecf20Sopenharmony_ci/* List of parent clocks for Muxes in CMU_PERIC0 */ 6358c2ecf20Sopenharmony_ciPNAME(mout_aclk_peric0_66_user_p) = { "fin_pll", "aclk_peric0_66" }; 6368c2ecf20Sopenharmony_ciPNAME(mout_sclk_uart0_user_p) = { "fin_pll", "sclk_uart0" }; 6378c2ecf20Sopenharmony_ci 6388c2ecf20Sopenharmony_cistatic const unsigned long peric0_clk_regs[] __initconst = { 6398c2ecf20Sopenharmony_ci MUX_SEL_PERIC0, 6408c2ecf20Sopenharmony_ci ENABLE_PCLK_PERIC0, 6418c2ecf20Sopenharmony_ci ENABLE_SCLK_PERIC0, 6428c2ecf20Sopenharmony_ci}; 6438c2ecf20Sopenharmony_ci 6448c2ecf20Sopenharmony_cistatic const struct samsung_mux_clock peric0_mux_clks[] __initconst = { 6458c2ecf20Sopenharmony_ci MUX(0, "mout_aclk_peric0_66_user", mout_aclk_peric0_66_user_p, 6468c2ecf20Sopenharmony_ci MUX_SEL_PERIC0, 0, 1), 6478c2ecf20Sopenharmony_ci MUX(0, "mout_sclk_uart0_user", mout_sclk_uart0_user_p, 6488c2ecf20Sopenharmony_ci MUX_SEL_PERIC0, 16, 1), 6498c2ecf20Sopenharmony_ci}; 6508c2ecf20Sopenharmony_ci 6518c2ecf20Sopenharmony_cistatic const struct samsung_gate_clock peric0_gate_clks[] __initconst = { 6528c2ecf20Sopenharmony_ci GATE(PCLK_HSI2C0, "pclk_hsi2c0", "mout_aclk_peric0_66_user", 6538c2ecf20Sopenharmony_ci ENABLE_PCLK_PERIC0, 8, 0, 0), 6548c2ecf20Sopenharmony_ci GATE(PCLK_HSI2C1, "pclk_hsi2c1", "mout_aclk_peric0_66_user", 6558c2ecf20Sopenharmony_ci ENABLE_PCLK_PERIC0, 9, 0, 0), 6568c2ecf20Sopenharmony_ci GATE(PCLK_HSI2C4, "pclk_hsi2c4", "mout_aclk_peric0_66_user", 6578c2ecf20Sopenharmony_ci ENABLE_PCLK_PERIC0, 10, 0, 0), 6588c2ecf20Sopenharmony_ci GATE(PCLK_HSI2C5, "pclk_hsi2c5", "mout_aclk_peric0_66_user", 6598c2ecf20Sopenharmony_ci ENABLE_PCLK_PERIC0, 11, 0, 0), 6608c2ecf20Sopenharmony_ci GATE(PCLK_HSI2C9, "pclk_hsi2c9", "mout_aclk_peric0_66_user", 6618c2ecf20Sopenharmony_ci ENABLE_PCLK_PERIC0, 12, 0, 0), 6628c2ecf20Sopenharmony_ci GATE(PCLK_HSI2C10, "pclk_hsi2c10", "mout_aclk_peric0_66_user", 6638c2ecf20Sopenharmony_ci ENABLE_PCLK_PERIC0, 13, 0, 0), 6648c2ecf20Sopenharmony_ci GATE(PCLK_HSI2C11, "pclk_hsi2c11", "mout_aclk_peric0_66_user", 6658c2ecf20Sopenharmony_ci ENABLE_PCLK_PERIC0, 14, 0, 0), 6668c2ecf20Sopenharmony_ci GATE(PCLK_UART0, "pclk_uart0", "mout_aclk_peric0_66_user", 6678c2ecf20Sopenharmony_ci ENABLE_PCLK_PERIC0, 16, 0, 0), 6688c2ecf20Sopenharmony_ci GATE(PCLK_ADCIF, "pclk_adcif", "mout_aclk_peric0_66_user", 6698c2ecf20Sopenharmony_ci ENABLE_PCLK_PERIC0, 20, 0, 0), 6708c2ecf20Sopenharmony_ci GATE(PCLK_PWM, "pclk_pwm", "mout_aclk_peric0_66_user", 6718c2ecf20Sopenharmony_ci ENABLE_PCLK_PERIC0, 21, 0, 0), 6728c2ecf20Sopenharmony_ci 6738c2ecf20Sopenharmony_ci GATE(SCLK_UART0, "sclk_uart0_user", "mout_sclk_uart0_user", 6748c2ecf20Sopenharmony_ci ENABLE_SCLK_PERIC0, 16, 0, 0), 6758c2ecf20Sopenharmony_ci GATE(SCLK_PWM, "sclk_pwm", "fin_pll", ENABLE_SCLK_PERIC0, 21, 0, 0), 6768c2ecf20Sopenharmony_ci}; 6778c2ecf20Sopenharmony_ci 6788c2ecf20Sopenharmony_cistatic const struct samsung_cmu_info peric0_cmu_info __initconst = { 6798c2ecf20Sopenharmony_ci .mux_clks = peric0_mux_clks, 6808c2ecf20Sopenharmony_ci .nr_mux_clks = ARRAY_SIZE(peric0_mux_clks), 6818c2ecf20Sopenharmony_ci .gate_clks = peric0_gate_clks, 6828c2ecf20Sopenharmony_ci .nr_gate_clks = ARRAY_SIZE(peric0_gate_clks), 6838c2ecf20Sopenharmony_ci .nr_clk_ids = PERIC0_NR_CLK, 6848c2ecf20Sopenharmony_ci .clk_regs = peric0_clk_regs, 6858c2ecf20Sopenharmony_ci .nr_clk_regs = ARRAY_SIZE(peric0_clk_regs), 6868c2ecf20Sopenharmony_ci}; 6878c2ecf20Sopenharmony_ci 6888c2ecf20Sopenharmony_cistatic void __init exynos7_clk_peric0_init(struct device_node *np) 6898c2ecf20Sopenharmony_ci{ 6908c2ecf20Sopenharmony_ci samsung_cmu_register_one(np, &peric0_cmu_info); 6918c2ecf20Sopenharmony_ci} 6928c2ecf20Sopenharmony_ci 6938c2ecf20Sopenharmony_ci/* Register Offset definitions for CMU_PERIC1 (0x14C80000) */ 6948c2ecf20Sopenharmony_ci#define MUX_SEL_PERIC10 0x0200 6958c2ecf20Sopenharmony_ci#define MUX_SEL_PERIC11 0x0204 6968c2ecf20Sopenharmony_ci#define MUX_SEL_PERIC12 0x0208 6978c2ecf20Sopenharmony_ci#define ENABLE_PCLK_PERIC1 0x0900 6988c2ecf20Sopenharmony_ci#define ENABLE_SCLK_PERIC10 0x0A00 6998c2ecf20Sopenharmony_ci 7008c2ecf20Sopenharmony_ciCLK_OF_DECLARE(exynos7_clk_peric0, "samsung,exynos7-clock-peric0", 7018c2ecf20Sopenharmony_ci exynos7_clk_peric0_init); 7028c2ecf20Sopenharmony_ci 7038c2ecf20Sopenharmony_ci/* List of parent clocks for Muxes in CMU_PERIC1 */ 7048c2ecf20Sopenharmony_ciPNAME(mout_aclk_peric1_66_user_p) = { "fin_pll", "aclk_peric1_66" }; 7058c2ecf20Sopenharmony_ciPNAME(mout_sclk_uart1_user_p) = { "fin_pll", "sclk_uart1" }; 7068c2ecf20Sopenharmony_ciPNAME(mout_sclk_uart2_user_p) = { "fin_pll", "sclk_uart2" }; 7078c2ecf20Sopenharmony_ciPNAME(mout_sclk_uart3_user_p) = { "fin_pll", "sclk_uart3" }; 7088c2ecf20Sopenharmony_ciPNAME(mout_sclk_spi0_user_p) = { "fin_pll", "sclk_spi0" }; 7098c2ecf20Sopenharmony_ciPNAME(mout_sclk_spi1_user_p) = { "fin_pll", "sclk_spi1" }; 7108c2ecf20Sopenharmony_ciPNAME(mout_sclk_spi2_user_p) = { "fin_pll", "sclk_spi2" }; 7118c2ecf20Sopenharmony_ciPNAME(mout_sclk_spi3_user_p) = { "fin_pll", "sclk_spi3" }; 7128c2ecf20Sopenharmony_ciPNAME(mout_sclk_spi4_user_p) = { "fin_pll", "sclk_spi4" }; 7138c2ecf20Sopenharmony_ci 7148c2ecf20Sopenharmony_cistatic const unsigned long peric1_clk_regs[] __initconst = { 7158c2ecf20Sopenharmony_ci MUX_SEL_PERIC10, 7168c2ecf20Sopenharmony_ci MUX_SEL_PERIC11, 7178c2ecf20Sopenharmony_ci MUX_SEL_PERIC12, 7188c2ecf20Sopenharmony_ci ENABLE_PCLK_PERIC1, 7198c2ecf20Sopenharmony_ci ENABLE_SCLK_PERIC10, 7208c2ecf20Sopenharmony_ci}; 7218c2ecf20Sopenharmony_ci 7228c2ecf20Sopenharmony_cistatic const struct samsung_mux_clock peric1_mux_clks[] __initconst = { 7238c2ecf20Sopenharmony_ci MUX(0, "mout_aclk_peric1_66_user", mout_aclk_peric1_66_user_p, 7248c2ecf20Sopenharmony_ci MUX_SEL_PERIC10, 0, 1), 7258c2ecf20Sopenharmony_ci 7268c2ecf20Sopenharmony_ci MUX_F(0, "mout_sclk_spi0_user", mout_sclk_spi0_user_p, 7278c2ecf20Sopenharmony_ci MUX_SEL_PERIC11, 0, 1, CLK_SET_RATE_PARENT, 0), 7288c2ecf20Sopenharmony_ci MUX_F(0, "mout_sclk_spi1_user", mout_sclk_spi1_user_p, 7298c2ecf20Sopenharmony_ci MUX_SEL_PERIC11, 4, 1, CLK_SET_RATE_PARENT, 0), 7308c2ecf20Sopenharmony_ci MUX_F(0, "mout_sclk_spi2_user", mout_sclk_spi2_user_p, 7318c2ecf20Sopenharmony_ci MUX_SEL_PERIC11, 8, 1, CLK_SET_RATE_PARENT, 0), 7328c2ecf20Sopenharmony_ci MUX_F(0, "mout_sclk_spi3_user", mout_sclk_spi3_user_p, 7338c2ecf20Sopenharmony_ci MUX_SEL_PERIC11, 12, 1, CLK_SET_RATE_PARENT, 0), 7348c2ecf20Sopenharmony_ci MUX_F(0, "mout_sclk_spi4_user", mout_sclk_spi4_user_p, 7358c2ecf20Sopenharmony_ci MUX_SEL_PERIC11, 16, 1, CLK_SET_RATE_PARENT, 0), 7368c2ecf20Sopenharmony_ci MUX(0, "mout_sclk_uart1_user", mout_sclk_uart1_user_p, 7378c2ecf20Sopenharmony_ci MUX_SEL_PERIC11, 20, 1), 7388c2ecf20Sopenharmony_ci MUX(0, "mout_sclk_uart2_user", mout_sclk_uart2_user_p, 7398c2ecf20Sopenharmony_ci MUX_SEL_PERIC11, 24, 1), 7408c2ecf20Sopenharmony_ci MUX(0, "mout_sclk_uart3_user", mout_sclk_uart3_user_p, 7418c2ecf20Sopenharmony_ci MUX_SEL_PERIC11, 28, 1), 7428c2ecf20Sopenharmony_ci}; 7438c2ecf20Sopenharmony_ci 7448c2ecf20Sopenharmony_cistatic const struct samsung_gate_clock peric1_gate_clks[] __initconst = { 7458c2ecf20Sopenharmony_ci GATE(PCLK_HSI2C2, "pclk_hsi2c2", "mout_aclk_peric1_66_user", 7468c2ecf20Sopenharmony_ci ENABLE_PCLK_PERIC1, 4, 0, 0), 7478c2ecf20Sopenharmony_ci GATE(PCLK_HSI2C3, "pclk_hsi2c3", "mout_aclk_peric1_66_user", 7488c2ecf20Sopenharmony_ci ENABLE_PCLK_PERIC1, 5, 0, 0), 7498c2ecf20Sopenharmony_ci GATE(PCLK_HSI2C6, "pclk_hsi2c6", "mout_aclk_peric1_66_user", 7508c2ecf20Sopenharmony_ci ENABLE_PCLK_PERIC1, 6, 0, 0), 7518c2ecf20Sopenharmony_ci GATE(PCLK_HSI2C7, "pclk_hsi2c7", "mout_aclk_peric1_66_user", 7528c2ecf20Sopenharmony_ci ENABLE_PCLK_PERIC1, 7, 0, 0), 7538c2ecf20Sopenharmony_ci GATE(PCLK_HSI2C8, "pclk_hsi2c8", "mout_aclk_peric1_66_user", 7548c2ecf20Sopenharmony_ci ENABLE_PCLK_PERIC1, 8, 0, 0), 7558c2ecf20Sopenharmony_ci GATE(PCLK_UART1, "pclk_uart1", "mout_aclk_peric1_66_user", 7568c2ecf20Sopenharmony_ci ENABLE_PCLK_PERIC1, 9, 0, 0), 7578c2ecf20Sopenharmony_ci GATE(PCLK_UART2, "pclk_uart2", "mout_aclk_peric1_66_user", 7588c2ecf20Sopenharmony_ci ENABLE_PCLK_PERIC1, 10, 0, 0), 7598c2ecf20Sopenharmony_ci GATE(PCLK_UART3, "pclk_uart3", "mout_aclk_peric1_66_user", 7608c2ecf20Sopenharmony_ci ENABLE_PCLK_PERIC1, 11, 0, 0), 7618c2ecf20Sopenharmony_ci GATE(PCLK_SPI0, "pclk_spi0", "mout_aclk_peric1_66_user", 7628c2ecf20Sopenharmony_ci ENABLE_PCLK_PERIC1, 12, 0, 0), 7638c2ecf20Sopenharmony_ci GATE(PCLK_SPI1, "pclk_spi1", "mout_aclk_peric1_66_user", 7648c2ecf20Sopenharmony_ci ENABLE_PCLK_PERIC1, 13, 0, 0), 7658c2ecf20Sopenharmony_ci GATE(PCLK_SPI2, "pclk_spi2", "mout_aclk_peric1_66_user", 7668c2ecf20Sopenharmony_ci ENABLE_PCLK_PERIC1, 14, 0, 0), 7678c2ecf20Sopenharmony_ci GATE(PCLK_SPI3, "pclk_spi3", "mout_aclk_peric1_66_user", 7688c2ecf20Sopenharmony_ci ENABLE_PCLK_PERIC1, 15, 0, 0), 7698c2ecf20Sopenharmony_ci GATE(PCLK_SPI4, "pclk_spi4", "mout_aclk_peric1_66_user", 7708c2ecf20Sopenharmony_ci ENABLE_PCLK_PERIC1, 16, 0, 0), 7718c2ecf20Sopenharmony_ci GATE(PCLK_I2S1, "pclk_i2s1", "mout_aclk_peric1_66_user", 7728c2ecf20Sopenharmony_ci ENABLE_PCLK_PERIC1, 17, CLK_SET_RATE_PARENT, 0), 7738c2ecf20Sopenharmony_ci GATE(PCLK_PCM1, "pclk_pcm1", "mout_aclk_peric1_66_user", 7748c2ecf20Sopenharmony_ci ENABLE_PCLK_PERIC1, 18, 0, 0), 7758c2ecf20Sopenharmony_ci GATE(PCLK_SPDIF, "pclk_spdif", "mout_aclk_peric1_66_user", 7768c2ecf20Sopenharmony_ci ENABLE_PCLK_PERIC1, 19, 0, 0), 7778c2ecf20Sopenharmony_ci 7788c2ecf20Sopenharmony_ci GATE(SCLK_UART1, "sclk_uart1_user", "mout_sclk_uart1_user", 7798c2ecf20Sopenharmony_ci ENABLE_SCLK_PERIC10, 9, 0, 0), 7808c2ecf20Sopenharmony_ci GATE(SCLK_UART2, "sclk_uart2_user", "mout_sclk_uart2_user", 7818c2ecf20Sopenharmony_ci ENABLE_SCLK_PERIC10, 10, 0, 0), 7828c2ecf20Sopenharmony_ci GATE(SCLK_UART3, "sclk_uart3_user", "mout_sclk_uart3_user", 7838c2ecf20Sopenharmony_ci ENABLE_SCLK_PERIC10, 11, 0, 0), 7848c2ecf20Sopenharmony_ci GATE(SCLK_SPI0, "sclk_spi0_user", "mout_sclk_spi0_user", 7858c2ecf20Sopenharmony_ci ENABLE_SCLK_PERIC10, 12, CLK_SET_RATE_PARENT, 0), 7868c2ecf20Sopenharmony_ci GATE(SCLK_SPI1, "sclk_spi1_user", "mout_sclk_spi1_user", 7878c2ecf20Sopenharmony_ci ENABLE_SCLK_PERIC10, 13, CLK_SET_RATE_PARENT, 0), 7888c2ecf20Sopenharmony_ci GATE(SCLK_SPI2, "sclk_spi2_user", "mout_sclk_spi2_user", 7898c2ecf20Sopenharmony_ci ENABLE_SCLK_PERIC10, 14, CLK_SET_RATE_PARENT, 0), 7908c2ecf20Sopenharmony_ci GATE(SCLK_SPI3, "sclk_spi3_user", "mout_sclk_spi3_user", 7918c2ecf20Sopenharmony_ci ENABLE_SCLK_PERIC10, 15, CLK_SET_RATE_PARENT, 0), 7928c2ecf20Sopenharmony_ci GATE(SCLK_SPI4, "sclk_spi4_user", "mout_sclk_spi4_user", 7938c2ecf20Sopenharmony_ci ENABLE_SCLK_PERIC10, 16, CLK_SET_RATE_PARENT, 0), 7948c2ecf20Sopenharmony_ci GATE(SCLK_I2S1, "sclk_i2s1_user", "sclk_i2s1", 7958c2ecf20Sopenharmony_ci ENABLE_SCLK_PERIC10, 17, CLK_SET_RATE_PARENT, 0), 7968c2ecf20Sopenharmony_ci GATE(SCLK_PCM1, "sclk_pcm1_user", "sclk_pcm1", 7978c2ecf20Sopenharmony_ci ENABLE_SCLK_PERIC10, 18, CLK_SET_RATE_PARENT, 0), 7988c2ecf20Sopenharmony_ci GATE(SCLK_SPDIF, "sclk_spdif_user", "sclk_spdif", 7998c2ecf20Sopenharmony_ci ENABLE_SCLK_PERIC10, 19, CLK_SET_RATE_PARENT, 0), 8008c2ecf20Sopenharmony_ci}; 8018c2ecf20Sopenharmony_ci 8028c2ecf20Sopenharmony_cistatic const struct samsung_cmu_info peric1_cmu_info __initconst = { 8038c2ecf20Sopenharmony_ci .mux_clks = peric1_mux_clks, 8048c2ecf20Sopenharmony_ci .nr_mux_clks = ARRAY_SIZE(peric1_mux_clks), 8058c2ecf20Sopenharmony_ci .gate_clks = peric1_gate_clks, 8068c2ecf20Sopenharmony_ci .nr_gate_clks = ARRAY_SIZE(peric1_gate_clks), 8078c2ecf20Sopenharmony_ci .nr_clk_ids = PERIC1_NR_CLK, 8088c2ecf20Sopenharmony_ci .clk_regs = peric1_clk_regs, 8098c2ecf20Sopenharmony_ci .nr_clk_regs = ARRAY_SIZE(peric1_clk_regs), 8108c2ecf20Sopenharmony_ci}; 8118c2ecf20Sopenharmony_ci 8128c2ecf20Sopenharmony_cistatic void __init exynos7_clk_peric1_init(struct device_node *np) 8138c2ecf20Sopenharmony_ci{ 8148c2ecf20Sopenharmony_ci samsung_cmu_register_one(np, &peric1_cmu_info); 8158c2ecf20Sopenharmony_ci} 8168c2ecf20Sopenharmony_ci 8178c2ecf20Sopenharmony_ciCLK_OF_DECLARE(exynos7_clk_peric1, "samsung,exynos7-clock-peric1", 8188c2ecf20Sopenharmony_ci exynos7_clk_peric1_init); 8198c2ecf20Sopenharmony_ci 8208c2ecf20Sopenharmony_ci/* Register Offset definitions for CMU_PERIS (0x10040000) */ 8218c2ecf20Sopenharmony_ci#define MUX_SEL_PERIS 0x0200 8228c2ecf20Sopenharmony_ci#define ENABLE_PCLK_PERIS 0x0900 8238c2ecf20Sopenharmony_ci#define ENABLE_PCLK_PERIS_SECURE_CHIPID 0x0910 8248c2ecf20Sopenharmony_ci#define ENABLE_SCLK_PERIS 0x0A00 8258c2ecf20Sopenharmony_ci#define ENABLE_SCLK_PERIS_SECURE_CHIPID 0x0A10 8268c2ecf20Sopenharmony_ci 8278c2ecf20Sopenharmony_ci/* List of parent clocks for Muxes in CMU_PERIS */ 8288c2ecf20Sopenharmony_ciPNAME(mout_aclk_peris_66_user_p) = { "fin_pll", "aclk_peris_66" }; 8298c2ecf20Sopenharmony_ci 8308c2ecf20Sopenharmony_cistatic const unsigned long peris_clk_regs[] __initconst = { 8318c2ecf20Sopenharmony_ci MUX_SEL_PERIS, 8328c2ecf20Sopenharmony_ci ENABLE_PCLK_PERIS, 8338c2ecf20Sopenharmony_ci ENABLE_PCLK_PERIS_SECURE_CHIPID, 8348c2ecf20Sopenharmony_ci ENABLE_SCLK_PERIS, 8358c2ecf20Sopenharmony_ci ENABLE_SCLK_PERIS_SECURE_CHIPID, 8368c2ecf20Sopenharmony_ci}; 8378c2ecf20Sopenharmony_ci 8388c2ecf20Sopenharmony_cistatic const struct samsung_mux_clock peris_mux_clks[] __initconst = { 8398c2ecf20Sopenharmony_ci MUX(0, "mout_aclk_peris_66_user", 8408c2ecf20Sopenharmony_ci mout_aclk_peris_66_user_p, MUX_SEL_PERIS, 0, 1), 8418c2ecf20Sopenharmony_ci}; 8428c2ecf20Sopenharmony_ci 8438c2ecf20Sopenharmony_cistatic const struct samsung_gate_clock peris_gate_clks[] __initconst = { 8448c2ecf20Sopenharmony_ci GATE(PCLK_WDT, "pclk_wdt", "mout_aclk_peris_66_user", 8458c2ecf20Sopenharmony_ci ENABLE_PCLK_PERIS, 6, 0, 0), 8468c2ecf20Sopenharmony_ci GATE(PCLK_TMU, "pclk_tmu_apbif", "mout_aclk_peris_66_user", 8478c2ecf20Sopenharmony_ci ENABLE_PCLK_PERIS, 10, 0, 0), 8488c2ecf20Sopenharmony_ci 8498c2ecf20Sopenharmony_ci GATE(PCLK_CHIPID, "pclk_chipid", "mout_aclk_peris_66_user", 8508c2ecf20Sopenharmony_ci ENABLE_PCLK_PERIS_SECURE_CHIPID, 0, 0, 0), 8518c2ecf20Sopenharmony_ci GATE(SCLK_CHIPID, "sclk_chipid", "fin_pll", 8528c2ecf20Sopenharmony_ci ENABLE_SCLK_PERIS_SECURE_CHIPID, 0, 0, 0), 8538c2ecf20Sopenharmony_ci 8548c2ecf20Sopenharmony_ci GATE(SCLK_TMU, "sclk_tmu", "fin_pll", ENABLE_SCLK_PERIS, 10, 0, 0), 8558c2ecf20Sopenharmony_ci}; 8568c2ecf20Sopenharmony_ci 8578c2ecf20Sopenharmony_cistatic const struct samsung_cmu_info peris_cmu_info __initconst = { 8588c2ecf20Sopenharmony_ci .mux_clks = peris_mux_clks, 8598c2ecf20Sopenharmony_ci .nr_mux_clks = ARRAY_SIZE(peris_mux_clks), 8608c2ecf20Sopenharmony_ci .gate_clks = peris_gate_clks, 8618c2ecf20Sopenharmony_ci .nr_gate_clks = ARRAY_SIZE(peris_gate_clks), 8628c2ecf20Sopenharmony_ci .nr_clk_ids = PERIS_NR_CLK, 8638c2ecf20Sopenharmony_ci .clk_regs = peris_clk_regs, 8648c2ecf20Sopenharmony_ci .nr_clk_regs = ARRAY_SIZE(peris_clk_regs), 8658c2ecf20Sopenharmony_ci}; 8668c2ecf20Sopenharmony_ci 8678c2ecf20Sopenharmony_cistatic void __init exynos7_clk_peris_init(struct device_node *np) 8688c2ecf20Sopenharmony_ci{ 8698c2ecf20Sopenharmony_ci samsung_cmu_register_one(np, &peris_cmu_info); 8708c2ecf20Sopenharmony_ci} 8718c2ecf20Sopenharmony_ci 8728c2ecf20Sopenharmony_ciCLK_OF_DECLARE(exynos7_clk_peris, "samsung,exynos7-clock-peris", 8738c2ecf20Sopenharmony_ci exynos7_clk_peris_init); 8748c2ecf20Sopenharmony_ci 8758c2ecf20Sopenharmony_ci/* Register Offset definitions for CMU_FSYS0 (0x10E90000) */ 8768c2ecf20Sopenharmony_ci#define MUX_SEL_FSYS00 0x0200 8778c2ecf20Sopenharmony_ci#define MUX_SEL_FSYS01 0x0204 8788c2ecf20Sopenharmony_ci#define MUX_SEL_FSYS02 0x0208 8798c2ecf20Sopenharmony_ci#define ENABLE_ACLK_FSYS00 0x0800 8808c2ecf20Sopenharmony_ci#define ENABLE_ACLK_FSYS01 0x0804 8818c2ecf20Sopenharmony_ci#define ENABLE_SCLK_FSYS01 0x0A04 8828c2ecf20Sopenharmony_ci#define ENABLE_SCLK_FSYS02 0x0A08 8838c2ecf20Sopenharmony_ci#define ENABLE_SCLK_FSYS04 0x0A10 8848c2ecf20Sopenharmony_ci 8858c2ecf20Sopenharmony_ci/* 8868c2ecf20Sopenharmony_ci * List of parent clocks for Muxes in CMU_FSYS0 8878c2ecf20Sopenharmony_ci */ 8888c2ecf20Sopenharmony_ciPNAME(mout_aclk_fsys0_200_user_p) = { "fin_pll", "aclk_fsys0_200" }; 8898c2ecf20Sopenharmony_ciPNAME(mout_sclk_mmc2_user_p) = { "fin_pll", "sclk_mmc2" }; 8908c2ecf20Sopenharmony_ci 8918c2ecf20Sopenharmony_ciPNAME(mout_sclk_usbdrd300_user_p) = { "fin_pll", "sclk_usbdrd300" }; 8928c2ecf20Sopenharmony_ciPNAME(mout_phyclk_usbdrd300_udrd30_phyclk_user_p) = { "fin_pll", 8938c2ecf20Sopenharmony_ci "phyclk_usbdrd300_udrd30_phyclock" }; 8948c2ecf20Sopenharmony_ciPNAME(mout_phyclk_usbdrd300_udrd30_pipe_pclk_user_p) = { "fin_pll", 8958c2ecf20Sopenharmony_ci "phyclk_usbdrd300_udrd30_pipe_pclk" }; 8968c2ecf20Sopenharmony_ci 8978c2ecf20Sopenharmony_ci/* fixed rate clocks used in the FSYS0 block */ 8988c2ecf20Sopenharmony_cistatic const struct samsung_fixed_rate_clock fixed_rate_clks_fsys0[] __initconst = { 8998c2ecf20Sopenharmony_ci FRATE(0, "phyclk_usbdrd300_udrd30_phyclock", NULL, 0, 60000000), 9008c2ecf20Sopenharmony_ci FRATE(0, "phyclk_usbdrd300_udrd30_pipe_pclk", NULL, 0, 125000000), 9018c2ecf20Sopenharmony_ci}; 9028c2ecf20Sopenharmony_ci 9038c2ecf20Sopenharmony_cistatic const unsigned long fsys0_clk_regs[] __initconst = { 9048c2ecf20Sopenharmony_ci MUX_SEL_FSYS00, 9058c2ecf20Sopenharmony_ci MUX_SEL_FSYS01, 9068c2ecf20Sopenharmony_ci MUX_SEL_FSYS02, 9078c2ecf20Sopenharmony_ci ENABLE_ACLK_FSYS00, 9088c2ecf20Sopenharmony_ci ENABLE_ACLK_FSYS01, 9098c2ecf20Sopenharmony_ci ENABLE_SCLK_FSYS01, 9108c2ecf20Sopenharmony_ci ENABLE_SCLK_FSYS02, 9118c2ecf20Sopenharmony_ci ENABLE_SCLK_FSYS04, 9128c2ecf20Sopenharmony_ci}; 9138c2ecf20Sopenharmony_ci 9148c2ecf20Sopenharmony_cistatic const struct samsung_mux_clock fsys0_mux_clks[] __initconst = { 9158c2ecf20Sopenharmony_ci MUX(0, "mout_aclk_fsys0_200_user", mout_aclk_fsys0_200_user_p, 9168c2ecf20Sopenharmony_ci MUX_SEL_FSYS00, 24, 1), 9178c2ecf20Sopenharmony_ci 9188c2ecf20Sopenharmony_ci MUX(0, "mout_sclk_mmc2_user", mout_sclk_mmc2_user_p, 9198c2ecf20Sopenharmony_ci MUX_SEL_FSYS01, 24, 1), 9208c2ecf20Sopenharmony_ci MUX(0, "mout_sclk_usbdrd300_user", mout_sclk_usbdrd300_user_p, 9218c2ecf20Sopenharmony_ci MUX_SEL_FSYS01, 28, 1), 9228c2ecf20Sopenharmony_ci 9238c2ecf20Sopenharmony_ci MUX(0, "mout_phyclk_usbdrd300_udrd30_pipe_pclk_user", 9248c2ecf20Sopenharmony_ci mout_phyclk_usbdrd300_udrd30_pipe_pclk_user_p, 9258c2ecf20Sopenharmony_ci MUX_SEL_FSYS02, 24, 1), 9268c2ecf20Sopenharmony_ci MUX(0, "mout_phyclk_usbdrd300_udrd30_phyclk_user", 9278c2ecf20Sopenharmony_ci mout_phyclk_usbdrd300_udrd30_phyclk_user_p, 9288c2ecf20Sopenharmony_ci MUX_SEL_FSYS02, 28, 1), 9298c2ecf20Sopenharmony_ci}; 9308c2ecf20Sopenharmony_ci 9318c2ecf20Sopenharmony_cistatic const struct samsung_gate_clock fsys0_gate_clks[] __initconst = { 9328c2ecf20Sopenharmony_ci GATE(ACLK_PDMA1, "aclk_pdma1", "mout_aclk_fsys0_200_user", 9338c2ecf20Sopenharmony_ci ENABLE_ACLK_FSYS00, 3, 0, 0), 9348c2ecf20Sopenharmony_ci GATE(ACLK_PDMA0, "aclk_pdma0", "mout_aclk_fsys0_200_user", 9358c2ecf20Sopenharmony_ci ENABLE_ACLK_FSYS00, 4, 0, 0), 9368c2ecf20Sopenharmony_ci GATE(ACLK_AXIUS_USBDRD30X_FSYS0X, "aclk_axius_usbdrd30x_fsys0x", 9378c2ecf20Sopenharmony_ci "mout_aclk_fsys0_200_user", 9388c2ecf20Sopenharmony_ci ENABLE_ACLK_FSYS00, 19, 0, 0), 9398c2ecf20Sopenharmony_ci 9408c2ecf20Sopenharmony_ci GATE(ACLK_USBDRD300, "aclk_usbdrd300", "mout_aclk_fsys0_200_user", 9418c2ecf20Sopenharmony_ci ENABLE_ACLK_FSYS01, 29, 0, 0), 9428c2ecf20Sopenharmony_ci GATE(ACLK_MMC2, "aclk_mmc2", "mout_aclk_fsys0_200_user", 9438c2ecf20Sopenharmony_ci ENABLE_ACLK_FSYS01, 31, 0, 0), 9448c2ecf20Sopenharmony_ci 9458c2ecf20Sopenharmony_ci GATE(SCLK_USBDRD300_SUSPENDCLK, "sclk_usbdrd300_suspendclk", 9468c2ecf20Sopenharmony_ci "mout_sclk_usbdrd300_user", 9478c2ecf20Sopenharmony_ci ENABLE_SCLK_FSYS01, 4, 0, 0), 9488c2ecf20Sopenharmony_ci GATE(SCLK_USBDRD300_REFCLK, "sclk_usbdrd300_refclk", "fin_pll", 9498c2ecf20Sopenharmony_ci ENABLE_SCLK_FSYS01, 8, 0, 0), 9508c2ecf20Sopenharmony_ci 9518c2ecf20Sopenharmony_ci GATE(PHYCLK_USBDRD300_UDRD30_PIPE_PCLK_USER, 9528c2ecf20Sopenharmony_ci "phyclk_usbdrd300_udrd30_pipe_pclk_user", 9538c2ecf20Sopenharmony_ci "mout_phyclk_usbdrd300_udrd30_pipe_pclk_user", 9548c2ecf20Sopenharmony_ci ENABLE_SCLK_FSYS02, 24, 0, 0), 9558c2ecf20Sopenharmony_ci GATE(PHYCLK_USBDRD300_UDRD30_PHYCLK_USER, 9568c2ecf20Sopenharmony_ci "phyclk_usbdrd300_udrd30_phyclk_user", 9578c2ecf20Sopenharmony_ci "mout_phyclk_usbdrd300_udrd30_phyclk_user", 9588c2ecf20Sopenharmony_ci ENABLE_SCLK_FSYS02, 28, 0, 0), 9598c2ecf20Sopenharmony_ci 9608c2ecf20Sopenharmony_ci GATE(OSCCLK_PHY_CLKOUT_USB30_PHY, "oscclk_phy_clkout_usb30_phy", 9618c2ecf20Sopenharmony_ci "fin_pll", 9628c2ecf20Sopenharmony_ci ENABLE_SCLK_FSYS04, 28, 0, 0), 9638c2ecf20Sopenharmony_ci}; 9648c2ecf20Sopenharmony_ci 9658c2ecf20Sopenharmony_cistatic const struct samsung_cmu_info fsys0_cmu_info __initconst = { 9668c2ecf20Sopenharmony_ci .fixed_clks = fixed_rate_clks_fsys0, 9678c2ecf20Sopenharmony_ci .nr_fixed_clks = ARRAY_SIZE(fixed_rate_clks_fsys0), 9688c2ecf20Sopenharmony_ci .mux_clks = fsys0_mux_clks, 9698c2ecf20Sopenharmony_ci .nr_mux_clks = ARRAY_SIZE(fsys0_mux_clks), 9708c2ecf20Sopenharmony_ci .gate_clks = fsys0_gate_clks, 9718c2ecf20Sopenharmony_ci .nr_gate_clks = ARRAY_SIZE(fsys0_gate_clks), 9728c2ecf20Sopenharmony_ci .nr_clk_ids = FSYS0_NR_CLK, 9738c2ecf20Sopenharmony_ci .clk_regs = fsys0_clk_regs, 9748c2ecf20Sopenharmony_ci .nr_clk_regs = ARRAY_SIZE(fsys0_clk_regs), 9758c2ecf20Sopenharmony_ci}; 9768c2ecf20Sopenharmony_ci 9778c2ecf20Sopenharmony_cistatic void __init exynos7_clk_fsys0_init(struct device_node *np) 9788c2ecf20Sopenharmony_ci{ 9798c2ecf20Sopenharmony_ci samsung_cmu_register_one(np, &fsys0_cmu_info); 9808c2ecf20Sopenharmony_ci} 9818c2ecf20Sopenharmony_ci 9828c2ecf20Sopenharmony_ciCLK_OF_DECLARE(exynos7_clk_fsys0, "samsung,exynos7-clock-fsys0", 9838c2ecf20Sopenharmony_ci exynos7_clk_fsys0_init); 9848c2ecf20Sopenharmony_ci 9858c2ecf20Sopenharmony_ci/* Register Offset definitions for CMU_FSYS1 (0x156E0000) */ 9868c2ecf20Sopenharmony_ci#define MUX_SEL_FSYS10 0x0200 9878c2ecf20Sopenharmony_ci#define MUX_SEL_FSYS11 0x0204 9888c2ecf20Sopenharmony_ci#define MUX_SEL_FSYS12 0x0208 9898c2ecf20Sopenharmony_ci#define DIV_FSYS1 0x0600 9908c2ecf20Sopenharmony_ci#define ENABLE_ACLK_FSYS1 0x0800 9918c2ecf20Sopenharmony_ci#define ENABLE_PCLK_FSYS1 0x0900 9928c2ecf20Sopenharmony_ci#define ENABLE_SCLK_FSYS11 0x0A04 9938c2ecf20Sopenharmony_ci#define ENABLE_SCLK_FSYS12 0x0A08 9948c2ecf20Sopenharmony_ci#define ENABLE_SCLK_FSYS13 0x0A0C 9958c2ecf20Sopenharmony_ci 9968c2ecf20Sopenharmony_ci/* 9978c2ecf20Sopenharmony_ci * List of parent clocks for Muxes in CMU_FSYS1 9988c2ecf20Sopenharmony_ci */ 9998c2ecf20Sopenharmony_ciPNAME(mout_aclk_fsys1_200_user_p) = { "fin_pll", "aclk_fsys1_200" }; 10008c2ecf20Sopenharmony_ciPNAME(mout_fsys1_group_p) = { "fin_pll", "fin_pll_26m", 10018c2ecf20Sopenharmony_ci "sclk_phy_fsys1_26m" }; 10028c2ecf20Sopenharmony_ciPNAME(mout_sclk_mmc0_user_p) = { "fin_pll", "sclk_mmc0" }; 10038c2ecf20Sopenharmony_ciPNAME(mout_sclk_mmc1_user_p) = { "fin_pll", "sclk_mmc1" }; 10048c2ecf20Sopenharmony_ciPNAME(mout_sclk_ufsunipro20_user_p) = { "fin_pll", "sclk_ufsunipro20" }; 10058c2ecf20Sopenharmony_ciPNAME(mout_phyclk_ufs20_tx0_user_p) = { "fin_pll", "phyclk_ufs20_tx0_symbol" }; 10068c2ecf20Sopenharmony_ciPNAME(mout_phyclk_ufs20_rx0_user_p) = { "fin_pll", "phyclk_ufs20_rx0_symbol" }; 10078c2ecf20Sopenharmony_ciPNAME(mout_phyclk_ufs20_rx1_user_p) = { "fin_pll", "phyclk_ufs20_rx1_symbol" }; 10088c2ecf20Sopenharmony_ci 10098c2ecf20Sopenharmony_ci/* fixed rate clocks used in the FSYS1 block */ 10108c2ecf20Sopenharmony_cistatic const struct samsung_fixed_rate_clock fixed_rate_clks_fsys1[] __initconst = { 10118c2ecf20Sopenharmony_ci FRATE(PHYCLK_UFS20_TX0_SYMBOL, "phyclk_ufs20_tx0_symbol", NULL, 10128c2ecf20Sopenharmony_ci 0, 300000000), 10138c2ecf20Sopenharmony_ci FRATE(PHYCLK_UFS20_RX0_SYMBOL, "phyclk_ufs20_rx0_symbol", NULL, 10148c2ecf20Sopenharmony_ci 0, 300000000), 10158c2ecf20Sopenharmony_ci FRATE(PHYCLK_UFS20_RX1_SYMBOL, "phyclk_ufs20_rx1_symbol", NULL, 10168c2ecf20Sopenharmony_ci 0, 300000000), 10178c2ecf20Sopenharmony_ci}; 10188c2ecf20Sopenharmony_ci 10198c2ecf20Sopenharmony_cistatic const unsigned long fsys1_clk_regs[] __initconst = { 10208c2ecf20Sopenharmony_ci MUX_SEL_FSYS10, 10218c2ecf20Sopenharmony_ci MUX_SEL_FSYS11, 10228c2ecf20Sopenharmony_ci MUX_SEL_FSYS12, 10238c2ecf20Sopenharmony_ci DIV_FSYS1, 10248c2ecf20Sopenharmony_ci ENABLE_ACLK_FSYS1, 10258c2ecf20Sopenharmony_ci ENABLE_PCLK_FSYS1, 10268c2ecf20Sopenharmony_ci ENABLE_SCLK_FSYS11, 10278c2ecf20Sopenharmony_ci ENABLE_SCLK_FSYS12, 10288c2ecf20Sopenharmony_ci ENABLE_SCLK_FSYS13, 10298c2ecf20Sopenharmony_ci}; 10308c2ecf20Sopenharmony_ci 10318c2ecf20Sopenharmony_cistatic const struct samsung_mux_clock fsys1_mux_clks[] __initconst = { 10328c2ecf20Sopenharmony_ci MUX(MOUT_FSYS1_PHYCLK_SEL1, "mout_fsys1_phyclk_sel1", 10338c2ecf20Sopenharmony_ci mout_fsys1_group_p, MUX_SEL_FSYS10, 16, 2), 10348c2ecf20Sopenharmony_ci MUX(0, "mout_fsys1_phyclk_sel0", mout_fsys1_group_p, 10358c2ecf20Sopenharmony_ci MUX_SEL_FSYS10, 20, 2), 10368c2ecf20Sopenharmony_ci MUX(0, "mout_aclk_fsys1_200_user", mout_aclk_fsys1_200_user_p, 10378c2ecf20Sopenharmony_ci MUX_SEL_FSYS10, 28, 1), 10388c2ecf20Sopenharmony_ci 10398c2ecf20Sopenharmony_ci MUX(0, "mout_sclk_mmc1_user", mout_sclk_mmc1_user_p, 10408c2ecf20Sopenharmony_ci MUX_SEL_FSYS11, 24, 1), 10418c2ecf20Sopenharmony_ci MUX(0, "mout_sclk_mmc0_user", mout_sclk_mmc0_user_p, 10428c2ecf20Sopenharmony_ci MUX_SEL_FSYS11, 28, 1), 10438c2ecf20Sopenharmony_ci MUX(0, "mout_sclk_ufsunipro20_user", mout_sclk_ufsunipro20_user_p, 10448c2ecf20Sopenharmony_ci MUX_SEL_FSYS11, 20, 1), 10458c2ecf20Sopenharmony_ci 10468c2ecf20Sopenharmony_ci MUX(0, "mout_phyclk_ufs20_rx1_symbol_user", 10478c2ecf20Sopenharmony_ci mout_phyclk_ufs20_rx1_user_p, MUX_SEL_FSYS12, 16, 1), 10488c2ecf20Sopenharmony_ci MUX(0, "mout_phyclk_ufs20_rx0_symbol_user", 10498c2ecf20Sopenharmony_ci mout_phyclk_ufs20_rx0_user_p, MUX_SEL_FSYS12, 24, 1), 10508c2ecf20Sopenharmony_ci MUX(0, "mout_phyclk_ufs20_tx0_symbol_user", 10518c2ecf20Sopenharmony_ci mout_phyclk_ufs20_tx0_user_p, MUX_SEL_FSYS12, 28, 1), 10528c2ecf20Sopenharmony_ci}; 10538c2ecf20Sopenharmony_ci 10548c2ecf20Sopenharmony_cistatic const struct samsung_div_clock fsys1_div_clks[] __initconst = { 10558c2ecf20Sopenharmony_ci DIV(DOUT_PCLK_FSYS1, "dout_pclk_fsys1", "mout_aclk_fsys1_200_user", 10568c2ecf20Sopenharmony_ci DIV_FSYS1, 0, 2), 10578c2ecf20Sopenharmony_ci}; 10588c2ecf20Sopenharmony_ci 10598c2ecf20Sopenharmony_cistatic const struct samsung_gate_clock fsys1_gate_clks[] __initconst = { 10608c2ecf20Sopenharmony_ci GATE(SCLK_UFSUNIPRO20_USER, "sclk_ufsunipro20_user", 10618c2ecf20Sopenharmony_ci "mout_sclk_ufsunipro20_user", 10628c2ecf20Sopenharmony_ci ENABLE_SCLK_FSYS11, 20, 0, 0), 10638c2ecf20Sopenharmony_ci 10648c2ecf20Sopenharmony_ci GATE(ACLK_MMC1, "aclk_mmc1", "mout_aclk_fsys1_200_user", 10658c2ecf20Sopenharmony_ci ENABLE_ACLK_FSYS1, 29, 0, 0), 10668c2ecf20Sopenharmony_ci GATE(ACLK_MMC0, "aclk_mmc0", "mout_aclk_fsys1_200_user", 10678c2ecf20Sopenharmony_ci ENABLE_ACLK_FSYS1, 30, 0, 0), 10688c2ecf20Sopenharmony_ci 10698c2ecf20Sopenharmony_ci GATE(ACLK_UFS20_LINK, "aclk_ufs20_link", "dout_pclk_fsys1", 10708c2ecf20Sopenharmony_ci ENABLE_ACLK_FSYS1, 31, 0, 0), 10718c2ecf20Sopenharmony_ci GATE(PCLK_GPIO_FSYS1, "pclk_gpio_fsys1", "mout_aclk_fsys1_200_user", 10728c2ecf20Sopenharmony_ci ENABLE_PCLK_FSYS1, 30, 0, 0), 10738c2ecf20Sopenharmony_ci 10748c2ecf20Sopenharmony_ci GATE(PHYCLK_UFS20_RX1_SYMBOL_USER, "phyclk_ufs20_rx1_symbol_user", 10758c2ecf20Sopenharmony_ci "mout_phyclk_ufs20_rx1_symbol_user", 10768c2ecf20Sopenharmony_ci ENABLE_SCLK_FSYS12, 16, 0, 0), 10778c2ecf20Sopenharmony_ci GATE(PHYCLK_UFS20_RX0_SYMBOL_USER, "phyclk_ufs20_rx0_symbol_user", 10788c2ecf20Sopenharmony_ci "mout_phyclk_ufs20_rx0_symbol_user", 10798c2ecf20Sopenharmony_ci ENABLE_SCLK_FSYS12, 24, 0, 0), 10808c2ecf20Sopenharmony_ci GATE(PHYCLK_UFS20_TX0_SYMBOL_USER, "phyclk_ufs20_tx0_symbol_user", 10818c2ecf20Sopenharmony_ci "mout_phyclk_ufs20_tx0_symbol_user", 10828c2ecf20Sopenharmony_ci ENABLE_SCLK_FSYS12, 28, 0, 0), 10838c2ecf20Sopenharmony_ci 10848c2ecf20Sopenharmony_ci GATE(OSCCLK_PHY_CLKOUT_EMBEDDED_COMBO_PHY, 10858c2ecf20Sopenharmony_ci "oscclk_phy_clkout_embedded_combo_phy", 10868c2ecf20Sopenharmony_ci "fin_pll", 10878c2ecf20Sopenharmony_ci ENABLE_SCLK_FSYS12, 4, CLK_IGNORE_UNUSED, 0), 10888c2ecf20Sopenharmony_ci 10898c2ecf20Sopenharmony_ci GATE(SCLK_COMBO_PHY_EMBEDDED_26M, "sclk_combo_phy_embedded_26m", 10908c2ecf20Sopenharmony_ci "mout_fsys1_phyclk_sel1", 10918c2ecf20Sopenharmony_ci ENABLE_SCLK_FSYS13, 24, CLK_IGNORE_UNUSED, 0), 10928c2ecf20Sopenharmony_ci}; 10938c2ecf20Sopenharmony_ci 10948c2ecf20Sopenharmony_cistatic const struct samsung_cmu_info fsys1_cmu_info __initconst = { 10958c2ecf20Sopenharmony_ci .fixed_clks = fixed_rate_clks_fsys1, 10968c2ecf20Sopenharmony_ci .nr_fixed_clks = ARRAY_SIZE(fixed_rate_clks_fsys1), 10978c2ecf20Sopenharmony_ci .mux_clks = fsys1_mux_clks, 10988c2ecf20Sopenharmony_ci .nr_mux_clks = ARRAY_SIZE(fsys1_mux_clks), 10998c2ecf20Sopenharmony_ci .div_clks = fsys1_div_clks, 11008c2ecf20Sopenharmony_ci .nr_div_clks = ARRAY_SIZE(fsys1_div_clks), 11018c2ecf20Sopenharmony_ci .gate_clks = fsys1_gate_clks, 11028c2ecf20Sopenharmony_ci .nr_gate_clks = ARRAY_SIZE(fsys1_gate_clks), 11038c2ecf20Sopenharmony_ci .nr_clk_ids = FSYS1_NR_CLK, 11048c2ecf20Sopenharmony_ci .clk_regs = fsys1_clk_regs, 11058c2ecf20Sopenharmony_ci .nr_clk_regs = ARRAY_SIZE(fsys1_clk_regs), 11068c2ecf20Sopenharmony_ci}; 11078c2ecf20Sopenharmony_ci 11088c2ecf20Sopenharmony_cistatic void __init exynos7_clk_fsys1_init(struct device_node *np) 11098c2ecf20Sopenharmony_ci{ 11108c2ecf20Sopenharmony_ci samsung_cmu_register_one(np, &fsys1_cmu_info); 11118c2ecf20Sopenharmony_ci} 11128c2ecf20Sopenharmony_ci 11138c2ecf20Sopenharmony_ciCLK_OF_DECLARE(exynos7_clk_fsys1, "samsung,exynos7-clock-fsys1", 11148c2ecf20Sopenharmony_ci exynos7_clk_fsys1_init); 11158c2ecf20Sopenharmony_ci 11168c2ecf20Sopenharmony_ci#define MUX_SEL_MSCL 0x0200 11178c2ecf20Sopenharmony_ci#define DIV_MSCL 0x0600 11188c2ecf20Sopenharmony_ci#define ENABLE_ACLK_MSCL 0x0800 11198c2ecf20Sopenharmony_ci#define ENABLE_PCLK_MSCL 0x0900 11208c2ecf20Sopenharmony_ci 11218c2ecf20Sopenharmony_ci/* List of parent clocks for Muxes in CMU_MSCL */ 11228c2ecf20Sopenharmony_ciPNAME(mout_aclk_mscl_532_user_p) = { "fin_pll", "aclk_mscl_532" }; 11238c2ecf20Sopenharmony_ci 11248c2ecf20Sopenharmony_cistatic const unsigned long mscl_clk_regs[] __initconst = { 11258c2ecf20Sopenharmony_ci MUX_SEL_MSCL, 11268c2ecf20Sopenharmony_ci DIV_MSCL, 11278c2ecf20Sopenharmony_ci ENABLE_ACLK_MSCL, 11288c2ecf20Sopenharmony_ci ENABLE_PCLK_MSCL, 11298c2ecf20Sopenharmony_ci}; 11308c2ecf20Sopenharmony_ci 11318c2ecf20Sopenharmony_cistatic const struct samsung_mux_clock mscl_mux_clks[] __initconst = { 11328c2ecf20Sopenharmony_ci MUX(USERMUX_ACLK_MSCL_532, "usermux_aclk_mscl_532", 11338c2ecf20Sopenharmony_ci mout_aclk_mscl_532_user_p, MUX_SEL_MSCL, 0, 1), 11348c2ecf20Sopenharmony_ci}; 11358c2ecf20Sopenharmony_cistatic const struct samsung_div_clock mscl_div_clks[] __initconst = { 11368c2ecf20Sopenharmony_ci DIV(DOUT_PCLK_MSCL, "dout_pclk_mscl", "usermux_aclk_mscl_532", 11378c2ecf20Sopenharmony_ci DIV_MSCL, 0, 3), 11388c2ecf20Sopenharmony_ci}; 11398c2ecf20Sopenharmony_cistatic const struct samsung_gate_clock mscl_gate_clks[] __initconst = { 11408c2ecf20Sopenharmony_ci 11418c2ecf20Sopenharmony_ci GATE(ACLK_MSCL_0, "aclk_mscl_0", "usermux_aclk_mscl_532", 11428c2ecf20Sopenharmony_ci ENABLE_ACLK_MSCL, 31, 0, 0), 11438c2ecf20Sopenharmony_ci GATE(ACLK_MSCL_1, "aclk_mscl_1", "usermux_aclk_mscl_532", 11448c2ecf20Sopenharmony_ci ENABLE_ACLK_MSCL, 30, 0, 0), 11458c2ecf20Sopenharmony_ci GATE(ACLK_JPEG, "aclk_jpeg", "usermux_aclk_mscl_532", 11468c2ecf20Sopenharmony_ci ENABLE_ACLK_MSCL, 29, 0, 0), 11478c2ecf20Sopenharmony_ci GATE(ACLK_G2D, "aclk_g2d", "usermux_aclk_mscl_532", 11488c2ecf20Sopenharmony_ci ENABLE_ACLK_MSCL, 28, 0, 0), 11498c2ecf20Sopenharmony_ci GATE(ACLK_LH_ASYNC_SI_MSCL_0, "aclk_lh_async_si_mscl_0", 11508c2ecf20Sopenharmony_ci "usermux_aclk_mscl_532", 11518c2ecf20Sopenharmony_ci ENABLE_ACLK_MSCL, 27, 0, 0), 11528c2ecf20Sopenharmony_ci GATE(ACLK_LH_ASYNC_SI_MSCL_1, "aclk_lh_async_si_mscl_1", 11538c2ecf20Sopenharmony_ci "usermux_aclk_mscl_532", 11548c2ecf20Sopenharmony_ci ENABLE_ACLK_MSCL, 26, 0, 0), 11558c2ecf20Sopenharmony_ci GATE(ACLK_XIU_MSCLX_0, "aclk_xiu_msclx_0", "usermux_aclk_mscl_532", 11568c2ecf20Sopenharmony_ci ENABLE_ACLK_MSCL, 25, 0, 0), 11578c2ecf20Sopenharmony_ci GATE(ACLK_XIU_MSCLX_1, "aclk_xiu_msclx_1", "usermux_aclk_mscl_532", 11588c2ecf20Sopenharmony_ci ENABLE_ACLK_MSCL, 24, 0, 0), 11598c2ecf20Sopenharmony_ci GATE(ACLK_AXI2ACEL_BRIDGE, "aclk_axi2acel_bridge", 11608c2ecf20Sopenharmony_ci "usermux_aclk_mscl_532", 11618c2ecf20Sopenharmony_ci ENABLE_ACLK_MSCL, 23, 0, 0), 11628c2ecf20Sopenharmony_ci GATE(ACLK_QE_MSCL_0, "aclk_qe_mscl_0", "usermux_aclk_mscl_532", 11638c2ecf20Sopenharmony_ci ENABLE_ACLK_MSCL, 22, 0, 0), 11648c2ecf20Sopenharmony_ci GATE(ACLK_QE_MSCL_1, "aclk_qe_mscl_1", "usermux_aclk_mscl_532", 11658c2ecf20Sopenharmony_ci ENABLE_ACLK_MSCL, 21, 0, 0), 11668c2ecf20Sopenharmony_ci GATE(ACLK_QE_JPEG, "aclk_qe_jpeg", "usermux_aclk_mscl_532", 11678c2ecf20Sopenharmony_ci ENABLE_ACLK_MSCL, 20, 0, 0), 11688c2ecf20Sopenharmony_ci GATE(ACLK_QE_G2D, "aclk_qe_g2d", "usermux_aclk_mscl_532", 11698c2ecf20Sopenharmony_ci ENABLE_ACLK_MSCL, 19, 0, 0), 11708c2ecf20Sopenharmony_ci GATE(ACLK_PPMU_MSCL_0, "aclk_ppmu_mscl_0", "usermux_aclk_mscl_532", 11718c2ecf20Sopenharmony_ci ENABLE_ACLK_MSCL, 18, 0, 0), 11728c2ecf20Sopenharmony_ci GATE(ACLK_PPMU_MSCL_1, "aclk_ppmu_mscl_1", "usermux_aclk_mscl_532", 11738c2ecf20Sopenharmony_ci ENABLE_ACLK_MSCL, 17, 0, 0), 11748c2ecf20Sopenharmony_ci GATE(ACLK_MSCLNP_133, "aclk_msclnp_133", "usermux_aclk_mscl_532", 11758c2ecf20Sopenharmony_ci ENABLE_ACLK_MSCL, 16, 0, 0), 11768c2ecf20Sopenharmony_ci GATE(ACLK_AHB2APB_MSCL0P, "aclk_ahb2apb_mscl0p", 11778c2ecf20Sopenharmony_ci "usermux_aclk_mscl_532", 11788c2ecf20Sopenharmony_ci ENABLE_ACLK_MSCL, 15, 0, 0), 11798c2ecf20Sopenharmony_ci GATE(ACLK_AHB2APB_MSCL1P, "aclk_ahb2apb_mscl1p", 11808c2ecf20Sopenharmony_ci "usermux_aclk_mscl_532", 11818c2ecf20Sopenharmony_ci ENABLE_ACLK_MSCL, 14, 0, 0), 11828c2ecf20Sopenharmony_ci 11838c2ecf20Sopenharmony_ci GATE(PCLK_MSCL_0, "pclk_mscl_0", "dout_pclk_mscl", 11848c2ecf20Sopenharmony_ci ENABLE_PCLK_MSCL, 31, 0, 0), 11858c2ecf20Sopenharmony_ci GATE(PCLK_MSCL_1, "pclk_mscl_1", "dout_pclk_mscl", 11868c2ecf20Sopenharmony_ci ENABLE_PCLK_MSCL, 30, 0, 0), 11878c2ecf20Sopenharmony_ci GATE(PCLK_JPEG, "pclk_jpeg", "dout_pclk_mscl", 11888c2ecf20Sopenharmony_ci ENABLE_PCLK_MSCL, 29, 0, 0), 11898c2ecf20Sopenharmony_ci GATE(PCLK_G2D, "pclk_g2d", "dout_pclk_mscl", 11908c2ecf20Sopenharmony_ci ENABLE_PCLK_MSCL, 28, 0, 0), 11918c2ecf20Sopenharmony_ci GATE(PCLK_QE_MSCL_0, "pclk_qe_mscl_0", "dout_pclk_mscl", 11928c2ecf20Sopenharmony_ci ENABLE_PCLK_MSCL, 27, 0, 0), 11938c2ecf20Sopenharmony_ci GATE(PCLK_QE_MSCL_1, "pclk_qe_mscl_1", "dout_pclk_mscl", 11948c2ecf20Sopenharmony_ci ENABLE_PCLK_MSCL, 26, 0, 0), 11958c2ecf20Sopenharmony_ci GATE(PCLK_QE_JPEG, "pclk_qe_jpeg", "dout_pclk_mscl", 11968c2ecf20Sopenharmony_ci ENABLE_PCLK_MSCL, 25, 0, 0), 11978c2ecf20Sopenharmony_ci GATE(PCLK_QE_G2D, "pclk_qe_g2d", "dout_pclk_mscl", 11988c2ecf20Sopenharmony_ci ENABLE_PCLK_MSCL, 24, 0, 0), 11998c2ecf20Sopenharmony_ci GATE(PCLK_PPMU_MSCL_0, "pclk_ppmu_mscl_0", "dout_pclk_mscl", 12008c2ecf20Sopenharmony_ci ENABLE_PCLK_MSCL, 23, 0, 0), 12018c2ecf20Sopenharmony_ci GATE(PCLK_PPMU_MSCL_1, "pclk_ppmu_mscl_1", "dout_pclk_mscl", 12028c2ecf20Sopenharmony_ci ENABLE_PCLK_MSCL, 22, 0, 0), 12038c2ecf20Sopenharmony_ci GATE(PCLK_AXI2ACEL_BRIDGE, "pclk_axi2acel_bridge", "dout_pclk_mscl", 12048c2ecf20Sopenharmony_ci ENABLE_PCLK_MSCL, 21, 0, 0), 12058c2ecf20Sopenharmony_ci GATE(PCLK_PMU_MSCL, "pclk_pmu_mscl", "dout_pclk_mscl", 12068c2ecf20Sopenharmony_ci ENABLE_PCLK_MSCL, 20, 0, 0), 12078c2ecf20Sopenharmony_ci}; 12088c2ecf20Sopenharmony_ci 12098c2ecf20Sopenharmony_cistatic const struct samsung_cmu_info mscl_cmu_info __initconst = { 12108c2ecf20Sopenharmony_ci .mux_clks = mscl_mux_clks, 12118c2ecf20Sopenharmony_ci .nr_mux_clks = ARRAY_SIZE(mscl_mux_clks), 12128c2ecf20Sopenharmony_ci .div_clks = mscl_div_clks, 12138c2ecf20Sopenharmony_ci .nr_div_clks = ARRAY_SIZE(mscl_div_clks), 12148c2ecf20Sopenharmony_ci .gate_clks = mscl_gate_clks, 12158c2ecf20Sopenharmony_ci .nr_gate_clks = ARRAY_SIZE(mscl_gate_clks), 12168c2ecf20Sopenharmony_ci .nr_clk_ids = MSCL_NR_CLK, 12178c2ecf20Sopenharmony_ci .clk_regs = mscl_clk_regs, 12188c2ecf20Sopenharmony_ci .nr_clk_regs = ARRAY_SIZE(mscl_clk_regs), 12198c2ecf20Sopenharmony_ci}; 12208c2ecf20Sopenharmony_ci 12218c2ecf20Sopenharmony_cistatic void __init exynos7_clk_mscl_init(struct device_node *np) 12228c2ecf20Sopenharmony_ci{ 12238c2ecf20Sopenharmony_ci samsung_cmu_register_one(np, &mscl_cmu_info); 12248c2ecf20Sopenharmony_ci} 12258c2ecf20Sopenharmony_ci 12268c2ecf20Sopenharmony_ciCLK_OF_DECLARE(exynos7_clk_mscl, "samsung,exynos7-clock-mscl", 12278c2ecf20Sopenharmony_ci exynos7_clk_mscl_init); 12288c2ecf20Sopenharmony_ci 12298c2ecf20Sopenharmony_ci/* Register Offset definitions for CMU_AUD (0x114C0000) */ 12308c2ecf20Sopenharmony_ci#define MUX_SEL_AUD 0x0200 12318c2ecf20Sopenharmony_ci#define DIV_AUD0 0x0600 12328c2ecf20Sopenharmony_ci#define DIV_AUD1 0x0604 12338c2ecf20Sopenharmony_ci#define ENABLE_ACLK_AUD 0x0800 12348c2ecf20Sopenharmony_ci#define ENABLE_PCLK_AUD 0x0900 12358c2ecf20Sopenharmony_ci#define ENABLE_SCLK_AUD 0x0A00 12368c2ecf20Sopenharmony_ci 12378c2ecf20Sopenharmony_ci/* 12388c2ecf20Sopenharmony_ci * List of parent clocks for Muxes in CMU_AUD 12398c2ecf20Sopenharmony_ci */ 12408c2ecf20Sopenharmony_ciPNAME(mout_aud_pll_user_p) = { "fin_pll", "fout_aud_pll" }; 12418c2ecf20Sopenharmony_ciPNAME(mout_aud_group_p) = { "dout_aud_cdclk", "ioclk_audiocdclk0" }; 12428c2ecf20Sopenharmony_ci 12438c2ecf20Sopenharmony_cistatic const unsigned long aud_clk_regs[] __initconst = { 12448c2ecf20Sopenharmony_ci MUX_SEL_AUD, 12458c2ecf20Sopenharmony_ci DIV_AUD0, 12468c2ecf20Sopenharmony_ci DIV_AUD1, 12478c2ecf20Sopenharmony_ci ENABLE_ACLK_AUD, 12488c2ecf20Sopenharmony_ci ENABLE_PCLK_AUD, 12498c2ecf20Sopenharmony_ci ENABLE_SCLK_AUD, 12508c2ecf20Sopenharmony_ci}; 12518c2ecf20Sopenharmony_ci 12528c2ecf20Sopenharmony_cistatic const struct samsung_mux_clock aud_mux_clks[] __initconst = { 12538c2ecf20Sopenharmony_ci MUX(0, "mout_sclk_i2s", mout_aud_group_p, MUX_SEL_AUD, 12, 1), 12548c2ecf20Sopenharmony_ci MUX(0, "mout_sclk_pcm", mout_aud_group_p, MUX_SEL_AUD, 16, 1), 12558c2ecf20Sopenharmony_ci MUX(0, "mout_aud_pll_user", mout_aud_pll_user_p, MUX_SEL_AUD, 20, 1), 12568c2ecf20Sopenharmony_ci}; 12578c2ecf20Sopenharmony_ci 12588c2ecf20Sopenharmony_cistatic const struct samsung_div_clock aud_div_clks[] __initconst = { 12598c2ecf20Sopenharmony_ci DIV(0, "dout_aud_ca5", "mout_aud_pll_user", DIV_AUD0, 0, 4), 12608c2ecf20Sopenharmony_ci DIV(0, "dout_aclk_aud", "dout_aud_ca5", DIV_AUD0, 4, 4), 12618c2ecf20Sopenharmony_ci DIV(0, "dout_aud_pclk_dbg", "dout_aud_ca5", DIV_AUD0, 8, 4), 12628c2ecf20Sopenharmony_ci 12638c2ecf20Sopenharmony_ci DIV(0, "dout_sclk_i2s", "mout_sclk_i2s", DIV_AUD1, 0, 4), 12648c2ecf20Sopenharmony_ci DIV(0, "dout_sclk_pcm", "mout_sclk_pcm", DIV_AUD1, 4, 8), 12658c2ecf20Sopenharmony_ci DIV(0, "dout_sclk_uart", "dout_aud_cdclk", DIV_AUD1, 12, 4), 12668c2ecf20Sopenharmony_ci DIV(0, "dout_sclk_slimbus", "dout_aud_cdclk", DIV_AUD1, 16, 5), 12678c2ecf20Sopenharmony_ci DIV(0, "dout_aud_cdclk", "mout_aud_pll_user", DIV_AUD1, 24, 4), 12688c2ecf20Sopenharmony_ci}; 12698c2ecf20Sopenharmony_ci 12708c2ecf20Sopenharmony_cistatic const struct samsung_gate_clock aud_gate_clks[] __initconst = { 12718c2ecf20Sopenharmony_ci GATE(SCLK_PCM, "sclk_pcm", "dout_sclk_pcm", 12728c2ecf20Sopenharmony_ci ENABLE_SCLK_AUD, 27, CLK_SET_RATE_PARENT, 0), 12738c2ecf20Sopenharmony_ci GATE(SCLK_I2S, "sclk_i2s", "dout_sclk_i2s", 12748c2ecf20Sopenharmony_ci ENABLE_SCLK_AUD, 28, CLK_SET_RATE_PARENT, 0), 12758c2ecf20Sopenharmony_ci GATE(0, "sclk_uart", "dout_sclk_uart", ENABLE_SCLK_AUD, 29, 0, 0), 12768c2ecf20Sopenharmony_ci GATE(0, "sclk_slimbus", "dout_sclk_slimbus", 12778c2ecf20Sopenharmony_ci ENABLE_SCLK_AUD, 30, 0, 0), 12788c2ecf20Sopenharmony_ci 12798c2ecf20Sopenharmony_ci GATE(0, "pclk_dbg_aud", "dout_aud_pclk_dbg", ENABLE_PCLK_AUD, 19, 0, 0), 12808c2ecf20Sopenharmony_ci GATE(0, "pclk_gpio_aud", "dout_aclk_aud", ENABLE_PCLK_AUD, 20, 0, 0), 12818c2ecf20Sopenharmony_ci GATE(0, "pclk_wdt1", "dout_aclk_aud", ENABLE_PCLK_AUD, 22, 0, 0), 12828c2ecf20Sopenharmony_ci GATE(0, "pclk_wdt0", "dout_aclk_aud", ENABLE_PCLK_AUD, 23, 0, 0), 12838c2ecf20Sopenharmony_ci GATE(0, "pclk_slimbus", "dout_aclk_aud", ENABLE_PCLK_AUD, 24, 0, 0), 12848c2ecf20Sopenharmony_ci GATE(0, "pclk_uart", "dout_aclk_aud", ENABLE_PCLK_AUD, 25, 0, 0), 12858c2ecf20Sopenharmony_ci GATE(PCLK_PCM, "pclk_pcm", "dout_aclk_aud", 12868c2ecf20Sopenharmony_ci ENABLE_PCLK_AUD, 26, CLK_SET_RATE_PARENT, 0), 12878c2ecf20Sopenharmony_ci GATE(PCLK_I2S, "pclk_i2s", "dout_aclk_aud", 12888c2ecf20Sopenharmony_ci ENABLE_PCLK_AUD, 27, CLK_SET_RATE_PARENT, 0), 12898c2ecf20Sopenharmony_ci GATE(0, "pclk_timer", "dout_aclk_aud", ENABLE_PCLK_AUD, 28, 0, 0), 12908c2ecf20Sopenharmony_ci GATE(0, "pclk_smmu_aud", "dout_aclk_aud", ENABLE_PCLK_AUD, 31, 0, 0), 12918c2ecf20Sopenharmony_ci 12928c2ecf20Sopenharmony_ci GATE(0, "aclk_smmu_aud", "dout_aclk_aud", ENABLE_ACLK_AUD, 27, 0, 0), 12938c2ecf20Sopenharmony_ci GATE(0, "aclk_acel_lh_async_si_top", "dout_aclk_aud", 12948c2ecf20Sopenharmony_ci ENABLE_ACLK_AUD, 28, 0, 0), 12958c2ecf20Sopenharmony_ci GATE(ACLK_ADMA, "aclk_dmac", "dout_aclk_aud", ENABLE_ACLK_AUD, 31, 0, 0), 12968c2ecf20Sopenharmony_ci}; 12978c2ecf20Sopenharmony_ci 12988c2ecf20Sopenharmony_cistatic const struct samsung_cmu_info aud_cmu_info __initconst = { 12998c2ecf20Sopenharmony_ci .mux_clks = aud_mux_clks, 13008c2ecf20Sopenharmony_ci .nr_mux_clks = ARRAY_SIZE(aud_mux_clks), 13018c2ecf20Sopenharmony_ci .div_clks = aud_div_clks, 13028c2ecf20Sopenharmony_ci .nr_div_clks = ARRAY_SIZE(aud_div_clks), 13038c2ecf20Sopenharmony_ci .gate_clks = aud_gate_clks, 13048c2ecf20Sopenharmony_ci .nr_gate_clks = ARRAY_SIZE(aud_gate_clks), 13058c2ecf20Sopenharmony_ci .nr_clk_ids = AUD_NR_CLK, 13068c2ecf20Sopenharmony_ci .clk_regs = aud_clk_regs, 13078c2ecf20Sopenharmony_ci .nr_clk_regs = ARRAY_SIZE(aud_clk_regs), 13088c2ecf20Sopenharmony_ci}; 13098c2ecf20Sopenharmony_ci 13108c2ecf20Sopenharmony_cistatic void __init exynos7_clk_aud_init(struct device_node *np) 13118c2ecf20Sopenharmony_ci{ 13128c2ecf20Sopenharmony_ci samsung_cmu_register_one(np, &aud_cmu_info); 13138c2ecf20Sopenharmony_ci} 13148c2ecf20Sopenharmony_ci 13158c2ecf20Sopenharmony_ciCLK_OF_DECLARE(exynos7_clk_aud, "samsung,exynos7-clock-aud", 13168c2ecf20Sopenharmony_ci exynos7_clk_aud_init); 1317