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 | #include <linux/kernel.h> |
| 14 | #include <linux/init.h> |
| 15 | #include <linux/err.h> |
| 16 | #include <linux/ctype.h> |
| 17 | #include <linux/bitops.h> |
| 18 | #include <linux/io.h> |
| 19 | #include <linux/spinlock.h> |
| 20 | #include <linux/delay.h> |
| 21 | #include <linux/clk.h> |
| 22 | |
| 23 | #include <asm/clkdev.h> |
| 24 | #include <asm/mach-types.h> |
| 25 | |
| 26 | #include <mach/msm_iomap.h> |
| 27 | #include <mach/clk.h> |
| 28 | #include <mach/rpm-regulator.h> |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 29 | #include <mach/socinfo.h> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 30 | |
| 31 | #include "clock-local.h" |
| 32 | #include "clock-rpm.h" |
| 33 | #include "clock-voter.h" |
| 34 | #include "clock-dss-8960.h" |
| 35 | #include "devices.h" |
| 36 | |
| 37 | #define REG(off) (MSM_CLK_CTL_BASE + (off)) |
| 38 | #define REG_MM(off) (MSM_MMSS_CLK_CTL_BASE + (off)) |
| 39 | #define REG_LPA(off) (MSM_LPASS_CLK_CTL_BASE + (off)) |
Matt Wagantall | 8b38f94 | 2011-08-02 18:23:18 -0700 | [diff] [blame] | 40 | #define REG_GCC(off) (MSM_APCS_GCC_BASE + (off)) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 41 | |
| 42 | /* Peripheral clock registers. */ |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 43 | #define ADM0_PBUS_CLK_CTL_REG REG(0x2208) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 44 | #define CE1_HCLK_CTL_REG REG(0x2720) |
| 45 | #define CE1_CORE_CLK_CTL_REG REG(0x2724) |
Tianyi Gou | 05e0110 | 2012-02-08 22:15:49 -0800 | [diff] [blame] | 46 | #define PRNG_CLK_NS_REG REG(0x2E80) |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 47 | #define CE3_HCLK_CTL_REG REG(0x36C4) |
| 48 | #define CE3_CORE_CLK_CTL_REG REG(0x36CC) |
| 49 | #define CE3_CLK_SRC_NS_REG REG(0x36C0) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 50 | #define DMA_BAM_HCLK_CTL REG(0x25C0) |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 51 | #define CLK_HALT_AFAB_SFAB_STATEB_REG REG(0x2FC4) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 52 | #define CLK_HALT_CFPB_STATEA_REG REG(0x2FCC) |
| 53 | #define CLK_HALT_CFPB_STATEB_REG REG(0x2FD0) |
| 54 | #define CLK_HALT_CFPB_STATEC_REG REG(0x2FD4) |
| 55 | #define CLK_HALT_DFAB_STATE_REG REG(0x2FC8) |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 56 | /* 8064 name CLK_HALT_GSS_KPSS_MISC_STATE_REG */ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 57 | #define CLK_HALT_MSS_SMPSS_MISC_STATE_REG REG(0x2FDC) |
| 58 | #define CLK_HALT_SFPB_MISC_STATE_REG REG(0x2FD8) |
Stephen Boyd | 973e4ba | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 59 | #define CLK_HALT_AFAB_SFAB_STATEB_REG REG(0x2FC4) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 60 | #define CLK_TEST_REG REG(0x2FA0) |
Matt Wagantall | 7625a4c | 2011-11-01 16:17:53 -0700 | [diff] [blame] | 61 | #define GPn_MD_REG(n) REG(0x2D00+(0x20*(n))) |
| 62 | #define GPn_NS_REG(n) REG(0x2D24+(0x20*(n))) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 63 | #define GSBIn_HCLK_CTL_REG(n) REG(0x29C0+(0x20*((n)-1))) |
| 64 | #define GSBIn_QUP_APPS_MD_REG(n) REG(0x29C8+(0x20*((n)-1))) |
| 65 | #define GSBIn_QUP_APPS_NS_REG(n) REG(0x29CC+(0x20*((n)-1))) |
| 66 | #define GSBIn_RESET_REG(n) REG(0x29DC+(0x20*((n)-1))) |
| 67 | #define GSBIn_UART_APPS_MD_REG(n) REG(0x29D0+(0x20*((n)-1))) |
| 68 | #define GSBIn_UART_APPS_NS_REG(n) REG(0x29D4+(0x20*((n)-1))) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 69 | #define PDM_CLK_NS_REG REG(0x2CC0) |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 70 | /* 8064 name BB_PLL_ENA_APCS_REG */ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 71 | #define BB_PLL_ENA_SC0_REG REG(0x34C0) |
Tianyi Gou | 59608a7 | 2012-01-31 22:19:30 -0800 | [diff] [blame] | 72 | #define BB_PLL_ENA_RPM_REG REG(0x34A0) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 73 | #define BB_PLL0_STATUS_REG REG(0x30D8) |
| 74 | #define BB_PLL5_STATUS_REG REG(0x30F8) |
| 75 | #define BB_PLL6_STATUS_REG REG(0x3118) |
| 76 | #define BB_PLL7_STATUS_REG REG(0x3138) |
| 77 | #define BB_PLL8_L_VAL_REG REG(0x3144) |
| 78 | #define BB_PLL8_M_VAL_REG REG(0x3148) |
| 79 | #define BB_PLL8_MODE_REG REG(0x3140) |
| 80 | #define BB_PLL8_N_VAL_REG REG(0x314C) |
| 81 | #define BB_PLL8_STATUS_REG REG(0x3158) |
| 82 | #define BB_PLL8_CONFIG_REG REG(0x3154) |
| 83 | #define BB_PLL8_TEST_CTL_REG REG(0x3150) |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 84 | #define BB_MMCC_PLL2_MODE_REG REG(0x3160) |
| 85 | #define BB_MMCC_PLL2_TEST_CTL_REG REG(0x3170) |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 86 | #define BB_PLL14_MODE_REG REG(0x31C0) |
| 87 | #define BB_PLL14_L_VAL_REG REG(0x31C4) |
| 88 | #define BB_PLL14_M_VAL_REG REG(0x31C8) |
| 89 | #define BB_PLL14_N_VAL_REG REG(0x31CC) |
| 90 | #define BB_PLL14_TEST_CTL_REG REG(0x31D0) |
| 91 | #define BB_PLL14_CONFIG_REG REG(0x31D4) |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 92 | #define BB_PLL14_STATUS_REG REG(0x31D8) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 93 | #define PLLTEST_PAD_CFG_REG REG(0x2FA4) |
| 94 | #define PMEM_ACLK_CTL_REG REG(0x25A0) |
| 95 | #define RINGOSC_NS_REG REG(0x2DC0) |
| 96 | #define RINGOSC_STATUS_REG REG(0x2DCC) |
| 97 | #define RINGOSC_TCXO_CTL_REG REG(0x2DC4) |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 98 | #define RPM_MSG_RAM_HCLK_CTL_REG REG(0x27E0) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 99 | #define SC0_U_CLK_BRANCH_ENA_VOTE_REG REG(0x3080) |
| 100 | #define SDCn_APPS_CLK_MD_REG(n) REG(0x2828+(0x20*((n)-1))) |
| 101 | #define SDCn_APPS_CLK_NS_REG(n) REG(0x282C+(0x20*((n)-1))) |
| 102 | #define SDCn_HCLK_CTL_REG(n) REG(0x2820+(0x20*((n)-1))) |
| 103 | #define SDCn_RESET_REG(n) REG(0x2830+(0x20*((n)-1))) |
| 104 | #define SLIMBUS_XO_SRC_CLK_CTL_REG REG(0x2628) |
| 105 | #define TSIF_HCLK_CTL_REG REG(0x2700) |
| 106 | #define TSIF_REF_CLK_MD_REG REG(0x270C) |
| 107 | #define TSIF_REF_CLK_NS_REG REG(0x2710) |
| 108 | #define TSSC_CLK_CTL_REG REG(0x2CA0) |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 109 | #define SATA_CLK_SRC_NS_REG REG(0x2C08) |
| 110 | #define SATA_RXOOB_CLK_CTL_REG REG(0x2C0C) |
| 111 | #define SATA_PMALIVE_CLK_CTL_REG REG(0x2C10) |
| 112 | #define SATA_PHY_REF_CLK_CTL_REG REG(0x2C14) |
| 113 | #define SATA_PHY_CFG_CLK_CTL_REG REG(0x2C40) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 114 | #define USB_FSn_HCLK_CTL_REG(n) REG(0x2960+(0x20*((n)-1))) |
| 115 | #define USB_FSn_RESET_REG(n) REG(0x2974+(0x20*((n)-1))) |
| 116 | #define USB_FSn_SYSTEM_CLK_CTL_REG(n) REG(0x296C+(0x20*((n)-1))) |
| 117 | #define USB_FSn_XCVR_FS_CLK_MD_REG(n) REG(0x2964+(0x20*((n)-1))) |
| 118 | #define USB_FSn_XCVR_FS_CLK_NS_REG(n) REG(0x2968+(0x20*((n)-1))) |
| 119 | #define USB_HS1_HCLK_CTL_REG REG(0x2900) |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 120 | #define USB_HS1_HCLK_FS_REG REG(0x2904) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 121 | #define USB_HS1_RESET_REG REG(0x2910) |
| 122 | #define USB_HS1_XCVR_FS_CLK_MD_REG REG(0x2908) |
| 123 | #define USB_HS1_XCVR_FS_CLK_NS_REG REG(0x290C) |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 124 | #define USB_HS3_HCLK_CTL_REG REG(0x3700) |
| 125 | #define USB_HS3_HCLK_FS_REG REG(0x3704) |
| 126 | #define USB_HS3_RESET_REG REG(0x3710) |
| 127 | #define USB_HS3_XCVR_FS_CLK_MD_REG REG(0X3708) |
| 128 | #define USB_HS3_XCVR_FS_CLK_NS_REG REG(0X370C) |
| 129 | #define USB_HS4_HCLK_CTL_REG REG(0x3720) |
| 130 | #define USB_HS4_HCLK_FS_REG REG(0x3724) |
| 131 | #define USB_HS4_RESET_REG REG(0x3730) |
| 132 | #define USB_HS4_XCVR_FS_CLK_MD_REG REG(0X3728) |
| 133 | #define USB_HS4_XCVR_FS_CLK_NS_REG REG(0X372C) |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 134 | #define USB_HSIC_HCLK_CTL_REG REG(0x2920) |
| 135 | #define USB_HSIC_HSIC_CLK_CTL_REG REG(0x2B44) |
| 136 | #define USB_HSIC_HSIC_CLK_SRC_CTL_REG REG(0x2B40) |
| 137 | #define USB_HSIC_HSIO_CAL_CLK_CTL_REG REG(0x2B48) |
| 138 | #define USB_HSIC_RESET_REG REG(0x2934) |
| 139 | #define USB_HSIC_SYSTEM_CLK_CTL_REG REG(0x292C) |
| 140 | #define USB_HSIC_XCVR_FS_CLK_MD_REG REG(0x2924) |
| 141 | #define USB_HSIC_XCVR_FS_CLK_NS_REG REG(0x2928) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 142 | #define USB_PHY0_RESET_REG REG(0x2E20) |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 143 | #define PCIE_ALT_REF_CLK_NS_REG REG(0x3860) |
| 144 | #define PCIE_HCLK_CTL_REG REG(0x22CC) |
| 145 | #define GPLL1_MODE_REG REG(0x3160) |
| 146 | #define GPLL1_L_VAL_REG REG(0x3164) |
| 147 | #define GPLL1_M_VAL_REG REG(0x3168) |
| 148 | #define GPLL1_N_VAL_REG REG(0x316C) |
| 149 | #define GPLL1_CONFIG_REG REG(0x3174) |
| 150 | #define GPLL1_STATUS_REG REG(0x3178) |
| 151 | #define PXO_SRC_CLK_CTL_REG REG(0x2EA0) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 152 | |
| 153 | /* Multimedia clock registers. */ |
| 154 | #define AHB_EN_REG REG_MM(0x0008) |
| 155 | #define AHB_EN2_REG REG_MM(0x0038) |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 156 | #define AHB_EN3_REG REG_MM(0x0248) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 157 | #define AHB_NS_REG REG_MM(0x0004) |
| 158 | #define AXI_NS_REG REG_MM(0x0014) |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 159 | #define CAMCLK0_NS_REG REG_MM(0x0148) |
| 160 | #define CAMCLK0_CC_REG REG_MM(0x0140) |
| 161 | #define CAMCLK0_MD_REG REG_MM(0x0144) |
| 162 | #define CAMCLK1_NS_REG REG_MM(0x015C) |
| 163 | #define CAMCLK1_CC_REG REG_MM(0x0154) |
| 164 | #define CAMCLK1_MD_REG REG_MM(0x0158) |
| 165 | #define CAMCLK2_NS_REG REG_MM(0x0228) |
| 166 | #define CAMCLK2_CC_REG REG_MM(0x0220) |
| 167 | #define CAMCLK2_MD_REG REG_MM(0x0224) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 168 | #define CSI0_NS_REG REG_MM(0x0048) |
| 169 | #define CSI0_CC_REG REG_MM(0x0040) |
| 170 | #define CSI0_MD_REG REG_MM(0x0044) |
| 171 | #define CSI1_NS_REG REG_MM(0x0010) |
| 172 | #define CSI1_CC_REG REG_MM(0x0024) |
| 173 | #define CSI1_MD_REG REG_MM(0x0028) |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 174 | #define CSI2_NS_REG REG_MM(0x0234) |
| 175 | #define CSI2_CC_REG REG_MM(0x022C) |
| 176 | #define CSI2_MD_REG REG_MM(0x0230) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 177 | #define CSIPHYTIMER_CC_REG REG_MM(0x0160) |
| 178 | #define CSIPHYTIMER_MD_REG REG_MM(0x0164) |
| 179 | #define CSIPHYTIMER_NS_REG REG_MM(0x0168) |
| 180 | #define DSI1_BYTE_NS_REG REG_MM(0x00B0) |
| 181 | #define DSI1_BYTE_CC_REG REG_MM(0x0090) |
| 182 | #define DSI2_BYTE_NS_REG REG_MM(0x00BC) |
| 183 | #define DSI2_BYTE_CC_REG REG_MM(0x00B4) |
| 184 | #define DSI1_ESC_NS_REG REG_MM(0x011C) |
| 185 | #define DSI1_ESC_CC_REG REG_MM(0x00CC) |
| 186 | #define DSI2_ESC_NS_REG REG_MM(0x0150) |
| 187 | #define DSI2_ESC_CC_REG REG_MM(0x013C) |
| 188 | #define DSI_PIXEL_CC_REG REG_MM(0x0130) |
| 189 | #define DSI2_PIXEL_CC_REG REG_MM(0x0094) |
| 190 | #define DBG_BUS_VEC_A_REG REG_MM(0x01C8) |
| 191 | #define DBG_BUS_VEC_B_REG REG_MM(0x01CC) |
| 192 | #define DBG_BUS_VEC_C_REG REG_MM(0x01D0) |
| 193 | #define DBG_BUS_VEC_D_REG REG_MM(0x01D4) |
| 194 | #define DBG_BUS_VEC_E_REG REG_MM(0x01D8) |
| 195 | #define DBG_BUS_VEC_F_REG REG_MM(0x01DC) |
| 196 | #define DBG_BUS_VEC_G_REG REG_MM(0x01E0) |
| 197 | #define DBG_BUS_VEC_H_REG REG_MM(0x01E4) |
| 198 | #define DBG_BUS_VEC_I_REG REG_MM(0x01E8) |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 199 | #define DBG_BUS_VEC_J_REG REG_MM(0x0240) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 200 | #define DBG_CFG_REG_HS_REG REG_MM(0x01B4) |
| 201 | #define DBG_CFG_REG_LS_REG REG_MM(0x01B8) |
| 202 | #define GFX2D0_CC_REG REG_MM(0x0060) |
| 203 | #define GFX2D0_MD0_REG REG_MM(0x0064) |
| 204 | #define GFX2D0_MD1_REG REG_MM(0x0068) |
| 205 | #define GFX2D0_NS_REG REG_MM(0x0070) |
| 206 | #define GFX2D1_CC_REG REG_MM(0x0074) |
| 207 | #define GFX2D1_MD0_REG REG_MM(0x0078) |
| 208 | #define GFX2D1_MD1_REG REG_MM(0x006C) |
| 209 | #define GFX2D1_NS_REG REG_MM(0x007C) |
| 210 | #define GFX3D_CC_REG REG_MM(0x0080) |
| 211 | #define GFX3D_MD0_REG REG_MM(0x0084) |
| 212 | #define GFX3D_MD1_REG REG_MM(0x0088) |
| 213 | #define GFX3D_NS_REG REG_MM(0x008C) |
| 214 | #define IJPEG_CC_REG REG_MM(0x0098) |
| 215 | #define IJPEG_MD_REG REG_MM(0x009C) |
| 216 | #define IJPEG_NS_REG REG_MM(0x00A0) |
| 217 | #define JPEGD_CC_REG REG_MM(0x00A4) |
| 218 | #define JPEGD_NS_REG REG_MM(0x00AC) |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 219 | #define VCAP_CC_REG REG_MM(0x0178) |
| 220 | #define VCAP_NS_REG REG_MM(0x021C) |
| 221 | #define VCAP_MD0_REG REG_MM(0x01EC) |
| 222 | #define VCAP_MD1_REG REG_MM(0x0218) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 223 | #define MAXI_EN_REG REG_MM(0x0018) |
| 224 | #define MAXI_EN2_REG REG_MM(0x0020) |
| 225 | #define MAXI_EN3_REG REG_MM(0x002C) |
| 226 | #define MAXI_EN4_REG REG_MM(0x0114) |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 227 | #define MAXI_EN5_REG REG_MM(0x0244) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 228 | #define MDP_CC_REG REG_MM(0x00C0) |
| 229 | #define MDP_LUT_CC_REG REG_MM(0x016C) |
| 230 | #define MDP_MD0_REG REG_MM(0x00C4) |
| 231 | #define MDP_MD1_REG REG_MM(0x00C8) |
| 232 | #define MDP_NS_REG REG_MM(0x00D0) |
| 233 | #define MISC_CC_REG REG_MM(0x0058) |
| 234 | #define MISC_CC2_REG REG_MM(0x005C) |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 235 | #define MISC_CC3_REG REG_MM(0x0238) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 236 | #define MM_PLL1_MODE_REG REG_MM(0x031C) |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 237 | #define MM_PLL1_L_VAL_REG REG_MM(0x0320) |
| 238 | #define MM_PLL1_M_VAL_REG REG_MM(0x0324) |
| 239 | #define MM_PLL1_N_VAL_REG REG_MM(0x0328) |
| 240 | #define MM_PLL1_CONFIG_REG REG_MM(0x032C) |
| 241 | #define MM_PLL1_TEST_CTL_REG REG_MM(0x0330) |
| 242 | #define MM_PLL1_STATUS_REG REG_MM(0x0334) |
| 243 | #define MM_PLL3_MODE_REG REG_MM(0x0338) |
Tianyi Gou | 621f874 | 2011-09-01 21:45:01 -0700 | [diff] [blame] | 244 | #define MM_PLL3_L_VAL_REG REG_MM(0x033C) |
| 245 | #define MM_PLL3_M_VAL_REG REG_MM(0x0340) |
| 246 | #define MM_PLL3_N_VAL_REG REG_MM(0x0344) |
| 247 | #define MM_PLL3_CONFIG_REG REG_MM(0x0348) |
| 248 | #define MM_PLL3_TEST_CTL_REG REG_MM(0x034C) |
| 249 | #define MM_PLL3_STATUS_REG REG_MM(0x0350) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 250 | #define ROT_CC_REG REG_MM(0x00E0) |
| 251 | #define ROT_NS_REG REG_MM(0x00E8) |
| 252 | #define SAXI_EN_REG REG_MM(0x0030) |
| 253 | #define SW_RESET_AHB_REG REG_MM(0x020C) |
| 254 | #define SW_RESET_AHB2_REG REG_MM(0x0200) |
| 255 | #define SW_RESET_ALL_REG REG_MM(0x0204) |
| 256 | #define SW_RESET_AXI_REG REG_MM(0x0208) |
| 257 | #define SW_RESET_CORE_REG REG_MM(0x0210) |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 258 | #define SW_RESET_CORE2_REG REG_MM(0x0214) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 259 | #define TV_CC_REG REG_MM(0x00EC) |
| 260 | #define TV_CC2_REG REG_MM(0x0124) |
| 261 | #define TV_MD_REG REG_MM(0x00F0) |
| 262 | #define TV_NS_REG REG_MM(0x00F4) |
| 263 | #define VCODEC_CC_REG REG_MM(0x00F8) |
| 264 | #define VCODEC_MD0_REG REG_MM(0x00FC) |
| 265 | #define VCODEC_MD1_REG REG_MM(0x0128) |
| 266 | #define VCODEC_NS_REG REG_MM(0x0100) |
| 267 | #define VFE_CC_REG REG_MM(0x0104) |
| 268 | #define VFE_MD_REG REG_MM(0x0108) |
| 269 | #define VFE_NS_REG REG_MM(0x010C) |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 270 | #define VFE_CC2_REG REG_MM(0x023C) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 271 | #define VPE_CC_REG REG_MM(0x0110) |
| 272 | #define VPE_NS_REG REG_MM(0x0118) |
| 273 | |
| 274 | /* Low-power Audio clock registers. */ |
Stephen Boyd | 3939c8d | 2011-08-29 17:36:22 -0700 | [diff] [blame] | 275 | #define LCC_CLK_HS_DEBUG_CFG_REG REG_LPA(0x00A4) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 276 | #define LCC_CLK_LS_DEBUG_CFG_REG REG_LPA(0x00A8) |
| 277 | #define LCC_CODEC_I2S_MIC_MD_REG REG_LPA(0x0064) |
| 278 | #define LCC_CODEC_I2S_MIC_NS_REG REG_LPA(0x0060) |
| 279 | #define LCC_CODEC_I2S_MIC_STATUS_REG REG_LPA(0x0068) |
| 280 | #define LCC_CODEC_I2S_SPKR_MD_REG REG_LPA(0x0070) |
| 281 | #define LCC_CODEC_I2S_SPKR_NS_REG REG_LPA(0x006C) |
| 282 | #define LCC_CODEC_I2S_SPKR_STATUS_REG REG_LPA(0x0074) |
| 283 | #define LCC_MI2S_MD_REG REG_LPA(0x004C) |
| 284 | #define LCC_MI2S_NS_REG REG_LPA(0x0048) |
| 285 | #define LCC_MI2S_STATUS_REG REG_LPA(0x0050) |
| 286 | #define LCC_PCM_MD_REG REG_LPA(0x0058) |
| 287 | #define LCC_PCM_NS_REG REG_LPA(0x0054) |
| 288 | #define LCC_PCM_STATUS_REG REG_LPA(0x005C) |
Tianyi Gou | c29c324 | 2011-10-12 21:02:15 -0700 | [diff] [blame] | 289 | #define LCC_PLL0_MODE_REG REG_LPA(0x0000) |
| 290 | #define LCC_PLL0_L_VAL_REG REG_LPA(0x0004) |
| 291 | #define LCC_PLL0_M_VAL_REG REG_LPA(0x0008) |
| 292 | #define LCC_PLL0_N_VAL_REG REG_LPA(0x000C) |
| 293 | #define LCC_PLL0_CONFIG_REG REG_LPA(0x0014) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 294 | #define LCC_PLL0_STATUS_REG REG_LPA(0x0018) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 295 | #define LCC_SPARE_I2S_MIC_MD_REG REG_LPA(0x007C) |
| 296 | #define LCC_SPARE_I2S_MIC_NS_REG REG_LPA(0x0078) |
| 297 | #define LCC_SPARE_I2S_MIC_STATUS_REG REG_LPA(0x0080) |
| 298 | #define LCC_SPARE_I2S_SPKR_MD_REG REG_LPA(0x0088) |
| 299 | #define LCC_SPARE_I2S_SPKR_NS_REG REG_LPA(0x0084) |
| 300 | #define LCC_SPARE_I2S_SPKR_STATUS_REG REG_LPA(0x008C) |
| 301 | #define LCC_SLIMBUS_NS_REG REG_LPA(0x00CC) |
| 302 | #define LCC_SLIMBUS_MD_REG REG_LPA(0x00D0) |
| 303 | #define LCC_SLIMBUS_STATUS_REG REG_LPA(0x00D4) |
| 304 | #define LCC_AHBEX_BRANCH_CTL_REG REG_LPA(0x00E4) |
Tianyi Gou | c29c324 | 2011-10-12 21:02:15 -0700 | [diff] [blame] | 305 | #define LCC_PRI_PLL_CLK_CTL_REG REG_LPA(0x00C4) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 306 | |
Matt Wagantall | 8b38f94 | 2011-08-02 18:23:18 -0700 | [diff] [blame] | 307 | #define GCC_APCS_CLK_DIAG REG_GCC(0x001C) |
| 308 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 309 | /* MUX source input identifiers. */ |
| 310 | #define pxo_to_bb_mux 0 |
Matt Wagantall | 7625a4c | 2011-11-01 16:17:53 -0700 | [diff] [blame] | 311 | #define cxo_to_bb_mux 5 |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 312 | #define pll0_to_bb_mux 2 |
| 313 | #define pll8_to_bb_mux 3 |
| 314 | #define pll6_to_bb_mux 4 |
| 315 | #define gnd_to_bb_mux 5 |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 316 | #define pll3_to_bb_mux 6 |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 317 | #define pxo_to_mm_mux 0 |
| 318 | #define pll1_to_mm_mux 1 |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 319 | #define pll2_to_mm_mux 1 /* or MMCC_PLL1 */ |
| 320 | #define pll8_to_mm_mux 2 /* or GCC_PERF */ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 321 | #define pll0_to_mm_mux 3 |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 322 | #define pll15_to_mm_mux 3 /* or MM_PLL3 */ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 323 | #define gnd_to_mm_mux 4 |
Stephen Boyd | 7a776cd | 2011-10-20 12:46:04 -0700 | [diff] [blame] | 324 | #define pll3_to_mm_mux 3 /* or MMCC_PLL2 */ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 325 | #define hdmi_pll_to_mm_mux 3 |
| 326 | #define cxo_to_xo_mux 0 |
| 327 | #define pxo_to_xo_mux 1 |
| 328 | #define gnd_to_xo_mux 3 |
| 329 | #define pxo_to_lpa_mux 0 |
| 330 | #define cxo_to_lpa_mux 1 |
| 331 | #define pll4_to_lpa_mux 2 |
| 332 | #define gnd_to_lpa_mux 6 |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 333 | #define pxo_to_pcie_mux 0 |
| 334 | #define pll3_to_pcie_mux 1 |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 335 | |
| 336 | /* Test Vector Macros */ |
| 337 | #define TEST_TYPE_PER_LS 1 |
| 338 | #define TEST_TYPE_PER_HS 2 |
| 339 | #define TEST_TYPE_MM_LS 3 |
| 340 | #define TEST_TYPE_MM_HS 4 |
| 341 | #define TEST_TYPE_LPA 5 |
Matt Wagantall | 8b38f94 | 2011-08-02 18:23:18 -0700 | [diff] [blame] | 342 | #define TEST_TYPE_CPUL2 6 |
Stephen Boyd | 3939c8d | 2011-08-29 17:36:22 -0700 | [diff] [blame] | 343 | #define TEST_TYPE_LPA_HS 7 |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 344 | #define TEST_TYPE_SHIFT 24 |
| 345 | #define TEST_CLK_SEL_MASK BM(23, 0) |
| 346 | #define TEST_VECTOR(s, t) (((t) << TEST_TYPE_SHIFT) | BVAL(23, 0, (s))) |
| 347 | #define TEST_PER_LS(s) TEST_VECTOR((s), TEST_TYPE_PER_LS) |
| 348 | #define TEST_PER_HS(s) TEST_VECTOR((s), TEST_TYPE_PER_HS) |
| 349 | #define TEST_MM_LS(s) TEST_VECTOR((s), TEST_TYPE_MM_LS) |
| 350 | #define TEST_MM_HS(s) TEST_VECTOR((s), TEST_TYPE_MM_HS) |
| 351 | #define TEST_LPA(s) TEST_VECTOR((s), TEST_TYPE_LPA) |
Stephen Boyd | 3939c8d | 2011-08-29 17:36:22 -0700 | [diff] [blame] | 352 | #define TEST_LPA_HS(s) TEST_VECTOR((s), TEST_TYPE_LPA_HS) |
Matt Wagantall | 8b38f94 | 2011-08-02 18:23:18 -0700 | [diff] [blame] | 353 | #define TEST_CPUL2(s) TEST_VECTOR((s), TEST_TYPE_CPUL2) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 354 | |
| 355 | #define MN_MODE_DUAL_EDGE 0x2 |
| 356 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 357 | struct pll_rate { |
| 358 | const uint32_t l_val; |
| 359 | const uint32_t m_val; |
| 360 | const uint32_t n_val; |
| 361 | const uint32_t vco; |
| 362 | const uint32_t post_div; |
| 363 | const uint32_t i_bits; |
| 364 | }; |
| 365 | #define PLL_RATE(l, m, n, v, d, i) { l, m, n, v, (d>>1), i } |
| 366 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 367 | enum vdd_dig_levels { |
| 368 | VDD_DIG_NONE, |
| 369 | VDD_DIG_LOW, |
| 370 | VDD_DIG_NOMINAL, |
| 371 | VDD_DIG_HIGH |
| 372 | }; |
| 373 | |
Saravana Kannan | 298ec39 | 2012-02-08 19:21:47 -0800 | [diff] [blame] | 374 | static int set_vdd_dig_8960(struct clk_vdd_class *vdd_class, int level) |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 375 | { |
| 376 | static const int vdd_uv[] = { |
| 377 | [VDD_DIG_NONE] = 0, |
| 378 | [VDD_DIG_LOW] = 945000, |
| 379 | [VDD_DIG_NOMINAL] = 1050000, |
| 380 | [VDD_DIG_HIGH] = 1150000 |
| 381 | }; |
Saravana Kannan | 298ec39 | 2012-02-08 19:21:47 -0800 | [diff] [blame] | 382 | return rpm_vreg_set_voltage(RPM_VREG_ID_PM8921_S3, RPM_VREG_VOTER3, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 383 | vdd_uv[level], 1150000, 1); |
| 384 | } |
| 385 | |
Saravana Kannan | 298ec39 | 2012-02-08 19:21:47 -0800 | [diff] [blame] | 386 | static DEFINE_VDD_CLASS(vdd_dig, set_vdd_dig_8960); |
| 387 | |
| 388 | static int set_vdd_dig_8930(struct clk_vdd_class *vdd_class, int level) |
| 389 | { |
Saravana Kannan | ebaa3ac | 2012-02-08 19:55:44 -0800 | [diff] [blame] | 390 | static const int vdd_corner[] = { |
| 391 | [VDD_DIG_NONE] = RPM_VREG_CORNER_NONE, |
| 392 | [VDD_DIG_LOW] = RPM_VREG_CORNER_LOW, |
| 393 | [VDD_DIG_NOMINAL] = RPM_VREG_CORNER_NOMINAL, |
| 394 | [VDD_DIG_HIGH] = RPM_VREG_CORNER_HIGH, |
Saravana Kannan | 298ec39 | 2012-02-08 19:21:47 -0800 | [diff] [blame] | 395 | }; |
Saravana Kannan | ebaa3ac | 2012-02-08 19:55:44 -0800 | [diff] [blame] | 396 | return rpm_vreg_set_voltage(RPM_VREG_ID_PM8038_VDD_DIG_CORNER, |
| 397 | RPM_VREG_VOTER3, |
| 398 | vdd_corner[level], |
| 399 | RPM_VREG_CORNER_HIGH, 1); |
Saravana Kannan | 298ec39 | 2012-02-08 19:21:47 -0800 | [diff] [blame] | 400 | } |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 401 | |
| 402 | #define VDD_DIG_FMAX_MAP1(l1, f1) \ |
| 403 | .vdd_class = &vdd_dig, \ |
| 404 | .fmax[VDD_DIG_##l1] = (f1) |
| 405 | #define VDD_DIG_FMAX_MAP2(l1, f1, l2, f2) \ |
| 406 | .vdd_class = &vdd_dig, \ |
| 407 | .fmax[VDD_DIG_##l1] = (f1), \ |
| 408 | .fmax[VDD_DIG_##l2] = (f2) |
| 409 | #define VDD_DIG_FMAX_MAP3(l1, f1, l2, f2, l3, f3) \ |
| 410 | .vdd_class = &vdd_dig, \ |
| 411 | .fmax[VDD_DIG_##l1] = (f1), \ |
| 412 | .fmax[VDD_DIG_##l2] = (f2), \ |
| 413 | .fmax[VDD_DIG_##l3] = (f3) |
| 414 | |
Tianyi Gou | e1faaf2 | 2012-01-24 16:07:19 -0800 | [diff] [blame] | 415 | enum vdd_sr2_pll_levels { |
| 416 | VDD_SR2_PLL_OFF, |
| 417 | VDD_SR2_PLL_ON |
Matt Wagantall | c57577d | 2011-10-06 17:06:53 -0700 | [diff] [blame] | 418 | }; |
| 419 | |
Saravana Kannan | 298ec39 | 2012-02-08 19:21:47 -0800 | [diff] [blame] | 420 | static int set_vdd_sr2_pll_8960(struct clk_vdd_class *vdd_class, int level) |
Matt Wagantall | c57577d | 2011-10-06 17:06:53 -0700 | [diff] [blame] | 421 | { |
Tianyi Gou | bf3d0b1 | 2012-01-23 14:37:28 -0800 | [diff] [blame] | 422 | int rc = 0; |
Saravana Kannan | 298ec39 | 2012-02-08 19:21:47 -0800 | [diff] [blame] | 423 | |
| 424 | if (level == VDD_SR2_PLL_OFF) { |
| 425 | rc = rpm_vreg_set_voltage(RPM_VREG_ID_PM8921_L23, |
| 426 | RPM_VREG_VOTER3, 0, 0, 1); |
| 427 | if (rc) |
| 428 | return rc; |
| 429 | rc = rpm_vreg_set_voltage(RPM_VREG_ID_PM8921_S8, |
| 430 | RPM_VREG_VOTER3, 0, 0, 1); |
| 431 | if (rc) |
| 432 | rpm_vreg_set_voltage(RPM_VREG_ID_PM8921_L23, |
| 433 | RPM_VREG_VOTER3, 1800000, 1800000, 1); |
Tianyi Gou | e1faaf2 | 2012-01-24 16:07:19 -0800 | [diff] [blame] | 434 | } else { |
Saravana Kannan | 298ec39 | 2012-02-08 19:21:47 -0800 | [diff] [blame] | 435 | rc = rpm_vreg_set_voltage(RPM_VREG_ID_PM8921_S8, |
| 436 | RPM_VREG_VOTER3, 2100000, 2100000, 1); |
| 437 | if (rc) |
| 438 | return rc; |
| 439 | rc = rpm_vreg_set_voltage(RPM_VREG_ID_PM8921_L23, |
| 440 | RPM_VREG_VOTER3, 1800000, 1800000, 1); |
| 441 | if (rc) |
| 442 | rpm_vreg_set_voltage(RPM_VREG_ID_PM8921_S8, |
Tianyi Gou | bf3d0b1 | 2012-01-23 14:37:28 -0800 | [diff] [blame] | 443 | RPM_VREG_VOTER3, 0, 0, 1); |
Matt Wagantall | c57577d | 2011-10-06 17:06:53 -0700 | [diff] [blame] | 444 | } |
| 445 | |
| 446 | return rc; |
| 447 | } |
| 448 | |
Saravana Kannan | 298ec39 | 2012-02-08 19:21:47 -0800 | [diff] [blame] | 449 | static DEFINE_VDD_CLASS(vdd_sr2_pll, set_vdd_sr2_pll_8960); |
| 450 | |
| 451 | static int sr2_lreg_uv[] = { |
| 452 | [VDD_SR2_PLL_OFF] = 0, |
| 453 | [VDD_SR2_PLL_ON] = 1800000, |
| 454 | }; |
| 455 | |
| 456 | static int set_vdd_sr2_pll_8064(struct clk_vdd_class *vdd_class, int level) |
| 457 | { |
| 458 | return rpm_vreg_set_voltage(RPM_VREG_ID_PM8921_LVS7, RPM_VREG_VOTER3, |
| 459 | sr2_lreg_uv[level], sr2_lreg_uv[level], 1); |
| 460 | } |
| 461 | |
| 462 | static int set_vdd_sr2_pll_8930(struct clk_vdd_class *vdd_class, int level) |
| 463 | { |
| 464 | return rpm_vreg_set_voltage(RPM_VREG_ID_PM8038_L23, RPM_VREG_VOTER3, |
| 465 | sr2_lreg_uv[level], sr2_lreg_uv[level], 1); |
| 466 | } |
Matt Wagantall | c57577d | 2011-10-06 17:06:53 -0700 | [diff] [blame] | 467 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 468 | /* |
| 469 | * Clock Descriptions |
| 470 | */ |
| 471 | |
Stephen Boyd | 72a8035 | 2012-01-26 15:57:38 -0800 | [diff] [blame] | 472 | DEFINE_CLK_RPM_BRANCH(pxo_clk, pxo_a_clk, PXO, 27000000); |
| 473 | DEFINE_CLK_RPM_BRANCH(cxo_clk, cxo_a_clk, CXO, 19200000); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 474 | |
| 475 | static struct pll_clk pll2_clk = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 476 | .mode_reg = MM_PLL1_MODE_REG, |
| 477 | .parent = &pxo_clk.c, |
| 478 | .c = { |
| 479 | .dbg_name = "pll2_clk", |
Tianyi Gou | 7949ecb | 2012-02-14 14:25:32 -0800 | [diff] [blame] | 480 | .rate = 800000000, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 481 | .ops = &clk_ops_pll, |
| 482 | CLK_INIT(pll2_clk.c), |
Stephen Boyd | 3bbf346 | 2012-01-12 00:19:23 -0800 | [diff] [blame] | 483 | .warned = true, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 484 | }, |
| 485 | }; |
| 486 | |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 487 | static struct pll_clk pll3_clk = { |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 488 | .mode_reg = BB_MMCC_PLL2_MODE_REG, |
| 489 | .parent = &pxo_clk.c, |
| 490 | .c = { |
| 491 | .dbg_name = "pll3_clk", |
Tianyi Gou | 7949ecb | 2012-02-14 14:25:32 -0800 | [diff] [blame] | 492 | .rate = 1200000000, |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 493 | .ops = &clk_ops_pll, |
Tianyi Gou | e1faaf2 | 2012-01-24 16:07:19 -0800 | [diff] [blame] | 494 | .vdd_class = &vdd_sr2_pll, |
| 495 | .fmax[VDD_SR2_PLL_ON] = ULONG_MAX, |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 496 | CLK_INIT(pll3_clk.c), |
Stephen Boyd | 3bbf346 | 2012-01-12 00:19:23 -0800 | [diff] [blame] | 497 | .warned = true, |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 498 | }, |
| 499 | }; |
| 500 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 501 | static struct pll_vote_clk pll4_clk = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 502 | .en_reg = BB_PLL_ENA_SC0_REG, |
| 503 | .en_mask = BIT(4), |
| 504 | .status_reg = LCC_PLL0_STATUS_REG, |
| 505 | .parent = &pxo_clk.c, |
| 506 | .c = { |
| 507 | .dbg_name = "pll4_clk", |
Tianyi Gou | 7949ecb | 2012-02-14 14:25:32 -0800 | [diff] [blame] | 508 | .rate = 393216000, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 509 | .ops = &clk_ops_pll_vote, |
| 510 | CLK_INIT(pll4_clk.c), |
Stephen Boyd | 3bbf346 | 2012-01-12 00:19:23 -0800 | [diff] [blame] | 511 | .warned = true, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 512 | }, |
| 513 | }; |
| 514 | |
| 515 | static struct pll_vote_clk pll8_clk = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 516 | .en_reg = BB_PLL_ENA_SC0_REG, |
| 517 | .en_mask = BIT(8), |
| 518 | .status_reg = BB_PLL8_STATUS_REG, |
| 519 | .parent = &pxo_clk.c, |
| 520 | .c = { |
| 521 | .dbg_name = "pll8_clk", |
Tianyi Gou | 7949ecb | 2012-02-14 14:25:32 -0800 | [diff] [blame] | 522 | .rate = 384000000, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 523 | .ops = &clk_ops_pll_vote, |
| 524 | CLK_INIT(pll8_clk.c), |
Stephen Boyd | 3bbf346 | 2012-01-12 00:19:23 -0800 | [diff] [blame] | 525 | .warned = true, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 526 | }, |
| 527 | }; |
| 528 | |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 529 | static struct pll_vote_clk pll14_clk = { |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 530 | .en_reg = BB_PLL_ENA_SC0_REG, |
| 531 | .en_mask = BIT(14), |
| 532 | .status_reg = BB_PLL14_STATUS_REG, |
| 533 | .parent = &pxo_clk.c, |
| 534 | .c = { |
| 535 | .dbg_name = "pll14_clk", |
Tianyi Gou | 7949ecb | 2012-02-14 14:25:32 -0800 | [diff] [blame] | 536 | .rate = 480000000, |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 537 | .ops = &clk_ops_pll_vote, |
| 538 | CLK_INIT(pll14_clk.c), |
Stephen Boyd | 3bbf346 | 2012-01-12 00:19:23 -0800 | [diff] [blame] | 539 | .warned = true, |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 540 | }, |
| 541 | }; |
| 542 | |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 543 | static struct pll_clk pll15_clk = { |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 544 | .mode_reg = MM_PLL3_MODE_REG, |
| 545 | .parent = &pxo_clk.c, |
| 546 | .c = { |
| 547 | .dbg_name = "pll15_clk", |
Tianyi Gou | 7949ecb | 2012-02-14 14:25:32 -0800 | [diff] [blame] | 548 | .rate = 975000000, |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 549 | .ops = &clk_ops_pll, |
| 550 | CLK_INIT(pll15_clk.c), |
Stephen Boyd | 3bbf346 | 2012-01-12 00:19:23 -0800 | [diff] [blame] | 551 | .warned = true, |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 552 | }, |
| 553 | }; |
| 554 | |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 555 | static struct clk_ops clk_ops_rcg_8960 = { |
Matt Wagantall | 0625ea0 | 2011-07-13 18:51:56 -0700 | [diff] [blame] | 556 | .enable = rcg_clk_enable, |
| 557 | .disable = rcg_clk_disable, |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 558 | .enable_hwcg = rcg_clk_enable_hwcg, |
| 559 | .disable_hwcg = rcg_clk_disable_hwcg, |
| 560 | .in_hwcg_mode = rcg_clk_in_hwcg_mode, |
Matt Wagantall | 41af077 | 2011-09-17 12:21:39 -0700 | [diff] [blame] | 561 | .auto_off = rcg_clk_disable, |
Matt Wagantall | 53d968f | 2011-07-19 13:22:53 -0700 | [diff] [blame] | 562 | .handoff = rcg_clk_handoff, |
Matt Wagantall | 0625ea0 | 2011-07-13 18:51:56 -0700 | [diff] [blame] | 563 | .set_rate = rcg_clk_set_rate, |
Matt Wagantall | 0625ea0 | 2011-07-13 18:51:56 -0700 | [diff] [blame] | 564 | .list_rate = rcg_clk_list_rate, |
| 565 | .is_enabled = rcg_clk_is_enabled, |
| 566 | .round_rate = rcg_clk_round_rate, |
Stephen Boyd | 7bf2814 | 2011-12-07 00:30:52 -0800 | [diff] [blame] | 567 | .reset = rcg_clk_reset, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 568 | .is_local = local_clk_is_local, |
Matt Wagantall | 0625ea0 | 2011-07-13 18:51:56 -0700 | [diff] [blame] | 569 | .get_parent = rcg_clk_get_parent, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 570 | .set_flags = rcg_clk_set_flags, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 571 | }; |
| 572 | |
| 573 | static struct clk_ops clk_ops_branch = { |
| 574 | .enable = branch_clk_enable, |
| 575 | .disable = branch_clk_disable, |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 576 | .enable_hwcg = branch_clk_enable_hwcg, |
| 577 | .disable_hwcg = branch_clk_disable_hwcg, |
| 578 | .in_hwcg_mode = branch_clk_in_hwcg_mode, |
Matt Wagantall | 41af077 | 2011-09-17 12:21:39 -0700 | [diff] [blame] | 579 | .auto_off = branch_clk_disable, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 580 | .is_enabled = branch_clk_is_enabled, |
| 581 | .reset = branch_clk_reset, |
| 582 | .is_local = local_clk_is_local, |
| 583 | .get_parent = branch_clk_get_parent, |
| 584 | .set_parent = branch_clk_set_parent, |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 585 | .handoff = branch_clk_handoff, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 586 | .set_flags = branch_clk_set_flags, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 587 | }; |
| 588 | |
| 589 | static struct clk_ops clk_ops_reset = { |
| 590 | .reset = branch_clk_reset, |
| 591 | .is_local = local_clk_is_local, |
| 592 | }; |
| 593 | |
| 594 | /* AXI Interfaces */ |
| 595 | static struct branch_clk gmem_axi_clk = { |
| 596 | .b = { |
| 597 | .ctl_reg = MAXI_EN_REG, |
| 598 | .en_mask = BIT(24), |
| 599 | .halt_reg = DBG_BUS_VEC_E_REG, |
| 600 | .halt_bit = 6, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 601 | .retain_reg = MAXI_EN2_REG, |
| 602 | .retain_mask = BIT(21), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 603 | }, |
| 604 | .c = { |
| 605 | .dbg_name = "gmem_axi_clk", |
| 606 | .ops = &clk_ops_branch, |
| 607 | CLK_INIT(gmem_axi_clk.c), |
| 608 | }, |
| 609 | }; |
| 610 | |
| 611 | static struct branch_clk ijpeg_axi_clk = { |
| 612 | .b = { |
| 613 | .ctl_reg = MAXI_EN_REG, |
| 614 | .en_mask = BIT(21), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 615 | .hwcg_reg = MAXI_EN_REG, |
| 616 | .hwcg_mask = BIT(11), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 617 | .reset_reg = SW_RESET_AXI_REG, |
| 618 | .reset_mask = BIT(14), |
| 619 | .halt_reg = DBG_BUS_VEC_E_REG, |
| 620 | .halt_bit = 4, |
| 621 | }, |
| 622 | .c = { |
| 623 | .dbg_name = "ijpeg_axi_clk", |
| 624 | .ops = &clk_ops_branch, |
| 625 | CLK_INIT(ijpeg_axi_clk.c), |
| 626 | }, |
| 627 | }; |
| 628 | |
| 629 | static struct branch_clk imem_axi_clk = { |
| 630 | .b = { |
| 631 | .ctl_reg = MAXI_EN_REG, |
| 632 | .en_mask = BIT(22), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 633 | .hwcg_reg = MAXI_EN_REG, |
| 634 | .hwcg_mask = BIT(15), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 635 | .reset_reg = SW_RESET_CORE_REG, |
| 636 | .reset_mask = BIT(10), |
| 637 | .halt_reg = DBG_BUS_VEC_E_REG, |
| 638 | .halt_bit = 7, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 639 | .retain_reg = MAXI_EN2_REG, |
| 640 | .retain_mask = BIT(10), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 641 | }, |
| 642 | .c = { |
| 643 | .dbg_name = "imem_axi_clk", |
| 644 | .ops = &clk_ops_branch, |
| 645 | CLK_INIT(imem_axi_clk.c), |
| 646 | }, |
| 647 | }; |
| 648 | |
| 649 | static struct branch_clk jpegd_axi_clk = { |
| 650 | .b = { |
| 651 | .ctl_reg = MAXI_EN_REG, |
| 652 | .en_mask = BIT(25), |
| 653 | .halt_reg = DBG_BUS_VEC_E_REG, |
| 654 | .halt_bit = 5, |
| 655 | }, |
| 656 | .c = { |
| 657 | .dbg_name = "jpegd_axi_clk", |
| 658 | .ops = &clk_ops_branch, |
| 659 | CLK_INIT(jpegd_axi_clk.c), |
| 660 | }, |
| 661 | }; |
| 662 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 663 | static struct branch_clk vcodec_axi_b_clk = { |
| 664 | .b = { |
| 665 | .ctl_reg = MAXI_EN4_REG, |
| 666 | .en_mask = BIT(23), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 667 | .hwcg_reg = MAXI_EN4_REG, |
| 668 | .hwcg_mask = BIT(22), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 669 | .halt_reg = DBG_BUS_VEC_I_REG, |
| 670 | .halt_bit = 25, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 671 | .retain_reg = MAXI_EN4_REG, |
| 672 | .retain_mask = BIT(21), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 673 | }, |
| 674 | .c = { |
| 675 | .dbg_name = "vcodec_axi_b_clk", |
| 676 | .ops = &clk_ops_branch, |
| 677 | CLK_INIT(vcodec_axi_b_clk.c), |
| 678 | }, |
| 679 | }; |
| 680 | |
Matt Wagantall | 91f4270 | 2011-07-14 12:01:15 -0700 | [diff] [blame] | 681 | static struct branch_clk vcodec_axi_a_clk = { |
| 682 | .b = { |
| 683 | .ctl_reg = MAXI_EN4_REG, |
| 684 | .en_mask = BIT(25), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 685 | .hwcg_reg = MAXI_EN4_REG, |
| 686 | .hwcg_mask = BIT(24), |
Matt Wagantall | 91f4270 | 2011-07-14 12:01:15 -0700 | [diff] [blame] | 687 | .halt_reg = DBG_BUS_VEC_I_REG, |
| 688 | .halt_bit = 26, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 689 | .retain_reg = MAXI_EN4_REG, |
| 690 | .retain_mask = BIT(10), |
Matt Wagantall | 91f4270 | 2011-07-14 12:01:15 -0700 | [diff] [blame] | 691 | }, |
Matt Wagantall | 91f4270 | 2011-07-14 12:01:15 -0700 | [diff] [blame] | 692 | .c = { |
| 693 | .dbg_name = "vcodec_axi_a_clk", |
| 694 | .ops = &clk_ops_branch, |
| 695 | CLK_INIT(vcodec_axi_a_clk.c), |
Stephen Boyd | 7fa2674 | 2011-08-11 23:22:29 -0700 | [diff] [blame] | 696 | .depends = &vcodec_axi_b_clk.c, |
Matt Wagantall | 91f4270 | 2011-07-14 12:01:15 -0700 | [diff] [blame] | 697 | }, |
| 698 | }; |
| 699 | |
| 700 | static struct branch_clk vcodec_axi_clk = { |
| 701 | .b = { |
| 702 | .ctl_reg = MAXI_EN_REG, |
| 703 | .en_mask = BIT(19), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 704 | .hwcg_reg = MAXI_EN_REG, |
| 705 | .hwcg_mask = BIT(13), |
Matt Wagantall | 91f4270 | 2011-07-14 12:01:15 -0700 | [diff] [blame] | 706 | .reset_reg = SW_RESET_AXI_REG, |
Gopikrishnaiah Anandan | 83b6e85 | 2012-01-05 17:47:02 -0800 | [diff] [blame] | 707 | .reset_mask = BIT(4)|BIT(5)|BIT(7), |
Matt Wagantall | 91f4270 | 2011-07-14 12:01:15 -0700 | [diff] [blame] | 708 | .halt_reg = DBG_BUS_VEC_E_REG, |
| 709 | .halt_bit = 3, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 710 | .retain_reg = MAXI_EN2_REG, |
| 711 | .retain_mask = BIT(28), |
Matt Wagantall | 91f4270 | 2011-07-14 12:01:15 -0700 | [diff] [blame] | 712 | }, |
Matt Wagantall | 91f4270 | 2011-07-14 12:01:15 -0700 | [diff] [blame] | 713 | .c = { |
| 714 | .dbg_name = "vcodec_axi_clk", |
| 715 | .ops = &clk_ops_branch, |
| 716 | CLK_INIT(vcodec_axi_clk.c), |
Stephen Boyd | 7fa2674 | 2011-08-11 23:22:29 -0700 | [diff] [blame] | 717 | .depends = &vcodec_axi_a_clk.c, |
Matt Wagantall | 91f4270 | 2011-07-14 12:01:15 -0700 | [diff] [blame] | 718 | }, |
| 719 | }; |
| 720 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 721 | static struct branch_clk vfe_axi_clk = { |
| 722 | .b = { |
| 723 | .ctl_reg = MAXI_EN_REG, |
| 724 | .en_mask = BIT(18), |
| 725 | .reset_reg = SW_RESET_AXI_REG, |
| 726 | .reset_mask = BIT(9), |
| 727 | .halt_reg = DBG_BUS_VEC_E_REG, |
| 728 | .halt_bit = 0, |
| 729 | }, |
| 730 | .c = { |
| 731 | .dbg_name = "vfe_axi_clk", |
| 732 | .ops = &clk_ops_branch, |
| 733 | CLK_INIT(vfe_axi_clk.c), |
| 734 | }, |
| 735 | }; |
| 736 | |
| 737 | static struct branch_clk mdp_axi_clk = { |
| 738 | .b = { |
| 739 | .ctl_reg = MAXI_EN_REG, |
| 740 | .en_mask = BIT(23), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 741 | .hwcg_reg = MAXI_EN_REG, |
| 742 | .hwcg_mask = BIT(16), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 743 | .reset_reg = SW_RESET_AXI_REG, |
| 744 | .reset_mask = BIT(13), |
| 745 | .halt_reg = DBG_BUS_VEC_E_REG, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 746 | .halt_bit = 8, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 747 | .retain_reg = MAXI_EN_REG, |
| 748 | .retain_mask = BIT(0), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 749 | }, |
| 750 | .c = { |
| 751 | .dbg_name = "mdp_axi_clk", |
| 752 | .ops = &clk_ops_branch, |
| 753 | CLK_INIT(mdp_axi_clk.c), |
| 754 | }, |
| 755 | }; |
| 756 | |
| 757 | static struct branch_clk rot_axi_clk = { |
| 758 | .b = { |
| 759 | .ctl_reg = MAXI_EN2_REG, |
| 760 | .en_mask = BIT(24), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 761 | .hwcg_reg = MAXI_EN2_REG, |
| 762 | .hwcg_mask = BIT(25), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 763 | .reset_reg = SW_RESET_AXI_REG, |
| 764 | .reset_mask = BIT(6), |
| 765 | .halt_reg = DBG_BUS_VEC_E_REG, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 766 | .halt_bit = 2, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 767 | .retain_reg = MAXI_EN3_REG, |
| 768 | .retain_mask = BIT(10), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 769 | }, |
| 770 | .c = { |
| 771 | .dbg_name = "rot_axi_clk", |
| 772 | .ops = &clk_ops_branch, |
| 773 | CLK_INIT(rot_axi_clk.c), |
| 774 | }, |
| 775 | }; |
| 776 | |
| 777 | static struct branch_clk vpe_axi_clk = { |
| 778 | .b = { |
| 779 | .ctl_reg = MAXI_EN2_REG, |
| 780 | .en_mask = BIT(26), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 781 | .hwcg_reg = MAXI_EN2_REG, |
| 782 | .hwcg_mask = BIT(27), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 783 | .reset_reg = SW_RESET_AXI_REG, |
| 784 | .reset_mask = BIT(15), |
| 785 | .halt_reg = DBG_BUS_VEC_E_REG, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 786 | .halt_bit = 1, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 787 | .retain_reg = MAXI_EN3_REG, |
| 788 | .retain_mask = BIT(21), |
| 789 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 790 | }, |
| 791 | .c = { |
| 792 | .dbg_name = "vpe_axi_clk", |
| 793 | .ops = &clk_ops_branch, |
| 794 | CLK_INIT(vpe_axi_clk.c), |
| 795 | }, |
| 796 | }; |
| 797 | |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 798 | static struct branch_clk vcap_axi_clk = { |
| 799 | .b = { |
| 800 | .ctl_reg = MAXI_EN5_REG, |
| 801 | .en_mask = BIT(12), |
| 802 | .reset_reg = SW_RESET_AXI_REG, |
| 803 | .reset_mask = BIT(16), |
| 804 | .halt_reg = DBG_BUS_VEC_J_REG, |
| 805 | .halt_bit = 20, |
| 806 | }, |
| 807 | .c = { |
| 808 | .dbg_name = "vcap_axi_clk", |
| 809 | .ops = &clk_ops_branch, |
| 810 | CLK_INIT(vcap_axi_clk.c), |
| 811 | }, |
| 812 | }; |
| 813 | |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 814 | /* gfx3d_axi_clk is set as a dependency of gmem_axi_clk at runtime */ |
| 815 | static struct branch_clk gfx3d_axi_clk_8064 = { |
Tianyi Gou | 621f874 | 2011-09-01 21:45:01 -0700 | [diff] [blame] | 816 | .b = { |
| 817 | .ctl_reg = MAXI_EN5_REG, |
| 818 | .en_mask = BIT(25), |
| 819 | .reset_reg = SW_RESET_AXI_REG, |
| 820 | .reset_mask = BIT(17), |
| 821 | .halt_reg = DBG_BUS_VEC_J_REG, |
| 822 | .halt_bit = 30, |
| 823 | }, |
| 824 | .c = { |
| 825 | .dbg_name = "gfx3d_axi_clk", |
| 826 | .ops = &clk_ops_branch, |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 827 | CLK_INIT(gfx3d_axi_clk_8064.c), |
| 828 | }, |
| 829 | }; |
| 830 | |
| 831 | static struct branch_clk gfx3d_axi_clk_8930 = { |
| 832 | .b = { |
| 833 | .ctl_reg = MAXI_EN5_REG, |
| 834 | .en_mask = BIT(12), |
| 835 | .reset_reg = SW_RESET_AXI_REG, |
| 836 | .reset_mask = BIT(16), |
| 837 | .halt_reg = DBG_BUS_VEC_J_REG, |
| 838 | .halt_bit = 12, |
| 839 | }, |
| 840 | .c = { |
| 841 | .dbg_name = "gfx3d_axi_clk", |
| 842 | .ops = &clk_ops_branch, |
| 843 | CLK_INIT(gfx3d_axi_clk_8930.c), |
Tianyi Gou | 621f874 | 2011-09-01 21:45:01 -0700 | [diff] [blame] | 844 | }, |
| 845 | }; |
| 846 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 847 | /* AHB Interfaces */ |
| 848 | static struct branch_clk amp_p_clk = { |
| 849 | .b = { |
| 850 | .ctl_reg = AHB_EN_REG, |
| 851 | .en_mask = BIT(24), |
| 852 | .halt_reg = DBG_BUS_VEC_F_REG, |
| 853 | .halt_bit = 18, |
| 854 | }, |
| 855 | .c = { |
| 856 | .dbg_name = "amp_p_clk", |
| 857 | .ops = &clk_ops_branch, |
| 858 | CLK_INIT(amp_p_clk.c), |
| 859 | }, |
| 860 | }; |
| 861 | |
Matt Wagantall | c23eee9 | 2011-08-16 23:06:52 -0700 | [diff] [blame] | 862 | static struct branch_clk csi_p_clk = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 863 | .b = { |
| 864 | .ctl_reg = AHB_EN_REG, |
| 865 | .en_mask = BIT(7), |
| 866 | .reset_reg = SW_RESET_AHB_REG, |
| 867 | .reset_mask = BIT(17), |
| 868 | .halt_reg = DBG_BUS_VEC_F_REG, |
| 869 | .halt_bit = 16, |
| 870 | }, |
| 871 | .c = { |
Matt Wagantall | c23eee9 | 2011-08-16 23:06:52 -0700 | [diff] [blame] | 872 | .dbg_name = "csi_p_clk", |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 873 | .ops = &clk_ops_branch, |
Matt Wagantall | c23eee9 | 2011-08-16 23:06:52 -0700 | [diff] [blame] | 874 | CLK_INIT(csi_p_clk.c), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 875 | }, |
| 876 | }; |
| 877 | |
| 878 | static struct branch_clk dsi1_m_p_clk = { |
| 879 | .b = { |
| 880 | .ctl_reg = AHB_EN_REG, |
| 881 | .en_mask = BIT(9), |
| 882 | .reset_reg = SW_RESET_AHB_REG, |
| 883 | .reset_mask = BIT(6), |
| 884 | .halt_reg = DBG_BUS_VEC_F_REG, |
| 885 | .halt_bit = 19, |
| 886 | }, |
| 887 | .c = { |
| 888 | .dbg_name = "dsi1_m_p_clk", |
| 889 | .ops = &clk_ops_branch, |
| 890 | CLK_INIT(dsi1_m_p_clk.c), |
| 891 | }, |
| 892 | }; |
| 893 | |
| 894 | static struct branch_clk dsi1_s_p_clk = { |
| 895 | .b = { |
| 896 | .ctl_reg = AHB_EN_REG, |
| 897 | .en_mask = BIT(18), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 898 | .hwcg_reg = AHB_EN2_REG, |
| 899 | .hwcg_mask = BIT(20), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 900 | .reset_reg = SW_RESET_AHB_REG, |
| 901 | .reset_mask = BIT(5), |
| 902 | .halt_reg = DBG_BUS_VEC_F_REG, |
| 903 | .halt_bit = 21, |
| 904 | }, |
| 905 | .c = { |
| 906 | .dbg_name = "dsi1_s_p_clk", |
| 907 | .ops = &clk_ops_branch, |
| 908 | CLK_INIT(dsi1_s_p_clk.c), |
| 909 | }, |
| 910 | }; |
| 911 | |
| 912 | static struct branch_clk dsi2_m_p_clk = { |
| 913 | .b = { |
| 914 | .ctl_reg = AHB_EN_REG, |
| 915 | .en_mask = BIT(17), |
| 916 | .reset_reg = SW_RESET_AHB2_REG, |
| 917 | .reset_mask = BIT(1), |
| 918 | .halt_reg = DBG_BUS_VEC_E_REG, |
| 919 | .halt_bit = 18, |
| 920 | }, |
| 921 | .c = { |
| 922 | .dbg_name = "dsi2_m_p_clk", |
| 923 | .ops = &clk_ops_branch, |
| 924 | CLK_INIT(dsi2_m_p_clk.c), |
| 925 | }, |
| 926 | }; |
| 927 | |
| 928 | static struct branch_clk dsi2_s_p_clk = { |
| 929 | .b = { |
| 930 | .ctl_reg = AHB_EN_REG, |
| 931 | .en_mask = BIT(22), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 932 | .hwcg_reg = AHB_EN2_REG, |
| 933 | .hwcg_mask = BIT(15), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 934 | .reset_reg = SW_RESET_AHB2_REG, |
| 935 | .reset_mask = BIT(0), |
| 936 | .halt_reg = DBG_BUS_VEC_F_REG, |
| 937 | .halt_bit = 20, |
| 938 | }, |
| 939 | .c = { |
| 940 | .dbg_name = "dsi2_s_p_clk", |
| 941 | .ops = &clk_ops_branch, |
| 942 | CLK_INIT(dsi2_s_p_clk.c), |
| 943 | }, |
| 944 | }; |
| 945 | |
| 946 | static struct branch_clk gfx2d0_p_clk = { |
| 947 | .b = { |
| 948 | .ctl_reg = AHB_EN_REG, |
| 949 | .en_mask = BIT(19), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 950 | .hwcg_reg = AHB_EN2_REG, |
| 951 | .hwcg_mask = BIT(28), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 952 | .reset_reg = SW_RESET_AHB_REG, |
| 953 | .reset_mask = BIT(12), |
| 954 | .halt_reg = DBG_BUS_VEC_F_REG, |
| 955 | .halt_bit = 2, |
| 956 | }, |
| 957 | .c = { |
| 958 | .dbg_name = "gfx2d0_p_clk", |
| 959 | .ops = &clk_ops_branch, |
| 960 | CLK_INIT(gfx2d0_p_clk.c), |
| 961 | }, |
| 962 | }; |
| 963 | |
| 964 | static struct branch_clk gfx2d1_p_clk = { |
| 965 | .b = { |
| 966 | .ctl_reg = AHB_EN_REG, |
| 967 | .en_mask = BIT(2), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 968 | .hwcg_reg = AHB_EN2_REG, |
| 969 | .hwcg_mask = BIT(29), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 970 | .reset_reg = SW_RESET_AHB_REG, |
| 971 | .reset_mask = BIT(11), |
| 972 | .halt_reg = DBG_BUS_VEC_F_REG, |
| 973 | .halt_bit = 3, |
| 974 | }, |
| 975 | .c = { |
| 976 | .dbg_name = "gfx2d1_p_clk", |
| 977 | .ops = &clk_ops_branch, |
| 978 | CLK_INIT(gfx2d1_p_clk.c), |
| 979 | }, |
| 980 | }; |
| 981 | |
| 982 | static struct branch_clk gfx3d_p_clk = { |
| 983 | .b = { |
| 984 | .ctl_reg = AHB_EN_REG, |
| 985 | .en_mask = BIT(3), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 986 | .hwcg_reg = AHB_EN2_REG, |
| 987 | .hwcg_mask = BIT(27), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 988 | .reset_reg = SW_RESET_AHB_REG, |
| 989 | .reset_mask = BIT(10), |
| 990 | .halt_reg = DBG_BUS_VEC_F_REG, |
| 991 | .halt_bit = 4, |
| 992 | }, |
| 993 | .c = { |
| 994 | .dbg_name = "gfx3d_p_clk", |
| 995 | .ops = &clk_ops_branch, |
| 996 | CLK_INIT(gfx3d_p_clk.c), |
| 997 | }, |
| 998 | }; |
| 999 | |
| 1000 | static struct branch_clk hdmi_m_p_clk = { |
| 1001 | .b = { |
| 1002 | .ctl_reg = AHB_EN_REG, |
| 1003 | .en_mask = BIT(14), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 1004 | .hwcg_reg = AHB_EN2_REG, |
| 1005 | .hwcg_mask = BIT(21), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1006 | .reset_reg = SW_RESET_AHB_REG, |
| 1007 | .reset_mask = BIT(9), |
| 1008 | .halt_reg = DBG_BUS_VEC_F_REG, |
| 1009 | .halt_bit = 5, |
| 1010 | }, |
| 1011 | .c = { |
| 1012 | .dbg_name = "hdmi_m_p_clk", |
| 1013 | .ops = &clk_ops_branch, |
| 1014 | CLK_INIT(hdmi_m_p_clk.c), |
| 1015 | }, |
| 1016 | }; |
| 1017 | |
| 1018 | static struct branch_clk hdmi_s_p_clk = { |
| 1019 | .b = { |
| 1020 | .ctl_reg = AHB_EN_REG, |
| 1021 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 1022 | .hwcg_reg = AHB_EN2_REG, |
| 1023 | .hwcg_mask = BIT(22), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1024 | .reset_reg = SW_RESET_AHB_REG, |
| 1025 | .reset_mask = BIT(9), |
| 1026 | .halt_reg = DBG_BUS_VEC_F_REG, |
| 1027 | .halt_bit = 6, |
| 1028 | }, |
| 1029 | .c = { |
| 1030 | .dbg_name = "hdmi_s_p_clk", |
| 1031 | .ops = &clk_ops_branch, |
| 1032 | CLK_INIT(hdmi_s_p_clk.c), |
| 1033 | }, |
| 1034 | }; |
| 1035 | |
| 1036 | static struct branch_clk ijpeg_p_clk = { |
| 1037 | .b = { |
| 1038 | .ctl_reg = AHB_EN_REG, |
| 1039 | .en_mask = BIT(5), |
| 1040 | .reset_reg = SW_RESET_AHB_REG, |
| 1041 | .reset_mask = BIT(7), |
| 1042 | .halt_reg = DBG_BUS_VEC_F_REG, |
| 1043 | .halt_bit = 9, |
| 1044 | }, |
| 1045 | .c = { |
| 1046 | .dbg_name = "ijpeg_p_clk", |
| 1047 | .ops = &clk_ops_branch, |
| 1048 | CLK_INIT(ijpeg_p_clk.c), |
| 1049 | }, |
| 1050 | }; |
| 1051 | |
| 1052 | static struct branch_clk imem_p_clk = { |
| 1053 | .b = { |
| 1054 | .ctl_reg = AHB_EN_REG, |
| 1055 | .en_mask = BIT(6), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 1056 | .hwcg_reg = AHB_EN2_REG, |
| 1057 | .hwcg_mask = BIT(12), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1058 | .reset_reg = SW_RESET_AHB_REG, |
| 1059 | .reset_mask = BIT(8), |
| 1060 | .halt_reg = DBG_BUS_VEC_F_REG, |
| 1061 | .halt_bit = 10, |
| 1062 | }, |
| 1063 | .c = { |
| 1064 | .dbg_name = "imem_p_clk", |
| 1065 | .ops = &clk_ops_branch, |
| 1066 | CLK_INIT(imem_p_clk.c), |
| 1067 | }, |
| 1068 | }; |
| 1069 | |
| 1070 | static struct branch_clk jpegd_p_clk = { |
| 1071 | .b = { |
| 1072 | .ctl_reg = AHB_EN_REG, |
| 1073 | .en_mask = BIT(21), |
| 1074 | .reset_reg = SW_RESET_AHB_REG, |
| 1075 | .reset_mask = BIT(4), |
| 1076 | .halt_reg = DBG_BUS_VEC_F_REG, |
| 1077 | .halt_bit = 7, |
| 1078 | }, |
| 1079 | .c = { |
| 1080 | .dbg_name = "jpegd_p_clk", |
| 1081 | .ops = &clk_ops_branch, |
| 1082 | CLK_INIT(jpegd_p_clk.c), |
| 1083 | }, |
| 1084 | }; |
| 1085 | |
| 1086 | static struct branch_clk mdp_p_clk = { |
| 1087 | .b = { |
| 1088 | .ctl_reg = AHB_EN_REG, |
| 1089 | .en_mask = BIT(10), |
| 1090 | .reset_reg = SW_RESET_AHB_REG, |
| 1091 | .reset_mask = BIT(3), |
| 1092 | .halt_reg = DBG_BUS_VEC_F_REG, |
| 1093 | .halt_bit = 11, |
| 1094 | }, |
| 1095 | .c = { |
| 1096 | .dbg_name = "mdp_p_clk", |
| 1097 | .ops = &clk_ops_branch, |
| 1098 | CLK_INIT(mdp_p_clk.c), |
| 1099 | }, |
| 1100 | }; |
| 1101 | |
| 1102 | static struct branch_clk rot_p_clk = { |
| 1103 | .b = { |
| 1104 | .ctl_reg = AHB_EN_REG, |
| 1105 | .en_mask = BIT(12), |
| 1106 | .reset_reg = SW_RESET_AHB_REG, |
| 1107 | .reset_mask = BIT(2), |
| 1108 | .halt_reg = DBG_BUS_VEC_F_REG, |
| 1109 | .halt_bit = 13, |
| 1110 | }, |
| 1111 | .c = { |
| 1112 | .dbg_name = "rot_p_clk", |
| 1113 | .ops = &clk_ops_branch, |
| 1114 | CLK_INIT(rot_p_clk.c), |
| 1115 | }, |
| 1116 | }; |
| 1117 | |
| 1118 | static struct branch_clk smmu_p_clk = { |
| 1119 | .b = { |
| 1120 | .ctl_reg = AHB_EN_REG, |
| 1121 | .en_mask = BIT(15), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 1122 | .hwcg_reg = AHB_EN_REG, |
| 1123 | .hwcg_mask = BIT(26), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1124 | .halt_reg = DBG_BUS_VEC_F_REG, |
| 1125 | .halt_bit = 22, |
| 1126 | }, |
| 1127 | .c = { |
| 1128 | .dbg_name = "smmu_p_clk", |
| 1129 | .ops = &clk_ops_branch, |
| 1130 | CLK_INIT(smmu_p_clk.c), |
| 1131 | }, |
| 1132 | }; |
| 1133 | |
| 1134 | static struct branch_clk tv_enc_p_clk = { |
| 1135 | .b = { |
| 1136 | .ctl_reg = AHB_EN_REG, |
| 1137 | .en_mask = BIT(25), |
| 1138 | .reset_reg = SW_RESET_AHB_REG, |
| 1139 | .reset_mask = BIT(15), |
| 1140 | .halt_reg = DBG_BUS_VEC_F_REG, |
| 1141 | .halt_bit = 23, |
| 1142 | }, |
| 1143 | .c = { |
| 1144 | .dbg_name = "tv_enc_p_clk", |
| 1145 | .ops = &clk_ops_branch, |
| 1146 | CLK_INIT(tv_enc_p_clk.c), |
| 1147 | }, |
| 1148 | }; |
| 1149 | |
| 1150 | static struct branch_clk vcodec_p_clk = { |
| 1151 | .b = { |
| 1152 | .ctl_reg = AHB_EN_REG, |
| 1153 | .en_mask = BIT(11), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 1154 | .hwcg_reg = AHB_EN2_REG, |
| 1155 | .hwcg_mask = BIT(26), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1156 | .reset_reg = SW_RESET_AHB_REG, |
| 1157 | .reset_mask = BIT(1), |
| 1158 | .halt_reg = DBG_BUS_VEC_F_REG, |
| 1159 | .halt_bit = 12, |
| 1160 | }, |
| 1161 | .c = { |
| 1162 | .dbg_name = "vcodec_p_clk", |
| 1163 | .ops = &clk_ops_branch, |
| 1164 | CLK_INIT(vcodec_p_clk.c), |
| 1165 | }, |
| 1166 | }; |
| 1167 | |
| 1168 | static struct branch_clk vfe_p_clk = { |
| 1169 | .b = { |
| 1170 | .ctl_reg = AHB_EN_REG, |
| 1171 | .en_mask = BIT(13), |
| 1172 | .reset_reg = SW_RESET_AHB_REG, |
| 1173 | .reset_mask = BIT(0), |
| 1174 | .halt_reg = DBG_BUS_VEC_F_REG, |
| 1175 | .halt_bit = 14, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 1176 | .retain_reg = AHB_EN2_REG, |
| 1177 | .retain_mask = BIT(0), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1178 | }, |
| 1179 | .c = { |
| 1180 | .dbg_name = "vfe_p_clk", |
| 1181 | .ops = &clk_ops_branch, |
| 1182 | CLK_INIT(vfe_p_clk.c), |
| 1183 | }, |
| 1184 | }; |
| 1185 | |
| 1186 | static struct branch_clk vpe_p_clk = { |
| 1187 | .b = { |
| 1188 | .ctl_reg = AHB_EN_REG, |
| 1189 | .en_mask = BIT(16), |
| 1190 | .reset_reg = SW_RESET_AHB_REG, |
| 1191 | .reset_mask = BIT(14), |
| 1192 | .halt_reg = DBG_BUS_VEC_F_REG, |
| 1193 | .halt_bit = 15, |
| 1194 | }, |
| 1195 | .c = { |
| 1196 | .dbg_name = "vpe_p_clk", |
| 1197 | .ops = &clk_ops_branch, |
| 1198 | CLK_INIT(vpe_p_clk.c), |
| 1199 | }, |
| 1200 | }; |
| 1201 | |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 1202 | static struct branch_clk vcap_p_clk = { |
| 1203 | .b = { |
| 1204 | .ctl_reg = AHB_EN3_REG, |
| 1205 | .en_mask = BIT(1), |
| 1206 | .reset_reg = SW_RESET_AHB2_REG, |
| 1207 | .reset_mask = BIT(2), |
| 1208 | .halt_reg = DBG_BUS_VEC_J_REG, |
| 1209 | .halt_bit = 23, |
| 1210 | }, |
| 1211 | .c = { |
| 1212 | .dbg_name = "vcap_p_clk", |
| 1213 | .ops = &clk_ops_branch, |
| 1214 | CLK_INIT(vcap_p_clk.c), |
| 1215 | }, |
| 1216 | }; |
| 1217 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1218 | /* |
| 1219 | * Peripheral Clocks |
| 1220 | */ |
Matt Wagantall | 7625a4c | 2011-11-01 16:17:53 -0700 | [diff] [blame] | 1221 | #define CLK_GP(i, n, h_r, h_b) \ |
| 1222 | struct rcg_clk i##_clk = { \ |
| 1223 | .b = { \ |
| 1224 | .ctl_reg = GPn_NS_REG(n), \ |
| 1225 | .en_mask = BIT(9), \ |
| 1226 | .halt_reg = h_r, \ |
| 1227 | .halt_bit = h_b, \ |
| 1228 | }, \ |
| 1229 | .ns_reg = GPn_NS_REG(n), \ |
| 1230 | .md_reg = GPn_MD_REG(n), \ |
| 1231 | .root_en_mask = BIT(11), \ |
| 1232 | .ns_mask = (BM(23, 16) | BM(6, 0)), \ |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame] | 1233 | .mnd_en_mask = BIT(8), \ |
Matt Wagantall | 7625a4c | 2011-11-01 16:17:53 -0700 | [diff] [blame] | 1234 | .set_rate = set_rate_mnd, \ |
| 1235 | .freq_tbl = clk_tbl_gp, \ |
| 1236 | .current_freq = &rcg_dummy_freq, \ |
| 1237 | .c = { \ |
| 1238 | .dbg_name = #i "_clk", \ |
| 1239 | .ops = &clk_ops_rcg_8960, \ |
| 1240 | VDD_DIG_FMAX_MAP2(LOW, 100000000, NOMINAL, 200000000), \ |
| 1241 | CLK_INIT(i##_clk.c), \ |
| 1242 | }, \ |
| 1243 | } |
| 1244 | #define F_GP(f, s, d, m, n) \ |
| 1245 | { \ |
| 1246 | .freq_hz = f, \ |
| 1247 | .src_clk = &s##_clk.c, \ |
| 1248 | .md_val = MD8(16, m, 0, n), \ |
| 1249 | .ns_val = NS(23, 16, n, m, 5, 4, 3, d, 2, 0, s##_to_bb_mux), \ |
Matt Wagantall | 7625a4c | 2011-11-01 16:17:53 -0700 | [diff] [blame] | 1250 | } |
| 1251 | static struct clk_freq_tbl clk_tbl_gp[] = { |
| 1252 | F_GP( 0, gnd, 1, 0, 0), |
| 1253 | F_GP( 9600000, cxo, 2, 0, 0), |
| 1254 | F_GP( 13500000, pxo, 2, 0, 0), |
| 1255 | F_GP( 19200000, cxo, 1, 0, 0), |
| 1256 | F_GP( 27000000, pxo, 1, 0, 0), |
| 1257 | F_GP( 64000000, pll8, 2, 1, 3), |
| 1258 | F_GP( 76800000, pll8, 1, 1, 5), |
| 1259 | F_GP( 96000000, pll8, 4, 0, 0), |
| 1260 | F_GP(128000000, pll8, 3, 0, 0), |
| 1261 | F_GP(192000000, pll8, 2, 0, 0), |
| 1262 | F_GP(384000000, pll8, 1, 0, 0), |
| 1263 | F_END |
| 1264 | }; |
| 1265 | |
| 1266 | static CLK_GP(gp0, 0, CLK_HALT_SFPB_MISC_STATE_REG, 7); |
| 1267 | static CLK_GP(gp1, 1, CLK_HALT_SFPB_MISC_STATE_REG, 6); |
| 1268 | static CLK_GP(gp2, 2, CLK_HALT_SFPB_MISC_STATE_REG, 5); |
| 1269 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1270 | #define CLK_GSBI_UART(i, n, h_r, h_b) \ |
| 1271 | struct rcg_clk i##_clk = { \ |
| 1272 | .b = { \ |
| 1273 | .ctl_reg = GSBIn_UART_APPS_NS_REG(n), \ |
| 1274 | .en_mask = BIT(9), \ |
| 1275 | .reset_reg = GSBIn_RESET_REG(n), \ |
| 1276 | .reset_mask = BIT(0), \ |
| 1277 | .halt_reg = h_r, \ |
| 1278 | .halt_bit = h_b, \ |
| 1279 | }, \ |
| 1280 | .ns_reg = GSBIn_UART_APPS_NS_REG(n), \ |
| 1281 | .md_reg = GSBIn_UART_APPS_MD_REG(n), \ |
| 1282 | .root_en_mask = BIT(11), \ |
| 1283 | .ns_mask = (BM(31, 16) | BM(6, 0)), \ |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame] | 1284 | .mnd_en_mask = BIT(8), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1285 | .set_rate = set_rate_mnd, \ |
| 1286 | .freq_tbl = clk_tbl_gsbi_uart, \ |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1287 | .current_freq = &rcg_dummy_freq, \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1288 | .c = { \ |
| 1289 | .dbg_name = #i "_clk", \ |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1290 | .ops = &clk_ops_rcg_8960, \ |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1291 | VDD_DIG_FMAX_MAP2(LOW, 32000000, NOMINAL, 64000000), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1292 | CLK_INIT(i##_clk.c), \ |
| 1293 | }, \ |
| 1294 | } |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1295 | #define F_GSBI_UART(f, s, d, m, n) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1296 | { \ |
| 1297 | .freq_hz = f, \ |
| 1298 | .src_clk = &s##_clk.c, \ |
| 1299 | .md_val = MD16(m, n), \ |
| 1300 | .ns_val = NS(31, 16, n, m, 5, 4, 3, d, 2, 0, s##_to_bb_mux), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1301 | } |
| 1302 | static struct clk_freq_tbl clk_tbl_gsbi_uart[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1303 | F_GSBI_UART( 0, gnd, 1, 0, 0), |
Matt Wagantall | 9a561f7 | 2012-01-19 16:13:12 -0800 | [diff] [blame] | 1304 | F_GSBI_UART( 1843200, pll8, 2, 6, 625), |
| 1305 | F_GSBI_UART( 3686400, pll8, 2, 12, 625), |
| 1306 | F_GSBI_UART( 7372800, pll8, 2, 24, 625), |
| 1307 | F_GSBI_UART(14745600, pll8, 2, 48, 625), |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1308 | F_GSBI_UART(16000000, pll8, 4, 1, 6), |
| 1309 | F_GSBI_UART(24000000, pll8, 4, 1, 4), |
| 1310 | F_GSBI_UART(32000000, pll8, 4, 1, 3), |
| 1311 | F_GSBI_UART(40000000, pll8, 1, 5, 48), |
| 1312 | F_GSBI_UART(46400000, pll8, 1, 29, 240), |
| 1313 | F_GSBI_UART(48000000, pll8, 4, 1, 2), |
| 1314 | F_GSBI_UART(51200000, pll8, 1, 2, 15), |
| 1315 | F_GSBI_UART(56000000, pll8, 1, 7, 48), |
| 1316 | F_GSBI_UART(58982400, pll8, 1, 96, 625), |
| 1317 | F_GSBI_UART(64000000, pll8, 2, 1, 3), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1318 | F_END |
| 1319 | }; |
| 1320 | |
| 1321 | static CLK_GSBI_UART(gsbi1_uart, 1, CLK_HALT_CFPB_STATEA_REG, 10); |
| 1322 | static CLK_GSBI_UART(gsbi2_uart, 2, CLK_HALT_CFPB_STATEA_REG, 6); |
| 1323 | static CLK_GSBI_UART(gsbi3_uart, 3, CLK_HALT_CFPB_STATEA_REG, 2); |
| 1324 | static CLK_GSBI_UART(gsbi4_uart, 4, CLK_HALT_CFPB_STATEB_REG, 26); |
| 1325 | static CLK_GSBI_UART(gsbi5_uart, 5, CLK_HALT_CFPB_STATEB_REG, 22); |
| 1326 | static CLK_GSBI_UART(gsbi6_uart, 6, CLK_HALT_CFPB_STATEB_REG, 18); |
| 1327 | static CLK_GSBI_UART(gsbi7_uart, 7, CLK_HALT_CFPB_STATEB_REG, 14); |
| 1328 | static CLK_GSBI_UART(gsbi8_uart, 8, CLK_HALT_CFPB_STATEB_REG, 10); |
| 1329 | static CLK_GSBI_UART(gsbi9_uart, 9, CLK_HALT_CFPB_STATEB_REG, 6); |
| 1330 | static CLK_GSBI_UART(gsbi10_uart, 10, CLK_HALT_CFPB_STATEB_REG, 2); |
| 1331 | static CLK_GSBI_UART(gsbi11_uart, 11, CLK_HALT_CFPB_STATEC_REG, 17); |
| 1332 | static CLK_GSBI_UART(gsbi12_uart, 12, CLK_HALT_CFPB_STATEC_REG, 13); |
| 1333 | |
| 1334 | #define CLK_GSBI_QUP(i, n, h_r, h_b) \ |
| 1335 | struct rcg_clk i##_clk = { \ |
| 1336 | .b = { \ |
| 1337 | .ctl_reg = GSBIn_QUP_APPS_NS_REG(n), \ |
| 1338 | .en_mask = BIT(9), \ |
| 1339 | .reset_reg = GSBIn_RESET_REG(n), \ |
| 1340 | .reset_mask = BIT(0), \ |
| 1341 | .halt_reg = h_r, \ |
| 1342 | .halt_bit = h_b, \ |
| 1343 | }, \ |
| 1344 | .ns_reg = GSBIn_QUP_APPS_NS_REG(n), \ |
| 1345 | .md_reg = GSBIn_QUP_APPS_MD_REG(n), \ |
| 1346 | .root_en_mask = BIT(11), \ |
| 1347 | .ns_mask = (BM(23, 16) | BM(6, 0)), \ |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame] | 1348 | .mnd_en_mask = BIT(8), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1349 | .set_rate = set_rate_mnd, \ |
| 1350 | .freq_tbl = clk_tbl_gsbi_qup, \ |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1351 | .current_freq = &rcg_dummy_freq, \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1352 | .c = { \ |
| 1353 | .dbg_name = #i "_clk", \ |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1354 | .ops = &clk_ops_rcg_8960, \ |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1355 | VDD_DIG_FMAX_MAP2(LOW, 24000000, NOMINAL, 52000000), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1356 | CLK_INIT(i##_clk.c), \ |
| 1357 | }, \ |
| 1358 | } |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1359 | #define F_GSBI_QUP(f, s, d, m, n) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1360 | { \ |
| 1361 | .freq_hz = f, \ |
| 1362 | .src_clk = &s##_clk.c, \ |
| 1363 | .md_val = MD8(16, m, 0, n), \ |
| 1364 | .ns_val = NS(23, 16, n, m, 5, 4, 3, d, 2, 0, s##_to_bb_mux), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1365 | } |
| 1366 | static struct clk_freq_tbl clk_tbl_gsbi_qup[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1367 | F_GSBI_QUP( 0, gnd, 1, 0, 0), |
| 1368 | F_GSBI_QUP( 1100000, pxo, 1, 2, 49), |
| 1369 | F_GSBI_QUP( 5400000, pxo, 1, 1, 5), |
| 1370 | F_GSBI_QUP(10800000, pxo, 1, 2, 5), |
| 1371 | F_GSBI_QUP(15060000, pll8, 1, 2, 51), |
| 1372 | F_GSBI_QUP(24000000, pll8, 4, 1, 4), |
| 1373 | F_GSBI_QUP(25600000, pll8, 1, 1, 15), |
| 1374 | F_GSBI_QUP(27000000, pxo, 1, 0, 0), |
| 1375 | F_GSBI_QUP(48000000, pll8, 4, 1, 2), |
| 1376 | F_GSBI_QUP(51200000, pll8, 1, 2, 15), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1377 | F_END |
| 1378 | }; |
| 1379 | |
| 1380 | static CLK_GSBI_QUP(gsbi1_qup, 1, CLK_HALT_CFPB_STATEA_REG, 9); |
| 1381 | static CLK_GSBI_QUP(gsbi2_qup, 2, CLK_HALT_CFPB_STATEA_REG, 4); |
| 1382 | static CLK_GSBI_QUP(gsbi3_qup, 3, CLK_HALT_CFPB_STATEA_REG, 0); |
| 1383 | static CLK_GSBI_QUP(gsbi4_qup, 4, CLK_HALT_CFPB_STATEB_REG, 24); |
| 1384 | static CLK_GSBI_QUP(gsbi5_qup, 5, CLK_HALT_CFPB_STATEB_REG, 20); |
| 1385 | static CLK_GSBI_QUP(gsbi6_qup, 6, CLK_HALT_CFPB_STATEB_REG, 16); |
| 1386 | static CLK_GSBI_QUP(gsbi7_qup, 7, CLK_HALT_CFPB_STATEB_REG, 12); |
| 1387 | static CLK_GSBI_QUP(gsbi8_qup, 8, CLK_HALT_CFPB_STATEB_REG, 8); |
| 1388 | static CLK_GSBI_QUP(gsbi9_qup, 9, CLK_HALT_CFPB_STATEB_REG, 4); |
| 1389 | static CLK_GSBI_QUP(gsbi10_qup, 10, CLK_HALT_CFPB_STATEB_REG, 0); |
| 1390 | static CLK_GSBI_QUP(gsbi11_qup, 11, CLK_HALT_CFPB_STATEC_REG, 15); |
| 1391 | static CLK_GSBI_QUP(gsbi12_qup, 12, CLK_HALT_CFPB_STATEC_REG, 11); |
| 1392 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1393 | #define F_PDM(f, s, d) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1394 | { \ |
| 1395 | .freq_hz = f, \ |
| 1396 | .src_clk = &s##_clk.c, \ |
| 1397 | .ns_val = NS_SRC_SEL(1, 0, s##_to_xo_mux), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1398 | } |
| 1399 | static struct clk_freq_tbl clk_tbl_pdm[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1400 | F_PDM( 0, gnd, 1), |
| 1401 | F_PDM(27000000, pxo, 1), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1402 | F_END |
| 1403 | }; |
| 1404 | |
| 1405 | static struct rcg_clk pdm_clk = { |
| 1406 | .b = { |
| 1407 | .ctl_reg = PDM_CLK_NS_REG, |
| 1408 | .en_mask = BIT(9), |
| 1409 | .reset_reg = PDM_CLK_NS_REG, |
| 1410 | .reset_mask = BIT(12), |
| 1411 | .halt_reg = CLK_HALT_CFPB_STATEC_REG, |
| 1412 | .halt_bit = 3, |
| 1413 | }, |
| 1414 | .ns_reg = PDM_CLK_NS_REG, |
| 1415 | .root_en_mask = BIT(11), |
| 1416 | .ns_mask = BM(1, 0), |
| 1417 | .set_rate = set_rate_nop, |
| 1418 | .freq_tbl = clk_tbl_pdm, |
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 | .c = { |
| 1421 | .dbg_name = "pdm_clk", |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1422 | .ops = &clk_ops_rcg_8960, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1423 | VDD_DIG_FMAX_MAP1(LOW, 27000000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1424 | CLK_INIT(pdm_clk.c), |
| 1425 | }, |
| 1426 | }; |
| 1427 | |
| 1428 | static struct branch_clk pmem_clk = { |
| 1429 | .b = { |
| 1430 | .ctl_reg = PMEM_ACLK_CTL_REG, |
| 1431 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 1432 | .hwcg_reg = PMEM_ACLK_CTL_REG, |
| 1433 | .hwcg_mask = BIT(6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1434 | .halt_reg = CLK_HALT_DFAB_STATE_REG, |
| 1435 | .halt_bit = 20, |
| 1436 | }, |
| 1437 | .c = { |
| 1438 | .dbg_name = "pmem_clk", |
| 1439 | .ops = &clk_ops_branch, |
| 1440 | CLK_INIT(pmem_clk.c), |
| 1441 | }, |
| 1442 | }; |
| 1443 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1444 | #define F_PRNG(f, s) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1445 | { \ |
| 1446 | .freq_hz = f, \ |
| 1447 | .src_clk = &s##_clk.c, \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1448 | } |
| 1449 | static struct clk_freq_tbl clk_tbl_prng[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1450 | F_PRNG(64000000, pll8), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1451 | F_END |
| 1452 | }; |
| 1453 | |
| 1454 | static struct rcg_clk prng_clk = { |
| 1455 | .b = { |
| 1456 | .ctl_reg = SC0_U_CLK_BRANCH_ENA_VOTE_REG, |
| 1457 | .en_mask = BIT(10), |
| 1458 | .halt_reg = CLK_HALT_SFPB_MISC_STATE_REG, |
| 1459 | .halt_check = HALT_VOTED, |
| 1460 | .halt_bit = 10, |
| 1461 | }, |
| 1462 | .set_rate = set_rate_nop, |
| 1463 | .freq_tbl = clk_tbl_prng, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1464 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1465 | .c = { |
| 1466 | .dbg_name = "prng_clk", |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1467 | .ops = &clk_ops_rcg_8960, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1468 | VDD_DIG_FMAX_MAP2(LOW, 32000000, NOMINAL, 65000000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1469 | CLK_INIT(prng_clk.c), |
| 1470 | }, |
| 1471 | }; |
| 1472 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1473 | #define CLK_SDC(name, n, h_b, fmax_low, fmax_nom) \ |
Stephen Boyd | a78a740 | 2011-08-02 11:23:39 -0700 | [diff] [blame] | 1474 | struct rcg_clk name = { \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1475 | .b = { \ |
| 1476 | .ctl_reg = SDCn_APPS_CLK_NS_REG(n), \ |
| 1477 | .en_mask = BIT(9), \ |
| 1478 | .reset_reg = SDCn_RESET_REG(n), \ |
| 1479 | .reset_mask = BIT(0), \ |
Stephen Boyd | a78a740 | 2011-08-02 11:23:39 -0700 | [diff] [blame] | 1480 | .halt_reg = CLK_HALT_DFAB_STATE_REG, \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1481 | .halt_bit = h_b, \ |
| 1482 | }, \ |
| 1483 | .ns_reg = SDCn_APPS_CLK_NS_REG(n), \ |
| 1484 | .md_reg = SDCn_APPS_CLK_MD_REG(n), \ |
| 1485 | .root_en_mask = BIT(11), \ |
| 1486 | .ns_mask = (BM(23, 16) | BM(6, 0)), \ |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame] | 1487 | .mnd_en_mask = BIT(8), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1488 | .set_rate = set_rate_mnd, \ |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1489 | .freq_tbl = clk_tbl_sdc, \ |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1490 | .current_freq = &rcg_dummy_freq, \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1491 | .c = { \ |
Stephen Boyd | a78a740 | 2011-08-02 11:23:39 -0700 | [diff] [blame] | 1492 | .dbg_name = #name, \ |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1493 | .ops = &clk_ops_rcg_8960, \ |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1494 | VDD_DIG_FMAX_MAP2(LOW, fmax_low, NOMINAL, fmax_nom), \ |
Stephen Boyd | a78a740 | 2011-08-02 11:23:39 -0700 | [diff] [blame] | 1495 | CLK_INIT(name.c), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1496 | }, \ |
| 1497 | } |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1498 | #define F_SDC(f, s, d, m, n) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1499 | { \ |
| 1500 | .freq_hz = f, \ |
| 1501 | .src_clk = &s##_clk.c, \ |
| 1502 | .md_val = MD8(16, m, 0, n), \ |
| 1503 | .ns_val = NS(23, 16, n, m, 5, 4, 3, d, 2, 0, s##_to_bb_mux), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1504 | } |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1505 | static struct clk_freq_tbl clk_tbl_sdc[] = { |
| 1506 | F_SDC( 0, gnd, 1, 0, 0), |
| 1507 | F_SDC( 144000, pxo, 3, 2, 125), |
| 1508 | F_SDC( 400000, pll8, 4, 1, 240), |
| 1509 | F_SDC( 16000000, pll8, 4, 1, 6), |
| 1510 | F_SDC( 17070000, pll8, 1, 2, 45), |
| 1511 | F_SDC( 20210000, pll8, 1, 1, 19), |
| 1512 | F_SDC( 24000000, pll8, 4, 1, 4), |
| 1513 | F_SDC( 48000000, pll8, 4, 1, 2), |
| 1514 | F_SDC( 64000000, pll8, 3, 1, 2), |
| 1515 | F_SDC( 96000000, pll8, 4, 0, 0), |
Subhash Jadavani | bd238ba | 2011-11-24 15:12:39 +0530 | [diff] [blame] | 1516 | F_SDC(192000000, pll8, 2, 0, 0), |
Stephen Boyd | a78a740 | 2011-08-02 11:23:39 -0700 | [diff] [blame] | 1517 | F_END |
| 1518 | }; |
| 1519 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1520 | static CLK_SDC(sdc1_clk, 1, 6, 52000000, 104000000); |
| 1521 | static CLK_SDC(sdc2_clk, 2, 5, 52000000, 104000000); |
| 1522 | static CLK_SDC(sdc3_clk, 3, 4, 104000000, 208000000); |
| 1523 | static CLK_SDC(sdc4_clk, 4, 3, 33000000, 67000000); |
| 1524 | static CLK_SDC(sdc5_clk, 5, 2, 33000000, 67000000); |
Stephen Boyd | a78a740 | 2011-08-02 11:23:39 -0700 | [diff] [blame] | 1525 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1526 | #define F_TSIF_REF(f, s, d, m, n) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1527 | { \ |
| 1528 | .freq_hz = f, \ |
| 1529 | .src_clk = &s##_clk.c, \ |
| 1530 | .md_val = MD16(m, n), \ |
| 1531 | .ns_val = NS(31, 16, n, m, 5, 4, 3, d, 2, 0, s##_to_bb_mux), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1532 | } |
| 1533 | static struct clk_freq_tbl clk_tbl_tsif_ref[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1534 | F_TSIF_REF( 0, gnd, 1, 0, 0), |
| 1535 | F_TSIF_REF(105000, pxo, 1, 1, 256), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1536 | F_END |
| 1537 | }; |
| 1538 | |
| 1539 | static struct rcg_clk tsif_ref_clk = { |
| 1540 | .b = { |
| 1541 | .ctl_reg = TSIF_REF_CLK_NS_REG, |
| 1542 | .en_mask = BIT(9), |
| 1543 | .halt_reg = CLK_HALT_CFPB_STATEC_REG, |
| 1544 | .halt_bit = 5, |
| 1545 | }, |
| 1546 | .ns_reg = TSIF_REF_CLK_NS_REG, |
| 1547 | .md_reg = TSIF_REF_CLK_MD_REG, |
| 1548 | .root_en_mask = BIT(11), |
| 1549 | .ns_mask = (BM(31, 16) | BM(6, 0)), |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame] | 1550 | .mnd_en_mask = BIT(8), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1551 | .set_rate = set_rate_mnd, |
| 1552 | .freq_tbl = clk_tbl_tsif_ref, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1553 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1554 | .c = { |
| 1555 | .dbg_name = "tsif_ref_clk", |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1556 | .ops = &clk_ops_rcg_8960, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1557 | VDD_DIG_FMAX_MAP2(LOW, 27000000, NOMINAL, 54000000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1558 | CLK_INIT(tsif_ref_clk.c), |
| 1559 | }, |
| 1560 | }; |
| 1561 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1562 | #define F_TSSC(f, s) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1563 | { \ |
| 1564 | .freq_hz = f, \ |
| 1565 | .src_clk = &s##_clk.c, \ |
| 1566 | .ns_val = NS_SRC_SEL(1, 0, s##_to_xo_mux), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1567 | } |
| 1568 | static struct clk_freq_tbl clk_tbl_tssc[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1569 | F_TSSC( 0, gnd), |
| 1570 | F_TSSC(27000000, pxo), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1571 | F_END |
| 1572 | }; |
| 1573 | |
| 1574 | static struct rcg_clk tssc_clk = { |
| 1575 | .b = { |
| 1576 | .ctl_reg = TSSC_CLK_CTL_REG, |
| 1577 | .en_mask = BIT(4), |
| 1578 | .halt_reg = CLK_HALT_CFPB_STATEC_REG, |
| 1579 | .halt_bit = 4, |
| 1580 | }, |
| 1581 | .ns_reg = TSSC_CLK_CTL_REG, |
| 1582 | .ns_mask = BM(1, 0), |
| 1583 | .set_rate = set_rate_nop, |
| 1584 | .freq_tbl = clk_tbl_tssc, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1585 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1586 | .c = { |
| 1587 | .dbg_name = "tssc_clk", |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1588 | .ops = &clk_ops_rcg_8960, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1589 | VDD_DIG_FMAX_MAP1(LOW, 27000000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1590 | CLK_INIT(tssc_clk.c), |
| 1591 | }, |
| 1592 | }; |
| 1593 | |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 1594 | #define CLK_USB_HS(name, n, h_b) \ |
| 1595 | static struct rcg_clk name = { \ |
| 1596 | .b = { \ |
| 1597 | .ctl_reg = USB_HS##n##_XCVR_FS_CLK_NS_REG, \ |
| 1598 | .en_mask = BIT(9), \ |
| 1599 | .reset_reg = USB_HS##n##_RESET_REG, \ |
| 1600 | .reset_mask = BIT(0), \ |
| 1601 | .halt_reg = CLK_HALT_DFAB_STATE_REG, \ |
| 1602 | .halt_bit = h_b, \ |
| 1603 | }, \ |
| 1604 | .ns_reg = USB_HS##n##_XCVR_FS_CLK_NS_REG, \ |
| 1605 | .md_reg = USB_HS##n##_XCVR_FS_CLK_MD_REG, \ |
| 1606 | .root_en_mask = BIT(11), \ |
| 1607 | .ns_mask = (BM(23, 16) | BM(6, 0)), \ |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame] | 1608 | .mnd_en_mask = BIT(8), \ |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 1609 | .set_rate = set_rate_mnd, \ |
| 1610 | .freq_tbl = clk_tbl_usb, \ |
| 1611 | .current_freq = &rcg_dummy_freq, \ |
| 1612 | .c = { \ |
| 1613 | .dbg_name = #name, \ |
| 1614 | .ops = &clk_ops_rcg_8960, \ |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1615 | VDD_DIG_FMAX_MAP1(NOMINAL, 64000000), \ |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 1616 | CLK_INIT(name.c), \ |
| 1617 | }, \ |
| 1618 | } |
| 1619 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1620 | #define F_USB(f, s, d, m, n) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1621 | { \ |
| 1622 | .freq_hz = f, \ |
| 1623 | .src_clk = &s##_clk.c, \ |
| 1624 | .md_val = MD8(16, m, 0, n), \ |
| 1625 | .ns_val = NS(23, 16, n, m, 5, 4, 3, d, 2, 0, s##_to_bb_mux), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1626 | } |
| 1627 | static struct clk_freq_tbl clk_tbl_usb[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1628 | F_USB( 0, gnd, 1, 0, 0), |
| 1629 | F_USB(60000000, pll8, 1, 5, 32), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1630 | F_END |
| 1631 | }; |
| 1632 | |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 1633 | CLK_USB_HS(usb_hs1_xcvr_clk, 1, 0); |
| 1634 | CLK_USB_HS(usb_hs3_xcvr_clk, 3, 30); |
| 1635 | CLK_USB_HS(usb_hs4_xcvr_clk, 4, 2); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1636 | |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 1637 | static struct clk_freq_tbl clk_tbl_usb_hsic[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1638 | F_USB( 0, gnd, 1, 0, 0), |
| 1639 | F_USB(60000000, pll8, 1, 5, 32), |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 1640 | F_END |
| 1641 | }; |
| 1642 | |
| 1643 | static struct rcg_clk usb_hsic_xcvr_fs_clk = { |
| 1644 | .b = { |
| 1645 | .ctl_reg = USB_HSIC_XCVR_FS_CLK_NS_REG, |
| 1646 | .en_mask = BIT(9), |
| 1647 | .halt_reg = CLK_HALT_CFPB_STATEA_REG, |
| 1648 | .halt_bit = 26, |
| 1649 | }, |
| 1650 | .ns_reg = USB_HSIC_XCVR_FS_CLK_NS_REG, |
| 1651 | .md_reg = USB_HSIC_XCVR_FS_CLK_MD_REG, |
| 1652 | .root_en_mask = BIT(11), |
| 1653 | .ns_mask = (BM(23, 16) | BM(6, 0)), |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame] | 1654 | .mnd_en_mask = BIT(8), |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 1655 | .set_rate = set_rate_mnd, |
| 1656 | .freq_tbl = clk_tbl_usb_hsic, |
| 1657 | .current_freq = &rcg_dummy_freq, |
| 1658 | .c = { |
| 1659 | .dbg_name = "usb_hsic_xcvr_fs_clk", |
| 1660 | .ops = &clk_ops_rcg_8960, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1661 | VDD_DIG_FMAX_MAP1(LOW, 60000000), |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 1662 | CLK_INIT(usb_hsic_xcvr_fs_clk.c), |
| 1663 | }, |
| 1664 | }; |
| 1665 | |
| 1666 | static struct branch_clk usb_hsic_system_clk = { |
| 1667 | .b = { |
| 1668 | .ctl_reg = USB_HSIC_SYSTEM_CLK_CTL_REG, |
| 1669 | .en_mask = BIT(4), |
| 1670 | .reset_reg = USB_HSIC_RESET_REG, |
| 1671 | .reset_mask = BIT(0), |
| 1672 | .halt_reg = CLK_HALT_CFPB_STATEA_REG, |
| 1673 | .halt_bit = 24, |
| 1674 | }, |
| 1675 | .parent = &usb_hsic_xcvr_fs_clk.c, |
| 1676 | .c = { |
| 1677 | .dbg_name = "usb_hsic_system_clk", |
| 1678 | .ops = &clk_ops_branch, |
| 1679 | CLK_INIT(usb_hsic_system_clk.c), |
| 1680 | }, |
| 1681 | }; |
| 1682 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1683 | #define F_USB_HSIC(f, s) \ |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 1684 | { \ |
| 1685 | .freq_hz = f, \ |
| 1686 | .src_clk = &s##_clk.c, \ |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 1687 | } |
| 1688 | static struct clk_freq_tbl clk_tbl_usb2_hsic[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1689 | F_USB_HSIC(480000000, pll14), |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 1690 | F_END |
| 1691 | }; |
| 1692 | |
| 1693 | static struct rcg_clk usb_hsic_hsic_src_clk = { |
| 1694 | .b = { |
| 1695 | .ctl_reg = USB_HSIC_HSIC_CLK_SRC_CTL_REG, |
| 1696 | .halt_check = NOCHECK, |
| 1697 | }, |
| 1698 | .root_en_mask = BIT(0), |
| 1699 | .set_rate = set_rate_nop, |
| 1700 | .freq_tbl = clk_tbl_usb2_hsic, |
| 1701 | .current_freq = &rcg_dummy_freq, |
| 1702 | .c = { |
| 1703 | .dbg_name = "usb_hsic_hsic_src_clk", |
| 1704 | .ops = &clk_ops_rcg_8960, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1705 | VDD_DIG_FMAX_MAP1(LOW, 480000000), |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 1706 | CLK_INIT(usb_hsic_hsic_src_clk.c), |
| 1707 | }, |
| 1708 | }; |
| 1709 | |
| 1710 | static struct branch_clk usb_hsic_hsic_clk = { |
| 1711 | .b = { |
| 1712 | .ctl_reg = USB_HSIC_HSIC_CLK_CTL_REG, |
| 1713 | .en_mask = BIT(0), |
| 1714 | .halt_reg = CLK_HALT_CFPB_STATEA_REG, |
| 1715 | .halt_bit = 19, |
| 1716 | }, |
| 1717 | .parent = &usb_hsic_hsic_src_clk.c, |
| 1718 | .c = { |
| 1719 | .dbg_name = "usb_hsic_hsic_clk", |
| 1720 | .ops = &clk_ops_branch, |
| 1721 | CLK_INIT(usb_hsic_hsic_clk.c), |
| 1722 | }, |
| 1723 | }; |
| 1724 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1725 | #define F_USB_HSIO_CAL(f, s) \ |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 1726 | { \ |
| 1727 | .freq_hz = f, \ |
| 1728 | .src_clk = &s##_clk.c, \ |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 1729 | } |
| 1730 | static struct clk_freq_tbl clk_tbl_usb_hsio_cal[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1731 | F_USB_HSIO_CAL(9000000, pxo), |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 1732 | F_END |
| 1733 | }; |
| 1734 | |
| 1735 | static struct rcg_clk usb_hsic_hsio_cal_clk = { |
| 1736 | .b = { |
| 1737 | .ctl_reg = USB_HSIC_HSIO_CAL_CLK_CTL_REG, |
| 1738 | .en_mask = BIT(0), |
| 1739 | .halt_reg = CLK_HALT_CFPB_STATEA_REG, |
| 1740 | .halt_bit = 23, |
| 1741 | }, |
| 1742 | .set_rate = set_rate_nop, |
| 1743 | .freq_tbl = clk_tbl_usb_hsio_cal, |
| 1744 | .current_freq = &rcg_dummy_freq, |
| 1745 | .c = { |
| 1746 | .dbg_name = "usb_hsic_hsio_cal_clk", |
Stephen Boyd | a0e82ec | 2011-09-19 12:18:45 -0700 | [diff] [blame] | 1747 | .ops = &clk_ops_rcg_8960, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1748 | VDD_DIG_FMAX_MAP1(LOW, 10000000), |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 1749 | CLK_INIT(usb_hsic_hsio_cal_clk.c), |
| 1750 | }, |
| 1751 | }; |
| 1752 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1753 | static struct branch_clk usb_phy0_clk = { |
| 1754 | .b = { |
| 1755 | .reset_reg = USB_PHY0_RESET_REG, |
| 1756 | .reset_mask = BIT(0), |
| 1757 | }, |
| 1758 | .c = { |
| 1759 | .dbg_name = "usb_phy0_clk", |
| 1760 | .ops = &clk_ops_reset, |
| 1761 | CLK_INIT(usb_phy0_clk.c), |
| 1762 | }, |
| 1763 | }; |
| 1764 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1765 | #define CLK_USB_FS(i, n, fmax_nom) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1766 | struct rcg_clk i##_clk = { \ |
| 1767 | .ns_reg = USB_FSn_XCVR_FS_CLK_NS_REG(n), \ |
| 1768 | .b = { \ |
| 1769 | .ctl_reg = USB_FSn_XCVR_FS_CLK_NS_REG(n), \ |
| 1770 | .halt_check = NOCHECK, \ |
| 1771 | }, \ |
| 1772 | .md_reg = USB_FSn_XCVR_FS_CLK_MD_REG(n), \ |
| 1773 | .root_en_mask = BIT(11), \ |
| 1774 | .ns_mask = (BM(23, 16) | BM(6, 0)), \ |
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 | .set_rate = set_rate_mnd, \ |
| 1777 | .freq_tbl = clk_tbl_usb, \ |
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 | .c = { \ |
| 1780 | .dbg_name = #i "_clk", \ |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1781 | .ops = &clk_ops_rcg_8960, \ |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1782 | VDD_DIG_FMAX_MAP1(NOMINAL, fmax_nom), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1783 | CLK_INIT(i##_clk.c), \ |
| 1784 | }, \ |
| 1785 | } |
| 1786 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1787 | static CLK_USB_FS(usb_fs1_src, 1, 64000000); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1788 | static struct branch_clk usb_fs1_xcvr_clk = { |
| 1789 | .b = { |
| 1790 | .ctl_reg = USB_FSn_XCVR_FS_CLK_NS_REG(1), |
| 1791 | .en_mask = BIT(9), |
| 1792 | .reset_reg = USB_FSn_RESET_REG(1), |
| 1793 | .reset_mask = BIT(1), |
| 1794 | .halt_reg = CLK_HALT_CFPB_STATEA_REG, |
| 1795 | .halt_bit = 15, |
| 1796 | }, |
| 1797 | .parent = &usb_fs1_src_clk.c, |
| 1798 | .c = { |
| 1799 | .dbg_name = "usb_fs1_xcvr_clk", |
| 1800 | .ops = &clk_ops_branch, |
| 1801 | CLK_INIT(usb_fs1_xcvr_clk.c), |
| 1802 | }, |
| 1803 | }; |
| 1804 | |
| 1805 | static struct branch_clk usb_fs1_sys_clk = { |
| 1806 | .b = { |
| 1807 | .ctl_reg = USB_FSn_SYSTEM_CLK_CTL_REG(1), |
| 1808 | .en_mask = BIT(4), |
| 1809 | .reset_reg = USB_FSn_RESET_REG(1), |
| 1810 | .reset_mask = BIT(0), |
| 1811 | .halt_reg = CLK_HALT_CFPB_STATEA_REG, |
| 1812 | .halt_bit = 16, |
| 1813 | }, |
| 1814 | .parent = &usb_fs1_src_clk.c, |
| 1815 | .c = { |
| 1816 | .dbg_name = "usb_fs1_sys_clk", |
| 1817 | .ops = &clk_ops_branch, |
| 1818 | CLK_INIT(usb_fs1_sys_clk.c), |
| 1819 | }, |
| 1820 | }; |
| 1821 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1822 | static CLK_USB_FS(usb_fs2_src, 2, 60000000); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1823 | static struct branch_clk usb_fs2_xcvr_clk = { |
| 1824 | .b = { |
| 1825 | .ctl_reg = USB_FSn_XCVR_FS_CLK_NS_REG(2), |
| 1826 | .en_mask = BIT(9), |
| 1827 | .reset_reg = USB_FSn_RESET_REG(2), |
| 1828 | .reset_mask = BIT(1), |
| 1829 | .halt_reg = CLK_HALT_CFPB_STATEA_REG, |
| 1830 | .halt_bit = 12, |
| 1831 | }, |
| 1832 | .parent = &usb_fs2_src_clk.c, |
| 1833 | .c = { |
| 1834 | .dbg_name = "usb_fs2_xcvr_clk", |
| 1835 | .ops = &clk_ops_branch, |
| 1836 | CLK_INIT(usb_fs2_xcvr_clk.c), |
| 1837 | }, |
| 1838 | }; |
| 1839 | |
| 1840 | static struct branch_clk usb_fs2_sys_clk = { |
| 1841 | .b = { |
| 1842 | .ctl_reg = USB_FSn_SYSTEM_CLK_CTL_REG(2), |
| 1843 | .en_mask = BIT(4), |
| 1844 | .reset_reg = USB_FSn_RESET_REG(2), |
| 1845 | .reset_mask = BIT(0), |
| 1846 | .halt_reg = CLK_HALT_CFPB_STATEA_REG, |
| 1847 | .halt_bit = 13, |
| 1848 | }, |
| 1849 | .parent = &usb_fs2_src_clk.c, |
| 1850 | .c = { |
| 1851 | .dbg_name = "usb_fs2_sys_clk", |
| 1852 | .ops = &clk_ops_branch, |
| 1853 | CLK_INIT(usb_fs2_sys_clk.c), |
| 1854 | }, |
| 1855 | }; |
| 1856 | |
| 1857 | /* Fast Peripheral Bus Clocks */ |
| 1858 | static struct branch_clk ce1_core_clk = { |
| 1859 | .b = { |
| 1860 | .ctl_reg = CE1_CORE_CLK_CTL_REG, |
| 1861 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 1862 | .hwcg_reg = CE1_CORE_CLK_CTL_REG, |
| 1863 | .hwcg_mask = BIT(6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1864 | .halt_reg = CLK_HALT_CFPB_STATEC_REG, |
| 1865 | .halt_bit = 27, |
| 1866 | }, |
| 1867 | .c = { |
| 1868 | .dbg_name = "ce1_core_clk", |
| 1869 | .ops = &clk_ops_branch, |
| 1870 | CLK_INIT(ce1_core_clk.c), |
| 1871 | }, |
| 1872 | }; |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 1873 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1874 | static struct branch_clk ce1_p_clk = { |
| 1875 | .b = { |
| 1876 | .ctl_reg = CE1_HCLK_CTL_REG, |
| 1877 | .en_mask = BIT(4), |
| 1878 | .halt_reg = CLK_HALT_CFPB_STATEC_REG, |
| 1879 | .halt_bit = 1, |
| 1880 | }, |
| 1881 | .c = { |
| 1882 | .dbg_name = "ce1_p_clk", |
| 1883 | .ops = &clk_ops_branch, |
| 1884 | CLK_INIT(ce1_p_clk.c), |
| 1885 | }, |
| 1886 | }; |
| 1887 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1888 | #define F_CE3(f, s, d) \ |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 1889 | { \ |
| 1890 | .freq_hz = f, \ |
| 1891 | .src_clk = &s##_clk.c, \ |
| 1892 | .ns_val = NS_DIVSRC(6, 3, d, 2, 0, s##_to_bb_mux), \ |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 1893 | } |
| 1894 | |
| 1895 | static struct clk_freq_tbl clk_tbl_ce3[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1896 | F_CE3( 0, gnd, 1), |
| 1897 | F_CE3( 48000000, pll8, 8), |
| 1898 | F_CE3(100000000, pll3, 12), |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 1899 | F_END |
| 1900 | }; |
| 1901 | |
| 1902 | static struct rcg_clk ce3_src_clk = { |
| 1903 | .b = { |
| 1904 | .ctl_reg = CE3_CLK_SRC_NS_REG, |
| 1905 | .halt_check = NOCHECK, |
| 1906 | }, |
| 1907 | .ns_reg = CE3_CLK_SRC_NS_REG, |
| 1908 | .root_en_mask = BIT(7), |
| 1909 | .ns_mask = BM(6, 0), |
| 1910 | .set_rate = set_rate_nop, |
| 1911 | .freq_tbl = clk_tbl_ce3, |
| 1912 | .current_freq = &rcg_dummy_freq, |
| 1913 | .c = { |
| 1914 | .dbg_name = "ce3_src_clk", |
| 1915 | .ops = &clk_ops_rcg_8960, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1916 | VDD_DIG_FMAX_MAP2(LOW, 50000000, NOMINAL, 100000000), |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 1917 | CLK_INIT(ce3_src_clk.c), |
| 1918 | }, |
| 1919 | }; |
| 1920 | |
| 1921 | static struct branch_clk ce3_core_clk = { |
| 1922 | .b = { |
| 1923 | .ctl_reg = CE3_CORE_CLK_CTL_REG, |
| 1924 | .en_mask = BIT(4), |
| 1925 | .reset_reg = CE3_CORE_CLK_CTL_REG, |
| 1926 | .reset_mask = BIT(7), |
| 1927 | .halt_reg = CLK_HALT_MSS_SMPSS_MISC_STATE_REG, |
| 1928 | .halt_bit = 5, |
| 1929 | }, |
| 1930 | .parent = &ce3_src_clk.c, |
| 1931 | .c = { |
| 1932 | .dbg_name = "ce3_core_clk", |
| 1933 | .ops = &clk_ops_branch, |
| 1934 | CLK_INIT(ce3_core_clk.c), |
| 1935 | } |
| 1936 | }; |
| 1937 | |
| 1938 | static struct branch_clk ce3_p_clk = { |
| 1939 | .b = { |
| 1940 | .ctl_reg = CE3_HCLK_CTL_REG, |
| 1941 | .en_mask = BIT(4), |
| 1942 | .reset_reg = CE3_HCLK_CTL_REG, |
| 1943 | .reset_mask = BIT(7), |
| 1944 | .halt_reg = CLK_HALT_AFAB_SFAB_STATEB_REG, |
| 1945 | .halt_bit = 16, |
| 1946 | }, |
| 1947 | .parent = &ce3_src_clk.c, |
| 1948 | .c = { |
| 1949 | .dbg_name = "ce3_p_clk", |
| 1950 | .ops = &clk_ops_branch, |
| 1951 | CLK_INIT(ce3_p_clk.c), |
| 1952 | } |
| 1953 | }; |
| 1954 | |
| 1955 | static struct branch_clk sata_phy_ref_clk = { |
| 1956 | .b = { |
| 1957 | .ctl_reg = SATA_PHY_REF_CLK_CTL_REG, |
| 1958 | .en_mask = BIT(4), |
| 1959 | .halt_reg = CLK_HALT_MSS_SMPSS_MISC_STATE_REG, |
| 1960 | .halt_bit = 24, |
| 1961 | }, |
| 1962 | .parent = &pxo_clk.c, |
| 1963 | .c = { |
| 1964 | .dbg_name = "sata_phy_ref_clk", |
| 1965 | .ops = &clk_ops_branch, |
| 1966 | CLK_INIT(sata_phy_ref_clk.c), |
| 1967 | }, |
| 1968 | }; |
| 1969 | |
| 1970 | static struct branch_clk pcie_p_clk = { |
| 1971 | .b = { |
| 1972 | .ctl_reg = PCIE_HCLK_CTL_REG, |
| 1973 | .en_mask = BIT(4), |
| 1974 | .halt_reg = CLK_HALT_CFPB_STATEC_REG, |
| 1975 | .halt_bit = 8, |
| 1976 | }, |
| 1977 | .c = { |
| 1978 | .dbg_name = "pcie_p_clk", |
| 1979 | .ops = &clk_ops_branch, |
| 1980 | CLK_INIT(pcie_p_clk.c), |
| 1981 | }, |
| 1982 | }; |
| 1983 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1984 | static struct branch_clk dma_bam_p_clk = { |
| 1985 | .b = { |
| 1986 | .ctl_reg = DMA_BAM_HCLK_CTL, |
| 1987 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 1988 | .hwcg_reg = DMA_BAM_HCLK_CTL, |
| 1989 | .hwcg_mask = BIT(6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1990 | .halt_reg = CLK_HALT_DFAB_STATE_REG, |
| 1991 | .halt_bit = 12, |
| 1992 | }, |
| 1993 | .c = { |
| 1994 | .dbg_name = "dma_bam_p_clk", |
| 1995 | .ops = &clk_ops_branch, |
| 1996 | CLK_INIT(dma_bam_p_clk.c), |
| 1997 | }, |
| 1998 | }; |
| 1999 | |
| 2000 | static struct branch_clk gsbi1_p_clk = { |
| 2001 | .b = { |
| 2002 | .ctl_reg = GSBIn_HCLK_CTL_REG(1), |
| 2003 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 2004 | .hwcg_reg = GSBIn_HCLK_CTL_REG(1), |
| 2005 | .hwcg_mask = BIT(6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2006 | .halt_reg = CLK_HALT_CFPB_STATEA_REG, |
| 2007 | .halt_bit = 11, |
| 2008 | }, |
| 2009 | .c = { |
| 2010 | .dbg_name = "gsbi1_p_clk", |
| 2011 | .ops = &clk_ops_branch, |
| 2012 | CLK_INIT(gsbi1_p_clk.c), |
| 2013 | }, |
| 2014 | }; |
| 2015 | |
| 2016 | static struct branch_clk gsbi2_p_clk = { |
| 2017 | .b = { |
| 2018 | .ctl_reg = GSBIn_HCLK_CTL_REG(2), |
| 2019 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 2020 | .hwcg_reg = GSBIn_HCLK_CTL_REG(2), |
| 2021 | .hwcg_mask = BIT(6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2022 | .halt_reg = CLK_HALT_CFPB_STATEA_REG, |
| 2023 | .halt_bit = 7, |
| 2024 | }, |
| 2025 | .c = { |
| 2026 | .dbg_name = "gsbi2_p_clk", |
| 2027 | .ops = &clk_ops_branch, |
| 2028 | CLK_INIT(gsbi2_p_clk.c), |
| 2029 | }, |
| 2030 | }; |
| 2031 | |
| 2032 | static struct branch_clk gsbi3_p_clk = { |
| 2033 | .b = { |
| 2034 | .ctl_reg = GSBIn_HCLK_CTL_REG(3), |
| 2035 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 2036 | .hwcg_reg = GSBIn_HCLK_CTL_REG(3), |
| 2037 | .hwcg_mask = BIT(6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2038 | .halt_reg = CLK_HALT_CFPB_STATEA_REG, |
| 2039 | .halt_bit = 3, |
| 2040 | }, |
| 2041 | .c = { |
| 2042 | .dbg_name = "gsbi3_p_clk", |
| 2043 | .ops = &clk_ops_branch, |
| 2044 | CLK_INIT(gsbi3_p_clk.c), |
| 2045 | }, |
| 2046 | }; |
| 2047 | |
| 2048 | static struct branch_clk gsbi4_p_clk = { |
| 2049 | .b = { |
| 2050 | .ctl_reg = GSBIn_HCLK_CTL_REG(4), |
| 2051 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 2052 | .hwcg_reg = GSBIn_HCLK_CTL_REG(4), |
| 2053 | .hwcg_mask = BIT(6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2054 | .halt_reg = CLK_HALT_CFPB_STATEB_REG, |
| 2055 | .halt_bit = 27, |
| 2056 | }, |
| 2057 | .c = { |
| 2058 | .dbg_name = "gsbi4_p_clk", |
| 2059 | .ops = &clk_ops_branch, |
| 2060 | CLK_INIT(gsbi4_p_clk.c), |
| 2061 | }, |
| 2062 | }; |
| 2063 | |
| 2064 | static struct branch_clk gsbi5_p_clk = { |
| 2065 | .b = { |
| 2066 | .ctl_reg = GSBIn_HCLK_CTL_REG(5), |
| 2067 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 2068 | .hwcg_reg = GSBIn_HCLK_CTL_REG(5), |
| 2069 | .hwcg_mask = BIT(6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2070 | .halt_reg = CLK_HALT_CFPB_STATEB_REG, |
| 2071 | .halt_bit = 23, |
| 2072 | }, |
| 2073 | .c = { |
| 2074 | .dbg_name = "gsbi5_p_clk", |
| 2075 | .ops = &clk_ops_branch, |
| 2076 | CLK_INIT(gsbi5_p_clk.c), |
| 2077 | }, |
| 2078 | }; |
| 2079 | |
| 2080 | static struct branch_clk gsbi6_p_clk = { |
| 2081 | .b = { |
| 2082 | .ctl_reg = GSBIn_HCLK_CTL_REG(6), |
| 2083 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 2084 | .hwcg_reg = GSBIn_HCLK_CTL_REG(6), |
| 2085 | .hwcg_mask = BIT(6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2086 | .halt_reg = CLK_HALT_CFPB_STATEB_REG, |
| 2087 | .halt_bit = 19, |
| 2088 | }, |
| 2089 | .c = { |
| 2090 | .dbg_name = "gsbi6_p_clk", |
| 2091 | .ops = &clk_ops_branch, |
| 2092 | CLK_INIT(gsbi6_p_clk.c), |
| 2093 | }, |
| 2094 | }; |
| 2095 | |
| 2096 | static struct branch_clk gsbi7_p_clk = { |
| 2097 | .b = { |
| 2098 | .ctl_reg = GSBIn_HCLK_CTL_REG(7), |
| 2099 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 2100 | .hwcg_reg = GSBIn_HCLK_CTL_REG(7), |
| 2101 | .hwcg_mask = BIT(6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2102 | .halt_reg = CLK_HALT_CFPB_STATEB_REG, |
| 2103 | .halt_bit = 15, |
| 2104 | }, |
| 2105 | .c = { |
| 2106 | .dbg_name = "gsbi7_p_clk", |
| 2107 | .ops = &clk_ops_branch, |
| 2108 | CLK_INIT(gsbi7_p_clk.c), |
| 2109 | }, |
| 2110 | }; |
| 2111 | |
| 2112 | static struct branch_clk gsbi8_p_clk = { |
| 2113 | .b = { |
| 2114 | .ctl_reg = GSBIn_HCLK_CTL_REG(8), |
| 2115 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 2116 | .hwcg_reg = GSBIn_HCLK_CTL_REG(8), |
| 2117 | .hwcg_mask = BIT(6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2118 | .halt_reg = CLK_HALT_CFPB_STATEB_REG, |
| 2119 | .halt_bit = 11, |
| 2120 | }, |
| 2121 | .c = { |
| 2122 | .dbg_name = "gsbi8_p_clk", |
| 2123 | .ops = &clk_ops_branch, |
| 2124 | CLK_INIT(gsbi8_p_clk.c), |
| 2125 | }, |
| 2126 | }; |
| 2127 | |
| 2128 | static struct branch_clk gsbi9_p_clk = { |
| 2129 | .b = { |
| 2130 | .ctl_reg = GSBIn_HCLK_CTL_REG(9), |
| 2131 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 2132 | .hwcg_reg = GSBIn_HCLK_CTL_REG(9), |
| 2133 | .hwcg_mask = BIT(6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2134 | .halt_reg = CLK_HALT_CFPB_STATEB_REG, |
| 2135 | .halt_bit = 7, |
| 2136 | }, |
| 2137 | .c = { |
| 2138 | .dbg_name = "gsbi9_p_clk", |
| 2139 | .ops = &clk_ops_branch, |
| 2140 | CLK_INIT(gsbi9_p_clk.c), |
| 2141 | }, |
| 2142 | }; |
| 2143 | |
| 2144 | static struct branch_clk gsbi10_p_clk = { |
| 2145 | .b = { |
| 2146 | .ctl_reg = GSBIn_HCLK_CTL_REG(10), |
| 2147 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 2148 | .hwcg_reg = GSBIn_HCLK_CTL_REG(10), |
| 2149 | .hwcg_mask = BIT(6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2150 | .halt_reg = CLK_HALT_CFPB_STATEB_REG, |
| 2151 | .halt_bit = 3, |
| 2152 | }, |
| 2153 | .c = { |
| 2154 | .dbg_name = "gsbi10_p_clk", |
| 2155 | .ops = &clk_ops_branch, |
| 2156 | CLK_INIT(gsbi10_p_clk.c), |
| 2157 | }, |
| 2158 | }; |
| 2159 | |
| 2160 | static struct branch_clk gsbi11_p_clk = { |
| 2161 | .b = { |
| 2162 | .ctl_reg = GSBIn_HCLK_CTL_REG(11), |
| 2163 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 2164 | .hwcg_reg = GSBIn_HCLK_CTL_REG(11), |
| 2165 | .hwcg_mask = BIT(6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2166 | .halt_reg = CLK_HALT_CFPB_STATEC_REG, |
| 2167 | .halt_bit = 18, |
| 2168 | }, |
| 2169 | .c = { |
| 2170 | .dbg_name = "gsbi11_p_clk", |
| 2171 | .ops = &clk_ops_branch, |
| 2172 | CLK_INIT(gsbi11_p_clk.c), |
| 2173 | }, |
| 2174 | }; |
| 2175 | |
| 2176 | static struct branch_clk gsbi12_p_clk = { |
| 2177 | .b = { |
| 2178 | .ctl_reg = GSBIn_HCLK_CTL_REG(12), |
| 2179 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 2180 | .hwcg_reg = GSBIn_HCLK_CTL_REG(12), |
| 2181 | .hwcg_mask = BIT(6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2182 | .halt_reg = CLK_HALT_CFPB_STATEC_REG, |
| 2183 | .halt_bit = 14, |
| 2184 | }, |
| 2185 | .c = { |
| 2186 | .dbg_name = "gsbi12_p_clk", |
| 2187 | .ops = &clk_ops_branch, |
| 2188 | CLK_INIT(gsbi12_p_clk.c), |
| 2189 | }, |
| 2190 | }; |
| 2191 | |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 2192 | static struct branch_clk sata_phy_cfg_clk = { |
| 2193 | .b = { |
| 2194 | .ctl_reg = SATA_PHY_CFG_CLK_CTL_REG, |
| 2195 | .en_mask = BIT(4), |
| 2196 | .halt_reg = CLK_HALT_CFPB_STATEA_REG, |
| 2197 | .halt_bit = 12, |
| 2198 | }, |
| 2199 | .c = { |
| 2200 | .dbg_name = "sata_phy_cfg_clk", |
| 2201 | .ops = &clk_ops_branch, |
| 2202 | CLK_INIT(sata_phy_cfg_clk.c), |
Stephen Boyd | 973e4ba | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 2203 | }, |
| 2204 | }; |
| 2205 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2206 | static struct branch_clk tsif_p_clk = { |
| 2207 | .b = { |
| 2208 | .ctl_reg = TSIF_HCLK_CTL_REG, |
| 2209 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 2210 | .hwcg_reg = TSIF_HCLK_CTL_REG, |
| 2211 | .hwcg_mask = BIT(6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2212 | .halt_reg = CLK_HALT_CFPB_STATEC_REG, |
| 2213 | .halt_bit = 7, |
| 2214 | }, |
| 2215 | .c = { |
| 2216 | .dbg_name = "tsif_p_clk", |
| 2217 | .ops = &clk_ops_branch, |
| 2218 | CLK_INIT(tsif_p_clk.c), |
| 2219 | }, |
| 2220 | }; |
| 2221 | |
| 2222 | static struct branch_clk usb_fs1_p_clk = { |
| 2223 | .b = { |
| 2224 | .ctl_reg = USB_FSn_HCLK_CTL_REG(1), |
| 2225 | .en_mask = BIT(4), |
| 2226 | .halt_reg = CLK_HALT_CFPB_STATEA_REG, |
| 2227 | .halt_bit = 17, |
| 2228 | }, |
| 2229 | .c = { |
| 2230 | .dbg_name = "usb_fs1_p_clk", |
| 2231 | .ops = &clk_ops_branch, |
| 2232 | CLK_INIT(usb_fs1_p_clk.c), |
| 2233 | }, |
| 2234 | }; |
| 2235 | |
| 2236 | static struct branch_clk usb_fs2_p_clk = { |
| 2237 | .b = { |
| 2238 | .ctl_reg = USB_FSn_HCLK_CTL_REG(2), |
| 2239 | .en_mask = BIT(4), |
| 2240 | .halt_reg = CLK_HALT_CFPB_STATEA_REG, |
| 2241 | .halt_bit = 14, |
| 2242 | }, |
| 2243 | .c = { |
| 2244 | .dbg_name = "usb_fs2_p_clk", |
| 2245 | .ops = &clk_ops_branch, |
| 2246 | CLK_INIT(usb_fs2_p_clk.c), |
| 2247 | }, |
| 2248 | }; |
| 2249 | |
| 2250 | static struct branch_clk usb_hs1_p_clk = { |
| 2251 | .b = { |
| 2252 | .ctl_reg = USB_HS1_HCLK_CTL_REG, |
| 2253 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 2254 | .hwcg_reg = USB_HS1_HCLK_CTL_REG, |
| 2255 | .hwcg_mask = BIT(6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2256 | .halt_reg = CLK_HALT_DFAB_STATE_REG, |
| 2257 | .halt_bit = 1, |
| 2258 | }, |
| 2259 | .c = { |
| 2260 | .dbg_name = "usb_hs1_p_clk", |
| 2261 | .ops = &clk_ops_branch, |
| 2262 | CLK_INIT(usb_hs1_p_clk.c), |
| 2263 | }, |
| 2264 | }; |
| 2265 | |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 2266 | static struct branch_clk usb_hs3_p_clk = { |
| 2267 | .b = { |
| 2268 | .ctl_reg = USB_HS3_HCLK_CTL_REG, |
| 2269 | .en_mask = BIT(4), |
| 2270 | .halt_reg = CLK_HALT_DFAB_STATE_REG, |
| 2271 | .halt_bit = 31, |
| 2272 | }, |
| 2273 | .c = { |
| 2274 | .dbg_name = "usb_hs3_p_clk", |
| 2275 | .ops = &clk_ops_branch, |
| 2276 | CLK_INIT(usb_hs3_p_clk.c), |
| 2277 | }, |
| 2278 | }; |
| 2279 | |
| 2280 | static struct branch_clk usb_hs4_p_clk = { |
| 2281 | .b = { |
| 2282 | .ctl_reg = USB_HS4_HCLK_CTL_REG, |
| 2283 | .en_mask = BIT(4), |
| 2284 | .halt_reg = CLK_HALT_DFAB_STATE_REG, |
| 2285 | .halt_bit = 7, |
| 2286 | }, |
| 2287 | .c = { |
| 2288 | .dbg_name = "usb_hs4_p_clk", |
| 2289 | .ops = &clk_ops_branch, |
| 2290 | CLK_INIT(usb_hs4_p_clk.c), |
| 2291 | }, |
| 2292 | }; |
| 2293 | |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 2294 | static struct branch_clk usb_hsic_p_clk = { |
| 2295 | .b = { |
| 2296 | .ctl_reg = USB_HSIC_HCLK_CTL_REG, |
| 2297 | .en_mask = BIT(4), |
| 2298 | .halt_reg = CLK_HALT_CFPB_STATEA_REG, |
| 2299 | .halt_bit = 28, |
| 2300 | }, |
| 2301 | .c = { |
| 2302 | .dbg_name = "usb_hsic_p_clk", |
| 2303 | .ops = &clk_ops_branch, |
| 2304 | CLK_INIT(usb_hsic_p_clk.c), |
| 2305 | }, |
| 2306 | }; |
| 2307 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2308 | static struct branch_clk sdc1_p_clk = { |
| 2309 | .b = { |
| 2310 | .ctl_reg = SDCn_HCLK_CTL_REG(1), |
| 2311 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 2312 | .hwcg_reg = SDCn_HCLK_CTL_REG(1), |
| 2313 | .hwcg_mask = BIT(6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2314 | .halt_reg = CLK_HALT_DFAB_STATE_REG, |
| 2315 | .halt_bit = 11, |
| 2316 | }, |
| 2317 | .c = { |
| 2318 | .dbg_name = "sdc1_p_clk", |
| 2319 | .ops = &clk_ops_branch, |
| 2320 | CLK_INIT(sdc1_p_clk.c), |
| 2321 | }, |
| 2322 | }; |
| 2323 | |
| 2324 | static struct branch_clk sdc2_p_clk = { |
| 2325 | .b = { |
| 2326 | .ctl_reg = SDCn_HCLK_CTL_REG(2), |
| 2327 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 2328 | .hwcg_reg = SDCn_HCLK_CTL_REG(2), |
| 2329 | .hwcg_mask = BIT(6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2330 | .halt_reg = CLK_HALT_DFAB_STATE_REG, |
| 2331 | .halt_bit = 10, |
| 2332 | }, |
| 2333 | .c = { |
| 2334 | .dbg_name = "sdc2_p_clk", |
| 2335 | .ops = &clk_ops_branch, |
| 2336 | CLK_INIT(sdc2_p_clk.c), |
| 2337 | }, |
| 2338 | }; |
| 2339 | |
| 2340 | static struct branch_clk sdc3_p_clk = { |
| 2341 | .b = { |
| 2342 | .ctl_reg = SDCn_HCLK_CTL_REG(3), |
| 2343 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 2344 | .hwcg_reg = SDCn_HCLK_CTL_REG(3), |
| 2345 | .hwcg_mask = BIT(6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2346 | .halt_reg = CLK_HALT_DFAB_STATE_REG, |
| 2347 | .halt_bit = 9, |
| 2348 | }, |
| 2349 | .c = { |
| 2350 | .dbg_name = "sdc3_p_clk", |
| 2351 | .ops = &clk_ops_branch, |
| 2352 | CLK_INIT(sdc3_p_clk.c), |
| 2353 | }, |
| 2354 | }; |
| 2355 | |
| 2356 | static struct branch_clk sdc4_p_clk = { |
| 2357 | .b = { |
| 2358 | .ctl_reg = SDCn_HCLK_CTL_REG(4), |
| 2359 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 2360 | .hwcg_reg = SDCn_HCLK_CTL_REG(4), |
| 2361 | .hwcg_mask = BIT(6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2362 | .halt_reg = CLK_HALT_DFAB_STATE_REG, |
| 2363 | .halt_bit = 8, |
| 2364 | }, |
| 2365 | .c = { |
| 2366 | .dbg_name = "sdc4_p_clk", |
| 2367 | .ops = &clk_ops_branch, |
| 2368 | CLK_INIT(sdc4_p_clk.c), |
| 2369 | }, |
| 2370 | }; |
| 2371 | |
| 2372 | static struct branch_clk sdc5_p_clk = { |
| 2373 | .b = { |
| 2374 | .ctl_reg = SDCn_HCLK_CTL_REG(5), |
| 2375 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 2376 | .hwcg_reg = SDCn_HCLK_CTL_REG(5), |
| 2377 | .hwcg_mask = BIT(6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2378 | .halt_reg = CLK_HALT_DFAB_STATE_REG, |
| 2379 | .halt_bit = 7, |
| 2380 | }, |
| 2381 | .c = { |
| 2382 | .dbg_name = "sdc5_p_clk", |
| 2383 | .ops = &clk_ops_branch, |
| 2384 | CLK_INIT(sdc5_p_clk.c), |
| 2385 | }, |
| 2386 | }; |
| 2387 | |
| 2388 | /* HW-Voteable Clocks */ |
| 2389 | static struct branch_clk adm0_clk = { |
| 2390 | .b = { |
| 2391 | .ctl_reg = SC0_U_CLK_BRANCH_ENA_VOTE_REG, |
| 2392 | .en_mask = BIT(2), |
| 2393 | .halt_reg = CLK_HALT_MSS_SMPSS_MISC_STATE_REG, |
| 2394 | .halt_check = HALT_VOTED, |
| 2395 | .halt_bit = 14, |
| 2396 | }, |
| 2397 | .c = { |
| 2398 | .dbg_name = "adm0_clk", |
| 2399 | .ops = &clk_ops_branch, |
| 2400 | CLK_INIT(adm0_clk.c), |
| 2401 | }, |
| 2402 | }; |
| 2403 | |
| 2404 | static struct branch_clk adm0_p_clk = { |
| 2405 | .b = { |
| 2406 | .ctl_reg = SC0_U_CLK_BRANCH_ENA_VOTE_REG, |
| 2407 | .en_mask = BIT(3), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 2408 | .hwcg_reg = ADM0_PBUS_CLK_CTL_REG, |
| 2409 | .hwcg_mask = BIT(6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2410 | .halt_reg = CLK_HALT_MSS_SMPSS_MISC_STATE_REG, |
| 2411 | .halt_check = HALT_VOTED, |
| 2412 | .halt_bit = 13, |
| 2413 | }, |
| 2414 | .c = { |
| 2415 | .dbg_name = "adm0_p_clk", |
| 2416 | .ops = &clk_ops_branch, |
| 2417 | CLK_INIT(adm0_p_clk.c), |
| 2418 | }, |
| 2419 | }; |
| 2420 | |
| 2421 | static struct branch_clk pmic_arb0_p_clk = { |
| 2422 | .b = { |
| 2423 | .ctl_reg = SC0_U_CLK_BRANCH_ENA_VOTE_REG, |
| 2424 | .en_mask = BIT(8), |
| 2425 | .halt_reg = CLK_HALT_SFPB_MISC_STATE_REG, |
| 2426 | .halt_check = HALT_VOTED, |
| 2427 | .halt_bit = 22, |
| 2428 | }, |
| 2429 | .c = { |
| 2430 | .dbg_name = "pmic_arb0_p_clk", |
| 2431 | .ops = &clk_ops_branch, |
| 2432 | CLK_INIT(pmic_arb0_p_clk.c), |
| 2433 | }, |
| 2434 | }; |
| 2435 | |
| 2436 | static struct branch_clk pmic_arb1_p_clk = { |
| 2437 | .b = { |
| 2438 | .ctl_reg = SC0_U_CLK_BRANCH_ENA_VOTE_REG, |
| 2439 | .en_mask = BIT(9), |
| 2440 | .halt_reg = CLK_HALT_SFPB_MISC_STATE_REG, |
| 2441 | .halt_check = HALT_VOTED, |
| 2442 | .halt_bit = 21, |
| 2443 | }, |
| 2444 | .c = { |
| 2445 | .dbg_name = "pmic_arb1_p_clk", |
| 2446 | .ops = &clk_ops_branch, |
| 2447 | CLK_INIT(pmic_arb1_p_clk.c), |
| 2448 | }, |
| 2449 | }; |
| 2450 | |
| 2451 | static struct branch_clk pmic_ssbi2_clk = { |
| 2452 | .b = { |
| 2453 | .ctl_reg = SC0_U_CLK_BRANCH_ENA_VOTE_REG, |
| 2454 | .en_mask = BIT(7), |
| 2455 | .halt_reg = CLK_HALT_SFPB_MISC_STATE_REG, |
| 2456 | .halt_check = HALT_VOTED, |
| 2457 | .halt_bit = 23, |
| 2458 | }, |
| 2459 | .c = { |
| 2460 | .dbg_name = "pmic_ssbi2_clk", |
| 2461 | .ops = &clk_ops_branch, |
| 2462 | CLK_INIT(pmic_ssbi2_clk.c), |
| 2463 | }, |
| 2464 | }; |
| 2465 | |
| 2466 | static struct branch_clk rpm_msg_ram_p_clk = { |
| 2467 | .b = { |
| 2468 | .ctl_reg = SC0_U_CLK_BRANCH_ENA_VOTE_REG, |
| 2469 | .en_mask = BIT(6), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 2470 | .hwcg_reg = RPM_MSG_RAM_HCLK_CTL_REG, |
| 2471 | .hwcg_mask = BIT(6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2472 | .halt_reg = CLK_HALT_SFPB_MISC_STATE_REG, |
| 2473 | .halt_check = HALT_VOTED, |
| 2474 | .halt_bit = 12, |
| 2475 | }, |
| 2476 | .c = { |
| 2477 | .dbg_name = "rpm_msg_ram_p_clk", |
| 2478 | .ops = &clk_ops_branch, |
| 2479 | CLK_INIT(rpm_msg_ram_p_clk.c), |
| 2480 | }, |
| 2481 | }; |
| 2482 | |
| 2483 | /* |
| 2484 | * Multimedia Clocks |
| 2485 | */ |
| 2486 | |
| 2487 | static struct branch_clk amp_clk = { |
| 2488 | .b = { |
| 2489 | .reset_reg = SW_RESET_CORE_REG, |
| 2490 | .reset_mask = BIT(20), |
| 2491 | }, |
| 2492 | .c = { |
| 2493 | .dbg_name = "amp_clk", |
| 2494 | .ops = &clk_ops_reset, |
| 2495 | CLK_INIT(amp_clk.c), |
| 2496 | }, |
| 2497 | }; |
| 2498 | |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 2499 | #define CLK_CAM(name, n, hb) \ |
| 2500 | struct rcg_clk name = { \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2501 | .b = { \ |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 2502 | .ctl_reg = CAMCLK##n##_CC_REG, \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2503 | .en_mask = BIT(0), \ |
| 2504 | .halt_reg = DBG_BUS_VEC_I_REG, \ |
| 2505 | .halt_bit = hb, \ |
| 2506 | }, \ |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 2507 | .ns_reg = CAMCLK##n##_NS_REG, \ |
| 2508 | .md_reg = CAMCLK##n##_MD_REG, \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2509 | .root_en_mask = BIT(2), \ |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 2510 | .ns_mask = BM(31, 24) | BM(15, 14) | BM(2, 0), \ |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame] | 2511 | .mnd_en_mask = BIT(5), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2512 | .ctl_mask = BM(7, 6), \ |
| 2513 | .set_rate = set_rate_mnd_8, \ |
| 2514 | .freq_tbl = clk_tbl_cam, \ |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 2515 | .current_freq = &rcg_dummy_freq, \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2516 | .c = { \ |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 2517 | .dbg_name = #name, \ |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 2518 | .ops = &clk_ops_rcg_8960, \ |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 2519 | VDD_DIG_FMAX_MAP2(LOW, 64000000, NOMINAL, 128000000), \ |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 2520 | CLK_INIT(name.c), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2521 | }, \ |
| 2522 | } |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 2523 | #define F_CAM(f, s, d, m, n) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2524 | { \ |
| 2525 | .freq_hz = f, \ |
| 2526 | .src_clk = &s##_clk.c, \ |
| 2527 | .md_val = MD8(8, m, 0, n), \ |
| 2528 | .ns_val = NS_MM(31, 24, n, m, 15, 14, d, 2, 0, s##_to_mm_mux), \ |
| 2529 | .ctl_val = CC(6, n), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2530 | } |
| 2531 | static struct clk_freq_tbl clk_tbl_cam[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 2532 | F_CAM( 0, gnd, 1, 0, 0), |
| 2533 | F_CAM( 6000000, pll8, 4, 1, 16), |
| 2534 | F_CAM( 8000000, pll8, 4, 1, 12), |
| 2535 | F_CAM( 12000000, pll8, 4, 1, 8), |
| 2536 | F_CAM( 16000000, pll8, 4, 1, 6), |
| 2537 | F_CAM( 19200000, pll8, 4, 1, 5), |
| 2538 | F_CAM( 24000000, pll8, 4, 1, 4), |
| 2539 | F_CAM( 32000000, pll8, 4, 1, 3), |
| 2540 | F_CAM( 48000000, pll8, 4, 1, 2), |
| 2541 | F_CAM( 64000000, pll8, 3, 1, 2), |
| 2542 | F_CAM( 96000000, pll8, 4, 0, 0), |
| 2543 | F_CAM(128000000, pll8, 3, 0, 0), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2544 | F_END |
| 2545 | }; |
| 2546 | |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 2547 | static CLK_CAM(cam0_clk, 0, 15); |
| 2548 | static CLK_CAM(cam1_clk, 1, 16); |
| 2549 | static CLK_CAM(cam2_clk, 2, 31); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2550 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 2551 | #define F_CSI(f, s, d, m, n) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2552 | { \ |
| 2553 | .freq_hz = f, \ |
| 2554 | .src_clk = &s##_clk.c, \ |
| 2555 | .md_val = MD8(8, m, 0, n), \ |
| 2556 | .ns_val = NS_MM(31, 24, n, m, 15, 14, d, 2, 0, s##_to_mm_mux), \ |
| 2557 | .ctl_val = CC(6, n), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2558 | } |
| 2559 | static struct clk_freq_tbl clk_tbl_csi[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 2560 | F_CSI( 0, gnd, 1, 0, 0), |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 2561 | F_CSI( 27000000, pxo, 1, 0, 0), |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 2562 | F_CSI( 85330000, pll8, 1, 2, 9), |
| 2563 | F_CSI(177780000, pll2, 1, 2, 9), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2564 | F_END |
| 2565 | }; |
| 2566 | |
| 2567 | static struct rcg_clk csi0_src_clk = { |
| 2568 | .ns_reg = CSI0_NS_REG, |
| 2569 | .b = { |
| 2570 | .ctl_reg = CSI0_CC_REG, |
| 2571 | .halt_check = NOCHECK, |
| 2572 | }, |
| 2573 | .md_reg = CSI0_MD_REG, |
| 2574 | .root_en_mask = BIT(2), |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 2575 | .ns_mask = BM(31, 24) | BM(15, 14) | BM(2, 0), |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame] | 2576 | .mnd_en_mask = BIT(5), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2577 | .ctl_mask = BM(7, 6), |
| 2578 | .set_rate = set_rate_mnd, |
| 2579 | .freq_tbl = clk_tbl_csi, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 2580 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2581 | .c = { |
| 2582 | .dbg_name = "csi0_src_clk", |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 2583 | .ops = &clk_ops_rcg_8960, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 2584 | VDD_DIG_FMAX_MAP2(LOW, 86000000, NOMINAL, 178000000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2585 | CLK_INIT(csi0_src_clk.c), |
| 2586 | }, |
| 2587 | }; |
| 2588 | |
| 2589 | static struct branch_clk csi0_clk = { |
| 2590 | .b = { |
| 2591 | .ctl_reg = CSI0_CC_REG, |
| 2592 | .en_mask = BIT(0), |
| 2593 | .reset_reg = SW_RESET_CORE_REG, |
| 2594 | .reset_mask = BIT(8), |
| 2595 | .halt_reg = DBG_BUS_VEC_B_REG, |
| 2596 | .halt_bit = 13, |
| 2597 | }, |
| 2598 | .parent = &csi0_src_clk.c, |
| 2599 | .c = { |
| 2600 | .dbg_name = "csi0_clk", |
| 2601 | .ops = &clk_ops_branch, |
| 2602 | CLK_INIT(csi0_clk.c), |
| 2603 | }, |
| 2604 | }; |
| 2605 | |
| 2606 | static struct branch_clk csi0_phy_clk = { |
| 2607 | .b = { |
| 2608 | .ctl_reg = CSI0_CC_REG, |
| 2609 | .en_mask = BIT(8), |
| 2610 | .reset_reg = SW_RESET_CORE_REG, |
| 2611 | .reset_mask = BIT(29), |
| 2612 | .halt_reg = DBG_BUS_VEC_I_REG, |
| 2613 | .halt_bit = 9, |
| 2614 | }, |
| 2615 | .parent = &csi0_src_clk.c, |
| 2616 | .c = { |
| 2617 | .dbg_name = "csi0_phy_clk", |
| 2618 | .ops = &clk_ops_branch, |
| 2619 | CLK_INIT(csi0_phy_clk.c), |
| 2620 | }, |
| 2621 | }; |
| 2622 | |
| 2623 | static struct rcg_clk csi1_src_clk = { |
| 2624 | .ns_reg = CSI1_NS_REG, |
| 2625 | .b = { |
| 2626 | .ctl_reg = CSI1_CC_REG, |
| 2627 | .halt_check = NOCHECK, |
| 2628 | }, |
| 2629 | .md_reg = CSI1_MD_REG, |
| 2630 | .root_en_mask = BIT(2), |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 2631 | .ns_mask = BM(31, 24) | BM(15, 14) | BM(2, 0), |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame] | 2632 | .mnd_en_mask = BIT(5), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2633 | .ctl_mask = BM(7, 6), |
| 2634 | .set_rate = set_rate_mnd, |
| 2635 | .freq_tbl = clk_tbl_csi, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 2636 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2637 | .c = { |
| 2638 | .dbg_name = "csi1_src_clk", |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 2639 | .ops = &clk_ops_rcg_8960, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 2640 | VDD_DIG_FMAX_MAP2(LOW, 86000000, NOMINAL, 178000000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2641 | CLK_INIT(csi1_src_clk.c), |
| 2642 | }, |
| 2643 | }; |
| 2644 | |
| 2645 | static struct branch_clk csi1_clk = { |
| 2646 | .b = { |
| 2647 | .ctl_reg = CSI1_CC_REG, |
| 2648 | .en_mask = BIT(0), |
| 2649 | .reset_reg = SW_RESET_CORE_REG, |
| 2650 | .reset_mask = BIT(18), |
| 2651 | .halt_reg = DBG_BUS_VEC_B_REG, |
| 2652 | .halt_bit = 14, |
| 2653 | }, |
| 2654 | .parent = &csi1_src_clk.c, |
| 2655 | .c = { |
| 2656 | .dbg_name = "csi1_clk", |
| 2657 | .ops = &clk_ops_branch, |
| 2658 | CLK_INIT(csi1_clk.c), |
| 2659 | }, |
| 2660 | }; |
| 2661 | |
| 2662 | static struct branch_clk csi1_phy_clk = { |
| 2663 | .b = { |
| 2664 | .ctl_reg = CSI1_CC_REG, |
| 2665 | .en_mask = BIT(8), |
| 2666 | .reset_reg = SW_RESET_CORE_REG, |
| 2667 | .reset_mask = BIT(28), |
| 2668 | .halt_reg = DBG_BUS_VEC_I_REG, |
| 2669 | .halt_bit = 10, |
| 2670 | }, |
| 2671 | .parent = &csi1_src_clk.c, |
| 2672 | .c = { |
| 2673 | .dbg_name = "csi1_phy_clk", |
| 2674 | .ops = &clk_ops_branch, |
| 2675 | CLK_INIT(csi1_phy_clk.c), |
| 2676 | }, |
| 2677 | }; |
| 2678 | |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 2679 | static struct rcg_clk csi2_src_clk = { |
| 2680 | .ns_reg = CSI2_NS_REG, |
| 2681 | .b = { |
| 2682 | .ctl_reg = CSI2_CC_REG, |
| 2683 | .halt_check = NOCHECK, |
| 2684 | }, |
| 2685 | .md_reg = CSI2_MD_REG, |
| 2686 | .root_en_mask = BIT(2), |
| 2687 | .ns_mask = BM(31, 24) | BM(15, 14) | BM(2, 0), |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame] | 2688 | .mnd_en_mask = BIT(5), |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 2689 | .ctl_mask = BM(7, 6), |
| 2690 | .set_rate = set_rate_mnd, |
| 2691 | .freq_tbl = clk_tbl_csi, |
| 2692 | .current_freq = &rcg_dummy_freq, |
| 2693 | .c = { |
| 2694 | .dbg_name = "csi2_src_clk", |
| 2695 | .ops = &clk_ops_rcg_8960, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 2696 | VDD_DIG_FMAX_MAP2(LOW, 86000000, NOMINAL, 178000000), |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 2697 | CLK_INIT(csi2_src_clk.c), |
| 2698 | }, |
| 2699 | }; |
| 2700 | |
| 2701 | static struct branch_clk csi2_clk = { |
| 2702 | .b = { |
| 2703 | .ctl_reg = CSI2_CC_REG, |
| 2704 | .en_mask = BIT(0), |
| 2705 | .reset_reg = SW_RESET_CORE2_REG, |
| 2706 | .reset_mask = BIT(2), |
| 2707 | .halt_reg = DBG_BUS_VEC_B_REG, |
| 2708 | .halt_bit = 29, |
| 2709 | }, |
| 2710 | .parent = &csi2_src_clk.c, |
| 2711 | .c = { |
| 2712 | .dbg_name = "csi2_clk", |
| 2713 | .ops = &clk_ops_branch, |
| 2714 | CLK_INIT(csi2_clk.c), |
| 2715 | }, |
| 2716 | }; |
| 2717 | |
| 2718 | static struct branch_clk csi2_phy_clk = { |
| 2719 | .b = { |
| 2720 | .ctl_reg = CSI2_CC_REG, |
| 2721 | .en_mask = BIT(8), |
| 2722 | .reset_reg = SW_RESET_CORE_REG, |
| 2723 | .reset_mask = BIT(31), |
| 2724 | .halt_reg = DBG_BUS_VEC_I_REG, |
| 2725 | .halt_bit = 29, |
| 2726 | }, |
| 2727 | .parent = &csi2_src_clk.c, |
| 2728 | .c = { |
| 2729 | .dbg_name = "csi2_phy_clk", |
| 2730 | .ops = &clk_ops_branch, |
| 2731 | CLK_INIT(csi2_phy_clk.c), |
| 2732 | }, |
| 2733 | }; |
| 2734 | |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 2735 | static struct clk *pix_rdi_mux_map[] = { |
| 2736 | [0] = &csi0_clk.c, |
| 2737 | [1] = &csi1_clk.c, |
| 2738 | [2] = &csi2_clk.c, |
| 2739 | NULL, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2740 | }; |
| 2741 | |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 2742 | struct pix_rdi_clk { |
| 2743 | bool enabled; |
Matt Wagantall | 9de3bfb | 2011-11-03 20:13:12 -0700 | [diff] [blame] | 2744 | unsigned long cur_rate; |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 2745 | |
| 2746 | void __iomem *const s_reg; |
| 2747 | u32 s_mask; |
| 2748 | |
| 2749 | void __iomem *const s2_reg; |
| 2750 | u32 s2_mask; |
| 2751 | |
| 2752 | struct branch b; |
| 2753 | struct clk c; |
| 2754 | }; |
| 2755 | |
| 2756 | static inline struct pix_rdi_clk *to_pix_rdi_clk(struct clk *clk) |
| 2757 | { |
| 2758 | return container_of(clk, struct pix_rdi_clk, c); |
| 2759 | } |
| 2760 | |
Matt Wagantall | 9de3bfb | 2011-11-03 20:13:12 -0700 | [diff] [blame] | 2761 | static int pix_rdi_clk_set_rate(struct clk *c, unsigned long rate) |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 2762 | { |
| 2763 | int ret, i; |
| 2764 | u32 reg; |
| 2765 | unsigned long flags; |
| 2766 | struct pix_rdi_clk *clk = to_pix_rdi_clk(c); |
| 2767 | struct clk **mux_map = pix_rdi_mux_map; |
| 2768 | |
| 2769 | /* |
| 2770 | * These clocks select three inputs via two muxes. One mux selects |
| 2771 | * between csi0 and csi1 and the second mux selects between that mux's |
| 2772 | * output and csi2. The source and destination selections for each |
| 2773 | * mux must be clocking for the switch to succeed so just turn on |
| 2774 | * all three sources because it's easier than figuring out what source |
| 2775 | * needs to be on at what time. |
| 2776 | */ |
| 2777 | for (i = 0; mux_map[i]; i++) { |
| 2778 | ret = clk_enable(mux_map[i]); |
| 2779 | if (ret) |
| 2780 | goto err; |
| 2781 | } |
| 2782 | if (rate >= i) { |
| 2783 | ret = -EINVAL; |
| 2784 | goto err; |
| 2785 | } |
| 2786 | /* Keep the new source on when switching inputs of an enabled clock */ |
| 2787 | if (clk->enabled) { |
| 2788 | clk_disable(mux_map[clk->cur_rate]); |
| 2789 | clk_enable(mux_map[rate]); |
| 2790 | } |
| 2791 | spin_lock_irqsave(&local_clock_reg_lock, flags); |
| 2792 | reg = readl_relaxed(clk->s2_reg); |
| 2793 | reg &= ~clk->s2_mask; |
| 2794 | reg |= rate == 2 ? clk->s2_mask : 0; |
| 2795 | writel_relaxed(reg, clk->s2_reg); |
| 2796 | /* |
| 2797 | * Wait at least 6 cycles of slowest clock |
| 2798 | * for the glitch-free MUX to fully switch sources. |
| 2799 | */ |
| 2800 | mb(); |
| 2801 | udelay(1); |
| 2802 | reg = readl_relaxed(clk->s_reg); |
| 2803 | reg &= ~clk->s_mask; |
| 2804 | reg |= rate == 1 ? clk->s_mask : 0; |
| 2805 | writel_relaxed(reg, clk->s_reg); |
| 2806 | /* |
| 2807 | * Wait at least 6 cycles of slowest clock |
| 2808 | * for the glitch-free MUX to fully switch sources. |
| 2809 | */ |
| 2810 | mb(); |
| 2811 | udelay(1); |
| 2812 | clk->cur_rate = rate; |
| 2813 | spin_unlock_irqrestore(&local_clock_reg_lock, flags); |
| 2814 | err: |
| 2815 | for (i--; i >= 0; i--) |
| 2816 | clk_disable(mux_map[i]); |
| 2817 | |
| 2818 | return 0; |
| 2819 | } |
| 2820 | |
Matt Wagantall | 9de3bfb | 2011-11-03 20:13:12 -0700 | [diff] [blame] | 2821 | static unsigned long pix_rdi_clk_get_rate(struct clk *c) |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 2822 | { |
| 2823 | return to_pix_rdi_clk(c)->cur_rate; |
| 2824 | } |
| 2825 | |
| 2826 | static int pix_rdi_clk_enable(struct clk *c) |
| 2827 | { |
| 2828 | unsigned long flags; |
| 2829 | struct pix_rdi_clk *clk = to_pix_rdi_clk(c); |
| 2830 | |
| 2831 | spin_lock_irqsave(&local_clock_reg_lock, flags); |
| 2832 | __branch_clk_enable_reg(&clk->b, clk->c.dbg_name); |
| 2833 | spin_unlock_irqrestore(&local_clock_reg_lock, flags); |
| 2834 | clk->enabled = true; |
| 2835 | |
| 2836 | return 0; |
| 2837 | } |
| 2838 | |
| 2839 | static void pix_rdi_clk_disable(struct clk *c) |
| 2840 | { |
| 2841 | unsigned long flags; |
| 2842 | struct pix_rdi_clk *clk = to_pix_rdi_clk(c); |
| 2843 | |
| 2844 | spin_lock_irqsave(&local_clock_reg_lock, flags); |
| 2845 | __branch_clk_disable_reg(&clk->b, clk->c.dbg_name); |
| 2846 | spin_unlock_irqrestore(&local_clock_reg_lock, flags); |
| 2847 | clk->enabled = false; |
| 2848 | } |
| 2849 | |
| 2850 | static int pix_rdi_clk_reset(struct clk *clk, enum clk_reset_action action) |
| 2851 | { |
| 2852 | return branch_reset(&to_pix_rdi_clk(clk)->b, action); |
| 2853 | } |
| 2854 | |
| 2855 | static struct clk *pix_rdi_clk_get_parent(struct clk *c) |
| 2856 | { |
| 2857 | struct pix_rdi_clk *clk = to_pix_rdi_clk(c); |
| 2858 | |
| 2859 | return pix_rdi_mux_map[clk->cur_rate]; |
| 2860 | } |
| 2861 | |
| 2862 | static int pix_rdi_clk_list_rate(struct clk *c, unsigned n) |
| 2863 | { |
| 2864 | if (pix_rdi_mux_map[n]) |
| 2865 | return n; |
| 2866 | return -ENXIO; |
| 2867 | } |
| 2868 | |
Matt Wagantall | a15833b | 2012-04-03 11:00:56 -0700 | [diff] [blame^] | 2869 | static enum handoff pix_rdi_clk_handoff(struct clk *c) |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 2870 | { |
| 2871 | u32 reg; |
| 2872 | struct pix_rdi_clk *clk = to_pix_rdi_clk(c); |
Matt Wagantall | a15833b | 2012-04-03 11:00:56 -0700 | [diff] [blame^] | 2873 | enum handoff ret; |
| 2874 | |
| 2875 | ret = branch_handoff(&clk->b, &clk->c); |
| 2876 | if (ret == HANDOFF_DISABLED_CLK) |
| 2877 | return ret; |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 2878 | |
| 2879 | reg = readl_relaxed(clk->s_reg); |
| 2880 | clk->cur_rate = reg & clk->s_mask ? 1 : 0; |
| 2881 | reg = readl_relaxed(clk->s2_reg); |
| 2882 | clk->cur_rate = reg & clk->s2_mask ? 2 : clk->cur_rate; |
Matt Wagantall | a15833b | 2012-04-03 11:00:56 -0700 | [diff] [blame^] | 2883 | |
| 2884 | return HANDOFF_ENABLED_CLK; |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 2885 | } |
| 2886 | |
| 2887 | static struct clk_ops clk_ops_pix_rdi_8960 = { |
| 2888 | .enable = pix_rdi_clk_enable, |
| 2889 | .disable = pix_rdi_clk_disable, |
| 2890 | .auto_off = pix_rdi_clk_disable, |
| 2891 | .handoff = pix_rdi_clk_handoff, |
| 2892 | .set_rate = pix_rdi_clk_set_rate, |
| 2893 | .get_rate = pix_rdi_clk_get_rate, |
| 2894 | .list_rate = pix_rdi_clk_list_rate, |
| 2895 | .reset = pix_rdi_clk_reset, |
| 2896 | .is_local = local_clk_is_local, |
| 2897 | .get_parent = pix_rdi_clk_get_parent, |
| 2898 | }; |
| 2899 | |
| 2900 | static struct pix_rdi_clk csi_pix_clk = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2901 | .b = { |
| 2902 | .ctl_reg = MISC_CC_REG, |
| 2903 | .en_mask = BIT(26), |
| 2904 | .halt_check = DELAY, |
| 2905 | .reset_reg = SW_RESET_CORE_REG, |
| 2906 | .reset_mask = BIT(26), |
| 2907 | }, |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 2908 | .s_reg = MISC_CC_REG, |
| 2909 | .s_mask = BIT(25), |
| 2910 | .s2_reg = MISC_CC3_REG, |
| 2911 | .s2_mask = BIT(13), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2912 | .c = { |
| 2913 | .dbg_name = "csi_pix_clk", |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 2914 | .ops = &clk_ops_pix_rdi_8960, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2915 | CLK_INIT(csi_pix_clk.c), |
| 2916 | }, |
| 2917 | }; |
| 2918 | |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 2919 | static struct pix_rdi_clk csi_pix1_clk = { |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 2920 | .b = { |
| 2921 | .ctl_reg = MISC_CC3_REG, |
| 2922 | .en_mask = BIT(10), |
| 2923 | .halt_check = DELAY, |
| 2924 | .reset_reg = SW_RESET_CORE_REG, |
| 2925 | .reset_mask = BIT(30), |
| 2926 | }, |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 2927 | .s_reg = MISC_CC3_REG, |
| 2928 | .s_mask = BIT(8), |
| 2929 | .s2_reg = MISC_CC3_REG, |
| 2930 | .s2_mask = BIT(9), |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 2931 | .c = { |
| 2932 | .dbg_name = "csi_pix1_clk", |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 2933 | .ops = &clk_ops_pix_rdi_8960, |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 2934 | CLK_INIT(csi_pix1_clk.c), |
| 2935 | }, |
| 2936 | }; |
| 2937 | |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 2938 | static struct pix_rdi_clk csi_rdi_clk = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2939 | .b = { |
| 2940 | .ctl_reg = MISC_CC_REG, |
| 2941 | .en_mask = BIT(13), |
| 2942 | .halt_check = DELAY, |
| 2943 | .reset_reg = SW_RESET_CORE_REG, |
| 2944 | .reset_mask = BIT(27), |
| 2945 | }, |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 2946 | .s_reg = MISC_CC_REG, |
| 2947 | .s_mask = BIT(12), |
| 2948 | .s2_reg = MISC_CC3_REG, |
| 2949 | .s2_mask = BIT(12), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2950 | .c = { |
| 2951 | .dbg_name = "csi_rdi_clk", |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 2952 | .ops = &clk_ops_pix_rdi_8960, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2953 | CLK_INIT(csi_rdi_clk.c), |
| 2954 | }, |
| 2955 | }; |
| 2956 | |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 2957 | static struct pix_rdi_clk csi_rdi1_clk = { |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 2958 | .b = { |
| 2959 | .ctl_reg = MISC_CC3_REG, |
| 2960 | .en_mask = BIT(2), |
| 2961 | .halt_check = DELAY, |
| 2962 | .reset_reg = SW_RESET_CORE2_REG, |
| 2963 | .reset_mask = BIT(1), |
| 2964 | }, |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 2965 | .s_reg = MISC_CC3_REG, |
| 2966 | .s_mask = BIT(0), |
| 2967 | .s2_reg = MISC_CC3_REG, |
| 2968 | .s2_mask = BIT(1), |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 2969 | .c = { |
| 2970 | .dbg_name = "csi_rdi1_clk", |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 2971 | .ops = &clk_ops_pix_rdi_8960, |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 2972 | CLK_INIT(csi_rdi1_clk.c), |
| 2973 | }, |
| 2974 | }; |
| 2975 | |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 2976 | static struct pix_rdi_clk csi_rdi2_clk = { |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 2977 | .b = { |
| 2978 | .ctl_reg = MISC_CC3_REG, |
| 2979 | .en_mask = BIT(6), |
| 2980 | .halt_check = DELAY, |
| 2981 | .reset_reg = SW_RESET_CORE2_REG, |
| 2982 | .reset_mask = BIT(0), |
| 2983 | }, |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 2984 | .s_reg = MISC_CC3_REG, |
| 2985 | .s_mask = BIT(4), |
| 2986 | .s2_reg = MISC_CC3_REG, |
| 2987 | .s2_mask = BIT(5), |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 2988 | .c = { |
| 2989 | .dbg_name = "csi_rdi2_clk", |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 2990 | .ops = &clk_ops_pix_rdi_8960, |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 2991 | CLK_INIT(csi_rdi2_clk.c), |
| 2992 | }, |
| 2993 | }; |
| 2994 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 2995 | #define F_CSI_PHYTIMER(f, s, d, m, n) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2996 | { \ |
| 2997 | .freq_hz = f, \ |
| 2998 | .src_clk = &s##_clk.c, \ |
| 2999 | .md_val = MD8(8, m, 0, n), \ |
| 3000 | .ns_val = NS_MM(31, 24, n, m, 15, 14, d, 2, 0, s##_to_mm_mux), \ |
| 3001 | .ctl_val = CC(6, n), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3002 | } |
| 3003 | static struct clk_freq_tbl clk_tbl_csi_phytimer[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3004 | F_CSI_PHYTIMER( 0, gnd, 1, 0, 0), |
| 3005 | F_CSI_PHYTIMER( 85330000, pll8, 1, 2, 9), |
| 3006 | F_CSI_PHYTIMER(177780000, pll2, 1, 2, 9), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3007 | F_END |
| 3008 | }; |
| 3009 | |
| 3010 | static struct rcg_clk csiphy_timer_src_clk = { |
| 3011 | .ns_reg = CSIPHYTIMER_NS_REG, |
| 3012 | .b = { |
| 3013 | .ctl_reg = CSIPHYTIMER_CC_REG, |
| 3014 | .halt_check = NOCHECK, |
| 3015 | }, |
| 3016 | .md_reg = CSIPHYTIMER_MD_REG, |
| 3017 | .root_en_mask = BIT(2), |
| 3018 | .ns_mask = (BM(31, 24) | BM(15, 14) | BM(2, 0)), |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame] | 3019 | .mnd_en_mask = BIT(5), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3020 | .ctl_mask = BM(7, 6), |
| 3021 | .set_rate = set_rate_mnd_8, |
| 3022 | .freq_tbl = clk_tbl_csi_phytimer, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 3023 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3024 | .c = { |
| 3025 | .dbg_name = "csiphy_timer_src_clk", |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 3026 | .ops = &clk_ops_rcg_8960, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3027 | VDD_DIG_FMAX_MAP2(LOW, 86000000, NOMINAL, 178000000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3028 | CLK_INIT(csiphy_timer_src_clk.c), |
| 3029 | }, |
| 3030 | }; |
| 3031 | |
| 3032 | static struct branch_clk csi0phy_timer_clk = { |
| 3033 | .b = { |
| 3034 | .ctl_reg = CSIPHYTIMER_CC_REG, |
| 3035 | .en_mask = BIT(0), |
| 3036 | .halt_reg = DBG_BUS_VEC_I_REG, |
| 3037 | .halt_bit = 17, |
| 3038 | }, |
| 3039 | .parent = &csiphy_timer_src_clk.c, |
| 3040 | .c = { |
| 3041 | .dbg_name = "csi0phy_timer_clk", |
| 3042 | .ops = &clk_ops_branch, |
| 3043 | CLK_INIT(csi0phy_timer_clk.c), |
| 3044 | }, |
| 3045 | }; |
| 3046 | |
| 3047 | static struct branch_clk csi1phy_timer_clk = { |
| 3048 | .b = { |
| 3049 | .ctl_reg = CSIPHYTIMER_CC_REG, |
| 3050 | .en_mask = BIT(9), |
| 3051 | .halt_reg = DBG_BUS_VEC_I_REG, |
| 3052 | .halt_bit = 18, |
| 3053 | }, |
| 3054 | .parent = &csiphy_timer_src_clk.c, |
| 3055 | .c = { |
| 3056 | .dbg_name = "csi1phy_timer_clk", |
| 3057 | .ops = &clk_ops_branch, |
| 3058 | CLK_INIT(csi1phy_timer_clk.c), |
| 3059 | }, |
| 3060 | }; |
| 3061 | |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 3062 | static struct branch_clk csi2phy_timer_clk = { |
| 3063 | .b = { |
| 3064 | .ctl_reg = CSIPHYTIMER_CC_REG, |
| 3065 | .en_mask = BIT(11), |
| 3066 | .halt_reg = DBG_BUS_VEC_I_REG, |
| 3067 | .halt_bit = 30, |
| 3068 | }, |
| 3069 | .parent = &csiphy_timer_src_clk.c, |
| 3070 | .c = { |
| 3071 | .dbg_name = "csi2phy_timer_clk", |
| 3072 | .ops = &clk_ops_branch, |
| 3073 | CLK_INIT(csi2phy_timer_clk.c), |
| 3074 | }, |
| 3075 | }; |
| 3076 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3077 | #define F_DSI(d) \ |
| 3078 | { \ |
| 3079 | .freq_hz = d, \ |
| 3080 | .ns_val = BVAL(15, 12, (d-1)), \ |
| 3081 | } |
| 3082 | /* |
| 3083 | * The DSI_BYTE/ESC clock is sourced from the DSI PHY PLL, which may change rate |
| 3084 | * without this clock driver knowing. So, overload the clk_set_rate() to set |
| 3085 | * the divider (1 to 16) of the clock with respect to the PLL rate. |
| 3086 | */ |
| 3087 | static struct clk_freq_tbl clk_tbl_dsi_byte[] = { |
| 3088 | F_DSI(1), F_DSI(2), F_DSI(3), F_DSI(4), |
| 3089 | F_DSI(5), F_DSI(6), F_DSI(7), F_DSI(8), |
| 3090 | F_DSI(9), F_DSI(10), F_DSI(11), F_DSI(12), |
| 3091 | F_DSI(13), F_DSI(14), F_DSI(15), F_DSI(16), |
| 3092 | F_END |
| 3093 | }; |
| 3094 | |
| 3095 | static struct rcg_clk dsi1_byte_clk = { |
| 3096 | .b = { |
| 3097 | .ctl_reg = DSI1_BYTE_CC_REG, |
| 3098 | .en_mask = BIT(0), |
| 3099 | .reset_reg = SW_RESET_CORE_REG, |
| 3100 | .reset_mask = BIT(7), |
| 3101 | .halt_reg = DBG_BUS_VEC_B_REG, |
| 3102 | .halt_bit = 21, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 3103 | .retain_reg = DSI1_BYTE_CC_REG, |
| 3104 | .retain_mask = BIT(31), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3105 | }, |
| 3106 | .ns_reg = DSI1_BYTE_NS_REG, |
| 3107 | .root_en_mask = BIT(2), |
| 3108 | .ns_mask = BM(15, 12), |
| 3109 | .set_rate = set_rate_nop, |
| 3110 | .freq_tbl = clk_tbl_dsi_byte, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 3111 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3112 | .c = { |
| 3113 | .dbg_name = "dsi1_byte_clk", |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 3114 | .ops = &clk_ops_rcg_8960, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3115 | CLK_INIT(dsi1_byte_clk.c), |
| 3116 | }, |
| 3117 | }; |
| 3118 | |
| 3119 | static struct rcg_clk dsi2_byte_clk = { |
| 3120 | .b = { |
| 3121 | .ctl_reg = DSI2_BYTE_CC_REG, |
| 3122 | .en_mask = BIT(0), |
| 3123 | .reset_reg = SW_RESET_CORE_REG, |
| 3124 | .reset_mask = BIT(25), |
| 3125 | .halt_reg = DBG_BUS_VEC_B_REG, |
| 3126 | .halt_bit = 20, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 3127 | .retain_reg = DSI2_BYTE_CC_REG, |
| 3128 | .retain_mask = BIT(31), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3129 | }, |
| 3130 | .ns_reg = DSI2_BYTE_NS_REG, |
| 3131 | .root_en_mask = BIT(2), |
| 3132 | .ns_mask = BM(15, 12), |
| 3133 | .set_rate = set_rate_nop, |
| 3134 | .freq_tbl = clk_tbl_dsi_byte, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 3135 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3136 | .c = { |
| 3137 | .dbg_name = "dsi2_byte_clk", |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 3138 | .ops = &clk_ops_rcg_8960, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3139 | CLK_INIT(dsi2_byte_clk.c), |
| 3140 | }, |
| 3141 | }; |
| 3142 | |
| 3143 | static struct rcg_clk dsi1_esc_clk = { |
| 3144 | .b = { |
| 3145 | .ctl_reg = DSI1_ESC_CC_REG, |
| 3146 | .en_mask = BIT(0), |
| 3147 | .reset_reg = SW_RESET_CORE_REG, |
| 3148 | .halt_reg = DBG_BUS_VEC_I_REG, |
| 3149 | .halt_bit = 1, |
| 3150 | }, |
| 3151 | .ns_reg = DSI1_ESC_NS_REG, |
| 3152 | .root_en_mask = BIT(2), |
| 3153 | .ns_mask = BM(15, 12), |
| 3154 | .set_rate = set_rate_nop, |
| 3155 | .freq_tbl = clk_tbl_dsi_byte, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 3156 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3157 | .c = { |
| 3158 | .dbg_name = "dsi1_esc_clk", |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 3159 | .ops = &clk_ops_rcg_8960, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3160 | CLK_INIT(dsi1_esc_clk.c), |
| 3161 | }, |
| 3162 | }; |
| 3163 | |
| 3164 | static struct rcg_clk dsi2_esc_clk = { |
| 3165 | .b = { |
| 3166 | .ctl_reg = DSI2_ESC_CC_REG, |
| 3167 | .en_mask = BIT(0), |
| 3168 | .halt_reg = DBG_BUS_VEC_I_REG, |
| 3169 | .halt_bit = 3, |
| 3170 | }, |
| 3171 | .ns_reg = DSI2_ESC_NS_REG, |
| 3172 | .root_en_mask = BIT(2), |
| 3173 | .ns_mask = BM(15, 12), |
| 3174 | .set_rate = set_rate_nop, |
| 3175 | .freq_tbl = clk_tbl_dsi_byte, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 3176 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3177 | .c = { |
| 3178 | .dbg_name = "dsi2_esc_clk", |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 3179 | .ops = &clk_ops_rcg_8960, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3180 | CLK_INIT(dsi2_esc_clk.c), |
| 3181 | }, |
| 3182 | }; |
| 3183 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3184 | #define F_GFX2D(f, s, m, n) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3185 | { \ |
| 3186 | .freq_hz = f, \ |
| 3187 | .src_clk = &s##_clk.c, \ |
| 3188 | .md_val = MD4(4, m, 0, n), \ |
| 3189 | .ns_val = NS_MND_BANKED4(20, 16, n, m, 3, 0, s##_to_mm_mux), \ |
| 3190 | .ctl_val = CC_BANKED(9, 6, n), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3191 | } |
| 3192 | static struct clk_freq_tbl clk_tbl_gfx2d[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3193 | F_GFX2D( 0, gnd, 0, 0), |
| 3194 | F_GFX2D( 27000000, pxo, 0, 0), |
| 3195 | F_GFX2D( 48000000, pll8, 1, 8), |
| 3196 | F_GFX2D( 54857000, pll8, 1, 7), |
| 3197 | F_GFX2D( 64000000, pll8, 1, 6), |
| 3198 | F_GFX2D( 76800000, pll8, 1, 5), |
| 3199 | F_GFX2D( 96000000, pll8, 1, 4), |
| 3200 | F_GFX2D(128000000, pll8, 1, 3), |
| 3201 | F_GFX2D(145455000, pll2, 2, 11), |
| 3202 | F_GFX2D(160000000, pll2, 1, 5), |
| 3203 | F_GFX2D(177778000, pll2, 2, 9), |
| 3204 | F_GFX2D(200000000, pll2, 1, 4), |
| 3205 | F_GFX2D(228571000, pll2, 2, 7), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3206 | F_END |
| 3207 | }; |
| 3208 | |
| 3209 | static struct bank_masks bmnd_info_gfx2d0 = { |
| 3210 | .bank_sel_mask = BIT(11), |
| 3211 | .bank0_mask = { |
| 3212 | .md_reg = GFX2D0_MD0_REG, |
| 3213 | .ns_mask = BM(23, 20) | BM(5, 3), |
| 3214 | .rst_mask = BIT(25), |
| 3215 | .mnd_en_mask = BIT(8), |
| 3216 | .mode_mask = BM(10, 9), |
| 3217 | }, |
| 3218 | .bank1_mask = { |
| 3219 | .md_reg = GFX2D0_MD1_REG, |
| 3220 | .ns_mask = BM(19, 16) | BM(2, 0), |
| 3221 | .rst_mask = BIT(24), |
| 3222 | .mnd_en_mask = BIT(5), |
| 3223 | .mode_mask = BM(7, 6), |
| 3224 | }, |
| 3225 | }; |
| 3226 | |
| 3227 | static struct rcg_clk gfx2d0_clk = { |
| 3228 | .b = { |
| 3229 | .ctl_reg = GFX2D0_CC_REG, |
| 3230 | .en_mask = BIT(0), |
| 3231 | .reset_reg = SW_RESET_CORE_REG, |
| 3232 | .reset_mask = BIT(14), |
| 3233 | .halt_reg = DBG_BUS_VEC_A_REG, |
| 3234 | .halt_bit = 9, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 3235 | .retain_reg = GFX2D0_CC_REG, |
| 3236 | .retain_mask = BIT(31), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3237 | }, |
| 3238 | .ns_reg = GFX2D0_NS_REG, |
| 3239 | .root_en_mask = BIT(2), |
| 3240 | .set_rate = set_rate_mnd_banked, |
| 3241 | .freq_tbl = clk_tbl_gfx2d, |
Stephen Boyd | c78d9a7 | 2011-07-20 00:46:24 -0700 | [diff] [blame] | 3242 | .bank_info = &bmnd_info_gfx2d0, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 3243 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3244 | .c = { |
| 3245 | .dbg_name = "gfx2d0_clk", |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 3246 | .ops = &clk_ops_rcg_8960, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3247 | VDD_DIG_FMAX_MAP3(LOW, 100000000, NOMINAL, 200000000, |
| 3248 | HIGH, 228571000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3249 | CLK_INIT(gfx2d0_clk.c), |
| 3250 | }, |
| 3251 | }; |
| 3252 | |
| 3253 | static struct bank_masks bmnd_info_gfx2d1 = { |
| 3254 | .bank_sel_mask = BIT(11), |
| 3255 | .bank0_mask = { |
| 3256 | .md_reg = GFX2D1_MD0_REG, |
| 3257 | .ns_mask = BM(23, 20) | BM(5, 3), |
| 3258 | .rst_mask = BIT(25), |
| 3259 | .mnd_en_mask = BIT(8), |
| 3260 | .mode_mask = BM(10, 9), |
| 3261 | }, |
| 3262 | .bank1_mask = { |
| 3263 | .md_reg = GFX2D1_MD1_REG, |
| 3264 | .ns_mask = BM(19, 16) | BM(2, 0), |
| 3265 | .rst_mask = BIT(24), |
| 3266 | .mnd_en_mask = BIT(5), |
| 3267 | .mode_mask = BM(7, 6), |
| 3268 | }, |
| 3269 | }; |
| 3270 | |
| 3271 | static struct rcg_clk gfx2d1_clk = { |
| 3272 | .b = { |
| 3273 | .ctl_reg = GFX2D1_CC_REG, |
| 3274 | .en_mask = BIT(0), |
| 3275 | .reset_reg = SW_RESET_CORE_REG, |
| 3276 | .reset_mask = BIT(13), |
| 3277 | .halt_reg = DBG_BUS_VEC_A_REG, |
| 3278 | .halt_bit = 14, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 3279 | .retain_reg = GFX2D1_CC_REG, |
| 3280 | .retain_mask = BIT(31), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3281 | }, |
| 3282 | .ns_reg = GFX2D1_NS_REG, |
| 3283 | .root_en_mask = BIT(2), |
| 3284 | .set_rate = set_rate_mnd_banked, |
| 3285 | .freq_tbl = clk_tbl_gfx2d, |
Stephen Boyd | c78d9a7 | 2011-07-20 00:46:24 -0700 | [diff] [blame] | 3286 | .bank_info = &bmnd_info_gfx2d1, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 3287 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3288 | .c = { |
| 3289 | .dbg_name = "gfx2d1_clk", |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 3290 | .ops = &clk_ops_rcg_8960, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3291 | VDD_DIG_FMAX_MAP3(LOW, 100000000, NOMINAL, 200000000, |
| 3292 | HIGH, 228571000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3293 | CLK_INIT(gfx2d1_clk.c), |
| 3294 | }, |
| 3295 | }; |
| 3296 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3297 | #define F_GFX3D(f, s, m, n) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3298 | { \ |
| 3299 | .freq_hz = f, \ |
| 3300 | .src_clk = &s##_clk.c, \ |
| 3301 | .md_val = MD4(4, m, 0, n), \ |
| 3302 | .ns_val = NS_MND_BANKED4(18, 14, n, m, 3, 0, s##_to_mm_mux), \ |
| 3303 | .ctl_val = CC_BANKED(9, 6, n), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3304 | } |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 3305 | |
| 3306 | static struct clk_freq_tbl clk_tbl_gfx3d_8960[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3307 | F_GFX3D( 0, gnd, 0, 0), |
| 3308 | F_GFX3D( 27000000, pxo, 0, 0), |
| 3309 | F_GFX3D( 48000000, pll8, 1, 8), |
| 3310 | F_GFX3D( 54857000, pll8, 1, 7), |
| 3311 | F_GFX3D( 64000000, pll8, 1, 6), |
| 3312 | F_GFX3D( 76800000, pll8, 1, 5), |
| 3313 | F_GFX3D( 96000000, pll8, 1, 4), |
| 3314 | F_GFX3D(128000000, pll8, 1, 3), |
| 3315 | F_GFX3D(145455000, pll2, 2, 11), |
| 3316 | F_GFX3D(160000000, pll2, 1, 5), |
| 3317 | F_GFX3D(177778000, pll2, 2, 9), |
| 3318 | F_GFX3D(200000000, pll2, 1, 4), |
| 3319 | F_GFX3D(228571000, pll2, 2, 7), |
| 3320 | F_GFX3D(266667000, pll2, 1, 3), |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3321 | F_GFX3D(300000000, pll3, 1, 4), |
| 3322 | F_GFX3D(320000000, pll2, 2, 5), |
| 3323 | F_GFX3D(400000000, pll2, 1, 2), |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 3324 | F_END |
| 3325 | }; |
| 3326 | |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 3327 | static struct clk_freq_tbl clk_tbl_gfx3d_8064[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3328 | F_GFX3D( 0, gnd, 0, 0), |
| 3329 | F_GFX3D( 27000000, pxo, 0, 0), |
| 3330 | F_GFX3D( 48000000, pll8, 1, 8), |
| 3331 | F_GFX3D( 54857000, pll8, 1, 7), |
| 3332 | F_GFX3D( 64000000, pll8, 1, 6), |
| 3333 | F_GFX3D( 76800000, pll8, 1, 5), |
| 3334 | F_GFX3D( 96000000, pll8, 1, 4), |
| 3335 | F_GFX3D(128000000, pll8, 1, 3), |
| 3336 | F_GFX3D(145455000, pll2, 2, 11), |
| 3337 | F_GFX3D(160000000, pll2, 1, 5), |
| 3338 | F_GFX3D(177778000, pll2, 2, 9), |
| 3339 | F_GFX3D(200000000, pll2, 1, 4), |
| 3340 | F_GFX3D(228571000, pll2, 2, 7), |
| 3341 | F_GFX3D(266667000, pll2, 1, 3), |
Tianyi Gou | 0c50fe3 | 2011-10-19 15:50:35 -0700 | [diff] [blame] | 3342 | F_GFX3D(325000000, pll15, 1, 3), |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3343 | F_GFX3D(400000000, pll2, 1, 2), |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 3344 | F_END |
| 3345 | }; |
| 3346 | |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 3347 | static struct clk_freq_tbl clk_tbl_gfx3d_8930[] = { |
| 3348 | F_GFX3D( 0, gnd, 0, 0), |
| 3349 | F_GFX3D( 27000000, pxo, 0, 0), |
| 3350 | F_GFX3D( 48000000, pll8, 1, 8), |
| 3351 | F_GFX3D( 54857000, pll8, 1, 7), |
| 3352 | F_GFX3D( 64000000, pll8, 1, 6), |
| 3353 | F_GFX3D( 76800000, pll8, 1, 5), |
| 3354 | F_GFX3D( 96000000, pll8, 1, 4), |
| 3355 | F_GFX3D(128000000, pll8, 1, 3), |
| 3356 | F_GFX3D(145455000, pll2, 2, 11), |
| 3357 | F_GFX3D(160000000, pll2, 1, 5), |
| 3358 | F_GFX3D(177778000, pll2, 2, 9), |
Tianyi Gou | 4d33c9c | 2012-03-30 11:10:15 -0700 | [diff] [blame] | 3359 | F_GFX3D(192000000, pll8, 1, 2), |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 3360 | F_GFX3D(200000000, pll2, 1, 4), |
| 3361 | F_GFX3D(228571000, pll2, 2, 7), |
| 3362 | F_GFX3D(266667000, pll2, 1, 3), |
| 3363 | F_GFX3D(300000000, pll3, 1, 4), |
| 3364 | F_GFX3D(320000000, pll2, 2, 5), |
| 3365 | F_GFX3D(400000000, pll2, 1, 2), |
| 3366 | F_GFX3D(450000000, pll15, 1, 2), |
| 3367 | F_END |
| 3368 | }; |
| 3369 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3370 | static unsigned long fmax_gfx3d_8064[MAX_VDD_LEVELS] __initdata = { |
| 3371 | [VDD_DIG_LOW] = 128000000, |
| 3372 | [VDD_DIG_NOMINAL] = 325000000, |
| 3373 | [VDD_DIG_HIGH] = 400000000 |
| 3374 | }; |
| 3375 | |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 3376 | static unsigned long fmax_gfx3d_8930[MAX_VDD_LEVELS] __initdata = { |
Tianyi Gou | 4d33c9c | 2012-03-30 11:10:15 -0700 | [diff] [blame] | 3377 | [VDD_DIG_LOW] = 192000000, |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 3378 | [VDD_DIG_NOMINAL] = 320000000, |
| 3379 | [VDD_DIG_HIGH] = 450000000 |
| 3380 | }; |
| 3381 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3382 | static struct bank_masks bmnd_info_gfx3d = { |
| 3383 | .bank_sel_mask = BIT(11), |
| 3384 | .bank0_mask = { |
| 3385 | .md_reg = GFX3D_MD0_REG, |
| 3386 | .ns_mask = BM(21, 18) | BM(5, 3), |
| 3387 | .rst_mask = BIT(23), |
| 3388 | .mnd_en_mask = BIT(8), |
| 3389 | .mode_mask = BM(10, 9), |
| 3390 | }, |
| 3391 | .bank1_mask = { |
| 3392 | .md_reg = GFX3D_MD1_REG, |
| 3393 | .ns_mask = BM(17, 14) | BM(2, 0), |
| 3394 | .rst_mask = BIT(22), |
| 3395 | .mnd_en_mask = BIT(5), |
| 3396 | .mode_mask = BM(7, 6), |
| 3397 | }, |
| 3398 | }; |
| 3399 | |
| 3400 | static struct rcg_clk gfx3d_clk = { |
| 3401 | .b = { |
| 3402 | .ctl_reg = GFX3D_CC_REG, |
| 3403 | .en_mask = BIT(0), |
| 3404 | .reset_reg = SW_RESET_CORE_REG, |
| 3405 | .reset_mask = BIT(12), |
| 3406 | .halt_reg = DBG_BUS_VEC_A_REG, |
| 3407 | .halt_bit = 4, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 3408 | .retain_reg = GFX3D_CC_REG, |
| 3409 | .retain_mask = BIT(31), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3410 | }, |
| 3411 | .ns_reg = GFX3D_NS_REG, |
| 3412 | .root_en_mask = BIT(2), |
| 3413 | .set_rate = set_rate_mnd_banked, |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 3414 | .freq_tbl = clk_tbl_gfx3d_8960, |
Stephen Boyd | c78d9a7 | 2011-07-20 00:46:24 -0700 | [diff] [blame] | 3415 | .bank_info = &bmnd_info_gfx3d, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 3416 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3417 | .c = { |
| 3418 | .dbg_name = "gfx3d_clk", |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 3419 | .ops = &clk_ops_rcg_8960, |
Tianyi Gou | 3022dfd | 2012-01-25 15:50:05 -0800 | [diff] [blame] | 3420 | VDD_DIG_FMAX_MAP3(LOW, 128000000, NOMINAL, 300000000, |
| 3421 | HIGH, 400000000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3422 | CLK_INIT(gfx3d_clk.c), |
Stephen Boyd | 7fa2674 | 2011-08-11 23:22:29 -0700 | [diff] [blame] | 3423 | .depends = &gmem_axi_clk.c, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3424 | }, |
| 3425 | }; |
| 3426 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3427 | #define F_VCAP(f, s, m, n) \ |
Tianyi Gou | 621f874 | 2011-09-01 21:45:01 -0700 | [diff] [blame] | 3428 | { \ |
| 3429 | .freq_hz = f, \ |
| 3430 | .src_clk = &s##_clk.c, \ |
| 3431 | .md_val = MD4(4, m, 0, n), \ |
| 3432 | .ns_val = NS_MND_BANKED4(18, 14, n, m, 3, 0, s##_to_mm_mux), \ |
| 3433 | .ctl_val = CC_BANKED(9, 6, n), \ |
Tianyi Gou | 621f874 | 2011-09-01 21:45:01 -0700 | [diff] [blame] | 3434 | } |
| 3435 | |
| 3436 | static struct clk_freq_tbl clk_tbl_vcap[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3437 | F_VCAP( 0, gnd, 0, 0), |
| 3438 | F_VCAP( 27000000, pxo, 0, 0), |
| 3439 | F_VCAP( 54860000, pll8, 1, 7), |
| 3440 | F_VCAP( 64000000, pll8, 1, 6), |
| 3441 | F_VCAP( 76800000, pll8, 1, 5), |
| 3442 | F_VCAP(128000000, pll8, 1, 3), |
| 3443 | F_VCAP(160000000, pll2, 1, 5), |
| 3444 | F_VCAP(200000000, pll2, 1, 4), |
Tianyi Gou | 621f874 | 2011-09-01 21:45:01 -0700 | [diff] [blame] | 3445 | F_END |
| 3446 | }; |
| 3447 | |
| 3448 | static struct bank_masks bmnd_info_vcap = { |
| 3449 | .bank_sel_mask = BIT(11), |
| 3450 | .bank0_mask = { |
| 3451 | .md_reg = VCAP_MD0_REG, |
| 3452 | .ns_mask = BM(21, 18) | BM(5, 3), |
| 3453 | .rst_mask = BIT(23), |
| 3454 | .mnd_en_mask = BIT(8), |
| 3455 | .mode_mask = BM(10, 9), |
| 3456 | }, |
| 3457 | .bank1_mask = { |
| 3458 | .md_reg = VCAP_MD1_REG, |
| 3459 | .ns_mask = BM(17, 14) | BM(2, 0), |
| 3460 | .rst_mask = BIT(22), |
| 3461 | .mnd_en_mask = BIT(5), |
| 3462 | .mode_mask = BM(7, 6), |
| 3463 | }, |
| 3464 | }; |
| 3465 | |
| 3466 | static struct rcg_clk vcap_clk = { |
| 3467 | .b = { |
| 3468 | .ctl_reg = VCAP_CC_REG, |
| 3469 | .en_mask = BIT(0), |
| 3470 | .halt_reg = DBG_BUS_VEC_J_REG, |
| 3471 | .halt_bit = 15, |
| 3472 | }, |
| 3473 | .ns_reg = VCAP_NS_REG, |
| 3474 | .root_en_mask = BIT(2), |
| 3475 | .set_rate = set_rate_mnd_banked, |
| 3476 | .freq_tbl = clk_tbl_vcap, |
| 3477 | .bank_info = &bmnd_info_vcap, |
| 3478 | .current_freq = &rcg_dummy_freq, |
| 3479 | .c = { |
| 3480 | .dbg_name = "vcap_clk", |
| 3481 | .ops = &clk_ops_rcg_8960, |
| 3482 | .depends = &vcap_axi_clk.c, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3483 | VDD_DIG_FMAX_MAP2(LOW, 100000000, NOMINAL, 200000000), |
Tianyi Gou | 621f874 | 2011-09-01 21:45:01 -0700 | [diff] [blame] | 3484 | CLK_INIT(vcap_clk.c), |
| 3485 | }, |
| 3486 | }; |
| 3487 | |
| 3488 | static struct branch_clk vcap_npl_clk = { |
| 3489 | .b = { |
| 3490 | .ctl_reg = VCAP_CC_REG, |
| 3491 | .en_mask = BIT(13), |
| 3492 | .halt_reg = DBG_BUS_VEC_J_REG, |
| 3493 | .halt_bit = 25, |
| 3494 | }, |
| 3495 | .parent = &vcap_clk.c, |
| 3496 | .c = { |
| 3497 | .dbg_name = "vcap_npl_clk", |
| 3498 | .ops = &clk_ops_branch, |
| 3499 | CLK_INIT(vcap_npl_clk.c), |
| 3500 | }, |
| 3501 | }; |
| 3502 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3503 | #define F_IJPEG(f, s, d, m, n) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3504 | { \ |
| 3505 | .freq_hz = f, \ |
| 3506 | .src_clk = &s##_clk.c, \ |
| 3507 | .md_val = MD8(8, m, 0, n), \ |
| 3508 | .ns_val = NS_MM(23, 16, n, m, 15, 12, d, 2, 0, s##_to_mm_mux), \ |
| 3509 | .ctl_val = CC(6, n), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3510 | } |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 3511 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3512 | static struct clk_freq_tbl clk_tbl_ijpeg[] = { |
| 3513 | F_IJPEG( 0, gnd, 1, 0, 0), |
| 3514 | F_IJPEG( 27000000, pxo, 1, 0, 0), |
| 3515 | F_IJPEG( 36570000, pll8, 1, 2, 21), |
| 3516 | F_IJPEG( 54860000, pll8, 7, 0, 0), |
| 3517 | F_IJPEG( 96000000, pll8, 4, 0, 0), |
| 3518 | F_IJPEG(109710000, pll8, 1, 2, 7), |
| 3519 | F_IJPEG(128000000, pll8, 3, 0, 0), |
| 3520 | F_IJPEG(153600000, pll8, 1, 2, 5), |
| 3521 | F_IJPEG(200000000, pll2, 4, 0, 0), |
| 3522 | F_IJPEG(228571000, pll2, 1, 2, 7), |
| 3523 | F_IJPEG(266667000, pll2, 1, 1, 3), |
| 3524 | F_IJPEG(320000000, pll2, 1, 2, 5), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3525 | F_END |
| 3526 | }; |
| 3527 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3528 | static unsigned long fmax_ijpeg_8064[MAX_VDD_LEVELS] __initdata = { |
| 3529 | [VDD_DIG_LOW] = 128000000, |
| 3530 | [VDD_DIG_NOMINAL] = 266667000, |
| 3531 | [VDD_DIG_HIGH] = 320000000 |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 3532 | }; |
| 3533 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3534 | static struct rcg_clk ijpeg_clk = { |
| 3535 | .b = { |
| 3536 | .ctl_reg = IJPEG_CC_REG, |
| 3537 | .en_mask = BIT(0), |
| 3538 | .reset_reg = SW_RESET_CORE_REG, |
| 3539 | .reset_mask = BIT(9), |
| 3540 | .halt_reg = DBG_BUS_VEC_A_REG, |
| 3541 | .halt_bit = 24, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 3542 | .retain_reg = IJPEG_CC_REG, |
| 3543 | .retain_mask = BIT(31), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3544 | }, |
| 3545 | .ns_reg = IJPEG_NS_REG, |
| 3546 | .md_reg = IJPEG_MD_REG, |
| 3547 | .root_en_mask = BIT(2), |
| 3548 | .ns_mask = (BM(23, 16) | BM(15, 12) | BM(2, 0)), |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame] | 3549 | .mnd_en_mask = BIT(5), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3550 | .ctl_mask = BM(7, 6), |
| 3551 | .set_rate = set_rate_mnd, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3552 | .freq_tbl = clk_tbl_ijpeg, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 3553 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3554 | .c = { |
| 3555 | .dbg_name = "ijpeg_clk", |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 3556 | .ops = &clk_ops_rcg_8960, |
Tianyi Gou | 3022dfd | 2012-01-25 15:50:05 -0800 | [diff] [blame] | 3557 | VDD_DIG_FMAX_MAP3(LOW, 110000000, NOMINAL, 266667000, |
| 3558 | HIGH, 320000000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3559 | CLK_INIT(ijpeg_clk.c), |
Stephen Boyd | 7fa2674 | 2011-08-11 23:22:29 -0700 | [diff] [blame] | 3560 | .depends = &ijpeg_axi_clk.c, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3561 | }, |
| 3562 | }; |
| 3563 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3564 | #define F_JPEGD(f, s, d) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3565 | { \ |
| 3566 | .freq_hz = f, \ |
| 3567 | .src_clk = &s##_clk.c, \ |
| 3568 | .ns_val = NS_DIVSRC(15, 12, d, 2, 0, s##_to_mm_mux), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3569 | } |
| 3570 | static struct clk_freq_tbl clk_tbl_jpegd[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3571 | F_JPEGD( 0, gnd, 1), |
| 3572 | F_JPEGD( 64000000, pll8, 6), |
| 3573 | F_JPEGD( 76800000, pll8, 5), |
| 3574 | F_JPEGD( 96000000, pll8, 4), |
| 3575 | F_JPEGD(160000000, pll2, 5), |
| 3576 | F_JPEGD(200000000, pll2, 4), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3577 | F_END |
| 3578 | }; |
| 3579 | |
| 3580 | static struct rcg_clk jpegd_clk = { |
| 3581 | .b = { |
| 3582 | .ctl_reg = JPEGD_CC_REG, |
| 3583 | .en_mask = BIT(0), |
| 3584 | .reset_reg = SW_RESET_CORE_REG, |
| 3585 | .reset_mask = BIT(19), |
| 3586 | .halt_reg = DBG_BUS_VEC_A_REG, |
| 3587 | .halt_bit = 19, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 3588 | .retain_reg = JPEGD_CC_REG, |
| 3589 | .retain_mask = BIT(31), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3590 | }, |
| 3591 | .ns_reg = JPEGD_NS_REG, |
| 3592 | .root_en_mask = BIT(2), |
| 3593 | .ns_mask = (BM(15, 12) | BM(2, 0)), |
| 3594 | .set_rate = set_rate_nop, |
| 3595 | .freq_tbl = clk_tbl_jpegd, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 3596 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3597 | .c = { |
| 3598 | .dbg_name = "jpegd_clk", |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 3599 | .ops = &clk_ops_rcg_8960, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3600 | VDD_DIG_FMAX_MAP2(LOW, 96000000, NOMINAL, 200000000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3601 | CLK_INIT(jpegd_clk.c), |
Stephen Boyd | 7fa2674 | 2011-08-11 23:22:29 -0700 | [diff] [blame] | 3602 | .depends = &jpegd_axi_clk.c, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3603 | }, |
| 3604 | }; |
| 3605 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3606 | #define F_MDP(f, s, m, n) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3607 | { \ |
| 3608 | .freq_hz = f, \ |
| 3609 | .src_clk = &s##_clk.c, \ |
| 3610 | .md_val = MD8(8, m, 0, n), \ |
| 3611 | .ns_val = NS_MND_BANKED8(22, 14, n, m, 3, 0, s##_to_mm_mux), \ |
| 3612 | .ctl_val = CC_BANKED(9, 6, n), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3613 | } |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3614 | static struct clk_freq_tbl clk_tbl_mdp[] = { |
| 3615 | F_MDP( 0, gnd, 0, 0), |
| 3616 | F_MDP( 9600000, pll8, 1, 40), |
| 3617 | F_MDP( 13710000, pll8, 1, 28), |
| 3618 | F_MDP( 27000000, pxo, 0, 0), |
| 3619 | F_MDP( 29540000, pll8, 1, 13), |
| 3620 | F_MDP( 34910000, pll8, 1, 11), |
| 3621 | F_MDP( 38400000, pll8, 1, 10), |
| 3622 | F_MDP( 59080000, pll8, 2, 13), |
| 3623 | F_MDP( 76800000, pll8, 1, 5), |
| 3624 | F_MDP( 85330000, pll8, 2, 9), |
| 3625 | F_MDP( 96000000, pll8, 1, 4), |
| 3626 | F_MDP(128000000, pll8, 1, 3), |
| 3627 | F_MDP(160000000, pll2, 1, 5), |
| 3628 | F_MDP(177780000, pll2, 2, 9), |
| 3629 | F_MDP(200000000, pll2, 1, 4), |
| 3630 | F_MDP(266667000, pll2, 1, 3), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3631 | F_END |
| 3632 | }; |
| 3633 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3634 | static unsigned long fmax_mdp_8064[MAX_VDD_LEVELS] __initdata = { |
| 3635 | [VDD_DIG_LOW] = 128000000, |
| 3636 | [VDD_DIG_NOMINAL] = 266667000 |
Tianyi Gou | 621f874 | 2011-09-01 21:45:01 -0700 | [diff] [blame] | 3637 | }; |
| 3638 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3639 | static struct bank_masks bmnd_info_mdp = { |
| 3640 | .bank_sel_mask = BIT(11), |
| 3641 | .bank0_mask = { |
| 3642 | .md_reg = MDP_MD0_REG, |
| 3643 | .ns_mask = BM(29, 22) | BM(5, 3), |
| 3644 | .rst_mask = BIT(31), |
| 3645 | .mnd_en_mask = BIT(8), |
| 3646 | .mode_mask = BM(10, 9), |
| 3647 | }, |
| 3648 | .bank1_mask = { |
| 3649 | .md_reg = MDP_MD1_REG, |
| 3650 | .ns_mask = BM(21, 14) | BM(2, 0), |
| 3651 | .rst_mask = BIT(30), |
| 3652 | .mnd_en_mask = BIT(5), |
| 3653 | .mode_mask = BM(7, 6), |
| 3654 | }, |
| 3655 | }; |
| 3656 | |
| 3657 | static struct rcg_clk mdp_clk = { |
| 3658 | .b = { |
| 3659 | .ctl_reg = MDP_CC_REG, |
| 3660 | .en_mask = BIT(0), |
| 3661 | .reset_reg = SW_RESET_CORE_REG, |
| 3662 | .reset_mask = BIT(21), |
| 3663 | .halt_reg = DBG_BUS_VEC_C_REG, |
| 3664 | .halt_bit = 10, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 3665 | .retain_reg = MDP_CC_REG, |
| 3666 | .retain_mask = BIT(31), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3667 | }, |
| 3668 | .ns_reg = MDP_NS_REG, |
| 3669 | .root_en_mask = BIT(2), |
| 3670 | .set_rate = set_rate_mnd_banked, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3671 | .freq_tbl = clk_tbl_mdp, |
Stephen Boyd | c78d9a7 | 2011-07-20 00:46:24 -0700 | [diff] [blame] | 3672 | .bank_info = &bmnd_info_mdp, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 3673 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3674 | .c = { |
| 3675 | .dbg_name = "mdp_clk", |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 3676 | .ops = &clk_ops_rcg_8960, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3677 | VDD_DIG_FMAX_MAP2(LOW, 96000000, NOMINAL, 200000000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3678 | CLK_INIT(mdp_clk.c), |
Stephen Boyd | 7fa2674 | 2011-08-11 23:22:29 -0700 | [diff] [blame] | 3679 | .depends = &mdp_axi_clk.c, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3680 | }, |
| 3681 | }; |
| 3682 | |
| 3683 | static struct branch_clk lut_mdp_clk = { |
| 3684 | .b = { |
| 3685 | .ctl_reg = MDP_LUT_CC_REG, |
| 3686 | .en_mask = BIT(0), |
| 3687 | .halt_reg = DBG_BUS_VEC_I_REG, |
| 3688 | .halt_bit = 13, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 3689 | .retain_reg = MDP_LUT_CC_REG, |
| 3690 | .retain_mask = BIT(31), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3691 | }, |
| 3692 | .parent = &mdp_clk.c, |
| 3693 | .c = { |
| 3694 | .dbg_name = "lut_mdp_clk", |
| 3695 | .ops = &clk_ops_branch, |
| 3696 | CLK_INIT(lut_mdp_clk.c), |
| 3697 | }, |
| 3698 | }; |
| 3699 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3700 | #define F_MDP_VSYNC(f, s) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3701 | { \ |
| 3702 | .freq_hz = f, \ |
| 3703 | .src_clk = &s##_clk.c, \ |
| 3704 | .ns_val = NS_SRC_SEL(13, 13, s##_to_bb_mux), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3705 | } |
| 3706 | static struct clk_freq_tbl clk_tbl_mdp_vsync[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3707 | F_MDP_VSYNC(27000000, pxo), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3708 | F_END |
| 3709 | }; |
| 3710 | |
| 3711 | static struct rcg_clk mdp_vsync_clk = { |
| 3712 | .b = { |
| 3713 | .ctl_reg = MISC_CC_REG, |
| 3714 | .en_mask = BIT(6), |
| 3715 | .reset_reg = SW_RESET_CORE_REG, |
| 3716 | .reset_mask = BIT(3), |
| 3717 | .halt_reg = DBG_BUS_VEC_B_REG, |
| 3718 | .halt_bit = 22, |
| 3719 | }, |
| 3720 | .ns_reg = MISC_CC2_REG, |
| 3721 | .ns_mask = BIT(13), |
| 3722 | .set_rate = set_rate_nop, |
| 3723 | .freq_tbl = clk_tbl_mdp_vsync, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 3724 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3725 | .c = { |
| 3726 | .dbg_name = "mdp_vsync_clk", |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 3727 | .ops = &clk_ops_rcg_8960, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3728 | VDD_DIG_FMAX_MAP1(LOW, 27000000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3729 | CLK_INIT(mdp_vsync_clk.c), |
| 3730 | }, |
| 3731 | }; |
| 3732 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3733 | #define F_ROT(f, s, d) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3734 | { \ |
| 3735 | .freq_hz = f, \ |
| 3736 | .src_clk = &s##_clk.c, \ |
| 3737 | .ns_val = NS_DIVSRC_BANKED(29, 26, 25, 22, d, \ |
| 3738 | 21, 19, 18, 16, s##_to_mm_mux), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3739 | } |
| 3740 | static struct clk_freq_tbl clk_tbl_rot[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3741 | F_ROT( 0, gnd, 1), |
| 3742 | F_ROT( 27000000, pxo, 1), |
| 3743 | F_ROT( 29540000, pll8, 13), |
| 3744 | F_ROT( 32000000, pll8, 12), |
| 3745 | F_ROT( 38400000, pll8, 10), |
| 3746 | F_ROT( 48000000, pll8, 8), |
| 3747 | F_ROT( 54860000, pll8, 7), |
| 3748 | F_ROT( 64000000, pll8, 6), |
| 3749 | F_ROT( 76800000, pll8, 5), |
| 3750 | F_ROT( 96000000, pll8, 4), |
| 3751 | F_ROT(100000000, pll2, 8), |
| 3752 | F_ROT(114290000, pll2, 7), |
| 3753 | F_ROT(133330000, pll2, 6), |
| 3754 | F_ROT(160000000, pll2, 5), |
| 3755 | F_ROT(200000000, pll2, 4), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3756 | F_END |
| 3757 | }; |
| 3758 | |
| 3759 | static struct bank_masks bdiv_info_rot = { |
| 3760 | .bank_sel_mask = BIT(30), |
| 3761 | .bank0_mask = { |
| 3762 | .ns_mask = BM(25, 22) | BM(18, 16), |
| 3763 | }, |
| 3764 | .bank1_mask = { |
| 3765 | .ns_mask = BM(29, 26) | BM(21, 19), |
| 3766 | }, |
| 3767 | }; |
| 3768 | |
| 3769 | static struct rcg_clk rot_clk = { |
| 3770 | .b = { |
| 3771 | .ctl_reg = ROT_CC_REG, |
| 3772 | .en_mask = BIT(0), |
| 3773 | .reset_reg = SW_RESET_CORE_REG, |
| 3774 | .reset_mask = BIT(2), |
| 3775 | .halt_reg = DBG_BUS_VEC_C_REG, |
| 3776 | .halt_bit = 15, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 3777 | .retain_reg = ROT_CC_REG, |
| 3778 | .retain_mask = BIT(31), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3779 | }, |
| 3780 | .ns_reg = ROT_NS_REG, |
| 3781 | .root_en_mask = BIT(2), |
| 3782 | .set_rate = set_rate_div_banked, |
| 3783 | .freq_tbl = clk_tbl_rot, |
Stephen Boyd | c78d9a7 | 2011-07-20 00:46:24 -0700 | [diff] [blame] | 3784 | .bank_info = &bdiv_info_rot, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 3785 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3786 | .c = { |
| 3787 | .dbg_name = "rot_clk", |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 3788 | .ops = &clk_ops_rcg_8960, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3789 | VDD_DIG_FMAX_MAP2(LOW, 96000000, NOMINAL, 200000000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3790 | CLK_INIT(rot_clk.c), |
Stephen Boyd | 7fa2674 | 2011-08-11 23:22:29 -0700 | [diff] [blame] | 3791 | .depends = &rot_axi_clk.c, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3792 | }, |
| 3793 | }; |
| 3794 | |
| 3795 | static int hdmi_pll_clk_enable(struct clk *clk) |
| 3796 | { |
| 3797 | int ret; |
| 3798 | unsigned long flags; |
| 3799 | spin_lock_irqsave(&local_clock_reg_lock, flags); |
| 3800 | ret = hdmi_pll_enable(); |
| 3801 | spin_unlock_irqrestore(&local_clock_reg_lock, flags); |
| 3802 | return ret; |
| 3803 | } |
| 3804 | |
| 3805 | static void hdmi_pll_clk_disable(struct clk *clk) |
| 3806 | { |
| 3807 | unsigned long flags; |
| 3808 | spin_lock_irqsave(&local_clock_reg_lock, flags); |
| 3809 | hdmi_pll_disable(); |
| 3810 | spin_unlock_irqrestore(&local_clock_reg_lock, flags); |
| 3811 | } |
| 3812 | |
Matt Wagantall | 9de3bfb | 2011-11-03 20:13:12 -0700 | [diff] [blame] | 3813 | static unsigned long hdmi_pll_clk_get_rate(struct clk *clk) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3814 | { |
| 3815 | return hdmi_pll_get_rate(); |
| 3816 | } |
| 3817 | |
Stephen Boyd | 5b35dee | 2011-09-21 12:17:38 -0700 | [diff] [blame] | 3818 | static struct clk *hdmi_pll_clk_get_parent(struct clk *clk) |
| 3819 | { |
| 3820 | return &pxo_clk.c; |
| 3821 | } |
| 3822 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3823 | static struct clk_ops clk_ops_hdmi_pll = { |
| 3824 | .enable = hdmi_pll_clk_enable, |
| 3825 | .disable = hdmi_pll_clk_disable, |
| 3826 | .get_rate = hdmi_pll_clk_get_rate, |
| 3827 | .is_local = local_clk_is_local, |
Stephen Boyd | 5b35dee | 2011-09-21 12:17:38 -0700 | [diff] [blame] | 3828 | .get_parent = hdmi_pll_clk_get_parent, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3829 | }; |
| 3830 | |
| 3831 | static struct clk hdmi_pll_clk = { |
| 3832 | .dbg_name = "hdmi_pll_clk", |
| 3833 | .ops = &clk_ops_hdmi_pll, |
| 3834 | CLK_INIT(hdmi_pll_clk), |
| 3835 | }; |
| 3836 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3837 | #define F_TV_GND(f, s, p_r, d, m, n) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3838 | { \ |
| 3839 | .freq_hz = f, \ |
| 3840 | .src_clk = &s##_clk.c, \ |
| 3841 | .md_val = MD8(8, m, 0, n), \ |
| 3842 | .ns_val = NS_MM(23, 16, n, m, 15, 14, d, 2, 0, s##_to_mm_mux), \ |
| 3843 | .ctl_val = CC(6, n), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3844 | } |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3845 | #define F_TV(f, s, p_r, d, m, n) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3846 | { \ |
| 3847 | .freq_hz = f, \ |
| 3848 | .src_clk = &s##_clk, \ |
| 3849 | .md_val = MD8(8, m, 0, n), \ |
| 3850 | .ns_val = NS_MM(23, 16, n, m, 15, 14, d, 2, 0, s##_to_mm_mux), \ |
| 3851 | .ctl_val = CC(6, n), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3852 | .extra_freq_data = (void *)p_r, \ |
| 3853 | } |
| 3854 | /* Switching TV freqs requires PLL reconfiguration. */ |
| 3855 | static struct clk_freq_tbl clk_tbl_tv[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3856 | F_TV_GND( 0, gnd, 0, 1, 0, 0), |
| 3857 | F_TV( 25200000, hdmi_pll, 25200000, 1, 0, 0), |
| 3858 | F_TV( 27000000, hdmi_pll, 27000000, 1, 0, 0), |
| 3859 | F_TV( 27030000, hdmi_pll, 27030000, 1, 0, 0), |
| 3860 | F_TV( 74250000, hdmi_pll, 74250000, 1, 0, 0), |
| 3861 | F_TV(148500000, hdmi_pll, 148500000, 1, 0, 0), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3862 | F_END |
| 3863 | }; |
| 3864 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3865 | static unsigned long fmax_tv_src_8064[MAX_VDD_LEVELS] __initdata = { |
| 3866 | [VDD_DIG_LOW] = 74250000, |
| 3867 | [VDD_DIG_NOMINAL] = 149000000 |
| 3868 | }; |
| 3869 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3870 | /* |
| 3871 | * Unlike other clocks, the TV rate is adjusted through PLL |
| 3872 | * re-programming. It is also routed through an MND divider. |
| 3873 | */ |
| 3874 | void set_rate_tv(struct rcg_clk *clk, struct clk_freq_tbl *nf) |
| 3875 | { |
| 3876 | unsigned long pll_rate = (unsigned long)nf->extra_freq_data; |
| 3877 | if (pll_rate) |
| 3878 | hdmi_pll_set_rate(pll_rate); |
| 3879 | set_rate_mnd(clk, nf); |
| 3880 | } |
| 3881 | |
| 3882 | static struct rcg_clk tv_src_clk = { |
| 3883 | .ns_reg = TV_NS_REG, |
| 3884 | .b = { |
| 3885 | .ctl_reg = TV_CC_REG, |
| 3886 | .halt_check = NOCHECK, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 3887 | .retain_reg = TV_CC_REG, |
| 3888 | .retain_mask = BIT(31), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3889 | }, |
| 3890 | .md_reg = TV_MD_REG, |
| 3891 | .root_en_mask = BIT(2), |
| 3892 | .ns_mask = (BM(23, 16) | BM(15, 14) | BM(2, 0)), |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame] | 3893 | .mnd_en_mask = BIT(5), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3894 | .ctl_mask = BM(7, 6), |
| 3895 | .set_rate = set_rate_tv, |
| 3896 | .freq_tbl = clk_tbl_tv, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 3897 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3898 | .c = { |
| 3899 | .dbg_name = "tv_src_clk", |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 3900 | .ops = &clk_ops_rcg_8960, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3901 | VDD_DIG_FMAX_MAP2(LOW, 27030000, NOMINAL, 149000000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3902 | CLK_INIT(tv_src_clk.c), |
| 3903 | }, |
| 3904 | }; |
| 3905 | |
Tianyi Gou | 5191880 | 2012-01-26 14:05:43 -0800 | [diff] [blame] | 3906 | static struct cdiv_clk tv_src_div_clk = { |
| 3907 | .b = { |
| 3908 | .ctl_reg = TV_NS_REG, |
| 3909 | .halt_check = NOCHECK, |
| 3910 | }, |
| 3911 | .ns_reg = TV_NS_REG, |
| 3912 | .div_offset = 6, |
| 3913 | .max_div = 2, |
| 3914 | .c = { |
| 3915 | .dbg_name = "tv_src_div_clk", |
| 3916 | .ops = &clk_ops_cdiv, |
| 3917 | CLK_INIT(tv_src_div_clk.c), |
| 3918 | }, |
| 3919 | }; |
| 3920 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3921 | static struct branch_clk tv_enc_clk = { |
| 3922 | .b = { |
| 3923 | .ctl_reg = TV_CC_REG, |
| 3924 | .en_mask = BIT(8), |
| 3925 | .reset_reg = SW_RESET_CORE_REG, |
| 3926 | .reset_mask = BIT(0), |
| 3927 | .halt_reg = DBG_BUS_VEC_D_REG, |
| 3928 | .halt_bit = 9, |
| 3929 | }, |
| 3930 | .parent = &tv_src_clk.c, |
| 3931 | .c = { |
| 3932 | .dbg_name = "tv_enc_clk", |
| 3933 | .ops = &clk_ops_branch, |
| 3934 | CLK_INIT(tv_enc_clk.c), |
| 3935 | }, |
| 3936 | }; |
| 3937 | |
| 3938 | static struct branch_clk tv_dac_clk = { |
| 3939 | .b = { |
| 3940 | .ctl_reg = TV_CC_REG, |
| 3941 | .en_mask = BIT(10), |
| 3942 | .halt_reg = DBG_BUS_VEC_D_REG, |
| 3943 | .halt_bit = 10, |
| 3944 | }, |
| 3945 | .parent = &tv_src_clk.c, |
| 3946 | .c = { |
| 3947 | .dbg_name = "tv_dac_clk", |
| 3948 | .ops = &clk_ops_branch, |
| 3949 | CLK_INIT(tv_dac_clk.c), |
| 3950 | }, |
| 3951 | }; |
| 3952 | |
| 3953 | static struct branch_clk mdp_tv_clk = { |
| 3954 | .b = { |
| 3955 | .ctl_reg = TV_CC_REG, |
| 3956 | .en_mask = BIT(0), |
| 3957 | .reset_reg = SW_RESET_CORE_REG, |
| 3958 | .reset_mask = BIT(4), |
| 3959 | .halt_reg = DBG_BUS_VEC_D_REG, |
| 3960 | .halt_bit = 12, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 3961 | .retain_reg = TV_CC2_REG, |
| 3962 | .retain_mask = BIT(10), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3963 | }, |
| 3964 | .parent = &tv_src_clk.c, |
| 3965 | .c = { |
| 3966 | .dbg_name = "mdp_tv_clk", |
| 3967 | .ops = &clk_ops_branch, |
| 3968 | CLK_INIT(mdp_tv_clk.c), |
| 3969 | }, |
| 3970 | }; |
| 3971 | |
| 3972 | static struct branch_clk hdmi_tv_clk = { |
| 3973 | .b = { |
| 3974 | .ctl_reg = TV_CC_REG, |
| 3975 | .en_mask = BIT(12), |
| 3976 | .reset_reg = SW_RESET_CORE_REG, |
| 3977 | .reset_mask = BIT(1), |
| 3978 | .halt_reg = DBG_BUS_VEC_D_REG, |
| 3979 | .halt_bit = 11, |
| 3980 | }, |
| 3981 | .parent = &tv_src_clk.c, |
| 3982 | .c = { |
| 3983 | .dbg_name = "hdmi_tv_clk", |
| 3984 | .ops = &clk_ops_branch, |
| 3985 | CLK_INIT(hdmi_tv_clk.c), |
| 3986 | }, |
| 3987 | }; |
| 3988 | |
Tianyi Gou | 5191880 | 2012-01-26 14:05:43 -0800 | [diff] [blame] | 3989 | static struct branch_clk rgb_tv_clk = { |
| 3990 | .b = { |
| 3991 | .ctl_reg = TV_CC2_REG, |
| 3992 | .en_mask = BIT(14), |
| 3993 | .halt_reg = DBG_BUS_VEC_J_REG, |
| 3994 | .halt_bit = 27, |
| 3995 | }, |
| 3996 | .parent = &tv_src_clk.c, |
| 3997 | .c = { |
| 3998 | .dbg_name = "rgb_tv_clk", |
| 3999 | .ops = &clk_ops_branch, |
| 4000 | CLK_INIT(rgb_tv_clk.c), |
| 4001 | }, |
| 4002 | }; |
| 4003 | |
| 4004 | static struct branch_clk npl_tv_clk = { |
| 4005 | .b = { |
| 4006 | .ctl_reg = TV_CC2_REG, |
| 4007 | .en_mask = BIT(16), |
| 4008 | .halt_reg = DBG_BUS_VEC_J_REG, |
| 4009 | .halt_bit = 26, |
| 4010 | }, |
| 4011 | .parent = &tv_src_clk.c, |
| 4012 | .c = { |
| 4013 | .dbg_name = "npl_tv_clk", |
| 4014 | .ops = &clk_ops_branch, |
| 4015 | CLK_INIT(npl_tv_clk.c), |
| 4016 | }, |
| 4017 | }; |
| 4018 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4019 | static struct branch_clk hdmi_app_clk = { |
| 4020 | .b = { |
| 4021 | .ctl_reg = MISC_CC2_REG, |
| 4022 | .en_mask = BIT(11), |
| 4023 | .reset_reg = SW_RESET_CORE_REG, |
| 4024 | .reset_mask = BIT(11), |
| 4025 | .halt_reg = DBG_BUS_VEC_B_REG, |
| 4026 | .halt_bit = 25, |
| 4027 | }, |
| 4028 | .c = { |
| 4029 | .dbg_name = "hdmi_app_clk", |
| 4030 | .ops = &clk_ops_branch, |
| 4031 | CLK_INIT(hdmi_app_clk.c), |
| 4032 | }, |
| 4033 | }; |
| 4034 | |
| 4035 | static struct bank_masks bmnd_info_vcodec = { |
| 4036 | .bank_sel_mask = BIT(13), |
| 4037 | .bank0_mask = { |
| 4038 | .md_reg = VCODEC_MD0_REG, |
| 4039 | .ns_mask = BM(18, 11) | BM(2, 0), |
| 4040 | .rst_mask = BIT(31), |
| 4041 | .mnd_en_mask = BIT(5), |
| 4042 | .mode_mask = BM(7, 6), |
| 4043 | }, |
| 4044 | .bank1_mask = { |
| 4045 | .md_reg = VCODEC_MD1_REG, |
| 4046 | .ns_mask = BM(26, 19) | BM(29, 27), |
| 4047 | .rst_mask = BIT(30), |
| 4048 | .mnd_en_mask = BIT(10), |
| 4049 | .mode_mask = BM(12, 11), |
| 4050 | }, |
| 4051 | }; |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 4052 | #define F_VCODEC(f, s, m, n) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4053 | { \ |
| 4054 | .freq_hz = f, \ |
| 4055 | .src_clk = &s##_clk.c, \ |
| 4056 | .md_val = MD8(8, m, 0, n), \ |
| 4057 | .ns_val = NS_MND_BANKED8(11, 19, n, m, 0, 27, s##_to_mm_mux), \ |
| 4058 | .ctl_val = CC_BANKED(6, 11, n), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4059 | } |
| 4060 | static struct clk_freq_tbl clk_tbl_vcodec[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 4061 | F_VCODEC( 0, gnd, 0, 0), |
| 4062 | F_VCODEC( 27000000, pxo, 0, 0), |
| 4063 | F_VCODEC( 32000000, pll8, 1, 12), |
| 4064 | F_VCODEC( 48000000, pll8, 1, 8), |
| 4065 | F_VCODEC( 54860000, pll8, 1, 7), |
| 4066 | F_VCODEC( 96000000, pll8, 1, 4), |
| 4067 | F_VCODEC(133330000, pll2, 1, 6), |
| 4068 | F_VCODEC(200000000, pll2, 1, 4), |
| 4069 | F_VCODEC(228570000, pll2, 2, 7), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4070 | F_END |
| 4071 | }; |
| 4072 | |
| 4073 | static struct rcg_clk vcodec_clk = { |
| 4074 | .b = { |
| 4075 | .ctl_reg = VCODEC_CC_REG, |
| 4076 | .en_mask = BIT(0), |
| 4077 | .reset_reg = SW_RESET_CORE_REG, |
| 4078 | .reset_mask = BIT(6), |
| 4079 | .halt_reg = DBG_BUS_VEC_C_REG, |
| 4080 | .halt_bit = 29, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 4081 | .retain_reg = VCODEC_CC_REG, |
| 4082 | .retain_mask = BIT(31), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4083 | }, |
| 4084 | .ns_reg = VCODEC_NS_REG, |
| 4085 | .root_en_mask = BIT(2), |
| 4086 | .set_rate = set_rate_mnd_banked, |
Stephen Boyd | c78d9a7 | 2011-07-20 00:46:24 -0700 | [diff] [blame] | 4087 | .bank_info = &bmnd_info_vcodec, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4088 | .freq_tbl = clk_tbl_vcodec, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 4089 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4090 | .c = { |
| 4091 | .dbg_name = "vcodec_clk", |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 4092 | .ops = &clk_ops_rcg_8960, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 4093 | VDD_DIG_FMAX_MAP3(LOW, 100000000, NOMINAL, 200000000, |
| 4094 | HIGH, 228571000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4095 | CLK_INIT(vcodec_clk.c), |
Stephen Boyd | 7fa2674 | 2011-08-11 23:22:29 -0700 | [diff] [blame] | 4096 | .depends = &vcodec_axi_clk.c, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4097 | }, |
| 4098 | }; |
| 4099 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 4100 | #define F_VPE(f, s, d) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4101 | { \ |
| 4102 | .freq_hz = f, \ |
| 4103 | .src_clk = &s##_clk.c, \ |
| 4104 | .ns_val = NS_DIVSRC(15, 12, d, 2, 0, s##_to_mm_mux), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4105 | } |
| 4106 | static struct clk_freq_tbl clk_tbl_vpe[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 4107 | F_VPE( 0, gnd, 1), |
| 4108 | F_VPE( 27000000, pxo, 1), |
| 4109 | F_VPE( 34909000, pll8, 11), |
| 4110 | F_VPE( 38400000, pll8, 10), |
| 4111 | F_VPE( 64000000, pll8, 6), |
| 4112 | F_VPE( 76800000, pll8, 5), |
| 4113 | F_VPE( 96000000, pll8, 4), |
| 4114 | F_VPE(100000000, pll2, 8), |
| 4115 | F_VPE(160000000, pll2, 5), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4116 | F_END |
| 4117 | }; |
| 4118 | |
| 4119 | static struct rcg_clk vpe_clk = { |
| 4120 | .b = { |
| 4121 | .ctl_reg = VPE_CC_REG, |
| 4122 | .en_mask = BIT(0), |
| 4123 | .reset_reg = SW_RESET_CORE_REG, |
| 4124 | .reset_mask = BIT(17), |
| 4125 | .halt_reg = DBG_BUS_VEC_A_REG, |
| 4126 | .halt_bit = 28, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 4127 | .retain_reg = VPE_CC_REG, |
| 4128 | .retain_mask = BIT(31), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4129 | }, |
| 4130 | .ns_reg = VPE_NS_REG, |
| 4131 | .root_en_mask = BIT(2), |
| 4132 | .ns_mask = (BM(15, 12) | BM(2, 0)), |
| 4133 | .set_rate = set_rate_nop, |
| 4134 | .freq_tbl = clk_tbl_vpe, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 4135 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4136 | .c = { |
| 4137 | .dbg_name = "vpe_clk", |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 4138 | .ops = &clk_ops_rcg_8960, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 4139 | VDD_DIG_FMAX_MAP2(LOW, 76800000, NOMINAL, 160000000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4140 | CLK_INIT(vpe_clk.c), |
Stephen Boyd | 7fa2674 | 2011-08-11 23:22:29 -0700 | [diff] [blame] | 4141 | .depends = &vpe_axi_clk.c, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4142 | }, |
| 4143 | }; |
| 4144 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 4145 | #define F_VFE(f, s, d, m, n) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4146 | { \ |
| 4147 | .freq_hz = f, \ |
| 4148 | .src_clk = &s##_clk.c, \ |
| 4149 | .md_val = MD8(8, m, 0, n), \ |
| 4150 | .ns_val = NS_MM(23, 16, n, m, 11, 10, d, 2, 0, s##_to_mm_mux), \ |
| 4151 | .ctl_val = CC(6, n), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4152 | } |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 4153 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 4154 | static struct clk_freq_tbl clk_tbl_vfe[] = { |
| 4155 | F_VFE( 0, gnd, 1, 0, 0), |
| 4156 | F_VFE( 13960000, pll8, 1, 2, 55), |
| 4157 | F_VFE( 27000000, pxo, 1, 0, 0), |
| 4158 | F_VFE( 36570000, pll8, 1, 2, 21), |
| 4159 | F_VFE( 38400000, pll8, 2, 1, 5), |
| 4160 | F_VFE( 45180000, pll8, 1, 2, 17), |
| 4161 | F_VFE( 48000000, pll8, 2, 1, 4), |
| 4162 | F_VFE( 54860000, pll8, 1, 1, 7), |
| 4163 | F_VFE( 64000000, pll8, 2, 1, 3), |
| 4164 | F_VFE( 76800000, pll8, 1, 1, 5), |
| 4165 | F_VFE( 96000000, pll8, 2, 1, 2), |
| 4166 | F_VFE(109710000, pll8, 1, 2, 7), |
| 4167 | F_VFE(128000000, pll8, 1, 1, 3), |
| 4168 | F_VFE(153600000, pll8, 1, 2, 5), |
| 4169 | F_VFE(200000000, pll2, 2, 1, 2), |
| 4170 | F_VFE(228570000, pll2, 1, 2, 7), |
| 4171 | F_VFE(266667000, pll2, 1, 1, 3), |
| 4172 | F_VFE(320000000, pll2, 1, 2, 5), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4173 | F_END |
| 4174 | }; |
| 4175 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 4176 | static unsigned long fmax_vfe_8064[MAX_VDD_LEVELS] __initdata = { |
| 4177 | [VDD_DIG_LOW] = 128000000, |
| 4178 | [VDD_DIG_NOMINAL] = 266667000, |
| 4179 | [VDD_DIG_HIGH] = 320000000 |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 4180 | }; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4181 | |
| 4182 | static struct rcg_clk vfe_clk = { |
| 4183 | .b = { |
| 4184 | .ctl_reg = VFE_CC_REG, |
| 4185 | .reset_reg = SW_RESET_CORE_REG, |
| 4186 | .reset_mask = BIT(15), |
| 4187 | .halt_reg = DBG_BUS_VEC_B_REG, |
| 4188 | .halt_bit = 6, |
| 4189 | .en_mask = BIT(0), |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 4190 | .retain_reg = VFE_CC2_REG, |
| 4191 | .retain_mask = BIT(31), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4192 | }, |
| 4193 | .ns_reg = VFE_NS_REG, |
| 4194 | .md_reg = VFE_MD_REG, |
| 4195 | .root_en_mask = BIT(2), |
| 4196 | .ns_mask = (BM(23, 16) | BM(11, 10) | BM(2, 0)), |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame] | 4197 | .mnd_en_mask = BIT(5), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4198 | .ctl_mask = BM(7, 6), |
| 4199 | .set_rate = set_rate_mnd, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 4200 | .freq_tbl = clk_tbl_vfe, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 4201 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4202 | .c = { |
| 4203 | .dbg_name = "vfe_clk", |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 4204 | .ops = &clk_ops_rcg_8960, |
Tianyi Gou | 3022dfd | 2012-01-25 15:50:05 -0800 | [diff] [blame] | 4205 | VDD_DIG_FMAX_MAP3(LOW, 110000000, NOMINAL, 266667000, |
| 4206 | HIGH, 320000000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4207 | CLK_INIT(vfe_clk.c), |
Stephen Boyd | 7fa2674 | 2011-08-11 23:22:29 -0700 | [diff] [blame] | 4208 | .depends = &vfe_axi_clk.c, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4209 | }, |
| 4210 | }; |
| 4211 | |
Matt Wagantall | c23eee9 | 2011-08-16 23:06:52 -0700 | [diff] [blame] | 4212 | static struct branch_clk csi_vfe_clk = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4213 | .b = { |
| 4214 | .ctl_reg = VFE_CC_REG, |
| 4215 | .en_mask = BIT(12), |
| 4216 | .reset_reg = SW_RESET_CORE_REG, |
| 4217 | .reset_mask = BIT(24), |
| 4218 | .halt_reg = DBG_BUS_VEC_B_REG, |
| 4219 | .halt_bit = 8, |
| 4220 | }, |
| 4221 | .parent = &vfe_clk.c, |
| 4222 | .c = { |
Matt Wagantall | c23eee9 | 2011-08-16 23:06:52 -0700 | [diff] [blame] | 4223 | .dbg_name = "csi_vfe_clk", |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4224 | .ops = &clk_ops_branch, |
Matt Wagantall | c23eee9 | 2011-08-16 23:06:52 -0700 | [diff] [blame] | 4225 | CLK_INIT(csi_vfe_clk.c), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4226 | }, |
| 4227 | }; |
| 4228 | |
| 4229 | /* |
| 4230 | * Low Power Audio Clocks |
| 4231 | */ |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 4232 | #define F_AIF_OSR(f, s, d, m, n) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4233 | { \ |
| 4234 | .freq_hz = f, \ |
| 4235 | .src_clk = &s##_clk.c, \ |
| 4236 | .md_val = MD8(8, m, 0, n), \ |
| 4237 | .ns_val = NS(31, 24, n, m, 5, 4, 3, d, 2, 0, s##_to_lpa_mux), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4238 | } |
| 4239 | static struct clk_freq_tbl clk_tbl_aif_osr[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 4240 | F_AIF_OSR( 0, gnd, 1, 0, 0), |
| 4241 | F_AIF_OSR( 512000, pll4, 4, 1, 192), |
| 4242 | F_AIF_OSR( 768000, pll4, 4, 1, 128), |
| 4243 | F_AIF_OSR( 1024000, pll4, 4, 1, 96), |
| 4244 | F_AIF_OSR( 1536000, pll4, 4, 1, 64), |
| 4245 | F_AIF_OSR( 2048000, pll4, 4, 1, 48), |
| 4246 | F_AIF_OSR( 3072000, pll4, 4, 1, 32), |
| 4247 | F_AIF_OSR( 4096000, pll4, 4, 1, 24), |
| 4248 | F_AIF_OSR( 6144000, pll4, 4, 1, 16), |
| 4249 | F_AIF_OSR( 8192000, pll4, 4, 1, 12), |
| 4250 | F_AIF_OSR(12288000, pll4, 4, 1, 8), |
| 4251 | F_AIF_OSR(24576000, pll4, 4, 1, 4), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4252 | F_END |
| 4253 | }; |
| 4254 | |
| 4255 | #define CLK_AIF_OSR(i, ns, md, h_r) \ |
| 4256 | struct rcg_clk i##_clk = { \ |
| 4257 | .b = { \ |
| 4258 | .ctl_reg = ns, \ |
| 4259 | .en_mask = BIT(17), \ |
| 4260 | .reset_reg = ns, \ |
| 4261 | .reset_mask = BIT(19), \ |
| 4262 | .halt_reg = h_r, \ |
| 4263 | .halt_check = ENABLE, \ |
| 4264 | .halt_bit = 1, \ |
| 4265 | }, \ |
| 4266 | .ns_reg = ns, \ |
| 4267 | .md_reg = md, \ |
| 4268 | .root_en_mask = BIT(9), \ |
| 4269 | .ns_mask = (BM(31, 24) | BM(6, 0)), \ |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame] | 4270 | .mnd_en_mask = BIT(8), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4271 | .set_rate = set_rate_mnd, \ |
| 4272 | .freq_tbl = clk_tbl_aif_osr, \ |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 4273 | .current_freq = &rcg_dummy_freq, \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4274 | .c = { \ |
| 4275 | .dbg_name = #i "_clk", \ |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 4276 | .ops = &clk_ops_rcg_8960, \ |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 4277 | VDD_DIG_FMAX_MAP1(LOW, 24576000), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4278 | CLK_INIT(i##_clk.c), \ |
| 4279 | }, \ |
| 4280 | } |
| 4281 | #define CLK_AIF_OSR_DIV(i, ns, md, h_r) \ |
| 4282 | struct rcg_clk i##_clk = { \ |
| 4283 | .b = { \ |
| 4284 | .ctl_reg = ns, \ |
| 4285 | .en_mask = BIT(21), \ |
| 4286 | .reset_reg = ns, \ |
| 4287 | .reset_mask = BIT(23), \ |
| 4288 | .halt_reg = h_r, \ |
| 4289 | .halt_check = ENABLE, \ |
| 4290 | .halt_bit = 1, \ |
| 4291 | }, \ |
| 4292 | .ns_reg = ns, \ |
| 4293 | .md_reg = md, \ |
| 4294 | .root_en_mask = BIT(9), \ |
| 4295 | .ns_mask = (BM(31, 24) | BM(6, 0)), \ |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame] | 4296 | .mnd_en_mask = BIT(8), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4297 | .set_rate = set_rate_mnd, \ |
| 4298 | .freq_tbl = clk_tbl_aif_osr, \ |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 4299 | .current_freq = &rcg_dummy_freq, \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4300 | .c = { \ |
| 4301 | .dbg_name = #i "_clk", \ |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 4302 | .ops = &clk_ops_rcg_8960, \ |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 4303 | VDD_DIG_FMAX_MAP1(LOW, 24576000), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4304 | CLK_INIT(i##_clk.c), \ |
| 4305 | }, \ |
| 4306 | } |
| 4307 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4308 | #define CLK_AIF_BIT(i, ns, h_r) \ |
Stephen Boyd | 9fd1964 | 2011-11-16 11:11:09 -0800 | [diff] [blame] | 4309 | struct cdiv_clk i##_clk = { \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4310 | .b = { \ |
| 4311 | .ctl_reg = ns, \ |
| 4312 | .en_mask = BIT(15), \ |
| 4313 | .halt_reg = h_r, \ |
| 4314 | .halt_check = DELAY, \ |
| 4315 | }, \ |
| 4316 | .ns_reg = ns, \ |
Stephen Boyd | 9fd1964 | 2011-11-16 11:11:09 -0800 | [diff] [blame] | 4317 | .ext_mask = BIT(14), \ |
| 4318 | .div_offset = 10, \ |
| 4319 | .max_div = 16, \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4320 | .c = { \ |
| 4321 | .dbg_name = #i "_clk", \ |
Stephen Boyd | 9fd1964 | 2011-11-16 11:11:09 -0800 | [diff] [blame] | 4322 | .ops = &clk_ops_cdiv, \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4323 | CLK_INIT(i##_clk.c), \ |
| 4324 | }, \ |
| 4325 | } |
| 4326 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4327 | #define CLK_AIF_BIT_DIV(i, ns, h_r) \ |
Stephen Boyd | 9fd1964 | 2011-11-16 11:11:09 -0800 | [diff] [blame] | 4328 | struct cdiv_clk i##_clk = { \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4329 | .b = { \ |
| 4330 | .ctl_reg = ns, \ |
| 4331 | .en_mask = BIT(19), \ |
| 4332 | .halt_reg = h_r, \ |
Stephen Boyd | 7bb9cf8 | 2012-01-25 18:09:01 -0800 | [diff] [blame] | 4333 | .halt_check = DELAY, \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4334 | }, \ |
| 4335 | .ns_reg = ns, \ |
Stephen Boyd | 9fd1964 | 2011-11-16 11:11:09 -0800 | [diff] [blame] | 4336 | .ext_mask = BIT(18), \ |
| 4337 | .div_offset = 10, \ |
| 4338 | .max_div = 256, \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4339 | .c = { \ |
| 4340 | .dbg_name = #i "_clk", \ |
Stephen Boyd | 9fd1964 | 2011-11-16 11:11:09 -0800 | [diff] [blame] | 4341 | .ops = &clk_ops_cdiv, \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4342 | CLK_INIT(i##_clk.c), \ |
| 4343 | }, \ |
| 4344 | } |
| 4345 | |
| 4346 | static CLK_AIF_OSR(mi2s_osr, LCC_MI2S_NS_REG, LCC_MI2S_MD_REG, |
| 4347 | LCC_MI2S_STATUS_REG); |
| 4348 | static CLK_AIF_BIT(mi2s_bit, LCC_MI2S_NS_REG, LCC_MI2S_STATUS_REG); |
| 4349 | |
| 4350 | static CLK_AIF_OSR_DIV(codec_i2s_mic_osr, LCC_CODEC_I2S_MIC_NS_REG, |
| 4351 | LCC_CODEC_I2S_MIC_MD_REG, LCC_CODEC_I2S_MIC_STATUS_REG); |
| 4352 | static CLK_AIF_BIT_DIV(codec_i2s_mic_bit, LCC_CODEC_I2S_MIC_NS_REG, |
| 4353 | LCC_CODEC_I2S_MIC_STATUS_REG); |
| 4354 | |
| 4355 | static CLK_AIF_OSR_DIV(spare_i2s_mic_osr, LCC_SPARE_I2S_MIC_NS_REG, |
| 4356 | LCC_SPARE_I2S_MIC_MD_REG, LCC_SPARE_I2S_MIC_STATUS_REG); |
| 4357 | static CLK_AIF_BIT_DIV(spare_i2s_mic_bit, LCC_SPARE_I2S_MIC_NS_REG, |
| 4358 | LCC_SPARE_I2S_MIC_STATUS_REG); |
| 4359 | |
| 4360 | static CLK_AIF_OSR_DIV(codec_i2s_spkr_osr, LCC_CODEC_I2S_SPKR_NS_REG, |
| 4361 | LCC_CODEC_I2S_SPKR_MD_REG, LCC_CODEC_I2S_SPKR_STATUS_REG); |
| 4362 | static CLK_AIF_BIT_DIV(codec_i2s_spkr_bit, LCC_CODEC_I2S_SPKR_NS_REG, |
| 4363 | LCC_CODEC_I2S_SPKR_STATUS_REG); |
| 4364 | |
| 4365 | static CLK_AIF_OSR_DIV(spare_i2s_spkr_osr, LCC_SPARE_I2S_SPKR_NS_REG, |
| 4366 | LCC_SPARE_I2S_SPKR_MD_REG, LCC_SPARE_I2S_SPKR_STATUS_REG); |
| 4367 | static CLK_AIF_BIT_DIV(spare_i2s_spkr_bit, LCC_SPARE_I2S_SPKR_NS_REG, |
| 4368 | LCC_SPARE_I2S_SPKR_STATUS_REG); |
| 4369 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 4370 | #define F_PCM(f, s, d, m, n) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4371 | { \ |
| 4372 | .freq_hz = f, \ |
| 4373 | .src_clk = &s##_clk.c, \ |
| 4374 | .md_val = MD16(m, n), \ |
| 4375 | .ns_val = NS(31, 16, n, m, 5, 4, 3, d, 2, 0, s##_to_lpa_mux), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4376 | } |
| 4377 | static struct clk_freq_tbl clk_tbl_pcm[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 4378 | F_PCM( 0, gnd, 1, 0, 0), |
| 4379 | F_PCM( 512000, pll4, 4, 1, 192), |
| 4380 | F_PCM( 768000, pll4, 4, 1, 128), |
| 4381 | F_PCM( 1024000, pll4, 4, 1, 96), |
| 4382 | F_PCM( 1536000, pll4, 4, 1, 64), |
| 4383 | F_PCM( 2048000, pll4, 4, 1, 48), |
| 4384 | F_PCM( 3072000, pll4, 4, 1, 32), |
| 4385 | F_PCM( 4096000, pll4, 4, 1, 24), |
| 4386 | F_PCM( 6144000, pll4, 4, 1, 16), |
| 4387 | F_PCM( 8192000, pll4, 4, 1, 12), |
| 4388 | F_PCM(12288000, pll4, 4, 1, 8), |
| 4389 | F_PCM(24576000, pll4, 4, 1, 4), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4390 | F_END |
| 4391 | }; |
| 4392 | |
| 4393 | static struct rcg_clk pcm_clk = { |
| 4394 | .b = { |
| 4395 | .ctl_reg = LCC_PCM_NS_REG, |
| 4396 | .en_mask = BIT(11), |
| 4397 | .reset_reg = LCC_PCM_NS_REG, |
| 4398 | .reset_mask = BIT(13), |
| 4399 | .halt_reg = LCC_PCM_STATUS_REG, |
| 4400 | .halt_check = ENABLE, |
| 4401 | .halt_bit = 0, |
| 4402 | }, |
| 4403 | .ns_reg = LCC_PCM_NS_REG, |
| 4404 | .md_reg = LCC_PCM_MD_REG, |
| 4405 | .root_en_mask = BIT(9), |
| 4406 | .ns_mask = (BM(31, 16) | BM(6, 0)), |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame] | 4407 | .mnd_en_mask = BIT(8), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4408 | .set_rate = set_rate_mnd, |
| 4409 | .freq_tbl = clk_tbl_pcm, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 4410 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4411 | .c = { |
| 4412 | .dbg_name = "pcm_clk", |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 4413 | .ops = &clk_ops_rcg_8960, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 4414 | VDD_DIG_FMAX_MAP1(LOW, 24576000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4415 | CLK_INIT(pcm_clk.c), |
| 4416 | }, |
| 4417 | }; |
| 4418 | |
| 4419 | static struct rcg_clk audio_slimbus_clk = { |
| 4420 | .b = { |
| 4421 | .ctl_reg = LCC_SLIMBUS_NS_REG, |
| 4422 | .en_mask = BIT(10), |
| 4423 | .reset_reg = LCC_AHBEX_BRANCH_CTL_REG, |
| 4424 | .reset_mask = BIT(5), |
| 4425 | .halt_reg = LCC_SLIMBUS_STATUS_REG, |
| 4426 | .halt_check = ENABLE, |
| 4427 | .halt_bit = 0, |
| 4428 | }, |
| 4429 | .ns_reg = LCC_SLIMBUS_NS_REG, |
| 4430 | .md_reg = LCC_SLIMBUS_MD_REG, |
| 4431 | .root_en_mask = BIT(9), |
| 4432 | .ns_mask = (BM(31, 24) | BM(6, 0)), |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame] | 4433 | .mnd_en_mask = BIT(8), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4434 | .set_rate = set_rate_mnd, |
| 4435 | .freq_tbl = clk_tbl_aif_osr, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 4436 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4437 | .c = { |
| 4438 | .dbg_name = "audio_slimbus_clk", |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 4439 | .ops = &clk_ops_rcg_8960, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 4440 | VDD_DIG_FMAX_MAP1(LOW, 24576000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4441 | CLK_INIT(audio_slimbus_clk.c), |
| 4442 | }, |
| 4443 | }; |
| 4444 | |
| 4445 | static struct branch_clk sps_slimbus_clk = { |
| 4446 | .b = { |
| 4447 | .ctl_reg = LCC_SLIMBUS_NS_REG, |
| 4448 | .en_mask = BIT(12), |
| 4449 | .halt_reg = LCC_SLIMBUS_STATUS_REG, |
| 4450 | .halt_check = ENABLE, |
| 4451 | .halt_bit = 1, |
| 4452 | }, |
| 4453 | .parent = &audio_slimbus_clk.c, |
| 4454 | .c = { |
| 4455 | .dbg_name = "sps_slimbus_clk", |
| 4456 | .ops = &clk_ops_branch, |
| 4457 | CLK_INIT(sps_slimbus_clk.c), |
| 4458 | }, |
| 4459 | }; |
| 4460 | |
| 4461 | static struct branch_clk slimbus_xo_src_clk = { |
| 4462 | .b = { |
| 4463 | .ctl_reg = SLIMBUS_XO_SRC_CLK_CTL_REG, |
| 4464 | .en_mask = BIT(2), |
| 4465 | .halt_reg = CLK_HALT_DFAB_STATE_REG, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4466 | .halt_bit = 28, |
| 4467 | }, |
| 4468 | .parent = &sps_slimbus_clk.c, |
| 4469 | .c = { |
| 4470 | .dbg_name = "slimbus_xo_src_clk", |
| 4471 | .ops = &clk_ops_branch, |
| 4472 | CLK_INIT(slimbus_xo_src_clk.c), |
| 4473 | }, |
| 4474 | }; |
| 4475 | |
Matt Wagantall | 735f01a | 2011-08-12 12:40:28 -0700 | [diff] [blame] | 4476 | DEFINE_CLK_RPM(afab_clk, afab_a_clk, APPS_FABRIC, NULL); |
| 4477 | DEFINE_CLK_RPM(cfpb_clk, cfpb_a_clk, CFPB, NULL); |
| 4478 | DEFINE_CLK_RPM(dfab_clk, dfab_a_clk, DAYTONA_FABRIC, NULL); |
| 4479 | DEFINE_CLK_RPM(ebi1_clk, ebi1_a_clk, EBI1, NULL); |
| 4480 | DEFINE_CLK_RPM(mmfab_clk, mmfab_a_clk, MM_FABRIC, NULL); |
| 4481 | DEFINE_CLK_RPM(mmfpb_clk, mmfpb_a_clk, MMFPB, NULL); |
| 4482 | DEFINE_CLK_RPM(sfab_clk, sfab_a_clk, SYSTEM_FABRIC, NULL); |
| 4483 | DEFINE_CLK_RPM(sfpb_clk, sfpb_a_clk, SFPB, NULL); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4484 | |
Stephen Boyd | d7a143a | 2012-02-16 17:59:26 -0800 | [diff] [blame] | 4485 | static DEFINE_CLK_VOTER(sfab_msmbus_a_clk, &sfab_a_clk.c); |
| 4486 | static DEFINE_CLK_VOTER(sfab_tmr_a_clk, &sfab_a_clk.c); |
| 4487 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4488 | static DEFINE_CLK_VOTER(dfab_dsps_clk, &dfab_clk.c); |
| 4489 | static DEFINE_CLK_VOTER(dfab_usb_hs_clk, &dfab_clk.c); |
Manu Gautam | 7483f17 | 2011-11-08 15:22:26 +0530 | [diff] [blame] | 4490 | static DEFINE_CLK_VOTER(dfab_usb_hs3_clk, &dfab_clk.c); |
| 4491 | static DEFINE_CLK_VOTER(dfab_usb_hs4_clk, &dfab_clk.c); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4492 | static DEFINE_CLK_VOTER(dfab_sdc1_clk, &dfab_clk.c); |
| 4493 | static DEFINE_CLK_VOTER(dfab_sdc2_clk, &dfab_clk.c); |
| 4494 | static DEFINE_CLK_VOTER(dfab_sdc3_clk, &dfab_clk.c); |
| 4495 | static DEFINE_CLK_VOTER(dfab_sdc4_clk, &dfab_clk.c); |
| 4496 | static DEFINE_CLK_VOTER(dfab_sdc5_clk, &dfab_clk.c); |
| 4497 | static DEFINE_CLK_VOTER(dfab_sps_clk, &dfab_clk.c); |
Stephen Boyd | 1c51a49 | 2011-10-26 12:11:47 -0700 | [diff] [blame] | 4498 | static DEFINE_CLK_VOTER(dfab_bam_dmux_clk, &dfab_clk.c); |
Stephen Boyd | ef5d1c4 | 2011-12-15 20:47:14 -0800 | [diff] [blame] | 4499 | static DEFINE_CLK_VOTER(dfab_scm_clk, &dfab_clk.c); |
Ramesh Masavarapu | a1bc0e4 | 2012-03-05 07:42:48 -0800 | [diff] [blame] | 4500 | static DEFINE_CLK_VOTER(dfab_qseecom_clk, &dfab_clk.c); |
Ramesh Masavarapu | eb6e934 | 2012-02-13 19:59:50 -0800 | [diff] [blame] | 4501 | static DEFINE_CLK_VOTER(dfab_tzcom_clk, &dfab_clk.c); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4502 | |
| 4503 | static DEFINE_CLK_VOTER(ebi1_msmbus_clk, &ebi1_clk.c); |
Stephen Boyd | 36466ae | 2012-01-18 20:58:27 -0800 | [diff] [blame] | 4504 | static DEFINE_CLK_VOTER(ebi1_adm_clk, &ebi1_clk.c); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4505 | |
| 4506 | #ifdef CONFIG_DEBUG_FS |
| 4507 | struct measure_sel { |
| 4508 | u32 test_vector; |
| 4509 | struct clk *clk; |
| 4510 | }; |
| 4511 | |
Matt Wagantall | 8b38f94 | 2011-08-02 18:23:18 -0700 | [diff] [blame] | 4512 | static DEFINE_CLK_MEASURE(l2_m_clk); |
| 4513 | static DEFINE_CLK_MEASURE(krait0_m_clk); |
| 4514 | static DEFINE_CLK_MEASURE(krait1_m_clk); |
Tianyi Gou | 455c13c | 2012-02-02 16:33:24 -0800 | [diff] [blame] | 4515 | static DEFINE_CLK_MEASURE(krait2_m_clk); |
| 4516 | static DEFINE_CLK_MEASURE(krait3_m_clk); |
Stephen Boyd | 3939c8d | 2011-08-29 17:36:22 -0700 | [diff] [blame] | 4517 | static DEFINE_CLK_MEASURE(q6sw_clk); |
| 4518 | static DEFINE_CLK_MEASURE(q6fw_clk); |
| 4519 | static DEFINE_CLK_MEASURE(q6_func_clk); |
Matt Wagantall | 8b38f94 | 2011-08-02 18:23:18 -0700 | [diff] [blame] | 4520 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4521 | static struct measure_sel measure_mux[] = { |
| 4522 | { TEST_PER_LS(0x08), &slimbus_xo_src_clk.c }, |
| 4523 | { TEST_PER_LS(0x12), &sdc1_p_clk.c }, |
| 4524 | { TEST_PER_LS(0x13), &sdc1_clk.c }, |
| 4525 | { TEST_PER_LS(0x14), &sdc2_p_clk.c }, |
| 4526 | { TEST_PER_LS(0x15), &sdc2_clk.c }, |
| 4527 | { TEST_PER_LS(0x16), &sdc3_p_clk.c }, |
| 4528 | { TEST_PER_LS(0x17), &sdc3_clk.c }, |
| 4529 | { TEST_PER_LS(0x18), &sdc4_p_clk.c }, |
| 4530 | { TEST_PER_LS(0x19), &sdc4_clk.c }, |
| 4531 | { TEST_PER_LS(0x1A), &sdc5_p_clk.c }, |
| 4532 | { TEST_PER_LS(0x1B), &sdc5_clk.c }, |
Matt Wagantall | 7625a4c | 2011-11-01 16:17:53 -0700 | [diff] [blame] | 4533 | { TEST_PER_LS(0x1F), &gp0_clk.c }, |
| 4534 | { TEST_PER_LS(0x20), &gp1_clk.c }, |
| 4535 | { TEST_PER_LS(0x21), &gp2_clk.c }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4536 | { TEST_PER_LS(0x25), &dfab_clk.c }, |
| 4537 | { TEST_PER_LS(0x25), &dfab_a_clk.c }, |
| 4538 | { TEST_PER_LS(0x26), &pmem_clk.c }, |
| 4539 | { TEST_PER_LS(0x32), &dma_bam_p_clk.c }, |
| 4540 | { TEST_PER_LS(0x33), &cfpb_clk.c }, |
| 4541 | { TEST_PER_LS(0x33), &cfpb_a_clk.c }, |
| 4542 | { TEST_PER_LS(0x3D), &gsbi1_p_clk.c }, |
| 4543 | { TEST_PER_LS(0x3E), &gsbi1_uart_clk.c }, |
| 4544 | { TEST_PER_LS(0x3F), &gsbi1_qup_clk.c }, |
| 4545 | { TEST_PER_LS(0x41), &gsbi2_p_clk.c }, |
| 4546 | { TEST_PER_LS(0x42), &gsbi2_uart_clk.c }, |
| 4547 | { TEST_PER_LS(0x44), &gsbi2_qup_clk.c }, |
| 4548 | { TEST_PER_LS(0x45), &gsbi3_p_clk.c }, |
| 4549 | { TEST_PER_LS(0x46), &gsbi3_uart_clk.c }, |
| 4550 | { TEST_PER_LS(0x48), &gsbi3_qup_clk.c }, |
| 4551 | { TEST_PER_LS(0x49), &gsbi4_p_clk.c }, |
| 4552 | { TEST_PER_LS(0x4A), &gsbi4_uart_clk.c }, |
| 4553 | { TEST_PER_LS(0x4C), &gsbi4_qup_clk.c }, |
| 4554 | { TEST_PER_LS(0x4D), &gsbi5_p_clk.c }, |
| 4555 | { TEST_PER_LS(0x4E), &gsbi5_uart_clk.c }, |
| 4556 | { TEST_PER_LS(0x50), &gsbi5_qup_clk.c }, |
| 4557 | { TEST_PER_LS(0x51), &gsbi6_p_clk.c }, |
| 4558 | { TEST_PER_LS(0x52), &gsbi6_uart_clk.c }, |
| 4559 | { TEST_PER_LS(0x54), &gsbi6_qup_clk.c }, |
| 4560 | { TEST_PER_LS(0x55), &gsbi7_p_clk.c }, |
| 4561 | { TEST_PER_LS(0x56), &gsbi7_uart_clk.c }, |
| 4562 | { TEST_PER_LS(0x58), &gsbi7_qup_clk.c }, |
| 4563 | { TEST_PER_LS(0x59), &gsbi8_p_clk.c }, |
| 4564 | { TEST_PER_LS(0x5A), &gsbi8_uart_clk.c }, |
| 4565 | { TEST_PER_LS(0x5C), &gsbi8_qup_clk.c }, |
| 4566 | { TEST_PER_LS(0x5D), &gsbi9_p_clk.c }, |
| 4567 | { TEST_PER_LS(0x5E), &gsbi9_uart_clk.c }, |
| 4568 | { TEST_PER_LS(0x60), &gsbi9_qup_clk.c }, |
| 4569 | { TEST_PER_LS(0x61), &gsbi10_p_clk.c }, |
| 4570 | { TEST_PER_LS(0x62), &gsbi10_uart_clk.c }, |
| 4571 | { TEST_PER_LS(0x64), &gsbi10_qup_clk.c }, |
| 4572 | { TEST_PER_LS(0x65), &gsbi11_p_clk.c }, |
| 4573 | { TEST_PER_LS(0x66), &gsbi11_uart_clk.c }, |
| 4574 | { TEST_PER_LS(0x68), &gsbi11_qup_clk.c }, |
| 4575 | { TEST_PER_LS(0x69), &gsbi12_p_clk.c }, |
| 4576 | { TEST_PER_LS(0x6A), &gsbi12_uart_clk.c }, |
| 4577 | { TEST_PER_LS(0x6C), &gsbi12_qup_clk.c }, |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 4578 | { TEST_PER_LS(0x5E), &pcie_p_clk.c }, |
| 4579 | { TEST_PER_LS(0x5F), &ce3_p_clk.c }, |
| 4580 | { TEST_PER_LS(0x60), &ce3_core_clk.c }, |
| 4581 | { TEST_PER_LS(0x63), &usb_hs3_p_clk.c }, |
| 4582 | { TEST_PER_LS(0x64), &usb_hs3_xcvr_clk.c }, |
| 4583 | { TEST_PER_LS(0x65), &usb_hs4_p_clk.c }, |
| 4584 | { TEST_PER_LS(0x66), &usb_hs4_xcvr_clk.c }, |
| 4585 | { TEST_PER_LS(0x6B), &sata_phy_ref_clk.c }, |
| 4586 | { TEST_PER_LS(0x6C), &sata_phy_cfg_clk.c }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4587 | { TEST_PER_LS(0x78), &sfpb_clk.c }, |
| 4588 | { TEST_PER_LS(0x78), &sfpb_a_clk.c }, |
| 4589 | { TEST_PER_LS(0x7A), &pmic_ssbi2_clk.c }, |
| 4590 | { TEST_PER_LS(0x7B), &pmic_arb0_p_clk.c }, |
| 4591 | { TEST_PER_LS(0x7C), &pmic_arb1_p_clk.c }, |
| 4592 | { TEST_PER_LS(0x7D), &prng_clk.c }, |
| 4593 | { TEST_PER_LS(0x7F), &rpm_msg_ram_p_clk.c }, |
| 4594 | { TEST_PER_LS(0x80), &adm0_p_clk.c }, |
| 4595 | { TEST_PER_LS(0x84), &usb_hs1_p_clk.c }, |
| 4596 | { TEST_PER_LS(0x85), &usb_hs1_xcvr_clk.c }, |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 4597 | { TEST_PER_LS(0x86), &usb_hsic_p_clk.c }, |
| 4598 | { TEST_PER_LS(0x87), &usb_hsic_system_clk.c }, |
| 4599 | { TEST_PER_LS(0x88), &usb_hsic_xcvr_fs_clk.c }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4600 | { TEST_PER_LS(0x89), &usb_fs1_p_clk.c }, |
| 4601 | { TEST_PER_LS(0x8A), &usb_fs1_sys_clk.c }, |
| 4602 | { TEST_PER_LS(0x8B), &usb_fs1_xcvr_clk.c }, |
| 4603 | { TEST_PER_LS(0x8C), &usb_fs2_p_clk.c }, |
| 4604 | { TEST_PER_LS(0x8D), &usb_fs2_sys_clk.c }, |
| 4605 | { TEST_PER_LS(0x8E), &usb_fs2_xcvr_clk.c }, |
| 4606 | { TEST_PER_LS(0x8F), &tsif_p_clk.c }, |
| 4607 | { TEST_PER_LS(0x91), &tsif_ref_clk.c }, |
| 4608 | { TEST_PER_LS(0x92), &ce1_p_clk.c }, |
| 4609 | { TEST_PER_LS(0x94), &tssc_clk.c }, |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 4610 | { TEST_PER_LS(0x9D), &usb_hsic_hsio_cal_clk.c }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4611 | { TEST_PER_LS(0xA4), &ce1_core_clk.c }, |
| 4612 | |
| 4613 | { TEST_PER_HS(0x07), &afab_clk.c }, |
| 4614 | { TEST_PER_HS(0x07), &afab_a_clk.c }, |
| 4615 | { TEST_PER_HS(0x18), &sfab_clk.c }, |
| 4616 | { TEST_PER_HS(0x18), &sfab_a_clk.c }, |
Stephen Boyd | 3939c8d | 2011-08-29 17:36:22 -0700 | [diff] [blame] | 4617 | { TEST_PER_HS(0x26), &q6sw_clk }, |
| 4618 | { TEST_PER_HS(0x27), &q6fw_clk }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4619 | { TEST_PER_HS(0x2A), &adm0_clk.c }, |
| 4620 | { TEST_PER_HS(0x34), &ebi1_clk.c }, |
| 4621 | { TEST_PER_HS(0x34), &ebi1_a_clk.c }, |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 4622 | { TEST_PER_HS(0x50), &usb_hsic_hsic_clk.c }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4623 | |
| 4624 | { TEST_MM_LS(0x00), &dsi1_byte_clk.c }, |
| 4625 | { TEST_MM_LS(0x01), &dsi2_byte_clk.c }, |
| 4626 | { TEST_MM_LS(0x02), &cam1_clk.c }, |
| 4627 | { TEST_MM_LS(0x06), &_p_clk.c }, |
Matt Wagantall | c23eee9 | 2011-08-16 23:06:52 -0700 | [diff] [blame] | 4628 | { TEST_MM_LS(0x07), &csi_p_clk.c }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4629 | { TEST_MM_LS(0x08), &dsi2_s_p_clk.c }, |
| 4630 | { TEST_MM_LS(0x09), &dsi1_m_p_clk.c }, |
| 4631 | { TEST_MM_LS(0x0A), &dsi1_s_p_clk.c }, |
| 4632 | { TEST_MM_LS(0x0C), &gfx2d0_p_clk.c }, |
| 4633 | { TEST_MM_LS(0x0D), &gfx2d1_p_clk.c }, |
| 4634 | { TEST_MM_LS(0x0E), &gfx3d_p_clk.c }, |
| 4635 | { TEST_MM_LS(0x0F), &hdmi_m_p_clk.c }, |
| 4636 | { TEST_MM_LS(0x10), &hdmi_s_p_clk.c }, |
| 4637 | { TEST_MM_LS(0x11), &ijpeg_p_clk.c }, |
| 4638 | { TEST_MM_LS(0x12), &imem_p_clk.c }, |
| 4639 | { TEST_MM_LS(0x13), &jpegd_p_clk.c }, |
| 4640 | { TEST_MM_LS(0x14), &mdp_p_clk.c }, |
| 4641 | { TEST_MM_LS(0x16), &rot_p_clk.c }, |
| 4642 | { TEST_MM_LS(0x17), &dsi1_esc_clk.c }, |
| 4643 | { TEST_MM_LS(0x18), &smmu_p_clk.c }, |
| 4644 | { TEST_MM_LS(0x19), &tv_enc_p_clk.c }, |
| 4645 | { TEST_MM_LS(0x1A), &vcodec_p_clk.c }, |
| 4646 | { TEST_MM_LS(0x1B), &vfe_p_clk.c }, |
| 4647 | { TEST_MM_LS(0x1C), &vpe_p_clk.c }, |
| 4648 | { TEST_MM_LS(0x1D), &cam0_clk.c }, |
| 4649 | { TEST_MM_LS(0x1F), &hdmi_app_clk.c }, |
| 4650 | { TEST_MM_LS(0x20), &mdp_vsync_clk.c }, |
| 4651 | { TEST_MM_LS(0x21), &tv_dac_clk.c }, |
| 4652 | { TEST_MM_LS(0x22), &tv_enc_clk.c }, |
| 4653 | { TEST_MM_LS(0x23), &dsi2_esc_clk.c }, |
| 4654 | { TEST_MM_LS(0x25), &mmfpb_clk.c }, |
| 4655 | { TEST_MM_LS(0x25), &mmfpb_a_clk.c }, |
| 4656 | { TEST_MM_LS(0x26), &dsi2_m_p_clk.c }, |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 4657 | { TEST_MM_LS(0x27), &cam2_clk.c }, |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 4658 | { TEST_MM_LS(0x28), &vcap_p_clk.c }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4659 | |
| 4660 | { TEST_MM_HS(0x00), &csi0_clk.c }, |
| 4661 | { TEST_MM_HS(0x01), &csi1_clk.c }, |
Matt Wagantall | c23eee9 | 2011-08-16 23:06:52 -0700 | [diff] [blame] | 4662 | { TEST_MM_HS(0x04), &csi_vfe_clk.c }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4663 | { TEST_MM_HS(0x05), &ijpeg_clk.c }, |
| 4664 | { TEST_MM_HS(0x06), &vfe_clk.c }, |
| 4665 | { TEST_MM_HS(0x07), &gfx2d0_clk.c }, |
| 4666 | { TEST_MM_HS(0x08), &gfx2d1_clk.c }, |
| 4667 | { TEST_MM_HS(0x09), &gfx3d_clk.c }, |
| 4668 | { TEST_MM_HS(0x0A), &jpegd_clk.c }, |
| 4669 | { TEST_MM_HS(0x0B), &vcodec_clk.c }, |
| 4670 | { TEST_MM_HS(0x0F), &mmfab_clk.c }, |
| 4671 | { TEST_MM_HS(0x0F), &mmfab_a_clk.c }, |
| 4672 | { TEST_MM_HS(0x11), &gmem_axi_clk.c }, |
| 4673 | { TEST_MM_HS(0x12), &ijpeg_axi_clk.c }, |
| 4674 | { TEST_MM_HS(0x13), &imem_axi_clk.c }, |
| 4675 | { TEST_MM_HS(0x14), &jpegd_axi_clk.c }, |
| 4676 | { TEST_MM_HS(0x15), &mdp_axi_clk.c }, |
| 4677 | { TEST_MM_HS(0x16), &rot_axi_clk.c }, |
| 4678 | { TEST_MM_HS(0x17), &vcodec_axi_clk.c }, |
| 4679 | { TEST_MM_HS(0x18), &vfe_axi_clk.c }, |
| 4680 | { TEST_MM_HS(0x19), &vpe_axi_clk.c }, |
| 4681 | { TEST_MM_HS(0x1A), &mdp_clk.c }, |
| 4682 | { TEST_MM_HS(0x1B), &rot_clk.c }, |
| 4683 | { TEST_MM_HS(0x1C), &vpe_clk.c }, |
| 4684 | { TEST_MM_HS(0x1E), &hdmi_tv_clk.c }, |
| 4685 | { TEST_MM_HS(0x1F), &mdp_tv_clk.c }, |
| 4686 | { TEST_MM_HS(0x24), &csi0_phy_clk.c }, |
| 4687 | { TEST_MM_HS(0x25), &csi1_phy_clk.c }, |
| 4688 | { TEST_MM_HS(0x26), &csi_pix_clk.c }, |
| 4689 | { TEST_MM_HS(0x27), &csi_rdi_clk.c }, |
| 4690 | { TEST_MM_HS(0x28), &lut_mdp_clk.c }, |
| 4691 | { TEST_MM_HS(0x29), &vcodec_axi_a_clk.c }, |
| 4692 | { TEST_MM_HS(0x2A), &vcodec_axi_b_clk.c }, |
| 4693 | { TEST_MM_HS(0x2B), &csi1phy_timer_clk.c }, |
| 4694 | { TEST_MM_HS(0x2C), &csi0phy_timer_clk.c }, |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 4695 | { TEST_MM_HS(0x2D), &csi2_clk.c }, |
| 4696 | { TEST_MM_HS(0x2E), &csi2_phy_clk.c }, |
| 4697 | { TEST_MM_HS(0x2F), &csi2phy_timer_clk.c }, |
| 4698 | { TEST_MM_HS(0x30), &csi_pix1_clk.c }, |
| 4699 | { TEST_MM_HS(0x31), &csi_rdi1_clk.c }, |
| 4700 | { TEST_MM_HS(0x32), &csi_rdi2_clk.c }, |
Tianyi Gou | 621f874 | 2011-09-01 21:45:01 -0700 | [diff] [blame] | 4701 | { TEST_MM_HS(0x33), &vcap_clk.c }, |
| 4702 | { TEST_MM_HS(0x34), &vcap_npl_clk.c }, |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 4703 | { TEST_MM_HS(0x34), &gfx3d_axi_clk_8930.c }, |
Tianyi Gou | 7747a96 | 2012-02-03 15:03:55 -0800 | [diff] [blame] | 4704 | { TEST_MM_HS(0x35), &vcap_axi_clk.c }, |
Tianyi Gou | 5191880 | 2012-01-26 14:05:43 -0800 | [diff] [blame] | 4705 | { TEST_MM_HS(0x36), &rgb_tv_clk.c }, |
| 4706 | { TEST_MM_HS(0x37), &npl_tv_clk.c }, |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 4707 | { TEST_MM_HS(0x38), &gfx3d_axi_clk_8064.c }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4708 | |
| 4709 | { TEST_LPA(0x0F), &mi2s_bit_clk.c }, |
| 4710 | { TEST_LPA(0x10), &codec_i2s_mic_bit_clk.c }, |
| 4711 | { TEST_LPA(0x11), &codec_i2s_spkr_bit_clk.c }, |
| 4712 | { TEST_LPA(0x12), &spare_i2s_mic_bit_clk.c }, |
| 4713 | { TEST_LPA(0x13), &spare_i2s_spkr_bit_clk.c }, |
| 4714 | { TEST_LPA(0x14), &pcm_clk.c }, |
| 4715 | { TEST_LPA(0x1D), &audio_slimbus_clk.c }, |
Matt Wagantall | 8b38f94 | 2011-08-02 18:23:18 -0700 | [diff] [blame] | 4716 | |
Stephen Boyd | 3939c8d | 2011-08-29 17:36:22 -0700 | [diff] [blame] | 4717 | { TEST_LPA_HS(0x00), &q6_func_clk }, |
| 4718 | |
Stephen Boyd | 46fdf0d | 2011-11-22 12:25:09 -0800 | [diff] [blame] | 4719 | { TEST_CPUL2(0x2), &l2_m_clk }, |
| 4720 | { TEST_CPUL2(0x0), &krait0_m_clk }, |
| 4721 | { TEST_CPUL2(0x1), &krait1_m_clk }, |
Tianyi Gou | 455c13c | 2012-02-02 16:33:24 -0800 | [diff] [blame] | 4722 | { TEST_CPUL2(0x4), &krait2_m_clk }, |
| 4723 | { TEST_CPUL2(0x5), &krait3_m_clk }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4724 | }; |
| 4725 | |
| 4726 | static struct measure_sel *find_measure_sel(struct clk *clk) |
| 4727 | { |
| 4728 | int i; |
| 4729 | |
| 4730 | for (i = 0; i < ARRAY_SIZE(measure_mux); i++) |
| 4731 | if (measure_mux[i].clk == clk) |
| 4732 | return &measure_mux[i]; |
| 4733 | return NULL; |
| 4734 | } |
| 4735 | |
Matt Wagantall | 8b38f94 | 2011-08-02 18:23:18 -0700 | [diff] [blame] | 4736 | static int measure_clk_set_parent(struct clk *c, struct clk *parent) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4737 | { |
| 4738 | int ret = 0; |
| 4739 | u32 clk_sel; |
| 4740 | struct measure_sel *p; |
Matt Wagantall | 8b38f94 | 2011-08-02 18:23:18 -0700 | [diff] [blame] | 4741 | struct measure_clk *clk = to_measure_clk(c); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4742 | unsigned long flags; |
| 4743 | |
| 4744 | if (!parent) |
| 4745 | return -EINVAL; |
| 4746 | |
| 4747 | p = find_measure_sel(parent); |
| 4748 | if (!p) |
| 4749 | return -EINVAL; |
| 4750 | |
| 4751 | spin_lock_irqsave(&local_clock_reg_lock, flags); |
| 4752 | |
Matt Wagantall | 8b38f94 | 2011-08-02 18:23:18 -0700 | [diff] [blame] | 4753 | /* |
| 4754 | * Program the test vector, measurement period (sample_ticks) |
| 4755 | * and scaling multiplier. |
| 4756 | */ |
| 4757 | clk->sample_ticks = 0x10000; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4758 | clk_sel = p->test_vector & TEST_CLK_SEL_MASK; |
Matt Wagantall | 8b38f94 | 2011-08-02 18:23:18 -0700 | [diff] [blame] | 4759 | clk->multiplier = 1; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4760 | switch (p->test_vector >> TEST_TYPE_SHIFT) { |
| 4761 | case TEST_TYPE_PER_LS: |
| 4762 | writel_relaxed(0x4030D00|BVAL(7, 0, clk_sel), CLK_TEST_REG); |
| 4763 | break; |
| 4764 | case TEST_TYPE_PER_HS: |
| 4765 | writel_relaxed(0x4020000|BVAL(16, 10, clk_sel), CLK_TEST_REG); |
| 4766 | break; |
| 4767 | case TEST_TYPE_MM_LS: |
| 4768 | writel_relaxed(0x4030D97, CLK_TEST_REG); |
| 4769 | writel_relaxed(BVAL(6, 1, clk_sel)|BIT(0), DBG_CFG_REG_LS_REG); |
| 4770 | break; |
| 4771 | case TEST_TYPE_MM_HS: |
| 4772 | writel_relaxed(0x402B800, CLK_TEST_REG); |
| 4773 | writel_relaxed(BVAL(6, 1, clk_sel)|BIT(0), DBG_CFG_REG_HS_REG); |
| 4774 | break; |
| 4775 | case TEST_TYPE_LPA: |
| 4776 | writel_relaxed(0x4030D98, CLK_TEST_REG); |
| 4777 | writel_relaxed(BVAL(6, 1, clk_sel)|BIT(0), |
| 4778 | LCC_CLK_LS_DEBUG_CFG_REG); |
| 4779 | break; |
Stephen Boyd | 3939c8d | 2011-08-29 17:36:22 -0700 | [diff] [blame] | 4780 | case TEST_TYPE_LPA_HS: |
| 4781 | writel_relaxed(0x402BC00, CLK_TEST_REG); |
| 4782 | writel_relaxed(BVAL(2, 1, clk_sel)|BIT(0), |
| 4783 | LCC_CLK_HS_DEBUG_CFG_REG); |
| 4784 | break; |
Matt Wagantall | 8b38f94 | 2011-08-02 18:23:18 -0700 | [diff] [blame] | 4785 | case TEST_TYPE_CPUL2: |
| 4786 | writel_relaxed(0x4030400, CLK_TEST_REG); |
| 4787 | writel_relaxed(0x80|BVAL(5, 3, clk_sel), GCC_APCS_CLK_DIAG); |
| 4788 | clk->sample_ticks = 0x4000; |
| 4789 | clk->multiplier = 2; |
| 4790 | break; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4791 | default: |
| 4792 | ret = -EPERM; |
| 4793 | } |
| 4794 | /* Make sure test vector is set before starting measurements. */ |
| 4795 | mb(); |
| 4796 | |
| 4797 | spin_unlock_irqrestore(&local_clock_reg_lock, flags); |
| 4798 | |
| 4799 | return ret; |
| 4800 | } |
| 4801 | |
| 4802 | /* Sample clock for 'ticks' reference clock ticks. */ |
| 4803 | static u32 run_measurement(unsigned ticks) |
| 4804 | { |
| 4805 | /* Stop counters and set the XO4 counter start value. */ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4806 | writel_relaxed(ticks, RINGOSC_TCXO_CTL_REG); |
| 4807 | |
| 4808 | /* Wait for timer to become ready. */ |
| 4809 | while ((readl_relaxed(RINGOSC_STATUS_REG) & BIT(25)) != 0) |
| 4810 | cpu_relax(); |
| 4811 | |
| 4812 | /* Run measurement and wait for completion. */ |
| 4813 | writel_relaxed(BIT(20)|ticks, RINGOSC_TCXO_CTL_REG); |
| 4814 | while ((readl_relaxed(RINGOSC_STATUS_REG) & BIT(25)) == 0) |
| 4815 | cpu_relax(); |
| 4816 | |
| 4817 | /* Stop counters. */ |
| 4818 | writel_relaxed(0x0, RINGOSC_TCXO_CTL_REG); |
| 4819 | |
| 4820 | /* Return measured ticks. */ |
| 4821 | return readl_relaxed(RINGOSC_STATUS_REG) & BM(24, 0); |
| 4822 | } |
| 4823 | |
| 4824 | |
| 4825 | /* Perform a hardware rate measurement for a given clock. |
| 4826 | FOR DEBUG USE ONLY: Measurements take ~15 ms! */ |
Matt Wagantall | 9de3bfb | 2011-11-03 20:13:12 -0700 | [diff] [blame] | 4827 | static unsigned long measure_clk_get_rate(struct clk *c) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4828 | { |
| 4829 | unsigned long flags; |
| 4830 | u32 pdm_reg_backup, ringosc_reg_backup; |
| 4831 | u64 raw_count_short, raw_count_full; |
Matt Wagantall | 8b38f94 | 2011-08-02 18:23:18 -0700 | [diff] [blame] | 4832 | struct measure_clk *clk = to_measure_clk(c); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4833 | unsigned ret; |
| 4834 | |
Stephen Boyd | e334aeb | 2012-01-24 12:17:29 -0800 | [diff] [blame] | 4835 | ret = clk_prepare_enable(&cxo_clk.c); |
Stephen Boyd | 3a35f0b | 2012-01-11 16:18:26 -0800 | [diff] [blame] | 4836 | if (ret) { |
| 4837 | pr_warning("CXO clock failed to enable. Can't measure\n"); |
| 4838 | return 0; |
| 4839 | } |
| 4840 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4841 | spin_lock_irqsave(&local_clock_reg_lock, flags); |
| 4842 | |
| 4843 | /* Enable CXO/4 and RINGOSC branch and root. */ |
| 4844 | pdm_reg_backup = readl_relaxed(PDM_CLK_NS_REG); |
| 4845 | ringosc_reg_backup = readl_relaxed(RINGOSC_NS_REG); |
| 4846 | writel_relaxed(0x2898, PDM_CLK_NS_REG); |
| 4847 | writel_relaxed(0xA00, RINGOSC_NS_REG); |
| 4848 | |
| 4849 | /* |
| 4850 | * The ring oscillator counter will not reset if the measured clock |
| 4851 | * is not running. To detect this, run a short measurement before |
| 4852 | * the full measurement. If the raw results of the two are the same |
| 4853 | * then the clock must be off. |
| 4854 | */ |
| 4855 | |
| 4856 | /* Run a short measurement. (~1 ms) */ |
| 4857 | raw_count_short = run_measurement(0x1000); |
| 4858 | /* Run a full measurement. (~14 ms) */ |
Matt Wagantall | 8b38f94 | 2011-08-02 18:23:18 -0700 | [diff] [blame] | 4859 | raw_count_full = run_measurement(clk->sample_ticks); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4860 | |
| 4861 | writel_relaxed(ringosc_reg_backup, RINGOSC_NS_REG); |
| 4862 | writel_relaxed(pdm_reg_backup, PDM_CLK_NS_REG); |
| 4863 | |
| 4864 | /* Return 0 if the clock is off. */ |
| 4865 | if (raw_count_full == raw_count_short) |
| 4866 | ret = 0; |
| 4867 | else { |
| 4868 | /* Compute rate in Hz. */ |
| 4869 | raw_count_full = ((raw_count_full * 10) + 15) * 4800000; |
Matt Wagantall | 8b38f94 | 2011-08-02 18:23:18 -0700 | [diff] [blame] | 4870 | do_div(raw_count_full, ((clk->sample_ticks * 10) + 35)); |
| 4871 | ret = (raw_count_full * clk->multiplier); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4872 | } |
| 4873 | |
| 4874 | /* Route dbg_hs_clk to PLLTEST. 300mV single-ended amplitude. */ |
Stephen Boyd | 69da840 | 2011-07-14 17:45:31 -0700 | [diff] [blame] | 4875 | writel_relaxed(0x38F8, PLLTEST_PAD_CFG_REG); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4876 | spin_unlock_irqrestore(&local_clock_reg_lock, flags); |
| 4877 | |
Stephen Boyd | e334aeb | 2012-01-24 12:17:29 -0800 | [diff] [blame] | 4878 | clk_disable_unprepare(&cxo_clk.c); |
Stephen Boyd | 3a35f0b | 2012-01-11 16:18:26 -0800 | [diff] [blame] | 4879 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4880 | return ret; |
| 4881 | } |
| 4882 | #else /* !CONFIG_DEBUG_FS */ |
| 4883 | static int measure_clk_set_parent(struct clk *clk, struct clk *parent) |
| 4884 | { |
| 4885 | return -EINVAL; |
| 4886 | } |
| 4887 | |
Matt Wagantall | 9de3bfb | 2011-11-03 20:13:12 -0700 | [diff] [blame] | 4888 | static unsigned long measure_clk_get_rate(struct clk *clk) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4889 | { |
| 4890 | return 0; |
| 4891 | } |
| 4892 | #endif /* CONFIG_DEBUG_FS */ |
| 4893 | |
| 4894 | static struct clk_ops measure_clk_ops = { |
| 4895 | .set_parent = measure_clk_set_parent, |
| 4896 | .get_rate = measure_clk_get_rate, |
| 4897 | .is_local = local_clk_is_local, |
| 4898 | }; |
| 4899 | |
Matt Wagantall | 8b38f94 | 2011-08-02 18:23:18 -0700 | [diff] [blame] | 4900 | static struct measure_clk measure_clk = { |
| 4901 | .c = { |
| 4902 | .dbg_name = "measure_clk", |
| 4903 | .ops = &measure_clk_ops, |
| 4904 | CLK_INIT(measure_clk.c), |
| 4905 | }, |
| 4906 | .multiplier = 1, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4907 | }; |
| 4908 | |
Tianyi Gou | a8b3cce | 2011-11-08 14:37:26 -0800 | [diff] [blame] | 4909 | static struct clk_lookup msm_clocks_8064[] = { |
Stephen Boyd | 72a8035 | 2012-01-26 15:57:38 -0800 | [diff] [blame] | 4910 | CLK_LOOKUP("xo", cxo_a_clk.c, ""), |
| 4911 | CLK_LOOKUP("xo", pxo_a_clk.c, ""), |
Stephen Boyd | ed630b0 | 2012-01-26 15:26:47 -0800 | [diff] [blame] | 4912 | CLK_LOOKUP("cxo", cxo_clk.c, "wcnss_wlan.0"), |
| 4913 | CLK_LOOKUP("cxo", cxo_clk.c, "pil_riva"), |
| 4914 | CLK_LOOKUP("xo", pxo_clk.c, "pil_qdsp6v4.0"), |
| 4915 | CLK_LOOKUP("xo", cxo_clk.c, "pil_qdsp6v4.1"), |
| 4916 | CLK_LOOKUP("xo", cxo_clk.c, "pil_qdsp6v4.2"), |
Matt Wagantall | 292aace | 2012-01-26 19:12:34 -0800 | [diff] [blame] | 4917 | CLK_LOOKUP("xo", cxo_clk.c, "pil_gss"), |
Stephen Boyd | 69d35e3 | 2012-02-14 15:33:30 -0800 | [diff] [blame] | 4918 | CLK_LOOKUP("xo", cxo_clk.c, "BAM_RMNT"), |
Stephen Boyd | 5a190a8 | 2012-03-01 14:45:15 -0800 | [diff] [blame] | 4919 | CLK_LOOKUP("xo", cxo_clk.c, "msm_xo"), |
Stephen Boyd | ed630b0 | 2012-01-26 15:26:47 -0800 | [diff] [blame] | 4920 | CLK_LOOKUP("pll2", pll2_clk.c, NULL), |
| 4921 | CLK_LOOKUP("pll8", pll8_clk.c, NULL), |
| 4922 | CLK_LOOKUP("pll4", pll4_clk.c, NULL), |
| 4923 | CLK_LOOKUP("measure", measure_clk.c, "debug"), |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 4924 | |
Tianyi Gou | 21a0e80 | 2012-02-04 22:34:10 -0800 | [diff] [blame] | 4925 | CLK_LOOKUP("bus_clk", afab_clk.c, "msm_apps_fab"), |
| 4926 | CLK_LOOKUP("bus_a_clk", afab_a_clk.c, "msm_apps_fab"), |
| 4927 | CLK_LOOKUP("bus_clk", cfpb_clk.c, "msm_cpss_fpb"), |
| 4928 | CLK_LOOKUP("bus_a_clk", cfpb_a_clk.c, "msm_cpss_fpb"), |
| 4929 | CLK_LOOKUP("bus_clk", sfab_clk.c, "msm_sys_fab"), |
Stephen Boyd | d7a143a | 2012-02-16 17:59:26 -0800 | [diff] [blame] | 4930 | CLK_LOOKUP("bus_a_clk", sfab_msmbus_a_clk.c, "msm_sys_fab"), |
Tianyi Gou | 21a0e80 | 2012-02-04 22:34:10 -0800 | [diff] [blame] | 4931 | CLK_LOOKUP("bus_clk", sfpb_clk.c, "msm_sys_fpb"), |
| 4932 | CLK_LOOKUP("bus_a_clk", sfpb_a_clk.c, "msm_sys_fpb"), |
| 4933 | CLK_LOOKUP("bus_clk", mmfab_clk.c, "msm_mm_fab"), |
| 4934 | CLK_LOOKUP("bus_a_clk", mmfab_a_clk.c, "msm_mm_fab"), |
| 4935 | CLK_LOOKUP("mem_clk", ebi1_msmbus_clk.c, "msm_bus"), |
| 4936 | CLK_LOOKUP("mem_a_clk", ebi1_a_clk.c, "msm_bus"), |
Matt Wagantall | b2710b8 | 2011-11-16 19:55:17 -0800 | [diff] [blame] | 4937 | |
Tianyi Gou | 21a0e80 | 2012-02-04 22:34:10 -0800 | [diff] [blame] | 4938 | CLK_LOOKUP("ebi1_clk", ebi1_clk.c, ""), |
| 4939 | CLK_LOOKUP("dfab_clk", dfab_clk.c, ""), |
| 4940 | CLK_LOOKUP("dfab_a_clk", dfab_a_clk.c, ""), |
| 4941 | CLK_LOOKUP("mmfpb_clk", mmfpb_clk.c, ""), |
| 4942 | CLK_LOOKUP("mmfpb_a_clk", mmfpb_a_clk.c, "clock-8960"), |
| 4943 | CLK_LOOKUP("cfpb_a_clk", cfpb_a_clk.c, "clock-8960"), |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 4944 | |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 4945 | CLK_LOOKUP("core_clk", gp0_clk.c, ""), |
| 4946 | CLK_LOOKUP("core_clk", gp1_clk.c, ""), |
| 4947 | CLK_LOOKUP("core_clk", gp2_clk.c, ""), |
Jin Hong | 4bbbfba | 2012-02-02 21:48:07 -0800 | [diff] [blame] | 4948 | CLK_LOOKUP("core_clk", gsbi1_uart_clk.c, "msm_serial_hsl.1"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 4949 | CLK_LOOKUP("core_clk", gsbi2_uart_clk.c, ""), |
| 4950 | CLK_LOOKUP("core_clk", gsbi3_uart_clk.c, ""), |
| 4951 | CLK_LOOKUP("core_clk", gsbi4_uart_clk.c, ""), |
| 4952 | CLK_LOOKUP("core_clk", gsbi5_uart_clk.c, ""), |
| 4953 | CLK_LOOKUP("core_clk", gsbi6_uart_clk.c, ""), |
Jin Hong | 4bbbfba | 2012-02-02 21:48:07 -0800 | [diff] [blame] | 4954 | CLK_LOOKUP("core_clk", gsbi7_uart_clk.c, "msm_serial_hsl.0"), |
David Keitel | 3c40fc5 | 2012-02-09 17:53:52 -0800 | [diff] [blame] | 4955 | CLK_LOOKUP("core_clk", gsbi1_qup_clk.c, "qup_i2c.0"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 4956 | CLK_LOOKUP("core_clk", gsbi2_qup_clk.c, ""), |
Jing Lin | 04601f9 | 2012-02-05 15:36:07 -0800 | [diff] [blame] | 4957 | CLK_LOOKUP("core_clk", gsbi3_qup_clk.c, "qup_i2c.3"), |
Kevin Chan | d07220e | 2012-02-13 15:52:22 -0800 | [diff] [blame] | 4958 | CLK_LOOKUP("core_clk", gsbi4_qup_clk.c, "qup_i2c.4"), |
Stepan Moskovchenko | 6499900 | 2012-01-31 15:52:59 -0800 | [diff] [blame] | 4959 | CLK_LOOKUP("core_clk", gsbi5_qup_clk.c, "spi_qsd.0"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 4960 | CLK_LOOKUP("core_clk", gsbi6_qup_clk.c, ""), |
| 4961 | CLK_LOOKUP("core_clk", gsbi7_qup_clk.c, ""), |
| 4962 | CLK_LOOKUP("core_clk", pdm_clk.c, ""), |
Tianyi Gou | 50f2381 | 2012-02-06 16:04:19 -0800 | [diff] [blame] | 4963 | CLK_LOOKUP("mem_clk", pmem_clk.c, "msm_sps"), |
Tianyi Gou | 05e0110 | 2012-02-08 22:15:49 -0800 | [diff] [blame] | 4964 | CLK_LOOKUP("core_clk", prng_clk.c, "msm_rng.0"), |
Tianyi Gou | 43208a0 | 2011-09-27 15:35:13 -0700 | [diff] [blame] | 4965 | CLK_LOOKUP("core_clk", sdc1_clk.c, "msm_sdcc.1"), |
| 4966 | CLK_LOOKUP("core_clk", sdc2_clk.c, "msm_sdcc.2"), |
| 4967 | CLK_LOOKUP("core_clk", sdc3_clk.c, "msm_sdcc.3"), |
| 4968 | CLK_LOOKUP("core_clk", sdc4_clk.c, "msm_sdcc.4"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 4969 | CLK_LOOKUP("ref_clk", tsif_ref_clk.c, ""), |
| 4970 | CLK_LOOKUP("core_clk", tssc_clk.c, ""), |
Manu Gautam | 5143b25 | 2012-01-05 19:25:23 -0800 | [diff] [blame] | 4971 | CLK_LOOKUP("alt_core_clk", usb_hs1_xcvr_clk.c, "msm_otg"), |
| 4972 | CLK_LOOKUP("alt_core_clk", usb_hs3_xcvr_clk.c, "msm_ehci_host.0"), |
| 4973 | CLK_LOOKUP("alt_core_clk", usb_hs4_xcvr_clk.c, "msm_ehci_host.1"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 4974 | CLK_LOOKUP("src_clk", usb_fs1_src_clk.c, ""), |
| 4975 | CLK_LOOKUP("alt_core_clk", usb_fs1_xcvr_clk.c, ""), |
| 4976 | CLK_LOOKUP("sys_clk", usb_fs1_sys_clk.c, ""), |
| 4977 | CLK_LOOKUP("iface_clk", ce1_p_clk.c, ""), |
| 4978 | CLK_LOOKUP("core_clk", ce1_core_clk.c, ""), |
| 4979 | CLK_LOOKUP("ref_clk", sata_phy_ref_clk.c, ""), |
| 4980 | CLK_LOOKUP("cfg_clk", sata_phy_cfg_clk.c, ""), |
Ramesh Masavarapu | 2831191 | 2011-10-27 11:04:12 -0700 | [diff] [blame] | 4981 | CLK_LOOKUP("iface_clk", ce3_p_clk.c, "qce.0"), |
| 4982 | CLK_LOOKUP("iface_clk", ce3_p_clk.c, "qcrypto.0"), |
| 4983 | CLK_LOOKUP("core_clk", ce3_core_clk.c, "qce.0"), |
| 4984 | CLK_LOOKUP("core_clk", ce3_core_clk.c, "qcrypto.0"), |
| 4985 | CLK_LOOKUP("ce3_core_src_clk", ce3_src_clk.c, "qce.0"), |
| 4986 | CLK_LOOKUP("ce3_core_src_clk", ce3_src_clk.c, "qcrypto.0"), |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 4987 | CLK_LOOKUP("dma_bam_pclk", dma_bam_p_clk.c, NULL), |
Jin Hong | 4bbbfba | 2012-02-02 21:48:07 -0800 | [diff] [blame] | 4988 | CLK_LOOKUP("iface_clk", gsbi1_p_clk.c, "msm_serial_hsl.1"), |
David Keitel | 3c40fc5 | 2012-02-09 17:53:52 -0800 | [diff] [blame] | 4989 | CLK_LOOKUP("iface_clk", gsbi1_p_clk.c, "qup_i2c.0"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 4990 | CLK_LOOKUP("iface_clk", gsbi2_p_clk.c, ""), |
Jing Lin | 04601f9 | 2012-02-05 15:36:07 -0800 | [diff] [blame] | 4991 | CLK_LOOKUP("iface_clk", gsbi3_p_clk.c, "qup_i2c.3"), |
Kevin Chan | d07220e | 2012-02-13 15:52:22 -0800 | [diff] [blame] | 4992 | CLK_LOOKUP("iface_clk", gsbi4_p_clk.c, "qup_i2c.4"), |
Stepan Moskovchenko | 6499900 | 2012-01-31 15:52:59 -0800 | [diff] [blame] | 4993 | CLK_LOOKUP("iface_clk", gsbi5_p_clk.c, "spi_qsd.0"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 4994 | CLK_LOOKUP("iface_clk", gsbi6_p_clk.c, ""), |
Jin Hong | 4bbbfba | 2012-02-02 21:48:07 -0800 | [diff] [blame] | 4995 | CLK_LOOKUP("iface_clk", gsbi7_p_clk.c, "msm_serial_hsl.0"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 4996 | CLK_LOOKUP("iface_clk", tsif_p_clk.c, ""), |
| 4997 | CLK_LOOKUP("iface_clk", usb_fs1_p_clk.c, ""), |
Manu Gautam | 5143b25 | 2012-01-05 19:25:23 -0800 | [diff] [blame] | 4998 | CLK_LOOKUP("iface_clk", usb_hs1_p_clk.c, "msm_otg"), |
Manu Gautam | 7483f17 | 2011-11-08 15:22:26 +0530 | [diff] [blame] | 4999 | CLK_LOOKUP("iface_clk", usb_hs3_p_clk.c, "msm_ehci_host.0"), |
| 5000 | CLK_LOOKUP("iface_clk", usb_hs4_p_clk.c, "msm_ehci_host.1"), |
Tianyi Gou | 43208a0 | 2011-09-27 15:35:13 -0700 | [diff] [blame] | 5001 | CLK_LOOKUP("iface_clk", sdc1_p_clk.c, "msm_sdcc.1"), |
| 5002 | CLK_LOOKUP("iface_clk", sdc2_p_clk.c, "msm_sdcc.2"), |
| 5003 | CLK_LOOKUP("iface_clk", sdc3_p_clk.c, "msm_sdcc.3"), |
| 5004 | CLK_LOOKUP("iface_clk", sdc4_p_clk.c, "msm_sdcc.4"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5005 | CLK_LOOKUP("iface_clk", pcie_p_clk.c, ""), |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 5006 | CLK_LOOKUP("core_clk", adm0_clk.c, "msm_dmov"), |
| 5007 | CLK_LOOKUP("iface_clk", adm0_p_clk.c, "msm_dmov"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5008 | CLK_LOOKUP("iface_clk", pmic_arb0_p_clk.c, ""), |
| 5009 | CLK_LOOKUP("iface_clk", pmic_arb1_p_clk.c, ""), |
| 5010 | CLK_LOOKUP("core_clk", pmic_ssbi2_clk.c, ""), |
| 5011 | CLK_LOOKUP("mem_clk", rpm_msg_ram_p_clk.c, ""), |
| 5012 | CLK_LOOKUP("core_clk", amp_clk.c, ""), |
Kevin Chan | d07220e | 2012-02-13 15:52:22 -0800 | [diff] [blame] | 5013 | CLK_LOOKUP("cam_clk", cam0_clk.c, "4-001a"), |
Sreesudhan Ramakrish Ramkumar | 3381da7 | 2012-01-27 08:08:32 -0800 | [diff] [blame] | 5014 | CLK_LOOKUP("cam_clk", cam0_clk.c, "4-0034"), |
Sreesudhan Ramakrish Ramkumar | 6c6f57c | 2012-02-21 15:12:44 -0800 | [diff] [blame] | 5015 | CLK_LOOKUP("cam_clk", cam1_clk.c, "4-0048"), |
Kevin Chan | d07220e | 2012-02-13 15:52:22 -0800 | [diff] [blame] | 5016 | CLK_LOOKUP("cam_clk", cam1_clk.c, "4-006c"), |
| 5017 | CLK_LOOKUP("csi_src_clk", csi0_src_clk.c, "msm_csid.0"), |
| 5018 | CLK_LOOKUP("csi_src_clk", csi1_src_clk.c, "msm_csid.1"), |
| 5019 | CLK_LOOKUP("csi_src_clk", csi2_src_clk.c, "msm_csid.2"), |
| 5020 | CLK_LOOKUP("csi_clk", csi0_clk.c, "msm_csid.0"), |
| 5021 | CLK_LOOKUP("csi_clk", csi1_clk.c, "msm_csid.1"), |
| 5022 | CLK_LOOKUP("csi_clk", csi2_clk.c, "msm_csid.2"), |
| 5023 | CLK_LOOKUP("csi_phy_clk", csi0_phy_clk.c, "msm_csid.0"), |
| 5024 | CLK_LOOKUP("csi_phy_clk", csi1_phy_clk.c, "msm_csid.1"), |
| 5025 | CLK_LOOKUP("csi_phy_clk", csi2_phy_clk.c, "msm_csid.2"), |
| 5026 | CLK_LOOKUP("csi_pix_clk", csi_pix_clk.c, "msm_ispif.0"), |
| 5027 | CLK_LOOKUP("csi_pix1_clk", csi_pix1_clk.c, "msm_ispif.0"), |
| 5028 | CLK_LOOKUP("csi_rdi_clk", csi_rdi_clk.c, "msm_ispif.0"), |
| 5029 | CLK_LOOKUP("csi_rdi1_clk", csi_rdi1_clk.c, "msm_ispif.0"), |
| 5030 | CLK_LOOKUP("csi_rdi2_clk", csi_rdi2_clk.c, "msm_ispif.0"), |
| 5031 | CLK_LOOKUP("csiphy_timer_src_clk", |
| 5032 | csiphy_timer_src_clk.c, "msm_csiphy.0"), |
| 5033 | CLK_LOOKUP("csiphy_timer_src_clk", |
| 5034 | csiphy_timer_src_clk.c, "msm_csiphy.1"), |
| 5035 | CLK_LOOKUP("csiphy_timer_src_clk", |
| 5036 | csiphy_timer_src_clk.c, "msm_csiphy.2"), |
| 5037 | CLK_LOOKUP("csiphy_timer_clk", csi0phy_timer_clk.c, "msm_csiphy.0"), |
| 5038 | CLK_LOOKUP("csiphy_timer_clk", csi1phy_timer_clk.c, "msm_csiphy.1"), |
| 5039 | CLK_LOOKUP("csiphy_timer_clk", csi2phy_timer_clk.c, "msm_csiphy.2"), |
Ravishangar Kalyanam | c2fee31 | 2012-02-09 19:11:22 -0800 | [diff] [blame] | 5040 | CLK_LOOKUP("dsi_byte_div_clk", dsi1_byte_clk.c, NULL), |
| 5041 | CLK_LOOKUP("dsi_byte_div_clk", dsi2_byte_clk.c, NULL), |
| 5042 | CLK_LOOKUP("dsi_esc_clk", dsi1_esc_clk.c, NULL), |
| 5043 | CLK_LOOKUP("dsi_esc_clk", dsi2_esc_clk.c, NULL), |
Tianyi Gou | 5191880 | 2012-01-26 14:05:43 -0800 | [diff] [blame] | 5044 | CLK_LOOKUP("rgb_clk", rgb_tv_clk.c, ""), |
| 5045 | CLK_LOOKUP("npl_clk", npl_tv_clk.c, ""), |
| 5046 | |
Pu Chen | 86b4be9 | 2011-11-03 17:27:57 -0700 | [diff] [blame] | 5047 | CLK_LOOKUP("core_clk", gfx3d_clk.c, "kgsl-3d0.0"), |
Matt Wagantall | c9a780c | 2011-10-28 12:12:18 -0700 | [diff] [blame] | 5048 | CLK_LOOKUP("core_clk", gfx3d_clk.c, "footswitch-8x60.2"), |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 5049 | CLK_LOOKUP("bus_clk", |
| 5050 | gfx3d_axi_clk_8064.c, "footswitch-8x60.2"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5051 | CLK_LOOKUP("iface_clk", vcap_p_clk.c, ""), |
Matt Wagantall | c9a780c | 2011-10-28 12:12:18 -0700 | [diff] [blame] | 5052 | CLK_LOOKUP("iface_clk", vcap_p_clk.c, "footswitch-8x60.10"), |
| 5053 | CLK_LOOKUP("bus_clk", vcap_axi_clk.c, "footswitch-8x60.10"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5054 | CLK_LOOKUP("core_clk", vcap_clk.c, ""), |
Matt Wagantall | c9a780c | 2011-10-28 12:12:18 -0700 | [diff] [blame] | 5055 | CLK_LOOKUP("core_clk", vcap_clk.c, "footswitch-8x60.10"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5056 | CLK_LOOKUP("vcap_npl_clk", vcap_npl_clk.c, ""), |
Matt Wagantall | c9a780c | 2011-10-28 12:12:18 -0700 | [diff] [blame] | 5057 | CLK_LOOKUP("bus_clk", ijpeg_axi_clk.c, "footswitch-8x60.3"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5058 | CLK_LOOKUP("mem_clk", imem_axi_clk.c, ""), |
| 5059 | CLK_LOOKUP("ijpeg_clk", ijpeg_clk.c, ""), |
Matt Wagantall | c9a780c | 2011-10-28 12:12:18 -0700 | [diff] [blame] | 5060 | CLK_LOOKUP("core_clk", ijpeg_clk.c, "footswitch-8x60.3"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5061 | CLK_LOOKUP("core_clk", jpegd_clk.c, ""), |
Ravishangar Kalyanam | c2fee31 | 2012-02-09 19:11:22 -0800 | [diff] [blame] | 5062 | CLK_LOOKUP("mdp_clk", mdp_clk.c, NULL), |
Matt Wagantall | c9a780c | 2011-10-28 12:12:18 -0700 | [diff] [blame] | 5063 | CLK_LOOKUP("core_clk", mdp_clk.c, "footswitch-8x60.4"), |
Ravishangar Kalyanam | c2fee31 | 2012-02-09 19:11:22 -0800 | [diff] [blame] | 5064 | CLK_LOOKUP("mdp_vsync_clk", mdp_vsync_clk.c, NULL), |
Matt Wagantall | b82a513 | 2011-12-12 22:26:41 -0800 | [diff] [blame] | 5065 | CLK_LOOKUP("vsync_clk", mdp_vsync_clk.c, "footswitch-8x60.4"), |
Ravishangar Kalyanam | c2fee31 | 2012-02-09 19:11:22 -0800 | [diff] [blame] | 5066 | CLK_LOOKUP("lut_mdp", lut_mdp_clk.c, NULL), |
Matt Wagantall | b82a513 | 2011-12-12 22:26:41 -0800 | [diff] [blame] | 5067 | CLK_LOOKUP("lut_clk", lut_mdp_clk.c, "footswitch-8x60.4"), |
Matt Wagantall | bb90da9 | 2011-10-25 15:07:52 -0700 | [diff] [blame] | 5068 | CLK_LOOKUP("core_clk", rot_clk.c, "msm_rotator.0"), |
Matt Wagantall | c9a780c | 2011-10-28 12:12:18 -0700 | [diff] [blame] | 5069 | CLK_LOOKUP("core_clk", rot_clk.c, "footswitch-8x60.6"), |
Matt Wagantall | 6128631 | 2012-02-22 15:55:09 -0800 | [diff] [blame] | 5070 | CLK_LOOKUP("tv_src_clk", tv_src_clk.c, "footswitch-8x60.4"), |
Aravind Venkateswaran | 0507c8c | 2012-02-16 17:16:05 -0800 | [diff] [blame] | 5071 | CLK_LOOKUP("tv_src_clk", tv_src_clk.c, NULL), |
| 5072 | CLK_LOOKUP("tv_src_div_clk", tv_src_div_clk.c, NULL), |
Greg Grisco | fa47b53 | 2011-11-11 10:32:06 -0800 | [diff] [blame] | 5073 | CLK_LOOKUP("core_clk", vcodec_clk.c, "msm_vidc.0"), |
Matt Wagantall | c9a780c | 2011-10-28 12:12:18 -0700 | [diff] [blame] | 5074 | CLK_LOOKUP("core_clk", vcodec_clk.c, "footswitch-8x60.7"), |
Aravind Venkateswaran | 0507c8c | 2012-02-16 17:16:05 -0800 | [diff] [blame] | 5075 | CLK_LOOKUP("mdp_tv_clk", mdp_tv_clk.c, NULL), |
Tianyi Gou | 5191880 | 2012-01-26 14:05:43 -0800 | [diff] [blame] | 5076 | CLK_LOOKUP("tv_clk", mdp_tv_clk.c, "footswitch-8x60.4"), |
Aravind Venkateswaran | 0507c8c | 2012-02-16 17:16:05 -0800 | [diff] [blame] | 5077 | CLK_LOOKUP("hdmi_clk", hdmi_tv_clk.c, NULL), |
| 5078 | CLK_LOOKUP("core_clk", hdmi_app_clk.c, "hdmi_msm.1"), |
Ujwal Patel | d041f98 | 2012-03-27 19:51:44 -0700 | [diff] [blame] | 5079 | CLK_LOOKUP("vpe_clk", vpe_clk.c, "msm_vpe.0"), |
Matt Wagantall | c9a780c | 2011-10-28 12:12:18 -0700 | [diff] [blame] | 5080 | CLK_LOOKUP("core_clk", vpe_clk.c, "footswitch-8x60.9"), |
Kevin Chan | d07220e | 2012-02-13 15:52:22 -0800 | [diff] [blame] | 5081 | CLK_LOOKUP("vfe_clk", vfe_clk.c, "msm_vfe.0"), |
Matt Wagantall | c9a780c | 2011-10-28 12:12:18 -0700 | [diff] [blame] | 5082 | CLK_LOOKUP("core_clk", vfe_clk.c, "footswitch-8x60.8"), |
Kevin Chan | d07220e | 2012-02-13 15:52:22 -0800 | [diff] [blame] | 5083 | CLK_LOOKUP("csi_vfe_clk", csi_vfe_clk.c, "msm_vfe.0"), |
Matt Wagantall | c9a780c | 2011-10-28 12:12:18 -0700 | [diff] [blame] | 5084 | CLK_LOOKUP("bus_clk", vfe_axi_clk.c, "footswitch-8x60.8"), |
| 5085 | CLK_LOOKUP("bus_clk", mdp_axi_clk.c, "footswitch-8x60.4"), |
| 5086 | CLK_LOOKUP("bus_clk", rot_axi_clk.c, "footswitch-8x60.6"), |
| 5087 | CLK_LOOKUP("bus_clk", vcodec_axi_clk.c, "footswitch-8x60.7"), |
| 5088 | CLK_LOOKUP("bus_a_clk", vcodec_axi_a_clk.c, "footswitch-8x60.7"), |
| 5089 | CLK_LOOKUP("bus_b_clk", vcodec_axi_b_clk.c, "footswitch-8x60.7"), |
| 5090 | CLK_LOOKUP("bus_clk", vpe_axi_clk.c, "footswitch-8x60.9"), |
Ravishangar Kalyanam | c2fee31 | 2012-02-09 19:11:22 -0800 | [diff] [blame] | 5091 | CLK_LOOKUP("amp_pclk", amp_p_clk.c, NULL), |
Kevin Chan | d07220e | 2012-02-13 15:52:22 -0800 | [diff] [blame] | 5092 | CLK_LOOKUP("csi_pclk", csi_p_clk.c, "msm_csid.0"), |
| 5093 | CLK_LOOKUP("csi_pclk", csi_p_clk.c, "msm_csid.1"), |
| 5094 | CLK_LOOKUP("csi_pclk", csi_p_clk.c, "msm_csid.2"), |
Ravishangar Kalyanam | c2fee31 | 2012-02-09 19:11:22 -0800 | [diff] [blame] | 5095 | CLK_LOOKUP("dsi_m_pclk", dsi1_m_p_clk.c, NULL), |
| 5096 | CLK_LOOKUP("dsi_s_pclk", dsi1_s_p_clk.c, NULL), |
| 5097 | CLK_LOOKUP("dsi_m_pclk", dsi2_m_p_clk.c, NULL), |
| 5098 | CLK_LOOKUP("dsi_s_pclk", dsi2_s_p_clk.c, NULL), |
Pu Chen | 86b4be9 | 2011-11-03 17:27:57 -0700 | [diff] [blame] | 5099 | CLK_LOOKUP("iface_clk", gfx3d_p_clk.c, "kgsl-3d0.0"), |
Matt Wagantall | c9a780c | 2011-10-28 12:12:18 -0700 | [diff] [blame] | 5100 | CLK_LOOKUP("iface_clk", gfx3d_p_clk.c, "footswitch-8x60.2"), |
Aravind Venkateswaran | 0507c8c | 2012-02-16 17:16:05 -0800 | [diff] [blame] | 5101 | CLK_LOOKUP("master_iface_clk", hdmi_m_p_clk.c, "hdmi_msm.1"), |
| 5102 | CLK_LOOKUP("slave_iface_clk", hdmi_s_p_clk.c, "hdmi_msm.1"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5103 | CLK_LOOKUP("ijpeg_pclk", ijpeg_p_clk.c, ""), |
Matt Wagantall | c9a780c | 2011-10-28 12:12:18 -0700 | [diff] [blame] | 5104 | CLK_LOOKUP("iface_clk", ijpeg_p_clk.c, "footswitch-8x60.3"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5105 | CLK_LOOKUP("iface_clk", jpegd_p_clk.c, ""), |
Matt Wagantall | 5d44ef2 | 2012-01-23 11:01:05 -0800 | [diff] [blame] | 5106 | CLK_LOOKUP("mem_iface_clk", imem_p_clk.c, "kgsl-3d0.0"), |
Ravishangar Kalyanam | c2fee31 | 2012-02-09 19:11:22 -0800 | [diff] [blame] | 5107 | CLK_LOOKUP("mdp_pclk", mdp_p_clk.c, NULL), |
Matt Wagantall | c9a780c | 2011-10-28 12:12:18 -0700 | [diff] [blame] | 5108 | CLK_LOOKUP("iface_clk", mdp_p_clk.c, "footswitch-8x60.4"), |
Stepan Moskovchenko | 279b785 | 2012-01-31 20:42:46 -0800 | [diff] [blame] | 5109 | CLK_LOOKUP("iface_clk", smmu_p_clk.c, "msm_iommu"), |
Matt Wagantall | bb90da9 | 2011-10-25 15:07:52 -0700 | [diff] [blame] | 5110 | CLK_LOOKUP("iface_clk", rot_p_clk.c, "msm_rotator.0"), |
Matt Wagantall | c9a780c | 2011-10-28 12:12:18 -0700 | [diff] [blame] | 5111 | CLK_LOOKUP("iface_clk", rot_p_clk.c, "footswitch-8x60.6"), |
Greg Grisco | fa47b53 | 2011-11-11 10:32:06 -0800 | [diff] [blame] | 5112 | CLK_LOOKUP("iface_clk", vcodec_p_clk.c, "msm_vidc.0"), |
Matt Wagantall | c9a780c | 2011-10-28 12:12:18 -0700 | [diff] [blame] | 5113 | CLK_LOOKUP("iface_clk", vcodec_p_clk.c, "footswitch-8x60.7"), |
Kevin Chan | d07220e | 2012-02-13 15:52:22 -0800 | [diff] [blame] | 5114 | CLK_LOOKUP("vfe_pclk", vfe_p_clk.c, "msm_vfe.0"), |
Matt Wagantall | c9a780c | 2011-10-28 12:12:18 -0700 | [diff] [blame] | 5115 | CLK_LOOKUP("iface_clk", vfe_p_clk.c, "footswitch-8x60.8"), |
Kevin Chan | b20742b | 2012-02-27 15:47:35 -0800 | [diff] [blame] | 5116 | CLK_LOOKUP("vpe_pclk", vpe_p_clk.c, "msm_vpe.0"), |
Matt Wagantall | 6128631 | 2012-02-22 15:55:09 -0800 | [diff] [blame] | 5117 | CLK_LOOKUP("iface_clk", vpe_p_clk.c, "footswitch-8x60.9"), |
Tianyi Gou | 21a0e80 | 2012-02-04 22:34:10 -0800 | [diff] [blame] | 5118 | |
Kuirong Wang | a9c3acc | 2012-02-09 17:00:45 -0800 | [diff] [blame] | 5119 | CLK_LOOKUP("bit_clk", mi2s_bit_clk.c, "msm-dai-q6.6"), |
| 5120 | CLK_LOOKUP("osr_clk", mi2s_osr_clk.c, "msm-dai-q6.6"), |
| 5121 | CLK_LOOKUP("bit_clk", codec_i2s_mic_bit_clk.c, |
| 5122 | "msm-dai-q6.1"), |
| 5123 | CLK_LOOKUP("osr_clk", codec_i2s_mic_osr_clk.c, |
| 5124 | "msm-dai-q6.1"), |
| 5125 | CLK_LOOKUP("bit_clk", spare_i2s_mic_bit_clk.c, |
| 5126 | "msm-dai-q6.5"), |
| 5127 | CLK_LOOKUP("osr_clk", spare_i2s_mic_osr_clk.c, |
| 5128 | "msm-dai-q6.5"), |
| 5129 | CLK_LOOKUP("bit_clk", codec_i2s_spkr_bit_clk.c, |
| 5130 | "msm-dai-q6.16384"), |
| 5131 | CLK_LOOKUP("osr_clk", codec_i2s_spkr_osr_clk.c, |
| 5132 | "msm-dai-q6.16384"), |
| 5133 | CLK_LOOKUP("bit_clk", spare_i2s_spkr_bit_clk.c, |
| 5134 | "msm-dai-q6.4"), |
| 5135 | CLK_LOOKUP("osr_clk", spare_i2s_spkr_osr_clk.c, |
| 5136 | "msm-dai-q6.4"), |
| 5137 | CLK_LOOKUP("pcm_clk", pcm_clk.c, "msm-dai-q6.2"), |
Kiran Kandi | 5f4ab69 | 2012-02-23 11:23:56 -0800 | [diff] [blame] | 5138 | CLK_LOOKUP("pcm_clk", pcm_clk.c, "msm-dai-q6.3"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5139 | CLK_LOOKUP("sps_slimbus_clk", sps_slimbus_clk.c, ""), |
Tianyi Gou | 44a81b0 | 2012-02-06 17:49:07 -0800 | [diff] [blame] | 5140 | CLK_LOOKUP("core_clk", audio_slimbus_clk.c, "msm_slim_ctrl.1"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5141 | CLK_LOOKUP("core_clk", jpegd_axi_clk.c, ""), |
| 5142 | CLK_LOOKUP("core_clk", vpe_axi_clk.c, ""), |
| 5143 | CLK_LOOKUP("core_clk", mdp_axi_clk.c, ""), |
| 5144 | CLK_LOOKUP("core_clk", vcap_axi_clk.c, ""), |
| 5145 | CLK_LOOKUP("core_clk", rot_axi_clk.c, ""), |
| 5146 | CLK_LOOKUP("core_clk", ijpeg_axi_clk.c, ""), |
| 5147 | CLK_LOOKUP("core_clk", vfe_axi_clk.c, ""), |
| 5148 | CLK_LOOKUP("core_clk", vcodec_axi_a_clk.c, ""), |
| 5149 | CLK_LOOKUP("core_clk", vcodec_axi_b_clk.c, ""), |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 5150 | CLK_LOOKUP("core_clk", gfx3d_axi_clk_8064.c, ""), |
Tianyi Gou | 21a0e80 | 2012-02-04 22:34:10 -0800 | [diff] [blame] | 5151 | |
| 5152 | CLK_LOOKUP("dfab_dsps_clk", dfab_dsps_clk.c, NULL), |
| 5153 | CLK_LOOKUP("core_clk", dfab_usb_hs_clk.c, "msm_otg"), |
| 5154 | CLK_LOOKUP("core_clk", dfab_usb_hs3_clk.c, "msm_ehci_host.0"), |
| 5155 | CLK_LOOKUP("core_clk", dfab_usb_hs3_clk.c, "msm_ehci_host.1"), |
| 5156 | CLK_LOOKUP("bus_clk", dfab_sdc1_clk.c, "msm_sdcc.1"), |
| 5157 | CLK_LOOKUP("bus_clk", dfab_sdc2_clk.c, "msm_sdcc.2"), |
| 5158 | CLK_LOOKUP("bus_clk", dfab_sdc3_clk.c, "msm_sdcc.3"), |
| 5159 | CLK_LOOKUP("bus_clk", dfab_sdc4_clk.c, "msm_sdcc.4"), |
| 5160 | CLK_LOOKUP("dfab_clk", dfab_sps_clk.c, "msm_sps"), |
| 5161 | CLK_LOOKUP("bus_clk", dfab_bam_dmux_clk.c, "BAM_RMNT"), |
| 5162 | CLK_LOOKUP("bus_clk", dfab_scm_clk.c, "scm"), |
Ramesh Masavarapu | a1bc0e4 | 2012-03-05 07:42:48 -0800 | [diff] [blame] | 5163 | CLK_LOOKUP("bus_clk", dfab_qseecom_clk.c, "qseecom"), |
Ramesh Masavarapu | eb6e934 | 2012-02-13 19:59:50 -0800 | [diff] [blame] | 5164 | CLK_LOOKUP("bus_clk", dfab_tzcom_clk.c, "tzcom"), |
Tianyi Gou | 21a0e80 | 2012-02-04 22:34:10 -0800 | [diff] [blame] | 5165 | |
Manu Gautam | 5143b25 | 2012-01-05 19:25:23 -0800 | [diff] [blame] | 5166 | CLK_LOOKUP("alt_core_clk", usb_hsic_xcvr_fs_clk.c, "msm_hsic_host"), |
| 5167 | CLK_LOOKUP("phy_clk", usb_hsic_hsic_clk.c, "msm_hsic_host"), |
| 5168 | CLK_LOOKUP("cal_clk", usb_hsic_hsio_cal_clk.c, "msm_hsic_host"), |
| 5169 | CLK_LOOKUP("core_clk", usb_hsic_system_clk.c, "msm_hsic_host"), |
| 5170 | CLK_LOOKUP("iface_clk", usb_hsic_p_clk.c, "msm_hsic_host"), |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 5171 | |
Stepan Moskovchenko | 279b785 | 2012-01-31 20:42:46 -0800 | [diff] [blame] | 5172 | CLK_LOOKUP("core_clk", jpegd_axi_clk.c, "msm_iommu.0"), |
| 5173 | CLK_LOOKUP("core_clk", vpe_axi_clk.c, "msm_iommu.1"), |
| 5174 | CLK_LOOKUP("core_clk", mdp_axi_clk.c, "msm_iommu.2"), |
| 5175 | CLK_LOOKUP("core_clk", mdp_axi_clk.c, "msm_iommu.3"), |
| 5176 | CLK_LOOKUP("core_clk", rot_axi_clk.c, "msm_iommu.4"), |
| 5177 | CLK_LOOKUP("core_clk", ijpeg_axi_clk.c, "msm_iommu.5"), |
| 5178 | CLK_LOOKUP("core_clk", vfe_axi_clk.c, "msm_iommu.6"), |
| 5179 | CLK_LOOKUP("core_clk", vcodec_axi_a_clk.c, "msm_iommu.7"), |
| 5180 | CLK_LOOKUP("core_clk", vcodec_axi_b_clk.c, "msm_iommu.8"), |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 5181 | CLK_LOOKUP("core_clk", gfx3d_axi_clk_8064.c, "msm_iommu.9"), |
| 5182 | CLK_LOOKUP("core_clk", gfx3d_axi_clk_8064.c, "msm_iommu.10"), |
Stepan Moskovchenko | 279b785 | 2012-01-31 20:42:46 -0800 | [diff] [blame] | 5183 | CLK_LOOKUP("core_clk", vcap_axi_clk.c, "msm_iommu.11"), |
| 5184 | |
Jeff Ohlstein | 8c116c7 | 2011-10-27 17:34:48 -0700 | [diff] [blame] | 5185 | CLK_LOOKUP("mem_clk", ebi1_adm_clk.c, "msm_dmov"), |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 5186 | |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5187 | CLK_LOOKUP("l2_mclk", l2_m_clk, ""), |
| 5188 | CLK_LOOKUP("krait0_mclk", krait0_m_clk, ""), |
| 5189 | CLK_LOOKUP("krait1_mclk", krait1_m_clk, ""), |
Tianyi Gou | 455c13c | 2012-02-02 16:33:24 -0800 | [diff] [blame] | 5190 | CLK_LOOKUP("krait2_mclk", krait2_m_clk, ""), |
| 5191 | CLK_LOOKUP("krait3_mclk", krait3_m_clk, ""), |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 5192 | }; |
| 5193 | |
Tianyi Gou | 3022dfd | 2012-01-25 15:50:05 -0800 | [diff] [blame] | 5194 | static struct clk_lookup msm_clocks_8960[] = { |
Stephen Boyd | 72a8035 | 2012-01-26 15:57:38 -0800 | [diff] [blame] | 5195 | CLK_LOOKUP("xo", cxo_a_clk.c, ""), |
| 5196 | CLK_LOOKUP("xo", pxo_a_clk.c, ""), |
Stephen Boyd | ed630b0 | 2012-01-26 15:26:47 -0800 | [diff] [blame] | 5197 | CLK_LOOKUP("cxo", cxo_clk.c, "wcnss_wlan.0"), |
| 5198 | CLK_LOOKUP("cxo", cxo_clk.c, "pil_riva"), |
| 5199 | CLK_LOOKUP("xo", pxo_clk.c, "pil_qdsp6v4.0"), |
| 5200 | CLK_LOOKUP("xo", cxo_clk.c, "pil_qdsp6v4.1"), |
| 5201 | CLK_LOOKUP("xo", cxo_clk.c, "pil_qdsp6v4.2"), |
Stephen Boyd | 69d35e3 | 2012-02-14 15:33:30 -0800 | [diff] [blame] | 5202 | CLK_LOOKUP("xo", cxo_clk.c, "BAM_RMNT"), |
Stephen Boyd | 5a190a8 | 2012-03-01 14:45:15 -0800 | [diff] [blame] | 5203 | CLK_LOOKUP("xo", cxo_clk.c, "msm_xo"), |
Stephen Boyd | ed630b0 | 2012-01-26 15:26:47 -0800 | [diff] [blame] | 5204 | CLK_LOOKUP("pll2", pll2_clk.c, NULL), |
| 5205 | CLK_LOOKUP("pll8", pll8_clk.c, NULL), |
| 5206 | CLK_LOOKUP("pll4", pll4_clk.c, NULL), |
| 5207 | CLK_LOOKUP("measure", measure_clk.c, "debug"), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5208 | |
Matt Wagantall | b2710b8 | 2011-11-16 19:55:17 -0800 | [diff] [blame] | 5209 | CLK_LOOKUP("bus_clk", afab_clk.c, "msm_apps_fab"), |
| 5210 | CLK_LOOKUP("bus_a_clk", afab_a_clk.c, "msm_apps_fab"), |
| 5211 | CLK_LOOKUP("bus_clk", cfpb_clk.c, "msm_cpss_fpb"), |
| 5212 | CLK_LOOKUP("bus_a_clk", cfpb_a_clk.c, "msm_cpss_fpb"), |
| 5213 | CLK_LOOKUP("bus_clk", sfab_clk.c, "msm_sys_fab"), |
Stephen Boyd | d7a143a | 2012-02-16 17:59:26 -0800 | [diff] [blame] | 5214 | CLK_LOOKUP("bus_a_clk", sfab_msmbus_a_clk.c, "msm_sys_fab"), |
Matt Wagantall | b2710b8 | 2011-11-16 19:55:17 -0800 | [diff] [blame] | 5215 | CLK_LOOKUP("bus_clk", sfpb_clk.c, "msm_sys_fpb"), |
| 5216 | CLK_LOOKUP("bus_a_clk", sfpb_a_clk.c, "msm_sys_fpb"), |
| 5217 | CLK_LOOKUP("bus_clk", mmfab_clk.c, "msm_mm_fab"), |
| 5218 | CLK_LOOKUP("bus_a_clk", mmfab_a_clk.c, "msm_mm_fab"), |
| 5219 | CLK_LOOKUP("mem_clk", ebi1_msmbus_clk.c, "msm_bus"), |
| 5220 | CLK_LOOKUP("mem_a_clk", ebi1_a_clk.c, "msm_bus"), |
| 5221 | |
| 5222 | CLK_LOOKUP("ebi1_clk", ebi1_clk.c, NULL), |
| 5223 | CLK_LOOKUP("dfab_clk", dfab_clk.c, NULL), |
| 5224 | CLK_LOOKUP("dfab_a_clk", dfab_a_clk.c, NULL), |
| 5225 | CLK_LOOKUP("mmfpb_clk", mmfpb_clk.c, NULL), |
| 5226 | CLK_LOOKUP("mmfpb_a_clk", mmfpb_a_clk.c, "clock-8960"), |
| 5227 | CLK_LOOKUP("cfpb_a_clk", cfpb_a_clk.c, "clock-8960"), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5228 | |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5229 | CLK_LOOKUP("core_clk", gp0_clk.c, ""), |
| 5230 | CLK_LOOKUP("core_clk", gp1_clk.c, ""), |
| 5231 | CLK_LOOKUP("core_clk", gp2_clk.c, ""), |
| 5232 | CLK_LOOKUP("core_clk", gsbi1_uart_clk.c, ""), |
| 5233 | CLK_LOOKUP("core_clk", gsbi2_uart_clk.c, ""), |
| 5234 | CLK_LOOKUP("core_clk", gsbi3_uart_clk.c, ""), |
| 5235 | CLK_LOOKUP("core_clk", gsbi4_uart_clk.c, ""), |
Matt Wagantall | e252237 | 2011-08-17 14:52:21 -0700 | [diff] [blame] | 5236 | CLK_LOOKUP("core_clk", gsbi5_uart_clk.c, "msm_serial_hsl.0"), |
| 5237 | CLK_LOOKUP("core_clk", gsbi6_uart_clk.c, "msm_serial_hs.0"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5238 | CLK_LOOKUP("core_clk", gsbi7_uart_clk.c, ""), |
| 5239 | CLK_LOOKUP("core_clk", gsbi8_uart_clk.c, ""), |
| 5240 | CLK_LOOKUP("core_clk", gsbi9_uart_clk.c, ""), |
| 5241 | CLK_LOOKUP("core_clk", gsbi10_uart_clk.c, ""), |
| 5242 | CLK_LOOKUP("core_clk", gsbi11_uart_clk.c, ""), |
| 5243 | CLK_LOOKUP("core_clk", gsbi12_uart_clk.c, ""), |
Matt Wagantall | ac29485 | 2011-08-17 15:44:58 -0700 | [diff] [blame] | 5244 | CLK_LOOKUP("core_clk", gsbi1_qup_clk.c, "spi_qsd.0"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5245 | CLK_LOOKUP("core_clk", gsbi2_qup_clk.c, ""), |
Matt Wagantall | ac29485 | 2011-08-17 15:44:58 -0700 | [diff] [blame] | 5246 | CLK_LOOKUP("core_clk", gsbi3_qup_clk.c, "qup_i2c.3"), |
| 5247 | CLK_LOOKUP("core_clk", gsbi4_qup_clk.c, "qup_i2c.4"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5248 | CLK_LOOKUP("core_clk", gsbi5_qup_clk.c, ""), |
| 5249 | CLK_LOOKUP("core_clk", gsbi6_qup_clk.c, ""), |
| 5250 | CLK_LOOKUP("core_clk", gsbi7_qup_clk.c, ""), |
| 5251 | CLK_LOOKUP("core_clk", gsbi8_qup_clk.c, ""), |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 5252 | CLK_LOOKUP("core_clk", gsbi9_qup_clk.c, ""), |
Matt Wagantall | ac29485 | 2011-08-17 15:44:58 -0700 | [diff] [blame] | 5253 | CLK_LOOKUP("core_clk", gsbi10_qup_clk.c, "qup_i2c.10"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5254 | CLK_LOOKUP("core_clk", gsbi11_qup_clk.c, ""), |
Matt Wagantall | ac29485 | 2011-08-17 15:44:58 -0700 | [diff] [blame] | 5255 | CLK_LOOKUP("core_clk", gsbi12_qup_clk.c, "qup_i2c.12"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5256 | CLK_LOOKUP("core_clk", pdm_clk.c, ""), |
Vikram Mulukutla | dd0a237 | 2011-09-19 15:58:21 -0700 | [diff] [blame] | 5257 | CLK_LOOKUP("mem_clk", pmem_clk.c, "msm_sps"), |
Matt Wagantall | c120529 | 2011-08-11 17:19:31 -0700 | [diff] [blame] | 5258 | CLK_LOOKUP("core_clk", prng_clk.c, "msm_rng.0"), |
Matt Wagantall | 37ce384 | 2011-08-17 16:00:36 -0700 | [diff] [blame] | 5259 | CLK_LOOKUP("core_clk", sdc1_clk.c, "msm_sdcc.1"), |
| 5260 | CLK_LOOKUP("core_clk", sdc2_clk.c, "msm_sdcc.2"), |
| 5261 | CLK_LOOKUP("core_clk", sdc3_clk.c, "msm_sdcc.3"), |
| 5262 | CLK_LOOKUP("core_clk", sdc4_clk.c, "msm_sdcc.4"), |
| 5263 | CLK_LOOKUP("core_clk", sdc5_clk.c, "msm_sdcc.5"), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5264 | CLK_LOOKUP("slimbus_xo_src_clk", slimbus_xo_src_clk.c, NULL), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5265 | CLK_LOOKUP("ref_clk", tsif_ref_clk.c, ""), |
| 5266 | CLK_LOOKUP("core_clk", tssc_clk.c, ""), |
Manu Gautam | 5143b25 | 2012-01-05 19:25:23 -0800 | [diff] [blame] | 5267 | CLK_LOOKUP("alt_core_clk", usb_hs1_xcvr_clk.c, "msm_otg"), |
| 5268 | CLK_LOOKUP("phy_clk", usb_phy0_clk.c, "msm_otg"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5269 | CLK_LOOKUP("alt_core_clk", usb_fs1_xcvr_clk.c, ""), |
| 5270 | CLK_LOOKUP("sys_clk", usb_fs1_sys_clk.c, ""), |
| 5271 | CLK_LOOKUP("src_clk", usb_fs1_src_clk.c, ""), |
| 5272 | CLK_LOOKUP("alt_core_clk", usb_fs2_xcvr_clk.c, ""), |
| 5273 | CLK_LOOKUP("sys_clk", usb_fs2_sys_clk.c, ""), |
| 5274 | CLK_LOOKUP("src_clk", usb_fs2_src_clk.c, ""), |
Tianyi Gou | 3022dfd | 2012-01-25 15:50:05 -0800 | [diff] [blame] | 5275 | CLK_LOOKUP("alt_core_clk", usb_hsic_xcvr_fs_clk.c, "msm_hsic_host"), |
| 5276 | CLK_LOOKUP("phy_clk", usb_hsic_hsic_clk.c, "msm_hsic_host"), |
| 5277 | CLK_LOOKUP("cal_clk", usb_hsic_hsio_cal_clk.c, "msm_hsic_host"), |
| 5278 | CLK_LOOKUP("core_clk", usb_hsic_system_clk.c, "msm_hsic_host"), |
| 5279 | CLK_LOOKUP("iface_clk", usb_hsic_p_clk.c, "msm_hsic_host"), |
Matt Wagantall | c4b3a4d | 2011-08-17 16:58:39 -0700 | [diff] [blame] | 5280 | CLK_LOOKUP("iface_clk", ce1_p_clk.c, "qce.0"), |
Matt Wagantall | e0b1145 | 2011-09-13 17:25:33 -0700 | [diff] [blame] | 5281 | CLK_LOOKUP("iface_clk", ce1_p_clk.c, "qcrypto.0"), |
Matt Wagantall | c4b3a4d | 2011-08-17 16:58:39 -0700 | [diff] [blame] | 5282 | CLK_LOOKUP("core_clk", ce1_core_clk.c, "qce.0"), |
Matt Wagantall | e0b1145 | 2011-09-13 17:25:33 -0700 | [diff] [blame] | 5283 | CLK_LOOKUP("core_clk", ce1_core_clk.c, "qcrypto.0"), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5284 | CLK_LOOKUP("dma_bam_pclk", dma_bam_p_clk.c, NULL), |
Matt Wagantall | ac29485 | 2011-08-17 15:44:58 -0700 | [diff] [blame] | 5285 | CLK_LOOKUP("iface_clk", gsbi1_p_clk.c, "spi_qsd.0"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5286 | CLK_LOOKUP("iface_clk", gsbi2_p_clk.c, ""), |
Matt Wagantall | ac29485 | 2011-08-17 15:44:58 -0700 | [diff] [blame] | 5287 | CLK_LOOKUP("iface_clk", gsbi3_p_clk.c, "qup_i2c.3"), |
| 5288 | CLK_LOOKUP("iface_clk", gsbi4_p_clk.c, "qup_i2c.4"), |
Matt Wagantall | e252237 | 2011-08-17 14:52:21 -0700 | [diff] [blame] | 5289 | CLK_LOOKUP("iface_clk", gsbi5_p_clk.c, "msm_serial_hsl.0"), |
| 5290 | CLK_LOOKUP("iface_clk", gsbi6_p_clk.c, "msm_serial_hs.0"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5291 | CLK_LOOKUP("iface_clk", gsbi7_p_clk.c, ""), |
| 5292 | CLK_LOOKUP("iface_clk", gsbi8_p_clk.c, ""), |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 5293 | CLK_LOOKUP("iface_clk", gsbi9_p_clk.c, ""), |
Matt Wagantall | ac29485 | 2011-08-17 15:44:58 -0700 | [diff] [blame] | 5294 | CLK_LOOKUP("iface_clk", gsbi10_p_clk.c, "qup_i2c.10"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5295 | CLK_LOOKUP("iface_clk", gsbi11_p_clk.c, ""), |
Matt Wagantall | ac29485 | 2011-08-17 15:44:58 -0700 | [diff] [blame] | 5296 | CLK_LOOKUP("iface_clk", gsbi12_p_clk.c, "qup_i2c.12"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5297 | CLK_LOOKUP("iface_clk", tsif_p_clk.c, ""), |
| 5298 | CLK_LOOKUP("iface_clk", usb_fs1_p_clk.c, ""), |
| 5299 | CLK_LOOKUP("iface_clk", usb_fs2_p_clk.c, ""), |
Manu Gautam | 5143b25 | 2012-01-05 19:25:23 -0800 | [diff] [blame] | 5300 | CLK_LOOKUP("iface_clk", usb_hs1_p_clk.c, "msm_otg"), |
Matt Wagantall | 37ce384 | 2011-08-17 16:00:36 -0700 | [diff] [blame] | 5301 | CLK_LOOKUP("iface_clk", sdc1_p_clk.c, "msm_sdcc.1"), |
| 5302 | CLK_LOOKUP("iface_clk", sdc2_p_clk.c, "msm_sdcc.2"), |
| 5303 | CLK_LOOKUP("iface_clk", sdc3_p_clk.c, "msm_sdcc.3"), |
| 5304 | CLK_LOOKUP("iface_clk", sdc4_p_clk.c, "msm_sdcc.4"), |
| 5305 | CLK_LOOKUP("iface_clk", sdc5_p_clk.c, "msm_sdcc.5"), |
Matt Wagantall | e1a8606 | 2011-08-18 17:46:10 -0700 | [diff] [blame] | 5306 | CLK_LOOKUP("core_clk", adm0_clk.c, "msm_dmov"), |
| 5307 | CLK_LOOKUP("iface_clk", adm0_p_clk.c, "msm_dmov"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5308 | CLK_LOOKUP("iface_clk", pmic_arb0_p_clk.c, ""), |
| 5309 | CLK_LOOKUP("iface_clk", pmic_arb1_p_clk.c, ""), |
| 5310 | CLK_LOOKUP("core_clk", pmic_ssbi2_clk.c, ""), |
| 5311 | CLK_LOOKUP("mem_clk", rpm_msg_ram_p_clk.c, ""), |
| 5312 | CLK_LOOKUP("core_clk", amp_clk.c, ""), |
Kevin Chan | 09f4e66 | 2011-12-16 08:17:02 -0800 | [diff] [blame] | 5313 | CLK_LOOKUP("cam_clk", cam0_clk.c, "4-001a"), |
| 5314 | CLK_LOOKUP("cam_clk", cam0_clk.c, "4-006c"), |
| 5315 | CLK_LOOKUP("cam_clk", cam0_clk.c, "4-0048"), |
Tianyi Gou | 3022dfd | 2012-01-25 15:50:05 -0800 | [diff] [blame] | 5316 | CLK_LOOKUP("cam_clk", cam2_clk.c, NULL), |
Sreesudhan Ramakrish Ramkumar | 8f11b8b | 2012-01-04 17:09:05 -0800 | [diff] [blame] | 5317 | CLK_LOOKUP("cam_clk", cam0_clk.c, "4-0020"), |
Sreesudhan Ramakrish Ramkumar | 3381da7 | 2012-01-27 08:08:32 -0800 | [diff] [blame] | 5318 | CLK_LOOKUP("cam_clk", cam0_clk.c, "4-0034"), |
Kevin Chan | c8b52e8 | 2011-10-25 23:20:21 -0700 | [diff] [blame] | 5319 | CLK_LOOKUP("csi_src_clk", csi0_src_clk.c, "msm_csid.0"), |
| 5320 | CLK_LOOKUP("csi_src_clk", csi1_src_clk.c, "msm_csid.1"), |
Sreesudhan Ramakrish Ramkumar | b1edcd0 | 2012-01-17 11:33:05 -0800 | [diff] [blame] | 5321 | CLK_LOOKUP("csi_src_clk", csi2_src_clk.c, "msm_csid.2"), |
Kevin Chan | c8b52e8 | 2011-10-25 23:20:21 -0700 | [diff] [blame] | 5322 | CLK_LOOKUP("csi_clk", csi0_clk.c, "msm_csid.0"), |
| 5323 | CLK_LOOKUP("csi_clk", csi1_clk.c, "msm_csid.1"), |
Sreesudhan Ramakrish Ramkumar | b1edcd0 | 2012-01-17 11:33:05 -0800 | [diff] [blame] | 5324 | CLK_LOOKUP("csi_clk", csi2_clk.c, "msm_csid.2"), |
Kevin Chan | c8b52e8 | 2011-10-25 23:20:21 -0700 | [diff] [blame] | 5325 | CLK_LOOKUP("csi_phy_clk", csi0_phy_clk.c, "msm_csid.0"), |
| 5326 | CLK_LOOKUP("csi_phy_clk", csi1_phy_clk.c, "msm_csid.1"), |
Sreesudhan Ramakrish Ramkumar | b1edcd0 | 2012-01-17 11:33:05 -0800 | [diff] [blame] | 5327 | CLK_LOOKUP("csi_phy_clk", csi2_phy_clk.c, "msm_csid.2"), |
Kevin Chan | e12c667 | 2011-10-26 11:55:26 -0700 | [diff] [blame] | 5328 | CLK_LOOKUP("csi_pix_clk", csi_pix_clk.c, "msm_ispif.0"), |
| 5329 | CLK_LOOKUP("csi_rdi_clk", csi_rdi_clk.c, "msm_ispif.0"), |
Tianyi Gou | 3022dfd | 2012-01-25 15:50:05 -0800 | [diff] [blame] | 5330 | CLK_LOOKUP("csi_src_clk", csi2_src_clk.c, NULL), |
| 5331 | CLK_LOOKUP("csi_clk", csi2_clk.c, NULL), |
| 5332 | CLK_LOOKUP("csi_pix1_clk", csi_pix1_clk.c, "msm_ispif.0"), |
| 5333 | CLK_LOOKUP("csi_rdi1_clk", csi_rdi1_clk.c, "msm_ispif.0"), |
| 5334 | CLK_LOOKUP("csi_rdi2_clk", csi_rdi2_clk.c, "msm_ispif.0"), |
| 5335 | CLK_LOOKUP("csi_phy_clk", csi2_phy_clk.c, NULL), |
| 5336 | CLK_LOOKUP("csi2phy_timer_clk", csi2phy_timer_clk.c, NULL), |
Kevin Chan | f6216f2 | 2011-10-25 18:40:11 -0700 | [diff] [blame] | 5337 | CLK_LOOKUP("csiphy_timer_src_clk", |
| 5338 | csiphy_timer_src_clk.c, "msm_csiphy.0"), |
| 5339 | CLK_LOOKUP("csiphy_timer_src_clk", |
| 5340 | csiphy_timer_src_clk.c, "msm_csiphy.1"), |
Sreesudhan Ramakrish Ramkumar | b1edcd0 | 2012-01-17 11:33:05 -0800 | [diff] [blame] | 5341 | CLK_LOOKUP("csiphy_timer_src_clk", |
| 5342 | csiphy_timer_src_clk.c, "msm_csiphy.2"), |
Kevin Chan | f6216f2 | 2011-10-25 18:40:11 -0700 | [diff] [blame] | 5343 | CLK_LOOKUP("csiphy_timer_clk", csi0phy_timer_clk.c, "msm_csiphy.0"), |
| 5344 | CLK_LOOKUP("csiphy_timer_clk", csi1phy_timer_clk.c, "msm_csiphy.1"), |
Sreesudhan Ramakrish Ramkumar | b1edcd0 | 2012-01-17 11:33:05 -0800 | [diff] [blame] | 5345 | CLK_LOOKUP("csiphy_timer_clk", csi2phy_timer_clk.c, "msm_csiphy.2"), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5346 | CLK_LOOKUP("dsi_byte_div_clk", dsi1_byte_clk.c, NULL), |
| 5347 | CLK_LOOKUP("dsi_byte_div_clk", dsi2_byte_clk.c, NULL), |
| 5348 | CLK_LOOKUP("dsi_esc_clk", dsi1_esc_clk.c, NULL), |
| 5349 | CLK_LOOKUP("dsi_esc_clk", dsi2_esc_clk.c, NULL), |
Matt Wagantall | 9dc0163 | 2011-08-17 18:55:04 -0700 | [diff] [blame] | 5350 | CLK_LOOKUP("core_clk", gfx2d0_clk.c, "kgsl-2d0.0"), |
Matt Wagantall | 4972271 | 2011-08-17 18:50:53 -0700 | [diff] [blame] | 5351 | CLK_LOOKUP("core_clk", gfx2d0_clk.c, "footswitch-8x60.0"), |
Matt Wagantall | 9dc0163 | 2011-08-17 18:55:04 -0700 | [diff] [blame] | 5352 | CLK_LOOKUP("core_clk", gfx2d1_clk.c, "kgsl-2d1.1"), |
Matt Wagantall | 4972271 | 2011-08-17 18:50:53 -0700 | [diff] [blame] | 5353 | CLK_LOOKUP("core_clk", gfx2d1_clk.c, "footswitch-8x60.1"), |
Matt Wagantall | 9dc0163 | 2011-08-17 18:55:04 -0700 | [diff] [blame] | 5354 | CLK_LOOKUP("core_clk", gfx3d_clk.c, "kgsl-3d0.0"), |
Matt Wagantall | 4972271 | 2011-08-17 18:50:53 -0700 | [diff] [blame] | 5355 | CLK_LOOKUP("core_clk", gfx3d_clk.c, "footswitch-8x60.2"), |
| 5356 | CLK_LOOKUP("bus_clk", ijpeg_axi_clk.c, "footswitch-8x60.3"), |
Jignesh Mehta | 95dd6e1 | 2011-11-18 17:21:16 -0800 | [diff] [blame] | 5357 | CLK_LOOKUP("imem_clk", imem_axi_clk.c, NULL), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5358 | CLK_LOOKUP("ijpeg_clk", ijpeg_clk.c, NULL), |
Matt Wagantall | 4972271 | 2011-08-17 18:50:53 -0700 | [diff] [blame] | 5359 | CLK_LOOKUP("core_clk", ijpeg_clk.c, "footswitch-8x60.3"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5360 | CLK_LOOKUP("core_clk", jpegd_clk.c, ""), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5361 | CLK_LOOKUP("mdp_clk", mdp_clk.c, NULL), |
Matt Wagantall | 4972271 | 2011-08-17 18:50:53 -0700 | [diff] [blame] | 5362 | CLK_LOOKUP("core_clk", mdp_clk.c, "footswitch-8x60.4"), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5363 | CLK_LOOKUP("mdp_vsync_clk", mdp_vsync_clk.c, NULL), |
Matt Wagantall | b82a513 | 2011-12-12 22:26:41 -0800 | [diff] [blame] | 5364 | CLK_LOOKUP("vsync_clk", mdp_vsync_clk.c, "footswitch-8x60.4"), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5365 | CLK_LOOKUP("lut_mdp", lut_mdp_clk.c, NULL), |
Matt Wagantall | b82a513 | 2011-12-12 22:26:41 -0800 | [diff] [blame] | 5366 | CLK_LOOKUP("lut_clk", lut_mdp_clk.c, "footswitch-8x60.4"), |
Matt Wagantall | bb90da9 | 2011-10-25 15:07:52 -0700 | [diff] [blame] | 5367 | CLK_LOOKUP("core_clk", rot_clk.c, "msm_rotator.0"), |
Matt Wagantall | 4972271 | 2011-08-17 18:50:53 -0700 | [diff] [blame] | 5368 | CLK_LOOKUP("core_clk", rot_clk.c, "footswitch-8x60.6"), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5369 | CLK_LOOKUP("tv_src_clk", tv_src_clk.c, NULL), |
Matt Wagantall | b82a513 | 2011-12-12 22:26:41 -0800 | [diff] [blame] | 5370 | CLK_LOOKUP("tv_src_clk", tv_src_clk.c, "footswitch-8x60.4"), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5371 | CLK_LOOKUP("tv_enc_clk", tv_enc_clk.c, NULL), |
| 5372 | CLK_LOOKUP("tv_dac_clk", tv_dac_clk.c, NULL), |
Matt Wagantall | 3f7660b | 2011-08-17 21:25:13 -0700 | [diff] [blame] | 5373 | CLK_LOOKUP("core_clk", vcodec_clk.c, "msm_vidc.0"), |
Matt Wagantall | 4972271 | 2011-08-17 18:50:53 -0700 | [diff] [blame] | 5374 | CLK_LOOKUP("core_clk", vcodec_clk.c, "footswitch-8x60.7"), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5375 | CLK_LOOKUP("mdp_tv_clk", mdp_tv_clk.c, NULL), |
Matt Wagantall | b82a513 | 2011-12-12 22:26:41 -0800 | [diff] [blame] | 5376 | CLK_LOOKUP("tv_clk", mdp_tv_clk.c, "footswitch-8x60.4"), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5377 | CLK_LOOKUP("hdmi_clk", hdmi_tv_clk.c, NULL), |
Matt Wagantall | 5a4f1ba | 2011-08-18 18:13:03 -0700 | [diff] [blame] | 5378 | CLK_LOOKUP("core_clk", hdmi_app_clk.c, "hdmi_msm.1"), |
Kevin Chan | a085312 | 2011-11-07 19:48:44 -0800 | [diff] [blame] | 5379 | CLK_LOOKUP("vpe_clk", vpe_clk.c, "msm_vpe.0"), |
Matt Wagantall | 4972271 | 2011-08-17 18:50:53 -0700 | [diff] [blame] | 5380 | CLK_LOOKUP("core_clk", vpe_clk.c, "footswitch-8x60.9"), |
Kevin Chan | 5827c55 | 2011-10-28 18:36:32 -0700 | [diff] [blame] | 5381 | CLK_LOOKUP("vfe_clk", vfe_clk.c, "msm_vfe.0"), |
Matt Wagantall | 4972271 | 2011-08-17 18:50:53 -0700 | [diff] [blame] | 5382 | CLK_LOOKUP("core_clk", vfe_clk.c, "footswitch-8x60.8"), |
Kevin Chan | 5827c55 | 2011-10-28 18:36:32 -0700 | [diff] [blame] | 5383 | CLK_LOOKUP("csi_vfe_clk", csi_vfe_clk.c, "msm_vfe.0"), |
Matt Wagantall | 4972271 | 2011-08-17 18:50:53 -0700 | [diff] [blame] | 5384 | CLK_LOOKUP("bus_clk", vfe_axi_clk.c, "footswitch-8x60.8"), |
| 5385 | CLK_LOOKUP("bus_clk", mdp_axi_clk.c, "footswitch-8x60.4"), |
| 5386 | CLK_LOOKUP("bus_clk", rot_axi_clk.c, "footswitch-8x60.6"), |
| 5387 | CLK_LOOKUP("bus_clk", vcodec_axi_clk.c, "footswitch-8x60.7"), |
| 5388 | CLK_LOOKUP("bus_a_clk", vcodec_axi_a_clk.c, "footswitch-8x60.7"), |
| 5389 | CLK_LOOKUP("bus_b_clk", vcodec_axi_b_clk.c, "footswitch-8x60.7"), |
| 5390 | CLK_LOOKUP("bus_clk", vpe_axi_clk.c, "footswitch-8x60.9"), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5391 | CLK_LOOKUP("amp_pclk", amp_p_clk.c, NULL), |
Kevin Chan | c8b52e8 | 2011-10-25 23:20:21 -0700 | [diff] [blame] | 5392 | CLK_LOOKUP("csi_pclk", csi_p_clk.c, "msm_csid.0"), |
| 5393 | CLK_LOOKUP("csi_pclk", csi_p_clk.c, "msm_csid.1"), |
Sreesudhan Ramakrish Ramkumar | b1edcd0 | 2012-01-17 11:33:05 -0800 | [diff] [blame] | 5394 | CLK_LOOKUP("csi_pclk", csi_p_clk.c, "msm_csid.2"), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5395 | CLK_LOOKUP("dsi_m_pclk", dsi1_m_p_clk.c, NULL), |
| 5396 | CLK_LOOKUP("dsi_s_pclk", dsi1_s_p_clk.c, NULL), |
| 5397 | CLK_LOOKUP("dsi_m_pclk", dsi2_m_p_clk.c, NULL), |
| 5398 | CLK_LOOKUP("dsi_s_pclk", dsi2_s_p_clk.c, NULL), |
Matt Wagantall | 9dc0163 | 2011-08-17 18:55:04 -0700 | [diff] [blame] | 5399 | CLK_LOOKUP("iface_clk", gfx2d0_p_clk.c, "kgsl-2d0.0"), |
Matt Wagantall | 4972271 | 2011-08-17 18:50:53 -0700 | [diff] [blame] | 5400 | CLK_LOOKUP("iface_clk", gfx2d0_p_clk.c, "footswitch-8x60.0"), |
Matt Wagantall | 9dc0163 | 2011-08-17 18:55:04 -0700 | [diff] [blame] | 5401 | CLK_LOOKUP("iface_clk", gfx2d1_p_clk.c, "kgsl-2d1.1"), |
Matt Wagantall | 4972271 | 2011-08-17 18:50:53 -0700 | [diff] [blame] | 5402 | CLK_LOOKUP("iface_clk", gfx2d1_p_clk.c, "footswitch-8x60.1"), |
Matt Wagantall | 9dc0163 | 2011-08-17 18:55:04 -0700 | [diff] [blame] | 5403 | CLK_LOOKUP("iface_clk", gfx3d_p_clk.c, "kgsl-3d0.0"), |
Matt Wagantall | 4972271 | 2011-08-17 18:50:53 -0700 | [diff] [blame] | 5404 | CLK_LOOKUP("iface_clk", gfx3d_p_clk.c, "footswitch-8x60.2"), |
Matt Wagantall | 5a4f1ba | 2011-08-18 18:13:03 -0700 | [diff] [blame] | 5405 | CLK_LOOKUP("master_iface_clk", hdmi_m_p_clk.c, "hdmi_msm.1"), |
| 5406 | CLK_LOOKUP("slave_iface_clk", hdmi_s_p_clk.c, "hdmi_msm.1"), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5407 | CLK_LOOKUP("ijpeg_pclk", ijpeg_p_clk.c, NULL), |
Matt Wagantall | 4972271 | 2011-08-17 18:50:53 -0700 | [diff] [blame] | 5408 | CLK_LOOKUP("iface_clk", ijpeg_p_clk.c, "footswitch-8x60.3"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5409 | CLK_LOOKUP("iface_clk", jpegd_p_clk.c, ""), |
Matt Wagantall | 5d44ef2 | 2012-01-23 11:01:05 -0800 | [diff] [blame] | 5410 | CLK_LOOKUP("mem_iface_clk", imem_p_clk.c, "kgsl-3d0.0"), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5411 | CLK_LOOKUP("mdp_pclk", mdp_p_clk.c, NULL), |
Matt Wagantall | 4972271 | 2011-08-17 18:50:53 -0700 | [diff] [blame] | 5412 | CLK_LOOKUP("iface_clk", mdp_p_clk.c, "footswitch-8x60.4"), |
Matt Wagantall | e604d71 | 2011-10-21 15:38:18 -0700 | [diff] [blame] | 5413 | CLK_LOOKUP("iface_clk", smmu_p_clk.c, "msm_iommu"), |
Matt Wagantall | bb90da9 | 2011-10-25 15:07:52 -0700 | [diff] [blame] | 5414 | CLK_LOOKUP("iface_clk", rot_p_clk.c, "msm_rotator.0"), |
Matt Wagantall | 4972271 | 2011-08-17 18:50:53 -0700 | [diff] [blame] | 5415 | CLK_LOOKUP("iface_clk", rot_p_clk.c, "footswitch-8x60.6"), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5416 | CLK_LOOKUP("tv_enc_pclk", tv_enc_p_clk.c, NULL), |
Matt Wagantall | 3f7660b | 2011-08-17 21:25:13 -0700 | [diff] [blame] | 5417 | CLK_LOOKUP("iface_clk", vcodec_p_clk.c, "msm_vidc.0"), |
Matt Wagantall | 4972271 | 2011-08-17 18:50:53 -0700 | [diff] [blame] | 5418 | CLK_LOOKUP("iface_clk", vcodec_p_clk.c, "footswitch-8x60.7"), |
Kevin Chan | 5827c55 | 2011-10-28 18:36:32 -0700 | [diff] [blame] | 5419 | CLK_LOOKUP("vfe_pclk", vfe_p_clk.c, "msm_vfe.0"), |
Matt Wagantall | 4972271 | 2011-08-17 18:50:53 -0700 | [diff] [blame] | 5420 | CLK_LOOKUP("iface_clk", vfe_p_clk.c, "footswitch-8x60.8"), |
Kevin Chan | a085312 | 2011-11-07 19:48:44 -0800 | [diff] [blame] | 5421 | CLK_LOOKUP("vpe_pclk", vpe_p_clk.c, "msm_vpe.0"), |
Matt Wagantall | 4972271 | 2011-08-17 18:50:53 -0700 | [diff] [blame] | 5422 | CLK_LOOKUP("iface_clk", vpe_p_clk.c, "footswitch-8x60.9"), |
Kuirong Wang | a9c3acc | 2012-02-09 17:00:45 -0800 | [diff] [blame] | 5423 | CLK_LOOKUP("bit_clk", mi2s_bit_clk.c, "msm-dai-q6.6"), |
| 5424 | CLK_LOOKUP("osr_clk", mi2s_osr_clk.c, "msm-dai-q6.6"), |
| 5425 | CLK_LOOKUP("bit_clk", codec_i2s_mic_bit_clk.c, |
| 5426 | "msm-dai-q6.1"), |
| 5427 | CLK_LOOKUP("osr_clk", codec_i2s_mic_osr_clk.c, |
| 5428 | "msm-dai-q6.1"), |
| 5429 | CLK_LOOKUP("bit_clk", spare_i2s_mic_bit_clk.c, |
| 5430 | "msm-dai-q6.5"), |
| 5431 | CLK_LOOKUP("osr_clk", spare_i2s_mic_osr_clk.c, |
| 5432 | "msm-dai-q6.5"), |
| 5433 | CLK_LOOKUP("bit_clk", codec_i2s_spkr_bit_clk.c, |
| 5434 | "msm-dai-q6.16384"), |
| 5435 | CLK_LOOKUP("osr_clk", codec_i2s_spkr_osr_clk.c, |
| 5436 | "msm-dai-q6.16384"), |
| 5437 | CLK_LOOKUP("bit_clk", spare_i2s_spkr_bit_clk.c, |
| 5438 | "msm-dai-q6.4"), |
| 5439 | CLK_LOOKUP("osr_clk", spare_i2s_spkr_osr_clk.c, |
| 5440 | "msm-dai-q6.4"), |
| 5441 | CLK_LOOKUP("pcm_clk", pcm_clk.c, "msm-dai-q6.2"), |
Kiran Kandi | 5f4ab69 | 2012-02-23 11:23:56 -0800 | [diff] [blame] | 5442 | CLK_LOOKUP("pcm_clk", pcm_clk.c, "msm-dai-q6.3"), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5443 | CLK_LOOKUP("sps_slimbus_clk", sps_slimbus_clk.c, NULL), |
Tianyi Gou | 44a81b0 | 2012-02-06 17:49:07 -0800 | [diff] [blame] | 5444 | CLK_LOOKUP("core_clk", audio_slimbus_clk.c, "msm_slim_ctrl.1"), |
Matt Wagantall | e604d71 | 2011-10-21 15:38:18 -0700 | [diff] [blame] | 5445 | CLK_LOOKUP("core_clk", jpegd_axi_clk.c, "msm_iommu.0"), |
| 5446 | CLK_LOOKUP("core_clk", vpe_axi_clk.c, "msm_iommu.1"), |
| 5447 | CLK_LOOKUP("core_clk", mdp_axi_clk.c, "msm_iommu.2"), |
| 5448 | CLK_LOOKUP("core_clk", mdp_axi_clk.c, "msm_iommu.3"), |
| 5449 | CLK_LOOKUP("core_clk", rot_axi_clk.c, "msm_iommu.4"), |
| 5450 | CLK_LOOKUP("core_clk", ijpeg_axi_clk.c, "msm_iommu.5"), |
| 5451 | CLK_LOOKUP("core_clk", vfe_axi_clk.c, "msm_iommu.6"), |
| 5452 | CLK_LOOKUP("core_clk", vcodec_axi_a_clk.c, "msm_iommu.7"), |
| 5453 | CLK_LOOKUP("core_clk", vcodec_axi_b_clk.c, "msm_iommu.8"), |
| 5454 | CLK_LOOKUP("core_clk", gfx3d_clk.c, "msm_iommu.9"), |
| 5455 | CLK_LOOKUP("core_clk", gfx2d0_clk.c, "msm_iommu.10"), |
| 5456 | CLK_LOOKUP("core_clk", gfx2d1_clk.c, "msm_iommu.11"), |
Gopikrishnaiah Anandan | 4d05ed3 | 2012-01-13 11:08:44 -0800 | [diff] [blame] | 5457 | |
| 5458 | CLK_LOOKUP("mdp_iommu_clk", mdp_axi_clk.c, "msm_vidc.0"), |
| 5459 | CLK_LOOKUP("rot_iommu_clk", rot_axi_clk.c, "msm_vidc.0"), |
| 5460 | CLK_LOOKUP("vcodec_iommu0_clk", vcodec_axi_a_clk.c, "msm_vidc.0"), |
| 5461 | CLK_LOOKUP("vcodec_iommu1_clk", vcodec_axi_b_clk.c, "msm_vidc.0"), |
| 5462 | CLK_LOOKUP("smmu_iface_clk", smmu_p_clk.c, "msm_vidc.0"), |
| 5463 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5464 | CLK_LOOKUP("dfab_dsps_clk", dfab_dsps_clk.c, NULL), |
Manu Gautam | 5143b25 | 2012-01-05 19:25:23 -0800 | [diff] [blame] | 5465 | CLK_LOOKUP("core_clk", dfab_usb_hs_clk.c, "msm_otg"), |
Matt Wagantall | 37ce384 | 2011-08-17 16:00:36 -0700 | [diff] [blame] | 5466 | CLK_LOOKUP("bus_clk", dfab_sdc1_clk.c, "msm_sdcc.1"), |
| 5467 | CLK_LOOKUP("bus_clk", dfab_sdc2_clk.c, "msm_sdcc.2"), |
| 5468 | CLK_LOOKUP("bus_clk", dfab_sdc3_clk.c, "msm_sdcc.3"), |
| 5469 | CLK_LOOKUP("bus_clk", dfab_sdc4_clk.c, "msm_sdcc.4"), |
| 5470 | CLK_LOOKUP("bus_clk", dfab_sdc5_clk.c, "msm_sdcc.5"), |
Yan He | 160633e | 2011-06-30 12:18:56 -0700 | [diff] [blame] | 5471 | CLK_LOOKUP("dfab_clk", dfab_sps_clk.c, "msm_sps"), |
Stephen Boyd | 1c51a49 | 2011-10-26 12:11:47 -0700 | [diff] [blame] | 5472 | CLK_LOOKUP("bus_clk", dfab_bam_dmux_clk.c, "BAM_RMNT"), |
Stephen Boyd | ef5d1c4 | 2011-12-15 20:47:14 -0800 | [diff] [blame] | 5473 | CLK_LOOKUP("bus_clk", dfab_scm_clk.c, "scm"), |
Ramesh Masavarapu | a1bc0e4 | 2012-03-05 07:42:48 -0800 | [diff] [blame] | 5474 | CLK_LOOKUP("bus_clk", dfab_qseecom_clk.c, "qseecom"), |
Ramesh Masavarapu | eb6e934 | 2012-02-13 19:59:50 -0800 | [diff] [blame] | 5475 | CLK_LOOKUP("bus_clk", dfab_tzcom_clk.c, "tzcom"), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5476 | |
Matt Wagantall | e1a8606 | 2011-08-18 17:46:10 -0700 | [diff] [blame] | 5477 | CLK_LOOKUP("mem_clk", ebi1_adm_clk.c, "msm_dmov"), |
Matt Wagantall | 8b38f94 | 2011-08-02 18:23:18 -0700 | [diff] [blame] | 5478 | |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5479 | CLK_LOOKUP("l2_mclk", l2_m_clk, ""), |
| 5480 | CLK_LOOKUP("krait0_mclk", krait0_m_clk, ""), |
| 5481 | CLK_LOOKUP("krait1_mclk", krait1_m_clk, ""), |
| 5482 | CLK_LOOKUP("q6sw_clk", q6sw_clk, ""), |
| 5483 | CLK_LOOKUP("q6fw_clk", q6fw_clk, ""), |
| 5484 | CLK_LOOKUP("q6_func_clk", q6_func_clk, ""), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5485 | }; |
| 5486 | |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 5487 | static struct clk_lookup msm_clocks_8930[] = { |
Stephen Boyd | be1a739 | 2012-04-02 20:17:11 -0700 | [diff] [blame] | 5488 | CLK_LOOKUP("xo", cxo_clk.c, "msm_xo"), |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 5489 | CLK_LOOKUP("cxo", cxo_clk.c, "wcnss_wlan.0"), |
| 5490 | CLK_LOOKUP("cxo", cxo_clk.c, "pil_riva"), |
| 5491 | CLK_LOOKUP("xo", pxo_clk.c, "pil_qdsp6v4.0"), |
| 5492 | CLK_LOOKUP("xo", cxo_clk.c, "pil_qdsp6v4.1"), |
| 5493 | CLK_LOOKUP("xo", cxo_clk.c, "pil_qdsp6v4.2"), |
| 5494 | CLK_LOOKUP("xo", cxo_clk.c, "BAM_RMNT"), |
| 5495 | CLK_LOOKUP("pll2", pll2_clk.c, NULL), |
| 5496 | CLK_LOOKUP("pll8", pll8_clk.c, NULL), |
| 5497 | CLK_LOOKUP("pll4", pll4_clk.c, NULL), |
| 5498 | CLK_LOOKUP("measure", measure_clk.c, "debug"), |
| 5499 | |
| 5500 | CLK_LOOKUP("bus_clk", afab_clk.c, "msm_apps_fab"), |
| 5501 | CLK_LOOKUP("bus_a_clk", afab_a_clk.c, "msm_apps_fab"), |
| 5502 | CLK_LOOKUP("bus_clk", cfpb_clk.c, "msm_cpss_fpb"), |
| 5503 | CLK_LOOKUP("bus_a_clk", cfpb_a_clk.c, "msm_cpss_fpb"), |
| 5504 | CLK_LOOKUP("bus_clk", sfab_clk.c, "msm_sys_fab"), |
| 5505 | CLK_LOOKUP("bus_a_clk", sfab_msmbus_a_clk.c, "msm_sys_fab"), |
| 5506 | CLK_LOOKUP("bus_clk", sfpb_clk.c, "msm_sys_fpb"), |
| 5507 | CLK_LOOKUP("bus_a_clk", sfpb_a_clk.c, "msm_sys_fpb"), |
| 5508 | CLK_LOOKUP("bus_clk", mmfab_clk.c, "msm_mm_fab"), |
| 5509 | CLK_LOOKUP("bus_a_clk", mmfab_a_clk.c, "msm_mm_fab"), |
| 5510 | CLK_LOOKUP("mem_clk", ebi1_msmbus_clk.c, "msm_bus"), |
| 5511 | CLK_LOOKUP("mem_a_clk", ebi1_a_clk.c, "msm_bus"), |
| 5512 | |
| 5513 | CLK_LOOKUP("ebi1_clk", ebi1_clk.c, NULL), |
| 5514 | CLK_LOOKUP("dfab_clk", dfab_clk.c, NULL), |
| 5515 | CLK_LOOKUP("dfab_a_clk", dfab_a_clk.c, NULL), |
| 5516 | CLK_LOOKUP("mmfpb_clk", mmfpb_clk.c, NULL), |
| 5517 | CLK_LOOKUP("mmfpb_a_clk", mmfpb_a_clk.c, "clock-8960"), |
| 5518 | CLK_LOOKUP("cfpb_a_clk", cfpb_a_clk.c, "clock-8960"), |
| 5519 | |
| 5520 | CLK_LOOKUP("core_clk", gp0_clk.c, ""), |
| 5521 | CLK_LOOKUP("core_clk", gp1_clk.c, ""), |
| 5522 | CLK_LOOKUP("core_clk", gp2_clk.c, ""), |
| 5523 | CLK_LOOKUP("core_clk", gsbi1_uart_clk.c, ""), |
| 5524 | CLK_LOOKUP("core_clk", gsbi2_uart_clk.c, ""), |
| 5525 | CLK_LOOKUP("core_clk", gsbi3_uart_clk.c, ""), |
| 5526 | CLK_LOOKUP("core_clk", gsbi4_uart_clk.c, ""), |
| 5527 | CLK_LOOKUP("core_clk", gsbi5_uart_clk.c, "msm_serial_hsl.0"), |
| 5528 | CLK_LOOKUP("core_clk", gsbi6_uart_clk.c, "msm_serial_hs.0"), |
| 5529 | CLK_LOOKUP("core_clk", gsbi7_uart_clk.c, ""), |
| 5530 | CLK_LOOKUP("core_clk", gsbi8_uart_clk.c, ""), |
| 5531 | CLK_LOOKUP("core_clk", gsbi9_uart_clk.c, ""), |
| 5532 | CLK_LOOKUP("core_clk", gsbi10_uart_clk.c, ""), |
| 5533 | CLK_LOOKUP("core_clk", gsbi11_uart_clk.c, ""), |
| 5534 | CLK_LOOKUP("core_clk", gsbi12_uart_clk.c, ""), |
| 5535 | CLK_LOOKUP("core_clk", gsbi1_qup_clk.c, "spi_qsd.0"), |
| 5536 | CLK_LOOKUP("core_clk", gsbi2_qup_clk.c, ""), |
| 5537 | CLK_LOOKUP("core_clk", gsbi3_qup_clk.c, "qup_i2c.3"), |
| 5538 | CLK_LOOKUP("core_clk", gsbi4_qup_clk.c, "qup_i2c.4"), |
| 5539 | CLK_LOOKUP("core_clk", gsbi5_qup_clk.c, ""), |
| 5540 | CLK_LOOKUP("core_clk", gsbi6_qup_clk.c, ""), |
| 5541 | CLK_LOOKUP("core_clk", gsbi7_qup_clk.c, ""), |
| 5542 | CLK_LOOKUP("core_clk", gsbi8_qup_clk.c, ""), |
| 5543 | CLK_LOOKUP("core_clk", gsbi9_qup_clk.c, "qup_i2c.0"), |
| 5544 | CLK_LOOKUP("core_clk", gsbi10_qup_clk.c, "qup_i2c.10"), |
| 5545 | CLK_LOOKUP("core_clk", gsbi11_qup_clk.c, ""), |
| 5546 | CLK_LOOKUP("core_clk", gsbi12_qup_clk.c, "qup_i2c.12"), |
| 5547 | CLK_LOOKUP("core_clk", pdm_clk.c, ""), |
| 5548 | CLK_LOOKUP("mem_clk", pmem_clk.c, "msm_sps"), |
| 5549 | CLK_LOOKUP("core_clk", prng_clk.c, "msm_rng.0"), |
| 5550 | CLK_LOOKUP("core_clk", sdc1_clk.c, "msm_sdcc.1"), |
| 5551 | CLK_LOOKUP("core_clk", sdc2_clk.c, "msm_sdcc.2"), |
| 5552 | CLK_LOOKUP("core_clk", sdc3_clk.c, "msm_sdcc.3"), |
| 5553 | CLK_LOOKUP("core_clk", sdc4_clk.c, "msm_sdcc.4"), |
| 5554 | CLK_LOOKUP("core_clk", sdc5_clk.c, "msm_sdcc.5"), |
| 5555 | CLK_LOOKUP("ref_clk", tsif_ref_clk.c, ""), |
| 5556 | CLK_LOOKUP("core_clk", tssc_clk.c, ""), |
| 5557 | CLK_LOOKUP("alt_core_clk", usb_hs1_xcvr_clk.c, "msm_otg"), |
| 5558 | CLK_LOOKUP("phy_clk", usb_phy0_clk.c, "msm_otg"), |
| 5559 | CLK_LOOKUP("alt_core_clk", usb_fs1_xcvr_clk.c, ""), |
| 5560 | CLK_LOOKUP("sys_clk", usb_fs1_sys_clk.c, ""), |
| 5561 | CLK_LOOKUP("src_clk", usb_fs1_src_clk.c, ""), |
| 5562 | CLK_LOOKUP("alt_core_clk", usb_fs2_xcvr_clk.c, ""), |
| 5563 | CLK_LOOKUP("sys_clk", usb_fs2_sys_clk.c, ""), |
| 5564 | CLK_LOOKUP("src_clk", usb_fs2_src_clk.c, ""), |
| 5565 | CLK_LOOKUP("alt_core_clk", usb_hsic_xcvr_fs_clk.c, "msm_hsic_host"), |
| 5566 | CLK_LOOKUP("phy_clk", usb_hsic_hsic_clk.c, "msm_hsic_host"), |
| 5567 | CLK_LOOKUP("cal_clk", usb_hsic_hsio_cal_clk.c, "msm_hsic_host"), |
| 5568 | CLK_LOOKUP("core_clk", usb_hsic_system_clk.c, "msm_hsic_host"), |
| 5569 | CLK_LOOKUP("iface_clk", usb_hsic_p_clk.c, "msm_hsic_host"), |
| 5570 | CLK_LOOKUP("iface_clk", ce1_p_clk.c, "qce.0"), |
| 5571 | CLK_LOOKUP("iface_clk", ce1_p_clk.c, "qcrypto.0"), |
| 5572 | CLK_LOOKUP("core_clk", ce1_core_clk.c, "qce.0"), |
| 5573 | CLK_LOOKUP("core_clk", ce1_core_clk.c, "qcrypto.0"), |
| 5574 | CLK_LOOKUP("dma_bam_pclk", dma_bam_p_clk.c, NULL), |
| 5575 | CLK_LOOKUP("iface_clk", gsbi1_p_clk.c, "spi_qsd.0"), |
| 5576 | CLK_LOOKUP("iface_clk", gsbi2_p_clk.c, ""), |
| 5577 | CLK_LOOKUP("iface_clk", gsbi3_p_clk.c, "qup_i2c.3"), |
| 5578 | CLK_LOOKUP("iface_clk", gsbi4_p_clk.c, "qup_i2c.4"), |
| 5579 | CLK_LOOKUP("iface_clk", gsbi5_p_clk.c, "msm_serial_hsl.0"), |
| 5580 | CLK_LOOKUP("iface_clk", gsbi6_p_clk.c, "msm_serial_hs.0"), |
| 5581 | CLK_LOOKUP("iface_clk", gsbi7_p_clk.c, ""), |
| 5582 | CLK_LOOKUP("iface_clk", gsbi8_p_clk.c, ""), |
| 5583 | CLK_LOOKUP("iface_clk", gsbi9_p_clk.c, "qup_i2c.0"), |
| 5584 | CLK_LOOKUP("iface_clk", gsbi10_p_clk.c, "qup_i2c.10"), |
| 5585 | CLK_LOOKUP("iface_clk", gsbi11_p_clk.c, ""), |
| 5586 | CLK_LOOKUP("iface_clk", gsbi12_p_clk.c, "qup_i2c.12"), |
| 5587 | CLK_LOOKUP("iface_clk", tsif_p_clk.c, ""), |
| 5588 | CLK_LOOKUP("iface_clk", usb_fs1_p_clk.c, ""), |
| 5589 | CLK_LOOKUP("iface_clk", usb_fs2_p_clk.c, ""), |
| 5590 | CLK_LOOKUP("iface_clk", usb_hs1_p_clk.c, "msm_otg"), |
| 5591 | CLK_LOOKUP("iface_clk", sdc1_p_clk.c, "msm_sdcc.1"), |
| 5592 | CLK_LOOKUP("iface_clk", sdc2_p_clk.c, "msm_sdcc.2"), |
| 5593 | CLK_LOOKUP("iface_clk", sdc3_p_clk.c, "msm_sdcc.3"), |
| 5594 | CLK_LOOKUP("iface_clk", sdc4_p_clk.c, "msm_sdcc.4"), |
| 5595 | CLK_LOOKUP("iface_clk", sdc5_p_clk.c, "msm_sdcc.5"), |
| 5596 | CLK_LOOKUP("core_clk", adm0_clk.c, "msm_dmov"), |
| 5597 | CLK_LOOKUP("iface_clk", adm0_p_clk.c, "msm_dmov"), |
| 5598 | CLK_LOOKUP("iface_clk", pmic_arb0_p_clk.c, ""), |
| 5599 | CLK_LOOKUP("iface_clk", pmic_arb1_p_clk.c, ""), |
| 5600 | CLK_LOOKUP("core_clk", pmic_ssbi2_clk.c, ""), |
| 5601 | CLK_LOOKUP("mem_clk", rpm_msg_ram_p_clk.c, ""), |
| 5602 | CLK_LOOKUP("core_clk", amp_clk.c, ""), |
| 5603 | CLK_LOOKUP("cam_clk", cam0_clk.c, "4-001a"), |
| 5604 | CLK_LOOKUP("cam_clk", cam0_clk.c, "4-006c"), |
| 5605 | CLK_LOOKUP("cam_clk", cam0_clk.c, "4-0048"), |
| 5606 | CLK_LOOKUP("cam_clk", cam2_clk.c, NULL), |
| 5607 | CLK_LOOKUP("cam_clk", cam0_clk.c, "4-0020"), |
| 5608 | CLK_LOOKUP("csi_src_clk", csi0_src_clk.c, "msm_csid.0"), |
| 5609 | CLK_LOOKUP("csi_src_clk", csi1_src_clk.c, "msm_csid.1"), |
| 5610 | CLK_LOOKUP("csi_src_clk", csi2_src_clk.c, "msm_csid.2"), |
| 5611 | CLK_LOOKUP("csi_clk", csi0_clk.c, "msm_csid.0"), |
| 5612 | CLK_LOOKUP("csi_clk", csi1_clk.c, "msm_csid.1"), |
| 5613 | CLK_LOOKUP("csi_clk", csi2_clk.c, "msm_csid.2"), |
| 5614 | CLK_LOOKUP("csi_phy_clk", csi0_phy_clk.c, "msm_csid.0"), |
| 5615 | CLK_LOOKUP("csi_phy_clk", csi1_phy_clk.c, "msm_csid.1"), |
| 5616 | CLK_LOOKUP("csi_phy_clk", csi2_phy_clk.c, "msm_csid.2"), |
| 5617 | CLK_LOOKUP("csi_pix_clk", csi_pix_clk.c, "msm_ispif.0"), |
| 5618 | CLK_LOOKUP("csi_rdi_clk", csi_rdi_clk.c, "msm_ispif.0"), |
| 5619 | CLK_LOOKUP("csi_src_clk", csi2_src_clk.c, NULL), |
| 5620 | CLK_LOOKUP("csi_clk", csi2_clk.c, NULL), |
| 5621 | CLK_LOOKUP("csi_pix1_clk", csi_pix1_clk.c, "msm_ispif.0"), |
| 5622 | CLK_LOOKUP("csi_rdi1_clk", csi_rdi1_clk.c, "msm_ispif.0"), |
| 5623 | CLK_LOOKUP("csi_rdi2_clk", csi_rdi2_clk.c, "msm_ispif.0"), |
| 5624 | CLK_LOOKUP("csi_phy_clk", csi2_phy_clk.c, NULL), |
| 5625 | CLK_LOOKUP("csi2phy_timer_clk", csi2phy_timer_clk.c, NULL), |
| 5626 | CLK_LOOKUP("csiphy_timer_src_clk", |
| 5627 | csiphy_timer_src_clk.c, "msm_csiphy.0"), |
| 5628 | CLK_LOOKUP("csiphy_timer_src_clk", |
| 5629 | csiphy_timer_src_clk.c, "msm_csiphy.1"), |
| 5630 | CLK_LOOKUP("csiphy_timer_src_clk", |
| 5631 | csiphy_timer_src_clk.c, "msm_csiphy.2"), |
| 5632 | CLK_LOOKUP("csiphy_timer_clk", csi0phy_timer_clk.c, "msm_csiphy.0"), |
| 5633 | CLK_LOOKUP("csiphy_timer_clk", csi1phy_timer_clk.c, "msm_csiphy.1"), |
| 5634 | CLK_LOOKUP("csiphy_timer_clk", csi2phy_timer_clk.c, "msm_csiphy.2"), |
| 5635 | CLK_LOOKUP("dsi_byte_div_clk", dsi1_byte_clk.c, NULL), |
| 5636 | CLK_LOOKUP("dsi_esc_clk", dsi1_esc_clk.c, NULL), |
| 5637 | CLK_LOOKUP("core_clk", gfx3d_clk.c, "kgsl-3d0.0"), |
| 5638 | CLK_LOOKUP("core_clk", gfx3d_clk.c, "footswitch-8x60.2"), |
| 5639 | CLK_LOOKUP("bus_clk", |
| 5640 | gfx3d_axi_clk_8930.c, "footswitch-8x60.2"), |
| 5641 | CLK_LOOKUP("bus_clk", ijpeg_axi_clk.c, "footswitch-8x60.3"), |
| 5642 | CLK_LOOKUP("imem_clk", imem_axi_clk.c, NULL), |
| 5643 | CLK_LOOKUP("ijpeg_clk", ijpeg_clk.c, NULL), |
| 5644 | CLK_LOOKUP("core_clk", ijpeg_clk.c, "footswitch-8x60.3"), |
| 5645 | CLK_LOOKUP("mdp_clk", mdp_clk.c, NULL), |
| 5646 | CLK_LOOKUP("core_clk", mdp_clk.c, "footswitch-8x60.4"), |
| 5647 | CLK_LOOKUP("mdp_vsync_clk", mdp_vsync_clk.c, NULL), |
| 5648 | CLK_LOOKUP("vsync_clk", mdp_vsync_clk.c, "footswitch-8x60.4"), |
| 5649 | CLK_LOOKUP("lut_mdp", lut_mdp_clk.c, NULL), |
| 5650 | CLK_LOOKUP("lut_clk", lut_mdp_clk.c, "footswitch-8x60.4"), |
| 5651 | CLK_LOOKUP("core_clk", rot_clk.c, "msm_rotator.0"), |
| 5652 | CLK_LOOKUP("core_clk", rot_clk.c, "footswitch-8x60.6"), |
| 5653 | CLK_LOOKUP("tv_src_clk", tv_src_clk.c, NULL), |
| 5654 | CLK_LOOKUP("tv_src_clk", tv_src_clk.c, "footswitch-8x60.4"), |
| 5655 | CLK_LOOKUP("tv_dac_clk", tv_dac_clk.c, NULL), |
| 5656 | CLK_LOOKUP("core_clk", vcodec_clk.c, "msm_vidc.0"), |
| 5657 | CLK_LOOKUP("core_clk", vcodec_clk.c, "footswitch-8x60.7"), |
| 5658 | CLK_LOOKUP("mdp_tv_clk", mdp_tv_clk.c, NULL), |
| 5659 | CLK_LOOKUP("tv_clk", mdp_tv_clk.c, "footswitch-8x60.4"), |
| 5660 | CLK_LOOKUP("hdmi_clk", hdmi_tv_clk.c, NULL), |
| 5661 | CLK_LOOKUP("core_clk", hdmi_app_clk.c, "hdmi_msm.1"), |
| 5662 | CLK_LOOKUP("vpe_clk", vpe_clk.c, "msm_vpe.0"), |
| 5663 | CLK_LOOKUP("core_clk", vpe_clk.c, "footswitch-8x60.9"), |
| 5664 | CLK_LOOKUP("vfe_clk", vfe_clk.c, "msm_vfe.0"), |
| 5665 | CLK_LOOKUP("core_clk", vfe_clk.c, "footswitch-8x60.8"), |
| 5666 | CLK_LOOKUP("csi_vfe_clk", csi_vfe_clk.c, "msm_vfe.0"), |
| 5667 | CLK_LOOKUP("bus_clk", vfe_axi_clk.c, "footswitch-8x60.8"), |
| 5668 | CLK_LOOKUP("bus_clk", mdp_axi_clk.c, "footswitch-8x60.4"), |
| 5669 | CLK_LOOKUP("bus_clk", rot_axi_clk.c, "footswitch-8x60.6"), |
| 5670 | CLK_LOOKUP("bus_clk", vcodec_axi_clk.c, "footswitch-8x60.7"), |
| 5671 | CLK_LOOKUP("bus_a_clk", vcodec_axi_a_clk.c, "footswitch-8x60.7"), |
| 5672 | CLK_LOOKUP("bus_b_clk", vcodec_axi_b_clk.c, "footswitch-8x60.7"), |
| 5673 | CLK_LOOKUP("bus_clk", vpe_axi_clk.c, "footswitch-8x60.9"), |
| 5674 | CLK_LOOKUP("amp_pclk", amp_p_clk.c, NULL), |
| 5675 | CLK_LOOKUP("csi_pclk", csi_p_clk.c, "msm_csid.0"), |
| 5676 | CLK_LOOKUP("csi_pclk", csi_p_clk.c, "msm_csid.1"), |
| 5677 | CLK_LOOKUP("csi_pclk", csi_p_clk.c, "msm_csid.2"), |
| 5678 | CLK_LOOKUP("dsi_m_pclk", dsi1_m_p_clk.c, NULL), |
| 5679 | CLK_LOOKUP("dsi_s_pclk", dsi1_s_p_clk.c, NULL), |
| 5680 | CLK_LOOKUP("iface_clk", gfx3d_p_clk.c, "kgsl-3d0.0"), |
| 5681 | CLK_LOOKUP("iface_clk", gfx3d_p_clk.c, "footswitch-8x60.2"), |
| 5682 | CLK_LOOKUP("master_iface_clk", hdmi_m_p_clk.c, "hdmi_msm.1"), |
| 5683 | CLK_LOOKUP("slave_iface_clk", hdmi_s_p_clk.c, "hdmi_msm.1"), |
| 5684 | CLK_LOOKUP("ijpeg_pclk", ijpeg_p_clk.c, NULL), |
| 5685 | CLK_LOOKUP("iface_clk", ijpeg_p_clk.c, "footswitch-8x60.3"), |
| 5686 | CLK_LOOKUP("mem_iface_clk", imem_p_clk.c, "kgsl-3d0.0"), |
| 5687 | CLK_LOOKUP("mdp_pclk", mdp_p_clk.c, NULL), |
| 5688 | CLK_LOOKUP("iface_clk", mdp_p_clk.c, "footswitch-8x60.4"), |
| 5689 | CLK_LOOKUP("iface_clk", smmu_p_clk.c, "msm_iommu"), |
| 5690 | CLK_LOOKUP("iface_clk", rot_p_clk.c, "msm_rotator.0"), |
| 5691 | CLK_LOOKUP("iface_clk", rot_p_clk.c, "footswitch-8x60.6"), |
| 5692 | CLK_LOOKUP("iface_clk", vcodec_p_clk.c, "msm_vidc.0"), |
| 5693 | CLK_LOOKUP("iface_clk", vcodec_p_clk.c, "footswitch-8x60.7"), |
| 5694 | CLK_LOOKUP("vfe_pclk", vfe_p_clk.c, "msm_vfe.0"), |
| 5695 | CLK_LOOKUP("iface_clk", vfe_p_clk.c, "footswitch-8x60.8"), |
| 5696 | CLK_LOOKUP("vpe_pclk", vpe_p_clk.c, "msm_vpe.0"), |
| 5697 | CLK_LOOKUP("iface_clk", vpe_p_clk.c, "footswitch-8x60.9"), |
| 5698 | CLK_LOOKUP("bit_clk", mi2s_bit_clk.c, "msm-dai-q6.6"), |
| 5699 | CLK_LOOKUP("osr_clk", mi2s_osr_clk.c, "msm-dai-q6.6"), |
| 5700 | CLK_LOOKUP("bit_clk", codec_i2s_mic_bit_clk.c, |
| 5701 | "msm-dai-q6.1"), |
| 5702 | CLK_LOOKUP("osr_clk", codec_i2s_mic_osr_clk.c, |
| 5703 | "msm-dai-q6.1"), |
| 5704 | CLK_LOOKUP("bit_clk", spare_i2s_mic_bit_clk.c, |
| 5705 | "msm-dai-q6.5"), |
| 5706 | CLK_LOOKUP("osr_clk", spare_i2s_mic_osr_clk.c, |
| 5707 | "msm-dai-q6.5"), |
| 5708 | CLK_LOOKUP("bit_clk", codec_i2s_spkr_bit_clk.c, |
| 5709 | "msm-dai-q6.16384"), |
| 5710 | CLK_LOOKUP("osr_clk", codec_i2s_spkr_osr_clk.c, |
| 5711 | "msm-dai-q6.16384"), |
| 5712 | CLK_LOOKUP("bit_clk", spare_i2s_spkr_bit_clk.c, |
| 5713 | "msm-dai-q6.4"), |
| 5714 | CLK_LOOKUP("osr_clk", spare_i2s_spkr_osr_clk.c, |
| 5715 | "msm-dai-q6.4"), |
| 5716 | CLK_LOOKUP("pcm_clk", pcm_clk.c, "msm-dai-q6.2"), |
| 5717 | CLK_LOOKUP("sps_slimbus_clk", sps_slimbus_clk.c, NULL), |
| 5718 | CLK_LOOKUP("core_clk", audio_slimbus_clk.c, "msm_slim_ctrl.1"), |
| 5719 | CLK_LOOKUP("core_clk", vpe_axi_clk.c, "msm_iommu.1"), |
| 5720 | CLK_LOOKUP("core_clk", mdp_axi_clk.c, "msm_iommu.2"), |
| 5721 | CLK_LOOKUP("core_clk", mdp_axi_clk.c, "msm_iommu.3"), |
| 5722 | CLK_LOOKUP("core_clk", rot_axi_clk.c, "msm_iommu.4"), |
| 5723 | CLK_LOOKUP("core_clk", ijpeg_axi_clk.c, "msm_iommu.5"), |
| 5724 | CLK_LOOKUP("core_clk", vfe_axi_clk.c, "msm_iommu.6"), |
| 5725 | CLK_LOOKUP("core_clk", vcodec_axi_a_clk.c, "msm_iommu.7"), |
| 5726 | CLK_LOOKUP("core_clk", vcodec_axi_b_clk.c, "msm_iommu.8"), |
| 5727 | CLK_LOOKUP("core_clk", gfx3d_axi_clk_8930.c, "msm_iommu.9"), |
| 5728 | CLK_LOOKUP("core_clk", gfx3d_axi_clk_8930.c, "msm_iommu.10"), |
| 5729 | |
| 5730 | CLK_LOOKUP("mdp_iommu_clk", mdp_axi_clk.c, "msm_vidc.0"), |
| 5731 | CLK_LOOKUP("rot_iommu_clk", rot_axi_clk.c, "msm_vidc.0"), |
| 5732 | CLK_LOOKUP("vcodec_iommu0_clk", vcodec_axi_a_clk.c, "msm_vidc.0"), |
| 5733 | CLK_LOOKUP("vcodec_iommu1_clk", vcodec_axi_b_clk.c, "msm_vidc.0"), |
| 5734 | CLK_LOOKUP("smmu_iface_clk", smmu_p_clk.c, "msm_vidc.0"), |
| 5735 | |
| 5736 | CLK_LOOKUP("dfab_dsps_clk", dfab_dsps_clk.c, NULL), |
| 5737 | CLK_LOOKUP("core_clk", dfab_usb_hs_clk.c, "msm_otg"), |
| 5738 | CLK_LOOKUP("bus_clk", dfab_sdc1_clk.c, "msm_sdcc.1"), |
| 5739 | CLK_LOOKUP("bus_clk", dfab_sdc2_clk.c, "msm_sdcc.2"), |
| 5740 | CLK_LOOKUP("bus_clk", dfab_sdc3_clk.c, "msm_sdcc.3"), |
| 5741 | CLK_LOOKUP("bus_clk", dfab_sdc4_clk.c, "msm_sdcc.4"), |
| 5742 | CLK_LOOKUP("bus_clk", dfab_sdc5_clk.c, "msm_sdcc.5"), |
| 5743 | CLK_LOOKUP("dfab_clk", dfab_sps_clk.c, "msm_sps"), |
| 5744 | CLK_LOOKUP("bus_clk", dfab_bam_dmux_clk.c, "BAM_RMNT"), |
| 5745 | CLK_LOOKUP("bus_clk", dfab_scm_clk.c, "scm"), |
| 5746 | CLK_LOOKUP("bus_clk", dfab_qseecom_clk.c, "qseecom"), |
| 5747 | |
| 5748 | CLK_LOOKUP("mem_clk", ebi1_adm_clk.c, "msm_dmov"), |
| 5749 | |
| 5750 | CLK_LOOKUP("l2_mclk", l2_m_clk, ""), |
| 5751 | CLK_LOOKUP("krait0_mclk", krait0_m_clk, ""), |
| 5752 | CLK_LOOKUP("krait1_mclk", krait1_m_clk, ""), |
| 5753 | CLK_LOOKUP("q6sw_clk", q6sw_clk, ""), |
| 5754 | CLK_LOOKUP("q6fw_clk", q6fw_clk, ""), |
| 5755 | CLK_LOOKUP("q6_func_clk", q6_func_clk, ""), |
| 5756 | }; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5757 | /* |
| 5758 | * Miscellaneous clock register initializations |
| 5759 | */ |
| 5760 | |
| 5761 | /* Read, modify, then write-back a register. */ |
| 5762 | static void __init rmwreg(uint32_t val, void *reg, uint32_t mask) |
| 5763 | { |
| 5764 | uint32_t regval = readl_relaxed(reg); |
| 5765 | regval &= ~mask; |
| 5766 | regval |= val; |
| 5767 | writel_relaxed(regval, reg); |
| 5768 | } |
| 5769 | |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 5770 | static void __init set_fsm_mode(void __iomem *mode_reg) |
| 5771 | { |
| 5772 | u32 regval = readl_relaxed(mode_reg); |
| 5773 | |
| 5774 | /*De-assert reset to FSM */ |
| 5775 | regval &= ~BIT(21); |
| 5776 | writel_relaxed(regval, mode_reg); |
| 5777 | |
| 5778 | /* Program bias count */ |
Tianyi Gou | 358c386 | 2011-10-18 17:03:41 -0700 | [diff] [blame] | 5779 | regval &= ~BM(19, 14); |
| 5780 | regval |= BVAL(19, 14, 0x1); |
| 5781 | writel_relaxed(regval, mode_reg); |
| 5782 | |
| 5783 | /* Program lock count */ |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 5784 | regval &= ~BM(13, 8); |
| 5785 | regval |= BVAL(13, 8, 0x8); |
| 5786 | writel_relaxed(regval, mode_reg); |
| 5787 | |
| 5788 | /*Enable PLL FSM voting */ |
| 5789 | regval |= BIT(20); |
| 5790 | writel_relaxed(regval, mode_reg); |
| 5791 | } |
| 5792 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5793 | static void __init reg_init(void) |
| 5794 | { |
Stephen Boyd | d471e7a | 2011-11-19 01:37:39 -0800 | [diff] [blame] | 5795 | void __iomem *imem_reg; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5796 | /* Deassert MM SW_RESET_ALL signal. */ |
| 5797 | writel_relaxed(0, SW_RESET_ALL_REG); |
| 5798 | |
Tianyi Gou | 8c1a118 | 2011-10-10 14:47:11 -0700 | [diff] [blame] | 5799 | /* |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 5800 | * Some bits are only used on 8960 or 8064 or 8930 and are marked as |
| 5801 | * reserved bits on the other SoCs. Writing to these reserved bits |
Tianyi Gou | 8c1a118 | 2011-10-10 14:47:11 -0700 | [diff] [blame] | 5802 | * should have no effect. |
| 5803 | */ |
Stephen Boyd | d471e7a | 2011-11-19 01:37:39 -0800 | [diff] [blame] | 5804 | /* |
| 5805 | * Initialize MM AHB registers: Enable the FPB clock and disable HW |
Tianyi Gou | 3022dfd | 2012-01-25 15:50:05 -0800 | [diff] [blame] | 5806 | * gating on non-8960 for all clocks. Also set VFE_AHB's |
Stephen Boyd | d471e7a | 2011-11-19 01:37:39 -0800 | [diff] [blame] | 5807 | * FORCE_CORE_ON bit to prevent its memory from being collapsed when |
| 5808 | * the clock is halted. The sleep and wake-up delays are set to safe |
| 5809 | * values. |
| 5810 | */ |
Tianyi Gou | 3022dfd | 2012-01-25 15:50:05 -0800 | [diff] [blame] | 5811 | if (cpu_is_msm8960()) { |
Stephen Boyd | d471e7a | 2011-11-19 01:37:39 -0800 | [diff] [blame] | 5812 | rmwreg(0x44000000, AHB_EN_REG, 0x6C000103); |
| 5813 | writel_relaxed(0x3C7097F9, AHB_EN2_REG); |
| 5814 | } else { |
| 5815 | rmwreg(0x00000003, AHB_EN_REG, 0x6C000103); |
| 5816 | writel_relaxed(0x000007F9, AHB_EN2_REG); |
| 5817 | } |
Tianyi Gou | 8c1a118 | 2011-10-10 14:47:11 -0700 | [diff] [blame] | 5818 | if (cpu_is_apq8064()) |
| 5819 | rmwreg(0x00000000, AHB_EN3_REG, 0x00000001); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5820 | |
| 5821 | /* Deassert all locally-owned MM AHB resets. */ |
| 5822 | rmwreg(0, SW_RESET_AHB_REG, 0xFFF7DFFF); |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 5823 | rmwreg(0, SW_RESET_AHB2_REG, 0x0000000F); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5824 | |
| 5825 | /* Initialize MM AXI registers: Enable HW gating for all clocks that |
| 5826 | * support it. Also set FORCE_CORE_ON bits, and any sleep and wake-up |
| 5827 | * delays to safe values. */ |
Stephen Boyd | d471e7a | 2011-11-19 01:37:39 -0800 | [diff] [blame] | 5828 | if (cpu_is_msm8960() && |
| 5829 | SOCINFO_VERSION_MAJOR(socinfo_get_version()) >= 3) { |
| 5830 | rmwreg(0x0003AFF9, MAXI_EN_REG, 0x0803FFFF); |
| 5831 | rmwreg(0x3A27FCFF, MAXI_EN2_REG, 0x3A3FFFFF); |
Gopikrishnaiah Anandan | 83b6e85 | 2012-01-05 17:47:02 -0800 | [diff] [blame] | 5832 | rmwreg(0x0027FCFF, MAXI_EN4_REG, 0x017FFFFF); |
Stephen Boyd | d471e7a | 2011-11-19 01:37:39 -0800 | [diff] [blame] | 5833 | } else { |
| 5834 | rmwreg(0x000007F9, MAXI_EN_REG, 0x0803FFFF); |
| 5835 | rmwreg(0x3027FCFF, MAXI_EN2_REG, 0x3A3FFFFF); |
| 5836 | rmwreg(0x0027FCFF, MAXI_EN4_REG, 0x017FFFFF); |
| 5837 | } |
Matt Wagantall | 53d968f | 2011-07-19 13:22:53 -0700 | [diff] [blame] | 5838 | rmwreg(0x0027FCFF, MAXI_EN3_REG, 0x003FFFFF); |
Tianyi Gou | 8c1a118 | 2011-10-10 14:47:11 -0700 | [diff] [blame] | 5839 | if (cpu_is_apq8064()) |
| 5840 | rmwreg(0x009FE4FF, MAXI_EN5_REG, 0x01FFEFFF); |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 5841 | if (cpu_is_msm8930()) |
| 5842 | rmwreg(0x000004FF, MAXI_EN5_REG, 0x00000FFF); |
Tianyi Gou | 3022dfd | 2012-01-25 15:50:05 -0800 | [diff] [blame] | 5843 | if (cpu_is_msm8960()) |
Stephen Boyd | d471e7a | 2011-11-19 01:37:39 -0800 | [diff] [blame] | 5844 | rmwreg(0x00003C38, SAXI_EN_REG, 0x00003FFF); |
| 5845 | else |
| 5846 | rmwreg(0x000003C7, SAXI_EN_REG, 0x00003FFF); |
| 5847 | |
| 5848 | /* Enable IMEM's clk_on signal */ |
| 5849 | imem_reg = ioremap(0x04b00040, 4); |
| 5850 | if (imem_reg) { |
| 5851 | writel_relaxed(0x3, imem_reg); |
| 5852 | iounmap(imem_reg); |
| 5853 | } |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5854 | |
| 5855 | /* Initialize MM CC registers: Set MM FORCE_CORE_ON bits so that core |
| 5856 | * memories retain state even when not clocked. Also, set sleep and |
| 5857 | * wake-up delays to safe values. */ |
Matt Wagantall | 53d968f | 2011-07-19 13:22:53 -0700 | [diff] [blame] | 5858 | rmwreg(0x00000000, CSI0_CC_REG, 0x00000410); |
| 5859 | rmwreg(0x00000000, CSI1_CC_REG, 0x00000410); |
| 5860 | rmwreg(0x80FF0000, DSI1_BYTE_CC_REG, 0xE0FF0010); |
Matt Wagantall | 53d968f | 2011-07-19 13:22:53 -0700 | [diff] [blame] | 5861 | rmwreg(0x80FF0000, DSI_PIXEL_CC_REG, 0xE0FF0010); |
Tarun Karra | 6fbc00a | 2011-12-13 09:23:47 -0700 | [diff] [blame] | 5862 | rmwreg(0xC0FF0000, GFX3D_CC_REG, 0xE0FF0010); |
Matt Wagantall | 53d968f | 2011-07-19 13:22:53 -0700 | [diff] [blame] | 5863 | rmwreg(0x80FF0000, IJPEG_CC_REG, 0xE0FF0010); |
Matt Wagantall | 53d968f | 2011-07-19 13:22:53 -0700 | [diff] [blame] | 5864 | rmwreg(0x80FF0000, MDP_CC_REG, 0xE1FF0010); |
| 5865 | rmwreg(0x80FF0000, MDP_LUT_CC_REG, 0xE0FF0010); |
| 5866 | rmwreg(0x80FF0000, ROT_CC_REG, 0xE0FF0010); |
Matt Wagantall | 53d968f | 2011-07-19 13:22:53 -0700 | [diff] [blame] | 5867 | rmwreg(0x000004FF, TV_CC2_REG, 0x000007FF); |
| 5868 | rmwreg(0xC0FF0000, VCODEC_CC_REG, 0xE0FF0010); |
| 5869 | rmwreg(0x80FF0000, VFE_CC_REG, 0xE0FF4010); |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 5870 | rmwreg(0x800000FF, VFE_CC2_REG, 0xE00000FF); |
Matt Wagantall | 53d968f | 2011-07-19 13:22:53 -0700 | [diff] [blame] | 5871 | rmwreg(0x80FF0000, VPE_CC_REG, 0xE0FF0010); |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 5872 | if (cpu_is_msm8960() || cpu_is_apq8064()) { |
| 5873 | rmwreg(0x80FF0000, DSI2_BYTE_CC_REG, 0xE0FF0010); |
| 5874 | rmwreg(0x80FF0000, DSI2_PIXEL_CC_REG, 0xE0FF0010); |
| 5875 | rmwreg(0x80FF0000, JPEGD_CC_REG, 0xE0FF0010); |
| 5876 | } |
| 5877 | if (cpu_is_msm8960() || cpu_is_msm8930()) |
| 5878 | rmwreg(0x80FF0000, TV_CC_REG, 0xE1FFC010); |
| 5879 | |
| 5880 | if (cpu_is_msm8960()) { |
Tianyi Gou | 8c1a118 | 2011-10-10 14:47:11 -0700 | [diff] [blame] | 5881 | rmwreg(0x80FF0000, GFX2D0_CC_REG, 0xE0FF0010); |
| 5882 | rmwreg(0x80FF0000, GFX2D1_CC_REG, 0xE0FF0010); |
Tianyi Gou | 8c1a118 | 2011-10-10 14:47:11 -0700 | [diff] [blame] | 5883 | } |
| 5884 | if (cpu_is_apq8064()) { |
| 5885 | rmwreg(0x00000000, TV_CC_REG, 0x00004010); |
Tianyi Gou | 621f874 | 2011-09-01 21:45:01 -0700 | [diff] [blame] | 5886 | rmwreg(0x80FF0000, VCAP_CC_REG, 0xE0FF1010); |
Tianyi Gou | 8c1a118 | 2011-10-10 14:47:11 -0700 | [diff] [blame] | 5887 | } |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5888 | |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 5889 | /* |
| 5890 | * Initialize USB_HS_HCLK_FS registers: Set FORCE_C_ON bits so that |
| 5891 | * core remain active during halt state of the clk. Also, set sleep |
| 5892 | * and wake-up value to max. |
| 5893 | */ |
| 5894 | rmwreg(0x0000004F, USB_HS1_HCLK_FS_REG, 0x0000007F); |
Tianyi Gou | 8c1a118 | 2011-10-10 14:47:11 -0700 | [diff] [blame] | 5895 | if (cpu_is_apq8064()) { |
| 5896 | rmwreg(0x0000004F, USB_HS3_HCLK_FS_REG, 0x0000007F); |
| 5897 | rmwreg(0x0000004F, USB_HS4_HCLK_FS_REG, 0x0000007F); |
| 5898 | } |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 5899 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5900 | /* De-assert MM AXI resets to all hardware blocks. */ |
| 5901 | writel_relaxed(0, SW_RESET_AXI_REG); |
| 5902 | |
| 5903 | /* Deassert all MM core resets. */ |
| 5904 | writel_relaxed(0, SW_RESET_CORE_REG); |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 5905 | writel_relaxed(0, SW_RESET_CORE2_REG); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5906 | |
| 5907 | /* Reset 3D core once more, with its clock enabled. This can |
| 5908 | * eventually be done as part of the GDFS footswitch driver. */ |
| 5909 | clk_set_rate(&gfx3d_clk.c, 27000000); |
Stephen Boyd | e334aeb | 2012-01-24 12:17:29 -0800 | [diff] [blame] | 5910 | clk_prepare_enable(&gfx3d_clk.c); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5911 | writel_relaxed(BIT(12), SW_RESET_CORE_REG); |
| 5912 | mb(); |
| 5913 | udelay(5); |
| 5914 | writel_relaxed(0, SW_RESET_CORE_REG); |
| 5915 | /* Make sure reset is de-asserted before clock is disabled. */ |
| 5916 | mb(); |
Stephen Boyd | e334aeb | 2012-01-24 12:17:29 -0800 | [diff] [blame] | 5917 | clk_disable_unprepare(&gfx3d_clk.c); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5918 | |
| 5919 | /* Enable TSSC and PDM PXO sources. */ |
| 5920 | writel_relaxed(BIT(11), TSSC_CLK_CTL_REG); |
| 5921 | writel_relaxed(BIT(15), PDM_CLK_NS_REG); |
| 5922 | |
| 5923 | /* Source SLIMBus xo src from slimbus reference clock */ |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 5924 | if (cpu_is_msm8960()) |
Tianyi Gou | 8c1a118 | 2011-10-10 14:47:11 -0700 | [diff] [blame] | 5925 | writel_relaxed(0x3, SLIMBUS_XO_SRC_CLK_CTL_REG); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5926 | |
| 5927 | /* Source the dsi_byte_clks from the DSI PHY PLLs */ |
| 5928 | rmwreg(0x1, DSI1_BYTE_NS_REG, 0x7); |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 5929 | if (cpu_is_msm8960() || cpu_is_apq8064()) |
| 5930 | rmwreg(0x2, DSI2_BYTE_NS_REG, 0x7); |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 5931 | |
| 5932 | /* Source the sata_phy_ref_clk from PXO */ |
| 5933 | if (cpu_is_apq8064()) |
| 5934 | rmwreg(0, SATA_PHY_REF_CLK_CTL_REG, 0x1); |
| 5935 | |
| 5936 | /* |
Tianyi Gou | 05e0110 | 2012-02-08 22:15:49 -0800 | [diff] [blame] | 5937 | * TODO: Programming below PLLs and prng_clk is temporary and |
| 5938 | * needs to be removed after bootloaders program them. |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 5939 | */ |
| 5940 | if (cpu_is_apq8064()) { |
Tianyi Gou | 317aa86 | 2012-02-06 14:31:07 -0800 | [diff] [blame] | 5941 | u32 is_pll_enabled; |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 5942 | |
| 5943 | /* Program pxo_src_clk to source from PXO */ |
| 5944 | rmwreg(0x1, PXO_SRC_CLK_CTL_REG, 0x7); |
| 5945 | |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 5946 | /* Check if PLL14 is active */ |
| 5947 | is_pll_enabled = readl_relaxed(BB_PLL14_STATUS_REG) & BIT(16); |
| 5948 | if (!is_pll_enabled) { |
Tianyi Gou | df71f2e | 2011-10-24 22:25:04 -0700 | [diff] [blame] | 5949 | /* Ref clk = 27MHz and program pll14 to 480MHz */ |
Tianyi Gou | 317aa86 | 2012-02-06 14:31:07 -0800 | [diff] [blame] | 5950 | writel_relaxed(0x00031011, BB_PLL14_L_VAL_REG); |
Tianyi Gou | df71f2e | 2011-10-24 22:25:04 -0700 | [diff] [blame] | 5951 | writel_relaxed(0x7, BB_PLL14_M_VAL_REG); |
| 5952 | writel_relaxed(0x9, BB_PLL14_N_VAL_REG); |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 5953 | |
Tianyi Gou | 317aa86 | 2012-02-06 14:31:07 -0800 | [diff] [blame] | 5954 | /* |
| 5955 | * Enable the main output and the MN accumulator |
| 5956 | * Set pre-divider and post-divider values to 1 and 1 |
| 5957 | */ |
| 5958 | writel_relaxed(0x00C00000, BB_PLL14_CONFIG_REG); |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 5959 | |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 5960 | set_fsm_mode(BB_PLL14_MODE_REG); |
| 5961 | } |
Tianyi Gou | 621f874 | 2011-09-01 21:45:01 -0700 | [diff] [blame] | 5962 | |
Tianyi Gou | 621f874 | 2011-09-01 21:45:01 -0700 | [diff] [blame] | 5963 | /* Program PLL15 to 975MHz with ref clk = 27MHz */ |
Tianyi Gou | 317aa86 | 2012-02-06 14:31:07 -0800 | [diff] [blame] | 5964 | writel_relaxed(0x31024, MM_PLL3_L_VAL_REG); |
| 5965 | writel_relaxed(0x1, MM_PLL3_M_VAL_REG); |
| 5966 | writel_relaxed(0x9, MM_PLL3_N_VAL_REG); |
Tianyi Gou | 621f874 | 2011-09-01 21:45:01 -0700 | [diff] [blame] | 5967 | |
Tianyi Gou | 317aa86 | 2012-02-06 14:31:07 -0800 | [diff] [blame] | 5968 | writel_relaxed(0xC20000, MM_PLL3_CONFIG_REG); |
Tianyi Gou | c29c324 | 2011-10-12 21:02:15 -0700 | [diff] [blame] | 5969 | |
| 5970 | /* Check if PLL4 is active */ |
| 5971 | is_pll_enabled = readl_relaxed(LCC_PLL0_STATUS_REG) & BIT(16); |
| 5972 | if (!is_pll_enabled) { |
Tianyi Gou | df71f2e | 2011-10-24 22:25:04 -0700 | [diff] [blame] | 5973 | /* Ref clk = 27MHz and program pll4 to 393.2160MHz */ |
| 5974 | writel_relaxed(0xE, LCC_PLL0_L_VAL_REG); |
| 5975 | writel_relaxed(0x27A, LCC_PLL0_M_VAL_REG); |
| 5976 | writel_relaxed(0x465, LCC_PLL0_N_VAL_REG); |
Tianyi Gou | c29c324 | 2011-10-12 21:02:15 -0700 | [diff] [blame] | 5977 | |
Tianyi Gou | 317aa86 | 2012-02-06 14:31:07 -0800 | [diff] [blame] | 5978 | writel_relaxed(0xC00000, LCC_PLL0_CONFIG_REG); |
Tianyi Gou | c29c324 | 2011-10-12 21:02:15 -0700 | [diff] [blame] | 5979 | |
| 5980 | set_fsm_mode(LCC_PLL0_MODE_REG); |
| 5981 | } |
| 5982 | |
| 5983 | /* Enable PLL4 source on the LPASS Primary PLL Mux */ |
| 5984 | writel_relaxed(0x1, LCC_PRI_PLL_CLK_CTL_REG); |
Tianyi Gou | 05e0110 | 2012-02-08 22:15:49 -0800 | [diff] [blame] | 5985 | |
| 5986 | /* Program prng_clk to 64MHz if it isn't configured */ |
| 5987 | if (!readl_relaxed(PRNG_CLK_NS_REG)) |
| 5988 | writel_relaxed(0x2B, PRNG_CLK_NS_REG); |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 5989 | } |
Tianyi Gou | 65c536a | 2012-03-20 23:20:29 -0700 | [diff] [blame] | 5990 | |
| 5991 | /* |
| 5992 | * Program PLL15 to 900MHz with ref clk = 27MHz and |
| 5993 | * only enable PLL main output. |
| 5994 | */ |
| 5995 | if (cpu_is_msm8930()) { |
| 5996 | writel_relaxed(0x30021, MM_PLL3_L_VAL_REG); |
| 5997 | writel_relaxed(0x1, MM_PLL3_M_VAL_REG); |
| 5998 | writel_relaxed(0x3, MM_PLL3_N_VAL_REG); |
| 5999 | |
| 6000 | writel_relaxed(0xC20000, MM_PLL3_CONFIG_REG); |
| 6001 | writel_relaxed(0, MM_PLL3_TEST_CTL_REG); |
| 6002 | } |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 6003 | } |
| 6004 | |
Matt Wagantall | b64888f | 2012-04-02 21:35:07 -0700 | [diff] [blame] | 6005 | static void __init msm8960_clock_pre_init(void) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 6006 | { |
Saravana Kannan | 298ec39 | 2012-02-08 19:21:47 -0800 | [diff] [blame] | 6007 | if (cpu_is_apq8064()) { |
| 6008 | vdd_sr2_pll.set_vdd = set_vdd_sr2_pll_8064; |
Tianyi Gou | e1faaf2 | 2012-01-24 16:07:19 -0800 | [diff] [blame] | 6009 | } else if (cpu_is_msm8930() || cpu_is_msm8627()) { |
Saravana Kannan | 298ec39 | 2012-02-08 19:21:47 -0800 | [diff] [blame] | 6010 | vdd_dig.set_vdd = set_vdd_dig_8930; |
| 6011 | vdd_sr2_pll.set_vdd = set_vdd_sr2_pll_8930; |
Tianyi Gou | e1faaf2 | 2012-01-24 16:07:19 -0800 | [diff] [blame] | 6012 | } |
Tianyi Gou | bf3d0b1 | 2012-01-23 14:37:28 -0800 | [diff] [blame] | 6013 | |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 6014 | /* |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 6015 | * Change the freq tables for and voltage requirements for |
| 6016 | * clocks which differ between 8960 and 8064. |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 6017 | */ |
| 6018 | if (cpu_is_apq8064()) { |
| 6019 | gfx3d_clk.freq_tbl = clk_tbl_gfx3d_8064; |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 6020 | |
| 6021 | memcpy(gfx3d_clk.c.fmax, fmax_gfx3d_8064, |
| 6022 | sizeof(gfx3d_clk.c.fmax)); |
| 6023 | memcpy(ijpeg_clk.c.fmax, fmax_ijpeg_8064, |
| 6024 | sizeof(ijpeg_clk.c.fmax)); |
| 6025 | memcpy(mdp_clk.c.fmax, fmax_mdp_8064, |
| 6026 | sizeof(ijpeg_clk.c.fmax)); |
| 6027 | memcpy(tv_src_clk.c.fmax, fmax_tv_src_8064, |
| 6028 | sizeof(tv_src_clk.c.fmax)); |
| 6029 | memcpy(vfe_clk.c.fmax, fmax_vfe_8064, |
| 6030 | sizeof(vfe_clk.c.fmax)); |
| 6031 | |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 6032 | gmem_axi_clk.c.depends = &gfx3d_axi_clk_8064.c; |
| 6033 | } |
| 6034 | |
| 6035 | /* |
| 6036 | * Change the freq tables and voltage requirements for |
| 6037 | * clocks which differ between 8960 and 8930. |
| 6038 | */ |
| 6039 | if (cpu_is_msm8930()) { |
| 6040 | gfx3d_clk.freq_tbl = clk_tbl_gfx3d_8930; |
| 6041 | |
| 6042 | memcpy(gfx3d_clk.c.fmax, fmax_gfx3d_8930, |
| 6043 | sizeof(gfx3d_clk.c.fmax)); |
| 6044 | |
| 6045 | pll15_clk.c.rate = 900000000; |
| 6046 | gmem_axi_clk.c.depends = &gfx3d_axi_clk_8930.c; |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 6047 | } |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 6048 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 6049 | vote_vdd_level(&vdd_dig, VDD_DIG_HIGH); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 6050 | |
Vikram Mulukutla | 489e39e | 2011-08-31 18:04:05 -0700 | [diff] [blame] | 6051 | clk_ops_pll.enable = sr_pll_clk_enable; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 6052 | |
| 6053 | /* Initialize clock registers. */ |
| 6054 | reg_init(); |
Matt Wagantall | b64888f | 2012-04-02 21:35:07 -0700 | [diff] [blame] | 6055 | } |
| 6056 | |
| 6057 | static void __init msm8960_clock_post_init(void) |
| 6058 | { |
| 6059 | /* Keep PXO on whenever APPS cpu is active */ |
| 6060 | clk_prepare_enable(&pxo_a_clk.c); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 6061 | |
| 6062 | /* Initialize rates for clocks that only support one. */ |
| 6063 | clk_set_rate(&pdm_clk.c, 27000000); |
| 6064 | clk_set_rate(&prng_clk.c, 64000000); |
| 6065 | clk_set_rate(&mdp_vsync_clk.c, 27000000); |
| 6066 | clk_set_rate(&tsif_ref_clk.c, 105000); |
| 6067 | clk_set_rate(&tssc_clk.c, 27000000); |
| 6068 | clk_set_rate(&usb_hs1_xcvr_clk.c, 60000000); |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 6069 | if (cpu_is_apq8064()) { |
| 6070 | clk_set_rate(&usb_hs3_xcvr_clk.c, 60000000); |
| 6071 | clk_set_rate(&usb_hs4_xcvr_clk.c, 60000000); |
| 6072 | } |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 6073 | clk_set_rate(&usb_fs1_src_clk.c, 60000000); |
Stepan Moskovchenko | 2429f15 | 2011-10-25 14:42:35 -0700 | [diff] [blame] | 6074 | if (cpu_is_msm8960() || cpu_is_msm8930()) |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 6075 | clk_set_rate(&usb_fs2_src_clk.c, 60000000); |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 6076 | clk_set_rate(&usb_hsic_xcvr_fs_clk.c, 60000000); |
| 6077 | clk_set_rate(&usb_hsic_hsic_src_clk.c, 480000000); |
| 6078 | clk_set_rate(&usb_hsic_hsio_cal_clk.c, 9000000); |
Lena Salman | 127823f | 2012-02-14 17:13:53 +0200 | [diff] [blame] | 6079 | clk_set_rate(&usb_hsic_system_clk.c, 60000000); |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 6080 | /* |
| 6081 | * Set the CSI rates to a safe default to avoid warnings when |
| 6082 | * switching csi pix and rdi clocks. |
| 6083 | */ |
| 6084 | clk_set_rate(&csi0_src_clk.c, 27000000); |
| 6085 | clk_set_rate(&csi1_src_clk.c, 27000000); |
| 6086 | clk_set_rate(&csi2_src_clk.c, 27000000); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 6087 | |
| 6088 | /* |
Stephen Boyd | 60496bb | 2011-10-17 13:51:37 -0700 | [diff] [blame] | 6089 | * The halt status bits for these clocks may be incorrect at boot. |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 6090 | * Toggle these clocks on and off to refresh them. |
| 6091 | */ |
Matt Wagantall | 0625ea0 | 2011-07-13 18:51:56 -0700 | [diff] [blame] | 6092 | rcg_clk_enable(&pdm_clk.c); |
| 6093 | rcg_clk_disable(&pdm_clk.c); |
| 6094 | rcg_clk_enable(&tssc_clk.c); |
| 6095 | rcg_clk_disable(&tssc_clk.c); |
Stephen Boyd | e334aeb | 2012-01-24 12:17:29 -0800 | [diff] [blame] | 6096 | clk_prepare_enable(&usb_hsic_hsic_clk.c); |
| 6097 | clk_disable_unprepare(&usb_hsic_hsic_clk.c); |
Stephen Boyd | d7a143a | 2012-02-16 17:59:26 -0800 | [diff] [blame] | 6098 | |
| 6099 | /* |
| 6100 | * Keep sfab floor @ 54MHz so that Krait AHB is at least 27MHz at all |
| 6101 | * times when Apps CPU is active. This ensures the timer's requirement |
| 6102 | * of Krait AHB running 4 times as fast as the timer itself. |
| 6103 | */ |
| 6104 | clk_set_rate(&sfab_tmr_a_clk.c, 54000000); |
Stephen Boyd | e334aeb | 2012-01-24 12:17:29 -0800 | [diff] [blame] | 6105 | clk_prepare_enable(&sfab_tmr_a_clk.c); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 6106 | } |
| 6107 | |
Stephen Boyd | bb600ae | 2011-08-02 20:11:40 -0700 | [diff] [blame] | 6108 | static int __init msm8960_clock_late_init(void) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 6109 | { |
Stephen Boyd | a3787f3 | 2011-09-16 18:55:13 -0700 | [diff] [blame] | 6110 | int rc; |
| 6111 | struct clk *mmfpb_a_clk = clk_get_sys("clock-8960", "mmfpb_a_clk"); |
Stephen Boyd | 8543613 | 2011-09-16 18:55:13 -0700 | [diff] [blame] | 6112 | struct clk *cfpb_a_clk = clk_get_sys("clock-8960", "cfpb_a_clk"); |
Stephen Boyd | a3787f3 | 2011-09-16 18:55:13 -0700 | [diff] [blame] | 6113 | |
| 6114 | /* Vote for MMFPB to be at least 76.8MHz when an Apps CPU is active. */ |
| 6115 | if (WARN(IS_ERR(mmfpb_a_clk), "mmfpb_a_clk not found (%ld)\n", |
| 6116 | PTR_ERR(mmfpb_a_clk))) |
| 6117 | return PTR_ERR(mmfpb_a_clk); |
Matt Wagantall | de555f56 | 2011-11-08 14:18:07 -0800 | [diff] [blame] | 6118 | rc = clk_set_rate(mmfpb_a_clk, 76800000); |
Stephen Boyd | a3787f3 | 2011-09-16 18:55:13 -0700 | [diff] [blame] | 6119 | if (WARN(rc, "mmfpb_a_clk rate was not set (%d)\n", rc)) |
| 6120 | return rc; |
Stephen Boyd | e334aeb | 2012-01-24 12:17:29 -0800 | [diff] [blame] | 6121 | rc = clk_prepare_enable(mmfpb_a_clk); |
Stephen Boyd | a3787f3 | 2011-09-16 18:55:13 -0700 | [diff] [blame] | 6122 | if (WARN(rc, "mmfpb_a_clk not enabled (%d)\n", rc)) |
| 6123 | return rc; |
| 6124 | |
Stephen Boyd | 8543613 | 2011-09-16 18:55:13 -0700 | [diff] [blame] | 6125 | /* Vote for CFPB to be at least 64MHz when an Apps CPU is active. */ |
| 6126 | if (WARN(IS_ERR(cfpb_a_clk), "cfpb_a_clk not found (%ld)\n", |
| 6127 | PTR_ERR(cfpb_a_clk))) |
| 6128 | return PTR_ERR(cfpb_a_clk); |
Matt Wagantall | de555f56 | 2011-11-08 14:18:07 -0800 | [diff] [blame] | 6129 | rc = clk_set_rate(cfpb_a_clk, 64000000); |
Stephen Boyd | 8543613 | 2011-09-16 18:55:13 -0700 | [diff] [blame] | 6130 | if (WARN(rc, "cfpb_a_clk rate was not set (%d)\n", rc)) |
| 6131 | return rc; |
Stephen Boyd | e334aeb | 2012-01-24 12:17:29 -0800 | [diff] [blame] | 6132 | rc = clk_prepare_enable(cfpb_a_clk); |
Stephen Boyd | 8543613 | 2011-09-16 18:55:13 -0700 | [diff] [blame] | 6133 | if (WARN(rc, "cfpb_a_clk not enabled (%d)\n", rc)) |
| 6134 | return rc; |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 6135 | |
| 6136 | return unvote_vdd_level(&vdd_dig, VDD_DIG_HIGH); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 6137 | } |
Stephen Boyd | bb600ae | 2011-08-02 20:11:40 -0700 | [diff] [blame] | 6138 | |
| 6139 | struct clock_init_data msm8960_clock_init_data __initdata = { |
| 6140 | .table = msm_clocks_8960, |
| 6141 | .size = ARRAY_SIZE(msm_clocks_8960), |
Matt Wagantall | b64888f | 2012-04-02 21:35:07 -0700 | [diff] [blame] | 6142 | .pre_init = msm8960_clock_pre_init, |
| 6143 | .post_init = msm8960_clock_post_init, |
Stephen Boyd | bb600ae | 2011-08-02 20:11:40 -0700 | [diff] [blame] | 6144 | .late_init = msm8960_clock_late_init, |
| 6145 | }; |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 6146 | |
| 6147 | struct clock_init_data apq8064_clock_init_data __initdata = { |
| 6148 | .table = msm_clocks_8064, |
| 6149 | .size = ARRAY_SIZE(msm_clocks_8064), |
Matt Wagantall | b64888f | 2012-04-02 21:35:07 -0700 | [diff] [blame] | 6150 | .pre_init = msm8960_clock_pre_init, |
| 6151 | .post_init = msm8960_clock_post_init, |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 6152 | .late_init = msm8960_clock_late_init, |
| 6153 | }; |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 6154 | |
| 6155 | struct clock_init_data msm8930_clock_init_data __initdata = { |
| 6156 | .table = msm_clocks_8930, |
| 6157 | .size = ARRAY_SIZE(msm_clocks_8930), |
Matt Wagantall | b64888f | 2012-04-02 21:35:07 -0700 | [diff] [blame] | 6158 | .pre_init = msm8960_clock_pre_init, |
| 6159 | .post_init = msm8960_clock_post_init, |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 6160 | .late_init = msm8960_clock_late_init, |
| 6161 | }; |