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