1d2912cb1SThomas Gleixner // SPDX-License-Identifier: GPL-2.0-only
252b14728STero Kristo /*
352b14728STero Kristo * OMAP5 Clock init
452b14728STero Kristo *
552b14728STero Kristo * Copyright (C) 2013 Texas Instruments, Inc.
652b14728STero Kristo *
752b14728STero Kristo * Tero Kristo (t-kristo@ti.com)
852b14728STero Kristo */
952b14728STero Kristo
1052b14728STero Kristo #include <linux/kernel.h>
1152b14728STero Kristo #include <linux/list.h>
12e387088aSStephen Boyd #include <linux/clk.h>
1352b14728STero Kristo #include <linux/clkdev.h>
1452b14728STero Kristo #include <linux/io.h>
1552b14728STero Kristo #include <linux/clk/ti.h>
160ad902f6STero Kristo #include <dt-bindings/clock/omap5.h>
1752b14728STero Kristo
18a3314e9cSTero Kristo #include "clock.h"
19a3314e9cSTero Kristo
2052b14728STero Kristo #define OMAP5_DPLL_ABE_DEFFREQ 98304000
2152b14728STero Kristo
2262125a46SRoger Quadros /*
2362125a46SRoger Quadros * OMAP543x TRM, section "3.6.3.9.5 DPLL_USB Preferred Settings"
2462125a46SRoger Quadros * states it must be at 960MHz
2562125a46SRoger Quadros */
2662125a46SRoger Quadros #define OMAP5_DPLL_USB_DEFFREQ 960000000
2762125a46SRoger Quadros
280ad902f6STero Kristo static const struct omap_clkctrl_reg_data omap5_mpu_clkctrl_regs[] __initconst = {
290ad902f6STero Kristo { OMAP5_MPU_CLKCTRL, NULL, 0, "dpll_mpu_m2_ck" },
300ad902f6STero Kristo { 0 },
310ad902f6STero Kristo };
320ad902f6STero Kristo
330ad902f6STero Kristo static const struct omap_clkctrl_reg_data omap5_dsp_clkctrl_regs[] __initconst = {
3495a62bf2SSuman Anna { OMAP5_MMU_DSP_CLKCTRL, NULL, CLKF_HW_SUP | CLKF_NO_IDLEST, "dpll_iva_h11x2_ck" },
350ad902f6STero Kristo { 0 },
360ad902f6STero Kristo };
370ad902f6STero Kristo
38364975eeSTony Lindgren static const char * const omap5_aess_fclk_parents[] __initconst = {
39364975eeSTony Lindgren "abe_clk",
40364975eeSTony Lindgren NULL,
41364975eeSTony Lindgren };
42364975eeSTony Lindgren
43364975eeSTony Lindgren static const struct omap_clkctrl_div_data omap5_aess_fclk_data __initconst = {
44364975eeSTony Lindgren .max_div = 2,
45364975eeSTony Lindgren };
46364975eeSTony Lindgren
47364975eeSTony Lindgren static const struct omap_clkctrl_bit_data omap5_aess_bit_data[] __initconst = {
48364975eeSTony Lindgren { 24, TI_CLK_DIVIDER, omap5_aess_fclk_parents, &omap5_aess_fclk_data },
49364975eeSTony Lindgren { 0 },
50364975eeSTony Lindgren };
51364975eeSTony Lindgren
520ad902f6STero Kristo static const char * const omap5_dmic_gfclk_parents[] __initconst = {
53255584b1STony Lindgren "abe-clkctrl:0018:26",
540ad902f6STero Kristo "pad_clks_ck",
550ad902f6STero Kristo "slimbus_clk",
560ad902f6STero Kristo NULL,
570ad902f6STero Kristo };
580ad902f6STero Kristo
590ad902f6STero Kristo static const char * const omap5_dmic_sync_mux_ck_parents[] __initconst = {
600ad902f6STero Kristo "abe_24m_fclk",
610ad902f6STero Kristo "dss_syc_gfclk_div",
620ad902f6STero Kristo "func_24m_clk",
630ad902f6STero Kristo NULL,
640ad902f6STero Kristo };
650ad902f6STero Kristo
660ad902f6STero Kristo static const struct omap_clkctrl_bit_data omap5_dmic_bit_data[] __initconst = {
670ad902f6STero Kristo { 24, TI_CLK_MUX, omap5_dmic_gfclk_parents, NULL },
680ad902f6STero Kristo { 26, TI_CLK_MUX, omap5_dmic_sync_mux_ck_parents, NULL },
690ad902f6STero Kristo { 0 },
700ad902f6STero Kristo };
710ad902f6STero Kristo
720ad902f6STero Kristo static const char * const omap5_mcbsp1_gfclk_parents[] __initconst = {
73255584b1STony Lindgren "abe-clkctrl:0028:26",
740ad902f6STero Kristo "pad_clks_ck",
750ad902f6STero Kristo "slimbus_clk",
760ad902f6STero Kristo NULL,
770ad902f6STero Kristo };
780ad902f6STero Kristo
790ad902f6STero Kristo static const struct omap_clkctrl_bit_data omap5_mcbsp1_bit_data[] __initconst = {
800ad902f6STero Kristo { 24, TI_CLK_MUX, omap5_mcbsp1_gfclk_parents, NULL },
810ad902f6STero Kristo { 26, TI_CLK_MUX, omap5_dmic_sync_mux_ck_parents, NULL },
820ad902f6STero Kristo { 0 },
830ad902f6STero Kristo };
840ad902f6STero Kristo
850ad902f6STero Kristo static const char * const omap5_mcbsp2_gfclk_parents[] __initconst = {
86255584b1STony Lindgren "abe-clkctrl:0030:26",
870ad902f6STero Kristo "pad_clks_ck",
880ad902f6STero Kristo "slimbus_clk",
890ad902f6STero Kristo NULL,
900ad902f6STero Kristo };
910ad902f6STero Kristo
920ad902f6STero Kristo static const struct omap_clkctrl_bit_data omap5_mcbsp2_bit_data[] __initconst = {
930ad902f6STero Kristo { 24, TI_CLK_MUX, omap5_mcbsp2_gfclk_parents, NULL },
940ad902f6STero Kristo { 26, TI_CLK_MUX, omap5_dmic_sync_mux_ck_parents, NULL },
950ad902f6STero Kristo { 0 },
960ad902f6STero Kristo };
970ad902f6STero Kristo
980ad902f6STero Kristo static const char * const omap5_mcbsp3_gfclk_parents[] __initconst = {
99255584b1STony Lindgren "abe-clkctrl:0038:26",
1000ad902f6STero Kristo "pad_clks_ck",
1010ad902f6STero Kristo "slimbus_clk",
1020ad902f6STero Kristo NULL,
1030ad902f6STero Kristo };
1040ad902f6STero Kristo
1050ad902f6STero Kristo static const struct omap_clkctrl_bit_data omap5_mcbsp3_bit_data[] __initconst = {
1060ad902f6STero Kristo { 24, TI_CLK_MUX, omap5_mcbsp3_gfclk_parents, NULL },
1070ad902f6STero Kristo { 26, TI_CLK_MUX, omap5_dmic_sync_mux_ck_parents, NULL },
1080ad902f6STero Kristo { 0 },
1090ad902f6STero Kristo };
1100ad902f6STero Kristo
1110ad902f6STero Kristo static const char * const omap5_timer5_gfclk_mux_parents[] __initconst = {
1120ad902f6STero Kristo "dss_syc_gfclk_div",
1130ad902f6STero Kristo "sys_32k_ck",
1140ad902f6STero Kristo NULL,
1150ad902f6STero Kristo };
1160ad902f6STero Kristo
1170ad902f6STero Kristo static const struct omap_clkctrl_bit_data omap5_timer5_bit_data[] __initconst = {
1180ad902f6STero Kristo { 24, TI_CLK_MUX, omap5_timer5_gfclk_mux_parents, NULL },
1190ad902f6STero Kristo { 0 },
1200ad902f6STero Kristo };
1210ad902f6STero Kristo
1220ad902f6STero Kristo static const struct omap_clkctrl_bit_data omap5_timer6_bit_data[] __initconst = {
1230ad902f6STero Kristo { 24, TI_CLK_MUX, omap5_timer5_gfclk_mux_parents, NULL },
1240ad902f6STero Kristo { 0 },
1250ad902f6STero Kristo };
1260ad902f6STero Kristo
1270ad902f6STero Kristo static const struct omap_clkctrl_bit_data omap5_timer7_bit_data[] __initconst = {
1280ad902f6STero Kristo { 24, TI_CLK_MUX, omap5_timer5_gfclk_mux_parents, NULL },
1290ad902f6STero Kristo { 0 },
1300ad902f6STero Kristo };
1310ad902f6STero Kristo
1320ad902f6STero Kristo static const struct omap_clkctrl_bit_data omap5_timer8_bit_data[] __initconst = {
1330ad902f6STero Kristo { 24, TI_CLK_MUX, omap5_timer5_gfclk_mux_parents, NULL },
1340ad902f6STero Kristo { 0 },
1350ad902f6STero Kristo };
1360ad902f6STero Kristo
1370ad902f6STero Kristo static const struct omap_clkctrl_reg_data omap5_abe_clkctrl_regs[] __initconst = {
1380ad902f6STero Kristo { OMAP5_L4_ABE_CLKCTRL, NULL, 0, "abe_iclk" },
139255584b1STony Lindgren { OMAP5_AESS_CLKCTRL, omap5_aess_bit_data, CLKF_SW_SUP, "abe-clkctrl:0008:24" },
1400ad902f6STero Kristo { OMAP5_MCPDM_CLKCTRL, NULL, CLKF_SW_SUP, "pad_clks_ck" },
141255584b1STony Lindgren { OMAP5_DMIC_CLKCTRL, omap5_dmic_bit_data, CLKF_SW_SUP, "abe-clkctrl:0018:24" },
142255584b1STony Lindgren { OMAP5_MCBSP1_CLKCTRL, omap5_mcbsp1_bit_data, CLKF_SW_SUP, "abe-clkctrl:0028:24" },
143255584b1STony Lindgren { OMAP5_MCBSP2_CLKCTRL, omap5_mcbsp2_bit_data, CLKF_SW_SUP, "abe-clkctrl:0030:24" },
144255584b1STony Lindgren { OMAP5_MCBSP3_CLKCTRL, omap5_mcbsp3_bit_data, CLKF_SW_SUP, "abe-clkctrl:0038:24" },
145255584b1STony Lindgren { OMAP5_TIMER5_CLKCTRL, omap5_timer5_bit_data, CLKF_SW_SUP, "abe-clkctrl:0048:24" },
146255584b1STony Lindgren { OMAP5_TIMER6_CLKCTRL, omap5_timer6_bit_data, CLKF_SW_SUP, "abe-clkctrl:0050:24" },
147255584b1STony Lindgren { OMAP5_TIMER7_CLKCTRL, omap5_timer7_bit_data, CLKF_SW_SUP, "abe-clkctrl:0058:24" },
148255584b1STony Lindgren { OMAP5_TIMER8_CLKCTRL, omap5_timer8_bit_data, CLKF_SW_SUP, "abe-clkctrl:0060:24" },
1490ad902f6STero Kristo { 0 },
1500ad902f6STero Kristo };
1510ad902f6STero Kristo
1520ad902f6STero Kristo static const struct omap_clkctrl_reg_data omap5_l3main1_clkctrl_regs[] __initconst = {
1530ad902f6STero Kristo { OMAP5_L3_MAIN_1_CLKCTRL, NULL, 0, "l3_iclk_div" },
1540ad902f6STero Kristo { 0 },
1550ad902f6STero Kristo };
1560ad902f6STero Kristo
1570ad902f6STero Kristo static const struct omap_clkctrl_reg_data omap5_l3main2_clkctrl_regs[] __initconst = {
1580ad902f6STero Kristo { OMAP5_L3_MAIN_2_CLKCTRL, NULL, 0, "l3_iclk_div" },
1597f7acef8STony Lindgren { OMAP5_L3_MAIN_2_GPMC_CLKCTRL, NULL, CLKF_HW_SUP, "l3_iclk_div" },
1607f7acef8STony Lindgren { OMAP5_L3_MAIN_2_OCMC_RAM_CLKCTRL, NULL, CLKF_HW_SUP, "l3_iclk_div" },
1610ad902f6STero Kristo { 0 },
1620ad902f6STero Kristo };
1630ad902f6STero Kristo
1640ad902f6STero Kristo static const struct omap_clkctrl_reg_data omap5_ipu_clkctrl_regs[] __initconst = {
16595a62bf2SSuman Anna { OMAP5_MMU_IPU_CLKCTRL, NULL, CLKF_HW_SUP | CLKF_NO_IDLEST, "dpll_core_h22x2_ck" },
1660ad902f6STero Kristo { 0 },
1670ad902f6STero Kristo };
1680ad902f6STero Kristo
1690ad902f6STero Kristo static const struct omap_clkctrl_reg_data omap5_dma_clkctrl_regs[] __initconst = {
1700ad902f6STero Kristo { OMAP5_DMA_SYSTEM_CLKCTRL, NULL, 0, "l3_iclk_div" },
1710ad902f6STero Kristo { 0 },
1720ad902f6STero Kristo };
1730ad902f6STero Kristo
1740ad902f6STero Kristo static const struct omap_clkctrl_reg_data omap5_emif_clkctrl_regs[] __initconst = {
1750ad902f6STero Kristo { OMAP5_DMM_CLKCTRL, NULL, 0, "l3_iclk_div" },
1760ad902f6STero Kristo { OMAP5_EMIF1_CLKCTRL, NULL, CLKF_HW_SUP, "dpll_core_h11x2_ck" },
1770ad902f6STero Kristo { OMAP5_EMIF2_CLKCTRL, NULL, CLKF_HW_SUP, "dpll_core_h11x2_ck" },
1780ad902f6STero Kristo { 0 },
1790ad902f6STero Kristo };
1800ad902f6STero Kristo
1810ad902f6STero Kristo static const struct omap_clkctrl_reg_data omap5_l4cfg_clkctrl_regs[] __initconst = {
1820ad902f6STero Kristo { OMAP5_L4_CFG_CLKCTRL, NULL, 0, "l4_root_clk_div" },
1830ad902f6STero Kristo { OMAP5_SPINLOCK_CLKCTRL, NULL, 0, "l4_root_clk_div" },
1840ad902f6STero Kristo { OMAP5_MAILBOX_CLKCTRL, NULL, 0, "l4_root_clk_div" },
1850ad902f6STero Kristo { 0 },
1860ad902f6STero Kristo };
1870ad902f6STero Kristo
1880ad902f6STero Kristo static const struct omap_clkctrl_reg_data omap5_l3instr_clkctrl_regs[] __initconst = {
1890ad902f6STero Kristo { OMAP5_L3_MAIN_3_CLKCTRL, NULL, CLKF_HW_SUP, "l3_iclk_div" },
1900ad902f6STero Kristo { OMAP5_L3_INSTR_CLKCTRL, NULL, CLKF_HW_SUP, "l3_iclk_div" },
1910ad902f6STero Kristo { 0 },
1920ad902f6STero Kristo };
1930ad902f6STero Kristo
1940ad902f6STero Kristo static const char * const omap5_timer10_gfclk_mux_parents[] __initconst = {
1950ad902f6STero Kristo "sys_clkin",
1960ad902f6STero Kristo "sys_32k_ck",
1970ad902f6STero Kristo NULL,
1980ad902f6STero Kristo };
1990ad902f6STero Kristo
2000ad902f6STero Kristo static const struct omap_clkctrl_bit_data omap5_timer10_bit_data[] __initconst = {
2010ad902f6STero Kristo { 24, TI_CLK_MUX, omap5_timer10_gfclk_mux_parents, NULL },
2020ad902f6STero Kristo { 0 },
2030ad902f6STero Kristo };
2040ad902f6STero Kristo
2050ad902f6STero Kristo static const struct omap_clkctrl_bit_data omap5_timer11_bit_data[] __initconst = {
2060ad902f6STero Kristo { 24, TI_CLK_MUX, omap5_timer10_gfclk_mux_parents, NULL },
2070ad902f6STero Kristo { 0 },
2080ad902f6STero Kristo };
2090ad902f6STero Kristo
2100ad902f6STero Kristo static const struct omap_clkctrl_bit_data omap5_timer2_bit_data[] __initconst = {
2110ad902f6STero Kristo { 24, TI_CLK_MUX, omap5_timer10_gfclk_mux_parents, NULL },
2120ad902f6STero Kristo { 0 },
2130ad902f6STero Kristo };
2140ad902f6STero Kristo
2150ad902f6STero Kristo static const struct omap_clkctrl_bit_data omap5_timer3_bit_data[] __initconst = {
2160ad902f6STero Kristo { 24, TI_CLK_MUX, omap5_timer10_gfclk_mux_parents, NULL },
2170ad902f6STero Kristo { 0 },
2180ad902f6STero Kristo };
2190ad902f6STero Kristo
2200ad902f6STero Kristo static const struct omap_clkctrl_bit_data omap5_timer4_bit_data[] __initconst = {
2210ad902f6STero Kristo { 24, TI_CLK_MUX, omap5_timer10_gfclk_mux_parents, NULL },
2220ad902f6STero Kristo { 0 },
2230ad902f6STero Kristo };
2240ad902f6STero Kristo
2250ad902f6STero Kristo static const struct omap_clkctrl_bit_data omap5_timer9_bit_data[] __initconst = {
2260ad902f6STero Kristo { 24, TI_CLK_MUX, omap5_timer10_gfclk_mux_parents, NULL },
2270ad902f6STero Kristo { 0 },
2280ad902f6STero Kristo };
2290ad902f6STero Kristo
2300ad902f6STero Kristo static const char * const omap5_gpio2_dbclk_parents[] __initconst = {
2310ad902f6STero Kristo "sys_32k_ck",
2320ad902f6STero Kristo NULL,
2330ad902f6STero Kristo };
2340ad902f6STero Kristo
2350ad902f6STero Kristo static const struct omap_clkctrl_bit_data omap5_gpio2_bit_data[] __initconst = {
2360ad902f6STero Kristo { 8, TI_CLK_GATE, omap5_gpio2_dbclk_parents, NULL },
2370ad902f6STero Kristo { 0 },
2380ad902f6STero Kristo };
2390ad902f6STero Kristo
2400ad902f6STero Kristo static const struct omap_clkctrl_bit_data omap5_gpio3_bit_data[] __initconst = {
2410ad902f6STero Kristo { 8, TI_CLK_GATE, omap5_gpio2_dbclk_parents, NULL },
2420ad902f6STero Kristo { 0 },
2430ad902f6STero Kristo };
2440ad902f6STero Kristo
2450ad902f6STero Kristo static const struct omap_clkctrl_bit_data omap5_gpio4_bit_data[] __initconst = {
2460ad902f6STero Kristo { 8, TI_CLK_GATE, omap5_gpio2_dbclk_parents, NULL },
2470ad902f6STero Kristo { 0 },
2480ad902f6STero Kristo };
2490ad902f6STero Kristo
2500ad902f6STero Kristo static const struct omap_clkctrl_bit_data omap5_gpio5_bit_data[] __initconst = {
2510ad902f6STero Kristo { 8, TI_CLK_GATE, omap5_gpio2_dbclk_parents, NULL },
2520ad902f6STero Kristo { 0 },
2530ad902f6STero Kristo };
2540ad902f6STero Kristo
2550ad902f6STero Kristo static const struct omap_clkctrl_bit_data omap5_gpio6_bit_data[] __initconst = {
2560ad902f6STero Kristo { 8, TI_CLK_GATE, omap5_gpio2_dbclk_parents, NULL },
2570ad902f6STero Kristo { 0 },
2580ad902f6STero Kristo };
2590ad902f6STero Kristo
2600ad902f6STero Kristo static const struct omap_clkctrl_bit_data omap5_gpio7_bit_data[] __initconst = {
2610ad902f6STero Kristo { 8, TI_CLK_GATE, omap5_gpio2_dbclk_parents, NULL },
2620ad902f6STero Kristo { 0 },
2630ad902f6STero Kristo };
2640ad902f6STero Kristo
2650ad902f6STero Kristo static const struct omap_clkctrl_bit_data omap5_gpio8_bit_data[] __initconst = {
2660ad902f6STero Kristo { 8, TI_CLK_GATE, omap5_gpio2_dbclk_parents, NULL },
2670ad902f6STero Kristo { 0 },
2680ad902f6STero Kristo };
2690ad902f6STero Kristo
2700ad902f6STero Kristo static const struct omap_clkctrl_reg_data omap5_l4per_clkctrl_regs[] __initconst = {
271255584b1STony Lindgren { OMAP5_TIMER10_CLKCTRL, omap5_timer10_bit_data, CLKF_SW_SUP, "l4per-clkctrl:0008:24" },
272255584b1STony Lindgren { OMAP5_TIMER11_CLKCTRL, omap5_timer11_bit_data, CLKF_SW_SUP, "l4per-clkctrl:0010:24" },
273255584b1STony Lindgren { OMAP5_TIMER2_CLKCTRL, omap5_timer2_bit_data, CLKF_SW_SUP, "l4per-clkctrl:0018:24" },
274255584b1STony Lindgren { OMAP5_TIMER3_CLKCTRL, omap5_timer3_bit_data, CLKF_SW_SUP, "l4per-clkctrl:0020:24" },
275255584b1STony Lindgren { OMAP5_TIMER4_CLKCTRL, omap5_timer4_bit_data, CLKF_SW_SUP, "l4per-clkctrl:0028:24" },
276255584b1STony Lindgren { OMAP5_TIMER9_CLKCTRL, omap5_timer9_bit_data, CLKF_SW_SUP, "l4per-clkctrl:0030:24" },
2770ad902f6STero Kristo { OMAP5_GPIO2_CLKCTRL, omap5_gpio2_bit_data, CLKF_HW_SUP, "l4_root_clk_div" },
2780ad902f6STero Kristo { OMAP5_GPIO3_CLKCTRL, omap5_gpio3_bit_data, CLKF_HW_SUP, "l4_root_clk_div" },
2790ad902f6STero Kristo { OMAP5_GPIO4_CLKCTRL, omap5_gpio4_bit_data, CLKF_HW_SUP, "l4_root_clk_div" },
2800ad902f6STero Kristo { OMAP5_GPIO5_CLKCTRL, omap5_gpio5_bit_data, CLKF_HW_SUP, "l4_root_clk_div" },
2810ad902f6STero Kristo { OMAP5_GPIO6_CLKCTRL, omap5_gpio6_bit_data, CLKF_HW_SUP, "l4_root_clk_div" },
2820ad902f6STero Kristo { OMAP5_I2C1_CLKCTRL, NULL, CLKF_SW_SUP, "func_96m_fclk" },
2830ad902f6STero Kristo { OMAP5_I2C2_CLKCTRL, NULL, CLKF_SW_SUP, "func_96m_fclk" },
2840ad902f6STero Kristo { OMAP5_I2C3_CLKCTRL, NULL, CLKF_SW_SUP, "func_96m_fclk" },
2850ad902f6STero Kristo { OMAP5_I2C4_CLKCTRL, NULL, CLKF_SW_SUP, "func_96m_fclk" },
2860ad902f6STero Kristo { OMAP5_L4_PER_CLKCTRL, NULL, 0, "l4_root_clk_div" },
2870ad902f6STero Kristo { OMAP5_MCSPI1_CLKCTRL, NULL, CLKF_SW_SUP, "func_48m_fclk" },
2880ad902f6STero Kristo { OMAP5_MCSPI2_CLKCTRL, NULL, CLKF_SW_SUP, "func_48m_fclk" },
2890ad902f6STero Kristo { OMAP5_MCSPI3_CLKCTRL, NULL, CLKF_SW_SUP, "func_48m_fclk" },
2900ad902f6STero Kristo { OMAP5_MCSPI4_CLKCTRL, NULL, CLKF_SW_SUP, "func_48m_fclk" },
2910ad902f6STero Kristo { OMAP5_GPIO7_CLKCTRL, omap5_gpio7_bit_data, CLKF_HW_SUP, "l4_root_clk_div" },
2920ad902f6STero Kristo { OMAP5_GPIO8_CLKCTRL, omap5_gpio8_bit_data, CLKF_HW_SUP, "l4_root_clk_div" },
2930ad902f6STero Kristo { OMAP5_MMC3_CLKCTRL, NULL, CLKF_SW_SUP, "func_48m_fclk" },
2940ad902f6STero Kristo { OMAP5_MMC4_CLKCTRL, NULL, CLKF_SW_SUP, "func_48m_fclk" },
2950ad902f6STero Kristo { OMAP5_UART1_CLKCTRL, NULL, CLKF_SW_SUP, "func_48m_fclk" },
2960ad902f6STero Kristo { OMAP5_UART2_CLKCTRL, NULL, CLKF_SW_SUP, "func_48m_fclk" },
2970ad902f6STero Kristo { OMAP5_UART3_CLKCTRL, NULL, CLKF_SW_SUP, "func_48m_fclk" },
2980ad902f6STero Kristo { OMAP5_UART4_CLKCTRL, NULL, CLKF_SW_SUP, "func_48m_fclk" },
2990ad902f6STero Kristo { OMAP5_MMC5_CLKCTRL, NULL, CLKF_SW_SUP, "func_96m_fclk" },
3000ad902f6STero Kristo { OMAP5_I2C5_CLKCTRL, NULL, CLKF_SW_SUP, "func_96m_fclk" },
3010ad902f6STero Kristo { OMAP5_UART5_CLKCTRL, NULL, CLKF_SW_SUP, "func_48m_fclk" },
3020ad902f6STero Kristo { OMAP5_UART6_CLKCTRL, NULL, CLKF_SW_SUP, "func_48m_fclk" },
3030ad902f6STero Kristo { 0 },
3040ad902f6STero Kristo };
3050ad902f6STero Kristo
306723a567fSTony Lindgren static const struct
307723a567fSTony Lindgren omap_clkctrl_reg_data omap5_l4_secure_clkctrl_regs[] __initconst = {
308f968045fSTero Kristo { OMAP5_AES1_CLKCTRL, NULL, CLKF_HW_SUP, "l3_iclk_div" },
309f968045fSTero Kristo { OMAP5_AES2_CLKCTRL, NULL, CLKF_HW_SUP, "l3_iclk_div" },
310f968045fSTero Kristo { OMAP5_DES3DES_CLKCTRL, NULL, CLKF_HW_SUP, "l4_root_clk_div" },
311f968045fSTero Kristo { OMAP5_FPKA_CLKCTRL, NULL, CLKF_SW_SUP, "l4_root_clk_div" },
312f968045fSTero Kristo { OMAP5_RNG_CLKCTRL, NULL, CLKF_HW_SUP | CLKF_SOC_NONSEC, "l4_root_clk_div" },
313f968045fSTero Kristo { OMAP5_SHA2MD5_CLKCTRL, NULL, CLKF_HW_SUP, "l3_iclk_div" },
314f968045fSTero Kristo { OMAP5_DMA_CRYPTO_CLKCTRL, NULL, CLKF_HW_SUP | CLKF_SOC_NONSEC, "l3_iclk_div" },
315723a567fSTony Lindgren { 0 },
316723a567fSTony Lindgren };
317723a567fSTony Lindgren
31825999e61STero Kristo static const struct omap_clkctrl_reg_data omap5_iva_clkctrl_regs[] __initconst = {
31925999e61STero Kristo { OMAP5_IVA_CLKCTRL, NULL, CLKF_HW_SUP, "dpll_iva_h12x2_ck" },
32025999e61STero Kristo { OMAP5_SL2IF_CLKCTRL, NULL, CLKF_HW_SUP, "dpll_iva_h12x2_ck" },
32125999e61STero Kristo { 0 },
32225999e61STero Kristo };
32325999e61STero Kristo
3240ad902f6STero Kristo static const char * const omap5_dss_dss_clk_parents[] __initconst = {
3250ad902f6STero Kristo "dpll_per_h12x2_ck",
3260ad902f6STero Kristo NULL,
3270ad902f6STero Kristo };
3280ad902f6STero Kristo
3290ad902f6STero Kristo static const char * const omap5_dss_48mhz_clk_parents[] __initconst = {
3300ad902f6STero Kristo "func_48m_fclk",
3310ad902f6STero Kristo NULL,
3320ad902f6STero Kristo };
3330ad902f6STero Kristo
3340ad902f6STero Kristo static const char * const omap5_dss_sys_clk_parents[] __initconst = {
3350ad902f6STero Kristo "dss_syc_gfclk_div",
3360ad902f6STero Kristo NULL,
3370ad902f6STero Kristo };
3380ad902f6STero Kristo
3390ad902f6STero Kristo static const struct omap_clkctrl_bit_data omap5_dss_core_bit_data[] __initconst = {
3400ad902f6STero Kristo { 8, TI_CLK_GATE, omap5_dss_dss_clk_parents, NULL },
3410ad902f6STero Kristo { 9, TI_CLK_GATE, omap5_dss_48mhz_clk_parents, NULL },
3420ad902f6STero Kristo { 10, TI_CLK_GATE, omap5_dss_sys_clk_parents, NULL },
3430ad902f6STero Kristo { 11, TI_CLK_GATE, omap5_gpio2_dbclk_parents, NULL },
3440ad902f6STero Kristo { 0 },
3450ad902f6STero Kristo };
3460ad902f6STero Kristo
3470ad902f6STero Kristo static const struct omap_clkctrl_reg_data omap5_dss_clkctrl_regs[] __initconst = {
348255584b1STony Lindgren { OMAP5_DSS_CORE_CLKCTRL, omap5_dss_core_bit_data, CLKF_SW_SUP, "dss-clkctrl:0000:8" },
3490ad902f6STero Kristo { 0 },
3500ad902f6STero Kristo };
3510ad902f6STero Kristo
352fd568374STony Lindgren static const char * const omap5_gpu_core_mux_parents[] __initconst = {
353fd568374STony Lindgren "dpll_core_h14x2_ck",
354fd568374STony Lindgren "dpll_per_h14x2_ck",
355fd568374STony Lindgren NULL,
356fd568374STony Lindgren };
357fd568374STony Lindgren
358fd568374STony Lindgren static const char * const omap5_gpu_hyd_mux_parents[] __initconst = {
359fd568374STony Lindgren "dpll_core_h14x2_ck",
360fd568374STony Lindgren "dpll_per_h14x2_ck",
361fd568374STony Lindgren NULL,
362fd568374STony Lindgren };
363fd568374STony Lindgren
364fd568374STony Lindgren static const char * const omap5_gpu_sys_clk_parents[] __initconst = {
365fd568374STony Lindgren "sys_clkin",
366fd568374STony Lindgren NULL,
367fd568374STony Lindgren };
368fd568374STony Lindgren
369fd568374STony Lindgren static const struct omap_clkctrl_div_data omap5_gpu_sys_clk_data __initconst = {
370fd568374STony Lindgren .max_div = 2,
371fd568374STony Lindgren };
372fd568374STony Lindgren
373fd568374STony Lindgren static const struct omap_clkctrl_bit_data omap5_gpu_core_bit_data[] __initconst = {
374fd568374STony Lindgren { 24, TI_CLK_MUX, omap5_gpu_core_mux_parents, NULL },
375fd568374STony Lindgren { 25, TI_CLK_MUX, omap5_gpu_hyd_mux_parents, NULL },
376fd568374STony Lindgren { 26, TI_CLK_DIVIDER, omap5_gpu_sys_clk_parents, &omap5_gpu_sys_clk_data },
377fd568374STony Lindgren { 0 },
378fd568374STony Lindgren };
379fd568374STony Lindgren
380fd568374STony Lindgren static const struct omap_clkctrl_reg_data omap5_gpu_clkctrl_regs[] __initconst = {
381255584b1STony Lindgren { OMAP5_GPU_CLKCTRL, omap5_gpu_core_bit_data, CLKF_SW_SUP, "gpu-clkctrl:0000:24" },
382fd568374STony Lindgren { 0 },
383fd568374STony Lindgren };
384fd568374STony Lindgren
3850ad902f6STero Kristo static const char * const omap5_mmc1_fclk_mux_parents[] __initconst = {
3860ad902f6STero Kristo "func_128m_clk",
3870ad902f6STero Kristo "dpll_per_m2x2_ck",
3880ad902f6STero Kristo NULL,
3890ad902f6STero Kristo };
3900ad902f6STero Kristo
3910ad902f6STero Kristo static const char * const omap5_mmc1_fclk_parents[] __initconst = {
392255584b1STony Lindgren "l3init-clkctrl:0008:24",
3930ad902f6STero Kristo NULL,
3940ad902f6STero Kristo };
3950ad902f6STero Kristo
3960ad902f6STero Kristo static const struct omap_clkctrl_div_data omap5_mmc1_fclk_data __initconst = {
3970ad902f6STero Kristo .max_div = 2,
3980ad902f6STero Kristo };
3990ad902f6STero Kristo
4000ad902f6STero Kristo static const struct omap_clkctrl_bit_data omap5_mmc1_bit_data[] __initconst = {
4010ad902f6STero Kristo { 8, TI_CLK_GATE, omap5_gpio2_dbclk_parents, NULL },
4020ad902f6STero Kristo { 24, TI_CLK_MUX, omap5_mmc1_fclk_mux_parents, NULL },
4030ad902f6STero Kristo { 25, TI_CLK_DIVIDER, omap5_mmc1_fclk_parents, &omap5_mmc1_fclk_data },
4040ad902f6STero Kristo { 0 },
4050ad902f6STero Kristo };
4060ad902f6STero Kristo
4070ad902f6STero Kristo static const char * const omap5_mmc2_fclk_parents[] __initconst = {
408255584b1STony Lindgren "l3init-clkctrl:0010:24",
4090ad902f6STero Kristo NULL,
4100ad902f6STero Kristo };
4110ad902f6STero Kristo
4120ad902f6STero Kristo static const struct omap_clkctrl_div_data omap5_mmc2_fclk_data __initconst = {
4130ad902f6STero Kristo .max_div = 2,
4140ad902f6STero Kristo };
4150ad902f6STero Kristo
4160ad902f6STero Kristo static const struct omap_clkctrl_bit_data omap5_mmc2_bit_data[] __initconst = {
4170ad902f6STero Kristo { 24, TI_CLK_MUX, omap5_mmc1_fclk_mux_parents, NULL },
4180ad902f6STero Kristo { 25, TI_CLK_DIVIDER, omap5_mmc2_fclk_parents, &omap5_mmc2_fclk_data },
4190ad902f6STero Kristo { 0 },
4200ad902f6STero Kristo };
4210ad902f6STero Kristo
4220ad902f6STero Kristo static const char * const omap5_usb_host_hs_hsic60m_p3_clk_parents[] __initconst = {
4230ad902f6STero Kristo "l3init_60m_fclk",
4240ad902f6STero Kristo NULL,
4250ad902f6STero Kristo };
4260ad902f6STero Kristo
4270ad902f6STero Kristo static const char * const omap5_usb_host_hs_hsic480m_p3_clk_parents[] __initconst = {
4280ad902f6STero Kristo "dpll_usb_m2_ck",
4290ad902f6STero Kristo NULL,
4300ad902f6STero Kristo };
4310ad902f6STero Kristo
4320ad902f6STero Kristo static const char * const omap5_usb_host_hs_utmi_p1_clk_parents[] __initconst = {
433255584b1STony Lindgren "l3init-clkctrl:0038:24",
4340ad902f6STero Kristo NULL,
4350ad902f6STero Kristo };
4360ad902f6STero Kristo
4370ad902f6STero Kristo static const char * const omap5_usb_host_hs_utmi_p2_clk_parents[] __initconst = {
438255584b1STony Lindgren "l3init-clkctrl:0038:25",
4390ad902f6STero Kristo NULL,
4400ad902f6STero Kristo };
4410ad902f6STero Kristo
4420ad902f6STero Kristo static const char * const omap5_utmi_p1_gfclk_parents[] __initconst = {
4430ad902f6STero Kristo "l3init_60m_fclk",
4440ad902f6STero Kristo "xclk60mhsp1_ck",
4450ad902f6STero Kristo NULL,
4460ad902f6STero Kristo };
4470ad902f6STero Kristo
4480ad902f6STero Kristo static const char * const omap5_utmi_p2_gfclk_parents[] __initconst = {
4490ad902f6STero Kristo "l3init_60m_fclk",
4500ad902f6STero Kristo "xclk60mhsp2_ck",
4510ad902f6STero Kristo NULL,
4520ad902f6STero Kristo };
4530ad902f6STero Kristo
4540ad902f6STero Kristo static const struct omap_clkctrl_bit_data omap5_usb_host_hs_bit_data[] __initconst = {
4550ad902f6STero Kristo { 6, TI_CLK_GATE, omap5_usb_host_hs_hsic60m_p3_clk_parents, NULL },
4560ad902f6STero Kristo { 7, TI_CLK_GATE, omap5_usb_host_hs_hsic480m_p3_clk_parents, NULL },
4570ad902f6STero Kristo { 8, TI_CLK_GATE, omap5_usb_host_hs_utmi_p1_clk_parents, NULL },
4580ad902f6STero Kristo { 9, TI_CLK_GATE, omap5_usb_host_hs_utmi_p2_clk_parents, NULL },
4590ad902f6STero Kristo { 10, TI_CLK_GATE, omap5_usb_host_hs_hsic60m_p3_clk_parents, NULL },
4600ad902f6STero Kristo { 11, TI_CLK_GATE, omap5_usb_host_hs_hsic60m_p3_clk_parents, NULL },
4610ad902f6STero Kristo { 12, TI_CLK_GATE, omap5_usb_host_hs_hsic60m_p3_clk_parents, NULL },
4620ad902f6STero Kristo { 13, TI_CLK_GATE, omap5_usb_host_hs_hsic480m_p3_clk_parents, NULL },
4630ad902f6STero Kristo { 14, TI_CLK_GATE, omap5_usb_host_hs_hsic480m_p3_clk_parents, NULL },
4640ad902f6STero Kristo { 24, TI_CLK_MUX, omap5_utmi_p1_gfclk_parents, NULL },
4650ad902f6STero Kristo { 25, TI_CLK_MUX, omap5_utmi_p2_gfclk_parents, NULL },
4660ad902f6STero Kristo { 0 },
4670ad902f6STero Kristo };
4680ad902f6STero Kristo
4690ad902f6STero Kristo static const struct omap_clkctrl_bit_data omap5_usb_tll_hs_bit_data[] __initconst = {
4700ad902f6STero Kristo { 8, TI_CLK_GATE, omap5_usb_host_hs_hsic60m_p3_clk_parents, NULL },
4710ad902f6STero Kristo { 9, TI_CLK_GATE, omap5_usb_host_hs_hsic60m_p3_clk_parents, NULL },
4720ad902f6STero Kristo { 10, TI_CLK_GATE, omap5_usb_host_hs_hsic60m_p3_clk_parents, NULL },
4730ad902f6STero Kristo { 0 },
4740ad902f6STero Kristo };
4750ad902f6STero Kristo
4760ad902f6STero Kristo static const char * const omap5_sata_ref_clk_parents[] __initconst = {
4770ad902f6STero Kristo "sys_clkin",
4780ad902f6STero Kristo NULL,
4790ad902f6STero Kristo };
4800ad902f6STero Kristo
4810ad902f6STero Kristo static const struct omap_clkctrl_bit_data omap5_sata_bit_data[] __initconst = {
4820ad902f6STero Kristo { 8, TI_CLK_GATE, omap5_sata_ref_clk_parents, NULL },
4830ad902f6STero Kristo { 0 },
4840ad902f6STero Kristo };
4850ad902f6STero Kristo
4860ad902f6STero Kristo static const char * const omap5_usb_otg_ss_refclk960m_parents[] __initconst = {
4870ad902f6STero Kristo "dpll_usb_clkdcoldo",
4880ad902f6STero Kristo NULL,
4890ad902f6STero Kristo };
4900ad902f6STero Kristo
4910ad902f6STero Kristo static const struct omap_clkctrl_bit_data omap5_usb_otg_ss_bit_data[] __initconst = {
4920ad902f6STero Kristo { 8, TI_CLK_GATE, omap5_usb_otg_ss_refclk960m_parents, NULL },
4930ad902f6STero Kristo { 0 },
4940ad902f6STero Kristo };
4950ad902f6STero Kristo
4960ad902f6STero Kristo static const struct omap_clkctrl_reg_data omap5_l3init_clkctrl_regs[] __initconst = {
497255584b1STony Lindgren { OMAP5_MMC1_CLKCTRL, omap5_mmc1_bit_data, CLKF_SW_SUP, "l3init-clkctrl:0008:25" },
498255584b1STony Lindgren { OMAP5_MMC2_CLKCTRL, omap5_mmc2_bit_data, CLKF_SW_SUP, "l3init-clkctrl:0010:25" },
4990ad902f6STero Kristo { OMAP5_USB_HOST_HS_CLKCTRL, omap5_usb_host_hs_bit_data, CLKF_SW_SUP, "l3init_60m_fclk" },
5000ad902f6STero Kristo { OMAP5_USB_TLL_HS_CLKCTRL, omap5_usb_tll_hs_bit_data, CLKF_HW_SUP, "l4_root_clk_div" },
5010ad902f6STero Kristo { OMAP5_SATA_CLKCTRL, omap5_sata_bit_data, CLKF_SW_SUP, "func_48m_fclk" },
5020ad902f6STero Kristo { OMAP5_OCP2SCP1_CLKCTRL, NULL, CLKF_HW_SUP, "l4_root_clk_div" },
5030ad902f6STero Kristo { OMAP5_OCP2SCP3_CLKCTRL, NULL, CLKF_HW_SUP, "l4_root_clk_div" },
5040ad902f6STero Kristo { OMAP5_USB_OTG_SS_CLKCTRL, omap5_usb_otg_ss_bit_data, CLKF_HW_SUP, "dpll_core_h13x2_ck" },
5050ad902f6STero Kristo { 0 },
5060ad902f6STero Kristo };
5070ad902f6STero Kristo
5080ad902f6STero Kristo static const struct omap_clkctrl_bit_data omap5_gpio1_bit_data[] __initconst = {
5090ad902f6STero Kristo { 8, TI_CLK_GATE, omap5_gpio2_dbclk_parents, NULL },
5100ad902f6STero Kristo { 0 },
5110ad902f6STero Kristo };
5120ad902f6STero Kristo
5130ad902f6STero Kristo static const struct omap_clkctrl_bit_data omap5_timer1_bit_data[] __initconst = {
5140ad902f6STero Kristo { 24, TI_CLK_MUX, omap5_timer10_gfclk_mux_parents, NULL },
5150ad902f6STero Kristo { 0 },
5160ad902f6STero Kristo };
5170ad902f6STero Kristo
5180ad902f6STero Kristo static const struct omap_clkctrl_reg_data omap5_wkupaon_clkctrl_regs[] __initconst = {
5190ad902f6STero Kristo { OMAP5_L4_WKUP_CLKCTRL, NULL, 0, "wkupaon_iclk_mux" },
5200ad902f6STero Kristo { OMAP5_WD_TIMER2_CLKCTRL, NULL, CLKF_SW_SUP, "sys_32k_ck" },
5210ad902f6STero Kristo { OMAP5_GPIO1_CLKCTRL, omap5_gpio1_bit_data, CLKF_HW_SUP, "wkupaon_iclk_mux" },
522255584b1STony Lindgren { OMAP5_TIMER1_CLKCTRL, omap5_timer1_bit_data, CLKF_SW_SUP, "wkupaon-clkctrl:0020:24" },
5230ad902f6STero Kristo { OMAP5_COUNTER_32K_CLKCTRL, NULL, 0, "wkupaon_iclk_mux" },
5240ad902f6STero Kristo { OMAP5_KBD_CLKCTRL, NULL, CLKF_SW_SUP, "sys_32k_ck" },
5250ad902f6STero Kristo { 0 },
5260ad902f6STero Kristo };
5270ad902f6STero Kristo
5280ad902f6STero Kristo const struct omap_clkctrl_data omap5_clkctrl_data[] __initconst = {
5290ad902f6STero Kristo { 0x4a004320, omap5_mpu_clkctrl_regs },
5300ad902f6STero Kristo { 0x4a004420, omap5_dsp_clkctrl_regs },
5310ad902f6STero Kristo { 0x4a004520, omap5_abe_clkctrl_regs },
5320ad902f6STero Kristo { 0x4a008720, omap5_l3main1_clkctrl_regs },
5330ad902f6STero Kristo { 0x4a008820, omap5_l3main2_clkctrl_regs },
5340ad902f6STero Kristo { 0x4a008920, omap5_ipu_clkctrl_regs },
5350ad902f6STero Kristo { 0x4a008a20, omap5_dma_clkctrl_regs },
5360ad902f6STero Kristo { 0x4a008b20, omap5_emif_clkctrl_regs },
5370ad902f6STero Kristo { 0x4a008d20, omap5_l4cfg_clkctrl_regs },
5380ad902f6STero Kristo { 0x4a008e20, omap5_l3instr_clkctrl_regs },
5390ad902f6STero Kristo { 0x4a009020, omap5_l4per_clkctrl_regs },
540723a567fSTony Lindgren { 0x4a0091a0, omap5_l4_secure_clkctrl_regs },
54125999e61STero Kristo { 0x4a009220, omap5_iva_clkctrl_regs },
5420ad902f6STero Kristo { 0x4a009420, omap5_dss_clkctrl_regs },
543fd568374STony Lindgren { 0x4a009520, omap5_gpu_clkctrl_regs },
5440ad902f6STero Kristo { 0x4a009620, omap5_l3init_clkctrl_regs },
5450ad902f6STero Kristo { 0x4ae07920, omap5_wkupaon_clkctrl_regs },
5460ad902f6STero Kristo { 0 },
5470ad902f6STero Kristo };
5480ad902f6STero Kristo
54952b14728STero Kristo static struct ti_dt_clk omap54xx_clks[] = {
55052b14728STero Kristo DT_CLK(NULL, "timer_32k_ck", "sys_32k_ck"),
551d5630b7aSGrygorii Strashko DT_CLK(NULL, "sys_clkin_ck", "sys_clkin"),
552255584b1STony Lindgren DT_CLK(NULL, "dmic_gfclk", "abe-clkctrl:0018:24"),
553255584b1STony Lindgren DT_CLK(NULL, "dmic_sync_mux_ck", "abe-clkctrl:0018:26"),
554255584b1STony Lindgren DT_CLK(NULL, "dss_32khz_clk", "dss-clkctrl:0000:11"),
555255584b1STony Lindgren DT_CLK(NULL, "dss_48mhz_clk", "dss-clkctrl:0000:9"),
556255584b1STony Lindgren DT_CLK(NULL, "dss_dss_clk", "dss-clkctrl:0000:8"),
557255584b1STony Lindgren DT_CLK(NULL, "dss_sys_clk", "dss-clkctrl:0000:10"),
558255584b1STony Lindgren DT_CLK(NULL, "gpio1_dbclk", "wkupaon-clkctrl:0018:8"),
559255584b1STony Lindgren DT_CLK(NULL, "gpio2_dbclk", "l4per-clkctrl:0040:8"),
560255584b1STony Lindgren DT_CLK(NULL, "gpio3_dbclk", "l4per-clkctrl:0048:8"),
561255584b1STony Lindgren DT_CLK(NULL, "gpio4_dbclk", "l4per-clkctrl:0050:8"),
562255584b1STony Lindgren DT_CLK(NULL, "gpio5_dbclk", "l4per-clkctrl:0058:8"),
563255584b1STony Lindgren DT_CLK(NULL, "gpio6_dbclk", "l4per-clkctrl:0060:8"),
564255584b1STony Lindgren DT_CLK(NULL, "gpio7_dbclk", "l4per-clkctrl:00f0:8"),
565255584b1STony Lindgren DT_CLK(NULL, "gpio8_dbclk", "l4per-clkctrl:00f8:8"),
566255584b1STony Lindgren DT_CLK(NULL, "mcbsp1_gfclk", "abe-clkctrl:0028:24"),
567255584b1STony Lindgren DT_CLK(NULL, "mcbsp1_sync_mux_ck", "abe-clkctrl:0028:26"),
568*0b9a4a67STony Lindgren DT_CLK("40122000.mcbsp", "prcm_fck", "abe-clkctrl:0028:26"),
569255584b1STony Lindgren DT_CLK(NULL, "mcbsp2_gfclk", "abe-clkctrl:0030:24"),
570255584b1STony Lindgren DT_CLK(NULL, "mcbsp2_sync_mux_ck", "abe-clkctrl:0030:26"),
571*0b9a4a67STony Lindgren DT_CLK("40124000.mcbsp", "prcm_fck", "abe-clkctrl:0030:26"),
572255584b1STony Lindgren DT_CLK(NULL, "mcbsp3_gfclk", "abe-clkctrl:0038:24"),
573255584b1STony Lindgren DT_CLK(NULL, "mcbsp3_sync_mux_ck", "abe-clkctrl:0038:26"),
574*0b9a4a67STony Lindgren DT_CLK("40126000.mcbsp", "prcm_fck", "abe-clkctrl:0038:26"),
575255584b1STony Lindgren DT_CLK(NULL, "mmc1_32khz_clk", "l3init-clkctrl:0008:8"),
576255584b1STony Lindgren DT_CLK(NULL, "mmc1_fclk", "l3init-clkctrl:0008:25"),
577255584b1STony Lindgren DT_CLK(NULL, "mmc1_fclk_mux", "l3init-clkctrl:0008:24"),
578255584b1STony Lindgren DT_CLK(NULL, "mmc2_fclk", "l3init-clkctrl:0010:25"),
579255584b1STony Lindgren DT_CLK(NULL, "mmc2_fclk_mux", "l3init-clkctrl:0010:24"),
580*0b9a4a67STony Lindgren DT_CLK(NULL, "pad_fck", "pad_clks_ck"),
581255584b1STony Lindgren DT_CLK(NULL, "sata_ref_clk", "l3init-clkctrl:0068:8"),
582255584b1STony Lindgren DT_CLK(NULL, "timer10_gfclk_mux", "l4per-clkctrl:0008:24"),
583255584b1STony Lindgren DT_CLK(NULL, "timer11_gfclk_mux", "l4per-clkctrl:0010:24"),
584255584b1STony Lindgren DT_CLK(NULL, "timer1_gfclk_mux", "wkupaon-clkctrl:0020:24"),
585255584b1STony Lindgren DT_CLK(NULL, "timer2_gfclk_mux", "l4per-clkctrl:0018:24"),
586255584b1STony Lindgren DT_CLK(NULL, "timer3_gfclk_mux", "l4per-clkctrl:0020:24"),
587255584b1STony Lindgren DT_CLK(NULL, "timer4_gfclk_mux", "l4per-clkctrl:0028:24"),
588255584b1STony Lindgren DT_CLK(NULL, "timer5_gfclk_mux", "abe-clkctrl:0048:24"),
589255584b1STony Lindgren DT_CLK(NULL, "timer6_gfclk_mux", "abe-clkctrl:0050:24"),
590255584b1STony Lindgren DT_CLK(NULL, "timer7_gfclk_mux", "abe-clkctrl:0058:24"),
591255584b1STony Lindgren DT_CLK(NULL, "timer8_gfclk_mux", "abe-clkctrl:0060:24"),
592255584b1STony Lindgren DT_CLK(NULL, "timer9_gfclk_mux", "l4per-clkctrl:0030:24"),
593255584b1STony Lindgren DT_CLK(NULL, "usb_host_hs_hsic480m_p1_clk", "l3init-clkctrl:0038:13"),
594255584b1STony Lindgren DT_CLK(NULL, "usb_host_hs_hsic480m_p2_clk", "l3init-clkctrl:0038:14"),
595255584b1STony Lindgren DT_CLK(NULL, "usb_host_hs_hsic480m_p3_clk", "l3init-clkctrl:0038:7"),
596255584b1STony Lindgren DT_CLK(NULL, "usb_host_hs_hsic60m_p1_clk", "l3init-clkctrl:0038:11"),
597255584b1STony Lindgren DT_CLK(NULL, "usb_host_hs_hsic60m_p2_clk", "l3init-clkctrl:0038:12"),
598255584b1STony Lindgren DT_CLK(NULL, "usb_host_hs_hsic60m_p3_clk", "l3init-clkctrl:0038:6"),
599255584b1STony Lindgren DT_CLK(NULL, "usb_host_hs_utmi_p1_clk", "l3init-clkctrl:0038:8"),
600255584b1STony Lindgren DT_CLK(NULL, "usb_host_hs_utmi_p2_clk", "l3init-clkctrl:0038:9"),
601255584b1STony Lindgren DT_CLK(NULL, "usb_host_hs_utmi_p3_clk", "l3init-clkctrl:0038:10"),
602255584b1STony Lindgren DT_CLK(NULL, "usb_otg_ss_refclk960m", "l3init-clkctrl:00d0:8"),
603255584b1STony Lindgren DT_CLK(NULL, "usb_tll_hs_usb_ch0_clk", "l3init-clkctrl:0048:8"),
604255584b1STony Lindgren DT_CLK(NULL, "usb_tll_hs_usb_ch1_clk", "l3init-clkctrl:0048:9"),
605255584b1STony Lindgren DT_CLK(NULL, "usb_tll_hs_usb_ch2_clk", "l3init-clkctrl:0048:10"),
606255584b1STony Lindgren DT_CLK(NULL, "utmi_p1_gfclk", "l3init-clkctrl:0038:24"),
607255584b1STony Lindgren DT_CLK(NULL, "utmi_p2_gfclk", "l3init-clkctrl:0038:25"),
60852b14728STero Kristo { .node_name = NULL },
60952b14728STero Kristo };
61052b14728STero Kristo
omap5xxx_dt_clk_init(void)61152b14728STero Kristo int __init omap5xxx_dt_clk_init(void)
61252b14728STero Kristo {
61352b14728STero Kristo int rc;
61466cc7af3SDavid Shah struct clk *abe_dpll_ref, *abe_dpll, *abe_dpll_byp, *sys_32k_ck, *usb_dpll;
61552b14728STero Kristo
61652b14728STero Kristo ti_dt_clocks_register(omap54xx_clks);
61752b14728STero Kristo
61852b14728STero Kristo omap2_clk_disable_autoidle_all();
61952b14728STero Kristo
620d41e5304STero Kristo ti_clk_add_aliases();
621d41e5304STero Kristo
62252b14728STero Kristo abe_dpll_ref = clk_get_sys(NULL, "abe_dpll_clk_mux");
62352b14728STero Kristo sys_32k_ck = clk_get_sys(NULL, "sys_32k_ck");
62452b14728STero Kristo rc = clk_set_parent(abe_dpll_ref, sys_32k_ck);
62566cc7af3SDavid Shah
62666cc7af3SDavid Shah /*
62766cc7af3SDavid Shah * This must also be set to sys_32k_ck to match or
62866cc7af3SDavid Shah * the ABE DPLL will not lock on a warm reboot when
62966cc7af3SDavid Shah * ABE timers are used.
63066cc7af3SDavid Shah */
63166cc7af3SDavid Shah abe_dpll_byp = clk_get_sys(NULL, "abe_dpll_bypass_clk_mux");
63266cc7af3SDavid Shah if (!rc)
63366cc7af3SDavid Shah rc = clk_set_parent(abe_dpll_byp, sys_32k_ck);
63466cc7af3SDavid Shah
63552b14728STero Kristo abe_dpll = clk_get_sys(NULL, "dpll_abe_ck");
63652b14728STero Kristo if (!rc)
63752b14728STero Kristo rc = clk_set_rate(abe_dpll, OMAP5_DPLL_ABE_DEFFREQ);
63852b14728STero Kristo if (rc)
63952b14728STero Kristo pr_err("%s: failed to configure ABE DPLL!\n", __func__);
64052b14728STero Kristo
64181c7e03aSPeter Ujfalusi abe_dpll = clk_get_sys(NULL, "dpll_abe_m2x2_ck");
64281c7e03aSPeter Ujfalusi if (!rc)
64381c7e03aSPeter Ujfalusi rc = clk_set_rate(abe_dpll, OMAP5_DPLL_ABE_DEFFREQ * 2);
64481c7e03aSPeter Ujfalusi if (rc)
64581c7e03aSPeter Ujfalusi pr_err("%s: failed to configure ABE m2x2 DPLL!\n", __func__);
64681c7e03aSPeter Ujfalusi
64762125a46SRoger Quadros usb_dpll = clk_get_sys(NULL, "dpll_usb_ck");
64862125a46SRoger Quadros rc = clk_set_rate(usb_dpll, OMAP5_DPLL_USB_DEFFREQ);
64962125a46SRoger Quadros if (rc)
65062125a46SRoger Quadros pr_err("%s: failed to configure USB DPLL!\n", __func__);
65162125a46SRoger Quadros
65262125a46SRoger Quadros usb_dpll = clk_get_sys(NULL, "dpll_usb_m2_ck");
65362125a46SRoger Quadros rc = clk_set_rate(usb_dpll, OMAP5_DPLL_USB_DEFFREQ/2);
65462125a46SRoger Quadros if (rc)
65562125a46SRoger Quadros pr_err("%s: failed to set USB_DPLL M2 OUT\n", __func__);
65662125a46SRoger Quadros
65752b14728STero Kristo return 0;
65852b14728STero Kristo }
659