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" |
Vikram Mulukutla | 681d868 | 2012-03-09 23:56:20 -0800 | [diff] [blame] | 36 | #include "clock-pll.h" |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 37 | |
| 38 | #define REG(off) (MSM_CLK_CTL_BASE + (off)) |
| 39 | #define REG_MM(off) (MSM_MMSS_CLK_CTL_BASE + (off)) |
| 40 | #define REG_LPA(off) (MSM_LPASS_CLK_CTL_BASE + (off)) |
Matt Wagantall | 8b38f94 | 2011-08-02 18:23:18 -0700 | [diff] [blame] | 41 | #define REG_GCC(off) (MSM_APCS_GCC_BASE + (off)) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 42 | |
| 43 | /* Peripheral clock registers. */ |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 44 | #define ADM0_PBUS_CLK_CTL_REG REG(0x2208) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 45 | #define CE1_HCLK_CTL_REG REG(0x2720) |
| 46 | #define CE1_CORE_CLK_CTL_REG REG(0x2724) |
Tianyi Gou | 05e0110 | 2012-02-08 22:15:49 -0800 | [diff] [blame] | 47 | #define PRNG_CLK_NS_REG REG(0x2E80) |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 48 | #define CE3_HCLK_CTL_REG REG(0x36C4) |
| 49 | #define CE3_CORE_CLK_CTL_REG REG(0x36CC) |
| 50 | #define CE3_CLK_SRC_NS_REG REG(0x36C0) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 51 | #define DMA_BAM_HCLK_CTL REG(0x25C0) |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 52 | #define CLK_HALT_AFAB_SFAB_STATEB_REG REG(0x2FC4) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 53 | #define CLK_HALT_CFPB_STATEA_REG REG(0x2FCC) |
| 54 | #define CLK_HALT_CFPB_STATEB_REG REG(0x2FD0) |
| 55 | #define CLK_HALT_CFPB_STATEC_REG REG(0x2FD4) |
| 56 | #define CLK_HALT_DFAB_STATE_REG REG(0x2FC8) |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 57 | /* 8064 name CLK_HALT_GSS_KPSS_MISC_STATE_REG */ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 58 | #define CLK_HALT_MSS_SMPSS_MISC_STATE_REG REG(0x2FDC) |
| 59 | #define CLK_HALT_SFPB_MISC_STATE_REG REG(0x2FD8) |
Stephen Boyd | 973e4ba | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 60 | #define CLK_HALT_AFAB_SFAB_STATEB_REG REG(0x2FC4) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 61 | #define CLK_TEST_REG REG(0x2FA0) |
Matt Wagantall | 7625a4c | 2011-11-01 16:17:53 -0700 | [diff] [blame] | 62 | #define GPn_MD_REG(n) REG(0x2D00+(0x20*(n))) |
| 63 | #define GPn_NS_REG(n) REG(0x2D24+(0x20*(n))) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 64 | #define GSBIn_HCLK_CTL_REG(n) REG(0x29C0+(0x20*((n)-1))) |
| 65 | #define GSBIn_QUP_APPS_MD_REG(n) REG(0x29C8+(0x20*((n)-1))) |
| 66 | #define GSBIn_QUP_APPS_NS_REG(n) REG(0x29CC+(0x20*((n)-1))) |
| 67 | #define GSBIn_RESET_REG(n) REG(0x29DC+(0x20*((n)-1))) |
| 68 | #define GSBIn_UART_APPS_MD_REG(n) REG(0x29D0+(0x20*((n)-1))) |
| 69 | #define GSBIn_UART_APPS_NS_REG(n) REG(0x29D4+(0x20*((n)-1))) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 70 | #define PDM_CLK_NS_REG REG(0x2CC0) |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 71 | /* 8064 name BB_PLL_ENA_APCS_REG */ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 72 | #define BB_PLL_ENA_SC0_REG REG(0x34C0) |
Tianyi Gou | 59608a7 | 2012-01-31 22:19:30 -0800 | [diff] [blame] | 73 | #define BB_PLL_ENA_RPM_REG REG(0x34A0) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 74 | #define BB_PLL0_STATUS_REG REG(0x30D8) |
| 75 | #define BB_PLL5_STATUS_REG REG(0x30F8) |
| 76 | #define BB_PLL6_STATUS_REG REG(0x3118) |
| 77 | #define BB_PLL7_STATUS_REG REG(0x3138) |
| 78 | #define BB_PLL8_L_VAL_REG REG(0x3144) |
| 79 | #define BB_PLL8_M_VAL_REG REG(0x3148) |
| 80 | #define BB_PLL8_MODE_REG REG(0x3140) |
| 81 | #define BB_PLL8_N_VAL_REG REG(0x314C) |
| 82 | #define BB_PLL8_STATUS_REG REG(0x3158) |
| 83 | #define BB_PLL8_CONFIG_REG REG(0x3154) |
| 84 | #define BB_PLL8_TEST_CTL_REG REG(0x3150) |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 85 | #define BB_MMCC_PLL2_MODE_REG REG(0x3160) |
| 86 | #define BB_MMCC_PLL2_TEST_CTL_REG REG(0x3170) |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 87 | #define BB_PLL14_MODE_REG REG(0x31C0) |
| 88 | #define BB_PLL14_L_VAL_REG REG(0x31C4) |
| 89 | #define BB_PLL14_M_VAL_REG REG(0x31C8) |
| 90 | #define BB_PLL14_N_VAL_REG REG(0x31CC) |
| 91 | #define BB_PLL14_TEST_CTL_REG REG(0x31D0) |
| 92 | #define BB_PLL14_CONFIG_REG REG(0x31D4) |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 93 | #define BB_PLL14_STATUS_REG REG(0x31D8) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 94 | #define PLLTEST_PAD_CFG_REG REG(0x2FA4) |
| 95 | #define PMEM_ACLK_CTL_REG REG(0x25A0) |
| 96 | #define RINGOSC_NS_REG REG(0x2DC0) |
| 97 | #define RINGOSC_STATUS_REG REG(0x2DCC) |
| 98 | #define RINGOSC_TCXO_CTL_REG REG(0x2DC4) |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 99 | #define RPM_MSG_RAM_HCLK_CTL_REG REG(0x27E0) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 100 | #define SC0_U_CLK_BRANCH_ENA_VOTE_REG REG(0x3080) |
| 101 | #define SDCn_APPS_CLK_MD_REG(n) REG(0x2828+(0x20*((n)-1))) |
| 102 | #define SDCn_APPS_CLK_NS_REG(n) REG(0x282C+(0x20*((n)-1))) |
| 103 | #define SDCn_HCLK_CTL_REG(n) REG(0x2820+(0x20*((n)-1))) |
| 104 | #define SDCn_RESET_REG(n) REG(0x2830+(0x20*((n)-1))) |
| 105 | #define SLIMBUS_XO_SRC_CLK_CTL_REG REG(0x2628) |
| 106 | #define TSIF_HCLK_CTL_REG REG(0x2700) |
| 107 | #define TSIF_REF_CLK_MD_REG REG(0x270C) |
| 108 | #define TSIF_REF_CLK_NS_REG REG(0x2710) |
| 109 | #define TSSC_CLK_CTL_REG REG(0x2CA0) |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 110 | #define SATA_CLK_SRC_NS_REG REG(0x2C08) |
| 111 | #define SATA_RXOOB_CLK_CTL_REG REG(0x2C0C) |
| 112 | #define SATA_PMALIVE_CLK_CTL_REG REG(0x2C10) |
| 113 | #define SATA_PHY_REF_CLK_CTL_REG REG(0x2C14) |
| 114 | #define SATA_PHY_CFG_CLK_CTL_REG REG(0x2C40) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 115 | #define USB_FSn_HCLK_CTL_REG(n) REG(0x2960+(0x20*((n)-1))) |
| 116 | #define USB_FSn_RESET_REG(n) REG(0x2974+(0x20*((n)-1))) |
| 117 | #define USB_FSn_SYSTEM_CLK_CTL_REG(n) REG(0x296C+(0x20*((n)-1))) |
| 118 | #define USB_FSn_XCVR_FS_CLK_MD_REG(n) REG(0x2964+(0x20*((n)-1))) |
| 119 | #define USB_FSn_XCVR_FS_CLK_NS_REG(n) REG(0x2968+(0x20*((n)-1))) |
| 120 | #define USB_HS1_HCLK_CTL_REG REG(0x2900) |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 121 | #define USB_HS1_HCLK_FS_REG REG(0x2904) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 122 | #define USB_HS1_RESET_REG REG(0x2910) |
| 123 | #define USB_HS1_XCVR_FS_CLK_MD_REG REG(0x2908) |
| 124 | #define USB_HS1_XCVR_FS_CLK_NS_REG REG(0x290C) |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 125 | #define USB_HS3_HCLK_CTL_REG REG(0x3700) |
| 126 | #define USB_HS3_HCLK_FS_REG REG(0x3704) |
| 127 | #define USB_HS3_RESET_REG REG(0x3710) |
| 128 | #define USB_HS3_XCVR_FS_CLK_MD_REG REG(0X3708) |
| 129 | #define USB_HS3_XCVR_FS_CLK_NS_REG REG(0X370C) |
| 130 | #define USB_HS4_HCLK_CTL_REG REG(0x3720) |
| 131 | #define USB_HS4_HCLK_FS_REG REG(0x3724) |
| 132 | #define USB_HS4_RESET_REG REG(0x3730) |
| 133 | #define USB_HS4_XCVR_FS_CLK_MD_REG REG(0X3728) |
| 134 | #define USB_HS4_XCVR_FS_CLK_NS_REG REG(0X372C) |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 135 | #define USB_HSIC_HCLK_CTL_REG REG(0x2920) |
| 136 | #define USB_HSIC_HSIC_CLK_CTL_REG REG(0x2B44) |
| 137 | #define USB_HSIC_HSIC_CLK_SRC_CTL_REG REG(0x2B40) |
| 138 | #define USB_HSIC_HSIO_CAL_CLK_CTL_REG REG(0x2B48) |
| 139 | #define USB_HSIC_RESET_REG REG(0x2934) |
| 140 | #define USB_HSIC_SYSTEM_CLK_CTL_REG REG(0x292C) |
| 141 | #define USB_HSIC_XCVR_FS_CLK_MD_REG REG(0x2924) |
| 142 | #define USB_HSIC_XCVR_FS_CLK_NS_REG REG(0x2928) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 143 | #define USB_PHY0_RESET_REG REG(0x2E20) |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 144 | #define PCIE_ALT_REF_CLK_NS_REG REG(0x3860) |
| 145 | #define PCIE_HCLK_CTL_REG REG(0x22CC) |
| 146 | #define GPLL1_MODE_REG REG(0x3160) |
| 147 | #define GPLL1_L_VAL_REG REG(0x3164) |
| 148 | #define GPLL1_M_VAL_REG REG(0x3168) |
| 149 | #define GPLL1_N_VAL_REG REG(0x316C) |
| 150 | #define GPLL1_CONFIG_REG REG(0x3174) |
| 151 | #define GPLL1_STATUS_REG REG(0x3178) |
| 152 | #define PXO_SRC_CLK_CTL_REG REG(0x2EA0) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 153 | |
| 154 | /* Multimedia clock registers. */ |
| 155 | #define AHB_EN_REG REG_MM(0x0008) |
| 156 | #define AHB_EN2_REG REG_MM(0x0038) |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 157 | #define AHB_EN3_REG REG_MM(0x0248) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 158 | #define AHB_NS_REG REG_MM(0x0004) |
| 159 | #define AXI_NS_REG REG_MM(0x0014) |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 160 | #define CAMCLK0_NS_REG REG_MM(0x0148) |
| 161 | #define CAMCLK0_CC_REG REG_MM(0x0140) |
| 162 | #define CAMCLK0_MD_REG REG_MM(0x0144) |
| 163 | #define CAMCLK1_NS_REG REG_MM(0x015C) |
| 164 | #define CAMCLK1_CC_REG REG_MM(0x0154) |
| 165 | #define CAMCLK1_MD_REG REG_MM(0x0158) |
| 166 | #define CAMCLK2_NS_REG REG_MM(0x0228) |
| 167 | #define CAMCLK2_CC_REG REG_MM(0x0220) |
| 168 | #define CAMCLK2_MD_REG REG_MM(0x0224) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 169 | #define CSI0_NS_REG REG_MM(0x0048) |
| 170 | #define CSI0_CC_REG REG_MM(0x0040) |
| 171 | #define CSI0_MD_REG REG_MM(0x0044) |
| 172 | #define CSI1_NS_REG REG_MM(0x0010) |
| 173 | #define CSI1_CC_REG REG_MM(0x0024) |
| 174 | #define CSI1_MD_REG REG_MM(0x0028) |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 175 | #define CSI2_NS_REG REG_MM(0x0234) |
| 176 | #define CSI2_CC_REG REG_MM(0x022C) |
| 177 | #define CSI2_MD_REG REG_MM(0x0230) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 178 | #define CSIPHYTIMER_CC_REG REG_MM(0x0160) |
| 179 | #define CSIPHYTIMER_MD_REG REG_MM(0x0164) |
| 180 | #define CSIPHYTIMER_NS_REG REG_MM(0x0168) |
| 181 | #define DSI1_BYTE_NS_REG REG_MM(0x00B0) |
| 182 | #define DSI1_BYTE_CC_REG REG_MM(0x0090) |
| 183 | #define DSI2_BYTE_NS_REG REG_MM(0x00BC) |
| 184 | #define DSI2_BYTE_CC_REG REG_MM(0x00B4) |
| 185 | #define DSI1_ESC_NS_REG REG_MM(0x011C) |
| 186 | #define DSI1_ESC_CC_REG REG_MM(0x00CC) |
| 187 | #define DSI2_ESC_NS_REG REG_MM(0x0150) |
| 188 | #define DSI2_ESC_CC_REG REG_MM(0x013C) |
| 189 | #define DSI_PIXEL_CC_REG REG_MM(0x0130) |
| 190 | #define DSI2_PIXEL_CC_REG REG_MM(0x0094) |
| 191 | #define DBG_BUS_VEC_A_REG REG_MM(0x01C8) |
| 192 | #define DBG_BUS_VEC_B_REG REG_MM(0x01CC) |
| 193 | #define DBG_BUS_VEC_C_REG REG_MM(0x01D0) |
| 194 | #define DBG_BUS_VEC_D_REG REG_MM(0x01D4) |
| 195 | #define DBG_BUS_VEC_E_REG REG_MM(0x01D8) |
| 196 | #define DBG_BUS_VEC_F_REG REG_MM(0x01DC) |
| 197 | #define DBG_BUS_VEC_G_REG REG_MM(0x01E0) |
| 198 | #define DBG_BUS_VEC_H_REG REG_MM(0x01E4) |
| 199 | #define DBG_BUS_VEC_I_REG REG_MM(0x01E8) |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 200 | #define DBG_BUS_VEC_J_REG REG_MM(0x0240) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 201 | #define DBG_CFG_REG_HS_REG REG_MM(0x01B4) |
| 202 | #define DBG_CFG_REG_LS_REG REG_MM(0x01B8) |
| 203 | #define GFX2D0_CC_REG REG_MM(0x0060) |
| 204 | #define GFX2D0_MD0_REG REG_MM(0x0064) |
| 205 | #define GFX2D0_MD1_REG REG_MM(0x0068) |
| 206 | #define GFX2D0_NS_REG REG_MM(0x0070) |
| 207 | #define GFX2D1_CC_REG REG_MM(0x0074) |
| 208 | #define GFX2D1_MD0_REG REG_MM(0x0078) |
| 209 | #define GFX2D1_MD1_REG REG_MM(0x006C) |
| 210 | #define GFX2D1_NS_REG REG_MM(0x007C) |
| 211 | #define GFX3D_CC_REG REG_MM(0x0080) |
| 212 | #define GFX3D_MD0_REG REG_MM(0x0084) |
| 213 | #define GFX3D_MD1_REG REG_MM(0x0088) |
| 214 | #define GFX3D_NS_REG REG_MM(0x008C) |
| 215 | #define IJPEG_CC_REG REG_MM(0x0098) |
| 216 | #define IJPEG_MD_REG REG_MM(0x009C) |
| 217 | #define IJPEG_NS_REG REG_MM(0x00A0) |
| 218 | #define JPEGD_CC_REG REG_MM(0x00A4) |
| 219 | #define JPEGD_NS_REG REG_MM(0x00AC) |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 220 | #define VCAP_CC_REG REG_MM(0x0178) |
| 221 | #define VCAP_NS_REG REG_MM(0x021C) |
| 222 | #define VCAP_MD0_REG REG_MM(0x01EC) |
| 223 | #define VCAP_MD1_REG REG_MM(0x0218) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 224 | #define MAXI_EN_REG REG_MM(0x0018) |
| 225 | #define MAXI_EN2_REG REG_MM(0x0020) |
| 226 | #define MAXI_EN3_REG REG_MM(0x002C) |
| 227 | #define MAXI_EN4_REG REG_MM(0x0114) |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 228 | #define MAXI_EN5_REG REG_MM(0x0244) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 229 | #define MDP_CC_REG REG_MM(0x00C0) |
| 230 | #define MDP_LUT_CC_REG REG_MM(0x016C) |
| 231 | #define MDP_MD0_REG REG_MM(0x00C4) |
| 232 | #define MDP_MD1_REG REG_MM(0x00C8) |
| 233 | #define MDP_NS_REG REG_MM(0x00D0) |
| 234 | #define MISC_CC_REG REG_MM(0x0058) |
| 235 | #define MISC_CC2_REG REG_MM(0x005C) |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 236 | #define MISC_CC3_REG REG_MM(0x0238) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 237 | #define MM_PLL1_MODE_REG REG_MM(0x031C) |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 238 | #define MM_PLL1_L_VAL_REG REG_MM(0x0320) |
| 239 | #define MM_PLL1_M_VAL_REG REG_MM(0x0324) |
| 240 | #define MM_PLL1_N_VAL_REG REG_MM(0x0328) |
| 241 | #define MM_PLL1_CONFIG_REG REG_MM(0x032C) |
| 242 | #define MM_PLL1_TEST_CTL_REG REG_MM(0x0330) |
| 243 | #define MM_PLL1_STATUS_REG REG_MM(0x0334) |
| 244 | #define MM_PLL3_MODE_REG REG_MM(0x0338) |
Tianyi Gou | 621f874 | 2011-09-01 21:45:01 -0700 | [diff] [blame] | 245 | #define MM_PLL3_L_VAL_REG REG_MM(0x033C) |
| 246 | #define MM_PLL3_M_VAL_REG REG_MM(0x0340) |
| 247 | #define MM_PLL3_N_VAL_REG REG_MM(0x0344) |
| 248 | #define MM_PLL3_CONFIG_REG REG_MM(0x0348) |
| 249 | #define MM_PLL3_TEST_CTL_REG REG_MM(0x034C) |
| 250 | #define MM_PLL3_STATUS_REG REG_MM(0x0350) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 251 | #define ROT_CC_REG REG_MM(0x00E0) |
| 252 | #define ROT_NS_REG REG_MM(0x00E8) |
| 253 | #define SAXI_EN_REG REG_MM(0x0030) |
| 254 | #define SW_RESET_AHB_REG REG_MM(0x020C) |
| 255 | #define SW_RESET_AHB2_REG REG_MM(0x0200) |
| 256 | #define SW_RESET_ALL_REG REG_MM(0x0204) |
| 257 | #define SW_RESET_AXI_REG REG_MM(0x0208) |
| 258 | #define SW_RESET_CORE_REG REG_MM(0x0210) |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 259 | #define SW_RESET_CORE2_REG REG_MM(0x0214) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 260 | #define TV_CC_REG REG_MM(0x00EC) |
| 261 | #define TV_CC2_REG REG_MM(0x0124) |
| 262 | #define TV_MD_REG REG_MM(0x00F0) |
| 263 | #define TV_NS_REG REG_MM(0x00F4) |
| 264 | #define VCODEC_CC_REG REG_MM(0x00F8) |
| 265 | #define VCODEC_MD0_REG REG_MM(0x00FC) |
| 266 | #define VCODEC_MD1_REG REG_MM(0x0128) |
| 267 | #define VCODEC_NS_REG REG_MM(0x0100) |
| 268 | #define VFE_CC_REG REG_MM(0x0104) |
| 269 | #define VFE_MD_REG REG_MM(0x0108) |
| 270 | #define VFE_NS_REG REG_MM(0x010C) |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 271 | #define VFE_CC2_REG REG_MM(0x023C) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 272 | #define VPE_CC_REG REG_MM(0x0110) |
| 273 | #define VPE_NS_REG REG_MM(0x0118) |
| 274 | |
| 275 | /* Low-power Audio clock registers. */ |
Stephen Boyd | 3939c8d | 2011-08-29 17:36:22 -0700 | [diff] [blame] | 276 | #define LCC_CLK_HS_DEBUG_CFG_REG REG_LPA(0x00A4) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 277 | #define LCC_CLK_LS_DEBUG_CFG_REG REG_LPA(0x00A8) |
| 278 | #define LCC_CODEC_I2S_MIC_MD_REG REG_LPA(0x0064) |
| 279 | #define LCC_CODEC_I2S_MIC_NS_REG REG_LPA(0x0060) |
| 280 | #define LCC_CODEC_I2S_MIC_STATUS_REG REG_LPA(0x0068) |
| 281 | #define LCC_CODEC_I2S_SPKR_MD_REG REG_LPA(0x0070) |
| 282 | #define LCC_CODEC_I2S_SPKR_NS_REG REG_LPA(0x006C) |
| 283 | #define LCC_CODEC_I2S_SPKR_STATUS_REG REG_LPA(0x0074) |
| 284 | #define LCC_MI2S_MD_REG REG_LPA(0x004C) |
| 285 | #define LCC_MI2S_NS_REG REG_LPA(0x0048) |
| 286 | #define LCC_MI2S_STATUS_REG REG_LPA(0x0050) |
| 287 | #define LCC_PCM_MD_REG REG_LPA(0x0058) |
| 288 | #define LCC_PCM_NS_REG REG_LPA(0x0054) |
| 289 | #define LCC_PCM_STATUS_REG REG_LPA(0x005C) |
Tianyi Gou | c29c324 | 2011-10-12 21:02:15 -0700 | [diff] [blame] | 290 | #define LCC_PLL0_MODE_REG REG_LPA(0x0000) |
| 291 | #define LCC_PLL0_L_VAL_REG REG_LPA(0x0004) |
| 292 | #define LCC_PLL0_M_VAL_REG REG_LPA(0x0008) |
| 293 | #define LCC_PLL0_N_VAL_REG REG_LPA(0x000C) |
| 294 | #define LCC_PLL0_CONFIG_REG REG_LPA(0x0014) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 295 | #define LCC_PLL0_STATUS_REG REG_LPA(0x0018) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 296 | #define LCC_SPARE_I2S_MIC_MD_REG REG_LPA(0x007C) |
| 297 | #define LCC_SPARE_I2S_MIC_NS_REG REG_LPA(0x0078) |
| 298 | #define LCC_SPARE_I2S_MIC_STATUS_REG REG_LPA(0x0080) |
| 299 | #define LCC_SPARE_I2S_SPKR_MD_REG REG_LPA(0x0088) |
| 300 | #define LCC_SPARE_I2S_SPKR_NS_REG REG_LPA(0x0084) |
| 301 | #define LCC_SPARE_I2S_SPKR_STATUS_REG REG_LPA(0x008C) |
| 302 | #define LCC_SLIMBUS_NS_REG REG_LPA(0x00CC) |
| 303 | #define LCC_SLIMBUS_MD_REG REG_LPA(0x00D0) |
| 304 | #define LCC_SLIMBUS_STATUS_REG REG_LPA(0x00D4) |
| 305 | #define LCC_AHBEX_BRANCH_CTL_REG REG_LPA(0x00E4) |
Tianyi Gou | c29c324 | 2011-10-12 21:02:15 -0700 | [diff] [blame] | 306 | #define LCC_PRI_PLL_CLK_CTL_REG REG_LPA(0x00C4) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 307 | |
Matt Wagantall | 8b38f94 | 2011-08-02 18:23:18 -0700 | [diff] [blame] | 308 | #define GCC_APCS_CLK_DIAG REG_GCC(0x001C) |
| 309 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 310 | /* MUX source input identifiers. */ |
| 311 | #define pxo_to_bb_mux 0 |
Matt Wagantall | 7625a4c | 2011-11-01 16:17:53 -0700 | [diff] [blame] | 312 | #define cxo_to_bb_mux 5 |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 313 | #define pll0_to_bb_mux 2 |
| 314 | #define pll8_to_bb_mux 3 |
| 315 | #define pll6_to_bb_mux 4 |
| 316 | #define gnd_to_bb_mux 5 |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 317 | #define pll3_to_bb_mux 6 |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 318 | #define pxo_to_mm_mux 0 |
| 319 | #define pll1_to_mm_mux 1 |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 320 | #define pll2_to_mm_mux 1 /* or MMCC_PLL1 */ |
| 321 | #define pll8_to_mm_mux 2 /* or GCC_PERF */ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 322 | #define pll0_to_mm_mux 3 |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 323 | #define pll15_to_mm_mux 3 /* or MM_PLL3 */ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 324 | #define gnd_to_mm_mux 4 |
Stephen Boyd | 7a776cd | 2011-10-20 12:46:04 -0700 | [diff] [blame] | 325 | #define pll3_to_mm_mux 3 /* or MMCC_PLL2 */ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 326 | #define hdmi_pll_to_mm_mux 3 |
| 327 | #define cxo_to_xo_mux 0 |
| 328 | #define pxo_to_xo_mux 1 |
| 329 | #define gnd_to_xo_mux 3 |
| 330 | #define pxo_to_lpa_mux 0 |
| 331 | #define cxo_to_lpa_mux 1 |
| 332 | #define pll4_to_lpa_mux 2 |
| 333 | #define gnd_to_lpa_mux 6 |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 334 | #define pxo_to_pcie_mux 0 |
| 335 | #define pll3_to_pcie_mux 1 |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 336 | |
| 337 | /* Test Vector Macros */ |
| 338 | #define TEST_TYPE_PER_LS 1 |
| 339 | #define TEST_TYPE_PER_HS 2 |
| 340 | #define TEST_TYPE_MM_LS 3 |
| 341 | #define TEST_TYPE_MM_HS 4 |
| 342 | #define TEST_TYPE_LPA 5 |
Matt Wagantall | 8b38f94 | 2011-08-02 18:23:18 -0700 | [diff] [blame] | 343 | #define TEST_TYPE_CPUL2 6 |
Stephen Boyd | 3939c8d | 2011-08-29 17:36:22 -0700 | [diff] [blame] | 344 | #define TEST_TYPE_LPA_HS 7 |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 345 | #define TEST_TYPE_SHIFT 24 |
| 346 | #define TEST_CLK_SEL_MASK BM(23, 0) |
| 347 | #define TEST_VECTOR(s, t) (((t) << TEST_TYPE_SHIFT) | BVAL(23, 0, (s))) |
| 348 | #define TEST_PER_LS(s) TEST_VECTOR((s), TEST_TYPE_PER_LS) |
| 349 | #define TEST_PER_HS(s) TEST_VECTOR((s), TEST_TYPE_PER_HS) |
| 350 | #define TEST_MM_LS(s) TEST_VECTOR((s), TEST_TYPE_MM_LS) |
| 351 | #define TEST_MM_HS(s) TEST_VECTOR((s), TEST_TYPE_MM_HS) |
| 352 | #define TEST_LPA(s) TEST_VECTOR((s), TEST_TYPE_LPA) |
Stephen Boyd | 3939c8d | 2011-08-29 17:36:22 -0700 | [diff] [blame] | 353 | #define TEST_LPA_HS(s) TEST_VECTOR((s), TEST_TYPE_LPA_HS) |
Matt Wagantall | 8b38f94 | 2011-08-02 18:23:18 -0700 | [diff] [blame] | 354 | #define TEST_CPUL2(s) TEST_VECTOR((s), TEST_TYPE_CPUL2) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 355 | |
| 356 | #define MN_MODE_DUAL_EDGE 0x2 |
| 357 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 358 | struct pll_rate { |
| 359 | const uint32_t l_val; |
| 360 | const uint32_t m_val; |
| 361 | const uint32_t n_val; |
| 362 | const uint32_t vco; |
| 363 | const uint32_t post_div; |
| 364 | const uint32_t i_bits; |
| 365 | }; |
| 366 | #define PLL_RATE(l, m, n, v, d, i) { l, m, n, v, (d>>1), i } |
| 367 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 368 | enum vdd_dig_levels { |
| 369 | VDD_DIG_NONE, |
| 370 | VDD_DIG_LOW, |
| 371 | VDD_DIG_NOMINAL, |
| 372 | VDD_DIG_HIGH |
| 373 | }; |
| 374 | |
Saravana Kannan | 298ec39 | 2012-02-08 19:21:47 -0800 | [diff] [blame] | 375 | 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] | 376 | { |
| 377 | static const int vdd_uv[] = { |
| 378 | [VDD_DIG_NONE] = 0, |
| 379 | [VDD_DIG_LOW] = 945000, |
| 380 | [VDD_DIG_NOMINAL] = 1050000, |
| 381 | [VDD_DIG_HIGH] = 1150000 |
| 382 | }; |
Saravana Kannan | 298ec39 | 2012-02-08 19:21:47 -0800 | [diff] [blame] | 383 | 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] | 384 | vdd_uv[level], 1150000, 1); |
| 385 | } |
| 386 | |
Saravana Kannan | 298ec39 | 2012-02-08 19:21:47 -0800 | [diff] [blame] | 387 | static DEFINE_VDD_CLASS(vdd_dig, set_vdd_dig_8960); |
| 388 | |
| 389 | static int set_vdd_dig_8930(struct clk_vdd_class *vdd_class, int level) |
| 390 | { |
Saravana Kannan | ebaa3ac | 2012-02-08 19:55:44 -0800 | [diff] [blame] | 391 | static const int vdd_corner[] = { |
| 392 | [VDD_DIG_NONE] = RPM_VREG_CORNER_NONE, |
| 393 | [VDD_DIG_LOW] = RPM_VREG_CORNER_LOW, |
| 394 | [VDD_DIG_NOMINAL] = RPM_VREG_CORNER_NOMINAL, |
| 395 | [VDD_DIG_HIGH] = RPM_VREG_CORNER_HIGH, |
Saravana Kannan | 298ec39 | 2012-02-08 19:21:47 -0800 | [diff] [blame] | 396 | }; |
Saravana Kannan | ebaa3ac | 2012-02-08 19:55:44 -0800 | [diff] [blame] | 397 | return rpm_vreg_set_voltage(RPM_VREG_ID_PM8038_VDD_DIG_CORNER, |
| 398 | RPM_VREG_VOTER3, |
| 399 | vdd_corner[level], |
| 400 | RPM_VREG_CORNER_HIGH, 1); |
Saravana Kannan | 298ec39 | 2012-02-08 19:21:47 -0800 | [diff] [blame] | 401 | } |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 402 | |
| 403 | #define VDD_DIG_FMAX_MAP1(l1, f1) \ |
| 404 | .vdd_class = &vdd_dig, \ |
| 405 | .fmax[VDD_DIG_##l1] = (f1) |
| 406 | #define VDD_DIG_FMAX_MAP2(l1, f1, l2, f2) \ |
| 407 | .vdd_class = &vdd_dig, \ |
| 408 | .fmax[VDD_DIG_##l1] = (f1), \ |
| 409 | .fmax[VDD_DIG_##l2] = (f2) |
| 410 | #define VDD_DIG_FMAX_MAP3(l1, f1, l2, f2, l3, f3) \ |
| 411 | .vdd_class = &vdd_dig, \ |
| 412 | .fmax[VDD_DIG_##l1] = (f1), \ |
| 413 | .fmax[VDD_DIG_##l2] = (f2), \ |
| 414 | .fmax[VDD_DIG_##l3] = (f3) |
| 415 | |
Tianyi Gou | e1faaf2 | 2012-01-24 16:07:19 -0800 | [diff] [blame] | 416 | enum vdd_sr2_pll_levels { |
| 417 | VDD_SR2_PLL_OFF, |
| 418 | VDD_SR2_PLL_ON |
Matt Wagantall | c57577d | 2011-10-06 17:06:53 -0700 | [diff] [blame] | 419 | }; |
| 420 | |
Saravana Kannan | 298ec39 | 2012-02-08 19:21:47 -0800 | [diff] [blame] | 421 | 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] | 422 | { |
Tianyi Gou | bf3d0b1 | 2012-01-23 14:37:28 -0800 | [diff] [blame] | 423 | int rc = 0; |
Saravana Kannan | 298ec39 | 2012-02-08 19:21:47 -0800 | [diff] [blame] | 424 | |
| 425 | if (level == VDD_SR2_PLL_OFF) { |
| 426 | rc = rpm_vreg_set_voltage(RPM_VREG_ID_PM8921_L23, |
| 427 | RPM_VREG_VOTER3, 0, 0, 1); |
| 428 | if (rc) |
| 429 | return rc; |
| 430 | rc = rpm_vreg_set_voltage(RPM_VREG_ID_PM8921_S8, |
| 431 | RPM_VREG_VOTER3, 0, 0, 1); |
| 432 | if (rc) |
| 433 | rpm_vreg_set_voltage(RPM_VREG_ID_PM8921_L23, |
| 434 | RPM_VREG_VOTER3, 1800000, 1800000, 1); |
Tianyi Gou | e1faaf2 | 2012-01-24 16:07:19 -0800 | [diff] [blame] | 435 | } else { |
Saravana Kannan | 298ec39 | 2012-02-08 19:21:47 -0800 | [diff] [blame] | 436 | rc = rpm_vreg_set_voltage(RPM_VREG_ID_PM8921_S8, |
David Collins | 9a81d6c | 2012-03-29 15:11:33 -0700 | [diff] [blame] | 437 | RPM_VREG_VOTER3, 2050000, 2100000, 1); |
Saravana Kannan | 298ec39 | 2012-02-08 19:21:47 -0800 | [diff] [blame] | 438 | if (rc) |
| 439 | return rc; |
| 440 | rc = rpm_vreg_set_voltage(RPM_VREG_ID_PM8921_L23, |
| 441 | RPM_VREG_VOTER3, 1800000, 1800000, 1); |
| 442 | if (rc) |
| 443 | rpm_vreg_set_voltage(RPM_VREG_ID_PM8921_S8, |
Tianyi Gou | bf3d0b1 | 2012-01-23 14:37:28 -0800 | [diff] [blame] | 444 | RPM_VREG_VOTER3, 0, 0, 1); |
Matt Wagantall | c57577d | 2011-10-06 17:06:53 -0700 | [diff] [blame] | 445 | } |
| 446 | |
| 447 | return rc; |
| 448 | } |
| 449 | |
Saravana Kannan | 298ec39 | 2012-02-08 19:21:47 -0800 | [diff] [blame] | 450 | static DEFINE_VDD_CLASS(vdd_sr2_pll, set_vdd_sr2_pll_8960); |
| 451 | |
| 452 | static int sr2_lreg_uv[] = { |
| 453 | [VDD_SR2_PLL_OFF] = 0, |
| 454 | [VDD_SR2_PLL_ON] = 1800000, |
| 455 | }; |
| 456 | |
| 457 | static int set_vdd_sr2_pll_8064(struct clk_vdd_class *vdd_class, int level) |
| 458 | { |
| 459 | return rpm_vreg_set_voltage(RPM_VREG_ID_PM8921_LVS7, RPM_VREG_VOTER3, |
| 460 | sr2_lreg_uv[level], sr2_lreg_uv[level], 1); |
| 461 | } |
| 462 | |
| 463 | static int set_vdd_sr2_pll_8930(struct clk_vdd_class *vdd_class, int level) |
| 464 | { |
| 465 | return rpm_vreg_set_voltage(RPM_VREG_ID_PM8038_L23, RPM_VREG_VOTER3, |
| 466 | sr2_lreg_uv[level], sr2_lreg_uv[level], 1); |
| 467 | } |
Matt Wagantall | c57577d | 2011-10-06 17:06:53 -0700 | [diff] [blame] | 468 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 469 | /* |
| 470 | * Clock Descriptions |
| 471 | */ |
| 472 | |
Stephen Boyd | 72a8035 | 2012-01-26 15:57:38 -0800 | [diff] [blame] | 473 | DEFINE_CLK_RPM_BRANCH(pxo_clk, pxo_a_clk, PXO, 27000000); |
| 474 | DEFINE_CLK_RPM_BRANCH(cxo_clk, cxo_a_clk, CXO, 19200000); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 475 | |
| 476 | static struct pll_clk pll2_clk = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 477 | .mode_reg = MM_PLL1_MODE_REG, |
| 478 | .parent = &pxo_clk.c, |
| 479 | .c = { |
| 480 | .dbg_name = "pll2_clk", |
Tianyi Gou | 7949ecb | 2012-02-14 14:25:32 -0800 | [diff] [blame] | 481 | .rate = 800000000, |
Vikram Mulukutla | 681d868 | 2012-03-09 23:56:20 -0800 | [diff] [blame] | 482 | .ops = &clk_ops_local_pll, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 483 | CLK_INIT(pll2_clk.c), |
Stephen Boyd | 3bbf346 | 2012-01-12 00:19:23 -0800 | [diff] [blame] | 484 | .warned = true, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 485 | }, |
| 486 | }; |
| 487 | |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 488 | static struct pll_clk pll3_clk = { |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 489 | .mode_reg = BB_MMCC_PLL2_MODE_REG, |
| 490 | .parent = &pxo_clk.c, |
| 491 | .c = { |
| 492 | .dbg_name = "pll3_clk", |
Tianyi Gou | 7949ecb | 2012-02-14 14:25:32 -0800 | [diff] [blame] | 493 | .rate = 1200000000, |
Vikram Mulukutla | 681d868 | 2012-03-09 23:56:20 -0800 | [diff] [blame] | 494 | .ops = &clk_ops_local_pll, |
Tianyi Gou | e1faaf2 | 2012-01-24 16:07:19 -0800 | [diff] [blame] | 495 | .vdd_class = &vdd_sr2_pll, |
| 496 | .fmax[VDD_SR2_PLL_ON] = ULONG_MAX, |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 497 | CLK_INIT(pll3_clk.c), |
Stephen Boyd | 3bbf346 | 2012-01-12 00:19:23 -0800 | [diff] [blame] | 498 | .warned = true, |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 499 | }, |
| 500 | }; |
| 501 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 502 | static struct pll_vote_clk pll4_clk = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 503 | .en_reg = BB_PLL_ENA_SC0_REG, |
| 504 | .en_mask = BIT(4), |
| 505 | .status_reg = LCC_PLL0_STATUS_REG, |
Vikram Mulukutla | 681d868 | 2012-03-09 23:56:20 -0800 | [diff] [blame] | 506 | .status_mask = BIT(16), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 507 | .parent = &pxo_clk.c, |
| 508 | .c = { |
| 509 | .dbg_name = "pll4_clk", |
Tianyi Gou | 7949ecb | 2012-02-14 14:25:32 -0800 | [diff] [blame] | 510 | .rate = 393216000, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 511 | .ops = &clk_ops_pll_vote, |
| 512 | CLK_INIT(pll4_clk.c), |
Stephen Boyd | 3bbf346 | 2012-01-12 00:19:23 -0800 | [diff] [blame] | 513 | .warned = true, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 514 | }, |
| 515 | }; |
| 516 | |
| 517 | static struct pll_vote_clk pll8_clk = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 518 | .en_reg = BB_PLL_ENA_SC0_REG, |
| 519 | .en_mask = BIT(8), |
| 520 | .status_reg = BB_PLL8_STATUS_REG, |
Vikram Mulukutla | 681d868 | 2012-03-09 23:56:20 -0800 | [diff] [blame] | 521 | .status_mask = BIT(16), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 522 | .parent = &pxo_clk.c, |
| 523 | .c = { |
| 524 | .dbg_name = "pll8_clk", |
Tianyi Gou | 7949ecb | 2012-02-14 14:25:32 -0800 | [diff] [blame] | 525 | .rate = 384000000, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 526 | .ops = &clk_ops_pll_vote, |
| 527 | CLK_INIT(pll8_clk.c), |
Stephen Boyd | 3bbf346 | 2012-01-12 00:19:23 -0800 | [diff] [blame] | 528 | .warned = true, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 529 | }, |
| 530 | }; |
| 531 | |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 532 | static struct pll_vote_clk pll14_clk = { |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 533 | .en_reg = BB_PLL_ENA_SC0_REG, |
| 534 | .en_mask = BIT(14), |
| 535 | .status_reg = BB_PLL14_STATUS_REG, |
Vikram Mulukutla | 681d868 | 2012-03-09 23:56:20 -0800 | [diff] [blame] | 536 | .status_mask = BIT(16), |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 537 | .parent = &pxo_clk.c, |
| 538 | .c = { |
| 539 | .dbg_name = "pll14_clk", |
Tianyi Gou | 7949ecb | 2012-02-14 14:25:32 -0800 | [diff] [blame] | 540 | .rate = 480000000, |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 541 | .ops = &clk_ops_pll_vote, |
| 542 | CLK_INIT(pll14_clk.c), |
Stephen Boyd | 3bbf346 | 2012-01-12 00:19:23 -0800 | [diff] [blame] | 543 | .warned = true, |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 544 | }, |
| 545 | }; |
| 546 | |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 547 | static struct pll_clk pll15_clk = { |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 548 | .mode_reg = MM_PLL3_MODE_REG, |
| 549 | .parent = &pxo_clk.c, |
| 550 | .c = { |
| 551 | .dbg_name = "pll15_clk", |
Tianyi Gou | 7949ecb | 2012-02-14 14:25:32 -0800 | [diff] [blame] | 552 | .rate = 975000000, |
Vikram Mulukutla | 681d868 | 2012-03-09 23:56:20 -0800 | [diff] [blame] | 553 | .ops = &clk_ops_local_pll, |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 554 | CLK_INIT(pll15_clk.c), |
Stephen Boyd | 3bbf346 | 2012-01-12 00:19:23 -0800 | [diff] [blame] | 555 | .warned = true, |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 556 | }, |
| 557 | }; |
| 558 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 559 | /* AXI Interfaces */ |
| 560 | static struct branch_clk gmem_axi_clk = { |
| 561 | .b = { |
| 562 | .ctl_reg = MAXI_EN_REG, |
| 563 | .en_mask = BIT(24), |
| 564 | .halt_reg = DBG_BUS_VEC_E_REG, |
| 565 | .halt_bit = 6, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 566 | .retain_reg = MAXI_EN2_REG, |
| 567 | .retain_mask = BIT(21), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 568 | }, |
| 569 | .c = { |
| 570 | .dbg_name = "gmem_axi_clk", |
| 571 | .ops = &clk_ops_branch, |
| 572 | CLK_INIT(gmem_axi_clk.c), |
| 573 | }, |
| 574 | }; |
| 575 | |
| 576 | static struct branch_clk ijpeg_axi_clk = { |
| 577 | .b = { |
| 578 | .ctl_reg = MAXI_EN_REG, |
| 579 | .en_mask = BIT(21), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 580 | .hwcg_reg = MAXI_EN_REG, |
| 581 | .hwcg_mask = BIT(11), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 582 | .reset_reg = SW_RESET_AXI_REG, |
| 583 | .reset_mask = BIT(14), |
| 584 | .halt_reg = DBG_BUS_VEC_E_REG, |
| 585 | .halt_bit = 4, |
| 586 | }, |
| 587 | .c = { |
| 588 | .dbg_name = "ijpeg_axi_clk", |
| 589 | .ops = &clk_ops_branch, |
| 590 | CLK_INIT(ijpeg_axi_clk.c), |
| 591 | }, |
| 592 | }; |
| 593 | |
| 594 | static struct branch_clk imem_axi_clk = { |
| 595 | .b = { |
| 596 | .ctl_reg = MAXI_EN_REG, |
| 597 | .en_mask = BIT(22), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 598 | .hwcg_reg = MAXI_EN_REG, |
| 599 | .hwcg_mask = BIT(15), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 600 | .reset_reg = SW_RESET_CORE_REG, |
| 601 | .reset_mask = BIT(10), |
| 602 | .halt_reg = DBG_BUS_VEC_E_REG, |
| 603 | .halt_bit = 7, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 604 | .retain_reg = MAXI_EN2_REG, |
| 605 | .retain_mask = BIT(10), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 606 | }, |
| 607 | .c = { |
| 608 | .dbg_name = "imem_axi_clk", |
| 609 | .ops = &clk_ops_branch, |
| 610 | CLK_INIT(imem_axi_clk.c), |
| 611 | }, |
| 612 | }; |
| 613 | |
| 614 | static struct branch_clk jpegd_axi_clk = { |
| 615 | .b = { |
| 616 | .ctl_reg = MAXI_EN_REG, |
| 617 | .en_mask = BIT(25), |
| 618 | .halt_reg = DBG_BUS_VEC_E_REG, |
| 619 | .halt_bit = 5, |
| 620 | }, |
| 621 | .c = { |
| 622 | .dbg_name = "jpegd_axi_clk", |
| 623 | .ops = &clk_ops_branch, |
| 624 | CLK_INIT(jpegd_axi_clk.c), |
| 625 | }, |
| 626 | }; |
| 627 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 628 | static struct branch_clk vcodec_axi_b_clk = { |
| 629 | .b = { |
| 630 | .ctl_reg = MAXI_EN4_REG, |
| 631 | .en_mask = BIT(23), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 632 | .hwcg_reg = MAXI_EN4_REG, |
| 633 | .hwcg_mask = BIT(22), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 634 | .halt_reg = DBG_BUS_VEC_I_REG, |
| 635 | .halt_bit = 25, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 636 | .retain_reg = MAXI_EN4_REG, |
| 637 | .retain_mask = BIT(21), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 638 | }, |
| 639 | .c = { |
| 640 | .dbg_name = "vcodec_axi_b_clk", |
| 641 | .ops = &clk_ops_branch, |
| 642 | CLK_INIT(vcodec_axi_b_clk.c), |
| 643 | }, |
| 644 | }; |
| 645 | |
Matt Wagantall | 91f4270 | 2011-07-14 12:01:15 -0700 | [diff] [blame] | 646 | static struct branch_clk vcodec_axi_a_clk = { |
| 647 | .b = { |
| 648 | .ctl_reg = MAXI_EN4_REG, |
| 649 | .en_mask = BIT(25), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 650 | .hwcg_reg = MAXI_EN4_REG, |
| 651 | .hwcg_mask = BIT(24), |
Matt Wagantall | 91f4270 | 2011-07-14 12:01:15 -0700 | [diff] [blame] | 652 | .halt_reg = DBG_BUS_VEC_I_REG, |
| 653 | .halt_bit = 26, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 654 | .retain_reg = MAXI_EN4_REG, |
| 655 | .retain_mask = BIT(10), |
Matt Wagantall | 91f4270 | 2011-07-14 12:01:15 -0700 | [diff] [blame] | 656 | }, |
Matt Wagantall | 91f4270 | 2011-07-14 12:01:15 -0700 | [diff] [blame] | 657 | .c = { |
| 658 | .dbg_name = "vcodec_axi_a_clk", |
| 659 | .ops = &clk_ops_branch, |
| 660 | CLK_INIT(vcodec_axi_a_clk.c), |
Stephen Boyd | 7fa2674 | 2011-08-11 23:22:29 -0700 | [diff] [blame] | 661 | .depends = &vcodec_axi_b_clk.c, |
Matt Wagantall | 91f4270 | 2011-07-14 12:01:15 -0700 | [diff] [blame] | 662 | }, |
| 663 | }; |
| 664 | |
| 665 | static struct branch_clk vcodec_axi_clk = { |
| 666 | .b = { |
| 667 | .ctl_reg = MAXI_EN_REG, |
| 668 | .en_mask = BIT(19), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 669 | .hwcg_reg = MAXI_EN_REG, |
| 670 | .hwcg_mask = BIT(13), |
Matt Wagantall | 91f4270 | 2011-07-14 12:01:15 -0700 | [diff] [blame] | 671 | .reset_reg = SW_RESET_AXI_REG, |
Gopikrishnaiah Anandan | 83b6e85 | 2012-01-05 17:47:02 -0800 | [diff] [blame] | 672 | .reset_mask = BIT(4)|BIT(5)|BIT(7), |
Matt Wagantall | 91f4270 | 2011-07-14 12:01:15 -0700 | [diff] [blame] | 673 | .halt_reg = DBG_BUS_VEC_E_REG, |
| 674 | .halt_bit = 3, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 675 | .retain_reg = MAXI_EN2_REG, |
| 676 | .retain_mask = BIT(28), |
Matt Wagantall | 91f4270 | 2011-07-14 12:01:15 -0700 | [diff] [blame] | 677 | }, |
Matt Wagantall | 91f4270 | 2011-07-14 12:01:15 -0700 | [diff] [blame] | 678 | .c = { |
| 679 | .dbg_name = "vcodec_axi_clk", |
| 680 | .ops = &clk_ops_branch, |
| 681 | CLK_INIT(vcodec_axi_clk.c), |
Stephen Boyd | 7fa2674 | 2011-08-11 23:22:29 -0700 | [diff] [blame] | 682 | .depends = &vcodec_axi_a_clk.c, |
Matt Wagantall | 91f4270 | 2011-07-14 12:01:15 -0700 | [diff] [blame] | 683 | }, |
| 684 | }; |
| 685 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 686 | static struct branch_clk vfe_axi_clk = { |
| 687 | .b = { |
| 688 | .ctl_reg = MAXI_EN_REG, |
| 689 | .en_mask = BIT(18), |
| 690 | .reset_reg = SW_RESET_AXI_REG, |
| 691 | .reset_mask = BIT(9), |
| 692 | .halt_reg = DBG_BUS_VEC_E_REG, |
| 693 | .halt_bit = 0, |
| 694 | }, |
| 695 | .c = { |
| 696 | .dbg_name = "vfe_axi_clk", |
| 697 | .ops = &clk_ops_branch, |
| 698 | CLK_INIT(vfe_axi_clk.c), |
| 699 | }, |
| 700 | }; |
| 701 | |
| 702 | static struct branch_clk mdp_axi_clk = { |
| 703 | .b = { |
| 704 | .ctl_reg = MAXI_EN_REG, |
| 705 | .en_mask = BIT(23), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 706 | .hwcg_reg = MAXI_EN_REG, |
| 707 | .hwcg_mask = BIT(16), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 708 | .reset_reg = SW_RESET_AXI_REG, |
| 709 | .reset_mask = BIT(13), |
| 710 | .halt_reg = DBG_BUS_VEC_E_REG, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 711 | .halt_bit = 8, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 712 | .retain_reg = MAXI_EN_REG, |
| 713 | .retain_mask = BIT(0), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 714 | }, |
| 715 | .c = { |
| 716 | .dbg_name = "mdp_axi_clk", |
| 717 | .ops = &clk_ops_branch, |
| 718 | CLK_INIT(mdp_axi_clk.c), |
| 719 | }, |
| 720 | }; |
| 721 | |
| 722 | static struct branch_clk rot_axi_clk = { |
| 723 | .b = { |
| 724 | .ctl_reg = MAXI_EN2_REG, |
| 725 | .en_mask = BIT(24), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 726 | .hwcg_reg = MAXI_EN2_REG, |
| 727 | .hwcg_mask = BIT(25), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 728 | .reset_reg = SW_RESET_AXI_REG, |
| 729 | .reset_mask = BIT(6), |
| 730 | .halt_reg = DBG_BUS_VEC_E_REG, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 731 | .halt_bit = 2, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 732 | .retain_reg = MAXI_EN3_REG, |
| 733 | .retain_mask = BIT(10), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 734 | }, |
| 735 | .c = { |
| 736 | .dbg_name = "rot_axi_clk", |
| 737 | .ops = &clk_ops_branch, |
| 738 | CLK_INIT(rot_axi_clk.c), |
| 739 | }, |
| 740 | }; |
| 741 | |
| 742 | static struct branch_clk vpe_axi_clk = { |
| 743 | .b = { |
| 744 | .ctl_reg = MAXI_EN2_REG, |
| 745 | .en_mask = BIT(26), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 746 | .hwcg_reg = MAXI_EN2_REG, |
| 747 | .hwcg_mask = BIT(27), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 748 | .reset_reg = SW_RESET_AXI_REG, |
| 749 | .reset_mask = BIT(15), |
| 750 | .halt_reg = DBG_BUS_VEC_E_REG, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 751 | .halt_bit = 1, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 752 | .retain_reg = MAXI_EN3_REG, |
| 753 | .retain_mask = BIT(21), |
| 754 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 755 | }, |
| 756 | .c = { |
| 757 | .dbg_name = "vpe_axi_clk", |
| 758 | .ops = &clk_ops_branch, |
| 759 | CLK_INIT(vpe_axi_clk.c), |
| 760 | }, |
| 761 | }; |
| 762 | |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 763 | static struct branch_clk vcap_axi_clk = { |
| 764 | .b = { |
| 765 | .ctl_reg = MAXI_EN5_REG, |
| 766 | .en_mask = BIT(12), |
| 767 | .reset_reg = SW_RESET_AXI_REG, |
| 768 | .reset_mask = BIT(16), |
| 769 | .halt_reg = DBG_BUS_VEC_J_REG, |
| 770 | .halt_bit = 20, |
| 771 | }, |
| 772 | .c = { |
| 773 | .dbg_name = "vcap_axi_clk", |
| 774 | .ops = &clk_ops_branch, |
| 775 | CLK_INIT(vcap_axi_clk.c), |
| 776 | }, |
| 777 | }; |
| 778 | |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 779 | /* gfx3d_axi_clk is set as a dependency of gmem_axi_clk at runtime */ |
| 780 | static struct branch_clk gfx3d_axi_clk_8064 = { |
Tianyi Gou | 621f874 | 2011-09-01 21:45:01 -0700 | [diff] [blame] | 781 | .b = { |
| 782 | .ctl_reg = MAXI_EN5_REG, |
| 783 | .en_mask = BIT(25), |
| 784 | .reset_reg = SW_RESET_AXI_REG, |
| 785 | .reset_mask = BIT(17), |
| 786 | .halt_reg = DBG_BUS_VEC_J_REG, |
| 787 | .halt_bit = 30, |
| 788 | }, |
| 789 | .c = { |
| 790 | .dbg_name = "gfx3d_axi_clk", |
| 791 | .ops = &clk_ops_branch, |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 792 | CLK_INIT(gfx3d_axi_clk_8064.c), |
| 793 | }, |
| 794 | }; |
| 795 | |
| 796 | static struct branch_clk gfx3d_axi_clk_8930 = { |
| 797 | .b = { |
| 798 | .ctl_reg = MAXI_EN5_REG, |
| 799 | .en_mask = BIT(12), |
| 800 | .reset_reg = SW_RESET_AXI_REG, |
| 801 | .reset_mask = BIT(16), |
| 802 | .halt_reg = DBG_BUS_VEC_J_REG, |
| 803 | .halt_bit = 12, |
| 804 | }, |
| 805 | .c = { |
| 806 | .dbg_name = "gfx3d_axi_clk", |
| 807 | .ops = &clk_ops_branch, |
| 808 | CLK_INIT(gfx3d_axi_clk_8930.c), |
Tianyi Gou | 621f874 | 2011-09-01 21:45:01 -0700 | [diff] [blame] | 809 | }, |
| 810 | }; |
| 811 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 812 | /* AHB Interfaces */ |
| 813 | static struct branch_clk amp_p_clk = { |
| 814 | .b = { |
| 815 | .ctl_reg = AHB_EN_REG, |
| 816 | .en_mask = BIT(24), |
Matt Wagantall | d40857a | 2012-04-10 19:15:43 -0700 | [diff] [blame] | 817 | .reset_reg = SW_RESET_CORE_REG, |
| 818 | .reset_mask = BIT(20), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 819 | .halt_reg = DBG_BUS_VEC_F_REG, |
| 820 | .halt_bit = 18, |
| 821 | }, |
| 822 | .c = { |
| 823 | .dbg_name = "amp_p_clk", |
| 824 | .ops = &clk_ops_branch, |
| 825 | CLK_INIT(amp_p_clk.c), |
| 826 | }, |
| 827 | }; |
| 828 | |
Matt Wagantall | c23eee9 | 2011-08-16 23:06:52 -0700 | [diff] [blame] | 829 | static struct branch_clk csi_p_clk = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 830 | .b = { |
| 831 | .ctl_reg = AHB_EN_REG, |
| 832 | .en_mask = BIT(7), |
| 833 | .reset_reg = SW_RESET_AHB_REG, |
| 834 | .reset_mask = BIT(17), |
| 835 | .halt_reg = DBG_BUS_VEC_F_REG, |
| 836 | .halt_bit = 16, |
| 837 | }, |
| 838 | .c = { |
Matt Wagantall | c23eee9 | 2011-08-16 23:06:52 -0700 | [diff] [blame] | 839 | .dbg_name = "csi_p_clk", |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 840 | .ops = &clk_ops_branch, |
Matt Wagantall | c23eee9 | 2011-08-16 23:06:52 -0700 | [diff] [blame] | 841 | CLK_INIT(csi_p_clk.c), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 842 | }, |
| 843 | }; |
| 844 | |
| 845 | static struct branch_clk dsi1_m_p_clk = { |
| 846 | .b = { |
| 847 | .ctl_reg = AHB_EN_REG, |
| 848 | .en_mask = BIT(9), |
| 849 | .reset_reg = SW_RESET_AHB_REG, |
| 850 | .reset_mask = BIT(6), |
| 851 | .halt_reg = DBG_BUS_VEC_F_REG, |
| 852 | .halt_bit = 19, |
| 853 | }, |
| 854 | .c = { |
| 855 | .dbg_name = "dsi1_m_p_clk", |
| 856 | .ops = &clk_ops_branch, |
| 857 | CLK_INIT(dsi1_m_p_clk.c), |
| 858 | }, |
| 859 | }; |
| 860 | |
| 861 | static struct branch_clk dsi1_s_p_clk = { |
| 862 | .b = { |
| 863 | .ctl_reg = AHB_EN_REG, |
| 864 | .en_mask = BIT(18), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 865 | .hwcg_reg = AHB_EN2_REG, |
| 866 | .hwcg_mask = BIT(20), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 867 | .reset_reg = SW_RESET_AHB_REG, |
| 868 | .reset_mask = BIT(5), |
| 869 | .halt_reg = DBG_BUS_VEC_F_REG, |
| 870 | .halt_bit = 21, |
| 871 | }, |
| 872 | .c = { |
| 873 | .dbg_name = "dsi1_s_p_clk", |
| 874 | .ops = &clk_ops_branch, |
| 875 | CLK_INIT(dsi1_s_p_clk.c), |
| 876 | }, |
| 877 | }; |
| 878 | |
| 879 | static struct branch_clk dsi2_m_p_clk = { |
| 880 | .b = { |
| 881 | .ctl_reg = AHB_EN_REG, |
| 882 | .en_mask = BIT(17), |
| 883 | .reset_reg = SW_RESET_AHB2_REG, |
| 884 | .reset_mask = BIT(1), |
| 885 | .halt_reg = DBG_BUS_VEC_E_REG, |
| 886 | .halt_bit = 18, |
| 887 | }, |
| 888 | .c = { |
| 889 | .dbg_name = "dsi2_m_p_clk", |
| 890 | .ops = &clk_ops_branch, |
| 891 | CLK_INIT(dsi2_m_p_clk.c), |
| 892 | }, |
| 893 | }; |
| 894 | |
| 895 | static struct branch_clk dsi2_s_p_clk = { |
| 896 | .b = { |
| 897 | .ctl_reg = AHB_EN_REG, |
| 898 | .en_mask = BIT(22), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 899 | .hwcg_reg = AHB_EN2_REG, |
| 900 | .hwcg_mask = BIT(15), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 901 | .reset_reg = SW_RESET_AHB2_REG, |
| 902 | .reset_mask = BIT(0), |
| 903 | .halt_reg = DBG_BUS_VEC_F_REG, |
| 904 | .halt_bit = 20, |
| 905 | }, |
| 906 | .c = { |
| 907 | .dbg_name = "dsi2_s_p_clk", |
| 908 | .ops = &clk_ops_branch, |
| 909 | CLK_INIT(dsi2_s_p_clk.c), |
| 910 | }, |
| 911 | }; |
| 912 | |
| 913 | static struct branch_clk gfx2d0_p_clk = { |
| 914 | .b = { |
| 915 | .ctl_reg = AHB_EN_REG, |
| 916 | .en_mask = BIT(19), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 917 | .hwcg_reg = AHB_EN2_REG, |
| 918 | .hwcg_mask = BIT(28), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 919 | .reset_reg = SW_RESET_AHB_REG, |
| 920 | .reset_mask = BIT(12), |
| 921 | .halt_reg = DBG_BUS_VEC_F_REG, |
| 922 | .halt_bit = 2, |
| 923 | }, |
| 924 | .c = { |
| 925 | .dbg_name = "gfx2d0_p_clk", |
| 926 | .ops = &clk_ops_branch, |
| 927 | CLK_INIT(gfx2d0_p_clk.c), |
| 928 | }, |
| 929 | }; |
| 930 | |
| 931 | static struct branch_clk gfx2d1_p_clk = { |
| 932 | .b = { |
| 933 | .ctl_reg = AHB_EN_REG, |
| 934 | .en_mask = BIT(2), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 935 | .hwcg_reg = AHB_EN2_REG, |
| 936 | .hwcg_mask = BIT(29), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 937 | .reset_reg = SW_RESET_AHB_REG, |
| 938 | .reset_mask = BIT(11), |
| 939 | .halt_reg = DBG_BUS_VEC_F_REG, |
| 940 | .halt_bit = 3, |
| 941 | }, |
| 942 | .c = { |
| 943 | .dbg_name = "gfx2d1_p_clk", |
| 944 | .ops = &clk_ops_branch, |
| 945 | CLK_INIT(gfx2d1_p_clk.c), |
| 946 | }, |
| 947 | }; |
| 948 | |
| 949 | static struct branch_clk gfx3d_p_clk = { |
| 950 | .b = { |
| 951 | .ctl_reg = AHB_EN_REG, |
| 952 | .en_mask = BIT(3), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 953 | .hwcg_reg = AHB_EN2_REG, |
| 954 | .hwcg_mask = BIT(27), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 955 | .reset_reg = SW_RESET_AHB_REG, |
| 956 | .reset_mask = BIT(10), |
| 957 | .halt_reg = DBG_BUS_VEC_F_REG, |
| 958 | .halt_bit = 4, |
| 959 | }, |
| 960 | .c = { |
| 961 | .dbg_name = "gfx3d_p_clk", |
| 962 | .ops = &clk_ops_branch, |
| 963 | CLK_INIT(gfx3d_p_clk.c), |
| 964 | }, |
| 965 | }; |
| 966 | |
| 967 | static struct branch_clk hdmi_m_p_clk = { |
| 968 | .b = { |
| 969 | .ctl_reg = AHB_EN_REG, |
| 970 | .en_mask = BIT(14), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 971 | .hwcg_reg = AHB_EN2_REG, |
| 972 | .hwcg_mask = BIT(21), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 973 | .reset_reg = SW_RESET_AHB_REG, |
| 974 | .reset_mask = BIT(9), |
| 975 | .halt_reg = DBG_BUS_VEC_F_REG, |
| 976 | .halt_bit = 5, |
| 977 | }, |
| 978 | .c = { |
| 979 | .dbg_name = "hdmi_m_p_clk", |
| 980 | .ops = &clk_ops_branch, |
| 981 | CLK_INIT(hdmi_m_p_clk.c), |
| 982 | }, |
| 983 | }; |
| 984 | |
| 985 | static struct branch_clk hdmi_s_p_clk = { |
| 986 | .b = { |
| 987 | .ctl_reg = AHB_EN_REG, |
| 988 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 989 | .hwcg_reg = AHB_EN2_REG, |
| 990 | .hwcg_mask = BIT(22), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 991 | .reset_reg = SW_RESET_AHB_REG, |
| 992 | .reset_mask = BIT(9), |
| 993 | .halt_reg = DBG_BUS_VEC_F_REG, |
| 994 | .halt_bit = 6, |
| 995 | }, |
| 996 | .c = { |
| 997 | .dbg_name = "hdmi_s_p_clk", |
| 998 | .ops = &clk_ops_branch, |
| 999 | CLK_INIT(hdmi_s_p_clk.c), |
| 1000 | }, |
| 1001 | }; |
| 1002 | |
| 1003 | static struct branch_clk ijpeg_p_clk = { |
| 1004 | .b = { |
| 1005 | .ctl_reg = AHB_EN_REG, |
| 1006 | .en_mask = BIT(5), |
| 1007 | .reset_reg = SW_RESET_AHB_REG, |
| 1008 | .reset_mask = BIT(7), |
| 1009 | .halt_reg = DBG_BUS_VEC_F_REG, |
| 1010 | .halt_bit = 9, |
| 1011 | }, |
| 1012 | .c = { |
| 1013 | .dbg_name = "ijpeg_p_clk", |
| 1014 | .ops = &clk_ops_branch, |
| 1015 | CLK_INIT(ijpeg_p_clk.c), |
| 1016 | }, |
| 1017 | }; |
| 1018 | |
| 1019 | static struct branch_clk imem_p_clk = { |
| 1020 | .b = { |
| 1021 | .ctl_reg = AHB_EN_REG, |
| 1022 | .en_mask = BIT(6), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 1023 | .hwcg_reg = AHB_EN2_REG, |
| 1024 | .hwcg_mask = BIT(12), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1025 | .reset_reg = SW_RESET_AHB_REG, |
| 1026 | .reset_mask = BIT(8), |
| 1027 | .halt_reg = DBG_BUS_VEC_F_REG, |
| 1028 | .halt_bit = 10, |
| 1029 | }, |
| 1030 | .c = { |
| 1031 | .dbg_name = "imem_p_clk", |
| 1032 | .ops = &clk_ops_branch, |
| 1033 | CLK_INIT(imem_p_clk.c), |
| 1034 | }, |
| 1035 | }; |
| 1036 | |
| 1037 | static struct branch_clk jpegd_p_clk = { |
| 1038 | .b = { |
| 1039 | .ctl_reg = AHB_EN_REG, |
| 1040 | .en_mask = BIT(21), |
| 1041 | .reset_reg = SW_RESET_AHB_REG, |
| 1042 | .reset_mask = BIT(4), |
| 1043 | .halt_reg = DBG_BUS_VEC_F_REG, |
| 1044 | .halt_bit = 7, |
| 1045 | }, |
| 1046 | .c = { |
| 1047 | .dbg_name = "jpegd_p_clk", |
| 1048 | .ops = &clk_ops_branch, |
| 1049 | CLK_INIT(jpegd_p_clk.c), |
| 1050 | }, |
| 1051 | }; |
| 1052 | |
| 1053 | static struct branch_clk mdp_p_clk = { |
| 1054 | .b = { |
| 1055 | .ctl_reg = AHB_EN_REG, |
| 1056 | .en_mask = BIT(10), |
| 1057 | .reset_reg = SW_RESET_AHB_REG, |
| 1058 | .reset_mask = BIT(3), |
| 1059 | .halt_reg = DBG_BUS_VEC_F_REG, |
| 1060 | .halt_bit = 11, |
| 1061 | }, |
| 1062 | .c = { |
| 1063 | .dbg_name = "mdp_p_clk", |
| 1064 | .ops = &clk_ops_branch, |
| 1065 | CLK_INIT(mdp_p_clk.c), |
| 1066 | }, |
| 1067 | }; |
| 1068 | |
| 1069 | static struct branch_clk rot_p_clk = { |
| 1070 | .b = { |
| 1071 | .ctl_reg = AHB_EN_REG, |
| 1072 | .en_mask = BIT(12), |
| 1073 | .reset_reg = SW_RESET_AHB_REG, |
| 1074 | .reset_mask = BIT(2), |
| 1075 | .halt_reg = DBG_BUS_VEC_F_REG, |
| 1076 | .halt_bit = 13, |
| 1077 | }, |
| 1078 | .c = { |
| 1079 | .dbg_name = "rot_p_clk", |
| 1080 | .ops = &clk_ops_branch, |
| 1081 | CLK_INIT(rot_p_clk.c), |
| 1082 | }, |
| 1083 | }; |
| 1084 | |
| 1085 | static struct branch_clk smmu_p_clk = { |
| 1086 | .b = { |
| 1087 | .ctl_reg = AHB_EN_REG, |
| 1088 | .en_mask = BIT(15), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 1089 | .hwcg_reg = AHB_EN_REG, |
| 1090 | .hwcg_mask = BIT(26), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1091 | .halt_reg = DBG_BUS_VEC_F_REG, |
| 1092 | .halt_bit = 22, |
| 1093 | }, |
| 1094 | .c = { |
| 1095 | .dbg_name = "smmu_p_clk", |
| 1096 | .ops = &clk_ops_branch, |
| 1097 | CLK_INIT(smmu_p_clk.c), |
| 1098 | }, |
| 1099 | }; |
| 1100 | |
| 1101 | static struct branch_clk tv_enc_p_clk = { |
| 1102 | .b = { |
| 1103 | .ctl_reg = AHB_EN_REG, |
| 1104 | .en_mask = BIT(25), |
| 1105 | .reset_reg = SW_RESET_AHB_REG, |
| 1106 | .reset_mask = BIT(15), |
| 1107 | .halt_reg = DBG_BUS_VEC_F_REG, |
| 1108 | .halt_bit = 23, |
| 1109 | }, |
| 1110 | .c = { |
| 1111 | .dbg_name = "tv_enc_p_clk", |
| 1112 | .ops = &clk_ops_branch, |
| 1113 | CLK_INIT(tv_enc_p_clk.c), |
| 1114 | }, |
| 1115 | }; |
| 1116 | |
| 1117 | static struct branch_clk vcodec_p_clk = { |
| 1118 | .b = { |
| 1119 | .ctl_reg = AHB_EN_REG, |
| 1120 | .en_mask = BIT(11), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 1121 | .hwcg_reg = AHB_EN2_REG, |
| 1122 | .hwcg_mask = BIT(26), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1123 | .reset_reg = SW_RESET_AHB_REG, |
| 1124 | .reset_mask = BIT(1), |
| 1125 | .halt_reg = DBG_BUS_VEC_F_REG, |
| 1126 | .halt_bit = 12, |
| 1127 | }, |
| 1128 | .c = { |
| 1129 | .dbg_name = "vcodec_p_clk", |
| 1130 | .ops = &clk_ops_branch, |
| 1131 | CLK_INIT(vcodec_p_clk.c), |
| 1132 | }, |
| 1133 | }; |
| 1134 | |
| 1135 | static struct branch_clk vfe_p_clk = { |
| 1136 | .b = { |
| 1137 | .ctl_reg = AHB_EN_REG, |
| 1138 | .en_mask = BIT(13), |
| 1139 | .reset_reg = SW_RESET_AHB_REG, |
| 1140 | .reset_mask = BIT(0), |
| 1141 | .halt_reg = DBG_BUS_VEC_F_REG, |
| 1142 | .halt_bit = 14, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 1143 | .retain_reg = AHB_EN2_REG, |
| 1144 | .retain_mask = BIT(0), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1145 | }, |
| 1146 | .c = { |
| 1147 | .dbg_name = "vfe_p_clk", |
| 1148 | .ops = &clk_ops_branch, |
| 1149 | CLK_INIT(vfe_p_clk.c), |
| 1150 | }, |
| 1151 | }; |
| 1152 | |
| 1153 | static struct branch_clk vpe_p_clk = { |
| 1154 | .b = { |
| 1155 | .ctl_reg = AHB_EN_REG, |
| 1156 | .en_mask = BIT(16), |
| 1157 | .reset_reg = SW_RESET_AHB_REG, |
| 1158 | .reset_mask = BIT(14), |
| 1159 | .halt_reg = DBG_BUS_VEC_F_REG, |
| 1160 | .halt_bit = 15, |
| 1161 | }, |
| 1162 | .c = { |
| 1163 | .dbg_name = "vpe_p_clk", |
| 1164 | .ops = &clk_ops_branch, |
| 1165 | CLK_INIT(vpe_p_clk.c), |
| 1166 | }, |
| 1167 | }; |
| 1168 | |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 1169 | static struct branch_clk vcap_p_clk = { |
| 1170 | .b = { |
| 1171 | .ctl_reg = AHB_EN3_REG, |
| 1172 | .en_mask = BIT(1), |
| 1173 | .reset_reg = SW_RESET_AHB2_REG, |
| 1174 | .reset_mask = BIT(2), |
| 1175 | .halt_reg = DBG_BUS_VEC_J_REG, |
| 1176 | .halt_bit = 23, |
| 1177 | }, |
| 1178 | .c = { |
| 1179 | .dbg_name = "vcap_p_clk", |
| 1180 | .ops = &clk_ops_branch, |
| 1181 | CLK_INIT(vcap_p_clk.c), |
| 1182 | }, |
| 1183 | }; |
| 1184 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1185 | /* |
| 1186 | * Peripheral Clocks |
| 1187 | */ |
Matt Wagantall | 7625a4c | 2011-11-01 16:17:53 -0700 | [diff] [blame] | 1188 | #define CLK_GP(i, n, h_r, h_b) \ |
| 1189 | struct rcg_clk i##_clk = { \ |
| 1190 | .b = { \ |
| 1191 | .ctl_reg = GPn_NS_REG(n), \ |
| 1192 | .en_mask = BIT(9), \ |
| 1193 | .halt_reg = h_r, \ |
| 1194 | .halt_bit = h_b, \ |
| 1195 | }, \ |
| 1196 | .ns_reg = GPn_NS_REG(n), \ |
| 1197 | .md_reg = GPn_MD_REG(n), \ |
| 1198 | .root_en_mask = BIT(11), \ |
| 1199 | .ns_mask = (BM(23, 16) | BM(6, 0)), \ |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame] | 1200 | .mnd_en_mask = BIT(8), \ |
Matt Wagantall | 7625a4c | 2011-11-01 16:17:53 -0700 | [diff] [blame] | 1201 | .set_rate = set_rate_mnd, \ |
| 1202 | .freq_tbl = clk_tbl_gp, \ |
| 1203 | .current_freq = &rcg_dummy_freq, \ |
| 1204 | .c = { \ |
| 1205 | .dbg_name = #i "_clk", \ |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 1206 | .ops = &clk_ops_rcg, \ |
Matt Wagantall | 7625a4c | 2011-11-01 16:17:53 -0700 | [diff] [blame] | 1207 | VDD_DIG_FMAX_MAP2(LOW, 100000000, NOMINAL, 200000000), \ |
| 1208 | CLK_INIT(i##_clk.c), \ |
| 1209 | }, \ |
| 1210 | } |
| 1211 | #define F_GP(f, s, d, m, n) \ |
| 1212 | { \ |
| 1213 | .freq_hz = f, \ |
| 1214 | .src_clk = &s##_clk.c, \ |
| 1215 | .md_val = MD8(16, m, 0, n), \ |
| 1216 | .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] | 1217 | } |
| 1218 | static struct clk_freq_tbl clk_tbl_gp[] = { |
| 1219 | F_GP( 0, gnd, 1, 0, 0), |
| 1220 | F_GP( 9600000, cxo, 2, 0, 0), |
| 1221 | F_GP( 13500000, pxo, 2, 0, 0), |
| 1222 | F_GP( 19200000, cxo, 1, 0, 0), |
| 1223 | F_GP( 27000000, pxo, 1, 0, 0), |
| 1224 | F_GP( 64000000, pll8, 2, 1, 3), |
| 1225 | F_GP( 76800000, pll8, 1, 1, 5), |
| 1226 | F_GP( 96000000, pll8, 4, 0, 0), |
| 1227 | F_GP(128000000, pll8, 3, 0, 0), |
| 1228 | F_GP(192000000, pll8, 2, 0, 0), |
Matt Wagantall | 7625a4c | 2011-11-01 16:17:53 -0700 | [diff] [blame] | 1229 | F_END |
| 1230 | }; |
| 1231 | |
| 1232 | static CLK_GP(gp0, 0, CLK_HALT_SFPB_MISC_STATE_REG, 7); |
| 1233 | static CLK_GP(gp1, 1, CLK_HALT_SFPB_MISC_STATE_REG, 6); |
| 1234 | static CLK_GP(gp2, 2, CLK_HALT_SFPB_MISC_STATE_REG, 5); |
| 1235 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1236 | #define CLK_GSBI_UART(i, n, h_r, h_b) \ |
| 1237 | struct rcg_clk i##_clk = { \ |
| 1238 | .b = { \ |
| 1239 | .ctl_reg = GSBIn_UART_APPS_NS_REG(n), \ |
| 1240 | .en_mask = BIT(9), \ |
| 1241 | .reset_reg = GSBIn_RESET_REG(n), \ |
| 1242 | .reset_mask = BIT(0), \ |
| 1243 | .halt_reg = h_r, \ |
| 1244 | .halt_bit = h_b, \ |
| 1245 | }, \ |
| 1246 | .ns_reg = GSBIn_UART_APPS_NS_REG(n), \ |
| 1247 | .md_reg = GSBIn_UART_APPS_MD_REG(n), \ |
| 1248 | .root_en_mask = BIT(11), \ |
| 1249 | .ns_mask = (BM(31, 16) | BM(6, 0)), \ |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame] | 1250 | .mnd_en_mask = BIT(8), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1251 | .set_rate = set_rate_mnd, \ |
| 1252 | .freq_tbl = clk_tbl_gsbi_uart, \ |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1253 | .current_freq = &rcg_dummy_freq, \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1254 | .c = { \ |
| 1255 | .dbg_name = #i "_clk", \ |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 1256 | .ops = &clk_ops_rcg, \ |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1257 | VDD_DIG_FMAX_MAP2(LOW, 32000000, NOMINAL, 64000000), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1258 | CLK_INIT(i##_clk.c), \ |
| 1259 | }, \ |
| 1260 | } |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1261 | #define F_GSBI_UART(f, s, d, m, n) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1262 | { \ |
| 1263 | .freq_hz = f, \ |
| 1264 | .src_clk = &s##_clk.c, \ |
| 1265 | .md_val = MD16(m, n), \ |
| 1266 | .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] | 1267 | } |
| 1268 | static struct clk_freq_tbl clk_tbl_gsbi_uart[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1269 | F_GSBI_UART( 0, gnd, 1, 0, 0), |
Matt Wagantall | 9a561f7 | 2012-01-19 16:13:12 -0800 | [diff] [blame] | 1270 | F_GSBI_UART( 1843200, pll8, 2, 6, 625), |
| 1271 | F_GSBI_UART( 3686400, pll8, 2, 12, 625), |
| 1272 | F_GSBI_UART( 7372800, pll8, 2, 24, 625), |
| 1273 | F_GSBI_UART(14745600, pll8, 2, 48, 625), |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1274 | F_GSBI_UART(16000000, pll8, 4, 1, 6), |
| 1275 | F_GSBI_UART(24000000, pll8, 4, 1, 4), |
| 1276 | F_GSBI_UART(32000000, pll8, 4, 1, 3), |
| 1277 | F_GSBI_UART(40000000, pll8, 1, 5, 48), |
| 1278 | F_GSBI_UART(46400000, pll8, 1, 29, 240), |
| 1279 | F_GSBI_UART(48000000, pll8, 4, 1, 2), |
| 1280 | F_GSBI_UART(51200000, pll8, 1, 2, 15), |
| 1281 | F_GSBI_UART(56000000, pll8, 1, 7, 48), |
| 1282 | F_GSBI_UART(58982400, pll8, 1, 96, 625), |
| 1283 | F_GSBI_UART(64000000, pll8, 2, 1, 3), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1284 | F_END |
| 1285 | }; |
| 1286 | |
| 1287 | static CLK_GSBI_UART(gsbi1_uart, 1, CLK_HALT_CFPB_STATEA_REG, 10); |
| 1288 | static CLK_GSBI_UART(gsbi2_uart, 2, CLK_HALT_CFPB_STATEA_REG, 6); |
| 1289 | static CLK_GSBI_UART(gsbi3_uart, 3, CLK_HALT_CFPB_STATEA_REG, 2); |
| 1290 | static CLK_GSBI_UART(gsbi4_uart, 4, CLK_HALT_CFPB_STATEB_REG, 26); |
| 1291 | static CLK_GSBI_UART(gsbi5_uart, 5, CLK_HALT_CFPB_STATEB_REG, 22); |
| 1292 | static CLK_GSBI_UART(gsbi6_uart, 6, CLK_HALT_CFPB_STATEB_REG, 18); |
| 1293 | static CLK_GSBI_UART(gsbi7_uart, 7, CLK_HALT_CFPB_STATEB_REG, 14); |
| 1294 | static CLK_GSBI_UART(gsbi8_uart, 8, CLK_HALT_CFPB_STATEB_REG, 10); |
| 1295 | static CLK_GSBI_UART(gsbi9_uart, 9, CLK_HALT_CFPB_STATEB_REG, 6); |
| 1296 | static CLK_GSBI_UART(gsbi10_uart, 10, CLK_HALT_CFPB_STATEB_REG, 2); |
| 1297 | static CLK_GSBI_UART(gsbi11_uart, 11, CLK_HALT_CFPB_STATEC_REG, 17); |
| 1298 | static CLK_GSBI_UART(gsbi12_uart, 12, CLK_HALT_CFPB_STATEC_REG, 13); |
| 1299 | |
| 1300 | #define CLK_GSBI_QUP(i, n, h_r, h_b) \ |
| 1301 | struct rcg_clk i##_clk = { \ |
| 1302 | .b = { \ |
| 1303 | .ctl_reg = GSBIn_QUP_APPS_NS_REG(n), \ |
| 1304 | .en_mask = BIT(9), \ |
| 1305 | .reset_reg = GSBIn_RESET_REG(n), \ |
| 1306 | .reset_mask = BIT(0), \ |
| 1307 | .halt_reg = h_r, \ |
| 1308 | .halt_bit = h_b, \ |
| 1309 | }, \ |
| 1310 | .ns_reg = GSBIn_QUP_APPS_NS_REG(n), \ |
| 1311 | .md_reg = GSBIn_QUP_APPS_MD_REG(n), \ |
| 1312 | .root_en_mask = BIT(11), \ |
| 1313 | .ns_mask = (BM(23, 16) | BM(6, 0)), \ |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame] | 1314 | .mnd_en_mask = BIT(8), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1315 | .set_rate = set_rate_mnd, \ |
| 1316 | .freq_tbl = clk_tbl_gsbi_qup, \ |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1317 | .current_freq = &rcg_dummy_freq, \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1318 | .c = { \ |
| 1319 | .dbg_name = #i "_clk", \ |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 1320 | .ops = &clk_ops_rcg, \ |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1321 | VDD_DIG_FMAX_MAP2(LOW, 24000000, NOMINAL, 52000000), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1322 | CLK_INIT(i##_clk.c), \ |
| 1323 | }, \ |
| 1324 | } |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1325 | #define F_GSBI_QUP(f, s, d, m, n) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1326 | { \ |
| 1327 | .freq_hz = f, \ |
| 1328 | .src_clk = &s##_clk.c, \ |
| 1329 | .md_val = MD8(16, m, 0, n), \ |
| 1330 | .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] | 1331 | } |
| 1332 | static struct clk_freq_tbl clk_tbl_gsbi_qup[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1333 | F_GSBI_QUP( 0, gnd, 1, 0, 0), |
| 1334 | F_GSBI_QUP( 1100000, pxo, 1, 2, 49), |
| 1335 | F_GSBI_QUP( 5400000, pxo, 1, 1, 5), |
| 1336 | F_GSBI_QUP(10800000, pxo, 1, 2, 5), |
| 1337 | F_GSBI_QUP(15060000, pll8, 1, 2, 51), |
| 1338 | F_GSBI_QUP(24000000, pll8, 4, 1, 4), |
| 1339 | F_GSBI_QUP(25600000, pll8, 1, 1, 15), |
| 1340 | F_GSBI_QUP(27000000, pxo, 1, 0, 0), |
| 1341 | F_GSBI_QUP(48000000, pll8, 4, 1, 2), |
| 1342 | F_GSBI_QUP(51200000, pll8, 1, 2, 15), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1343 | F_END |
| 1344 | }; |
| 1345 | |
| 1346 | static CLK_GSBI_QUP(gsbi1_qup, 1, CLK_HALT_CFPB_STATEA_REG, 9); |
| 1347 | static CLK_GSBI_QUP(gsbi2_qup, 2, CLK_HALT_CFPB_STATEA_REG, 4); |
| 1348 | static CLK_GSBI_QUP(gsbi3_qup, 3, CLK_HALT_CFPB_STATEA_REG, 0); |
| 1349 | static CLK_GSBI_QUP(gsbi4_qup, 4, CLK_HALT_CFPB_STATEB_REG, 24); |
| 1350 | static CLK_GSBI_QUP(gsbi5_qup, 5, CLK_HALT_CFPB_STATEB_REG, 20); |
| 1351 | static CLK_GSBI_QUP(gsbi6_qup, 6, CLK_HALT_CFPB_STATEB_REG, 16); |
| 1352 | static CLK_GSBI_QUP(gsbi7_qup, 7, CLK_HALT_CFPB_STATEB_REG, 12); |
| 1353 | static CLK_GSBI_QUP(gsbi8_qup, 8, CLK_HALT_CFPB_STATEB_REG, 8); |
| 1354 | static CLK_GSBI_QUP(gsbi9_qup, 9, CLK_HALT_CFPB_STATEB_REG, 4); |
| 1355 | static CLK_GSBI_QUP(gsbi10_qup, 10, CLK_HALT_CFPB_STATEB_REG, 0); |
| 1356 | static CLK_GSBI_QUP(gsbi11_qup, 11, CLK_HALT_CFPB_STATEC_REG, 15); |
| 1357 | static CLK_GSBI_QUP(gsbi12_qup, 12, CLK_HALT_CFPB_STATEC_REG, 11); |
| 1358 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1359 | #define F_PDM(f, s, d) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1360 | { \ |
| 1361 | .freq_hz = f, \ |
| 1362 | .src_clk = &s##_clk.c, \ |
| 1363 | .ns_val = NS_SRC_SEL(1, 0, s##_to_xo_mux), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1364 | } |
| 1365 | static struct clk_freq_tbl clk_tbl_pdm[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1366 | F_PDM( 0, gnd, 1), |
| 1367 | F_PDM(27000000, pxo, 1), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1368 | F_END |
| 1369 | }; |
| 1370 | |
| 1371 | static struct rcg_clk pdm_clk = { |
| 1372 | .b = { |
| 1373 | .ctl_reg = PDM_CLK_NS_REG, |
| 1374 | .en_mask = BIT(9), |
| 1375 | .reset_reg = PDM_CLK_NS_REG, |
| 1376 | .reset_mask = BIT(12), |
| 1377 | .halt_reg = CLK_HALT_CFPB_STATEC_REG, |
| 1378 | .halt_bit = 3, |
| 1379 | }, |
| 1380 | .ns_reg = PDM_CLK_NS_REG, |
| 1381 | .root_en_mask = BIT(11), |
| 1382 | .ns_mask = BM(1, 0), |
| 1383 | .set_rate = set_rate_nop, |
| 1384 | .freq_tbl = clk_tbl_pdm, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1385 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1386 | .c = { |
| 1387 | .dbg_name = "pdm_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 1388 | .ops = &clk_ops_rcg, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1389 | VDD_DIG_FMAX_MAP1(LOW, 27000000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1390 | CLK_INIT(pdm_clk.c), |
| 1391 | }, |
| 1392 | }; |
| 1393 | |
| 1394 | static struct branch_clk pmem_clk = { |
| 1395 | .b = { |
| 1396 | .ctl_reg = PMEM_ACLK_CTL_REG, |
| 1397 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 1398 | .hwcg_reg = PMEM_ACLK_CTL_REG, |
| 1399 | .hwcg_mask = BIT(6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1400 | .halt_reg = CLK_HALT_DFAB_STATE_REG, |
| 1401 | .halt_bit = 20, |
| 1402 | }, |
| 1403 | .c = { |
| 1404 | .dbg_name = "pmem_clk", |
| 1405 | .ops = &clk_ops_branch, |
| 1406 | CLK_INIT(pmem_clk.c), |
| 1407 | }, |
| 1408 | }; |
| 1409 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1410 | #define F_PRNG(f, s) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1411 | { \ |
| 1412 | .freq_hz = f, \ |
| 1413 | .src_clk = &s##_clk.c, \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1414 | } |
Stephen Boyd | 842a1f6 | 2012-04-26 19:07:38 -0700 | [diff] [blame] | 1415 | static struct clk_freq_tbl clk_tbl_prng_32[] = { |
| 1416 | F_PRNG(32000000, pll8), |
| 1417 | F_END |
| 1418 | }; |
| 1419 | |
| 1420 | static struct clk_freq_tbl clk_tbl_prng_64[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1421 | F_PRNG(64000000, pll8), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1422 | F_END |
| 1423 | }; |
| 1424 | |
| 1425 | static struct rcg_clk prng_clk = { |
| 1426 | .b = { |
| 1427 | .ctl_reg = SC0_U_CLK_BRANCH_ENA_VOTE_REG, |
| 1428 | .en_mask = BIT(10), |
| 1429 | .halt_reg = CLK_HALT_SFPB_MISC_STATE_REG, |
| 1430 | .halt_check = HALT_VOTED, |
| 1431 | .halt_bit = 10, |
| 1432 | }, |
| 1433 | .set_rate = set_rate_nop, |
Stephen Boyd | 842a1f6 | 2012-04-26 19:07:38 -0700 | [diff] [blame] | 1434 | .freq_tbl = clk_tbl_prng_32, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1435 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1436 | .c = { |
| 1437 | .dbg_name = "prng_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 1438 | .ops = &clk_ops_rcg, |
Stephen Boyd | 842a1f6 | 2012-04-26 19:07:38 -0700 | [diff] [blame] | 1439 | VDD_DIG_FMAX_MAP2(LOW, 32000000, NOMINAL, 64000000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1440 | CLK_INIT(prng_clk.c), |
| 1441 | }, |
| 1442 | }; |
| 1443 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1444 | #define CLK_SDC(name, n, h_b, fmax_low, fmax_nom) \ |
Stephen Boyd | a78a740 | 2011-08-02 11:23:39 -0700 | [diff] [blame] | 1445 | struct rcg_clk name = { \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1446 | .b = { \ |
| 1447 | .ctl_reg = SDCn_APPS_CLK_NS_REG(n), \ |
| 1448 | .en_mask = BIT(9), \ |
| 1449 | .reset_reg = SDCn_RESET_REG(n), \ |
| 1450 | .reset_mask = BIT(0), \ |
Stephen Boyd | a78a740 | 2011-08-02 11:23:39 -0700 | [diff] [blame] | 1451 | .halt_reg = CLK_HALT_DFAB_STATE_REG, \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1452 | .halt_bit = h_b, \ |
| 1453 | }, \ |
| 1454 | .ns_reg = SDCn_APPS_CLK_NS_REG(n), \ |
| 1455 | .md_reg = SDCn_APPS_CLK_MD_REG(n), \ |
| 1456 | .root_en_mask = BIT(11), \ |
| 1457 | .ns_mask = (BM(23, 16) | BM(6, 0)), \ |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame] | 1458 | .mnd_en_mask = BIT(8), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1459 | .set_rate = set_rate_mnd, \ |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1460 | .freq_tbl = clk_tbl_sdc, \ |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1461 | .current_freq = &rcg_dummy_freq, \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1462 | .c = { \ |
Stephen Boyd | a78a740 | 2011-08-02 11:23:39 -0700 | [diff] [blame] | 1463 | .dbg_name = #name, \ |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 1464 | .ops = &clk_ops_rcg, \ |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1465 | VDD_DIG_FMAX_MAP2(LOW, fmax_low, NOMINAL, fmax_nom), \ |
Stephen Boyd | a78a740 | 2011-08-02 11:23:39 -0700 | [diff] [blame] | 1466 | CLK_INIT(name.c), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1467 | }, \ |
| 1468 | } |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1469 | #define F_SDC(f, s, d, m, n) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1470 | { \ |
| 1471 | .freq_hz = f, \ |
| 1472 | .src_clk = &s##_clk.c, \ |
| 1473 | .md_val = MD8(16, m, 0, n), \ |
| 1474 | .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] | 1475 | } |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1476 | static struct clk_freq_tbl clk_tbl_sdc[] = { |
| 1477 | F_SDC( 0, gnd, 1, 0, 0), |
| 1478 | F_SDC( 144000, pxo, 3, 2, 125), |
| 1479 | F_SDC( 400000, pll8, 4, 1, 240), |
| 1480 | F_SDC( 16000000, pll8, 4, 1, 6), |
| 1481 | F_SDC( 17070000, pll8, 1, 2, 45), |
| 1482 | F_SDC( 20210000, pll8, 1, 1, 19), |
| 1483 | F_SDC( 24000000, pll8, 4, 1, 4), |
| 1484 | F_SDC( 48000000, pll8, 4, 1, 2), |
| 1485 | F_SDC( 64000000, pll8, 3, 1, 2), |
| 1486 | F_SDC( 96000000, pll8, 4, 0, 0), |
Subhash Jadavani | bd238ba | 2011-11-24 15:12:39 +0530 | [diff] [blame] | 1487 | F_SDC(192000000, pll8, 2, 0, 0), |
Stephen Boyd | a78a740 | 2011-08-02 11:23:39 -0700 | [diff] [blame] | 1488 | F_END |
| 1489 | }; |
| 1490 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1491 | static CLK_SDC(sdc1_clk, 1, 6, 52000000, 104000000); |
| 1492 | static CLK_SDC(sdc2_clk, 2, 5, 52000000, 104000000); |
| 1493 | static CLK_SDC(sdc3_clk, 3, 4, 104000000, 208000000); |
| 1494 | static CLK_SDC(sdc4_clk, 4, 3, 33000000, 67000000); |
| 1495 | static CLK_SDC(sdc5_clk, 5, 2, 33000000, 67000000); |
Stephen Boyd | a78a740 | 2011-08-02 11:23:39 -0700 | [diff] [blame] | 1496 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1497 | #define F_TSIF_REF(f, s, d, m, n) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1498 | { \ |
| 1499 | .freq_hz = f, \ |
| 1500 | .src_clk = &s##_clk.c, \ |
| 1501 | .md_val = MD16(m, n), \ |
| 1502 | .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] | 1503 | } |
| 1504 | static struct clk_freq_tbl clk_tbl_tsif_ref[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1505 | F_TSIF_REF( 0, gnd, 1, 0, 0), |
| 1506 | F_TSIF_REF(105000, pxo, 1, 1, 256), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1507 | F_END |
| 1508 | }; |
| 1509 | |
| 1510 | static struct rcg_clk tsif_ref_clk = { |
| 1511 | .b = { |
| 1512 | .ctl_reg = TSIF_REF_CLK_NS_REG, |
| 1513 | .en_mask = BIT(9), |
| 1514 | .halt_reg = CLK_HALT_CFPB_STATEC_REG, |
| 1515 | .halt_bit = 5, |
| 1516 | }, |
| 1517 | .ns_reg = TSIF_REF_CLK_NS_REG, |
| 1518 | .md_reg = TSIF_REF_CLK_MD_REG, |
| 1519 | .root_en_mask = BIT(11), |
| 1520 | .ns_mask = (BM(31, 16) | BM(6, 0)), |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame] | 1521 | .mnd_en_mask = BIT(8), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1522 | .set_rate = set_rate_mnd, |
| 1523 | .freq_tbl = clk_tbl_tsif_ref, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1524 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1525 | .c = { |
| 1526 | .dbg_name = "tsif_ref_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 1527 | .ops = &clk_ops_rcg, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1528 | VDD_DIG_FMAX_MAP2(LOW, 27000000, NOMINAL, 54000000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1529 | CLK_INIT(tsif_ref_clk.c), |
| 1530 | }, |
| 1531 | }; |
| 1532 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1533 | #define F_TSSC(f, s) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1534 | { \ |
| 1535 | .freq_hz = f, \ |
| 1536 | .src_clk = &s##_clk.c, \ |
| 1537 | .ns_val = NS_SRC_SEL(1, 0, s##_to_xo_mux), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1538 | } |
| 1539 | static struct clk_freq_tbl clk_tbl_tssc[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1540 | F_TSSC( 0, gnd), |
| 1541 | F_TSSC(27000000, pxo), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1542 | F_END |
| 1543 | }; |
| 1544 | |
| 1545 | static struct rcg_clk tssc_clk = { |
| 1546 | .b = { |
| 1547 | .ctl_reg = TSSC_CLK_CTL_REG, |
| 1548 | .en_mask = BIT(4), |
| 1549 | .halt_reg = CLK_HALT_CFPB_STATEC_REG, |
| 1550 | .halt_bit = 4, |
| 1551 | }, |
| 1552 | .ns_reg = TSSC_CLK_CTL_REG, |
| 1553 | .ns_mask = BM(1, 0), |
| 1554 | .set_rate = set_rate_nop, |
| 1555 | .freq_tbl = clk_tbl_tssc, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1556 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1557 | .c = { |
| 1558 | .dbg_name = "tssc_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 1559 | .ops = &clk_ops_rcg, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1560 | VDD_DIG_FMAX_MAP1(LOW, 27000000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1561 | CLK_INIT(tssc_clk.c), |
| 1562 | }, |
| 1563 | }; |
| 1564 | |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 1565 | #define CLK_USB_HS(name, n, h_b) \ |
| 1566 | static struct rcg_clk name = { \ |
| 1567 | .b = { \ |
| 1568 | .ctl_reg = USB_HS##n##_XCVR_FS_CLK_NS_REG, \ |
| 1569 | .en_mask = BIT(9), \ |
| 1570 | .reset_reg = USB_HS##n##_RESET_REG, \ |
| 1571 | .reset_mask = BIT(0), \ |
| 1572 | .halt_reg = CLK_HALT_DFAB_STATE_REG, \ |
| 1573 | .halt_bit = h_b, \ |
| 1574 | }, \ |
| 1575 | .ns_reg = USB_HS##n##_XCVR_FS_CLK_NS_REG, \ |
| 1576 | .md_reg = USB_HS##n##_XCVR_FS_CLK_MD_REG, \ |
| 1577 | .root_en_mask = BIT(11), \ |
| 1578 | .ns_mask = (BM(23, 16) | BM(6, 0)), \ |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame] | 1579 | .mnd_en_mask = BIT(8), \ |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 1580 | .set_rate = set_rate_mnd, \ |
| 1581 | .freq_tbl = clk_tbl_usb, \ |
| 1582 | .current_freq = &rcg_dummy_freq, \ |
| 1583 | .c = { \ |
| 1584 | .dbg_name = #name, \ |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 1585 | .ops = &clk_ops_rcg, \ |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1586 | VDD_DIG_FMAX_MAP1(NOMINAL, 64000000), \ |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 1587 | CLK_INIT(name.c), \ |
| 1588 | }, \ |
| 1589 | } |
| 1590 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1591 | #define F_USB(f, s, d, m, n) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1592 | { \ |
| 1593 | .freq_hz = f, \ |
| 1594 | .src_clk = &s##_clk.c, \ |
| 1595 | .md_val = MD8(16, m, 0, n), \ |
| 1596 | .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] | 1597 | } |
| 1598 | static struct clk_freq_tbl clk_tbl_usb[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1599 | F_USB( 0, gnd, 1, 0, 0), |
| 1600 | F_USB(60000000, pll8, 1, 5, 32), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1601 | F_END |
| 1602 | }; |
| 1603 | |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 1604 | CLK_USB_HS(usb_hs1_xcvr_clk, 1, 0); |
| 1605 | CLK_USB_HS(usb_hs3_xcvr_clk, 3, 30); |
| 1606 | CLK_USB_HS(usb_hs4_xcvr_clk, 4, 2); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1607 | |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 1608 | static struct clk_freq_tbl clk_tbl_usb_hsic[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1609 | F_USB( 0, gnd, 1, 0, 0), |
| 1610 | F_USB(60000000, pll8, 1, 5, 32), |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 1611 | F_END |
| 1612 | }; |
| 1613 | |
| 1614 | static struct rcg_clk usb_hsic_xcvr_fs_clk = { |
| 1615 | .b = { |
| 1616 | .ctl_reg = USB_HSIC_XCVR_FS_CLK_NS_REG, |
| 1617 | .en_mask = BIT(9), |
| 1618 | .halt_reg = CLK_HALT_CFPB_STATEA_REG, |
| 1619 | .halt_bit = 26, |
| 1620 | }, |
| 1621 | .ns_reg = USB_HSIC_XCVR_FS_CLK_NS_REG, |
| 1622 | .md_reg = USB_HSIC_XCVR_FS_CLK_MD_REG, |
| 1623 | .root_en_mask = BIT(11), |
| 1624 | .ns_mask = (BM(23, 16) | BM(6, 0)), |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame] | 1625 | .mnd_en_mask = BIT(8), |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 1626 | .set_rate = set_rate_mnd, |
| 1627 | .freq_tbl = clk_tbl_usb_hsic, |
| 1628 | .current_freq = &rcg_dummy_freq, |
| 1629 | .c = { |
| 1630 | .dbg_name = "usb_hsic_xcvr_fs_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 1631 | .ops = &clk_ops_rcg, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1632 | VDD_DIG_FMAX_MAP1(LOW, 60000000), |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 1633 | CLK_INIT(usb_hsic_xcvr_fs_clk.c), |
| 1634 | }, |
| 1635 | }; |
| 1636 | |
| 1637 | static struct branch_clk usb_hsic_system_clk = { |
| 1638 | .b = { |
| 1639 | .ctl_reg = USB_HSIC_SYSTEM_CLK_CTL_REG, |
| 1640 | .en_mask = BIT(4), |
| 1641 | .reset_reg = USB_HSIC_RESET_REG, |
| 1642 | .reset_mask = BIT(0), |
| 1643 | .halt_reg = CLK_HALT_CFPB_STATEA_REG, |
| 1644 | .halt_bit = 24, |
| 1645 | }, |
| 1646 | .parent = &usb_hsic_xcvr_fs_clk.c, |
| 1647 | .c = { |
| 1648 | .dbg_name = "usb_hsic_system_clk", |
| 1649 | .ops = &clk_ops_branch, |
| 1650 | CLK_INIT(usb_hsic_system_clk.c), |
| 1651 | }, |
| 1652 | }; |
| 1653 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1654 | #define F_USB_HSIC(f, s) \ |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 1655 | { \ |
| 1656 | .freq_hz = f, \ |
| 1657 | .src_clk = &s##_clk.c, \ |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 1658 | } |
| 1659 | static struct clk_freq_tbl clk_tbl_usb2_hsic[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1660 | F_USB_HSIC(480000000, pll14), |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 1661 | F_END |
| 1662 | }; |
| 1663 | |
| 1664 | static struct rcg_clk usb_hsic_hsic_src_clk = { |
| 1665 | .b = { |
| 1666 | .ctl_reg = USB_HSIC_HSIC_CLK_SRC_CTL_REG, |
| 1667 | .halt_check = NOCHECK, |
| 1668 | }, |
| 1669 | .root_en_mask = BIT(0), |
| 1670 | .set_rate = set_rate_nop, |
| 1671 | .freq_tbl = clk_tbl_usb2_hsic, |
| 1672 | .current_freq = &rcg_dummy_freq, |
| 1673 | .c = { |
| 1674 | .dbg_name = "usb_hsic_hsic_src_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 1675 | .ops = &clk_ops_rcg, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1676 | VDD_DIG_FMAX_MAP1(LOW, 480000000), |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 1677 | CLK_INIT(usb_hsic_hsic_src_clk.c), |
| 1678 | }, |
| 1679 | }; |
| 1680 | |
| 1681 | static struct branch_clk usb_hsic_hsic_clk = { |
| 1682 | .b = { |
| 1683 | .ctl_reg = USB_HSIC_HSIC_CLK_CTL_REG, |
| 1684 | .en_mask = BIT(0), |
| 1685 | .halt_reg = CLK_HALT_CFPB_STATEA_REG, |
| 1686 | .halt_bit = 19, |
| 1687 | }, |
| 1688 | .parent = &usb_hsic_hsic_src_clk.c, |
| 1689 | .c = { |
| 1690 | .dbg_name = "usb_hsic_hsic_clk", |
| 1691 | .ops = &clk_ops_branch, |
| 1692 | CLK_INIT(usb_hsic_hsic_clk.c), |
| 1693 | }, |
| 1694 | }; |
| 1695 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1696 | #define F_USB_HSIO_CAL(f, s) \ |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 1697 | { \ |
| 1698 | .freq_hz = f, \ |
| 1699 | .src_clk = &s##_clk.c, \ |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 1700 | } |
| 1701 | static struct clk_freq_tbl clk_tbl_usb_hsio_cal[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1702 | F_USB_HSIO_CAL(9000000, pxo), |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 1703 | F_END |
| 1704 | }; |
| 1705 | |
| 1706 | static struct rcg_clk usb_hsic_hsio_cal_clk = { |
| 1707 | .b = { |
| 1708 | .ctl_reg = USB_HSIC_HSIO_CAL_CLK_CTL_REG, |
| 1709 | .en_mask = BIT(0), |
| 1710 | .halt_reg = CLK_HALT_CFPB_STATEA_REG, |
| 1711 | .halt_bit = 23, |
| 1712 | }, |
| 1713 | .set_rate = set_rate_nop, |
| 1714 | .freq_tbl = clk_tbl_usb_hsio_cal, |
| 1715 | .current_freq = &rcg_dummy_freq, |
| 1716 | .c = { |
| 1717 | .dbg_name = "usb_hsic_hsio_cal_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 1718 | .ops = &clk_ops_rcg, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1719 | VDD_DIG_FMAX_MAP1(LOW, 10000000), |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 1720 | CLK_INIT(usb_hsic_hsio_cal_clk.c), |
| 1721 | }, |
| 1722 | }; |
| 1723 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1724 | static struct branch_clk usb_phy0_clk = { |
| 1725 | .b = { |
| 1726 | .reset_reg = USB_PHY0_RESET_REG, |
| 1727 | .reset_mask = BIT(0), |
| 1728 | }, |
| 1729 | .c = { |
| 1730 | .dbg_name = "usb_phy0_clk", |
| 1731 | .ops = &clk_ops_reset, |
| 1732 | CLK_INIT(usb_phy0_clk.c), |
| 1733 | }, |
| 1734 | }; |
| 1735 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1736 | #define CLK_USB_FS(i, n, fmax_nom) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1737 | struct rcg_clk i##_clk = { \ |
| 1738 | .ns_reg = USB_FSn_XCVR_FS_CLK_NS_REG(n), \ |
| 1739 | .b = { \ |
| 1740 | .ctl_reg = USB_FSn_XCVR_FS_CLK_NS_REG(n), \ |
| 1741 | .halt_check = NOCHECK, \ |
| 1742 | }, \ |
| 1743 | .md_reg = USB_FSn_XCVR_FS_CLK_MD_REG(n), \ |
| 1744 | .root_en_mask = BIT(11), \ |
| 1745 | .ns_mask = (BM(23, 16) | BM(6, 0)), \ |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame] | 1746 | .mnd_en_mask = BIT(8), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1747 | .set_rate = set_rate_mnd, \ |
| 1748 | .freq_tbl = clk_tbl_usb, \ |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1749 | .current_freq = &rcg_dummy_freq, \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1750 | .c = { \ |
| 1751 | .dbg_name = #i "_clk", \ |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 1752 | .ops = &clk_ops_rcg, \ |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1753 | VDD_DIG_FMAX_MAP1(NOMINAL, fmax_nom), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1754 | CLK_INIT(i##_clk.c), \ |
| 1755 | }, \ |
| 1756 | } |
| 1757 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1758 | static CLK_USB_FS(usb_fs1_src, 1, 64000000); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1759 | static struct branch_clk usb_fs1_xcvr_clk = { |
| 1760 | .b = { |
| 1761 | .ctl_reg = USB_FSn_XCVR_FS_CLK_NS_REG(1), |
| 1762 | .en_mask = BIT(9), |
| 1763 | .reset_reg = USB_FSn_RESET_REG(1), |
| 1764 | .reset_mask = BIT(1), |
| 1765 | .halt_reg = CLK_HALT_CFPB_STATEA_REG, |
| 1766 | .halt_bit = 15, |
| 1767 | }, |
| 1768 | .parent = &usb_fs1_src_clk.c, |
| 1769 | .c = { |
| 1770 | .dbg_name = "usb_fs1_xcvr_clk", |
| 1771 | .ops = &clk_ops_branch, |
| 1772 | CLK_INIT(usb_fs1_xcvr_clk.c), |
| 1773 | }, |
| 1774 | }; |
| 1775 | |
| 1776 | static struct branch_clk usb_fs1_sys_clk = { |
| 1777 | .b = { |
| 1778 | .ctl_reg = USB_FSn_SYSTEM_CLK_CTL_REG(1), |
| 1779 | .en_mask = BIT(4), |
| 1780 | .reset_reg = USB_FSn_RESET_REG(1), |
| 1781 | .reset_mask = BIT(0), |
| 1782 | .halt_reg = CLK_HALT_CFPB_STATEA_REG, |
| 1783 | .halt_bit = 16, |
| 1784 | }, |
| 1785 | .parent = &usb_fs1_src_clk.c, |
| 1786 | .c = { |
| 1787 | .dbg_name = "usb_fs1_sys_clk", |
| 1788 | .ops = &clk_ops_branch, |
| 1789 | CLK_INIT(usb_fs1_sys_clk.c), |
| 1790 | }, |
| 1791 | }; |
| 1792 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1793 | static CLK_USB_FS(usb_fs2_src, 2, 60000000); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1794 | static struct branch_clk usb_fs2_xcvr_clk = { |
| 1795 | .b = { |
| 1796 | .ctl_reg = USB_FSn_XCVR_FS_CLK_NS_REG(2), |
| 1797 | .en_mask = BIT(9), |
| 1798 | .reset_reg = USB_FSn_RESET_REG(2), |
| 1799 | .reset_mask = BIT(1), |
| 1800 | .halt_reg = CLK_HALT_CFPB_STATEA_REG, |
| 1801 | .halt_bit = 12, |
| 1802 | }, |
| 1803 | .parent = &usb_fs2_src_clk.c, |
| 1804 | .c = { |
| 1805 | .dbg_name = "usb_fs2_xcvr_clk", |
| 1806 | .ops = &clk_ops_branch, |
| 1807 | CLK_INIT(usb_fs2_xcvr_clk.c), |
| 1808 | }, |
| 1809 | }; |
| 1810 | |
| 1811 | static struct branch_clk usb_fs2_sys_clk = { |
| 1812 | .b = { |
| 1813 | .ctl_reg = USB_FSn_SYSTEM_CLK_CTL_REG(2), |
| 1814 | .en_mask = BIT(4), |
| 1815 | .reset_reg = USB_FSn_RESET_REG(2), |
| 1816 | .reset_mask = BIT(0), |
| 1817 | .halt_reg = CLK_HALT_CFPB_STATEA_REG, |
| 1818 | .halt_bit = 13, |
| 1819 | }, |
| 1820 | .parent = &usb_fs2_src_clk.c, |
| 1821 | .c = { |
| 1822 | .dbg_name = "usb_fs2_sys_clk", |
| 1823 | .ops = &clk_ops_branch, |
| 1824 | CLK_INIT(usb_fs2_sys_clk.c), |
| 1825 | }, |
| 1826 | }; |
| 1827 | |
| 1828 | /* Fast Peripheral Bus Clocks */ |
| 1829 | static struct branch_clk ce1_core_clk = { |
| 1830 | .b = { |
| 1831 | .ctl_reg = CE1_CORE_CLK_CTL_REG, |
| 1832 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 1833 | .hwcg_reg = CE1_CORE_CLK_CTL_REG, |
| 1834 | .hwcg_mask = BIT(6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1835 | .halt_reg = CLK_HALT_CFPB_STATEC_REG, |
| 1836 | .halt_bit = 27, |
| 1837 | }, |
| 1838 | .c = { |
| 1839 | .dbg_name = "ce1_core_clk", |
| 1840 | .ops = &clk_ops_branch, |
| 1841 | CLK_INIT(ce1_core_clk.c), |
| 1842 | }, |
| 1843 | }; |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 1844 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1845 | static struct branch_clk ce1_p_clk = { |
| 1846 | .b = { |
| 1847 | .ctl_reg = CE1_HCLK_CTL_REG, |
| 1848 | .en_mask = BIT(4), |
| 1849 | .halt_reg = CLK_HALT_CFPB_STATEC_REG, |
| 1850 | .halt_bit = 1, |
| 1851 | }, |
| 1852 | .c = { |
| 1853 | .dbg_name = "ce1_p_clk", |
| 1854 | .ops = &clk_ops_branch, |
| 1855 | CLK_INIT(ce1_p_clk.c), |
| 1856 | }, |
| 1857 | }; |
| 1858 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1859 | #define F_CE3(f, s, d) \ |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 1860 | { \ |
| 1861 | .freq_hz = f, \ |
| 1862 | .src_clk = &s##_clk.c, \ |
| 1863 | .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] | 1864 | } |
| 1865 | |
| 1866 | static struct clk_freq_tbl clk_tbl_ce3[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1867 | F_CE3( 0, gnd, 1), |
| 1868 | F_CE3( 48000000, pll8, 8), |
| 1869 | F_CE3(100000000, pll3, 12), |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 1870 | F_END |
| 1871 | }; |
| 1872 | |
| 1873 | static struct rcg_clk ce3_src_clk = { |
| 1874 | .b = { |
| 1875 | .ctl_reg = CE3_CLK_SRC_NS_REG, |
| 1876 | .halt_check = NOCHECK, |
| 1877 | }, |
| 1878 | .ns_reg = CE3_CLK_SRC_NS_REG, |
| 1879 | .root_en_mask = BIT(7), |
| 1880 | .ns_mask = BM(6, 0), |
| 1881 | .set_rate = set_rate_nop, |
| 1882 | .freq_tbl = clk_tbl_ce3, |
| 1883 | .current_freq = &rcg_dummy_freq, |
| 1884 | .c = { |
| 1885 | .dbg_name = "ce3_src_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 1886 | .ops = &clk_ops_rcg, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1887 | VDD_DIG_FMAX_MAP2(LOW, 50000000, NOMINAL, 100000000), |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 1888 | CLK_INIT(ce3_src_clk.c), |
| 1889 | }, |
| 1890 | }; |
| 1891 | |
| 1892 | static struct branch_clk ce3_core_clk = { |
| 1893 | .b = { |
| 1894 | .ctl_reg = CE3_CORE_CLK_CTL_REG, |
| 1895 | .en_mask = BIT(4), |
| 1896 | .reset_reg = CE3_CORE_CLK_CTL_REG, |
| 1897 | .reset_mask = BIT(7), |
| 1898 | .halt_reg = CLK_HALT_MSS_SMPSS_MISC_STATE_REG, |
| 1899 | .halt_bit = 5, |
| 1900 | }, |
| 1901 | .parent = &ce3_src_clk.c, |
| 1902 | .c = { |
| 1903 | .dbg_name = "ce3_core_clk", |
| 1904 | .ops = &clk_ops_branch, |
| 1905 | CLK_INIT(ce3_core_clk.c), |
| 1906 | } |
| 1907 | }; |
| 1908 | |
| 1909 | static struct branch_clk ce3_p_clk = { |
| 1910 | .b = { |
| 1911 | .ctl_reg = CE3_HCLK_CTL_REG, |
| 1912 | .en_mask = BIT(4), |
| 1913 | .reset_reg = CE3_HCLK_CTL_REG, |
| 1914 | .reset_mask = BIT(7), |
| 1915 | .halt_reg = CLK_HALT_AFAB_SFAB_STATEB_REG, |
| 1916 | .halt_bit = 16, |
| 1917 | }, |
| 1918 | .parent = &ce3_src_clk.c, |
| 1919 | .c = { |
| 1920 | .dbg_name = "ce3_p_clk", |
| 1921 | .ops = &clk_ops_branch, |
| 1922 | CLK_INIT(ce3_p_clk.c), |
| 1923 | } |
| 1924 | }; |
| 1925 | |
| 1926 | static struct branch_clk sata_phy_ref_clk = { |
| 1927 | .b = { |
| 1928 | .ctl_reg = SATA_PHY_REF_CLK_CTL_REG, |
| 1929 | .en_mask = BIT(4), |
| 1930 | .halt_reg = CLK_HALT_MSS_SMPSS_MISC_STATE_REG, |
| 1931 | .halt_bit = 24, |
| 1932 | }, |
| 1933 | .parent = &pxo_clk.c, |
| 1934 | .c = { |
| 1935 | .dbg_name = "sata_phy_ref_clk", |
| 1936 | .ops = &clk_ops_branch, |
| 1937 | CLK_INIT(sata_phy_ref_clk.c), |
| 1938 | }, |
| 1939 | }; |
| 1940 | |
| 1941 | static struct branch_clk pcie_p_clk = { |
| 1942 | .b = { |
| 1943 | .ctl_reg = PCIE_HCLK_CTL_REG, |
| 1944 | .en_mask = BIT(4), |
| 1945 | .halt_reg = CLK_HALT_CFPB_STATEC_REG, |
| 1946 | .halt_bit = 8, |
| 1947 | }, |
| 1948 | .c = { |
| 1949 | .dbg_name = "pcie_p_clk", |
| 1950 | .ops = &clk_ops_branch, |
| 1951 | CLK_INIT(pcie_p_clk.c), |
| 1952 | }, |
| 1953 | }; |
| 1954 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1955 | static struct branch_clk dma_bam_p_clk = { |
| 1956 | .b = { |
| 1957 | .ctl_reg = DMA_BAM_HCLK_CTL, |
| 1958 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 1959 | .hwcg_reg = DMA_BAM_HCLK_CTL, |
| 1960 | .hwcg_mask = BIT(6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1961 | .halt_reg = CLK_HALT_DFAB_STATE_REG, |
| 1962 | .halt_bit = 12, |
| 1963 | }, |
| 1964 | .c = { |
| 1965 | .dbg_name = "dma_bam_p_clk", |
| 1966 | .ops = &clk_ops_branch, |
| 1967 | CLK_INIT(dma_bam_p_clk.c), |
| 1968 | }, |
| 1969 | }; |
| 1970 | |
| 1971 | static struct branch_clk gsbi1_p_clk = { |
| 1972 | .b = { |
| 1973 | .ctl_reg = GSBIn_HCLK_CTL_REG(1), |
| 1974 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 1975 | .hwcg_reg = GSBIn_HCLK_CTL_REG(1), |
| 1976 | .hwcg_mask = BIT(6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1977 | .halt_reg = CLK_HALT_CFPB_STATEA_REG, |
| 1978 | .halt_bit = 11, |
| 1979 | }, |
| 1980 | .c = { |
| 1981 | .dbg_name = "gsbi1_p_clk", |
| 1982 | .ops = &clk_ops_branch, |
| 1983 | CLK_INIT(gsbi1_p_clk.c), |
| 1984 | }, |
| 1985 | }; |
| 1986 | |
| 1987 | static struct branch_clk gsbi2_p_clk = { |
| 1988 | .b = { |
| 1989 | .ctl_reg = GSBIn_HCLK_CTL_REG(2), |
| 1990 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 1991 | .hwcg_reg = GSBIn_HCLK_CTL_REG(2), |
| 1992 | .hwcg_mask = BIT(6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1993 | .halt_reg = CLK_HALT_CFPB_STATEA_REG, |
| 1994 | .halt_bit = 7, |
| 1995 | }, |
| 1996 | .c = { |
| 1997 | .dbg_name = "gsbi2_p_clk", |
| 1998 | .ops = &clk_ops_branch, |
| 1999 | CLK_INIT(gsbi2_p_clk.c), |
| 2000 | }, |
| 2001 | }; |
| 2002 | |
| 2003 | static struct branch_clk gsbi3_p_clk = { |
| 2004 | .b = { |
| 2005 | .ctl_reg = GSBIn_HCLK_CTL_REG(3), |
| 2006 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 2007 | .hwcg_reg = GSBIn_HCLK_CTL_REG(3), |
| 2008 | .hwcg_mask = BIT(6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2009 | .halt_reg = CLK_HALT_CFPB_STATEA_REG, |
| 2010 | .halt_bit = 3, |
| 2011 | }, |
| 2012 | .c = { |
| 2013 | .dbg_name = "gsbi3_p_clk", |
| 2014 | .ops = &clk_ops_branch, |
| 2015 | CLK_INIT(gsbi3_p_clk.c), |
| 2016 | }, |
| 2017 | }; |
| 2018 | |
| 2019 | static struct branch_clk gsbi4_p_clk = { |
| 2020 | .b = { |
| 2021 | .ctl_reg = GSBIn_HCLK_CTL_REG(4), |
| 2022 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 2023 | .hwcg_reg = GSBIn_HCLK_CTL_REG(4), |
| 2024 | .hwcg_mask = BIT(6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2025 | .halt_reg = CLK_HALT_CFPB_STATEB_REG, |
| 2026 | .halt_bit = 27, |
| 2027 | }, |
| 2028 | .c = { |
| 2029 | .dbg_name = "gsbi4_p_clk", |
| 2030 | .ops = &clk_ops_branch, |
| 2031 | CLK_INIT(gsbi4_p_clk.c), |
| 2032 | }, |
| 2033 | }; |
| 2034 | |
| 2035 | static struct branch_clk gsbi5_p_clk = { |
| 2036 | .b = { |
| 2037 | .ctl_reg = GSBIn_HCLK_CTL_REG(5), |
| 2038 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 2039 | .hwcg_reg = GSBIn_HCLK_CTL_REG(5), |
| 2040 | .hwcg_mask = BIT(6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2041 | .halt_reg = CLK_HALT_CFPB_STATEB_REG, |
| 2042 | .halt_bit = 23, |
| 2043 | }, |
| 2044 | .c = { |
| 2045 | .dbg_name = "gsbi5_p_clk", |
| 2046 | .ops = &clk_ops_branch, |
| 2047 | CLK_INIT(gsbi5_p_clk.c), |
| 2048 | }, |
| 2049 | }; |
| 2050 | |
| 2051 | static struct branch_clk gsbi6_p_clk = { |
| 2052 | .b = { |
| 2053 | .ctl_reg = GSBIn_HCLK_CTL_REG(6), |
| 2054 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 2055 | .hwcg_reg = GSBIn_HCLK_CTL_REG(6), |
| 2056 | .hwcg_mask = BIT(6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2057 | .halt_reg = CLK_HALT_CFPB_STATEB_REG, |
| 2058 | .halt_bit = 19, |
| 2059 | }, |
| 2060 | .c = { |
| 2061 | .dbg_name = "gsbi6_p_clk", |
| 2062 | .ops = &clk_ops_branch, |
| 2063 | CLK_INIT(gsbi6_p_clk.c), |
| 2064 | }, |
| 2065 | }; |
| 2066 | |
| 2067 | static struct branch_clk gsbi7_p_clk = { |
| 2068 | .b = { |
| 2069 | .ctl_reg = GSBIn_HCLK_CTL_REG(7), |
| 2070 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 2071 | .hwcg_reg = GSBIn_HCLK_CTL_REG(7), |
| 2072 | .hwcg_mask = BIT(6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2073 | .halt_reg = CLK_HALT_CFPB_STATEB_REG, |
| 2074 | .halt_bit = 15, |
| 2075 | }, |
| 2076 | .c = { |
| 2077 | .dbg_name = "gsbi7_p_clk", |
| 2078 | .ops = &clk_ops_branch, |
| 2079 | CLK_INIT(gsbi7_p_clk.c), |
| 2080 | }, |
| 2081 | }; |
| 2082 | |
| 2083 | static struct branch_clk gsbi8_p_clk = { |
| 2084 | .b = { |
| 2085 | .ctl_reg = GSBIn_HCLK_CTL_REG(8), |
| 2086 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 2087 | .hwcg_reg = GSBIn_HCLK_CTL_REG(8), |
| 2088 | .hwcg_mask = BIT(6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2089 | .halt_reg = CLK_HALT_CFPB_STATEB_REG, |
| 2090 | .halt_bit = 11, |
| 2091 | }, |
| 2092 | .c = { |
| 2093 | .dbg_name = "gsbi8_p_clk", |
| 2094 | .ops = &clk_ops_branch, |
| 2095 | CLK_INIT(gsbi8_p_clk.c), |
| 2096 | }, |
| 2097 | }; |
| 2098 | |
| 2099 | static struct branch_clk gsbi9_p_clk = { |
| 2100 | .b = { |
| 2101 | .ctl_reg = GSBIn_HCLK_CTL_REG(9), |
| 2102 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 2103 | .hwcg_reg = GSBIn_HCLK_CTL_REG(9), |
| 2104 | .hwcg_mask = BIT(6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2105 | .halt_reg = CLK_HALT_CFPB_STATEB_REG, |
| 2106 | .halt_bit = 7, |
| 2107 | }, |
| 2108 | .c = { |
| 2109 | .dbg_name = "gsbi9_p_clk", |
| 2110 | .ops = &clk_ops_branch, |
| 2111 | CLK_INIT(gsbi9_p_clk.c), |
| 2112 | }, |
| 2113 | }; |
| 2114 | |
| 2115 | static struct branch_clk gsbi10_p_clk = { |
| 2116 | .b = { |
| 2117 | .ctl_reg = GSBIn_HCLK_CTL_REG(10), |
| 2118 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 2119 | .hwcg_reg = GSBIn_HCLK_CTL_REG(10), |
| 2120 | .hwcg_mask = BIT(6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2121 | .halt_reg = CLK_HALT_CFPB_STATEB_REG, |
| 2122 | .halt_bit = 3, |
| 2123 | }, |
| 2124 | .c = { |
| 2125 | .dbg_name = "gsbi10_p_clk", |
| 2126 | .ops = &clk_ops_branch, |
| 2127 | CLK_INIT(gsbi10_p_clk.c), |
| 2128 | }, |
| 2129 | }; |
| 2130 | |
| 2131 | static struct branch_clk gsbi11_p_clk = { |
| 2132 | .b = { |
| 2133 | .ctl_reg = GSBIn_HCLK_CTL_REG(11), |
| 2134 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 2135 | .hwcg_reg = GSBIn_HCLK_CTL_REG(11), |
| 2136 | .hwcg_mask = BIT(6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2137 | .halt_reg = CLK_HALT_CFPB_STATEC_REG, |
| 2138 | .halt_bit = 18, |
| 2139 | }, |
| 2140 | .c = { |
| 2141 | .dbg_name = "gsbi11_p_clk", |
| 2142 | .ops = &clk_ops_branch, |
| 2143 | CLK_INIT(gsbi11_p_clk.c), |
| 2144 | }, |
| 2145 | }; |
| 2146 | |
| 2147 | static struct branch_clk gsbi12_p_clk = { |
| 2148 | .b = { |
| 2149 | .ctl_reg = GSBIn_HCLK_CTL_REG(12), |
| 2150 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 2151 | .hwcg_reg = GSBIn_HCLK_CTL_REG(12), |
| 2152 | .hwcg_mask = BIT(6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2153 | .halt_reg = CLK_HALT_CFPB_STATEC_REG, |
| 2154 | .halt_bit = 14, |
| 2155 | }, |
| 2156 | .c = { |
| 2157 | .dbg_name = "gsbi12_p_clk", |
| 2158 | .ops = &clk_ops_branch, |
| 2159 | CLK_INIT(gsbi12_p_clk.c), |
| 2160 | }, |
| 2161 | }; |
| 2162 | |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 2163 | static struct branch_clk sata_phy_cfg_clk = { |
| 2164 | .b = { |
| 2165 | .ctl_reg = SATA_PHY_CFG_CLK_CTL_REG, |
| 2166 | .en_mask = BIT(4), |
| 2167 | .halt_reg = CLK_HALT_CFPB_STATEA_REG, |
| 2168 | .halt_bit = 12, |
| 2169 | }, |
| 2170 | .c = { |
| 2171 | .dbg_name = "sata_phy_cfg_clk", |
| 2172 | .ops = &clk_ops_branch, |
| 2173 | CLK_INIT(sata_phy_cfg_clk.c), |
Stephen Boyd | 973e4ba | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 2174 | }, |
| 2175 | }; |
| 2176 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2177 | static struct branch_clk tsif_p_clk = { |
| 2178 | .b = { |
| 2179 | .ctl_reg = TSIF_HCLK_CTL_REG, |
| 2180 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 2181 | .hwcg_reg = TSIF_HCLK_CTL_REG, |
| 2182 | .hwcg_mask = BIT(6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2183 | .halt_reg = CLK_HALT_CFPB_STATEC_REG, |
| 2184 | .halt_bit = 7, |
| 2185 | }, |
| 2186 | .c = { |
| 2187 | .dbg_name = "tsif_p_clk", |
| 2188 | .ops = &clk_ops_branch, |
| 2189 | CLK_INIT(tsif_p_clk.c), |
| 2190 | }, |
| 2191 | }; |
| 2192 | |
| 2193 | static struct branch_clk usb_fs1_p_clk = { |
| 2194 | .b = { |
| 2195 | .ctl_reg = USB_FSn_HCLK_CTL_REG(1), |
| 2196 | .en_mask = BIT(4), |
| 2197 | .halt_reg = CLK_HALT_CFPB_STATEA_REG, |
| 2198 | .halt_bit = 17, |
| 2199 | }, |
| 2200 | .c = { |
| 2201 | .dbg_name = "usb_fs1_p_clk", |
| 2202 | .ops = &clk_ops_branch, |
| 2203 | CLK_INIT(usb_fs1_p_clk.c), |
| 2204 | }, |
| 2205 | }; |
| 2206 | |
| 2207 | static struct branch_clk usb_fs2_p_clk = { |
| 2208 | .b = { |
| 2209 | .ctl_reg = USB_FSn_HCLK_CTL_REG(2), |
| 2210 | .en_mask = BIT(4), |
| 2211 | .halt_reg = CLK_HALT_CFPB_STATEA_REG, |
| 2212 | .halt_bit = 14, |
| 2213 | }, |
| 2214 | .c = { |
| 2215 | .dbg_name = "usb_fs2_p_clk", |
| 2216 | .ops = &clk_ops_branch, |
| 2217 | CLK_INIT(usb_fs2_p_clk.c), |
| 2218 | }, |
| 2219 | }; |
| 2220 | |
| 2221 | static struct branch_clk usb_hs1_p_clk = { |
| 2222 | .b = { |
| 2223 | .ctl_reg = USB_HS1_HCLK_CTL_REG, |
| 2224 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 2225 | .hwcg_reg = USB_HS1_HCLK_CTL_REG, |
| 2226 | .hwcg_mask = BIT(6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2227 | .halt_reg = CLK_HALT_DFAB_STATE_REG, |
| 2228 | .halt_bit = 1, |
| 2229 | }, |
| 2230 | .c = { |
| 2231 | .dbg_name = "usb_hs1_p_clk", |
| 2232 | .ops = &clk_ops_branch, |
| 2233 | CLK_INIT(usb_hs1_p_clk.c), |
| 2234 | }, |
| 2235 | }; |
| 2236 | |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 2237 | static struct branch_clk usb_hs3_p_clk = { |
| 2238 | .b = { |
| 2239 | .ctl_reg = USB_HS3_HCLK_CTL_REG, |
| 2240 | .en_mask = BIT(4), |
| 2241 | .halt_reg = CLK_HALT_DFAB_STATE_REG, |
| 2242 | .halt_bit = 31, |
| 2243 | }, |
| 2244 | .c = { |
| 2245 | .dbg_name = "usb_hs3_p_clk", |
| 2246 | .ops = &clk_ops_branch, |
| 2247 | CLK_INIT(usb_hs3_p_clk.c), |
| 2248 | }, |
| 2249 | }; |
| 2250 | |
| 2251 | static struct branch_clk usb_hs4_p_clk = { |
| 2252 | .b = { |
| 2253 | .ctl_reg = USB_HS4_HCLK_CTL_REG, |
| 2254 | .en_mask = BIT(4), |
| 2255 | .halt_reg = CLK_HALT_DFAB_STATE_REG, |
| 2256 | .halt_bit = 7, |
| 2257 | }, |
| 2258 | .c = { |
| 2259 | .dbg_name = "usb_hs4_p_clk", |
| 2260 | .ops = &clk_ops_branch, |
| 2261 | CLK_INIT(usb_hs4_p_clk.c), |
| 2262 | }, |
| 2263 | }; |
| 2264 | |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 2265 | static struct branch_clk usb_hsic_p_clk = { |
| 2266 | .b = { |
| 2267 | .ctl_reg = USB_HSIC_HCLK_CTL_REG, |
| 2268 | .en_mask = BIT(4), |
| 2269 | .halt_reg = CLK_HALT_CFPB_STATEA_REG, |
| 2270 | .halt_bit = 28, |
| 2271 | }, |
| 2272 | .c = { |
| 2273 | .dbg_name = "usb_hsic_p_clk", |
| 2274 | .ops = &clk_ops_branch, |
| 2275 | CLK_INIT(usb_hsic_p_clk.c), |
| 2276 | }, |
| 2277 | }; |
| 2278 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2279 | static struct branch_clk sdc1_p_clk = { |
| 2280 | .b = { |
| 2281 | .ctl_reg = SDCn_HCLK_CTL_REG(1), |
| 2282 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 2283 | .hwcg_reg = SDCn_HCLK_CTL_REG(1), |
| 2284 | .hwcg_mask = BIT(6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2285 | .halt_reg = CLK_HALT_DFAB_STATE_REG, |
| 2286 | .halt_bit = 11, |
| 2287 | }, |
| 2288 | .c = { |
| 2289 | .dbg_name = "sdc1_p_clk", |
| 2290 | .ops = &clk_ops_branch, |
| 2291 | CLK_INIT(sdc1_p_clk.c), |
| 2292 | }, |
| 2293 | }; |
| 2294 | |
| 2295 | static struct branch_clk sdc2_p_clk = { |
| 2296 | .b = { |
| 2297 | .ctl_reg = SDCn_HCLK_CTL_REG(2), |
| 2298 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 2299 | .hwcg_reg = SDCn_HCLK_CTL_REG(2), |
| 2300 | .hwcg_mask = BIT(6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2301 | .halt_reg = CLK_HALT_DFAB_STATE_REG, |
| 2302 | .halt_bit = 10, |
| 2303 | }, |
| 2304 | .c = { |
| 2305 | .dbg_name = "sdc2_p_clk", |
| 2306 | .ops = &clk_ops_branch, |
| 2307 | CLK_INIT(sdc2_p_clk.c), |
| 2308 | }, |
| 2309 | }; |
| 2310 | |
| 2311 | static struct branch_clk sdc3_p_clk = { |
| 2312 | .b = { |
| 2313 | .ctl_reg = SDCn_HCLK_CTL_REG(3), |
| 2314 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 2315 | .hwcg_reg = SDCn_HCLK_CTL_REG(3), |
| 2316 | .hwcg_mask = BIT(6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2317 | .halt_reg = CLK_HALT_DFAB_STATE_REG, |
| 2318 | .halt_bit = 9, |
| 2319 | }, |
| 2320 | .c = { |
| 2321 | .dbg_name = "sdc3_p_clk", |
| 2322 | .ops = &clk_ops_branch, |
| 2323 | CLK_INIT(sdc3_p_clk.c), |
| 2324 | }, |
| 2325 | }; |
| 2326 | |
| 2327 | static struct branch_clk sdc4_p_clk = { |
| 2328 | .b = { |
| 2329 | .ctl_reg = SDCn_HCLK_CTL_REG(4), |
| 2330 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 2331 | .hwcg_reg = SDCn_HCLK_CTL_REG(4), |
| 2332 | .hwcg_mask = BIT(6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2333 | .halt_reg = CLK_HALT_DFAB_STATE_REG, |
| 2334 | .halt_bit = 8, |
| 2335 | }, |
| 2336 | .c = { |
| 2337 | .dbg_name = "sdc4_p_clk", |
| 2338 | .ops = &clk_ops_branch, |
| 2339 | CLK_INIT(sdc4_p_clk.c), |
| 2340 | }, |
| 2341 | }; |
| 2342 | |
| 2343 | static struct branch_clk sdc5_p_clk = { |
| 2344 | .b = { |
| 2345 | .ctl_reg = SDCn_HCLK_CTL_REG(5), |
| 2346 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 2347 | .hwcg_reg = SDCn_HCLK_CTL_REG(5), |
| 2348 | .hwcg_mask = BIT(6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2349 | .halt_reg = CLK_HALT_DFAB_STATE_REG, |
| 2350 | .halt_bit = 7, |
| 2351 | }, |
| 2352 | .c = { |
| 2353 | .dbg_name = "sdc5_p_clk", |
| 2354 | .ops = &clk_ops_branch, |
| 2355 | CLK_INIT(sdc5_p_clk.c), |
| 2356 | }, |
| 2357 | }; |
| 2358 | |
| 2359 | /* HW-Voteable Clocks */ |
| 2360 | static struct branch_clk adm0_clk = { |
| 2361 | .b = { |
| 2362 | .ctl_reg = SC0_U_CLK_BRANCH_ENA_VOTE_REG, |
| 2363 | .en_mask = BIT(2), |
| 2364 | .halt_reg = CLK_HALT_MSS_SMPSS_MISC_STATE_REG, |
| 2365 | .halt_check = HALT_VOTED, |
| 2366 | .halt_bit = 14, |
| 2367 | }, |
| 2368 | .c = { |
| 2369 | .dbg_name = "adm0_clk", |
| 2370 | .ops = &clk_ops_branch, |
| 2371 | CLK_INIT(adm0_clk.c), |
| 2372 | }, |
| 2373 | }; |
| 2374 | |
| 2375 | static struct branch_clk adm0_p_clk = { |
| 2376 | .b = { |
| 2377 | .ctl_reg = SC0_U_CLK_BRANCH_ENA_VOTE_REG, |
| 2378 | .en_mask = BIT(3), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 2379 | .hwcg_reg = ADM0_PBUS_CLK_CTL_REG, |
| 2380 | .hwcg_mask = BIT(6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2381 | .halt_reg = CLK_HALT_MSS_SMPSS_MISC_STATE_REG, |
| 2382 | .halt_check = HALT_VOTED, |
| 2383 | .halt_bit = 13, |
| 2384 | }, |
| 2385 | .c = { |
| 2386 | .dbg_name = "adm0_p_clk", |
| 2387 | .ops = &clk_ops_branch, |
| 2388 | CLK_INIT(adm0_p_clk.c), |
| 2389 | }, |
| 2390 | }; |
| 2391 | |
| 2392 | static struct branch_clk pmic_arb0_p_clk = { |
| 2393 | .b = { |
| 2394 | .ctl_reg = SC0_U_CLK_BRANCH_ENA_VOTE_REG, |
| 2395 | .en_mask = BIT(8), |
| 2396 | .halt_reg = CLK_HALT_SFPB_MISC_STATE_REG, |
| 2397 | .halt_check = HALT_VOTED, |
| 2398 | .halt_bit = 22, |
| 2399 | }, |
| 2400 | .c = { |
| 2401 | .dbg_name = "pmic_arb0_p_clk", |
| 2402 | .ops = &clk_ops_branch, |
| 2403 | CLK_INIT(pmic_arb0_p_clk.c), |
| 2404 | }, |
| 2405 | }; |
| 2406 | |
| 2407 | static struct branch_clk pmic_arb1_p_clk = { |
| 2408 | .b = { |
| 2409 | .ctl_reg = SC0_U_CLK_BRANCH_ENA_VOTE_REG, |
| 2410 | .en_mask = BIT(9), |
| 2411 | .halt_reg = CLK_HALT_SFPB_MISC_STATE_REG, |
| 2412 | .halt_check = HALT_VOTED, |
| 2413 | .halt_bit = 21, |
| 2414 | }, |
| 2415 | .c = { |
| 2416 | .dbg_name = "pmic_arb1_p_clk", |
| 2417 | .ops = &clk_ops_branch, |
| 2418 | CLK_INIT(pmic_arb1_p_clk.c), |
| 2419 | }, |
| 2420 | }; |
| 2421 | |
| 2422 | static struct branch_clk pmic_ssbi2_clk = { |
| 2423 | .b = { |
| 2424 | .ctl_reg = SC0_U_CLK_BRANCH_ENA_VOTE_REG, |
| 2425 | .en_mask = BIT(7), |
| 2426 | .halt_reg = CLK_HALT_SFPB_MISC_STATE_REG, |
| 2427 | .halt_check = HALT_VOTED, |
| 2428 | .halt_bit = 23, |
| 2429 | }, |
| 2430 | .c = { |
| 2431 | .dbg_name = "pmic_ssbi2_clk", |
| 2432 | .ops = &clk_ops_branch, |
| 2433 | CLK_INIT(pmic_ssbi2_clk.c), |
| 2434 | }, |
| 2435 | }; |
| 2436 | |
| 2437 | static struct branch_clk rpm_msg_ram_p_clk = { |
| 2438 | .b = { |
| 2439 | .ctl_reg = SC0_U_CLK_BRANCH_ENA_VOTE_REG, |
| 2440 | .en_mask = BIT(6), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 2441 | .hwcg_reg = RPM_MSG_RAM_HCLK_CTL_REG, |
| 2442 | .hwcg_mask = BIT(6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2443 | .halt_reg = CLK_HALT_SFPB_MISC_STATE_REG, |
| 2444 | .halt_check = HALT_VOTED, |
| 2445 | .halt_bit = 12, |
| 2446 | }, |
| 2447 | .c = { |
| 2448 | .dbg_name = "rpm_msg_ram_p_clk", |
| 2449 | .ops = &clk_ops_branch, |
| 2450 | CLK_INIT(rpm_msg_ram_p_clk.c), |
| 2451 | }, |
| 2452 | }; |
| 2453 | |
| 2454 | /* |
| 2455 | * Multimedia Clocks |
| 2456 | */ |
| 2457 | |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 2458 | #define CLK_CAM(name, n, hb) \ |
| 2459 | struct rcg_clk name = { \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2460 | .b = { \ |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 2461 | .ctl_reg = CAMCLK##n##_CC_REG, \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2462 | .en_mask = BIT(0), \ |
| 2463 | .halt_reg = DBG_BUS_VEC_I_REG, \ |
| 2464 | .halt_bit = hb, \ |
| 2465 | }, \ |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 2466 | .ns_reg = CAMCLK##n##_NS_REG, \ |
| 2467 | .md_reg = CAMCLK##n##_MD_REG, \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2468 | .root_en_mask = BIT(2), \ |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 2469 | .ns_mask = BM(31, 24) | BM(15, 14) | BM(2, 0), \ |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame] | 2470 | .mnd_en_mask = BIT(5), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2471 | .ctl_mask = BM(7, 6), \ |
| 2472 | .set_rate = set_rate_mnd_8, \ |
| 2473 | .freq_tbl = clk_tbl_cam, \ |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 2474 | .current_freq = &rcg_dummy_freq, \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2475 | .c = { \ |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 2476 | .dbg_name = #name, \ |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 2477 | .ops = &clk_ops_rcg, \ |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 2478 | VDD_DIG_FMAX_MAP2(LOW, 64000000, NOMINAL, 128000000), \ |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 2479 | CLK_INIT(name.c), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2480 | }, \ |
| 2481 | } |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 2482 | #define F_CAM(f, s, d, m, n) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2483 | { \ |
| 2484 | .freq_hz = f, \ |
| 2485 | .src_clk = &s##_clk.c, \ |
| 2486 | .md_val = MD8(8, m, 0, n), \ |
| 2487 | .ns_val = NS_MM(31, 24, n, m, 15, 14, d, 2, 0, s##_to_mm_mux), \ |
| 2488 | .ctl_val = CC(6, n), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2489 | } |
| 2490 | static struct clk_freq_tbl clk_tbl_cam[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 2491 | F_CAM( 0, gnd, 1, 0, 0), |
| 2492 | F_CAM( 6000000, pll8, 4, 1, 16), |
| 2493 | F_CAM( 8000000, pll8, 4, 1, 12), |
| 2494 | F_CAM( 12000000, pll8, 4, 1, 8), |
| 2495 | F_CAM( 16000000, pll8, 4, 1, 6), |
| 2496 | F_CAM( 19200000, pll8, 4, 1, 5), |
| 2497 | F_CAM( 24000000, pll8, 4, 1, 4), |
| 2498 | F_CAM( 32000000, pll8, 4, 1, 3), |
| 2499 | F_CAM( 48000000, pll8, 4, 1, 2), |
| 2500 | F_CAM( 64000000, pll8, 3, 1, 2), |
| 2501 | F_CAM( 96000000, pll8, 4, 0, 0), |
| 2502 | F_CAM(128000000, pll8, 3, 0, 0), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2503 | F_END |
| 2504 | }; |
| 2505 | |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 2506 | static CLK_CAM(cam0_clk, 0, 15); |
| 2507 | static CLK_CAM(cam1_clk, 1, 16); |
| 2508 | static CLK_CAM(cam2_clk, 2, 31); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2509 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 2510 | #define F_CSI(f, s, d, m, n) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2511 | { \ |
| 2512 | .freq_hz = f, \ |
| 2513 | .src_clk = &s##_clk.c, \ |
| 2514 | .md_val = MD8(8, m, 0, n), \ |
| 2515 | .ns_val = NS_MM(31, 24, n, m, 15, 14, d, 2, 0, s##_to_mm_mux), \ |
| 2516 | .ctl_val = CC(6, n), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2517 | } |
| 2518 | static struct clk_freq_tbl clk_tbl_csi[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 2519 | F_CSI( 0, gnd, 1, 0, 0), |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 2520 | F_CSI( 27000000, pxo, 1, 0, 0), |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 2521 | F_CSI( 85330000, pll8, 1, 2, 9), |
| 2522 | F_CSI(177780000, pll2, 1, 2, 9), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2523 | F_END |
| 2524 | }; |
| 2525 | |
| 2526 | static struct rcg_clk csi0_src_clk = { |
| 2527 | .ns_reg = CSI0_NS_REG, |
| 2528 | .b = { |
| 2529 | .ctl_reg = CSI0_CC_REG, |
| 2530 | .halt_check = NOCHECK, |
| 2531 | }, |
| 2532 | .md_reg = CSI0_MD_REG, |
| 2533 | .root_en_mask = BIT(2), |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 2534 | .ns_mask = BM(31, 24) | BM(15, 14) | BM(2, 0), |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame] | 2535 | .mnd_en_mask = BIT(5), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2536 | .ctl_mask = BM(7, 6), |
| 2537 | .set_rate = set_rate_mnd, |
| 2538 | .freq_tbl = clk_tbl_csi, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 2539 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2540 | .c = { |
| 2541 | .dbg_name = "csi0_src_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 2542 | .ops = &clk_ops_rcg, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 2543 | VDD_DIG_FMAX_MAP2(LOW, 86000000, NOMINAL, 178000000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2544 | CLK_INIT(csi0_src_clk.c), |
| 2545 | }, |
| 2546 | }; |
| 2547 | |
| 2548 | static struct branch_clk csi0_clk = { |
| 2549 | .b = { |
| 2550 | .ctl_reg = CSI0_CC_REG, |
| 2551 | .en_mask = BIT(0), |
| 2552 | .reset_reg = SW_RESET_CORE_REG, |
| 2553 | .reset_mask = BIT(8), |
| 2554 | .halt_reg = DBG_BUS_VEC_B_REG, |
| 2555 | .halt_bit = 13, |
| 2556 | }, |
| 2557 | .parent = &csi0_src_clk.c, |
| 2558 | .c = { |
| 2559 | .dbg_name = "csi0_clk", |
| 2560 | .ops = &clk_ops_branch, |
| 2561 | CLK_INIT(csi0_clk.c), |
| 2562 | }, |
| 2563 | }; |
| 2564 | |
| 2565 | static struct branch_clk csi0_phy_clk = { |
| 2566 | .b = { |
| 2567 | .ctl_reg = CSI0_CC_REG, |
| 2568 | .en_mask = BIT(8), |
| 2569 | .reset_reg = SW_RESET_CORE_REG, |
| 2570 | .reset_mask = BIT(29), |
| 2571 | .halt_reg = DBG_BUS_VEC_I_REG, |
| 2572 | .halt_bit = 9, |
| 2573 | }, |
| 2574 | .parent = &csi0_src_clk.c, |
| 2575 | .c = { |
| 2576 | .dbg_name = "csi0_phy_clk", |
| 2577 | .ops = &clk_ops_branch, |
| 2578 | CLK_INIT(csi0_phy_clk.c), |
| 2579 | }, |
| 2580 | }; |
| 2581 | |
| 2582 | static struct rcg_clk csi1_src_clk = { |
| 2583 | .ns_reg = CSI1_NS_REG, |
| 2584 | .b = { |
| 2585 | .ctl_reg = CSI1_CC_REG, |
| 2586 | .halt_check = NOCHECK, |
| 2587 | }, |
| 2588 | .md_reg = CSI1_MD_REG, |
| 2589 | .root_en_mask = BIT(2), |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 2590 | .ns_mask = BM(31, 24) | BM(15, 14) | BM(2, 0), |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame] | 2591 | .mnd_en_mask = BIT(5), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2592 | .ctl_mask = BM(7, 6), |
| 2593 | .set_rate = set_rate_mnd, |
| 2594 | .freq_tbl = clk_tbl_csi, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 2595 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2596 | .c = { |
| 2597 | .dbg_name = "csi1_src_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 2598 | .ops = &clk_ops_rcg, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 2599 | VDD_DIG_FMAX_MAP2(LOW, 86000000, NOMINAL, 178000000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2600 | CLK_INIT(csi1_src_clk.c), |
| 2601 | }, |
| 2602 | }; |
| 2603 | |
| 2604 | static struct branch_clk csi1_clk = { |
| 2605 | .b = { |
| 2606 | .ctl_reg = CSI1_CC_REG, |
| 2607 | .en_mask = BIT(0), |
| 2608 | .reset_reg = SW_RESET_CORE_REG, |
| 2609 | .reset_mask = BIT(18), |
| 2610 | .halt_reg = DBG_BUS_VEC_B_REG, |
| 2611 | .halt_bit = 14, |
| 2612 | }, |
| 2613 | .parent = &csi1_src_clk.c, |
| 2614 | .c = { |
| 2615 | .dbg_name = "csi1_clk", |
| 2616 | .ops = &clk_ops_branch, |
| 2617 | CLK_INIT(csi1_clk.c), |
| 2618 | }, |
| 2619 | }; |
| 2620 | |
| 2621 | static struct branch_clk csi1_phy_clk = { |
| 2622 | .b = { |
| 2623 | .ctl_reg = CSI1_CC_REG, |
| 2624 | .en_mask = BIT(8), |
| 2625 | .reset_reg = SW_RESET_CORE_REG, |
| 2626 | .reset_mask = BIT(28), |
| 2627 | .halt_reg = DBG_BUS_VEC_I_REG, |
| 2628 | .halt_bit = 10, |
| 2629 | }, |
| 2630 | .parent = &csi1_src_clk.c, |
| 2631 | .c = { |
| 2632 | .dbg_name = "csi1_phy_clk", |
| 2633 | .ops = &clk_ops_branch, |
| 2634 | CLK_INIT(csi1_phy_clk.c), |
| 2635 | }, |
| 2636 | }; |
| 2637 | |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 2638 | static struct rcg_clk csi2_src_clk = { |
| 2639 | .ns_reg = CSI2_NS_REG, |
| 2640 | .b = { |
| 2641 | .ctl_reg = CSI2_CC_REG, |
| 2642 | .halt_check = NOCHECK, |
| 2643 | }, |
| 2644 | .md_reg = CSI2_MD_REG, |
| 2645 | .root_en_mask = BIT(2), |
| 2646 | .ns_mask = BM(31, 24) | BM(15, 14) | BM(2, 0), |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame] | 2647 | .mnd_en_mask = BIT(5), |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 2648 | .ctl_mask = BM(7, 6), |
| 2649 | .set_rate = set_rate_mnd, |
| 2650 | .freq_tbl = clk_tbl_csi, |
| 2651 | .current_freq = &rcg_dummy_freq, |
| 2652 | .c = { |
| 2653 | .dbg_name = "csi2_src_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 2654 | .ops = &clk_ops_rcg, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 2655 | VDD_DIG_FMAX_MAP2(LOW, 86000000, NOMINAL, 178000000), |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 2656 | CLK_INIT(csi2_src_clk.c), |
| 2657 | }, |
| 2658 | }; |
| 2659 | |
| 2660 | static struct branch_clk csi2_clk = { |
| 2661 | .b = { |
| 2662 | .ctl_reg = CSI2_CC_REG, |
| 2663 | .en_mask = BIT(0), |
| 2664 | .reset_reg = SW_RESET_CORE2_REG, |
| 2665 | .reset_mask = BIT(2), |
| 2666 | .halt_reg = DBG_BUS_VEC_B_REG, |
| 2667 | .halt_bit = 29, |
| 2668 | }, |
| 2669 | .parent = &csi2_src_clk.c, |
| 2670 | .c = { |
| 2671 | .dbg_name = "csi2_clk", |
| 2672 | .ops = &clk_ops_branch, |
| 2673 | CLK_INIT(csi2_clk.c), |
| 2674 | }, |
| 2675 | }; |
| 2676 | |
| 2677 | static struct branch_clk csi2_phy_clk = { |
| 2678 | .b = { |
| 2679 | .ctl_reg = CSI2_CC_REG, |
| 2680 | .en_mask = BIT(8), |
| 2681 | .reset_reg = SW_RESET_CORE_REG, |
| 2682 | .reset_mask = BIT(31), |
| 2683 | .halt_reg = DBG_BUS_VEC_I_REG, |
| 2684 | .halt_bit = 29, |
| 2685 | }, |
| 2686 | .parent = &csi2_src_clk.c, |
| 2687 | .c = { |
| 2688 | .dbg_name = "csi2_phy_clk", |
| 2689 | .ops = &clk_ops_branch, |
| 2690 | CLK_INIT(csi2_phy_clk.c), |
| 2691 | }, |
| 2692 | }; |
| 2693 | |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 2694 | static struct clk *pix_rdi_mux_map[] = { |
| 2695 | [0] = &csi0_clk.c, |
| 2696 | [1] = &csi1_clk.c, |
| 2697 | [2] = &csi2_clk.c, |
| 2698 | NULL, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2699 | }; |
| 2700 | |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 2701 | struct pix_rdi_clk { |
| 2702 | bool enabled; |
Matt Wagantall | 9de3bfb | 2011-11-03 20:13:12 -0700 | [diff] [blame] | 2703 | unsigned long cur_rate; |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 2704 | |
| 2705 | void __iomem *const s_reg; |
| 2706 | u32 s_mask; |
| 2707 | |
| 2708 | void __iomem *const s2_reg; |
| 2709 | u32 s2_mask; |
| 2710 | |
| 2711 | struct branch b; |
| 2712 | struct clk c; |
| 2713 | }; |
| 2714 | |
| 2715 | static inline struct pix_rdi_clk *to_pix_rdi_clk(struct clk *clk) |
| 2716 | { |
| 2717 | return container_of(clk, struct pix_rdi_clk, c); |
| 2718 | } |
| 2719 | |
Matt Wagantall | 9de3bfb | 2011-11-03 20:13:12 -0700 | [diff] [blame] | 2720 | 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] | 2721 | { |
| 2722 | int ret, i; |
| 2723 | u32 reg; |
| 2724 | unsigned long flags; |
| 2725 | struct pix_rdi_clk *clk = to_pix_rdi_clk(c); |
| 2726 | struct clk **mux_map = pix_rdi_mux_map; |
| 2727 | |
| 2728 | /* |
| 2729 | * These clocks select three inputs via two muxes. One mux selects |
| 2730 | * between csi0 and csi1 and the second mux selects between that mux's |
| 2731 | * output and csi2. The source and destination selections for each |
| 2732 | * mux must be clocking for the switch to succeed so just turn on |
| 2733 | * all three sources because it's easier than figuring out what source |
| 2734 | * needs to be on at what time. |
| 2735 | */ |
| 2736 | for (i = 0; mux_map[i]; i++) { |
| 2737 | ret = clk_enable(mux_map[i]); |
| 2738 | if (ret) |
| 2739 | goto err; |
| 2740 | } |
| 2741 | if (rate >= i) { |
| 2742 | ret = -EINVAL; |
| 2743 | goto err; |
| 2744 | } |
| 2745 | /* Keep the new source on when switching inputs of an enabled clock */ |
| 2746 | if (clk->enabled) { |
| 2747 | clk_disable(mux_map[clk->cur_rate]); |
| 2748 | clk_enable(mux_map[rate]); |
| 2749 | } |
| 2750 | spin_lock_irqsave(&local_clock_reg_lock, flags); |
| 2751 | reg = readl_relaxed(clk->s2_reg); |
| 2752 | reg &= ~clk->s2_mask; |
| 2753 | reg |= rate == 2 ? clk->s2_mask : 0; |
| 2754 | writel_relaxed(reg, clk->s2_reg); |
| 2755 | /* |
| 2756 | * Wait at least 6 cycles of slowest clock |
| 2757 | * for the glitch-free MUX to fully switch sources. |
| 2758 | */ |
| 2759 | mb(); |
| 2760 | udelay(1); |
| 2761 | reg = readl_relaxed(clk->s_reg); |
| 2762 | reg &= ~clk->s_mask; |
| 2763 | reg |= rate == 1 ? clk->s_mask : 0; |
| 2764 | writel_relaxed(reg, clk->s_reg); |
| 2765 | /* |
| 2766 | * Wait at least 6 cycles of slowest clock |
| 2767 | * for the glitch-free MUX to fully switch sources. |
| 2768 | */ |
| 2769 | mb(); |
| 2770 | udelay(1); |
| 2771 | clk->cur_rate = rate; |
| 2772 | spin_unlock_irqrestore(&local_clock_reg_lock, flags); |
| 2773 | err: |
| 2774 | for (i--; i >= 0; i--) |
| 2775 | clk_disable(mux_map[i]); |
| 2776 | |
| 2777 | return 0; |
| 2778 | } |
| 2779 | |
Matt Wagantall | 9de3bfb | 2011-11-03 20:13:12 -0700 | [diff] [blame] | 2780 | static unsigned long pix_rdi_clk_get_rate(struct clk *c) |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 2781 | { |
| 2782 | return to_pix_rdi_clk(c)->cur_rate; |
| 2783 | } |
| 2784 | |
| 2785 | static int pix_rdi_clk_enable(struct clk *c) |
| 2786 | { |
| 2787 | unsigned long flags; |
| 2788 | struct pix_rdi_clk *clk = to_pix_rdi_clk(c); |
| 2789 | |
| 2790 | spin_lock_irqsave(&local_clock_reg_lock, flags); |
| 2791 | __branch_clk_enable_reg(&clk->b, clk->c.dbg_name); |
| 2792 | spin_unlock_irqrestore(&local_clock_reg_lock, flags); |
| 2793 | clk->enabled = true; |
| 2794 | |
| 2795 | return 0; |
| 2796 | } |
| 2797 | |
| 2798 | static void pix_rdi_clk_disable(struct clk *c) |
| 2799 | { |
| 2800 | unsigned long flags; |
| 2801 | struct pix_rdi_clk *clk = to_pix_rdi_clk(c); |
| 2802 | |
| 2803 | spin_lock_irqsave(&local_clock_reg_lock, flags); |
| 2804 | __branch_clk_disable_reg(&clk->b, clk->c.dbg_name); |
| 2805 | spin_unlock_irqrestore(&local_clock_reg_lock, flags); |
| 2806 | clk->enabled = false; |
| 2807 | } |
| 2808 | |
| 2809 | static int pix_rdi_clk_reset(struct clk *clk, enum clk_reset_action action) |
| 2810 | { |
| 2811 | return branch_reset(&to_pix_rdi_clk(clk)->b, action); |
| 2812 | } |
| 2813 | |
| 2814 | static struct clk *pix_rdi_clk_get_parent(struct clk *c) |
| 2815 | { |
| 2816 | struct pix_rdi_clk *clk = to_pix_rdi_clk(c); |
| 2817 | |
| 2818 | return pix_rdi_mux_map[clk->cur_rate]; |
| 2819 | } |
| 2820 | |
| 2821 | static int pix_rdi_clk_list_rate(struct clk *c, unsigned n) |
| 2822 | { |
| 2823 | if (pix_rdi_mux_map[n]) |
| 2824 | return n; |
| 2825 | return -ENXIO; |
| 2826 | } |
| 2827 | |
Matt Wagantall | a15833b | 2012-04-03 11:00:56 -0700 | [diff] [blame] | 2828 | static enum handoff pix_rdi_clk_handoff(struct clk *c) |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 2829 | { |
| 2830 | u32 reg; |
| 2831 | struct pix_rdi_clk *clk = to_pix_rdi_clk(c); |
Matt Wagantall | a15833b | 2012-04-03 11:00:56 -0700 | [diff] [blame] | 2832 | enum handoff ret; |
| 2833 | |
| 2834 | ret = branch_handoff(&clk->b, &clk->c); |
| 2835 | if (ret == HANDOFF_DISABLED_CLK) |
| 2836 | return ret; |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 2837 | |
| 2838 | reg = readl_relaxed(clk->s_reg); |
| 2839 | clk->cur_rate = reg & clk->s_mask ? 1 : 0; |
| 2840 | reg = readl_relaxed(clk->s2_reg); |
| 2841 | clk->cur_rate = reg & clk->s2_mask ? 2 : clk->cur_rate; |
Matt Wagantall | a15833b | 2012-04-03 11:00:56 -0700 | [diff] [blame] | 2842 | |
| 2843 | return HANDOFF_ENABLED_CLK; |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 2844 | } |
| 2845 | |
| 2846 | static struct clk_ops clk_ops_pix_rdi_8960 = { |
| 2847 | .enable = pix_rdi_clk_enable, |
| 2848 | .disable = pix_rdi_clk_disable, |
| 2849 | .auto_off = pix_rdi_clk_disable, |
| 2850 | .handoff = pix_rdi_clk_handoff, |
| 2851 | .set_rate = pix_rdi_clk_set_rate, |
| 2852 | .get_rate = pix_rdi_clk_get_rate, |
| 2853 | .list_rate = pix_rdi_clk_list_rate, |
| 2854 | .reset = pix_rdi_clk_reset, |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 2855 | .get_parent = pix_rdi_clk_get_parent, |
| 2856 | }; |
| 2857 | |
| 2858 | static struct pix_rdi_clk csi_pix_clk = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2859 | .b = { |
| 2860 | .ctl_reg = MISC_CC_REG, |
| 2861 | .en_mask = BIT(26), |
| 2862 | .halt_check = DELAY, |
| 2863 | .reset_reg = SW_RESET_CORE_REG, |
| 2864 | .reset_mask = BIT(26), |
| 2865 | }, |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 2866 | .s_reg = MISC_CC_REG, |
| 2867 | .s_mask = BIT(25), |
| 2868 | .s2_reg = MISC_CC3_REG, |
| 2869 | .s2_mask = BIT(13), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2870 | .c = { |
| 2871 | .dbg_name = "csi_pix_clk", |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 2872 | .ops = &clk_ops_pix_rdi_8960, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2873 | CLK_INIT(csi_pix_clk.c), |
| 2874 | }, |
| 2875 | }; |
| 2876 | |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 2877 | static struct pix_rdi_clk csi_pix1_clk = { |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 2878 | .b = { |
| 2879 | .ctl_reg = MISC_CC3_REG, |
| 2880 | .en_mask = BIT(10), |
| 2881 | .halt_check = DELAY, |
| 2882 | .reset_reg = SW_RESET_CORE_REG, |
| 2883 | .reset_mask = BIT(30), |
| 2884 | }, |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 2885 | .s_reg = MISC_CC3_REG, |
| 2886 | .s_mask = BIT(8), |
| 2887 | .s2_reg = MISC_CC3_REG, |
| 2888 | .s2_mask = BIT(9), |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 2889 | .c = { |
| 2890 | .dbg_name = "csi_pix1_clk", |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 2891 | .ops = &clk_ops_pix_rdi_8960, |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 2892 | CLK_INIT(csi_pix1_clk.c), |
| 2893 | }, |
| 2894 | }; |
| 2895 | |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 2896 | static struct pix_rdi_clk csi_rdi_clk = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2897 | .b = { |
| 2898 | .ctl_reg = MISC_CC_REG, |
| 2899 | .en_mask = BIT(13), |
| 2900 | .halt_check = DELAY, |
| 2901 | .reset_reg = SW_RESET_CORE_REG, |
| 2902 | .reset_mask = BIT(27), |
| 2903 | }, |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 2904 | .s_reg = MISC_CC_REG, |
| 2905 | .s_mask = BIT(12), |
| 2906 | .s2_reg = MISC_CC3_REG, |
| 2907 | .s2_mask = BIT(12), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2908 | .c = { |
| 2909 | .dbg_name = "csi_rdi_clk", |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 2910 | .ops = &clk_ops_pix_rdi_8960, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2911 | CLK_INIT(csi_rdi_clk.c), |
| 2912 | }, |
| 2913 | }; |
| 2914 | |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 2915 | static struct pix_rdi_clk csi_rdi1_clk = { |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 2916 | .b = { |
| 2917 | .ctl_reg = MISC_CC3_REG, |
| 2918 | .en_mask = BIT(2), |
| 2919 | .halt_check = DELAY, |
| 2920 | .reset_reg = SW_RESET_CORE2_REG, |
| 2921 | .reset_mask = BIT(1), |
| 2922 | }, |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 2923 | .s_reg = MISC_CC3_REG, |
| 2924 | .s_mask = BIT(0), |
| 2925 | .s2_reg = MISC_CC3_REG, |
| 2926 | .s2_mask = BIT(1), |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 2927 | .c = { |
| 2928 | .dbg_name = "csi_rdi1_clk", |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 2929 | .ops = &clk_ops_pix_rdi_8960, |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 2930 | CLK_INIT(csi_rdi1_clk.c), |
| 2931 | }, |
| 2932 | }; |
| 2933 | |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 2934 | static struct pix_rdi_clk csi_rdi2_clk = { |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 2935 | .b = { |
| 2936 | .ctl_reg = MISC_CC3_REG, |
| 2937 | .en_mask = BIT(6), |
| 2938 | .halt_check = DELAY, |
| 2939 | .reset_reg = SW_RESET_CORE2_REG, |
| 2940 | .reset_mask = BIT(0), |
| 2941 | }, |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 2942 | .s_reg = MISC_CC3_REG, |
| 2943 | .s_mask = BIT(4), |
| 2944 | .s2_reg = MISC_CC3_REG, |
| 2945 | .s2_mask = BIT(5), |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 2946 | .c = { |
| 2947 | .dbg_name = "csi_rdi2_clk", |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 2948 | .ops = &clk_ops_pix_rdi_8960, |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 2949 | CLK_INIT(csi_rdi2_clk.c), |
| 2950 | }, |
| 2951 | }; |
| 2952 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 2953 | #define F_CSI_PHYTIMER(f, s, d, m, n) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2954 | { \ |
| 2955 | .freq_hz = f, \ |
| 2956 | .src_clk = &s##_clk.c, \ |
| 2957 | .md_val = MD8(8, m, 0, n), \ |
| 2958 | .ns_val = NS_MM(31, 24, n, m, 15, 14, d, 2, 0, s##_to_mm_mux), \ |
| 2959 | .ctl_val = CC(6, n), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2960 | } |
| 2961 | static struct clk_freq_tbl clk_tbl_csi_phytimer[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 2962 | F_CSI_PHYTIMER( 0, gnd, 1, 0, 0), |
| 2963 | F_CSI_PHYTIMER( 85330000, pll8, 1, 2, 9), |
| 2964 | F_CSI_PHYTIMER(177780000, pll2, 1, 2, 9), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2965 | F_END |
| 2966 | }; |
| 2967 | |
| 2968 | static struct rcg_clk csiphy_timer_src_clk = { |
| 2969 | .ns_reg = CSIPHYTIMER_NS_REG, |
| 2970 | .b = { |
| 2971 | .ctl_reg = CSIPHYTIMER_CC_REG, |
| 2972 | .halt_check = NOCHECK, |
| 2973 | }, |
| 2974 | .md_reg = CSIPHYTIMER_MD_REG, |
| 2975 | .root_en_mask = BIT(2), |
| 2976 | .ns_mask = (BM(31, 24) | BM(15, 14) | BM(2, 0)), |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame] | 2977 | .mnd_en_mask = BIT(5), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2978 | .ctl_mask = BM(7, 6), |
| 2979 | .set_rate = set_rate_mnd_8, |
| 2980 | .freq_tbl = clk_tbl_csi_phytimer, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 2981 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2982 | .c = { |
| 2983 | .dbg_name = "csiphy_timer_src_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 2984 | .ops = &clk_ops_rcg, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 2985 | VDD_DIG_FMAX_MAP2(LOW, 86000000, NOMINAL, 178000000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2986 | CLK_INIT(csiphy_timer_src_clk.c), |
| 2987 | }, |
| 2988 | }; |
| 2989 | |
| 2990 | static struct branch_clk csi0phy_timer_clk = { |
| 2991 | .b = { |
| 2992 | .ctl_reg = CSIPHYTIMER_CC_REG, |
| 2993 | .en_mask = BIT(0), |
| 2994 | .halt_reg = DBG_BUS_VEC_I_REG, |
| 2995 | .halt_bit = 17, |
| 2996 | }, |
| 2997 | .parent = &csiphy_timer_src_clk.c, |
| 2998 | .c = { |
| 2999 | .dbg_name = "csi0phy_timer_clk", |
| 3000 | .ops = &clk_ops_branch, |
| 3001 | CLK_INIT(csi0phy_timer_clk.c), |
| 3002 | }, |
| 3003 | }; |
| 3004 | |
| 3005 | static struct branch_clk csi1phy_timer_clk = { |
| 3006 | .b = { |
| 3007 | .ctl_reg = CSIPHYTIMER_CC_REG, |
| 3008 | .en_mask = BIT(9), |
| 3009 | .halt_reg = DBG_BUS_VEC_I_REG, |
| 3010 | .halt_bit = 18, |
| 3011 | }, |
| 3012 | .parent = &csiphy_timer_src_clk.c, |
| 3013 | .c = { |
| 3014 | .dbg_name = "csi1phy_timer_clk", |
| 3015 | .ops = &clk_ops_branch, |
| 3016 | CLK_INIT(csi1phy_timer_clk.c), |
| 3017 | }, |
| 3018 | }; |
| 3019 | |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 3020 | static struct branch_clk csi2phy_timer_clk = { |
| 3021 | .b = { |
| 3022 | .ctl_reg = CSIPHYTIMER_CC_REG, |
| 3023 | .en_mask = BIT(11), |
| 3024 | .halt_reg = DBG_BUS_VEC_I_REG, |
| 3025 | .halt_bit = 30, |
| 3026 | }, |
| 3027 | .parent = &csiphy_timer_src_clk.c, |
| 3028 | .c = { |
| 3029 | .dbg_name = "csi2phy_timer_clk", |
| 3030 | .ops = &clk_ops_branch, |
| 3031 | CLK_INIT(csi2phy_timer_clk.c), |
| 3032 | }, |
| 3033 | }; |
| 3034 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3035 | #define F_DSI(d) \ |
| 3036 | { \ |
| 3037 | .freq_hz = d, \ |
| 3038 | .ns_val = BVAL(15, 12, (d-1)), \ |
| 3039 | } |
| 3040 | /* |
| 3041 | * The DSI_BYTE/ESC clock is sourced from the DSI PHY PLL, which may change rate |
| 3042 | * without this clock driver knowing. So, overload the clk_set_rate() to set |
| 3043 | * the divider (1 to 16) of the clock with respect to the PLL rate. |
| 3044 | */ |
| 3045 | static struct clk_freq_tbl clk_tbl_dsi_byte[] = { |
| 3046 | F_DSI(1), F_DSI(2), F_DSI(3), F_DSI(4), |
| 3047 | F_DSI(5), F_DSI(6), F_DSI(7), F_DSI(8), |
| 3048 | F_DSI(9), F_DSI(10), F_DSI(11), F_DSI(12), |
| 3049 | F_DSI(13), F_DSI(14), F_DSI(15), F_DSI(16), |
| 3050 | F_END |
| 3051 | }; |
| 3052 | |
| 3053 | static struct rcg_clk dsi1_byte_clk = { |
| 3054 | .b = { |
| 3055 | .ctl_reg = DSI1_BYTE_CC_REG, |
| 3056 | .en_mask = BIT(0), |
| 3057 | .reset_reg = SW_RESET_CORE_REG, |
| 3058 | .reset_mask = BIT(7), |
| 3059 | .halt_reg = DBG_BUS_VEC_B_REG, |
| 3060 | .halt_bit = 21, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 3061 | .retain_reg = DSI1_BYTE_CC_REG, |
| 3062 | .retain_mask = BIT(31), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3063 | }, |
| 3064 | .ns_reg = DSI1_BYTE_NS_REG, |
| 3065 | .root_en_mask = BIT(2), |
| 3066 | .ns_mask = BM(15, 12), |
| 3067 | .set_rate = set_rate_nop, |
| 3068 | .freq_tbl = clk_tbl_dsi_byte, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 3069 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3070 | .c = { |
| 3071 | .dbg_name = "dsi1_byte_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 3072 | .ops = &clk_ops_rcg, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3073 | CLK_INIT(dsi1_byte_clk.c), |
| 3074 | }, |
| 3075 | }; |
| 3076 | |
| 3077 | static struct rcg_clk dsi2_byte_clk = { |
| 3078 | .b = { |
| 3079 | .ctl_reg = DSI2_BYTE_CC_REG, |
| 3080 | .en_mask = BIT(0), |
| 3081 | .reset_reg = SW_RESET_CORE_REG, |
| 3082 | .reset_mask = BIT(25), |
| 3083 | .halt_reg = DBG_BUS_VEC_B_REG, |
| 3084 | .halt_bit = 20, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 3085 | .retain_reg = DSI2_BYTE_CC_REG, |
| 3086 | .retain_mask = BIT(31), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3087 | }, |
| 3088 | .ns_reg = DSI2_BYTE_NS_REG, |
| 3089 | .root_en_mask = BIT(2), |
| 3090 | .ns_mask = BM(15, 12), |
| 3091 | .set_rate = set_rate_nop, |
| 3092 | .freq_tbl = clk_tbl_dsi_byte, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 3093 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3094 | .c = { |
| 3095 | .dbg_name = "dsi2_byte_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 3096 | .ops = &clk_ops_rcg, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3097 | CLK_INIT(dsi2_byte_clk.c), |
| 3098 | }, |
| 3099 | }; |
| 3100 | |
| 3101 | static struct rcg_clk dsi1_esc_clk = { |
| 3102 | .b = { |
| 3103 | .ctl_reg = DSI1_ESC_CC_REG, |
| 3104 | .en_mask = BIT(0), |
| 3105 | .reset_reg = SW_RESET_CORE_REG, |
| 3106 | .halt_reg = DBG_BUS_VEC_I_REG, |
| 3107 | .halt_bit = 1, |
| 3108 | }, |
| 3109 | .ns_reg = DSI1_ESC_NS_REG, |
| 3110 | .root_en_mask = BIT(2), |
| 3111 | .ns_mask = BM(15, 12), |
| 3112 | .set_rate = set_rate_nop, |
| 3113 | .freq_tbl = clk_tbl_dsi_byte, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 3114 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3115 | .c = { |
| 3116 | .dbg_name = "dsi1_esc_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 3117 | .ops = &clk_ops_rcg, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3118 | CLK_INIT(dsi1_esc_clk.c), |
| 3119 | }, |
| 3120 | }; |
| 3121 | |
| 3122 | static struct rcg_clk dsi2_esc_clk = { |
| 3123 | .b = { |
| 3124 | .ctl_reg = DSI2_ESC_CC_REG, |
| 3125 | .en_mask = BIT(0), |
| 3126 | .halt_reg = DBG_BUS_VEC_I_REG, |
| 3127 | .halt_bit = 3, |
| 3128 | }, |
| 3129 | .ns_reg = DSI2_ESC_NS_REG, |
| 3130 | .root_en_mask = BIT(2), |
| 3131 | .ns_mask = BM(15, 12), |
| 3132 | .set_rate = set_rate_nop, |
| 3133 | .freq_tbl = clk_tbl_dsi_byte, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 3134 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3135 | .c = { |
| 3136 | .dbg_name = "dsi2_esc_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 3137 | .ops = &clk_ops_rcg, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3138 | CLK_INIT(dsi2_esc_clk.c), |
| 3139 | }, |
| 3140 | }; |
| 3141 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3142 | #define F_GFX2D(f, s, m, n) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3143 | { \ |
| 3144 | .freq_hz = f, \ |
| 3145 | .src_clk = &s##_clk.c, \ |
| 3146 | .md_val = MD4(4, m, 0, n), \ |
| 3147 | .ns_val = NS_MND_BANKED4(20, 16, n, m, 3, 0, s##_to_mm_mux), \ |
| 3148 | .ctl_val = CC_BANKED(9, 6, n), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3149 | } |
| 3150 | static struct clk_freq_tbl clk_tbl_gfx2d[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3151 | F_GFX2D( 0, gnd, 0, 0), |
| 3152 | F_GFX2D( 27000000, pxo, 0, 0), |
| 3153 | F_GFX2D( 48000000, pll8, 1, 8), |
| 3154 | F_GFX2D( 54857000, pll8, 1, 7), |
| 3155 | F_GFX2D( 64000000, pll8, 1, 6), |
| 3156 | F_GFX2D( 76800000, pll8, 1, 5), |
| 3157 | F_GFX2D( 96000000, pll8, 1, 4), |
| 3158 | F_GFX2D(128000000, pll8, 1, 3), |
| 3159 | F_GFX2D(145455000, pll2, 2, 11), |
| 3160 | F_GFX2D(160000000, pll2, 1, 5), |
| 3161 | F_GFX2D(177778000, pll2, 2, 9), |
| 3162 | F_GFX2D(200000000, pll2, 1, 4), |
| 3163 | F_GFX2D(228571000, pll2, 2, 7), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3164 | F_END |
| 3165 | }; |
| 3166 | |
| 3167 | static struct bank_masks bmnd_info_gfx2d0 = { |
| 3168 | .bank_sel_mask = BIT(11), |
| 3169 | .bank0_mask = { |
| 3170 | .md_reg = GFX2D0_MD0_REG, |
| 3171 | .ns_mask = BM(23, 20) | BM(5, 3), |
| 3172 | .rst_mask = BIT(25), |
| 3173 | .mnd_en_mask = BIT(8), |
| 3174 | .mode_mask = BM(10, 9), |
| 3175 | }, |
| 3176 | .bank1_mask = { |
| 3177 | .md_reg = GFX2D0_MD1_REG, |
| 3178 | .ns_mask = BM(19, 16) | BM(2, 0), |
| 3179 | .rst_mask = BIT(24), |
| 3180 | .mnd_en_mask = BIT(5), |
| 3181 | .mode_mask = BM(7, 6), |
| 3182 | }, |
| 3183 | }; |
| 3184 | |
| 3185 | static struct rcg_clk gfx2d0_clk = { |
| 3186 | .b = { |
| 3187 | .ctl_reg = GFX2D0_CC_REG, |
| 3188 | .en_mask = BIT(0), |
| 3189 | .reset_reg = SW_RESET_CORE_REG, |
| 3190 | .reset_mask = BIT(14), |
| 3191 | .halt_reg = DBG_BUS_VEC_A_REG, |
| 3192 | .halt_bit = 9, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 3193 | .retain_reg = GFX2D0_CC_REG, |
| 3194 | .retain_mask = BIT(31), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3195 | }, |
| 3196 | .ns_reg = GFX2D0_NS_REG, |
| 3197 | .root_en_mask = BIT(2), |
| 3198 | .set_rate = set_rate_mnd_banked, |
| 3199 | .freq_tbl = clk_tbl_gfx2d, |
Stephen Boyd | c78d9a7 | 2011-07-20 00:46:24 -0700 | [diff] [blame] | 3200 | .bank_info = &bmnd_info_gfx2d0, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 3201 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3202 | .c = { |
| 3203 | .dbg_name = "gfx2d0_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 3204 | .ops = &clk_ops_rcg, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3205 | VDD_DIG_FMAX_MAP3(LOW, 100000000, NOMINAL, 200000000, |
| 3206 | HIGH, 228571000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3207 | CLK_INIT(gfx2d0_clk.c), |
| 3208 | }, |
| 3209 | }; |
| 3210 | |
| 3211 | static struct bank_masks bmnd_info_gfx2d1 = { |
| 3212 | .bank_sel_mask = BIT(11), |
| 3213 | .bank0_mask = { |
| 3214 | .md_reg = GFX2D1_MD0_REG, |
| 3215 | .ns_mask = BM(23, 20) | BM(5, 3), |
| 3216 | .rst_mask = BIT(25), |
| 3217 | .mnd_en_mask = BIT(8), |
| 3218 | .mode_mask = BM(10, 9), |
| 3219 | }, |
| 3220 | .bank1_mask = { |
| 3221 | .md_reg = GFX2D1_MD1_REG, |
| 3222 | .ns_mask = BM(19, 16) | BM(2, 0), |
| 3223 | .rst_mask = BIT(24), |
| 3224 | .mnd_en_mask = BIT(5), |
| 3225 | .mode_mask = BM(7, 6), |
| 3226 | }, |
| 3227 | }; |
| 3228 | |
| 3229 | static struct rcg_clk gfx2d1_clk = { |
| 3230 | .b = { |
| 3231 | .ctl_reg = GFX2D1_CC_REG, |
| 3232 | .en_mask = BIT(0), |
| 3233 | .reset_reg = SW_RESET_CORE_REG, |
| 3234 | .reset_mask = BIT(13), |
| 3235 | .halt_reg = DBG_BUS_VEC_A_REG, |
| 3236 | .halt_bit = 14, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 3237 | .retain_reg = GFX2D1_CC_REG, |
| 3238 | .retain_mask = BIT(31), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3239 | }, |
| 3240 | .ns_reg = GFX2D1_NS_REG, |
| 3241 | .root_en_mask = BIT(2), |
| 3242 | .set_rate = set_rate_mnd_banked, |
| 3243 | .freq_tbl = clk_tbl_gfx2d, |
Stephen Boyd | c78d9a7 | 2011-07-20 00:46:24 -0700 | [diff] [blame] | 3244 | .bank_info = &bmnd_info_gfx2d1, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 3245 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3246 | .c = { |
| 3247 | .dbg_name = "gfx2d1_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 3248 | .ops = &clk_ops_rcg, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3249 | VDD_DIG_FMAX_MAP3(LOW, 100000000, NOMINAL, 200000000, |
| 3250 | HIGH, 228571000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3251 | CLK_INIT(gfx2d1_clk.c), |
| 3252 | }, |
| 3253 | }; |
| 3254 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3255 | #define F_GFX3D(f, s, m, n) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3256 | { \ |
| 3257 | .freq_hz = f, \ |
| 3258 | .src_clk = &s##_clk.c, \ |
| 3259 | .md_val = MD4(4, m, 0, n), \ |
| 3260 | .ns_val = NS_MND_BANKED4(18, 14, n, m, 3, 0, s##_to_mm_mux), \ |
| 3261 | .ctl_val = CC_BANKED(9, 6, n), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3262 | } |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 3263 | |
| 3264 | static struct clk_freq_tbl clk_tbl_gfx3d_8960[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3265 | F_GFX3D( 0, gnd, 0, 0), |
| 3266 | F_GFX3D( 27000000, pxo, 0, 0), |
| 3267 | F_GFX3D( 48000000, pll8, 1, 8), |
| 3268 | F_GFX3D( 54857000, pll8, 1, 7), |
| 3269 | F_GFX3D( 64000000, pll8, 1, 6), |
| 3270 | F_GFX3D( 76800000, pll8, 1, 5), |
| 3271 | F_GFX3D( 96000000, pll8, 1, 4), |
| 3272 | F_GFX3D(128000000, pll8, 1, 3), |
| 3273 | F_GFX3D(145455000, pll2, 2, 11), |
| 3274 | F_GFX3D(160000000, pll2, 1, 5), |
| 3275 | F_GFX3D(177778000, pll2, 2, 9), |
| 3276 | F_GFX3D(200000000, pll2, 1, 4), |
| 3277 | F_GFX3D(228571000, pll2, 2, 7), |
| 3278 | F_GFX3D(266667000, pll2, 1, 3), |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3279 | F_GFX3D(300000000, pll3, 1, 4), |
| 3280 | F_GFX3D(320000000, pll2, 2, 5), |
| 3281 | F_GFX3D(400000000, pll2, 1, 2), |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 3282 | F_END |
| 3283 | }; |
| 3284 | |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 3285 | static struct clk_freq_tbl clk_tbl_gfx3d_8064[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3286 | F_GFX3D( 0, gnd, 0, 0), |
| 3287 | F_GFX3D( 27000000, pxo, 0, 0), |
| 3288 | F_GFX3D( 48000000, pll8, 1, 8), |
| 3289 | F_GFX3D( 54857000, pll8, 1, 7), |
| 3290 | F_GFX3D( 64000000, pll8, 1, 6), |
| 3291 | F_GFX3D( 76800000, pll8, 1, 5), |
| 3292 | F_GFX3D( 96000000, pll8, 1, 4), |
| 3293 | F_GFX3D(128000000, pll8, 1, 3), |
| 3294 | F_GFX3D(145455000, pll2, 2, 11), |
| 3295 | F_GFX3D(160000000, pll2, 1, 5), |
| 3296 | F_GFX3D(177778000, pll2, 2, 9), |
| 3297 | F_GFX3D(200000000, pll2, 1, 4), |
| 3298 | F_GFX3D(228571000, pll2, 2, 7), |
| 3299 | F_GFX3D(266667000, pll2, 1, 3), |
Tianyi Gou | 0c50fe3 | 2011-10-19 15:50:35 -0700 | [diff] [blame] | 3300 | F_GFX3D(325000000, pll15, 1, 3), |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3301 | F_GFX3D(400000000, pll2, 1, 2), |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 3302 | F_END |
| 3303 | }; |
| 3304 | |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 3305 | static struct clk_freq_tbl clk_tbl_gfx3d_8930[] = { |
| 3306 | F_GFX3D( 0, gnd, 0, 0), |
| 3307 | F_GFX3D( 27000000, pxo, 0, 0), |
| 3308 | F_GFX3D( 48000000, pll8, 1, 8), |
| 3309 | F_GFX3D( 54857000, pll8, 1, 7), |
| 3310 | F_GFX3D( 64000000, pll8, 1, 6), |
| 3311 | F_GFX3D( 76800000, pll8, 1, 5), |
| 3312 | F_GFX3D( 96000000, pll8, 1, 4), |
| 3313 | F_GFX3D(128000000, pll8, 1, 3), |
| 3314 | F_GFX3D(145455000, pll2, 2, 11), |
| 3315 | F_GFX3D(160000000, pll2, 1, 5), |
| 3316 | F_GFX3D(177778000, pll2, 2, 9), |
Tianyi Gou | 4d33c9c | 2012-03-30 11:10:15 -0700 | [diff] [blame] | 3317 | F_GFX3D(192000000, pll8, 1, 2), |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 3318 | F_GFX3D(200000000, pll2, 1, 4), |
| 3319 | F_GFX3D(228571000, pll2, 2, 7), |
| 3320 | F_GFX3D(266667000, pll2, 1, 3), |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 3321 | F_GFX3D(320000000, pll2, 2, 5), |
| 3322 | F_GFX3D(400000000, pll2, 1, 2), |
| 3323 | F_GFX3D(450000000, pll15, 1, 2), |
| 3324 | F_END |
| 3325 | }; |
| 3326 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3327 | static unsigned long fmax_gfx3d_8064[MAX_VDD_LEVELS] __initdata = { |
| 3328 | [VDD_DIG_LOW] = 128000000, |
| 3329 | [VDD_DIG_NOMINAL] = 325000000, |
| 3330 | [VDD_DIG_HIGH] = 400000000 |
| 3331 | }; |
| 3332 | |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 3333 | static unsigned long fmax_gfx3d_8930[MAX_VDD_LEVELS] __initdata = { |
Tianyi Gou | 4d33c9c | 2012-03-30 11:10:15 -0700 | [diff] [blame] | 3334 | [VDD_DIG_LOW] = 192000000, |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 3335 | [VDD_DIG_NOMINAL] = 320000000, |
| 3336 | [VDD_DIG_HIGH] = 450000000 |
| 3337 | }; |
| 3338 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3339 | static struct bank_masks bmnd_info_gfx3d = { |
| 3340 | .bank_sel_mask = BIT(11), |
| 3341 | .bank0_mask = { |
| 3342 | .md_reg = GFX3D_MD0_REG, |
| 3343 | .ns_mask = BM(21, 18) | BM(5, 3), |
| 3344 | .rst_mask = BIT(23), |
| 3345 | .mnd_en_mask = BIT(8), |
| 3346 | .mode_mask = BM(10, 9), |
| 3347 | }, |
| 3348 | .bank1_mask = { |
| 3349 | .md_reg = GFX3D_MD1_REG, |
| 3350 | .ns_mask = BM(17, 14) | BM(2, 0), |
| 3351 | .rst_mask = BIT(22), |
| 3352 | .mnd_en_mask = BIT(5), |
| 3353 | .mode_mask = BM(7, 6), |
| 3354 | }, |
| 3355 | }; |
| 3356 | |
| 3357 | static struct rcg_clk gfx3d_clk = { |
| 3358 | .b = { |
| 3359 | .ctl_reg = GFX3D_CC_REG, |
| 3360 | .en_mask = BIT(0), |
| 3361 | .reset_reg = SW_RESET_CORE_REG, |
| 3362 | .reset_mask = BIT(12), |
| 3363 | .halt_reg = DBG_BUS_VEC_A_REG, |
| 3364 | .halt_bit = 4, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 3365 | .retain_reg = GFX3D_CC_REG, |
| 3366 | .retain_mask = BIT(31), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3367 | }, |
| 3368 | .ns_reg = GFX3D_NS_REG, |
| 3369 | .root_en_mask = BIT(2), |
| 3370 | .set_rate = set_rate_mnd_banked, |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 3371 | .freq_tbl = clk_tbl_gfx3d_8960, |
Stephen Boyd | c78d9a7 | 2011-07-20 00:46:24 -0700 | [diff] [blame] | 3372 | .bank_info = &bmnd_info_gfx3d, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 3373 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3374 | .c = { |
| 3375 | .dbg_name = "gfx3d_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 3376 | .ops = &clk_ops_rcg, |
Tianyi Gou | 3022dfd | 2012-01-25 15:50:05 -0800 | [diff] [blame] | 3377 | VDD_DIG_FMAX_MAP3(LOW, 128000000, NOMINAL, 300000000, |
| 3378 | HIGH, 400000000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3379 | CLK_INIT(gfx3d_clk.c), |
Stephen Boyd | 7fa2674 | 2011-08-11 23:22:29 -0700 | [diff] [blame] | 3380 | .depends = &gmem_axi_clk.c, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3381 | }, |
| 3382 | }; |
| 3383 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3384 | #define F_VCAP(f, s, m, n) \ |
Tianyi Gou | 621f874 | 2011-09-01 21:45:01 -0700 | [diff] [blame] | 3385 | { \ |
| 3386 | .freq_hz = f, \ |
| 3387 | .src_clk = &s##_clk.c, \ |
| 3388 | .md_val = MD4(4, m, 0, n), \ |
| 3389 | .ns_val = NS_MND_BANKED4(18, 14, n, m, 3, 0, s##_to_mm_mux), \ |
| 3390 | .ctl_val = CC_BANKED(9, 6, n), \ |
Tianyi Gou | 621f874 | 2011-09-01 21:45:01 -0700 | [diff] [blame] | 3391 | } |
| 3392 | |
| 3393 | static struct clk_freq_tbl clk_tbl_vcap[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3394 | F_VCAP( 0, gnd, 0, 0), |
| 3395 | F_VCAP( 27000000, pxo, 0, 0), |
| 3396 | F_VCAP( 54860000, pll8, 1, 7), |
| 3397 | F_VCAP( 64000000, pll8, 1, 6), |
| 3398 | F_VCAP( 76800000, pll8, 1, 5), |
| 3399 | F_VCAP(128000000, pll8, 1, 3), |
| 3400 | F_VCAP(160000000, pll2, 1, 5), |
| 3401 | F_VCAP(200000000, pll2, 1, 4), |
Tianyi Gou | 621f874 | 2011-09-01 21:45:01 -0700 | [diff] [blame] | 3402 | F_END |
| 3403 | }; |
| 3404 | |
| 3405 | static struct bank_masks bmnd_info_vcap = { |
| 3406 | .bank_sel_mask = BIT(11), |
| 3407 | .bank0_mask = { |
| 3408 | .md_reg = VCAP_MD0_REG, |
| 3409 | .ns_mask = BM(21, 18) | BM(5, 3), |
| 3410 | .rst_mask = BIT(23), |
| 3411 | .mnd_en_mask = BIT(8), |
| 3412 | .mode_mask = BM(10, 9), |
| 3413 | }, |
| 3414 | .bank1_mask = { |
| 3415 | .md_reg = VCAP_MD1_REG, |
| 3416 | .ns_mask = BM(17, 14) | BM(2, 0), |
| 3417 | .rst_mask = BIT(22), |
| 3418 | .mnd_en_mask = BIT(5), |
| 3419 | .mode_mask = BM(7, 6), |
| 3420 | }, |
| 3421 | }; |
| 3422 | |
| 3423 | static struct rcg_clk vcap_clk = { |
| 3424 | .b = { |
| 3425 | .ctl_reg = VCAP_CC_REG, |
| 3426 | .en_mask = BIT(0), |
| 3427 | .halt_reg = DBG_BUS_VEC_J_REG, |
| 3428 | .halt_bit = 15, |
| 3429 | }, |
| 3430 | .ns_reg = VCAP_NS_REG, |
| 3431 | .root_en_mask = BIT(2), |
| 3432 | .set_rate = set_rate_mnd_banked, |
| 3433 | .freq_tbl = clk_tbl_vcap, |
| 3434 | .bank_info = &bmnd_info_vcap, |
| 3435 | .current_freq = &rcg_dummy_freq, |
| 3436 | .c = { |
| 3437 | .dbg_name = "vcap_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 3438 | .ops = &clk_ops_rcg, |
Tianyi Gou | 621f874 | 2011-09-01 21:45:01 -0700 | [diff] [blame] | 3439 | .depends = &vcap_axi_clk.c, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3440 | VDD_DIG_FMAX_MAP2(LOW, 100000000, NOMINAL, 200000000), |
Tianyi Gou | 621f874 | 2011-09-01 21:45:01 -0700 | [diff] [blame] | 3441 | CLK_INIT(vcap_clk.c), |
| 3442 | }, |
| 3443 | }; |
| 3444 | |
| 3445 | static struct branch_clk vcap_npl_clk = { |
| 3446 | .b = { |
| 3447 | .ctl_reg = VCAP_CC_REG, |
| 3448 | .en_mask = BIT(13), |
| 3449 | .halt_reg = DBG_BUS_VEC_J_REG, |
| 3450 | .halt_bit = 25, |
| 3451 | }, |
| 3452 | .parent = &vcap_clk.c, |
| 3453 | .c = { |
| 3454 | .dbg_name = "vcap_npl_clk", |
| 3455 | .ops = &clk_ops_branch, |
| 3456 | CLK_INIT(vcap_npl_clk.c), |
| 3457 | }, |
| 3458 | }; |
| 3459 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3460 | #define F_IJPEG(f, s, d, m, n) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3461 | { \ |
| 3462 | .freq_hz = f, \ |
| 3463 | .src_clk = &s##_clk.c, \ |
| 3464 | .md_val = MD8(8, m, 0, n), \ |
| 3465 | .ns_val = NS_MM(23, 16, n, m, 15, 12, d, 2, 0, s##_to_mm_mux), \ |
| 3466 | .ctl_val = CC(6, n), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3467 | } |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 3468 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3469 | static struct clk_freq_tbl clk_tbl_ijpeg[] = { |
| 3470 | F_IJPEG( 0, gnd, 1, 0, 0), |
| 3471 | F_IJPEG( 27000000, pxo, 1, 0, 0), |
| 3472 | F_IJPEG( 36570000, pll8, 1, 2, 21), |
| 3473 | F_IJPEG( 54860000, pll8, 7, 0, 0), |
| 3474 | F_IJPEG( 96000000, pll8, 4, 0, 0), |
| 3475 | F_IJPEG(109710000, pll8, 1, 2, 7), |
| 3476 | F_IJPEG(128000000, pll8, 3, 0, 0), |
| 3477 | F_IJPEG(153600000, pll8, 1, 2, 5), |
| 3478 | F_IJPEG(200000000, pll2, 4, 0, 0), |
| 3479 | F_IJPEG(228571000, pll2, 1, 2, 7), |
| 3480 | F_IJPEG(266667000, pll2, 1, 1, 3), |
| 3481 | F_IJPEG(320000000, pll2, 1, 2, 5), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3482 | F_END |
| 3483 | }; |
| 3484 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3485 | static unsigned long fmax_ijpeg_8064[MAX_VDD_LEVELS] __initdata = { |
| 3486 | [VDD_DIG_LOW] = 128000000, |
| 3487 | [VDD_DIG_NOMINAL] = 266667000, |
| 3488 | [VDD_DIG_HIGH] = 320000000 |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 3489 | }; |
| 3490 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3491 | static struct rcg_clk ijpeg_clk = { |
| 3492 | .b = { |
| 3493 | .ctl_reg = IJPEG_CC_REG, |
| 3494 | .en_mask = BIT(0), |
| 3495 | .reset_reg = SW_RESET_CORE_REG, |
| 3496 | .reset_mask = BIT(9), |
| 3497 | .halt_reg = DBG_BUS_VEC_A_REG, |
| 3498 | .halt_bit = 24, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 3499 | .retain_reg = IJPEG_CC_REG, |
| 3500 | .retain_mask = BIT(31), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3501 | }, |
| 3502 | .ns_reg = IJPEG_NS_REG, |
| 3503 | .md_reg = IJPEG_MD_REG, |
| 3504 | .root_en_mask = BIT(2), |
| 3505 | .ns_mask = (BM(23, 16) | BM(15, 12) | BM(2, 0)), |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame] | 3506 | .mnd_en_mask = BIT(5), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3507 | .ctl_mask = BM(7, 6), |
| 3508 | .set_rate = set_rate_mnd, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3509 | .freq_tbl = clk_tbl_ijpeg, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 3510 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3511 | .c = { |
| 3512 | .dbg_name = "ijpeg_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 3513 | .ops = &clk_ops_rcg, |
Tianyi Gou | 3022dfd | 2012-01-25 15:50:05 -0800 | [diff] [blame] | 3514 | VDD_DIG_FMAX_MAP3(LOW, 110000000, NOMINAL, 266667000, |
| 3515 | HIGH, 320000000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3516 | CLK_INIT(ijpeg_clk.c), |
Stephen Boyd | 7fa2674 | 2011-08-11 23:22:29 -0700 | [diff] [blame] | 3517 | .depends = &ijpeg_axi_clk.c, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3518 | }, |
| 3519 | }; |
| 3520 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3521 | #define F_JPEGD(f, s, d) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3522 | { \ |
| 3523 | .freq_hz = f, \ |
| 3524 | .src_clk = &s##_clk.c, \ |
| 3525 | .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] | 3526 | } |
| 3527 | static struct clk_freq_tbl clk_tbl_jpegd[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3528 | F_JPEGD( 0, gnd, 1), |
| 3529 | F_JPEGD( 64000000, pll8, 6), |
| 3530 | F_JPEGD( 76800000, pll8, 5), |
| 3531 | F_JPEGD( 96000000, pll8, 4), |
| 3532 | F_JPEGD(160000000, pll2, 5), |
| 3533 | F_JPEGD(200000000, pll2, 4), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3534 | F_END |
| 3535 | }; |
| 3536 | |
| 3537 | static struct rcg_clk jpegd_clk = { |
| 3538 | .b = { |
| 3539 | .ctl_reg = JPEGD_CC_REG, |
| 3540 | .en_mask = BIT(0), |
| 3541 | .reset_reg = SW_RESET_CORE_REG, |
| 3542 | .reset_mask = BIT(19), |
| 3543 | .halt_reg = DBG_BUS_VEC_A_REG, |
| 3544 | .halt_bit = 19, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 3545 | .retain_reg = JPEGD_CC_REG, |
| 3546 | .retain_mask = BIT(31), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3547 | }, |
| 3548 | .ns_reg = JPEGD_NS_REG, |
| 3549 | .root_en_mask = BIT(2), |
| 3550 | .ns_mask = (BM(15, 12) | BM(2, 0)), |
| 3551 | .set_rate = set_rate_nop, |
| 3552 | .freq_tbl = clk_tbl_jpegd, |
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 = "jpegd_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 3556 | .ops = &clk_ops_rcg, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3557 | VDD_DIG_FMAX_MAP2(LOW, 96000000, NOMINAL, 200000000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3558 | CLK_INIT(jpegd_clk.c), |
Stephen Boyd | 7fa2674 | 2011-08-11 23:22:29 -0700 | [diff] [blame] | 3559 | .depends = &jpegd_axi_clk.c, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3560 | }, |
| 3561 | }; |
| 3562 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3563 | #define F_MDP(f, s, m, n) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3564 | { \ |
| 3565 | .freq_hz = f, \ |
| 3566 | .src_clk = &s##_clk.c, \ |
| 3567 | .md_val = MD8(8, m, 0, n), \ |
| 3568 | .ns_val = NS_MND_BANKED8(22, 14, n, m, 3, 0, s##_to_mm_mux), \ |
| 3569 | .ctl_val = CC_BANKED(9, 6, n), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3570 | } |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3571 | static struct clk_freq_tbl clk_tbl_mdp[] = { |
| 3572 | F_MDP( 0, gnd, 0, 0), |
| 3573 | F_MDP( 9600000, pll8, 1, 40), |
| 3574 | F_MDP( 13710000, pll8, 1, 28), |
| 3575 | F_MDP( 27000000, pxo, 0, 0), |
| 3576 | F_MDP( 29540000, pll8, 1, 13), |
| 3577 | F_MDP( 34910000, pll8, 1, 11), |
| 3578 | F_MDP( 38400000, pll8, 1, 10), |
| 3579 | F_MDP( 59080000, pll8, 2, 13), |
| 3580 | F_MDP( 76800000, pll8, 1, 5), |
| 3581 | F_MDP( 85330000, pll8, 2, 9), |
| 3582 | F_MDP( 96000000, pll8, 1, 4), |
| 3583 | F_MDP(128000000, pll8, 1, 3), |
| 3584 | F_MDP(160000000, pll2, 1, 5), |
| 3585 | F_MDP(177780000, pll2, 2, 9), |
| 3586 | F_MDP(200000000, pll2, 1, 4), |
| 3587 | F_MDP(266667000, pll2, 1, 3), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3588 | F_END |
| 3589 | }; |
| 3590 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3591 | static unsigned long fmax_mdp_8064[MAX_VDD_LEVELS] __initdata = { |
| 3592 | [VDD_DIG_LOW] = 128000000, |
| 3593 | [VDD_DIG_NOMINAL] = 266667000 |
Tianyi Gou | 621f874 | 2011-09-01 21:45:01 -0700 | [diff] [blame] | 3594 | }; |
| 3595 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3596 | static struct bank_masks bmnd_info_mdp = { |
| 3597 | .bank_sel_mask = BIT(11), |
| 3598 | .bank0_mask = { |
| 3599 | .md_reg = MDP_MD0_REG, |
| 3600 | .ns_mask = BM(29, 22) | BM(5, 3), |
| 3601 | .rst_mask = BIT(31), |
| 3602 | .mnd_en_mask = BIT(8), |
| 3603 | .mode_mask = BM(10, 9), |
| 3604 | }, |
| 3605 | .bank1_mask = { |
| 3606 | .md_reg = MDP_MD1_REG, |
| 3607 | .ns_mask = BM(21, 14) | BM(2, 0), |
| 3608 | .rst_mask = BIT(30), |
| 3609 | .mnd_en_mask = BIT(5), |
| 3610 | .mode_mask = BM(7, 6), |
| 3611 | }, |
| 3612 | }; |
| 3613 | |
| 3614 | static struct rcg_clk mdp_clk = { |
| 3615 | .b = { |
| 3616 | .ctl_reg = MDP_CC_REG, |
| 3617 | .en_mask = BIT(0), |
| 3618 | .reset_reg = SW_RESET_CORE_REG, |
| 3619 | .reset_mask = BIT(21), |
| 3620 | .halt_reg = DBG_BUS_VEC_C_REG, |
| 3621 | .halt_bit = 10, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 3622 | .retain_reg = MDP_CC_REG, |
| 3623 | .retain_mask = BIT(31), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3624 | }, |
| 3625 | .ns_reg = MDP_NS_REG, |
| 3626 | .root_en_mask = BIT(2), |
| 3627 | .set_rate = set_rate_mnd_banked, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3628 | .freq_tbl = clk_tbl_mdp, |
Stephen Boyd | c78d9a7 | 2011-07-20 00:46:24 -0700 | [diff] [blame] | 3629 | .bank_info = &bmnd_info_mdp, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 3630 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3631 | .c = { |
| 3632 | .dbg_name = "mdp_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 3633 | .ops = &clk_ops_rcg, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3634 | VDD_DIG_FMAX_MAP2(LOW, 96000000, NOMINAL, 200000000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3635 | CLK_INIT(mdp_clk.c), |
Stephen Boyd | 7fa2674 | 2011-08-11 23:22:29 -0700 | [diff] [blame] | 3636 | .depends = &mdp_axi_clk.c, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3637 | }, |
| 3638 | }; |
| 3639 | |
| 3640 | static struct branch_clk lut_mdp_clk = { |
| 3641 | .b = { |
| 3642 | .ctl_reg = MDP_LUT_CC_REG, |
| 3643 | .en_mask = BIT(0), |
| 3644 | .halt_reg = DBG_BUS_VEC_I_REG, |
| 3645 | .halt_bit = 13, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 3646 | .retain_reg = MDP_LUT_CC_REG, |
| 3647 | .retain_mask = BIT(31), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3648 | }, |
| 3649 | .parent = &mdp_clk.c, |
| 3650 | .c = { |
| 3651 | .dbg_name = "lut_mdp_clk", |
| 3652 | .ops = &clk_ops_branch, |
| 3653 | CLK_INIT(lut_mdp_clk.c), |
| 3654 | }, |
| 3655 | }; |
| 3656 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3657 | #define F_MDP_VSYNC(f, s) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3658 | { \ |
| 3659 | .freq_hz = f, \ |
| 3660 | .src_clk = &s##_clk.c, \ |
| 3661 | .ns_val = NS_SRC_SEL(13, 13, s##_to_bb_mux), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3662 | } |
| 3663 | static struct clk_freq_tbl clk_tbl_mdp_vsync[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3664 | F_MDP_VSYNC(27000000, pxo), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3665 | F_END |
| 3666 | }; |
| 3667 | |
| 3668 | static struct rcg_clk mdp_vsync_clk = { |
| 3669 | .b = { |
| 3670 | .ctl_reg = MISC_CC_REG, |
| 3671 | .en_mask = BIT(6), |
| 3672 | .reset_reg = SW_RESET_CORE_REG, |
| 3673 | .reset_mask = BIT(3), |
| 3674 | .halt_reg = DBG_BUS_VEC_B_REG, |
| 3675 | .halt_bit = 22, |
| 3676 | }, |
| 3677 | .ns_reg = MISC_CC2_REG, |
| 3678 | .ns_mask = BIT(13), |
| 3679 | .set_rate = set_rate_nop, |
| 3680 | .freq_tbl = clk_tbl_mdp_vsync, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 3681 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3682 | .c = { |
| 3683 | .dbg_name = "mdp_vsync_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 3684 | .ops = &clk_ops_rcg, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3685 | VDD_DIG_FMAX_MAP1(LOW, 27000000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3686 | CLK_INIT(mdp_vsync_clk.c), |
| 3687 | }, |
| 3688 | }; |
| 3689 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3690 | #define F_ROT(f, s, d) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3691 | { \ |
| 3692 | .freq_hz = f, \ |
| 3693 | .src_clk = &s##_clk.c, \ |
| 3694 | .ns_val = NS_DIVSRC_BANKED(29, 26, 25, 22, d, \ |
| 3695 | 21, 19, 18, 16, s##_to_mm_mux), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3696 | } |
| 3697 | static struct clk_freq_tbl clk_tbl_rot[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3698 | F_ROT( 0, gnd, 1), |
| 3699 | F_ROT( 27000000, pxo, 1), |
| 3700 | F_ROT( 29540000, pll8, 13), |
| 3701 | F_ROT( 32000000, pll8, 12), |
| 3702 | F_ROT( 38400000, pll8, 10), |
| 3703 | F_ROT( 48000000, pll8, 8), |
| 3704 | F_ROT( 54860000, pll8, 7), |
| 3705 | F_ROT( 64000000, pll8, 6), |
| 3706 | F_ROT( 76800000, pll8, 5), |
| 3707 | F_ROT( 96000000, pll8, 4), |
| 3708 | F_ROT(100000000, pll2, 8), |
| 3709 | F_ROT(114290000, pll2, 7), |
| 3710 | F_ROT(133330000, pll2, 6), |
| 3711 | F_ROT(160000000, pll2, 5), |
| 3712 | F_ROT(200000000, pll2, 4), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3713 | F_END |
| 3714 | }; |
| 3715 | |
| 3716 | static struct bank_masks bdiv_info_rot = { |
| 3717 | .bank_sel_mask = BIT(30), |
| 3718 | .bank0_mask = { |
| 3719 | .ns_mask = BM(25, 22) | BM(18, 16), |
| 3720 | }, |
| 3721 | .bank1_mask = { |
| 3722 | .ns_mask = BM(29, 26) | BM(21, 19), |
| 3723 | }, |
| 3724 | }; |
| 3725 | |
| 3726 | static struct rcg_clk rot_clk = { |
| 3727 | .b = { |
| 3728 | .ctl_reg = ROT_CC_REG, |
| 3729 | .en_mask = BIT(0), |
| 3730 | .reset_reg = SW_RESET_CORE_REG, |
| 3731 | .reset_mask = BIT(2), |
| 3732 | .halt_reg = DBG_BUS_VEC_C_REG, |
| 3733 | .halt_bit = 15, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 3734 | .retain_reg = ROT_CC_REG, |
| 3735 | .retain_mask = BIT(31), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3736 | }, |
| 3737 | .ns_reg = ROT_NS_REG, |
| 3738 | .root_en_mask = BIT(2), |
| 3739 | .set_rate = set_rate_div_banked, |
| 3740 | .freq_tbl = clk_tbl_rot, |
Stephen Boyd | c78d9a7 | 2011-07-20 00:46:24 -0700 | [diff] [blame] | 3741 | .bank_info = &bdiv_info_rot, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 3742 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3743 | .c = { |
| 3744 | .dbg_name = "rot_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 3745 | .ops = &clk_ops_rcg, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3746 | VDD_DIG_FMAX_MAP2(LOW, 96000000, NOMINAL, 200000000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3747 | CLK_INIT(rot_clk.c), |
Stephen Boyd | 7fa2674 | 2011-08-11 23:22:29 -0700 | [diff] [blame] | 3748 | .depends = &rot_axi_clk.c, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3749 | }, |
| 3750 | }; |
| 3751 | |
| 3752 | static int hdmi_pll_clk_enable(struct clk *clk) |
| 3753 | { |
| 3754 | int ret; |
| 3755 | unsigned long flags; |
| 3756 | spin_lock_irqsave(&local_clock_reg_lock, flags); |
| 3757 | ret = hdmi_pll_enable(); |
| 3758 | spin_unlock_irqrestore(&local_clock_reg_lock, flags); |
| 3759 | return ret; |
| 3760 | } |
| 3761 | |
| 3762 | static void hdmi_pll_clk_disable(struct clk *clk) |
| 3763 | { |
| 3764 | unsigned long flags; |
| 3765 | spin_lock_irqsave(&local_clock_reg_lock, flags); |
| 3766 | hdmi_pll_disable(); |
| 3767 | spin_unlock_irqrestore(&local_clock_reg_lock, flags); |
| 3768 | } |
| 3769 | |
Matt Wagantall | 9de3bfb | 2011-11-03 20:13:12 -0700 | [diff] [blame] | 3770 | static unsigned long hdmi_pll_clk_get_rate(struct clk *clk) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3771 | { |
| 3772 | return hdmi_pll_get_rate(); |
| 3773 | } |
| 3774 | |
Stephen Boyd | 5b35dee | 2011-09-21 12:17:38 -0700 | [diff] [blame] | 3775 | static struct clk *hdmi_pll_clk_get_parent(struct clk *clk) |
| 3776 | { |
| 3777 | return &pxo_clk.c; |
| 3778 | } |
| 3779 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3780 | static struct clk_ops clk_ops_hdmi_pll = { |
| 3781 | .enable = hdmi_pll_clk_enable, |
| 3782 | .disable = hdmi_pll_clk_disable, |
| 3783 | .get_rate = hdmi_pll_clk_get_rate, |
Stephen Boyd | 5b35dee | 2011-09-21 12:17:38 -0700 | [diff] [blame] | 3784 | .get_parent = hdmi_pll_clk_get_parent, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3785 | }; |
| 3786 | |
| 3787 | static struct clk hdmi_pll_clk = { |
| 3788 | .dbg_name = "hdmi_pll_clk", |
| 3789 | .ops = &clk_ops_hdmi_pll, |
| 3790 | CLK_INIT(hdmi_pll_clk), |
| 3791 | }; |
| 3792 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3793 | #define F_TV_GND(f, s, p_r, d, m, n) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3794 | { \ |
| 3795 | .freq_hz = f, \ |
| 3796 | .src_clk = &s##_clk.c, \ |
| 3797 | .md_val = MD8(8, m, 0, n), \ |
| 3798 | .ns_val = NS_MM(23, 16, n, m, 15, 14, d, 2, 0, s##_to_mm_mux), \ |
| 3799 | .ctl_val = CC(6, n), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3800 | } |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3801 | #define F_TV(f, s, p_r, d, m, n) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3802 | { \ |
| 3803 | .freq_hz = f, \ |
| 3804 | .src_clk = &s##_clk, \ |
| 3805 | .md_val = MD8(8, m, 0, n), \ |
| 3806 | .ns_val = NS_MM(23, 16, n, m, 15, 14, d, 2, 0, s##_to_mm_mux), \ |
| 3807 | .ctl_val = CC(6, n), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3808 | .extra_freq_data = (void *)p_r, \ |
| 3809 | } |
| 3810 | /* Switching TV freqs requires PLL reconfiguration. */ |
| 3811 | static struct clk_freq_tbl clk_tbl_tv[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3812 | F_TV_GND( 0, gnd, 0, 1, 0, 0), |
| 3813 | F_TV( 25200000, hdmi_pll, 25200000, 1, 0, 0), |
| 3814 | F_TV( 27000000, hdmi_pll, 27000000, 1, 0, 0), |
| 3815 | F_TV( 27030000, hdmi_pll, 27030000, 1, 0, 0), |
| 3816 | F_TV( 74250000, hdmi_pll, 74250000, 1, 0, 0), |
| 3817 | F_TV(148500000, hdmi_pll, 148500000, 1, 0, 0), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3818 | F_END |
| 3819 | }; |
| 3820 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3821 | static unsigned long fmax_tv_src_8064[MAX_VDD_LEVELS] __initdata = { |
| 3822 | [VDD_DIG_LOW] = 74250000, |
| 3823 | [VDD_DIG_NOMINAL] = 149000000 |
| 3824 | }; |
| 3825 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3826 | /* |
| 3827 | * Unlike other clocks, the TV rate is adjusted through PLL |
| 3828 | * re-programming. It is also routed through an MND divider. |
| 3829 | */ |
| 3830 | void set_rate_tv(struct rcg_clk *clk, struct clk_freq_tbl *nf) |
| 3831 | { |
| 3832 | unsigned long pll_rate = (unsigned long)nf->extra_freq_data; |
| 3833 | if (pll_rate) |
| 3834 | hdmi_pll_set_rate(pll_rate); |
| 3835 | set_rate_mnd(clk, nf); |
| 3836 | } |
| 3837 | |
| 3838 | static struct rcg_clk tv_src_clk = { |
| 3839 | .ns_reg = TV_NS_REG, |
| 3840 | .b = { |
| 3841 | .ctl_reg = TV_CC_REG, |
| 3842 | .halt_check = NOCHECK, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 3843 | .retain_reg = TV_CC_REG, |
| 3844 | .retain_mask = BIT(31), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3845 | }, |
| 3846 | .md_reg = TV_MD_REG, |
| 3847 | .root_en_mask = BIT(2), |
| 3848 | .ns_mask = (BM(23, 16) | BM(15, 14) | BM(2, 0)), |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame] | 3849 | .mnd_en_mask = BIT(5), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3850 | .ctl_mask = BM(7, 6), |
| 3851 | .set_rate = set_rate_tv, |
| 3852 | .freq_tbl = clk_tbl_tv, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 3853 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3854 | .c = { |
| 3855 | .dbg_name = "tv_src_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 3856 | .ops = &clk_ops_rcg, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3857 | VDD_DIG_FMAX_MAP2(LOW, 27030000, NOMINAL, 149000000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3858 | CLK_INIT(tv_src_clk.c), |
| 3859 | }, |
| 3860 | }; |
| 3861 | |
Tianyi Gou | 5191880 | 2012-01-26 14:05:43 -0800 | [diff] [blame] | 3862 | static struct cdiv_clk tv_src_div_clk = { |
| 3863 | .b = { |
| 3864 | .ctl_reg = TV_NS_REG, |
| 3865 | .halt_check = NOCHECK, |
| 3866 | }, |
| 3867 | .ns_reg = TV_NS_REG, |
| 3868 | .div_offset = 6, |
| 3869 | .max_div = 2, |
| 3870 | .c = { |
| 3871 | .dbg_name = "tv_src_div_clk", |
| 3872 | .ops = &clk_ops_cdiv, |
| 3873 | CLK_INIT(tv_src_div_clk.c), |
| 3874 | }, |
| 3875 | }; |
| 3876 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3877 | static struct branch_clk tv_enc_clk = { |
| 3878 | .b = { |
| 3879 | .ctl_reg = TV_CC_REG, |
| 3880 | .en_mask = BIT(8), |
| 3881 | .reset_reg = SW_RESET_CORE_REG, |
| 3882 | .reset_mask = BIT(0), |
| 3883 | .halt_reg = DBG_BUS_VEC_D_REG, |
| 3884 | .halt_bit = 9, |
| 3885 | }, |
| 3886 | .parent = &tv_src_clk.c, |
| 3887 | .c = { |
| 3888 | .dbg_name = "tv_enc_clk", |
| 3889 | .ops = &clk_ops_branch, |
| 3890 | CLK_INIT(tv_enc_clk.c), |
| 3891 | }, |
| 3892 | }; |
| 3893 | |
| 3894 | static struct branch_clk tv_dac_clk = { |
| 3895 | .b = { |
| 3896 | .ctl_reg = TV_CC_REG, |
| 3897 | .en_mask = BIT(10), |
| 3898 | .halt_reg = DBG_BUS_VEC_D_REG, |
| 3899 | .halt_bit = 10, |
| 3900 | }, |
| 3901 | .parent = &tv_src_clk.c, |
| 3902 | .c = { |
| 3903 | .dbg_name = "tv_dac_clk", |
| 3904 | .ops = &clk_ops_branch, |
| 3905 | CLK_INIT(tv_dac_clk.c), |
| 3906 | }, |
| 3907 | }; |
| 3908 | |
| 3909 | static struct branch_clk mdp_tv_clk = { |
| 3910 | .b = { |
| 3911 | .ctl_reg = TV_CC_REG, |
| 3912 | .en_mask = BIT(0), |
| 3913 | .reset_reg = SW_RESET_CORE_REG, |
| 3914 | .reset_mask = BIT(4), |
| 3915 | .halt_reg = DBG_BUS_VEC_D_REG, |
| 3916 | .halt_bit = 12, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 3917 | .retain_reg = TV_CC2_REG, |
| 3918 | .retain_mask = BIT(10), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3919 | }, |
| 3920 | .parent = &tv_src_clk.c, |
| 3921 | .c = { |
| 3922 | .dbg_name = "mdp_tv_clk", |
| 3923 | .ops = &clk_ops_branch, |
| 3924 | CLK_INIT(mdp_tv_clk.c), |
| 3925 | }, |
| 3926 | }; |
| 3927 | |
| 3928 | static struct branch_clk hdmi_tv_clk = { |
| 3929 | .b = { |
| 3930 | .ctl_reg = TV_CC_REG, |
| 3931 | .en_mask = BIT(12), |
| 3932 | .reset_reg = SW_RESET_CORE_REG, |
| 3933 | .reset_mask = BIT(1), |
| 3934 | .halt_reg = DBG_BUS_VEC_D_REG, |
| 3935 | .halt_bit = 11, |
| 3936 | }, |
| 3937 | .parent = &tv_src_clk.c, |
| 3938 | .c = { |
| 3939 | .dbg_name = "hdmi_tv_clk", |
| 3940 | .ops = &clk_ops_branch, |
| 3941 | CLK_INIT(hdmi_tv_clk.c), |
| 3942 | }, |
| 3943 | }; |
| 3944 | |
Tianyi Gou | 5191880 | 2012-01-26 14:05:43 -0800 | [diff] [blame] | 3945 | static struct branch_clk rgb_tv_clk = { |
| 3946 | .b = { |
| 3947 | .ctl_reg = TV_CC2_REG, |
| 3948 | .en_mask = BIT(14), |
| 3949 | .halt_reg = DBG_BUS_VEC_J_REG, |
| 3950 | .halt_bit = 27, |
| 3951 | }, |
| 3952 | .parent = &tv_src_clk.c, |
| 3953 | .c = { |
| 3954 | .dbg_name = "rgb_tv_clk", |
| 3955 | .ops = &clk_ops_branch, |
| 3956 | CLK_INIT(rgb_tv_clk.c), |
| 3957 | }, |
| 3958 | }; |
| 3959 | |
| 3960 | static struct branch_clk npl_tv_clk = { |
| 3961 | .b = { |
| 3962 | .ctl_reg = TV_CC2_REG, |
| 3963 | .en_mask = BIT(16), |
| 3964 | .halt_reg = DBG_BUS_VEC_J_REG, |
| 3965 | .halt_bit = 26, |
| 3966 | }, |
| 3967 | .parent = &tv_src_clk.c, |
| 3968 | .c = { |
| 3969 | .dbg_name = "npl_tv_clk", |
| 3970 | .ops = &clk_ops_branch, |
| 3971 | CLK_INIT(npl_tv_clk.c), |
| 3972 | }, |
| 3973 | }; |
| 3974 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3975 | static struct branch_clk hdmi_app_clk = { |
| 3976 | .b = { |
| 3977 | .ctl_reg = MISC_CC2_REG, |
| 3978 | .en_mask = BIT(11), |
| 3979 | .reset_reg = SW_RESET_CORE_REG, |
| 3980 | .reset_mask = BIT(11), |
| 3981 | .halt_reg = DBG_BUS_VEC_B_REG, |
| 3982 | .halt_bit = 25, |
| 3983 | }, |
| 3984 | .c = { |
| 3985 | .dbg_name = "hdmi_app_clk", |
| 3986 | .ops = &clk_ops_branch, |
| 3987 | CLK_INIT(hdmi_app_clk.c), |
| 3988 | }, |
| 3989 | }; |
| 3990 | |
| 3991 | static struct bank_masks bmnd_info_vcodec = { |
| 3992 | .bank_sel_mask = BIT(13), |
| 3993 | .bank0_mask = { |
| 3994 | .md_reg = VCODEC_MD0_REG, |
| 3995 | .ns_mask = BM(18, 11) | BM(2, 0), |
| 3996 | .rst_mask = BIT(31), |
| 3997 | .mnd_en_mask = BIT(5), |
| 3998 | .mode_mask = BM(7, 6), |
| 3999 | }, |
| 4000 | .bank1_mask = { |
| 4001 | .md_reg = VCODEC_MD1_REG, |
| 4002 | .ns_mask = BM(26, 19) | BM(29, 27), |
| 4003 | .rst_mask = BIT(30), |
| 4004 | .mnd_en_mask = BIT(10), |
| 4005 | .mode_mask = BM(12, 11), |
| 4006 | }, |
| 4007 | }; |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 4008 | #define F_VCODEC(f, s, m, n) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4009 | { \ |
| 4010 | .freq_hz = f, \ |
| 4011 | .src_clk = &s##_clk.c, \ |
| 4012 | .md_val = MD8(8, m, 0, n), \ |
| 4013 | .ns_val = NS_MND_BANKED8(11, 19, n, m, 0, 27, s##_to_mm_mux), \ |
| 4014 | .ctl_val = CC_BANKED(6, 11, n), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4015 | } |
| 4016 | static struct clk_freq_tbl clk_tbl_vcodec[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 4017 | F_VCODEC( 0, gnd, 0, 0), |
| 4018 | F_VCODEC( 27000000, pxo, 0, 0), |
| 4019 | F_VCODEC( 32000000, pll8, 1, 12), |
| 4020 | F_VCODEC( 48000000, pll8, 1, 8), |
| 4021 | F_VCODEC( 54860000, pll8, 1, 7), |
| 4022 | F_VCODEC( 96000000, pll8, 1, 4), |
| 4023 | F_VCODEC(133330000, pll2, 1, 6), |
| 4024 | F_VCODEC(200000000, pll2, 1, 4), |
| 4025 | F_VCODEC(228570000, pll2, 2, 7), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4026 | F_END |
| 4027 | }; |
| 4028 | |
| 4029 | static struct rcg_clk vcodec_clk = { |
| 4030 | .b = { |
| 4031 | .ctl_reg = VCODEC_CC_REG, |
| 4032 | .en_mask = BIT(0), |
| 4033 | .reset_reg = SW_RESET_CORE_REG, |
| 4034 | .reset_mask = BIT(6), |
| 4035 | .halt_reg = DBG_BUS_VEC_C_REG, |
| 4036 | .halt_bit = 29, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 4037 | .retain_reg = VCODEC_CC_REG, |
| 4038 | .retain_mask = BIT(31), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4039 | }, |
| 4040 | .ns_reg = VCODEC_NS_REG, |
| 4041 | .root_en_mask = BIT(2), |
| 4042 | .set_rate = set_rate_mnd_banked, |
Stephen Boyd | c78d9a7 | 2011-07-20 00:46:24 -0700 | [diff] [blame] | 4043 | .bank_info = &bmnd_info_vcodec, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4044 | .freq_tbl = clk_tbl_vcodec, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 4045 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4046 | .c = { |
| 4047 | .dbg_name = "vcodec_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 4048 | .ops = &clk_ops_rcg, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 4049 | VDD_DIG_FMAX_MAP3(LOW, 100000000, NOMINAL, 200000000, |
| 4050 | HIGH, 228571000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4051 | CLK_INIT(vcodec_clk.c), |
Stephen Boyd | 7fa2674 | 2011-08-11 23:22:29 -0700 | [diff] [blame] | 4052 | .depends = &vcodec_axi_clk.c, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4053 | }, |
| 4054 | }; |
| 4055 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 4056 | #define F_VPE(f, s, d) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4057 | { \ |
| 4058 | .freq_hz = f, \ |
| 4059 | .src_clk = &s##_clk.c, \ |
| 4060 | .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] | 4061 | } |
| 4062 | static struct clk_freq_tbl clk_tbl_vpe[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 4063 | F_VPE( 0, gnd, 1), |
| 4064 | F_VPE( 27000000, pxo, 1), |
| 4065 | F_VPE( 34909000, pll8, 11), |
| 4066 | F_VPE( 38400000, pll8, 10), |
| 4067 | F_VPE( 64000000, pll8, 6), |
| 4068 | F_VPE( 76800000, pll8, 5), |
| 4069 | F_VPE( 96000000, pll8, 4), |
| 4070 | F_VPE(100000000, pll2, 8), |
| 4071 | F_VPE(160000000, pll2, 5), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4072 | F_END |
| 4073 | }; |
| 4074 | |
| 4075 | static struct rcg_clk vpe_clk = { |
| 4076 | .b = { |
| 4077 | .ctl_reg = VPE_CC_REG, |
| 4078 | .en_mask = BIT(0), |
| 4079 | .reset_reg = SW_RESET_CORE_REG, |
| 4080 | .reset_mask = BIT(17), |
| 4081 | .halt_reg = DBG_BUS_VEC_A_REG, |
| 4082 | .halt_bit = 28, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 4083 | .retain_reg = VPE_CC_REG, |
| 4084 | .retain_mask = BIT(31), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4085 | }, |
| 4086 | .ns_reg = VPE_NS_REG, |
| 4087 | .root_en_mask = BIT(2), |
| 4088 | .ns_mask = (BM(15, 12) | BM(2, 0)), |
| 4089 | .set_rate = set_rate_nop, |
| 4090 | .freq_tbl = clk_tbl_vpe, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 4091 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4092 | .c = { |
| 4093 | .dbg_name = "vpe_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 4094 | .ops = &clk_ops_rcg, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 4095 | VDD_DIG_FMAX_MAP2(LOW, 76800000, NOMINAL, 160000000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4096 | CLK_INIT(vpe_clk.c), |
Stephen Boyd | 7fa2674 | 2011-08-11 23:22:29 -0700 | [diff] [blame] | 4097 | .depends = &vpe_axi_clk.c, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4098 | }, |
| 4099 | }; |
| 4100 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 4101 | #define F_VFE(f, s, d, m, n) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4102 | { \ |
| 4103 | .freq_hz = f, \ |
| 4104 | .src_clk = &s##_clk.c, \ |
| 4105 | .md_val = MD8(8, m, 0, n), \ |
| 4106 | .ns_val = NS_MM(23, 16, n, m, 11, 10, d, 2, 0, s##_to_mm_mux), \ |
| 4107 | .ctl_val = CC(6, n), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4108 | } |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 4109 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 4110 | static struct clk_freq_tbl clk_tbl_vfe[] = { |
| 4111 | F_VFE( 0, gnd, 1, 0, 0), |
| 4112 | F_VFE( 13960000, pll8, 1, 2, 55), |
| 4113 | F_VFE( 27000000, pxo, 1, 0, 0), |
| 4114 | F_VFE( 36570000, pll8, 1, 2, 21), |
| 4115 | F_VFE( 38400000, pll8, 2, 1, 5), |
| 4116 | F_VFE( 45180000, pll8, 1, 2, 17), |
| 4117 | F_VFE( 48000000, pll8, 2, 1, 4), |
| 4118 | F_VFE( 54860000, pll8, 1, 1, 7), |
| 4119 | F_VFE( 64000000, pll8, 2, 1, 3), |
| 4120 | F_VFE( 76800000, pll8, 1, 1, 5), |
| 4121 | F_VFE( 96000000, pll8, 2, 1, 2), |
| 4122 | F_VFE(109710000, pll8, 1, 2, 7), |
| 4123 | F_VFE(128000000, pll8, 1, 1, 3), |
| 4124 | F_VFE(153600000, pll8, 1, 2, 5), |
| 4125 | F_VFE(200000000, pll2, 2, 1, 2), |
| 4126 | F_VFE(228570000, pll2, 1, 2, 7), |
| 4127 | F_VFE(266667000, pll2, 1, 1, 3), |
| 4128 | F_VFE(320000000, pll2, 1, 2, 5), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4129 | F_END |
| 4130 | }; |
| 4131 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 4132 | static unsigned long fmax_vfe_8064[MAX_VDD_LEVELS] __initdata = { |
| 4133 | [VDD_DIG_LOW] = 128000000, |
| 4134 | [VDD_DIG_NOMINAL] = 266667000, |
| 4135 | [VDD_DIG_HIGH] = 320000000 |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 4136 | }; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4137 | |
| 4138 | static struct rcg_clk vfe_clk = { |
| 4139 | .b = { |
| 4140 | .ctl_reg = VFE_CC_REG, |
| 4141 | .reset_reg = SW_RESET_CORE_REG, |
| 4142 | .reset_mask = BIT(15), |
| 4143 | .halt_reg = DBG_BUS_VEC_B_REG, |
| 4144 | .halt_bit = 6, |
| 4145 | .en_mask = BIT(0), |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 4146 | .retain_reg = VFE_CC2_REG, |
| 4147 | .retain_mask = BIT(31), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4148 | }, |
| 4149 | .ns_reg = VFE_NS_REG, |
| 4150 | .md_reg = VFE_MD_REG, |
| 4151 | .root_en_mask = BIT(2), |
| 4152 | .ns_mask = (BM(23, 16) | BM(11, 10) | BM(2, 0)), |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame] | 4153 | .mnd_en_mask = BIT(5), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4154 | .ctl_mask = BM(7, 6), |
| 4155 | .set_rate = set_rate_mnd, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 4156 | .freq_tbl = clk_tbl_vfe, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 4157 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4158 | .c = { |
| 4159 | .dbg_name = "vfe_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 4160 | .ops = &clk_ops_rcg, |
Tianyi Gou | 3022dfd | 2012-01-25 15:50:05 -0800 | [diff] [blame] | 4161 | VDD_DIG_FMAX_MAP3(LOW, 110000000, NOMINAL, 266667000, |
| 4162 | HIGH, 320000000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4163 | CLK_INIT(vfe_clk.c), |
Stephen Boyd | 7fa2674 | 2011-08-11 23:22:29 -0700 | [diff] [blame] | 4164 | .depends = &vfe_axi_clk.c, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4165 | }, |
| 4166 | }; |
| 4167 | |
Matt Wagantall | c23eee9 | 2011-08-16 23:06:52 -0700 | [diff] [blame] | 4168 | static struct branch_clk csi_vfe_clk = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4169 | .b = { |
| 4170 | .ctl_reg = VFE_CC_REG, |
| 4171 | .en_mask = BIT(12), |
| 4172 | .reset_reg = SW_RESET_CORE_REG, |
| 4173 | .reset_mask = BIT(24), |
| 4174 | .halt_reg = DBG_BUS_VEC_B_REG, |
| 4175 | .halt_bit = 8, |
| 4176 | }, |
| 4177 | .parent = &vfe_clk.c, |
| 4178 | .c = { |
Matt Wagantall | c23eee9 | 2011-08-16 23:06:52 -0700 | [diff] [blame] | 4179 | .dbg_name = "csi_vfe_clk", |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4180 | .ops = &clk_ops_branch, |
Matt Wagantall | c23eee9 | 2011-08-16 23:06:52 -0700 | [diff] [blame] | 4181 | CLK_INIT(csi_vfe_clk.c), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4182 | }, |
| 4183 | }; |
| 4184 | |
| 4185 | /* |
| 4186 | * Low Power Audio Clocks |
| 4187 | */ |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 4188 | #define F_AIF_OSR(f, s, d, m, n) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4189 | { \ |
| 4190 | .freq_hz = f, \ |
| 4191 | .src_clk = &s##_clk.c, \ |
| 4192 | .md_val = MD8(8, m, 0, n), \ |
| 4193 | .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] | 4194 | } |
| 4195 | static struct clk_freq_tbl clk_tbl_aif_osr[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 4196 | F_AIF_OSR( 0, gnd, 1, 0, 0), |
| 4197 | F_AIF_OSR( 512000, pll4, 4, 1, 192), |
| 4198 | F_AIF_OSR( 768000, pll4, 4, 1, 128), |
| 4199 | F_AIF_OSR( 1024000, pll4, 4, 1, 96), |
| 4200 | F_AIF_OSR( 1536000, pll4, 4, 1, 64), |
| 4201 | F_AIF_OSR( 2048000, pll4, 4, 1, 48), |
| 4202 | F_AIF_OSR( 3072000, pll4, 4, 1, 32), |
| 4203 | F_AIF_OSR( 4096000, pll4, 4, 1, 24), |
| 4204 | F_AIF_OSR( 6144000, pll4, 4, 1, 16), |
| 4205 | F_AIF_OSR( 8192000, pll4, 4, 1, 12), |
| 4206 | F_AIF_OSR(12288000, pll4, 4, 1, 8), |
| 4207 | F_AIF_OSR(24576000, pll4, 4, 1, 4), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4208 | F_END |
| 4209 | }; |
| 4210 | |
| 4211 | #define CLK_AIF_OSR(i, ns, md, h_r) \ |
| 4212 | struct rcg_clk i##_clk = { \ |
| 4213 | .b = { \ |
| 4214 | .ctl_reg = ns, \ |
| 4215 | .en_mask = BIT(17), \ |
| 4216 | .reset_reg = ns, \ |
| 4217 | .reset_mask = BIT(19), \ |
| 4218 | .halt_reg = h_r, \ |
| 4219 | .halt_check = ENABLE, \ |
| 4220 | .halt_bit = 1, \ |
| 4221 | }, \ |
| 4222 | .ns_reg = ns, \ |
| 4223 | .md_reg = md, \ |
| 4224 | .root_en_mask = BIT(9), \ |
| 4225 | .ns_mask = (BM(31, 24) | BM(6, 0)), \ |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame] | 4226 | .mnd_en_mask = BIT(8), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4227 | .set_rate = set_rate_mnd, \ |
| 4228 | .freq_tbl = clk_tbl_aif_osr, \ |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 4229 | .current_freq = &rcg_dummy_freq, \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4230 | .c = { \ |
| 4231 | .dbg_name = #i "_clk", \ |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 4232 | .ops = &clk_ops_rcg, \ |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 4233 | VDD_DIG_FMAX_MAP1(LOW, 24576000), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4234 | CLK_INIT(i##_clk.c), \ |
| 4235 | }, \ |
| 4236 | } |
| 4237 | #define CLK_AIF_OSR_DIV(i, ns, md, h_r) \ |
| 4238 | struct rcg_clk i##_clk = { \ |
| 4239 | .b = { \ |
| 4240 | .ctl_reg = ns, \ |
| 4241 | .en_mask = BIT(21), \ |
| 4242 | .reset_reg = ns, \ |
| 4243 | .reset_mask = BIT(23), \ |
| 4244 | .halt_reg = h_r, \ |
| 4245 | .halt_check = ENABLE, \ |
| 4246 | .halt_bit = 1, \ |
| 4247 | }, \ |
| 4248 | .ns_reg = ns, \ |
| 4249 | .md_reg = md, \ |
| 4250 | .root_en_mask = BIT(9), \ |
| 4251 | .ns_mask = (BM(31, 24) | BM(6, 0)), \ |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame] | 4252 | .mnd_en_mask = BIT(8), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4253 | .set_rate = set_rate_mnd, \ |
| 4254 | .freq_tbl = clk_tbl_aif_osr, \ |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 4255 | .current_freq = &rcg_dummy_freq, \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4256 | .c = { \ |
| 4257 | .dbg_name = #i "_clk", \ |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 4258 | .ops = &clk_ops_rcg, \ |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 4259 | VDD_DIG_FMAX_MAP1(LOW, 24576000), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4260 | CLK_INIT(i##_clk.c), \ |
| 4261 | }, \ |
| 4262 | } |
| 4263 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4264 | #define CLK_AIF_BIT(i, ns, h_r) \ |
Stephen Boyd | 9fd1964 | 2011-11-16 11:11:09 -0800 | [diff] [blame] | 4265 | struct cdiv_clk i##_clk = { \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4266 | .b = { \ |
| 4267 | .ctl_reg = ns, \ |
| 4268 | .en_mask = BIT(15), \ |
| 4269 | .halt_reg = h_r, \ |
| 4270 | .halt_check = DELAY, \ |
| 4271 | }, \ |
| 4272 | .ns_reg = ns, \ |
Stephen Boyd | 9fd1964 | 2011-11-16 11:11:09 -0800 | [diff] [blame] | 4273 | .ext_mask = BIT(14), \ |
| 4274 | .div_offset = 10, \ |
| 4275 | .max_div = 16, \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4276 | .c = { \ |
| 4277 | .dbg_name = #i "_clk", \ |
Stephen Boyd | 9fd1964 | 2011-11-16 11:11:09 -0800 | [diff] [blame] | 4278 | .ops = &clk_ops_cdiv, \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4279 | CLK_INIT(i##_clk.c), \ |
| 4280 | }, \ |
| 4281 | } |
| 4282 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4283 | #define CLK_AIF_BIT_DIV(i, ns, h_r) \ |
Stephen Boyd | 9fd1964 | 2011-11-16 11:11:09 -0800 | [diff] [blame] | 4284 | struct cdiv_clk i##_clk = { \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4285 | .b = { \ |
| 4286 | .ctl_reg = ns, \ |
| 4287 | .en_mask = BIT(19), \ |
| 4288 | .halt_reg = h_r, \ |
Stephen Boyd | 7bb9cf8 | 2012-01-25 18:09:01 -0800 | [diff] [blame] | 4289 | .halt_check = DELAY, \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4290 | }, \ |
| 4291 | .ns_reg = ns, \ |
Stephen Boyd | 9fd1964 | 2011-11-16 11:11:09 -0800 | [diff] [blame] | 4292 | .ext_mask = BIT(18), \ |
| 4293 | .div_offset = 10, \ |
| 4294 | .max_div = 256, \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4295 | .c = { \ |
| 4296 | .dbg_name = #i "_clk", \ |
Stephen Boyd | 9fd1964 | 2011-11-16 11:11:09 -0800 | [diff] [blame] | 4297 | .ops = &clk_ops_cdiv, \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4298 | CLK_INIT(i##_clk.c), \ |
| 4299 | }, \ |
| 4300 | } |
| 4301 | |
| 4302 | static CLK_AIF_OSR(mi2s_osr, LCC_MI2S_NS_REG, LCC_MI2S_MD_REG, |
| 4303 | LCC_MI2S_STATUS_REG); |
| 4304 | static CLK_AIF_BIT(mi2s_bit, LCC_MI2S_NS_REG, LCC_MI2S_STATUS_REG); |
| 4305 | |
| 4306 | static CLK_AIF_OSR_DIV(codec_i2s_mic_osr, LCC_CODEC_I2S_MIC_NS_REG, |
| 4307 | LCC_CODEC_I2S_MIC_MD_REG, LCC_CODEC_I2S_MIC_STATUS_REG); |
| 4308 | static CLK_AIF_BIT_DIV(codec_i2s_mic_bit, LCC_CODEC_I2S_MIC_NS_REG, |
| 4309 | LCC_CODEC_I2S_MIC_STATUS_REG); |
| 4310 | |
| 4311 | static CLK_AIF_OSR_DIV(spare_i2s_mic_osr, LCC_SPARE_I2S_MIC_NS_REG, |
| 4312 | LCC_SPARE_I2S_MIC_MD_REG, LCC_SPARE_I2S_MIC_STATUS_REG); |
| 4313 | static CLK_AIF_BIT_DIV(spare_i2s_mic_bit, LCC_SPARE_I2S_MIC_NS_REG, |
| 4314 | LCC_SPARE_I2S_MIC_STATUS_REG); |
| 4315 | |
| 4316 | static CLK_AIF_OSR_DIV(codec_i2s_spkr_osr, LCC_CODEC_I2S_SPKR_NS_REG, |
| 4317 | LCC_CODEC_I2S_SPKR_MD_REG, LCC_CODEC_I2S_SPKR_STATUS_REG); |
| 4318 | static CLK_AIF_BIT_DIV(codec_i2s_spkr_bit, LCC_CODEC_I2S_SPKR_NS_REG, |
| 4319 | LCC_CODEC_I2S_SPKR_STATUS_REG); |
| 4320 | |
| 4321 | static CLK_AIF_OSR_DIV(spare_i2s_spkr_osr, LCC_SPARE_I2S_SPKR_NS_REG, |
| 4322 | LCC_SPARE_I2S_SPKR_MD_REG, LCC_SPARE_I2S_SPKR_STATUS_REG); |
| 4323 | static CLK_AIF_BIT_DIV(spare_i2s_spkr_bit, LCC_SPARE_I2S_SPKR_NS_REG, |
| 4324 | LCC_SPARE_I2S_SPKR_STATUS_REG); |
| 4325 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 4326 | #define F_PCM(f, s, d, m, n) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4327 | { \ |
| 4328 | .freq_hz = f, \ |
| 4329 | .src_clk = &s##_clk.c, \ |
| 4330 | .md_val = MD16(m, n), \ |
| 4331 | .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] | 4332 | } |
| 4333 | static struct clk_freq_tbl clk_tbl_pcm[] = { |
Stephen Boyd | 630f325 | 2012-01-31 00:10:08 -0800 | [diff] [blame] | 4334 | { .ns_val = BIT(10) /* external input */ }, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 4335 | F_PCM( 512000, pll4, 4, 1, 192), |
| 4336 | F_PCM( 768000, pll4, 4, 1, 128), |
| 4337 | F_PCM( 1024000, pll4, 4, 1, 96), |
| 4338 | F_PCM( 1536000, pll4, 4, 1, 64), |
| 4339 | F_PCM( 2048000, pll4, 4, 1, 48), |
| 4340 | F_PCM( 3072000, pll4, 4, 1, 32), |
| 4341 | F_PCM( 4096000, pll4, 4, 1, 24), |
| 4342 | F_PCM( 6144000, pll4, 4, 1, 16), |
| 4343 | F_PCM( 8192000, pll4, 4, 1, 12), |
| 4344 | F_PCM(12288000, pll4, 4, 1, 8), |
| 4345 | F_PCM(24576000, pll4, 4, 1, 4), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4346 | F_END |
| 4347 | }; |
| 4348 | |
| 4349 | static struct rcg_clk pcm_clk = { |
| 4350 | .b = { |
| 4351 | .ctl_reg = LCC_PCM_NS_REG, |
| 4352 | .en_mask = BIT(11), |
| 4353 | .reset_reg = LCC_PCM_NS_REG, |
| 4354 | .reset_mask = BIT(13), |
| 4355 | .halt_reg = LCC_PCM_STATUS_REG, |
| 4356 | .halt_check = ENABLE, |
| 4357 | .halt_bit = 0, |
| 4358 | }, |
| 4359 | .ns_reg = LCC_PCM_NS_REG, |
| 4360 | .md_reg = LCC_PCM_MD_REG, |
| 4361 | .root_en_mask = BIT(9), |
Stephen Boyd | 630f325 | 2012-01-31 00:10:08 -0800 | [diff] [blame] | 4362 | .ns_mask = BM(31, 16) | BIT(10) | BM(6, 0), |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame] | 4363 | .mnd_en_mask = BIT(8), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4364 | .set_rate = set_rate_mnd, |
| 4365 | .freq_tbl = clk_tbl_pcm, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 4366 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4367 | .c = { |
| 4368 | .dbg_name = "pcm_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 4369 | .ops = &clk_ops_rcg, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 4370 | VDD_DIG_FMAX_MAP1(LOW, 24576000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4371 | CLK_INIT(pcm_clk.c), |
| 4372 | }, |
| 4373 | }; |
| 4374 | |
| 4375 | static struct rcg_clk audio_slimbus_clk = { |
| 4376 | .b = { |
| 4377 | .ctl_reg = LCC_SLIMBUS_NS_REG, |
| 4378 | .en_mask = BIT(10), |
| 4379 | .reset_reg = LCC_AHBEX_BRANCH_CTL_REG, |
| 4380 | .reset_mask = BIT(5), |
| 4381 | .halt_reg = LCC_SLIMBUS_STATUS_REG, |
| 4382 | .halt_check = ENABLE, |
| 4383 | .halt_bit = 0, |
| 4384 | }, |
| 4385 | .ns_reg = LCC_SLIMBUS_NS_REG, |
| 4386 | .md_reg = LCC_SLIMBUS_MD_REG, |
| 4387 | .root_en_mask = BIT(9), |
| 4388 | .ns_mask = (BM(31, 24) | BM(6, 0)), |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame] | 4389 | .mnd_en_mask = BIT(8), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4390 | .set_rate = set_rate_mnd, |
| 4391 | .freq_tbl = clk_tbl_aif_osr, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 4392 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4393 | .c = { |
| 4394 | .dbg_name = "audio_slimbus_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 4395 | .ops = &clk_ops_rcg, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 4396 | VDD_DIG_FMAX_MAP1(LOW, 24576000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4397 | CLK_INIT(audio_slimbus_clk.c), |
| 4398 | }, |
| 4399 | }; |
| 4400 | |
| 4401 | static struct branch_clk sps_slimbus_clk = { |
| 4402 | .b = { |
| 4403 | .ctl_reg = LCC_SLIMBUS_NS_REG, |
| 4404 | .en_mask = BIT(12), |
| 4405 | .halt_reg = LCC_SLIMBUS_STATUS_REG, |
| 4406 | .halt_check = ENABLE, |
| 4407 | .halt_bit = 1, |
| 4408 | }, |
| 4409 | .parent = &audio_slimbus_clk.c, |
| 4410 | .c = { |
| 4411 | .dbg_name = "sps_slimbus_clk", |
| 4412 | .ops = &clk_ops_branch, |
| 4413 | CLK_INIT(sps_slimbus_clk.c), |
| 4414 | }, |
| 4415 | }; |
| 4416 | |
| 4417 | static struct branch_clk slimbus_xo_src_clk = { |
| 4418 | .b = { |
| 4419 | .ctl_reg = SLIMBUS_XO_SRC_CLK_CTL_REG, |
| 4420 | .en_mask = BIT(2), |
| 4421 | .halt_reg = CLK_HALT_DFAB_STATE_REG, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4422 | .halt_bit = 28, |
| 4423 | }, |
| 4424 | .parent = &sps_slimbus_clk.c, |
| 4425 | .c = { |
| 4426 | .dbg_name = "slimbus_xo_src_clk", |
| 4427 | .ops = &clk_ops_branch, |
| 4428 | CLK_INIT(slimbus_xo_src_clk.c), |
| 4429 | }, |
| 4430 | }; |
| 4431 | |
Matt Wagantall | 735f01a | 2011-08-12 12:40:28 -0700 | [diff] [blame] | 4432 | DEFINE_CLK_RPM(afab_clk, afab_a_clk, APPS_FABRIC, NULL); |
| 4433 | DEFINE_CLK_RPM(cfpb_clk, cfpb_a_clk, CFPB, NULL); |
| 4434 | DEFINE_CLK_RPM(dfab_clk, dfab_a_clk, DAYTONA_FABRIC, NULL); |
| 4435 | DEFINE_CLK_RPM(ebi1_clk, ebi1_a_clk, EBI1, NULL); |
| 4436 | DEFINE_CLK_RPM(mmfab_clk, mmfab_a_clk, MM_FABRIC, NULL); |
| 4437 | DEFINE_CLK_RPM(mmfpb_clk, mmfpb_a_clk, MMFPB, NULL); |
| 4438 | DEFINE_CLK_RPM(sfab_clk, sfab_a_clk, SYSTEM_FABRIC, NULL); |
| 4439 | DEFINE_CLK_RPM(sfpb_clk, sfpb_a_clk, SFPB, NULL); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4440 | |
Matt Wagantall | 35e78fc | 2012-04-05 14:18:44 -0700 | [diff] [blame] | 4441 | static DEFINE_CLK_VOTER(sfab_msmbus_a_clk, &sfab_a_clk.c, 0); |
| 4442 | static DEFINE_CLK_VOTER(sfab_tmr_a_clk, &sfab_a_clk.c, 0); |
Stephen Boyd | d7a143a | 2012-02-16 17:59:26 -0800 | [diff] [blame] | 4443 | |
Matt Wagantall | 35e78fc | 2012-04-05 14:18:44 -0700 | [diff] [blame] | 4444 | static DEFINE_CLK_VOTER(dfab_dsps_clk, &dfab_clk.c, 0); |
| 4445 | static DEFINE_CLK_VOTER(dfab_usb_hs_clk, &dfab_clk.c, 0); |
| 4446 | static DEFINE_CLK_VOTER(dfab_usb_hs3_clk, &dfab_clk.c, 0); |
| 4447 | static DEFINE_CLK_VOTER(dfab_usb_hs4_clk, &dfab_clk.c, 0); |
| 4448 | static DEFINE_CLK_VOTER(dfab_sdc1_clk, &dfab_clk.c, 0); |
| 4449 | static DEFINE_CLK_VOTER(dfab_sdc2_clk, &dfab_clk.c, 0); |
| 4450 | static DEFINE_CLK_VOTER(dfab_sdc3_clk, &dfab_clk.c, 0); |
| 4451 | static DEFINE_CLK_VOTER(dfab_sdc4_clk, &dfab_clk.c, 0); |
| 4452 | static DEFINE_CLK_VOTER(dfab_sdc5_clk, &dfab_clk.c, 0); |
| 4453 | static DEFINE_CLK_VOTER(dfab_sps_clk, &dfab_clk.c, 0); |
| 4454 | static DEFINE_CLK_VOTER(dfab_bam_dmux_clk, &dfab_clk.c, 0); |
| 4455 | static DEFINE_CLK_VOTER(dfab_scm_clk, &dfab_clk.c, 0); |
| 4456 | static DEFINE_CLK_VOTER(dfab_qseecom_clk, &dfab_clk.c, 0); |
| 4457 | static DEFINE_CLK_VOTER(dfab_tzcom_clk, &dfab_clk.c, 0); |
| 4458 | static DEFINE_CLK_VOTER(dfab_msmbus_clk, &dfab_clk.c, 0); |
| 4459 | static DEFINE_CLK_VOTER(dfab_msmbus_a_clk, &dfab_a_clk.c, 0); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4460 | |
Matt Wagantall | 42cd12a | 2012-03-30 18:02:40 -0700 | [diff] [blame] | 4461 | static DEFINE_CLK_VOTER(ebi1_msmbus_clk, &ebi1_clk.c, LONG_MAX); |
Matt Wagantall | 35e78fc | 2012-04-05 14:18:44 -0700 | [diff] [blame] | 4462 | static DEFINE_CLK_VOTER(ebi1_adm_clk, &ebi1_clk.c, 0); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4463 | |
| 4464 | #ifdef CONFIG_DEBUG_FS |
| 4465 | struct measure_sel { |
| 4466 | u32 test_vector; |
| 4467 | struct clk *clk; |
| 4468 | }; |
| 4469 | |
Matt Wagantall | 8b38f94 | 2011-08-02 18:23:18 -0700 | [diff] [blame] | 4470 | static DEFINE_CLK_MEASURE(l2_m_clk); |
| 4471 | static DEFINE_CLK_MEASURE(krait0_m_clk); |
| 4472 | static DEFINE_CLK_MEASURE(krait1_m_clk); |
Tianyi Gou | 455c13c | 2012-02-02 16:33:24 -0800 | [diff] [blame] | 4473 | static DEFINE_CLK_MEASURE(krait2_m_clk); |
| 4474 | static DEFINE_CLK_MEASURE(krait3_m_clk); |
Stephen Boyd | 3939c8d | 2011-08-29 17:36:22 -0700 | [diff] [blame] | 4475 | static DEFINE_CLK_MEASURE(q6sw_clk); |
| 4476 | static DEFINE_CLK_MEASURE(q6fw_clk); |
| 4477 | static DEFINE_CLK_MEASURE(q6_func_clk); |
Matt Wagantall | 8b38f94 | 2011-08-02 18:23:18 -0700 | [diff] [blame] | 4478 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4479 | static struct measure_sel measure_mux[] = { |
| 4480 | { TEST_PER_LS(0x08), &slimbus_xo_src_clk.c }, |
| 4481 | { TEST_PER_LS(0x12), &sdc1_p_clk.c }, |
| 4482 | { TEST_PER_LS(0x13), &sdc1_clk.c }, |
| 4483 | { TEST_PER_LS(0x14), &sdc2_p_clk.c }, |
| 4484 | { TEST_PER_LS(0x15), &sdc2_clk.c }, |
| 4485 | { TEST_PER_LS(0x16), &sdc3_p_clk.c }, |
| 4486 | { TEST_PER_LS(0x17), &sdc3_clk.c }, |
| 4487 | { TEST_PER_LS(0x18), &sdc4_p_clk.c }, |
| 4488 | { TEST_PER_LS(0x19), &sdc4_clk.c }, |
| 4489 | { TEST_PER_LS(0x1A), &sdc5_p_clk.c }, |
| 4490 | { TEST_PER_LS(0x1B), &sdc5_clk.c }, |
Matt Wagantall | 7625a4c | 2011-11-01 16:17:53 -0700 | [diff] [blame] | 4491 | { TEST_PER_LS(0x1F), &gp0_clk.c }, |
| 4492 | { TEST_PER_LS(0x20), &gp1_clk.c }, |
| 4493 | { TEST_PER_LS(0x21), &gp2_clk.c }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4494 | { TEST_PER_LS(0x25), &dfab_clk.c }, |
| 4495 | { TEST_PER_LS(0x25), &dfab_a_clk.c }, |
| 4496 | { TEST_PER_LS(0x26), &pmem_clk.c }, |
| 4497 | { TEST_PER_LS(0x32), &dma_bam_p_clk.c }, |
| 4498 | { TEST_PER_LS(0x33), &cfpb_clk.c }, |
| 4499 | { TEST_PER_LS(0x33), &cfpb_a_clk.c }, |
| 4500 | { TEST_PER_LS(0x3D), &gsbi1_p_clk.c }, |
| 4501 | { TEST_PER_LS(0x3E), &gsbi1_uart_clk.c }, |
| 4502 | { TEST_PER_LS(0x3F), &gsbi1_qup_clk.c }, |
| 4503 | { TEST_PER_LS(0x41), &gsbi2_p_clk.c }, |
| 4504 | { TEST_PER_LS(0x42), &gsbi2_uart_clk.c }, |
| 4505 | { TEST_PER_LS(0x44), &gsbi2_qup_clk.c }, |
| 4506 | { TEST_PER_LS(0x45), &gsbi3_p_clk.c }, |
| 4507 | { TEST_PER_LS(0x46), &gsbi3_uart_clk.c }, |
| 4508 | { TEST_PER_LS(0x48), &gsbi3_qup_clk.c }, |
| 4509 | { TEST_PER_LS(0x49), &gsbi4_p_clk.c }, |
| 4510 | { TEST_PER_LS(0x4A), &gsbi4_uart_clk.c }, |
| 4511 | { TEST_PER_LS(0x4C), &gsbi4_qup_clk.c }, |
| 4512 | { TEST_PER_LS(0x4D), &gsbi5_p_clk.c }, |
| 4513 | { TEST_PER_LS(0x4E), &gsbi5_uart_clk.c }, |
| 4514 | { TEST_PER_LS(0x50), &gsbi5_qup_clk.c }, |
| 4515 | { TEST_PER_LS(0x51), &gsbi6_p_clk.c }, |
| 4516 | { TEST_PER_LS(0x52), &gsbi6_uart_clk.c }, |
| 4517 | { TEST_PER_LS(0x54), &gsbi6_qup_clk.c }, |
| 4518 | { TEST_PER_LS(0x55), &gsbi7_p_clk.c }, |
| 4519 | { TEST_PER_LS(0x56), &gsbi7_uart_clk.c }, |
| 4520 | { TEST_PER_LS(0x58), &gsbi7_qup_clk.c }, |
| 4521 | { TEST_PER_LS(0x59), &gsbi8_p_clk.c }, |
| 4522 | { TEST_PER_LS(0x5A), &gsbi8_uart_clk.c }, |
| 4523 | { TEST_PER_LS(0x5C), &gsbi8_qup_clk.c }, |
| 4524 | { TEST_PER_LS(0x5D), &gsbi9_p_clk.c }, |
| 4525 | { TEST_PER_LS(0x5E), &gsbi9_uart_clk.c }, |
| 4526 | { TEST_PER_LS(0x60), &gsbi9_qup_clk.c }, |
| 4527 | { TEST_PER_LS(0x61), &gsbi10_p_clk.c }, |
| 4528 | { TEST_PER_LS(0x62), &gsbi10_uart_clk.c }, |
| 4529 | { TEST_PER_LS(0x64), &gsbi10_qup_clk.c }, |
| 4530 | { TEST_PER_LS(0x65), &gsbi11_p_clk.c }, |
| 4531 | { TEST_PER_LS(0x66), &gsbi11_uart_clk.c }, |
| 4532 | { TEST_PER_LS(0x68), &gsbi11_qup_clk.c }, |
| 4533 | { TEST_PER_LS(0x69), &gsbi12_p_clk.c }, |
| 4534 | { TEST_PER_LS(0x6A), &gsbi12_uart_clk.c }, |
| 4535 | { TEST_PER_LS(0x6C), &gsbi12_qup_clk.c }, |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 4536 | { TEST_PER_LS(0x5E), &pcie_p_clk.c }, |
| 4537 | { TEST_PER_LS(0x5F), &ce3_p_clk.c }, |
| 4538 | { TEST_PER_LS(0x60), &ce3_core_clk.c }, |
| 4539 | { TEST_PER_LS(0x63), &usb_hs3_p_clk.c }, |
| 4540 | { TEST_PER_LS(0x64), &usb_hs3_xcvr_clk.c }, |
| 4541 | { TEST_PER_LS(0x65), &usb_hs4_p_clk.c }, |
| 4542 | { TEST_PER_LS(0x66), &usb_hs4_xcvr_clk.c }, |
| 4543 | { TEST_PER_LS(0x6B), &sata_phy_ref_clk.c }, |
| 4544 | { TEST_PER_LS(0x6C), &sata_phy_cfg_clk.c }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4545 | { TEST_PER_LS(0x78), &sfpb_clk.c }, |
| 4546 | { TEST_PER_LS(0x78), &sfpb_a_clk.c }, |
| 4547 | { TEST_PER_LS(0x7A), &pmic_ssbi2_clk.c }, |
| 4548 | { TEST_PER_LS(0x7B), &pmic_arb0_p_clk.c }, |
| 4549 | { TEST_PER_LS(0x7C), &pmic_arb1_p_clk.c }, |
| 4550 | { TEST_PER_LS(0x7D), &prng_clk.c }, |
| 4551 | { TEST_PER_LS(0x7F), &rpm_msg_ram_p_clk.c }, |
| 4552 | { TEST_PER_LS(0x80), &adm0_p_clk.c }, |
| 4553 | { TEST_PER_LS(0x84), &usb_hs1_p_clk.c }, |
| 4554 | { TEST_PER_LS(0x85), &usb_hs1_xcvr_clk.c }, |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 4555 | { TEST_PER_LS(0x86), &usb_hsic_p_clk.c }, |
| 4556 | { TEST_PER_LS(0x87), &usb_hsic_system_clk.c }, |
| 4557 | { TEST_PER_LS(0x88), &usb_hsic_xcvr_fs_clk.c }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4558 | { TEST_PER_LS(0x89), &usb_fs1_p_clk.c }, |
| 4559 | { TEST_PER_LS(0x8A), &usb_fs1_sys_clk.c }, |
| 4560 | { TEST_PER_LS(0x8B), &usb_fs1_xcvr_clk.c }, |
| 4561 | { TEST_PER_LS(0x8C), &usb_fs2_p_clk.c }, |
| 4562 | { TEST_PER_LS(0x8D), &usb_fs2_sys_clk.c }, |
| 4563 | { TEST_PER_LS(0x8E), &usb_fs2_xcvr_clk.c }, |
| 4564 | { TEST_PER_LS(0x8F), &tsif_p_clk.c }, |
| 4565 | { TEST_PER_LS(0x91), &tsif_ref_clk.c }, |
| 4566 | { TEST_PER_LS(0x92), &ce1_p_clk.c }, |
| 4567 | { TEST_PER_LS(0x94), &tssc_clk.c }, |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 4568 | { TEST_PER_LS(0x9D), &usb_hsic_hsio_cal_clk.c }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4569 | { TEST_PER_LS(0xA4), &ce1_core_clk.c }, |
| 4570 | |
| 4571 | { TEST_PER_HS(0x07), &afab_clk.c }, |
| 4572 | { TEST_PER_HS(0x07), &afab_a_clk.c }, |
| 4573 | { TEST_PER_HS(0x18), &sfab_clk.c }, |
| 4574 | { TEST_PER_HS(0x18), &sfab_a_clk.c }, |
Stephen Boyd | 3939c8d | 2011-08-29 17:36:22 -0700 | [diff] [blame] | 4575 | { TEST_PER_HS(0x26), &q6sw_clk }, |
| 4576 | { TEST_PER_HS(0x27), &q6fw_clk }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4577 | { TEST_PER_HS(0x2A), &adm0_clk.c }, |
| 4578 | { TEST_PER_HS(0x34), &ebi1_clk.c }, |
| 4579 | { TEST_PER_HS(0x34), &ebi1_a_clk.c }, |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 4580 | { TEST_PER_HS(0x50), &usb_hsic_hsic_clk.c }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4581 | |
| 4582 | { TEST_MM_LS(0x00), &dsi1_byte_clk.c }, |
| 4583 | { TEST_MM_LS(0x01), &dsi2_byte_clk.c }, |
| 4584 | { TEST_MM_LS(0x02), &cam1_clk.c }, |
| 4585 | { TEST_MM_LS(0x06), &_p_clk.c }, |
Matt Wagantall | c23eee9 | 2011-08-16 23:06:52 -0700 | [diff] [blame] | 4586 | { TEST_MM_LS(0x07), &csi_p_clk.c }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4587 | { TEST_MM_LS(0x08), &dsi2_s_p_clk.c }, |
| 4588 | { TEST_MM_LS(0x09), &dsi1_m_p_clk.c }, |
| 4589 | { TEST_MM_LS(0x0A), &dsi1_s_p_clk.c }, |
| 4590 | { TEST_MM_LS(0x0C), &gfx2d0_p_clk.c }, |
| 4591 | { TEST_MM_LS(0x0D), &gfx2d1_p_clk.c }, |
| 4592 | { TEST_MM_LS(0x0E), &gfx3d_p_clk.c }, |
| 4593 | { TEST_MM_LS(0x0F), &hdmi_m_p_clk.c }, |
| 4594 | { TEST_MM_LS(0x10), &hdmi_s_p_clk.c }, |
| 4595 | { TEST_MM_LS(0x11), &ijpeg_p_clk.c }, |
| 4596 | { TEST_MM_LS(0x12), &imem_p_clk.c }, |
| 4597 | { TEST_MM_LS(0x13), &jpegd_p_clk.c }, |
| 4598 | { TEST_MM_LS(0x14), &mdp_p_clk.c }, |
| 4599 | { TEST_MM_LS(0x16), &rot_p_clk.c }, |
| 4600 | { TEST_MM_LS(0x17), &dsi1_esc_clk.c }, |
| 4601 | { TEST_MM_LS(0x18), &smmu_p_clk.c }, |
| 4602 | { TEST_MM_LS(0x19), &tv_enc_p_clk.c }, |
| 4603 | { TEST_MM_LS(0x1A), &vcodec_p_clk.c }, |
| 4604 | { TEST_MM_LS(0x1B), &vfe_p_clk.c }, |
| 4605 | { TEST_MM_LS(0x1C), &vpe_p_clk.c }, |
| 4606 | { TEST_MM_LS(0x1D), &cam0_clk.c }, |
| 4607 | { TEST_MM_LS(0x1F), &hdmi_app_clk.c }, |
| 4608 | { TEST_MM_LS(0x20), &mdp_vsync_clk.c }, |
| 4609 | { TEST_MM_LS(0x21), &tv_dac_clk.c }, |
| 4610 | { TEST_MM_LS(0x22), &tv_enc_clk.c }, |
| 4611 | { TEST_MM_LS(0x23), &dsi2_esc_clk.c }, |
| 4612 | { TEST_MM_LS(0x25), &mmfpb_clk.c }, |
| 4613 | { TEST_MM_LS(0x25), &mmfpb_a_clk.c }, |
| 4614 | { TEST_MM_LS(0x26), &dsi2_m_p_clk.c }, |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 4615 | { TEST_MM_LS(0x27), &cam2_clk.c }, |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 4616 | { TEST_MM_LS(0x28), &vcap_p_clk.c }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4617 | |
| 4618 | { TEST_MM_HS(0x00), &csi0_clk.c }, |
| 4619 | { TEST_MM_HS(0x01), &csi1_clk.c }, |
Matt Wagantall | c23eee9 | 2011-08-16 23:06:52 -0700 | [diff] [blame] | 4620 | { TEST_MM_HS(0x04), &csi_vfe_clk.c }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4621 | { TEST_MM_HS(0x05), &ijpeg_clk.c }, |
| 4622 | { TEST_MM_HS(0x06), &vfe_clk.c }, |
| 4623 | { TEST_MM_HS(0x07), &gfx2d0_clk.c }, |
| 4624 | { TEST_MM_HS(0x08), &gfx2d1_clk.c }, |
| 4625 | { TEST_MM_HS(0x09), &gfx3d_clk.c }, |
| 4626 | { TEST_MM_HS(0x0A), &jpegd_clk.c }, |
| 4627 | { TEST_MM_HS(0x0B), &vcodec_clk.c }, |
| 4628 | { TEST_MM_HS(0x0F), &mmfab_clk.c }, |
| 4629 | { TEST_MM_HS(0x0F), &mmfab_a_clk.c }, |
| 4630 | { TEST_MM_HS(0x11), &gmem_axi_clk.c }, |
| 4631 | { TEST_MM_HS(0x12), &ijpeg_axi_clk.c }, |
| 4632 | { TEST_MM_HS(0x13), &imem_axi_clk.c }, |
| 4633 | { TEST_MM_HS(0x14), &jpegd_axi_clk.c }, |
| 4634 | { TEST_MM_HS(0x15), &mdp_axi_clk.c }, |
| 4635 | { TEST_MM_HS(0x16), &rot_axi_clk.c }, |
| 4636 | { TEST_MM_HS(0x17), &vcodec_axi_clk.c }, |
| 4637 | { TEST_MM_HS(0x18), &vfe_axi_clk.c }, |
| 4638 | { TEST_MM_HS(0x19), &vpe_axi_clk.c }, |
| 4639 | { TEST_MM_HS(0x1A), &mdp_clk.c }, |
| 4640 | { TEST_MM_HS(0x1B), &rot_clk.c }, |
| 4641 | { TEST_MM_HS(0x1C), &vpe_clk.c }, |
| 4642 | { TEST_MM_HS(0x1E), &hdmi_tv_clk.c }, |
| 4643 | { TEST_MM_HS(0x1F), &mdp_tv_clk.c }, |
| 4644 | { TEST_MM_HS(0x24), &csi0_phy_clk.c }, |
| 4645 | { TEST_MM_HS(0x25), &csi1_phy_clk.c }, |
| 4646 | { TEST_MM_HS(0x26), &csi_pix_clk.c }, |
| 4647 | { TEST_MM_HS(0x27), &csi_rdi_clk.c }, |
| 4648 | { TEST_MM_HS(0x28), &lut_mdp_clk.c }, |
| 4649 | { TEST_MM_HS(0x29), &vcodec_axi_a_clk.c }, |
| 4650 | { TEST_MM_HS(0x2A), &vcodec_axi_b_clk.c }, |
| 4651 | { TEST_MM_HS(0x2B), &csi1phy_timer_clk.c }, |
| 4652 | { TEST_MM_HS(0x2C), &csi0phy_timer_clk.c }, |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 4653 | { TEST_MM_HS(0x2D), &csi2_clk.c }, |
| 4654 | { TEST_MM_HS(0x2E), &csi2_phy_clk.c }, |
| 4655 | { TEST_MM_HS(0x2F), &csi2phy_timer_clk.c }, |
| 4656 | { TEST_MM_HS(0x30), &csi_pix1_clk.c }, |
| 4657 | { TEST_MM_HS(0x31), &csi_rdi1_clk.c }, |
| 4658 | { TEST_MM_HS(0x32), &csi_rdi2_clk.c }, |
Tianyi Gou | 621f874 | 2011-09-01 21:45:01 -0700 | [diff] [blame] | 4659 | { TEST_MM_HS(0x33), &vcap_clk.c }, |
| 4660 | { TEST_MM_HS(0x34), &vcap_npl_clk.c }, |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 4661 | { TEST_MM_HS(0x34), &gfx3d_axi_clk_8930.c }, |
Tianyi Gou | 7747a96 | 2012-02-03 15:03:55 -0800 | [diff] [blame] | 4662 | { TEST_MM_HS(0x35), &vcap_axi_clk.c }, |
Tianyi Gou | 5191880 | 2012-01-26 14:05:43 -0800 | [diff] [blame] | 4663 | { TEST_MM_HS(0x36), &rgb_tv_clk.c }, |
| 4664 | { TEST_MM_HS(0x37), &npl_tv_clk.c }, |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 4665 | { TEST_MM_HS(0x38), &gfx3d_axi_clk_8064.c }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4666 | |
| 4667 | { TEST_LPA(0x0F), &mi2s_bit_clk.c }, |
| 4668 | { TEST_LPA(0x10), &codec_i2s_mic_bit_clk.c }, |
| 4669 | { TEST_LPA(0x11), &codec_i2s_spkr_bit_clk.c }, |
| 4670 | { TEST_LPA(0x12), &spare_i2s_mic_bit_clk.c }, |
| 4671 | { TEST_LPA(0x13), &spare_i2s_spkr_bit_clk.c }, |
| 4672 | { TEST_LPA(0x14), &pcm_clk.c }, |
| 4673 | { TEST_LPA(0x1D), &audio_slimbus_clk.c }, |
Matt Wagantall | 8b38f94 | 2011-08-02 18:23:18 -0700 | [diff] [blame] | 4674 | |
Stephen Boyd | 3939c8d | 2011-08-29 17:36:22 -0700 | [diff] [blame] | 4675 | { TEST_LPA_HS(0x00), &q6_func_clk }, |
| 4676 | |
Stephen Boyd | 46fdf0d | 2011-11-22 12:25:09 -0800 | [diff] [blame] | 4677 | { TEST_CPUL2(0x2), &l2_m_clk }, |
| 4678 | { TEST_CPUL2(0x0), &krait0_m_clk }, |
| 4679 | { TEST_CPUL2(0x1), &krait1_m_clk }, |
Tianyi Gou | 455c13c | 2012-02-02 16:33:24 -0800 | [diff] [blame] | 4680 | { TEST_CPUL2(0x4), &krait2_m_clk }, |
| 4681 | { TEST_CPUL2(0x5), &krait3_m_clk }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4682 | }; |
| 4683 | |
| 4684 | static struct measure_sel *find_measure_sel(struct clk *clk) |
| 4685 | { |
| 4686 | int i; |
| 4687 | |
| 4688 | for (i = 0; i < ARRAY_SIZE(measure_mux); i++) |
| 4689 | if (measure_mux[i].clk == clk) |
| 4690 | return &measure_mux[i]; |
| 4691 | return NULL; |
| 4692 | } |
| 4693 | |
Matt Wagantall | 8b38f94 | 2011-08-02 18:23:18 -0700 | [diff] [blame] | 4694 | static int measure_clk_set_parent(struct clk *c, struct clk *parent) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4695 | { |
| 4696 | int ret = 0; |
| 4697 | u32 clk_sel; |
| 4698 | struct measure_sel *p; |
Matt Wagantall | 8b38f94 | 2011-08-02 18:23:18 -0700 | [diff] [blame] | 4699 | struct measure_clk *clk = to_measure_clk(c); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4700 | unsigned long flags; |
| 4701 | |
| 4702 | if (!parent) |
| 4703 | return -EINVAL; |
| 4704 | |
| 4705 | p = find_measure_sel(parent); |
| 4706 | if (!p) |
| 4707 | return -EINVAL; |
| 4708 | |
| 4709 | spin_lock_irqsave(&local_clock_reg_lock, flags); |
| 4710 | |
Matt Wagantall | 8b38f94 | 2011-08-02 18:23:18 -0700 | [diff] [blame] | 4711 | /* |
| 4712 | * Program the test vector, measurement period (sample_ticks) |
| 4713 | * and scaling multiplier. |
| 4714 | */ |
| 4715 | clk->sample_ticks = 0x10000; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4716 | clk_sel = p->test_vector & TEST_CLK_SEL_MASK; |
Matt Wagantall | 8b38f94 | 2011-08-02 18:23:18 -0700 | [diff] [blame] | 4717 | clk->multiplier = 1; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4718 | switch (p->test_vector >> TEST_TYPE_SHIFT) { |
| 4719 | case TEST_TYPE_PER_LS: |
| 4720 | writel_relaxed(0x4030D00|BVAL(7, 0, clk_sel), CLK_TEST_REG); |
| 4721 | break; |
| 4722 | case TEST_TYPE_PER_HS: |
| 4723 | writel_relaxed(0x4020000|BVAL(16, 10, clk_sel), CLK_TEST_REG); |
| 4724 | break; |
| 4725 | case TEST_TYPE_MM_LS: |
| 4726 | writel_relaxed(0x4030D97, CLK_TEST_REG); |
| 4727 | writel_relaxed(BVAL(6, 1, clk_sel)|BIT(0), DBG_CFG_REG_LS_REG); |
| 4728 | break; |
| 4729 | case TEST_TYPE_MM_HS: |
| 4730 | writel_relaxed(0x402B800, CLK_TEST_REG); |
| 4731 | writel_relaxed(BVAL(6, 1, clk_sel)|BIT(0), DBG_CFG_REG_HS_REG); |
| 4732 | break; |
| 4733 | case TEST_TYPE_LPA: |
| 4734 | writel_relaxed(0x4030D98, CLK_TEST_REG); |
| 4735 | writel_relaxed(BVAL(6, 1, clk_sel)|BIT(0), |
| 4736 | LCC_CLK_LS_DEBUG_CFG_REG); |
| 4737 | break; |
Stephen Boyd | 3939c8d | 2011-08-29 17:36:22 -0700 | [diff] [blame] | 4738 | case TEST_TYPE_LPA_HS: |
| 4739 | writel_relaxed(0x402BC00, CLK_TEST_REG); |
| 4740 | writel_relaxed(BVAL(2, 1, clk_sel)|BIT(0), |
| 4741 | LCC_CLK_HS_DEBUG_CFG_REG); |
| 4742 | break; |
Matt Wagantall | 8b38f94 | 2011-08-02 18:23:18 -0700 | [diff] [blame] | 4743 | case TEST_TYPE_CPUL2: |
| 4744 | writel_relaxed(0x4030400, CLK_TEST_REG); |
| 4745 | writel_relaxed(0x80|BVAL(5, 3, clk_sel), GCC_APCS_CLK_DIAG); |
| 4746 | clk->sample_ticks = 0x4000; |
| 4747 | clk->multiplier = 2; |
| 4748 | break; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4749 | default: |
| 4750 | ret = -EPERM; |
| 4751 | } |
| 4752 | /* Make sure test vector is set before starting measurements. */ |
| 4753 | mb(); |
| 4754 | |
| 4755 | spin_unlock_irqrestore(&local_clock_reg_lock, flags); |
| 4756 | |
| 4757 | return ret; |
| 4758 | } |
| 4759 | |
| 4760 | /* Sample clock for 'ticks' reference clock ticks. */ |
| 4761 | static u32 run_measurement(unsigned ticks) |
| 4762 | { |
| 4763 | /* Stop counters and set the XO4 counter start value. */ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4764 | writel_relaxed(ticks, RINGOSC_TCXO_CTL_REG); |
| 4765 | |
| 4766 | /* Wait for timer to become ready. */ |
| 4767 | while ((readl_relaxed(RINGOSC_STATUS_REG) & BIT(25)) != 0) |
| 4768 | cpu_relax(); |
| 4769 | |
| 4770 | /* Run measurement and wait for completion. */ |
| 4771 | writel_relaxed(BIT(20)|ticks, RINGOSC_TCXO_CTL_REG); |
| 4772 | while ((readl_relaxed(RINGOSC_STATUS_REG) & BIT(25)) == 0) |
| 4773 | cpu_relax(); |
| 4774 | |
| 4775 | /* Stop counters. */ |
| 4776 | writel_relaxed(0x0, RINGOSC_TCXO_CTL_REG); |
| 4777 | |
| 4778 | /* Return measured ticks. */ |
| 4779 | return readl_relaxed(RINGOSC_STATUS_REG) & BM(24, 0); |
| 4780 | } |
| 4781 | |
| 4782 | |
| 4783 | /* Perform a hardware rate measurement for a given clock. |
| 4784 | FOR DEBUG USE ONLY: Measurements take ~15 ms! */ |
Matt Wagantall | 9de3bfb | 2011-11-03 20:13:12 -0700 | [diff] [blame] | 4785 | static unsigned long measure_clk_get_rate(struct clk *c) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4786 | { |
| 4787 | unsigned long flags; |
| 4788 | u32 pdm_reg_backup, ringosc_reg_backup; |
| 4789 | u64 raw_count_short, raw_count_full; |
Matt Wagantall | 8b38f94 | 2011-08-02 18:23:18 -0700 | [diff] [blame] | 4790 | struct measure_clk *clk = to_measure_clk(c); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4791 | unsigned ret; |
| 4792 | |
Stephen Boyd | e334aeb | 2012-01-24 12:17:29 -0800 | [diff] [blame] | 4793 | ret = clk_prepare_enable(&cxo_clk.c); |
Stephen Boyd | 3a35f0b | 2012-01-11 16:18:26 -0800 | [diff] [blame] | 4794 | if (ret) { |
| 4795 | pr_warning("CXO clock failed to enable. Can't measure\n"); |
| 4796 | return 0; |
| 4797 | } |
| 4798 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4799 | spin_lock_irqsave(&local_clock_reg_lock, flags); |
| 4800 | |
| 4801 | /* Enable CXO/4 and RINGOSC branch and root. */ |
| 4802 | pdm_reg_backup = readl_relaxed(PDM_CLK_NS_REG); |
| 4803 | ringosc_reg_backup = readl_relaxed(RINGOSC_NS_REG); |
| 4804 | writel_relaxed(0x2898, PDM_CLK_NS_REG); |
| 4805 | writel_relaxed(0xA00, RINGOSC_NS_REG); |
| 4806 | |
| 4807 | /* |
| 4808 | * The ring oscillator counter will not reset if the measured clock |
| 4809 | * is not running. To detect this, run a short measurement before |
| 4810 | * the full measurement. If the raw results of the two are the same |
| 4811 | * then the clock must be off. |
| 4812 | */ |
| 4813 | |
| 4814 | /* Run a short measurement. (~1 ms) */ |
| 4815 | raw_count_short = run_measurement(0x1000); |
| 4816 | /* Run a full measurement. (~14 ms) */ |
Matt Wagantall | 8b38f94 | 2011-08-02 18:23:18 -0700 | [diff] [blame] | 4817 | raw_count_full = run_measurement(clk->sample_ticks); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4818 | |
| 4819 | writel_relaxed(ringosc_reg_backup, RINGOSC_NS_REG); |
| 4820 | writel_relaxed(pdm_reg_backup, PDM_CLK_NS_REG); |
| 4821 | |
| 4822 | /* Return 0 if the clock is off. */ |
| 4823 | if (raw_count_full == raw_count_short) |
| 4824 | ret = 0; |
| 4825 | else { |
| 4826 | /* Compute rate in Hz. */ |
| 4827 | raw_count_full = ((raw_count_full * 10) + 15) * 4800000; |
Matt Wagantall | 8b38f94 | 2011-08-02 18:23:18 -0700 | [diff] [blame] | 4828 | do_div(raw_count_full, ((clk->sample_ticks * 10) + 35)); |
| 4829 | ret = (raw_count_full * clk->multiplier); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4830 | } |
| 4831 | |
| 4832 | /* Route dbg_hs_clk to PLLTEST. 300mV single-ended amplitude. */ |
Stephen Boyd | 69da840 | 2011-07-14 17:45:31 -0700 | [diff] [blame] | 4833 | writel_relaxed(0x38F8, PLLTEST_PAD_CFG_REG); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4834 | spin_unlock_irqrestore(&local_clock_reg_lock, flags); |
| 4835 | |
Stephen Boyd | e334aeb | 2012-01-24 12:17:29 -0800 | [diff] [blame] | 4836 | clk_disable_unprepare(&cxo_clk.c); |
Stephen Boyd | 3a35f0b | 2012-01-11 16:18:26 -0800 | [diff] [blame] | 4837 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4838 | return ret; |
| 4839 | } |
| 4840 | #else /* !CONFIG_DEBUG_FS */ |
| 4841 | static int measure_clk_set_parent(struct clk *clk, struct clk *parent) |
| 4842 | { |
| 4843 | return -EINVAL; |
| 4844 | } |
| 4845 | |
Matt Wagantall | 9de3bfb | 2011-11-03 20:13:12 -0700 | [diff] [blame] | 4846 | static unsigned long measure_clk_get_rate(struct clk *clk) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4847 | { |
| 4848 | return 0; |
| 4849 | } |
| 4850 | #endif /* CONFIG_DEBUG_FS */ |
| 4851 | |
| 4852 | static struct clk_ops measure_clk_ops = { |
| 4853 | .set_parent = measure_clk_set_parent, |
| 4854 | .get_rate = measure_clk_get_rate, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4855 | }; |
| 4856 | |
Matt Wagantall | 8b38f94 | 2011-08-02 18:23:18 -0700 | [diff] [blame] | 4857 | static struct measure_clk measure_clk = { |
| 4858 | .c = { |
| 4859 | .dbg_name = "measure_clk", |
| 4860 | .ops = &measure_clk_ops, |
| 4861 | CLK_INIT(measure_clk.c), |
| 4862 | }, |
| 4863 | .multiplier = 1, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4864 | }; |
| 4865 | |
Tianyi Gou | a8b3cce | 2011-11-08 14:37:26 -0800 | [diff] [blame] | 4866 | static struct clk_lookup msm_clocks_8064[] = { |
Stephen Boyd | 72a8035 | 2012-01-26 15:57:38 -0800 | [diff] [blame] | 4867 | CLK_LOOKUP("xo", cxo_a_clk.c, ""), |
| 4868 | CLK_LOOKUP("xo", pxo_a_clk.c, ""), |
Stephen Boyd | ed630b0 | 2012-01-26 15:26:47 -0800 | [diff] [blame] | 4869 | CLK_LOOKUP("cxo", cxo_clk.c, "wcnss_wlan.0"), |
| 4870 | CLK_LOOKUP("cxo", cxo_clk.c, "pil_riva"), |
| 4871 | CLK_LOOKUP("xo", pxo_clk.c, "pil_qdsp6v4.0"), |
| 4872 | CLK_LOOKUP("xo", cxo_clk.c, "pil_qdsp6v4.1"), |
| 4873 | CLK_LOOKUP("xo", cxo_clk.c, "pil_qdsp6v4.2"), |
Matt Wagantall | 292aace | 2012-01-26 19:12:34 -0800 | [diff] [blame] | 4874 | CLK_LOOKUP("xo", cxo_clk.c, "pil_gss"), |
Stephen Boyd | 69d35e3 | 2012-02-14 15:33:30 -0800 | [diff] [blame] | 4875 | CLK_LOOKUP("xo", cxo_clk.c, "BAM_RMNT"), |
Stephen Boyd | 5a190a8 | 2012-03-01 14:45:15 -0800 | [diff] [blame] | 4876 | CLK_LOOKUP("xo", cxo_clk.c, "msm_xo"), |
Stephen Boyd | ed630b0 | 2012-01-26 15:26:47 -0800 | [diff] [blame] | 4877 | CLK_LOOKUP("pll2", pll2_clk.c, NULL), |
| 4878 | CLK_LOOKUP("pll8", pll8_clk.c, NULL), |
| 4879 | CLK_LOOKUP("pll4", pll4_clk.c, NULL), |
| 4880 | CLK_LOOKUP("measure", measure_clk.c, "debug"), |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 4881 | |
Tianyi Gou | 21a0e80 | 2012-02-04 22:34:10 -0800 | [diff] [blame] | 4882 | CLK_LOOKUP("bus_clk", afab_clk.c, "msm_apps_fab"), |
| 4883 | CLK_LOOKUP("bus_a_clk", afab_a_clk.c, "msm_apps_fab"), |
| 4884 | CLK_LOOKUP("bus_clk", cfpb_clk.c, "msm_cpss_fpb"), |
| 4885 | CLK_LOOKUP("bus_a_clk", cfpb_a_clk.c, "msm_cpss_fpb"), |
| 4886 | CLK_LOOKUP("bus_clk", sfab_clk.c, "msm_sys_fab"), |
Stephen Boyd | d7a143a | 2012-02-16 17:59:26 -0800 | [diff] [blame] | 4887 | 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] | 4888 | CLK_LOOKUP("bus_clk", sfpb_clk.c, "msm_sys_fpb"), |
| 4889 | CLK_LOOKUP("bus_a_clk", sfpb_a_clk.c, "msm_sys_fpb"), |
| 4890 | CLK_LOOKUP("bus_clk", mmfab_clk.c, "msm_mm_fab"), |
| 4891 | CLK_LOOKUP("bus_a_clk", mmfab_a_clk.c, "msm_mm_fab"), |
| 4892 | CLK_LOOKUP("mem_clk", ebi1_msmbus_clk.c, "msm_bus"), |
| 4893 | CLK_LOOKUP("mem_a_clk", ebi1_a_clk.c, "msm_bus"), |
Gagan Mac | bc5f81d | 2012-04-04 15:03:12 -0600 | [diff] [blame] | 4894 | CLK_LOOKUP("dfab_clk", dfab_msmbus_clk.c, "msm_bus"), |
| 4895 | CLK_LOOKUP("dfab_a_clk", dfab_msmbus_a_clk.c, "msm_bus"), |
Matt Wagantall | b2710b8 | 2011-11-16 19:55:17 -0800 | [diff] [blame] | 4896 | |
Tianyi Gou | 21a0e80 | 2012-02-04 22:34:10 -0800 | [diff] [blame] | 4897 | CLK_LOOKUP("ebi1_clk", ebi1_clk.c, ""), |
Tianyi Gou | 21a0e80 | 2012-02-04 22:34:10 -0800 | [diff] [blame] | 4898 | CLK_LOOKUP("mmfpb_clk", mmfpb_clk.c, ""), |
| 4899 | CLK_LOOKUP("mmfpb_a_clk", mmfpb_a_clk.c, "clock-8960"), |
| 4900 | CLK_LOOKUP("cfpb_a_clk", cfpb_a_clk.c, "clock-8960"), |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 4901 | |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 4902 | CLK_LOOKUP("core_clk", gp0_clk.c, ""), |
| 4903 | CLK_LOOKUP("core_clk", gp1_clk.c, ""), |
| 4904 | CLK_LOOKUP("core_clk", gp2_clk.c, ""), |
Jin Hong | 4bbbfba | 2012-02-02 21:48:07 -0800 | [diff] [blame] | 4905 | CLK_LOOKUP("core_clk", gsbi1_uart_clk.c, "msm_serial_hsl.1"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 4906 | CLK_LOOKUP("core_clk", gsbi2_uart_clk.c, ""), |
| 4907 | CLK_LOOKUP("core_clk", gsbi3_uart_clk.c, ""), |
| 4908 | CLK_LOOKUP("core_clk", gsbi4_uart_clk.c, ""), |
| 4909 | CLK_LOOKUP("core_clk", gsbi5_uart_clk.c, ""), |
| 4910 | CLK_LOOKUP("core_clk", gsbi6_uart_clk.c, ""), |
Jin Hong | 4bbbfba | 2012-02-02 21:48:07 -0800 | [diff] [blame] | 4911 | CLK_LOOKUP("core_clk", gsbi7_uart_clk.c, "msm_serial_hsl.0"), |
David Keitel | 3c40fc5 | 2012-02-09 17:53:52 -0800 | [diff] [blame] | 4912 | CLK_LOOKUP("core_clk", gsbi1_qup_clk.c, "qup_i2c.0"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 4913 | CLK_LOOKUP("core_clk", gsbi2_qup_clk.c, ""), |
Jing Lin | 04601f9 | 2012-02-05 15:36:07 -0800 | [diff] [blame] | 4914 | CLK_LOOKUP("core_clk", gsbi3_qup_clk.c, "qup_i2c.3"), |
Kevin Chan | d07220e | 2012-02-13 15:52:22 -0800 | [diff] [blame] | 4915 | CLK_LOOKUP("core_clk", gsbi4_qup_clk.c, "qup_i2c.4"), |
Stepan Moskovchenko | 6499900 | 2012-01-31 15:52:59 -0800 | [diff] [blame] | 4916 | CLK_LOOKUP("core_clk", gsbi5_qup_clk.c, "spi_qsd.0"), |
Joel King | 8f839b9 | 2012-04-01 14:37:46 -0700 | [diff] [blame] | 4917 | CLK_LOOKUP("core_clk", gsbi5_qup_clk.c, "qup_i2c.5"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 4918 | CLK_LOOKUP("core_clk", gsbi6_qup_clk.c, ""), |
| 4919 | CLK_LOOKUP("core_clk", gsbi7_qup_clk.c, ""), |
| 4920 | CLK_LOOKUP("core_clk", pdm_clk.c, ""), |
Tianyi Gou | 50f2381 | 2012-02-06 16:04:19 -0800 | [diff] [blame] | 4921 | CLK_LOOKUP("mem_clk", pmem_clk.c, "msm_sps"), |
Tianyi Gou | 05e0110 | 2012-02-08 22:15:49 -0800 | [diff] [blame] | 4922 | CLK_LOOKUP("core_clk", prng_clk.c, "msm_rng.0"), |
Tianyi Gou | 43208a0 | 2011-09-27 15:35:13 -0700 | [diff] [blame] | 4923 | CLK_LOOKUP("core_clk", sdc1_clk.c, "msm_sdcc.1"), |
| 4924 | CLK_LOOKUP("core_clk", sdc2_clk.c, "msm_sdcc.2"), |
| 4925 | CLK_LOOKUP("core_clk", sdc3_clk.c, "msm_sdcc.3"), |
| 4926 | CLK_LOOKUP("core_clk", sdc4_clk.c, "msm_sdcc.4"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 4927 | CLK_LOOKUP("ref_clk", tsif_ref_clk.c, ""), |
| 4928 | CLK_LOOKUP("core_clk", tssc_clk.c, ""), |
Manu Gautam | 5143b25 | 2012-01-05 19:25:23 -0800 | [diff] [blame] | 4929 | CLK_LOOKUP("alt_core_clk", usb_hs1_xcvr_clk.c, "msm_otg"), |
| 4930 | CLK_LOOKUP("alt_core_clk", usb_hs3_xcvr_clk.c, "msm_ehci_host.0"), |
| 4931 | 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] | 4932 | CLK_LOOKUP("src_clk", usb_fs1_src_clk.c, ""), |
| 4933 | CLK_LOOKUP("alt_core_clk", usb_fs1_xcvr_clk.c, ""), |
| 4934 | CLK_LOOKUP("sys_clk", usb_fs1_sys_clk.c, ""), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 4935 | CLK_LOOKUP("ref_clk", sata_phy_ref_clk.c, ""), |
| 4936 | CLK_LOOKUP("cfg_clk", sata_phy_cfg_clk.c, ""), |
Ramesh Masavarapu | 2831191 | 2011-10-27 11:04:12 -0700 | [diff] [blame] | 4937 | CLK_LOOKUP("iface_clk", ce3_p_clk.c, "qce.0"), |
| 4938 | CLK_LOOKUP("iface_clk", ce3_p_clk.c, "qcrypto.0"), |
| 4939 | CLK_LOOKUP("core_clk", ce3_core_clk.c, "qce.0"), |
| 4940 | CLK_LOOKUP("core_clk", ce3_core_clk.c, "qcrypto.0"), |
| 4941 | CLK_LOOKUP("ce3_core_src_clk", ce3_src_clk.c, "qce.0"), |
| 4942 | CLK_LOOKUP("ce3_core_src_clk", ce3_src_clk.c, "qcrypto.0"), |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 4943 | CLK_LOOKUP("dma_bam_pclk", dma_bam_p_clk.c, NULL), |
Jin Hong | 4bbbfba | 2012-02-02 21:48:07 -0800 | [diff] [blame] | 4944 | CLK_LOOKUP("iface_clk", gsbi1_p_clk.c, "msm_serial_hsl.1"), |
David Keitel | 3c40fc5 | 2012-02-09 17:53:52 -0800 | [diff] [blame] | 4945 | CLK_LOOKUP("iface_clk", gsbi1_p_clk.c, "qup_i2c.0"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 4946 | CLK_LOOKUP("iface_clk", gsbi2_p_clk.c, ""), |
Jing Lin | 04601f9 | 2012-02-05 15:36:07 -0800 | [diff] [blame] | 4947 | CLK_LOOKUP("iface_clk", gsbi3_p_clk.c, "qup_i2c.3"), |
Kevin Chan | d07220e | 2012-02-13 15:52:22 -0800 | [diff] [blame] | 4948 | CLK_LOOKUP("iface_clk", gsbi4_p_clk.c, "qup_i2c.4"), |
Stepan Moskovchenko | 6499900 | 2012-01-31 15:52:59 -0800 | [diff] [blame] | 4949 | CLK_LOOKUP("iface_clk", gsbi5_p_clk.c, "spi_qsd.0"), |
Joel King | 8f839b9 | 2012-04-01 14:37:46 -0700 | [diff] [blame] | 4950 | CLK_LOOKUP("iface_clk", gsbi5_p_clk.c, "qup_i2c.5"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 4951 | CLK_LOOKUP("iface_clk", gsbi6_p_clk.c, ""), |
Jin Hong | 4bbbfba | 2012-02-02 21:48:07 -0800 | [diff] [blame] | 4952 | CLK_LOOKUP("iface_clk", gsbi7_p_clk.c, "msm_serial_hsl.0"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 4953 | CLK_LOOKUP("iface_clk", tsif_p_clk.c, ""), |
| 4954 | CLK_LOOKUP("iface_clk", usb_fs1_p_clk.c, ""), |
Manu Gautam | 5143b25 | 2012-01-05 19:25:23 -0800 | [diff] [blame] | 4955 | CLK_LOOKUP("iface_clk", usb_hs1_p_clk.c, "msm_otg"), |
Manu Gautam | 7483f17 | 2011-11-08 15:22:26 +0530 | [diff] [blame] | 4956 | CLK_LOOKUP("iface_clk", usb_hs3_p_clk.c, "msm_ehci_host.0"), |
| 4957 | 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] | 4958 | CLK_LOOKUP("iface_clk", sdc1_p_clk.c, "msm_sdcc.1"), |
| 4959 | CLK_LOOKUP("iface_clk", sdc2_p_clk.c, "msm_sdcc.2"), |
| 4960 | CLK_LOOKUP("iface_clk", sdc3_p_clk.c, "msm_sdcc.3"), |
| 4961 | CLK_LOOKUP("iface_clk", sdc4_p_clk.c, "msm_sdcc.4"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 4962 | CLK_LOOKUP("iface_clk", pcie_p_clk.c, ""), |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 4963 | CLK_LOOKUP("core_clk", adm0_clk.c, "msm_dmov"), |
| 4964 | CLK_LOOKUP("iface_clk", adm0_p_clk.c, "msm_dmov"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 4965 | CLK_LOOKUP("iface_clk", pmic_arb0_p_clk.c, ""), |
| 4966 | CLK_LOOKUP("iface_clk", pmic_arb1_p_clk.c, ""), |
| 4967 | CLK_LOOKUP("core_clk", pmic_ssbi2_clk.c, ""), |
| 4968 | CLK_LOOKUP("mem_clk", rpm_msg_ram_p_clk.c, ""), |
Kevin Chan | d07220e | 2012-02-13 15:52:22 -0800 | [diff] [blame] | 4969 | CLK_LOOKUP("cam_clk", cam0_clk.c, "4-001a"), |
Sreesudhan Ramakrish Ramkumar | 3381da7 | 2012-01-27 08:08:32 -0800 | [diff] [blame] | 4970 | CLK_LOOKUP("cam_clk", cam0_clk.c, "4-0034"), |
Sreesudhan Ramakrish Ramkumar | 8002a79 | 2012-04-09 17:42:58 -0700 | [diff] [blame] | 4971 | CLK_LOOKUP("cam_clk", cam0_clk.c, "4-0020"), |
Sreesudhan Ramakrish Ramkumar | 6c6f57c | 2012-02-21 15:12:44 -0800 | [diff] [blame] | 4972 | CLK_LOOKUP("cam_clk", cam1_clk.c, "4-0048"), |
Kevin Chan | d07220e | 2012-02-13 15:52:22 -0800 | [diff] [blame] | 4973 | CLK_LOOKUP("cam_clk", cam1_clk.c, "4-006c"), |
| 4974 | CLK_LOOKUP("csi_src_clk", csi0_src_clk.c, "msm_csid.0"), |
| 4975 | CLK_LOOKUP("csi_src_clk", csi1_src_clk.c, "msm_csid.1"), |
| 4976 | CLK_LOOKUP("csi_src_clk", csi2_src_clk.c, "msm_csid.2"), |
| 4977 | CLK_LOOKUP("csi_clk", csi0_clk.c, "msm_csid.0"), |
| 4978 | CLK_LOOKUP("csi_clk", csi1_clk.c, "msm_csid.1"), |
| 4979 | CLK_LOOKUP("csi_clk", csi2_clk.c, "msm_csid.2"), |
| 4980 | CLK_LOOKUP("csi_phy_clk", csi0_phy_clk.c, "msm_csid.0"), |
| 4981 | CLK_LOOKUP("csi_phy_clk", csi1_phy_clk.c, "msm_csid.1"), |
| 4982 | CLK_LOOKUP("csi_phy_clk", csi2_phy_clk.c, "msm_csid.2"), |
| 4983 | CLK_LOOKUP("csi_pix_clk", csi_pix_clk.c, "msm_ispif.0"), |
| 4984 | CLK_LOOKUP("csi_pix1_clk", csi_pix1_clk.c, "msm_ispif.0"), |
| 4985 | CLK_LOOKUP("csi_rdi_clk", csi_rdi_clk.c, "msm_ispif.0"), |
| 4986 | CLK_LOOKUP("csi_rdi1_clk", csi_rdi1_clk.c, "msm_ispif.0"), |
| 4987 | CLK_LOOKUP("csi_rdi2_clk", csi_rdi2_clk.c, "msm_ispif.0"), |
| 4988 | CLK_LOOKUP("csiphy_timer_src_clk", |
| 4989 | csiphy_timer_src_clk.c, "msm_csiphy.0"), |
| 4990 | CLK_LOOKUP("csiphy_timer_src_clk", |
| 4991 | csiphy_timer_src_clk.c, "msm_csiphy.1"), |
| 4992 | CLK_LOOKUP("csiphy_timer_src_clk", |
| 4993 | csiphy_timer_src_clk.c, "msm_csiphy.2"), |
| 4994 | CLK_LOOKUP("csiphy_timer_clk", csi0phy_timer_clk.c, "msm_csiphy.0"), |
| 4995 | CLK_LOOKUP("csiphy_timer_clk", csi1phy_timer_clk.c, "msm_csiphy.1"), |
| 4996 | CLK_LOOKUP("csiphy_timer_clk", csi2phy_timer_clk.c, "msm_csiphy.2"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 4997 | CLK_LOOKUP("byte_clk", dsi1_byte_clk.c, "mipi_dsi.1"), |
| 4998 | CLK_LOOKUP("byte_clk", dsi2_byte_clk.c, "mipi_dsi.2"), |
| 4999 | CLK_LOOKUP("esc_clk", dsi1_esc_clk.c, "mipi_dsi.1"), |
| 5000 | CLK_LOOKUP("esc_clk", dsi2_esc_clk.c, "mipi_dsi.2"), |
Tianyi Gou | 5191880 | 2012-01-26 14:05:43 -0800 | [diff] [blame] | 5001 | CLK_LOOKUP("rgb_clk", rgb_tv_clk.c, ""), |
| 5002 | CLK_LOOKUP("npl_clk", npl_tv_clk.c, ""), |
| 5003 | |
Pu Chen | 86b4be9 | 2011-11-03 17:27:57 -0700 | [diff] [blame] | 5004 | CLK_LOOKUP("core_clk", gfx3d_clk.c, "kgsl-3d0.0"), |
Matt Wagantall | c9a780c | 2011-10-28 12:12:18 -0700 | [diff] [blame] | 5005 | CLK_LOOKUP("core_clk", gfx3d_clk.c, "footswitch-8x60.2"), |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 5006 | CLK_LOOKUP("bus_clk", |
| 5007 | gfx3d_axi_clk_8064.c, "footswitch-8x60.2"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5008 | CLK_LOOKUP("iface_clk", vcap_p_clk.c, ""), |
Terence Hampson | 2e1705f | 2012-04-11 19:55:29 -0400 | [diff] [blame] | 5009 | CLK_LOOKUP("iface_clk", vcap_p_clk.c, "msm_vcap.0"), |
Matt Wagantall | c9a780c | 2011-10-28 12:12:18 -0700 | [diff] [blame] | 5010 | CLK_LOOKUP("iface_clk", vcap_p_clk.c, "footswitch-8x60.10"), |
| 5011 | CLK_LOOKUP("bus_clk", vcap_axi_clk.c, "footswitch-8x60.10"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5012 | CLK_LOOKUP("core_clk", vcap_clk.c, ""), |
Terence Hampson | 2e1705f | 2012-04-11 19:55:29 -0400 | [diff] [blame] | 5013 | CLK_LOOKUP("core_clk", vcap_clk.c, "msm_vcap.0"), |
Matt Wagantall | c9a780c | 2011-10-28 12:12:18 -0700 | [diff] [blame] | 5014 | CLK_LOOKUP("core_clk", vcap_clk.c, "footswitch-8x60.10"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5015 | CLK_LOOKUP("vcap_npl_clk", vcap_npl_clk.c, ""), |
Terence Hampson | 2e1705f | 2012-04-11 19:55:29 -0400 | [diff] [blame] | 5016 | CLK_LOOKUP("vcap_npl_clk", vcap_npl_clk.c, "msm_vcap.0"), |
Matt Wagantall | c9a780c | 2011-10-28 12:12:18 -0700 | [diff] [blame] | 5017 | CLK_LOOKUP("bus_clk", ijpeg_axi_clk.c, "footswitch-8x60.3"), |
Matt Wagantall | f45cd36 | 2012-05-03 21:09:44 -0700 | [diff] [blame] | 5018 | CLK_LOOKUP("mem_clk", imem_axi_clk.c, "msm_gemini.0"), |
| 5019 | CLK_LOOKUP("core_clk", ijpeg_clk.c, "msm_gemini.0"), |
Matt Wagantall | c9a780c | 2011-10-28 12:12:18 -0700 | [diff] [blame] | 5020 | CLK_LOOKUP("core_clk", ijpeg_clk.c, "footswitch-8x60.3"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5021 | CLK_LOOKUP("core_clk", jpegd_clk.c, ""), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 5022 | CLK_LOOKUP("core_clk", mdp_clk.c, "mdp.0"), |
Matt Wagantall | c9a780c | 2011-10-28 12:12:18 -0700 | [diff] [blame] | 5023 | CLK_LOOKUP("core_clk", mdp_clk.c, "footswitch-8x60.4"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 5024 | CLK_LOOKUP("vsync_clk", mdp_vsync_clk.c, "mdp.0"), |
Matt Wagantall | b82a513 | 2011-12-12 22:26:41 -0800 | [diff] [blame] | 5025 | CLK_LOOKUP("vsync_clk", mdp_vsync_clk.c, "footswitch-8x60.4"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 5026 | CLK_LOOKUP("lut_clk", lut_mdp_clk.c, "mdp.0"), |
Matt Wagantall | b82a513 | 2011-12-12 22:26:41 -0800 | [diff] [blame] | 5027 | CLK_LOOKUP("lut_clk", lut_mdp_clk.c, "footswitch-8x60.4"), |
Matt Wagantall | bb90da9 | 2011-10-25 15:07:52 -0700 | [diff] [blame] | 5028 | CLK_LOOKUP("core_clk", rot_clk.c, "msm_rotator.0"), |
Matt Wagantall | c9a780c | 2011-10-28 12:12:18 -0700 | [diff] [blame] | 5029 | CLK_LOOKUP("core_clk", rot_clk.c, "footswitch-8x60.6"), |
Matt Wagantall | 6128631 | 2012-02-22 15:55:09 -0800 | [diff] [blame] | 5030 | CLK_LOOKUP("tv_src_clk", tv_src_clk.c, "footswitch-8x60.4"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 5031 | CLK_LOOKUP("src_clk", tv_src_clk.c, "dtv.0"), |
| 5032 | CLK_LOOKUP("div_clk", tv_src_div_clk.c, ""), |
Greg Grisco | fa47b53 | 2011-11-11 10:32:06 -0800 | [diff] [blame] | 5033 | CLK_LOOKUP("core_clk", vcodec_clk.c, "msm_vidc.0"), |
Matt Wagantall | c9a780c | 2011-10-28 12:12:18 -0700 | [diff] [blame] | 5034 | CLK_LOOKUP("core_clk", vcodec_clk.c, "footswitch-8x60.7"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 5035 | CLK_LOOKUP("mdp_clk", mdp_tv_clk.c, "dtv.0"), |
Tianyi Gou | 5191880 | 2012-01-26 14:05:43 -0800 | [diff] [blame] | 5036 | CLK_LOOKUP("tv_clk", mdp_tv_clk.c, "footswitch-8x60.4"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 5037 | CLK_LOOKUP("hdmi_clk", hdmi_tv_clk.c, "dtv.0"), |
Aravind Venkateswaran | 0507c8c | 2012-02-16 17:16:05 -0800 | [diff] [blame] | 5038 | CLK_LOOKUP("core_clk", hdmi_app_clk.c, "hdmi_msm.1"), |
Ujwal Patel | d041f98 | 2012-03-27 19:51:44 -0700 | [diff] [blame] | 5039 | CLK_LOOKUP("vpe_clk", vpe_clk.c, "msm_vpe.0"), |
Matt Wagantall | c9a780c | 2011-10-28 12:12:18 -0700 | [diff] [blame] | 5040 | CLK_LOOKUP("core_clk", vpe_clk.c, "footswitch-8x60.9"), |
Kevin Chan | d07220e | 2012-02-13 15:52:22 -0800 | [diff] [blame] | 5041 | CLK_LOOKUP("vfe_clk", vfe_clk.c, "msm_vfe.0"), |
Matt Wagantall | c9a780c | 2011-10-28 12:12:18 -0700 | [diff] [blame] | 5042 | CLK_LOOKUP("core_clk", vfe_clk.c, "footswitch-8x60.8"), |
Kevin Chan | d07220e | 2012-02-13 15:52:22 -0800 | [diff] [blame] | 5043 | CLK_LOOKUP("csi_vfe_clk", csi_vfe_clk.c, "msm_vfe.0"), |
Matt Wagantall | c9a780c | 2011-10-28 12:12:18 -0700 | [diff] [blame] | 5044 | CLK_LOOKUP("bus_clk", vfe_axi_clk.c, "footswitch-8x60.8"), |
| 5045 | CLK_LOOKUP("bus_clk", mdp_axi_clk.c, "footswitch-8x60.4"), |
| 5046 | CLK_LOOKUP("bus_clk", rot_axi_clk.c, "footswitch-8x60.6"), |
| 5047 | CLK_LOOKUP("bus_clk", vcodec_axi_clk.c, "footswitch-8x60.7"), |
| 5048 | CLK_LOOKUP("bus_a_clk", vcodec_axi_a_clk.c, "footswitch-8x60.7"), |
| 5049 | CLK_LOOKUP("bus_b_clk", vcodec_axi_b_clk.c, "footswitch-8x60.7"), |
| 5050 | CLK_LOOKUP("bus_clk", vpe_axi_clk.c, "footswitch-8x60.9"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 5051 | CLK_LOOKUP("arb_clk", amp_p_clk.c, "mipi_dsi.1"), |
| 5052 | CLK_LOOKUP("arb_clk", amp_p_clk.c, "mipi_dsi.2"), |
Kevin Chan | d07220e | 2012-02-13 15:52:22 -0800 | [diff] [blame] | 5053 | CLK_LOOKUP("csi_pclk", csi_p_clk.c, "msm_csid.0"), |
| 5054 | CLK_LOOKUP("csi_pclk", csi_p_clk.c, "msm_csid.1"), |
| 5055 | CLK_LOOKUP("csi_pclk", csi_p_clk.c, "msm_csid.2"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 5056 | CLK_LOOKUP("master_iface_clk", dsi1_m_p_clk.c, "mipi_dsi.1"), |
| 5057 | CLK_LOOKUP("slave_iface_clk", dsi1_s_p_clk.c, "mipi_dsi.1"), |
| 5058 | CLK_LOOKUP("master_iface_clk", dsi2_m_p_clk.c, "mipi_dsi.2"), |
| 5059 | CLK_LOOKUP("slave_iface_clk", dsi2_s_p_clk.c, "mipi_dsi.2"), |
Pu Chen | 86b4be9 | 2011-11-03 17:27:57 -0700 | [diff] [blame] | 5060 | CLK_LOOKUP("iface_clk", gfx3d_p_clk.c, "kgsl-3d0.0"), |
Matt Wagantall | c9a780c | 2011-10-28 12:12:18 -0700 | [diff] [blame] | 5061 | CLK_LOOKUP("iface_clk", gfx3d_p_clk.c, "footswitch-8x60.2"), |
Aravind Venkateswaran | 0507c8c | 2012-02-16 17:16:05 -0800 | [diff] [blame] | 5062 | CLK_LOOKUP("master_iface_clk", hdmi_m_p_clk.c, "hdmi_msm.1"), |
| 5063 | CLK_LOOKUP("slave_iface_clk", hdmi_s_p_clk.c, "hdmi_msm.1"), |
Matt Wagantall | f45cd36 | 2012-05-03 21:09:44 -0700 | [diff] [blame] | 5064 | CLK_LOOKUP("iface_clk", ijpeg_p_clk.c, "msm_gemini.0"), |
Matt Wagantall | c9a780c | 2011-10-28 12:12:18 -0700 | [diff] [blame] | 5065 | CLK_LOOKUP("iface_clk", ijpeg_p_clk.c, "footswitch-8x60.3"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5066 | CLK_LOOKUP("iface_clk", jpegd_p_clk.c, ""), |
Matt Wagantall | 5d44ef2 | 2012-01-23 11:01:05 -0800 | [diff] [blame] | 5067 | CLK_LOOKUP("mem_iface_clk", imem_p_clk.c, "kgsl-3d0.0"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 5068 | CLK_LOOKUP("iface_clk", mdp_p_clk.c, "mdp.0"), |
Matt Wagantall | c9a780c | 2011-10-28 12:12:18 -0700 | [diff] [blame] | 5069 | CLK_LOOKUP("iface_clk", mdp_p_clk.c, "footswitch-8x60.4"), |
Stepan Moskovchenko | 279b785 | 2012-01-31 20:42:46 -0800 | [diff] [blame] | 5070 | CLK_LOOKUP("iface_clk", smmu_p_clk.c, "msm_iommu"), |
Matt Wagantall | bb90da9 | 2011-10-25 15:07:52 -0700 | [diff] [blame] | 5071 | CLK_LOOKUP("iface_clk", rot_p_clk.c, "msm_rotator.0"), |
Matt Wagantall | c9a780c | 2011-10-28 12:12:18 -0700 | [diff] [blame] | 5072 | CLK_LOOKUP("iface_clk", rot_p_clk.c, "footswitch-8x60.6"), |
Greg Grisco | fa47b53 | 2011-11-11 10:32:06 -0800 | [diff] [blame] | 5073 | CLK_LOOKUP("iface_clk", vcodec_p_clk.c, "msm_vidc.0"), |
Matt Wagantall | c9a780c | 2011-10-28 12:12:18 -0700 | [diff] [blame] | 5074 | CLK_LOOKUP("iface_clk", vcodec_p_clk.c, "footswitch-8x60.7"), |
Kevin Chan | d07220e | 2012-02-13 15:52:22 -0800 | [diff] [blame] | 5075 | CLK_LOOKUP("vfe_pclk", vfe_p_clk.c, "msm_vfe.0"), |
Matt Wagantall | c9a780c | 2011-10-28 12:12:18 -0700 | [diff] [blame] | 5076 | CLK_LOOKUP("iface_clk", vfe_p_clk.c, "footswitch-8x60.8"), |
Kevin Chan | b20742b | 2012-02-27 15:47:35 -0800 | [diff] [blame] | 5077 | CLK_LOOKUP("vpe_pclk", vpe_p_clk.c, "msm_vpe.0"), |
Matt Wagantall | 6128631 | 2012-02-22 15:55:09 -0800 | [diff] [blame] | 5078 | CLK_LOOKUP("iface_clk", vpe_p_clk.c, "footswitch-8x60.9"), |
Tianyi Gou | 21a0e80 | 2012-02-04 22:34:10 -0800 | [diff] [blame] | 5079 | |
Kuirong Wang | a9c3acc | 2012-02-09 17:00:45 -0800 | [diff] [blame] | 5080 | CLK_LOOKUP("bit_clk", mi2s_bit_clk.c, "msm-dai-q6.6"), |
| 5081 | CLK_LOOKUP("osr_clk", mi2s_osr_clk.c, "msm-dai-q6.6"), |
Kuirong Wang | 4f4d131 | 2012-03-31 12:50:10 -0700 | [diff] [blame] | 5082 | CLK_LOOKUP("bit_clk", mi2s_bit_clk.c, "msm-dai-q6.7"), |
| 5083 | CLK_LOOKUP("osr_clk", mi2s_osr_clk.c, "msm-dai-q6.7"), |
Kuirong Wang | a9c3acc | 2012-02-09 17:00:45 -0800 | [diff] [blame] | 5084 | CLK_LOOKUP("bit_clk", codec_i2s_mic_bit_clk.c, |
| 5085 | "msm-dai-q6.1"), |
| 5086 | CLK_LOOKUP("osr_clk", codec_i2s_mic_osr_clk.c, |
| 5087 | "msm-dai-q6.1"), |
| 5088 | CLK_LOOKUP("bit_clk", spare_i2s_mic_bit_clk.c, |
| 5089 | "msm-dai-q6.5"), |
| 5090 | CLK_LOOKUP("osr_clk", spare_i2s_mic_osr_clk.c, |
| 5091 | "msm-dai-q6.5"), |
| 5092 | CLK_LOOKUP("bit_clk", codec_i2s_spkr_bit_clk.c, |
| 5093 | "msm-dai-q6.16384"), |
| 5094 | CLK_LOOKUP("osr_clk", codec_i2s_spkr_osr_clk.c, |
| 5095 | "msm-dai-q6.16384"), |
| 5096 | CLK_LOOKUP("bit_clk", spare_i2s_spkr_bit_clk.c, |
| 5097 | "msm-dai-q6.4"), |
| 5098 | CLK_LOOKUP("osr_clk", spare_i2s_spkr_osr_clk.c, |
| 5099 | "msm-dai-q6.4"), |
| 5100 | CLK_LOOKUP("pcm_clk", pcm_clk.c, "msm-dai-q6.2"), |
Kiran Kandi | 5f4ab69 | 2012-02-23 11:23:56 -0800 | [diff] [blame] | 5101 | CLK_LOOKUP("pcm_clk", pcm_clk.c, "msm-dai-q6.3"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5102 | CLK_LOOKUP("sps_slimbus_clk", sps_slimbus_clk.c, ""), |
Tianyi Gou | 44a81b0 | 2012-02-06 17:49:07 -0800 | [diff] [blame] | 5103 | CLK_LOOKUP("core_clk", audio_slimbus_clk.c, "msm_slim_ctrl.1"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5104 | CLK_LOOKUP("core_clk", jpegd_axi_clk.c, ""), |
| 5105 | CLK_LOOKUP("core_clk", vpe_axi_clk.c, ""), |
| 5106 | CLK_LOOKUP("core_clk", mdp_axi_clk.c, ""), |
| 5107 | CLK_LOOKUP("core_clk", vcap_axi_clk.c, ""), |
| 5108 | CLK_LOOKUP("core_clk", rot_axi_clk.c, ""), |
| 5109 | CLK_LOOKUP("core_clk", ijpeg_axi_clk.c, ""), |
| 5110 | CLK_LOOKUP("core_clk", vfe_axi_clk.c, ""), |
| 5111 | CLK_LOOKUP("core_clk", vcodec_axi_a_clk.c, ""), |
| 5112 | CLK_LOOKUP("core_clk", vcodec_axi_b_clk.c, ""), |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 5113 | CLK_LOOKUP("core_clk", gfx3d_axi_clk_8064.c, ""), |
Tianyi Gou | 21a0e80 | 2012-02-04 22:34:10 -0800 | [diff] [blame] | 5114 | |
| 5115 | CLK_LOOKUP("dfab_dsps_clk", dfab_dsps_clk.c, NULL), |
| 5116 | CLK_LOOKUP("core_clk", dfab_usb_hs_clk.c, "msm_otg"), |
| 5117 | CLK_LOOKUP("core_clk", dfab_usb_hs3_clk.c, "msm_ehci_host.0"), |
| 5118 | CLK_LOOKUP("core_clk", dfab_usb_hs3_clk.c, "msm_ehci_host.1"), |
| 5119 | CLK_LOOKUP("bus_clk", dfab_sdc1_clk.c, "msm_sdcc.1"), |
| 5120 | CLK_LOOKUP("bus_clk", dfab_sdc2_clk.c, "msm_sdcc.2"), |
| 5121 | CLK_LOOKUP("bus_clk", dfab_sdc3_clk.c, "msm_sdcc.3"), |
| 5122 | CLK_LOOKUP("bus_clk", dfab_sdc4_clk.c, "msm_sdcc.4"), |
| 5123 | CLK_LOOKUP("dfab_clk", dfab_sps_clk.c, "msm_sps"), |
| 5124 | CLK_LOOKUP("bus_clk", dfab_bam_dmux_clk.c, "BAM_RMNT"), |
| 5125 | CLK_LOOKUP("bus_clk", dfab_scm_clk.c, "scm"), |
Ramesh Masavarapu | a1bc0e4 | 2012-03-05 07:42:48 -0800 | [diff] [blame] | 5126 | CLK_LOOKUP("bus_clk", dfab_qseecom_clk.c, "qseecom"), |
Ramesh Masavarapu | eb6e934 | 2012-02-13 19:59:50 -0800 | [diff] [blame] | 5127 | CLK_LOOKUP("bus_clk", dfab_tzcom_clk.c, "tzcom"), |
Tianyi Gou | 21a0e80 | 2012-02-04 22:34:10 -0800 | [diff] [blame] | 5128 | |
Manu Gautam | 5143b25 | 2012-01-05 19:25:23 -0800 | [diff] [blame] | 5129 | CLK_LOOKUP("alt_core_clk", usb_hsic_xcvr_fs_clk.c, "msm_hsic_host"), |
| 5130 | CLK_LOOKUP("phy_clk", usb_hsic_hsic_clk.c, "msm_hsic_host"), |
| 5131 | CLK_LOOKUP("cal_clk", usb_hsic_hsio_cal_clk.c, "msm_hsic_host"), |
| 5132 | CLK_LOOKUP("core_clk", usb_hsic_system_clk.c, "msm_hsic_host"), |
| 5133 | CLK_LOOKUP("iface_clk", usb_hsic_p_clk.c, "msm_hsic_host"), |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 5134 | |
Stepan Moskovchenko | 279b785 | 2012-01-31 20:42:46 -0800 | [diff] [blame] | 5135 | CLK_LOOKUP("core_clk", jpegd_axi_clk.c, "msm_iommu.0"), |
| 5136 | CLK_LOOKUP("core_clk", vpe_axi_clk.c, "msm_iommu.1"), |
| 5137 | CLK_LOOKUP("core_clk", mdp_axi_clk.c, "msm_iommu.2"), |
| 5138 | CLK_LOOKUP("core_clk", mdp_axi_clk.c, "msm_iommu.3"), |
| 5139 | CLK_LOOKUP("core_clk", rot_axi_clk.c, "msm_iommu.4"), |
| 5140 | CLK_LOOKUP("core_clk", ijpeg_axi_clk.c, "msm_iommu.5"), |
| 5141 | CLK_LOOKUP("core_clk", vfe_axi_clk.c, "msm_iommu.6"), |
| 5142 | CLK_LOOKUP("core_clk", vcodec_axi_a_clk.c, "msm_iommu.7"), |
| 5143 | CLK_LOOKUP("core_clk", vcodec_axi_b_clk.c, "msm_iommu.8"), |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 5144 | CLK_LOOKUP("core_clk", gfx3d_axi_clk_8064.c, "msm_iommu.9"), |
| 5145 | CLK_LOOKUP("core_clk", gfx3d_axi_clk_8064.c, "msm_iommu.10"), |
Stepan Moskovchenko | 279b785 | 2012-01-31 20:42:46 -0800 | [diff] [blame] | 5146 | CLK_LOOKUP("core_clk", vcap_axi_clk.c, "msm_iommu.11"), |
| 5147 | |
Deepak Kotur | 954b178 | 2012-04-24 17:58:19 -0700 | [diff] [blame] | 5148 | CLK_LOOKUP("mdp_iommu_clk", mdp_axi_clk.c, "msm_vidc.0"), |
| 5149 | CLK_LOOKUP("rot_iommu_clk", rot_axi_clk.c, "msm_vidc.0"), |
| 5150 | CLK_LOOKUP("vcodec_iommu0_clk", vcodec_axi_a_clk.c, "msm_vidc.0"), |
| 5151 | CLK_LOOKUP("vcodec_iommu1_clk", vcodec_axi_b_clk.c, "msm_vidc.0"), |
| 5152 | CLK_LOOKUP("smmu_iface_clk", smmu_p_clk.c, "msm_vidc.0"), |
Stephen Boyd | 7b973de | 2012-03-09 12:26:16 -0800 | [diff] [blame] | 5153 | CLK_LOOKUP("core_clk", vcodec_axi_clk.c, "pil_vidc"), |
| 5154 | CLK_LOOKUP("smmu_iface_clk", smmu_p_clk.c, "pil_vidc"), |
| 5155 | |
Jeff Ohlstein | 8c116c7 | 2011-10-27 17:34:48 -0700 | [diff] [blame] | 5156 | CLK_LOOKUP("mem_clk", ebi1_adm_clk.c, "msm_dmov"), |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 5157 | |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5158 | CLK_LOOKUP("l2_mclk", l2_m_clk, ""), |
| 5159 | CLK_LOOKUP("krait0_mclk", krait0_m_clk, ""), |
| 5160 | CLK_LOOKUP("krait1_mclk", krait1_m_clk, ""), |
Tianyi Gou | 455c13c | 2012-02-02 16:33:24 -0800 | [diff] [blame] | 5161 | CLK_LOOKUP("krait2_mclk", krait2_m_clk, ""), |
| 5162 | CLK_LOOKUP("krait3_mclk", krait3_m_clk, ""), |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 5163 | }; |
| 5164 | |
Tianyi Gou | 3022dfd | 2012-01-25 15:50:05 -0800 | [diff] [blame] | 5165 | static struct clk_lookup msm_clocks_8960[] = { |
Stephen Boyd | 72a8035 | 2012-01-26 15:57:38 -0800 | [diff] [blame] | 5166 | CLK_LOOKUP("xo", cxo_a_clk.c, ""), |
| 5167 | CLK_LOOKUP("xo", pxo_a_clk.c, ""), |
Stephen Boyd | ed630b0 | 2012-01-26 15:26:47 -0800 | [diff] [blame] | 5168 | CLK_LOOKUP("cxo", cxo_clk.c, "wcnss_wlan.0"), |
| 5169 | CLK_LOOKUP("cxo", cxo_clk.c, "pil_riva"), |
| 5170 | CLK_LOOKUP("xo", pxo_clk.c, "pil_qdsp6v4.0"), |
| 5171 | CLK_LOOKUP("xo", cxo_clk.c, "pil_qdsp6v4.1"), |
| 5172 | CLK_LOOKUP("xo", cxo_clk.c, "pil_qdsp6v4.2"), |
Stephen Boyd | 69d35e3 | 2012-02-14 15:33:30 -0800 | [diff] [blame] | 5173 | CLK_LOOKUP("xo", cxo_clk.c, "BAM_RMNT"), |
Stephen Boyd | 5a190a8 | 2012-03-01 14:45:15 -0800 | [diff] [blame] | 5174 | CLK_LOOKUP("xo", cxo_clk.c, "msm_xo"), |
Stephen Boyd | ed630b0 | 2012-01-26 15:26:47 -0800 | [diff] [blame] | 5175 | CLK_LOOKUP("pll2", pll2_clk.c, NULL), |
| 5176 | CLK_LOOKUP("pll8", pll8_clk.c, NULL), |
| 5177 | CLK_LOOKUP("pll4", pll4_clk.c, NULL), |
| 5178 | CLK_LOOKUP("measure", measure_clk.c, "debug"), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5179 | |
Matt Wagantall | b2710b8 | 2011-11-16 19:55:17 -0800 | [diff] [blame] | 5180 | CLK_LOOKUP("bus_clk", afab_clk.c, "msm_apps_fab"), |
| 5181 | CLK_LOOKUP("bus_a_clk", afab_a_clk.c, "msm_apps_fab"), |
| 5182 | CLK_LOOKUP("bus_clk", cfpb_clk.c, "msm_cpss_fpb"), |
| 5183 | CLK_LOOKUP("bus_a_clk", cfpb_a_clk.c, "msm_cpss_fpb"), |
| 5184 | CLK_LOOKUP("bus_clk", sfab_clk.c, "msm_sys_fab"), |
Stephen Boyd | d7a143a | 2012-02-16 17:59:26 -0800 | [diff] [blame] | 5185 | 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] | 5186 | CLK_LOOKUP("bus_clk", sfpb_clk.c, "msm_sys_fpb"), |
| 5187 | CLK_LOOKUP("bus_a_clk", sfpb_a_clk.c, "msm_sys_fpb"), |
| 5188 | CLK_LOOKUP("bus_clk", mmfab_clk.c, "msm_mm_fab"), |
| 5189 | CLK_LOOKUP("bus_a_clk", mmfab_a_clk.c, "msm_mm_fab"), |
| 5190 | CLK_LOOKUP("mem_clk", ebi1_msmbus_clk.c, "msm_bus"), |
| 5191 | CLK_LOOKUP("mem_a_clk", ebi1_a_clk.c, "msm_bus"), |
Gagan Mac | bc5f81d | 2012-04-04 15:03:12 -0600 | [diff] [blame] | 5192 | CLK_LOOKUP("dfab_clk", dfab_msmbus_clk.c, "msm_bus"), |
| 5193 | CLK_LOOKUP("dfab_a_clk", dfab_msmbus_a_clk.c, "msm_bus"), |
Matt Wagantall | b2710b8 | 2011-11-16 19:55:17 -0800 | [diff] [blame] | 5194 | |
| 5195 | CLK_LOOKUP("ebi1_clk", ebi1_clk.c, NULL), |
Matt Wagantall | b2710b8 | 2011-11-16 19:55:17 -0800 | [diff] [blame] | 5196 | CLK_LOOKUP("mmfpb_clk", mmfpb_clk.c, NULL), |
| 5197 | CLK_LOOKUP("mmfpb_a_clk", mmfpb_a_clk.c, "clock-8960"), |
| 5198 | CLK_LOOKUP("cfpb_a_clk", cfpb_a_clk.c, "clock-8960"), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5199 | |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5200 | CLK_LOOKUP("core_clk", gp0_clk.c, ""), |
| 5201 | CLK_LOOKUP("core_clk", gp1_clk.c, ""), |
| 5202 | CLK_LOOKUP("core_clk", gp2_clk.c, ""), |
| 5203 | CLK_LOOKUP("core_clk", gsbi1_uart_clk.c, ""), |
| 5204 | CLK_LOOKUP("core_clk", gsbi2_uart_clk.c, ""), |
| 5205 | CLK_LOOKUP("core_clk", gsbi3_uart_clk.c, ""), |
| 5206 | CLK_LOOKUP("core_clk", gsbi4_uart_clk.c, ""), |
Matt Wagantall | e252237 | 2011-08-17 14:52:21 -0700 | [diff] [blame] | 5207 | CLK_LOOKUP("core_clk", gsbi5_uart_clk.c, "msm_serial_hsl.0"), |
| 5208 | CLK_LOOKUP("core_clk", gsbi6_uart_clk.c, "msm_serial_hs.0"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5209 | CLK_LOOKUP("core_clk", gsbi7_uart_clk.c, ""), |
Stepan Moskovchenko | 2b4b1cd | 2012-03-29 18:21:04 -0700 | [diff] [blame] | 5210 | CLK_LOOKUP("core_clk", gsbi8_uart_clk.c, "msm_serial_hsl.1"), |
Mayank Rana | e009c92 | 2012-03-22 03:02:06 +0530 | [diff] [blame] | 5211 | CLK_LOOKUP("core_clk", gsbi9_uart_clk.c, "msm_serial_hs.1"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5212 | CLK_LOOKUP("core_clk", gsbi10_uart_clk.c, ""), |
| 5213 | CLK_LOOKUP("core_clk", gsbi11_uart_clk.c, ""), |
| 5214 | CLK_LOOKUP("core_clk", gsbi12_uart_clk.c, ""), |
Matt Wagantall | ac29485 | 2011-08-17 15:44:58 -0700 | [diff] [blame] | 5215 | CLK_LOOKUP("core_clk", gsbi1_qup_clk.c, "spi_qsd.0"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5216 | CLK_LOOKUP("core_clk", gsbi2_qup_clk.c, ""), |
Matt Wagantall | ac29485 | 2011-08-17 15:44:58 -0700 | [diff] [blame] | 5217 | CLK_LOOKUP("core_clk", gsbi3_qup_clk.c, "qup_i2c.3"), |
| 5218 | CLK_LOOKUP("core_clk", gsbi4_qup_clk.c, "qup_i2c.4"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5219 | CLK_LOOKUP("core_clk", gsbi5_qup_clk.c, ""), |
| 5220 | CLK_LOOKUP("core_clk", gsbi6_qup_clk.c, ""), |
| 5221 | CLK_LOOKUP("core_clk", gsbi7_qup_clk.c, ""), |
| 5222 | CLK_LOOKUP("core_clk", gsbi8_qup_clk.c, ""), |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 5223 | CLK_LOOKUP("core_clk", gsbi9_qup_clk.c, ""), |
Matt Wagantall | ac29485 | 2011-08-17 15:44:58 -0700 | [diff] [blame] | 5224 | CLK_LOOKUP("core_clk", gsbi10_qup_clk.c, "qup_i2c.10"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5225 | CLK_LOOKUP("core_clk", gsbi11_qup_clk.c, ""), |
Matt Wagantall | ac29485 | 2011-08-17 15:44:58 -0700 | [diff] [blame] | 5226 | CLK_LOOKUP("core_clk", gsbi12_qup_clk.c, "qup_i2c.12"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5227 | CLK_LOOKUP("core_clk", pdm_clk.c, ""), |
Vikram Mulukutla | dd0a237 | 2011-09-19 15:58:21 -0700 | [diff] [blame] | 5228 | CLK_LOOKUP("mem_clk", pmem_clk.c, "msm_sps"), |
Matt Wagantall | c120529 | 2011-08-11 17:19:31 -0700 | [diff] [blame] | 5229 | CLK_LOOKUP("core_clk", prng_clk.c, "msm_rng.0"), |
Matt Wagantall | 37ce384 | 2011-08-17 16:00:36 -0700 | [diff] [blame] | 5230 | CLK_LOOKUP("core_clk", sdc1_clk.c, "msm_sdcc.1"), |
| 5231 | CLK_LOOKUP("core_clk", sdc2_clk.c, "msm_sdcc.2"), |
| 5232 | CLK_LOOKUP("core_clk", sdc3_clk.c, "msm_sdcc.3"), |
| 5233 | CLK_LOOKUP("core_clk", sdc4_clk.c, "msm_sdcc.4"), |
| 5234 | CLK_LOOKUP("core_clk", sdc5_clk.c, "msm_sdcc.5"), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5235 | CLK_LOOKUP("slimbus_xo_src_clk", slimbus_xo_src_clk.c, NULL), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5236 | CLK_LOOKUP("ref_clk", tsif_ref_clk.c, ""), |
| 5237 | CLK_LOOKUP("core_clk", tssc_clk.c, ""), |
Manu Gautam | 5143b25 | 2012-01-05 19:25:23 -0800 | [diff] [blame] | 5238 | CLK_LOOKUP("alt_core_clk", usb_hs1_xcvr_clk.c, "msm_otg"), |
| 5239 | CLK_LOOKUP("phy_clk", usb_phy0_clk.c, "msm_otg"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5240 | CLK_LOOKUP("alt_core_clk", usb_fs1_xcvr_clk.c, ""), |
| 5241 | CLK_LOOKUP("sys_clk", usb_fs1_sys_clk.c, ""), |
| 5242 | CLK_LOOKUP("src_clk", usb_fs1_src_clk.c, ""), |
| 5243 | CLK_LOOKUP("alt_core_clk", usb_fs2_xcvr_clk.c, ""), |
| 5244 | CLK_LOOKUP("sys_clk", usb_fs2_sys_clk.c, ""), |
| 5245 | CLK_LOOKUP("src_clk", usb_fs2_src_clk.c, ""), |
Tianyi Gou | 3022dfd | 2012-01-25 15:50:05 -0800 | [diff] [blame] | 5246 | CLK_LOOKUP("alt_core_clk", usb_hsic_xcvr_fs_clk.c, "msm_hsic_host"), |
| 5247 | CLK_LOOKUP("phy_clk", usb_hsic_hsic_clk.c, "msm_hsic_host"), |
| 5248 | CLK_LOOKUP("cal_clk", usb_hsic_hsio_cal_clk.c, "msm_hsic_host"), |
| 5249 | CLK_LOOKUP("core_clk", usb_hsic_system_clk.c, "msm_hsic_host"), |
| 5250 | CLK_LOOKUP("iface_clk", usb_hsic_p_clk.c, "msm_hsic_host"), |
Matt Wagantall | c4b3a4d | 2011-08-17 16:58:39 -0700 | [diff] [blame] | 5251 | CLK_LOOKUP("iface_clk", ce1_p_clk.c, "qce.0"), |
Matt Wagantall | e0b1145 | 2011-09-13 17:25:33 -0700 | [diff] [blame] | 5252 | CLK_LOOKUP("iface_clk", ce1_p_clk.c, "qcrypto.0"), |
Matt Wagantall | c4b3a4d | 2011-08-17 16:58:39 -0700 | [diff] [blame] | 5253 | CLK_LOOKUP("core_clk", ce1_core_clk.c, "qce.0"), |
Matt Wagantall | e0b1145 | 2011-09-13 17:25:33 -0700 | [diff] [blame] | 5254 | CLK_LOOKUP("core_clk", ce1_core_clk.c, "qcrypto.0"), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5255 | CLK_LOOKUP("dma_bam_pclk", dma_bam_p_clk.c, NULL), |
Matt Wagantall | ac29485 | 2011-08-17 15:44:58 -0700 | [diff] [blame] | 5256 | CLK_LOOKUP("iface_clk", gsbi1_p_clk.c, "spi_qsd.0"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5257 | CLK_LOOKUP("iface_clk", gsbi2_p_clk.c, ""), |
Matt Wagantall | ac29485 | 2011-08-17 15:44:58 -0700 | [diff] [blame] | 5258 | CLK_LOOKUP("iface_clk", gsbi3_p_clk.c, "qup_i2c.3"), |
| 5259 | CLK_LOOKUP("iface_clk", gsbi4_p_clk.c, "qup_i2c.4"), |
Matt Wagantall | e252237 | 2011-08-17 14:52:21 -0700 | [diff] [blame] | 5260 | CLK_LOOKUP("iface_clk", gsbi5_p_clk.c, "msm_serial_hsl.0"), |
| 5261 | CLK_LOOKUP("iface_clk", gsbi6_p_clk.c, "msm_serial_hs.0"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5262 | CLK_LOOKUP("iface_clk", gsbi7_p_clk.c, ""), |
Stepan Moskovchenko | 2b4b1cd | 2012-03-29 18:21:04 -0700 | [diff] [blame] | 5263 | CLK_LOOKUP("iface_clk", gsbi8_p_clk.c, "msm_serial_hsl.1"), |
Mayank Rana | e009c92 | 2012-03-22 03:02:06 +0530 | [diff] [blame] | 5264 | CLK_LOOKUP("iface_clk", gsbi9_p_clk.c, "msm_serial_hs.1"), |
Matt Wagantall | ac29485 | 2011-08-17 15:44:58 -0700 | [diff] [blame] | 5265 | CLK_LOOKUP("iface_clk", gsbi10_p_clk.c, "qup_i2c.10"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5266 | CLK_LOOKUP("iface_clk", gsbi11_p_clk.c, ""), |
Matt Wagantall | ac29485 | 2011-08-17 15:44:58 -0700 | [diff] [blame] | 5267 | CLK_LOOKUP("iface_clk", gsbi12_p_clk.c, "qup_i2c.12"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5268 | CLK_LOOKUP("iface_clk", tsif_p_clk.c, ""), |
| 5269 | CLK_LOOKUP("iface_clk", usb_fs1_p_clk.c, ""), |
| 5270 | CLK_LOOKUP("iface_clk", usb_fs2_p_clk.c, ""), |
Manu Gautam | 5143b25 | 2012-01-05 19:25:23 -0800 | [diff] [blame] | 5271 | CLK_LOOKUP("iface_clk", usb_hs1_p_clk.c, "msm_otg"), |
Matt Wagantall | 37ce384 | 2011-08-17 16:00:36 -0700 | [diff] [blame] | 5272 | CLK_LOOKUP("iface_clk", sdc1_p_clk.c, "msm_sdcc.1"), |
| 5273 | CLK_LOOKUP("iface_clk", sdc2_p_clk.c, "msm_sdcc.2"), |
| 5274 | CLK_LOOKUP("iface_clk", sdc3_p_clk.c, "msm_sdcc.3"), |
| 5275 | CLK_LOOKUP("iface_clk", sdc4_p_clk.c, "msm_sdcc.4"), |
| 5276 | CLK_LOOKUP("iface_clk", sdc5_p_clk.c, "msm_sdcc.5"), |
Matt Wagantall | e1a8606 | 2011-08-18 17:46:10 -0700 | [diff] [blame] | 5277 | CLK_LOOKUP("core_clk", adm0_clk.c, "msm_dmov"), |
| 5278 | CLK_LOOKUP("iface_clk", adm0_p_clk.c, "msm_dmov"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5279 | CLK_LOOKUP("iface_clk", pmic_arb0_p_clk.c, ""), |
| 5280 | CLK_LOOKUP("iface_clk", pmic_arb1_p_clk.c, ""), |
| 5281 | CLK_LOOKUP("core_clk", pmic_ssbi2_clk.c, ""), |
| 5282 | CLK_LOOKUP("mem_clk", rpm_msg_ram_p_clk.c, ""), |
Kevin Chan | 09f4e66 | 2011-12-16 08:17:02 -0800 | [diff] [blame] | 5283 | CLK_LOOKUP("cam_clk", cam0_clk.c, "4-001a"), |
| 5284 | CLK_LOOKUP("cam_clk", cam0_clk.c, "4-006c"), |
| 5285 | CLK_LOOKUP("cam_clk", cam0_clk.c, "4-0048"), |
Tianyi Gou | 3022dfd | 2012-01-25 15:50:05 -0800 | [diff] [blame] | 5286 | CLK_LOOKUP("cam_clk", cam2_clk.c, NULL), |
Sreesudhan Ramakrish Ramkumar | 8f11b8b | 2012-01-04 17:09:05 -0800 | [diff] [blame] | 5287 | CLK_LOOKUP("cam_clk", cam0_clk.c, "4-0020"), |
Sreesudhan Ramakrish Ramkumar | 3381da7 | 2012-01-27 08:08:32 -0800 | [diff] [blame] | 5288 | CLK_LOOKUP("cam_clk", cam0_clk.c, "4-0034"), |
Kevin Chan | c8b52e8 | 2011-10-25 23:20:21 -0700 | [diff] [blame] | 5289 | CLK_LOOKUP("csi_src_clk", csi0_src_clk.c, "msm_csid.0"), |
| 5290 | 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] | 5291 | CLK_LOOKUP("csi_src_clk", csi2_src_clk.c, "msm_csid.2"), |
Kevin Chan | c8b52e8 | 2011-10-25 23:20:21 -0700 | [diff] [blame] | 5292 | CLK_LOOKUP("csi_clk", csi0_clk.c, "msm_csid.0"), |
| 5293 | CLK_LOOKUP("csi_clk", csi1_clk.c, "msm_csid.1"), |
Sreesudhan Ramakrish Ramkumar | b1edcd0 | 2012-01-17 11:33:05 -0800 | [diff] [blame] | 5294 | CLK_LOOKUP("csi_clk", csi2_clk.c, "msm_csid.2"), |
Kevin Chan | c8b52e8 | 2011-10-25 23:20:21 -0700 | [diff] [blame] | 5295 | CLK_LOOKUP("csi_phy_clk", csi0_phy_clk.c, "msm_csid.0"), |
| 5296 | 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] | 5297 | CLK_LOOKUP("csi_phy_clk", csi2_phy_clk.c, "msm_csid.2"), |
Kevin Chan | e12c667 | 2011-10-26 11:55:26 -0700 | [diff] [blame] | 5298 | CLK_LOOKUP("csi_pix_clk", csi_pix_clk.c, "msm_ispif.0"), |
| 5299 | CLK_LOOKUP("csi_rdi_clk", csi_rdi_clk.c, "msm_ispif.0"), |
Tianyi Gou | 3022dfd | 2012-01-25 15:50:05 -0800 | [diff] [blame] | 5300 | CLK_LOOKUP("csi_src_clk", csi2_src_clk.c, NULL), |
| 5301 | CLK_LOOKUP("csi_clk", csi2_clk.c, NULL), |
| 5302 | CLK_LOOKUP("csi_pix1_clk", csi_pix1_clk.c, "msm_ispif.0"), |
| 5303 | CLK_LOOKUP("csi_rdi1_clk", csi_rdi1_clk.c, "msm_ispif.0"), |
| 5304 | CLK_LOOKUP("csi_rdi2_clk", csi_rdi2_clk.c, "msm_ispif.0"), |
| 5305 | CLK_LOOKUP("csi_phy_clk", csi2_phy_clk.c, NULL), |
| 5306 | CLK_LOOKUP("csi2phy_timer_clk", csi2phy_timer_clk.c, NULL), |
Kevin Chan | f6216f2 | 2011-10-25 18:40:11 -0700 | [diff] [blame] | 5307 | CLK_LOOKUP("csiphy_timer_src_clk", |
| 5308 | csiphy_timer_src_clk.c, "msm_csiphy.0"), |
| 5309 | CLK_LOOKUP("csiphy_timer_src_clk", |
| 5310 | csiphy_timer_src_clk.c, "msm_csiphy.1"), |
Sreesudhan Ramakrish Ramkumar | b1edcd0 | 2012-01-17 11:33:05 -0800 | [diff] [blame] | 5311 | CLK_LOOKUP("csiphy_timer_src_clk", |
| 5312 | csiphy_timer_src_clk.c, "msm_csiphy.2"), |
Kevin Chan | f6216f2 | 2011-10-25 18:40:11 -0700 | [diff] [blame] | 5313 | CLK_LOOKUP("csiphy_timer_clk", csi0phy_timer_clk.c, "msm_csiphy.0"), |
| 5314 | 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] | 5315 | CLK_LOOKUP("csiphy_timer_clk", csi2phy_timer_clk.c, "msm_csiphy.2"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 5316 | CLK_LOOKUP("byte_clk", dsi1_byte_clk.c, "mipi_dsi.1"), |
| 5317 | CLK_LOOKUP("byte_clk", dsi2_byte_clk.c, "mipi_dsi.2"), |
| 5318 | CLK_LOOKUP("esc_clk", dsi1_esc_clk.c, "mipi_dsi.1"), |
| 5319 | CLK_LOOKUP("esc_clk", dsi2_esc_clk.c, "mipi_dsi.2"), |
Matt Wagantall | 9dc0163 | 2011-08-17 18:55:04 -0700 | [diff] [blame] | 5320 | CLK_LOOKUP("core_clk", gfx2d0_clk.c, "kgsl-2d0.0"), |
Matt Wagantall | 4972271 | 2011-08-17 18:50:53 -0700 | [diff] [blame] | 5321 | CLK_LOOKUP("core_clk", gfx2d0_clk.c, "footswitch-8x60.0"), |
Matt Wagantall | 9dc0163 | 2011-08-17 18:55:04 -0700 | [diff] [blame] | 5322 | CLK_LOOKUP("core_clk", gfx2d1_clk.c, "kgsl-2d1.1"), |
Matt Wagantall | 4972271 | 2011-08-17 18:50:53 -0700 | [diff] [blame] | 5323 | CLK_LOOKUP("core_clk", gfx2d1_clk.c, "footswitch-8x60.1"), |
Matt Wagantall | 9dc0163 | 2011-08-17 18:55:04 -0700 | [diff] [blame] | 5324 | CLK_LOOKUP("core_clk", gfx3d_clk.c, "kgsl-3d0.0"), |
Matt Wagantall | 4972271 | 2011-08-17 18:50:53 -0700 | [diff] [blame] | 5325 | CLK_LOOKUP("core_clk", gfx3d_clk.c, "footswitch-8x60.2"), |
| 5326 | CLK_LOOKUP("bus_clk", ijpeg_axi_clk.c, "footswitch-8x60.3"), |
Matt Wagantall | f45cd36 | 2012-05-03 21:09:44 -0700 | [diff] [blame] | 5327 | CLK_LOOKUP("mem_clk", imem_axi_clk.c, "msm_gemini.0"), |
| 5328 | CLK_LOOKUP("core_clk", ijpeg_clk.c, "msm_gemini.0"), |
Matt Wagantall | 4972271 | 2011-08-17 18:50:53 -0700 | [diff] [blame] | 5329 | CLK_LOOKUP("core_clk", ijpeg_clk.c, "footswitch-8x60.3"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5330 | CLK_LOOKUP("core_clk", jpegd_clk.c, ""), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 5331 | CLK_LOOKUP("core_clk", mdp_clk.c, "mdp.0"), |
Matt Wagantall | 4972271 | 2011-08-17 18:50:53 -0700 | [diff] [blame] | 5332 | CLK_LOOKUP("core_clk", mdp_clk.c, "footswitch-8x60.4"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 5333 | CLK_LOOKUP("vsync_clk", mdp_vsync_clk.c, "mdp.0"), |
Matt Wagantall | b82a513 | 2011-12-12 22:26:41 -0800 | [diff] [blame] | 5334 | CLK_LOOKUP("vsync_clk", mdp_vsync_clk.c, "footswitch-8x60.4"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 5335 | CLK_LOOKUP("lut_clk", lut_mdp_clk.c, "mdp.0"), |
Matt Wagantall | b82a513 | 2011-12-12 22:26:41 -0800 | [diff] [blame] | 5336 | CLK_LOOKUP("lut_clk", lut_mdp_clk.c, "footswitch-8x60.4"), |
Matt Wagantall | bb90da9 | 2011-10-25 15:07:52 -0700 | [diff] [blame] | 5337 | CLK_LOOKUP("core_clk", rot_clk.c, "msm_rotator.0"), |
Matt Wagantall | 4972271 | 2011-08-17 18:50:53 -0700 | [diff] [blame] | 5338 | CLK_LOOKUP("core_clk", rot_clk.c, "footswitch-8x60.6"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 5339 | CLK_LOOKUP("src_clk", tv_src_clk.c, "dtv.0"), |
| 5340 | CLK_LOOKUP("src_clk", tv_src_clk.c, "tvenc.0"), |
Matt Wagantall | b82a513 | 2011-12-12 22:26:41 -0800 | [diff] [blame] | 5341 | CLK_LOOKUP("tv_src_clk", tv_src_clk.c, "footswitch-8x60.4"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 5342 | CLK_LOOKUP("enc_clk", tv_enc_clk.c, "tvenc.0"), |
| 5343 | CLK_LOOKUP("dac_clk", tv_dac_clk.c, "tvenc.0"), |
Matt Wagantall | 3f7660b | 2011-08-17 21:25:13 -0700 | [diff] [blame] | 5344 | CLK_LOOKUP("core_clk", vcodec_clk.c, "msm_vidc.0"), |
Matt Wagantall | 4972271 | 2011-08-17 18:50:53 -0700 | [diff] [blame] | 5345 | CLK_LOOKUP("core_clk", vcodec_clk.c, "footswitch-8x60.7"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 5346 | CLK_LOOKUP("mdp_clk", mdp_tv_clk.c, "dtv.0"), |
| 5347 | CLK_LOOKUP("mdp_clk", mdp_tv_clk.c, "tvenc.0"), |
Matt Wagantall | b82a513 | 2011-12-12 22:26:41 -0800 | [diff] [blame] | 5348 | CLK_LOOKUP("tv_clk", mdp_tv_clk.c, "footswitch-8x60.4"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 5349 | CLK_LOOKUP("hdmi_clk", hdmi_tv_clk.c, "dtv.0"), |
Matt Wagantall | 5a4f1ba | 2011-08-18 18:13:03 -0700 | [diff] [blame] | 5350 | CLK_LOOKUP("core_clk", hdmi_app_clk.c, "hdmi_msm.1"), |
Kevin Chan | a085312 | 2011-11-07 19:48:44 -0800 | [diff] [blame] | 5351 | CLK_LOOKUP("vpe_clk", vpe_clk.c, "msm_vpe.0"), |
Matt Wagantall | 4972271 | 2011-08-17 18:50:53 -0700 | [diff] [blame] | 5352 | CLK_LOOKUP("core_clk", vpe_clk.c, "footswitch-8x60.9"), |
Kevin Chan | 5827c55 | 2011-10-28 18:36:32 -0700 | [diff] [blame] | 5353 | CLK_LOOKUP("vfe_clk", vfe_clk.c, "msm_vfe.0"), |
Matt Wagantall | 4972271 | 2011-08-17 18:50:53 -0700 | [diff] [blame] | 5354 | CLK_LOOKUP("core_clk", vfe_clk.c, "footswitch-8x60.8"), |
Kevin Chan | 5827c55 | 2011-10-28 18:36:32 -0700 | [diff] [blame] | 5355 | CLK_LOOKUP("csi_vfe_clk", csi_vfe_clk.c, "msm_vfe.0"), |
Matt Wagantall | 4972271 | 2011-08-17 18:50:53 -0700 | [diff] [blame] | 5356 | CLK_LOOKUP("bus_clk", vfe_axi_clk.c, "footswitch-8x60.8"), |
| 5357 | CLK_LOOKUP("bus_clk", mdp_axi_clk.c, "footswitch-8x60.4"), |
| 5358 | CLK_LOOKUP("bus_clk", rot_axi_clk.c, "footswitch-8x60.6"), |
| 5359 | CLK_LOOKUP("bus_clk", vcodec_axi_clk.c, "footswitch-8x60.7"), |
| 5360 | CLK_LOOKUP("bus_a_clk", vcodec_axi_a_clk.c, "footswitch-8x60.7"), |
| 5361 | CLK_LOOKUP("bus_b_clk", vcodec_axi_b_clk.c, "footswitch-8x60.7"), |
| 5362 | CLK_LOOKUP("bus_clk", vpe_axi_clk.c, "footswitch-8x60.9"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 5363 | CLK_LOOKUP("arb_clk", amp_p_clk.c, "mipi_dsi.1"), |
| 5364 | CLK_LOOKUP("arb_clk", amp_p_clk.c, "mipi_dsi.2"), |
Kevin Chan | c8b52e8 | 2011-10-25 23:20:21 -0700 | [diff] [blame] | 5365 | CLK_LOOKUP("csi_pclk", csi_p_clk.c, "msm_csid.0"), |
| 5366 | CLK_LOOKUP("csi_pclk", csi_p_clk.c, "msm_csid.1"), |
Sreesudhan Ramakrish Ramkumar | b1edcd0 | 2012-01-17 11:33:05 -0800 | [diff] [blame] | 5367 | CLK_LOOKUP("csi_pclk", csi_p_clk.c, "msm_csid.2"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 5368 | CLK_LOOKUP("master_iface_clk", dsi1_m_p_clk.c, "mipi_dsi.1"), |
| 5369 | CLK_LOOKUP("slave_iface_clk", dsi1_s_p_clk.c, "mipi_dsi.1"), |
| 5370 | CLK_LOOKUP("master_iface_clk", dsi2_m_p_clk.c, "mipi_dsi.2"), |
| 5371 | CLK_LOOKUP("slave_iface_clk", dsi2_s_p_clk.c, "mipi_dsi.2"), |
Matt Wagantall | 9dc0163 | 2011-08-17 18:55:04 -0700 | [diff] [blame] | 5372 | CLK_LOOKUP("iface_clk", gfx2d0_p_clk.c, "kgsl-2d0.0"), |
Matt Wagantall | 4972271 | 2011-08-17 18:50:53 -0700 | [diff] [blame] | 5373 | CLK_LOOKUP("iface_clk", gfx2d0_p_clk.c, "footswitch-8x60.0"), |
Matt Wagantall | 9dc0163 | 2011-08-17 18:55:04 -0700 | [diff] [blame] | 5374 | CLK_LOOKUP("iface_clk", gfx2d1_p_clk.c, "kgsl-2d1.1"), |
Matt Wagantall | 4972271 | 2011-08-17 18:50:53 -0700 | [diff] [blame] | 5375 | CLK_LOOKUP("iface_clk", gfx2d1_p_clk.c, "footswitch-8x60.1"), |
Matt Wagantall | 9dc0163 | 2011-08-17 18:55:04 -0700 | [diff] [blame] | 5376 | CLK_LOOKUP("iface_clk", gfx3d_p_clk.c, "kgsl-3d0.0"), |
Matt Wagantall | 4972271 | 2011-08-17 18:50:53 -0700 | [diff] [blame] | 5377 | CLK_LOOKUP("iface_clk", gfx3d_p_clk.c, "footswitch-8x60.2"), |
Matt Wagantall | 5a4f1ba | 2011-08-18 18:13:03 -0700 | [diff] [blame] | 5378 | CLK_LOOKUP("master_iface_clk", hdmi_m_p_clk.c, "hdmi_msm.1"), |
| 5379 | CLK_LOOKUP("slave_iface_clk", hdmi_s_p_clk.c, "hdmi_msm.1"), |
Matt Wagantall | f45cd36 | 2012-05-03 21:09:44 -0700 | [diff] [blame] | 5380 | CLK_LOOKUP("iface_clk", ijpeg_p_clk.c, "msm_gemini.0"), |
Matt Wagantall | 4972271 | 2011-08-17 18:50:53 -0700 | [diff] [blame] | 5381 | CLK_LOOKUP("iface_clk", ijpeg_p_clk.c, "footswitch-8x60.3"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5382 | CLK_LOOKUP("iface_clk", jpegd_p_clk.c, ""), |
Matt Wagantall | 5d44ef2 | 2012-01-23 11:01:05 -0800 | [diff] [blame] | 5383 | CLK_LOOKUP("mem_iface_clk", imem_p_clk.c, "kgsl-3d0.0"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 5384 | CLK_LOOKUP("iface_clk", mdp_p_clk.c, "mdp.0"), |
Matt Wagantall | 4972271 | 2011-08-17 18:50:53 -0700 | [diff] [blame] | 5385 | CLK_LOOKUP("iface_clk", mdp_p_clk.c, "footswitch-8x60.4"), |
Matt Wagantall | e604d71 | 2011-10-21 15:38:18 -0700 | [diff] [blame] | 5386 | CLK_LOOKUP("iface_clk", smmu_p_clk.c, "msm_iommu"), |
Matt Wagantall | bb90da9 | 2011-10-25 15:07:52 -0700 | [diff] [blame] | 5387 | CLK_LOOKUP("iface_clk", rot_p_clk.c, "msm_rotator.0"), |
Matt Wagantall | 4972271 | 2011-08-17 18:50:53 -0700 | [diff] [blame] | 5388 | CLK_LOOKUP("iface_clk", rot_p_clk.c, "footswitch-8x60.6"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 5389 | CLK_LOOKUP("iface_clk", tv_enc_p_clk.c, "tvenc.0"), |
Matt Wagantall | 3f7660b | 2011-08-17 21:25:13 -0700 | [diff] [blame] | 5390 | CLK_LOOKUP("iface_clk", vcodec_p_clk.c, "msm_vidc.0"), |
Matt Wagantall | 4972271 | 2011-08-17 18:50:53 -0700 | [diff] [blame] | 5391 | CLK_LOOKUP("iface_clk", vcodec_p_clk.c, "footswitch-8x60.7"), |
Kevin Chan | 5827c55 | 2011-10-28 18:36:32 -0700 | [diff] [blame] | 5392 | CLK_LOOKUP("vfe_pclk", vfe_p_clk.c, "msm_vfe.0"), |
Matt Wagantall | 4972271 | 2011-08-17 18:50:53 -0700 | [diff] [blame] | 5393 | CLK_LOOKUP("iface_clk", vfe_p_clk.c, "footswitch-8x60.8"), |
Kevin Chan | a085312 | 2011-11-07 19:48:44 -0800 | [diff] [blame] | 5394 | CLK_LOOKUP("vpe_pclk", vpe_p_clk.c, "msm_vpe.0"), |
Matt Wagantall | 4972271 | 2011-08-17 18:50:53 -0700 | [diff] [blame] | 5395 | CLK_LOOKUP("iface_clk", vpe_p_clk.c, "footswitch-8x60.9"), |
Kuirong Wang | a9c3acc | 2012-02-09 17:00:45 -0800 | [diff] [blame] | 5396 | CLK_LOOKUP("bit_clk", mi2s_bit_clk.c, "msm-dai-q6.6"), |
| 5397 | CLK_LOOKUP("osr_clk", mi2s_osr_clk.c, "msm-dai-q6.6"), |
Kuirong Wang | 4f4d131 | 2012-03-31 12:50:10 -0700 | [diff] [blame] | 5398 | CLK_LOOKUP("bit_clk", mi2s_bit_clk.c, "msm-dai-q6.7"), |
| 5399 | CLK_LOOKUP("osr_clk", mi2s_osr_clk.c, "msm-dai-q6.7"), |
Kuirong Wang | a9c3acc | 2012-02-09 17:00:45 -0800 | [diff] [blame] | 5400 | CLK_LOOKUP("bit_clk", codec_i2s_mic_bit_clk.c, |
| 5401 | "msm-dai-q6.1"), |
| 5402 | CLK_LOOKUP("osr_clk", codec_i2s_mic_osr_clk.c, |
| 5403 | "msm-dai-q6.1"), |
| 5404 | CLK_LOOKUP("bit_clk", spare_i2s_mic_bit_clk.c, |
| 5405 | "msm-dai-q6.5"), |
| 5406 | CLK_LOOKUP("osr_clk", spare_i2s_mic_osr_clk.c, |
| 5407 | "msm-dai-q6.5"), |
| 5408 | CLK_LOOKUP("bit_clk", codec_i2s_spkr_bit_clk.c, |
| 5409 | "msm-dai-q6.16384"), |
| 5410 | CLK_LOOKUP("osr_clk", codec_i2s_spkr_osr_clk.c, |
| 5411 | "msm-dai-q6.16384"), |
| 5412 | CLK_LOOKUP("bit_clk", spare_i2s_spkr_bit_clk.c, |
| 5413 | "msm-dai-q6.4"), |
| 5414 | CLK_LOOKUP("osr_clk", spare_i2s_spkr_osr_clk.c, |
| 5415 | "msm-dai-q6.4"), |
| 5416 | CLK_LOOKUP("pcm_clk", pcm_clk.c, "msm-dai-q6.2"), |
Kiran Kandi | 5f4ab69 | 2012-02-23 11:23:56 -0800 | [diff] [blame] | 5417 | CLK_LOOKUP("pcm_clk", pcm_clk.c, "msm-dai-q6.3"), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5418 | CLK_LOOKUP("sps_slimbus_clk", sps_slimbus_clk.c, NULL), |
Tianyi Gou | 44a81b0 | 2012-02-06 17:49:07 -0800 | [diff] [blame] | 5419 | CLK_LOOKUP("core_clk", audio_slimbus_clk.c, "msm_slim_ctrl.1"), |
Matt Wagantall | e604d71 | 2011-10-21 15:38:18 -0700 | [diff] [blame] | 5420 | CLK_LOOKUP("core_clk", jpegd_axi_clk.c, "msm_iommu.0"), |
| 5421 | CLK_LOOKUP("core_clk", vpe_axi_clk.c, "msm_iommu.1"), |
| 5422 | CLK_LOOKUP("core_clk", mdp_axi_clk.c, "msm_iommu.2"), |
| 5423 | CLK_LOOKUP("core_clk", mdp_axi_clk.c, "msm_iommu.3"), |
| 5424 | CLK_LOOKUP("core_clk", rot_axi_clk.c, "msm_iommu.4"), |
| 5425 | CLK_LOOKUP("core_clk", ijpeg_axi_clk.c, "msm_iommu.5"), |
| 5426 | CLK_LOOKUP("core_clk", vfe_axi_clk.c, "msm_iommu.6"), |
| 5427 | CLK_LOOKUP("core_clk", vcodec_axi_a_clk.c, "msm_iommu.7"), |
| 5428 | CLK_LOOKUP("core_clk", vcodec_axi_b_clk.c, "msm_iommu.8"), |
| 5429 | CLK_LOOKUP("core_clk", gfx3d_clk.c, "msm_iommu.9"), |
| 5430 | CLK_LOOKUP("core_clk", gfx2d0_clk.c, "msm_iommu.10"), |
| 5431 | CLK_LOOKUP("core_clk", gfx2d1_clk.c, "msm_iommu.11"), |
Gopikrishnaiah Anandan | 4d05ed3 | 2012-01-13 11:08:44 -0800 | [diff] [blame] | 5432 | |
| 5433 | CLK_LOOKUP("mdp_iommu_clk", mdp_axi_clk.c, "msm_vidc.0"), |
| 5434 | CLK_LOOKUP("rot_iommu_clk", rot_axi_clk.c, "msm_vidc.0"), |
| 5435 | CLK_LOOKUP("vcodec_iommu0_clk", vcodec_axi_a_clk.c, "msm_vidc.0"), |
| 5436 | CLK_LOOKUP("vcodec_iommu1_clk", vcodec_axi_b_clk.c, "msm_vidc.0"), |
| 5437 | CLK_LOOKUP("smmu_iface_clk", smmu_p_clk.c, "msm_vidc.0"), |
Stephen Boyd | 7b973de | 2012-03-09 12:26:16 -0800 | [diff] [blame] | 5438 | CLK_LOOKUP("core_clk", vcodec_axi_clk.c, "pil_vidc"), |
| 5439 | CLK_LOOKUP("smmu_iface_clk", smmu_p_clk.c, "pil_vidc"), |
Gopikrishnaiah Anandan | 4d05ed3 | 2012-01-13 11:08:44 -0800 | [diff] [blame] | 5440 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5441 | CLK_LOOKUP("dfab_dsps_clk", dfab_dsps_clk.c, NULL), |
Manu Gautam | 5143b25 | 2012-01-05 19:25:23 -0800 | [diff] [blame] | 5442 | CLK_LOOKUP("core_clk", dfab_usb_hs_clk.c, "msm_otg"), |
Matt Wagantall | 37ce384 | 2011-08-17 16:00:36 -0700 | [diff] [blame] | 5443 | CLK_LOOKUP("bus_clk", dfab_sdc1_clk.c, "msm_sdcc.1"), |
| 5444 | CLK_LOOKUP("bus_clk", dfab_sdc2_clk.c, "msm_sdcc.2"), |
| 5445 | CLK_LOOKUP("bus_clk", dfab_sdc3_clk.c, "msm_sdcc.3"), |
| 5446 | CLK_LOOKUP("bus_clk", dfab_sdc4_clk.c, "msm_sdcc.4"), |
| 5447 | CLK_LOOKUP("bus_clk", dfab_sdc5_clk.c, "msm_sdcc.5"), |
Yan He | 160633e | 2011-06-30 12:18:56 -0700 | [diff] [blame] | 5448 | CLK_LOOKUP("dfab_clk", dfab_sps_clk.c, "msm_sps"), |
Stephen Boyd | 1c51a49 | 2011-10-26 12:11:47 -0700 | [diff] [blame] | 5449 | CLK_LOOKUP("bus_clk", dfab_bam_dmux_clk.c, "BAM_RMNT"), |
Stephen Boyd | ef5d1c4 | 2011-12-15 20:47:14 -0800 | [diff] [blame] | 5450 | CLK_LOOKUP("bus_clk", dfab_scm_clk.c, "scm"), |
Ramesh Masavarapu | a1bc0e4 | 2012-03-05 07:42:48 -0800 | [diff] [blame] | 5451 | CLK_LOOKUP("bus_clk", dfab_qseecom_clk.c, "qseecom"), |
Ramesh Masavarapu | eb6e934 | 2012-02-13 19:59:50 -0800 | [diff] [blame] | 5452 | CLK_LOOKUP("bus_clk", dfab_tzcom_clk.c, "tzcom"), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5453 | |
Matt Wagantall | e1a8606 | 2011-08-18 17:46:10 -0700 | [diff] [blame] | 5454 | CLK_LOOKUP("mem_clk", ebi1_adm_clk.c, "msm_dmov"), |
Matt Wagantall | 8b38f94 | 2011-08-02 18:23:18 -0700 | [diff] [blame] | 5455 | |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5456 | CLK_LOOKUP("l2_mclk", l2_m_clk, ""), |
| 5457 | CLK_LOOKUP("krait0_mclk", krait0_m_clk, ""), |
| 5458 | CLK_LOOKUP("krait1_mclk", krait1_m_clk, ""), |
| 5459 | CLK_LOOKUP("q6sw_clk", q6sw_clk, ""), |
| 5460 | CLK_LOOKUP("q6fw_clk", q6fw_clk, ""), |
| 5461 | CLK_LOOKUP("q6_func_clk", q6_func_clk, ""), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5462 | }; |
| 5463 | |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 5464 | static struct clk_lookup msm_clocks_8930[] = { |
Stephen Boyd | be1a739 | 2012-04-02 20:17:11 -0700 | [diff] [blame] | 5465 | CLK_LOOKUP("xo", cxo_clk.c, "msm_xo"), |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 5466 | CLK_LOOKUP("cxo", cxo_clk.c, "wcnss_wlan.0"), |
| 5467 | CLK_LOOKUP("cxo", cxo_clk.c, "pil_riva"), |
| 5468 | CLK_LOOKUP("xo", pxo_clk.c, "pil_qdsp6v4.0"), |
| 5469 | CLK_LOOKUP("xo", cxo_clk.c, "pil_qdsp6v4.1"), |
| 5470 | CLK_LOOKUP("xo", cxo_clk.c, "pil_qdsp6v4.2"), |
| 5471 | CLK_LOOKUP("xo", cxo_clk.c, "BAM_RMNT"), |
| 5472 | CLK_LOOKUP("pll2", pll2_clk.c, NULL), |
| 5473 | CLK_LOOKUP("pll8", pll8_clk.c, NULL), |
| 5474 | CLK_LOOKUP("pll4", pll4_clk.c, NULL), |
| 5475 | CLK_LOOKUP("measure", measure_clk.c, "debug"), |
| 5476 | |
| 5477 | CLK_LOOKUP("bus_clk", afab_clk.c, "msm_apps_fab"), |
| 5478 | CLK_LOOKUP("bus_a_clk", afab_a_clk.c, "msm_apps_fab"), |
| 5479 | CLK_LOOKUP("bus_clk", cfpb_clk.c, "msm_cpss_fpb"), |
| 5480 | CLK_LOOKUP("bus_a_clk", cfpb_a_clk.c, "msm_cpss_fpb"), |
| 5481 | CLK_LOOKUP("bus_clk", sfab_clk.c, "msm_sys_fab"), |
| 5482 | CLK_LOOKUP("bus_a_clk", sfab_msmbus_a_clk.c, "msm_sys_fab"), |
| 5483 | CLK_LOOKUP("bus_clk", sfpb_clk.c, "msm_sys_fpb"), |
| 5484 | CLK_LOOKUP("bus_a_clk", sfpb_a_clk.c, "msm_sys_fpb"), |
| 5485 | CLK_LOOKUP("bus_clk", mmfab_clk.c, "msm_mm_fab"), |
| 5486 | CLK_LOOKUP("bus_a_clk", mmfab_a_clk.c, "msm_mm_fab"), |
| 5487 | CLK_LOOKUP("mem_clk", ebi1_msmbus_clk.c, "msm_bus"), |
| 5488 | CLK_LOOKUP("mem_a_clk", ebi1_a_clk.c, "msm_bus"), |
Gagan Mac | bc5f81d | 2012-04-04 15:03:12 -0600 | [diff] [blame] | 5489 | CLK_LOOKUP("dfab_clk", dfab_msmbus_clk.c, "msm_bus"), |
| 5490 | CLK_LOOKUP("dfab_a_clk", dfab_msmbus_a_clk.c, "msm_bus"), |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 5491 | |
| 5492 | CLK_LOOKUP("ebi1_clk", ebi1_clk.c, NULL), |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 5493 | CLK_LOOKUP("mmfpb_clk", mmfpb_clk.c, NULL), |
| 5494 | CLK_LOOKUP("mmfpb_a_clk", mmfpb_a_clk.c, "clock-8960"), |
| 5495 | CLK_LOOKUP("cfpb_a_clk", cfpb_a_clk.c, "clock-8960"), |
| 5496 | |
| 5497 | CLK_LOOKUP("core_clk", gp0_clk.c, ""), |
| 5498 | CLK_LOOKUP("core_clk", gp1_clk.c, ""), |
| 5499 | CLK_LOOKUP("core_clk", gp2_clk.c, ""), |
| 5500 | CLK_LOOKUP("core_clk", gsbi1_uart_clk.c, ""), |
| 5501 | CLK_LOOKUP("core_clk", gsbi2_uart_clk.c, ""), |
| 5502 | CLK_LOOKUP("core_clk", gsbi3_uart_clk.c, ""), |
| 5503 | CLK_LOOKUP("core_clk", gsbi4_uart_clk.c, ""), |
| 5504 | CLK_LOOKUP("core_clk", gsbi5_uart_clk.c, "msm_serial_hsl.0"), |
| 5505 | CLK_LOOKUP("core_clk", gsbi6_uart_clk.c, "msm_serial_hs.0"), |
| 5506 | CLK_LOOKUP("core_clk", gsbi7_uart_clk.c, ""), |
| 5507 | CLK_LOOKUP("core_clk", gsbi8_uart_clk.c, ""), |
| 5508 | CLK_LOOKUP("core_clk", gsbi9_uart_clk.c, ""), |
| 5509 | CLK_LOOKUP("core_clk", gsbi10_uart_clk.c, ""), |
| 5510 | CLK_LOOKUP("core_clk", gsbi11_uart_clk.c, ""), |
| 5511 | CLK_LOOKUP("core_clk", gsbi12_uart_clk.c, ""), |
| 5512 | CLK_LOOKUP("core_clk", gsbi1_qup_clk.c, "spi_qsd.0"), |
| 5513 | CLK_LOOKUP("core_clk", gsbi2_qup_clk.c, ""), |
| 5514 | CLK_LOOKUP("core_clk", gsbi3_qup_clk.c, "qup_i2c.3"), |
| 5515 | CLK_LOOKUP("core_clk", gsbi4_qup_clk.c, "qup_i2c.4"), |
| 5516 | CLK_LOOKUP("core_clk", gsbi5_qup_clk.c, ""), |
| 5517 | CLK_LOOKUP("core_clk", gsbi6_qup_clk.c, ""), |
| 5518 | CLK_LOOKUP("core_clk", gsbi7_qup_clk.c, ""), |
| 5519 | CLK_LOOKUP("core_clk", gsbi8_qup_clk.c, ""), |
| 5520 | CLK_LOOKUP("core_clk", gsbi9_qup_clk.c, "qup_i2c.0"), |
| 5521 | CLK_LOOKUP("core_clk", gsbi10_qup_clk.c, "qup_i2c.10"), |
| 5522 | CLK_LOOKUP("core_clk", gsbi11_qup_clk.c, ""), |
| 5523 | CLK_LOOKUP("core_clk", gsbi12_qup_clk.c, "qup_i2c.12"), |
| 5524 | CLK_LOOKUP("core_clk", pdm_clk.c, ""), |
| 5525 | CLK_LOOKUP("mem_clk", pmem_clk.c, "msm_sps"), |
| 5526 | CLK_LOOKUP("core_clk", prng_clk.c, "msm_rng.0"), |
| 5527 | CLK_LOOKUP("core_clk", sdc1_clk.c, "msm_sdcc.1"), |
| 5528 | CLK_LOOKUP("core_clk", sdc2_clk.c, "msm_sdcc.2"), |
| 5529 | CLK_LOOKUP("core_clk", sdc3_clk.c, "msm_sdcc.3"), |
| 5530 | CLK_LOOKUP("core_clk", sdc4_clk.c, "msm_sdcc.4"), |
| 5531 | CLK_LOOKUP("core_clk", sdc5_clk.c, "msm_sdcc.5"), |
| 5532 | CLK_LOOKUP("ref_clk", tsif_ref_clk.c, ""), |
| 5533 | CLK_LOOKUP("core_clk", tssc_clk.c, ""), |
| 5534 | CLK_LOOKUP("alt_core_clk", usb_hs1_xcvr_clk.c, "msm_otg"), |
| 5535 | CLK_LOOKUP("phy_clk", usb_phy0_clk.c, "msm_otg"), |
| 5536 | CLK_LOOKUP("alt_core_clk", usb_fs1_xcvr_clk.c, ""), |
| 5537 | CLK_LOOKUP("sys_clk", usb_fs1_sys_clk.c, ""), |
| 5538 | CLK_LOOKUP("src_clk", usb_fs1_src_clk.c, ""), |
| 5539 | CLK_LOOKUP("alt_core_clk", usb_fs2_xcvr_clk.c, ""), |
| 5540 | CLK_LOOKUP("sys_clk", usb_fs2_sys_clk.c, ""), |
| 5541 | CLK_LOOKUP("src_clk", usb_fs2_src_clk.c, ""), |
| 5542 | CLK_LOOKUP("alt_core_clk", usb_hsic_xcvr_fs_clk.c, "msm_hsic_host"), |
| 5543 | CLK_LOOKUP("phy_clk", usb_hsic_hsic_clk.c, "msm_hsic_host"), |
| 5544 | CLK_LOOKUP("cal_clk", usb_hsic_hsio_cal_clk.c, "msm_hsic_host"), |
| 5545 | CLK_LOOKUP("core_clk", usb_hsic_system_clk.c, "msm_hsic_host"), |
| 5546 | CLK_LOOKUP("iface_clk", usb_hsic_p_clk.c, "msm_hsic_host"), |
| 5547 | CLK_LOOKUP("iface_clk", ce1_p_clk.c, "qce.0"), |
| 5548 | CLK_LOOKUP("iface_clk", ce1_p_clk.c, "qcrypto.0"), |
| 5549 | CLK_LOOKUP("core_clk", ce1_core_clk.c, "qce.0"), |
| 5550 | CLK_LOOKUP("core_clk", ce1_core_clk.c, "qcrypto.0"), |
| 5551 | CLK_LOOKUP("dma_bam_pclk", dma_bam_p_clk.c, NULL), |
| 5552 | CLK_LOOKUP("iface_clk", gsbi1_p_clk.c, "spi_qsd.0"), |
| 5553 | CLK_LOOKUP("iface_clk", gsbi2_p_clk.c, ""), |
| 5554 | CLK_LOOKUP("iface_clk", gsbi3_p_clk.c, "qup_i2c.3"), |
| 5555 | CLK_LOOKUP("iface_clk", gsbi4_p_clk.c, "qup_i2c.4"), |
| 5556 | CLK_LOOKUP("iface_clk", gsbi5_p_clk.c, "msm_serial_hsl.0"), |
| 5557 | CLK_LOOKUP("iface_clk", gsbi6_p_clk.c, "msm_serial_hs.0"), |
| 5558 | CLK_LOOKUP("iface_clk", gsbi7_p_clk.c, ""), |
| 5559 | CLK_LOOKUP("iface_clk", gsbi8_p_clk.c, ""), |
| 5560 | CLK_LOOKUP("iface_clk", gsbi9_p_clk.c, "qup_i2c.0"), |
| 5561 | CLK_LOOKUP("iface_clk", gsbi10_p_clk.c, "qup_i2c.10"), |
| 5562 | CLK_LOOKUP("iface_clk", gsbi11_p_clk.c, ""), |
| 5563 | CLK_LOOKUP("iface_clk", gsbi12_p_clk.c, "qup_i2c.12"), |
| 5564 | CLK_LOOKUP("iface_clk", tsif_p_clk.c, ""), |
| 5565 | CLK_LOOKUP("iface_clk", usb_fs1_p_clk.c, ""), |
| 5566 | CLK_LOOKUP("iface_clk", usb_fs2_p_clk.c, ""), |
| 5567 | CLK_LOOKUP("iface_clk", usb_hs1_p_clk.c, "msm_otg"), |
| 5568 | CLK_LOOKUP("iface_clk", sdc1_p_clk.c, "msm_sdcc.1"), |
| 5569 | CLK_LOOKUP("iface_clk", sdc2_p_clk.c, "msm_sdcc.2"), |
| 5570 | CLK_LOOKUP("iface_clk", sdc3_p_clk.c, "msm_sdcc.3"), |
| 5571 | CLK_LOOKUP("iface_clk", sdc4_p_clk.c, "msm_sdcc.4"), |
| 5572 | CLK_LOOKUP("iface_clk", sdc5_p_clk.c, "msm_sdcc.5"), |
| 5573 | CLK_LOOKUP("core_clk", adm0_clk.c, "msm_dmov"), |
| 5574 | CLK_LOOKUP("iface_clk", adm0_p_clk.c, "msm_dmov"), |
| 5575 | CLK_LOOKUP("iface_clk", pmic_arb0_p_clk.c, ""), |
| 5576 | CLK_LOOKUP("iface_clk", pmic_arb1_p_clk.c, ""), |
| 5577 | CLK_LOOKUP("core_clk", pmic_ssbi2_clk.c, ""), |
| 5578 | CLK_LOOKUP("mem_clk", rpm_msg_ram_p_clk.c, ""), |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 5579 | CLK_LOOKUP("cam_clk", cam0_clk.c, "4-001a"), |
Hody Hung | 994f462 | 2012-04-24 10:27:45 -0700 | [diff] [blame] | 5580 | CLK_LOOKUP("cam_clk", cam1_clk.c, "4-006c"), |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 5581 | CLK_LOOKUP("cam_clk", cam0_clk.c, "4-0048"), |
| 5582 | CLK_LOOKUP("cam_clk", cam2_clk.c, NULL), |
| 5583 | CLK_LOOKUP("cam_clk", cam0_clk.c, "4-0020"), |
| 5584 | CLK_LOOKUP("csi_src_clk", csi0_src_clk.c, "msm_csid.0"), |
| 5585 | CLK_LOOKUP("csi_src_clk", csi1_src_clk.c, "msm_csid.1"), |
| 5586 | CLK_LOOKUP("csi_src_clk", csi2_src_clk.c, "msm_csid.2"), |
| 5587 | CLK_LOOKUP("csi_clk", csi0_clk.c, "msm_csid.0"), |
| 5588 | CLK_LOOKUP("csi_clk", csi1_clk.c, "msm_csid.1"), |
| 5589 | CLK_LOOKUP("csi_clk", csi2_clk.c, "msm_csid.2"), |
| 5590 | CLK_LOOKUP("csi_phy_clk", csi0_phy_clk.c, "msm_csid.0"), |
| 5591 | CLK_LOOKUP("csi_phy_clk", csi1_phy_clk.c, "msm_csid.1"), |
| 5592 | CLK_LOOKUP("csi_phy_clk", csi2_phy_clk.c, "msm_csid.2"), |
| 5593 | CLK_LOOKUP("csi_pix_clk", csi_pix_clk.c, "msm_ispif.0"), |
| 5594 | CLK_LOOKUP("csi_rdi_clk", csi_rdi_clk.c, "msm_ispif.0"), |
| 5595 | CLK_LOOKUP("csi_src_clk", csi2_src_clk.c, NULL), |
| 5596 | CLK_LOOKUP("csi_clk", csi2_clk.c, NULL), |
| 5597 | CLK_LOOKUP("csi_pix1_clk", csi_pix1_clk.c, "msm_ispif.0"), |
| 5598 | CLK_LOOKUP("csi_rdi1_clk", csi_rdi1_clk.c, "msm_ispif.0"), |
| 5599 | CLK_LOOKUP("csi_rdi2_clk", csi_rdi2_clk.c, "msm_ispif.0"), |
| 5600 | CLK_LOOKUP("csi_phy_clk", csi2_phy_clk.c, NULL), |
| 5601 | CLK_LOOKUP("csi2phy_timer_clk", csi2phy_timer_clk.c, NULL), |
| 5602 | CLK_LOOKUP("csiphy_timer_src_clk", |
| 5603 | csiphy_timer_src_clk.c, "msm_csiphy.0"), |
| 5604 | CLK_LOOKUP("csiphy_timer_src_clk", |
| 5605 | csiphy_timer_src_clk.c, "msm_csiphy.1"), |
| 5606 | CLK_LOOKUP("csiphy_timer_src_clk", |
| 5607 | csiphy_timer_src_clk.c, "msm_csiphy.2"), |
| 5608 | CLK_LOOKUP("csiphy_timer_clk", csi0phy_timer_clk.c, "msm_csiphy.0"), |
| 5609 | CLK_LOOKUP("csiphy_timer_clk", csi1phy_timer_clk.c, "msm_csiphy.1"), |
| 5610 | CLK_LOOKUP("csiphy_timer_clk", csi2phy_timer_clk.c, "msm_csiphy.2"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 5611 | CLK_LOOKUP("byte_clk", dsi1_byte_clk.c, "mipi_dsi.1"), |
| 5612 | CLK_LOOKUP("esc_clk", dsi1_esc_clk.c, "mipi_dsi.1"), |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 5613 | CLK_LOOKUP("core_clk", gfx3d_clk.c, "kgsl-3d0.0"), |
| 5614 | CLK_LOOKUP("core_clk", gfx3d_clk.c, "footswitch-8x60.2"), |
| 5615 | CLK_LOOKUP("bus_clk", |
| 5616 | gfx3d_axi_clk_8930.c, "footswitch-8x60.2"), |
| 5617 | CLK_LOOKUP("bus_clk", ijpeg_axi_clk.c, "footswitch-8x60.3"), |
Matt Wagantall | f45cd36 | 2012-05-03 21:09:44 -0700 | [diff] [blame] | 5618 | CLK_LOOKUP("mem_clk", imem_axi_clk.c, "msm_gemini.0"), |
| 5619 | CLK_LOOKUP("core_clk", ijpeg_clk.c, "msm_gemini.0"), |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 5620 | CLK_LOOKUP("core_clk", ijpeg_clk.c, "footswitch-8x60.3"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 5621 | CLK_LOOKUP("core_clk", mdp_clk.c, "mdp.0"), |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 5622 | CLK_LOOKUP("core_clk", mdp_clk.c, "footswitch-8x60.4"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 5623 | CLK_LOOKUP("vsync_clk", mdp_vsync_clk.c, "mdp.0"), |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 5624 | CLK_LOOKUP("vsync_clk", mdp_vsync_clk.c, "footswitch-8x60.4"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 5625 | CLK_LOOKUP("lut_clk", lut_mdp_clk.c, "mdp.0"), |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 5626 | CLK_LOOKUP("lut_clk", lut_mdp_clk.c, "footswitch-8x60.4"), |
| 5627 | CLK_LOOKUP("core_clk", rot_clk.c, "msm_rotator.0"), |
| 5628 | CLK_LOOKUP("core_clk", rot_clk.c, "footswitch-8x60.6"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 5629 | CLK_LOOKUP("src_clk", tv_src_clk.c, "dtv.0"), |
| 5630 | CLK_LOOKUP("src_clk", tv_src_clk.c, "tvenc.0"), |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 5631 | CLK_LOOKUP("tv_src_clk", tv_src_clk.c, "footswitch-8x60.4"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 5632 | CLK_LOOKUP("dac_clk", tv_dac_clk.c, "tvenc.0"), |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 5633 | CLK_LOOKUP("core_clk", vcodec_clk.c, "msm_vidc.0"), |
| 5634 | CLK_LOOKUP("core_clk", vcodec_clk.c, "footswitch-8x60.7"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 5635 | CLK_LOOKUP("mdp_clk", mdp_tv_clk.c, "dtv.0"), |
| 5636 | CLK_LOOKUP("mdp_clk", mdp_tv_clk.c, "tvenc.0"), |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 5637 | CLK_LOOKUP("tv_clk", mdp_tv_clk.c, "footswitch-8x60.4"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 5638 | CLK_LOOKUP("hdmi_clk", hdmi_tv_clk.c, "dtv.0"), |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 5639 | CLK_LOOKUP("core_clk", hdmi_app_clk.c, "hdmi_msm.1"), |
| 5640 | CLK_LOOKUP("vpe_clk", vpe_clk.c, "msm_vpe.0"), |
| 5641 | CLK_LOOKUP("core_clk", vpe_clk.c, "footswitch-8x60.9"), |
| 5642 | CLK_LOOKUP("vfe_clk", vfe_clk.c, "msm_vfe.0"), |
| 5643 | CLK_LOOKUP("core_clk", vfe_clk.c, "footswitch-8x60.8"), |
| 5644 | CLK_LOOKUP("csi_vfe_clk", csi_vfe_clk.c, "msm_vfe.0"), |
| 5645 | CLK_LOOKUP("bus_clk", vfe_axi_clk.c, "footswitch-8x60.8"), |
| 5646 | CLK_LOOKUP("bus_clk", mdp_axi_clk.c, "footswitch-8x60.4"), |
| 5647 | CLK_LOOKUP("bus_clk", rot_axi_clk.c, "footswitch-8x60.6"), |
| 5648 | CLK_LOOKUP("bus_clk", vcodec_axi_clk.c, "footswitch-8x60.7"), |
| 5649 | CLK_LOOKUP("bus_a_clk", vcodec_axi_a_clk.c, "footswitch-8x60.7"), |
| 5650 | CLK_LOOKUP("bus_b_clk", vcodec_axi_b_clk.c, "footswitch-8x60.7"), |
| 5651 | CLK_LOOKUP("bus_clk", vpe_axi_clk.c, "footswitch-8x60.9"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 5652 | CLK_LOOKUP("arb_clk", amp_p_clk.c, "mipi_dsi.1"), |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 5653 | CLK_LOOKUP("csi_pclk", csi_p_clk.c, "msm_csid.0"), |
| 5654 | CLK_LOOKUP("csi_pclk", csi_p_clk.c, "msm_csid.1"), |
| 5655 | CLK_LOOKUP("csi_pclk", csi_p_clk.c, "msm_csid.2"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 5656 | CLK_LOOKUP("master_iface_clk", dsi1_m_p_clk.c, "mipi_dsi.1"), |
| 5657 | CLK_LOOKUP("slave_iface_clk", dsi1_s_p_clk.c, "mipi_dsi.1"), |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 5658 | CLK_LOOKUP("iface_clk", gfx3d_p_clk.c, "kgsl-3d0.0"), |
| 5659 | CLK_LOOKUP("iface_clk", gfx3d_p_clk.c, "footswitch-8x60.2"), |
| 5660 | CLK_LOOKUP("master_iface_clk", hdmi_m_p_clk.c, "hdmi_msm.1"), |
| 5661 | CLK_LOOKUP("slave_iface_clk", hdmi_s_p_clk.c, "hdmi_msm.1"), |
Matt Wagantall | f45cd36 | 2012-05-03 21:09:44 -0700 | [diff] [blame] | 5662 | CLK_LOOKUP("iface_clk", ijpeg_p_clk.c, "msm_gemini.0"), |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 5663 | CLK_LOOKUP("iface_clk", ijpeg_p_clk.c, "footswitch-8x60.3"), |
| 5664 | CLK_LOOKUP("mem_iface_clk", imem_p_clk.c, "kgsl-3d0.0"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 5665 | CLK_LOOKUP("iface_clk", mdp_p_clk.c, "mdp.0"), |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 5666 | CLK_LOOKUP("iface_clk", mdp_p_clk.c, "footswitch-8x60.4"), |
| 5667 | CLK_LOOKUP("iface_clk", smmu_p_clk.c, "msm_iommu"), |
| 5668 | CLK_LOOKUP("iface_clk", rot_p_clk.c, "msm_rotator.0"), |
| 5669 | CLK_LOOKUP("iface_clk", rot_p_clk.c, "footswitch-8x60.6"), |
| 5670 | CLK_LOOKUP("iface_clk", vcodec_p_clk.c, "msm_vidc.0"), |
| 5671 | CLK_LOOKUP("iface_clk", vcodec_p_clk.c, "footswitch-8x60.7"), |
| 5672 | CLK_LOOKUP("vfe_pclk", vfe_p_clk.c, "msm_vfe.0"), |
| 5673 | CLK_LOOKUP("iface_clk", vfe_p_clk.c, "footswitch-8x60.8"), |
| 5674 | CLK_LOOKUP("vpe_pclk", vpe_p_clk.c, "msm_vpe.0"), |
| 5675 | CLK_LOOKUP("iface_clk", vpe_p_clk.c, "footswitch-8x60.9"), |
| 5676 | CLK_LOOKUP("bit_clk", mi2s_bit_clk.c, "msm-dai-q6.6"), |
| 5677 | CLK_LOOKUP("osr_clk", mi2s_osr_clk.c, "msm-dai-q6.6"), |
| 5678 | CLK_LOOKUP("bit_clk", codec_i2s_mic_bit_clk.c, |
| 5679 | "msm-dai-q6.1"), |
| 5680 | CLK_LOOKUP("osr_clk", codec_i2s_mic_osr_clk.c, |
| 5681 | "msm-dai-q6.1"), |
| 5682 | CLK_LOOKUP("bit_clk", spare_i2s_mic_bit_clk.c, |
| 5683 | "msm-dai-q6.5"), |
| 5684 | CLK_LOOKUP("osr_clk", spare_i2s_mic_osr_clk.c, |
| 5685 | "msm-dai-q6.5"), |
| 5686 | CLK_LOOKUP("bit_clk", codec_i2s_spkr_bit_clk.c, |
| 5687 | "msm-dai-q6.16384"), |
| 5688 | CLK_LOOKUP("osr_clk", codec_i2s_spkr_osr_clk.c, |
| 5689 | "msm-dai-q6.16384"), |
| 5690 | CLK_LOOKUP("bit_clk", spare_i2s_spkr_bit_clk.c, |
| 5691 | "msm-dai-q6.4"), |
| 5692 | CLK_LOOKUP("osr_clk", spare_i2s_spkr_osr_clk.c, |
| 5693 | "msm-dai-q6.4"), |
| 5694 | CLK_LOOKUP("pcm_clk", pcm_clk.c, "msm-dai-q6.2"), |
| 5695 | CLK_LOOKUP("sps_slimbus_clk", sps_slimbus_clk.c, NULL), |
| 5696 | CLK_LOOKUP("core_clk", audio_slimbus_clk.c, "msm_slim_ctrl.1"), |
| 5697 | CLK_LOOKUP("core_clk", vpe_axi_clk.c, "msm_iommu.1"), |
| 5698 | CLK_LOOKUP("core_clk", mdp_axi_clk.c, "msm_iommu.2"), |
| 5699 | CLK_LOOKUP("core_clk", mdp_axi_clk.c, "msm_iommu.3"), |
| 5700 | CLK_LOOKUP("core_clk", rot_axi_clk.c, "msm_iommu.4"), |
| 5701 | CLK_LOOKUP("core_clk", ijpeg_axi_clk.c, "msm_iommu.5"), |
| 5702 | CLK_LOOKUP("core_clk", vfe_axi_clk.c, "msm_iommu.6"), |
| 5703 | CLK_LOOKUP("core_clk", vcodec_axi_a_clk.c, "msm_iommu.7"), |
| 5704 | CLK_LOOKUP("core_clk", vcodec_axi_b_clk.c, "msm_iommu.8"), |
| 5705 | CLK_LOOKUP("core_clk", gfx3d_axi_clk_8930.c, "msm_iommu.9"), |
| 5706 | CLK_LOOKUP("core_clk", gfx3d_axi_clk_8930.c, "msm_iommu.10"), |
| 5707 | |
| 5708 | CLK_LOOKUP("mdp_iommu_clk", mdp_axi_clk.c, "msm_vidc.0"), |
| 5709 | CLK_LOOKUP("rot_iommu_clk", rot_axi_clk.c, "msm_vidc.0"), |
| 5710 | CLK_LOOKUP("vcodec_iommu0_clk", vcodec_axi_a_clk.c, "msm_vidc.0"), |
| 5711 | CLK_LOOKUP("vcodec_iommu1_clk", vcodec_axi_b_clk.c, "msm_vidc.0"), |
| 5712 | CLK_LOOKUP("smmu_iface_clk", smmu_p_clk.c, "msm_vidc.0"), |
Stephen Boyd | 7b973de | 2012-03-09 12:26:16 -0800 | [diff] [blame] | 5713 | CLK_LOOKUP("core_clk", vcodec_axi_clk.c, "pil_vidc"), |
| 5714 | CLK_LOOKUP("smmu_iface_clk", smmu_p_clk.c, "pil_vidc"), |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 5715 | |
| 5716 | CLK_LOOKUP("dfab_dsps_clk", dfab_dsps_clk.c, NULL), |
| 5717 | CLK_LOOKUP("core_clk", dfab_usb_hs_clk.c, "msm_otg"), |
| 5718 | CLK_LOOKUP("bus_clk", dfab_sdc1_clk.c, "msm_sdcc.1"), |
| 5719 | CLK_LOOKUP("bus_clk", dfab_sdc2_clk.c, "msm_sdcc.2"), |
| 5720 | CLK_LOOKUP("bus_clk", dfab_sdc3_clk.c, "msm_sdcc.3"), |
| 5721 | CLK_LOOKUP("bus_clk", dfab_sdc4_clk.c, "msm_sdcc.4"), |
| 5722 | CLK_LOOKUP("bus_clk", dfab_sdc5_clk.c, "msm_sdcc.5"), |
| 5723 | CLK_LOOKUP("dfab_clk", dfab_sps_clk.c, "msm_sps"), |
| 5724 | CLK_LOOKUP("bus_clk", dfab_bam_dmux_clk.c, "BAM_RMNT"), |
| 5725 | CLK_LOOKUP("bus_clk", dfab_scm_clk.c, "scm"), |
| 5726 | CLK_LOOKUP("bus_clk", dfab_qseecom_clk.c, "qseecom"), |
| 5727 | |
| 5728 | CLK_LOOKUP("mem_clk", ebi1_adm_clk.c, "msm_dmov"), |
| 5729 | |
| 5730 | CLK_LOOKUP("l2_mclk", l2_m_clk, ""), |
| 5731 | CLK_LOOKUP("krait0_mclk", krait0_m_clk, ""), |
| 5732 | CLK_LOOKUP("krait1_mclk", krait1_m_clk, ""), |
| 5733 | CLK_LOOKUP("q6sw_clk", q6sw_clk, ""), |
| 5734 | CLK_LOOKUP("q6fw_clk", q6fw_clk, ""), |
| 5735 | CLK_LOOKUP("q6_func_clk", q6_func_clk, ""), |
| 5736 | }; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5737 | /* |
| 5738 | * Miscellaneous clock register initializations |
| 5739 | */ |
| 5740 | |
| 5741 | /* Read, modify, then write-back a register. */ |
| 5742 | static void __init rmwreg(uint32_t val, void *reg, uint32_t mask) |
| 5743 | { |
| 5744 | uint32_t regval = readl_relaxed(reg); |
| 5745 | regval &= ~mask; |
| 5746 | regval |= val; |
| 5747 | writel_relaxed(regval, reg); |
| 5748 | } |
| 5749 | |
Vikram Mulukutla | 5b14672 | 2012-04-23 18:17:50 -0700 | [diff] [blame] | 5750 | static struct pll_config_regs pll4_regs __initdata = { |
| 5751 | .l_reg = LCC_PLL0_L_VAL_REG, |
| 5752 | .m_reg = LCC_PLL0_M_VAL_REG, |
| 5753 | .n_reg = LCC_PLL0_N_VAL_REG, |
| 5754 | .config_reg = LCC_PLL0_CONFIG_REG, |
| 5755 | .mode_reg = LCC_PLL0_MODE_REG, |
| 5756 | }; |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 5757 | |
Vikram Mulukutla | 5b14672 | 2012-04-23 18:17:50 -0700 | [diff] [blame] | 5758 | static struct pll_config pll4_config __initdata = { |
| 5759 | .l = 0xE, |
| 5760 | .m = 0x27A, |
| 5761 | .n = 0x465, |
| 5762 | .vco_val = 0x0, |
| 5763 | .vco_mask = BM(17, 16), |
| 5764 | .pre_div_val = 0x0, |
| 5765 | .pre_div_mask = BIT(19), |
| 5766 | .post_div_val = 0x0, |
| 5767 | .post_div_mask = BM(21, 20), |
| 5768 | .mn_ena_val = BIT(22), |
| 5769 | .mn_ena_mask = BIT(22), |
| 5770 | .main_output_val = BIT(23), |
| 5771 | .main_output_mask = BIT(23), |
| 5772 | }; |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 5773 | |
Vikram Mulukutla | 5b14672 | 2012-04-23 18:17:50 -0700 | [diff] [blame] | 5774 | static struct pll_config_regs pll15_regs __initdata = { |
| 5775 | .l_reg = MM_PLL3_L_VAL_REG, |
| 5776 | .m_reg = MM_PLL3_M_VAL_REG, |
| 5777 | .n_reg = MM_PLL3_N_VAL_REG, |
| 5778 | .config_reg = MM_PLL3_CONFIG_REG, |
| 5779 | .mode_reg = MM_PLL3_MODE_REG, |
| 5780 | }; |
Tianyi Gou | 358c386 | 2011-10-18 17:03:41 -0700 | [diff] [blame] | 5781 | |
Vikram Mulukutla | 5b14672 | 2012-04-23 18:17:50 -0700 | [diff] [blame] | 5782 | static struct pll_config pll15_config __initdata = { |
| 5783 | .l = (0x24 | BVAL(31, 7, 0x620)), |
| 5784 | .m = 0x1, |
| 5785 | .n = 0x9, |
| 5786 | .vco_val = BVAL(17, 16, 0x2), |
| 5787 | .vco_mask = BM(17, 16), |
| 5788 | .pre_div_val = 0x0, |
| 5789 | .pre_div_mask = BIT(19), |
| 5790 | .post_div_val = 0x0, |
| 5791 | .post_div_mask = BM(21, 20), |
| 5792 | .mn_ena_val = BIT(22), |
| 5793 | .mn_ena_mask = BIT(22), |
| 5794 | .main_output_val = BIT(23), |
| 5795 | .main_output_mask = BIT(23), |
| 5796 | }; |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 5797 | |
Vikram Mulukutla | 5b14672 | 2012-04-23 18:17:50 -0700 | [diff] [blame] | 5798 | static struct pll_config_regs pll14_regs __initdata = { |
| 5799 | .l_reg = BB_PLL14_L_VAL_REG, |
| 5800 | .m_reg = BB_PLL14_M_VAL_REG, |
| 5801 | .n_reg = BB_PLL14_N_VAL_REG, |
| 5802 | .config_reg = BB_PLL14_CONFIG_REG, |
| 5803 | .mode_reg = BB_PLL14_MODE_REG, |
| 5804 | }; |
| 5805 | |
| 5806 | static struct pll_config pll14_config __initdata = { |
| 5807 | .l = (0x11 | BVAL(31, 7, 0x620)), |
| 5808 | .m = 0x7, |
| 5809 | .n = 0x9, |
| 5810 | .vco_val = 0x0, |
| 5811 | .vco_mask = BM(17, 16), |
| 5812 | .pre_div_val = 0x0, |
| 5813 | .pre_div_mask = BIT(19), |
| 5814 | .post_div_val = 0x0, |
| 5815 | .post_div_mask = BM(21, 20), |
| 5816 | .mn_ena_val = BIT(22), |
| 5817 | .mn_ena_mask = BIT(22), |
| 5818 | .main_output_val = BIT(23), |
| 5819 | .main_output_mask = BIT(23), |
| 5820 | }; |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 5821 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5822 | static void __init reg_init(void) |
| 5823 | { |
Stephen Boyd | d471e7a | 2011-11-19 01:37:39 -0800 | [diff] [blame] | 5824 | void __iomem *imem_reg; |
Vikram Mulukutla | 5b14672 | 2012-04-23 18:17:50 -0700 | [diff] [blame] | 5825 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5826 | /* Deassert MM SW_RESET_ALL signal. */ |
| 5827 | writel_relaxed(0, SW_RESET_ALL_REG); |
| 5828 | |
Tianyi Gou | 8c1a118 | 2011-10-10 14:47:11 -0700 | [diff] [blame] | 5829 | /* |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 5830 | * Some bits are only used on 8960 or 8064 or 8930 and are marked as |
| 5831 | * reserved bits on the other SoCs. Writing to these reserved bits |
Tianyi Gou | 8c1a118 | 2011-10-10 14:47:11 -0700 | [diff] [blame] | 5832 | * should have no effect. |
| 5833 | */ |
Stephen Boyd | d471e7a | 2011-11-19 01:37:39 -0800 | [diff] [blame] | 5834 | /* |
| 5835 | * Initialize MM AHB registers: Enable the FPB clock and disable HW |
Tianyi Gou | 3022dfd | 2012-01-25 15:50:05 -0800 | [diff] [blame] | 5836 | * gating on non-8960 for all clocks. Also set VFE_AHB's |
Stephen Boyd | d471e7a | 2011-11-19 01:37:39 -0800 | [diff] [blame] | 5837 | * FORCE_CORE_ON bit to prevent its memory from being collapsed when |
| 5838 | * the clock is halted. The sleep and wake-up delays are set to safe |
| 5839 | * values. |
| 5840 | */ |
Tianyi Gou | 3022dfd | 2012-01-25 15:50:05 -0800 | [diff] [blame] | 5841 | if (cpu_is_msm8960()) { |
Stephen Boyd | d471e7a | 2011-11-19 01:37:39 -0800 | [diff] [blame] | 5842 | rmwreg(0x44000000, AHB_EN_REG, 0x6C000103); |
| 5843 | writel_relaxed(0x3C7097F9, AHB_EN2_REG); |
| 5844 | } else { |
| 5845 | rmwreg(0x00000003, AHB_EN_REG, 0x6C000103); |
| 5846 | writel_relaxed(0x000007F9, AHB_EN2_REG); |
| 5847 | } |
Tianyi Gou | 8c1a118 | 2011-10-10 14:47:11 -0700 | [diff] [blame] | 5848 | if (cpu_is_apq8064()) |
| 5849 | rmwreg(0x00000000, AHB_EN3_REG, 0x00000001); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5850 | |
| 5851 | /* Deassert all locally-owned MM AHB resets. */ |
| 5852 | rmwreg(0, SW_RESET_AHB_REG, 0xFFF7DFFF); |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 5853 | rmwreg(0, SW_RESET_AHB2_REG, 0x0000000F); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5854 | |
| 5855 | /* Initialize MM AXI registers: Enable HW gating for all clocks that |
| 5856 | * support it. Also set FORCE_CORE_ON bits, and any sleep and wake-up |
| 5857 | * delays to safe values. */ |
Stephen Boyd | d471e7a | 2011-11-19 01:37:39 -0800 | [diff] [blame] | 5858 | if (cpu_is_msm8960() && |
| 5859 | SOCINFO_VERSION_MAJOR(socinfo_get_version()) >= 3) { |
| 5860 | rmwreg(0x0003AFF9, MAXI_EN_REG, 0x0803FFFF); |
| 5861 | rmwreg(0x3A27FCFF, MAXI_EN2_REG, 0x3A3FFFFF); |
Gopikrishnaiah Anandan | 83b6e85 | 2012-01-05 17:47:02 -0800 | [diff] [blame] | 5862 | rmwreg(0x0027FCFF, MAXI_EN4_REG, 0x017FFFFF); |
Stephen Boyd | d471e7a | 2011-11-19 01:37:39 -0800 | [diff] [blame] | 5863 | } else { |
| 5864 | rmwreg(0x000007F9, MAXI_EN_REG, 0x0803FFFF); |
| 5865 | rmwreg(0x3027FCFF, MAXI_EN2_REG, 0x3A3FFFFF); |
| 5866 | rmwreg(0x0027FCFF, MAXI_EN4_REG, 0x017FFFFF); |
| 5867 | } |
Matt Wagantall | 53d968f | 2011-07-19 13:22:53 -0700 | [diff] [blame] | 5868 | rmwreg(0x0027FCFF, MAXI_EN3_REG, 0x003FFFFF); |
Tianyi Gou | 8c1a118 | 2011-10-10 14:47:11 -0700 | [diff] [blame] | 5869 | if (cpu_is_apq8064()) |
| 5870 | rmwreg(0x009FE4FF, MAXI_EN5_REG, 0x01FFEFFF); |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 5871 | if (cpu_is_msm8930()) |
| 5872 | rmwreg(0x000004FF, MAXI_EN5_REG, 0x00000FFF); |
Tianyi Gou | 3022dfd | 2012-01-25 15:50:05 -0800 | [diff] [blame] | 5873 | if (cpu_is_msm8960()) |
Stephen Boyd | d471e7a | 2011-11-19 01:37:39 -0800 | [diff] [blame] | 5874 | rmwreg(0x00003C38, SAXI_EN_REG, 0x00003FFF); |
| 5875 | else |
| 5876 | rmwreg(0x000003C7, SAXI_EN_REG, 0x00003FFF); |
| 5877 | |
| 5878 | /* Enable IMEM's clk_on signal */ |
| 5879 | imem_reg = ioremap(0x04b00040, 4); |
| 5880 | if (imem_reg) { |
| 5881 | writel_relaxed(0x3, imem_reg); |
| 5882 | iounmap(imem_reg); |
| 5883 | } |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5884 | |
| 5885 | /* Initialize MM CC registers: Set MM FORCE_CORE_ON bits so that core |
| 5886 | * memories retain state even when not clocked. Also, set sleep and |
| 5887 | * wake-up delays to safe values. */ |
Matt Wagantall | 53d968f | 2011-07-19 13:22:53 -0700 | [diff] [blame] | 5888 | rmwreg(0x00000000, CSI0_CC_REG, 0x00000410); |
| 5889 | rmwreg(0x00000000, CSI1_CC_REG, 0x00000410); |
| 5890 | rmwreg(0x80FF0000, DSI1_BYTE_CC_REG, 0xE0FF0010); |
Matt Wagantall | 53d968f | 2011-07-19 13:22:53 -0700 | [diff] [blame] | 5891 | rmwreg(0x80FF0000, DSI_PIXEL_CC_REG, 0xE0FF0010); |
Tarun Karra | 6fbc00a | 2011-12-13 09:23:47 -0700 | [diff] [blame] | 5892 | rmwreg(0xC0FF0000, GFX3D_CC_REG, 0xE0FF0010); |
Matt Wagantall | 53d968f | 2011-07-19 13:22:53 -0700 | [diff] [blame] | 5893 | rmwreg(0x80FF0000, IJPEG_CC_REG, 0xE0FF0010); |
Matt Wagantall | 53d968f | 2011-07-19 13:22:53 -0700 | [diff] [blame] | 5894 | rmwreg(0x80FF0000, MDP_CC_REG, 0xE1FF0010); |
| 5895 | rmwreg(0x80FF0000, MDP_LUT_CC_REG, 0xE0FF0010); |
| 5896 | rmwreg(0x80FF0000, ROT_CC_REG, 0xE0FF0010); |
Matt Wagantall | 53d968f | 2011-07-19 13:22:53 -0700 | [diff] [blame] | 5897 | rmwreg(0x000004FF, TV_CC2_REG, 0x000007FF); |
| 5898 | rmwreg(0xC0FF0000, VCODEC_CC_REG, 0xE0FF0010); |
| 5899 | rmwreg(0x80FF0000, VFE_CC_REG, 0xE0FF4010); |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 5900 | rmwreg(0x800000FF, VFE_CC2_REG, 0xE00000FF); |
Matt Wagantall | 53d968f | 2011-07-19 13:22:53 -0700 | [diff] [blame] | 5901 | rmwreg(0x80FF0000, VPE_CC_REG, 0xE0FF0010); |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 5902 | if (cpu_is_msm8960() || cpu_is_apq8064()) { |
| 5903 | rmwreg(0x80FF0000, DSI2_BYTE_CC_REG, 0xE0FF0010); |
| 5904 | rmwreg(0x80FF0000, DSI2_PIXEL_CC_REG, 0xE0FF0010); |
| 5905 | rmwreg(0x80FF0000, JPEGD_CC_REG, 0xE0FF0010); |
| 5906 | } |
| 5907 | if (cpu_is_msm8960() || cpu_is_msm8930()) |
| 5908 | rmwreg(0x80FF0000, TV_CC_REG, 0xE1FFC010); |
| 5909 | |
| 5910 | if (cpu_is_msm8960()) { |
Tianyi Gou | 8c1a118 | 2011-10-10 14:47:11 -0700 | [diff] [blame] | 5911 | rmwreg(0x80FF0000, GFX2D0_CC_REG, 0xE0FF0010); |
| 5912 | rmwreg(0x80FF0000, GFX2D1_CC_REG, 0xE0FF0010); |
Tianyi Gou | 8c1a118 | 2011-10-10 14:47:11 -0700 | [diff] [blame] | 5913 | } |
| 5914 | if (cpu_is_apq8064()) { |
| 5915 | rmwreg(0x00000000, TV_CC_REG, 0x00004010); |
Tianyi Gou | 621f874 | 2011-09-01 21:45:01 -0700 | [diff] [blame] | 5916 | rmwreg(0x80FF0000, VCAP_CC_REG, 0xE0FF1010); |
Tianyi Gou | 8c1a118 | 2011-10-10 14:47:11 -0700 | [diff] [blame] | 5917 | } |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5918 | |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 5919 | /* |
| 5920 | * Initialize USB_HS_HCLK_FS registers: Set FORCE_C_ON bits so that |
| 5921 | * core remain active during halt state of the clk. Also, set sleep |
| 5922 | * and wake-up value to max. |
| 5923 | */ |
| 5924 | rmwreg(0x0000004F, USB_HS1_HCLK_FS_REG, 0x0000007F); |
Tianyi Gou | 8c1a118 | 2011-10-10 14:47:11 -0700 | [diff] [blame] | 5925 | if (cpu_is_apq8064()) { |
| 5926 | rmwreg(0x0000004F, USB_HS3_HCLK_FS_REG, 0x0000007F); |
| 5927 | rmwreg(0x0000004F, USB_HS4_HCLK_FS_REG, 0x0000007F); |
| 5928 | } |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 5929 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5930 | /* De-assert MM AXI resets to all hardware blocks. */ |
| 5931 | writel_relaxed(0, SW_RESET_AXI_REG); |
| 5932 | |
| 5933 | /* Deassert all MM core resets. */ |
| 5934 | writel_relaxed(0, SW_RESET_CORE_REG); |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 5935 | writel_relaxed(0, SW_RESET_CORE2_REG); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5936 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5937 | /* Enable TSSC and PDM PXO sources. */ |
| 5938 | writel_relaxed(BIT(11), TSSC_CLK_CTL_REG); |
| 5939 | writel_relaxed(BIT(15), PDM_CLK_NS_REG); |
| 5940 | |
| 5941 | /* Source SLIMBus xo src from slimbus reference clock */ |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 5942 | if (cpu_is_msm8960()) |
Tianyi Gou | 8c1a118 | 2011-10-10 14:47:11 -0700 | [diff] [blame] | 5943 | writel_relaxed(0x3, SLIMBUS_XO_SRC_CLK_CTL_REG); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5944 | |
| 5945 | /* Source the dsi_byte_clks from the DSI PHY PLLs */ |
| 5946 | rmwreg(0x1, DSI1_BYTE_NS_REG, 0x7); |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 5947 | if (cpu_is_msm8960() || cpu_is_apq8064()) |
| 5948 | rmwreg(0x2, DSI2_BYTE_NS_REG, 0x7); |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 5949 | |
| 5950 | /* Source the sata_phy_ref_clk from PXO */ |
| 5951 | if (cpu_is_apq8064()) |
| 5952 | rmwreg(0, SATA_PHY_REF_CLK_CTL_REG, 0x1); |
| 5953 | |
| 5954 | /* |
Tianyi Gou | 05e0110 | 2012-02-08 22:15:49 -0800 | [diff] [blame] | 5955 | * TODO: Programming below PLLs and prng_clk is temporary and |
| 5956 | * needs to be removed after bootloaders program them. |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 5957 | */ |
| 5958 | if (cpu_is_apq8064()) { |
Tianyi Gou | 317aa86 | 2012-02-06 14:31:07 -0800 | [diff] [blame] | 5959 | u32 is_pll_enabled; |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 5960 | |
| 5961 | /* Program pxo_src_clk to source from PXO */ |
| 5962 | rmwreg(0x1, PXO_SRC_CLK_CTL_REG, 0x7); |
| 5963 | |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 5964 | /* Check if PLL14 is active */ |
| 5965 | is_pll_enabled = readl_relaxed(BB_PLL14_STATUS_REG) & BIT(16); |
Vikram Mulukutla | 5b14672 | 2012-04-23 18:17:50 -0700 | [diff] [blame] | 5966 | if (!is_pll_enabled) |
Tianyi Gou | df71f2e | 2011-10-24 22:25:04 -0700 | [diff] [blame] | 5967 | /* Ref clk = 27MHz and program pll14 to 480MHz */ |
Vikram Mulukutla | 5b14672 | 2012-04-23 18:17:50 -0700 | [diff] [blame] | 5968 | configure_pll(&pll14_config, &pll14_regs, 1); |
Tianyi Gou | 621f874 | 2011-09-01 21:45:01 -0700 | [diff] [blame] | 5969 | |
Tianyi Gou | 621f874 | 2011-09-01 21:45:01 -0700 | [diff] [blame] | 5970 | /* Program PLL15 to 975MHz with ref clk = 27MHz */ |
Vikram Mulukutla | 5b14672 | 2012-04-23 18:17:50 -0700 | [diff] [blame] | 5971 | configure_pll(&pll15_config, &pll15_regs, 0); |
Tianyi Gou | c29c324 | 2011-10-12 21:02:15 -0700 | [diff] [blame] | 5972 | |
| 5973 | /* Check if PLL4 is active */ |
| 5974 | is_pll_enabled = readl_relaxed(LCC_PLL0_STATUS_REG) & BIT(16); |
Vikram Mulukutla | 5b14672 | 2012-04-23 18:17:50 -0700 | [diff] [blame] | 5975 | if (!is_pll_enabled) |
Tianyi Gou | df71f2e | 2011-10-24 22:25:04 -0700 | [diff] [blame] | 5976 | /* Ref clk = 27MHz and program pll4 to 393.2160MHz */ |
Vikram Mulukutla | 5b14672 | 2012-04-23 18:17:50 -0700 | [diff] [blame] | 5977 | configure_pll(&pll4_config, &pll4_regs, 1); |
Tianyi Gou | c29c324 | 2011-10-12 21:02:15 -0700 | [diff] [blame] | 5978 | |
| 5979 | /* Enable PLL4 source on the LPASS Primary PLL Mux */ |
| 5980 | writel_relaxed(0x1, LCC_PRI_PLL_CLK_CTL_REG); |
Tianyi Gou | 05e0110 | 2012-02-08 22:15:49 -0800 | [diff] [blame] | 5981 | |
| 5982 | /* Program prng_clk to 64MHz if it isn't configured */ |
| 5983 | if (!readl_relaxed(PRNG_CLK_NS_REG)) |
| 5984 | writel_relaxed(0x2B, PRNG_CLK_NS_REG); |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 5985 | } |
Tianyi Gou | 65c536a | 2012-03-20 23:20:29 -0700 | [diff] [blame] | 5986 | |
| 5987 | /* |
| 5988 | * Program PLL15 to 900MHz with ref clk = 27MHz and |
| 5989 | * only enable PLL main output. |
| 5990 | */ |
| 5991 | if (cpu_is_msm8930()) { |
Vikram Mulukutla | 5b14672 | 2012-04-23 18:17:50 -0700 | [diff] [blame] | 5992 | pll15_config.l = 0x21 | BVAL(31, 7, 0x600); |
| 5993 | pll15_config.m = 0x1; |
| 5994 | pll15_config.n = 0x3; |
| 5995 | configure_pll(&pll15_config, &pll15_regs, 0); |
| 5996 | /* Disable AUX and BIST outputs */ |
| 5997 | writel_relaxed(0, MM_PLL3_TEST_CTL_REG); |
Tianyi Gou | 65c536a | 2012-03-20 23:20:29 -0700 | [diff] [blame] | 5998 | } |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5999 | } |
| 6000 | |
Matt Wagantall | b64888f | 2012-04-02 21:35:07 -0700 | [diff] [blame] | 6001 | static void __init msm8960_clock_pre_init(void) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 6002 | { |
Saravana Kannan | 298ec39 | 2012-02-08 19:21:47 -0800 | [diff] [blame] | 6003 | if (cpu_is_apq8064()) { |
| 6004 | vdd_sr2_pll.set_vdd = set_vdd_sr2_pll_8064; |
Tianyi Gou | e1faaf2 | 2012-01-24 16:07:19 -0800 | [diff] [blame] | 6005 | } else if (cpu_is_msm8930() || cpu_is_msm8627()) { |
Saravana Kannan | 298ec39 | 2012-02-08 19:21:47 -0800 | [diff] [blame] | 6006 | vdd_dig.set_vdd = set_vdd_dig_8930; |
| 6007 | vdd_sr2_pll.set_vdd = set_vdd_sr2_pll_8930; |
Tianyi Gou | e1faaf2 | 2012-01-24 16:07:19 -0800 | [diff] [blame] | 6008 | } |
Tianyi Gou | bf3d0b1 | 2012-01-23 14:37:28 -0800 | [diff] [blame] | 6009 | |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 6010 | /* |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 6011 | * Change the freq tables for and voltage requirements for |
| 6012 | * clocks which differ between 8960 and 8064. |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 6013 | */ |
| 6014 | if (cpu_is_apq8064()) { |
| 6015 | gfx3d_clk.freq_tbl = clk_tbl_gfx3d_8064; |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 6016 | |
| 6017 | memcpy(gfx3d_clk.c.fmax, fmax_gfx3d_8064, |
| 6018 | sizeof(gfx3d_clk.c.fmax)); |
| 6019 | memcpy(ijpeg_clk.c.fmax, fmax_ijpeg_8064, |
| 6020 | sizeof(ijpeg_clk.c.fmax)); |
| 6021 | memcpy(mdp_clk.c.fmax, fmax_mdp_8064, |
| 6022 | sizeof(ijpeg_clk.c.fmax)); |
| 6023 | memcpy(tv_src_clk.c.fmax, fmax_tv_src_8064, |
| 6024 | sizeof(tv_src_clk.c.fmax)); |
| 6025 | memcpy(vfe_clk.c.fmax, fmax_vfe_8064, |
| 6026 | sizeof(vfe_clk.c.fmax)); |
| 6027 | |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 6028 | gmem_axi_clk.c.depends = &gfx3d_axi_clk_8064.c; |
| 6029 | } |
| 6030 | |
| 6031 | /* |
| 6032 | * Change the freq tables and voltage requirements for |
| 6033 | * clocks which differ between 8960 and 8930. |
| 6034 | */ |
| 6035 | if (cpu_is_msm8930()) { |
| 6036 | gfx3d_clk.freq_tbl = clk_tbl_gfx3d_8930; |
| 6037 | |
| 6038 | memcpy(gfx3d_clk.c.fmax, fmax_gfx3d_8930, |
| 6039 | sizeof(gfx3d_clk.c.fmax)); |
| 6040 | |
| 6041 | pll15_clk.c.rate = 900000000; |
| 6042 | gmem_axi_clk.c.depends = &gfx3d_axi_clk_8930.c; |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 6043 | } |
Stephen Boyd | 842a1f6 | 2012-04-26 19:07:38 -0700 | [diff] [blame] | 6044 | if ((readl_relaxed(PRNG_CLK_NS_REG) & 0x7F) == 0x2B) |
| 6045 | prng_clk.freq_tbl = clk_tbl_prng_64; |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 6046 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 6047 | vote_vdd_level(&vdd_dig, VDD_DIG_HIGH); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 6048 | |
Vikram Mulukutla | 681d868 | 2012-03-09 23:56:20 -0800 | [diff] [blame] | 6049 | clk_ops_local_pll.enable = sr_pll_clk_enable; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 6050 | |
| 6051 | /* Initialize clock registers. */ |
| 6052 | reg_init(); |
Matt Wagantall | b64888f | 2012-04-02 21:35:07 -0700 | [diff] [blame] | 6053 | } |
| 6054 | |
| 6055 | static void __init msm8960_clock_post_init(void) |
| 6056 | { |
| 6057 | /* Keep PXO on whenever APPS cpu is active */ |
| 6058 | clk_prepare_enable(&pxo_a_clk.c); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 6059 | |
Matt Wagantall | e655cd7 | 2012-04-09 10:15:03 -0700 | [diff] [blame] | 6060 | /* Reset 3D core while clocked to ensure it resets completely. */ |
| 6061 | clk_set_rate(&gfx3d_clk.c, 27000000); |
| 6062 | clk_prepare_enable(&gfx3d_clk.c); |
| 6063 | clk_reset(&gfx3d_clk.c, CLK_RESET_ASSERT); |
| 6064 | udelay(5); |
| 6065 | clk_reset(&gfx3d_clk.c, CLK_RESET_DEASSERT); |
| 6066 | clk_disable_unprepare(&gfx3d_clk.c); |
| 6067 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 6068 | /* Initialize rates for clocks that only support one. */ |
| 6069 | clk_set_rate(&pdm_clk.c, 27000000); |
Stephen Boyd | 842a1f6 | 2012-04-26 19:07:38 -0700 | [diff] [blame] | 6070 | clk_set_rate(&prng_clk.c, prng_clk.freq_tbl->freq_hz); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 6071 | clk_set_rate(&mdp_vsync_clk.c, 27000000); |
| 6072 | clk_set_rate(&tsif_ref_clk.c, 105000); |
| 6073 | clk_set_rate(&tssc_clk.c, 27000000); |
| 6074 | clk_set_rate(&usb_hs1_xcvr_clk.c, 60000000); |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 6075 | if (cpu_is_apq8064()) { |
| 6076 | clk_set_rate(&usb_hs3_xcvr_clk.c, 60000000); |
| 6077 | clk_set_rate(&usb_hs4_xcvr_clk.c, 60000000); |
| 6078 | } |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 6079 | clk_set_rate(&usb_fs1_src_clk.c, 60000000); |
Stepan Moskovchenko | 2429f15 | 2011-10-25 14:42:35 -0700 | [diff] [blame] | 6080 | if (cpu_is_msm8960() || cpu_is_msm8930()) |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 6081 | clk_set_rate(&usb_fs2_src_clk.c, 60000000); |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 6082 | clk_set_rate(&usb_hsic_xcvr_fs_clk.c, 60000000); |
| 6083 | clk_set_rate(&usb_hsic_hsic_src_clk.c, 480000000); |
| 6084 | clk_set_rate(&usb_hsic_hsio_cal_clk.c, 9000000); |
Lena Salman | 127823f | 2012-02-14 17:13:53 +0200 | [diff] [blame] | 6085 | clk_set_rate(&usb_hsic_system_clk.c, 60000000); |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 6086 | /* |
| 6087 | * Set the CSI rates to a safe default to avoid warnings when |
| 6088 | * switching csi pix and rdi clocks. |
| 6089 | */ |
| 6090 | clk_set_rate(&csi0_src_clk.c, 27000000); |
| 6091 | clk_set_rate(&csi1_src_clk.c, 27000000); |
| 6092 | clk_set_rate(&csi2_src_clk.c, 27000000); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 6093 | |
| 6094 | /* |
Stephen Boyd | 60496bb | 2011-10-17 13:51:37 -0700 | [diff] [blame] | 6095 | * The halt status bits for these clocks may be incorrect at boot. |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 6096 | * Toggle these clocks on and off to refresh them. |
| 6097 | */ |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 6098 | clk_prepare_enable(&pdm_clk.c); |
| 6099 | clk_disable_unprepare(&pdm_clk.c); |
| 6100 | clk_prepare_enable(&tssc_clk.c); |
| 6101 | clk_disable_unprepare(&tssc_clk.c); |
Stephen Boyd | e334aeb | 2012-01-24 12:17:29 -0800 | [diff] [blame] | 6102 | clk_prepare_enable(&usb_hsic_hsic_clk.c); |
| 6103 | clk_disable_unprepare(&usb_hsic_hsic_clk.c); |
Stephen Boyd | d7a143a | 2012-02-16 17:59:26 -0800 | [diff] [blame] | 6104 | |
| 6105 | /* |
| 6106 | * Keep sfab floor @ 54MHz so that Krait AHB is at least 27MHz at all |
| 6107 | * times when Apps CPU is active. This ensures the timer's requirement |
| 6108 | * of Krait AHB running 4 times as fast as the timer itself. |
| 6109 | */ |
| 6110 | clk_set_rate(&sfab_tmr_a_clk.c, 54000000); |
Stephen Boyd | e334aeb | 2012-01-24 12:17:29 -0800 | [diff] [blame] | 6111 | clk_prepare_enable(&sfab_tmr_a_clk.c); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 6112 | } |
| 6113 | |
Stephen Boyd | bb600ae | 2011-08-02 20:11:40 -0700 | [diff] [blame] | 6114 | static int __init msm8960_clock_late_init(void) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 6115 | { |
Stephen Boyd | a3787f3 | 2011-09-16 18:55:13 -0700 | [diff] [blame] | 6116 | int rc; |
| 6117 | 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] | 6118 | 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] | 6119 | |
| 6120 | /* Vote for MMFPB to be at least 76.8MHz when an Apps CPU is active. */ |
| 6121 | if (WARN(IS_ERR(mmfpb_a_clk), "mmfpb_a_clk not found (%ld)\n", |
| 6122 | PTR_ERR(mmfpb_a_clk))) |
| 6123 | return PTR_ERR(mmfpb_a_clk); |
Matt Wagantall | de555f56 | 2011-11-08 14:18:07 -0800 | [diff] [blame] | 6124 | rc = clk_set_rate(mmfpb_a_clk, 76800000); |
Stephen Boyd | a3787f3 | 2011-09-16 18:55:13 -0700 | [diff] [blame] | 6125 | if (WARN(rc, "mmfpb_a_clk rate was not set (%d)\n", rc)) |
| 6126 | return rc; |
Stephen Boyd | e334aeb | 2012-01-24 12:17:29 -0800 | [diff] [blame] | 6127 | rc = clk_prepare_enable(mmfpb_a_clk); |
Stephen Boyd | a3787f3 | 2011-09-16 18:55:13 -0700 | [diff] [blame] | 6128 | if (WARN(rc, "mmfpb_a_clk not enabled (%d)\n", rc)) |
| 6129 | return rc; |
| 6130 | |
Stephen Boyd | 8543613 | 2011-09-16 18:55:13 -0700 | [diff] [blame] | 6131 | /* Vote for CFPB to be at least 64MHz when an Apps CPU is active. */ |
| 6132 | if (WARN(IS_ERR(cfpb_a_clk), "cfpb_a_clk not found (%ld)\n", |
| 6133 | PTR_ERR(cfpb_a_clk))) |
| 6134 | return PTR_ERR(cfpb_a_clk); |
Matt Wagantall | de555f56 | 2011-11-08 14:18:07 -0800 | [diff] [blame] | 6135 | rc = clk_set_rate(cfpb_a_clk, 64000000); |
Stephen Boyd | 8543613 | 2011-09-16 18:55:13 -0700 | [diff] [blame] | 6136 | if (WARN(rc, "cfpb_a_clk rate was not set (%d)\n", rc)) |
| 6137 | return rc; |
Stephen Boyd | e334aeb | 2012-01-24 12:17:29 -0800 | [diff] [blame] | 6138 | rc = clk_prepare_enable(cfpb_a_clk); |
Stephen Boyd | 8543613 | 2011-09-16 18:55:13 -0700 | [diff] [blame] | 6139 | if (WARN(rc, "cfpb_a_clk not enabled (%d)\n", rc)) |
| 6140 | return rc; |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 6141 | |
| 6142 | return unvote_vdd_level(&vdd_dig, VDD_DIG_HIGH); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 6143 | } |
Stephen Boyd | bb600ae | 2011-08-02 20:11:40 -0700 | [diff] [blame] | 6144 | |
| 6145 | struct clock_init_data msm8960_clock_init_data __initdata = { |
| 6146 | .table = msm_clocks_8960, |
| 6147 | .size = ARRAY_SIZE(msm_clocks_8960), |
Matt Wagantall | b64888f | 2012-04-02 21:35:07 -0700 | [diff] [blame] | 6148 | .pre_init = msm8960_clock_pre_init, |
| 6149 | .post_init = msm8960_clock_post_init, |
Stephen Boyd | bb600ae | 2011-08-02 20:11:40 -0700 | [diff] [blame] | 6150 | .late_init = msm8960_clock_late_init, |
| 6151 | }; |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 6152 | |
| 6153 | struct clock_init_data apq8064_clock_init_data __initdata = { |
| 6154 | .table = msm_clocks_8064, |
| 6155 | .size = ARRAY_SIZE(msm_clocks_8064), |
Matt Wagantall | b64888f | 2012-04-02 21:35:07 -0700 | [diff] [blame] | 6156 | .pre_init = msm8960_clock_pre_init, |
| 6157 | .post_init = msm8960_clock_post_init, |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 6158 | .late_init = msm8960_clock_late_init, |
| 6159 | }; |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 6160 | |
| 6161 | struct clock_init_data msm8930_clock_init_data __initdata = { |
| 6162 | .table = msm_clocks_8930, |
| 6163 | .size = ARRAY_SIZE(msm_clocks_8930), |
Matt Wagantall | b64888f | 2012-04-02 21:35:07 -0700 | [diff] [blame] | 6164 | .pre_init = msm8960_clock_pre_init, |
| 6165 | .post_init = msm8960_clock_post_init, |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 6166 | .late_init = msm8960_clock_late_init, |
| 6167 | }; |