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> 18*1c881b5aSTero 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 37*1c881b5aSTero Kristo static const struct omap_clkctrl_reg_data omap4_mpuss_clkctrl_regs[] __initconst = { 38*1c881b5aSTero Kristo { OMAP4_MPU_CLKCTRL, NULL, CLKF_HW_SUP, "dpll_mpu_m2_ck" }, 39*1c881b5aSTero Kristo { 0 }, 40*1c881b5aSTero Kristo }; 41*1c881b5aSTero Kristo 42*1c881b5aSTero Kristo static const struct omap_clkctrl_reg_data omap4_tesla_clkctrl_regs[] __initconst = { 43*1c881b5aSTero Kristo { OMAP4_DSP_CLKCTRL, NULL, CLKF_HW_SUP, "dpll_iva_m4x2_ck" }, 44*1c881b5aSTero Kristo { 0 }, 45*1c881b5aSTero Kristo }; 46*1c881b5aSTero Kristo 47*1c881b5aSTero Kristo static const char * const omap4_aess_fclk_parents[] __initconst = { 48*1c881b5aSTero Kristo "abe_clk", 49*1c881b5aSTero Kristo NULL, 50*1c881b5aSTero Kristo }; 51*1c881b5aSTero Kristo 52*1c881b5aSTero Kristo static const struct omap_clkctrl_div_data omap4_aess_fclk_data __initconst = { 53*1c881b5aSTero Kristo .max_div = 2, 54*1c881b5aSTero Kristo }; 55*1c881b5aSTero Kristo 56*1c881b5aSTero Kristo static const struct omap_clkctrl_bit_data omap4_aess_bit_data[] __initconst = { 57*1c881b5aSTero Kristo { 24, TI_CLK_DIVIDER, omap4_aess_fclk_parents, &omap4_aess_fclk_data }, 58*1c881b5aSTero Kristo { 0 }, 59*1c881b5aSTero Kristo }; 60*1c881b5aSTero Kristo 61*1c881b5aSTero Kristo static const char * const omap4_func_dmic_abe_gfclk_parents[] __initconst = { 62*1c881b5aSTero Kristo "dmic_sync_mux_ck", 63*1c881b5aSTero Kristo "pad_clks_ck", 64*1c881b5aSTero Kristo "slimbus_clk", 65*1c881b5aSTero Kristo NULL, 66*1c881b5aSTero Kristo }; 67*1c881b5aSTero Kristo 68*1c881b5aSTero Kristo static const char * const omap4_dmic_sync_mux_ck_parents[] __initconst = { 69*1c881b5aSTero Kristo "abe_24m_fclk", 70*1c881b5aSTero Kristo "syc_clk_div_ck", 71*1c881b5aSTero Kristo "func_24m_clk", 72*1c881b5aSTero Kristo NULL, 73*1c881b5aSTero Kristo }; 74*1c881b5aSTero Kristo 75*1c881b5aSTero Kristo static const struct omap_clkctrl_bit_data omap4_dmic_bit_data[] __initconst = { 76*1c881b5aSTero Kristo { 24, TI_CLK_MUX, omap4_func_dmic_abe_gfclk_parents, NULL }, 77*1c881b5aSTero Kristo { 26, TI_CLK_MUX, omap4_dmic_sync_mux_ck_parents, NULL }, 78*1c881b5aSTero Kristo { 0 }, 79*1c881b5aSTero Kristo }; 80*1c881b5aSTero Kristo 81*1c881b5aSTero Kristo static const char * const omap4_func_mcasp_abe_gfclk_parents[] __initconst = { 82*1c881b5aSTero Kristo "mcasp_sync_mux_ck", 83*1c881b5aSTero Kristo "pad_clks_ck", 84*1c881b5aSTero Kristo "slimbus_clk", 85*1c881b5aSTero Kristo NULL, 86*1c881b5aSTero Kristo }; 87*1c881b5aSTero Kristo 88*1c881b5aSTero Kristo static const struct omap_clkctrl_bit_data omap4_mcasp_bit_data[] __initconst = { 89*1c881b5aSTero Kristo { 24, TI_CLK_MUX, omap4_func_mcasp_abe_gfclk_parents, NULL }, 90*1c881b5aSTero Kristo { 26, TI_CLK_MUX, omap4_dmic_sync_mux_ck_parents, NULL }, 91*1c881b5aSTero Kristo { 0 }, 92*1c881b5aSTero Kristo }; 93*1c881b5aSTero Kristo 94*1c881b5aSTero Kristo static const char * const omap4_func_mcbsp1_gfclk_parents[] __initconst = { 95*1c881b5aSTero Kristo "mcbsp1_sync_mux_ck", 96*1c881b5aSTero Kristo "pad_clks_ck", 97*1c881b5aSTero Kristo "slimbus_clk", 98*1c881b5aSTero Kristo NULL, 99*1c881b5aSTero Kristo }; 100*1c881b5aSTero Kristo 101*1c881b5aSTero Kristo static const struct omap_clkctrl_bit_data omap4_mcbsp1_bit_data[] __initconst = { 102*1c881b5aSTero Kristo { 24, TI_CLK_MUX, omap4_func_mcbsp1_gfclk_parents, NULL }, 103*1c881b5aSTero Kristo { 26, TI_CLK_MUX, omap4_dmic_sync_mux_ck_parents, NULL }, 104*1c881b5aSTero Kristo { 0 }, 105*1c881b5aSTero Kristo }; 106*1c881b5aSTero Kristo 107*1c881b5aSTero Kristo static const char * const omap4_func_mcbsp2_gfclk_parents[] __initconst = { 108*1c881b5aSTero Kristo "mcbsp2_sync_mux_ck", 109*1c881b5aSTero Kristo "pad_clks_ck", 110*1c881b5aSTero Kristo "slimbus_clk", 111*1c881b5aSTero Kristo NULL, 112*1c881b5aSTero Kristo }; 113*1c881b5aSTero Kristo 114*1c881b5aSTero Kristo static const struct omap_clkctrl_bit_data omap4_mcbsp2_bit_data[] __initconst = { 115*1c881b5aSTero Kristo { 24, TI_CLK_MUX, omap4_func_mcbsp2_gfclk_parents, NULL }, 116*1c881b5aSTero Kristo { 26, TI_CLK_MUX, omap4_dmic_sync_mux_ck_parents, NULL }, 117*1c881b5aSTero Kristo { 0 }, 118*1c881b5aSTero Kristo }; 119*1c881b5aSTero Kristo 120*1c881b5aSTero Kristo static const char * const omap4_func_mcbsp3_gfclk_parents[] __initconst = { 121*1c881b5aSTero Kristo "mcbsp3_sync_mux_ck", 122*1c881b5aSTero Kristo "pad_clks_ck", 123*1c881b5aSTero Kristo "slimbus_clk", 124*1c881b5aSTero Kristo NULL, 125*1c881b5aSTero Kristo }; 126*1c881b5aSTero Kristo 127*1c881b5aSTero Kristo static const struct omap_clkctrl_bit_data omap4_mcbsp3_bit_data[] __initconst = { 128*1c881b5aSTero Kristo { 24, TI_CLK_MUX, omap4_func_mcbsp3_gfclk_parents, NULL }, 129*1c881b5aSTero Kristo { 26, TI_CLK_MUX, omap4_dmic_sync_mux_ck_parents, NULL }, 130*1c881b5aSTero Kristo { 0 }, 131*1c881b5aSTero Kristo }; 132*1c881b5aSTero Kristo 133*1c881b5aSTero Kristo static const char * const omap4_slimbus1_fclk_0_parents[] __initconst = { 134*1c881b5aSTero Kristo "abe_24m_fclk", 135*1c881b5aSTero Kristo NULL, 136*1c881b5aSTero Kristo }; 137*1c881b5aSTero Kristo 138*1c881b5aSTero Kristo static const char * const omap4_slimbus1_fclk_1_parents[] __initconst = { 139*1c881b5aSTero Kristo "func_24m_clk", 140*1c881b5aSTero Kristo NULL, 141*1c881b5aSTero Kristo }; 142*1c881b5aSTero Kristo 143*1c881b5aSTero Kristo static const char * const omap4_slimbus1_fclk_2_parents[] __initconst = { 144*1c881b5aSTero Kristo "pad_clks_ck", 145*1c881b5aSTero Kristo NULL, 146*1c881b5aSTero Kristo }; 147*1c881b5aSTero Kristo 148*1c881b5aSTero Kristo static const char * const omap4_slimbus1_slimbus_clk_parents[] __initconst = { 149*1c881b5aSTero Kristo "slimbus_clk", 150*1c881b5aSTero Kristo NULL, 151*1c881b5aSTero Kristo }; 152*1c881b5aSTero Kristo 153*1c881b5aSTero Kristo static const struct omap_clkctrl_bit_data omap4_slimbus1_bit_data[] __initconst = { 154*1c881b5aSTero Kristo { 8, TI_CLK_GATE, omap4_slimbus1_fclk_0_parents, NULL }, 155*1c881b5aSTero Kristo { 9, TI_CLK_GATE, omap4_slimbus1_fclk_1_parents, NULL }, 156*1c881b5aSTero Kristo { 10, TI_CLK_GATE, omap4_slimbus1_fclk_2_parents, NULL }, 157*1c881b5aSTero Kristo { 11, TI_CLK_GATE, omap4_slimbus1_slimbus_clk_parents, NULL }, 158*1c881b5aSTero Kristo { 0 }, 159*1c881b5aSTero Kristo }; 160*1c881b5aSTero Kristo 161*1c881b5aSTero Kristo static const char * const omap4_timer5_sync_mux_parents[] __initconst = { 162*1c881b5aSTero Kristo "syc_clk_div_ck", 163*1c881b5aSTero Kristo "sys_32k_ck", 164*1c881b5aSTero Kristo NULL, 165*1c881b5aSTero Kristo }; 166*1c881b5aSTero Kristo 167*1c881b5aSTero Kristo static const struct omap_clkctrl_bit_data omap4_timer5_bit_data[] __initconst = { 168*1c881b5aSTero Kristo { 24, TI_CLK_MUX, omap4_timer5_sync_mux_parents, NULL }, 169*1c881b5aSTero Kristo { 0 }, 170*1c881b5aSTero Kristo }; 171*1c881b5aSTero Kristo 172*1c881b5aSTero Kristo static const struct omap_clkctrl_bit_data omap4_timer6_bit_data[] __initconst = { 173*1c881b5aSTero Kristo { 24, TI_CLK_MUX, omap4_timer5_sync_mux_parents, NULL }, 174*1c881b5aSTero Kristo { 0 }, 175*1c881b5aSTero Kristo }; 176*1c881b5aSTero Kristo 177*1c881b5aSTero Kristo static const struct omap_clkctrl_bit_data omap4_timer7_bit_data[] __initconst = { 178*1c881b5aSTero Kristo { 24, TI_CLK_MUX, omap4_timer5_sync_mux_parents, NULL }, 179*1c881b5aSTero Kristo { 0 }, 180*1c881b5aSTero Kristo }; 181*1c881b5aSTero Kristo 182*1c881b5aSTero Kristo static const struct omap_clkctrl_bit_data omap4_timer8_bit_data[] __initconst = { 183*1c881b5aSTero Kristo { 24, TI_CLK_MUX, omap4_timer5_sync_mux_parents, NULL }, 184*1c881b5aSTero Kristo { 0 }, 185*1c881b5aSTero Kristo }; 186*1c881b5aSTero Kristo 187*1c881b5aSTero Kristo static const struct omap_clkctrl_reg_data omap4_abe_clkctrl_regs[] __initconst = { 188*1c881b5aSTero Kristo { OMAP4_L4_ABE_CLKCTRL, NULL, 0, "ocp_abe_iclk" }, 189*1c881b5aSTero Kristo { OMAP4_AESS_CLKCTRL, omap4_aess_bit_data, CLKF_SW_SUP, "aess_fclk" }, 190*1c881b5aSTero Kristo { OMAP4_MCPDM_CLKCTRL, NULL, CLKF_SW_SUP, "pad_clks_ck" }, 191*1c881b5aSTero Kristo { OMAP4_DMIC_CLKCTRL, omap4_dmic_bit_data, CLKF_SW_SUP, "func_dmic_abe_gfclk" }, 192*1c881b5aSTero Kristo { OMAP4_MCASP_CLKCTRL, omap4_mcasp_bit_data, CLKF_SW_SUP, "func_mcasp_abe_gfclk" }, 193*1c881b5aSTero Kristo { OMAP4_MCBSP1_CLKCTRL, omap4_mcbsp1_bit_data, CLKF_SW_SUP, "func_mcbsp1_gfclk" }, 194*1c881b5aSTero Kristo { OMAP4_MCBSP2_CLKCTRL, omap4_mcbsp2_bit_data, CLKF_SW_SUP, "func_mcbsp2_gfclk" }, 195*1c881b5aSTero Kristo { OMAP4_MCBSP3_CLKCTRL, omap4_mcbsp3_bit_data, CLKF_SW_SUP, "func_mcbsp3_gfclk" }, 196*1c881b5aSTero Kristo { OMAP4_SLIMBUS1_CLKCTRL, omap4_slimbus1_bit_data, CLKF_SW_SUP, "slimbus1_fclk_0" }, 197*1c881b5aSTero Kristo { OMAP4_TIMER5_CLKCTRL, omap4_timer5_bit_data, CLKF_SW_SUP, "timer5_sync_mux" }, 198*1c881b5aSTero Kristo { OMAP4_TIMER6_CLKCTRL, omap4_timer6_bit_data, CLKF_SW_SUP, "timer6_sync_mux" }, 199*1c881b5aSTero Kristo { OMAP4_TIMER7_CLKCTRL, omap4_timer7_bit_data, CLKF_SW_SUP, "timer7_sync_mux" }, 200*1c881b5aSTero Kristo { OMAP4_TIMER8_CLKCTRL, omap4_timer8_bit_data, CLKF_SW_SUP, "timer8_sync_mux" }, 201*1c881b5aSTero Kristo { OMAP4_WD_TIMER3_CLKCTRL, NULL, CLKF_SW_SUP, "sys_32k_ck" }, 202*1c881b5aSTero Kristo { 0 }, 203*1c881b5aSTero Kristo }; 204*1c881b5aSTero Kristo 205*1c881b5aSTero Kristo static const struct omap_clkctrl_reg_data omap4_l4_ao_clkctrl_regs[] __initconst = { 206*1c881b5aSTero Kristo { OMAP4_SMARTREFLEX_MPU_CLKCTRL, NULL, CLKF_SW_SUP, "l4_wkup_clk_mux_ck" }, 207*1c881b5aSTero Kristo { OMAP4_SMARTREFLEX_IVA_CLKCTRL, NULL, CLKF_SW_SUP, "l4_wkup_clk_mux_ck" }, 208*1c881b5aSTero Kristo { OMAP4_SMARTREFLEX_CORE_CLKCTRL, NULL, CLKF_SW_SUP, "l4_wkup_clk_mux_ck" }, 209*1c881b5aSTero Kristo { 0 }, 210*1c881b5aSTero Kristo }; 211*1c881b5aSTero Kristo 212*1c881b5aSTero Kristo static const struct omap_clkctrl_reg_data omap4_l3_1_clkctrl_regs[] __initconst = { 213*1c881b5aSTero Kristo { OMAP4_L3_MAIN_1_CLKCTRL, NULL, 0, "l3_div_ck" }, 214*1c881b5aSTero Kristo { 0 }, 215*1c881b5aSTero Kristo }; 216*1c881b5aSTero Kristo 217*1c881b5aSTero Kristo static const struct omap_clkctrl_reg_data omap4_l3_2_clkctrl_regs[] __initconst = { 218*1c881b5aSTero Kristo { OMAP4_L3_MAIN_2_CLKCTRL, NULL, 0, "l3_div_ck" }, 219*1c881b5aSTero Kristo { OMAP4_GPMC_CLKCTRL, NULL, CLKF_HW_SUP, "l3_div_ck" }, 220*1c881b5aSTero Kristo { OMAP4_OCMC_RAM_CLKCTRL, NULL, 0, "l3_div_ck" }, 221*1c881b5aSTero Kristo { 0 }, 222*1c881b5aSTero Kristo }; 223*1c881b5aSTero Kristo 224*1c881b5aSTero Kristo static const struct omap_clkctrl_reg_data omap4_ducati_clkctrl_regs[] __initconst = { 225*1c881b5aSTero Kristo { OMAP4_IPU_CLKCTRL, NULL, CLKF_HW_SUP, "ducati_clk_mux_ck" }, 226*1c881b5aSTero Kristo { 0 }, 227*1c881b5aSTero Kristo }; 228*1c881b5aSTero Kristo 229*1c881b5aSTero Kristo static const struct omap_clkctrl_reg_data omap4_l3_dma_clkctrl_regs[] __initconst = { 230*1c881b5aSTero Kristo { OMAP4_DMA_SYSTEM_CLKCTRL, NULL, 0, "l3_div_ck" }, 231*1c881b5aSTero Kristo { 0 }, 232*1c881b5aSTero Kristo }; 233*1c881b5aSTero Kristo 234*1c881b5aSTero Kristo static const struct omap_clkctrl_reg_data omap4_l3_emif_clkctrl_regs[] __initconst = { 235*1c881b5aSTero Kristo { OMAP4_DMM_CLKCTRL, NULL, 0, "l3_div_ck" }, 236*1c881b5aSTero Kristo { OMAP4_EMIF1_CLKCTRL, NULL, CLKF_HW_SUP, "ddrphy_ck" }, 237*1c881b5aSTero Kristo { OMAP4_EMIF2_CLKCTRL, NULL, CLKF_HW_SUP, "ddrphy_ck" }, 238*1c881b5aSTero Kristo { 0 }, 239*1c881b5aSTero Kristo }; 240*1c881b5aSTero Kristo 241*1c881b5aSTero Kristo static const struct omap_clkctrl_reg_data omap4_d2d_clkctrl_regs[] __initconst = { 242*1c881b5aSTero Kristo { OMAP4_C2C_CLKCTRL, NULL, 0, "div_core_ck" }, 243*1c881b5aSTero Kristo { 0 }, 244*1c881b5aSTero Kristo }; 245*1c881b5aSTero Kristo 246*1c881b5aSTero Kristo static const struct omap_clkctrl_reg_data omap4_l4_cfg_clkctrl_regs[] __initconst = { 247*1c881b5aSTero Kristo { OMAP4_L4_CFG_CLKCTRL, NULL, 0, "l4_div_ck" }, 248*1c881b5aSTero Kristo { OMAP4_SPINLOCK_CLKCTRL, NULL, 0, "l4_div_ck" }, 249*1c881b5aSTero Kristo { OMAP4_MAILBOX_CLKCTRL, NULL, 0, "l4_div_ck" }, 250*1c881b5aSTero Kristo { 0 }, 251*1c881b5aSTero Kristo }; 252*1c881b5aSTero Kristo 253*1c881b5aSTero Kristo static const struct omap_clkctrl_reg_data omap4_l3_instr_clkctrl_regs[] __initconst = { 254*1c881b5aSTero Kristo { OMAP4_L3_MAIN_3_CLKCTRL, NULL, CLKF_HW_SUP, "l3_div_ck" }, 255*1c881b5aSTero Kristo { OMAP4_L3_INSTR_CLKCTRL, NULL, CLKF_HW_SUP, "l3_div_ck" }, 256*1c881b5aSTero Kristo { OMAP4_OCP_WP_NOC_CLKCTRL, NULL, CLKF_HW_SUP, "l3_div_ck" }, 257*1c881b5aSTero Kristo { 0 }, 258*1c881b5aSTero Kristo }; 259*1c881b5aSTero Kristo 260*1c881b5aSTero Kristo static const struct omap_clkctrl_reg_data omap4_ivahd_clkctrl_regs[] __initconst = { 261*1c881b5aSTero Kristo { OMAP4_IVA_CLKCTRL, NULL, CLKF_HW_SUP, "dpll_iva_m5x2_ck" }, 262*1c881b5aSTero Kristo { OMAP4_SL2IF_CLKCTRL, NULL, CLKF_HW_SUP, "dpll_iva_m5x2_ck" }, 263*1c881b5aSTero Kristo { 0 }, 264*1c881b5aSTero Kristo }; 265*1c881b5aSTero Kristo 266*1c881b5aSTero Kristo static const char * const omap4_iss_ctrlclk_parents[] __initconst = { 267*1c881b5aSTero Kristo "func_96m_fclk", 268*1c881b5aSTero Kristo NULL, 269*1c881b5aSTero Kristo }; 270*1c881b5aSTero Kristo 271*1c881b5aSTero Kristo static const struct omap_clkctrl_bit_data omap4_iss_bit_data[] __initconst = { 272*1c881b5aSTero Kristo { 8, TI_CLK_GATE, omap4_iss_ctrlclk_parents, NULL }, 273*1c881b5aSTero Kristo { 0 }, 274*1c881b5aSTero Kristo }; 275*1c881b5aSTero Kristo 276*1c881b5aSTero Kristo static const char * const omap4_fdif_fck_parents[] __initconst = { 277*1c881b5aSTero Kristo "dpll_per_m4x2_ck", 278*1c881b5aSTero Kristo NULL, 279*1c881b5aSTero Kristo }; 280*1c881b5aSTero Kristo 281*1c881b5aSTero Kristo static const struct omap_clkctrl_div_data omap4_fdif_fck_data __initconst = { 282*1c881b5aSTero Kristo .max_div = 4, 283*1c881b5aSTero Kristo }; 284*1c881b5aSTero Kristo 285*1c881b5aSTero Kristo static const struct omap_clkctrl_bit_data omap4_fdif_bit_data[] __initconst = { 286*1c881b5aSTero Kristo { 24, TI_CLK_DIVIDER, omap4_fdif_fck_parents, &omap4_fdif_fck_data }, 287*1c881b5aSTero Kristo { 0 }, 288*1c881b5aSTero Kristo }; 289*1c881b5aSTero Kristo 290*1c881b5aSTero Kristo static const struct omap_clkctrl_reg_data omap4_iss_clkctrl_regs[] __initconst = { 291*1c881b5aSTero Kristo { OMAP4_ISS_CLKCTRL, omap4_iss_bit_data, CLKF_SW_SUP, "ducati_clk_mux_ck" }, 292*1c881b5aSTero Kristo { OMAP4_FDIF_CLKCTRL, omap4_fdif_bit_data, CLKF_SW_SUP, "fdif_fck" }, 293*1c881b5aSTero Kristo { 0 }, 294*1c881b5aSTero Kristo }; 295*1c881b5aSTero Kristo 296*1c881b5aSTero Kristo static const char * const omap4_dss_dss_clk_parents[] __initconst = { 297*1c881b5aSTero Kristo "dpll_per_m5x2_ck", 298*1c881b5aSTero Kristo NULL, 299*1c881b5aSTero Kristo }; 300*1c881b5aSTero Kristo 301*1c881b5aSTero Kristo static const char * const omap4_dss_48mhz_clk_parents[] __initconst = { 302*1c881b5aSTero Kristo "func_48mc_fclk", 303*1c881b5aSTero Kristo NULL, 304*1c881b5aSTero Kristo }; 305*1c881b5aSTero Kristo 306*1c881b5aSTero Kristo static const char * const omap4_dss_sys_clk_parents[] __initconst = { 307*1c881b5aSTero Kristo "syc_clk_div_ck", 308*1c881b5aSTero Kristo NULL, 309*1c881b5aSTero Kristo }; 310*1c881b5aSTero Kristo 311*1c881b5aSTero Kristo static const char * const omap4_dss_tv_clk_parents[] __initconst = { 312*1c881b5aSTero Kristo "extalt_clkin_ck", 313*1c881b5aSTero Kristo NULL, 314*1c881b5aSTero Kristo }; 315*1c881b5aSTero Kristo 316*1c881b5aSTero Kristo static const struct omap_clkctrl_bit_data omap4_dss_core_bit_data[] __initconst = { 317*1c881b5aSTero Kristo { 8, TI_CLK_GATE, omap4_dss_dss_clk_parents, NULL }, 318*1c881b5aSTero Kristo { 9, TI_CLK_GATE, omap4_dss_48mhz_clk_parents, NULL }, 319*1c881b5aSTero Kristo { 10, TI_CLK_GATE, omap4_dss_sys_clk_parents, NULL }, 320*1c881b5aSTero Kristo { 11, TI_CLK_GATE, omap4_dss_tv_clk_parents, NULL }, 321*1c881b5aSTero Kristo { 0 }, 322*1c881b5aSTero Kristo }; 323*1c881b5aSTero Kristo 324*1c881b5aSTero Kristo static const struct omap_clkctrl_reg_data omap4_l3_dss_clkctrl_regs[] __initconst = { 325*1c881b5aSTero Kristo { OMAP4_DSS_CORE_CLKCTRL, omap4_dss_core_bit_data, CLKF_SW_SUP, "dss_dss_clk" }, 326*1c881b5aSTero Kristo { 0 }, 327*1c881b5aSTero Kristo }; 328*1c881b5aSTero Kristo 329*1c881b5aSTero Kristo static const char * const omap4_sgx_clk_mux_parents[] __initconst = { 330*1c881b5aSTero Kristo "dpll_core_m7x2_ck", 331*1c881b5aSTero Kristo "dpll_per_m7x2_ck", 332*1c881b5aSTero Kristo NULL, 333*1c881b5aSTero Kristo }; 334*1c881b5aSTero Kristo 335*1c881b5aSTero Kristo static const struct omap_clkctrl_bit_data omap4_gpu_bit_data[] __initconst = { 336*1c881b5aSTero Kristo { 24, TI_CLK_MUX, omap4_sgx_clk_mux_parents, NULL }, 337*1c881b5aSTero Kristo { 0 }, 338*1c881b5aSTero Kristo }; 339*1c881b5aSTero Kristo 340*1c881b5aSTero Kristo static const struct omap_clkctrl_reg_data omap4_l3_gfx_clkctrl_regs[] __initconst = { 341*1c881b5aSTero Kristo { OMAP4_GPU_CLKCTRL, omap4_gpu_bit_data, CLKF_SW_SUP, "sgx_clk_mux" }, 342*1c881b5aSTero Kristo { 0 }, 343*1c881b5aSTero Kristo }; 344*1c881b5aSTero Kristo 345*1c881b5aSTero Kristo static const char * const omap4_hsmmc1_fclk_parents[] __initconst = { 346*1c881b5aSTero Kristo "func_64m_fclk", 347*1c881b5aSTero Kristo "func_96m_fclk", 348*1c881b5aSTero Kristo NULL, 349*1c881b5aSTero Kristo }; 350*1c881b5aSTero Kristo 351*1c881b5aSTero Kristo static const struct omap_clkctrl_bit_data omap4_mmc1_bit_data[] __initconst = { 352*1c881b5aSTero Kristo { 24, TI_CLK_MUX, omap4_hsmmc1_fclk_parents, NULL }, 353*1c881b5aSTero Kristo { 0 }, 354*1c881b5aSTero Kristo }; 355*1c881b5aSTero Kristo 356*1c881b5aSTero Kristo static const struct omap_clkctrl_bit_data omap4_mmc2_bit_data[] __initconst = { 357*1c881b5aSTero Kristo { 24, TI_CLK_MUX, omap4_hsmmc1_fclk_parents, NULL }, 358*1c881b5aSTero Kristo { 0 }, 359*1c881b5aSTero Kristo }; 360*1c881b5aSTero Kristo 361*1c881b5aSTero Kristo static const char * const omap4_hsi_fck_parents[] __initconst = { 362*1c881b5aSTero Kristo "dpll_per_m2x2_ck", 363*1c881b5aSTero Kristo NULL, 364*1c881b5aSTero Kristo }; 365*1c881b5aSTero Kristo 366*1c881b5aSTero Kristo static const struct omap_clkctrl_div_data omap4_hsi_fck_data __initconst = { 367*1c881b5aSTero Kristo .max_div = 4, 368*1c881b5aSTero Kristo }; 369*1c881b5aSTero Kristo 370*1c881b5aSTero Kristo static const struct omap_clkctrl_bit_data omap4_hsi_bit_data[] __initconst = { 371*1c881b5aSTero Kristo { 24, TI_CLK_DIVIDER, omap4_hsi_fck_parents, &omap4_hsi_fck_data }, 372*1c881b5aSTero Kristo { 0 }, 373*1c881b5aSTero Kristo }; 374*1c881b5aSTero Kristo 375*1c881b5aSTero Kristo static const char * const omap4_usb_host_hs_utmi_p1_clk_parents[] __initconst = { 376*1c881b5aSTero Kristo "utmi_p1_gfclk", 377*1c881b5aSTero Kristo NULL, 378*1c881b5aSTero Kristo }; 379*1c881b5aSTero Kristo 380*1c881b5aSTero Kristo static const char * const omap4_usb_host_hs_utmi_p2_clk_parents[] __initconst = { 381*1c881b5aSTero Kristo "utmi_p2_gfclk", 382*1c881b5aSTero Kristo NULL, 383*1c881b5aSTero Kristo }; 384*1c881b5aSTero Kristo 385*1c881b5aSTero Kristo static const char * const omap4_usb_host_hs_utmi_p3_clk_parents[] __initconst = { 386*1c881b5aSTero Kristo "init_60m_fclk", 387*1c881b5aSTero Kristo NULL, 388*1c881b5aSTero Kristo }; 389*1c881b5aSTero Kristo 390*1c881b5aSTero Kristo static const char * const omap4_usb_host_hs_hsic480m_p1_clk_parents[] __initconst = { 391*1c881b5aSTero Kristo "dpll_usb_m2_ck", 392*1c881b5aSTero Kristo NULL, 393*1c881b5aSTero Kristo }; 394*1c881b5aSTero Kristo 395*1c881b5aSTero Kristo static const char * const omap4_utmi_p1_gfclk_parents[] __initconst = { 396*1c881b5aSTero Kristo "init_60m_fclk", 397*1c881b5aSTero Kristo "xclk60mhsp1_ck", 398*1c881b5aSTero Kristo NULL, 399*1c881b5aSTero Kristo }; 400*1c881b5aSTero Kristo 401*1c881b5aSTero Kristo static const char * const omap4_utmi_p2_gfclk_parents[] __initconst = { 402*1c881b5aSTero Kristo "init_60m_fclk", 403*1c881b5aSTero Kristo "xclk60mhsp2_ck", 404*1c881b5aSTero Kristo NULL, 405*1c881b5aSTero Kristo }; 406*1c881b5aSTero Kristo 407*1c881b5aSTero Kristo static const struct omap_clkctrl_bit_data omap4_usb_host_hs_bit_data[] __initconst = { 408*1c881b5aSTero Kristo { 8, TI_CLK_GATE, omap4_usb_host_hs_utmi_p1_clk_parents, NULL }, 409*1c881b5aSTero Kristo { 9, TI_CLK_GATE, omap4_usb_host_hs_utmi_p2_clk_parents, NULL }, 410*1c881b5aSTero Kristo { 10, TI_CLK_GATE, omap4_usb_host_hs_utmi_p3_clk_parents, NULL }, 411*1c881b5aSTero Kristo { 11, TI_CLK_GATE, omap4_usb_host_hs_utmi_p3_clk_parents, NULL }, 412*1c881b5aSTero Kristo { 12, TI_CLK_GATE, omap4_usb_host_hs_utmi_p3_clk_parents, NULL }, 413*1c881b5aSTero Kristo { 13, TI_CLK_GATE, omap4_usb_host_hs_hsic480m_p1_clk_parents, NULL }, 414*1c881b5aSTero Kristo { 14, TI_CLK_GATE, omap4_usb_host_hs_hsic480m_p1_clk_parents, NULL }, 415*1c881b5aSTero Kristo { 15, TI_CLK_GATE, omap4_dss_48mhz_clk_parents, NULL }, 416*1c881b5aSTero Kristo { 24, TI_CLK_MUX, omap4_utmi_p1_gfclk_parents, NULL }, 417*1c881b5aSTero Kristo { 25, TI_CLK_MUX, omap4_utmi_p2_gfclk_parents, NULL }, 418*1c881b5aSTero Kristo { 0 }, 419*1c881b5aSTero Kristo }; 420*1c881b5aSTero Kristo 421*1c881b5aSTero Kristo static const char * const omap4_usb_otg_hs_xclk_parents[] __initconst = { 422*1c881b5aSTero Kristo "otg_60m_gfclk", 423*1c881b5aSTero Kristo NULL, 424*1c881b5aSTero Kristo }; 425*1c881b5aSTero Kristo 426*1c881b5aSTero Kristo static const char * const omap4_otg_60m_gfclk_parents[] __initconst = { 427*1c881b5aSTero Kristo "utmi_phy_clkout_ck", 428*1c881b5aSTero Kristo "xclk60motg_ck", 429*1c881b5aSTero Kristo NULL, 430*1c881b5aSTero Kristo }; 431*1c881b5aSTero Kristo 432*1c881b5aSTero Kristo static const struct omap_clkctrl_bit_data omap4_usb_otg_hs_bit_data[] __initconst = { 433*1c881b5aSTero Kristo { 8, TI_CLK_GATE, omap4_usb_otg_hs_xclk_parents, NULL }, 434*1c881b5aSTero Kristo { 24, TI_CLK_MUX, omap4_otg_60m_gfclk_parents, NULL }, 435*1c881b5aSTero Kristo { 0 }, 436*1c881b5aSTero Kristo }; 437*1c881b5aSTero Kristo 438*1c881b5aSTero Kristo static const struct omap_clkctrl_bit_data omap4_usb_tll_hs_bit_data[] __initconst = { 439*1c881b5aSTero Kristo { 8, TI_CLK_GATE, omap4_usb_host_hs_utmi_p3_clk_parents, NULL }, 440*1c881b5aSTero Kristo { 9, TI_CLK_GATE, omap4_usb_host_hs_utmi_p3_clk_parents, NULL }, 441*1c881b5aSTero Kristo { 10, TI_CLK_GATE, omap4_usb_host_hs_utmi_p3_clk_parents, NULL }, 442*1c881b5aSTero Kristo { 0 }, 443*1c881b5aSTero Kristo }; 444*1c881b5aSTero Kristo 445*1c881b5aSTero Kristo static const char * const omap4_ocp2scp_usb_phy_phy_48m_parents[] __initconst = { 446*1c881b5aSTero Kristo "func_48m_fclk", 447*1c881b5aSTero Kristo NULL, 448*1c881b5aSTero Kristo }; 449*1c881b5aSTero Kristo 450*1c881b5aSTero Kristo static const struct omap_clkctrl_bit_data omap4_ocp2scp_usb_phy_bit_data[] __initconst = { 451*1c881b5aSTero Kristo { 8, TI_CLK_GATE, omap4_ocp2scp_usb_phy_phy_48m_parents, NULL }, 452*1c881b5aSTero Kristo { 0 }, 453*1c881b5aSTero Kristo }; 454*1c881b5aSTero Kristo 455*1c881b5aSTero Kristo static const struct omap_clkctrl_reg_data omap4_l3_init_clkctrl_regs[] __initconst = { 456*1c881b5aSTero Kristo { OMAP4_MMC1_CLKCTRL, omap4_mmc1_bit_data, CLKF_SW_SUP, "hsmmc1_fclk" }, 457*1c881b5aSTero Kristo { OMAP4_MMC2_CLKCTRL, omap4_mmc2_bit_data, CLKF_SW_SUP, "hsmmc2_fclk" }, 458*1c881b5aSTero Kristo { OMAP4_HSI_CLKCTRL, omap4_hsi_bit_data, CLKF_HW_SUP, "hsi_fck" }, 459*1c881b5aSTero Kristo { OMAP4_USB_HOST_HS_CLKCTRL, omap4_usb_host_hs_bit_data, CLKF_SW_SUP, "init_60m_fclk" }, 460*1c881b5aSTero Kristo { OMAP4_USB_OTG_HS_CLKCTRL, omap4_usb_otg_hs_bit_data, CLKF_HW_SUP, "l3_div_ck" }, 461*1c881b5aSTero Kristo { OMAP4_USB_TLL_HS_CLKCTRL, omap4_usb_tll_hs_bit_data, CLKF_HW_SUP, "l4_div_ck" }, 462*1c881b5aSTero Kristo { OMAP4_USB_HOST_FS_CLKCTRL, NULL, CLKF_SW_SUP, "func_48mc_fclk" }, 463*1c881b5aSTero Kristo { OMAP4_OCP2SCP_USB_PHY_CLKCTRL, omap4_ocp2scp_usb_phy_bit_data, CLKF_HW_SUP, "ocp2scp_usb_phy_phy_48m" }, 464*1c881b5aSTero Kristo { 0 }, 465*1c881b5aSTero Kristo }; 466*1c881b5aSTero Kristo 467*1c881b5aSTero Kristo static const char * const omap4_cm2_dm10_mux_parents[] __initconst = { 468*1c881b5aSTero Kristo "sys_clkin_ck", 469*1c881b5aSTero Kristo "sys_32k_ck", 470*1c881b5aSTero Kristo NULL, 471*1c881b5aSTero Kristo }; 472*1c881b5aSTero Kristo 473*1c881b5aSTero Kristo static const struct omap_clkctrl_bit_data omap4_timer10_bit_data[] __initconst = { 474*1c881b5aSTero Kristo { 24, TI_CLK_MUX, omap4_cm2_dm10_mux_parents, NULL }, 475*1c881b5aSTero Kristo { 0 }, 476*1c881b5aSTero Kristo }; 477*1c881b5aSTero Kristo 478*1c881b5aSTero Kristo static const struct omap_clkctrl_bit_data omap4_timer11_bit_data[] __initconst = { 479*1c881b5aSTero Kristo { 24, TI_CLK_MUX, omap4_cm2_dm10_mux_parents, NULL }, 480*1c881b5aSTero Kristo { 0 }, 481*1c881b5aSTero Kristo }; 482*1c881b5aSTero Kristo 483*1c881b5aSTero Kristo static const struct omap_clkctrl_bit_data omap4_timer2_bit_data[] __initconst = { 484*1c881b5aSTero Kristo { 24, TI_CLK_MUX, omap4_cm2_dm10_mux_parents, NULL }, 485*1c881b5aSTero Kristo { 0 }, 486*1c881b5aSTero Kristo }; 487*1c881b5aSTero Kristo 488*1c881b5aSTero Kristo static const struct omap_clkctrl_bit_data omap4_timer3_bit_data[] __initconst = { 489*1c881b5aSTero Kristo { 24, TI_CLK_MUX, omap4_cm2_dm10_mux_parents, NULL }, 490*1c881b5aSTero Kristo { 0 }, 491*1c881b5aSTero Kristo }; 492*1c881b5aSTero Kristo 493*1c881b5aSTero Kristo static const struct omap_clkctrl_bit_data omap4_timer4_bit_data[] __initconst = { 494*1c881b5aSTero Kristo { 24, TI_CLK_MUX, omap4_cm2_dm10_mux_parents, NULL }, 495*1c881b5aSTero Kristo { 0 }, 496*1c881b5aSTero Kristo }; 497*1c881b5aSTero Kristo 498*1c881b5aSTero Kristo static const struct omap_clkctrl_bit_data omap4_timer9_bit_data[] __initconst = { 499*1c881b5aSTero Kristo { 24, TI_CLK_MUX, omap4_cm2_dm10_mux_parents, NULL }, 500*1c881b5aSTero Kristo { 0 }, 501*1c881b5aSTero Kristo }; 502*1c881b5aSTero Kristo 503*1c881b5aSTero Kristo static const char * const omap4_gpio2_dbclk_parents[] __initconst = { 504*1c881b5aSTero Kristo "sys_32k_ck", 505*1c881b5aSTero Kristo NULL, 506*1c881b5aSTero Kristo }; 507*1c881b5aSTero Kristo 508*1c881b5aSTero Kristo static const struct omap_clkctrl_bit_data omap4_gpio2_bit_data[] __initconst = { 509*1c881b5aSTero Kristo { 8, TI_CLK_GATE, omap4_gpio2_dbclk_parents, NULL }, 510*1c881b5aSTero Kristo { 0 }, 511*1c881b5aSTero Kristo }; 512*1c881b5aSTero Kristo 513*1c881b5aSTero Kristo static const struct omap_clkctrl_bit_data omap4_gpio3_bit_data[] __initconst = { 514*1c881b5aSTero Kristo { 8, TI_CLK_GATE, omap4_gpio2_dbclk_parents, NULL }, 515*1c881b5aSTero Kristo { 0 }, 516*1c881b5aSTero Kristo }; 517*1c881b5aSTero Kristo 518*1c881b5aSTero Kristo static const struct omap_clkctrl_bit_data omap4_gpio4_bit_data[] __initconst = { 519*1c881b5aSTero Kristo { 8, TI_CLK_GATE, omap4_gpio2_dbclk_parents, NULL }, 520*1c881b5aSTero Kristo { 0 }, 521*1c881b5aSTero Kristo }; 522*1c881b5aSTero Kristo 523*1c881b5aSTero Kristo static const struct omap_clkctrl_bit_data omap4_gpio5_bit_data[] __initconst = { 524*1c881b5aSTero Kristo { 8, TI_CLK_GATE, omap4_gpio2_dbclk_parents, NULL }, 525*1c881b5aSTero Kristo { 0 }, 526*1c881b5aSTero Kristo }; 527*1c881b5aSTero Kristo 528*1c881b5aSTero Kristo static const struct omap_clkctrl_bit_data omap4_gpio6_bit_data[] __initconst = { 529*1c881b5aSTero Kristo { 8, TI_CLK_GATE, omap4_gpio2_dbclk_parents, NULL }, 530*1c881b5aSTero Kristo { 0 }, 531*1c881b5aSTero Kristo }; 532*1c881b5aSTero Kristo 533*1c881b5aSTero Kristo static const char * const omap4_per_mcbsp4_gfclk_parents[] __initconst = { 534*1c881b5aSTero Kristo "mcbsp4_sync_mux_ck", 535*1c881b5aSTero Kristo "pad_clks_ck", 536*1c881b5aSTero Kristo NULL, 537*1c881b5aSTero Kristo }; 538*1c881b5aSTero Kristo 539*1c881b5aSTero Kristo static const char * const omap4_mcbsp4_sync_mux_ck_parents[] __initconst = { 540*1c881b5aSTero Kristo "func_96m_fclk", 541*1c881b5aSTero Kristo "per_abe_nc_fclk", 542*1c881b5aSTero Kristo NULL, 543*1c881b5aSTero Kristo }; 544*1c881b5aSTero Kristo 545*1c881b5aSTero Kristo static const struct omap_clkctrl_bit_data omap4_mcbsp4_bit_data[] __initconst = { 546*1c881b5aSTero Kristo { 24, TI_CLK_MUX, omap4_per_mcbsp4_gfclk_parents, NULL }, 547*1c881b5aSTero Kristo { 25, TI_CLK_MUX, omap4_mcbsp4_sync_mux_ck_parents, NULL }, 548*1c881b5aSTero Kristo { 0 }, 549*1c881b5aSTero Kristo }; 550*1c881b5aSTero Kristo 551*1c881b5aSTero Kristo static const char * const omap4_slimbus2_fclk_0_parents[] __initconst = { 552*1c881b5aSTero Kristo "func_24mc_fclk", 553*1c881b5aSTero Kristo NULL, 554*1c881b5aSTero Kristo }; 555*1c881b5aSTero Kristo 556*1c881b5aSTero Kristo static const char * const omap4_slimbus2_fclk_1_parents[] __initconst = { 557*1c881b5aSTero Kristo "per_abe_24m_fclk", 558*1c881b5aSTero Kristo NULL, 559*1c881b5aSTero Kristo }; 560*1c881b5aSTero Kristo 561*1c881b5aSTero Kristo static const char * const omap4_slimbus2_slimbus_clk_parents[] __initconst = { 562*1c881b5aSTero Kristo "pad_slimbus_core_clks_ck", 563*1c881b5aSTero Kristo NULL, 564*1c881b5aSTero Kristo }; 565*1c881b5aSTero Kristo 566*1c881b5aSTero Kristo static const struct omap_clkctrl_bit_data omap4_slimbus2_bit_data[] __initconst = { 567*1c881b5aSTero Kristo { 8, TI_CLK_GATE, omap4_slimbus2_fclk_0_parents, NULL }, 568*1c881b5aSTero Kristo { 9, TI_CLK_GATE, omap4_slimbus2_fclk_1_parents, NULL }, 569*1c881b5aSTero Kristo { 10, TI_CLK_GATE, omap4_slimbus2_slimbus_clk_parents, NULL }, 570*1c881b5aSTero Kristo { 0 }, 571*1c881b5aSTero Kristo }; 572*1c881b5aSTero Kristo 573*1c881b5aSTero Kristo static const struct omap_clkctrl_reg_data omap4_l4_per_clkctrl_regs[] __initconst = { 574*1c881b5aSTero Kristo { OMAP4_TIMER10_CLKCTRL, omap4_timer10_bit_data, CLKF_SW_SUP, "cm2_dm10_mux" }, 575*1c881b5aSTero Kristo { OMAP4_TIMER11_CLKCTRL, omap4_timer11_bit_data, CLKF_SW_SUP, "cm2_dm11_mux" }, 576*1c881b5aSTero Kristo { OMAP4_TIMER2_CLKCTRL, omap4_timer2_bit_data, CLKF_SW_SUP, "cm2_dm2_mux" }, 577*1c881b5aSTero Kristo { OMAP4_TIMER3_CLKCTRL, omap4_timer3_bit_data, CLKF_SW_SUP, "cm2_dm3_mux" }, 578*1c881b5aSTero Kristo { OMAP4_TIMER4_CLKCTRL, omap4_timer4_bit_data, CLKF_SW_SUP, "cm2_dm4_mux" }, 579*1c881b5aSTero Kristo { OMAP4_TIMER9_CLKCTRL, omap4_timer9_bit_data, CLKF_SW_SUP, "cm2_dm9_mux" }, 580*1c881b5aSTero Kristo { OMAP4_ELM_CLKCTRL, NULL, 0, "l4_div_ck" }, 581*1c881b5aSTero Kristo { OMAP4_GPIO2_CLKCTRL, omap4_gpio2_bit_data, CLKF_HW_SUP, "l4_div_ck" }, 582*1c881b5aSTero Kristo { OMAP4_GPIO3_CLKCTRL, omap4_gpio3_bit_data, CLKF_HW_SUP, "l4_div_ck" }, 583*1c881b5aSTero Kristo { OMAP4_GPIO4_CLKCTRL, omap4_gpio4_bit_data, CLKF_HW_SUP, "l4_div_ck" }, 584*1c881b5aSTero Kristo { OMAP4_GPIO5_CLKCTRL, omap4_gpio5_bit_data, CLKF_HW_SUP, "l4_div_ck" }, 585*1c881b5aSTero Kristo { OMAP4_GPIO6_CLKCTRL, omap4_gpio6_bit_data, CLKF_HW_SUP, "l4_div_ck" }, 586*1c881b5aSTero Kristo { OMAP4_HDQ1W_CLKCTRL, NULL, CLKF_SW_SUP, "func_12m_fclk" }, 587*1c881b5aSTero Kristo { OMAP4_I2C1_CLKCTRL, NULL, CLKF_SW_SUP, "func_96m_fclk" }, 588*1c881b5aSTero Kristo { OMAP4_I2C2_CLKCTRL, NULL, CLKF_SW_SUP, "func_96m_fclk" }, 589*1c881b5aSTero Kristo { OMAP4_I2C3_CLKCTRL, NULL, CLKF_SW_SUP, "func_96m_fclk" }, 590*1c881b5aSTero Kristo { OMAP4_I2C4_CLKCTRL, NULL, CLKF_SW_SUP, "func_96m_fclk" }, 591*1c881b5aSTero Kristo { OMAP4_L4_PER_CLKCTRL, NULL, 0, "l4_div_ck" }, 592*1c881b5aSTero Kristo { OMAP4_MCBSP4_CLKCTRL, omap4_mcbsp4_bit_data, CLKF_SW_SUP, "per_mcbsp4_gfclk" }, 593*1c881b5aSTero Kristo { OMAP4_MCSPI1_CLKCTRL, NULL, CLKF_SW_SUP, "func_48m_fclk" }, 594*1c881b5aSTero Kristo { OMAP4_MCSPI2_CLKCTRL, NULL, CLKF_SW_SUP, "func_48m_fclk" }, 595*1c881b5aSTero Kristo { OMAP4_MCSPI3_CLKCTRL, NULL, CLKF_SW_SUP, "func_48m_fclk" }, 596*1c881b5aSTero Kristo { OMAP4_MCSPI4_CLKCTRL, NULL, CLKF_SW_SUP, "func_48m_fclk" }, 597*1c881b5aSTero Kristo { OMAP4_MMC3_CLKCTRL, NULL, CLKF_SW_SUP, "func_48m_fclk" }, 598*1c881b5aSTero Kristo { OMAP4_MMC4_CLKCTRL, NULL, CLKF_SW_SUP, "func_48m_fclk" }, 599*1c881b5aSTero Kristo { OMAP4_SLIMBUS2_CLKCTRL, omap4_slimbus2_bit_data, CLKF_SW_SUP, "slimbus2_fclk_0" }, 600*1c881b5aSTero Kristo { OMAP4_UART1_CLKCTRL, NULL, CLKF_SW_SUP, "func_48m_fclk" }, 601*1c881b5aSTero Kristo { OMAP4_UART2_CLKCTRL, NULL, CLKF_SW_SUP, "func_48m_fclk" }, 602*1c881b5aSTero Kristo { OMAP4_UART3_CLKCTRL, NULL, CLKF_SW_SUP, "func_48m_fclk" }, 603*1c881b5aSTero Kristo { OMAP4_UART4_CLKCTRL, NULL, CLKF_SW_SUP, "func_48m_fclk" }, 604*1c881b5aSTero Kristo { OMAP4_MMC5_CLKCTRL, NULL, CLKF_SW_SUP, "func_48m_fclk" }, 605*1c881b5aSTero Kristo { 0 }, 606*1c881b5aSTero Kristo }; 607*1c881b5aSTero Kristo 608*1c881b5aSTero Kristo static const struct omap_clkctrl_bit_data omap4_gpio1_bit_data[] __initconst = { 609*1c881b5aSTero Kristo { 8, TI_CLK_GATE, omap4_gpio2_dbclk_parents, NULL }, 610*1c881b5aSTero Kristo { 0 }, 611*1c881b5aSTero Kristo }; 612*1c881b5aSTero Kristo 613*1c881b5aSTero Kristo static const struct omap_clkctrl_bit_data omap4_timer1_bit_data[] __initconst = { 614*1c881b5aSTero Kristo { 24, TI_CLK_MUX, omap4_cm2_dm10_mux_parents, NULL }, 615*1c881b5aSTero Kristo { 0 }, 616*1c881b5aSTero Kristo }; 617*1c881b5aSTero Kristo 618*1c881b5aSTero Kristo static const struct omap_clkctrl_reg_data omap4_l4_wkup_clkctrl_regs[] __initconst = { 619*1c881b5aSTero Kristo { OMAP4_L4_WKUP_CLKCTRL, NULL, 0, "l4_wkup_clk_mux_ck" }, 620*1c881b5aSTero Kristo { OMAP4_WD_TIMER2_CLKCTRL, NULL, CLKF_SW_SUP, "sys_32k_ck" }, 621*1c881b5aSTero Kristo { OMAP4_GPIO1_CLKCTRL, omap4_gpio1_bit_data, CLKF_HW_SUP, "l4_wkup_clk_mux_ck" }, 622*1c881b5aSTero Kristo { OMAP4_TIMER1_CLKCTRL, omap4_timer1_bit_data, CLKF_SW_SUP, "dmt1_clk_mux" }, 623*1c881b5aSTero Kristo { OMAP4_COUNTER_32K_CLKCTRL, NULL, 0, "sys_32k_ck" }, 624*1c881b5aSTero Kristo { OMAP4_KBD_CLKCTRL, NULL, CLKF_SW_SUP, "sys_32k_ck" }, 625*1c881b5aSTero Kristo { 0 }, 626*1c881b5aSTero Kristo }; 627*1c881b5aSTero Kristo 628*1c881b5aSTero Kristo static const char * const omap4_pmd_stm_clock_mux_ck_parents[] __initconst = { 629*1c881b5aSTero Kristo "sys_clkin_ck", 630*1c881b5aSTero Kristo "dpll_core_m6x2_ck", 631*1c881b5aSTero Kristo "tie_low_clock_ck", 632*1c881b5aSTero Kristo NULL, 633*1c881b5aSTero Kristo }; 634*1c881b5aSTero Kristo 635*1c881b5aSTero Kristo static const char * const omap4_trace_clk_div_div_ck_parents[] __initconst = { 636*1c881b5aSTero Kristo "pmd_trace_clk_mux_ck", 637*1c881b5aSTero Kristo NULL, 638*1c881b5aSTero Kristo }; 639*1c881b5aSTero Kristo 640*1c881b5aSTero Kristo static const int omap4_trace_clk_div_div_ck_divs[] __initconst = { 641*1c881b5aSTero Kristo 0, 642*1c881b5aSTero Kristo 1, 643*1c881b5aSTero Kristo 2, 644*1c881b5aSTero Kristo 0, 645*1c881b5aSTero Kristo 4, 646*1c881b5aSTero Kristo -1, 647*1c881b5aSTero Kristo }; 648*1c881b5aSTero Kristo 649*1c881b5aSTero Kristo static const struct omap_clkctrl_div_data omap4_trace_clk_div_div_ck_data __initconst = { 650*1c881b5aSTero Kristo .dividers = omap4_trace_clk_div_div_ck_divs, 651*1c881b5aSTero Kristo }; 652*1c881b5aSTero Kristo 653*1c881b5aSTero Kristo static const char * const omap4_stm_clk_div_ck_parents[] __initconst = { 654*1c881b5aSTero Kristo "pmd_stm_clock_mux_ck", 655*1c881b5aSTero Kristo NULL, 656*1c881b5aSTero Kristo }; 657*1c881b5aSTero Kristo 658*1c881b5aSTero Kristo static const struct omap_clkctrl_div_data omap4_stm_clk_div_ck_data __initconst = { 659*1c881b5aSTero Kristo .max_div = 64, 660*1c881b5aSTero Kristo }; 661*1c881b5aSTero Kristo 662*1c881b5aSTero Kristo static const struct omap_clkctrl_bit_data omap4_debugss_bit_data[] __initconst = { 663*1c881b5aSTero Kristo { 20, TI_CLK_MUX, omap4_pmd_stm_clock_mux_ck_parents, NULL }, 664*1c881b5aSTero Kristo { 22, TI_CLK_MUX, omap4_pmd_stm_clock_mux_ck_parents, NULL }, 665*1c881b5aSTero Kristo { 24, TI_CLK_DIVIDER, omap4_trace_clk_div_div_ck_parents, &omap4_trace_clk_div_div_ck_data }, 666*1c881b5aSTero Kristo { 27, TI_CLK_DIVIDER, omap4_stm_clk_div_ck_parents, &omap4_stm_clk_div_ck_data }, 667*1c881b5aSTero Kristo { 0 }, 668*1c881b5aSTero Kristo }; 669*1c881b5aSTero Kristo 670*1c881b5aSTero Kristo static const struct omap_clkctrl_reg_data omap4_emu_sys_clkctrl_regs[] __initconst = { 671*1c881b5aSTero Kristo { OMAP4_DEBUGSS_CLKCTRL, omap4_debugss_bit_data, 0, "trace_clk_div_ck" }, 672*1c881b5aSTero Kristo { 0 }, 673*1c881b5aSTero Kristo }; 674*1c881b5aSTero Kristo 675*1c881b5aSTero Kristo const struct omap_clkctrl_data omap4_clkctrl_data[] __initconst = { 676*1c881b5aSTero Kristo { 0x4a004320, omap4_mpuss_clkctrl_regs }, 677*1c881b5aSTero Kristo { 0x4a004420, omap4_tesla_clkctrl_regs }, 678*1c881b5aSTero Kristo { 0x4a004520, omap4_abe_clkctrl_regs }, 679*1c881b5aSTero Kristo { 0x4a008620, omap4_l4_ao_clkctrl_regs }, 680*1c881b5aSTero Kristo { 0x4a008720, omap4_l3_1_clkctrl_regs }, 681*1c881b5aSTero Kristo { 0x4a008820, omap4_l3_2_clkctrl_regs }, 682*1c881b5aSTero Kristo { 0x4a008920, omap4_ducati_clkctrl_regs }, 683*1c881b5aSTero Kristo { 0x4a008a20, omap4_l3_dma_clkctrl_regs }, 684*1c881b5aSTero Kristo { 0x4a008b20, omap4_l3_emif_clkctrl_regs }, 685*1c881b5aSTero Kristo { 0x4a008c20, omap4_d2d_clkctrl_regs }, 686*1c881b5aSTero Kristo { 0x4a008d20, omap4_l4_cfg_clkctrl_regs }, 687*1c881b5aSTero Kristo { 0x4a008e20, omap4_l3_instr_clkctrl_regs }, 688*1c881b5aSTero Kristo { 0x4a008f20, omap4_ivahd_clkctrl_regs }, 689*1c881b5aSTero Kristo { 0x4a009020, omap4_iss_clkctrl_regs }, 690*1c881b5aSTero Kristo { 0x4a009120, omap4_l3_dss_clkctrl_regs }, 691*1c881b5aSTero Kristo { 0x4a009220, omap4_l3_gfx_clkctrl_regs }, 692*1c881b5aSTero Kristo { 0x4a009320, omap4_l3_init_clkctrl_regs }, 693*1c881b5aSTero Kristo { 0x4a009420, omap4_l4_per_clkctrl_regs }, 694*1c881b5aSTero Kristo { 0x4a307820, omap4_l4_wkup_clkctrl_regs }, 695*1c881b5aSTero Kristo { 0x4a307a20, omap4_emu_sys_clkctrl_regs }, 696*1c881b5aSTero Kristo { 0 }, 697*1c881b5aSTero Kristo }; 698*1c881b5aSTero Kristo 69921876ea5STero Kristo static struct ti_dt_clk omap44xx_clks[] = { 70021876ea5STero Kristo DT_CLK("smp_twd", NULL, "mpu_periphclk"), 70121876ea5STero Kristo DT_CLK("omapdss_dss", "ick", "dss_fck"), 70221876ea5STero Kristo DT_CLK("usbhs_omap", "fs_fck", "usb_host_fs_fck"), 70321876ea5STero Kristo DT_CLK("usbhs_omap", "hs_fck", "usb_host_hs_fck"), 70421876ea5STero Kristo DT_CLK("musb-omap2430", "ick", "usb_otg_hs_ick"), 70521876ea5STero Kristo DT_CLK("usbhs_omap", "usbtll_ick", "usb_tll_hs_ick"), 70621876ea5STero Kristo DT_CLK("usbhs_tll", "usbtll_ick", "usb_tll_hs_ick"), 70721876ea5STero Kristo DT_CLK("omap_i2c.1", "ick", "dummy_ck"), 70821876ea5STero Kristo DT_CLK("omap_i2c.2", "ick", "dummy_ck"), 70921876ea5STero Kristo DT_CLK("omap_i2c.3", "ick", "dummy_ck"), 71021876ea5STero Kristo DT_CLK("omap_i2c.4", "ick", "dummy_ck"), 71121876ea5STero Kristo DT_CLK(NULL, "mailboxes_ick", "dummy_ck"), 71221876ea5STero Kristo DT_CLK("omap_hsmmc.0", "ick", "dummy_ck"), 71321876ea5STero Kristo DT_CLK("omap_hsmmc.1", "ick", "dummy_ck"), 71421876ea5STero Kristo DT_CLK("omap_hsmmc.2", "ick", "dummy_ck"), 71521876ea5STero Kristo DT_CLK("omap_hsmmc.3", "ick", "dummy_ck"), 71621876ea5STero Kristo DT_CLK("omap_hsmmc.4", "ick", "dummy_ck"), 71721876ea5STero Kristo DT_CLK("omap-mcbsp.1", "ick", "dummy_ck"), 71821876ea5STero Kristo DT_CLK("omap-mcbsp.2", "ick", "dummy_ck"), 71921876ea5STero Kristo DT_CLK("omap-mcbsp.3", "ick", "dummy_ck"), 72021876ea5STero Kristo DT_CLK("omap-mcbsp.4", "ick", "dummy_ck"), 72121876ea5STero Kristo DT_CLK("omap2_mcspi.1", "ick", "dummy_ck"), 72221876ea5STero Kristo DT_CLK("omap2_mcspi.2", "ick", "dummy_ck"), 72321876ea5STero Kristo DT_CLK("omap2_mcspi.3", "ick", "dummy_ck"), 72421876ea5STero Kristo DT_CLK("omap2_mcspi.4", "ick", "dummy_ck"), 72521876ea5STero Kristo DT_CLK(NULL, "uart1_ick", "dummy_ck"), 72621876ea5STero Kristo DT_CLK(NULL, "uart2_ick", "dummy_ck"), 72721876ea5STero Kristo DT_CLK(NULL, "uart3_ick", "dummy_ck"), 72821876ea5STero Kristo DT_CLK(NULL, "uart4_ick", "dummy_ck"), 72921876ea5STero Kristo DT_CLK("usbhs_omap", "usbhost_ick", "dummy_ck"), 73021876ea5STero Kristo DT_CLK("usbhs_omap", "usbtll_fck", "dummy_ck"), 73121876ea5STero Kristo DT_CLK("usbhs_tll", "usbtll_fck", "dummy_ck"), 73221876ea5STero Kristo DT_CLK("omap_wdt", "ick", "dummy_ck"), 73321876ea5STero Kristo DT_CLK(NULL, "timer_32k_ck", "sys_32k_ck"), 73421876ea5STero Kristo DT_CLK("4a318000.timer", "timer_sys_ck", "sys_clkin_ck"), 73521876ea5STero Kristo DT_CLK("48032000.timer", "timer_sys_ck", "sys_clkin_ck"), 73621876ea5STero Kristo DT_CLK("48034000.timer", "timer_sys_ck", "sys_clkin_ck"), 73721876ea5STero Kristo DT_CLK("48036000.timer", "timer_sys_ck", "sys_clkin_ck"), 73821876ea5STero Kristo DT_CLK("4803e000.timer", "timer_sys_ck", "sys_clkin_ck"), 73921876ea5STero Kristo DT_CLK("48086000.timer", "timer_sys_ck", "sys_clkin_ck"), 74021876ea5STero Kristo DT_CLK("48088000.timer", "timer_sys_ck", "sys_clkin_ck"), 74121876ea5STero Kristo DT_CLK("40138000.timer", "timer_sys_ck", "syc_clk_div_ck"), 74221876ea5STero Kristo DT_CLK("4013a000.timer", "timer_sys_ck", "syc_clk_div_ck"), 74321876ea5STero Kristo DT_CLK("4013c000.timer", "timer_sys_ck", "syc_clk_div_ck"), 74421876ea5STero Kristo DT_CLK("4013e000.timer", "timer_sys_ck", "syc_clk_div_ck"), 74521876ea5STero Kristo DT_CLK(NULL, "cpufreq_ck", "dpll_mpu_ck"), 74621876ea5STero Kristo { .node_name = NULL }, 74721876ea5STero Kristo }; 74821876ea5STero Kristo 74921876ea5STero Kristo int __init omap4xxx_dt_clk_init(void) 75021876ea5STero Kristo { 75121876ea5STero Kristo int rc; 75221876ea5STero Kristo struct clk *abe_dpll_ref, *abe_dpll, *sys_32k_ck, *usb_dpll; 75321876ea5STero Kristo 75421876ea5STero Kristo ti_dt_clocks_register(omap44xx_clks); 75521876ea5STero Kristo 75621876ea5STero Kristo omap2_clk_disable_autoidle_all(); 75721876ea5STero Kristo 758b6312da5STero Kristo ti_clk_add_aliases(); 759b6312da5STero Kristo 76021876ea5STero Kristo /* 76121876ea5STero Kristo * Lock USB DPLL on OMAP4 devices so that the L3INIT power 76221876ea5STero Kristo * domain can transition to retention state when not in use. 76321876ea5STero Kristo */ 76421876ea5STero Kristo usb_dpll = clk_get_sys(NULL, "dpll_usb_ck"); 76521876ea5STero Kristo rc = clk_set_rate(usb_dpll, OMAP4_DPLL_USB_DEFFREQ); 76621876ea5STero Kristo if (rc) 76721876ea5STero Kristo pr_err("%s: failed to configure USB DPLL!\n", __func__); 76821876ea5STero Kristo 76921876ea5STero Kristo /* 77021876ea5STero Kristo * On OMAP4460 the ABE DPLL fails to turn on if in idle low-power 77121876ea5STero Kristo * state when turning the ABE clock domain. Workaround this by 77221876ea5STero Kristo * locking the ABE DPLL on boot. 77321876ea5STero Kristo * Lock the ABE DPLL in any case to avoid issues with audio. 77421876ea5STero Kristo */ 77521876ea5STero Kristo abe_dpll_ref = clk_get_sys(NULL, "abe_dpll_refclk_mux_ck"); 77621876ea5STero Kristo sys_32k_ck = clk_get_sys(NULL, "sys_32k_ck"); 77721876ea5STero Kristo rc = clk_set_parent(abe_dpll_ref, sys_32k_ck); 77821876ea5STero Kristo abe_dpll = clk_get_sys(NULL, "dpll_abe_ck"); 77921876ea5STero Kristo if (!rc) 78021876ea5STero Kristo rc = clk_set_rate(abe_dpll, OMAP4_DPLL_ABE_DEFFREQ); 78121876ea5STero Kristo if (rc) 78221876ea5STero Kristo pr_err("%s: failed to configure ABE DPLL!\n", __func__); 78321876ea5STero Kristo 78421876ea5STero Kristo return 0; 78521876ea5STero Kristo } 786