diff options
| -rw-r--r-- | arch/arm/mach-omap2/cclock2420_data.c | 1950 | ||||
| -rw-r--r-- | arch/arm/mach-omap2/cclock2430_data.c | 2065 | ||||
| -rw-r--r-- | arch/arm/mach-omap2/cm-regbits-24xx.h | 5 | ||||
| -rw-r--r-- | arch/arm/mach-omap2/prm-regbits-24xx.h | 2 |
4 files changed, 4022 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/cclock2420_data.c b/arch/arm/mach-omap2/cclock2420_data.c new file mode 100644 index 000000000000..7e5febe456d9 --- /dev/null +++ b/arch/arm/mach-omap2/cclock2420_data.c | |||
| @@ -0,0 +1,1950 @@ | |||
| 1 | /* | ||
| 2 | * OMAP2420 clock data | ||
| 3 | * | ||
| 4 | * Copyright (C) 2005-2012 Texas Instruments, Inc. | ||
| 5 | * Copyright (C) 2004-2011 Nokia Corporation | ||
| 6 | * | ||
| 7 | * Contacts: | ||
| 8 | * Richard Woodruff <r-woodruff2@ti.com> | ||
| 9 | * Paul Walmsley | ||
| 10 | * Updated to COMMON clk format by Rajendra Nayak <rnayak@ti.com> | ||
| 11 | * | ||
| 12 | * This program is free software; you can redistribute it and/or modify | ||
| 13 | * it under the terms of the GNU General Public License version 2 as | ||
| 14 | * published by the Free Software Foundation. | ||
| 15 | */ | ||
| 16 | |||
| 17 | #include <linux/kernel.h> | ||
| 18 | #include <linux/io.h> | ||
| 19 | #include <linux/clk.h> | ||
| 20 | #include <linux/clk-private.h> | ||
| 21 | #include <linux/list.h> | ||
| 22 | |||
| 23 | #include "soc.h" | ||
| 24 | #include "iomap.h" | ||
| 25 | #include "clock.h" | ||
| 26 | #include "clock2xxx.h" | ||
| 27 | #include "opp2xxx.h" | ||
| 28 | #include "cm2xxx.h" | ||
| 29 | #include "prm2xxx.h" | ||
| 30 | #include "prm-regbits-24xx.h" | ||
| 31 | #include "cm-regbits-24xx.h" | ||
| 32 | #include "sdrc.h" | ||
| 33 | #include "control.h" | ||
| 34 | |||
| 35 | #define OMAP_CM_REGADDR OMAP2420_CM_REGADDR | ||
| 36 | |||
| 37 | /* | ||
| 38 | * 2420 clock tree. | ||
| 39 | * | ||
| 40 | * NOTE:In many cases here we are assigning a 'default' parent. In | ||
| 41 | * many cases the parent is selectable. The set parent calls will | ||
| 42 | * also switch sources. | ||
| 43 | * | ||
| 44 | * Several sources are given initial rates which may be wrong, this will | ||
| 45 | * be fixed up in the init func. | ||
| 46 | * | ||
| 47 | * Things are broadly separated below by clock domains. It is | ||
| 48 | * noteworthy that most peripherals have dependencies on multiple clock | ||
| 49 | * domains. Many get their interface clocks from the L4 domain, but get | ||
| 50 | * functional clocks from fixed sources or other core domain derived | ||
| 51 | * clocks. | ||
| 52 | */ | ||
| 53 | |||
| 54 | DEFINE_CLK_FIXED_RATE(alt_ck, CLK_IS_ROOT, 54000000, 0x0); | ||
| 55 | |||
| 56 | DEFINE_CLK_FIXED_RATE(func_32k_ck, CLK_IS_ROOT, 32768, 0x0); | ||
| 57 | |||
| 58 | DEFINE_CLK_FIXED_RATE(mcbsp_clks, CLK_IS_ROOT, 0x0, 0x0); | ||
| 59 | |||
| 60 | static struct clk osc_ck; | ||
| 61 | |||
| 62 | static const struct clk_ops osc_ck_ops = { | ||
| 63 | .recalc_rate = &omap2_osc_clk_recalc, | ||
| 64 | }; | ||
| 65 | |||
| 66 | static struct clk_hw_omap osc_ck_hw = { | ||
| 67 | .hw = { | ||
| 68 | .clk = &osc_ck, | ||
| 69 | }, | ||
| 70 | }; | ||
| 71 | |||
| 72 | static struct clk osc_ck = { | ||
| 73 | .name = "osc_ck", | ||
| 74 | .ops = &osc_ck_ops, | ||
| 75 | .hw = &osc_ck_hw.hw, | ||
| 76 | .flags = CLK_IS_ROOT, | ||
| 77 | }; | ||
| 78 | |||
| 79 | DEFINE_CLK_FIXED_RATE(secure_32k_ck, CLK_IS_ROOT, 32768, 0x0); | ||
| 80 | |||
| 81 | static struct clk sys_ck; | ||
| 82 | |||
| 83 | static const char *sys_ck_parent_names[] = { | ||
| 84 | "osc_ck", | ||
| 85 | }; | ||
| 86 | |||
| 87 | static const struct clk_ops sys_ck_ops = { | ||
| 88 | .init = &omap2_init_clk_clkdm, | ||
| 89 | .recalc_rate = &omap2xxx_sys_clk_recalc, | ||
| 90 | }; | ||
| 91 | |||
| 92 | DEFINE_STRUCT_CLK_HW_OMAP(sys_ck, "wkup_clkdm"); | ||
| 93 | DEFINE_STRUCT_CLK(sys_ck, sys_ck_parent_names, sys_ck_ops); | ||
| 94 | |||
| 95 | static struct dpll_data dpll_dd = { | ||
| 96 | .mult_div1_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1), | ||
| 97 | .mult_mask = OMAP24XX_DPLL_MULT_MASK, | ||
| 98 | .div1_mask = OMAP24XX_DPLL_DIV_MASK, | ||
| 99 | .clk_bypass = &sys_ck, | ||
| 100 | .clk_ref = &sys_ck, | ||
| 101 | .control_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN), | ||
| 102 | .enable_mask = OMAP24XX_EN_DPLL_MASK, | ||
| 103 | .max_multiplier = 1023, | ||
| 104 | .min_divider = 1, | ||
| 105 | .max_divider = 16, | ||
| 106 | }; | ||
| 107 | |||
| 108 | static struct clk dpll_ck; | ||
| 109 | |||
| 110 | static const char *dpll_ck_parent_names[] = { | ||
| 111 | "sys_ck", | ||
| 112 | }; | ||
| 113 | |||
| 114 | static const struct clk_ops dpll_ck_ops = { | ||
| 115 | .init = &omap2_init_clk_clkdm, | ||
| 116 | .get_parent = &omap2_init_dpll_parent, | ||
| 117 | .recalc_rate = &omap2_dpllcore_recalc, | ||
| 118 | .round_rate = &omap2_dpll_round_rate, | ||
| 119 | .set_rate = &omap2_reprogram_dpllcore, | ||
| 120 | }; | ||
| 121 | |||
| 122 | static struct clk_hw_omap dpll_ck_hw = { | ||
| 123 | .hw = { | ||
| 124 | .clk = &dpll_ck, | ||
| 125 | }, | ||
| 126 | .ops = &clkhwops_omap2xxx_dpll, | ||
| 127 | .dpll_data = &dpll_dd, | ||
| 128 | .clkdm_name = "wkup_clkdm", | ||
| 129 | }; | ||
| 130 | |||
| 131 | DEFINE_STRUCT_CLK(dpll_ck, dpll_ck_parent_names, dpll_ck_ops); | ||
| 132 | |||
| 133 | static struct clk core_ck; | ||
| 134 | |||
| 135 | static const char *core_ck_parent_names[] = { | ||
| 136 | "dpll_ck", | ||
| 137 | }; | ||
| 138 | |||
| 139 | static const struct clk_ops core_ck_ops = { | ||
| 140 | .init = &omap2_init_clk_clkdm, | ||
| 141 | }; | ||
| 142 | |||
| 143 | DEFINE_STRUCT_CLK_HW_OMAP(core_ck, "wkup_clkdm"); | ||
| 144 | DEFINE_STRUCT_CLK(core_ck, core_ck_parent_names, core_ck_ops); | ||
| 145 | |||
| 146 | DEFINE_CLK_DIVIDER(core_l3_ck, "core_ck", &core_ck, 0x0, | ||
| 147 | OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1), | ||
| 148 | OMAP24XX_CLKSEL_L3_SHIFT, OMAP24XX_CLKSEL_L3_WIDTH, | ||
| 149 | CLK_DIVIDER_ONE_BASED, NULL); | ||
| 150 | |||
| 151 | DEFINE_CLK_DIVIDER(l4_ck, "core_l3_ck", &core_l3_ck, 0x0, | ||
| 152 | OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1), | ||
| 153 | OMAP24XX_CLKSEL_L4_SHIFT, OMAP24XX_CLKSEL_L4_WIDTH, | ||
| 154 | CLK_DIVIDER_ONE_BASED, NULL); | ||
| 155 | |||
| 156 | static struct clk aes_ick; | ||
| 157 | |||
| 158 | static const char *aes_ick_parent_names[] = { | ||
| 159 | "l4_ck", | ||
| 160 | }; | ||
| 161 | |||
| 162 | static const struct clk_ops aes_ick_ops = { | ||
| 163 | .init = &omap2_init_clk_clkdm, | ||
| 164 | .enable = &omap2_dflt_clk_enable, | ||
| 165 | .disable = &omap2_dflt_clk_disable, | ||
| 166 | .is_enabled = &omap2_dflt_clk_is_enabled, | ||
| 167 | }; | ||
| 168 | |||
| 169 | static struct clk_hw_omap aes_ick_hw = { | ||
| 170 | .hw = { | ||
| 171 | .clk = &aes_ick, | ||
| 172 | }, | ||
| 173 | .ops = &clkhwops_iclk_wait, | ||
| 174 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4), | ||
| 175 | .enable_bit = OMAP24XX_EN_AES_SHIFT, | ||
| 176 | .clkdm_name = "core_l4_clkdm", | ||
| 177 | }; | ||
| 178 | |||
| 179 | DEFINE_STRUCT_CLK(aes_ick, aes_ick_parent_names, aes_ick_ops); | ||
| 180 | |||
| 181 | static struct clk apll54_ck; | ||
| 182 | |||
| 183 | static const struct clk_ops apll54_ck_ops = { | ||
| 184 | .init = &omap2_init_clk_clkdm, | ||
| 185 | .enable = &omap2_clk_apll54_enable, | ||
| 186 | .disable = &omap2_clk_apll54_disable, | ||
| 187 | .recalc_rate = &omap2_clk_apll54_recalc, | ||
| 188 | }; | ||
| 189 | |||
| 190 | static struct clk_hw_omap apll54_ck_hw = { | ||
| 191 | .hw = { | ||
| 192 | .clk = &apll54_ck, | ||
| 193 | }, | ||
| 194 | .ops | ||
