Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1 | /* |
Paul Walmsley | 81b34fb | 2010-02-22 22:09:22 -0700 | [diff] [blame] | 2 | * linux/arch/arm/mach-omap2/clock2430_data.c |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 3 | * |
Paul Walmsley | d8a9445 | 2009-12-08 16:21:29 -0700 | [diff] [blame] | 4 | * Copyright (C) 2005-2009 Texas Instruments, Inc. |
Paul Walmsley | a1d5562 | 2011-02-25 15:39:30 -0700 | [diff] [blame] | 5 | * Copyright (C) 2004-2011 Nokia Corporation |
Tony Lindgren | a16e970 | 2008-03-18 11:56:39 +0200 | [diff] [blame] | 6 | * |
| 7 | * Contacts: |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 8 | * Richard Woodruff <r-woodruff2@ti.com> |
Tony Lindgren | a16e970 | 2008-03-18 11:56:39 +0200 | [diff] [blame] | 9 | * Paul Walmsley |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 10 | * |
| 11 | * This program is free software; you can redistribute it and/or modify |
| 12 | * it under the terms of the GNU General Public License version 2 as |
| 13 | * published by the Free Software Foundation. |
| 14 | */ |
| 15 | |
Paul Walmsley | d8a9445 | 2009-12-08 16:21:29 -0700 | [diff] [blame] | 16 | #include <linux/kernel.h> |
| 17 | #include <linux/clk.h> |
Paul Walmsley | 93340a2 | 2010-02-22 22:09:12 -0700 | [diff] [blame] | 18 | #include <linux/list.h> |
Paul Walmsley | d8a9445 | 2009-12-08 16:21:29 -0700 | [diff] [blame] | 19 | |
| 20 | #include <plat/clkdev_omap.h> |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 21 | |
Paul Walmsley | 6b8858a | 2008-03-18 10:35:15 +0200 | [diff] [blame] | 22 | #include "clock.h" |
Paul Walmsley | d8a9445 | 2009-12-08 16:21:29 -0700 | [diff] [blame] | 23 | #include "clock2xxx.h" |
| 24 | #include "opp2xxx.h" |
Paul Walmsley | 59fb659 | 2010-12-21 15:30:55 -0700 | [diff] [blame] | 25 | #include "cm2xxx_3xxx.h" |
| 26 | #include "prm2xxx_3xxx.h" |
Paul Walmsley | 6b8858a | 2008-03-18 10:35:15 +0200 | [diff] [blame] | 27 | #include "prm-regbits-24xx.h" |
| 28 | #include "cm-regbits-24xx.h" |
| 29 | #include "sdrc.h" |
Paul Walmsley | 4814ced | 2010-10-08 11:40:20 -0600 | [diff] [blame] | 30 | #include "control.h" |
Paul Walmsley | 6b8858a | 2008-03-18 10:35:15 +0200 | [diff] [blame] | 31 | |
Paul Walmsley | 81b34fb | 2010-02-22 22:09:22 -0700 | [diff] [blame] | 32 | #define OMAP_CM_REGADDR OMAP2430_CM_REGADDR |
| 33 | |
| 34 | /* |
| 35 | * 2430 clock tree. |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 36 | * |
| 37 | * NOTE:In many cases here we are assigning a 'default' parent. In many |
| 38 | * cases the parent is selectable. The get/set parent calls will also |
| 39 | * switch sources. |
| 40 | * |
| 41 | * Many some clocks say always_enabled, but they can be auto idled for |
| 42 | * power savings. They will always be available upon clock request. |
| 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 periferals 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. |
Paul Walmsley | 81b34fb | 2010-02-22 22:09:22 -0700 | [diff] [blame] | 52 | */ |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 53 | |
| 54 | /* Base external input clocks */ |
| 55 | static struct clk func_32k_ck = { |
| 56 | .name = "func_32k_ck", |
Russell King | 897dcde | 2008-11-04 16:35:03 +0000 | [diff] [blame] | 57 | .ops = &clkops_null, |
Paul Walmsley | 3f9cfd3 | 2011-02-16 15:38:38 -0700 | [diff] [blame] | 58 | .rate = 32768, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 59 | .clkdm_name = "wkup_clkdm", |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 60 | }; |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 61 | |
Paul Walmsley | f248076 | 2009-04-23 21:11:10 -0600 | [diff] [blame] | 62 | static struct clk secure_32k_ck = { |
| 63 | .name = "secure_32k_ck", |
| 64 | .ops = &clkops_null, |
| 65 | .rate = 32768, |
Paul Walmsley | f248076 | 2009-04-23 21:11:10 -0600 | [diff] [blame] | 66 | .clkdm_name = "wkup_clkdm", |
| 67 | }; |
| 68 | |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 69 | /* Typical 12/13MHz in standalone mode, will be 26Mhz in chassis mode */ |
| 70 | static struct clk osc_ck = { /* (*12, *13, 19.2, *26, 38.4)MHz */ |
| 71 | .name = "osc_ck", |
Russell King | 548d849 | 2008-11-04 14:02:46 +0000 | [diff] [blame] | 72 | .ops = &clkops_oscck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 73 | .clkdm_name = "wkup_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 74 | .recalc = &omap2_osc_clk_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 75 | }; |
| 76 | |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 77 | /* Without modem likely 12MHz, with modem likely 13MHz */ |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 78 | static struct clk sys_ck = { /* (*12, *13, 19.2, 26, 38.4)MHz */ |
| 79 | .name = "sys_ck", /* ~ ref_clk also */ |
Russell King | 897dcde | 2008-11-04 16:35:03 +0000 | [diff] [blame] | 80 | .ops = &clkops_null, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 81 | .parent = &osc_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 82 | .clkdm_name = "wkup_clkdm", |
Paul Walmsley | 44da0a5 | 2010-01-26 20:13:08 -0700 | [diff] [blame] | 83 | .recalc = &omap2xxx_sys_clk_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 84 | }; |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 85 | |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 86 | static struct clk alt_ck = { /* Typical 54M or 48M, may not exist */ |
| 87 | .name = "alt_ck", |
Russell King | 897dcde | 2008-11-04 16:35:03 +0000 | [diff] [blame] | 88 | .ops = &clkops_null, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 89 | .rate = 54000000, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 90 | .clkdm_name = "wkup_clkdm", |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 91 | }; |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 92 | |
Paul Walmsley | b115b74 | 2010-10-08 11:40:18 -0600 | [diff] [blame] | 93 | /* Optional external clock input for McBSP CLKS */ |
| 94 | static struct clk mcbsp_clks = { |
| 95 | .name = "mcbsp_clks", |
| 96 | .ops = &clkops_null, |
| 97 | }; |
| 98 | |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 99 | /* |
| 100 | * Analog domain root source clocks |
| 101 | */ |
| 102 | |
| 103 | /* dpll_ck, is broken out in to special cases through clksel */ |
Paul Walmsley | 6b8858a | 2008-03-18 10:35:15 +0200 | [diff] [blame] | 104 | /* REVISIT: Rate changes on dpll_ck trigger a full set change. ... |
| 105 | * deal with this |
| 106 | */ |
| 107 | |
Paul Walmsley | 88b8ba9 | 2008-07-03 12:24:46 +0300 | [diff] [blame] | 108 | static struct dpll_data dpll_dd = { |
Paul Walmsley | 6b8858a | 2008-03-18 10:35:15 +0200 | [diff] [blame] | 109 | .mult_div1_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1), |
| 110 | .mult_mask = OMAP24XX_DPLL_MULT_MASK, |
| 111 | .div1_mask = OMAP24XX_DPLL_DIV_MASK, |
Russell King | c0bf313 | 2009-02-19 13:29:22 +0000 | [diff] [blame] | 112 | .clk_bypass = &sys_ck, |
| 113 | .clk_ref = &sys_ck, |
| 114 | .control_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN), |
| 115 | .enable_mask = OMAP24XX_EN_DPLL_MASK, |
Paul Walmsley | 93340a2 | 2010-02-22 22:09:12 -0700 | [diff] [blame] | 116 | .max_multiplier = 1023, |
Paul Walmsley | 95f538a | 2009-01-28 12:08:44 -0700 | [diff] [blame] | 117 | .min_divider = 1, |
Paul Walmsley | 88b8ba9 | 2008-07-03 12:24:46 +0300 | [diff] [blame] | 118 | .max_divider = 16, |
| 119 | .rate_tolerance = DEFAULT_DPLL_RATE_TOLERANCE |
Paul Walmsley | 6b8858a | 2008-03-18 10:35:15 +0200 | [diff] [blame] | 120 | }; |
| 121 | |
Paul Walmsley | 88b8ba9 | 2008-07-03 12:24:46 +0300 | [diff] [blame] | 122 | /* |
| 123 | * XXX Cannot add round_rate here yet, as this is still a composite clock, |
| 124 | * not just a DPLL |
| 125 | */ |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 126 | static struct clk dpll_ck = { |
| 127 | .name = "dpll_ck", |
Paul Walmsley | 0fd0c21 | 2011-02-25 15:49:53 -0700 | [diff] [blame] | 128 | .ops = &clkops_omap2xxx_dpll_ops, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 129 | .parent = &sys_ck, /* Can be func_32k also */ |
Paul Walmsley | 6b8858a | 2008-03-18 10:35:15 +0200 | [diff] [blame] | 130 | .dpll_data = &dpll_dd, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 131 | .clkdm_name = "wkup_clkdm", |
Paul Walmsley | 88b8ba9 | 2008-07-03 12:24:46 +0300 | [diff] [blame] | 132 | .recalc = &omap2_dpllcore_recalc, |
| 133 | .set_rate = &omap2_reprogram_dpllcore, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 134 | }; |
| 135 | |
| 136 | static struct clk apll96_ck = { |
| 137 | .name = "apll96_ck", |
Paul Walmsley | 06b1693 | 2009-12-08 16:18:46 -0700 | [diff] [blame] | 138 | .ops = &clkops_apll96, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 139 | .parent = &sys_ck, |
| 140 | .rate = 96000000, |
Paul Walmsley | 51c1954 | 2010-02-22 22:09:26 -0700 | [diff] [blame] | 141 | .flags = ENABLE_ON_INIT, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 142 | .clkdm_name = "wkup_clkdm", |
Paul Walmsley | 6b8858a | 2008-03-18 10:35:15 +0200 | [diff] [blame] | 143 | .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN), |
| 144 | .enable_bit = OMAP24XX_EN_96M_PLL_SHIFT, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 145 | }; |
| 146 | |
| 147 | static struct clk apll54_ck = { |
| 148 | .name = "apll54_ck", |
Paul Walmsley | 06b1693 | 2009-12-08 16:18:46 -0700 | [diff] [blame] | 149 | .ops = &clkops_apll54, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 150 | .parent = &sys_ck, |
| 151 | .rate = 54000000, |
Paul Walmsley | 51c1954 | 2010-02-22 22:09:26 -0700 | [diff] [blame] | 152 | .flags = ENABLE_ON_INIT, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 153 | .clkdm_name = "wkup_clkdm", |
Paul Walmsley | 6b8858a | 2008-03-18 10:35:15 +0200 | [diff] [blame] | 154 | .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN), |
| 155 | .enable_bit = OMAP24XX_EN_54M_PLL_SHIFT, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 156 | }; |
| 157 | |
| 158 | /* |
| 159 | * PRCM digital base sources |
| 160 | */ |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 161 | |
| 162 | /* func_54m_ck */ |
| 163 | |
| 164 | static const struct clksel_rate func_54m_apll54_rates[] = { |
Paul Walmsley | d74b494 | 2010-05-18 18:40:24 -0600 | [diff] [blame] | 165 | { .div = 1, .val = 0, .flags = RATE_IN_24XX }, |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 166 | { .div = 0 }, |
| 167 | }; |
| 168 | |
| 169 | static const struct clksel_rate func_54m_alt_rates[] = { |
Paul Walmsley | d74b494 | 2010-05-18 18:40:24 -0600 | [diff] [blame] | 170 | { .div = 1, .val = 1, .flags = RATE_IN_24XX }, |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 171 | { .div = 0 }, |
| 172 | }; |
| 173 | |
| 174 | static const struct clksel func_54m_clksel[] = { |
| 175 | { .parent = &apll54_ck, .rates = func_54m_apll54_rates, }, |
| 176 | { .parent = &alt_ck, .rates = func_54m_alt_rates, }, |
| 177 | { .parent = NULL }, |
| 178 | }; |
| 179 | |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 180 | static struct clk func_54m_ck = { |
| 181 | .name = "func_54m_ck", |
Russell King | 5713718 | 2008-11-04 16:48:35 +0000 | [diff] [blame] | 182 | .ops = &clkops_null, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 183 | .parent = &apll54_ck, /* can also be alt_clk */ |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 184 | .clkdm_name = "wkup_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 185 | .init = &omap2_init_clksel_parent, |
| 186 | .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1), |
Paul Walmsley | f38ca10 | 2010-05-20 12:31:04 -0600 | [diff] [blame] | 187 | .clksel_mask = OMAP24XX_54M_SOURCE_MASK, |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 188 | .clksel = func_54m_clksel, |
| 189 | .recalc = &omap2_clksel_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 190 | }; |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 191 | |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 192 | static struct clk core_ck = { |
| 193 | .name = "core_ck", |
Russell King | 897dcde | 2008-11-04 16:35:03 +0000 | [diff] [blame] | 194 | .ops = &clkops_null, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 195 | .parent = &dpll_ck, /* can also be 32k */ |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 196 | .clkdm_name = "wkup_clkdm", |
Paul Walmsley | 6b8858a | 2008-03-18 10:35:15 +0200 | [diff] [blame] | 197 | .recalc = &followparent_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 198 | }; |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 199 | |
| 200 | /* func_96m_ck */ |
| 201 | static const struct clksel_rate func_96m_apll96_rates[] = { |
Paul Walmsley | d74b494 | 2010-05-18 18:40:24 -0600 | [diff] [blame] | 202 | { .div = 1, .val = 0, .flags = RATE_IN_24XX }, |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 203 | { .div = 0 }, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 204 | }; |
| 205 | |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 206 | static const struct clksel_rate func_96m_alt_rates[] = { |
Paul Walmsley | d74b494 | 2010-05-18 18:40:24 -0600 | [diff] [blame] | 207 | { .div = 1, .val = 1, .flags = RATE_IN_243X }, |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 208 | { .div = 0 }, |
| 209 | }; |
| 210 | |
| 211 | static const struct clksel func_96m_clksel[] = { |
| 212 | { .parent = &apll96_ck, .rates = func_96m_apll96_rates }, |
| 213 | { .parent = &alt_ck, .rates = func_96m_alt_rates }, |
| 214 | { .parent = NULL } |
| 215 | }; |
| 216 | |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 217 | static struct clk func_96m_ck = { |
| 218 | .name = "func_96m_ck", |
Russell King | 5713718 | 2008-11-04 16:48:35 +0000 | [diff] [blame] | 219 | .ops = &clkops_null, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 220 | .parent = &apll96_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 221 | .clkdm_name = "wkup_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 222 | .init = &omap2_init_clksel_parent, |
| 223 | .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1), |
Paul Walmsley | f38ca10 | 2010-05-20 12:31:04 -0600 | [diff] [blame] | 224 | .clksel_mask = OMAP2430_96M_SOURCE_MASK, |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 225 | .clksel = func_96m_clksel, |
| 226 | .recalc = &omap2_clksel_recalc, |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 227 | }; |
| 228 | |
| 229 | /* func_48m_ck */ |
| 230 | |
| 231 | static const struct clksel_rate func_48m_apll96_rates[] = { |
Paul Walmsley | d74b494 | 2010-05-18 18:40:24 -0600 | [diff] [blame] | 232 | { .div = 2, .val = 0, .flags = RATE_IN_24XX }, |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 233 | { .div = 0 }, |
| 234 | }; |
| 235 | |
| 236 | static const struct clksel_rate func_48m_alt_rates[] = { |
Paul Walmsley | d74b494 | 2010-05-18 18:40:24 -0600 | [diff] [blame] | 237 | { .div = 1, .val = 1, .flags = RATE_IN_24XX }, |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 238 | { .div = 0 }, |
| 239 | }; |
| 240 | |
| 241 | static const struct clksel func_48m_clksel[] = { |
| 242 | { .parent = &apll96_ck, .rates = func_48m_apll96_rates }, |
| 243 | { .parent = &alt_ck, .rates = func_48m_alt_rates }, |
| 244 | { .parent = NULL } |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 245 | }; |
| 246 | |
| 247 | static struct clk func_48m_ck = { |
| 248 | .name = "func_48m_ck", |
Russell King | 5713718 | 2008-11-04 16:48:35 +0000 | [diff] [blame] | 249 | .ops = &clkops_null, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 250 | .parent = &apll96_ck, /* 96M or Alt */ |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 251 | .clkdm_name = "wkup_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 252 | .init = &omap2_init_clksel_parent, |
| 253 | .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1), |
Paul Walmsley | f38ca10 | 2010-05-20 12:31:04 -0600 | [diff] [blame] | 254 | .clksel_mask = OMAP24XX_48M_SOURCE_MASK, |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 255 | .clksel = func_48m_clksel, |
| 256 | .recalc = &omap2_clksel_recalc, |
| 257 | .round_rate = &omap2_clksel_round_rate, |
| 258 | .set_rate = &omap2_clksel_set_rate |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 259 | }; |
| 260 | |
| 261 | static struct clk func_12m_ck = { |
| 262 | .name = "func_12m_ck", |
Russell King | 5713718 | 2008-11-04 16:48:35 +0000 | [diff] [blame] | 263 | .ops = &clkops_null, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 264 | .parent = &func_48m_ck, |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 265 | .fixed_div = 4, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 266 | .clkdm_name = "wkup_clkdm", |
Paul Walmsley | e9b98f6 | 2010-01-26 20:12:57 -0700 | [diff] [blame] | 267 | .recalc = &omap_fixed_divisor_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 268 | }; |
| 269 | |
| 270 | /* Secure timer, only available in secure mode */ |
| 271 | static struct clk wdt1_osc_ck = { |
| 272 | .name = "ck_wdt1_osc", |
Russell King | 897dcde | 2008-11-04 16:35:03 +0000 | [diff] [blame] | 273 | .ops = &clkops_null, /* RMK: missing? */ |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 274 | .parent = &osc_ck, |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 275 | .recalc = &followparent_recalc, |
| 276 | }; |
| 277 | |
| 278 | /* |
| 279 | * The common_clkout* clksel_rate structs are common to |
| 280 | * sys_clkout, sys_clkout_src, sys_clkout2, and sys_clkout2_src. |
| 281 | * sys_clkout2_* are 2420-only, so the |
| 282 | * clksel_rate flags fields are inaccurate for those clocks. This is |
| 283 | * harmless since access to those clocks are gated by the struct clk |
| 284 | * flags fields, which mark them as 2420-only. |
| 285 | */ |
| 286 | static const struct clksel_rate common_clkout_src_core_rates[] = { |
Paul Walmsley | d74b494 | 2010-05-18 18:40:24 -0600 | [diff] [blame] | 287 | { .div = 1, .val = 0, .flags = RATE_IN_24XX }, |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 288 | { .div = 0 } |
| 289 | }; |
| 290 | |
| 291 | static const struct clksel_rate common_clkout_src_sys_rates[] = { |
Paul Walmsley | d74b494 | 2010-05-18 18:40:24 -0600 | [diff] [blame] | 292 | { .div = 1, .val = 1, .flags = RATE_IN_24XX }, |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 293 | { .div = 0 } |
| 294 | }; |
| 295 | |
| 296 | static const struct clksel_rate common_clkout_src_96m_rates[] = { |
Paul Walmsley | d74b494 | 2010-05-18 18:40:24 -0600 | [diff] [blame] | 297 | { .div = 1, .val = 2, .flags = RATE_IN_24XX }, |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 298 | { .div = 0 } |
| 299 | }; |
| 300 | |
| 301 | static const struct clksel_rate common_clkout_src_54m_rates[] = { |
Paul Walmsley | d74b494 | 2010-05-18 18:40:24 -0600 | [diff] [blame] | 302 | { .div = 1, .val = 3, .flags = RATE_IN_24XX }, |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 303 | { .div = 0 } |
| 304 | }; |
| 305 | |
| 306 | static const struct clksel common_clkout_src_clksel[] = { |
| 307 | { .parent = &core_ck, .rates = common_clkout_src_core_rates }, |
| 308 | { .parent = &sys_ck, .rates = common_clkout_src_sys_rates }, |
| 309 | { .parent = &func_96m_ck, .rates = common_clkout_src_96m_rates }, |
| 310 | { .parent = &func_54m_ck, .rates = common_clkout_src_54m_rates }, |
| 311 | { .parent = NULL } |
| 312 | }; |
| 313 | |
| 314 | static struct clk sys_clkout_src = { |
| 315 | .name = "sys_clkout_src", |
Russell King | c1168dc | 2008-11-04 21:24:00 +0000 | [diff] [blame] | 316 | .ops = &clkops_omap2_dflt, |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 317 | .parent = &func_54m_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 318 | .clkdm_name = "wkup_clkdm", |
Paul Walmsley | 81b34fb | 2010-02-22 22:09:22 -0700 | [diff] [blame] | 319 | .enable_reg = OMAP2430_PRCM_CLKOUT_CTRL, |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 320 | .enable_bit = OMAP24XX_CLKOUT_EN_SHIFT, |
| 321 | .init = &omap2_init_clksel_parent, |
Paul Walmsley | 81b34fb | 2010-02-22 22:09:22 -0700 | [diff] [blame] | 322 | .clksel_reg = OMAP2430_PRCM_CLKOUT_CTRL, |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 323 | .clksel_mask = OMAP24XX_CLKOUT_SOURCE_MASK, |
| 324 | .clksel = common_clkout_src_clksel, |
| 325 | .recalc = &omap2_clksel_recalc, |
| 326 | .round_rate = &omap2_clksel_round_rate, |
| 327 | .set_rate = &omap2_clksel_set_rate |
| 328 | }; |
| 329 | |
| 330 | static const struct clksel_rate common_clkout_rates[] = { |
Paul Walmsley | d74b494 | 2010-05-18 18:40:24 -0600 | [diff] [blame] | 331 | { .div = 1, .val = 0, .flags = RATE_IN_24XX }, |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 332 | { .div = 2, .val = 1, .flags = RATE_IN_24XX }, |
| 333 | { .div = 4, .val = 2, .flags = RATE_IN_24XX }, |
| 334 | { .div = 8, .val = 3, .flags = RATE_IN_24XX }, |
| 335 | { .div = 16, .val = 4, .flags = RATE_IN_24XX }, |
| 336 | { .div = 0 }, |
| 337 | }; |
| 338 | |
| 339 | static const struct clksel sys_clkout_clksel[] = { |
| 340 | { .parent = &sys_clkout_src, .rates = common_clkout_rates }, |
| 341 | { .parent = NULL } |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 342 | }; |
| 343 | |
| 344 | static struct clk sys_clkout = { |
| 345 | .name = "sys_clkout", |
Russell King | 5713718 | 2008-11-04 16:48:35 +0000 | [diff] [blame] | 346 | .ops = &clkops_null, |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 347 | .parent = &sys_clkout_src, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 348 | .clkdm_name = "wkup_clkdm", |
Paul Walmsley | 81b34fb | 2010-02-22 22:09:22 -0700 | [diff] [blame] | 349 | .clksel_reg = OMAP2430_PRCM_CLKOUT_CTRL, |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 350 | .clksel_mask = OMAP24XX_CLKOUT_DIV_MASK, |
| 351 | .clksel = sys_clkout_clksel, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 352 | .recalc = &omap2_clksel_recalc, |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 353 | .round_rate = &omap2_clksel_round_rate, |
| 354 | .set_rate = &omap2_clksel_set_rate |
| 355 | }; |
| 356 | |
Tony Lindgren | b824efa | 2006-04-02 17:46:20 +0100 | [diff] [blame] | 357 | static struct clk emul_ck = { |
| 358 | .name = "emul_ck", |
Russell King | c1168dc | 2008-11-04 21:24:00 +0000 | [diff] [blame] | 359 | .ops = &clkops_omap2_dflt, |
Tony Lindgren | b824efa | 2006-04-02 17:46:20 +0100 | [diff] [blame] | 360 | .parent = &func_54m_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 361 | .clkdm_name = "wkup_clkdm", |
Paul Walmsley | 81b34fb | 2010-02-22 22:09:22 -0700 | [diff] [blame] | 362 | .enable_reg = OMAP2430_PRCM_CLKEMUL_CTRL, |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 363 | .enable_bit = OMAP24XX_EMULATION_EN_SHIFT, |
| 364 | .recalc = &followparent_recalc, |
Tony Lindgren | b824efa | 2006-04-02 17:46:20 +0100 | [diff] [blame] | 365 | |
| 366 | }; |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 367 | |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 368 | /* |
| 369 | * MPU clock domain |
| 370 | * Clocks: |
| 371 | * MPU_FCLK, MPU_ICLK |
| 372 | * INT_M_FCLK, INT_M_I_CLK |
| 373 | * |
| 374 | * - Individual clocks are hardware managed. |
| 375 | * - Base divider comes from: CM_CLKSEL_MPU |
| 376 | * |
| 377 | */ |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 378 | static const struct clksel_rate mpu_core_rates[] = { |
Paul Walmsley | d74b494 | 2010-05-18 18:40:24 -0600 | [diff] [blame] | 379 | { .div = 1, .val = 1, .flags = RATE_IN_24XX }, |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 380 | { .div = 2, .val = 2, .flags = RATE_IN_24XX }, |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 381 | { .div = 0 }, |
| 382 | }; |
| 383 | |
| 384 | static const struct clksel mpu_clksel[] = { |
| 385 | { .parent = &core_ck, .rates = mpu_core_rates }, |
| 386 | { .parent = NULL } |
| 387 | }; |
| 388 | |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 389 | static struct clk mpu_ck = { /* Control cpu */ |
| 390 | .name = "mpu_ck", |
Russell King | 897dcde | 2008-11-04 16:35:03 +0000 | [diff] [blame] | 391 | .ops = &clkops_null, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 392 | .parent = &core_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 393 | .clkdm_name = "mpu_clkdm", |
Paul Walmsley | 6b8858a | 2008-03-18 10:35:15 +0200 | [diff] [blame] | 394 | .init = &omap2_init_clksel_parent, |
| 395 | .clksel_reg = OMAP_CM_REGADDR(MPU_MOD, CM_CLKSEL), |
| 396 | .clksel_mask = OMAP24XX_CLKSEL_MPU_MASK, |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 397 | .clksel = mpu_clksel, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 398 | .recalc = &omap2_clksel_recalc, |
| 399 | }; |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 400 | |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 401 | /* |
Paul Walmsley | 81b34fb | 2010-02-22 22:09:22 -0700 | [diff] [blame] | 402 | * DSP (2430-IVA2.1) clock domain |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 403 | * Clocks: |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 404 | * 2430: IVA2.1_FCLK (really just DSP_FCLK), IVA2.1_ICLK |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 405 | * |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 406 | * Won't be too specific here. The core clock comes into this block |
| 407 | * it is divided then tee'ed. One branch goes directly to xyz enable |
| 408 | * controls. The other branch gets further divided by 2 then possibly |
| 409 | * routed into a synchronizer and out of clocks abc. |
| 410 | */ |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 411 | static const struct clksel_rate dsp_fck_core_rates[] = { |
Paul Walmsley | d74b494 | 2010-05-18 18:40:24 -0600 | [diff] [blame] | 412 | { .div = 1, .val = 1, .flags = RATE_IN_24XX }, |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 413 | { .div = 2, .val = 2, .flags = RATE_IN_24XX }, |
| 414 | { .div = 3, .val = 3, .flags = RATE_IN_24XX }, |
| 415 | { .div = 4, .val = 4, .flags = RATE_IN_24XX }, |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 416 | { .div = 0 }, |
| 417 | }; |
| 418 | |
| 419 | static const struct clksel dsp_fck_clksel[] = { |
| 420 | { .parent = &core_ck, .rates = dsp_fck_core_rates }, |
| 421 | { .parent = NULL } |
| 422 | }; |
| 423 | |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 424 | static struct clk dsp_fck = { |
| 425 | .name = "dsp_fck", |
Russell King | b36ee72 | 2008-11-04 17:59:52 +0000 | [diff] [blame] | 426 | .ops = &clkops_omap2_dflt_wait, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 427 | .parent = &core_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 428 | .clkdm_name = "dsp_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 429 | .enable_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_FCLKEN), |
| 430 | .enable_bit = OMAP24XX_CM_FCLKEN_DSP_EN_DSP_SHIFT, |
| 431 | .clksel_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_CLKSEL), |
| 432 | .clksel_mask = OMAP24XX_CLKSEL_DSP_MASK, |
| 433 | .clksel = dsp_fck_clksel, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 434 | .recalc = &omap2_clksel_recalc, |
| 435 | }; |
| 436 | |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 437 | /* DSP interface clock */ |
| 438 | static const struct clksel_rate dsp_irate_ick_rates[] = { |
Paul Walmsley | d74b494 | 2010-05-18 18:40:24 -0600 | [diff] [blame] | 439 | { .div = 1, .val = 1, .flags = RATE_IN_24XX }, |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 440 | { .div = 2, .val = 2, .flags = RATE_IN_24XX }, |
| 441 | { .div = 3, .val = 3, .flags = RATE_IN_243X }, |
| 442 | { .div = 0 }, |
| 443 | }; |
| 444 | |
| 445 | static const struct clksel dsp_irate_ick_clksel[] = { |
| 446 | { .parent = &dsp_fck, .rates = dsp_irate_ick_rates }, |
| 447 | { .parent = NULL } |
| 448 | }; |
| 449 | |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 450 | /* This clock does not exist as such in the TRM. */ |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 451 | static struct clk dsp_irate_ick = { |
| 452 | .name = "dsp_irate_ick", |
Russell King | 5713718 | 2008-11-04 16:48:35 +0000 | [diff] [blame] | 453 | .ops = &clkops_null, |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 454 | .parent = &dsp_fck, |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 455 | .clksel_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_CLKSEL), |
| 456 | .clksel_mask = OMAP24XX_CLKSEL_DSP_IF_MASK, |
| 457 | .clksel = dsp_irate_ick_clksel, |
| 458 | .recalc = &omap2_clksel_recalc, |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 459 | }; |
| 460 | |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 461 | /* 2430 only - EN_DSP controls both dsp fclk and iclk on 2430 */ |
| 462 | static struct clk iva2_1_ick = { |
| 463 | .name = "iva2_1_ick", |
Russell King | b36ee72 | 2008-11-04 17:59:52 +0000 | [diff] [blame] | 464 | .ops = &clkops_omap2_dflt_wait, |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 465 | .parent = &dsp_irate_ick, |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 466 | .enable_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_FCLKEN), |
| 467 | .enable_bit = OMAP24XX_CM_FCLKEN_DSP_EN_DSP_SHIFT, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 468 | }; |
| 469 | |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 470 | /* |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 471 | * L3 clock domain |
| 472 | * L3 clocks are used for both interface and functional clocks to |
| 473 | * multiple entities. Some of these clocks are completely managed |
| 474 | * by hardware, and some others allow software control. Hardware |
| 475 | * managed ones general are based on directly CLK_REQ signals and |
| 476 | * various auto idle settings. The functional spec sets many of these |
| 477 | * as 'tie-high' for their enables. |
| 478 | * |
| 479 | * I-CLOCKS: |
| 480 | * L3-Interconnect, SMS, GPMC, SDRC, OCM_RAM, OCM_ROM, SDMA |
| 481 | * CAM, HS-USB. |
| 482 | * F-CLOCK |
| 483 | * SSI. |
| 484 | * |
| 485 | * GPMC memories and SDRC have timing and clock sensitive registers which |
| 486 | * may very well need notification when the clock changes. Currently for low |
| 487 | * operating points, these are taken care of in sleep.S. |
| 488 | */ |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 489 | static const struct clksel_rate core_l3_core_rates[] = { |
| 490 | { .div = 1, .val = 1, .flags = RATE_IN_24XX }, |
Paul Walmsley | d74b494 | 2010-05-18 18:40:24 -0600 | [diff] [blame] | 491 | { .div = 4, .val = 4, .flags = RATE_IN_24XX }, |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 492 | { .div = 6, .val = 6, .flags = RATE_IN_24XX }, |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 493 | { .div = 0 } |
| 494 | }; |
| 495 | |
| 496 | static const struct clksel core_l3_clksel[] = { |
| 497 | { .parent = &core_ck, .rates = core_l3_core_rates }, |
| 498 | { .parent = NULL } |
| 499 | }; |
| 500 | |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 501 | static struct clk core_l3_ck = { /* Used for ick and fck, interconnect */ |
| 502 | .name = "core_l3_ck", |
Russell King | 897dcde | 2008-11-04 16:35:03 +0000 | [diff] [blame] | 503 | .ops = &clkops_null, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 504 | .parent = &core_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 505 | .clkdm_name = "core_l3_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 506 | .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1), |
| 507 | .clksel_mask = OMAP24XX_CLKSEL_L3_MASK, |
| 508 | .clksel = core_l3_clksel, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 509 | .recalc = &omap2_clksel_recalc, |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 510 | }; |
| 511 | |
| 512 | /* usb_l4_ick */ |
| 513 | static const struct clksel_rate usb_l4_ick_core_l3_rates[] = { |
| 514 | { .div = 1, .val = 1, .flags = RATE_IN_24XX }, |
Paul Walmsley | d74b494 | 2010-05-18 18:40:24 -0600 | [diff] [blame] | 515 | { .div = 2, .val = 2, .flags = RATE_IN_24XX }, |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 516 | { .div = 4, .val = 4, .flags = RATE_IN_24XX }, |
| 517 | { .div = 0 } |
| 518 | }; |
| 519 | |
| 520 | static const struct clksel usb_l4_ick_clksel[] = { |
| 521 | { .parent = &core_l3_ck, .rates = usb_l4_ick_core_l3_rates }, |
| 522 | { .parent = NULL }, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 523 | }; |
| 524 | |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 525 | /* It is unclear from TRM whether usb_l4_ick is really in L3 or L4 clkdm */ |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 526 | static struct clk usb_l4_ick = { /* FS-USB interface clock */ |
| 527 | .name = "usb_l4_ick", |
Paul Walmsley | a1d5562 | 2011-02-25 15:39:30 -0700 | [diff] [blame] | 528 | .ops = &clkops_omap2_iclk_dflt_wait, |
Tony Lindgren | fde0fd4 | 2006-01-17 15:31:18 -0800 | [diff] [blame] | 529 | .parent = &core_l3_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 530 | .clkdm_name = "core_l4_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 531 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), |
| 532 | .enable_bit = OMAP24XX_EN_USB_SHIFT, |
| 533 | .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1), |
| 534 | .clksel_mask = OMAP24XX_CLKSEL_USB_MASK, |
| 535 | .clksel = usb_l4_ick_clksel, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 536 | .recalc = &omap2_clksel_recalc, |
| 537 | }; |
| 538 | |
| 539 | /* |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 540 | * L4 clock management domain |
| 541 | * |
| 542 | * This domain contains lots of interface clocks from the L4 interface, some |
| 543 | * functional clocks. Fixed APLL functional source clocks are managed in |
| 544 | * this domain. |
| 545 | */ |
| 546 | static const struct clksel_rate l4_core_l3_rates[] = { |
Paul Walmsley | d74b494 | 2010-05-18 18:40:24 -0600 | [diff] [blame] | 547 | { .div = 1, .val = 1, .flags = RATE_IN_24XX }, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 548 | { .div = 2, .val = 2, .flags = RATE_IN_24XX }, |
| 549 | { .div = 0 } |
| 550 | }; |
| 551 | |
| 552 | static const struct clksel l4_clksel[] = { |
| 553 | { .parent = &core_l3_ck, .rates = l4_core_l3_rates }, |
| 554 | { .parent = NULL } |
| 555 | }; |
| 556 | |
| 557 | static struct clk l4_ck = { /* used both as an ick and fck */ |
| 558 | .name = "l4_ck", |
Russell King | 897dcde | 2008-11-04 16:35:03 +0000 | [diff] [blame] | 559 | .ops = &clkops_null, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 560 | .parent = &core_l3_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 561 | .clkdm_name = "core_l4_clkdm", |
| 562 | .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1), |
| 563 | .clksel_mask = OMAP24XX_CLKSEL_L4_MASK, |
| 564 | .clksel = l4_clksel, |
| 565 | .recalc = &omap2_clksel_recalc, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 566 | }; |
| 567 | |
| 568 | /* |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 569 | * SSI is in L3 management domain, its direct parent is core not l3, |
| 570 | * many core power domain entities are grouped into the L3 clock |
| 571 | * domain. |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 572 | * SSI_SSR_FCLK, SSI_SST_FCLK, SSI_L4_ICLK |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 573 | * |
| 574 | * ssr = core/1/2/3/4/5, sst = 1/2 ssr. |
| 575 | */ |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 576 | static const struct clksel_rate ssi_ssr_sst_fck_core_rates[] = { |
| 577 | { .div = 1, .val = 1, .flags = RATE_IN_24XX }, |
Paul Walmsley | d74b494 | 2010-05-18 18:40:24 -0600 | [diff] [blame] | 578 | { .div = 2, .val = 2, .flags = RATE_IN_24XX }, |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 579 | { .div = 3, .val = 3, .flags = RATE_IN_24XX }, |
| 580 | { .div = 4, .val = 4, .flags = RATE_IN_24XX }, |
| 581 | { .div = 5, .val = 5, .flags = RATE_IN_243X }, |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 582 | { .div = 0 } |
| 583 | }; |
| 584 | |
| 585 | static const struct clksel ssi_ssr_sst_fck_clksel[] = { |
| 586 | { .parent = &core_ck, .rates = ssi_ssr_sst_fck_core_rates }, |
| 587 | { .parent = NULL } |
| 588 | }; |
| 589 | |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 590 | static struct clk ssi_ssr_sst_fck = { |
| 591 | .name = "ssi_fck", |
Russell King | b36ee72 | 2008-11-04 17:59:52 +0000 | [diff] [blame] | 592 | .ops = &clkops_omap2_dflt_wait, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 593 | .parent = &core_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 594 | .clkdm_name = "core_l3_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 595 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), |
| 596 | .enable_bit = OMAP24XX_EN_SSI_SHIFT, |
| 597 | .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1), |
| 598 | .clksel_mask = OMAP24XX_CLKSEL_SSI_MASK, |
| 599 | .clksel = ssi_ssr_sst_fck_clksel, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 600 | .recalc = &omap2_clksel_recalc, |
| 601 | }; |
| 602 | |
Paul Walmsley | 9299fd8 | 2009-01-27 19:12:54 -0700 | [diff] [blame] | 603 | /* |
| 604 | * Presumably this is the same as SSI_ICLK. |
| 605 | * TRM contradicts itself on what clockdomain SSI_ICLK is in |
| 606 | */ |
| 607 | static struct clk ssi_l4_ick = { |
| 608 | .name = "ssi_l4_ick", |
Paul Walmsley | a1d5562 | 2011-02-25 15:39:30 -0700 | [diff] [blame] | 609 | .ops = &clkops_omap2_iclk_dflt_wait, |
Paul Walmsley | 9299fd8 | 2009-01-27 19:12:54 -0700 | [diff] [blame] | 610 | .parent = &l4_ck, |
| 611 | .clkdm_name = "core_l4_clkdm", |
| 612 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), |
| 613 | .enable_bit = OMAP24XX_EN_SSI_SHIFT, |
| 614 | .recalc = &followparent_recalc, |
| 615 | }; |
| 616 | |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 617 | |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 618 | /* |
| 619 | * GFX clock domain |
| 620 | * Clocks: |
| 621 | * GFX_FCLK, GFX_ICLK |
| 622 | * GFX_CG1(2d), GFX_CG2(3d) |
| 623 | * |
| 624 | * GFX_FCLK runs from L3, and is divided by (1,2,3,4) |
| 625 | * The 2d and 3d clocks run at a hardware determined |
| 626 | * divided value of fclk. |
| 627 | * |
| 628 | */ |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 629 | |
| 630 | /* This clksel struct is shared between gfx_3d_fck and gfx_2d_fck */ |
| 631 | static const struct clksel gfx_fck_clksel[] = { |
| 632 | { .parent = &core_l3_ck, .rates = gfx_l3_rates }, |
| 633 | { .parent = NULL }, |
| 634 | }; |
| 635 | |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 636 | static struct clk gfx_3d_fck = { |
| 637 | .name = "gfx_3d_fck", |
Russell King | b36ee72 | 2008-11-04 17:59:52 +0000 | [diff] [blame] | 638 | .ops = &clkops_omap2_dflt_wait, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 639 | .parent = &core_l3_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 640 | .clkdm_name = "gfx_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 641 | .enable_reg = OMAP_CM_REGADDR(GFX_MOD, CM_FCLKEN), |
| 642 | .enable_bit = OMAP24XX_EN_3D_SHIFT, |
| 643 | .clksel_reg = OMAP_CM_REGADDR(GFX_MOD, CM_CLKSEL), |
| 644 | .clksel_mask = OMAP_CLKSEL_GFX_MASK, |
| 645 | .clksel = gfx_fck_clksel, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 646 | .recalc = &omap2_clksel_recalc, |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 647 | .round_rate = &omap2_clksel_round_rate, |
| 648 | .set_rate = &omap2_clksel_set_rate |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 649 | }; |
| 650 | |
| 651 | static struct clk gfx_2d_fck = { |
| 652 | .name = "gfx_2d_fck", |
Russell King | b36ee72 | 2008-11-04 17:59:52 +0000 | [diff] [blame] | 653 | .ops = &clkops_omap2_dflt_wait, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 654 | .parent = &core_l3_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 655 | .clkdm_name = "gfx_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 656 | .enable_reg = OMAP_CM_REGADDR(GFX_MOD, CM_FCLKEN), |
| 657 | .enable_bit = OMAP24XX_EN_2D_SHIFT, |
| 658 | .clksel_reg = OMAP_CM_REGADDR(GFX_MOD, CM_CLKSEL), |
| 659 | .clksel_mask = OMAP_CLKSEL_GFX_MASK, |
| 660 | .clksel = gfx_fck_clksel, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 661 | .recalc = &omap2_clksel_recalc, |
| 662 | }; |
| 663 | |
Paul Walmsley | a1d5562 | 2011-02-25 15:39:30 -0700 | [diff] [blame] | 664 | /* This interface clock does not have a CM_AUTOIDLE bit */ |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 665 | static struct clk gfx_ick = { |
| 666 | .name = "gfx_ick", /* From l3 */ |
Russell King | b36ee72 | 2008-11-04 17:59:52 +0000 | [diff] [blame] | 667 | .ops = &clkops_omap2_dflt_wait, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 668 | .parent = &core_l3_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 669 | .clkdm_name = "gfx_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 670 | .enable_reg = OMAP_CM_REGADDR(GFX_MOD, CM_ICLKEN), |
| 671 | .enable_bit = OMAP_EN_GFX_SHIFT, |
| 672 | .recalc = &followparent_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 673 | }; |
| 674 | |
| 675 | /* |
| 676 | * Modem clock domain (2430) |
| 677 | * CLOCKS: |
| 678 | * MDM_OSC_CLK |
| 679 | * MDM_ICLK |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 680 | * These clocks are usable in chassis mode only. |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 681 | */ |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 682 | static const struct clksel_rate mdm_ick_core_rates[] = { |
| 683 | { .div = 1, .val = 1, .flags = RATE_IN_243X }, |
Paul Walmsley | d74b494 | 2010-05-18 18:40:24 -0600 | [diff] [blame] | 684 | { .div = 4, .val = 4, .flags = RATE_IN_243X }, |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 685 | { .div = 6, .val = 6, .flags = RATE_IN_243X }, |
| 686 | { .div = 9, .val = 9, .flags = RATE_IN_243X }, |
| 687 | { .div = 0 } |
| 688 | }; |
| 689 | |
| 690 | static const struct clksel mdm_ick_clksel[] = { |
| 691 | { .parent = &core_ck, .rates = mdm_ick_core_rates }, |
| 692 | { .parent = NULL } |
| 693 | }; |
| 694 | |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 695 | static struct clk mdm_ick = { /* used both as a ick and fck */ |
| 696 | .name = "mdm_ick", |
Paul Walmsley | a1d5562 | 2011-02-25 15:39:30 -0700 | [diff] [blame] | 697 | .ops = &clkops_omap2_iclk_dflt_wait, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 698 | .parent = &core_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 699 | .clkdm_name = "mdm_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 700 | .enable_reg = OMAP_CM_REGADDR(OMAP2430_MDM_MOD, CM_ICLKEN), |
| 701 | .enable_bit = OMAP2430_CM_ICLKEN_MDM_EN_MDM_SHIFT, |
| 702 | .clksel_reg = OMAP_CM_REGADDR(OMAP2430_MDM_MOD, CM_CLKSEL), |
| 703 | .clksel_mask = OMAP2430_CLKSEL_MDM_MASK, |
| 704 | .clksel = mdm_ick_clksel, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 705 | .recalc = &omap2_clksel_recalc, |
| 706 | }; |
| 707 | |
| 708 | static struct clk mdm_osc_ck = { |
| 709 | .name = "mdm_osc_ck", |
Paul Walmsley | a1d5562 | 2011-02-25 15:39:30 -0700 | [diff] [blame] | 710 | .ops = &clkops_omap2_mdmclk_dflt_wait, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 711 | .parent = &osc_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 712 | .clkdm_name = "mdm_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 713 | .enable_reg = OMAP_CM_REGADDR(OMAP2430_MDM_MOD, CM_FCLKEN), |
| 714 | .enable_bit = OMAP2430_EN_OSC_SHIFT, |
| 715 | .recalc = &followparent_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 716 | }; |
| 717 | |
| 718 | /* |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 719 | * DSS clock domain |
| 720 | * CLOCKs: |
| 721 | * DSS_L4_ICLK, DSS_L3_ICLK, |
| 722 | * DSS_CLK1, DSS_CLK2, DSS_54MHz_CLK |
| 723 | * |
| 724 | * DSS is both initiator and target. |
| 725 | */ |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 726 | /* XXX Add RATE_NOT_VALIDATED */ |
| 727 | |
| 728 | static const struct clksel_rate dss1_fck_sys_rates[] = { |
Paul Walmsley | d74b494 | 2010-05-18 18:40:24 -0600 | [diff] [blame] | 729 | { .div = 1, .val = 0, .flags = RATE_IN_24XX }, |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 730 | { .div = 0 } |
| 731 | }; |
| 732 | |
| 733 | static const struct clksel_rate dss1_fck_core_rates[] = { |
| 734 | { .div = 1, .val = 1, .flags = RATE_IN_24XX }, |
| 735 | { .div = 2, .val = 2, .flags = RATE_IN_24XX }, |
| 736 | { .div = 3, .val = 3, .flags = RATE_IN_24XX }, |
| 737 | { .div = 4, .val = 4, .flags = RATE_IN_24XX }, |
| 738 | { .div = 5, .val = 5, .flags = RATE_IN_24XX }, |
| 739 | { .div = 6, .val = 6, .flags = RATE_IN_24XX }, |
| 740 | { .div = 8, .val = 8, .flags = RATE_IN_24XX }, |
| 741 | { .div = 9, .val = 9, .flags = RATE_IN_24XX }, |
| 742 | { .div = 12, .val = 12, .flags = RATE_IN_24XX }, |
Paul Walmsley | d74b494 | 2010-05-18 18:40:24 -0600 | [diff] [blame] | 743 | { .div = 16, .val = 16, .flags = RATE_IN_24XX }, |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 744 | { .div = 0 } |
| 745 | }; |
| 746 | |
| 747 | static const struct clksel dss1_fck_clksel[] = { |
| 748 | { .parent = &sys_ck, .rates = dss1_fck_sys_rates }, |
| 749 | { .parent = &core_ck, .rates = dss1_fck_core_rates }, |
| 750 | { .parent = NULL }, |
| 751 | }; |
| 752 | |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 753 | static struct clk dss_ick = { /* Enables both L3,L4 ICLK's */ |
| 754 | .name = "dss_ick", |
Paul Walmsley | a1d5562 | 2011-02-25 15:39:30 -0700 | [diff] [blame] | 755 | .ops = &clkops_omap2_iclk_dflt, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 756 | .parent = &l4_ck, /* really both l3 and l4 */ |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 757 | .clkdm_name = "dss_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 758 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| 759 | .enable_bit = OMAP24XX_EN_DSS1_SHIFT, |
| 760 | .recalc = &followparent_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 761 | }; |
| 762 | |
| 763 | static struct clk dss1_fck = { |
| 764 | .name = "dss1_fck", |
Russell King | bc51da4 | 2008-11-04 18:59:32 +0000 | [diff] [blame] | 765 | .ops = &clkops_omap2_dflt, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 766 | .parent = &core_ck, /* Core or sys */ |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 767 | .clkdm_name = "dss_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 768 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
| 769 | .enable_bit = OMAP24XX_EN_DSS1_SHIFT, |
| 770 | .init = &omap2_init_clksel_parent, |
| 771 | .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1), |
| 772 | .clksel_mask = OMAP24XX_CLKSEL_DSS1_MASK, |
| 773 | .clksel = dss1_fck_clksel, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 774 | .recalc = &omap2_clksel_recalc, |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 775 | }; |
| 776 | |
| 777 | static const struct clksel_rate dss2_fck_sys_rates[] = { |
Paul Walmsley | d74b494 | 2010-05-18 18:40:24 -0600 | [diff] [blame] | 778 | { .div = 1, .val = 0, .flags = RATE_IN_24XX }, |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 779 | { .div = 0 } |
| 780 | }; |
| 781 | |
| 782 | static const struct clksel_rate dss2_fck_48m_rates[] = { |
Paul Walmsley | d74b494 | 2010-05-18 18:40:24 -0600 | [diff] [blame] | 783 | { .div = 1, .val = 1, .flags = RATE_IN_24XX }, |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 784 | { .div = 0 } |
| 785 | }; |
| 786 | |
| 787 | static const struct clksel dss2_fck_clksel[] = { |
| 788 | { .parent = &sys_ck, .rates = dss2_fck_sys_rates }, |
| 789 | { .parent = &func_48m_ck, .rates = dss2_fck_48m_rates }, |
| 790 | { .parent = NULL } |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 791 | }; |
| 792 | |
| 793 | static struct clk dss2_fck = { /* Alt clk used in power management */ |
| 794 | .name = "dss2_fck", |
Russell King | bc51da4 | 2008-11-04 18:59:32 +0000 | [diff] [blame] | 795 | .ops = &clkops_omap2_dflt, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 796 | .parent = &sys_ck, /* fixed at sys_ck or 48MHz */ |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 797 | .clkdm_name = "dss_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 798 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
| 799 | .enable_bit = OMAP24XX_EN_DSS2_SHIFT, |
| 800 | .init = &omap2_init_clksel_parent, |
| 801 | .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1), |
| 802 | .clksel_mask = OMAP24XX_CLKSEL_DSS2_MASK, |
| 803 | .clksel = dss2_fck_clksel, |
Paul Walmsley | d4521f6 | 2010-12-21 21:08:14 -0700 | [diff] [blame] | 804 | .recalc = &omap2_clksel_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 805 | }; |
| 806 | |
| 807 | static struct clk dss_54m_fck = { /* Alt clk used in power management */ |
| 808 | .name = "dss_54m_fck", /* 54m tv clk */ |
Russell King | b36ee72 | 2008-11-04 17:59:52 +0000 | [diff] [blame] | 809 | .ops = &clkops_omap2_dflt_wait, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 810 | .parent = &func_54m_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 811 | .clkdm_name = "dss_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 812 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
| 813 | .enable_bit = OMAP24XX_EN_TV_SHIFT, |
| 814 | .recalc = &followparent_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 815 | }; |
| 816 | |
Paul Walmsley | 19c1c0c | 2011-02-16 15:38:38 -0700 | [diff] [blame^] | 817 | static struct clk wu_l4_ick = { |
| 818 | .name = "wu_l4_ick", |
| 819 | .ops = &clkops_null, |
| 820 | .parent = &sys_ck, |
| 821 | .clkdm_name = "wkup_clkdm", |
| 822 | .recalc = &followparent_recalc, |
| 823 | }; |
| 824 | |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 825 | /* |
| 826 | * CORE power domain ICLK & FCLK defines. |
| 827 | * Many of the these can have more than one possible parent. Entries |
| 828 | * here will likely have an L4 interface parent, and may have multiple |
| 829 | * functional clock parents. |
| 830 | */ |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 831 | static const struct clksel_rate gpt_alt_rates[] = { |
Paul Walmsley | d74b494 | 2010-05-18 18:40:24 -0600 | [diff] [blame] | 832 | { .div = 1, .val = 2, .flags = RATE_IN_24XX }, |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 833 | { .div = 0 } |
| 834 | }; |
| 835 | |
| 836 | static const struct clksel omap24xx_gpt_clksel[] = { |
| 837 | { .parent = &func_32k_ck, .rates = gpt_32k_rates }, |
| 838 | { .parent = &sys_ck, .rates = gpt_sys_rates }, |
| 839 | { .parent = &alt_ck, .rates = gpt_alt_rates }, |
| 840 | { .parent = NULL }, |
| 841 | }; |
| 842 | |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 843 | static struct clk gpt1_ick = { |
| 844 | .name = "gpt1_ick", |
Paul Walmsley | a1d5562 | 2011-02-25 15:39:30 -0700 | [diff] [blame] | 845 | .ops = &clkops_omap2_iclk_dflt_wait, |
Paul Walmsley | 19c1c0c | 2011-02-16 15:38:38 -0700 | [diff] [blame^] | 846 | .parent = &wu_l4_ick, |
| 847 | .clkdm_name = "wkup_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 848 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), |
| 849 | .enable_bit = OMAP24XX_EN_GPT1_SHIFT, |
| 850 | .recalc = &followparent_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 851 | }; |
| 852 | |
| 853 | static struct clk gpt1_fck = { |
| 854 | .name = "gpt1_fck", |
Russell King | b36ee72 | 2008-11-04 17:59:52 +0000 | [diff] [blame] | 855 | .ops = &clkops_omap2_dflt_wait, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 856 | .parent = &func_32k_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 857 | .clkdm_name = "core_l4_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 858 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN), |
| 859 | .enable_bit = OMAP24XX_EN_GPT1_SHIFT, |
| 860 | .init = &omap2_init_clksel_parent, |
| 861 | .clksel_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_CLKSEL1), |
| 862 | .clksel_mask = OMAP24XX_CLKSEL_GPT1_MASK, |
| 863 | .clksel = omap24xx_gpt_clksel, |
| 864 | .recalc = &omap2_clksel_recalc, |
| 865 | .round_rate = &omap2_clksel_round_rate, |
| 866 | .set_rate = &omap2_clksel_set_rate |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 867 | }; |
| 868 | |
| 869 | static struct clk gpt2_ick = { |
| 870 | .name = "gpt2_ick", |
Paul Walmsley | a1d5562 | 2011-02-25 15:39:30 -0700 | [diff] [blame] | 871 | .ops = &clkops_omap2_iclk_dflt_wait, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 872 | .parent = &l4_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 873 | .clkdm_name = "core_l4_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 874 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| 875 | .enable_bit = OMAP24XX_EN_GPT2_SHIFT, |
| 876 | .recalc = &followparent_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 877 | }; |
| 878 | |
| 879 | static struct clk gpt2_fck = { |
| 880 | .name = "gpt2_fck", |
Russell King | b36ee72 | 2008-11-04 17:59:52 +0000 | [diff] [blame] | 881 | .ops = &clkops_omap2_dflt_wait, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 882 | .parent = &func_32k_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 883 | .clkdm_name = "core_l4_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 884 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
| 885 | .enable_bit = OMAP24XX_EN_GPT2_SHIFT, |
| 886 | .init = &omap2_init_clksel_parent, |
| 887 | .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2), |
| 888 | .clksel_mask = OMAP24XX_CLKSEL_GPT2_MASK, |
| 889 | .clksel = omap24xx_gpt_clksel, |
| 890 | .recalc = &omap2_clksel_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 891 | }; |
| 892 | |
| 893 | static struct clk gpt3_ick = { |
| 894 | .name = "gpt3_ick", |
Paul Walmsley | a1d5562 | 2011-02-25 15:39:30 -0700 | [diff] [blame] | 895 | .ops = &clkops_omap2_iclk_dflt_wait, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 896 | .parent = &l4_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 897 | .clkdm_name = "core_l4_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 898 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| 899 | .enable_bit = OMAP24XX_EN_GPT3_SHIFT, |
| 900 | .recalc = &followparent_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 901 | }; |
| 902 | |
| 903 | static struct clk gpt3_fck = { |
| 904 | .name = "gpt3_fck", |
Russell King | b36ee72 | 2008-11-04 17:59:52 +0000 | [diff] [blame] | 905 | .ops = &clkops_omap2_dflt_wait, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 906 | .parent = &func_32k_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 907 | .clkdm_name = "core_l4_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 908 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
| 909 | .enable_bit = OMAP24XX_EN_GPT3_SHIFT, |
| 910 | .init = &omap2_init_clksel_parent, |
| 911 | .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2), |
| 912 | .clksel_mask = OMAP24XX_CLKSEL_GPT3_MASK, |
| 913 | .clksel = omap24xx_gpt_clksel, |
| 914 | .recalc = &omap2_clksel_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 915 | }; |
| 916 | |
| 917 | static struct clk gpt4_ick = { |
| 918 | .name = "gpt4_ick", |
Paul Walmsley | a1d5562 | 2011-02-25 15:39:30 -0700 | [diff] [blame] | 919 | .ops = &clkops_omap2_iclk_dflt_wait, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 920 | .parent = &l4_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 921 | .clkdm_name = "core_l4_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 922 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| 923 | .enable_bit = OMAP24XX_EN_GPT4_SHIFT, |
| 924 | .recalc = &followparent_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 925 | }; |
| 926 | |
| 927 | static struct clk gpt4_fck = { |
| 928 | .name = "gpt4_fck", |
Russell King | b36ee72 | 2008-11-04 17:59:52 +0000 | [diff] [blame] | 929 | .ops = &clkops_omap2_dflt_wait, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 930 | .parent = &func_32k_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 931 | .clkdm_name = "core_l4_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 932 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
| 933 | .enable_bit = OMAP24XX_EN_GPT4_SHIFT, |
| 934 | .init = &omap2_init_clksel_parent, |
| 935 | .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2), |
| 936 | .clksel_mask = OMAP24XX_CLKSEL_GPT4_MASK, |
| 937 | .clksel = omap24xx_gpt_clksel, |
| 938 | .recalc = &omap2_clksel_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 939 | }; |
| 940 | |
| 941 | static struct clk gpt5_ick = { |
| 942 | .name = "gpt5_ick", |
Paul Walmsley | a1d5562 | 2011-02-25 15:39:30 -0700 | [diff] [blame] | 943 | .ops = &clkops_omap2_iclk_dflt_wait, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 944 | .parent = &l4_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 945 | .clkdm_name = "core_l4_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 946 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| 947 | .enable_bit = OMAP24XX_EN_GPT5_SHIFT, |
| 948 | .recalc = &followparent_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 949 | }; |
| 950 | |
| 951 | static struct clk gpt5_fck = { |
| 952 | .name = "gpt5_fck", |
Russell King | b36ee72 | 2008-11-04 17:59:52 +0000 | [diff] [blame] | 953 | .ops = &clkops_omap2_dflt_wait, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 954 | .parent = &func_32k_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 955 | .clkdm_name = "core_l4_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 956 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
| 957 | .enable_bit = OMAP24XX_EN_GPT5_SHIFT, |
| 958 | .init = &omap2_init_clksel_parent, |
| 959 | .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2), |
| 960 | .clksel_mask = OMAP24XX_CLKSEL_GPT5_MASK, |
| 961 | .clksel = omap24xx_gpt_clksel, |
| 962 | .recalc = &omap2_clksel_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 963 | }; |
| 964 | |
| 965 | static struct clk gpt6_ick = { |
| 966 | .name = "gpt6_ick", |
Paul Walmsley | a1d5562 | 2011-02-25 15:39:30 -0700 | [diff] [blame] | 967 | .ops = &clkops_omap2_iclk_dflt_wait, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 968 | .parent = &l4_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 969 | .clkdm_name = "core_l4_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 970 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| 971 | .enable_bit = OMAP24XX_EN_GPT6_SHIFT, |
| 972 | .recalc = &followparent_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 973 | }; |
| 974 | |
| 975 | static struct clk gpt6_fck = { |
| 976 | .name = "gpt6_fck", |
Russell King | b36ee72 | 2008-11-04 17:59:52 +0000 | [diff] [blame] | 977 | .ops = &clkops_omap2_dflt_wait, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 978 | .parent = &func_32k_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 979 | .clkdm_name = "core_l4_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 980 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
| 981 | .enable_bit = OMAP24XX_EN_GPT6_SHIFT, |
| 982 | .init = &omap2_init_clksel_parent, |
| 983 | .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2), |
| 984 | .clksel_mask = OMAP24XX_CLKSEL_GPT6_MASK, |
| 985 | .clksel = omap24xx_gpt_clksel, |
| 986 | .recalc = &omap2_clksel_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 987 | }; |
| 988 | |
| 989 | static struct clk gpt7_ick = { |
| 990 | .name = "gpt7_ick", |
Paul Walmsley | a1d5562 | 2011-02-25 15:39:30 -0700 | [diff] [blame] | 991 | .ops = &clkops_omap2_iclk_dflt_wait, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 992 | .parent = &l4_ck, |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 993 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| 994 | .enable_bit = OMAP24XX_EN_GPT7_SHIFT, |
| 995 | .recalc = &followparent_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 996 | }; |
| 997 | |
| 998 | static struct clk gpt7_fck = { |
| 999 | .name = "gpt7_fck", |
Russell King | b36ee72 | 2008-11-04 17:59:52 +0000 | [diff] [blame] | 1000 | .ops = &clkops_omap2_dflt_wait, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1001 | .parent = &func_32k_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 1002 | .clkdm_name = "core_l4_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 1003 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
| 1004 | .enable_bit = OMAP24XX_EN_GPT7_SHIFT, |
| 1005 | .init = &omap2_init_clksel_parent, |
| 1006 | .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2), |
| 1007 | .clksel_mask = OMAP24XX_CLKSEL_GPT7_MASK, |
| 1008 | .clksel = omap24xx_gpt_clksel, |
| 1009 | .recalc = &omap2_clksel_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1010 | }; |
| 1011 | |
| 1012 | static struct clk gpt8_ick = { |
| 1013 | .name = "gpt8_ick", |
Paul Walmsley | a1d5562 | 2011-02-25 15:39:30 -0700 | [diff] [blame] | 1014 | .ops = &clkops_omap2_iclk_dflt_wait, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1015 | .parent = &l4_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 1016 | .clkdm_name = "core_l4_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 1017 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| 1018 | .enable_bit = OMAP24XX_EN_GPT8_SHIFT, |
| 1019 | .recalc = &followparent_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1020 | }; |
| 1021 | |
| 1022 | static struct clk gpt8_fck = { |
| 1023 | .name = "gpt8_fck", |
Russell King | b36ee72 | 2008-11-04 17:59:52 +0000 | [diff] [blame] | 1024 | .ops = &clkops_omap2_dflt_wait, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1025 | .parent = &func_32k_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 1026 | .clkdm_name = "core_l4_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 1027 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
| 1028 | .enable_bit = OMAP24XX_EN_GPT8_SHIFT, |
| 1029 | .init = &omap2_init_clksel_parent, |
| 1030 | .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2), |
| 1031 | .clksel_mask = OMAP24XX_CLKSEL_GPT8_MASK, |
| 1032 | .clksel = omap24xx_gpt_clksel, |
| 1033 | .recalc = &omap2_clksel_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1034 | }; |
| 1035 | |
| 1036 | static struct clk gpt9_ick = { |
| 1037 | .name = "gpt9_ick", |
Paul Walmsley | a1d5562 | 2011-02-25 15:39:30 -0700 | [diff] [blame] | 1038 | .ops = &clkops_omap2_iclk_dflt_wait, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1039 | .parent = &l4_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 1040 | .clkdm_name = "core_l4_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 1041 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| 1042 | .enable_bit = OMAP24XX_EN_GPT9_SHIFT, |
| 1043 | .recalc = &followparent_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1044 | }; |
| 1045 | |
| 1046 | static struct clk gpt9_fck = { |
| 1047 | .name = "gpt9_fck", |
Russell King | b36ee72 | 2008-11-04 17:59:52 +0000 | [diff] [blame] | 1048 | .ops = &clkops_omap2_dflt_wait, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1049 | .parent = &func_32k_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 1050 | .clkdm_name = "core_l4_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 1051 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
| 1052 | .enable_bit = OMAP24XX_EN_GPT9_SHIFT, |
| 1053 | .init = &omap2_init_clksel_parent, |
| 1054 | .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2), |
| 1055 | .clksel_mask = OMAP24XX_CLKSEL_GPT9_MASK, |
| 1056 | .clksel = omap24xx_gpt_clksel, |
| 1057 | .recalc = &omap2_clksel_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1058 | }; |
| 1059 | |
| 1060 | static struct clk gpt10_ick = { |
| 1061 | .name = "gpt10_ick", |
Paul Walmsley | a1d5562 | 2011-02-25 15:39:30 -0700 | [diff] [blame] | 1062 | .ops = &clkops_omap2_iclk_dflt_wait, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1063 | .parent = &l4_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 1064 | .clkdm_name = "core_l4_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 1065 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| 1066 | .enable_bit = OMAP24XX_EN_GPT10_SHIFT, |
| 1067 | .recalc = &followparent_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1068 | }; |
| 1069 | |
| 1070 | static struct clk gpt10_fck = { |
| 1071 | .name = "gpt10_fck", |
Russell King | b36ee72 | 2008-11-04 17:59:52 +0000 | [diff] [blame] | 1072 | .ops = &clkops_omap2_dflt_wait, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1073 | .parent = &func_32k_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 1074 | .clkdm_name = "core_l4_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 1075 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
| 1076 | .enable_bit = OMAP24XX_EN_GPT10_SHIFT, |
| 1077 | .init = &omap2_init_clksel_parent, |
| 1078 | .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2), |
| 1079 | .clksel_mask = OMAP24XX_CLKSEL_GPT10_MASK, |
| 1080 | .clksel = omap24xx_gpt_clksel, |
| 1081 | .recalc = &omap2_clksel_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1082 | }; |
| 1083 | |
| 1084 | static struct clk gpt11_ick = { |
| 1085 | .name = "gpt11_ick", |
Paul Walmsley | a1d5562 | 2011-02-25 15:39:30 -0700 | [diff] [blame] | 1086 | .ops = &clkops_omap2_iclk_dflt_wait, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1087 | .parent = &l4_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 1088 | .clkdm_name = "core_l4_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 1089 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| 1090 | .enable_bit = OMAP24XX_EN_GPT11_SHIFT, |
| 1091 | .recalc = &followparent_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1092 | }; |
| 1093 | |
| 1094 | static struct clk gpt11_fck = { |
| 1095 | .name = "gpt11_fck", |
Russell King | b36ee72 | 2008-11-04 17:59:52 +0000 | [diff] [blame] | 1096 | .ops = &clkops_omap2_dflt_wait, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1097 | .parent = &func_32k_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 1098 | .clkdm_name = "core_l4_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 1099 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
| 1100 | .enable_bit = OMAP24XX_EN_GPT11_SHIFT, |
| 1101 | .init = &omap2_init_clksel_parent, |
| 1102 | .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2), |
| 1103 | .clksel_mask = OMAP24XX_CLKSEL_GPT11_MASK, |
| 1104 | .clksel = omap24xx_gpt_clksel, |
| 1105 | .recalc = &omap2_clksel_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1106 | }; |
| 1107 | |
| 1108 | static struct clk gpt12_ick = { |
| 1109 | .name = "gpt12_ick", |
Paul Walmsley | a1d5562 | 2011-02-25 15:39:30 -0700 | [diff] [blame] | 1110 | .ops = &clkops_omap2_iclk_dflt_wait, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1111 | .parent = &l4_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 1112 | .clkdm_name = "core_l4_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 1113 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| 1114 | .enable_bit = OMAP24XX_EN_GPT12_SHIFT, |
| 1115 | .recalc = &followparent_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1116 | }; |
| 1117 | |
| 1118 | static struct clk gpt12_fck = { |
| 1119 | .name = "gpt12_fck", |
Russell King | b36ee72 | 2008-11-04 17:59:52 +0000 | [diff] [blame] | 1120 | .ops = &clkops_omap2_dflt_wait, |
Paul Walmsley | f248076 | 2009-04-23 21:11:10 -0600 | [diff] [blame] | 1121 | .parent = &secure_32k_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 1122 | .clkdm_name = "core_l4_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 1123 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
| 1124 | .enable_bit = OMAP24XX_EN_GPT12_SHIFT, |
| 1125 | .init = &omap2_init_clksel_parent, |
| 1126 | .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2), |
| 1127 | .clksel_mask = OMAP24XX_CLKSEL_GPT12_MASK, |
| 1128 | .clksel = omap24xx_gpt_clksel, |
| 1129 | .recalc = &omap2_clksel_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1130 | }; |
| 1131 | |
| 1132 | static struct clk mcbsp1_ick = { |
Paul Walmsley | b92c170 | 2010-02-22 22:09:19 -0700 | [diff] [blame] | 1133 | .name = "mcbsp1_ick", |
Paul Walmsley | a1d5562 | 2011-02-25 15:39:30 -0700 | [diff] [blame] | 1134 | .ops = &clkops_omap2_iclk_dflt_wait, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1135 | .parent = &l4_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 1136 | .clkdm_name = "core_l4_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 1137 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| 1138 | .enable_bit = OMAP24XX_EN_MCBSP1_SHIFT, |
| 1139 | .recalc = &followparent_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1140 | }; |
| 1141 | |
Paul Walmsley | b115b74 | 2010-10-08 11:40:18 -0600 | [diff] [blame] | 1142 | static const struct clksel_rate common_mcbsp_96m_rates[] = { |
| 1143 | { .div = 1, .val = 0, .flags = RATE_IN_24XX }, |
| 1144 | { .div = 0 } |
| 1145 | }; |
| 1146 | |
| 1147 | static const struct clksel_rate common_mcbsp_mcbsp_rates[] = { |
| 1148 | { .div = 1, .val = 1, .flags = RATE_IN_24XX }, |
| 1149 | { .div = 0 } |
| 1150 | }; |
| 1151 | |
| 1152 | static const struct clksel mcbsp_fck_clksel[] = { |
| 1153 | { .parent = &func_96m_ck, .rates = common_mcbsp_96m_rates }, |
| 1154 | { .parent = &mcbsp_clks, .rates = common_mcbsp_mcbsp_rates }, |
| 1155 | { .parent = NULL } |
| 1156 | }; |
| 1157 | |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1158 | static struct clk mcbsp1_fck = { |
Paul Walmsley | b92c170 | 2010-02-22 22:09:19 -0700 | [diff] [blame] | 1159 | .name = "mcbsp1_fck", |
Russell King | b36ee72 | 2008-11-04 17:59:52 +0000 | [diff] [blame] | 1160 | .ops = &clkops_omap2_dflt_wait, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1161 | .parent = &func_96m_ck, |
Paul Walmsley | b115b74 | 2010-10-08 11:40:18 -0600 | [diff] [blame] | 1162 | .init = &omap2_init_clksel_parent, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 1163 | .clkdm_name = "core_l4_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 1164 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
| 1165 | .enable_bit = OMAP24XX_EN_MCBSP1_SHIFT, |
Paul Walmsley | b115b74 | 2010-10-08 11:40:18 -0600 | [diff] [blame] | 1166 | .clksel_reg = OMAP243X_CTRL_REGADDR(OMAP2_CONTROL_DEVCONF0), |
| 1167 | .clksel_mask = OMAP2_MCBSP1_CLKS_MASK, |
| 1168 | .clksel = mcbsp_fck_clksel, |
| 1169 | .recalc = &omap2_clksel_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1170 | }; |
| 1171 | |
| 1172 | static struct clk mcbsp2_ick = { |
Paul Walmsley | b92c170 | 2010-02-22 22:09:19 -0700 | [diff] [blame] | 1173 | .name = "mcbsp2_ick", |
Paul Walmsley | a1d5562 | 2011-02-25 15:39:30 -0700 | [diff] [blame] | 1174 | .ops = &clkops_omap2_iclk_dflt_wait, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1175 | .parent = &l4_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 1176 | .clkdm_name = "core_l4_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 1177 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| 1178 | .enable_bit = OMAP24XX_EN_MCBSP2_SHIFT, |
| 1179 | .recalc = &followparent_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1180 | }; |
| 1181 | |
| 1182 | static struct clk mcbsp2_fck = { |
Paul Walmsley | b92c170 | 2010-02-22 22:09:19 -0700 | [diff] [blame] | 1183 | .name = "mcbsp2_fck", |
Russell King | b36ee72 | 2008-11-04 17:59:52 +0000 | [diff] [blame] | 1184 | .ops = &clkops_omap2_dflt_wait, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1185 | .parent = &func_96m_ck, |
Paul Walmsley | b115b74 | 2010-10-08 11:40:18 -0600 | [diff] [blame] | 1186 | .init = &omap2_init_clksel_parent, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 1187 | .clkdm_name = "core_l4_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 1188 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
| 1189 | .enable_bit = OMAP24XX_EN_MCBSP2_SHIFT, |
Paul Walmsley | b115b74 | 2010-10-08 11:40:18 -0600 | [diff] [blame] | 1190 | .clksel_reg = OMAP243X_CTRL_REGADDR(OMAP2_CONTROL_DEVCONF0), |
| 1191 | .clksel_mask = OMAP2_MCBSP2_CLKS_MASK, |
| 1192 | .clksel = mcbsp_fck_clksel, |
| 1193 | .recalc = &omap2_clksel_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1194 | }; |
| 1195 | |
| 1196 | static struct clk mcbsp3_ick = { |
Paul Walmsley | b92c170 | 2010-02-22 22:09:19 -0700 | [diff] [blame] | 1197 | .name = "mcbsp3_ick", |
Paul Walmsley | a1d5562 | 2011-02-25 15:39:30 -0700 | [diff] [blame] | 1198 | .ops = &clkops_omap2_iclk_dflt_wait, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1199 | .parent = &l4_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 1200 | .clkdm_name = "core_l4_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 1201 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), |
| 1202 | .enable_bit = OMAP2430_EN_MCBSP3_SHIFT, |
| 1203 | .recalc = &followparent_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1204 | }; |
| 1205 | |
| 1206 | static struct clk mcbsp3_fck = { |
Paul Walmsley | b92c170 | 2010-02-22 22:09:19 -0700 | [diff] [blame] | 1207 | .name = "mcbsp3_fck", |
Russell King | b36ee72 | 2008-11-04 17:59:52 +0000 | [diff] [blame] | 1208 | .ops = &clkops_omap2_dflt_wait, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1209 | .parent = &func_96m_ck, |
Paul Walmsley | b115b74 | 2010-10-08 11:40:18 -0600 | [diff] [blame] | 1210 | .init = &omap2_init_clksel_parent, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 1211 | .clkdm_name = "core_l4_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 1212 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), |
| 1213 | .enable_bit = OMAP2430_EN_MCBSP3_SHIFT, |
Paul Walmsley | b115b74 | 2010-10-08 11:40:18 -0600 | [diff] [blame] | 1214 | .clksel_reg = OMAP243X_CTRL_REGADDR(OMAP243X_CONTROL_DEVCONF1), |
| 1215 | .clksel_mask = OMAP2_MCBSP3_CLKS_MASK, |
| 1216 | .clksel = mcbsp_fck_clksel, |
| 1217 | .recalc = &omap2_clksel_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1218 | }; |
| 1219 | |
| 1220 | static struct clk mcbsp4_ick = { |
Paul Walmsley | b92c170 | 2010-02-22 22:09:19 -0700 | [diff] [blame] | 1221 | .name = "mcbsp4_ick", |
Paul Walmsley | a1d5562 | 2011-02-25 15:39:30 -0700 | [diff] [blame] | 1222 | .ops = &clkops_omap2_iclk_dflt_wait, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1223 | .parent = &l4_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 1224 | .clkdm_name = "core_l4_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 1225 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), |
| 1226 | .enable_bit = OMAP2430_EN_MCBSP4_SHIFT, |
| 1227 | .recalc = &followparent_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1228 | }; |
| 1229 | |
| 1230 | static struct clk mcbsp4_fck = { |
Paul Walmsley | b92c170 | 2010-02-22 22:09:19 -0700 | [diff] [blame] | 1231 | .name = "mcbsp4_fck", |
Russell King | b36ee72 | 2008-11-04 17:59:52 +0000 | [diff] [blame] | 1232 | .ops = &clkops_omap2_dflt_wait, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1233 | .parent = &func_96m_ck, |
Paul Walmsley | b115b74 | 2010-10-08 11:40:18 -0600 | [diff] [blame] | 1234 | .init = &omap2_init_clksel_parent, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 1235 | .clkdm_name = "core_l4_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 1236 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), |
| 1237 | .enable_bit = OMAP2430_EN_MCBSP4_SHIFT, |
Paul Walmsley | b115b74 | 2010-10-08 11:40:18 -0600 | [diff] [blame] | 1238 | .clksel_reg = OMAP243X_CTRL_REGADDR(OMAP243X_CONTROL_DEVCONF1), |
| 1239 | .clksel_mask = OMAP2_MCBSP4_CLKS_MASK, |
| 1240 | .clksel = mcbsp_fck_clksel, |
| 1241 | .recalc = &omap2_clksel_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1242 | }; |
| 1243 | |
| 1244 | static struct clk mcbsp5_ick = { |
Paul Walmsley | b92c170 | 2010-02-22 22:09:19 -0700 | [diff] [blame] | 1245 | .name = "mcbsp5_ick", |
Paul Walmsley | a1d5562 | 2011-02-25 15:39:30 -0700 | [diff] [blame] | 1246 | .ops = &clkops_omap2_iclk_dflt_wait, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1247 | .parent = &l4_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 1248 | .clkdm_name = "core_l4_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 1249 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), |
| 1250 | .enable_bit = OMAP2430_EN_MCBSP5_SHIFT, |
| 1251 | .recalc = &followparent_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1252 | }; |
| 1253 | |
| 1254 | static struct clk mcbsp5_fck = { |
Paul Walmsley | b92c170 | 2010-02-22 22:09:19 -0700 | [diff] [blame] | 1255 | .name = "mcbsp5_fck", |
Russell King | b36ee72 | 2008-11-04 17:59:52 +0000 | [diff] [blame] | 1256 | .ops = &clkops_omap2_dflt_wait, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1257 | .parent = &func_96m_ck, |
Paul Walmsley | b115b74 | 2010-10-08 11:40:18 -0600 | [diff] [blame] | 1258 | .init = &omap2_init_clksel_parent, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 1259 | .clkdm_name = "core_l4_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 1260 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), |
| 1261 | .enable_bit = OMAP2430_EN_MCBSP5_SHIFT, |
Paul Walmsley | b115b74 | 2010-10-08 11:40:18 -0600 | [diff] [blame] | 1262 | .clksel_reg = OMAP243X_CTRL_REGADDR(OMAP243X_CONTROL_DEVCONF1), |
| 1263 | .clksel_mask = OMAP2_MCBSP5_CLKS_MASK, |
| 1264 | .clksel = mcbsp_fck_clksel, |
| 1265 | .recalc = &omap2_clksel_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1266 | }; |
| 1267 | |
| 1268 | static struct clk mcspi1_ick = { |
Paul Walmsley | b92c170 | 2010-02-22 22:09:19 -0700 | [diff] [blame] | 1269 | .name = "mcspi1_ick", |
Paul Walmsley | a1d5562 | 2011-02-25 15:39:30 -0700 | [diff] [blame] | 1270 | .ops = &clkops_omap2_iclk_dflt_wait, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1271 | .parent = &l4_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 1272 | .clkdm_name = "core_l4_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 1273 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| 1274 | .enable_bit = OMAP24XX_EN_MCSPI1_SHIFT, |
| 1275 | .recalc = &followparent_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1276 | }; |
| 1277 | |
| 1278 | static struct clk mcspi1_fck = { |
Paul Walmsley | b92c170 | 2010-02-22 22:09:19 -0700 | [diff] [blame] | 1279 | .name = "mcspi1_fck", |
Russell King | b36ee72 | 2008-11-04 17:59:52 +0000 | [diff] [blame] | 1280 | .ops = &clkops_omap2_dflt_wait, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1281 | .parent = &func_48m_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 1282 | .clkdm_name = "core_l4_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 1283 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
| 1284 | .enable_bit = OMAP24XX_EN_MCSPI1_SHIFT, |
| 1285 | .recalc = &followparent_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1286 | }; |
| 1287 | |
| 1288 | static struct clk mcspi2_ick = { |
Paul Walmsley | b92c170 | 2010-02-22 22:09:19 -0700 | [diff] [blame] | 1289 | .name = "mcspi2_ick", |
Paul Walmsley | a1d5562 | 2011-02-25 15:39:30 -0700 | [diff] [blame] | 1290 | .ops = &clkops_omap2_iclk_dflt_wait, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1291 | .parent = &l4_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 1292 | .clkdm_name = "core_l4_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 1293 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| 1294 | .enable_bit = OMAP24XX_EN_MCSPI2_SHIFT, |
| 1295 | .recalc = &followparent_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1296 | }; |
| 1297 | |
| 1298 | static struct clk mcspi2_fck = { |
Paul Walmsley | b92c170 | 2010-02-22 22:09:19 -0700 | [diff] [blame] | 1299 | .name = "mcspi2_fck", |
Russell King | b36ee72 | 2008-11-04 17:59:52 +0000 | [diff] [blame] | 1300 | .ops = &clkops_omap2_dflt_wait, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1301 | .parent = &func_48m_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 1302 | .clkdm_name = "core_l4_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 1303 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
| 1304 | .enable_bit = OMAP24XX_EN_MCSPI2_SHIFT, |
| 1305 | .recalc = &followparent_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1306 | }; |
| 1307 | |
| 1308 | static struct clk mcspi3_ick = { |
Paul Walmsley | b92c170 | 2010-02-22 22:09:19 -0700 | [diff] [blame] | 1309 | .name = "mcspi3_ick", |
Paul Walmsley | a1d5562 | 2011-02-25 15:39:30 -0700 | [diff] [blame] | 1310 | .ops = &clkops_omap2_iclk_dflt_wait, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1311 | .parent = &l4_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 1312 | .clkdm_name = "core_l4_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 1313 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), |
| 1314 | .enable_bit = OMAP2430_EN_MCSPI3_SHIFT, |
| 1315 | .recalc = &followparent_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1316 | }; |
| 1317 | |
| 1318 | static struct clk mcspi3_fck = { |
Paul Walmsley | b92c170 | 2010-02-22 22:09:19 -0700 | [diff] [blame] | 1319 | .name = "mcspi3_fck", |
Russell King | b36ee72 | 2008-11-04 17:59:52 +0000 | [diff] [blame] | 1320 | .ops = &clkops_omap2_dflt_wait, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1321 | .parent = &func_48m_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 1322 | .clkdm_name = "core_l4_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 1323 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), |
| 1324 | .enable_bit = OMAP2430_EN_MCSPI3_SHIFT, |
| 1325 | .recalc = &followparent_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1326 | }; |
| 1327 | |
| 1328 | static struct clk uart1_ick = { |
| 1329 | .name = "uart1_ick", |
Paul Walmsley | a1d5562 | 2011-02-25 15:39:30 -0700 | [diff] [blame] | 1330 | .ops = &clkops_omap2_iclk_dflt_wait, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1331 | .parent = &l4_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 1332 | .clkdm_name = "core_l4_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 1333 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| 1334 | .enable_bit = OMAP24XX_EN_UART1_SHIFT, |
| 1335 | .recalc = &followparent_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1336 | }; |
| 1337 | |
| 1338 | static struct clk uart1_fck = { |
| 1339 | .name = "uart1_fck", |
Russell King | b36ee72 | 2008-11-04 17:59:52 +0000 | [diff] [blame] | 1340 | .ops = &clkops_omap2_dflt_wait, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1341 | .parent = &func_48m_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 1342 | .clkdm_name = "core_l4_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 1343 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
| 1344 | .enable_bit = OMAP24XX_EN_UART1_SHIFT, |
| 1345 | .recalc = &followparent_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1346 | }; |
| 1347 | |
| 1348 | static struct clk uart2_ick = { |
| 1349 | .name = "uart2_ick", |
Paul Walmsley | a1d5562 | 2011-02-25 15:39:30 -0700 | [diff] [blame] | 1350 | .ops = &clkops_omap2_iclk_dflt_wait, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1351 | .parent = &l4_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 1352 | .clkdm_name = "core_l4_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 1353 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| 1354 | .enable_bit = OMAP24XX_EN_UART2_SHIFT, |
| 1355 | .recalc = &followparent_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1356 | }; |
| 1357 | |
| 1358 | static struct clk uart2_fck = { |
| 1359 | .name = "uart2_fck", |
Russell King | b36ee72 | 2008-11-04 17:59:52 +0000 | [diff] [blame] | 1360 | .ops = &clkops_omap2_dflt_wait, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1361 | .parent = &func_48m_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 1362 | .clkdm_name = "core_l4_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 1363 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
| 1364 | .enable_bit = OMAP24XX_EN_UART2_SHIFT, |
| 1365 | .recalc = &followparent_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1366 | }; |
| 1367 | |
| 1368 | static struct clk uart3_ick = { |
| 1369 | .name = "uart3_ick", |
Paul Walmsley | a1d5562 | 2011-02-25 15:39:30 -0700 | [diff] [blame] | 1370 | .ops = &clkops_omap2_iclk_dflt_wait, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1371 | .parent = &l4_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 1372 | .clkdm_name = "core_l4_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 1373 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), |
| 1374 | .enable_bit = OMAP24XX_EN_UART3_SHIFT, |
| 1375 | .recalc = &followparent_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1376 | }; |
| 1377 | |
| 1378 | static struct clk uart3_fck = { |
| 1379 | .name = "uart3_fck", |
Russell King | b36ee72 | 2008-11-04 17:59:52 +0000 | [diff] [blame] | 1380 | .ops = &clkops_omap2_dflt_wait, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1381 | .parent = &func_48m_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 1382 | .clkdm_name = "core_l4_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 1383 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), |
| 1384 | .enable_bit = OMAP24XX_EN_UART3_SHIFT, |
| 1385 | .recalc = &followparent_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1386 | }; |
| 1387 | |
| 1388 | static struct clk gpios_ick = { |
| 1389 | .name = "gpios_ick", |
Paul Walmsley | a1d5562 | 2011-02-25 15:39:30 -0700 | [diff] [blame] | 1390 | .ops = &clkops_omap2_iclk_dflt_wait, |
Paul Walmsley | 19c1c0c | 2011-02-16 15:38:38 -0700 | [diff] [blame^] | 1391 | .parent = &wu_l4_ick, |
| 1392 | .clkdm_name = "wkup_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 1393 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), |
| 1394 | .enable_bit = OMAP24XX_EN_GPIOS_SHIFT, |
| 1395 | .recalc = &followparent_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1396 | }; |
| 1397 | |
| 1398 | static struct clk gpios_fck = { |
| 1399 | .name = "gpios_fck", |
Russell King | b36ee72 | 2008-11-04 17:59:52 +0000 | [diff] [blame] | 1400 | .ops = &clkops_omap2_dflt_wait, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1401 | .parent = &func_32k_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 1402 | .clkdm_name = "wkup_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 1403 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN), |
| 1404 | .enable_bit = OMAP24XX_EN_GPIOS_SHIFT, |
| 1405 | .recalc = &followparent_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1406 | }; |
| 1407 | |
| 1408 | static struct clk mpu_wdt_ick = { |
| 1409 | .name = "mpu_wdt_ick", |
Paul Walmsley | a1d5562 | 2011-02-25 15:39:30 -0700 | [diff] [blame] | 1410 | .ops = &clkops_omap2_iclk_dflt_wait, |
Paul Walmsley | 19c1c0c | 2011-02-16 15:38:38 -0700 | [diff] [blame^] | 1411 | .parent = &wu_l4_ick, |
| 1412 | .clkdm_name = "wkup_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 1413 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), |
| 1414 | .enable_bit = OMAP24XX_EN_MPU_WDT_SHIFT, |
| 1415 | .recalc = &followparent_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1416 | }; |
| 1417 | |
| 1418 | static struct clk mpu_wdt_fck = { |
| 1419 | .name = "mpu_wdt_fck", |
Russell King | b36ee72 | 2008-11-04 17:59:52 +0000 | [diff] [blame] | 1420 | .ops = &clkops_omap2_dflt_wait, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1421 | .parent = &func_32k_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 1422 | .clkdm_name = "wkup_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 1423 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN), |
| 1424 | .enable_bit = OMAP24XX_EN_MPU_WDT_SHIFT, |
| 1425 | .recalc = &followparent_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1426 | }; |
| 1427 | |
| 1428 | static struct clk sync_32k_ick = { |
| 1429 | .name = "sync_32k_ick", |
Paul Walmsley | a1d5562 | 2011-02-25 15:39:30 -0700 | [diff] [blame] | 1430 | .ops = &clkops_omap2_iclk_dflt_wait, |
Russell King | 8ad8ff6 | 2009-01-19 15:27:29 +0000 | [diff] [blame] | 1431 | .flags = ENABLE_ON_INIT, |
Paul Walmsley | 19c1c0c | 2011-02-16 15:38:38 -0700 | [diff] [blame^] | 1432 | .parent = &wu_l4_ick, |
| 1433 | .clkdm_name = "wkup_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 1434 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), |
| 1435 | .enable_bit = OMAP24XX_EN_32KSYNC_SHIFT, |
| 1436 | .recalc = &followparent_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1437 | }; |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 1438 | |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1439 | static struct clk wdt1_ick = { |
| 1440 | .name = "wdt1_ick", |
Paul Walmsley | a1d5562 | 2011-02-25 15:39:30 -0700 | [diff] [blame] | 1441 | .ops = &clkops_omap2_iclk_dflt_wait, |
Paul Walmsley | 19c1c0c | 2011-02-16 15:38:38 -0700 | [diff] [blame^] | 1442 | .parent = &wu_l4_ick, |
| 1443 | .clkdm_name = "wkup_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 1444 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), |
| 1445 | .enable_bit = OMAP24XX_EN_WDT1_SHIFT, |
| 1446 | .recalc = &followparent_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1447 | }; |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 1448 | |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1449 | static struct clk omapctrl_ick = { |
| 1450 | .name = "omapctrl_ick", |
Paul Walmsley | a1d5562 | 2011-02-25 15:39:30 -0700 | [diff] [blame] | 1451 | .ops = &clkops_omap2_iclk_dflt_wait, |
Russell King | 8ad8ff6 | 2009-01-19 15:27:29 +0000 | [diff] [blame] | 1452 | .flags = ENABLE_ON_INIT, |
Paul Walmsley | 19c1c0c | 2011-02-16 15:38:38 -0700 | [diff] [blame^] | 1453 | .parent = &wu_l4_ick, |
| 1454 | .clkdm_name = "wkup_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 1455 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), |
| 1456 | .enable_bit = OMAP24XX_EN_OMAPCTRL_SHIFT, |
| 1457 | .recalc = &followparent_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1458 | }; |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 1459 | |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1460 | static struct clk icr_ick = { |
| 1461 | .name = "icr_ick", |
Paul Walmsley | a1d5562 | 2011-02-25 15:39:30 -0700 | [diff] [blame] | 1462 | .ops = &clkops_omap2_iclk_dflt_wait, |
Paul Walmsley | 19c1c0c | 2011-02-16 15:38:38 -0700 | [diff] [blame^] | 1463 | .parent = &wu_l4_ick, |
| 1464 | .clkdm_name = "wkup_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 1465 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), |
| 1466 | .enable_bit = OMAP2430_EN_ICR_SHIFT, |
| 1467 | .recalc = &followparent_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1468 | }; |
| 1469 | |
| 1470 | static struct clk cam_ick = { |
| 1471 | .name = "cam_ick", |
Paul Walmsley | a1d5562 | 2011-02-25 15:39:30 -0700 | [diff] [blame] | 1472 | .ops = &clkops_omap2_iclk_dflt, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1473 | .parent = &l4_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 1474 | .clkdm_name = "core_l4_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 1475 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| 1476 | .enable_bit = OMAP24XX_EN_CAM_SHIFT, |
| 1477 | .recalc = &followparent_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1478 | }; |
| 1479 | |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 1480 | /* |
| 1481 | * cam_fck controls both CAM_MCLK and CAM_FCLK. It should probably be |
| 1482 | * split into two separate clocks, since the parent clocks are different |
| 1483 | * and the clockdomains are also different. |
| 1484 | */ |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1485 | static struct clk cam_fck = { |
| 1486 | .name = "cam_fck", |
Russell King | bc51da4 | 2008-11-04 18:59:32 +0000 | [diff] [blame] | 1487 | .ops = &clkops_omap2_dflt, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1488 | .parent = &func_96m_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 1489 | .clkdm_name = "core_l3_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 1490 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
| 1491 | .enable_bit = OMAP24XX_EN_CAM_SHIFT, |
| 1492 | .recalc = &followparent_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1493 | }; |
| 1494 | |
| 1495 | static struct clk mailboxes_ick = { |
| 1496 | .name = "mailboxes_ick", |
Paul Walmsley | a1d5562 | 2011-02-25 15:39:30 -0700 | [diff] [blame] | 1497 | .ops = &clkops_omap2_iclk_dflt_wait, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1498 | .parent = &l4_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 1499 | .clkdm_name = "core_l4_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 1500 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| 1501 | .enable_bit = OMAP24XX_EN_MAILBOXES_SHIFT, |
| 1502 | .recalc = &followparent_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1503 | }; |
| 1504 | |
| 1505 | static struct clk wdt4_ick = { |
| 1506 | .name = "wdt4_ick", |
Paul Walmsley | a1d5562 | 2011-02-25 15:39:30 -0700 | [diff] [blame] | 1507 | .ops = &clkops_omap2_iclk_dflt_wait, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1508 | .parent = &l4_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 1509 | .clkdm_name = "core_l4_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 1510 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| 1511 | .enable_bit = OMAP24XX_EN_WDT4_SHIFT, |
| 1512 | .recalc = &followparent_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1513 | }; |
| 1514 | |
| 1515 | static struct clk wdt4_fck = { |
| 1516 | .name = "wdt4_fck", |
Russell King | b36ee72 | 2008-11-04 17:59:52 +0000 | [diff] [blame] | 1517 | .ops = &clkops_omap2_dflt_wait, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1518 | .parent = &func_32k_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 1519 | .clkdm_name = "core_l4_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 1520 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
| 1521 | .enable_bit = OMAP24XX_EN_WDT4_SHIFT, |
| 1522 | .recalc = &followparent_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1523 | }; |
| 1524 | |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1525 | static struct clk mspro_ick = { |
| 1526 | .name = "mspro_ick", |
Paul Walmsley | a1d5562 | 2011-02-25 15:39:30 -0700 | [diff] [blame] | 1527 | .ops = &clkops_omap2_iclk_dflt_wait, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1528 | .parent = &l4_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 1529 | .clkdm_name = "core_l4_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 1530 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| 1531 | .enable_bit = OMAP24XX_EN_MSPRO_SHIFT, |
| 1532 | .recalc = &followparent_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1533 | }; |
| 1534 | |
| 1535 | static struct clk mspro_fck = { |
| 1536 | .name = "mspro_fck", |
Russell King | b36ee72 | 2008-11-04 17:59:52 +0000 | [diff] [blame] | 1537 | .ops = &clkops_omap2_dflt_wait, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1538 | .parent = &func_96m_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 1539 | .clkdm_name = "core_l4_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 1540 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
| 1541 | .enable_bit = OMAP24XX_EN_MSPRO_SHIFT, |
| 1542 | .recalc = &followparent_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1543 | }; |
| 1544 | |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1545 | static struct clk fac_ick = { |
| 1546 | .name = "fac_ick", |
Paul Walmsley | a1d5562 | 2011-02-25 15:39:30 -0700 | [diff] [blame] | 1547 | .ops = &clkops_omap2_iclk_dflt_wait, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1548 | .parent = &l4_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 1549 | .clkdm_name = "core_l4_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 1550 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| 1551 | .enable_bit = OMAP24XX_EN_FAC_SHIFT, |
| 1552 | .recalc = &followparent_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1553 | }; |
| 1554 | |
| 1555 | static struct clk fac_fck = { |
| 1556 | .name = "fac_fck", |
Russell King | b36ee72 | 2008-11-04 17:59:52 +0000 | [diff] [blame] | 1557 | .ops = &clkops_omap2_dflt_wait, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1558 | .parent = &func_12m_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 1559 | .clkdm_name = "core_l4_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 1560 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
| 1561 | .enable_bit = OMAP24XX_EN_FAC_SHIFT, |
| 1562 | .recalc = &followparent_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1563 | }; |
| 1564 | |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1565 | static struct clk hdq_ick = { |
| 1566 | .name = "hdq_ick", |
Paul Walmsley | a1d5562 | 2011-02-25 15:39:30 -0700 | [diff] [blame] | 1567 | .ops = &clkops_omap2_iclk_dflt_wait, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1568 | .parent = &l4_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 1569 | .clkdm_name = "core_l4_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 1570 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| 1571 | .enable_bit = OMAP24XX_EN_HDQ_SHIFT, |
| 1572 | .recalc = &followparent_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1573 | }; |
| 1574 | |
| 1575 | static struct clk hdq_fck = { |
| 1576 | .name = "hdq_fck", |
Russell King | b36ee72 | 2008-11-04 17:59:52 +0000 | [diff] [blame] | 1577 | .ops = &clkops_omap2_dflt_wait, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1578 | .parent = &func_12m_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 1579 | .clkdm_name = "core_l4_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 1580 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
| 1581 | .enable_bit = OMAP24XX_EN_HDQ_SHIFT, |
| 1582 | .recalc = &followparent_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1583 | }; |
| 1584 | |
Paul Walmsley | 81b34fb | 2010-02-22 22:09:22 -0700 | [diff] [blame] | 1585 | /* |
| 1586 | * XXX This is marked as a 2420-only define, but it claims to be present |
| 1587 | * on 2430 also. Double-check. |
| 1588 | */ |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1589 | static struct clk i2c2_ick = { |
Paul Walmsley | b92c170 | 2010-02-22 22:09:19 -0700 | [diff] [blame] | 1590 | .name = "i2c2_ick", |
Paul Walmsley | a1d5562 | 2011-02-25 15:39:30 -0700 | [diff] [blame] | 1591 | .ops = &clkops_omap2_iclk_dflt_wait, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1592 | .parent = &l4_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 1593 | .clkdm_name = "core_l4_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 1594 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| 1595 | .enable_bit = OMAP2420_EN_I2C2_SHIFT, |
| 1596 | .recalc = &followparent_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1597 | }; |
| 1598 | |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1599 | static struct clk i2chs2_fck = { |
Paul Walmsley | b92c170 | 2010-02-22 22:09:19 -0700 | [diff] [blame] | 1600 | .name = "i2chs2_fck", |
Paul Walmsley | 3dc2197 | 2009-07-24 19:44:04 -0600 | [diff] [blame] | 1601 | .ops = &clkops_omap2430_i2chs_wait, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1602 | .parent = &func_96m_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 1603 | .clkdm_name = "core_l4_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 1604 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), |
| 1605 | .enable_bit = OMAP2430_EN_I2CHS2_SHIFT, |
| 1606 | .recalc = &followparent_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1607 | }; |
| 1608 | |
Paul Walmsley | 81b34fb | 2010-02-22 22:09:22 -0700 | [diff] [blame] | 1609 | /* |
| 1610 | * XXX This is marked as a 2420-only define, but it claims to be present |
| 1611 | * on 2430 also. Double-check. |
| 1612 | */ |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1613 | static struct clk i2c1_ick = { |
Paul Walmsley | b92c170 | 2010-02-22 22:09:19 -0700 | [diff] [blame] | 1614 | .name = "i2c1_ick", |
Paul Walmsley | a1d5562 | 2011-02-25 15:39:30 -0700 | [diff] [blame] | 1615 | .ops = &clkops_omap2_iclk_dflt_wait, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1616 | .parent = &l4_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 1617 | .clkdm_name = "core_l4_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 1618 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
| 1619 | .enable_bit = OMAP2420_EN_I2C1_SHIFT, |
| 1620 | .recalc = &followparent_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1621 | }; |
| 1622 | |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1623 | static struct clk i2chs1_fck = { |
Paul Walmsley | b92c170 | 2010-02-22 22:09:19 -0700 | [diff] [blame] | 1624 | .name = "i2chs1_fck", |
Paul Walmsley | 3dc2197 | 2009-07-24 19:44:04 -0600 | [diff] [blame] | 1625 | .ops = &clkops_omap2430_i2chs_wait, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1626 | .parent = &func_96m_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 1627 | .clkdm_name = "core_l4_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 1628 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), |
| 1629 | .enable_bit = OMAP2430_EN_I2CHS1_SHIFT, |
| 1630 | .recalc = &followparent_recalc, |
| 1631 | }; |
| 1632 | |
Paul Walmsley | a1d5562 | 2011-02-25 15:39:30 -0700 | [diff] [blame] | 1633 | /* |
| 1634 | * The enable_reg/enable_bit in this clock is only used for CM_AUTOIDLE |
| 1635 | * accesses derived from this data. |
| 1636 | */ |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 1637 | static struct clk gpmc_fck = { |
| 1638 | .name = "gpmc_fck", |
Paul Walmsley | a1d5562 | 2011-02-25 15:39:30 -0700 | [diff] [blame] | 1639 | .ops = &clkops_omap2_iclk_idle_only, |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 1640 | .parent = &core_l3_ck, |
Russell King | 8ad8ff6 | 2009-01-19 15:27:29 +0000 | [diff] [blame] | 1641 | .flags = ENABLE_ON_INIT, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 1642 | .clkdm_name = "core_l3_clkdm", |
Paul Walmsley | a1d5562 | 2011-02-25 15:39:30 -0700 | [diff] [blame] | 1643 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN3), |
| 1644 | .enable_bit = OMAP24XX_AUTO_GPMC_SHIFT, |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 1645 | .recalc = &followparent_recalc, |
| 1646 | }; |
| 1647 | |
| 1648 | static struct clk sdma_fck = { |
| 1649 | .name = "sdma_fck", |
Russell King | 897dcde | 2008-11-04 16:35:03 +0000 | [diff] [blame] | 1650 | .ops = &clkops_null, /* RMK: missing? */ |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 1651 | .parent = &core_l3_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 1652 | .clkdm_name = "core_l3_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 1653 | .recalc = &followparent_recalc, |
| 1654 | }; |
| 1655 | |
Paul Walmsley | a1d5562 | 2011-02-25 15:39:30 -0700 | [diff] [blame] | 1656 | /* |
| 1657 | * The enable_reg/enable_bit in this clock is only used for CM_AUTOIDLE |
| 1658 | * accesses derived from this data. |
| 1659 | */ |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 1660 | static struct clk sdma_ick = { |
| 1661 | .name = "sdma_ick", |
Paul Walmsley | a1d5562 | 2011-02-25 15:39:30 -0700 | [diff] [blame] | 1662 | .ops = &clkops_omap2_iclk_idle_only, |
Paul Walmsley | a1fed57 | 2011-02-25 15:51:02 -0700 | [diff] [blame] | 1663 | .parent = &core_l3_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 1664 | .clkdm_name = "core_l3_clkdm", |
Paul Walmsley | a1d5562 | 2011-02-25 15:39:30 -0700 | [diff] [blame] | 1665 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN3), |
| 1666 | .enable_bit = OMAP24XX_AUTO_SDMA_SHIFT, |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 1667 | .recalc = &followparent_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1668 | }; |
| 1669 | |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1670 | static struct clk sdrc_ick = { |
| 1671 | .name = "sdrc_ick", |
Paul Walmsley | a1d5562 | 2011-02-25 15:39:30 -0700 | [diff] [blame] | 1672 | .ops = &clkops_omap2_iclk_idle_only, |
Paul Walmsley | a1fed57 | 2011-02-25 15:51:02 -0700 | [diff] [blame] | 1673 | .parent = &core_l3_ck, |
Russell King | 8ad8ff6 | 2009-01-19 15:27:29 +0000 | [diff] [blame] | 1674 | .flags = ENABLE_ON_INIT, |
Paul Walmsley | a1fed57 | 2011-02-25 15:51:02 -0700 | [diff] [blame] | 1675 | .clkdm_name = "core_l3_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 1676 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN3), |
| 1677 | .enable_bit = OMAP2430_EN_SDRC_SHIFT, |
| 1678 | .recalc = &followparent_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1679 | }; |
| 1680 | |
| 1681 | static struct clk des_ick = { |
| 1682 | .name = "des_ick", |
Paul Walmsley | a1d5562 | 2011-02-25 15:39:30 -0700 | [diff] [blame] | 1683 | .ops = &clkops_omap2_iclk_dflt_wait, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1684 | .parent = &l4_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 1685 | .clkdm_name = "core_l4_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 1686 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4), |
| 1687 | .enable_bit = OMAP24XX_EN_DES_SHIFT, |
| 1688 | .recalc = &followparent_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1689 | }; |
| 1690 | |
| 1691 | static struct clk sha_ick = { |
| 1692 | .name = "sha_ick", |
Paul Walmsley | a1d5562 | 2011-02-25 15:39:30 -0700 | [diff] [blame] | 1693 | .ops = &clkops_omap2_iclk_dflt_wait, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1694 | .parent = &l4_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 1695 | .clkdm_name = "core_l4_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 1696 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4), |
| 1697 | .enable_bit = OMAP24XX_EN_SHA_SHIFT, |
| 1698 | .recalc = &followparent_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1699 | }; |
| 1700 | |
| 1701 | static struct clk rng_ick = { |
| 1702 | .name = "rng_ick", |
Paul Walmsley | a1d5562 | 2011-02-25 15:39:30 -0700 | [diff] [blame] | 1703 | .ops = &clkops_omap2_iclk_dflt_wait, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1704 | .parent = &l4_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 1705 | .clkdm_name = "core_l4_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 1706 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4), |
| 1707 | .enable_bit = OMAP24XX_EN_RNG_SHIFT, |
| 1708 | .recalc = &followparent_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1709 | }; |
| 1710 | |
| 1711 | static struct clk aes_ick = { |
| 1712 | .name = "aes_ick", |
Paul Walmsley | a1d5562 | 2011-02-25 15:39:30 -0700 | [diff] [blame] | 1713 | .ops = &clkops_omap2_iclk_dflt_wait, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1714 | .parent = &l4_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 1715 | .clkdm_name = "core_l4_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 1716 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4), |
| 1717 | .enable_bit = OMAP24XX_EN_AES_SHIFT, |
| 1718 | .recalc = &followparent_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1719 | }; |
| 1720 | |
| 1721 | static struct clk pka_ick = { |
| 1722 | .name = "pka_ick", |
Paul Walmsley | a1d5562 | 2011-02-25 15:39:30 -0700 | [diff] [blame] | 1723 | .ops = &clkops_omap2_iclk_dflt_wait, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1724 | .parent = &l4_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 1725 | .clkdm_name = "core_l4_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 1726 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4), |
| 1727 | .enable_bit = OMAP24XX_EN_PKA_SHIFT, |
| 1728 | .recalc = &followparent_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1729 | }; |
| 1730 | |
| 1731 | static struct clk usb_fck = { |
| 1732 | .name = "usb_fck", |
Russell King | b36ee72 | 2008-11-04 17:59:52 +0000 | [diff] [blame] | 1733 | .ops = &clkops_omap2_dflt_wait, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1734 | .parent = &func_48m_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 1735 | .clkdm_name = "core_l3_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 1736 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), |
| 1737 | .enable_bit = OMAP24XX_EN_USB_SHIFT, |
| 1738 | .recalc = &followparent_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1739 | }; |
| 1740 | |
| 1741 | static struct clk usbhs_ick = { |
| 1742 | .name = "usbhs_ick", |
Paul Walmsley | a1d5562 | 2011-02-25 15:39:30 -0700 | [diff] [blame] | 1743 | .ops = &clkops_omap2_iclk_dflt_wait, |
Tony Lindgren | fde0fd4 | 2006-01-17 15:31:18 -0800 | [diff] [blame] | 1744 | .parent = &core_l3_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 1745 | .clkdm_name = "core_l3_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 1746 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), |
| 1747 | .enable_bit = OMAP2430_EN_USBHS_SHIFT, |
| 1748 | .recalc = &followparent_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1749 | }; |
| 1750 | |
| 1751 | static struct clk mmchs1_ick = { |
Paul Walmsley | b92c170 | 2010-02-22 22:09:19 -0700 | [diff] [blame] | 1752 | .name = "mmchs1_ick", |
Paul Walmsley | a1d5562 | 2011-02-25 15:39:30 -0700 | [diff] [blame] | 1753 | .ops = &clkops_omap2_iclk_dflt_wait, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1754 | .parent = &l4_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 1755 | .clkdm_name = "core_l4_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 1756 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), |
| 1757 | .enable_bit = OMAP2430_EN_MMCHS1_SHIFT, |
| 1758 | .recalc = &followparent_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1759 | }; |
| 1760 | |
| 1761 | static struct clk mmchs1_fck = { |
Paul Walmsley | b92c170 | 2010-02-22 22:09:19 -0700 | [diff] [blame] | 1762 | .name = "mmchs1_fck", |
Russell King | b36ee72 | 2008-11-04 17:59:52 +0000 | [diff] [blame] | 1763 | .ops = &clkops_omap2_dflt_wait, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1764 | .parent = &func_96m_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 1765 | .clkdm_name = "core_l3_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 1766 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), |
| 1767 | .enable_bit = OMAP2430_EN_MMCHS1_SHIFT, |
| 1768 | .recalc = &followparent_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1769 | }; |
| 1770 | |
| 1771 | static struct clk mmchs2_ick = { |
Paul Walmsley | b92c170 | 2010-02-22 22:09:19 -0700 | [diff] [blame] | 1772 | .name = "mmchs2_ick", |
Paul Walmsley | a1d5562 | 2011-02-25 15:39:30 -0700 | [diff] [blame] | 1773 | .ops = &clkops_omap2_iclk_dflt_wait, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1774 | .parent = &l4_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 1775 | .clkdm_name = "core_l4_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 1776 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), |
| 1777 | .enable_bit = OMAP2430_EN_MMCHS2_SHIFT, |
| 1778 | .recalc = &followparent_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1779 | }; |
| 1780 | |
| 1781 | static struct clk mmchs2_fck = { |
Paul Walmsley | b92c170 | 2010-02-22 22:09:19 -0700 | [diff] [blame] | 1782 | .name = "mmchs2_fck", |
Russell King | b36ee72 | 2008-11-04 17:59:52 +0000 | [diff] [blame] | 1783 | .ops = &clkops_omap2_dflt_wait, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1784 | .parent = &func_96m_ck, |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 1785 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), |
| 1786 | .enable_bit = OMAP2430_EN_MMCHS2_SHIFT, |
| 1787 | .recalc = &followparent_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1788 | }; |
| 1789 | |
| 1790 | static struct clk gpio5_ick = { |
| 1791 | .name = "gpio5_ick", |
Paul Walmsley | a1d5562 | 2011-02-25 15:39:30 -0700 | [diff] [blame] | 1792 | .ops = &clkops_omap2_iclk_dflt_wait, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1793 | .parent = &l4_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 1794 | .clkdm_name = "core_l4_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 1795 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), |
| 1796 | .enable_bit = OMAP2430_EN_GPIO5_SHIFT, |
| 1797 | .recalc = &followparent_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1798 | }; |
| 1799 | |
| 1800 | static struct clk gpio5_fck = { |
| 1801 | .name = "gpio5_fck", |
Russell King | b36ee72 | 2008-11-04 17:59:52 +0000 | [diff] [blame] | 1802 | .ops = &clkops_omap2_dflt_wait, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1803 | .parent = &func_32k_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 1804 | .clkdm_name = "core_l4_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 1805 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), |
| 1806 | .enable_bit = OMAP2430_EN_GPIO5_SHIFT, |
| 1807 | .recalc = &followparent_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1808 | }; |
| 1809 | |
| 1810 | static struct clk mdm_intc_ick = { |
| 1811 | .name = "mdm_intc_ick", |
Paul Walmsley | a1d5562 | 2011-02-25 15:39:30 -0700 | [diff] [blame] | 1812 | .ops = &clkops_omap2_iclk_dflt_wait, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1813 | .parent = &l4_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 1814 | .clkdm_name = "core_l4_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 1815 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), |
| 1816 | .enable_bit = OMAP2430_EN_MDM_INTC_SHIFT, |
| 1817 | .recalc = &followparent_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1818 | }; |
| 1819 | |
| 1820 | static struct clk mmchsdb1_fck = { |
Paul Walmsley | b92c170 | 2010-02-22 22:09:19 -0700 | [diff] [blame] | 1821 | .name = "mmchsdb1_fck", |
Russell King | b36ee72 | 2008-11-04 17:59:52 +0000 | [diff] [blame] | 1822 | .ops = &clkops_omap2_dflt_wait, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1823 | .parent = &func_32k_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 1824 | .clkdm_name = "core_l4_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 1825 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), |
| 1826 | .enable_bit = OMAP2430_EN_MMCHSDB1_SHIFT, |
| 1827 | .recalc = &followparent_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1828 | }; |
| 1829 | |
| 1830 | static struct clk mmchsdb2_fck = { |
Paul Walmsley | b92c170 | 2010-02-22 22:09:19 -0700 | [diff] [blame] | 1831 | .name = "mmchsdb2_fck", |
Russell King | b36ee72 | 2008-11-04 17:59:52 +0000 | [diff] [blame] | 1832 | .ops = &clkops_omap2_dflt_wait, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1833 | .parent = &func_32k_ck, |
Paul Walmsley | d1b03f6 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 1834 | .clkdm_name = "core_l4_clkdm", |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 1835 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), |
| 1836 | .enable_bit = OMAP2430_EN_MMCHSDB2_SHIFT, |
| 1837 | .recalc = &followparent_recalc, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1838 | }; |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 1839 | |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1840 | /* |
| 1841 | * This clock is a composite clock which does entire set changes then |
| 1842 | * forces a rebalance. It keys on the MPU speed, but it really could |
| 1843 | * be any key speed part of a set in the rate table. |
| 1844 | * |
| 1845 | * to really change a set, you need memory table sets which get changed |
| 1846 | * in sram, pre-notifiers & post notifiers, changing the top set, without |
| 1847 | * having low level display recalc's won't work... this is why dpm notifiers |
| 1848 | * work, isr's off, walk a list of clocks already _off_ and not messing with |
| 1849 | * the bus. |
| 1850 | * |
| 1851 | * This clock should have no parent. It embodies the entire upper level |
| 1852 | * active set. A parent will mess up some of the init also. |
| 1853 | */ |
| 1854 | static struct clk virt_prcm_set = { |
| 1855 | .name = "virt_prcm_set", |
Russell King | 897dcde | 2008-11-04 16:35:03 +0000 | [diff] [blame] | 1856 | .ops = &clkops_null, |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1857 | .parent = &mpu_ck, /* Indexed by mpu speed, no parent */ |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 1858 | .recalc = &omap2_table_mpu_recalc, /* sets are keyed on mpu rate */ |
Tony Lindgren | 046d6b2 | 2005-11-10 14:26:52 +0000 | [diff] [blame] | 1859 | .set_rate = &omap2_select_table_rate, |
| 1860 | .round_rate = &omap2_round_to_table_rate, |
| 1861 | }; |
Paul Walmsley | e32744b | 2008-03-18 15:47:55 +0200 | [diff] [blame] | 1862 | |
Paul Walmsley | d8a9445 | 2009-12-08 16:21:29 -0700 | [diff] [blame] | 1863 | |
| 1864 | /* |
| 1865 | * clkdev integration |
| 1866 | */ |
| 1867 | |
Paul Walmsley | 81b34fb | 2010-02-22 22:09:22 -0700 | [diff] [blame] | 1868 | static struct omap_clk omap2430_clks[] = { |
Paul Walmsley | d8a9445 | 2009-12-08 16:21:29 -0700 | [diff] [blame] | 1869 | /* external root sources */ |
Paul Walmsley | 81b34fb | 2010-02-22 22:09:22 -0700 | [diff] [blame] | 1870 | CLK(NULL, "func_32k_ck", &func_32k_ck, CK_243X), |
| 1871 | CLK(NULL, "secure_32k_ck", &secure_32k_ck, CK_243X), |
| 1872 | CLK(NULL, "osc_ck", &osc_ck, CK_243X), |
| 1873 | CLK(NULL, "sys_ck", &sys_ck, CK_243X), |
| 1874 | CLK(NULL, "alt_ck", &alt_ck, CK_243X), |
Paul Walmsley | b115b74 | 2010-10-08 11:40:18 -0600 | [diff] [blame] | 1875 | CLK("omap-mcbsp.1", "pad_fck", &mcbsp_clks, CK_243X), |
| 1876 | CLK("omap-mcbsp.2", "pad_fck", &mcbsp_clks, CK_243X), |
| 1877 | CLK("omap-mcbsp.3", "pad_fck", &mcbsp_clks, CK_243X), |
| 1878 | CLK("omap-mcbsp.4", "pad_fck", &mcbsp_clks, CK_243X), |
| 1879 | CLK("omap-mcbsp.5", "pad_fck", &mcbsp_clks, CK_243X), |
| 1880 | CLK(NULL, "mcbsp_clks", &mcbsp_clks, CK_243X), |
Paul Walmsley | d8a9445 | 2009-12-08 16:21:29 -0700 | [diff] [blame] | 1881 | /* internal analog sources */ |
Paul Walmsley | 81b34fb | 2010-02-22 22:09:22 -0700 | [diff] [blame] | 1882 | CLK(NULL, "dpll_ck", &dpll_ck, CK_243X), |
| 1883 | CLK(NULL, "apll96_ck", &apll96_ck, CK_243X), |
| 1884 | CLK(NULL, "apll54_ck", &apll54_ck, CK_243X), |
Paul Walmsley | d8a9445 | 2009-12-08 16:21:29 -0700 | [diff] [blame] | 1885 | /* internal prcm root sources */ |
Paul Walmsley | 81b34fb | 2010-02-22 22:09:22 -0700 | [diff] [blame] | 1886 | CLK(NULL, "func_54m_ck", &func_54m_ck, CK_243X), |
| 1887 | CLK(NULL, "core_ck", &core_ck, CK_243X), |
Paul Walmsley | b115b74 | 2010-10-08 11:40:18 -0600 | [diff] [blame] | 1888 | CLK("omap-mcbsp.1", "prcm_fck", &func_96m_ck, CK_243X), |
| 1889 | CLK("omap-mcbsp.2", "prcm_fck", &func_96m_ck, CK_243X), |
| 1890 | CLK("omap-mcbsp.3", "prcm_fck", &func_96m_ck, CK_243X), |
| 1891 | CLK("omap-mcbsp.4", "prcm_fck", &func_96m_ck, CK_243X), |
| 1892 | CLK("omap-mcbsp.5", "prcm_fck", &func_96m_ck, CK_243X), |
Paul Walmsley | 81b34fb | 2010-02-22 22:09:22 -0700 | [diff] [blame] | 1893 | CLK(NULL, "func_96m_ck", &func_96m_ck, CK_243X), |
| 1894 | CLK(NULL, "func_48m_ck", &func_48m_ck, CK_243X), |
| 1895 | CLK(NULL, "func_12m_ck", &func_12m_ck, CK_243X), |
| 1896 | CLK(NULL, "ck_wdt1_osc", &wdt1_osc_ck, CK_243X), |
| 1897 | CLK(NULL, "sys_clkout_src", &sys_clkout_src, CK_243X), |
| 1898 | CLK(NULL, "sys_clkout", &sys_clkout, CK_243X), |
| 1899 | CLK(NULL, "emul_ck", &emul_ck, CK_243X), |
Paul Walmsley | d8a9445 | 2009-12-08 16:21:29 -0700 | [diff] [blame] | 1900 | /* mpu domain clocks */ |
Paul Walmsley | 81b34fb | 2010-02-22 22:09:22 -0700 | [diff] [blame] | 1901 | CLK(NULL, "mpu_ck", &mpu_ck, CK_243X), |
Paul Walmsley | d8a9445 | 2009-12-08 16:21:29 -0700 | [diff] [blame] | 1902 | /* dsp domain clocks */ |
Paul Walmsley | 81b34fb | 2010-02-22 22:09:22 -0700 | [diff] [blame] | 1903 | CLK(NULL, "dsp_fck", &dsp_fck, CK_243X), |
| 1904 | CLK(NULL, "dsp_irate_ick", &dsp_irate_ick, CK_243X), |
Paul Walmsley | d8a9445 | 2009-12-08 16:21:29 -0700 | [diff] [blame] | 1905 | CLK(NULL, "iva2_1_ick", &iva2_1_ick, CK_243X), |
Paul Walmsley | d8a9445 | 2009-12-08 16:21:29 -0700 | [diff] [blame] | 1906 | /* GFX domain clocks */ |
Paul Walmsley | 81b34fb | 2010-02-22 22:09:22 -0700 | [diff] [blame] | 1907 | CLK(NULL, "gfx_3d_fck", &gfx_3d_fck, CK_243X), |
| 1908 | CLK(NULL, "gfx_2d_fck", &gfx_2d_fck, CK_243X), |
| 1909 | CLK(NULL, "gfx_ick", &gfx_ick, CK_243X), |
Paul Walmsley | d8a9445 | 2009-12-08 16:21:29 -0700 | [diff] [blame] | 1910 | /* Modem domain clocks */ |
| 1911 | CLK(NULL, "mdm_ick", &mdm_ick, CK_243X), |
| 1912 | CLK(NULL, "mdm_osc_ck", &mdm_osc_ck, CK_243X), |
| 1913 | /* DSS domain clocks */ |
Paul Walmsley | 81b34fb | 2010-02-22 22:09:22 -0700 | [diff] [blame] | 1914 | CLK("omapdss", "ick", &dss_ick, CK_243X), |
| 1915 | CLK("omapdss", "dss1_fck", &dss1_fck, CK_243X), |
| 1916 | CLK("omapdss", "dss2_fck", &dss2_fck, CK_243X), |
| 1917 | CLK("omapdss", "tv_fck", &dss_54m_fck, CK_243X), |
Paul Walmsley | d8a9445 | 2009-12-08 16:21:29 -0700 | [diff] [blame] | 1918 | /* L3 domain clocks */ |
Paul Walmsley | 81b34fb | 2010-02-22 22:09:22 -0700 | [diff] [blame] | 1919 | CLK(NULL, "core_l3_ck", &core_l3_ck, CK_243X), |
| 1920 | CLK(NULL, "ssi_fck", &ssi_ssr_sst_fck, CK_243X), |
| 1921 | CLK(NULL, "usb_l4_ick", &usb_l4_ick, CK_243X), |
Paul Walmsley | d8a9445 | 2009-12-08 16:21:29 -0700 | [diff] [blame] | 1922 | /* L4 domain clocks */ |
Paul Walmsley | 81b34fb | 2010-02-22 22:09:22 -0700 | [diff] [blame] | 1923 | CLK(NULL, "l4_ck", &l4_ck, CK_243X), |
| 1924 | CLK(NULL, "ssi_l4_ick", &ssi_l4_ick, CK_243X), |
Paul Walmsley | 19c1c0c | 2011-02-16 15:38:38 -0700 | [diff] [blame^] | 1925 | CLK(NULL, "wu_l4_ick", &wu_l4_ick, CK_243X), |
Paul Walmsley | d8a9445 | 2009-12-08 16:21:29 -0700 | [diff] [blame] | 1926 | /* virtual meta-group clock */ |
Paul Walmsley | 81b34fb | 2010-02-22 22:09:22 -0700 | [diff] [blame] | 1927 | CLK(NULL, "virt_prcm_set", &virt_prcm_set, CK_243X), |
Paul Walmsley | d8a9445 | 2009-12-08 16:21:29 -0700 | [diff] [blame] | 1928 | /* general l4 interface ck, multi-parent functional clk */ |
Paul Walmsley | 81b34fb | 2010-02-22 22:09:22 -0700 | [diff] [blame] | 1929 | CLK(NULL, "gpt1_ick", &gpt1_ick, CK_243X), |
| 1930 | CLK(NULL, "gpt1_fck", &gpt1_fck, CK_243X), |
| 1931 | CLK(NULL, "gpt2_ick", &gpt2_ick, CK_243X), |
| 1932 | CLK(NULL, "gpt2_fck", &gpt2_fck, CK_243X), |
| 1933 | CLK(NULL, "gpt3_ick", &gpt3_ick, CK_243X), |
| 1934 | CLK(NULL, "gpt3_fck", &gpt3_fck, CK_243X), |
| 1935 | CLK(NULL, "gpt4_ick", &gpt4_ick, CK_243X), |
| 1936 | CLK(NULL, "gpt4_fck", &gpt4_fck, CK_243X), |
| 1937 | CLK(NULL, "gpt5_ick", &gpt5_ick, CK_243X), |
| 1938 | CLK(NULL, "gpt5_fck", &gpt5_fck, CK_243X), |
| 1939 | CLK(NULL, "gpt6_ick", &gpt6_ick, CK_243X), |
| 1940 | CLK(NULL, "gpt6_fck", &gpt6_fck, CK_243X), |
| 1941 | CLK(NULL, "gpt7_ick", &gpt7_ick, CK_243X), |
| 1942 | CLK(NULL, "gpt7_fck", &gpt7_fck, CK_243X), |
| 1943 | CLK(NULL, "gpt8_ick", &gpt8_ick, CK_243X), |
| 1944 | CLK(NULL, "gpt8_fck", &gpt8_fck, CK_243X), |
| 1945 | CLK(NULL, "gpt9_ick", &gpt9_ick, CK_243X), |
| 1946 | CLK(NULL, "gpt9_fck", &gpt9_fck, CK_243X), |
| 1947 | CLK(NULL, "gpt10_ick", &gpt10_ick, CK_243X), |
| 1948 | CLK(NULL, "gpt10_fck", &gpt10_fck, CK_243X), |
| 1949 | CLK(NULL, "gpt11_ick", &gpt11_ick, CK_243X), |
| 1950 | CLK(NULL, "gpt11_fck", &gpt11_fck, CK_243X), |
| 1951 | CLK(NULL, "gpt12_ick", &gpt12_ick, CK_243X), |
| 1952 | CLK(NULL, "gpt12_fck", &gpt12_fck, CK_243X), |
| 1953 | CLK("omap-mcbsp.1", "ick", &mcbsp1_ick, CK_243X), |
| 1954 | CLK("omap-mcbsp.1", "fck", &mcbsp1_fck, CK_243X), |
| 1955 | CLK("omap-mcbsp.2", "ick", &mcbsp2_ick, CK_243X), |
| 1956 | CLK("omap-mcbsp.2", "fck", &mcbsp2_fck, CK_243X), |
Paul Walmsley | d8a9445 | 2009-12-08 16:21:29 -0700 | [diff] [blame] | 1957 | CLK("omap-mcbsp.3", "ick", &mcbsp3_ick, CK_243X), |
| 1958 | CLK("omap-mcbsp.3", "fck", &mcbsp3_fck, CK_243X), |
| 1959 | CLK("omap-mcbsp.4", "ick", &mcbsp4_ick, CK_243X), |
| 1960 | CLK("omap-mcbsp.4", "fck", &mcbsp4_fck, CK_243X), |
| 1961 | CLK("omap-mcbsp.5", "ick", &mcbsp5_ick, CK_243X), |
| 1962 | CLK("omap-mcbsp.5", "fck", &mcbsp5_fck, CK_243X), |
Paul Walmsley | 81b34fb | 2010-02-22 22:09:22 -0700 | [diff] [blame] | 1963 | CLK("omap2_mcspi.1", "ick", &mcspi1_ick, CK_243X), |
| 1964 | CLK("omap2_mcspi.1", "fck", &mcspi1_fck, CK_243X), |
| 1965 | CLK("omap2_mcspi.2", "ick", &mcspi2_ick, CK_243X), |
| 1966 | CLK("omap2_mcspi.2", "fck", &mcspi2_fck, CK_243X), |
Paul Walmsley | d8a9445 | 2009-12-08 16:21:29 -0700 | [diff] [blame] | 1967 | CLK("omap2_mcspi.3", "ick", &mcspi3_ick, CK_243X), |
| 1968 | CLK("omap2_mcspi.3", "fck", &mcspi3_fck, CK_243X), |
Paul Walmsley | 81b34fb | 2010-02-22 22:09:22 -0700 | [diff] [blame] | 1969 | CLK(NULL, "uart1_ick", &uart1_ick, CK_243X), |
| 1970 | CLK(NULL, "uart1_fck", &uart1_fck, CK_243X), |
| 1971 | CLK(NULL, "uart2_ick", &uart2_ick, CK_243X), |
| 1972 | CLK(NULL, "uart2_fck", &uart2_fck, CK_243X), |
| 1973 | CLK(NULL, "uart3_ick", &uart3_ick, CK_243X), |
| 1974 | CLK(NULL, "uart3_fck", &uart3_fck, CK_243X), |
| 1975 | CLK(NULL, "gpios_ick", &gpios_ick, CK_243X), |
| 1976 | CLK(NULL, "gpios_fck", &gpios_fck, CK_243X), |
| 1977 | CLK("omap_wdt", "ick", &mpu_wdt_ick, CK_243X), |
| 1978 | CLK("omap_wdt", "fck", &mpu_wdt_fck, CK_243X), |
| 1979 | CLK(NULL, "sync_32k_ick", &sync_32k_ick, CK_243X), |
| 1980 | CLK(NULL, "wdt1_ick", &wdt1_ick, CK_243X), |
| 1981 | CLK(NULL, "omapctrl_ick", &omapctrl_ick, CK_243X), |
Paul Walmsley | d8a9445 | 2009-12-08 16:21:29 -0700 | [diff] [blame] | 1982 | CLK(NULL, "icr_ick", &icr_ick, CK_243X), |
Paul Walmsley | 81b34fb | 2010-02-22 22:09:22 -0700 | [diff] [blame] | 1983 | CLK("omap24xxcam", "fck", &cam_fck, CK_243X), |
| 1984 | CLK("omap24xxcam", "ick", &cam_ick, CK_243X), |
| 1985 | CLK(NULL, "mailboxes_ick", &mailboxes_ick, CK_243X), |
| 1986 | CLK(NULL, "wdt4_ick", &wdt4_ick, CK_243X), |
| 1987 | CLK(NULL, "wdt4_fck", &wdt4_fck, CK_243X), |
| 1988 | CLK(NULL, "mspro_ick", &mspro_ick, CK_243X), |
| 1989 | CLK(NULL, "mspro_fck", &mspro_fck, CK_243X), |
| 1990 | CLK(NULL, "fac_ick", &fac_ick, CK_243X), |
| 1991 | CLK(NULL, "fac_fck", &fac_fck, CK_243X), |
| 1992 | CLK("omap_hdq.0", "ick", &hdq_ick, CK_243X), |
| 1993 | CLK("omap_hdq.1", "fck", &hdq_fck, CK_243X), |
Benoit Cousson | f7bb0d9 | 2010-12-09 14:24:16 +0000 | [diff] [blame] | 1994 | CLK("omap_i2c.1", "ick", &i2c1_ick, CK_243X), |
| 1995 | CLK("omap_i2c.1", "fck", &i2chs1_fck, CK_243X), |
| 1996 | CLK("omap_i2c.2", "ick", &i2c2_ick, CK_243X), |
| 1997 | CLK("omap_i2c.2", "fck", &i2chs2_fck, CK_243X), |
Paul Walmsley | 81b34fb | 2010-02-22 22:09:22 -0700 | [diff] [blame] | 1998 | CLK(NULL, "gpmc_fck", &gpmc_fck, CK_243X), |
| 1999 | CLK(NULL, "sdma_fck", &sdma_fck, CK_243X), |
| 2000 | CLK(NULL, "sdma_ick", &sdma_ick, CK_243X), |
Paul Walmsley | d8a9445 | 2009-12-08 16:21:29 -0700 | [diff] [blame] | 2001 | CLK(NULL, "sdrc_ick", &sdrc_ick, CK_243X), |
Paul Walmsley | 81b34fb | 2010-02-22 22:09:22 -0700 | [diff] [blame] | 2002 | CLK(NULL, "des_ick", &des_ick, CK_243X), |
Dmitry Kasatkin | ee5500c | 2010-05-03 11:10:03 +0800 | [diff] [blame] | 2003 | CLK("omap-sham", "ick", &sha_ick, CK_243X), |
Paul Walmsley | 81b34fb | 2010-02-22 22:09:22 -0700 | [diff] [blame] | 2004 | CLK("omap_rng", "ick", &rng_ick, CK_243X), |
Dmitry Kasatkin | 82a0c14 | 2010-08-20 13:44:46 +0000 | [diff] [blame] | 2005 | CLK("omap-aes", "ick", &aes_ick, CK_243X), |
Paul Walmsley | 81b34fb | 2010-02-22 22:09:22 -0700 | [diff] [blame] | 2006 | CLK(NULL, "pka_ick", &pka_ick, CK_243X), |
| 2007 | CLK(NULL, "usb_fck", &usb_fck, CK_243X), |
Felipe Balbi | 0349176 | 2010-12-02 09:57:08 +0200 | [diff] [blame] | 2008 | CLK("musb-omap2430", "ick", &usbhs_ick, CK_243X), |
Paul Walmsley | d8a9445 | 2009-12-08 16:21:29 -0700 | [diff] [blame] | 2009 | CLK("mmci-omap-hs.0", "ick", &mmchs1_ick, CK_243X), |
| 2010 | CLK("mmci-omap-hs.0", "fck", &mmchs1_fck, CK_243X), |
| 2011 | CLK("mmci-omap-hs.1", "ick", &mmchs2_ick, CK_243X), |
| 2012 | CLK("mmci-omap-hs.1", "fck", &mmchs2_fck, CK_243X), |
| 2013 | CLK(NULL, "gpio5_ick", &gpio5_ick, CK_243X), |
| 2014 | CLK(NULL, "gpio5_fck", &gpio5_fck, CK_243X), |
| 2015 | CLK(NULL, "mdm_intc_ick", &mdm_intc_ick, CK_243X), |
| 2016 | CLK("mmci-omap-hs.0", "mmchsdb_fck", &mmchsdb1_fck, CK_243X), |
| 2017 | CLK("mmci-omap-hs.1", "mmchsdb_fck", &mmchsdb2_fck, CK_243X), |
| 2018 | }; |
| 2019 | |
| 2020 | /* |
| 2021 | * init code |
| 2022 | */ |
| 2023 | |
Paul Walmsley | 81b34fb | 2010-02-22 22:09:22 -0700 | [diff] [blame] | 2024 | int __init omap2430_clk_init(void) |
Paul Walmsley | d8a9445 | 2009-12-08 16:21:29 -0700 | [diff] [blame] | 2025 | { |
| 2026 | const struct prcm_config *prcm; |
| 2027 | struct omap_clk *c; |
| 2028 | u32 clkrate; |
Paul Walmsley | d8a9445 | 2009-12-08 16:21:29 -0700 | [diff] [blame] | 2029 | |
Paul Walmsley | 81b34fb | 2010-02-22 22:09:22 -0700 | [diff] [blame] | 2030 | prcm_clksrc_ctrl = OMAP2430_PRCM_CLKSRC_CTRL; |
| 2031 | cm_idlest_pll = OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST); |
| 2032 | cpu_mask = RATE_IN_243X; |
| 2033 | rate_table = omap2430_rate_table; |
Paul Walmsley | d8a9445 | 2009-12-08 16:21:29 -0700 | [diff] [blame] | 2034 | |
| 2035 | clk_init(&omap2_clk_functions); |
| 2036 | |
Paul Walmsley | 81b34fb | 2010-02-22 22:09:22 -0700 | [diff] [blame] | 2037 | for (c = omap2430_clks; c < omap2430_clks + ARRAY_SIZE(omap2430_clks); |
| 2038 | c++) |
Paul Walmsley | d8a9445 | 2009-12-08 16:21:29 -0700 | [diff] [blame] | 2039 | clk_preinit(c->lk.clk); |
| 2040 | |
| 2041 | osc_ck.rate = omap2_osc_clk_recalc(&osc_ck); |
| 2042 | propagate_rate(&osc_ck); |
Paul Walmsley | 44da0a5 | 2010-01-26 20:13:08 -0700 | [diff] [blame] | 2043 | sys_ck.rate = omap2xxx_sys_clk_recalc(&sys_ck); |
Paul Walmsley | d8a9445 | 2009-12-08 16:21:29 -0700 | [diff] [blame] | 2044 | propagate_rate(&sys_ck); |
| 2045 | |
Paul Walmsley | 81b34fb | 2010-02-22 22:09:22 -0700 | [diff] [blame] | 2046 | for (c = omap2430_clks; c < omap2430_clks + ARRAY_SIZE(omap2430_clks); |
| 2047 | c++) { |
| 2048 | clkdev_add(&c->lk); |
| 2049 | clk_register(c->lk.clk); |
| 2050 | omap2_init_clk_clkdm(c->lk.clk); |
| 2051 | } |
Paul Walmsley | d8a9445 | 2009-12-08 16:21:29 -0700 | [diff] [blame] | 2052 | |
Paul Walmsley | c6461f5 | 2011-02-25 15:49:53 -0700 | [diff] [blame] | 2053 | /* Disable autoidle on all clocks; let the PM code enable it later */ |
| 2054 | omap_clk_disable_autoidle_all(); |
| 2055 | |
Paul Walmsley | d8a9445 | 2009-12-08 16:21:29 -0700 | [diff] [blame] | 2056 | /* Check the MPU rate set by bootloader */ |
| 2057 | clkrate = omap2xxx_clk_get_core_rate(&dpll_ck); |
| 2058 | for (prcm = rate_table; prcm->mpu_speed; prcm++) { |
| 2059 | if (!(prcm->flags & cpu_mask)) |
| 2060 | continue; |
| 2061 | if (prcm->xtal_speed != sys_ck.rate) |
| 2062 | continue; |
| 2063 | if (prcm->dpll_speed <= clkrate) |
| 2064 | break; |
| 2065 | } |
| 2066 | curr_prcm_set = prcm; |
| 2067 | |
| 2068 | recalculate_root_clocks(); |
| 2069 | |
Paul Walmsley | 81b34fb | 2010-02-22 22:09:22 -0700 | [diff] [blame] | 2070 | pr_info("Clocking rate (Crystal/DPLL/MPU): %ld.%01ld/%ld/%ld MHz\n", |
| 2071 | (sys_ck.rate / 1000000), (sys_ck.rate / 100000) % 10, |
| 2072 | (dpll_ck.rate / 1000000), (mpu_ck.rate / 1000000)) ; |
Paul Walmsley | d8a9445 | 2009-12-08 16:21:29 -0700 | [diff] [blame] | 2073 | |
| 2074 | /* |
| 2075 | * Only enable those clocks we will need, let the drivers |
| 2076 | * enable other clocks as necessary |
| 2077 | */ |
| 2078 | clk_enable_init_clocks(); |
| 2079 | |
| 2080 | /* Avoid sleeping sleeping during omap2_clk_prepare_for_reboot() */ |
| 2081 | vclk = clk_get(NULL, "virt_prcm_set"); |
| 2082 | sclk = clk_get(NULL, "sys_ck"); |
| 2083 | dclk = clk_get(NULL, "dpll_ck"); |
| 2084 | |
| 2085 | return 0; |
| 2086 | } |
Paul Walmsley | 6b8858a | 2008-03-18 10:35:15 +0200 | [diff] [blame] | 2087 | |