Manu Gautam | 5143b25 | 2012-01-05 19:25:23 -0800 | [diff] [blame] | 1 | /* Copyright (c) 2009-2012, Code Aurora Forum. All rights reserved. |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2 | * |
| 3 | * This program is free software; you can redistribute it and/or modify |
| 4 | * it under the terms of the GNU General Public License version 2 and |
| 5 | * only version 2 as published by the Free Software Foundation. |
| 6 | * |
| 7 | * This program is distributed in the hope that it will be useful, |
| 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 10 | * GNU General Public License for more details. |
| 11 | * |
| 12 | */ |
| 13 | |
| 14 | #include <linux/kernel.h> |
| 15 | #include <linux/init.h> |
| 16 | #include <linux/err.h> |
| 17 | #include <linux/ctype.h> |
| 18 | #include <linux/bitops.h> |
| 19 | #include <linux/io.h> |
| 20 | #include <linux/spinlock.h> |
| 21 | #include <linux/delay.h> |
| 22 | #include <linux/clk.h> |
| 23 | #include <linux/clkdev.h> |
| 24 | #include <linux/string.h> |
| 25 | |
| 26 | #include <mach/msm_iomap.h> |
| 27 | #include <mach/clk.h> |
| 28 | |
| 29 | #include "clock.h" |
| 30 | #include "clock-local.h" |
| 31 | #include "clock-pcom.h" |
| 32 | #include "clock-voter.h" |
| 33 | #include "proc_comm.h" |
| 34 | |
| 35 | #define REG_BASE(off) (MSM_CLK_CTL_BASE + (off)) |
| 36 | #define REG(off) (MSM_CLK_CTL_SH2_BASE + (off)) |
| 37 | |
| 38 | /* Shadow-region 2 (SH2) registers. */ |
| 39 | #define QUP_I2C_NS_REG REG(0x04F0) |
| 40 | #define CAM_NS_REG REG(0x0374) |
| 41 | #define CAM_VFE_NS_REG REG(0x0044) |
| 42 | #define CLK_HALT_STATEA_REG REG(0x0108) |
| 43 | #define CLK_HALT_STATEB_REG REG(0x010C) |
| 44 | #define CLK_HALT_STATEC_REG REG(0x02D4) |
| 45 | #define CSI_NS_REG REG(0x0174) |
| 46 | #define EMDH_NS_REG REG(0x0050) |
| 47 | #define GLBL_CLK_ENA_2_SC_REG REG(0x03C0) |
| 48 | #define GLBL_CLK_ENA_SC_REG REG(0x03BC) |
| 49 | #define GLBL_CLK_STATE_2_REG REG(0x037C) |
| 50 | #define GLBL_CLK_STATE_REG REG(0x0004) |
| 51 | #define GRP_2D_NS_REG REG(0x0034) |
| 52 | #define GRP_NS_REG REG(0x0084) |
| 53 | #define HDMI_NS_REG REG(0x0484) |
| 54 | #define I2C_2_NS_REG REG(0x02D8) |
| 55 | #define I2C_NS_REG REG(0x0068) |
| 56 | #define JPEG_NS_REG REG(0x0164) |
| 57 | #define LPA_CORE_CLK_MA0_REG REG(0x04F4) |
| 58 | #define LPA_CORE_CLK_MA2_REG REG(0x04FC) |
| 59 | #define LPA_NS_REG REG(0x02E8) |
| 60 | #define MDC_NS_REG REG(0x007C) |
| 61 | #define MDP_LCDC_NS_REG REG(0x0390) |
| 62 | #define MDP_NS_REG REG(0x014C) |
| 63 | #define MDP_VSYNC_REG REG(0x0460) |
| 64 | #define MFC_NS_REG REG(0x0154) |
| 65 | #define MI2S_CODEC_RX_DIV_REG REG(0x02EC) |
| 66 | #define MI2S_CODEC_TX_DIV_REG REG(0x02F0) |
| 67 | #define MI2S_DIV_REG REG(0x02E4) |
| 68 | #define MI2S_NS_REG REG(0x02E0) |
| 69 | #define MI2S_RX_NS_REG REG(0x0070) |
| 70 | #define MI2S_TX_NS_REG REG(0x0078) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 71 | #define PLL_ENA_REG REG(0x0264) |
| 72 | #define PMDH_NS_REG REG(0x008C) |
| 73 | #define SDAC_NS_REG REG(0x009C) |
| 74 | #define SDCn_NS_REG(n) REG(0x00A4+(0x8*((n)-1))) |
| 75 | #define SPI_NS_REG REG(0x02C8) |
| 76 | #define TSIF_NS_REG REG(0x00C4) |
| 77 | #define TV_NS_REG REG(0x00CC) |
| 78 | #define UART1DM_NS_REG REG(0x00D4) |
| 79 | #define UART2DM_NS_REG REG(0x00DC) |
| 80 | #define UART2_NS_REG REG(0x0464) |
| 81 | #define UART_NS_REG REG(0x00E0) |
| 82 | #define USBH2_NS_REG REG(0x046C) |
| 83 | #define USBH3_NS_REG REG(0x0470) |
| 84 | #define USBH_MD_REG REG(0x02BC) |
| 85 | #define USBH_NS_REG REG(0x02C0) |
| 86 | #define VPE_NS_REG REG(0x015C) |
| 87 | |
| 88 | /* Registers in the base (non-shadow) region. */ |
| 89 | #define CLK_TEST_BASE_REG REG_BASE(0x011C) |
| 90 | #define CLK_TEST_2_BASE_REG REG_BASE(0x0384) |
| 91 | #define MISC_CLK_CTL_BASE_REG REG_BASE(0x0110) |
| 92 | #define PRPH_WEB_NS_BASE_REG REG_BASE(0x0080) |
| 93 | #define PLL0_STATUS_BASE_REG REG_BASE(0x0318) |
| 94 | #define PLL1_STATUS_BASE_REG REG_BASE(0x0334) |
| 95 | #define PLL2_STATUS_BASE_REG REG_BASE(0x0350) |
| 96 | #define PLL3_STATUS_BASE_REG REG_BASE(0x036C) |
| 97 | #define PLL4_STATUS_BASE_REG REG_BASE(0x0254) |
| 98 | #define PLL5_STATUS_BASE_REG REG_BASE(0x0258) |
| 99 | #define PLL6_STATUS_BASE_REG REG_BASE(0x04EC) |
| 100 | #define RINGOSC_CNT_BASE_REG REG_BASE(0x00FC) |
| 101 | #define SH2_OWN_APPS1_BASE_REG REG_BASE(0x040C) |
| 102 | #define SH2_OWN_APPS2_BASE_REG REG_BASE(0x0414) |
| 103 | #define SH2_OWN_APPS3_BASE_REG REG_BASE(0x0444) |
| 104 | #define SH2_OWN_GLBL_BASE_REG REG_BASE(0x0404) |
| 105 | #define SH2_OWN_ROW1_BASE_REG REG_BASE(0x041C) |
| 106 | #define SH2_OWN_ROW2_BASE_REG REG_BASE(0x0424) |
| 107 | #define TCXO_CNT_BASE_REG REG_BASE(0x00F8) |
| 108 | #define TCXO_CNT_DONE_BASE_REG REG_BASE(0x00F8) |
| 109 | |
| 110 | |
| 111 | /* MUX source input identifiers. */ |
| 112 | #define SRC_SEL_pll0 4 /* Modem PLL */ |
| 113 | #define SRC_SEL_pll1 1 /* Global PLL */ |
| 114 | #define SRC_SEL_pll3 3 /* Multimedia/Peripheral PLL or Backup PLL1 */ |
| 115 | #define SRC_SEL_pll4 2 /* Display PLL */ |
| 116 | #define SRC_SEL_SDAC_lpxo 5 /* Low-power XO for SDAC */ |
| 117 | #define SRC_SEL_lpxo 6 /* Low-power XO */ |
| 118 | #define SRC_SEL_tcxo 0 /* Used for rates from TCXO */ |
| 119 | #define SRC_SEL_axi 0 /* Used for rates that sync to AXI */ |
| 120 | #define SRC_SEL_gnd 7 /* No clock */ |
| 121 | |
| 122 | /* Clock declaration macros. */ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 123 | #define N8(msb, lsb, m, n) (BVAL(msb, lsb, ~(n-m)) | BVAL(6, 5, \ |
| 124 | (MN_MODE_DUAL_EDGE * !!(n)))) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 125 | #define N16(m, n) (BVAL(31, 16, ~(n-m)) | BVAL(6, 5, \ |
| 126 | (MN_MODE_DUAL_EDGE * !!(n)))) |
| 127 | #define SPDIV(s, d) (BVAL(4, 3, d-1) | BVAL(2, 0, s)) |
| 128 | #define SDIV(s, d) (BVAL(6, 3, d-1) | BVAL(2, 0, s)) |
| 129 | #define F_MASK_BASIC (BM(6, 3)|BM(2, 0)) |
| 130 | #define F_MASK_MND16 (BM(31, 16)|BM(6, 5)|BM(4, 3)|BM(2, 0)) |
| 131 | #define F_MASK_MND8(m, l) (BM(m, l)|BM(6, 5)|BM(4, 3)|BM(2, 0)) |
| 132 | |
| 133 | /* |
| 134 | * Clock frequency definitions and macros |
| 135 | */ |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 136 | #define F_BASIC(f, s, div) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 137 | { \ |
| 138 | .freq_hz = f, \ |
| 139 | .src_clk = &s##_clk.c, \ |
| 140 | .ns_val = SDIV(SRC_SEL_##s, div), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 141 | } |
| 142 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 143 | #define F_MND16(f, s, div, m, n) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 144 | { \ |
| 145 | .freq_hz = f, \ |
| 146 | .src_clk = &s##_clk.c, \ |
| 147 | .md_val = MD16(m, n), \ |
| 148 | .ns_val = N16(m, n) | SPDIV(SRC_SEL_##s, div), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 149 | } |
| 150 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 151 | #define F_MND8(f, nmsb, nlsb, s, div, m, n) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 152 | { \ |
| 153 | .freq_hz = f, \ |
| 154 | .src_clk = &s##_clk.c, \ |
Stephen Boyd | d10d264 | 2012-01-23 18:09:00 -0800 | [diff] [blame] | 155 | .md_val = MD8(8, m, 0, n), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 156 | .ns_val = N8(nmsb, nlsb, m, n) | SPDIV(SRC_SEL_##s, div), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 157 | } |
| 158 | |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 159 | static struct clk_ops clk_ops_rcg_7x30; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 160 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 161 | enum vdd_dig_levels { |
| 162 | VDD_DIG_NONE, |
| 163 | VDD_DIG_LOW, |
| 164 | VDD_DIG_NOMINAL, |
| 165 | VDD_DIG_HIGH |
| 166 | }; |
| 167 | |
| 168 | static int set_vdd_dig(struct clk_vdd_class *vdd_class, int level) |
| 169 | { |
| 170 | int rc, target_mv; |
| 171 | |
| 172 | static const int mv[] = { |
| 173 | [VDD_DIG_NONE] = 1000, |
| 174 | [VDD_DIG_LOW] = 1000, |
| 175 | [VDD_DIG_NOMINAL] = 1100, |
| 176 | [VDD_DIG_HIGH] = 1200 |
| 177 | }; |
| 178 | |
| 179 | target_mv = mv[level]; |
| 180 | rc = msm_proc_comm(PCOM_CLKCTL_RPC_MIN_MSMC1, &target_mv, NULL); |
| 181 | if (rc) |
| 182 | return rc; |
| 183 | if (target_mv) |
| 184 | rc = -EINVAL; |
| 185 | |
| 186 | return rc; |
| 187 | } |
| 188 | |
| 189 | static DEFINE_VDD_CLASS(vdd_dig, set_vdd_dig); |
| 190 | |
| 191 | #define VDD_DIG_FMAX_MAP1(l1, f1) \ |
| 192 | .vdd_class = &vdd_dig, \ |
| 193 | .fmax[VDD_DIG_##l1] = (f1) |
| 194 | #define VDD_DIG_FMAX_MAP2(l1, f1, l2, f2) \ |
| 195 | .vdd_class = &vdd_dig, \ |
| 196 | .fmax[VDD_DIG_##l1] = (f1), \ |
| 197 | .fmax[VDD_DIG_##l2] = (f2) |
| 198 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 199 | #define PCOM_XO_DISABLE 0 |
| 200 | #define PCOM_XO_ENABLE 1 |
| 201 | #define PCOM_XO_TCXO 0 |
| 202 | #define PCOM_XO_LPXO 1 |
| 203 | |
| 204 | static bool pcom_is_local(struct clk *clk) |
| 205 | { |
| 206 | return false; |
| 207 | } |
| 208 | |
| 209 | static int pcom_xo_enable(unsigned pcom_id, unsigned enable) |
| 210 | { |
| 211 | /* TODO: Check return code in pcom_id */ |
| 212 | return msm_proc_comm(PCOM_CLKCTL_RPC_SRC_REQUEST, &pcom_id, &enable); |
| 213 | } |
| 214 | |
| 215 | static int tcxo_clk_enable(struct clk *clk) |
| 216 | { |
| 217 | return pcom_xo_enable(PCOM_XO_TCXO, PCOM_XO_ENABLE); |
| 218 | } |
| 219 | |
| 220 | static void tcxo_clk_disable(struct clk *clk) |
| 221 | { |
| 222 | pcom_xo_enable(PCOM_XO_TCXO, PCOM_XO_DISABLE); |
| 223 | } |
| 224 | |
| 225 | static struct clk_ops clk_ops_tcxo = { |
| 226 | .enable = tcxo_clk_enable, |
| 227 | .disable = tcxo_clk_disable, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 228 | .is_local = pcom_is_local, |
| 229 | }; |
| 230 | |
| 231 | static struct fixed_clk tcxo_clk = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 232 | .c = { |
| 233 | .dbg_name = "tcxo_clk", |
Tianyi Gou | 7949ecb | 2012-02-14 14:25:32 -0800 | [diff] [blame] | 234 | .rate = 19200000, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 235 | .ops = &clk_ops_tcxo, |
| 236 | CLK_INIT(tcxo_clk.c), |
| 237 | }, |
| 238 | }; |
| 239 | |
| 240 | static int lpxo_clk_enable(struct clk *clk) |
| 241 | { |
| 242 | return pcom_xo_enable(PCOM_XO_LPXO, PCOM_XO_ENABLE); |
| 243 | } |
| 244 | |
| 245 | static void lpxo_clk_disable(struct clk *clk) |
| 246 | { |
| 247 | pcom_xo_enable(PCOM_XO_LPXO, PCOM_XO_DISABLE); |
| 248 | } |
| 249 | |
| 250 | static struct clk_ops clk_ops_lpxo = { |
| 251 | .enable = lpxo_clk_enable, |
| 252 | .disable = lpxo_clk_disable, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 253 | .is_local = pcom_is_local, |
| 254 | }; |
| 255 | |
| 256 | static struct fixed_clk lpxo_clk = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 257 | .c = { |
| 258 | .dbg_name = "lpxo_clk", |
Tianyi Gou | 7949ecb | 2012-02-14 14:25:32 -0800 | [diff] [blame] | 259 | .rate = 24576000, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 260 | .ops = &clk_ops_lpxo, |
| 261 | CLK_INIT(lpxo_clk.c), |
| 262 | }, |
| 263 | }; |
| 264 | |
| 265 | static struct pll_vote_clk pll1_clk = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 266 | .en_reg = PLL_ENA_REG, |
| 267 | .en_mask = BIT(1), |
| 268 | .status_reg = PLL1_STATUS_BASE_REG, |
| 269 | .parent = &tcxo_clk.c, |
| 270 | .c = { |
| 271 | .dbg_name = "pll1_clk", |
Tianyi Gou | 7949ecb | 2012-02-14 14:25:32 -0800 | [diff] [blame] | 272 | .rate = 768000000, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 273 | .ops = &clk_ops_pll_vote, |
| 274 | CLK_INIT(pll1_clk.c), |
| 275 | }, |
| 276 | }; |
| 277 | |
| 278 | static struct pll_vote_clk pll2_clk = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 279 | .en_reg = PLL_ENA_REG, |
| 280 | .en_mask = BIT(2), |
| 281 | .status_reg = PLL2_STATUS_BASE_REG, |
| 282 | .parent = &tcxo_clk.c, |
| 283 | .c = { |
| 284 | .dbg_name = "pll2_clk", |
Tianyi Gou | 7949ecb | 2012-02-14 14:25:32 -0800 | [diff] [blame] | 285 | .rate = 806400000, /* TODO: Support scaling */ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 286 | .ops = &clk_ops_pll_vote, |
| 287 | CLK_INIT(pll2_clk.c), |
| 288 | }, |
| 289 | }; |
| 290 | |
| 291 | static struct pll_vote_clk pll3_clk = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 292 | .en_reg = PLL_ENA_REG, |
| 293 | .en_mask = BIT(3), |
| 294 | .status_reg = PLL3_STATUS_BASE_REG, |
| 295 | .parent = &lpxo_clk.c, |
| 296 | .c = { |
| 297 | .dbg_name = "pll3_clk", |
Tianyi Gou | 7949ecb | 2012-02-14 14:25:32 -0800 | [diff] [blame] | 298 | .rate = 737280000, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 299 | .ops = &clk_ops_pll_vote, |
| 300 | CLK_INIT(pll3_clk.c), |
| 301 | }, |
| 302 | }; |
| 303 | |
| 304 | static struct pll_vote_clk pll4_clk = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 305 | .en_reg = PLL_ENA_REG, |
| 306 | .en_mask = BIT(4), |
| 307 | .status_reg = PLL4_STATUS_BASE_REG, |
| 308 | .parent = &lpxo_clk.c, |
| 309 | .c = { |
| 310 | .dbg_name = "pll4_clk", |
Tianyi Gou | 7949ecb | 2012-02-14 14:25:32 -0800 | [diff] [blame] | 311 | .rate = 891000000, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 312 | .ops = &clk_ops_pll_vote, |
| 313 | CLK_INIT(pll4_clk.c), |
| 314 | }, |
| 315 | }; |
| 316 | |
| 317 | static struct clk_ops clk_ops_branch; |
| 318 | |
| 319 | static struct clk_freq_tbl clk_tbl_axi[] = { |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame^] | 320 | F_RAW(1, &lpxo_clk.c, 0, 0, 0, NULL), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 321 | F_END, |
| 322 | }; |
| 323 | |
| 324 | /* For global clocks to be on we must have GLBL_ROOT_ENA set */ |
| 325 | static struct rcg_clk glbl_root_clk = { |
| 326 | .b = { |
| 327 | .ctl_reg = GLBL_CLK_ENA_SC_REG, |
| 328 | .en_mask = BIT(29), |
| 329 | .halt_check = NOCHECK, |
| 330 | }, |
| 331 | .freq_tbl = clk_tbl_axi, |
| 332 | .set_rate = set_rate_nop, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 333 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 334 | .set_rate = set_rate_nop, |
| 335 | .c = { |
| 336 | .dbg_name = "glbl_root_clk", |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 337 | .ops = &clk_ops_rcg_7x30, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 338 | VDD_DIG_FMAX_MAP1(NOMINAL, 1), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 339 | CLK_INIT(glbl_root_clk.c), |
| 340 | }, |
| 341 | }; |
| 342 | |
| 343 | /* AXI bridge clocks. */ |
| 344 | static struct branch_clk axi_li_apps_clk = { |
| 345 | .b = { |
| 346 | .ctl_reg = GLBL_CLK_ENA_SC_REG, |
| 347 | .en_mask = BIT(2), |
| 348 | .halt_reg = GLBL_CLK_STATE_REG, |
| 349 | .halt_check = HALT_VOTED, |
| 350 | .halt_bit = 2, |
| 351 | }, |
| 352 | .parent = &glbl_root_clk.c, |
| 353 | .c = { |
| 354 | .dbg_name = "axi_li_apps_clk", |
| 355 | .ops = &clk_ops_branch, |
| 356 | CLK_INIT(axi_li_apps_clk.c), |
| 357 | }, |
| 358 | }; |
| 359 | |
| 360 | static struct branch_clk axi_li_adsp_a_clk = { |
| 361 | .b = { |
| 362 | .ctl_reg = GLBL_CLK_ENA_2_SC_REG, |
| 363 | .en_mask = BIT(14), |
| 364 | .halt_reg = GLBL_CLK_STATE_2_REG, |
| 365 | .halt_check = HALT_VOTED, |
| 366 | .halt_bit = 14, |
| 367 | }, |
| 368 | .parent = &axi_li_apps_clk.c, |
| 369 | .c = { |
| 370 | .dbg_name = "axi_li_adsp_a_clk", |
| 371 | .ops = &clk_ops_branch, |
| 372 | CLK_INIT(axi_li_adsp_a_clk.c), |
| 373 | }, |
| 374 | }; |
| 375 | |
| 376 | static struct branch_clk axi_li_jpeg_clk = { |
| 377 | .b = { |
| 378 | .ctl_reg = GLBL_CLK_ENA_2_SC_REG, |
| 379 | .en_mask = BIT(19), |
| 380 | .halt_reg = GLBL_CLK_STATE_2_REG, |
| 381 | .halt_check = HALT_VOTED, |
| 382 | .halt_bit = 19, |
| 383 | }, |
| 384 | .parent = &axi_li_apps_clk.c, |
| 385 | .c = { |
| 386 | .dbg_name = "axi_li_jpeg_clk", |
| 387 | .ops = &clk_ops_branch, |
| 388 | CLK_INIT(axi_li_jpeg_clk.c), |
| 389 | }, |
| 390 | }; |
| 391 | |
| 392 | static struct branch_clk axi_li_vfe_clk = { |
| 393 | .b = { |
| 394 | .ctl_reg = GLBL_CLK_ENA_SC_REG, |
| 395 | .en_mask = BIT(23), |
| 396 | .halt_reg = GLBL_CLK_STATE_REG, |
| 397 | .halt_check = HALT_VOTED, |
| 398 | .halt_bit = 23, |
| 399 | }, |
| 400 | .parent = &axi_li_apps_clk.c, |
| 401 | .c = { |
| 402 | .dbg_name = "axi_li_vfe_clk", |
| 403 | .ops = &clk_ops_branch, |
| 404 | CLK_INIT(axi_li_vfe_clk.c), |
| 405 | }, |
| 406 | }; |
| 407 | |
| 408 | static struct branch_clk axi_mdp_clk = { |
| 409 | .b = { |
| 410 | .ctl_reg = GLBL_CLK_ENA_2_SC_REG, |
| 411 | .en_mask = BIT(29), |
| 412 | .halt_reg = GLBL_CLK_STATE_2_REG, |
| 413 | .halt_check = HALT_VOTED, |
| 414 | .halt_bit = 29, |
| 415 | }, |
| 416 | .parent = &axi_li_apps_clk.c, |
| 417 | .c = { |
| 418 | .dbg_name = "axi_mdp_clk", |
| 419 | .ops = &clk_ops_branch, |
| 420 | CLK_INIT(axi_mdp_clk.c), |
| 421 | }, |
| 422 | }; |
| 423 | |
| 424 | static struct branch_clk axi_li_vg_clk = { |
| 425 | .b = { |
| 426 | .ctl_reg = GLBL_CLK_ENA_SC_REG, |
| 427 | .en_mask = BIT(3), |
| 428 | .halt_reg = GLBL_CLK_STATE_REG, |
| 429 | .halt_check = HALT_VOTED, |
| 430 | .halt_bit = 3, |
| 431 | }, |
| 432 | .parent = &glbl_root_clk.c, |
| 433 | .c = { |
| 434 | .dbg_name = "axi_li_vg_clk", |
| 435 | .ops = &clk_ops_branch, |
| 436 | CLK_INIT(axi_li_vg_clk.c), |
| 437 | }, |
| 438 | }; |
| 439 | |
| 440 | static struct branch_clk axi_grp_2d_clk = { |
| 441 | .b = { |
| 442 | .ctl_reg = GLBL_CLK_ENA_SC_REG, |
| 443 | .en_mask = BIT(21), |
| 444 | .halt_reg = GLBL_CLK_STATE_REG, |
| 445 | .halt_check = HALT_VOTED, |
| 446 | .halt_bit = 21, |
| 447 | }, |
| 448 | .parent = &axi_li_vg_clk.c, |
| 449 | .c = { |
| 450 | .dbg_name = "axi_grp_2d_clk", |
| 451 | .ops = &clk_ops_branch, |
| 452 | CLK_INIT(axi_grp_2d_clk.c), |
| 453 | }, |
| 454 | }; |
| 455 | |
| 456 | static struct branch_clk axi_li_grp_clk = { |
| 457 | .b = { |
| 458 | .ctl_reg = GLBL_CLK_ENA_SC_REG, |
| 459 | .en_mask = BIT(22), |
| 460 | .halt_reg = GLBL_CLK_STATE_REG, |
| 461 | .halt_check = HALT_VOTED, |
| 462 | .halt_bit = 22, |
| 463 | }, |
| 464 | .parent = &axi_li_vg_clk.c, |
| 465 | .c = { |
| 466 | .dbg_name = "axi_li_grp_clk", |
| 467 | .ops = &clk_ops_branch, |
| 468 | CLK_INIT(axi_li_grp_clk.c), |
| 469 | }, |
| 470 | }; |
| 471 | |
| 472 | static struct branch_clk axi_mfc_clk = { |
| 473 | .b = { |
| 474 | .ctl_reg = GLBL_CLK_ENA_2_SC_REG, |
| 475 | .en_mask = BIT(20), |
| 476 | .halt_reg = GLBL_CLK_STATE_2_REG, |
| 477 | .halt_check = HALT_VOTED, |
| 478 | .halt_bit = 20, |
| 479 | }, |
| 480 | .parent = &axi_li_vg_clk.c, |
| 481 | .c = { |
| 482 | .dbg_name = "axi_mfc_clk", |
| 483 | .ops = &clk_ops_branch, |
| 484 | CLK_INIT(axi_mfc_clk.c), |
| 485 | }, |
| 486 | }; |
| 487 | |
| 488 | static struct branch_clk axi_rotator_clk = { |
| 489 | .b = { |
| 490 | .ctl_reg = GLBL_CLK_ENA_2_SC_REG, |
| 491 | .en_mask = BIT(22), |
| 492 | .halt_reg = GLBL_CLK_STATE_2_REG, |
| 493 | .halt_check = HALT_VOTED, |
| 494 | .halt_bit = 22, |
| 495 | .reset_mask = P_AXI_ROTATOR_CLK, |
| 496 | }, |
| 497 | .parent = &axi_li_vg_clk.c, |
| 498 | .c = { |
| 499 | .dbg_name = "axi_rotator_clk", |
| 500 | .ops = &clk_ops_branch, |
| 501 | CLK_INIT(axi_rotator_clk.c), |
| 502 | }, |
| 503 | }; |
| 504 | |
| 505 | static struct branch_clk axi_vpe_clk = { |
| 506 | .b = { |
| 507 | .ctl_reg = GLBL_CLK_ENA_2_SC_REG, |
| 508 | .en_mask = BIT(21), |
| 509 | .halt_reg = GLBL_CLK_STATE_2_REG, |
| 510 | .halt_check = HALT_VOTED, |
| 511 | .halt_bit = 21, |
| 512 | }, |
| 513 | .parent = &axi_li_vg_clk.c, |
| 514 | .c = { |
| 515 | .dbg_name = "axi_vpe_clk", |
| 516 | .ops = &clk_ops_branch, |
| 517 | CLK_INIT(axi_vpe_clk.c), |
| 518 | }, |
| 519 | }; |
| 520 | |
| 521 | /* Peripheral bus clocks. */ |
| 522 | static struct branch_clk adm_clk = { |
| 523 | .b = { |
| 524 | .ctl_reg = GLBL_CLK_ENA_SC_REG, |
| 525 | .en_mask = BIT(5), |
| 526 | .halt_reg = GLBL_CLK_STATE_REG, |
| 527 | .halt_check = HALT_VOTED, |
| 528 | .halt_bit = 5, |
| 529 | .reset_mask = P_ADM_CLK, |
| 530 | }, |
| 531 | .parent = &axi_li_apps_clk.c, |
| 532 | .c = { |
| 533 | .dbg_name = "adm_clk", |
| 534 | .ops = &clk_ops_branch, |
| 535 | CLK_INIT(adm_clk.c), |
| 536 | }, |
| 537 | }; |
| 538 | |
| 539 | static struct branch_clk adm_p_clk = { |
| 540 | .b = { |
| 541 | .ctl_reg = GLBL_CLK_ENA_2_SC_REG, |
| 542 | .en_mask = BIT(15), |
| 543 | .halt_reg = GLBL_CLK_STATE_2_REG, |
| 544 | .halt_check = HALT_VOTED, |
| 545 | .halt_bit = 15, |
| 546 | }, |
| 547 | .parent = &glbl_root_clk.c, |
| 548 | .c = { |
| 549 | .dbg_name = "adm_p_clk", |
| 550 | .ops = &clk_ops_branch, |
| 551 | CLK_INIT(adm_p_clk.c), |
| 552 | }, |
| 553 | }; |
| 554 | |
| 555 | static struct branch_clk ce_clk = { |
| 556 | .b = { |
| 557 | .ctl_reg = GLBL_CLK_ENA_SC_REG, |
| 558 | .en_mask = BIT(6), |
| 559 | .halt_reg = GLBL_CLK_STATE_REG, |
| 560 | .halt_check = HALT_VOTED, |
| 561 | .halt_bit = 6, |
| 562 | .reset_mask = P_CE_CLK, |
| 563 | }, |
| 564 | .parent = &glbl_root_clk.c, |
| 565 | .c = { |
| 566 | .dbg_name = "ce_clk", |
| 567 | .ops = &clk_ops_branch, |
| 568 | CLK_INIT(ce_clk.c), |
| 569 | }, |
| 570 | }; |
| 571 | |
| 572 | static struct branch_clk camif_pad_p_clk = { |
| 573 | .b = { |
| 574 | .ctl_reg = GLBL_CLK_ENA_SC_REG, |
| 575 | .en_mask = BIT(9), |
| 576 | .halt_reg = GLBL_CLK_STATE_REG, |
| 577 | .halt_check = HALT_VOTED, |
| 578 | .halt_bit = 9, |
| 579 | .reset_mask = P_CAMIF_PAD_P_CLK, |
| 580 | }, |
| 581 | .parent = &glbl_root_clk.c, |
| 582 | .c = { |
| 583 | .dbg_name = "camif_pad_p_clk", |
| 584 | .ops = &clk_ops_branch, |
| 585 | CLK_INIT(camif_pad_p_clk.c), |
| 586 | }, |
| 587 | }; |
| 588 | |
| 589 | static struct branch_clk csi0_p_clk = { |
| 590 | .b = { |
| 591 | .ctl_reg = GLBL_CLK_ENA_SC_REG, |
| 592 | .en_mask = BIT(30), |
| 593 | .halt_reg = GLBL_CLK_STATE_REG, |
| 594 | .halt_check = HALT_VOTED, |
| 595 | .halt_bit = 30, |
| 596 | .reset_mask = P_CSI0_P_CLK, |
| 597 | }, |
| 598 | .parent = &glbl_root_clk.c, |
| 599 | .c = { |
| 600 | .dbg_name = "csi0_p_clk", |
| 601 | .ops = &clk_ops_branch, |
| 602 | CLK_INIT(csi0_p_clk.c), |
| 603 | }, |
| 604 | }; |
| 605 | |
| 606 | static struct branch_clk emdh_p_clk = { |
| 607 | .b = { |
| 608 | .ctl_reg = GLBL_CLK_ENA_2_SC_REG, |
| 609 | .en_mask = BIT(3), |
| 610 | .halt_reg = GLBL_CLK_STATE_2_REG, |
| 611 | .halt_check = HALT_VOTED, |
| 612 | .halt_bit = 3, |
| 613 | .reset_mask = P_EMDH_P_CLK, |
| 614 | }, |
| 615 | .parent = &glbl_root_clk.c, |
| 616 | .c = { |
| 617 | .dbg_name = "emdh_p_clk", |
| 618 | .ops = &clk_ops_branch, |
| 619 | CLK_INIT(emdh_p_clk.c), |
| 620 | }, |
| 621 | }; |
| 622 | |
| 623 | static struct branch_clk grp_2d_p_clk = { |
| 624 | .b = { |
| 625 | .ctl_reg = GLBL_CLK_ENA_SC_REG, |
| 626 | .en_mask = BIT(24), |
| 627 | .halt_reg = GLBL_CLK_STATE_REG, |
| 628 | .halt_check = HALT_VOTED, |
| 629 | .halt_bit = 24, |
| 630 | .reset_mask = P_GRP_2D_P_CLK, |
| 631 | }, |
| 632 | .parent = &glbl_root_clk.c, |
| 633 | .c = { |
| 634 | .dbg_name = "grp_2d_p_clk", |
| 635 | .ops = &clk_ops_branch, |
| 636 | CLK_INIT(grp_2d_p_clk.c), |
| 637 | }, |
| 638 | }; |
| 639 | |
| 640 | static struct branch_clk grp_3d_p_clk = { |
| 641 | .b = { |
| 642 | .ctl_reg = GLBL_CLK_ENA_2_SC_REG, |
| 643 | .en_mask = BIT(17), |
| 644 | .halt_reg = GLBL_CLK_STATE_2_REG, |
| 645 | .halt_check = HALT_VOTED, |
| 646 | .halt_bit = 17, |
| 647 | .reset_mask = P_GRP_3D_P_CLK, |
| 648 | }, |
| 649 | .parent = &glbl_root_clk.c, |
| 650 | .c = { |
| 651 | .dbg_name = "grp_3d_p_clk", |
| 652 | .ops = &clk_ops_branch, |
| 653 | CLK_INIT(grp_3d_p_clk.c), |
| 654 | }, |
| 655 | }; |
| 656 | |
| 657 | static struct branch_clk jpeg_p_clk = { |
| 658 | .b = { |
| 659 | .ctl_reg = GLBL_CLK_ENA_2_SC_REG, |
| 660 | .en_mask = BIT(24), |
| 661 | .halt_reg = GLBL_CLK_STATE_2_REG, |
| 662 | .halt_check = HALT_VOTED, |
| 663 | .halt_bit = 24, |
| 664 | .reset_mask = P_JPEG_P_CLK, |
| 665 | }, |
| 666 | .parent = &glbl_root_clk.c, |
| 667 | .c = { |
| 668 | .dbg_name = "jpeg_p_clk", |
| 669 | .ops = &clk_ops_branch, |
| 670 | CLK_INIT(jpeg_p_clk.c), |
| 671 | }, |
| 672 | }; |
| 673 | |
| 674 | static struct branch_clk lpa_p_clk = { |
| 675 | .b = { |
| 676 | .ctl_reg = GLBL_CLK_ENA_2_SC_REG, |
| 677 | .en_mask = BIT(7), |
| 678 | .halt_reg = GLBL_CLK_STATE_2_REG, |
| 679 | .halt_check = HALT_VOTED, |
| 680 | .halt_bit = 7, |
| 681 | .reset_mask = P_LPA_P_CLK, |
| 682 | }, |
| 683 | .parent = &glbl_root_clk.c, |
| 684 | .c = { |
| 685 | .dbg_name = "lpa_p_clk", |
| 686 | .ops = &clk_ops_branch, |
| 687 | CLK_INIT(lpa_p_clk.c), |
| 688 | }, |
| 689 | }; |
| 690 | |
| 691 | static struct branch_clk mdp_p_clk = { |
| 692 | .b = { |
| 693 | .ctl_reg = GLBL_CLK_ENA_2_SC_REG, |
| 694 | .en_mask = BIT(6), |
| 695 | .halt_reg = GLBL_CLK_STATE_2_REG, |
| 696 | .halt_check = HALT_VOTED, |
| 697 | .halt_bit = 6, |
| 698 | .reset_mask = P_MDP_P_CLK, |
| 699 | }, |
| 700 | .parent = &glbl_root_clk.c, |
| 701 | .c = { |
| 702 | .dbg_name = "mdp_p_clk", |
| 703 | .ops = &clk_ops_branch, |
| 704 | CLK_INIT(mdp_p_clk.c), |
| 705 | }, |
| 706 | }; |
| 707 | |
| 708 | static struct branch_clk mfc_p_clk = { |
| 709 | .b = { |
| 710 | .ctl_reg = GLBL_CLK_ENA_2_SC_REG, |
| 711 | .en_mask = BIT(26), |
| 712 | .halt_reg = GLBL_CLK_STATE_2_REG, |
| 713 | .halt_check = HALT_VOTED, |
| 714 | .halt_bit = 26, |
| 715 | .reset_mask = P_MFC_P_CLK, |
| 716 | }, |
| 717 | .parent = &glbl_root_clk.c, |
| 718 | .c = { |
| 719 | .dbg_name = "mfc_p_clk", |
| 720 | .ops = &clk_ops_branch, |
| 721 | CLK_INIT(mfc_p_clk.c), |
| 722 | }, |
| 723 | }; |
| 724 | |
| 725 | static struct branch_clk pmdh_p_clk = { |
| 726 | .b = { |
| 727 | .ctl_reg = GLBL_CLK_ENA_2_SC_REG, |
| 728 | .en_mask = BIT(4), |
| 729 | .halt_reg = GLBL_CLK_STATE_2_REG, |
| 730 | .halt_check = HALT_VOTED, |
| 731 | .halt_bit = 4, |
| 732 | .reset_mask = P_PMDH_P_CLK, |
| 733 | }, |
| 734 | .parent = &glbl_root_clk.c, |
| 735 | .c = { |
| 736 | .dbg_name = "pmdh_p_clk", |
| 737 | .ops = &clk_ops_branch, |
| 738 | CLK_INIT(pmdh_p_clk.c), |
| 739 | }, |
| 740 | }; |
| 741 | |
| 742 | static struct branch_clk rotator_imem_clk = { |
| 743 | .b = { |
| 744 | .ctl_reg = GLBL_CLK_ENA_2_SC_REG, |
| 745 | .en_mask = BIT(23), |
| 746 | .halt_reg = GLBL_CLK_STATE_2_REG, |
| 747 | .halt_check = HALT_VOTED, |
| 748 | .halt_bit = 23, |
| 749 | .reset_mask = P_ROTATOR_IMEM_CLK, |
| 750 | }, |
| 751 | .parent = &glbl_root_clk.c, |
| 752 | .c = { |
| 753 | .dbg_name = "rotator_imem_clk", |
| 754 | .ops = &clk_ops_branch, |
| 755 | CLK_INIT(rotator_imem_clk.c), |
| 756 | }, |
| 757 | }; |
| 758 | |
| 759 | static struct branch_clk rotator_p_clk = { |
| 760 | .b = { |
| 761 | .ctl_reg = GLBL_CLK_ENA_2_SC_REG, |
| 762 | .en_mask = BIT(25), |
| 763 | .halt_reg = GLBL_CLK_STATE_2_REG, |
| 764 | .halt_check = HALT_VOTED, |
| 765 | .halt_bit = 25, |
| 766 | .reset_mask = P_ROTATOR_P_CLK, |
| 767 | }, |
| 768 | .parent = &glbl_root_clk.c, |
| 769 | .c = { |
| 770 | .dbg_name = "rotator_p_clk", |
| 771 | .ops = &clk_ops_branch, |
| 772 | CLK_INIT(rotator_p_clk.c), |
| 773 | }, |
| 774 | }; |
| 775 | |
| 776 | static struct branch_clk sdc1_p_clk = { |
| 777 | .b = { |
| 778 | .ctl_reg = GLBL_CLK_ENA_SC_REG, |
| 779 | .en_mask = BIT(7), |
| 780 | .halt_reg = GLBL_CLK_STATE_REG, |
| 781 | .halt_check = HALT_VOTED, |
| 782 | .halt_bit = 7, |
| 783 | .reset_mask = P_SDC1_P_CLK, |
| 784 | }, |
| 785 | .parent = &glbl_root_clk.c, |
| 786 | .c = { |
| 787 | .dbg_name = "sdc1_p_clk", |
| 788 | .ops = &clk_ops_branch, |
| 789 | CLK_INIT(sdc1_p_clk.c), |
| 790 | }, |
| 791 | }; |
| 792 | |
| 793 | static struct branch_clk sdc2_p_clk = { |
| 794 | .b = { |
| 795 | .ctl_reg = GLBL_CLK_ENA_SC_REG, |
| 796 | .en_mask = BIT(8), |
| 797 | .halt_reg = GLBL_CLK_STATE_REG, |
| 798 | .halt_check = HALT_VOTED, |
| 799 | .halt_bit = 8, |
| 800 | .reset_mask = P_SDC2_P_CLK, |
| 801 | }, |
| 802 | .parent = &glbl_root_clk.c, |
| 803 | .c = { |
| 804 | .dbg_name = "sdc2_p_clk", |
| 805 | .ops = &clk_ops_branch, |
| 806 | CLK_INIT(sdc2_p_clk.c), |
| 807 | }, |
| 808 | }; |
| 809 | |
| 810 | static struct branch_clk sdc3_p_clk = { |
| 811 | .b = { |
| 812 | .ctl_reg = GLBL_CLK_ENA_SC_REG, |
| 813 | .en_mask = BIT(27), |
| 814 | .halt_reg = GLBL_CLK_STATE_REG, |
| 815 | .halt_check = HALT_VOTED, |
| 816 | .halt_bit = 27, |
| 817 | .reset_mask = P_SDC3_P_CLK, |
| 818 | }, |
| 819 | .parent = &glbl_root_clk.c, |
| 820 | .c = { |
| 821 | .dbg_name = "sdc3_p_clk", |
| 822 | .ops = &clk_ops_branch, |
| 823 | CLK_INIT(sdc3_p_clk.c), |
| 824 | }, |
| 825 | }; |
| 826 | |
| 827 | static struct branch_clk sdc4_p_clk = { |
| 828 | .b = { |
| 829 | .ctl_reg = GLBL_CLK_ENA_SC_REG, |
| 830 | .en_mask = BIT(28), |
| 831 | .halt_reg = GLBL_CLK_STATE_REG, |
| 832 | .halt_check = HALT_VOTED, |
| 833 | .halt_bit = 28, |
| 834 | .reset_mask = P_SDC4_P_CLK, |
| 835 | }, |
| 836 | .parent = &glbl_root_clk.c, |
| 837 | .c = { |
| 838 | .dbg_name = "sdc4_p_clk", |
| 839 | .ops = &clk_ops_branch, |
| 840 | CLK_INIT(sdc4_p_clk.c), |
| 841 | }, |
| 842 | }; |
| 843 | |
| 844 | static struct branch_clk spi_p_clk = { |
| 845 | .b = { |
| 846 | .ctl_reg = GLBL_CLK_ENA_2_SC_REG, |
| 847 | .en_mask = BIT(10), |
| 848 | .halt_reg = GLBL_CLK_STATE_2_REG, |
| 849 | .halt_check = HALT_VOTED, |
| 850 | .halt_bit = 10, |
| 851 | .reset_mask = P_SPI_P_CLK, |
| 852 | }, |
| 853 | .parent = &glbl_root_clk.c, |
| 854 | .c = { |
| 855 | .dbg_name = "spi_p_clk", |
| 856 | .ops = &clk_ops_branch, |
| 857 | CLK_INIT(spi_p_clk.c), |
| 858 | }, |
| 859 | }; |
| 860 | |
| 861 | static struct branch_clk tsif_p_clk = { |
| 862 | .b = { |
| 863 | .ctl_reg = GLBL_CLK_ENA_SC_REG, |
| 864 | .en_mask = BIT(18), |
| 865 | .halt_reg = GLBL_CLK_STATE_REG, |
| 866 | .halt_check = HALT_VOTED, |
| 867 | .halt_bit = 18, |
| 868 | .reset_mask = P_TSIF_P_CLK, |
| 869 | }, |
| 870 | .parent = &glbl_root_clk.c, |
| 871 | .c = { |
| 872 | .dbg_name = "tsif_p_clk", |
| 873 | .ops = &clk_ops_branch, |
| 874 | CLK_INIT(tsif_p_clk.c), |
| 875 | }, |
| 876 | }; |
| 877 | |
| 878 | static struct branch_clk uart1dm_p_clk = { |
| 879 | .b = { |
| 880 | .ctl_reg = GLBL_CLK_ENA_SC_REG, |
| 881 | .en_mask = BIT(17), |
| 882 | .halt_reg = GLBL_CLK_STATE_REG, |
| 883 | .halt_check = HALT_VOTED, |
| 884 | .halt_bit = 17, |
| 885 | }, |
| 886 | .parent = &glbl_root_clk.c, |
| 887 | .c = { |
| 888 | .dbg_name = "uart1dm_p_clk", |
| 889 | .ops = &clk_ops_branch, |
| 890 | CLK_INIT(uart1dm_p_clk.c), |
| 891 | }, |
| 892 | }; |
| 893 | |
| 894 | static struct branch_clk uart2dm_p_clk = { |
| 895 | .b = { |
| 896 | .ctl_reg = GLBL_CLK_ENA_SC_REG, |
| 897 | .en_mask = BIT(26), |
| 898 | .halt_reg = GLBL_CLK_STATE_REG, |
| 899 | .halt_check = HALT_VOTED, |
| 900 | .halt_bit = 26, |
| 901 | }, |
| 902 | .parent = &glbl_root_clk.c, |
| 903 | .c = { |
| 904 | .dbg_name = "uart2dm_p_clk", |
| 905 | .ops = &clk_ops_branch, |
| 906 | CLK_INIT(uart2dm_p_clk.c), |
| 907 | }, |
| 908 | }; |
| 909 | |
| 910 | static struct branch_clk usb_hs2_p_clk = { |
| 911 | .b = { |
| 912 | .ctl_reg = GLBL_CLK_ENA_2_SC_REG, |
| 913 | .en_mask = BIT(8), |
| 914 | .halt_reg = GLBL_CLK_STATE_2_REG, |
| 915 | .halt_check = HALT_VOTED, |
| 916 | .halt_bit = 8, |
| 917 | .reset_mask = P_USB_HS2_P_CLK, |
| 918 | }, |
| 919 | .parent = &glbl_root_clk.c, |
| 920 | .c = { |
| 921 | .dbg_name = "usb_hs2_p_clk", |
| 922 | .ops = &clk_ops_branch, |
| 923 | CLK_INIT(usb_hs2_p_clk.c), |
| 924 | }, |
| 925 | }; |
| 926 | |
| 927 | static struct branch_clk usb_hs3_p_clk = { |
| 928 | .b = { |
| 929 | .ctl_reg = GLBL_CLK_ENA_2_SC_REG, |
| 930 | .en_mask = BIT(9), |
| 931 | .halt_reg = GLBL_CLK_STATE_2_REG, |
| 932 | .halt_check = HALT_VOTED, |
| 933 | .halt_bit = 9, |
| 934 | .reset_mask = P_USB_HS3_P_CLK, |
| 935 | }, |
| 936 | .parent = &glbl_root_clk.c, |
| 937 | .c = { |
| 938 | .dbg_name = "usb_hs3_p_clk", |
| 939 | .ops = &clk_ops_branch, |
| 940 | CLK_INIT(usb_hs3_p_clk.c), |
| 941 | }, |
| 942 | }; |
| 943 | |
| 944 | static struct branch_clk usb_hs_p_clk = { |
| 945 | .b = { |
| 946 | .ctl_reg = GLBL_CLK_ENA_SC_REG, |
| 947 | .en_mask = BIT(25), |
| 948 | .halt_reg = GLBL_CLK_STATE_REG, |
| 949 | .halt_check = HALT_VOTED, |
| 950 | .halt_bit = 25, |
| 951 | .reset_mask = P_USB_HS_P_CLK, |
| 952 | }, |
| 953 | .parent = &glbl_root_clk.c, |
| 954 | .c = { |
| 955 | .dbg_name = "usb_hs_p_clk", |
| 956 | .ops = &clk_ops_branch, |
| 957 | CLK_INIT(usb_hs_p_clk.c), |
| 958 | }, |
| 959 | }; |
| 960 | |
| 961 | static struct branch_clk vfe_p_clk = { |
| 962 | .b = { |
| 963 | .ctl_reg = GLBL_CLK_ENA_2_SC_REG, |
| 964 | .en_mask = BIT(27), |
| 965 | .halt_reg = GLBL_CLK_STATE_2_REG, |
| 966 | .halt_check = HALT_VOTED, |
| 967 | .halt_bit = 27, |
| 968 | .reset_mask = P_VFE_P_CLK, |
| 969 | }, |
| 970 | .parent = &glbl_root_clk.c, |
| 971 | .c = { |
| 972 | .dbg_name = "vfe_p_clk", |
| 973 | .ops = &clk_ops_branch, |
| 974 | CLK_INIT(vfe_p_clk.c), |
| 975 | }, |
| 976 | }; |
| 977 | |
| 978 | static struct clk_freq_tbl clk_tbl_csi[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 979 | F_MND8( 0, 0, 0, gnd, 1, 0, 0), |
| 980 | F_MND8(153600000, 24, 17, pll1, 2, 2, 5), |
| 981 | F_MND8(192000000, 24, 17, pll1, 4, 0, 0), |
| 982 | F_MND8(384000000, 24, 17, pll1, 2, 0, 0), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 983 | F_END, |
| 984 | }; |
| 985 | |
| 986 | static struct rcg_clk csi0_clk = { |
| 987 | .b = { |
| 988 | .ctl_reg = CSI_NS_REG, |
| 989 | .en_mask = BIT(9), |
| 990 | .halt_reg = CLK_HALT_STATEC_REG, |
| 991 | .halt_bit = 17, |
| 992 | .reset_mask = P_CSI0_CLK, |
| 993 | }, |
| 994 | .ns_reg = CSI_NS_REG, |
| 995 | .md_reg = CSI_NS_REG - 4, |
| 996 | .ns_mask = F_MASK_MND8(24, 17), |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame^] | 997 | .mnd_en_mask = BIT(8), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 998 | .root_en_mask = BIT(11), |
| 999 | .freq_tbl = clk_tbl_csi, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1000 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1001 | .set_rate = set_rate_mnd, |
| 1002 | .c = { |
| 1003 | .dbg_name = "csi0_clk", |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1004 | .ops = &clk_ops_rcg_7x30, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1005 | VDD_DIG_FMAX_MAP1(NOMINAL, 384000000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1006 | CLK_INIT(csi0_clk.c), |
| 1007 | }, |
| 1008 | }; |
| 1009 | |
| 1010 | static struct clk_freq_tbl clk_tbl_tcxo[] = { |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame^] | 1011 | F_RAW(19200000, &tcxo_clk.c, 0, 0, 0, NULL), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1012 | F_END, |
| 1013 | }; |
| 1014 | |
| 1015 | static struct rcg_clk i2c_clk = { |
| 1016 | .b = { |
| 1017 | .ctl_reg = I2C_NS_REG, |
| 1018 | .en_mask = BIT(9), |
| 1019 | .halt_reg = CLK_HALT_STATEA_REG, |
| 1020 | .halt_bit = 15, |
| 1021 | .reset_mask = P_I2C_CLK, |
| 1022 | }, |
| 1023 | .set_rate = set_rate_nop, |
| 1024 | .freq_tbl = clk_tbl_tcxo, |
| 1025 | .root_en_mask = BIT(11), |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1026 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1027 | .c = { |
| 1028 | .dbg_name = "i2c_clk", |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1029 | .ops = &clk_ops_rcg_7x30, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1030 | VDD_DIG_FMAX_MAP1(NOMINAL, 19200000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1031 | CLK_INIT(i2c_clk.c), |
| 1032 | }, |
| 1033 | }; |
| 1034 | |
| 1035 | static struct rcg_clk i2c_2_clk = { |
| 1036 | .b = { |
| 1037 | .ctl_reg = I2C_2_NS_REG, |
| 1038 | .en_mask = BIT(0), |
| 1039 | .halt_reg = CLK_HALT_STATEC_REG, |
| 1040 | .halt_bit = 2, |
| 1041 | .reset_mask = P_I2C_2_CLK, |
| 1042 | }, |
| 1043 | .root_en_mask = BIT(2), |
| 1044 | .freq_tbl = clk_tbl_tcxo, |
| 1045 | .set_rate = set_rate_nop, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1046 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1047 | .c = { |
| 1048 | .dbg_name = "i2c_2_clk", |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1049 | .ops = &clk_ops_rcg_7x30, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1050 | VDD_DIG_FMAX_MAP1(NOMINAL, 19200000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1051 | CLK_INIT(i2c_2_clk.c), |
| 1052 | }, |
| 1053 | }; |
| 1054 | |
| 1055 | static struct rcg_clk qup_i2c_clk = { |
| 1056 | .b = { |
| 1057 | .ctl_reg = QUP_I2C_NS_REG, |
| 1058 | .en_mask = BIT(0), |
| 1059 | .halt_reg = CLK_HALT_STATEB_REG, |
| 1060 | .halt_bit = 31, |
| 1061 | .reset_mask = P_QUP_I2C_CLK, |
| 1062 | }, |
| 1063 | .root_en_mask = BIT(2), |
| 1064 | .freq_tbl = clk_tbl_tcxo, |
| 1065 | .set_rate = set_rate_nop, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1066 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1067 | .c = { |
| 1068 | .dbg_name = "qup_i2c_clk", |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1069 | .ops = &clk_ops_rcg_7x30, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1070 | VDD_DIG_FMAX_MAP1(NOMINAL, 19200000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1071 | CLK_INIT(qup_i2c_clk.c), |
| 1072 | }, |
| 1073 | }; |
| 1074 | |
| 1075 | static struct rcg_clk uart1_clk = { |
| 1076 | .b = { |
| 1077 | .ctl_reg = UART_NS_REG, |
| 1078 | .en_mask = BIT(5), |
| 1079 | .halt_reg = CLK_HALT_STATEB_REG, |
| 1080 | .halt_bit = 7, |
| 1081 | .reset_mask = P_UART1_CLK, |
| 1082 | }, |
| 1083 | .root_en_mask = BIT(4), |
| 1084 | .freq_tbl = clk_tbl_tcxo, |
| 1085 | .set_rate = set_rate_nop, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1086 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1087 | .c = { |
| 1088 | .dbg_name = "uart1_clk", |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1089 | .ops = &clk_ops_rcg_7x30, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1090 | VDD_DIG_FMAX_MAP1(NOMINAL, 19200000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1091 | CLK_INIT(uart1_clk.c), |
| 1092 | }, |
| 1093 | }; |
| 1094 | |
| 1095 | static struct rcg_clk uart2_clk = { |
| 1096 | .b = { |
| 1097 | .ctl_reg = UART2_NS_REG, |
| 1098 | .en_mask = BIT(5), |
| 1099 | .halt_reg = CLK_HALT_STATEB_REG, |
| 1100 | .halt_bit = 5, |
| 1101 | .reset_mask = P_UART2_CLK, |
| 1102 | }, |
| 1103 | .root_en_mask = BIT(4), |
| 1104 | .freq_tbl = clk_tbl_tcxo, |
| 1105 | .set_rate = set_rate_nop, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1106 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1107 | .c = { |
| 1108 | .dbg_name = "uart2_clk", |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1109 | .ops = &clk_ops_rcg_7x30, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1110 | VDD_DIG_FMAX_MAP1(NOMINAL, 19200000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1111 | CLK_INIT(uart2_clk.c), |
| 1112 | }, |
| 1113 | }; |
| 1114 | |
| 1115 | static struct clk_freq_tbl clk_tbl_uartdm[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1116 | F_MND16( 0, gnd, 1, 0, 0), |
| 1117 | F_MND16( 3686400, pll3, 3, 3, 200), |
| 1118 | F_MND16( 7372800, pll3, 3, 3, 100), |
| 1119 | F_MND16(14745600, pll3, 3, 3, 50), |
| 1120 | F_MND16(32000000, pll3, 3, 25, 192), |
| 1121 | F_MND16(40000000, pll3, 3, 125, 768), |
| 1122 | F_MND16(46400000, pll3, 3, 145, 768), |
| 1123 | F_MND16(48000000, pll3, 3, 25, 128), |
| 1124 | F_MND16(51200000, pll3, 3, 5, 24), |
| 1125 | F_MND16(56000000, pll3, 3, 175, 768), |
| 1126 | F_MND16(58982400, pll3, 3, 6, 25), |
| 1127 | F_MND16(64000000, pll1, 4, 1, 3), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1128 | F_END, |
| 1129 | }; |
| 1130 | |
| 1131 | static struct rcg_clk uart1dm_clk = { |
| 1132 | .b = { |
| 1133 | .ctl_reg = UART1DM_NS_REG, |
| 1134 | .en_mask = BIT(9), |
| 1135 | .halt_reg = CLK_HALT_STATEB_REG, |
| 1136 | .halt_bit = 6, |
| 1137 | .reset_mask = P_UART1DM_CLK, |
| 1138 | }, |
| 1139 | .ns_reg = UART1DM_NS_REG, |
| 1140 | .md_reg = UART1DM_NS_REG - 4, |
| 1141 | .root_en_mask = BIT(11), |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame^] | 1142 | .mnd_en_mask = BIT(8), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1143 | .freq_tbl = clk_tbl_uartdm, |
| 1144 | .ns_mask = F_MASK_MND16, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1145 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1146 | .set_rate = set_rate_mnd, |
| 1147 | .c = { |
| 1148 | .dbg_name = "uart1dm_clk", |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1149 | .ops = &clk_ops_rcg_7x30, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1150 | VDD_DIG_FMAX_MAP1(NOMINAL, 64000000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1151 | CLK_INIT(uart1dm_clk.c), |
| 1152 | }, |
| 1153 | }; |
| 1154 | |
| 1155 | static struct rcg_clk uart2dm_clk = { |
| 1156 | .b = { |
| 1157 | .ctl_reg = UART2DM_NS_REG, |
| 1158 | .en_mask = BIT(9), |
| 1159 | .halt_reg = CLK_HALT_STATEB_REG, |
| 1160 | .halt_bit = 23, |
| 1161 | .reset_mask = P_UART2DM_CLK, |
| 1162 | }, |
| 1163 | .ns_reg = UART2DM_NS_REG, |
| 1164 | .md_reg = UART2DM_NS_REG - 4, |
| 1165 | .root_en_mask = BIT(11), |
| 1166 | .freq_tbl = clk_tbl_uartdm, |
| 1167 | .ns_mask = F_MASK_MND16, |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame^] | 1168 | .mnd_en_mask = BIT(8), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1169 | .set_rate = set_rate_mnd, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1170 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1171 | .c = { |
| 1172 | .dbg_name = "uart2dm_clk", |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1173 | .ops = &clk_ops_rcg_7x30, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1174 | VDD_DIG_FMAX_MAP1(NOMINAL, 64000000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1175 | CLK_INIT(uart2dm_clk.c), |
| 1176 | }, |
| 1177 | }; |
| 1178 | |
| 1179 | static struct clk_freq_tbl clk_tbl_mdh[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1180 | F_BASIC( 0, gnd, 1), |
| 1181 | F_BASIC( 49150000, pll3, 15), |
| 1182 | F_BASIC( 92160000, pll3, 8), |
| 1183 | F_BASIC(122880000, pll3, 6), |
| 1184 | F_BASIC(184320000, pll3, 4), |
| 1185 | F_BASIC(245760000, pll3, 3), |
| 1186 | F_BASIC(368640000, pll3, 2), |
| 1187 | F_BASIC(384000000, pll1, 2), |
| 1188 | F_BASIC(445500000, pll4, 2), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1189 | F_END, |
| 1190 | }; |
| 1191 | |
| 1192 | static struct rcg_clk emdh_clk = { |
| 1193 | .b = { |
| 1194 | .ctl_reg = EMDH_NS_REG, |
| 1195 | .halt_check = DELAY, |
| 1196 | .reset_mask = P_EMDH_CLK, |
| 1197 | }, |
| 1198 | .root_en_mask = BIT(11), |
| 1199 | .ns_reg = EMDH_NS_REG, |
| 1200 | .ns_mask = F_MASK_BASIC, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1201 | .set_rate = set_rate_nop, |
| 1202 | .freq_tbl = clk_tbl_mdh, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1203 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1204 | .c = { |
| 1205 | .dbg_name = "emdh_clk", |
| 1206 | .flags = CLKFLAG_MIN | CLKFLAG_MAX, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1207 | .ops = &clk_ops_rcg_7x30, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1208 | VDD_DIG_FMAX_MAP1(NOMINAL, 445500000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1209 | CLK_INIT(emdh_clk.c), |
Stephen Boyd | 7fa2674 | 2011-08-11 23:22:29 -0700 | [diff] [blame] | 1210 | .depends = &axi_li_adsp_a_clk.c, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1211 | }, |
| 1212 | }; |
| 1213 | |
| 1214 | static struct rcg_clk pmdh_clk = { |
| 1215 | .b = { |
| 1216 | .ctl_reg = PMDH_NS_REG, |
| 1217 | .halt_check = DELAY, |
| 1218 | .reset_mask = P_PMDH_CLK, |
| 1219 | }, |
| 1220 | .root_en_mask = BIT(11), |
| 1221 | .ns_reg = PMDH_NS_REG, |
| 1222 | .ns_mask = F_MASK_BASIC, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1223 | .set_rate = set_rate_nop, |
| 1224 | .freq_tbl = clk_tbl_mdh, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1225 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1226 | .c = { |
| 1227 | .dbg_name = "pmdh_clk", |
| 1228 | .flags = CLKFLAG_MIN | CLKFLAG_MAX, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1229 | .ops = &clk_ops_rcg_7x30, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1230 | VDD_DIG_FMAX_MAP1(NOMINAL, 445500000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1231 | CLK_INIT(pmdh_clk.c), |
Stephen Boyd | 7fa2674 | 2011-08-11 23:22:29 -0700 | [diff] [blame] | 1232 | .depends = &axi_li_adsp_a_clk.c, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1233 | }, |
| 1234 | }; |
| 1235 | |
| 1236 | static struct clk_freq_tbl clk_tbl_grp[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1237 | F_BASIC( 24576000, lpxo, 1), |
| 1238 | F_BASIC( 46080000, pll3, 16), |
| 1239 | F_BASIC( 49152000, pll3, 15), |
| 1240 | F_BASIC( 52662875, pll3, 14), |
| 1241 | F_BASIC( 56713846, pll3, 13), |
| 1242 | F_BASIC( 61440000, pll3, 12), |
| 1243 | F_BASIC( 67025454, pll3, 11), |
| 1244 | F_BASIC( 73728000, pll3, 10), |
| 1245 | F_BASIC( 81920000, pll3, 9), |
| 1246 | F_BASIC( 92160000, pll3, 8), |
| 1247 | F_BASIC(105325714, pll3, 7), |
| 1248 | F_BASIC(122880000, pll3, 6), |
| 1249 | F_BASIC(147456000, pll3, 5), |
| 1250 | F_BASIC(184320000, pll3, 4), |
| 1251 | F_BASIC(192000000, pll1, 4), |
| 1252 | F_BASIC(245760000, pll3, 3), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1253 | /* Sync to AXI. Hence this "rate" is not fixed. */ |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame^] | 1254 | F_RAW(1, &lpxo_clk.c, 0, BIT(14), 0, NULL), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1255 | F_END, |
| 1256 | }; |
| 1257 | |
| 1258 | static struct rcg_clk grp_2d_clk = { |
| 1259 | .b = { |
| 1260 | .ctl_reg = GRP_2D_NS_REG, |
| 1261 | .en_mask = BIT(7), |
| 1262 | .halt_reg = CLK_HALT_STATEA_REG, |
| 1263 | .halt_bit = 31, |
| 1264 | .reset_mask = P_GRP_2D_CLK, |
| 1265 | }, |
| 1266 | .ns_reg = GRP_2D_NS_REG, |
| 1267 | .root_en_mask = BIT(11), |
| 1268 | .ns_mask = F_MASK_BASIC | (7 << 12), |
| 1269 | .set_rate = set_rate_nop, |
| 1270 | .freq_tbl = clk_tbl_grp, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1271 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1272 | .c = { |
| 1273 | .dbg_name = "grp_2d_clk", |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1274 | .ops = &clk_ops_rcg_7x30, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1275 | VDD_DIG_FMAX_MAP2(NOMINAL, 192000000, HIGH, 245760000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1276 | CLK_INIT(grp_2d_clk.c), |
Stephen Boyd | 7fa2674 | 2011-08-11 23:22:29 -0700 | [diff] [blame] | 1277 | .depends = &axi_grp_2d_clk.c, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1278 | }, |
| 1279 | }; |
| 1280 | |
| 1281 | static struct rcg_clk grp_3d_src_clk = { |
| 1282 | .ns_reg = GRP_NS_REG, |
| 1283 | .b = { |
| 1284 | .ctl_reg = GRP_NS_REG, |
| 1285 | .halt_check = NOCHECK, |
| 1286 | }, |
| 1287 | .root_en_mask = BIT(11), |
| 1288 | .ns_mask = F_MASK_BASIC | (7 << 12), |
| 1289 | .set_rate = set_rate_nop, |
| 1290 | .freq_tbl = clk_tbl_grp, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1291 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1292 | .c = { |
| 1293 | .dbg_name = "grp_3d_src_clk", |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1294 | .ops = &clk_ops_rcg_7x30, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1295 | VDD_DIG_FMAX_MAP2(NOMINAL, 192000000, HIGH, 245760000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1296 | CLK_INIT(grp_3d_src_clk.c), |
Stephen Boyd | 7fa2674 | 2011-08-11 23:22:29 -0700 | [diff] [blame] | 1297 | .depends = &axi_li_grp_clk.c, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1298 | }, |
| 1299 | }; |
| 1300 | |
| 1301 | static struct branch_clk grp_3d_clk = { |
| 1302 | .b = { |
| 1303 | .ctl_reg = GRP_NS_REG, |
| 1304 | .en_mask = BIT(7), |
| 1305 | .halt_reg = CLK_HALT_STATEB_REG, |
| 1306 | .halt_bit = 18, |
| 1307 | .reset_mask = P_GRP_3D_CLK, |
| 1308 | }, |
| 1309 | .parent = &grp_3d_src_clk.c, |
| 1310 | .c = { |
| 1311 | .dbg_name = "grp_3d_clk", |
| 1312 | .ops = &clk_ops_branch, |
| 1313 | CLK_INIT(grp_3d_clk.c), |
| 1314 | }, |
| 1315 | }; |
| 1316 | |
| 1317 | static struct branch_clk imem_clk = { |
| 1318 | .b = { |
| 1319 | .ctl_reg = GRP_NS_REG, |
| 1320 | .en_mask = BIT(9), |
| 1321 | .halt_reg = CLK_HALT_STATEB_REG, |
| 1322 | .halt_bit = 19, |
| 1323 | .reset_mask = P_IMEM_CLK, |
| 1324 | }, |
| 1325 | .parent = &grp_3d_src_clk.c, |
| 1326 | .c = { |
| 1327 | .dbg_name = "imem_clk", |
| 1328 | .ops = &clk_ops_branch, |
| 1329 | CLK_INIT(imem_clk.c), |
| 1330 | }, |
| 1331 | }; |
| 1332 | |
| 1333 | static struct clk_freq_tbl clk_tbl_sdc1_3[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1334 | F_MND8( 0, 0, 0, gnd, 1, 0, 0), |
| 1335 | F_MND8( 144000, 19, 12, lpxo, 1, 1, 171), |
| 1336 | F_MND8( 400000, 19, 12, lpxo, 1, 2, 123), |
| 1337 | F_MND8(16027000, 19, 12, pll3, 3, 14, 215), |
| 1338 | F_MND8(17000000, 19, 12, pll3, 4, 19, 206), |
| 1339 | F_MND8(20480000, 19, 12, pll3, 4, 23, 212), |
| 1340 | F_MND8(24576000, 19, 12, lpxo, 1, 0, 0), |
| 1341 | F_MND8(49152000, 19, 12, pll3, 3, 1, 5), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1342 | F_END, |
| 1343 | }; |
| 1344 | |
| 1345 | static struct rcg_clk sdc1_clk = { |
| 1346 | .b = { |
| 1347 | .ctl_reg = SDCn_NS_REG(1), |
| 1348 | .en_mask = BIT(9), |
| 1349 | .halt_reg = CLK_HALT_STATEA_REG, |
| 1350 | .halt_bit = 1, |
| 1351 | .reset_mask = P_SDC1_CLK, |
| 1352 | }, |
| 1353 | .ns_reg = SDCn_NS_REG(1), |
| 1354 | .md_reg = SDCn_NS_REG(1) - 4, |
| 1355 | .ns_mask = F_MASK_MND8(19, 12), |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame^] | 1356 | .mnd_en_mask = BIT(8), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1357 | .root_en_mask = BIT(11), |
| 1358 | .freq_tbl = clk_tbl_sdc1_3, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1359 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1360 | .set_rate = set_rate_mnd, |
| 1361 | .c = { |
| 1362 | .dbg_name = "sdc1_clk", |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1363 | .ops = &clk_ops_rcg_7x30, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1364 | VDD_DIG_FMAX_MAP1(NOMINAL, 49152000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1365 | CLK_INIT(sdc1_clk.c), |
| 1366 | }, |
| 1367 | }; |
| 1368 | |
| 1369 | static struct rcg_clk sdc3_clk = { |
| 1370 | .b = { |
| 1371 | .ctl_reg = SDCn_NS_REG(3), |
| 1372 | .en_mask = BIT(9), |
| 1373 | .halt_reg = CLK_HALT_STATEB_REG, |
| 1374 | .halt_bit = 24, |
| 1375 | .reset_mask = P_SDC3_CLK, |
| 1376 | }, |
| 1377 | .ns_reg = SDCn_NS_REG(3), |
| 1378 | .md_reg = SDCn_NS_REG(3) - 4, |
| 1379 | .ns_mask = F_MASK_MND8(19, 12), |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame^] | 1380 | .mnd_en_mask = BIT(8), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1381 | .root_en_mask = BIT(11), |
| 1382 | .freq_tbl = clk_tbl_sdc1_3, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1383 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1384 | .set_rate = set_rate_mnd, |
| 1385 | .c = { |
| 1386 | .dbg_name = "sdc3_clk", |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1387 | .ops = &clk_ops_rcg_7x30, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1388 | VDD_DIG_FMAX_MAP1(NOMINAL, 49152000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1389 | CLK_INIT(sdc3_clk.c), |
| 1390 | }, |
| 1391 | }; |
| 1392 | |
| 1393 | static struct clk_freq_tbl clk_tbl_sdc2_4[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1394 | F_MND8( 0, 0, 0, gnd, 1, 0, 0), |
| 1395 | F_MND8( 144000, 20, 13, lpxo, 1, 1, 171), |
| 1396 | F_MND8( 400000, 20, 13, lpxo, 1, 2, 123), |
| 1397 | F_MND8(16027000, 20, 13, pll3, 3, 14, 215), |
| 1398 | F_MND8(17000000, 20, 13, pll3, 4, 19, 206), |
| 1399 | F_MND8(20480000, 20, 13, pll3, 4, 23, 212), |
| 1400 | F_MND8(24576000, 20, 13, lpxo, 1, 0, 0), |
| 1401 | F_MND8(49152000, 20, 13, pll3, 3, 1, 5), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1402 | F_END, |
| 1403 | }; |
| 1404 | |
| 1405 | static struct rcg_clk sdc2_clk = { |
| 1406 | .b = { |
| 1407 | .ctl_reg = SDCn_NS_REG(2), |
| 1408 | .en_mask = BIT(9), |
| 1409 | .halt_reg = CLK_HALT_STATEA_REG, |
| 1410 | .halt_bit = 0, |
| 1411 | .reset_mask = P_SDC2_CLK, |
| 1412 | }, |
| 1413 | .ns_reg = SDCn_NS_REG(2), |
| 1414 | .md_reg = SDCn_NS_REG(2) - 4, |
| 1415 | .ns_mask = F_MASK_MND8(20, 13), |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame^] | 1416 | .mnd_en_mask = BIT(8), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1417 | .root_en_mask = BIT(11), |
| 1418 | .freq_tbl = clk_tbl_sdc2_4, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1419 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1420 | .set_rate = set_rate_mnd, |
| 1421 | .c = { |
| 1422 | .dbg_name = "sdc2_clk", |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1423 | .ops = &clk_ops_rcg_7x30, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1424 | VDD_DIG_FMAX_MAP1(NOMINAL, 49152000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1425 | CLK_INIT(sdc2_clk.c), |
| 1426 | }, |
| 1427 | }; |
| 1428 | |
| 1429 | static struct rcg_clk sdc4_clk = { |
| 1430 | .b = { |
| 1431 | .ctl_reg = SDCn_NS_REG(4), |
| 1432 | .en_mask = BIT(9), |
| 1433 | .halt_reg = CLK_HALT_STATEB_REG, |
| 1434 | .halt_bit = 25, |
| 1435 | .reset_mask = P_SDC4_CLK, |
| 1436 | }, |
| 1437 | .ns_reg = SDCn_NS_REG(4), |
| 1438 | .md_reg = SDCn_NS_REG(4) - 4, |
| 1439 | .ns_mask = F_MASK_MND8(20, 13), |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame^] | 1440 | .mnd_en_mask = BIT(8), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1441 | .root_en_mask = BIT(11), |
| 1442 | .freq_tbl = clk_tbl_sdc2_4, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1443 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1444 | .set_rate = set_rate_mnd, |
| 1445 | .c = { |
| 1446 | .dbg_name = "sdc4_clk", |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1447 | .ops = &clk_ops_rcg_7x30, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1448 | VDD_DIG_FMAX_MAP1(NOMINAL, 49152000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1449 | CLK_INIT(sdc4_clk.c), |
| 1450 | }, |
| 1451 | }; |
| 1452 | |
| 1453 | static struct clk_freq_tbl clk_tbl_mdp_core[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1454 | F_BASIC( 24576000, lpxo, 1), |
| 1455 | F_BASIC( 46080000, pll3, 16), |
| 1456 | F_BASIC( 49152000, pll3, 15), |
| 1457 | F_BASIC( 52663000, pll3, 14), |
| 1458 | F_BASIC( 92160000, pll3, 8), |
| 1459 | F_BASIC(122880000, pll3, 6), |
| 1460 | F_BASIC(147456000, pll3, 5), |
| 1461 | F_BASIC(153600000, pll1, 5), |
| 1462 | F_BASIC(192000000, pll1, 4), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1463 | F_END, |
| 1464 | }; |
| 1465 | |
| 1466 | static struct rcg_clk mdp_clk = { |
| 1467 | .b = { |
| 1468 | .ctl_reg = MDP_NS_REG, |
| 1469 | .en_mask = BIT(9), |
| 1470 | .halt_reg = CLK_HALT_STATEB_REG, |
| 1471 | .halt_bit = 16, |
| 1472 | .reset_mask = P_MDP_CLK, |
| 1473 | }, |
| 1474 | .ns_reg = MDP_NS_REG, |
| 1475 | .root_en_mask = BIT(11), |
| 1476 | .ns_mask = F_MASK_BASIC, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1477 | .set_rate = set_rate_nop, |
| 1478 | .freq_tbl = clk_tbl_mdp_core, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1479 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1480 | .c = { |
| 1481 | .dbg_name = "mdp_clk", |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1482 | .ops = &clk_ops_rcg_7x30, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1483 | VDD_DIG_FMAX_MAP2(NOMINAL, 153600000, HIGH, 192000000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1484 | CLK_INIT(mdp_clk.c), |
Stephen Boyd | 7fa2674 | 2011-08-11 23:22:29 -0700 | [diff] [blame] | 1485 | .depends = &axi_mdp_clk.c, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1486 | }, |
| 1487 | }; |
| 1488 | |
| 1489 | static struct clk_freq_tbl clk_tbl_mdp_lcdc[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1490 | F_MND16( 0, gnd, 1, 0, 0), |
| 1491 | F_MND16(24576000, lpxo, 1, 0, 0), |
| 1492 | F_MND16(30720000, pll3, 4, 1, 6), |
| 1493 | F_MND16(32768000, pll3, 3, 2, 15), |
| 1494 | F_MND16(40960000, pll3, 2, 1, 9), |
| 1495 | F_MND16(73728000, pll3, 2, 1, 5), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1496 | F_END, |
| 1497 | }; |
| 1498 | |
| 1499 | static struct rcg_clk mdp_lcdc_pclk_clk = { |
| 1500 | .b = { |
| 1501 | .ctl_reg = MDP_LCDC_NS_REG, |
| 1502 | .en_mask = BIT(9), |
| 1503 | .halt_reg = CLK_HALT_STATEB_REG, |
| 1504 | .halt_bit = 28, |
| 1505 | .reset_mask = P_MDP_LCDC_PCLK_CLK, |
| 1506 | }, |
| 1507 | .ns_reg = MDP_LCDC_NS_REG, |
| 1508 | .md_reg = MDP_LCDC_NS_REG - 4, |
| 1509 | .root_en_mask = BIT(11), |
| 1510 | .ns_mask = F_MASK_MND16, |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame^] | 1511 | .mnd_en_mask = BIT(8), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1512 | .set_rate = set_rate_mnd, |
| 1513 | .freq_tbl = clk_tbl_mdp_lcdc, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1514 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1515 | .c = { |
| 1516 | .dbg_name = "mdp_lcdc_pclk_clk", |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1517 | .ops = &clk_ops_rcg_7x30, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1518 | VDD_DIG_FMAX_MAP1(NOMINAL, 73728000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1519 | CLK_INIT(mdp_lcdc_pclk_clk.c), |
| 1520 | }, |
| 1521 | }; |
| 1522 | |
| 1523 | static struct branch_clk mdp_lcdc_pad_pclk_clk = { |
| 1524 | .b = { |
| 1525 | .ctl_reg = MDP_LCDC_NS_REG, |
| 1526 | .en_mask = BIT(12), |
| 1527 | .halt_reg = CLK_HALT_STATEB_REG, |
| 1528 | .halt_bit = 29, |
| 1529 | .reset_mask = P_MDP_LCDC_PAD_PCLK_CLK, |
| 1530 | }, |
| 1531 | .parent = &mdp_lcdc_pclk_clk.c, |
| 1532 | .c = { |
| 1533 | .dbg_name = "mdp_lcdc_pad_pclk_clk", |
| 1534 | .ops = &clk_ops_branch, |
| 1535 | CLK_INIT(mdp_lcdc_pad_pclk_clk.c), |
| 1536 | }, |
| 1537 | }; |
| 1538 | |
| 1539 | static struct clk_freq_tbl clk_tbl_mdp_vsync[] = { |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame^] | 1540 | F_RAW( 0, &gnd_clk.c, 0, (0x3<<2), 0, NULL), |
| 1541 | F_RAW(24576000, &lpxo_clk.c, 0, (0x1<<2), 0, NULL), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1542 | F_END, |
| 1543 | }; |
| 1544 | |
| 1545 | static struct rcg_clk mdp_vsync_clk = { |
| 1546 | .b = { |
| 1547 | .ctl_reg = MDP_VSYNC_REG, |
| 1548 | .en_mask = BIT(0), |
| 1549 | .halt_reg = CLK_HALT_STATEB_REG, |
| 1550 | .halt_bit = 30, |
| 1551 | .reset_mask = P_MDP_VSYNC_CLK, |
| 1552 | }, |
| 1553 | .ns_reg = MDP_VSYNC_REG, |
| 1554 | .ns_mask = BM(3, 2), |
| 1555 | .freq_tbl = clk_tbl_mdp_vsync, |
| 1556 | .set_rate = set_rate_nop, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1557 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1558 | .c = { |
| 1559 | .dbg_name = "mdp_vsync_clk", |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1560 | .ops = &clk_ops_rcg_7x30, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1561 | VDD_DIG_FMAX_MAP1(NOMINAL, 24576000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1562 | CLK_INIT(mdp_vsync_clk.c), |
| 1563 | }, |
| 1564 | }; |
| 1565 | |
| 1566 | static struct clk_freq_tbl clk_tbl_mi2s_codec[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1567 | F_MND16( 0, gnd, 1, 0, 0), |
| 1568 | F_MND16( 2048000, lpxo, 4, 1, 3), |
| 1569 | F_MND16(12288000, lpxo, 2, 0, 0), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1570 | F_END, |
| 1571 | }; |
| 1572 | |
| 1573 | static struct rcg_clk mi2s_codec_rx_m_clk = { |
| 1574 | .b = { |
| 1575 | .ctl_reg = MI2S_RX_NS_REG, |
| 1576 | .en_mask = BIT(12), |
| 1577 | .halt_reg = CLK_HALT_STATEA_REG, |
| 1578 | .halt_bit = 12, |
| 1579 | .reset_mask = P_MI2S_CODEC_RX_M_CLK, |
| 1580 | }, |
| 1581 | .ns_reg = MI2S_RX_NS_REG, |
| 1582 | .md_reg = MI2S_RX_NS_REG - 4, |
| 1583 | .root_en_mask = BIT(11), |
| 1584 | .ns_mask = F_MASK_MND16, |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame^] | 1585 | .mnd_en_mask = BIT(8), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1586 | .set_rate = set_rate_mnd, |
| 1587 | .freq_tbl = clk_tbl_mi2s_codec, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1588 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1589 | .c = { |
| 1590 | .dbg_name = "mi2s_codec_rx_m_clk", |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1591 | .ops = &clk_ops_rcg_7x30, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1592 | VDD_DIG_FMAX_MAP1(NOMINAL, 12288000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1593 | CLK_INIT(mi2s_codec_rx_m_clk.c), |
| 1594 | }, |
| 1595 | }; |
| 1596 | |
| 1597 | static struct branch_clk mi2s_codec_rx_s_clk = { |
| 1598 | .b = { |
| 1599 | .ctl_reg = MI2S_RX_NS_REG, |
| 1600 | .en_mask = BIT(9), |
| 1601 | .halt_reg = CLK_HALT_STATEA_REG, |
| 1602 | .halt_bit = 13, |
| 1603 | .reset_mask = P_MI2S_CODEC_RX_S_CLK, |
| 1604 | }, |
| 1605 | .parent = &mi2s_codec_rx_m_clk.c, |
| 1606 | .c = { |
| 1607 | .dbg_name = "mi2s_codec_rx_s_clk", |
| 1608 | .ops = &clk_ops_branch, |
| 1609 | CLK_INIT(mi2s_codec_rx_s_clk.c), |
| 1610 | }, |
| 1611 | }; |
| 1612 | |
| 1613 | static struct rcg_clk mi2s_codec_tx_m_clk = { |
| 1614 | .b = { |
| 1615 | .ctl_reg = MI2S_TX_NS_REG, |
| 1616 | .en_mask = BIT(12), |
| 1617 | .halt_reg = CLK_HALT_STATEC_REG, |
| 1618 | .halt_bit = 8, |
| 1619 | .reset_mask = P_MI2S_CODEC_TX_M_CLK, |
| 1620 | }, |
| 1621 | .ns_reg = MI2S_TX_NS_REG, |
| 1622 | .md_reg = MI2S_TX_NS_REG - 4, |
| 1623 | .root_en_mask = BIT(11), |
| 1624 | .ns_mask = F_MASK_MND16, |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame^] | 1625 | .mnd_en_mask = BIT(8), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1626 | .set_rate = set_rate_mnd, |
| 1627 | .freq_tbl = clk_tbl_mi2s_codec, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1628 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1629 | .c = { |
| 1630 | .dbg_name = "mi2s_codec_tx_m_clk", |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1631 | .ops = &clk_ops_rcg_7x30, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1632 | VDD_DIG_FMAX_MAP1(NOMINAL, 12288000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1633 | CLK_INIT(mi2s_codec_tx_m_clk.c), |
| 1634 | }, |
| 1635 | }; |
| 1636 | |
| 1637 | static struct branch_clk mi2s_codec_tx_s_clk = { |
| 1638 | .b = { |
| 1639 | .ctl_reg = MI2S_TX_NS_REG, |
| 1640 | .en_mask = BIT(9), |
| 1641 | .halt_reg = CLK_HALT_STATEA_REG, |
| 1642 | .halt_bit = 11, |
| 1643 | .reset_mask = P_MI2S_CODEC_TX_S_CLK, |
| 1644 | }, |
| 1645 | .parent = &mi2s_codec_tx_m_clk.c, |
| 1646 | .c = { |
| 1647 | .dbg_name = "mi2s_codec_tx_s_clk", |
| 1648 | .ops = &clk_ops_branch, |
| 1649 | CLK_INIT(mi2s_codec_tx_s_clk.c), |
| 1650 | }, |
| 1651 | }; |
| 1652 | |
| 1653 | static struct clk_freq_tbl clk_tbl_mi2s[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1654 | F_MND16( 0, gnd, 1, 0, 0), |
| 1655 | F_MND16(12288000, lpxo, 2, 0, 0), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1656 | F_END, |
| 1657 | }; |
| 1658 | |
| 1659 | static struct rcg_clk mi2s_m_clk = { |
| 1660 | .b = { |
| 1661 | .ctl_reg = MI2S_NS_REG, |
| 1662 | .en_mask = BIT(12), |
| 1663 | .halt_reg = CLK_HALT_STATEC_REG, |
| 1664 | .halt_bit = 4, |
| 1665 | .reset_mask = P_MI2S_M_CLK, |
| 1666 | }, |
| 1667 | .ns_reg = MI2S_NS_REG, |
| 1668 | .md_reg = MI2S_NS_REG - 4, |
| 1669 | .root_en_mask = BIT(11), |
| 1670 | .ns_mask = F_MASK_MND16, |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame^] | 1671 | .mnd_en_mask = BIT(8), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1672 | .set_rate = set_rate_mnd, |
| 1673 | .freq_tbl = clk_tbl_mi2s, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1674 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1675 | .c = { |
| 1676 | .dbg_name = "mi2s_m_clk", |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1677 | .ops = &clk_ops_rcg_7x30, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1678 | VDD_DIG_FMAX_MAP1(NOMINAL, 12288000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1679 | CLK_INIT(mi2s_m_clk.c), |
| 1680 | }, |
| 1681 | }; |
| 1682 | |
| 1683 | static struct branch_clk mi2s_s_clk = { |
| 1684 | .b = { |
| 1685 | .ctl_reg = MI2S_NS_REG, |
| 1686 | .en_mask = BIT(9), |
| 1687 | .halt_reg = CLK_HALT_STATEC_REG, |
| 1688 | .halt_bit = 3, |
| 1689 | .reset_mask = P_MI2S_S_CLK, |
| 1690 | }, |
| 1691 | .parent = &mi2s_m_clk.c, |
| 1692 | .c = { |
| 1693 | .dbg_name = "mi2s_s_clk", |
| 1694 | .ops = &clk_ops_branch, |
| 1695 | CLK_INIT(mi2s_s_clk.c), |
| 1696 | }, |
| 1697 | }; |
| 1698 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1699 | #define F_SDAC(f, s, div, m, n) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1700 | { \ |
| 1701 | .freq_hz = f, \ |
| 1702 | .md_val = MD16(m, n), \ |
| 1703 | .ns_val = N16(m, n) | SPDIV(SRC_SEL_SDAC_##s, div), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1704 | .src_clk = &s##_clk.c, \ |
| 1705 | } |
| 1706 | |
| 1707 | static struct clk_freq_tbl clk_tbl_sdac[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1708 | F_SDAC( 256000, lpxo, 4, 1, 24), |
| 1709 | F_SDAC( 352800, lpxo, 1, 147, 10240), |
| 1710 | F_SDAC( 384000, lpxo, 4, 1, 16), |
| 1711 | F_SDAC( 512000, lpxo, 4, 1, 12), |
| 1712 | F_SDAC( 705600, lpxo, 1, 147, 5120), |
| 1713 | F_SDAC( 768000, lpxo, 4, 1, 8), |
| 1714 | F_SDAC(1024000, lpxo, 4, 1, 6), |
| 1715 | F_SDAC(1411200, lpxo, 1, 147, 2560), |
| 1716 | F_SDAC(1536000, lpxo, 4, 1, 4), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1717 | F_END, |
| 1718 | }; |
| 1719 | |
| 1720 | static struct rcg_clk sdac_clk = { |
| 1721 | .b = { |
| 1722 | .ctl_reg = SDAC_NS_REG, |
| 1723 | .en_mask = BIT(9), |
| 1724 | .halt_reg = CLK_HALT_STATEA_REG, |
| 1725 | .halt_bit = 2, |
| 1726 | .reset_mask = P_SDAC_CLK, |
| 1727 | }, |
| 1728 | .ns_reg = SDAC_NS_REG, |
| 1729 | .md_reg = SDAC_NS_REG - 4, |
| 1730 | .root_en_mask = BIT(11), |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame^] | 1731 | .mnd_en_mask = BIT(8), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1732 | .freq_tbl = clk_tbl_sdac, |
| 1733 | .ns_mask = F_MASK_MND16, |
| 1734 | .set_rate = set_rate_mnd, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1735 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1736 | .c = { |
| 1737 | .dbg_name = "sdac_clk", |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1738 | .ops = &clk_ops_rcg_7x30, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1739 | VDD_DIG_FMAX_MAP1(NOMINAL, 1536000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1740 | CLK_INIT(sdac_clk.c), |
| 1741 | }, |
| 1742 | }; |
| 1743 | |
| 1744 | static struct branch_clk sdac_m_clk = { |
| 1745 | .b = { |
| 1746 | .ctl_reg = SDAC_NS_REG, |
| 1747 | .en_mask = BIT(12), |
| 1748 | .halt_reg = CLK_HALT_STATEB_REG, |
| 1749 | .halt_bit = 17, |
| 1750 | .reset_mask = P_SDAC_M_CLK, |
| 1751 | }, |
| 1752 | .parent = &sdac_clk.c, |
| 1753 | .c = { |
| 1754 | .dbg_name = "sdac_m_clk", |
| 1755 | .ops = &clk_ops_branch, |
| 1756 | CLK_INIT(sdac_m_clk.c), |
| 1757 | }, |
| 1758 | }; |
| 1759 | |
| 1760 | static struct clk_freq_tbl clk_tbl_tv[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1761 | F_MND8( 0, 0, 0, gnd, 1, 0, 0), |
| 1762 | F_MND8(27000000, 23, 16, pll4, 2, 2, 33), |
| 1763 | F_MND8(74250000, 23, 16, pll4, 2, 1, 6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1764 | F_END, |
| 1765 | }; |
| 1766 | |
| 1767 | static struct rcg_clk tv_clk = { |
| 1768 | .ns_reg = TV_NS_REG, |
| 1769 | .b = { |
| 1770 | .ctl_reg = TV_NS_REG, |
| 1771 | .halt_check = NOCHECK, |
| 1772 | }, |
| 1773 | .md_reg = TV_NS_REG - 4, |
| 1774 | .ns_mask = F_MASK_MND8(23, 16), |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame^] | 1775 | .mnd_en_mask = BIT(8), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1776 | .root_en_mask = BIT(11), |
| 1777 | .freq_tbl = clk_tbl_tv, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1778 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1779 | .set_rate = set_rate_mnd, |
| 1780 | .c = { |
| 1781 | .dbg_name = "tv_clk", |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1782 | .ops = &clk_ops_rcg_7x30, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1783 | VDD_DIG_FMAX_MAP1(NOMINAL, 74250000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1784 | CLK_INIT(tv_clk.c), |
| 1785 | }, |
| 1786 | }; |
| 1787 | |
| 1788 | static struct branch_clk hdmi_clk = { |
| 1789 | .b = { |
| 1790 | .ctl_reg = HDMI_NS_REG, |
| 1791 | .en_mask = BIT(9), |
| 1792 | .halt_reg = CLK_HALT_STATEC_REG, |
| 1793 | .halt_bit = 7, |
| 1794 | .reset_mask = P_HDMI_CLK, |
| 1795 | }, |
| 1796 | .parent = &tv_clk.c, |
| 1797 | .c = { |
| 1798 | .dbg_name = "hdmi_clk", |
| 1799 | .ops = &clk_ops_branch, |
| 1800 | CLK_INIT(hdmi_clk.c), |
| 1801 | }, |
| 1802 | }; |
| 1803 | |
| 1804 | static struct branch_clk tv_dac_clk = { |
| 1805 | .b = { |
| 1806 | .ctl_reg = TV_NS_REG, |
| 1807 | .en_mask = BIT(12), |
| 1808 | .halt_reg = CLK_HALT_STATEB_REG, |
| 1809 | .halt_bit = 27, |
| 1810 | .reset_mask = P_TV_DAC_CLK, |
| 1811 | }, |
| 1812 | .parent = &tv_clk.c, |
| 1813 | .c = { |
| 1814 | .dbg_name = "tv_dac_clk", |
| 1815 | .ops = &clk_ops_branch, |
| 1816 | CLK_INIT(tv_dac_clk.c), |
| 1817 | }, |
| 1818 | }; |
| 1819 | |
| 1820 | static struct branch_clk tv_enc_clk = { |
| 1821 | .b = { |
| 1822 | .ctl_reg = TV_NS_REG, |
| 1823 | .en_mask = BIT(9), |
| 1824 | .halt_reg = CLK_HALT_STATEB_REG, |
| 1825 | .halt_bit = 10, |
| 1826 | .reset_mask = P_TV_ENC_CLK, |
| 1827 | }, |
| 1828 | .parent = &tv_clk.c, |
| 1829 | .c = { |
| 1830 | .dbg_name = "tv_enc_clk", |
| 1831 | .ops = &clk_ops_branch, |
| 1832 | CLK_INIT(tv_enc_clk.c), |
| 1833 | }, |
| 1834 | }; |
| 1835 | |
| 1836 | /* Hacking root & branch into one param. */ |
| 1837 | static struct branch_clk tsif_ref_clk = { |
| 1838 | .b = { |
| 1839 | .ctl_reg = TSIF_NS_REG, |
| 1840 | .en_mask = BIT(9)|BIT(11), |
| 1841 | .halt_reg = CLK_HALT_STATEB_REG, |
| 1842 | .halt_bit = 11, |
| 1843 | .reset_mask = P_TSIF_REF_CLK, |
| 1844 | }, |
| 1845 | .parent = &tv_clk.c, |
| 1846 | .c = { |
| 1847 | .dbg_name = "tsif_ref_clk", |
| 1848 | .ops = &clk_ops_branch, |
| 1849 | CLK_INIT(tsif_ref_clk.c), |
| 1850 | }, |
| 1851 | }; |
| 1852 | |
| 1853 | static struct clk_freq_tbl clk_tbl_usb[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1854 | F_MND8( 0, 0, 0, gnd, 1, 0, 0), |
| 1855 | F_MND8(60000000, 23, 16, pll1, 2, 5, 32), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1856 | F_END, |
| 1857 | }; |
| 1858 | |
| 1859 | static struct rcg_clk usb_hs_src_clk = { |
| 1860 | .ns_reg = USBH_NS_REG, |
| 1861 | .b = { |
| 1862 | .ctl_reg = USBH_NS_REG, |
| 1863 | .halt_check = NOCHECK, |
| 1864 | }, |
| 1865 | .md_reg = USBH_NS_REG - 4, |
| 1866 | .ns_mask = F_MASK_MND8(23, 16), |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame^] | 1867 | .mnd_en_mask = BIT(8), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1868 | .root_en_mask = BIT(11), |
| 1869 | .freq_tbl = clk_tbl_usb, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1870 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1871 | .set_rate = set_rate_mnd, |
| 1872 | .c = { |
| 1873 | .dbg_name = "usb_hs_src_clk", |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1874 | .ops = &clk_ops_rcg_7x30, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1875 | VDD_DIG_FMAX_MAP1(NOMINAL, 60000000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1876 | CLK_INIT(usb_hs_src_clk.c), |
Stephen Boyd | 7fa2674 | 2011-08-11 23:22:29 -0700 | [diff] [blame] | 1877 | .depends = &axi_li_adsp_a_clk.c, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1878 | }, |
| 1879 | }; |
| 1880 | |
| 1881 | static struct branch_clk usb_hs_clk = { |
| 1882 | .b = { |
| 1883 | .ctl_reg = USBH_NS_REG, |
| 1884 | .en_mask = BIT(9), |
| 1885 | .halt_reg = CLK_HALT_STATEB_REG, |
| 1886 | .halt_bit = 26, |
| 1887 | .reset_mask = P_USB_HS_CLK, |
| 1888 | }, |
| 1889 | .c = { |
| 1890 | .dbg_name = "usb_hs_clk", |
| 1891 | .ops = &clk_ops_branch, |
| 1892 | CLK_INIT(usb_hs_clk.c), |
| 1893 | }, |
| 1894 | }; |
| 1895 | |
| 1896 | static struct branch_clk usb_hs_core_clk = { |
| 1897 | .b = { |
| 1898 | .ctl_reg = USBH_NS_REG, |
| 1899 | .en_mask = BIT(13), |
| 1900 | .halt_reg = CLK_HALT_STATEA_REG, |
| 1901 | .halt_bit = 27, |
| 1902 | .reset_mask = P_USB_HS_CORE_CLK, |
| 1903 | }, |
| 1904 | .parent = &usb_hs_src_clk.c, |
| 1905 | .c = { |
| 1906 | .dbg_name = "usb_hs_core_clk", |
| 1907 | .ops = &clk_ops_branch, |
| 1908 | CLK_INIT(usb_hs_core_clk.c), |
| 1909 | }, |
| 1910 | }; |
| 1911 | |
| 1912 | static struct branch_clk usb_hs2_clk = { |
| 1913 | .b = { |
| 1914 | .ctl_reg = USBH2_NS_REG, |
| 1915 | .en_mask = BIT(9), |
| 1916 | .halt_reg = CLK_HALT_STATEB_REG, |
| 1917 | .halt_bit = 3, |
| 1918 | .reset_mask = P_USB_HS2_CLK, |
| 1919 | }, |
| 1920 | .parent = &usb_hs_src_clk.c, |
| 1921 | .c = { |
| 1922 | .dbg_name = "usb_hs2_clk", |
| 1923 | .ops = &clk_ops_branch, |
| 1924 | CLK_INIT(usb_hs2_clk.c), |
| 1925 | }, |
| 1926 | }; |
| 1927 | |
| 1928 | static struct branch_clk usb_hs2_core_clk = { |
| 1929 | .b = { |
| 1930 | .ctl_reg = USBH2_NS_REG, |
| 1931 | .en_mask = BIT(4), |
| 1932 | .halt_reg = CLK_HALT_STATEA_REG, |
| 1933 | .halt_bit = 28, |
| 1934 | .reset_mask = P_USB_HS2_CORE_CLK, |
| 1935 | }, |
| 1936 | .parent = &usb_hs_src_clk.c, |
| 1937 | .c = { |
| 1938 | .dbg_name = "usb_hs2_core_clk", |
| 1939 | .ops = &clk_ops_branch, |
| 1940 | CLK_INIT(usb_hs2_core_clk.c), |
| 1941 | }, |
| 1942 | }; |
| 1943 | |
| 1944 | static struct branch_clk usb_hs3_clk = { |
| 1945 | .b = { |
| 1946 | .ctl_reg = USBH3_NS_REG, |
| 1947 | .en_mask = BIT(9), |
| 1948 | .halt_reg = CLK_HALT_STATEB_REG, |
| 1949 | .halt_bit = 2, |
| 1950 | .reset_mask = P_USB_HS3_CLK, |
| 1951 | }, |
| 1952 | .parent = &usb_hs_src_clk.c, |
| 1953 | .c = { |
| 1954 | .dbg_name = "usb_hs3_clk", |
| 1955 | .ops = &clk_ops_branch, |
| 1956 | CLK_INIT(usb_hs3_clk.c), |
| 1957 | }, |
| 1958 | }; |
| 1959 | |
| 1960 | static struct branch_clk usb_hs3_core_clk = { |
| 1961 | .b = { |
| 1962 | .ctl_reg = USBH3_NS_REG, |
| 1963 | .en_mask = BIT(4), |
| 1964 | .halt_reg = CLK_HALT_STATEA_REG, |
| 1965 | .halt_bit = 29, |
| 1966 | .reset_mask = P_USB_HS3_CORE_CLK, |
| 1967 | }, |
| 1968 | .parent = &usb_hs_src_clk.c, |
| 1969 | .c = { |
| 1970 | .dbg_name = "usb_hs3_core_clk", |
| 1971 | .ops = &clk_ops_branch, |
| 1972 | CLK_INIT(usb_hs3_core_clk.c), |
| 1973 | }, |
| 1974 | }; |
| 1975 | |
| 1976 | static struct clk_freq_tbl clk_tbl_vfe_jpeg[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1977 | F_MND16( 24576000, lpxo, 1, 0, 0), |
| 1978 | F_MND16( 36864000, pll3, 4, 1, 5), |
| 1979 | F_MND16( 46080000, pll3, 4, 1, 4), |
| 1980 | F_MND16( 61440000, pll3, 4, 1, 3), |
| 1981 | F_MND16( 73728000, pll3, 2, 1, 5), |
| 1982 | F_MND16( 81920000, pll3, 3, 1, 3), |
| 1983 | F_MND16( 92160000, pll3, 4, 1, 2), |
| 1984 | F_MND16( 98304000, pll3, 3, 2, 5), |
| 1985 | F_MND16(105326000, pll3, 2, 2, 7), |
| 1986 | F_MND16(122880000, pll3, 2, 1, 3), |
| 1987 | F_MND16(147456000, pll3, 2, 2, 5), |
| 1988 | F_MND16(153600000, pll1, 2, 2, 5), |
| 1989 | F_MND16(192000000, pll1, 4, 0, 0), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1990 | F_END, |
| 1991 | }; |
| 1992 | |
| 1993 | static struct rcg_clk jpeg_clk = { |
| 1994 | .b = { |
| 1995 | .ctl_reg = JPEG_NS_REG, |
| 1996 | .en_mask = BIT(9), |
| 1997 | .halt_reg = CLK_HALT_STATEB_REG, |
| 1998 | .halt_bit = 1, |
| 1999 | .reset_mask = P_JPEG_CLK, |
| 2000 | }, |
| 2001 | .ns_reg = JPEG_NS_REG, |
| 2002 | .md_reg = JPEG_NS_REG - 4, |
| 2003 | .root_en_mask = BIT(11), |
| 2004 | .freq_tbl = clk_tbl_vfe_jpeg, |
| 2005 | .ns_mask = F_MASK_MND16, |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame^] | 2006 | .mnd_en_mask = BIT(8), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2007 | .set_rate = set_rate_mnd, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 2008 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2009 | .c = { |
| 2010 | .dbg_name = "jpeg_clk", |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 2011 | .ops = &clk_ops_rcg_7x30, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 2012 | VDD_DIG_FMAX_MAP2(NOMINAL, 153600000, HIGH, 192000000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2013 | CLK_INIT(jpeg_clk.c), |
Stephen Boyd | 7fa2674 | 2011-08-11 23:22:29 -0700 | [diff] [blame] | 2014 | .depends = &axi_li_jpeg_clk.c, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2015 | }, |
| 2016 | }; |
| 2017 | |
| 2018 | static struct rcg_clk vfe_clk = { |
| 2019 | .b = { |
| 2020 | .ctl_reg = CAM_VFE_NS_REG, |
| 2021 | .en_mask = BIT(9), |
| 2022 | .halt_reg = CLK_HALT_STATEB_REG, |
| 2023 | .halt_bit = 0, |
| 2024 | .reset_mask = P_VFE_CLK, |
| 2025 | }, |
| 2026 | .ns_reg = CAM_VFE_NS_REG, |
| 2027 | .md_reg = CAM_VFE_NS_REG - 4, |
| 2028 | .root_en_mask = BIT(13), |
| 2029 | .freq_tbl = clk_tbl_vfe_jpeg, |
| 2030 | .ns_mask = F_MASK_MND16, |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame^] | 2031 | .mnd_en_mask = BIT(8), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2032 | .set_rate = set_rate_mnd, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 2033 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2034 | .c = { |
| 2035 | .dbg_name = "vfe_clk", |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 2036 | .ops = &clk_ops_rcg_7x30, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 2037 | VDD_DIG_FMAX_MAP2(NOMINAL, 153600000, HIGH, 192000000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2038 | CLK_INIT(vfe_clk.c), |
Stephen Boyd | 7fa2674 | 2011-08-11 23:22:29 -0700 | [diff] [blame] | 2039 | .depends = &axi_li_vfe_clk.c, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2040 | }, |
| 2041 | }; |
| 2042 | |
| 2043 | static struct branch_clk vfe_mdc_clk = { |
| 2044 | .b = { |
| 2045 | .ctl_reg = CAM_VFE_NS_REG, |
| 2046 | .en_mask = BIT(11), |
| 2047 | .halt_reg = CLK_HALT_STATEA_REG, |
| 2048 | .halt_bit = 9, |
| 2049 | .reset_mask = P_VFE_MDC_CLK, |
| 2050 | }, |
| 2051 | .parent = &vfe_clk.c, |
| 2052 | .c = { |
| 2053 | .dbg_name = "vfe_mdc_clk", |
| 2054 | .ops = &clk_ops_branch, |
| 2055 | CLK_INIT(vfe_mdc_clk.c), |
| 2056 | }, |
| 2057 | }; |
| 2058 | |
| 2059 | static struct branch_clk vfe_camif_clk = { |
| 2060 | .b = { |
| 2061 | .ctl_reg = CAM_VFE_NS_REG, |
| 2062 | .en_mask = BIT(15), |
| 2063 | .halt_reg = CLK_HALT_STATEC_REG, |
| 2064 | .halt_bit = 13, |
| 2065 | .reset_mask = P_VFE_CAMIF_CLK, |
| 2066 | }, |
| 2067 | .parent = &vfe_clk.c, |
| 2068 | .c = { |
| 2069 | .dbg_name = "vfe_camif_clk", |
| 2070 | .ops = &clk_ops_branch, |
| 2071 | CLK_INIT(vfe_camif_clk.c), |
| 2072 | }, |
| 2073 | }; |
| 2074 | |
| 2075 | static struct branch_clk csi0_vfe_clk = { |
| 2076 | .b = { |
| 2077 | .ctl_reg = CSI_NS_REG, |
| 2078 | .en_mask = BIT(15), |
| 2079 | .halt_reg = CLK_HALT_STATEC_REG, |
| 2080 | .halt_bit = 16, |
| 2081 | .reset_mask = P_CSI0_VFE_CLK, |
| 2082 | }, |
| 2083 | .parent = &vfe_clk.c, |
| 2084 | .c = { |
| 2085 | .dbg_name = "csi0_vfe_clk", |
| 2086 | .ops = &clk_ops_branch, |
| 2087 | CLK_INIT(csi0_vfe_clk.c), |
| 2088 | }, |
| 2089 | }; |
| 2090 | |
| 2091 | static struct clk_freq_tbl clk_tbl_cam[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 2092 | F_MND16( 0, gnd, 1, 0, 0), |
| 2093 | F_MND16( 6000000, pll1, 4, 1, 32), |
| 2094 | F_MND16( 8000000, pll1, 4, 1, 24), |
| 2095 | F_MND16(12000000, pll1, 4, 1, 16), |
| 2096 | F_MND16(16000000, pll1, 4, 1, 12), |
| 2097 | F_MND16(19200000, pll1, 4, 1, 10), |
| 2098 | F_MND16(24000000, pll1, 4, 1, 8), |
| 2099 | F_MND16(32000000, pll1, 4, 1, 6), |
| 2100 | F_MND16(48000000, pll1, 4, 1, 4), |
| 2101 | F_MND16(64000000, pll1, 4, 1, 3), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2102 | F_END, |
| 2103 | }; |
| 2104 | |
| 2105 | static struct rcg_clk cam_m_clk = { |
| 2106 | .b = { |
| 2107 | .ctl_reg = CAM_NS_REG, |
| 2108 | .halt_check = DELAY, |
| 2109 | .reset_mask = P_CAM_M_CLK, |
| 2110 | }, |
| 2111 | .ns_reg = CAM_NS_REG, |
| 2112 | .md_reg = CAM_NS_REG - 4, |
| 2113 | .root_en_mask = BIT(9), |
| 2114 | .freq_tbl = clk_tbl_cam, |
| 2115 | .ns_mask = F_MASK_MND16, |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame^] | 2116 | .mnd_en_mask = BIT(8), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2117 | .set_rate = set_rate_mnd, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 2118 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2119 | .c = { |
| 2120 | .dbg_name = "cam_m_clk", |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 2121 | .ops = &clk_ops_rcg_7x30, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 2122 | VDD_DIG_FMAX_MAP1(NOMINAL, 64000000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2123 | CLK_INIT(cam_m_clk.c), |
| 2124 | }, |
| 2125 | }; |
| 2126 | |
| 2127 | static struct clk_freq_tbl clk_tbl_vpe[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 2128 | F_MND8( 24576000, 22, 15, lpxo, 1, 0, 0), |
| 2129 | F_MND8( 30720000, 22, 15, pll3, 4, 1, 6), |
| 2130 | F_MND8( 61440000, 22, 15, pll3, 4, 1, 3), |
| 2131 | F_MND8( 81920000, 22, 15, pll3, 3, 1, 3), |
| 2132 | F_MND8(122880000, 22, 15, pll3, 3, 1, 2), |
| 2133 | F_MND8(147456000, 22, 15, pll3, 1, 1, 5), |
| 2134 | F_MND8(153600000, 22, 15, pll1, 1, 1, 5), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2135 | F_END, |
| 2136 | }; |
| 2137 | |
| 2138 | static struct rcg_clk vpe_clk = { |
| 2139 | .b = { |
| 2140 | .ctl_reg = VPE_NS_REG, |
| 2141 | .en_mask = BIT(9), |
| 2142 | .halt_reg = CLK_HALT_STATEC_REG, |
| 2143 | .halt_bit = 10, |
| 2144 | .reset_mask = P_VPE_CLK, |
| 2145 | }, |
| 2146 | .ns_reg = VPE_NS_REG, |
| 2147 | .md_reg = VPE_NS_REG - 4, |
| 2148 | .ns_mask = F_MASK_MND8(22, 15), |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame^] | 2149 | .mnd_en_mask = BIT(8), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2150 | .root_en_mask = BIT(11), |
| 2151 | .freq_tbl = clk_tbl_vpe, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 2152 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2153 | .set_rate = set_rate_mnd, |
| 2154 | .c = { |
| 2155 | .dbg_name = "vpe_clk", |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 2156 | .ops = &clk_ops_rcg_7x30, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 2157 | VDD_DIG_FMAX_MAP1(NOMINAL, 153600000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2158 | CLK_INIT(vpe_clk.c), |
Stephen Boyd | 7fa2674 | 2011-08-11 23:22:29 -0700 | [diff] [blame] | 2159 | .depends = &axi_vpe_clk.c, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2160 | }, |
| 2161 | }; |
| 2162 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2163 | static struct clk_freq_tbl clk_tbl_mfc[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 2164 | F_MND8( 24576000, 24, 17, lpxo, 1, 0, 0), |
| 2165 | F_MND8( 30720000, 24, 17, pll3, 4, 1, 6), |
| 2166 | F_MND8( 61440000, 24, 17, pll3, 4, 1, 3), |
| 2167 | F_MND8( 81920000, 24, 17, pll3, 3, 1, 3), |
| 2168 | F_MND8(122880000, 24, 17, pll3, 3, 1, 2), |
| 2169 | F_MND8(147456000, 24, 17, pll3, 1, 1, 5), |
| 2170 | F_MND8(153600000, 24, 17, pll1, 1, 1, 5), |
| 2171 | F_MND8(170667000, 24, 17, pll1, 1, 2, 9), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2172 | F_END, |
| 2173 | }; |
| 2174 | |
| 2175 | static struct rcg_clk mfc_clk = { |
| 2176 | .b = { |
| 2177 | .ctl_reg = MFC_NS_REG, |
| 2178 | .en_mask = BIT(9), |
| 2179 | .halt_reg = CLK_HALT_STATEC_REG, |
| 2180 | .halt_bit = 12, |
| 2181 | .reset_mask = P_MFC_CLK, |
| 2182 | }, |
| 2183 | .ns_reg = MFC_NS_REG, |
| 2184 | .md_reg = MFC_NS_REG - 4, |
| 2185 | .ns_mask = F_MASK_MND8(24, 17), |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame^] | 2186 | .mnd_en_mask = BIT(8), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2187 | .root_en_mask = BIT(11), |
| 2188 | .freq_tbl = clk_tbl_mfc, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 2189 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2190 | .set_rate = set_rate_mnd, |
| 2191 | .c = { |
| 2192 | .dbg_name = "mfc_clk", |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 2193 | .ops = &clk_ops_rcg_7x30, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 2194 | VDD_DIG_FMAX_MAP1(NOMINAL, 170667000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2195 | CLK_INIT(mfc_clk.c), |
Stephen Boyd | 7fa2674 | 2011-08-11 23:22:29 -0700 | [diff] [blame] | 2196 | .depends = &axi_mfc_clk.c, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2197 | }, |
| 2198 | }; |
| 2199 | |
| 2200 | static struct branch_clk mfc_div2_clk = { |
| 2201 | .b = { |
| 2202 | .ctl_reg = MFC_NS_REG, |
| 2203 | .en_mask = BIT(15), |
| 2204 | .halt_reg = CLK_HALT_STATEC_REG, |
| 2205 | .halt_bit = 11, |
| 2206 | .reset_mask = P_MFC_DIV2_CLK, |
| 2207 | }, |
| 2208 | .parent = &mfc_clk.c, |
| 2209 | .c = { |
| 2210 | .dbg_name = "mfc_div2_clk", |
| 2211 | .ops = &clk_ops_branch, |
| 2212 | CLK_INIT(mfc_div2_clk.c), |
| 2213 | }, |
| 2214 | }; |
| 2215 | |
| 2216 | static struct clk_freq_tbl clk_tbl_spi[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 2217 | F_MND8( 0, 0, 0, gnd, 1, 0, 0), |
| 2218 | F_MND8( 9963243, 19, 12, pll3, 4, 2, 37), |
Matt Wagantall | a7df37f | 2011-11-11 11:28:11 -0800 | [diff] [blame] | 2219 | F_MND8(24576000, 19, 12, lpxo, 1, 0, 0), |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 2220 | F_MND8(26331429, 19, 12, pll3, 4, 1, 7), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2221 | F_END, |
| 2222 | }; |
| 2223 | |
| 2224 | static struct rcg_clk spi_clk = { |
| 2225 | .b = { |
| 2226 | .ctl_reg = SPI_NS_REG, |
| 2227 | .en_mask = BIT(9), |
| 2228 | .halt_reg = CLK_HALT_STATEC_REG, |
| 2229 | .halt_bit = 0, |
| 2230 | .reset_mask = P_SPI_CLK, |
| 2231 | }, |
| 2232 | .ns_reg = SPI_NS_REG, |
| 2233 | .md_reg = SPI_NS_REG - 4, |
| 2234 | .ns_mask = F_MASK_MND8(19, 12), |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame^] | 2235 | .mnd_en_mask = BIT(8), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2236 | .root_en_mask = BIT(11), |
| 2237 | .freq_tbl = clk_tbl_spi, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 2238 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2239 | .set_rate = set_rate_mnd, |
| 2240 | .c = { |
| 2241 | .dbg_name = "spi_clk", |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 2242 | .ops = &clk_ops_rcg_7x30, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 2243 | VDD_DIG_FMAX_MAP1(NOMINAL, 26331429), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2244 | CLK_INIT(spi_clk.c), |
| 2245 | }, |
| 2246 | }; |
| 2247 | |
| 2248 | static struct clk_freq_tbl clk_tbl_lpa_codec[] = { |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame^] | 2249 | F_RAW(1, NULL, 0, 0, 0, NULL), /* src MI2S_CODEC_RX */ |
| 2250 | F_RAW(2, NULL, 0, 1, 0, NULL), /* src ECODEC_CIF */ |
| 2251 | F_RAW(3, NULL, 0, 2, 0, NULL), /* src MI2S */ |
| 2252 | F_RAW(4, NULL, 0, 3, 0, NULL), /* src SDAC */ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2253 | F_END, |
| 2254 | }; |
| 2255 | |
| 2256 | static struct rcg_clk lpa_codec_clk = { |
| 2257 | .b = { |
| 2258 | .ctl_reg = LPA_NS_REG, |
| 2259 | .en_mask = BIT(9), |
| 2260 | .halt_reg = CLK_HALT_STATEC_REG, |
| 2261 | .halt_bit = 6, |
| 2262 | .reset_mask = P_LPA_CODEC_CLK, |
| 2263 | }, |
| 2264 | .ns_reg = LPA_NS_REG, |
| 2265 | .ns_mask = BM(1, 0), |
| 2266 | .set_rate = set_rate_nop, |
| 2267 | .freq_tbl = clk_tbl_lpa_codec, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 2268 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2269 | .c = { |
| 2270 | .dbg_name = "lpa_codec_clk", |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 2271 | .ops = &clk_ops_rcg_7x30, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 2272 | VDD_DIG_FMAX_MAP1(LOW, 4), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2273 | CLK_INIT(lpa_codec_clk.c), |
| 2274 | }, |
| 2275 | }; |
| 2276 | |
| 2277 | static struct clk_freq_tbl clk_tbl_mdc[] = { |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame^] | 2278 | F_RAW(1, NULL, 0, 0, 0, NULL), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2279 | F_END |
| 2280 | }; |
| 2281 | |
| 2282 | static struct rcg_clk mdc_clk = { |
| 2283 | .b = { |
| 2284 | .ctl_reg = MDC_NS_REG, |
| 2285 | .en_mask = BIT(9), |
| 2286 | .halt_reg = CLK_HALT_STATEA_REG, |
| 2287 | .halt_bit = 10, |
| 2288 | .reset_mask = P_MDC_CLK, |
| 2289 | }, |
| 2290 | .ns_reg = MDC_NS_REG, |
| 2291 | .root_en_mask = BIT(11), |
| 2292 | .freq_tbl = clk_tbl_mdc, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 2293 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2294 | .set_rate = set_rate_nop, |
| 2295 | .c = { |
| 2296 | .dbg_name = "mdc_clk", |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 2297 | .ops = &clk_ops_rcg_7x30, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 2298 | VDD_DIG_FMAX_MAP1(LOW, 1), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2299 | CLK_INIT(mdc_clk.c), |
| 2300 | }, |
| 2301 | }; |
| 2302 | |
| 2303 | static struct branch_clk lpa_core_clk = { |
| 2304 | .b = { |
| 2305 | .ctl_reg = LPA_NS_REG, |
| 2306 | .en_mask = BIT(5), |
| 2307 | .halt_reg = CLK_HALT_STATEC_REG, |
| 2308 | .halt_bit = 5, |
| 2309 | .reset_mask = P_LPA_CORE_CLK, |
| 2310 | }, |
| 2311 | .c = { |
| 2312 | .dbg_name = "lpa_core_clk", |
| 2313 | .ops = &clk_ops_branch, |
| 2314 | CLK_INIT(lpa_core_clk.c), |
| 2315 | }, |
| 2316 | }; |
| 2317 | |
| 2318 | static DEFINE_CLK_PCOM(adsp_clk, ADSP_CLK, CLKFLAG_SKIP_AUTO_OFF); |
| 2319 | static DEFINE_CLK_PCOM(codec_ssbi_clk, CODEC_SSBI_CLK, CLKFLAG_SKIP_AUTO_OFF); |
| 2320 | static DEFINE_CLK_PCOM(ebi1_clk, EBI1_CLK, CLKFLAG_SKIP_AUTO_OFF | CLKFLAG_MIN); |
| 2321 | static DEFINE_CLK_PCOM(ebi1_fixed_clk, EBI1_FIXED_CLK, CLKFLAG_MIN | |
| 2322 | CLKFLAG_SKIP_AUTO_OFF); |
| 2323 | static DEFINE_CLK_PCOM(ecodec_clk, ECODEC_CLK, CLKFLAG_SKIP_AUTO_OFF); |
| 2324 | static DEFINE_CLK_PCOM(gp_clk, GP_CLK, CLKFLAG_SKIP_AUTO_OFF); |
| 2325 | static DEFINE_CLK_PCOM(uart3_clk, UART3_CLK, 0); |
| 2326 | static DEFINE_CLK_PCOM(usb_phy_clk, USB_PHY_CLK, CLKFLAG_MIN); |
| 2327 | |
| 2328 | static DEFINE_CLK_PCOM(p_grp_2d_clk, GRP_2D_CLK, CLKFLAG_SKIP_AUTO_OFF); |
| 2329 | static DEFINE_CLK_PCOM(p_grp_2d_p_clk, GRP_2D_P_CLK, CLKFLAG_SKIP_AUTO_OFF); |
| 2330 | static DEFINE_CLK_PCOM(p_hdmi_clk, HDMI_CLK, CLKFLAG_SKIP_AUTO_OFF); |
Matt Wagantall | 2eedd22 | 2011-11-16 12:55:21 -0800 | [diff] [blame] | 2331 | static DEFINE_CLK_PCOM(p_jpeg_clk, JPEG_CLK, CLKFLAG_MIN); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2332 | static DEFINE_CLK_PCOM(p_jpeg_p_clk, JPEG_P_CLK, 0); |
| 2333 | static DEFINE_CLK_PCOM(p_lpa_codec_clk, LPA_CODEC_CLK, CLKFLAG_SKIP_AUTO_OFF); |
| 2334 | static DEFINE_CLK_PCOM(p_lpa_core_clk, LPA_CORE_CLK, CLKFLAG_SKIP_AUTO_OFF); |
| 2335 | static DEFINE_CLK_PCOM(p_lpa_p_clk, LPA_P_CLK, CLKFLAG_SKIP_AUTO_OFF); |
| 2336 | static DEFINE_CLK_PCOM(p_mi2s_m_clk, MI2S_M_CLK, CLKFLAG_SKIP_AUTO_OFF); |
| 2337 | static DEFINE_CLK_PCOM(p_mi2s_s_clk, MI2S_S_CLK, CLKFLAG_SKIP_AUTO_OFF); |
| 2338 | static DEFINE_CLK_PCOM(p_mi2s_codec_rx_m_clk, MI2S_CODEC_RX_M_CLK, |
| 2339 | CLKFLAG_SKIP_AUTO_OFF); |
| 2340 | static DEFINE_CLK_PCOM(p_mi2s_codec_rx_s_clk, MI2S_CODEC_RX_S_CLK, |
| 2341 | CLKFLAG_SKIP_AUTO_OFF); |
| 2342 | static DEFINE_CLK_PCOM(p_mi2s_codec_tx_m_clk, MI2S_CODEC_TX_M_CLK, |
| 2343 | CLKFLAG_SKIP_AUTO_OFF); |
| 2344 | static DEFINE_CLK_PCOM(p_mi2s_codec_tx_s_clk, MI2S_CODEC_TX_S_CLK, |
| 2345 | CLKFLAG_SKIP_AUTO_OFF); |
| 2346 | static DEFINE_CLK_PCOM(p_sdac_clk, SDAC_CLK, 0); |
| 2347 | static DEFINE_CLK_PCOM(p_sdac_m_clk, SDAC_M_CLK, 0); |
| 2348 | static DEFINE_CLK_PCOM(p_vfe_clk, VFE_CLK, CLKFLAG_SKIP_AUTO_OFF); |
| 2349 | static DEFINE_CLK_PCOM(p_vfe_camif_clk, VFE_CAMIF_CLK, CLKFLAG_SKIP_AUTO_OFF); |
| 2350 | static DEFINE_CLK_PCOM(p_vfe_mdc_clk, VFE_MDC_CLK, CLKFLAG_SKIP_AUTO_OFF); |
| 2351 | static DEFINE_CLK_PCOM(p_vfe_p_clk, VFE_P_CLK, 0); |
| 2352 | static DEFINE_CLK_PCOM(p_grp_3d_clk, GRP_3D_CLK, CLKFLAG_SKIP_AUTO_OFF); |
| 2353 | static DEFINE_CLK_PCOM(p_grp_3d_p_clk, GRP_3D_P_CLK, CLKFLAG_SKIP_AUTO_OFF); |
| 2354 | static DEFINE_CLK_PCOM(p_imem_clk, IMEM_CLK, 0); |
| 2355 | static DEFINE_CLK_PCOM(p_mdp_lcdc_pad_pclk_clk, MDP_LCDC_PAD_PCLK_CLK, |
| 2356 | CLKFLAG_SKIP_AUTO_OFF); |
| 2357 | static DEFINE_CLK_PCOM(p_mdp_lcdc_pclk_clk, MDP_LCDC_PCLK_CLK, |
| 2358 | CLKFLAG_SKIP_AUTO_OFF); |
| 2359 | static DEFINE_CLK_PCOM(p_mdp_p_clk, MDP_P_CLK, CLKFLAG_SKIP_AUTO_OFF); |
| 2360 | static DEFINE_CLK_PCOM(p_mdp_vsync_clk, MDP_VSYNC_CLK, 0); |
| 2361 | static DEFINE_CLK_PCOM(p_tsif_ref_clk, TSIF_REF_CLK, CLKFLAG_SKIP_AUTO_OFF); |
| 2362 | static DEFINE_CLK_PCOM(p_tsif_p_clk, TSIF_P_CLK, CLKFLAG_SKIP_AUTO_OFF); |
| 2363 | static DEFINE_CLK_PCOM(p_tv_dac_clk, TV_DAC_CLK, CLKFLAG_SKIP_AUTO_OFF); |
| 2364 | static DEFINE_CLK_PCOM(p_tv_enc_clk, TV_ENC_CLK, CLKFLAG_SKIP_AUTO_OFF); |
| 2365 | static DEFINE_CLK_PCOM(p_emdh_clk, EMDH_CLK, CLKFLAG_MIN | CLKFLAG_MAX); |
| 2366 | static DEFINE_CLK_PCOM(p_emdh_p_clk, EMDH_P_CLK, 0); |
| 2367 | static DEFINE_CLK_PCOM(p_i2c_clk, I2C_CLK, CLKFLAG_SKIP_AUTO_OFF); |
| 2368 | static DEFINE_CLK_PCOM(p_i2c_2_clk, I2C_2_CLK, CLKFLAG_SKIP_AUTO_OFF); |
| 2369 | static DEFINE_CLK_PCOM(p_mdc_clk, MDC_CLK, CLKFLAG_SKIP_AUTO_OFF); |
| 2370 | static DEFINE_CLK_PCOM(p_pmdh_clk, PMDH_CLK, CLKFLAG_MIN | CLKFLAG_MAX); |
| 2371 | static DEFINE_CLK_PCOM(p_pmdh_p_clk, PMDH_P_CLK, CLKFLAG_SKIP_AUTO_OFF); |
| 2372 | static DEFINE_CLK_PCOM(p_sdc1_clk, SDC1_CLK, 0); |
| 2373 | static DEFINE_CLK_PCOM(p_sdc1_p_clk, SDC1_P_CLK, 0); |
| 2374 | static DEFINE_CLK_PCOM(p_sdc2_clk, SDC2_CLK, 0); |
| 2375 | static DEFINE_CLK_PCOM(p_sdc2_p_clk, SDC2_P_CLK, 0); |
| 2376 | static DEFINE_CLK_PCOM(p_sdc3_clk, SDC3_CLK, 0); |
| 2377 | static DEFINE_CLK_PCOM(p_sdc3_p_clk, SDC3_P_CLK, 0); |
| 2378 | static DEFINE_CLK_PCOM(p_sdc4_clk, SDC4_CLK, 0); |
| 2379 | static DEFINE_CLK_PCOM(p_sdc4_p_clk, SDC4_P_CLK, 0); |
| 2380 | static DEFINE_CLK_PCOM(p_uart2_clk, UART2_CLK, CLKFLAG_SKIP_AUTO_OFF); |
| 2381 | static DEFINE_CLK_PCOM(p_usb_hs2_clk, USB_HS2_CLK, 0); |
| 2382 | static DEFINE_CLK_PCOM(p_usb_hs2_core_clk, USB_HS2_CORE_CLK, 0); |
| 2383 | static DEFINE_CLK_PCOM(p_usb_hs2_p_clk, USB_HS2_P_CLK, 0); |
| 2384 | static DEFINE_CLK_PCOM(p_usb_hs3_clk, USB_HS3_CLK, 0); |
| 2385 | static DEFINE_CLK_PCOM(p_usb_hs3_core_clk, USB_HS3_CORE_CLK, 0); |
| 2386 | static DEFINE_CLK_PCOM(p_usb_hs3_p_clk, USB_HS3_P_CLK, 0); |
| 2387 | static DEFINE_CLK_PCOM(p_qup_i2c_clk, QUP_I2C_CLK, CLKFLAG_SKIP_AUTO_OFF); |
| 2388 | static DEFINE_CLK_PCOM(p_spi_clk, SPI_CLK, CLKFLAG_SKIP_AUTO_OFF); |
| 2389 | static DEFINE_CLK_PCOM(p_spi_p_clk, SPI_P_CLK, CLKFLAG_SKIP_AUTO_OFF); |
| 2390 | static DEFINE_CLK_PCOM(p_uart1_clk, UART1_CLK, 0); |
| 2391 | static DEFINE_CLK_PCOM(p_uart1dm_clk, UART1DM_CLK, 0); |
| 2392 | static DEFINE_CLK_PCOM(p_uart2dm_clk, UART2DM_CLK, CLKFLAG_SKIP_AUTO_OFF); |
| 2393 | static DEFINE_CLK_PCOM(p_usb_hs_clk, USB_HS_CLK, 0); |
| 2394 | static DEFINE_CLK_PCOM(p_usb_hs_core_clk, USB_HS_CORE_CLK, 0); |
| 2395 | static DEFINE_CLK_PCOM(p_usb_hs_p_clk, USB_HS_P_CLK, 0); |
| 2396 | static DEFINE_CLK_PCOM(p_cam_m_clk, CAM_M_CLK, CLKFLAG_SKIP_AUTO_OFF); |
| 2397 | static DEFINE_CLK_PCOM(p_camif_pad_p_clk, CAMIF_PAD_P_CLK, 0); |
| 2398 | static DEFINE_CLK_PCOM(p_csi0_clk, CSI0_CLK, CLKFLAG_SKIP_AUTO_OFF); |
| 2399 | static DEFINE_CLK_PCOM(p_csi0_vfe_clk, CSI0_VFE_CLK, CLKFLAG_SKIP_AUTO_OFF); |
| 2400 | static DEFINE_CLK_PCOM(p_csi0_p_clk, CSI0_P_CLK, CLKFLAG_SKIP_AUTO_OFF); |
Matt Wagantall | a12cc95 | 2011-11-08 18:14:50 -0800 | [diff] [blame] | 2401 | static DEFINE_CLK_PCOM(p_mdp_clk, MDP_CLK, CLKFLAG_MIN); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2402 | static DEFINE_CLK_PCOM(p_mfc_clk, MFC_CLK, CLKFLAG_SKIP_AUTO_OFF); |
| 2403 | static DEFINE_CLK_PCOM(p_mfc_div2_clk, MFC_DIV2_CLK, CLKFLAG_SKIP_AUTO_OFF); |
| 2404 | static DEFINE_CLK_PCOM(p_mfc_p_clk, MFC_P_CLK, CLKFLAG_SKIP_AUTO_OFF); |
| 2405 | static DEFINE_CLK_PCOM(p_vpe_clk, VPE_CLK, CLKFLAG_SKIP_AUTO_OFF); |
| 2406 | static DEFINE_CLK_PCOM(p_adm_clk, ADM_CLK, CLKFLAG_SKIP_AUTO_OFF); |
| 2407 | static DEFINE_CLK_PCOM(p_ce_clk, CE_CLK, CLKFLAG_SKIP_AUTO_OFF); |
| 2408 | static DEFINE_CLK_PCOM(p_axi_rotator_clk, AXI_ROTATOR_CLK, |
| 2409 | CLKFLAG_SKIP_AUTO_OFF); |
| 2410 | static DEFINE_CLK_PCOM(p_rotator_imem_clk, ROTATOR_IMEM_CLK, 0); |
| 2411 | static DEFINE_CLK_PCOM(p_rotator_p_clk, ROTATOR_P_CLK, 0); |
| 2412 | |
| 2413 | static DEFINE_CLK_VOTER(ebi_dtv_clk, &ebi1_fixed_clk.c); |
Matt Wagantall | 9dc0163 | 2011-08-17 18:55:04 -0700 | [diff] [blame] | 2414 | static DEFINE_CLK_VOTER(ebi_grp_3d_clk, &ebi1_fixed_clk.c); |
| 2415 | static DEFINE_CLK_VOTER(ebi_grp_2d_clk, &ebi1_fixed_clk.c); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2416 | static DEFINE_CLK_VOTER(ebi_lcdc_clk, &ebi1_fixed_clk.c); |
| 2417 | static DEFINE_CLK_VOTER(ebi_mddi_clk, &ebi1_fixed_clk.c); |
| 2418 | static DEFINE_CLK_VOTER(ebi_tv_clk, &ebi1_fixed_clk.c); |
| 2419 | static DEFINE_CLK_VOTER(ebi_vcd_clk, &ebi1_fixed_clk.c); |
| 2420 | static DEFINE_CLK_VOTER(ebi_vfe_clk, &ebi1_fixed_clk.c); |
| 2421 | static DEFINE_CLK_VOTER(ebi_adm_clk, &ebi1_fixed_clk.c); |
| 2422 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2423 | #ifdef CONFIG_DEBUG_FS |
| 2424 | |
| 2425 | #define CLK_TEST_2(s) (s) |
| 2426 | #define CLK_TEST_HS(s) (0x4000 | ((s) << 8)) |
| 2427 | #define CLK_TEST_LS(s) (0x4D40 | (s)) |
| 2428 | |
| 2429 | struct measure_sel { |
| 2430 | u32 test_vector; |
| 2431 | struct clk *clk; |
| 2432 | }; |
| 2433 | |
| 2434 | static struct measure_sel measure_mux[] = { |
| 2435 | { CLK_TEST_2(0x03), &emdh_p_clk.c }, |
| 2436 | { CLK_TEST_2(0x04), &pmdh_p_clk.c }, |
| 2437 | { CLK_TEST_2(0x06), &mdp_p_clk.c }, |
| 2438 | { CLK_TEST_2(0x07), &lpa_p_clk.c }, |
| 2439 | { CLK_TEST_2(0x08), &usb_hs2_p_clk.c }, |
| 2440 | { CLK_TEST_2(0x09), &spi_clk.c }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2441 | { CLK_TEST_2(0x0B), &i2c_2_clk.c }, |
| 2442 | { CLK_TEST_2(0x0D), &mi2s_m_clk.c }, |
| 2443 | { CLK_TEST_2(0x0E), &lpa_core_clk.c }, |
| 2444 | { CLK_TEST_2(0x0F), &lpa_codec_clk.c }, |
| 2445 | { CLK_TEST_2(0x10), &usb_hs3_p_clk.c }, |
| 2446 | { CLK_TEST_2(0x11), &adm_p_clk.c }, |
| 2447 | { CLK_TEST_2(0x13), &hdmi_clk.c }, |
| 2448 | { CLK_TEST_2(0x14), &usb_hs_core_clk.c }, |
| 2449 | { CLK_TEST_2(0x15), &usb_hs2_core_clk.c }, |
| 2450 | { CLK_TEST_2(0x16), &usb_hs3_core_clk.c }, |
| 2451 | { CLK_TEST_2(0x17), &mi2s_codec_tx_s_clk.c }, |
| 2452 | { CLK_TEST_2(0x18), &spi_p_clk.c }, |
| 2453 | { CLK_TEST_2(0x1A), &camif_pad_p_clk.c }, |
| 2454 | { CLK_TEST_2(0x1C), &qup_i2c_clk.c }, |
| 2455 | { CLK_TEST_2(0x1F), &mfc_div2_clk.c }, |
| 2456 | { CLK_TEST_2(0x38), &mfc_clk.c }, |
| 2457 | |
| 2458 | { CLK_TEST_HS(0x00), &adm_clk.c }, |
| 2459 | { CLK_TEST_HS(0x01), &mdp_lcdc_pad_pclk_clk.c }, |
| 2460 | { CLK_TEST_HS(0x02), &mdp_lcdc_pclk_clk.c }, |
| 2461 | { CLK_TEST_HS(0x03), &axi_rotator_clk.c }, |
| 2462 | { CLK_TEST_HS(0x07), &axi_li_vg_clk.c }, |
| 2463 | { CLK_TEST_HS(0x09), &axi_li_apps_clk.c }, |
| 2464 | { CLK_TEST_HS(0x0E), &axi_li_jpeg_clk.c }, |
| 2465 | { CLK_TEST_HS(0x0F), &emdh_clk.c }, |
| 2466 | { CLK_TEST_HS(0x14), &mdp_clk.c }, |
| 2467 | { CLK_TEST_HS(0x15), &pmdh_clk.c }, |
| 2468 | { CLK_TEST_HS(0x19), &axi_grp_2d_clk.c }, |
| 2469 | { CLK_TEST_HS(0x1A), &axi_li_grp_clk.c }, |
| 2470 | { CLK_TEST_HS(0x1B), &axi_li_vfe_clk.c }, |
| 2471 | { CLK_TEST_HS(0x1C), &grp_2d_clk.c }, |
| 2472 | { CLK_TEST_HS(0x1E), &grp_3d_clk.c }, |
| 2473 | { CLK_TEST_HS(0x1F), &imem_clk.c }, |
| 2474 | { CLK_TEST_HS(0x20), &jpeg_clk.c }, |
| 2475 | { CLK_TEST_HS(0x24), &axi_li_adsp_a_clk.c }, |
| 2476 | { CLK_TEST_HS(0x26), &rotator_imem_clk.c }, |
| 2477 | { CLK_TEST_HS(0x27), &axi_vpe_clk.c }, |
| 2478 | { CLK_TEST_HS(0x2A), &axi_mfc_clk.c }, |
| 2479 | { CLK_TEST_HS(0x2B), &axi_mdp_clk.c }, |
| 2480 | { CLK_TEST_HS(0x2C), &vpe_clk.c }, |
| 2481 | { CLK_TEST_HS(0x30), &vfe_camif_clk.c }, |
| 2482 | { CLK_TEST_HS(0x31), &csi0_clk.c }, |
| 2483 | { CLK_TEST_HS(0x32), &csi0_vfe_clk.c }, |
| 2484 | { CLK_TEST_HS(0x33), &csi0_p_clk.c }, |
| 2485 | |
| 2486 | { CLK_TEST_LS(0x03), &ce_clk.c }, |
| 2487 | { CLK_TEST_LS(0x04), &cam_m_clk.c }, |
| 2488 | { CLK_TEST_LS(0x0C), &grp_2d_p_clk.c }, |
| 2489 | { CLK_TEST_LS(0x0D), &i2c_clk.c }, |
| 2490 | { CLK_TEST_LS(0x0E), &mi2s_codec_rx_m_clk.c }, |
| 2491 | { CLK_TEST_LS(0x0F), &mi2s_codec_rx_s_clk.c }, |
| 2492 | { CLK_TEST_LS(0x10), &mi2s_codec_tx_m_clk.c }, |
| 2493 | { CLK_TEST_LS(0x13), &mdp_vsync_clk.c }, |
| 2494 | { CLK_TEST_LS(0x15), &vfe_p_clk.c }, |
| 2495 | { CLK_TEST_LS(0x16), &mdc_clk.c }, |
| 2496 | { CLK_TEST_LS(0x17), &vfe_mdc_clk.c }, |
| 2497 | { CLK_TEST_LS(0x18), &usb_hs_p_clk.c }, |
| 2498 | { CLK_TEST_LS(0x1C), &uart1dm_p_clk.c }, |
| 2499 | { CLK_TEST_LS(0x1E), &jpeg_p_clk.c }, |
| 2500 | { CLK_TEST_LS(0x20), &sdac_clk.c }, |
| 2501 | { CLK_TEST_LS(0x21), &sdc1_p_clk.c }, |
| 2502 | { CLK_TEST_LS(0x22), &sdc1_clk.c }, |
| 2503 | { CLK_TEST_LS(0x23), &sdc2_p_clk.c }, |
| 2504 | { CLK_TEST_LS(0x24), &sdc2_clk.c }, |
| 2505 | { CLK_TEST_LS(0x25), &tsif_p_clk.c }, |
| 2506 | { CLK_TEST_LS(0x26), &sdac_m_clk.c }, |
| 2507 | { CLK_TEST_LS(0x27), &grp_3d_p_clk.c }, |
| 2508 | { CLK_TEST_LS(0x2A), &tsif_ref_clk.c }, |
| 2509 | { CLK_TEST_LS(0x2B), &tv_enc_clk.c }, |
| 2510 | { CLK_TEST_LS(0x2C), &tv_dac_clk.c }, |
| 2511 | { CLK_TEST_LS(0x2D), &rotator_p_clk.c }, |
| 2512 | { CLK_TEST_LS(0x2F), &uart1_clk.c }, |
| 2513 | { CLK_TEST_LS(0x30), &uart1dm_clk.c }, |
| 2514 | { CLK_TEST_LS(0x31), &uart2_clk.c }, |
| 2515 | { CLK_TEST_LS(0x33), &usb_hs2_clk.c }, |
| 2516 | { CLK_TEST_LS(0x34), &usb_hs3_clk.c }, |
| 2517 | { CLK_TEST_LS(0x35), &mfc_p_clk.c }, |
| 2518 | { CLK_TEST_LS(0x36), &vfe_clk.c }, |
| 2519 | { CLK_TEST_LS(0x39), &sdc3_p_clk.c }, |
| 2520 | { CLK_TEST_LS(0x3A), &sdc3_clk.c }, |
| 2521 | { CLK_TEST_LS(0x3B), &sdc4_p_clk.c }, |
| 2522 | { CLK_TEST_LS(0x3C), &sdc4_clk.c }, |
| 2523 | { CLK_TEST_LS(0x3D), &uart2dm_clk.c }, |
| 2524 | { CLK_TEST_LS(0x3E), &uart2dm_p_clk.c }, |
| 2525 | { CLK_TEST_LS(0x3F), &usb_hs_clk.c }, |
| 2526 | }; |
| 2527 | |
| 2528 | static struct measure_sel *find_measure_sel(struct clk *clk) |
| 2529 | { |
| 2530 | int i; |
| 2531 | |
| 2532 | for (i = 0; i < ARRAY_SIZE(measure_mux); i++) |
| 2533 | if (measure_mux[i].clk == clk) |
| 2534 | return &measure_mux[i]; |
| 2535 | return NULL; |
| 2536 | } |
| 2537 | |
| 2538 | static int measure_clk_set_parent(struct clk *clk, struct clk *parent) |
| 2539 | { |
| 2540 | struct measure_sel *p; |
| 2541 | unsigned long flags; |
| 2542 | |
| 2543 | if (!parent) |
| 2544 | return -EINVAL; |
| 2545 | |
| 2546 | p = find_measure_sel(parent); |
| 2547 | if (!p) |
| 2548 | return -EINVAL; |
| 2549 | |
| 2550 | spin_lock_irqsave(&local_clock_reg_lock, flags); |
| 2551 | |
| 2552 | /* Program test vector. */ |
| 2553 | if (p->test_vector <= 0xFF) { |
| 2554 | /* Select CLK_TEST_2 */ |
| 2555 | writel_relaxed(0x4D40, CLK_TEST_BASE_REG); |
| 2556 | writel_relaxed(p->test_vector, CLK_TEST_2_BASE_REG); |
| 2557 | } else |
| 2558 | writel_relaxed(p->test_vector, CLK_TEST_BASE_REG); |
| 2559 | |
| 2560 | spin_unlock_irqrestore(&local_clock_reg_lock, flags); |
| 2561 | |
| 2562 | return 0; |
| 2563 | } |
| 2564 | |
| 2565 | /* Sample clock for 'tcxo4_ticks' reference clock ticks. */ |
Matt Wagantall | 9de3bfb | 2011-11-03 20:13:12 -0700 | [diff] [blame] | 2566 | static unsigned long run_measurement(unsigned tcxo4_ticks) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2567 | { |
| 2568 | /* TCXO4_CNT_EN and RINGOSC_CNT_EN register values. */ |
| 2569 | u32 reg_val_enable = readl_relaxed(MISC_CLK_CTL_BASE_REG) | 0x3; |
| 2570 | u32 reg_val_disable = reg_val_enable & ~0x3; |
| 2571 | |
| 2572 | /* Stop counters and set the TCXO4 counter start value. */ |
| 2573 | writel_relaxed(reg_val_disable, MISC_CLK_CTL_BASE_REG); |
| 2574 | writel_relaxed(tcxo4_ticks, TCXO_CNT_BASE_REG); |
| 2575 | |
| 2576 | /* Run measurement and wait for completion. */ |
| 2577 | writel_relaxed(reg_val_enable, MISC_CLK_CTL_BASE_REG); |
| 2578 | while (readl_relaxed(TCXO_CNT_DONE_BASE_REG) == 0) |
| 2579 | cpu_relax(); |
| 2580 | |
| 2581 | /* Stop counters. */ |
| 2582 | writel_relaxed(reg_val_disable, MISC_CLK_CTL_BASE_REG); |
| 2583 | |
| 2584 | return readl_relaxed(RINGOSC_CNT_BASE_REG); |
| 2585 | } |
| 2586 | |
| 2587 | /* Perform a hardware rate measurement for a given clock. |
| 2588 | FOR DEBUG USE ONLY: Measurements take ~15 ms! */ |
Matt Wagantall | 9de3bfb | 2011-11-03 20:13:12 -0700 | [diff] [blame] | 2589 | static unsigned long measure_clk_get_rate(struct clk *clk) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2590 | { |
| 2591 | unsigned long flags; |
| 2592 | u32 regval, prph_web_reg_old; |
| 2593 | u64 raw_count_short, raw_count_full; |
| 2594 | unsigned ret; |
| 2595 | |
| 2596 | clk_enable(&tcxo_clk.c); |
| 2597 | |
| 2598 | spin_lock_irqsave(&local_clock_reg_lock, flags); |
| 2599 | |
| 2600 | /* Enable TCXO4 clock branch and root. */ |
| 2601 | prph_web_reg_old = readl_relaxed(PRPH_WEB_NS_BASE_REG); |
| 2602 | regval = prph_web_reg_old | BIT(9) | BIT(11); |
| 2603 | writel_relaxed(regval, PRPH_WEB_NS_BASE_REG); |
| 2604 | |
| 2605 | /* |
| 2606 | * The ring oscillator counter will not reset if the measured clock |
| 2607 | * is not running. To detect this, run a short measurement before |
| 2608 | * the full measurement. If the raw results of the two are the same |
| 2609 | * then the clock must be off. |
| 2610 | */ |
| 2611 | |
| 2612 | /* Run a short measurement. (~1 ms) */ |
| 2613 | raw_count_short = run_measurement(0x1000); |
| 2614 | /* Run a full measurement. (~14 ms) */ |
| 2615 | raw_count_full = run_measurement(0x10000); |
| 2616 | |
| 2617 | /* Disable TCXO4 clock branch and root. */ |
| 2618 | writel_relaxed(prph_web_reg_old, PRPH_WEB_NS_BASE_REG); |
| 2619 | |
| 2620 | spin_unlock_irqrestore(&local_clock_reg_lock, flags); |
| 2621 | |
| 2622 | /* Return 0 if the clock is off. */ |
| 2623 | if (raw_count_full == raw_count_short) |
| 2624 | ret = 0; |
| 2625 | else { |
| 2626 | /* Compute rate in Hz. */ |
| 2627 | raw_count_full = ((raw_count_full * 10) + 15) * 4800000; |
| 2628 | do_div(raw_count_full, ((0x10000 * 10) + 35)); |
| 2629 | ret = raw_count_full; |
| 2630 | } |
| 2631 | |
| 2632 | clk_disable(&tcxo_clk.c); |
| 2633 | |
| 2634 | return ret; |
| 2635 | } |
| 2636 | #else /* !CONFIG_DEBUG_FS */ |
| 2637 | static int measure_clk_set_parent(struct clk *clk, struct clk *parent) |
| 2638 | { |
| 2639 | return -EINVAL; |
| 2640 | } |
| 2641 | |
Matt Wagantall | 9de3bfb | 2011-11-03 20:13:12 -0700 | [diff] [blame] | 2642 | static unsigned long measure_clk_get_rate(struct clk *clk) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2643 | { |
| 2644 | return 0; |
| 2645 | } |
| 2646 | #endif /* CONFIG_DEBUG_FS */ |
| 2647 | |
| 2648 | static struct clk_ops measure_clk_ops = { |
| 2649 | .set_parent = measure_clk_set_parent, |
| 2650 | .get_rate = measure_clk_get_rate, |
| 2651 | .is_local = local_clk_is_local, |
| 2652 | }; |
| 2653 | |
| 2654 | static struct clk measure_clk = { |
| 2655 | .dbg_name = "measure_clk", |
| 2656 | .ops = &measure_clk_ops, |
| 2657 | CLK_INIT(measure_clk), |
| 2658 | }; |
| 2659 | |
| 2660 | /* Implementation for clk_set_flags(). */ |
| 2661 | int soc_clk_set_flags(struct clk *clk, unsigned clk_flags) |
| 2662 | { |
| 2663 | uint32_t regval, ret = 0; |
| 2664 | unsigned long flags; |
| 2665 | |
| 2666 | spin_lock_irqsave(&local_clock_reg_lock, flags); |
| 2667 | |
| 2668 | if (clk == &vfe_clk.c) { |
| 2669 | regval = readl_relaxed(CAM_VFE_NS_REG); |
| 2670 | /* Flag values chosen for backward compatibility |
| 2671 | * with proc_comm remote clock control. */ |
| 2672 | if (clk_flags == 0x00000100) { |
| 2673 | /* Select external source. */ |
| 2674 | regval |= BIT(14); |
| 2675 | } else if (clk_flags == 0x00000200) { |
| 2676 | /* Select internal source. */ |
| 2677 | regval &= ~BIT(14); |
| 2678 | } else |
| 2679 | ret = -EINVAL; |
| 2680 | |
| 2681 | writel_relaxed(regval, CAM_VFE_NS_REG); |
| 2682 | /* Make sure write is issued before returning. */ |
| 2683 | mb(); |
| 2684 | } else |
| 2685 | ret = -EPERM; |
| 2686 | |
| 2687 | spin_unlock_irqrestore(&local_clock_reg_lock, flags); |
| 2688 | |
| 2689 | return ret; |
| 2690 | } |
| 2691 | |
| 2692 | static int msm7x30_clk_reset(struct clk *clk, enum clk_reset_action action) |
| 2693 | { |
| 2694 | /* reset_mask is actually a proc_comm id */ |
| 2695 | unsigned id = to_rcg_clk(clk)->b.reset_mask; |
| 2696 | return pc_clk_reset(id, action); |
| 2697 | } |
| 2698 | |
| 2699 | static int soc_branch_clk_reset(struct clk *clk, enum clk_reset_action action) |
| 2700 | { |
| 2701 | unsigned id = to_branch_clk(clk)->b.reset_mask; |
| 2702 | return pc_clk_reset(id, action); |
| 2703 | } |
| 2704 | |
| 2705 | /* |
| 2706 | * Clock ownership detection code |
| 2707 | */ |
| 2708 | |
| 2709 | enum { |
| 2710 | SH2_OWN_GLBL, |
| 2711 | SH2_OWN_APPS1, |
| 2712 | SH2_OWN_APPS2, |
| 2713 | SH2_OWN_ROW1, |
| 2714 | SH2_OWN_ROW2, |
| 2715 | SH2_OWN_APPS3, |
| 2716 | NUM_OWNERSHIP |
| 2717 | }; |
| 2718 | static __initdata uint32_t ownership_regs[NUM_OWNERSHIP]; |
| 2719 | |
| 2720 | static void __init cache_ownership(void) |
| 2721 | { |
| 2722 | ownership_regs[SH2_OWN_GLBL] = readl_relaxed(SH2_OWN_GLBL_BASE_REG); |
| 2723 | ownership_regs[SH2_OWN_APPS1] = readl_relaxed(SH2_OWN_APPS1_BASE_REG); |
| 2724 | ownership_regs[SH2_OWN_APPS2] = readl_relaxed(SH2_OWN_APPS2_BASE_REG); |
| 2725 | ownership_regs[SH2_OWN_ROW1] = readl_relaxed(SH2_OWN_ROW1_BASE_REG); |
| 2726 | ownership_regs[SH2_OWN_ROW2] = readl_relaxed(SH2_OWN_ROW2_BASE_REG); |
| 2727 | ownership_regs[SH2_OWN_APPS3] = readl_relaxed(SH2_OWN_APPS3_BASE_REG); |
| 2728 | } |
| 2729 | |
| 2730 | static void __init print_ownership(void) |
| 2731 | { |
| 2732 | pr_info("Clock ownership\n"); |
| 2733 | pr_info(" GLBL : %08x\n", ownership_regs[SH2_OWN_GLBL]); |
| 2734 | pr_info(" APPS : %08x %08x %08x\n", ownership_regs[SH2_OWN_APPS1], |
| 2735 | ownership_regs[SH2_OWN_APPS2], ownership_regs[SH2_OWN_APPS3]); |
| 2736 | pr_info(" ROW : %08x %08x\n", ownership_regs[SH2_OWN_ROW1], |
| 2737 | ownership_regs[SH2_OWN_ROW2]); |
| 2738 | } |
| 2739 | |
| 2740 | #define O(x) (&ownership_regs[(SH2_OWN_##x)]) |
| 2741 | #define OWN(r, b, name, clk, dev) \ |
| 2742 | { \ |
| 2743 | .lk = CLK_LOOKUP(name, clk.c, dev), \ |
| 2744 | .remote = &p_##clk.c, \ |
| 2745 | .reg = O(r), \ |
| 2746 | .bit = BIT(b), \ |
| 2747 | } |
| 2748 | |
| 2749 | static struct clk_local_ownership { |
| 2750 | struct clk_lookup lk; |
| 2751 | const u32 *reg; |
| 2752 | const u32 bit; |
| 2753 | struct clk *remote; |
| 2754 | } ownership_map[] __initdata = { |
| 2755 | /* Sources */ |
| 2756 | { CLK_LOOKUP("pll1_clk", pll1_clk.c, "acpu") }, |
| 2757 | { CLK_LOOKUP("pll2_clk", pll2_clk.c, "acpu") }, |
| 2758 | { CLK_LOOKUP("pll3_clk", pll3_clk.c, "acpu") }, |
| 2759 | { CLK_LOOKUP("measure", measure_clk, "debug") }, |
| 2760 | |
| 2761 | /* PCOM */ |
| 2762 | { CLK_LOOKUP("adsp_clk", adsp_clk.c, NULL) }, |
| 2763 | { CLK_LOOKUP("codec_ssbi_clk", codec_ssbi_clk.c, NULL) }, |
| 2764 | { CLK_LOOKUP("ebi1_clk", ebi1_clk.c, NULL) }, |
| 2765 | { CLK_LOOKUP("ebi1_fixed_clk", ebi1_fixed_clk.c, NULL) }, |
| 2766 | { CLK_LOOKUP("ecodec_clk", ecodec_clk.c, NULL) }, |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 2767 | { CLK_LOOKUP("core_clk", gp_clk.c, "") }, |
Matt Wagantall | e252237 | 2011-08-17 14:52:21 -0700 | [diff] [blame] | 2768 | { CLK_LOOKUP("core_clk", uart3_clk.c, "msm_serial.2") }, |
Manu Gautam | 5143b25 | 2012-01-05 19:25:23 -0800 | [diff] [blame] | 2769 | { CLK_LOOKUP("phy_clk", usb_phy_clk.c, "msm_otg") }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2770 | |
| 2771 | /* Voters */ |
| 2772 | { CLK_LOOKUP("ebi1_dtv_clk", ebi_dtv_clk.c, NULL) }, |
Matt Wagantall | 9dc0163 | 2011-08-17 18:55:04 -0700 | [diff] [blame] | 2773 | { CLK_LOOKUP("bus_clk", ebi_grp_2d_clk.c, "kgsl-2d0.0") }, |
| 2774 | { CLK_LOOKUP("bus_clk", ebi_grp_3d_clk.c, "kgsl-3d0.0") }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2775 | { CLK_LOOKUP("ebi1_lcdc_clk", ebi_lcdc_clk.c, NULL) }, |
| 2776 | { CLK_LOOKUP("ebi1_mddi_clk", ebi_mddi_clk.c, NULL) }, |
| 2777 | { CLK_LOOKUP("ebi1_tv_clk", ebi_tv_clk.c, NULL) }, |
Matt Wagantall | 3f7660b | 2011-08-17 21:25:13 -0700 | [diff] [blame] | 2778 | { CLK_LOOKUP("mem_clk", ebi_vcd_clk.c, "msm_vidc.0") }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2779 | { CLK_LOOKUP("ebi1_vfe_clk", ebi_vfe_clk.c, NULL) }, |
Matt Wagantall | e1a8606 | 2011-08-18 17:46:10 -0700 | [diff] [blame] | 2780 | { CLK_LOOKUP("mem_clk", ebi_adm_clk.c, "msm_dmov") }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2781 | |
| 2782 | /* |
| 2783 | * This is a many-to-one mapping because we don't know how the remote |
| 2784 | * clock code has decided to handle the dependencies between clocks for |
| 2785 | * a particular hardware block. We determine the ownership for all the |
| 2786 | * clocks going into a block by checking the ownership bit of one |
| 2787 | * register (usually the ns register). |
| 2788 | */ |
Matt Wagantall | 9dc0163 | 2011-08-17 18:55:04 -0700 | [diff] [blame] | 2789 | OWN(APPS1, 6, "core_clk", grp_2d_clk, "kgsl-2d0.0"), |
Matt Wagantall | 4972271 | 2011-08-17 18:50:53 -0700 | [diff] [blame] | 2790 | OWN(APPS1, 6, "core_clk", grp_2d_clk, "footswitch-pcom.0"), |
Matt Wagantall | 9dc0163 | 2011-08-17 18:55:04 -0700 | [diff] [blame] | 2791 | OWN(APPS1, 6, "iface_clk", grp_2d_p_clk, "kgsl-2d0.0"), |
Matt Wagantall | 4972271 | 2011-08-17 18:50:53 -0700 | [diff] [blame] | 2792 | OWN(APPS1, 6, "iface_clk", grp_2d_p_clk, "footswitch-pcom.0"), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2793 | OWN(APPS1, 31, "hdmi_clk", hdmi_clk, NULL), |
| 2794 | OWN(APPS1, 0, "jpeg_clk", jpeg_clk, NULL), |
| 2795 | OWN(APPS1, 0, "jpeg_pclk", jpeg_p_clk, NULL), |
| 2796 | OWN(APPS1, 23, "lpa_codec_clk", lpa_codec_clk, NULL), |
| 2797 | OWN(APPS1, 23, "lpa_core_clk", lpa_core_clk, NULL), |
| 2798 | OWN(APPS1, 23, "lpa_pclk", lpa_p_clk, NULL), |
| 2799 | OWN(APPS1, 28, "mi2s_m_clk", mi2s_m_clk, NULL), |
| 2800 | OWN(APPS1, 28, "mi2s_s_clk", mi2s_s_clk, NULL), |
| 2801 | OWN(APPS1, 12, "mi2s_codec_rx_m_clk", mi2s_codec_rx_m_clk, NULL), |
| 2802 | OWN(APPS1, 12, "mi2s_codec_rx_s_clk", mi2s_codec_rx_s_clk, NULL), |
| 2803 | OWN(APPS1, 14, "mi2s_codec_tx_m_clk", mi2s_codec_tx_m_clk, NULL), |
| 2804 | OWN(APPS1, 14, "mi2s_codec_tx_s_clk", mi2s_codec_tx_s_clk, NULL), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2805 | OWN(APPS1, 26, "sdac_clk", sdac_clk, NULL), |
| 2806 | OWN(APPS1, 26, "sdac_m_clk", sdac_m_clk, NULL), |
| 2807 | OWN(APPS1, 8, "vfe_clk", vfe_clk, NULL), |
Matt Wagantall | 4972271 | 2011-08-17 18:50:53 -0700 | [diff] [blame] | 2808 | OWN(APPS1, 8, "core_clk", vfe_clk, "footswitch-pcom.8"), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2809 | OWN(APPS1, 8, "vfe_camif_clk", vfe_camif_clk, NULL), |
| 2810 | OWN(APPS1, 8, "vfe_mdc_clk", vfe_mdc_clk, NULL), |
| 2811 | OWN(APPS1, 8, "vfe_pclk", vfe_p_clk, NULL), |
Matt Wagantall | 4972271 | 2011-08-17 18:50:53 -0700 | [diff] [blame] | 2812 | OWN(APPS1, 8, "iface_clk", vfe_p_clk, "footswitch-pcom.8"), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2813 | |
Matt Wagantall | 9dc0163 | 2011-08-17 18:55:04 -0700 | [diff] [blame] | 2814 | OWN(APPS2, 0, "core_clk", grp_3d_clk, "kgsl-3d0.0"), |
Matt Wagantall | 4972271 | 2011-08-17 18:50:53 -0700 | [diff] [blame] | 2815 | OWN(APPS2, 0, "core_clk", grp_3d_clk, "footswitch-pcom.2"), |
Matt Wagantall | 9dc0163 | 2011-08-17 18:55:04 -0700 | [diff] [blame] | 2816 | OWN(APPS2, 0, "iface_clk", grp_3d_p_clk, "kgsl-3d0.0"), |
Matt Wagantall | 4972271 | 2011-08-17 18:50:53 -0700 | [diff] [blame] | 2817 | OWN(APPS2, 0, "iface_clk", grp_3d_p_clk, "footswitch-pcom.2"), |
Matt Wagantall | 9dc0163 | 2011-08-17 18:55:04 -0700 | [diff] [blame] | 2818 | { CLK_LOOKUP("src_clk", grp_3d_src_clk.c, "kgsl-3d0.0"), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2819 | O(APPS2), BIT(0), &p_grp_3d_clk.c }, |
Matt Wagantall | 4972271 | 2011-08-17 18:50:53 -0700 | [diff] [blame] | 2820 | { CLK_LOOKUP("src_clk", grp_3d_src_clk.c, "footswitch-pcom.2"), |
| 2821 | O(APPS2), BIT(0), &p_grp_3d_clk.c }, |
Matt Wagantall | 9dc0163 | 2011-08-17 18:55:04 -0700 | [diff] [blame] | 2822 | OWN(APPS2, 0, "mem_clk", imem_clk, "kgsl-3d0.0"), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2823 | OWN(APPS2, 4, "mdp_lcdc_pad_pclk_clk", mdp_lcdc_pad_pclk_clk, NULL), |
| 2824 | OWN(APPS2, 4, "mdp_lcdc_pclk_clk", mdp_lcdc_pclk_clk, NULL), |
| 2825 | OWN(APPS2, 4, "mdp_pclk", mdp_p_clk, NULL), |
Matt Wagantall | 4972271 | 2011-08-17 18:50:53 -0700 | [diff] [blame] | 2826 | OWN(APPS2, 4, "iface_clk", mdp_p_clk, "footswitch-pcom.4"), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2827 | OWN(APPS2, 28, "mdp_vsync_clk", mdp_vsync_clk, NULL), |
Matt Wagantall | 640e5fd | 2011-08-17 16:08:53 -0700 | [diff] [blame] | 2828 | OWN(APPS2, 5, "ref_clk", tsif_ref_clk, "msm_tsif.0"), |
| 2829 | OWN(APPS2, 5, "iface_clk", tsif_p_clk, "msm_tsif.0"), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2830 | { CLK_LOOKUP("tv_src_clk", tv_clk.c, NULL), |
| 2831 | O(APPS2), BIT(2), &p_tv_enc_clk.c }, |
| 2832 | OWN(APPS2, 2, "tv_dac_clk", tv_dac_clk, NULL), |
| 2833 | OWN(APPS2, 2, "tv_enc_clk", tv_enc_clk, NULL), |
| 2834 | |
| 2835 | OWN(ROW1, 7, "emdh_clk", emdh_clk, "msm_mddi.1"), |
| 2836 | OWN(ROW1, 7, "emdh_pclk", emdh_p_clk, "msm_mddi.1"), |
Matt Wagantall | ac29485 | 2011-08-17 15:44:58 -0700 | [diff] [blame] | 2837 | OWN(ROW1, 11, "core_clk", i2c_clk, "msm_i2c.0"), |
| 2838 | OWN(ROW1, 12, "core_clk", i2c_2_clk, "msm_i2c.2"), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2839 | OWN(ROW1, 17, "mdc_clk", mdc_clk, NULL), |
| 2840 | OWN(ROW1, 19, "mddi_clk", pmdh_clk, NULL), |
| 2841 | OWN(ROW1, 19, "mddi_pclk", pmdh_p_clk, NULL), |
Matt Wagantall | 37ce384 | 2011-08-17 16:00:36 -0700 | [diff] [blame] | 2842 | OWN(ROW1, 23, "core_clk", sdc1_clk, "msm_sdcc.1"), |
| 2843 | OWN(ROW1, 23, "iface_clk", sdc1_p_clk, "msm_sdcc.1"), |
| 2844 | OWN(ROW1, 25, "core_clk", sdc2_clk, "msm_sdcc.2"), |
| 2845 | OWN(ROW1, 25, "iface_clk", sdc2_p_clk, "msm_sdcc.2"), |
| 2846 | OWN(ROW1, 27, "core_clk", sdc3_clk, "msm_sdcc.3"), |
| 2847 | OWN(ROW1, 27, "iface_clk", sdc3_p_clk, "msm_sdcc.3"), |
| 2848 | OWN(ROW1, 29, "core_clk", sdc4_clk, "msm_sdcc.4"), |
| 2849 | OWN(ROW1, 29, "iface_clk", sdc4_p_clk, "msm_sdcc.4"), |
Matt Wagantall | e252237 | 2011-08-17 14:52:21 -0700 | [diff] [blame] | 2850 | OWN(ROW1, 0, "core_clk", uart2_clk, "msm_serial.1"), |
Manu Gautam | 5143b25 | 2012-01-05 19:25:23 -0800 | [diff] [blame] | 2851 | OWN(ROW1, 2, "alt_core_clk", usb_hs2_clk, "msm_hsusb_host.0"), |
| 2852 | OWN(ROW1, 2, "core_clk", usb_hs2_core_clk, "msm_hsusb_host.0"), |
| 2853 | OWN(ROW1, 2, "iface_clk", usb_hs2_p_clk, "msm_hsusb_host.0"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 2854 | OWN(ROW1, 4, "alt_core_clk", usb_hs3_clk, ""), |
| 2855 | OWN(ROW1, 4, "core_clk", usb_hs3_core_clk, ""), |
| 2856 | OWN(ROW1, 4, "iface_clk", usb_hs3_p_clk, ""), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2857 | |
Matt Wagantall | ac29485 | 2011-08-17 15:44:58 -0700 | [diff] [blame] | 2858 | OWN(ROW2, 3, "core_clk", qup_i2c_clk, "qup_i2c.4"), |
| 2859 | OWN(ROW2, 1, "core_clk", spi_clk, "spi_qsd.0"), |
| 2860 | OWN(ROW2, 1, "iface_clk", spi_p_clk, "spi_qsd.0"), |
Matt Wagantall | e252237 | 2011-08-17 14:52:21 -0700 | [diff] [blame] | 2861 | OWN(ROW2, 9, "core_clk", uart1_clk, "msm_serial.0"), |
| 2862 | OWN(ROW2, 6, "core_clk", uart1dm_clk, "msm_serial_hs.0"), |
| 2863 | OWN(ROW2, 8, "core_clk", uart2dm_clk, "msm_serial_hs.1"), |
Manu Gautam | 5143b25 | 2012-01-05 19:25:23 -0800 | [diff] [blame] | 2864 | OWN(ROW2, 11, "alt_core_clk", usb_hs_clk, "msm_otg"), |
| 2865 | OWN(ROW2, 11, "core_clk", usb_hs_core_clk, "msm_otg"), |
| 2866 | OWN(ROW2, 11, "iface_clk", usb_hs_p_clk, "msm_otg"), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2867 | |
| 2868 | OWN(APPS3, 6, "cam_m_clk", cam_m_clk, NULL), |
| 2869 | OWN(APPS3, 6, "camif_pad_pclk", camif_pad_p_clk, NULL), |
Matt Wagantall | ac29485 | 2011-08-17 15:44:58 -0700 | [diff] [blame] | 2870 | OWN(APPS3, 6, "iface_clk", camif_pad_p_clk, "qup_i2c.4"), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2871 | OWN(APPS3, 11, "csi_clk", csi0_clk, NULL), |
| 2872 | OWN(APPS3, 11, "csi_vfe_clk", csi0_vfe_clk, NULL), |
| 2873 | OWN(APPS3, 11, "csi_pclk", csi0_p_clk, NULL), |
| 2874 | OWN(APPS3, 0, "mdp_clk", mdp_clk, NULL), |
Matt Wagantall | 4972271 | 2011-08-17 18:50:53 -0700 | [diff] [blame] | 2875 | OWN(APPS3, 0, "core_clk", mdp_clk, "footswitch-pcom.4"), |
Matt Wagantall | 3f7660b | 2011-08-17 21:25:13 -0700 | [diff] [blame] | 2876 | OWN(APPS3, 2, "core_clk", mfc_clk, "msm_vidc.0"), |
Matt Wagantall | 4972271 | 2011-08-17 18:50:53 -0700 | [diff] [blame] | 2877 | OWN(APPS3, 2, "core_clk", mfc_clk, "footswitch-pcom.5"), |
Matt Wagantall | 3f7660b | 2011-08-17 21:25:13 -0700 | [diff] [blame] | 2878 | OWN(APPS3, 2, "core_div2_clk", mfc_div2_clk, "msm_vidc.0"), |
| 2879 | OWN(APPS3, 2, "iface_clk", mfc_p_clk, "msm_vidc.0"), |
Matt Wagantall | 4972271 | 2011-08-17 18:50:53 -0700 | [diff] [blame] | 2880 | OWN(APPS3, 2, "iface_clk", mfc_p_clk, "footswitch-pcom.5"), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2881 | OWN(APPS3, 4, "vpe_clk", vpe_clk, NULL), |
Matt Wagantall | 4972271 | 2011-08-17 18:50:53 -0700 | [diff] [blame] | 2882 | OWN(APPS3, 4, "core_clk", vpe_clk, "footswitch-pcom.9"), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2883 | |
Matt Wagantall | e1a8606 | 2011-08-18 17:46:10 -0700 | [diff] [blame] | 2884 | OWN(GLBL, 8, "core_clk", adm_clk, "msm_dmov"), |
| 2885 | { CLK_LOOKUP("iface_clk", adm_p_clk.c, "msm_dmov"), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2886 | O(GLBL), BIT(13), &dummy_clk }, |
Matt Wagantall | c4b3a4d | 2011-08-17 16:58:39 -0700 | [diff] [blame] | 2887 | OWN(GLBL, 8, "core_clk", ce_clk, "qce.0"), |
Matt Wagantall | e0b1145 | 2011-09-13 17:25:33 -0700 | [diff] [blame] | 2888 | OWN(GLBL, 8, "core_clk", ce_clk, "crypto.0"), |
Matt Wagantall | bb90da9 | 2011-10-25 15:07:52 -0700 | [diff] [blame] | 2889 | OWN(GLBL, 13, "core_clk", axi_rotator_clk, "msm_rotator.0"), |
Matt Wagantall | 4972271 | 2011-08-17 18:50:53 -0700 | [diff] [blame] | 2890 | OWN(GLBL, 13, "core_clk", axi_rotator_clk, "footswitch-pcom.6"), |
Matt Wagantall | bb90da9 | 2011-10-25 15:07:52 -0700 | [diff] [blame] | 2891 | OWN(GLBL, 13, "mem_clk", rotator_imem_clk, "msm_rotator.0"), |
| 2892 | OWN(GLBL, 13, "iface_clk", rotator_p_clk, "msm_rotator.0"), |
Matt Wagantall | 4972271 | 2011-08-17 18:50:53 -0700 | [diff] [blame] | 2893 | OWN(GLBL, 13, "iface_clk", rotator_p_clk, "footswitch-pcom.6"), |
Matt Wagantall | e252237 | 2011-08-17 14:52:21 -0700 | [diff] [blame] | 2894 | { CLK_LOOKUP("iface_clk", uart1dm_p_clk.c, "msm_serial_hs.0"), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2895 | O(GLBL), BIT(8), &dummy_clk }, |
Matt Wagantall | e252237 | 2011-08-17 14:52:21 -0700 | [diff] [blame] | 2896 | { CLK_LOOKUP("iface_clk", uart2dm_p_clk.c, "msm_serial_hs.1"), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2897 | O(GLBL), BIT(8), &dummy_clk }, |
| 2898 | }; |
| 2899 | |
| 2900 | static struct clk_lookup msm_clocks_7x30[ARRAY_SIZE(ownership_map)]; |
| 2901 | |
| 2902 | static void __init set_clock_ownership(void) |
| 2903 | { |
| 2904 | unsigned i; |
| 2905 | struct clk_lookup *lk; |
| 2906 | |
| 2907 | for (i = 0; i < ARRAY_SIZE(ownership_map); i++) { |
| 2908 | const u32 *reg = ownership_map[i].reg; |
| 2909 | u32 bit = ownership_map[i].bit; |
| 2910 | struct clk *remote = ownership_map[i].remote; |
| 2911 | |
| 2912 | lk = &ownership_map[i].lk; |
| 2913 | memcpy(&msm_clocks_7x30[i], lk, sizeof(*lk)); |
| 2914 | |
| 2915 | if (reg && !(*reg & bit)) |
| 2916 | msm_clocks_7x30[i].clk = remote; |
| 2917 | } |
| 2918 | } |
| 2919 | |
| 2920 | /* |
| 2921 | * Miscellaneous clock register initializations |
| 2922 | */ |
| 2923 | static const struct reg_init { |
| 2924 | const void __iomem *reg; |
| 2925 | uint32_t mask; |
| 2926 | uint32_t val; |
| 2927 | } ri_list[] __initconst = { |
| 2928 | /* Enable UMDX_P clock. Known to causes issues, so never turn off. */ |
| 2929 | {GLBL_CLK_ENA_2_SC_REG, BIT(2), BIT(2)}, |
| 2930 | |
| 2931 | /* Disable all the child clocks of USB_HS_SRC. */ |
| 2932 | { USBH_NS_REG, BIT(13) | BIT(9), 0 }, |
| 2933 | { USBH2_NS_REG, BIT(9) | BIT(4), 0 }, |
| 2934 | { USBH3_NS_REG, BIT(9) | BIT(4), 0 }, |
| 2935 | |
| 2936 | {EMDH_NS_REG, BM(18, 17) , BVAL(18, 17, 0x3)}, /* RX div = div-4. */ |
| 2937 | {PMDH_NS_REG, BM(18, 17), BVAL(18, 17, 0x3)}, /* RX div = div-4. */ |
| 2938 | /* MI2S_CODEC_RX_S src = MI2S_CODEC_RX_M. */ |
| 2939 | {MI2S_RX_NS_REG, BIT(14), 0x0}, |
| 2940 | /* MI2S_CODEC_TX_S src = MI2S_CODEC_TX_M. */ |
| 2941 | {MI2S_TX_NS_REG, BIT(14), 0x0}, |
| 2942 | {MI2S_NS_REG, BIT(14), 0x0}, /* MI2S_S src = MI2S_M. */ |
| 2943 | /* Allow DSP to decide the LPA CORE src. */ |
| 2944 | {LPA_CORE_CLK_MA0_REG, BIT(0), BIT(0)}, |
| 2945 | {LPA_CORE_CLK_MA2_REG, BIT(0), BIT(0)}, |
| 2946 | {MI2S_CODEC_RX_DIV_REG, 0xF, 0xD}, /* MI2S_CODEC_RX_S div = div-8. */ |
| 2947 | {MI2S_CODEC_TX_DIV_REG, 0xF, 0xD}, /* MI2S_CODEC_TX_S div = div-8. */ |
| 2948 | {MI2S_DIV_REG, 0xF, 0x7}, /* MI2S_S div = div-8. */ |
| 2949 | {MDC_NS_REG, 0x3, 0x3}, /* MDC src = external MDH src. */ |
| 2950 | {SDAC_NS_REG, BM(15, 14), 0x0}, /* SDAC div = div-1. */ |
| 2951 | /* Disable sources TCXO/5 & TCXO/6. UART1 src = TCXO*/ |
| 2952 | {UART_NS_REG, BM(26, 25) | BM(2, 0), 0x0}, |
| 2953 | /* HDMI div = div-1, non-inverted. tv_enc_src = tv_clk_src */ |
| 2954 | {HDMI_NS_REG, 0x7, 0x0}, |
| 2955 | {TV_NS_REG, BM(15, 14), 0x0}, /* tv_clk_src_div2 = div-1 */ |
| 2956 | |
| 2957 | /* USBH core clocks src = USB_HS_SRC. */ |
| 2958 | {USBH_NS_REG, BIT(15), BIT(15)}, |
| 2959 | {USBH2_NS_REG, BIT(6), BIT(6)}, |
| 2960 | {USBH3_NS_REG, BIT(6), BIT(6)}, |
| 2961 | }; |
| 2962 | |
| 2963 | /* Local clock driver initialization. */ |
Stephen Boyd | bb600ae | 2011-08-02 20:11:40 -0700 | [diff] [blame] | 2964 | static void __init msm7x30_clock_init(void) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2965 | { |
| 2966 | int i; |
| 2967 | uint32_t val; |
| 2968 | |
| 2969 | cache_ownership(); |
| 2970 | print_ownership(); |
| 2971 | set_clock_ownership(); |
| 2972 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2973 | /* When we have no local clock control, the rest of the code in this |
| 2974 | * function is a NOP since writes to shadow regions that we don't own |
| 2975 | * are ignored. */ |
| 2976 | |
| 2977 | clk_set_rate(&usb_hs_src_clk.c, clk_tbl_usb[1].freq_hz); |
| 2978 | |
| 2979 | for (i = 0; i < ARRAY_SIZE(ri_list); i++) { |
| 2980 | val = readl_relaxed(ri_list[i].reg); |
| 2981 | val &= ~ri_list[i].mask; |
| 2982 | val |= ri_list[i].val; |
| 2983 | writel_relaxed(val, ri_list[i].reg); |
| 2984 | } |
| 2985 | |
| 2986 | clk_set_rate(&i2c_clk.c, 19200000); |
| 2987 | clk_set_rate(&i2c_2_clk.c, 19200000); |
| 2988 | clk_set_rate(&qup_i2c_clk.c, 19200000); |
| 2989 | clk_set_rate(&uart1_clk.c, 19200000); |
| 2990 | clk_set_rate(&uart2_clk.c, 19200000); |
| 2991 | clk_set_rate(&mi2s_m_clk.c, 12288000); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2992 | clk_set_rate(&mdp_vsync_clk.c, 24576000); |
| 2993 | clk_set_rate(&glbl_root_clk.c, 1); |
| 2994 | clk_set_rate(&mdc_clk.c, 1); |
| 2995 | /* Sync the LPA_CODEC clock to MI2S_CODEC_RX */ |
| 2996 | clk_set_rate(&lpa_codec_clk.c, 1); |
| 2997 | /* Sync the GRP2D clock to AXI */ |
| 2998 | clk_set_rate(&grp_2d_clk.c, 1); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2999 | } |
| 3000 | |
Stephen Boyd | bb600ae | 2011-08-02 20:11:40 -0700 | [diff] [blame] | 3001 | struct clock_init_data msm7x30_clock_init_data __initdata = { |
| 3002 | .table = msm_clocks_7x30, |
| 3003 | .size = ARRAY_SIZE(msm_clocks_7x30), |
| 3004 | .init = msm7x30_clock_init, |
| 3005 | }; |
| 3006 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3007 | /* |
| 3008 | * Clock operation handler registration |
| 3009 | */ |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 3010 | static struct clk_ops clk_ops_rcg_7x30 = { |
Matt Wagantall | 0625ea0 | 2011-07-13 18:51:56 -0700 | [diff] [blame] | 3011 | .enable = rcg_clk_enable, |
| 3012 | .disable = rcg_clk_disable, |
Matt Wagantall | 41af077 | 2011-09-17 12:21:39 -0700 | [diff] [blame] | 3013 | .auto_off = rcg_clk_disable, |
Matt Wagantall | 0625ea0 | 2011-07-13 18:51:56 -0700 | [diff] [blame] | 3014 | .set_rate = rcg_clk_set_rate, |
Matt Wagantall | 0625ea0 | 2011-07-13 18:51:56 -0700 | [diff] [blame] | 3015 | .get_rate = rcg_clk_get_rate, |
| 3016 | .list_rate = rcg_clk_list_rate, |
| 3017 | .is_enabled = rcg_clk_is_enabled, |
| 3018 | .round_rate = rcg_clk_round_rate, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3019 | .reset = msm7x30_clk_reset, |
| 3020 | .set_flags = soc_clk_set_flags, |
| 3021 | .is_local = local_clk_is_local, |
Matt Wagantall | 0625ea0 | 2011-07-13 18:51:56 -0700 | [diff] [blame] | 3022 | .get_parent = rcg_clk_get_parent, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3023 | }; |
| 3024 | |
| 3025 | static struct clk_ops clk_ops_branch = { |
| 3026 | .enable = branch_clk_enable, |
| 3027 | .disable = branch_clk_disable, |
Matt Wagantall | 41af077 | 2011-09-17 12:21:39 -0700 | [diff] [blame] | 3028 | .auto_off = branch_clk_disable, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3029 | .is_enabled = branch_clk_is_enabled, |
| 3030 | .reset = soc_branch_clk_reset, |
| 3031 | .set_flags = soc_clk_set_flags, |
| 3032 | .is_local = local_clk_is_local, |
| 3033 | .get_parent = branch_clk_get_parent, |
| 3034 | .set_parent = branch_clk_set_parent, |
| 3035 | }; |