/* * OMAP2430 clock data * * Copyright (C) 2005-2009, 2012 Texas Instruments, Inc. * Copyright (C) 2004-2011 Nokia Corporation * * Contacts: * Richard Woodruff * Paul Walmsley * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ #include #include #include #include #include "soc.h" #include "iomap.h" #include "clock.h" #include "clock2xxx.h" #include "opp2xxx.h" #include "cm2xxx.h" #include "prm2xxx.h" #include "prm-regbits-24xx.h" #include "cm-regbits-24xx.h" #include "sdrc.h" #include "control.h" #define OMAP_CM_REGADDR OMAP2430_CM_REGADDR /* * 2430 clock tree. * * NOTE:In many cases here we are assigning a 'default' parent. In * many cases the parent is selectable. The set parent calls will * also switch sources. * * Several sources are given initial rates which may be wrong, this will * be fixed up in the init func. * * Things are broadly separated below by clock domains. It is * noteworthy that most peripherals have dependencies on multiple clock * domains. Many get their interface clocks from the L4 domain, but get * functional clocks from fixed sources or other core domain derived * clocks. */ DEFINE_CLK_FIXED_RATE(alt_ck, CLK_IS_ROOT, 54000000, 0x0); DEFINE_CLK_FIXED_RATE(func_32k_ck, CLK_IS_ROOT, 32768, 0x0); DEFINE_CLK_FIXED_RATE(mcbsp_clks, CLK_IS_ROOT, 0x0, 0x0); static struct clk osc_ck; static const struct clk_ops osc_ck_ops = { .enable = &omap2_enable_osc_ck, .disable = omap2_disable_osc_ck, .recalc_rate = &omap2_osc_clk_recalc, }; static struct clk_hw_omap osc_ck_hw = { .hw = { .clk = &osc_ck, }, }; static struct clk osc_ck = { .name = "osc_ck", .ops = &osc_ck_ops, .hw = &osc_ck_hw.hw, .flags = CLK_IS_ROOT, }; DEFINE_CLK_FIXED_RATE(secure_32k_ck, CLK_IS_ROOT, 32768, 0x0); static struct clk sys_ck; static const char *sys_ck_parent_names[] = { "osc_ck", }; static const struct clk_ops sys_ck_ops = { .init = &omap2_init_clk_clkdm, .recalc_rate = &omap2xxx_sys_clk_recalc, }; DEFINE_STRUCT_CLK_HW_OMAP(sys_ck, "wkup_clkdm"); DEFINE_STRUCT_CLK(sys_ck, sys_ck_parent_names, sys_ck_ops); static struct dpll_data dpll_dd = { .mult_div1_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1), .mult_mask = OMAP24XX_DPLL_MULT_MASK, .div1_mask = OMAP24XX_DPLL_DIV_MASK, .clk_bypass = &sys_ck, .clk_ref = &sys_ck, .control_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN), .enable_mask = OMAP24XX_EN_DPLL_MASK, .max_multiplier = 1023, .min_divider = 1, .max_divider = 16, }; static struct clk dpll_ck; static const char *dpll_ck_parent_names[] = { "sys_ck", }; static const struct clk_ops dpll_ck_ops = { .init = &omap2_init_clk_clkdm, .get_parent = &omap2_init_dpll_parent, .recalc_rate = &omap2_dpllcore_recalc, .round_rate = &omap2_dpll_round_rate, .set_rate = &omap2_reprogram_dpllcore, }; static struct clk_hw_omap dpll_ck_hw = { .hw = { .clk = &dpll_ck, }, .ops = &clkhwops_omap2xxx_dpll, .dpll_data = &dpll_dd, .clkdm_name = "wkup_clkdm", }; DEFINE_STRUCT_CLK(dpll_ck, dpll_ck_parent_names, dpll_ck_ops); static struct clk core_ck; static const char *core_ck_parent_names[] = { "dpll_ck", }; static const struct clk_ops core_ck_ops = { .init = &omap2_init_clk_clkdm, }; DEFINE_STRUCT_CLK_HW_OMAP(core_ck, "wkup_clkdm"); DEFINE_STRUCT_CLK(core_ck, core_ck_parent_names, core_ck_ops);