1*d2912cb1SThomas Gleixner // SPDX-License-Identifier: GPL-2.0-only 221876ea5STero Kristo /* 321876ea5STero Kristo * OMAP4 Clock init 421876ea5STero Kristo * 521876ea5STero Kristo * Copyright (C) 2013 Texas Instruments, Inc. 621876ea5STero Kristo * 721876ea5STero Kristo * Tero Kristo (t-kristo@ti.com) 821876ea5STero Kristo */ 921876ea5STero Kristo 1021876ea5STero Kristo #include <linux/kernel.h> 1121876ea5STero Kristo #include <linux/list.h> 12e387088aSStephen Boyd #include <linux/clk.h> 1321876ea5STero Kristo #include <linux/clkdev.h> 1421876ea5STero Kristo #include <linux/clk/ti.h> 151c881b5aSTero Kristo #include <dt-bindings/clock/omap4.h> 1621876ea5STero Kristo 17a3314e9cSTero Kristo #include "clock.h" 18a3314e9cSTero Kristo 1921876ea5STero Kristo /* 2021876ea5STero Kristo * OMAP4 ABE DPLL default frequency. In OMAP4460 TRM version V, section 2121876ea5STero Kristo * "3.6.3.2.3 CM1_ABE Clock Generator" states that the "DPLL_ABE_X2_CLK 2221876ea5STero Kristo * must be set to 196.608 MHz" and hence, the DPLL locked frequency is 2321876ea5STero Kristo * half of this value. 2421876ea5STero Kristo */ 2521876ea5STero Kristo #define OMAP4_DPLL_ABE_DEFFREQ 98304000 2621876ea5STero Kristo 2721876ea5STero Kristo /* 2821876ea5STero Kristo * OMAP4 USB DPLL default frequency. In OMAP4430 TRM version V, section 2921876ea5STero Kristo * "3.6.3.9.5 DPLL_USB Preferred Settings" shows that the preferred 3021876ea5STero Kristo * locked frequency for the USB DPLL is 960MHz. 3121876ea5STero Kristo */ 3221876ea5STero Kristo #define OMAP4_DPLL_USB_DEFFREQ 960000000 3321876ea5STero Kristo 341c881b5aSTero Kristo static const struct omap_clkctrl_reg_data omap4_mpuss_clkctrl_regs[] __initconst = { 35fe7020e6STero Kristo { OMAP4_MPU_CLKCTRL, NULL, 0, "dpll_mpu_m2_ck" }, 361c881b5aSTero Kristo { 0 }, 371c881b5aSTero Kristo }; 381c881b5aSTero Kristo 391c881b5aSTero Kristo static const struct omap_clkctrl_reg_data omap4_tesla_clkctrl_regs[] __initconst = { 401c881b5aSTero Kristo { OMAP4_DSP_CLKCTRL, NULL, CLKF_HW_SUP, "dpll_iva_m4x2_ck" }, 411c881b5aSTero Kristo { 0 }, 421c881b5aSTero Kristo }; 431c881b5aSTero Kristo 441c881b5aSTero Kristo static const char * const omap4_aess_fclk_parents[] __initconst = { 451c881b5aSTero Kristo "abe_clk", 461c881b5aSTero Kristo NULL, 471c881b5aSTero Kristo }; 481c881b5aSTero Kristo 491c881b5aSTero Kristo static const struct omap_clkctrl_div_data omap4_aess_fclk_data __initconst = { 501c881b5aSTero Kristo .max_div = 2, 511c881b5aSTero Kristo }; 521c881b5aSTero Kristo 531c881b5aSTero Kristo static const struct omap_clkctrl_bit_data omap4_aess_bit_data[] __initconst = { 541c881b5aSTero Kristo { 24, TI_CLK_DIVIDER, omap4_aess_fclk_parents, &omap4_aess_fclk_data }, 551c881b5aSTero Kristo { 0 }, 561c881b5aSTero Kristo }; 571c881b5aSTero Kristo 581c881b5aSTero Kristo static const char * const omap4_func_dmic_abe_gfclk_parents[] __initconst = { 59fe7020e6STero Kristo "abe_cm:clk:0018:26", 601c881b5aSTero Kristo "pad_clks_ck", 611c881b5aSTero Kristo "slimbus_clk", 621c881b5aSTero Kristo NULL, 631c881b5aSTero Kristo }; 641c881b5aSTero Kristo 651c881b5aSTero Kristo static const char * const omap4_dmic_sync_mux_ck_parents[] __initconst = { 661c881b5aSTero Kristo "abe_24m_fclk", 671c881b5aSTero Kristo "syc_clk_div_ck", 681c881b5aSTero Kristo "func_24m_clk", 691c881b5aSTero Kristo NULL, 701c881b5aSTero Kristo }; 711c881b5aSTero Kristo 721c881b5aSTero Kristo static const struct omap_clkctrl_bit_data omap4_dmic_bit_data[] __initconst = { 731c881b5aSTero Kristo { 24, TI_CLK_MUX, omap4_func_dmic_abe_gfclk_parents, NULL }, 741c881b5aSTero Kristo { 26, TI_CLK_MUX, omap4_dmic_sync_mux_ck_parents, NULL }, 751c881b5aSTero Kristo { 0 }, 761c881b5aSTero Kristo }; 771c881b5aSTero Kristo 781c881b5aSTero Kristo static const char * const omap4_func_mcasp_abe_gfclk_parents[] __initconst = { 79fe7020e6STero Kristo "abe_cm:clk:0020:26", 801c881b5aSTero Kristo "pad_clks_ck", 811c881b5aSTero Kristo "slimbus_clk", 821c881b5aSTero Kristo NULL, 831c881b5aSTero Kristo }; 841c881b5aSTero Kristo 851c881b5aSTero Kristo static const struct omap_clkctrl_bit_data omap4_mcasp_bit_data[] __initconst = { 861c881b5aSTero Kristo { 24, TI_CLK_MUX, omap4_func_mcasp_abe_gfclk_parents, NULL }, 871c881b5aSTero Kristo { 26, TI_CLK_MUX, omap4_dmic_sync_mux_ck_parents, NULL }, 881c881b5aSTero Kristo { 0 }, 891c881b5aSTero Kristo }; 901c881b5aSTero Kristo 911c881b5aSTero Kristo static const char * const omap4_func_mcbsp1_gfclk_parents[] __initconst = { 92fe7020e6STero Kristo "abe_cm:clk:0028:26", 931c881b5aSTero Kristo "pad_clks_ck", 941c881b5aSTero Kristo "slimbus_clk", 951c881b5aSTero Kristo NULL, 961c881b5aSTero Kristo }; 971c881b5aSTero Kristo 981c881b5aSTero Kristo static const struct omap_clkctrl_bit_data omap4_mcbsp1_bit_data[] __initconst = { 991c881b5aSTero Kristo { 24, TI_CLK_MUX, omap4_func_mcbsp1_gfclk_parents, NULL }, 1001c881b5aSTero Kristo { 26, TI_CLK_MUX, omap4_dmic_sync_mux_ck_parents, NULL }, 1011c881b5aSTero Kristo { 0 }, 1021c881b5aSTero Kristo }; 1031c881b5aSTero Kristo 1041c881b5aSTero Kristo static const char * const omap4_func_mcbsp2_gfclk_parents[] __initconst = { 105fe7020e6STero Kristo "abe_cm:clk:0030:26", 1061c881b5aSTero Kristo "pad_clks_ck", 1071c881b5aSTero Kristo "slimbus_clk", 1081c881b5aSTero Kristo NULL, 1091c881b5aSTero Kristo }; 1101c881b5aSTero Kristo 1111c881b5aSTero Kristo static const struct omap_clkctrl_bit_data omap4_mcbsp2_bit_data[] __initconst = { 1121c881b5aSTero Kristo { 24, TI_CLK_MUX, omap4_func_mcbsp2_gfclk_parents, NULL }, 1131c881b5aSTero Kristo { 26, TI_CLK_MUX, omap4_dmic_sync_mux_ck_parents, NULL }, 1141c881b5aSTero Kristo { 0 }, 1151c881b5aSTero Kristo }; 1161c881b5aSTero Kristo 1171c881b5aSTero Kristo static const char * const omap4_func_mcbsp3_gfclk_parents[] __initconst = { 118fe7020e6STero Kristo "abe_cm:clk:0038:26", 1191c881b5aSTero Kristo "pad_clks_ck", 1201c881b5aSTero Kristo "slimbus_clk", 1211c881b5aSTero Kristo NULL, 1221c881b5aSTero Kristo }; 1231c881b5aSTero Kristo 1241c881b5aSTero Kristo static const struct omap_clkctrl_bit_data omap4_mcbsp3_bit_data[] __initconst = { 1251c881b5aSTero Kristo { 24, TI_CLK_MUX, omap4_func_mcbsp3_gfclk_parents, NULL }, 1261c881b5aSTero Kristo { 26, TI_CLK_MUX, omap4_dmic_sync_mux_ck_parents, NULL }, 1271c881b5aSTero Kristo { 0 }, 1281c881b5aSTero Kristo }; 1291c881b5aSTero Kristo 1301c881b5aSTero Kristo static const char * const omap4_slimbus1_fclk_0_parents[] __initconst = { 1311c881b5aSTero Kristo "abe_24m_fclk", 1321c881b5aSTero Kristo NULL, 1331c881b5aSTero Kristo }; 1341c881b5aSTero Kristo 1351c881b5aSTero Kristo static const char * const omap4_slimbus1_fclk_1_parents[] __initconst = { 1361c881b5aSTero Kristo "func_24m_clk", 1371c881b5aSTero Kristo NULL, 1381c881b5aSTero Kristo }; 1391c881b5aSTero Kristo 1401c881b5aSTero Kristo static const char * const omap4_slimbus1_fclk_2_parents[] __initconst = { 1411c881b5aSTero Kristo "pad_clks_ck", 1421c881b5aSTero Kristo NULL, 1431c881b5aSTero Kristo }; 1441c881b5aSTero Kristo 1451c881b5aSTero Kristo static const char * const omap4_slimbus1_slimbus_clk_parents[] __initconst = { 1461c881b5aSTero Kristo "slimbus_clk", 1471c881b5aSTero Kristo NULL, 1481c881b5aSTero Kristo }; 1491c881b5aSTero Kristo 1501c881b5aSTero Kristo static const struct omap_clkctrl_bit_data omap4_slimbus1_bit_data[] __initconst = { 1511c881b5aSTero Kristo { 8, TI_CLK_GATE, omap4_slimbus1_fclk_0_parents, NULL }, 1521c881b5aSTero Kristo { 9, TI_CLK_GATE, omap4_slimbus1_fclk_1_parents, NULL }, 1531c881b5aSTero Kristo { 10, TI_CLK_GATE, omap4_slimbus1_fclk_2_parents, NULL }, 1541c881b5aSTero Kristo { 11, TI_CLK_GATE, omap4_slimbus1_slimbus_clk_parents, NULL }, 1551c881b5aSTero Kristo { 0 }, 1561c881b5aSTero Kristo }; 1571c881b5aSTero Kristo 1581c881b5aSTero Kristo static const char * const omap4_timer5_sync_mux_parents[] __initconst = { 1591c881b5aSTero Kristo "syc_clk_div_ck", 1601c881b5aSTero Kristo "sys_32k_ck", 1611c881b5aSTero Kristo NULL, 1621c881b5aSTero Kristo }; 1631c881b5aSTero Kristo 1641c881b5aSTero Kristo static const struct omap_clkctrl_bit_data omap4_timer5_bit_data[] __initconst = { 1651c881b5aSTero Kristo { 24, TI_CLK_MUX, omap4_timer5_sync_mux_parents, NULL }, 1661c881b5aSTero Kristo { 0 }, 1671c881b5aSTero Kristo }; 1681c881b5aSTero Kristo 1691c881b5aSTero Kristo static const struct omap_clkctrl_bit_data omap4_timer6_bit_data[] __initconst = { 1701c881b5aSTero Kristo { 24, TI_CLK_MUX, omap4_timer5_sync_mux_parents, NULL }, 1711c881b5aSTero Kristo { 0 }, 1721c881b5aSTero Kristo }; 1731c881b5aSTero Kristo 1741c881b5aSTero Kristo static const struct omap_clkctrl_bit_data omap4_timer7_bit_data[] __initconst = { 1751c881b5aSTero Kristo { 24, TI_CLK_MUX, omap4_timer5_sync_mux_parents, NULL }, 1761c881b5aSTero Kristo { 0 }, 1771c881b5aSTero Kristo }; 1781c881b5aSTero Kristo 1791c881b5aSTero Kristo static const struct omap_clkctrl_bit_data omap4_timer8_bit_data[] __initconst = { 1801c881b5aSTero Kristo { 24, TI_CLK_MUX, omap4_timer5_sync_mux_parents, NULL }, 1811c881b5aSTero Kristo { 0 }, 1821c881b5aSTero Kristo }; 1831c881b5aSTero Kristo 1841c881b5aSTero Kristo static const struct omap_clkctrl_reg_data omap4_abe_clkctrl_regs[] __initconst = { 1851c881b5aSTero Kristo { OMAP4_L4_ABE_CLKCTRL, NULL, 0, "ocp_abe_iclk" }, 186fe7020e6STero Kristo { OMAP4_AESS_CLKCTRL, omap4_aess_bit_data, CLKF_SW_SUP, "abe_cm:clk:0008:24" }, 1871c881b5aSTero Kristo { OMAP4_MCPDM_CLKCTRL, NULL, CLKF_SW_SUP, "pad_clks_ck" }, 188fe7020e6STero Kristo { OMAP4_DMIC_CLKCTRL, omap4_dmic_bit_data, CLKF_SW_SUP, "abe_cm:clk:0018:24" }, 189fe7020e6STero Kristo { OMAP4_MCASP_CLKCTRL, omap4_mcasp_bit_data, CLKF_SW_SUP, "abe_cm:clk:0020:24" }, 190fe7020e6STero Kristo { OMAP4_MCBSP1_CLKCTRL, omap4_mcbsp1_bit_data, CLKF_SW_SUP, "abe_cm:clk:0028:24" }, 191fe7020e6STero Kristo { OMAP4_MCBSP2_CLKCTRL, omap4_mcbsp2_bit_data, CLKF_SW_SUP, "abe_cm:clk:0030:24" }, 192fe7020e6STero Kristo { OMAP4_MCBSP3_CLKCTRL, omap4_mcbsp3_bit_data, CLKF_SW_SUP, "abe_cm:clk:0038:24" }, 193fe7020e6STero Kristo { OMAP4_SLIMBUS1_CLKCTRL, omap4_slimbus1_bit_data, CLKF_SW_SUP, "abe_cm:clk:0040:8" }, 194fe7020e6STero Kristo { OMAP4_TIMER5_CLKCTRL, omap4_timer5_bit_data, CLKF_SW_SUP, "abe_cm:clk:0048:24" }, 195fe7020e6STero Kristo { OMAP4_TIMER6_CLKCTRL, omap4_timer6_bit_data, CLKF_SW_SUP, "abe_cm:clk:0050:24" }, 196fe7020e6STero Kristo { OMAP4_TIMER7_CLKCTRL, omap4_timer7_bit_data, CLKF_SW_SUP, "abe_cm:clk:0058:24" }, 197fe7020e6STero Kristo { OMAP4_TIMER8_CLKCTRL, omap4_timer8_bit_data, CLKF_SW_SUP, "abe_cm:clk:0060:24" }, 1981c881b5aSTero Kristo { OMAP4_WD_TIMER3_CLKCTRL, NULL, CLKF_SW_SUP, "sys_32k_ck" }, 1991c881b5aSTero Kristo { 0 }, 2001c881b5aSTero Kristo }; 2011c881b5aSTero Kristo 2021c881b5aSTero Kristo static const struct omap_clkctrl_reg_data omap4_l4_ao_clkctrl_regs[] __initconst = { 2031c881b5aSTero Kristo { OMAP4_SMARTREFLEX_MPU_CLKCTRL, NULL, CLKF_SW_SUP, "l4_wkup_clk_mux_ck" }, 2041c881b5aSTero Kristo { OMAP4_SMARTREFLEX_IVA_CLKCTRL, NULL, CLKF_SW_SUP, "l4_wkup_clk_mux_ck" }, 2051c881b5aSTero Kristo { OMAP4_SMARTREFLEX_CORE_CLKCTRL, NULL, CLKF_SW_SUP, "l4_wkup_clk_mux_ck" }, 2061c881b5aSTero Kristo { 0 }, 2071c881b5aSTero Kristo }; 2081c881b5aSTero Kristo 2091c881b5aSTero Kristo static const struct omap_clkctrl_reg_data omap4_l3_1_clkctrl_regs[] __initconst = { 2101c881b5aSTero Kristo { OMAP4_L3_MAIN_1_CLKCTRL, NULL, 0, "l3_div_ck" }, 2111c881b5aSTero Kristo { 0 }, 2121c881b5aSTero Kristo }; 2131c881b5aSTero Kristo 2141c881b5aSTero Kristo static const struct omap_clkctrl_reg_data omap4_l3_2_clkctrl_regs[] __initconst = { 2151c881b5aSTero Kristo { OMAP4_L3_MAIN_2_CLKCTRL, NULL, 0, "l3_div_ck" }, 2161c881b5aSTero Kristo { OMAP4_GPMC_CLKCTRL, NULL, CLKF_HW_SUP, "l3_div_ck" }, 2171c881b5aSTero Kristo { OMAP4_OCMC_RAM_CLKCTRL, NULL, 0, "l3_div_ck" }, 2181c881b5aSTero Kristo { 0 }, 2191c881b5aSTero Kristo }; 2201c881b5aSTero Kristo 2211c881b5aSTero Kristo static const struct omap_clkctrl_reg_data omap4_ducati_clkctrl_regs[] __initconst = { 2221c881b5aSTero Kristo { OMAP4_IPU_CLKCTRL, NULL, CLKF_HW_SUP, "ducati_clk_mux_ck" }, 2231c881b5aSTero Kristo { 0 }, 2241c881b5aSTero Kristo }; 2251c881b5aSTero Kristo 2261c881b5aSTero Kristo static const struct omap_clkctrl_reg_data omap4_l3_dma_clkctrl_regs[] __initconst = { 2271c881b5aSTero Kristo { OMAP4_DMA_SYSTEM_CLKCTRL, NULL, 0, "l3_div_ck" }, 2281c881b5aSTero Kristo { 0 }, 2291c881b5aSTero Kristo }; 2301c881b5aSTero Kristo 2311c881b5aSTero Kristo static const struct omap_clkctrl_reg_data omap4_l3_emif_clkctrl_regs[] __initconst = { 2321c881b5aSTero Kristo { OMAP4_DMM_CLKCTRL, NULL, 0, "l3_div_ck" }, 2331c881b5aSTero Kristo { OMAP4_EMIF1_CLKCTRL, NULL, CLKF_HW_SUP, "ddrphy_ck" }, 2341c881b5aSTero Kristo { OMAP4_EMIF2_CLKCTRL, NULL, CLKF_HW_SUP, "ddrphy_ck" }, 2351c881b5aSTero Kristo { 0 }, 2361c881b5aSTero Kristo }; 2371c881b5aSTero Kristo 2381c881b5aSTero Kristo static const struct omap_clkctrl_reg_data omap4_d2d_clkctrl_regs[] __initconst = { 2391c881b5aSTero Kristo { OMAP4_C2C_CLKCTRL, NULL, 0, "div_core_ck" }, 2401c881b5aSTero Kristo { 0 }, 2411c881b5aSTero Kristo }; 2421c881b5aSTero Kristo 2431c881b5aSTero Kristo static const struct omap_clkctrl_reg_data omap4_l4_cfg_clkctrl_regs[] __initconst = { 2441c881b5aSTero Kristo { OMAP4_L4_CFG_CLKCTRL, NULL, 0, "l4_div_ck" }, 2451c881b5aSTero Kristo { OMAP4_SPINLOCK_CLKCTRL, NULL, 0, "l4_div_ck" }, 2461c881b5aSTero Kristo { OMAP4_MAILBOX_CLKCTRL, NULL, 0, "l4_div_ck" }, 2471c881b5aSTero Kristo { 0 }, 2481c881b5aSTero Kristo }; 2491c881b5aSTero Kristo 2501c881b5aSTero Kristo static const struct omap_clkctrl_reg_data omap4_l3_instr_clkctrl_regs[] __initconst = { 2511c881b5aSTero Kristo { OMAP4_L3_MAIN_3_CLKCTRL, NULL, CLKF_HW_SUP, "l3_div_ck" }, 2521c881b5aSTero Kristo { OMAP4_L3_INSTR_CLKCTRL, NULL, CLKF_HW_SUP, "l3_div_ck" }, 2531c881b5aSTero Kristo { OMAP4_OCP_WP_NOC_CLKCTRL, NULL, CLKF_HW_SUP, "l3_div_ck" }, 2541c881b5aSTero Kristo { 0 }, 2551c881b5aSTero Kristo }; 2561c881b5aSTero Kristo 2571c881b5aSTero Kristo static const struct omap_clkctrl_reg_data omap4_ivahd_clkctrl_regs[] __initconst = { 2581c881b5aSTero Kristo { OMAP4_IVA_CLKCTRL, NULL, CLKF_HW_SUP, "dpll_iva_m5x2_ck" }, 2591c881b5aSTero Kristo { OMAP4_SL2IF_CLKCTRL, NULL, CLKF_HW_SUP, "dpll_iva_m5x2_ck" }, 2601c881b5aSTero Kristo { 0 }, 2611c881b5aSTero Kristo }; 2621c881b5aSTero Kristo 2631c881b5aSTero Kristo static const char * const omap4_iss_ctrlclk_parents[] __initconst = { 2641c881b5aSTero Kristo "func_96m_fclk", 2651c881b5aSTero Kristo NULL, 2661c881b5aSTero Kristo }; 2671c881b5aSTero Kristo 2681c881b5aSTero Kristo static const struct omap_clkctrl_bit_data omap4_iss_bit_data[] __initconst = { 2691c881b5aSTero Kristo { 8, TI_CLK_GATE, omap4_iss_ctrlclk_parents, NULL }, 2701c881b5aSTero Kristo { 0 }, 2711c881b5aSTero Kristo }; 2721c881b5aSTero Kristo 2731c881b5aSTero Kristo static const char * const omap4_fdif_fck_parents[] __initconst = { 2741c881b5aSTero Kristo "dpll_per_m4x2_ck", 2751c881b5aSTero Kristo NULL, 2761c881b5aSTero Kristo }; 2771c881b5aSTero Kristo 2781c881b5aSTero Kristo static const struct omap_clkctrl_div_data omap4_fdif_fck_data __initconst = { 2791c881b5aSTero Kristo .max_div = 4, 280fe7020e6STero Kristo .flags = CLK_DIVIDER_POWER_OF_TWO, 2811c881b5aSTero Kristo }; 2821c881b5aSTero Kristo 2831c881b5aSTero Kristo static const struct omap_clkctrl_bit_data omap4_fdif_bit_data[] __initconst = { 2841c881b5aSTero Kristo { 24, TI_CLK_DIVIDER, omap4_fdif_fck_parents, &omap4_fdif_fck_data }, 2851c881b5aSTero Kristo { 0 }, 2861c881b5aSTero Kristo }; 2871c881b5aSTero Kristo 2881c881b5aSTero Kristo static const struct omap_clkctrl_reg_data omap4_iss_clkctrl_regs[] __initconst = { 2891c881b5aSTero Kristo { OMAP4_ISS_CLKCTRL, omap4_iss_bit_data, CLKF_SW_SUP, "ducati_clk_mux_ck" }, 290fe7020e6STero Kristo { OMAP4_FDIF_CLKCTRL, omap4_fdif_bit_data, CLKF_SW_SUP, "iss_cm:clk:0008:24" }, 2911c881b5aSTero Kristo { 0 }, 2921c881b5aSTero Kristo }; 2931c881b5aSTero Kristo 2941c881b5aSTero Kristo static const char * const omap4_dss_dss_clk_parents[] __initconst = { 2951c881b5aSTero Kristo "dpll_per_m5x2_ck", 2961c881b5aSTero Kristo NULL, 2971c881b5aSTero Kristo }; 2981c881b5aSTero Kristo 2991c881b5aSTero Kristo static const char * const omap4_dss_48mhz_clk_parents[] __initconst = { 3001c881b5aSTero Kristo "func_48mc_fclk", 3011c881b5aSTero Kristo NULL, 3021c881b5aSTero Kristo }; 3031c881b5aSTero Kristo 3041c881b5aSTero Kristo static const char * const omap4_dss_sys_clk_parents[] __initconst = { 3051c881b5aSTero Kristo "syc_clk_div_ck", 3061c881b5aSTero Kristo NULL, 3071c881b5aSTero Kristo }; 3081c881b5aSTero Kristo 3091c881b5aSTero Kristo static const char * const omap4_dss_tv_clk_parents[] __initconst = { 3101c881b5aSTero Kristo "extalt_clkin_ck", 3111c881b5aSTero Kristo NULL, 3121c881b5aSTero Kristo }; 3131c881b5aSTero Kristo 3141c881b5aSTero Kristo static const struct omap_clkctrl_bit_data omap4_dss_core_bit_data[] __initconst = { 3151c881b5aSTero Kristo { 8, TI_CLK_GATE, omap4_dss_dss_clk_parents, NULL }, 3161c881b5aSTero Kristo { 9, TI_CLK_GATE, omap4_dss_48mhz_clk_parents, NULL }, 3171c881b5aSTero Kristo { 10, TI_CLK_GATE, omap4_dss_sys_clk_parents, NULL }, 3181c881b5aSTero Kristo { 11, TI_CLK_GATE, omap4_dss_tv_clk_parents, NULL }, 3191c881b5aSTero Kristo { 0 }, 3201c881b5aSTero Kristo }; 3211c881b5aSTero Kristo 3221c881b5aSTero Kristo static const struct omap_clkctrl_reg_data omap4_l3_dss_clkctrl_regs[] __initconst = { 323fe7020e6STero Kristo { OMAP4_DSS_CORE_CLKCTRL, omap4_dss_core_bit_data, CLKF_SW_SUP, "l3_dss_cm:clk:0000:8" }, 3241c881b5aSTero Kristo { 0 }, 3251c881b5aSTero Kristo }; 3261c881b5aSTero Kristo 3271c881b5aSTero Kristo static const char * const omap4_sgx_clk_mux_parents[] __initconst = { 3281c881b5aSTero Kristo "dpll_core_m7x2_ck", 3291c881b5aSTero Kristo "dpll_per_m7x2_ck", 3301c881b5aSTero Kristo NULL, 3311c881b5aSTero Kristo }; 3321c881b5aSTero Kristo 3331c881b5aSTero Kristo static const struct omap_clkctrl_bit_data omap4_gpu_bit_data[] __initconst = { 3341c881b5aSTero Kristo { 24, TI_CLK_MUX, omap4_sgx_clk_mux_parents, NULL }, 3351c881b5aSTero Kristo { 0 }, 3361c881b5aSTero Kristo }; 3371c881b5aSTero Kristo 3381c881b5aSTero Kristo static const struct omap_clkctrl_reg_data omap4_l3_gfx_clkctrl_regs[] __initconst = { 339fe7020e6STero Kristo { OMAP4_GPU_CLKCTRL, omap4_gpu_bit_data, CLKF_SW_SUP, "l3_gfx_cm:clk:0000:24" }, 3401c881b5aSTero Kristo { 0 }, 3411c881b5aSTero Kristo }; 3421c881b5aSTero Kristo 3431c881b5aSTero Kristo static const char * const omap4_hsmmc1_fclk_parents[] __initconst = { 3441c881b5aSTero Kristo "func_64m_fclk", 3451c881b5aSTero Kristo "func_96m_fclk", 3461c881b5aSTero Kristo NULL, 3471c881b5aSTero Kristo }; 3481c881b5aSTero Kristo 3491c881b5aSTero Kristo static const struct omap_clkctrl_bit_data omap4_mmc1_bit_data[] __initconst = { 3501c881b5aSTero Kristo { 24, TI_CLK_MUX, omap4_hsmmc1_fclk_parents, NULL }, 3511c881b5aSTero Kristo { 0 }, 3521c881b5aSTero Kristo }; 3531c881b5aSTero Kristo 3541c881b5aSTero Kristo static const struct omap_clkctrl_bit_data omap4_mmc2_bit_data[] __initconst = { 3551c881b5aSTero Kristo { 24, TI_CLK_MUX, omap4_hsmmc1_fclk_parents, NULL }, 3561c881b5aSTero Kristo { 0 }, 3571c881b5aSTero Kristo }; 3581c881b5aSTero Kristo 3591c881b5aSTero Kristo static const char * const omap4_hsi_fck_parents[] __initconst = { 3601c881b5aSTero Kristo "dpll_per_m2x2_ck", 3611c881b5aSTero Kristo NULL, 3621c881b5aSTero Kristo }; 3631c881b5aSTero Kristo 3641c881b5aSTero Kristo static const struct omap_clkctrl_div_data omap4_hsi_fck_data __initconst = { 3651c881b5aSTero Kristo .max_div = 4, 366fe7020e6STero Kristo .flags = CLK_DIVIDER_POWER_OF_TWO, 3671c881b5aSTero Kristo }; 3681c881b5aSTero Kristo 3691c881b5aSTero Kristo static const struct omap_clkctrl_bit_data omap4_hsi_bit_data[] __initconst = { 3701c881b5aSTero Kristo { 24, TI_CLK_DIVIDER, omap4_hsi_fck_parents, &omap4_hsi_fck_data }, 3711c881b5aSTero Kristo { 0 }, 3721c881b5aSTero Kristo }; 3731c881b5aSTero Kristo 3741c881b5aSTero Kristo static const char * const omap4_usb_host_hs_utmi_p1_clk_parents[] __initconst = { 375fe7020e6STero Kristo "l3_init_cm:clk:0038:24", 3761c881b5aSTero Kristo NULL, 3771c881b5aSTero Kristo }; 3781c881b5aSTero Kristo 3791c881b5aSTero Kristo static const char * const omap4_usb_host_hs_utmi_p2_clk_parents[] __initconst = { 380fe7020e6STero Kristo "l3_init_cm:clk:0038:25", 3811c881b5aSTero Kristo NULL, 3821c881b5aSTero Kristo }; 3831c881b5aSTero Kristo 3841c881b5aSTero Kristo static const char * const omap4_usb_host_hs_utmi_p3_clk_parents[] __initconst = { 3851c881b5aSTero Kristo "init_60m_fclk", 3861c881b5aSTero Kristo NULL, 3871c881b5aSTero Kristo }; 3881c881b5aSTero Kristo 3891c881b5aSTero Kristo static const char * const omap4_usb_host_hs_hsic480m_p1_clk_parents[] __initconst = { 3901c881b5aSTero Kristo "dpll_usb_m2_ck", 3911c881b5aSTero Kristo NULL, 3921c881b5aSTero Kristo }; 3931c881b5aSTero Kristo 3941c881b5aSTero Kristo static const char * const omap4_utmi_p1_gfclk_parents[] __initconst = { 3951c881b5aSTero Kristo "init_60m_fclk", 3961c881b5aSTero Kristo "xclk60mhsp1_ck", 3971c881b5aSTero Kristo NULL, 3981c881b5aSTero Kristo }; 3991c881b5aSTero Kristo 4001c881b5aSTero Kristo static const char * const omap4_utmi_p2_gfclk_parents[] __initconst = { 4011c881b5aSTero Kristo "init_60m_fclk", 4021c881b5aSTero Kristo "xclk60mhsp2_ck", 4031c881b5aSTero Kristo NULL, 4041c881b5aSTero Kristo }; 4051c881b5aSTero Kristo 4061c881b5aSTero Kristo static const struct omap_clkctrl_bit_data omap4_usb_host_hs_bit_data[] __initconst = { 4071c881b5aSTero Kristo { 8, TI_CLK_GATE, omap4_usb_host_hs_utmi_p1_clk_parents, NULL }, 4081c881b5aSTero Kristo { 9, TI_CLK_GATE, omap4_usb_host_hs_utmi_p2_clk_parents, NULL }, 4091c881b5aSTero Kristo { 10, TI_CLK_GATE, omap4_usb_host_hs_utmi_p3_clk_parents, NULL }, 4101c881b5aSTero Kristo { 11, TI_CLK_GATE, omap4_usb_host_hs_utmi_p3_clk_parents, NULL }, 4111c881b5aSTero Kristo { 12, TI_CLK_GATE, omap4_usb_host_hs_utmi_p3_clk_parents, NULL }, 4121c881b5aSTero Kristo { 13, TI_CLK_GATE, omap4_usb_host_hs_hsic480m_p1_clk_parents, NULL }, 4131c881b5aSTero Kristo { 14, TI_CLK_GATE, omap4_usb_host_hs_hsic480m_p1_clk_parents, NULL }, 4141c881b5aSTero Kristo { 15, TI_CLK_GATE, omap4_dss_48mhz_clk_parents, NULL }, 4151c881b5aSTero Kristo { 24, TI_CLK_MUX, omap4_utmi_p1_gfclk_parents, NULL }, 4161c881b5aSTero Kristo { 25, TI_CLK_MUX, omap4_utmi_p2_gfclk_parents, NULL }, 4171c881b5aSTero Kristo { 0 }, 4181c881b5aSTero Kristo }; 4191c881b5aSTero Kristo 4201c881b5aSTero Kristo static const char * const omap4_usb_otg_hs_xclk_parents[] __initconst = { 421fe7020e6STero Kristo "l3_init_cm:clk:0040:24", 4221c881b5aSTero Kristo NULL, 4231c881b5aSTero Kristo }; 4241c881b5aSTero Kristo 4251c881b5aSTero Kristo static const char * const omap4_otg_60m_gfclk_parents[] __initconst = { 4261c881b5aSTero Kristo "utmi_phy_clkout_ck", 4271c881b5aSTero Kristo "xclk60motg_ck", 4281c881b5aSTero Kristo NULL, 4291c881b5aSTero Kristo }; 4301c881b5aSTero Kristo 4311c881b5aSTero Kristo static const struct omap_clkctrl_bit_data omap4_usb_otg_hs_bit_data[] __initconst = { 4321c881b5aSTero Kristo { 8, TI_CLK_GATE, omap4_usb_otg_hs_xclk_parents, NULL }, 4331c881b5aSTero Kristo { 24, TI_CLK_MUX, omap4_otg_60m_gfclk_parents, NULL }, 4341c881b5aSTero Kristo { 0 }, 4351c881b5aSTero Kristo }; 4361c881b5aSTero Kristo 4371c881b5aSTero Kristo static const struct omap_clkctrl_bit_data omap4_usb_tll_hs_bit_data[] __initconst = { 4381c881b5aSTero Kristo { 8, TI_CLK_GATE, omap4_usb_host_hs_utmi_p3_clk_parents, NULL }, 4391c881b5aSTero Kristo { 9, TI_CLK_GATE, omap4_usb_host_hs_utmi_p3_clk_parents, NULL }, 4401c881b5aSTero Kristo { 10, TI_CLK_GATE, omap4_usb_host_hs_utmi_p3_clk_parents, NULL }, 4411c881b5aSTero Kristo { 0 }, 4421c881b5aSTero Kristo }; 4431c881b5aSTero Kristo 4441c881b5aSTero Kristo static const char * const omap4_ocp2scp_usb_phy_phy_48m_parents[] __initconst = { 4451c881b5aSTero Kristo "func_48m_fclk", 4461c881b5aSTero Kristo NULL, 4471c881b5aSTero Kristo }; 4481c881b5aSTero Kristo 4491c881b5aSTero Kristo static const struct omap_clkctrl_bit_data omap4_ocp2scp_usb_phy_bit_data[] __initconst = { 4501c881b5aSTero Kristo { 8, TI_CLK_GATE, omap4_ocp2scp_usb_phy_phy_48m_parents, NULL }, 4511c881b5aSTero Kristo { 0 }, 4521c881b5aSTero Kristo }; 4531c881b5aSTero Kristo 4541c881b5aSTero Kristo static const struct omap_clkctrl_reg_data omap4_l3_init_clkctrl_regs[] __initconst = { 455fe7020e6STero Kristo { OMAP4_MMC1_CLKCTRL, omap4_mmc1_bit_data, CLKF_SW_SUP, "l3_init_cm:clk:0008:24" }, 456fe7020e6STero Kristo { OMAP4_MMC2_CLKCTRL, omap4_mmc2_bit_data, CLKF_SW_SUP, "l3_init_cm:clk:0010:24" }, 457fe7020e6STero Kristo { OMAP4_HSI_CLKCTRL, omap4_hsi_bit_data, CLKF_HW_SUP, "l3_init_cm:clk:0018:24" }, 4581c881b5aSTero Kristo { OMAP4_USB_HOST_HS_CLKCTRL, omap4_usb_host_hs_bit_data, CLKF_SW_SUP, "init_60m_fclk" }, 4591c881b5aSTero Kristo { OMAP4_USB_OTG_HS_CLKCTRL, omap4_usb_otg_hs_bit_data, CLKF_HW_SUP, "l3_div_ck" }, 4601c881b5aSTero Kristo { OMAP4_USB_TLL_HS_CLKCTRL, omap4_usb_tll_hs_bit_data, CLKF_HW_SUP, "l4_div_ck" }, 4611c881b5aSTero Kristo { OMAP4_USB_HOST_FS_CLKCTRL, NULL, CLKF_SW_SUP, "func_48mc_fclk" }, 462fe7020e6STero Kristo { OMAP4_OCP2SCP_USB_PHY_CLKCTRL, omap4_ocp2scp_usb_phy_bit_data, CLKF_HW_SUP, "l3_init_cm:clk:00c0:8" }, 4631c881b5aSTero Kristo { 0 }, 4641c881b5aSTero Kristo }; 4651c881b5aSTero Kristo 4661c881b5aSTero Kristo static const char * const omap4_cm2_dm10_mux_parents[] __initconst = { 4671c881b5aSTero Kristo "sys_clkin_ck", 4681c881b5aSTero Kristo "sys_32k_ck", 4691c881b5aSTero Kristo NULL, 4701c881b5aSTero Kristo }; 4711c881b5aSTero Kristo 4721c881b5aSTero Kristo static const struct omap_clkctrl_bit_data omap4_timer10_bit_data[] __initconst = { 4731c881b5aSTero Kristo { 24, TI_CLK_MUX, omap4_cm2_dm10_mux_parents, NULL }, 4741c881b5aSTero Kristo { 0 }, 4751c881b5aSTero Kristo }; 4761c881b5aSTero Kristo 4771c881b5aSTero Kristo static const struct omap_clkctrl_bit_data omap4_timer11_bit_data[] __initconst = { 4781c881b5aSTero Kristo { 24, TI_CLK_MUX, omap4_cm2_dm10_mux_parents, NULL }, 4791c881b5aSTero Kristo { 0 }, 4801c881b5aSTero Kristo }; 4811c881b5aSTero Kristo 4821c881b5aSTero Kristo static const struct omap_clkctrl_bit_data omap4_timer2_bit_data[] __initconst = { 4831c881b5aSTero Kristo { 24, TI_CLK_MUX, omap4_cm2_dm10_mux_parents, NULL }, 4841c881b5aSTero Kristo { 0 }, 4851c881b5aSTero Kristo }; 4861c881b5aSTero Kristo 4871c881b5aSTero Kristo static const struct omap_clkctrl_bit_data omap4_timer3_bit_data[] __initconst = { 4881c881b5aSTero Kristo { 24, TI_CLK_MUX, omap4_cm2_dm10_mux_parents, NULL }, 4891c881b5aSTero Kristo { 0 }, 4901c881b5aSTero Kristo }; 4911c881b5aSTero Kristo 4921c881b5aSTero Kristo static const struct omap_clkctrl_bit_data omap4_timer4_bit_data[] __initconst = { 4931c881b5aSTero Kristo { 24, TI_CLK_MUX, omap4_cm2_dm10_mux_parents, NULL }, 4941c881b5aSTero Kristo { 0 }, 4951c881b5aSTero Kristo }; 4961c881b5aSTero Kristo 4971c881b5aSTero Kristo static const struct omap_clkctrl_bit_data omap4_timer9_bit_data[] __initconst = { 4981c881b5aSTero Kristo { 24, TI_CLK_MUX, omap4_cm2_dm10_mux_parents, NULL }, 4991c881b5aSTero Kristo { 0 }, 5001c881b5aSTero Kristo }; 5011c881b5aSTero Kristo 5021c881b5aSTero Kristo static const char * const omap4_gpio2_dbclk_parents[] __initconst = { 5031c881b5aSTero Kristo "sys_32k_ck", 5041c881b5aSTero Kristo NULL, 5051c881b5aSTero Kristo }; 5061c881b5aSTero Kristo 5071c881b5aSTero Kristo static const struct omap_clkctrl_bit_data omap4_gpio2_bit_data[] __initconst = { 5081c881b5aSTero Kristo { 8, TI_CLK_GATE, omap4_gpio2_dbclk_parents, NULL }, 5091c881b5aSTero Kristo { 0 }, 5101c881b5aSTero Kristo }; 5111c881b5aSTero Kristo 5121c881b5aSTero Kristo static const struct omap_clkctrl_bit_data omap4_gpio3_bit_data[] __initconst = { 5131c881b5aSTero Kristo { 8, TI_CLK_GATE, omap4_gpio2_dbclk_parents, NULL }, 5141c881b5aSTero Kristo { 0 }, 5151c881b5aSTero Kristo }; 5161c881b5aSTero Kristo 5171c881b5aSTero Kristo static const struct omap_clkctrl_bit_data omap4_gpio4_bit_data[] __initconst = { 5181c881b5aSTero Kristo { 8, TI_CLK_GATE, omap4_gpio2_dbclk_parents, NULL }, 5191c881b5aSTero Kristo { 0 }, 5201c881b5aSTero Kristo }; 5211c881b5aSTero Kristo 5221c881b5aSTero Kristo static const struct omap_clkctrl_bit_data omap4_gpio5_bit_data[] __initconst = { 5231c881b5aSTero Kristo { 8, TI_CLK_GATE, omap4_gpio2_dbclk_parents, NULL }, 5241c881b5aSTero Kristo { 0 }, 5251c881b5aSTero Kristo }; 5261c881b5aSTero Kristo 5271c881b5aSTero Kristo static const struct omap_clkctrl_bit_data omap4_gpio6_bit_data[] __initconst = { 5281c881b5aSTero Kristo { 8, TI_CLK_GATE, omap4_gpio2_dbclk_parents, NULL }, 5291c881b5aSTero Kristo { 0 }, 5301c881b5aSTero Kristo }; 5311c881b5aSTero Kristo 5321c881b5aSTero Kristo static const char * const omap4_per_mcbsp4_gfclk_parents[] __initconst = { 533fe7020e6STero Kristo "l4_per_cm:clk:00c0:26", 5341c881b5aSTero Kristo "pad_clks_ck", 5351c881b5aSTero Kristo NULL, 5361c881b5aSTero Kristo }; 5371c881b5aSTero Kristo 5381c881b5aSTero Kristo static const char * const omap4_mcbsp4_sync_mux_ck_parents[] __initconst = { 5391c881b5aSTero Kristo "func_96m_fclk", 5401c881b5aSTero Kristo "per_abe_nc_fclk", 5411c881b5aSTero Kristo NULL, 5421c881b5aSTero Kristo }; 5431c881b5aSTero Kristo 5441c881b5aSTero Kristo static const struct omap_clkctrl_bit_data omap4_mcbsp4_bit_data[] __initconst = { 5451c881b5aSTero Kristo { 24, TI_CLK_MUX, omap4_per_mcbsp4_gfclk_parents, NULL }, 546fe7020e6STero Kristo { 26, TI_CLK_MUX, omap4_mcbsp4_sync_mux_ck_parents, NULL }, 5471c881b5aSTero Kristo { 0 }, 5481c881b5aSTero Kristo }; 5491c881b5aSTero Kristo 5501c881b5aSTero Kristo static const char * const omap4_slimbus2_fclk_0_parents[] __initconst = { 5511c881b5aSTero Kristo "func_24mc_fclk", 5521c881b5aSTero Kristo NULL, 5531c881b5aSTero Kristo }; 5541c881b5aSTero Kristo 5551c881b5aSTero Kristo static const char * const omap4_slimbus2_fclk_1_parents[] __initconst = { 5561c881b5aSTero Kristo "per_abe_24m_fclk", 5571c881b5aSTero Kristo NULL, 5581c881b5aSTero Kristo }; 5591c881b5aSTero Kristo 5601c881b5aSTero Kristo static const char * const omap4_slimbus2_slimbus_clk_parents[] __initconst = { 5611c881b5aSTero Kristo "pad_slimbus_core_clks_ck", 5621c881b5aSTero Kristo NULL, 5631c881b5aSTero Kristo }; 5641c881b5aSTero Kristo 5651c881b5aSTero Kristo static const struct omap_clkctrl_bit_data omap4_slimbus2_bit_data[] __initconst = { 5661c881b5aSTero Kristo { 8, TI_CLK_GATE, omap4_slimbus2_fclk_0_parents, NULL }, 5671c881b5aSTero Kristo { 9, TI_CLK_GATE, omap4_slimbus2_fclk_1_parents, NULL }, 5681c881b5aSTero Kristo { 10, TI_CLK_GATE, omap4_slimbus2_slimbus_clk_parents, NULL }, 5691c881b5aSTero Kristo { 0 }, 5701c881b5aSTero Kristo }; 5711c881b5aSTero Kristo 5721c881b5aSTero Kristo static const struct omap_clkctrl_reg_data omap4_l4_per_clkctrl_regs[] __initconst = { 573fe7020e6STero Kristo { OMAP4_TIMER10_CLKCTRL, omap4_timer10_bit_data, CLKF_SW_SUP, "l4_per_cm:clk:0008:24" }, 574fe7020e6STero Kristo { OMAP4_TIMER11_CLKCTRL, omap4_timer11_bit_data, CLKF_SW_SUP, "l4_per_cm:clk:0010:24" }, 575fe7020e6STero Kristo { OMAP4_TIMER2_CLKCTRL, omap4_timer2_bit_data, CLKF_SW_SUP, "l4_per_cm:clk:0018:24" }, 576fe7020e6STero Kristo { OMAP4_TIMER3_CLKCTRL, omap4_timer3_bit_data, CLKF_SW_SUP, "l4_per_cm:clk:0020:24" }, 577fe7020e6STero Kristo { OMAP4_TIMER4_CLKCTRL, omap4_timer4_bit_data, CLKF_SW_SUP, "l4_per_cm:clk:0028:24" }, 578fe7020e6STero Kristo { OMAP4_TIMER9_CLKCTRL, omap4_timer9_bit_data, CLKF_SW_SUP, "l4_per_cm:clk:0030:24" }, 5791c881b5aSTero Kristo { OMAP4_ELM_CLKCTRL, NULL, 0, "l4_div_ck" }, 5801c881b5aSTero Kristo { OMAP4_GPIO2_CLKCTRL, omap4_gpio2_bit_data, CLKF_HW_SUP, "l4_div_ck" }, 5811c881b5aSTero Kristo { OMAP4_GPIO3_CLKCTRL, omap4_gpio3_bit_data, CLKF_HW_SUP, "l4_div_ck" }, 5821c881b5aSTero Kristo { OMAP4_GPIO4_CLKCTRL, omap4_gpio4_bit_data, CLKF_HW_SUP, "l4_div_ck" }, 5831c881b5aSTero Kristo { OMAP4_GPIO5_CLKCTRL, omap4_gpio5_bit_data, CLKF_HW_SUP, "l4_div_ck" }, 5841c881b5aSTero Kristo { OMAP4_GPIO6_CLKCTRL, omap4_gpio6_bit_data, CLKF_HW_SUP, "l4_div_ck" }, 5851c881b5aSTero Kristo { OMAP4_HDQ1W_CLKCTRL, NULL, CLKF_SW_SUP, "func_12m_fclk" }, 5861c881b5aSTero Kristo { OMAP4_I2C1_CLKCTRL, NULL, CLKF_SW_SUP, "func_96m_fclk" }, 5871c881b5aSTero Kristo { OMAP4_I2C2_CLKCTRL, NULL, CLKF_SW_SUP, "func_96m_fclk" }, 5881c881b5aSTero Kristo { OMAP4_I2C3_CLKCTRL, NULL, CLKF_SW_SUP, "func_96m_fclk" }, 5891c881b5aSTero Kristo { OMAP4_I2C4_CLKCTRL, NULL, CLKF_SW_SUP, "func_96m_fclk" }, 5901c881b5aSTero Kristo { OMAP4_L4_PER_CLKCTRL, NULL, 0, "l4_div_ck" }, 591fe7020e6STero Kristo { OMAP4_MCBSP4_CLKCTRL, omap4_mcbsp4_bit_data, CLKF_SW_SUP, "l4_per_cm:clk:00c0:24" }, 5921c881b5aSTero Kristo { OMAP4_MCSPI1_CLKCTRL, NULL, CLKF_SW_SUP, "func_48m_fclk" }, 5931c881b5aSTero Kristo { OMAP4_MCSPI2_CLKCTRL, NULL, CLKF_SW_SUP, "func_48m_fclk" }, 5941c881b5aSTero Kristo { OMAP4_MCSPI3_CLKCTRL, NULL, CLKF_SW_SUP, "func_48m_fclk" }, 5951c881b5aSTero Kristo { OMAP4_MCSPI4_CLKCTRL, NULL, CLKF_SW_SUP, "func_48m_fclk" }, 5961c881b5aSTero Kristo { OMAP4_MMC3_CLKCTRL, NULL, CLKF_SW_SUP, "func_48m_fclk" }, 5971c881b5aSTero Kristo { OMAP4_MMC4_CLKCTRL, NULL, CLKF_SW_SUP, "func_48m_fclk" }, 598fe7020e6STero Kristo { OMAP4_SLIMBUS2_CLKCTRL, omap4_slimbus2_bit_data, CLKF_SW_SUP, "l4_per_cm:clk:0118:8" }, 5991c881b5aSTero Kristo { OMAP4_UART1_CLKCTRL, NULL, CLKF_SW_SUP, "func_48m_fclk" }, 6001c881b5aSTero Kristo { OMAP4_UART2_CLKCTRL, NULL, CLKF_SW_SUP, "func_48m_fclk" }, 6011c881b5aSTero Kristo { OMAP4_UART3_CLKCTRL, NULL, CLKF_SW_SUP, "func_48m_fclk" }, 6021c881b5aSTero Kristo { OMAP4_UART4_CLKCTRL, NULL, CLKF_SW_SUP, "func_48m_fclk" }, 6031c881b5aSTero Kristo { OMAP4_MMC5_CLKCTRL, NULL, CLKF_SW_SUP, "func_48m_fclk" }, 6041c881b5aSTero Kristo { 0 }, 6051c881b5aSTero Kristo }; 6061c881b5aSTero Kristo 6071c881b5aSTero Kristo static const struct omap_clkctrl_bit_data omap4_gpio1_bit_data[] __initconst = { 6081c881b5aSTero Kristo { 8, TI_CLK_GATE, omap4_gpio2_dbclk_parents, NULL }, 6091c881b5aSTero Kristo { 0 }, 6101c881b5aSTero Kristo }; 6111c881b5aSTero Kristo 6121c881b5aSTero Kristo static const struct omap_clkctrl_bit_data omap4_timer1_bit_data[] __initconst = { 6131c881b5aSTero Kristo { 24, TI_CLK_MUX, omap4_cm2_dm10_mux_parents, NULL }, 6141c881b5aSTero Kristo { 0 }, 6151c881b5aSTero Kristo }; 6161c881b5aSTero Kristo 6171c881b5aSTero Kristo static const struct omap_clkctrl_reg_data omap4_l4_wkup_clkctrl_regs[] __initconst = { 6181c881b5aSTero Kristo { OMAP4_L4_WKUP_CLKCTRL, NULL, 0, "l4_wkup_clk_mux_ck" }, 6191c881b5aSTero Kristo { OMAP4_WD_TIMER2_CLKCTRL, NULL, CLKF_SW_SUP, "sys_32k_ck" }, 6201c881b5aSTero Kristo { OMAP4_GPIO1_CLKCTRL, omap4_gpio1_bit_data, CLKF_HW_SUP, "l4_wkup_clk_mux_ck" }, 621fe7020e6STero Kristo { OMAP4_TIMER1_CLKCTRL, omap4_timer1_bit_data, CLKF_SW_SUP, "l4_wkup_cm:clk:0020:24" }, 6221c881b5aSTero Kristo { OMAP4_COUNTER_32K_CLKCTRL, NULL, 0, "sys_32k_ck" }, 6231c881b5aSTero Kristo { OMAP4_KBD_CLKCTRL, NULL, CLKF_SW_SUP, "sys_32k_ck" }, 6241c881b5aSTero Kristo { 0 }, 6251c881b5aSTero Kristo }; 6261c881b5aSTero Kristo 6271c881b5aSTero Kristo static const char * const omap4_pmd_stm_clock_mux_ck_parents[] __initconst = { 6281c881b5aSTero Kristo "sys_clkin_ck", 6291c881b5aSTero Kristo "dpll_core_m6x2_ck", 6301c881b5aSTero Kristo "tie_low_clock_ck", 6311c881b5aSTero Kristo NULL, 6321c881b5aSTero Kristo }; 6331c881b5aSTero Kristo 6341c881b5aSTero Kristo static const char * const omap4_trace_clk_div_div_ck_parents[] __initconst = { 635fe7020e6STero Kristo "emu_sys_cm:clk:0000:22", 6361c881b5aSTero Kristo NULL, 6371c881b5aSTero Kristo }; 6381c881b5aSTero Kristo 6391c881b5aSTero Kristo static const int omap4_trace_clk_div_div_ck_divs[] __initconst = { 6401c881b5aSTero Kristo 0, 6411c881b5aSTero Kristo 1, 6421c881b5aSTero Kristo 2, 6431c881b5aSTero Kristo 0, 6441c881b5aSTero Kristo 4, 6451c881b5aSTero Kristo -1, 6461c881b5aSTero Kristo }; 6471c881b5aSTero Kristo 6481c881b5aSTero Kristo static const struct omap_clkctrl_div_data omap4_trace_clk_div_div_ck_data __initconst = { 6491c881b5aSTero Kristo .dividers = omap4_trace_clk_div_div_ck_divs, 6501c881b5aSTero Kristo }; 6511c881b5aSTero Kristo 6521c881b5aSTero Kristo static const char * const omap4_stm_clk_div_ck_parents[] __initconst = { 653fe7020e6STero Kristo "emu_sys_cm:clk:0000:20", 6541c881b5aSTero Kristo NULL, 6551c881b5aSTero Kristo }; 6561c881b5aSTero Kristo 6571c881b5aSTero Kristo static const struct omap_clkctrl_div_data omap4_stm_clk_div_ck_data __initconst = { 6581c881b5aSTero Kristo .max_div = 64, 659fe7020e6STero Kristo .flags = CLK_DIVIDER_POWER_OF_TWO, 6601c881b5aSTero Kristo }; 6611c881b5aSTero Kristo 6621c881b5aSTero Kristo static const struct omap_clkctrl_bit_data omap4_debugss_bit_data[] __initconst = { 6631c881b5aSTero Kristo { 20, TI_CLK_MUX, omap4_pmd_stm_clock_mux_ck_parents, NULL }, 6641c881b5aSTero Kristo { 22, TI_CLK_MUX, omap4_pmd_stm_clock_mux_ck_parents, NULL }, 6651c881b5aSTero Kristo { 24, TI_CLK_DIVIDER, omap4_trace_clk_div_div_ck_parents, &omap4_trace_clk_div_div_ck_data }, 6661c881b5aSTero Kristo { 27, TI_CLK_DIVIDER, omap4_stm_clk_div_ck_parents, &omap4_stm_clk_div_ck_data }, 6671c881b5aSTero Kristo { 0 }, 6681c881b5aSTero Kristo }; 6691c881b5aSTero Kristo 6701c881b5aSTero Kristo static const struct omap_clkctrl_reg_data omap4_emu_sys_clkctrl_regs[] __initconst = { 6711c881b5aSTero Kristo { OMAP4_DEBUGSS_CLKCTRL, omap4_debugss_bit_data, 0, "trace_clk_div_ck" }, 6721c881b5aSTero Kristo { 0 }, 6731c881b5aSTero Kristo }; 6741c881b5aSTero Kristo 6751c881b5aSTero Kristo const struct omap_clkctrl_data omap4_clkctrl_data[] __initconst = { 6761c881b5aSTero Kristo { 0x4a004320, omap4_mpuss_clkctrl_regs }, 6771c881b5aSTero Kristo { 0x4a004420, omap4_tesla_clkctrl_regs }, 6781c881b5aSTero Kristo { 0x4a004520, omap4_abe_clkctrl_regs }, 6791c881b5aSTero Kristo { 0x4a008620, omap4_l4_ao_clkctrl_regs }, 6801c881b5aSTero Kristo { 0x4a008720, omap4_l3_1_clkctrl_regs }, 6811c881b5aSTero Kristo { 0x4a008820, omap4_l3_2_clkctrl_regs }, 6821c881b5aSTero Kristo { 0x4a008920, omap4_ducati_clkctrl_regs }, 6831c881b5aSTero Kristo { 0x4a008a20, omap4_l3_dma_clkctrl_regs }, 6841c881b5aSTero Kristo { 0x4a008b20, omap4_l3_emif_clkctrl_regs }, 6851c881b5aSTero Kristo { 0x4a008c20, omap4_d2d_clkctrl_regs }, 6861c881b5aSTero Kristo { 0x4a008d20, omap4_l4_cfg_clkctrl_regs }, 6871c881b5aSTero Kristo { 0x4a008e20, omap4_l3_instr_clkctrl_regs }, 6881c881b5aSTero Kristo { 0x4a008f20, omap4_ivahd_clkctrl_regs }, 6891c881b5aSTero Kristo { 0x4a009020, omap4_iss_clkctrl_regs }, 6901c881b5aSTero Kristo { 0x4a009120, omap4_l3_dss_clkctrl_regs }, 6911c881b5aSTero Kristo { 0x4a009220, omap4_l3_gfx_clkctrl_regs }, 6921c881b5aSTero Kristo { 0x4a009320, omap4_l3_init_clkctrl_regs }, 6931c881b5aSTero Kristo { 0x4a009420, omap4_l4_per_clkctrl_regs }, 6941c881b5aSTero Kristo { 0x4a307820, omap4_l4_wkup_clkctrl_regs }, 6951c881b5aSTero Kristo { 0x4a307a20, omap4_emu_sys_clkctrl_regs }, 6961c881b5aSTero Kristo { 0 }, 6971c881b5aSTero Kristo }; 6981c881b5aSTero Kristo 69921876ea5STero Kristo static struct ti_dt_clk omap44xx_clks[] = { 70021876ea5STero Kristo DT_CLK(NULL, "timer_32k_ck", "sys_32k_ck"), 701fe7020e6STero Kristo /* 702fe7020e6STero Kristo * XXX: All the clock aliases below are only needed for legacy 703fe7020e6STero Kristo * hwmod support. Once hwmod is removed, these can be removed 704fe7020e6STero Kristo * also. 705fe7020e6STero Kristo */ 706fe7020e6STero Kristo DT_CLK(NULL, "aess_fclk", "abe_cm:0008:24"), 707fe7020e6STero Kristo DT_CLK(NULL, "cm2_dm10_mux", "l4_per_cm:0008:24"), 708fe7020e6STero Kristo DT_CLK(NULL, "cm2_dm11_mux", "l4_per_cm:0010:24"), 709fe7020e6STero Kristo DT_CLK(NULL, "cm2_dm2_mux", "l4_per_cm:0018:24"), 710fe7020e6STero Kristo DT_CLK(NULL, "cm2_dm3_mux", "l4_per_cm:0020:24"), 711fe7020e6STero Kristo DT_CLK(NULL, "cm2_dm4_mux", "l4_per_cm:0028:24"), 712fe7020e6STero Kristo DT_CLK(NULL, "cm2_dm9_mux", "l4_per_cm:0030:24"), 713fe7020e6STero Kristo DT_CLK(NULL, "dmic_sync_mux_ck", "abe_cm:0018:26"), 714fe7020e6STero Kristo DT_CLK(NULL, "dmt1_clk_mux", "l4_wkup_cm:0020:24"), 715fe7020e6STero Kristo DT_CLK(NULL, "dss_48mhz_clk", "l3_dss_cm:0000:9"), 716fe7020e6STero Kristo DT_CLK(NULL, "dss_dss_clk", "l3_dss_cm:0000:8"), 717fe7020e6STero Kristo DT_CLK(NULL, "dss_sys_clk", "l3_dss_cm:0000:10"), 718fe7020e6STero Kristo DT_CLK(NULL, "dss_tv_clk", "l3_dss_cm:0000:11"), 719fe7020e6STero Kristo DT_CLK(NULL, "fdif_fck", "iss_cm:0008:24"), 720fe7020e6STero Kristo DT_CLK(NULL, "func_dmic_abe_gfclk", "abe_cm:0018:24"), 721fe7020e6STero Kristo DT_CLK(NULL, "func_mcasp_abe_gfclk", "abe_cm:0020:24"), 722fe7020e6STero Kristo DT_CLK(NULL, "func_mcbsp1_gfclk", "abe_cm:0028:24"), 723fe7020e6STero Kristo DT_CLK(NULL, "func_mcbsp2_gfclk", "abe_cm:0030:24"), 724fe7020e6STero Kristo DT_CLK(NULL, "func_mcbsp3_gfclk", "abe_cm:0038:24"), 725fe7020e6STero Kristo DT_CLK(NULL, "gpio1_dbclk", "l4_wkup_cm:0018:8"), 726fe7020e6STero Kristo DT_CLK(NULL, "gpio2_dbclk", "l4_per_cm:0040:8"), 727fe7020e6STero Kristo DT_CLK(NULL, "gpio3_dbclk", "l4_per_cm:0048:8"), 728fe7020e6STero Kristo DT_CLK(NULL, "gpio4_dbclk", "l4_per_cm:0050:8"), 729fe7020e6STero Kristo DT_CLK(NULL, "gpio5_dbclk", "l4_per_cm:0058:8"), 730fe7020e6STero Kristo DT_CLK(NULL, "gpio6_dbclk", "l4_per_cm:0060:8"), 731fe7020e6STero Kristo DT_CLK(NULL, "hsi_fck", "l3_init_cm:0018:24"), 732fe7020e6STero Kristo DT_CLK(NULL, "hsmmc1_fclk", "l3_init_cm:0008:24"), 733fe7020e6STero Kristo DT_CLK(NULL, "hsmmc2_fclk", "l3_init_cm:0010:24"), 734fe7020e6STero Kristo DT_CLK(NULL, "iss_ctrlclk", "iss_cm:0000:8"), 735fe7020e6STero Kristo DT_CLK(NULL, "mcasp_sync_mux_ck", "abe_cm:0020:26"), 736fe7020e6STero Kristo DT_CLK(NULL, "mcbsp1_sync_mux_ck", "abe_cm:0028:26"), 737fe7020e6STero Kristo DT_CLK(NULL, "mcbsp2_sync_mux_ck", "abe_cm:0030:26"), 738fe7020e6STero Kristo DT_CLK(NULL, "mcbsp3_sync_mux_ck", "abe_cm:0038:26"), 739fe7020e6STero Kristo DT_CLK(NULL, "mcbsp4_sync_mux_ck", "l4_per_cm:00c0:26"), 740fe7020e6STero Kristo DT_CLK(NULL, "ocp2scp_usb_phy_phy_48m", "l3_init_cm:00c0:8"), 741fe7020e6STero Kristo DT_CLK(NULL, "otg_60m_gfclk", "l3_init_cm:0040:24"), 742fe7020e6STero Kristo DT_CLK(NULL, "per_mcbsp4_gfclk", "l4_per_cm:00c0:24"), 743fe7020e6STero Kristo DT_CLK(NULL, "pmd_stm_clock_mux_ck", "emu_sys_cm:0000:20"), 744fe7020e6STero Kristo DT_CLK(NULL, "pmd_trace_clk_mux_ck", "emu_sys_cm:0000:22"), 745fe7020e6STero Kristo DT_CLK(NULL, "sgx_clk_mux", "l3_gfx_cm:0000:24"), 746fe7020e6STero Kristo DT_CLK(NULL, "slimbus1_fclk_0", "abe_cm:0040:8"), 747fe7020e6STero Kristo DT_CLK(NULL, "slimbus1_fclk_1", "abe_cm:0040:9"), 748fe7020e6STero Kristo DT_CLK(NULL, "slimbus1_fclk_2", "abe_cm:0040:10"), 749fe7020e6STero Kristo DT_CLK(NULL, "slimbus1_slimbus_clk", "abe_cm:0040:11"), 750fe7020e6STero Kristo DT_CLK(NULL, "slimbus2_fclk_0", "l4_per_cm:0118:8"), 751fe7020e6STero Kristo DT_CLK(NULL, "slimbus2_fclk_1", "l4_per_cm:0118:9"), 752fe7020e6STero Kristo DT_CLK(NULL, "slimbus2_slimbus_clk", "l4_per_cm:0118:10"), 753fe7020e6STero Kristo DT_CLK(NULL, "stm_clk_div_ck", "emu_sys_cm:0000:27"), 754fe7020e6STero Kristo DT_CLK(NULL, "timer5_sync_mux", "abe_cm:0048:24"), 755fe7020e6STero Kristo DT_CLK(NULL, "timer6_sync_mux", "abe_cm:0050:24"), 756fe7020e6STero Kristo DT_CLK(NULL, "timer7_sync_mux", "abe_cm:0058:24"), 757fe7020e6STero Kristo DT_CLK(NULL, "timer8_sync_mux", "abe_cm:0060:24"), 758fe7020e6STero Kristo DT_CLK(NULL, "trace_clk_div_div_ck", "emu_sys_cm:0000:24"), 759fe7020e6STero Kristo DT_CLK(NULL, "usb_host_hs_func48mclk", "l3_init_cm:0038:15"), 760fe7020e6STero Kristo DT_CLK(NULL, "usb_host_hs_hsic480m_p1_clk", "l3_init_cm:0038:13"), 761fe7020e6STero Kristo DT_CLK(NULL, "usb_host_hs_hsic480m_p2_clk", "l3_init_cm:0038:14"), 762fe7020e6STero Kristo DT_CLK(NULL, "usb_host_hs_hsic60m_p1_clk", "l3_init_cm:0038:11"), 763fe7020e6STero Kristo DT_CLK(NULL, "usb_host_hs_hsic60m_p2_clk", "l3_init_cm:0038:12"), 764fe7020e6STero Kristo DT_CLK(NULL, "usb_host_hs_utmi_p1_clk", "l3_init_cm:0038:8"), 765fe7020e6STero Kristo DT_CLK(NULL, "usb_host_hs_utmi_p2_clk", "l3_init_cm:0038:9"), 766fe7020e6STero Kristo DT_CLK(NULL, "usb_host_hs_utmi_p3_clk", "l3_init_cm:0038:10"), 767fe7020e6STero Kristo DT_CLK(NULL, "usb_otg_hs_xclk", "l3_init_cm:0040:8"), 768fe7020e6STero Kristo DT_CLK(NULL, "usb_tll_hs_usb_ch0_clk", "l3_init_cm:0048:8"), 769fe7020e6STero Kristo DT_CLK(NULL, "usb_tll_hs_usb_ch1_clk", "l3_init_cm:0048:9"), 770fe7020e6STero Kristo DT_CLK(NULL, "usb_tll_hs_usb_ch2_clk", "l3_init_cm:0048:10"), 771fe7020e6STero Kristo DT_CLK(NULL, "utmi_p1_gfclk", "l3_init_cm:0038:24"), 772fe7020e6STero Kristo DT_CLK(NULL, "utmi_p2_gfclk", "l3_init_cm:0038:25"), 77321876ea5STero Kristo { .node_name = NULL }, 77421876ea5STero Kristo }; 77521876ea5STero Kristo 77621876ea5STero Kristo int __init omap4xxx_dt_clk_init(void) 77721876ea5STero Kristo { 77821876ea5STero Kristo int rc; 77921876ea5STero Kristo struct clk *abe_dpll_ref, *abe_dpll, *sys_32k_ck, *usb_dpll; 78021876ea5STero Kristo 78121876ea5STero Kristo ti_dt_clocks_register(omap44xx_clks); 78221876ea5STero Kristo 78321876ea5STero Kristo omap2_clk_disable_autoidle_all(); 78421876ea5STero Kristo 785b6312da5STero Kristo ti_clk_add_aliases(); 786b6312da5STero Kristo 78721876ea5STero Kristo /* 78821876ea5STero Kristo * Lock USB DPLL on OMAP4 devices so that the L3INIT power 78921876ea5STero Kristo * domain can transition to retention state when not in use. 79021876ea5STero Kristo */ 79121876ea5STero Kristo usb_dpll = clk_get_sys(NULL, "dpll_usb_ck"); 79221876ea5STero Kristo rc = clk_set_rate(usb_dpll, OMAP4_DPLL_USB_DEFFREQ); 79321876ea5STero Kristo if (rc) 79421876ea5STero Kristo pr_err("%s: failed to configure USB DPLL!\n", __func__); 79521876ea5STero Kristo 79621876ea5STero Kristo /* 79721876ea5STero Kristo * On OMAP4460 the ABE DPLL fails to turn on if in idle low-power 79821876ea5STero Kristo * state when turning the ABE clock domain. Workaround this by 79921876ea5STero Kristo * locking the ABE DPLL on boot. 80021876ea5STero Kristo * Lock the ABE DPLL in any case to avoid issues with audio. 80121876ea5STero Kristo */ 80221876ea5STero Kristo abe_dpll_ref = clk_get_sys(NULL, "abe_dpll_refclk_mux_ck"); 80321876ea5STero Kristo sys_32k_ck = clk_get_sys(NULL, "sys_32k_ck"); 80421876ea5STero Kristo rc = clk_set_parent(abe_dpll_ref, sys_32k_ck); 80521876ea5STero Kristo abe_dpll = clk_get_sys(NULL, "dpll_abe_ck"); 80621876ea5STero Kristo if (!rc) 80721876ea5STero Kristo rc = clk_set_rate(abe_dpll, OMAP4_DPLL_ABE_DEFFREQ); 80821876ea5STero Kristo if (rc) 80921876ea5STero Kristo pr_err("%s: failed to configure ABE DPLL!\n", __func__); 81021876ea5STero Kristo 81121876ea5STero Kristo return 0; 81221876ea5STero Kristo } 813