Sujit Reddy Thumma | b0d51e7 | 2012-12-31 15:37:16 +0530 | [diff] [blame] | 1 | /* Copyright (c) 2009-2013, The Linux Foundation. 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> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 27 | #include <mach/rpm-regulator.h> |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 28 | #include <mach/socinfo.h> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 29 | |
Matt Wagantall | 33d01f5 | 2012-02-23 23:27:44 -0800 | [diff] [blame] | 30 | #include "clock.h" |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 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) |
Tianyi Gou | 352955d | 2012-05-18 19:44:01 -0700 | [diff] [blame] | 45 | #define SFAB_SATA_S_HCLK_CTL_REG REG(0x2480) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 46 | #define CE1_HCLK_CTL_REG REG(0x2720) |
| 47 | #define CE1_CORE_CLK_CTL_REG REG(0x2724) |
Tianyi Gou | 05e0110 | 2012-02-08 22:15:49 -0800 | [diff] [blame] | 48 | #define PRNG_CLK_NS_REG REG(0x2E80) |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 49 | #define CE3_HCLK_CTL_REG REG(0x36C4) |
| 50 | #define CE3_CORE_CLK_CTL_REG REG(0x36CC) |
| 51 | #define CE3_CLK_SRC_NS_REG REG(0x36C0) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 52 | #define DMA_BAM_HCLK_CTL REG(0x25C0) |
Tianyi Gou | 6613de5 | 2012-01-27 17:57:53 -0800 | [diff] [blame] | 53 | #define CLK_HALT_AFAB_SFAB_STATEA_REG REG(0x2FC0) |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 54 | #define CLK_HALT_AFAB_SFAB_STATEB_REG REG(0x2FC4) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 55 | #define CLK_HALT_CFPB_STATEA_REG REG(0x2FCC) |
| 56 | #define CLK_HALT_CFPB_STATEB_REG REG(0x2FD0) |
| 57 | #define CLK_HALT_CFPB_STATEC_REG REG(0x2FD4) |
| 58 | #define CLK_HALT_DFAB_STATE_REG REG(0x2FC8) |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 59 | /* 8064 name CLK_HALT_GSS_KPSS_MISC_STATE_REG */ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 60 | #define CLK_HALT_MSS_SMPSS_MISC_STATE_REG REG(0x2FDC) |
| 61 | #define CLK_HALT_SFPB_MISC_STATE_REG REG(0x2FD8) |
Stephen Boyd | 973e4ba | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 62 | #define CLK_HALT_AFAB_SFAB_STATEB_REG REG(0x2FC4) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 63 | #define CLK_TEST_REG REG(0x2FA0) |
Matt Wagantall | 7625a4c | 2011-11-01 16:17:53 -0700 | [diff] [blame] | 64 | #define GPn_MD_REG(n) REG(0x2D00+(0x20*(n))) |
| 65 | #define GPn_NS_REG(n) REG(0x2D24+(0x20*(n))) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 66 | #define GSBIn_HCLK_CTL_REG(n) REG(0x29C0+(0x20*((n)-1))) |
| 67 | #define GSBIn_QUP_APPS_MD_REG(n) REG(0x29C8+(0x20*((n)-1))) |
| 68 | #define GSBIn_QUP_APPS_NS_REG(n) REG(0x29CC+(0x20*((n)-1))) |
| 69 | #define GSBIn_RESET_REG(n) REG(0x29DC+(0x20*((n)-1))) |
| 70 | #define GSBIn_UART_APPS_MD_REG(n) REG(0x29D0+(0x20*((n)-1))) |
| 71 | #define GSBIn_UART_APPS_NS_REG(n) REG(0x29D4+(0x20*((n)-1))) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 72 | #define PDM_CLK_NS_REG REG(0x2CC0) |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 73 | /* 8064 name BB_PLL_ENA_APCS_REG */ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 74 | #define BB_PLL_ENA_SC0_REG REG(0x34C0) |
Tianyi Gou | 59608a7 | 2012-01-31 22:19:30 -0800 | [diff] [blame] | 75 | #define BB_PLL_ENA_RPM_REG REG(0x34A0) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 76 | #define BB_PLL0_STATUS_REG REG(0x30D8) |
| 77 | #define BB_PLL5_STATUS_REG REG(0x30F8) |
| 78 | #define BB_PLL6_STATUS_REG REG(0x3118) |
| 79 | #define BB_PLL7_STATUS_REG REG(0x3138) |
| 80 | #define BB_PLL8_L_VAL_REG REG(0x3144) |
| 81 | #define BB_PLL8_M_VAL_REG REG(0x3148) |
| 82 | #define BB_PLL8_MODE_REG REG(0x3140) |
| 83 | #define BB_PLL8_N_VAL_REG REG(0x314C) |
| 84 | #define BB_PLL8_STATUS_REG REG(0x3158) |
| 85 | #define BB_PLL8_CONFIG_REG REG(0x3154) |
| 86 | #define BB_PLL8_TEST_CTL_REG REG(0x3150) |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 87 | #define BB_MMCC_PLL2_MODE_REG REG(0x3160) |
Patrick Daly | aa61456 | 2013-01-23 16:39:45 -0800 | [diff] [blame] | 88 | #define BB_MMCC_PLL2_L_REG REG(0x3164) |
| 89 | #define BB_MMCC_PLL2_M_REG REG(0x3168) |
| 90 | #define BB_MMCC_PLL2_N_REG REG(0x316C) |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 91 | #define BB_MMCC_PLL2_TEST_CTL_REG REG(0x3170) |
Patrick Daly | aa61456 | 2013-01-23 16:39:45 -0800 | [diff] [blame] | 92 | #define BB_MMCC_PLL2_CONFIG_REG REG(0x3174) |
| 93 | #define BB_MMCC_PLL2_STATUS_REG REG(0x3178) |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 94 | #define BB_PLL14_MODE_REG REG(0x31C0) |
| 95 | #define BB_PLL14_L_VAL_REG REG(0x31C4) |
| 96 | #define BB_PLL14_M_VAL_REG REG(0x31C8) |
| 97 | #define BB_PLL14_N_VAL_REG REG(0x31CC) |
| 98 | #define BB_PLL14_TEST_CTL_REG REG(0x31D0) |
| 99 | #define BB_PLL14_CONFIG_REG REG(0x31D4) |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 100 | #define BB_PLL14_STATUS_REG REG(0x31D8) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 101 | #define PLLTEST_PAD_CFG_REG REG(0x2FA4) |
| 102 | #define PMEM_ACLK_CTL_REG REG(0x25A0) |
| 103 | #define RINGOSC_NS_REG REG(0x2DC0) |
| 104 | #define RINGOSC_STATUS_REG REG(0x2DCC) |
| 105 | #define RINGOSC_TCXO_CTL_REG REG(0x2DC4) |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 106 | #define RPM_MSG_RAM_HCLK_CTL_REG REG(0x27E0) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 107 | #define SC0_U_CLK_BRANCH_ENA_VOTE_REG REG(0x3080) |
| 108 | #define SDCn_APPS_CLK_MD_REG(n) REG(0x2828+(0x20*((n)-1))) |
| 109 | #define SDCn_APPS_CLK_NS_REG(n) REG(0x282C+(0x20*((n)-1))) |
| 110 | #define SDCn_HCLK_CTL_REG(n) REG(0x2820+(0x20*((n)-1))) |
| 111 | #define SDCn_RESET_REG(n) REG(0x2830+(0x20*((n)-1))) |
| 112 | #define SLIMBUS_XO_SRC_CLK_CTL_REG REG(0x2628) |
| 113 | #define TSIF_HCLK_CTL_REG REG(0x2700) |
| 114 | #define TSIF_REF_CLK_MD_REG REG(0x270C) |
| 115 | #define TSIF_REF_CLK_NS_REG REG(0x2710) |
| 116 | #define TSSC_CLK_CTL_REG REG(0x2CA0) |
Tianyi Gou | 352955d | 2012-05-18 19:44:01 -0700 | [diff] [blame] | 117 | #define SATA_HCLK_CTL_REG REG(0x2C00) |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 118 | #define SATA_CLK_SRC_NS_REG REG(0x2C08) |
| 119 | #define SATA_RXOOB_CLK_CTL_REG REG(0x2C0C) |
| 120 | #define SATA_PMALIVE_CLK_CTL_REG REG(0x2C10) |
| 121 | #define SATA_PHY_REF_CLK_CTL_REG REG(0x2C14) |
Sujit Reddy Thumma | b0d51e7 | 2012-12-31 15:37:16 +0530 | [diff] [blame] | 122 | #define SATA_RESET REG(0x2C1C) |
Tianyi Gou | 352955d | 2012-05-18 19:44:01 -0700 | [diff] [blame] | 123 | #define SATA_ACLK_CTL_REG REG(0x2C20) |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 124 | #define SATA_PHY_CFG_CLK_CTL_REG REG(0x2C40) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 125 | #define USB_FSn_HCLK_CTL_REG(n) REG(0x2960+(0x20*((n)-1))) |
| 126 | #define USB_FSn_RESET_REG(n) REG(0x2974+(0x20*((n)-1))) |
| 127 | #define USB_FSn_SYSTEM_CLK_CTL_REG(n) REG(0x296C+(0x20*((n)-1))) |
| 128 | #define USB_FSn_XCVR_FS_CLK_MD_REG(n) REG(0x2964+(0x20*((n)-1))) |
| 129 | #define USB_FSn_XCVR_FS_CLK_NS_REG(n) REG(0x2968+(0x20*((n)-1))) |
| 130 | #define USB_HS1_HCLK_CTL_REG REG(0x2900) |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 131 | #define USB_HS1_HCLK_FS_REG REG(0x2904) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 132 | #define USB_HS1_RESET_REG REG(0x2910) |
| 133 | #define USB_HS1_XCVR_FS_CLK_MD_REG REG(0x2908) |
| 134 | #define USB_HS1_XCVR_FS_CLK_NS_REG REG(0x290C) |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 135 | #define USB_HS3_HCLK_CTL_REG REG(0x3700) |
| 136 | #define USB_HS3_HCLK_FS_REG REG(0x3704) |
| 137 | #define USB_HS3_RESET_REG REG(0x3710) |
| 138 | #define USB_HS3_XCVR_FS_CLK_MD_REG REG(0X3708) |
| 139 | #define USB_HS3_XCVR_FS_CLK_NS_REG REG(0X370C) |
| 140 | #define USB_HS4_HCLK_CTL_REG REG(0x3720) |
| 141 | #define USB_HS4_HCLK_FS_REG REG(0x3724) |
| 142 | #define USB_HS4_RESET_REG REG(0x3730) |
| 143 | #define USB_HS4_XCVR_FS_CLK_MD_REG REG(0X3728) |
| 144 | #define USB_HS4_XCVR_FS_CLK_NS_REG REG(0X372C) |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 145 | #define USB_HSIC_HCLK_CTL_REG REG(0x2920) |
| 146 | #define USB_HSIC_HSIC_CLK_CTL_REG REG(0x2B44) |
| 147 | #define USB_HSIC_HSIC_CLK_SRC_CTL_REG REG(0x2B40) |
| 148 | #define USB_HSIC_HSIO_CAL_CLK_CTL_REG REG(0x2B48) |
| 149 | #define USB_HSIC_RESET_REG REG(0x2934) |
| 150 | #define USB_HSIC_SYSTEM_CLK_CTL_REG REG(0x292C) |
| 151 | #define USB_HSIC_XCVR_FS_CLK_MD_REG REG(0x2924) |
| 152 | #define USB_HSIC_XCVR_FS_CLK_NS_REG REG(0x2928) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 153 | #define USB_PHY0_RESET_REG REG(0x2E20) |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 154 | #define PCIE_ALT_REF_CLK_NS_REG REG(0x3860) |
Tianyi Gou | 6613de5 | 2012-01-27 17:57:53 -0800 | [diff] [blame] | 155 | #define PCIE_ACLK_CTL_REG REG(0x22C0) |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 156 | #define PCIE_HCLK_CTL_REG REG(0x22CC) |
Tianyi Gou | 6613de5 | 2012-01-27 17:57:53 -0800 | [diff] [blame] | 157 | #define PCIE_PCLK_CTL_REG REG(0x22D0) |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 158 | #define GPLL1_MODE_REG REG(0x3160) |
| 159 | #define GPLL1_L_VAL_REG REG(0x3164) |
| 160 | #define GPLL1_M_VAL_REG REG(0x3168) |
| 161 | #define GPLL1_N_VAL_REG REG(0x316C) |
| 162 | #define GPLL1_CONFIG_REG REG(0x3174) |
| 163 | #define GPLL1_STATUS_REG REG(0x3178) |
| 164 | #define PXO_SRC_CLK_CTL_REG REG(0x2EA0) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 165 | |
| 166 | /* Multimedia clock registers. */ |
| 167 | #define AHB_EN_REG REG_MM(0x0008) |
| 168 | #define AHB_EN2_REG REG_MM(0x0038) |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 169 | #define AHB_EN3_REG REG_MM(0x0248) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 170 | #define AHB_NS_REG REG_MM(0x0004) |
| 171 | #define AXI_NS_REG REG_MM(0x0014) |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 172 | #define CAMCLK0_NS_REG REG_MM(0x0148) |
| 173 | #define CAMCLK0_CC_REG REG_MM(0x0140) |
| 174 | #define CAMCLK0_MD_REG REG_MM(0x0144) |
| 175 | #define CAMCLK1_NS_REG REG_MM(0x015C) |
| 176 | #define CAMCLK1_CC_REG REG_MM(0x0154) |
| 177 | #define CAMCLK1_MD_REG REG_MM(0x0158) |
| 178 | #define CAMCLK2_NS_REG REG_MM(0x0228) |
| 179 | #define CAMCLK2_CC_REG REG_MM(0x0220) |
| 180 | #define CAMCLK2_MD_REG REG_MM(0x0224) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 181 | #define CSI0_NS_REG REG_MM(0x0048) |
| 182 | #define CSI0_CC_REG REG_MM(0x0040) |
| 183 | #define CSI0_MD_REG REG_MM(0x0044) |
| 184 | #define CSI1_NS_REG REG_MM(0x0010) |
| 185 | #define CSI1_CC_REG REG_MM(0x0024) |
| 186 | #define CSI1_MD_REG REG_MM(0x0028) |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 187 | #define CSI2_NS_REG REG_MM(0x0234) |
| 188 | #define CSI2_CC_REG REG_MM(0x022C) |
| 189 | #define CSI2_MD_REG REG_MM(0x0230) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 190 | #define CSIPHYTIMER_CC_REG REG_MM(0x0160) |
| 191 | #define CSIPHYTIMER_MD_REG REG_MM(0x0164) |
| 192 | #define CSIPHYTIMER_NS_REG REG_MM(0x0168) |
| 193 | #define DSI1_BYTE_NS_REG REG_MM(0x00B0) |
| 194 | #define DSI1_BYTE_CC_REG REG_MM(0x0090) |
| 195 | #define DSI2_BYTE_NS_REG REG_MM(0x00BC) |
| 196 | #define DSI2_BYTE_CC_REG REG_MM(0x00B4) |
| 197 | #define DSI1_ESC_NS_REG REG_MM(0x011C) |
| 198 | #define DSI1_ESC_CC_REG REG_MM(0x00CC) |
| 199 | #define DSI2_ESC_NS_REG REG_MM(0x0150) |
| 200 | #define DSI2_ESC_CC_REG REG_MM(0x013C) |
| 201 | #define DSI_PIXEL_CC_REG REG_MM(0x0130) |
| 202 | #define DSI2_PIXEL_CC_REG REG_MM(0x0094) |
Patrick Daly | e6f48904 | 2012-07-11 15:29:15 -0700 | [diff] [blame] | 203 | #define DSI2_PIXEL_CC2_REG REG_MM(0x0264) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 204 | #define DBG_BUS_VEC_A_REG REG_MM(0x01C8) |
| 205 | #define DBG_BUS_VEC_B_REG REG_MM(0x01CC) |
| 206 | #define DBG_BUS_VEC_C_REG REG_MM(0x01D0) |
| 207 | #define DBG_BUS_VEC_D_REG REG_MM(0x01D4) |
| 208 | #define DBG_BUS_VEC_E_REG REG_MM(0x01D8) |
| 209 | #define DBG_BUS_VEC_F_REG REG_MM(0x01DC) |
| 210 | #define DBG_BUS_VEC_G_REG REG_MM(0x01E0) |
| 211 | #define DBG_BUS_VEC_H_REG REG_MM(0x01E4) |
| 212 | #define DBG_BUS_VEC_I_REG REG_MM(0x01E8) |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 213 | #define DBG_BUS_VEC_J_REG REG_MM(0x0240) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 214 | #define DBG_CFG_REG_HS_REG REG_MM(0x01B4) |
| 215 | #define DBG_CFG_REG_LS_REG REG_MM(0x01B8) |
| 216 | #define GFX2D0_CC_REG REG_MM(0x0060) |
| 217 | #define GFX2D0_MD0_REG REG_MM(0x0064) |
| 218 | #define GFX2D0_MD1_REG REG_MM(0x0068) |
| 219 | #define GFX2D0_NS_REG REG_MM(0x0070) |
| 220 | #define GFX2D1_CC_REG REG_MM(0x0074) |
| 221 | #define GFX2D1_MD0_REG REG_MM(0x0078) |
| 222 | #define GFX2D1_MD1_REG REG_MM(0x006C) |
| 223 | #define GFX2D1_NS_REG REG_MM(0x007C) |
| 224 | #define GFX3D_CC_REG REG_MM(0x0080) |
| 225 | #define GFX3D_MD0_REG REG_MM(0x0084) |
| 226 | #define GFX3D_MD1_REG REG_MM(0x0088) |
| 227 | #define GFX3D_NS_REG REG_MM(0x008C) |
| 228 | #define IJPEG_CC_REG REG_MM(0x0098) |
| 229 | #define IJPEG_MD_REG REG_MM(0x009C) |
| 230 | #define IJPEG_NS_REG REG_MM(0x00A0) |
| 231 | #define JPEGD_CC_REG REG_MM(0x00A4) |
| 232 | #define JPEGD_NS_REG REG_MM(0x00AC) |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 233 | #define VCAP_CC_REG REG_MM(0x0178) |
| 234 | #define VCAP_NS_REG REG_MM(0x021C) |
| 235 | #define VCAP_MD0_REG REG_MM(0x01EC) |
| 236 | #define VCAP_MD1_REG REG_MM(0x0218) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 237 | #define MAXI_EN_REG REG_MM(0x0018) |
| 238 | #define MAXI_EN2_REG REG_MM(0x0020) |
| 239 | #define MAXI_EN3_REG REG_MM(0x002C) |
| 240 | #define MAXI_EN4_REG REG_MM(0x0114) |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 241 | #define MAXI_EN5_REG REG_MM(0x0244) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 242 | #define MDP_CC_REG REG_MM(0x00C0) |
| 243 | #define MDP_LUT_CC_REG REG_MM(0x016C) |
| 244 | #define MDP_MD0_REG REG_MM(0x00C4) |
| 245 | #define MDP_MD1_REG REG_MM(0x00C8) |
| 246 | #define MDP_NS_REG REG_MM(0x00D0) |
| 247 | #define MISC_CC_REG REG_MM(0x0058) |
| 248 | #define MISC_CC2_REG REG_MM(0x005C) |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 249 | #define MISC_CC3_REG REG_MM(0x0238) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 250 | #define MM_PLL1_MODE_REG REG_MM(0x031C) |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 251 | #define MM_PLL1_L_VAL_REG REG_MM(0x0320) |
| 252 | #define MM_PLL1_M_VAL_REG REG_MM(0x0324) |
| 253 | #define MM_PLL1_N_VAL_REG REG_MM(0x0328) |
| 254 | #define MM_PLL1_CONFIG_REG REG_MM(0x032C) |
| 255 | #define MM_PLL1_TEST_CTL_REG REG_MM(0x0330) |
| 256 | #define MM_PLL1_STATUS_REG REG_MM(0x0334) |
| 257 | #define MM_PLL3_MODE_REG REG_MM(0x0338) |
Tianyi Gou | 621f874 | 2011-09-01 21:45:01 -0700 | [diff] [blame] | 258 | #define MM_PLL3_L_VAL_REG REG_MM(0x033C) |
| 259 | #define MM_PLL3_M_VAL_REG REG_MM(0x0340) |
| 260 | #define MM_PLL3_N_VAL_REG REG_MM(0x0344) |
| 261 | #define MM_PLL3_CONFIG_REG REG_MM(0x0348) |
| 262 | #define MM_PLL3_TEST_CTL_REG REG_MM(0x034C) |
| 263 | #define MM_PLL3_STATUS_REG REG_MM(0x0350) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 264 | #define ROT_CC_REG REG_MM(0x00E0) |
| 265 | #define ROT_NS_REG REG_MM(0x00E8) |
| 266 | #define SAXI_EN_REG REG_MM(0x0030) |
| 267 | #define SW_RESET_AHB_REG REG_MM(0x020C) |
| 268 | #define SW_RESET_AHB2_REG REG_MM(0x0200) |
| 269 | #define SW_RESET_ALL_REG REG_MM(0x0204) |
| 270 | #define SW_RESET_AXI_REG REG_MM(0x0208) |
| 271 | #define SW_RESET_CORE_REG REG_MM(0x0210) |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 272 | #define SW_RESET_CORE2_REG REG_MM(0x0214) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 273 | #define TV_CC_REG REG_MM(0x00EC) |
| 274 | #define TV_CC2_REG REG_MM(0x0124) |
| 275 | #define TV_MD_REG REG_MM(0x00F0) |
| 276 | #define TV_NS_REG REG_MM(0x00F4) |
| 277 | #define VCODEC_CC_REG REG_MM(0x00F8) |
| 278 | #define VCODEC_MD0_REG REG_MM(0x00FC) |
| 279 | #define VCODEC_MD1_REG REG_MM(0x0128) |
| 280 | #define VCODEC_NS_REG REG_MM(0x0100) |
| 281 | #define VFE_CC_REG REG_MM(0x0104) |
| 282 | #define VFE_MD_REG REG_MM(0x0108) |
| 283 | #define VFE_NS_REG REG_MM(0x010C) |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 284 | #define VFE_CC2_REG REG_MM(0x023C) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 285 | #define VPE_CC_REG REG_MM(0x0110) |
| 286 | #define VPE_NS_REG REG_MM(0x0118) |
| 287 | |
| 288 | /* Low-power Audio clock registers. */ |
Stephen Boyd | 3939c8d | 2011-08-29 17:36:22 -0700 | [diff] [blame] | 289 | #define LCC_CLK_HS_DEBUG_CFG_REG REG_LPA(0x00A4) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 290 | #define LCC_CLK_LS_DEBUG_CFG_REG REG_LPA(0x00A8) |
| 291 | #define LCC_CODEC_I2S_MIC_MD_REG REG_LPA(0x0064) |
| 292 | #define LCC_CODEC_I2S_MIC_NS_REG REG_LPA(0x0060) |
| 293 | #define LCC_CODEC_I2S_MIC_STATUS_REG REG_LPA(0x0068) |
| 294 | #define LCC_CODEC_I2S_SPKR_MD_REG REG_LPA(0x0070) |
| 295 | #define LCC_CODEC_I2S_SPKR_NS_REG REG_LPA(0x006C) |
| 296 | #define LCC_CODEC_I2S_SPKR_STATUS_REG REG_LPA(0x0074) |
| 297 | #define LCC_MI2S_MD_REG REG_LPA(0x004C) |
| 298 | #define LCC_MI2S_NS_REG REG_LPA(0x0048) |
| 299 | #define LCC_MI2S_STATUS_REG REG_LPA(0x0050) |
| 300 | #define LCC_PCM_MD_REG REG_LPA(0x0058) |
| 301 | #define LCC_PCM_NS_REG REG_LPA(0x0054) |
| 302 | #define LCC_PCM_STATUS_REG REG_LPA(0x005C) |
Tianyi Gou | c29c324 | 2011-10-12 21:02:15 -0700 | [diff] [blame] | 303 | #define LCC_PLL0_MODE_REG REG_LPA(0x0000) |
| 304 | #define LCC_PLL0_L_VAL_REG REG_LPA(0x0004) |
| 305 | #define LCC_PLL0_M_VAL_REG REG_LPA(0x0008) |
| 306 | #define LCC_PLL0_N_VAL_REG REG_LPA(0x000C) |
| 307 | #define LCC_PLL0_CONFIG_REG REG_LPA(0x0014) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 308 | #define LCC_PLL0_STATUS_REG REG_LPA(0x0018) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 309 | #define LCC_SPARE_I2S_MIC_MD_REG REG_LPA(0x007C) |
| 310 | #define LCC_SPARE_I2S_MIC_NS_REG REG_LPA(0x0078) |
| 311 | #define LCC_SPARE_I2S_MIC_STATUS_REG REG_LPA(0x0080) |
| 312 | #define LCC_SPARE_I2S_SPKR_MD_REG REG_LPA(0x0088) |
| 313 | #define LCC_SPARE_I2S_SPKR_NS_REG REG_LPA(0x0084) |
| 314 | #define LCC_SPARE_I2S_SPKR_STATUS_REG REG_LPA(0x008C) |
| 315 | #define LCC_SLIMBUS_NS_REG REG_LPA(0x00CC) |
| 316 | #define LCC_SLIMBUS_MD_REG REG_LPA(0x00D0) |
| 317 | #define LCC_SLIMBUS_STATUS_REG REG_LPA(0x00D4) |
| 318 | #define LCC_AHBEX_BRANCH_CTL_REG REG_LPA(0x00E4) |
Tianyi Gou | c29c324 | 2011-10-12 21:02:15 -0700 | [diff] [blame] | 319 | #define LCC_PRI_PLL_CLK_CTL_REG REG_LPA(0x00C4) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 320 | |
Matt Wagantall | 8b38f94 | 2011-08-02 18:23:18 -0700 | [diff] [blame] | 321 | #define GCC_APCS_CLK_DIAG REG_GCC(0x001C) |
| 322 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 323 | /* MUX source input identifiers. */ |
| 324 | #define pxo_to_bb_mux 0 |
Matt Wagantall | 7625a4c | 2011-11-01 16:17:53 -0700 | [diff] [blame] | 325 | #define cxo_to_bb_mux 5 |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 326 | #define pll0_to_bb_mux 2 |
| 327 | #define pll8_to_bb_mux 3 |
| 328 | #define pll6_to_bb_mux 4 |
| 329 | #define gnd_to_bb_mux 5 |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 330 | #define pll3_to_bb_mux 6 |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 331 | #define pxo_to_mm_mux 0 |
| 332 | #define pll1_to_mm_mux 1 |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 333 | #define pll2_to_mm_mux 1 /* or MMCC_PLL1 */ |
| 334 | #define pll8_to_mm_mux 2 /* or GCC_PERF */ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 335 | #define pll0_to_mm_mux 3 |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 336 | #define pll15_to_mm_mux 3 /* or MM_PLL3 */ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 337 | #define gnd_to_mm_mux 4 |
Stephen Boyd | 7a776cd | 2011-10-20 12:46:04 -0700 | [diff] [blame] | 338 | #define pll3_to_mm_mux 3 /* or MMCC_PLL2 */ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 339 | #define hdmi_pll_to_mm_mux 3 |
| 340 | #define cxo_to_xo_mux 0 |
| 341 | #define pxo_to_xo_mux 1 |
| 342 | #define gnd_to_xo_mux 3 |
| 343 | #define pxo_to_lpa_mux 0 |
| 344 | #define cxo_to_lpa_mux 1 |
| 345 | #define pll4_to_lpa_mux 2 |
| 346 | #define gnd_to_lpa_mux 6 |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 347 | #define pxo_to_pcie_mux 0 |
| 348 | #define pll3_to_pcie_mux 1 |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 349 | |
| 350 | /* Test Vector Macros */ |
| 351 | #define TEST_TYPE_PER_LS 1 |
| 352 | #define TEST_TYPE_PER_HS 2 |
| 353 | #define TEST_TYPE_MM_LS 3 |
| 354 | #define TEST_TYPE_MM_HS 4 |
| 355 | #define TEST_TYPE_LPA 5 |
Matt Wagantall | 8b38f94 | 2011-08-02 18:23:18 -0700 | [diff] [blame] | 356 | #define TEST_TYPE_CPUL2 6 |
Stephen Boyd | 3939c8d | 2011-08-29 17:36:22 -0700 | [diff] [blame] | 357 | #define TEST_TYPE_LPA_HS 7 |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 358 | #define TEST_TYPE_SHIFT 24 |
| 359 | #define TEST_CLK_SEL_MASK BM(23, 0) |
| 360 | #define TEST_VECTOR(s, t) (((t) << TEST_TYPE_SHIFT) | BVAL(23, 0, (s))) |
| 361 | #define TEST_PER_LS(s) TEST_VECTOR((s), TEST_TYPE_PER_LS) |
| 362 | #define TEST_PER_HS(s) TEST_VECTOR((s), TEST_TYPE_PER_HS) |
| 363 | #define TEST_MM_LS(s) TEST_VECTOR((s), TEST_TYPE_MM_LS) |
| 364 | #define TEST_MM_HS(s) TEST_VECTOR((s), TEST_TYPE_MM_HS) |
| 365 | #define TEST_LPA(s) TEST_VECTOR((s), TEST_TYPE_LPA) |
Stephen Boyd | 3939c8d | 2011-08-29 17:36:22 -0700 | [diff] [blame] | 366 | #define TEST_LPA_HS(s) TEST_VECTOR((s), TEST_TYPE_LPA_HS) |
Matt Wagantall | 8b38f94 | 2011-08-02 18:23:18 -0700 | [diff] [blame] | 367 | #define TEST_CPUL2(s) TEST_VECTOR((s), TEST_TYPE_CPUL2) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 368 | |
| 369 | #define MN_MODE_DUAL_EDGE 0x2 |
| 370 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 371 | struct pll_rate { |
| 372 | const uint32_t l_val; |
| 373 | const uint32_t m_val; |
| 374 | const uint32_t n_val; |
| 375 | const uint32_t vco; |
| 376 | const uint32_t post_div; |
| 377 | const uint32_t i_bits; |
| 378 | }; |
| 379 | #define PLL_RATE(l, m, n, v, d, i) { l, m, n, v, (d>>1), i } |
| 380 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 381 | enum vdd_dig_levels { |
| 382 | VDD_DIG_NONE, |
| 383 | VDD_DIG_LOW, |
| 384 | VDD_DIG_NOMINAL, |
Saravana Kannan | 55e959d | 2012-10-15 22:16:04 -0700 | [diff] [blame] | 385 | VDD_DIG_HIGH, |
| 386 | VDD_DIG_NUM |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 387 | }; |
| 388 | |
Saravana Kannan | 298ec39 | 2012-02-08 19:21:47 -0800 | [diff] [blame] | 389 | 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] | 390 | { |
| 391 | static const int vdd_uv[] = { |
| 392 | [VDD_DIG_NONE] = 0, |
| 393 | [VDD_DIG_LOW] = 945000, |
| 394 | [VDD_DIG_NOMINAL] = 1050000, |
| 395 | [VDD_DIG_HIGH] = 1150000 |
| 396 | }; |
Saravana Kannan | 298ec39 | 2012-02-08 19:21:47 -0800 | [diff] [blame] | 397 | 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] | 398 | vdd_uv[level], 1150000, 1); |
| 399 | } |
| 400 | |
Saravana Kannan | 55e959d | 2012-10-15 22:16:04 -0700 | [diff] [blame] | 401 | static DEFINE_VDD_CLASS(vdd_dig, set_vdd_dig_8960, VDD_DIG_NUM); |
Saravana Kannan | 298ec39 | 2012-02-08 19:21:47 -0800 | [diff] [blame] | 402 | |
Patrick Daly | 1a3859f | 2012-08-27 16:10:26 -0700 | [diff] [blame] | 403 | static int rpm_vreg_dig_8930 = RPM_VREG_ID_PM8038_VDD_DIG_CORNER; |
Saravana Kannan | 298ec39 | 2012-02-08 19:21:47 -0800 | [diff] [blame] | 404 | static int set_vdd_dig_8930(struct clk_vdd_class *vdd_class, int level) |
| 405 | { |
Saravana Kannan | ebaa3ac | 2012-02-08 19:55:44 -0800 | [diff] [blame] | 406 | static const int vdd_corner[] = { |
| 407 | [VDD_DIG_NONE] = RPM_VREG_CORNER_NONE, |
| 408 | [VDD_DIG_LOW] = RPM_VREG_CORNER_LOW, |
| 409 | [VDD_DIG_NOMINAL] = RPM_VREG_CORNER_NOMINAL, |
| 410 | [VDD_DIG_HIGH] = RPM_VREG_CORNER_HIGH, |
Saravana Kannan | 298ec39 | 2012-02-08 19:21:47 -0800 | [diff] [blame] | 411 | }; |
Patrick Daly | 1a3859f | 2012-08-27 16:10:26 -0700 | [diff] [blame] | 412 | return rpm_vreg_set_voltage(rpm_vreg_dig_8930, |
Saravana Kannan | ebaa3ac | 2012-02-08 19:55:44 -0800 | [diff] [blame] | 413 | RPM_VREG_VOTER3, |
| 414 | vdd_corner[level], |
| 415 | RPM_VREG_CORNER_HIGH, 1); |
Saravana Kannan | 298ec39 | 2012-02-08 19:21:47 -0800 | [diff] [blame] | 416 | } |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 417 | |
| 418 | #define VDD_DIG_FMAX_MAP1(l1, f1) \ |
Saravana Kannan | 55e959d | 2012-10-15 22:16:04 -0700 | [diff] [blame] | 419 | .vdd_class = &vdd_dig, \ |
| 420 | .fmax = (unsigned long[VDD_DIG_NUM]) { \ |
| 421 | [VDD_DIG_##l1] = (f1), \ |
| 422 | }, \ |
| 423 | .num_fmax = VDD_DIG_NUM |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 424 | #define VDD_DIG_FMAX_MAP2(l1, f1, l2, f2) \ |
Saravana Kannan | 55e959d | 2012-10-15 22:16:04 -0700 | [diff] [blame] | 425 | .vdd_class = &vdd_dig, \ |
| 426 | .fmax = (unsigned long[VDD_DIG_NUM]) { \ |
| 427 | [VDD_DIG_##l1] = (f1), \ |
| 428 | [VDD_DIG_##l2] = (f2), \ |
| 429 | }, \ |
| 430 | .num_fmax = VDD_DIG_NUM |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 431 | #define VDD_DIG_FMAX_MAP3(l1, f1, l2, f2, l3, f3) \ |
Saravana Kannan | 55e959d | 2012-10-15 22:16:04 -0700 | [diff] [blame] | 432 | .vdd_class = &vdd_dig, \ |
| 433 | .fmax = (unsigned long[VDD_DIG_NUM]) { \ |
| 434 | [VDD_DIG_##l1] = (f1), \ |
| 435 | [VDD_DIG_##l2] = (f2), \ |
| 436 | [VDD_DIG_##l3] = (f3), \ |
| 437 | }, \ |
| 438 | .num_fmax = VDD_DIG_NUM |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 439 | |
Matt Wagantall | 82feaa1 | 2012-07-09 10:54:49 -0700 | [diff] [blame] | 440 | enum vdd_sr2_hdmi_pll_levels { |
| 441 | VDD_SR2_HDMI_PLL_OFF, |
Saravana Kannan | 55e959d | 2012-10-15 22:16:04 -0700 | [diff] [blame] | 442 | VDD_SR2_HDMI_PLL_ON, |
| 443 | VDD_SR2_HDMI_PLL_NUM |
Matt Wagantall | c57577d | 2011-10-06 17:06:53 -0700 | [diff] [blame] | 444 | }; |
| 445 | |
Matt Wagantall | 82feaa1 | 2012-07-09 10:54:49 -0700 | [diff] [blame] | 446 | static int set_vdd_sr2_hdmi_pll_8960(struct clk_vdd_class *vdd_class, int level) |
Matt Wagantall | c57577d | 2011-10-06 17:06:53 -0700 | [diff] [blame] | 447 | { |
Tianyi Gou | bf3d0b1 | 2012-01-23 14:37:28 -0800 | [diff] [blame] | 448 | int rc = 0; |
Saravana Kannan | 298ec39 | 2012-02-08 19:21:47 -0800 | [diff] [blame] | 449 | |
Matt Wagantall | 82feaa1 | 2012-07-09 10:54:49 -0700 | [diff] [blame] | 450 | if (level == VDD_SR2_HDMI_PLL_OFF) { |
Saravana Kannan | 298ec39 | 2012-02-08 19:21:47 -0800 | [diff] [blame] | 451 | rc = rpm_vreg_set_voltage(RPM_VREG_ID_PM8921_L23, |
| 452 | RPM_VREG_VOTER3, 0, 0, 1); |
| 453 | if (rc) |
| 454 | return rc; |
| 455 | rc = rpm_vreg_set_voltage(RPM_VREG_ID_PM8921_S8, |
| 456 | RPM_VREG_VOTER3, 0, 0, 1); |
| 457 | if (rc) |
| 458 | rpm_vreg_set_voltage(RPM_VREG_ID_PM8921_L23, |
| 459 | RPM_VREG_VOTER3, 1800000, 1800000, 1); |
Tianyi Gou | e1faaf2 | 2012-01-24 16:07:19 -0800 | [diff] [blame] | 460 | } else { |
Saravana Kannan | 298ec39 | 2012-02-08 19:21:47 -0800 | [diff] [blame] | 461 | rc = rpm_vreg_set_voltage(RPM_VREG_ID_PM8921_S8, |
David Collins | 9a81d6c | 2012-03-29 15:11:33 -0700 | [diff] [blame] | 462 | RPM_VREG_VOTER3, 2050000, 2100000, 1); |
Saravana Kannan | 298ec39 | 2012-02-08 19:21:47 -0800 | [diff] [blame] | 463 | if (rc) |
| 464 | return rc; |
| 465 | rc = rpm_vreg_set_voltage(RPM_VREG_ID_PM8921_L23, |
| 466 | RPM_VREG_VOTER3, 1800000, 1800000, 1); |
| 467 | if (rc) |
| 468 | rpm_vreg_set_voltage(RPM_VREG_ID_PM8921_S8, |
Tianyi Gou | bf3d0b1 | 2012-01-23 14:37:28 -0800 | [diff] [blame] | 469 | RPM_VREG_VOTER3, 0, 0, 1); |
Matt Wagantall | c57577d | 2011-10-06 17:06:53 -0700 | [diff] [blame] | 470 | } |
| 471 | |
| 472 | return rc; |
| 473 | } |
| 474 | |
Saravana Kannan | 55e959d | 2012-10-15 22:16:04 -0700 | [diff] [blame] | 475 | static DEFINE_VDD_CLASS(vdd_sr2_hdmi_pll, set_vdd_sr2_hdmi_pll_8960, |
| 476 | VDD_SR2_HDMI_PLL_NUM); |
Saravana Kannan | 298ec39 | 2012-02-08 19:21:47 -0800 | [diff] [blame] | 477 | |
| 478 | static int sr2_lreg_uv[] = { |
Matt Wagantall | 82feaa1 | 2012-07-09 10:54:49 -0700 | [diff] [blame] | 479 | [VDD_SR2_HDMI_PLL_OFF] = 0, |
| 480 | [VDD_SR2_HDMI_PLL_ON] = 1800000, |
Saravana Kannan | 298ec39 | 2012-02-08 19:21:47 -0800 | [diff] [blame] | 481 | }; |
| 482 | |
Matt Wagantall | 82feaa1 | 2012-07-09 10:54:49 -0700 | [diff] [blame] | 483 | static int set_vdd_sr2_hdmi_pll_8064(struct clk_vdd_class *vdd_class, int level) |
Saravana Kannan | 298ec39 | 2012-02-08 19:21:47 -0800 | [diff] [blame] | 484 | { |
| 485 | return rpm_vreg_set_voltage(RPM_VREG_ID_PM8921_LVS7, RPM_VREG_VOTER3, |
| 486 | sr2_lreg_uv[level], sr2_lreg_uv[level], 1); |
| 487 | } |
| 488 | |
Patrick Daly | 1a3859f | 2012-08-27 16:10:26 -0700 | [diff] [blame] | 489 | static int set_vdd_sr2_hdmi_pll_8930_pm8917(struct clk_vdd_class *vdd_class, |
| 490 | int level) |
| 491 | { |
| 492 | int rc = 0; |
| 493 | |
| 494 | if (level == VDD_SR2_HDMI_PLL_OFF) { |
| 495 | rc = rpm_vreg_set_voltage(RPM_VREG_ID_PM8917_L23, |
| 496 | RPM_VREG_VOTER3, 0, 0, 1); |
| 497 | if (rc) |
| 498 | return rc; |
| 499 | rc = rpm_vreg_set_voltage(RPM_VREG_ID_PM8917_S8, |
| 500 | RPM_VREG_VOTER3, 0, 0, 1); |
| 501 | if (rc) |
| 502 | rpm_vreg_set_voltage(RPM_VREG_ID_PM8917_L23, |
| 503 | RPM_VREG_VOTER3, 1800000, 1800000, 1); |
| 504 | } else { |
| 505 | rc = rpm_vreg_set_voltage(RPM_VREG_ID_PM8917_S8, |
| 506 | RPM_VREG_VOTER3, 2050000, 2100000, 1); |
| 507 | if (rc) |
| 508 | return rc; |
| 509 | rc = rpm_vreg_set_voltage(RPM_VREG_ID_PM8917_L23, |
| 510 | RPM_VREG_VOTER3, 1800000, 1800000, 1); |
| 511 | if (rc) |
| 512 | rpm_vreg_set_voltage(RPM_VREG_ID_PM8917_S8, |
| 513 | RPM_VREG_VOTER3, 0, 0, 1); |
| 514 | } |
| 515 | |
| 516 | return rc; |
| 517 | } |
| 518 | |
Matt Wagantall | 82feaa1 | 2012-07-09 10:54:49 -0700 | [diff] [blame] | 519 | static int set_vdd_sr2_hdmi_pll_8930(struct clk_vdd_class *vdd_class, int level) |
Saravana Kannan | 298ec39 | 2012-02-08 19:21:47 -0800 | [diff] [blame] | 520 | { |
| 521 | return rpm_vreg_set_voltage(RPM_VREG_ID_PM8038_L23, RPM_VREG_VOTER3, |
| 522 | sr2_lreg_uv[level], sr2_lreg_uv[level], 1); |
| 523 | } |
Matt Wagantall | c57577d | 2011-10-06 17:06:53 -0700 | [diff] [blame] | 524 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 525 | /* |
| 526 | * Clock Descriptions |
| 527 | */ |
| 528 | |
Stephen Boyd | 72a8035 | 2012-01-26 15:57:38 -0800 | [diff] [blame] | 529 | DEFINE_CLK_RPM_BRANCH(pxo_clk, pxo_a_clk, PXO, 27000000); |
| 530 | DEFINE_CLK_RPM_BRANCH(cxo_clk, cxo_a_clk, CXO, 19200000); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 531 | |
| 532 | static struct pll_clk pll2_clk = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 533 | .mode_reg = MM_PLL1_MODE_REG, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 534 | .c = { |
Saravana Kannan | 7a6532e | 2012-10-18 20:51:13 -0700 | [diff] [blame] | 535 | .parent = &pxo_clk.c, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 536 | .dbg_name = "pll2_clk", |
Tianyi Gou | 7949ecb | 2012-02-14 14:25:32 -0800 | [diff] [blame] | 537 | .rate = 800000000, |
Vikram Mulukutla | 681d868 | 2012-03-09 23:56:20 -0800 | [diff] [blame] | 538 | .ops = &clk_ops_local_pll, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 539 | CLK_INIT(pll2_clk.c), |
| 540 | }, |
| 541 | }; |
| 542 | |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 543 | static struct pll_clk pll3_clk = { |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 544 | .mode_reg = BB_MMCC_PLL2_MODE_REG, |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 545 | .c = { |
Saravana Kannan | 7a6532e | 2012-10-18 20:51:13 -0700 | [diff] [blame] | 546 | .parent = &pxo_clk.c, |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 547 | .dbg_name = "pll3_clk", |
Tianyi Gou | 7949ecb | 2012-02-14 14:25:32 -0800 | [diff] [blame] | 548 | .rate = 1200000000, |
Vikram Mulukutla | 681d868 | 2012-03-09 23:56:20 -0800 | [diff] [blame] | 549 | .ops = &clk_ops_local_pll, |
Matt Wagantall | 82feaa1 | 2012-07-09 10:54:49 -0700 | [diff] [blame] | 550 | .vdd_class = &vdd_sr2_hdmi_pll, |
Saravana Kannan | 55e959d | 2012-10-15 22:16:04 -0700 | [diff] [blame] | 551 | .fmax = (unsigned long[VDD_SR2_HDMI_PLL_NUM]) { |
| 552 | [VDD_SR2_HDMI_PLL_ON] = ULONG_MAX |
| 553 | }, |
| 554 | .num_fmax = VDD_SR2_HDMI_PLL_NUM, |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 555 | CLK_INIT(pll3_clk.c), |
| 556 | }, |
| 557 | }; |
| 558 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 559 | static struct pll_vote_clk pll4_clk = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 560 | .en_reg = BB_PLL_ENA_SC0_REG, |
| 561 | .en_mask = BIT(4), |
| 562 | .status_reg = LCC_PLL0_STATUS_REG, |
Vikram Mulukutla | 681d868 | 2012-03-09 23:56:20 -0800 | [diff] [blame] | 563 | .status_mask = BIT(16), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 564 | .c = { |
Saravana Kannan | 7a6532e | 2012-10-18 20:51:13 -0700 | [diff] [blame] | 565 | .parent = &pxo_clk.c, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 566 | .dbg_name = "pll4_clk", |
Tianyi Gou | 7949ecb | 2012-02-14 14:25:32 -0800 | [diff] [blame] | 567 | .rate = 393216000, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 568 | .ops = &clk_ops_pll_vote, |
| 569 | CLK_INIT(pll4_clk.c), |
| 570 | }, |
| 571 | }; |
| 572 | |
| 573 | static struct pll_vote_clk pll8_clk = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 574 | .en_reg = BB_PLL_ENA_SC0_REG, |
| 575 | .en_mask = BIT(8), |
| 576 | .status_reg = BB_PLL8_STATUS_REG, |
Vikram Mulukutla | 681d868 | 2012-03-09 23:56:20 -0800 | [diff] [blame] | 577 | .status_mask = BIT(16), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 578 | .c = { |
Saravana Kannan | 7a6532e | 2012-10-18 20:51:13 -0700 | [diff] [blame] | 579 | .parent = &pxo_clk.c, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 580 | .dbg_name = "pll8_clk", |
Tianyi Gou | 7949ecb | 2012-02-14 14:25:32 -0800 | [diff] [blame] | 581 | .rate = 384000000, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 582 | .ops = &clk_ops_pll_vote, |
| 583 | CLK_INIT(pll8_clk.c), |
| 584 | }, |
| 585 | }; |
| 586 | |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 587 | static struct pll_vote_clk pll14_clk = { |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 588 | .en_reg = BB_PLL_ENA_SC0_REG, |
| 589 | .en_mask = BIT(14), |
| 590 | .status_reg = BB_PLL14_STATUS_REG, |
Vikram Mulukutla | 681d868 | 2012-03-09 23:56:20 -0800 | [diff] [blame] | 591 | .status_mask = BIT(16), |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 592 | .c = { |
Saravana Kannan | 7a6532e | 2012-10-18 20:51:13 -0700 | [diff] [blame] | 593 | .parent = &pxo_clk.c, |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 594 | .dbg_name = "pll14_clk", |
Tianyi Gou | 7949ecb | 2012-02-14 14:25:32 -0800 | [diff] [blame] | 595 | .rate = 480000000, |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 596 | .ops = &clk_ops_pll_vote, |
| 597 | CLK_INIT(pll14_clk.c), |
| 598 | }, |
| 599 | }; |
| 600 | |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 601 | static struct pll_clk pll15_clk = { |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 602 | .mode_reg = MM_PLL3_MODE_REG, |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 603 | .c = { |
Saravana Kannan | 7a6532e | 2012-10-18 20:51:13 -0700 | [diff] [blame] | 604 | .parent = &pxo_clk.c, |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 605 | .dbg_name = "pll15_clk", |
Tianyi Gou | 7949ecb | 2012-02-14 14:25:32 -0800 | [diff] [blame] | 606 | .rate = 975000000, |
Vikram Mulukutla | 681d868 | 2012-03-09 23:56:20 -0800 | [diff] [blame] | 607 | .ops = &clk_ops_local_pll, |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 608 | CLK_INIT(pll15_clk.c), |
| 609 | }, |
| 610 | }; |
| 611 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 612 | /* AXI Interfaces */ |
| 613 | static struct branch_clk gmem_axi_clk = { |
| 614 | .b = { |
| 615 | .ctl_reg = MAXI_EN_REG, |
| 616 | .en_mask = BIT(24), |
| 617 | .halt_reg = DBG_BUS_VEC_E_REG, |
| 618 | .halt_bit = 6, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 619 | .retain_reg = MAXI_EN2_REG, |
| 620 | .retain_mask = BIT(21), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 621 | }, |
| 622 | .c = { |
| 623 | .dbg_name = "gmem_axi_clk", |
| 624 | .ops = &clk_ops_branch, |
| 625 | CLK_INIT(gmem_axi_clk.c), |
| 626 | }, |
| 627 | }; |
| 628 | |
| 629 | static struct branch_clk ijpeg_axi_clk = { |
| 630 | .b = { |
| 631 | .ctl_reg = MAXI_EN_REG, |
| 632 | .en_mask = BIT(21), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 633 | .hwcg_reg = MAXI_EN_REG, |
| 634 | .hwcg_mask = BIT(11), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 635 | .reset_reg = SW_RESET_AXI_REG, |
| 636 | .reset_mask = BIT(14), |
| 637 | .halt_reg = DBG_BUS_VEC_E_REG, |
| 638 | .halt_bit = 4, |
| 639 | }, |
| 640 | .c = { |
| 641 | .dbg_name = "ijpeg_axi_clk", |
| 642 | .ops = &clk_ops_branch, |
| 643 | CLK_INIT(ijpeg_axi_clk.c), |
| 644 | }, |
| 645 | }; |
| 646 | |
| 647 | static struct branch_clk imem_axi_clk = { |
| 648 | .b = { |
| 649 | .ctl_reg = MAXI_EN_REG, |
| 650 | .en_mask = BIT(22), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 651 | .hwcg_reg = MAXI_EN_REG, |
| 652 | .hwcg_mask = BIT(15), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 653 | .reset_reg = SW_RESET_CORE_REG, |
| 654 | .reset_mask = BIT(10), |
| 655 | .halt_reg = DBG_BUS_VEC_E_REG, |
| 656 | .halt_bit = 7, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 657 | .retain_reg = MAXI_EN2_REG, |
| 658 | .retain_mask = BIT(10), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 659 | }, |
| 660 | .c = { |
| 661 | .dbg_name = "imem_axi_clk", |
| 662 | .ops = &clk_ops_branch, |
| 663 | CLK_INIT(imem_axi_clk.c), |
| 664 | }, |
| 665 | }; |
| 666 | |
| 667 | static struct branch_clk jpegd_axi_clk = { |
| 668 | .b = { |
| 669 | .ctl_reg = MAXI_EN_REG, |
| 670 | .en_mask = BIT(25), |
| 671 | .halt_reg = DBG_BUS_VEC_E_REG, |
| 672 | .halt_bit = 5, |
| 673 | }, |
| 674 | .c = { |
| 675 | .dbg_name = "jpegd_axi_clk", |
| 676 | .ops = &clk_ops_branch, |
| 677 | CLK_INIT(jpegd_axi_clk.c), |
| 678 | }, |
| 679 | }; |
| 680 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 681 | static struct branch_clk vcodec_axi_b_clk = { |
| 682 | .b = { |
| 683 | .ctl_reg = MAXI_EN4_REG, |
| 684 | .en_mask = BIT(23), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 685 | .hwcg_reg = MAXI_EN4_REG, |
| 686 | .hwcg_mask = BIT(22), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 687 | .halt_reg = DBG_BUS_VEC_I_REG, |
| 688 | .halt_bit = 25, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 689 | .retain_reg = MAXI_EN4_REG, |
| 690 | .retain_mask = BIT(21), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 691 | }, |
| 692 | .c = { |
| 693 | .dbg_name = "vcodec_axi_b_clk", |
| 694 | .ops = &clk_ops_branch, |
| 695 | CLK_INIT(vcodec_axi_b_clk.c), |
| 696 | }, |
| 697 | }; |
| 698 | |
Matt Wagantall | 91f4270 | 2011-07-14 12:01:15 -0700 | [diff] [blame] | 699 | static struct branch_clk vcodec_axi_a_clk = { |
| 700 | .b = { |
| 701 | .ctl_reg = MAXI_EN4_REG, |
| 702 | .en_mask = BIT(25), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 703 | .hwcg_reg = MAXI_EN4_REG, |
| 704 | .hwcg_mask = BIT(24), |
Matt Wagantall | 91f4270 | 2011-07-14 12:01:15 -0700 | [diff] [blame] | 705 | .halt_reg = DBG_BUS_VEC_I_REG, |
| 706 | .halt_bit = 26, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 707 | .retain_reg = MAXI_EN4_REG, |
| 708 | .retain_mask = BIT(10), |
Matt Wagantall | 91f4270 | 2011-07-14 12:01:15 -0700 | [diff] [blame] | 709 | }, |
Matt Wagantall | 91f4270 | 2011-07-14 12:01:15 -0700 | [diff] [blame] | 710 | .c = { |
| 711 | .dbg_name = "vcodec_axi_a_clk", |
| 712 | .ops = &clk_ops_branch, |
| 713 | CLK_INIT(vcodec_axi_a_clk.c), |
Stephen Boyd | 7fa2674 | 2011-08-11 23:22:29 -0700 | [diff] [blame] | 714 | .depends = &vcodec_axi_b_clk.c, |
Matt Wagantall | 91f4270 | 2011-07-14 12:01:15 -0700 | [diff] [blame] | 715 | }, |
| 716 | }; |
| 717 | |
| 718 | static struct branch_clk vcodec_axi_clk = { |
| 719 | .b = { |
| 720 | .ctl_reg = MAXI_EN_REG, |
| 721 | .en_mask = BIT(19), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 722 | .hwcg_reg = MAXI_EN_REG, |
| 723 | .hwcg_mask = BIT(13), |
Matt Wagantall | 91f4270 | 2011-07-14 12:01:15 -0700 | [diff] [blame] | 724 | .reset_reg = SW_RESET_AXI_REG, |
Gopikrishnaiah Anandan | 83b6e85 | 2012-01-05 17:47:02 -0800 | [diff] [blame] | 725 | .reset_mask = BIT(4)|BIT(5)|BIT(7), |
Matt Wagantall | 91f4270 | 2011-07-14 12:01:15 -0700 | [diff] [blame] | 726 | .halt_reg = DBG_BUS_VEC_E_REG, |
| 727 | .halt_bit = 3, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 728 | .retain_reg = MAXI_EN2_REG, |
| 729 | .retain_mask = BIT(28), |
Matt Wagantall | 91f4270 | 2011-07-14 12:01:15 -0700 | [diff] [blame] | 730 | }, |
Matt Wagantall | 91f4270 | 2011-07-14 12:01:15 -0700 | [diff] [blame] | 731 | .c = { |
| 732 | .dbg_name = "vcodec_axi_clk", |
| 733 | .ops = &clk_ops_branch, |
| 734 | CLK_INIT(vcodec_axi_clk.c), |
Stephen Boyd | 7fa2674 | 2011-08-11 23:22:29 -0700 | [diff] [blame] | 735 | .depends = &vcodec_axi_a_clk.c, |
Matt Wagantall | 91f4270 | 2011-07-14 12:01:15 -0700 | [diff] [blame] | 736 | }, |
| 737 | }; |
| 738 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 739 | static struct branch_clk vfe_axi_clk = { |
| 740 | .b = { |
| 741 | .ctl_reg = MAXI_EN_REG, |
| 742 | .en_mask = BIT(18), |
| 743 | .reset_reg = SW_RESET_AXI_REG, |
| 744 | .reset_mask = BIT(9), |
| 745 | .halt_reg = DBG_BUS_VEC_E_REG, |
| 746 | .halt_bit = 0, |
| 747 | }, |
| 748 | .c = { |
| 749 | .dbg_name = "vfe_axi_clk", |
| 750 | .ops = &clk_ops_branch, |
| 751 | CLK_INIT(vfe_axi_clk.c), |
| 752 | }, |
| 753 | }; |
| 754 | |
| 755 | static struct branch_clk mdp_axi_clk = { |
| 756 | .b = { |
| 757 | .ctl_reg = MAXI_EN_REG, |
| 758 | .en_mask = BIT(23), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 759 | .hwcg_reg = MAXI_EN_REG, |
| 760 | .hwcg_mask = BIT(16), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 761 | .reset_reg = SW_RESET_AXI_REG, |
| 762 | .reset_mask = BIT(13), |
| 763 | .halt_reg = DBG_BUS_VEC_E_REG, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 764 | .halt_bit = 8, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 765 | .retain_reg = MAXI_EN_REG, |
| 766 | .retain_mask = BIT(0), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 767 | }, |
| 768 | .c = { |
| 769 | .dbg_name = "mdp_axi_clk", |
| 770 | .ops = &clk_ops_branch, |
| 771 | CLK_INIT(mdp_axi_clk.c), |
| 772 | }, |
| 773 | }; |
| 774 | |
| 775 | static struct branch_clk rot_axi_clk = { |
| 776 | .b = { |
| 777 | .ctl_reg = MAXI_EN2_REG, |
| 778 | .en_mask = BIT(24), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 779 | .hwcg_reg = MAXI_EN2_REG, |
| 780 | .hwcg_mask = BIT(25), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 781 | .reset_reg = SW_RESET_AXI_REG, |
| 782 | .reset_mask = BIT(6), |
| 783 | .halt_reg = DBG_BUS_VEC_E_REG, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 784 | .halt_bit = 2, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 785 | .retain_reg = MAXI_EN3_REG, |
| 786 | .retain_mask = BIT(10), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 787 | }, |
| 788 | .c = { |
| 789 | .dbg_name = "rot_axi_clk", |
| 790 | .ops = &clk_ops_branch, |
| 791 | CLK_INIT(rot_axi_clk.c), |
| 792 | }, |
| 793 | }; |
| 794 | |
| 795 | static struct branch_clk vpe_axi_clk = { |
| 796 | .b = { |
| 797 | .ctl_reg = MAXI_EN2_REG, |
| 798 | .en_mask = BIT(26), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 799 | .hwcg_reg = MAXI_EN2_REG, |
| 800 | .hwcg_mask = BIT(27), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 801 | .reset_reg = SW_RESET_AXI_REG, |
| 802 | .reset_mask = BIT(15), |
| 803 | .halt_reg = DBG_BUS_VEC_E_REG, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 804 | .halt_bit = 1, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 805 | .retain_reg = MAXI_EN3_REG, |
| 806 | .retain_mask = BIT(21), |
| 807 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 808 | }, |
| 809 | .c = { |
| 810 | .dbg_name = "vpe_axi_clk", |
| 811 | .ops = &clk_ops_branch, |
| 812 | CLK_INIT(vpe_axi_clk.c), |
| 813 | }, |
| 814 | }; |
| 815 | |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 816 | static struct branch_clk vcap_axi_clk = { |
| 817 | .b = { |
| 818 | .ctl_reg = MAXI_EN5_REG, |
| 819 | .en_mask = BIT(12), |
Tianyi Gou | f3095ea | 2012-05-22 14:16:06 -0700 | [diff] [blame] | 820 | .hwcg_reg = MAXI_EN5_REG, |
| 821 | .hwcg_mask = BIT(11), |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 822 | .reset_reg = SW_RESET_AXI_REG, |
| 823 | .reset_mask = BIT(16), |
| 824 | .halt_reg = DBG_BUS_VEC_J_REG, |
| 825 | .halt_bit = 20, |
| 826 | }, |
| 827 | .c = { |
| 828 | .dbg_name = "vcap_axi_clk", |
| 829 | .ops = &clk_ops_branch, |
| 830 | CLK_INIT(vcap_axi_clk.c), |
| 831 | }, |
| 832 | }; |
| 833 | |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 834 | /* gfx3d_axi_clk is set as a dependency of gmem_axi_clk at runtime */ |
Patrick Daly | e6f48904 | 2012-07-11 15:29:15 -0700 | [diff] [blame] | 835 | static struct branch_clk gfx3d_axi_clk = { |
Tianyi Gou | 621f874 | 2011-09-01 21:45:01 -0700 | [diff] [blame] | 836 | .b = { |
| 837 | .ctl_reg = MAXI_EN5_REG, |
| 838 | .en_mask = BIT(25), |
Tianyi Gou | f3095ea | 2012-05-22 14:16:06 -0700 | [diff] [blame] | 839 | .hwcg_reg = MAXI_EN5_REG, |
| 840 | .hwcg_mask = BIT(24), |
Tianyi Gou | 621f874 | 2011-09-01 21:45:01 -0700 | [diff] [blame] | 841 | .reset_reg = SW_RESET_AXI_REG, |
| 842 | .reset_mask = BIT(17), |
| 843 | .halt_reg = DBG_BUS_VEC_J_REG, |
| 844 | .halt_bit = 30, |
| 845 | }, |
| 846 | .c = { |
| 847 | .dbg_name = "gfx3d_axi_clk", |
| 848 | .ops = &clk_ops_branch, |
Patrick Daly | e6f48904 | 2012-07-11 15:29:15 -0700 | [diff] [blame] | 849 | CLK_INIT(gfx3d_axi_clk.c), |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 850 | }, |
| 851 | }; |
| 852 | |
| 853 | static struct branch_clk gfx3d_axi_clk_8930 = { |
| 854 | .b = { |
| 855 | .ctl_reg = MAXI_EN5_REG, |
| 856 | .en_mask = BIT(12), |
| 857 | .reset_reg = SW_RESET_AXI_REG, |
| 858 | .reset_mask = BIT(16), |
| 859 | .halt_reg = DBG_BUS_VEC_J_REG, |
| 860 | .halt_bit = 12, |
| 861 | }, |
| 862 | .c = { |
| 863 | .dbg_name = "gfx3d_axi_clk", |
| 864 | .ops = &clk_ops_branch, |
| 865 | CLK_INIT(gfx3d_axi_clk_8930.c), |
Tianyi Gou | 621f874 | 2011-09-01 21:45:01 -0700 | [diff] [blame] | 866 | }, |
| 867 | }; |
| 868 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 869 | /* AHB Interfaces */ |
| 870 | static struct branch_clk amp_p_clk = { |
| 871 | .b = { |
| 872 | .ctl_reg = AHB_EN_REG, |
| 873 | .en_mask = BIT(24), |
Matt Wagantall | d40857a | 2012-04-10 19:15:43 -0700 | [diff] [blame] | 874 | .reset_reg = SW_RESET_CORE_REG, |
| 875 | .reset_mask = BIT(20), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 876 | .halt_reg = DBG_BUS_VEC_F_REG, |
| 877 | .halt_bit = 18, |
| 878 | }, |
| 879 | .c = { |
| 880 | .dbg_name = "amp_p_clk", |
| 881 | .ops = &clk_ops_branch, |
| 882 | CLK_INIT(amp_p_clk.c), |
| 883 | }, |
| 884 | }; |
| 885 | |
Matt Wagantall | c23eee9 | 2011-08-16 23:06:52 -0700 | [diff] [blame] | 886 | static struct branch_clk csi_p_clk = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 887 | .b = { |
| 888 | .ctl_reg = AHB_EN_REG, |
| 889 | .en_mask = BIT(7), |
| 890 | .reset_reg = SW_RESET_AHB_REG, |
| 891 | .reset_mask = BIT(17), |
| 892 | .halt_reg = DBG_BUS_VEC_F_REG, |
| 893 | .halt_bit = 16, |
| 894 | }, |
| 895 | .c = { |
Matt Wagantall | c23eee9 | 2011-08-16 23:06:52 -0700 | [diff] [blame] | 896 | .dbg_name = "csi_p_clk", |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 897 | .ops = &clk_ops_branch, |
Matt Wagantall | c23eee9 | 2011-08-16 23:06:52 -0700 | [diff] [blame] | 898 | CLK_INIT(csi_p_clk.c), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 899 | }, |
| 900 | }; |
| 901 | |
| 902 | static struct branch_clk dsi1_m_p_clk = { |
| 903 | .b = { |
| 904 | .ctl_reg = AHB_EN_REG, |
| 905 | .en_mask = BIT(9), |
| 906 | .reset_reg = SW_RESET_AHB_REG, |
| 907 | .reset_mask = BIT(6), |
| 908 | .halt_reg = DBG_BUS_VEC_F_REG, |
| 909 | .halt_bit = 19, |
| 910 | }, |
| 911 | .c = { |
| 912 | .dbg_name = "dsi1_m_p_clk", |
| 913 | .ops = &clk_ops_branch, |
| 914 | CLK_INIT(dsi1_m_p_clk.c), |
| 915 | }, |
| 916 | }; |
| 917 | |
| 918 | static struct branch_clk dsi1_s_p_clk = { |
| 919 | .b = { |
| 920 | .ctl_reg = AHB_EN_REG, |
| 921 | .en_mask = BIT(18), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 922 | .hwcg_reg = AHB_EN2_REG, |
| 923 | .hwcg_mask = BIT(20), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 924 | .reset_reg = SW_RESET_AHB_REG, |
| 925 | .reset_mask = BIT(5), |
| 926 | .halt_reg = DBG_BUS_VEC_F_REG, |
| 927 | .halt_bit = 21, |
| 928 | }, |
| 929 | .c = { |
| 930 | .dbg_name = "dsi1_s_p_clk", |
| 931 | .ops = &clk_ops_branch, |
| 932 | CLK_INIT(dsi1_s_p_clk.c), |
| 933 | }, |
| 934 | }; |
| 935 | |
| 936 | static struct branch_clk dsi2_m_p_clk = { |
| 937 | .b = { |
| 938 | .ctl_reg = AHB_EN_REG, |
| 939 | .en_mask = BIT(17), |
| 940 | .reset_reg = SW_RESET_AHB2_REG, |
| 941 | .reset_mask = BIT(1), |
| 942 | .halt_reg = DBG_BUS_VEC_E_REG, |
| 943 | .halt_bit = 18, |
| 944 | }, |
| 945 | .c = { |
| 946 | .dbg_name = "dsi2_m_p_clk", |
| 947 | .ops = &clk_ops_branch, |
| 948 | CLK_INIT(dsi2_m_p_clk.c), |
| 949 | }, |
| 950 | }; |
| 951 | |
| 952 | static struct branch_clk dsi2_s_p_clk = { |
| 953 | .b = { |
| 954 | .ctl_reg = AHB_EN_REG, |
| 955 | .en_mask = BIT(22), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 956 | .hwcg_reg = AHB_EN2_REG, |
| 957 | .hwcg_mask = BIT(15), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 958 | .reset_reg = SW_RESET_AHB2_REG, |
| 959 | .reset_mask = BIT(0), |
| 960 | .halt_reg = DBG_BUS_VEC_F_REG, |
| 961 | .halt_bit = 20, |
| 962 | }, |
| 963 | .c = { |
| 964 | .dbg_name = "dsi2_s_p_clk", |
| 965 | .ops = &clk_ops_branch, |
| 966 | CLK_INIT(dsi2_s_p_clk.c), |
| 967 | }, |
| 968 | }; |
| 969 | |
| 970 | static struct branch_clk gfx2d0_p_clk = { |
| 971 | .b = { |
| 972 | .ctl_reg = AHB_EN_REG, |
| 973 | .en_mask = BIT(19), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 974 | .hwcg_reg = AHB_EN2_REG, |
| 975 | .hwcg_mask = BIT(28), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 976 | .reset_reg = SW_RESET_AHB_REG, |
| 977 | .reset_mask = BIT(12), |
| 978 | .halt_reg = DBG_BUS_VEC_F_REG, |
| 979 | .halt_bit = 2, |
| 980 | }, |
| 981 | .c = { |
| 982 | .dbg_name = "gfx2d0_p_clk", |
| 983 | .ops = &clk_ops_branch, |
Matt Wagantall | 158f73b | 2012-05-16 11:29:35 -0700 | [diff] [blame] | 984 | .flags = CLKFLAG_SKIP_HANDOFF, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 985 | CLK_INIT(gfx2d0_p_clk.c), |
| 986 | }, |
| 987 | }; |
| 988 | |
| 989 | static struct branch_clk gfx2d1_p_clk = { |
| 990 | .b = { |
| 991 | .ctl_reg = AHB_EN_REG, |
| 992 | .en_mask = BIT(2), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 993 | .hwcg_reg = AHB_EN2_REG, |
| 994 | .hwcg_mask = BIT(29), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 995 | .reset_reg = SW_RESET_AHB_REG, |
| 996 | .reset_mask = BIT(11), |
| 997 | .halt_reg = DBG_BUS_VEC_F_REG, |
| 998 | .halt_bit = 3, |
| 999 | }, |
| 1000 | .c = { |
| 1001 | .dbg_name = "gfx2d1_p_clk", |
| 1002 | .ops = &clk_ops_branch, |
Matt Wagantall | 158f73b | 2012-05-16 11:29:35 -0700 | [diff] [blame] | 1003 | .flags = CLKFLAG_SKIP_HANDOFF, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1004 | CLK_INIT(gfx2d1_p_clk.c), |
| 1005 | }, |
| 1006 | }; |
| 1007 | |
| 1008 | static struct branch_clk gfx3d_p_clk = { |
| 1009 | .b = { |
| 1010 | .ctl_reg = AHB_EN_REG, |
| 1011 | .en_mask = BIT(3), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 1012 | .hwcg_reg = AHB_EN2_REG, |
| 1013 | .hwcg_mask = BIT(27), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1014 | .reset_reg = SW_RESET_AHB_REG, |
| 1015 | .reset_mask = BIT(10), |
| 1016 | .halt_reg = DBG_BUS_VEC_F_REG, |
| 1017 | .halt_bit = 4, |
| 1018 | }, |
| 1019 | .c = { |
| 1020 | .dbg_name = "gfx3d_p_clk", |
| 1021 | .ops = &clk_ops_branch, |
| 1022 | CLK_INIT(gfx3d_p_clk.c), |
| 1023 | }, |
| 1024 | }; |
| 1025 | |
| 1026 | static struct branch_clk hdmi_m_p_clk = { |
| 1027 | .b = { |
| 1028 | .ctl_reg = AHB_EN_REG, |
| 1029 | .en_mask = BIT(14), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 1030 | .hwcg_reg = AHB_EN2_REG, |
| 1031 | .hwcg_mask = BIT(21), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1032 | .reset_reg = SW_RESET_AHB_REG, |
| 1033 | .reset_mask = BIT(9), |
| 1034 | .halt_reg = DBG_BUS_VEC_F_REG, |
| 1035 | .halt_bit = 5, |
| 1036 | }, |
| 1037 | .c = { |
| 1038 | .dbg_name = "hdmi_m_p_clk", |
| 1039 | .ops = &clk_ops_branch, |
| 1040 | CLK_INIT(hdmi_m_p_clk.c), |
| 1041 | }, |
| 1042 | }; |
| 1043 | |
| 1044 | static struct branch_clk hdmi_s_p_clk = { |
| 1045 | .b = { |
| 1046 | .ctl_reg = AHB_EN_REG, |
| 1047 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 1048 | .hwcg_reg = AHB_EN2_REG, |
| 1049 | .hwcg_mask = BIT(22), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1050 | .reset_reg = SW_RESET_AHB_REG, |
| 1051 | .reset_mask = BIT(9), |
| 1052 | .halt_reg = DBG_BUS_VEC_F_REG, |
| 1053 | .halt_bit = 6, |
| 1054 | }, |
| 1055 | .c = { |
| 1056 | .dbg_name = "hdmi_s_p_clk", |
| 1057 | .ops = &clk_ops_branch, |
| 1058 | CLK_INIT(hdmi_s_p_clk.c), |
| 1059 | }, |
| 1060 | }; |
| 1061 | |
| 1062 | static struct branch_clk ijpeg_p_clk = { |
| 1063 | .b = { |
| 1064 | .ctl_reg = AHB_EN_REG, |
| 1065 | .en_mask = BIT(5), |
| 1066 | .reset_reg = SW_RESET_AHB_REG, |
| 1067 | .reset_mask = BIT(7), |
| 1068 | .halt_reg = DBG_BUS_VEC_F_REG, |
| 1069 | .halt_bit = 9, |
| 1070 | }, |
| 1071 | .c = { |
| 1072 | .dbg_name = "ijpeg_p_clk", |
| 1073 | .ops = &clk_ops_branch, |
| 1074 | CLK_INIT(ijpeg_p_clk.c), |
| 1075 | }, |
| 1076 | }; |
| 1077 | |
| 1078 | static struct branch_clk imem_p_clk = { |
| 1079 | .b = { |
| 1080 | .ctl_reg = AHB_EN_REG, |
| 1081 | .en_mask = BIT(6), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 1082 | .hwcg_reg = AHB_EN2_REG, |
| 1083 | .hwcg_mask = BIT(12), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1084 | .reset_reg = SW_RESET_AHB_REG, |
| 1085 | .reset_mask = BIT(8), |
| 1086 | .halt_reg = DBG_BUS_VEC_F_REG, |
| 1087 | .halt_bit = 10, |
| 1088 | }, |
| 1089 | .c = { |
| 1090 | .dbg_name = "imem_p_clk", |
| 1091 | .ops = &clk_ops_branch, |
| 1092 | CLK_INIT(imem_p_clk.c), |
| 1093 | }, |
| 1094 | }; |
| 1095 | |
| 1096 | static struct branch_clk jpegd_p_clk = { |
| 1097 | .b = { |
| 1098 | .ctl_reg = AHB_EN_REG, |
| 1099 | .en_mask = BIT(21), |
| 1100 | .reset_reg = SW_RESET_AHB_REG, |
| 1101 | .reset_mask = BIT(4), |
| 1102 | .halt_reg = DBG_BUS_VEC_F_REG, |
| 1103 | .halt_bit = 7, |
| 1104 | }, |
| 1105 | .c = { |
| 1106 | .dbg_name = "jpegd_p_clk", |
| 1107 | .ops = &clk_ops_branch, |
| 1108 | CLK_INIT(jpegd_p_clk.c), |
| 1109 | }, |
| 1110 | }; |
| 1111 | |
| 1112 | static struct branch_clk mdp_p_clk = { |
| 1113 | .b = { |
| 1114 | .ctl_reg = AHB_EN_REG, |
| 1115 | .en_mask = BIT(10), |
| 1116 | .reset_reg = SW_RESET_AHB_REG, |
| 1117 | .reset_mask = BIT(3), |
| 1118 | .halt_reg = DBG_BUS_VEC_F_REG, |
| 1119 | .halt_bit = 11, |
| 1120 | }, |
| 1121 | .c = { |
| 1122 | .dbg_name = "mdp_p_clk", |
| 1123 | .ops = &clk_ops_branch, |
| 1124 | CLK_INIT(mdp_p_clk.c), |
| 1125 | }, |
| 1126 | }; |
| 1127 | |
| 1128 | static struct branch_clk rot_p_clk = { |
| 1129 | .b = { |
| 1130 | .ctl_reg = AHB_EN_REG, |
| 1131 | .en_mask = BIT(12), |
| 1132 | .reset_reg = SW_RESET_AHB_REG, |
| 1133 | .reset_mask = BIT(2), |
| 1134 | .halt_reg = DBG_BUS_VEC_F_REG, |
| 1135 | .halt_bit = 13, |
| 1136 | }, |
| 1137 | .c = { |
| 1138 | .dbg_name = "rot_p_clk", |
| 1139 | .ops = &clk_ops_branch, |
| 1140 | CLK_INIT(rot_p_clk.c), |
| 1141 | }, |
| 1142 | }; |
| 1143 | |
| 1144 | static struct branch_clk smmu_p_clk = { |
| 1145 | .b = { |
| 1146 | .ctl_reg = AHB_EN_REG, |
| 1147 | .en_mask = BIT(15), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 1148 | .hwcg_reg = AHB_EN_REG, |
| 1149 | .hwcg_mask = BIT(26), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1150 | .halt_reg = DBG_BUS_VEC_F_REG, |
| 1151 | .halt_bit = 22, |
| 1152 | }, |
| 1153 | .c = { |
| 1154 | .dbg_name = "smmu_p_clk", |
| 1155 | .ops = &clk_ops_branch, |
| 1156 | CLK_INIT(smmu_p_clk.c), |
| 1157 | }, |
| 1158 | }; |
| 1159 | |
| 1160 | static struct branch_clk tv_enc_p_clk = { |
| 1161 | .b = { |
| 1162 | .ctl_reg = AHB_EN_REG, |
| 1163 | .en_mask = BIT(25), |
| 1164 | .reset_reg = SW_RESET_AHB_REG, |
| 1165 | .reset_mask = BIT(15), |
| 1166 | .halt_reg = DBG_BUS_VEC_F_REG, |
| 1167 | .halt_bit = 23, |
| 1168 | }, |
| 1169 | .c = { |
| 1170 | .dbg_name = "tv_enc_p_clk", |
| 1171 | .ops = &clk_ops_branch, |
| 1172 | CLK_INIT(tv_enc_p_clk.c), |
| 1173 | }, |
| 1174 | }; |
| 1175 | |
| 1176 | static struct branch_clk vcodec_p_clk = { |
| 1177 | .b = { |
| 1178 | .ctl_reg = AHB_EN_REG, |
| 1179 | .en_mask = BIT(11), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 1180 | .hwcg_reg = AHB_EN2_REG, |
| 1181 | .hwcg_mask = BIT(26), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1182 | .reset_reg = SW_RESET_AHB_REG, |
| 1183 | .reset_mask = BIT(1), |
| 1184 | .halt_reg = DBG_BUS_VEC_F_REG, |
| 1185 | .halt_bit = 12, |
| 1186 | }, |
| 1187 | .c = { |
| 1188 | .dbg_name = "vcodec_p_clk", |
| 1189 | .ops = &clk_ops_branch, |
| 1190 | CLK_INIT(vcodec_p_clk.c), |
| 1191 | }, |
| 1192 | }; |
| 1193 | |
| 1194 | static struct branch_clk vfe_p_clk = { |
| 1195 | .b = { |
| 1196 | .ctl_reg = AHB_EN_REG, |
| 1197 | .en_mask = BIT(13), |
| 1198 | .reset_reg = SW_RESET_AHB_REG, |
| 1199 | .reset_mask = BIT(0), |
| 1200 | .halt_reg = DBG_BUS_VEC_F_REG, |
| 1201 | .halt_bit = 14, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 1202 | .retain_reg = AHB_EN2_REG, |
| 1203 | .retain_mask = BIT(0), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1204 | }, |
| 1205 | .c = { |
| 1206 | .dbg_name = "vfe_p_clk", |
| 1207 | .ops = &clk_ops_branch, |
| 1208 | CLK_INIT(vfe_p_clk.c), |
| 1209 | }, |
| 1210 | }; |
| 1211 | |
| 1212 | static struct branch_clk vpe_p_clk = { |
| 1213 | .b = { |
| 1214 | .ctl_reg = AHB_EN_REG, |
| 1215 | .en_mask = BIT(16), |
| 1216 | .reset_reg = SW_RESET_AHB_REG, |
| 1217 | .reset_mask = BIT(14), |
| 1218 | .halt_reg = DBG_BUS_VEC_F_REG, |
| 1219 | .halt_bit = 15, |
| 1220 | }, |
| 1221 | .c = { |
| 1222 | .dbg_name = "vpe_p_clk", |
| 1223 | .ops = &clk_ops_branch, |
| 1224 | CLK_INIT(vpe_p_clk.c), |
| 1225 | }, |
| 1226 | }; |
| 1227 | |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 1228 | static struct branch_clk vcap_p_clk = { |
| 1229 | .b = { |
| 1230 | .ctl_reg = AHB_EN3_REG, |
| 1231 | .en_mask = BIT(1), |
| 1232 | .reset_reg = SW_RESET_AHB2_REG, |
| 1233 | .reset_mask = BIT(2), |
| 1234 | .halt_reg = DBG_BUS_VEC_J_REG, |
| 1235 | .halt_bit = 23, |
| 1236 | }, |
| 1237 | .c = { |
| 1238 | .dbg_name = "vcap_p_clk", |
| 1239 | .ops = &clk_ops_branch, |
| 1240 | CLK_INIT(vcap_p_clk.c), |
| 1241 | }, |
| 1242 | }; |
| 1243 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1244 | /* |
| 1245 | * Peripheral Clocks |
| 1246 | */ |
Matt Wagantall | 7625a4c | 2011-11-01 16:17:53 -0700 | [diff] [blame] | 1247 | #define CLK_GP(i, n, h_r, h_b) \ |
| 1248 | struct rcg_clk i##_clk = { \ |
| 1249 | .b = { \ |
| 1250 | .ctl_reg = GPn_NS_REG(n), \ |
| 1251 | .en_mask = BIT(9), \ |
| 1252 | .halt_reg = h_r, \ |
| 1253 | .halt_bit = h_b, \ |
| 1254 | }, \ |
| 1255 | .ns_reg = GPn_NS_REG(n), \ |
| 1256 | .md_reg = GPn_MD_REG(n), \ |
| 1257 | .root_en_mask = BIT(11), \ |
| 1258 | .ns_mask = (BM(23, 16) | BM(6, 0)), \ |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame] | 1259 | .mnd_en_mask = BIT(8), \ |
Matt Wagantall | 7625a4c | 2011-11-01 16:17:53 -0700 | [diff] [blame] | 1260 | .set_rate = set_rate_mnd, \ |
| 1261 | .freq_tbl = clk_tbl_gp, \ |
| 1262 | .current_freq = &rcg_dummy_freq, \ |
| 1263 | .c = { \ |
| 1264 | .dbg_name = #i "_clk", \ |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 1265 | .ops = &clk_ops_rcg, \ |
Matt Wagantall | 7625a4c | 2011-11-01 16:17:53 -0700 | [diff] [blame] | 1266 | VDD_DIG_FMAX_MAP2(LOW, 100000000, NOMINAL, 200000000), \ |
| 1267 | CLK_INIT(i##_clk.c), \ |
| 1268 | }, \ |
| 1269 | } |
| 1270 | #define F_GP(f, s, d, m, n) \ |
| 1271 | { \ |
| 1272 | .freq_hz = f, \ |
| 1273 | .src_clk = &s##_clk.c, \ |
| 1274 | .md_val = MD8(16, m, 0, n), \ |
| 1275 | .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] | 1276 | } |
| 1277 | static struct clk_freq_tbl clk_tbl_gp[] = { |
| 1278 | F_GP( 0, gnd, 1, 0, 0), |
| 1279 | F_GP( 9600000, cxo, 2, 0, 0), |
| 1280 | F_GP( 13500000, pxo, 2, 0, 0), |
| 1281 | F_GP( 19200000, cxo, 1, 0, 0), |
| 1282 | F_GP( 27000000, pxo, 1, 0, 0), |
| 1283 | F_GP( 64000000, pll8, 2, 1, 3), |
| 1284 | F_GP( 76800000, pll8, 1, 1, 5), |
| 1285 | F_GP( 96000000, pll8, 4, 0, 0), |
| 1286 | F_GP(128000000, pll8, 3, 0, 0), |
| 1287 | F_GP(192000000, pll8, 2, 0, 0), |
Matt Wagantall | 7625a4c | 2011-11-01 16:17:53 -0700 | [diff] [blame] | 1288 | F_END |
| 1289 | }; |
| 1290 | |
| 1291 | static CLK_GP(gp0, 0, CLK_HALT_SFPB_MISC_STATE_REG, 7); |
| 1292 | static CLK_GP(gp1, 1, CLK_HALT_SFPB_MISC_STATE_REG, 6); |
| 1293 | static CLK_GP(gp2, 2, CLK_HALT_SFPB_MISC_STATE_REG, 5); |
| 1294 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1295 | #define CLK_GSBI_UART(i, n, h_r, h_b) \ |
| 1296 | struct rcg_clk i##_clk = { \ |
| 1297 | .b = { \ |
| 1298 | .ctl_reg = GSBIn_UART_APPS_NS_REG(n), \ |
| 1299 | .en_mask = BIT(9), \ |
| 1300 | .reset_reg = GSBIn_RESET_REG(n), \ |
| 1301 | .reset_mask = BIT(0), \ |
| 1302 | .halt_reg = h_r, \ |
| 1303 | .halt_bit = h_b, \ |
| 1304 | }, \ |
| 1305 | .ns_reg = GSBIn_UART_APPS_NS_REG(n), \ |
| 1306 | .md_reg = GSBIn_UART_APPS_MD_REG(n), \ |
| 1307 | .root_en_mask = BIT(11), \ |
| 1308 | .ns_mask = (BM(31, 16) | BM(6, 0)), \ |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame] | 1309 | .mnd_en_mask = BIT(8), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1310 | .set_rate = set_rate_mnd, \ |
| 1311 | .freq_tbl = clk_tbl_gsbi_uart, \ |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1312 | .current_freq = &rcg_dummy_freq, \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1313 | .c = { \ |
| 1314 | .dbg_name = #i "_clk", \ |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 1315 | .ops = &clk_ops_rcg, \ |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1316 | VDD_DIG_FMAX_MAP2(LOW, 32000000, NOMINAL, 64000000), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1317 | CLK_INIT(i##_clk.c), \ |
| 1318 | }, \ |
| 1319 | } |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1320 | #define F_GSBI_UART(f, s, d, m, n) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1321 | { \ |
| 1322 | .freq_hz = f, \ |
| 1323 | .src_clk = &s##_clk.c, \ |
| 1324 | .md_val = MD16(m, n), \ |
| 1325 | .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] | 1326 | } |
| 1327 | static struct clk_freq_tbl clk_tbl_gsbi_uart[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1328 | F_GSBI_UART( 0, gnd, 1, 0, 0), |
Matt Wagantall | 9a561f7 | 2012-01-19 16:13:12 -0800 | [diff] [blame] | 1329 | F_GSBI_UART( 1843200, pll8, 2, 6, 625), |
| 1330 | F_GSBI_UART( 3686400, pll8, 2, 12, 625), |
| 1331 | F_GSBI_UART( 7372800, pll8, 2, 24, 625), |
| 1332 | F_GSBI_UART(14745600, pll8, 2, 48, 625), |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1333 | F_GSBI_UART(16000000, pll8, 4, 1, 6), |
| 1334 | F_GSBI_UART(24000000, pll8, 4, 1, 4), |
| 1335 | F_GSBI_UART(32000000, pll8, 4, 1, 3), |
| 1336 | F_GSBI_UART(40000000, pll8, 1, 5, 48), |
| 1337 | F_GSBI_UART(46400000, pll8, 1, 29, 240), |
| 1338 | F_GSBI_UART(48000000, pll8, 4, 1, 2), |
| 1339 | F_GSBI_UART(51200000, pll8, 1, 2, 15), |
| 1340 | F_GSBI_UART(56000000, pll8, 1, 7, 48), |
| 1341 | F_GSBI_UART(58982400, pll8, 1, 96, 625), |
| 1342 | F_GSBI_UART(64000000, pll8, 2, 1, 3), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1343 | F_END |
| 1344 | }; |
| 1345 | |
| 1346 | static CLK_GSBI_UART(gsbi1_uart, 1, CLK_HALT_CFPB_STATEA_REG, 10); |
| 1347 | static CLK_GSBI_UART(gsbi2_uart, 2, CLK_HALT_CFPB_STATEA_REG, 6); |
| 1348 | static CLK_GSBI_UART(gsbi3_uart, 3, CLK_HALT_CFPB_STATEA_REG, 2); |
| 1349 | static CLK_GSBI_UART(gsbi4_uart, 4, CLK_HALT_CFPB_STATEB_REG, 26); |
| 1350 | static CLK_GSBI_UART(gsbi5_uart, 5, CLK_HALT_CFPB_STATEB_REG, 22); |
| 1351 | static CLK_GSBI_UART(gsbi6_uart, 6, CLK_HALT_CFPB_STATEB_REG, 18); |
| 1352 | static CLK_GSBI_UART(gsbi7_uart, 7, CLK_HALT_CFPB_STATEB_REG, 14); |
| 1353 | static CLK_GSBI_UART(gsbi8_uart, 8, CLK_HALT_CFPB_STATEB_REG, 10); |
| 1354 | static CLK_GSBI_UART(gsbi9_uart, 9, CLK_HALT_CFPB_STATEB_REG, 6); |
| 1355 | static CLK_GSBI_UART(gsbi10_uart, 10, CLK_HALT_CFPB_STATEB_REG, 2); |
| 1356 | static CLK_GSBI_UART(gsbi11_uart, 11, CLK_HALT_CFPB_STATEC_REG, 17); |
| 1357 | static CLK_GSBI_UART(gsbi12_uart, 12, CLK_HALT_CFPB_STATEC_REG, 13); |
| 1358 | |
| 1359 | #define CLK_GSBI_QUP(i, n, h_r, h_b) \ |
| 1360 | struct rcg_clk i##_clk = { \ |
| 1361 | .b = { \ |
| 1362 | .ctl_reg = GSBIn_QUP_APPS_NS_REG(n), \ |
| 1363 | .en_mask = BIT(9), \ |
| 1364 | .reset_reg = GSBIn_RESET_REG(n), \ |
| 1365 | .reset_mask = BIT(0), \ |
| 1366 | .halt_reg = h_r, \ |
| 1367 | .halt_bit = h_b, \ |
| 1368 | }, \ |
| 1369 | .ns_reg = GSBIn_QUP_APPS_NS_REG(n), \ |
| 1370 | .md_reg = GSBIn_QUP_APPS_MD_REG(n), \ |
| 1371 | .root_en_mask = BIT(11), \ |
| 1372 | .ns_mask = (BM(23, 16) | BM(6, 0)), \ |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame] | 1373 | .mnd_en_mask = BIT(8), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1374 | .set_rate = set_rate_mnd, \ |
| 1375 | .freq_tbl = clk_tbl_gsbi_qup, \ |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1376 | .current_freq = &rcg_dummy_freq, \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1377 | .c = { \ |
| 1378 | .dbg_name = #i "_clk", \ |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 1379 | .ops = &clk_ops_rcg, \ |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1380 | VDD_DIG_FMAX_MAP2(LOW, 24000000, NOMINAL, 52000000), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1381 | CLK_INIT(i##_clk.c), \ |
| 1382 | }, \ |
| 1383 | } |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1384 | #define F_GSBI_QUP(f, s, d, m, n) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1385 | { \ |
| 1386 | .freq_hz = f, \ |
| 1387 | .src_clk = &s##_clk.c, \ |
| 1388 | .md_val = MD8(16, m, 0, n), \ |
| 1389 | .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] | 1390 | } |
| 1391 | static struct clk_freq_tbl clk_tbl_gsbi_qup[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1392 | F_GSBI_QUP( 0, gnd, 1, 0, 0), |
| 1393 | F_GSBI_QUP( 1100000, pxo, 1, 2, 49), |
| 1394 | F_GSBI_QUP( 5400000, pxo, 1, 1, 5), |
| 1395 | F_GSBI_QUP(10800000, pxo, 1, 2, 5), |
| 1396 | F_GSBI_QUP(15060000, pll8, 1, 2, 51), |
| 1397 | F_GSBI_QUP(24000000, pll8, 4, 1, 4), |
| 1398 | F_GSBI_QUP(25600000, pll8, 1, 1, 15), |
| 1399 | F_GSBI_QUP(27000000, pxo, 1, 0, 0), |
| 1400 | F_GSBI_QUP(48000000, pll8, 4, 1, 2), |
| 1401 | F_GSBI_QUP(51200000, pll8, 1, 2, 15), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1402 | F_END |
| 1403 | }; |
| 1404 | |
| 1405 | static CLK_GSBI_QUP(gsbi1_qup, 1, CLK_HALT_CFPB_STATEA_REG, 9); |
| 1406 | static CLK_GSBI_QUP(gsbi2_qup, 2, CLK_HALT_CFPB_STATEA_REG, 4); |
| 1407 | static CLK_GSBI_QUP(gsbi3_qup, 3, CLK_HALT_CFPB_STATEA_REG, 0); |
| 1408 | static CLK_GSBI_QUP(gsbi4_qup, 4, CLK_HALT_CFPB_STATEB_REG, 24); |
| 1409 | static CLK_GSBI_QUP(gsbi5_qup, 5, CLK_HALT_CFPB_STATEB_REG, 20); |
| 1410 | static CLK_GSBI_QUP(gsbi6_qup, 6, CLK_HALT_CFPB_STATEB_REG, 16); |
| 1411 | static CLK_GSBI_QUP(gsbi7_qup, 7, CLK_HALT_CFPB_STATEB_REG, 12); |
| 1412 | static CLK_GSBI_QUP(gsbi8_qup, 8, CLK_HALT_CFPB_STATEB_REG, 8); |
| 1413 | static CLK_GSBI_QUP(gsbi9_qup, 9, CLK_HALT_CFPB_STATEB_REG, 4); |
| 1414 | static CLK_GSBI_QUP(gsbi10_qup, 10, CLK_HALT_CFPB_STATEB_REG, 0); |
| 1415 | static CLK_GSBI_QUP(gsbi11_qup, 11, CLK_HALT_CFPB_STATEC_REG, 15); |
| 1416 | static CLK_GSBI_QUP(gsbi12_qup, 12, CLK_HALT_CFPB_STATEC_REG, 11); |
| 1417 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1418 | #define F_PDM(f, s, d) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1419 | { \ |
| 1420 | .freq_hz = f, \ |
| 1421 | .src_clk = &s##_clk.c, \ |
| 1422 | .ns_val = NS_SRC_SEL(1, 0, s##_to_xo_mux), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1423 | } |
| 1424 | static struct clk_freq_tbl clk_tbl_pdm[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1425 | F_PDM( 0, gnd, 1), |
| 1426 | F_PDM(27000000, pxo, 1), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1427 | F_END |
| 1428 | }; |
| 1429 | |
| 1430 | static struct rcg_clk pdm_clk = { |
| 1431 | .b = { |
| 1432 | .ctl_reg = PDM_CLK_NS_REG, |
| 1433 | .en_mask = BIT(9), |
| 1434 | .reset_reg = PDM_CLK_NS_REG, |
| 1435 | .reset_mask = BIT(12), |
| 1436 | .halt_reg = CLK_HALT_CFPB_STATEC_REG, |
| 1437 | .halt_bit = 3, |
| 1438 | }, |
| 1439 | .ns_reg = PDM_CLK_NS_REG, |
| 1440 | .root_en_mask = BIT(11), |
| 1441 | .ns_mask = BM(1, 0), |
| 1442 | .set_rate = set_rate_nop, |
| 1443 | .freq_tbl = clk_tbl_pdm, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1444 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1445 | .c = { |
| 1446 | .dbg_name = "pdm_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 1447 | .ops = &clk_ops_rcg, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1448 | VDD_DIG_FMAX_MAP1(LOW, 27000000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1449 | CLK_INIT(pdm_clk.c), |
| 1450 | }, |
| 1451 | }; |
| 1452 | |
| 1453 | static struct branch_clk pmem_clk = { |
| 1454 | .b = { |
| 1455 | .ctl_reg = PMEM_ACLK_CTL_REG, |
| 1456 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 1457 | .hwcg_reg = PMEM_ACLK_CTL_REG, |
| 1458 | .hwcg_mask = BIT(6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1459 | .halt_reg = CLK_HALT_DFAB_STATE_REG, |
| 1460 | .halt_bit = 20, |
| 1461 | }, |
| 1462 | .c = { |
| 1463 | .dbg_name = "pmem_clk", |
| 1464 | .ops = &clk_ops_branch, |
| 1465 | CLK_INIT(pmem_clk.c), |
| 1466 | }, |
| 1467 | }; |
| 1468 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1469 | #define F_PRNG(f, s) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1470 | { \ |
| 1471 | .freq_hz = f, \ |
| 1472 | .src_clk = &s##_clk.c, \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1473 | } |
Stephen Boyd | 842a1f6 | 2012-04-26 19:07:38 -0700 | [diff] [blame] | 1474 | static struct clk_freq_tbl clk_tbl_prng_32[] = { |
| 1475 | F_PRNG(32000000, pll8), |
| 1476 | F_END |
| 1477 | }; |
| 1478 | |
| 1479 | static struct clk_freq_tbl clk_tbl_prng_64[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1480 | F_PRNG(64000000, pll8), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1481 | F_END |
| 1482 | }; |
| 1483 | |
| 1484 | static struct rcg_clk prng_clk = { |
| 1485 | .b = { |
| 1486 | .ctl_reg = SC0_U_CLK_BRANCH_ENA_VOTE_REG, |
| 1487 | .en_mask = BIT(10), |
| 1488 | .halt_reg = CLK_HALT_SFPB_MISC_STATE_REG, |
| 1489 | .halt_check = HALT_VOTED, |
| 1490 | .halt_bit = 10, |
| 1491 | }, |
| 1492 | .set_rate = set_rate_nop, |
Stephen Boyd | 842a1f6 | 2012-04-26 19:07:38 -0700 | [diff] [blame] | 1493 | .freq_tbl = clk_tbl_prng_32, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1494 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1495 | .c = { |
| 1496 | .dbg_name = "prng_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 1497 | .ops = &clk_ops_rcg, |
Stephen Boyd | 842a1f6 | 2012-04-26 19:07:38 -0700 | [diff] [blame] | 1498 | VDD_DIG_FMAX_MAP2(LOW, 32000000, NOMINAL, 64000000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1499 | CLK_INIT(prng_clk.c), |
| 1500 | }, |
| 1501 | }; |
| 1502 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1503 | #define CLK_SDC(name, n, h_b, fmax_low, fmax_nom) \ |
Stephen Boyd | a78a740 | 2011-08-02 11:23:39 -0700 | [diff] [blame] | 1504 | struct rcg_clk name = { \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1505 | .b = { \ |
| 1506 | .ctl_reg = SDCn_APPS_CLK_NS_REG(n), \ |
| 1507 | .en_mask = BIT(9), \ |
| 1508 | .reset_reg = SDCn_RESET_REG(n), \ |
| 1509 | .reset_mask = BIT(0), \ |
Stephen Boyd | a78a740 | 2011-08-02 11:23:39 -0700 | [diff] [blame] | 1510 | .halt_reg = CLK_HALT_DFAB_STATE_REG, \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1511 | .halt_bit = h_b, \ |
| 1512 | }, \ |
| 1513 | .ns_reg = SDCn_APPS_CLK_NS_REG(n), \ |
| 1514 | .md_reg = SDCn_APPS_CLK_MD_REG(n), \ |
| 1515 | .root_en_mask = BIT(11), \ |
| 1516 | .ns_mask = (BM(23, 16) | BM(6, 0)), \ |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame] | 1517 | .mnd_en_mask = BIT(8), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1518 | .set_rate = set_rate_mnd, \ |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1519 | .freq_tbl = clk_tbl_sdc, \ |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1520 | .current_freq = &rcg_dummy_freq, \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1521 | .c = { \ |
Stephen Boyd | a78a740 | 2011-08-02 11:23:39 -0700 | [diff] [blame] | 1522 | .dbg_name = #name, \ |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 1523 | .ops = &clk_ops_rcg, \ |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1524 | VDD_DIG_FMAX_MAP2(LOW, fmax_low, NOMINAL, fmax_nom), \ |
Stephen Boyd | a78a740 | 2011-08-02 11:23:39 -0700 | [diff] [blame] | 1525 | CLK_INIT(name.c), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1526 | }, \ |
| 1527 | } |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1528 | #define F_SDC(f, s, d, m, n) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1529 | { \ |
| 1530 | .freq_hz = f, \ |
| 1531 | .src_clk = &s##_clk.c, \ |
| 1532 | .md_val = MD8(16, m, 0, n), \ |
| 1533 | .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] | 1534 | } |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1535 | static struct clk_freq_tbl clk_tbl_sdc[] = { |
| 1536 | F_SDC( 0, gnd, 1, 0, 0), |
| 1537 | F_SDC( 144000, pxo, 3, 2, 125), |
| 1538 | F_SDC( 400000, pll8, 4, 1, 240), |
| 1539 | F_SDC( 16000000, pll8, 4, 1, 6), |
| 1540 | F_SDC( 17070000, pll8, 1, 2, 45), |
| 1541 | F_SDC( 20210000, pll8, 1, 1, 19), |
| 1542 | F_SDC( 24000000, pll8, 4, 1, 4), |
| 1543 | F_SDC( 48000000, pll8, 4, 1, 2), |
| 1544 | F_SDC( 64000000, pll8, 3, 1, 2), |
| 1545 | F_SDC( 96000000, pll8, 4, 0, 0), |
Subhash Jadavani | bd238ba | 2011-11-24 15:12:39 +0530 | [diff] [blame] | 1546 | F_SDC(192000000, pll8, 2, 0, 0), |
Stephen Boyd | a78a740 | 2011-08-02 11:23:39 -0700 | [diff] [blame] | 1547 | F_END |
| 1548 | }; |
| 1549 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1550 | static CLK_SDC(sdc1_clk, 1, 6, 52000000, 104000000); |
| 1551 | static CLK_SDC(sdc2_clk, 2, 5, 52000000, 104000000); |
| 1552 | static CLK_SDC(sdc3_clk, 3, 4, 104000000, 208000000); |
| 1553 | static CLK_SDC(sdc4_clk, 4, 3, 33000000, 67000000); |
| 1554 | static CLK_SDC(sdc5_clk, 5, 2, 33000000, 67000000); |
Stephen Boyd | a78a740 | 2011-08-02 11:23:39 -0700 | [diff] [blame] | 1555 | |
Saravana Kannan | 55e959d | 2012-10-15 22:16:04 -0700 | [diff] [blame] | 1556 | static unsigned long fmax_sdc1_8064v2[VDD_DIG_NUM] = { |
Patrick Daly | b7c777a | 2012-08-23 19:07:30 -0700 | [diff] [blame] | 1557 | [VDD_DIG_LOW] = 100000000, |
| 1558 | [VDD_DIG_NOMINAL] = 200000000, |
| 1559 | }; |
| 1560 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1561 | #define F_TSIF_REF(f, s, d, m, n) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1562 | { \ |
| 1563 | .freq_hz = f, \ |
| 1564 | .src_clk = &s##_clk.c, \ |
| 1565 | .md_val = MD16(m, n), \ |
| 1566 | .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] | 1567 | } |
| 1568 | static struct clk_freq_tbl clk_tbl_tsif_ref[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1569 | F_TSIF_REF( 0, gnd, 1, 0, 0), |
| 1570 | F_TSIF_REF(105000, pxo, 1, 1, 256), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1571 | F_END |
| 1572 | }; |
| 1573 | |
| 1574 | static struct rcg_clk tsif_ref_clk = { |
| 1575 | .b = { |
| 1576 | .ctl_reg = TSIF_REF_CLK_NS_REG, |
| 1577 | .en_mask = BIT(9), |
| 1578 | .halt_reg = CLK_HALT_CFPB_STATEC_REG, |
| 1579 | .halt_bit = 5, |
| 1580 | }, |
| 1581 | .ns_reg = TSIF_REF_CLK_NS_REG, |
| 1582 | .md_reg = TSIF_REF_CLK_MD_REG, |
| 1583 | .root_en_mask = BIT(11), |
| 1584 | .ns_mask = (BM(31, 16) | BM(6, 0)), |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame] | 1585 | .mnd_en_mask = BIT(8), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1586 | .set_rate = set_rate_mnd, |
| 1587 | .freq_tbl = clk_tbl_tsif_ref, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1588 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1589 | .c = { |
| 1590 | .dbg_name = "tsif_ref_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 1591 | .ops = &clk_ops_rcg, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1592 | VDD_DIG_FMAX_MAP2(LOW, 27000000, NOMINAL, 54000000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1593 | CLK_INIT(tsif_ref_clk.c), |
| 1594 | }, |
| 1595 | }; |
| 1596 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1597 | #define F_TSSC(f, s) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1598 | { \ |
| 1599 | .freq_hz = f, \ |
| 1600 | .src_clk = &s##_clk.c, \ |
| 1601 | .ns_val = NS_SRC_SEL(1, 0, s##_to_xo_mux), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1602 | } |
| 1603 | static struct clk_freq_tbl clk_tbl_tssc[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1604 | F_TSSC( 0, gnd), |
| 1605 | F_TSSC(27000000, pxo), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1606 | F_END |
| 1607 | }; |
| 1608 | |
| 1609 | static struct rcg_clk tssc_clk = { |
| 1610 | .b = { |
| 1611 | .ctl_reg = TSSC_CLK_CTL_REG, |
| 1612 | .en_mask = BIT(4), |
| 1613 | .halt_reg = CLK_HALT_CFPB_STATEC_REG, |
| 1614 | .halt_bit = 4, |
| 1615 | }, |
| 1616 | .ns_reg = TSSC_CLK_CTL_REG, |
| 1617 | .ns_mask = BM(1, 0), |
| 1618 | .set_rate = set_rate_nop, |
| 1619 | .freq_tbl = clk_tbl_tssc, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1620 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1621 | .c = { |
| 1622 | .dbg_name = "tssc_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 1623 | .ops = &clk_ops_rcg, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1624 | VDD_DIG_FMAX_MAP1(LOW, 27000000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1625 | CLK_INIT(tssc_clk.c), |
| 1626 | }, |
| 1627 | }; |
| 1628 | |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 1629 | #define CLK_USB_HS(name, n, h_b) \ |
| 1630 | static struct rcg_clk name = { \ |
| 1631 | .b = { \ |
| 1632 | .ctl_reg = USB_HS##n##_XCVR_FS_CLK_NS_REG, \ |
| 1633 | .en_mask = BIT(9), \ |
| 1634 | .reset_reg = USB_HS##n##_RESET_REG, \ |
| 1635 | .reset_mask = BIT(0), \ |
| 1636 | .halt_reg = CLK_HALT_DFAB_STATE_REG, \ |
| 1637 | .halt_bit = h_b, \ |
| 1638 | }, \ |
| 1639 | .ns_reg = USB_HS##n##_XCVR_FS_CLK_NS_REG, \ |
| 1640 | .md_reg = USB_HS##n##_XCVR_FS_CLK_MD_REG, \ |
| 1641 | .root_en_mask = BIT(11), \ |
| 1642 | .ns_mask = (BM(23, 16) | BM(6, 0)), \ |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame] | 1643 | .mnd_en_mask = BIT(8), \ |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 1644 | .set_rate = set_rate_mnd, \ |
| 1645 | .freq_tbl = clk_tbl_usb, \ |
| 1646 | .current_freq = &rcg_dummy_freq, \ |
| 1647 | .c = { \ |
| 1648 | .dbg_name = #name, \ |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 1649 | .ops = &clk_ops_rcg, \ |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1650 | VDD_DIG_FMAX_MAP1(NOMINAL, 64000000), \ |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 1651 | CLK_INIT(name.c), \ |
| 1652 | }, \ |
| 1653 | } |
| 1654 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1655 | #define F_USB(f, s, d, m, n) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1656 | { \ |
| 1657 | .freq_hz = f, \ |
| 1658 | .src_clk = &s##_clk.c, \ |
| 1659 | .md_val = MD8(16, m, 0, n), \ |
| 1660 | .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] | 1661 | } |
| 1662 | static struct clk_freq_tbl clk_tbl_usb[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1663 | F_USB( 0, gnd, 1, 0, 0), |
| 1664 | F_USB(60000000, pll8, 1, 5, 32), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1665 | F_END |
| 1666 | }; |
| 1667 | |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 1668 | CLK_USB_HS(usb_hs1_xcvr_clk, 1, 0); |
| 1669 | CLK_USB_HS(usb_hs3_xcvr_clk, 3, 30); |
| 1670 | CLK_USB_HS(usb_hs4_xcvr_clk, 4, 2); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1671 | |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 1672 | static struct clk_freq_tbl clk_tbl_usb_hsic[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1673 | F_USB( 0, gnd, 1, 0, 0), |
| 1674 | F_USB(60000000, pll8, 1, 5, 32), |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 1675 | F_END |
| 1676 | }; |
| 1677 | |
| 1678 | static struct rcg_clk usb_hsic_xcvr_fs_clk = { |
| 1679 | .b = { |
| 1680 | .ctl_reg = USB_HSIC_XCVR_FS_CLK_NS_REG, |
| 1681 | .en_mask = BIT(9), |
| 1682 | .halt_reg = CLK_HALT_CFPB_STATEA_REG, |
| 1683 | .halt_bit = 26, |
| 1684 | }, |
| 1685 | .ns_reg = USB_HSIC_XCVR_FS_CLK_NS_REG, |
| 1686 | .md_reg = USB_HSIC_XCVR_FS_CLK_MD_REG, |
| 1687 | .root_en_mask = BIT(11), |
| 1688 | .ns_mask = (BM(23, 16) | BM(6, 0)), |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame] | 1689 | .mnd_en_mask = BIT(8), |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 1690 | .set_rate = set_rate_mnd, |
| 1691 | .freq_tbl = clk_tbl_usb_hsic, |
| 1692 | .current_freq = &rcg_dummy_freq, |
| 1693 | .c = { |
| 1694 | .dbg_name = "usb_hsic_xcvr_fs_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 1695 | .ops = &clk_ops_rcg, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1696 | VDD_DIG_FMAX_MAP1(LOW, 60000000), |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 1697 | CLK_INIT(usb_hsic_xcvr_fs_clk.c), |
| 1698 | }, |
| 1699 | }; |
| 1700 | |
| 1701 | static struct branch_clk usb_hsic_system_clk = { |
| 1702 | .b = { |
| 1703 | .ctl_reg = USB_HSIC_SYSTEM_CLK_CTL_REG, |
| 1704 | .en_mask = BIT(4), |
| 1705 | .reset_reg = USB_HSIC_RESET_REG, |
| 1706 | .reset_mask = BIT(0), |
| 1707 | .halt_reg = CLK_HALT_CFPB_STATEA_REG, |
| 1708 | .halt_bit = 24, |
| 1709 | }, |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 1710 | .c = { |
Saravana Kannan | 7a6532e | 2012-10-18 20:51:13 -0700 | [diff] [blame] | 1711 | .parent = &usb_hsic_xcvr_fs_clk.c, |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 1712 | .dbg_name = "usb_hsic_system_clk", |
| 1713 | .ops = &clk_ops_branch, |
| 1714 | CLK_INIT(usb_hsic_system_clk.c), |
| 1715 | }, |
| 1716 | }; |
| 1717 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1718 | #define F_USB_HSIC(f, s) \ |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 1719 | { \ |
| 1720 | .freq_hz = f, \ |
| 1721 | .src_clk = &s##_clk.c, \ |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 1722 | } |
| 1723 | static struct clk_freq_tbl clk_tbl_usb2_hsic[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1724 | F_USB_HSIC(480000000, pll14), |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 1725 | F_END |
| 1726 | }; |
| 1727 | |
| 1728 | static struct rcg_clk usb_hsic_hsic_src_clk = { |
| 1729 | .b = { |
| 1730 | .ctl_reg = USB_HSIC_HSIC_CLK_SRC_CTL_REG, |
| 1731 | .halt_check = NOCHECK, |
| 1732 | }, |
| 1733 | .root_en_mask = BIT(0), |
| 1734 | .set_rate = set_rate_nop, |
| 1735 | .freq_tbl = clk_tbl_usb2_hsic, |
| 1736 | .current_freq = &rcg_dummy_freq, |
| 1737 | .c = { |
| 1738 | .dbg_name = "usb_hsic_hsic_src_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 1739 | .ops = &clk_ops_rcg, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1740 | VDD_DIG_FMAX_MAP1(LOW, 480000000), |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 1741 | CLK_INIT(usb_hsic_hsic_src_clk.c), |
| 1742 | }, |
| 1743 | }; |
| 1744 | |
| 1745 | static struct branch_clk usb_hsic_hsic_clk = { |
| 1746 | .b = { |
| 1747 | .ctl_reg = USB_HSIC_HSIC_CLK_CTL_REG, |
| 1748 | .en_mask = BIT(0), |
| 1749 | .halt_reg = CLK_HALT_CFPB_STATEA_REG, |
| 1750 | .halt_bit = 19, |
| 1751 | }, |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 1752 | .c = { |
Saravana Kannan | 7a6532e | 2012-10-18 20:51:13 -0700 | [diff] [blame] | 1753 | .parent = &usb_hsic_hsic_src_clk.c, |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 1754 | .dbg_name = "usb_hsic_hsic_clk", |
| 1755 | .ops = &clk_ops_branch, |
| 1756 | CLK_INIT(usb_hsic_hsic_clk.c), |
| 1757 | }, |
| 1758 | }; |
| 1759 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1760 | #define F_USB_HSIO_CAL(f, s) \ |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 1761 | { \ |
| 1762 | .freq_hz = f, \ |
| 1763 | .src_clk = &s##_clk.c, \ |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 1764 | } |
| 1765 | static struct clk_freq_tbl clk_tbl_usb_hsio_cal[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1766 | F_USB_HSIO_CAL(9000000, pxo), |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 1767 | F_END |
| 1768 | }; |
| 1769 | |
| 1770 | static struct rcg_clk usb_hsic_hsio_cal_clk = { |
| 1771 | .b = { |
| 1772 | .ctl_reg = USB_HSIC_HSIO_CAL_CLK_CTL_REG, |
| 1773 | .en_mask = BIT(0), |
| 1774 | .halt_reg = CLK_HALT_CFPB_STATEA_REG, |
| 1775 | .halt_bit = 23, |
| 1776 | }, |
| 1777 | .set_rate = set_rate_nop, |
| 1778 | .freq_tbl = clk_tbl_usb_hsio_cal, |
| 1779 | .current_freq = &rcg_dummy_freq, |
| 1780 | .c = { |
| 1781 | .dbg_name = "usb_hsic_hsio_cal_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 1782 | .ops = &clk_ops_rcg, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1783 | VDD_DIG_FMAX_MAP1(LOW, 10000000), |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 1784 | CLK_INIT(usb_hsic_hsio_cal_clk.c), |
| 1785 | }, |
| 1786 | }; |
| 1787 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1788 | static struct branch_clk usb_phy0_clk = { |
| 1789 | .b = { |
| 1790 | .reset_reg = USB_PHY0_RESET_REG, |
| 1791 | .reset_mask = BIT(0), |
| 1792 | }, |
| 1793 | .c = { |
| 1794 | .dbg_name = "usb_phy0_clk", |
| 1795 | .ops = &clk_ops_reset, |
| 1796 | CLK_INIT(usb_phy0_clk.c), |
| 1797 | }, |
| 1798 | }; |
| 1799 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1800 | #define CLK_USB_FS(i, n, fmax_nom) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1801 | struct rcg_clk i##_clk = { \ |
| 1802 | .ns_reg = USB_FSn_XCVR_FS_CLK_NS_REG(n), \ |
| 1803 | .b = { \ |
| 1804 | .ctl_reg = USB_FSn_XCVR_FS_CLK_NS_REG(n), \ |
| 1805 | .halt_check = NOCHECK, \ |
| 1806 | }, \ |
| 1807 | .md_reg = USB_FSn_XCVR_FS_CLK_MD_REG(n), \ |
| 1808 | .root_en_mask = BIT(11), \ |
| 1809 | .ns_mask = (BM(23, 16) | BM(6, 0)), \ |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame] | 1810 | .mnd_en_mask = BIT(8), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1811 | .set_rate = set_rate_mnd, \ |
| 1812 | .freq_tbl = clk_tbl_usb, \ |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1813 | .current_freq = &rcg_dummy_freq, \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1814 | .c = { \ |
| 1815 | .dbg_name = #i "_clk", \ |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 1816 | .ops = &clk_ops_rcg, \ |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1817 | VDD_DIG_FMAX_MAP1(NOMINAL, fmax_nom), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1818 | CLK_INIT(i##_clk.c), \ |
| 1819 | }, \ |
| 1820 | } |
| 1821 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1822 | static CLK_USB_FS(usb_fs1_src, 1, 64000000); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1823 | static struct branch_clk usb_fs1_xcvr_clk = { |
| 1824 | .b = { |
| 1825 | .ctl_reg = USB_FSn_XCVR_FS_CLK_NS_REG(1), |
| 1826 | .en_mask = BIT(9), |
| 1827 | .reset_reg = USB_FSn_RESET_REG(1), |
| 1828 | .reset_mask = BIT(1), |
| 1829 | .halt_reg = CLK_HALT_CFPB_STATEA_REG, |
| 1830 | .halt_bit = 15, |
| 1831 | }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1832 | .c = { |
Saravana Kannan | 7a6532e | 2012-10-18 20:51:13 -0700 | [diff] [blame] | 1833 | .parent = &usb_fs1_src_clk.c, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1834 | .dbg_name = "usb_fs1_xcvr_clk", |
| 1835 | .ops = &clk_ops_branch, |
| 1836 | CLK_INIT(usb_fs1_xcvr_clk.c), |
| 1837 | }, |
| 1838 | }; |
| 1839 | |
| 1840 | static struct branch_clk usb_fs1_sys_clk = { |
| 1841 | .b = { |
| 1842 | .ctl_reg = USB_FSn_SYSTEM_CLK_CTL_REG(1), |
| 1843 | .en_mask = BIT(4), |
| 1844 | .reset_reg = USB_FSn_RESET_REG(1), |
| 1845 | .reset_mask = BIT(0), |
| 1846 | .halt_reg = CLK_HALT_CFPB_STATEA_REG, |
| 1847 | .halt_bit = 16, |
| 1848 | }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1849 | .c = { |
Saravana Kannan | 7a6532e | 2012-10-18 20:51:13 -0700 | [diff] [blame] | 1850 | .parent = &usb_fs1_src_clk.c, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1851 | .dbg_name = "usb_fs1_sys_clk", |
| 1852 | .ops = &clk_ops_branch, |
| 1853 | CLK_INIT(usb_fs1_sys_clk.c), |
| 1854 | }, |
| 1855 | }; |
| 1856 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1857 | static CLK_USB_FS(usb_fs2_src, 2, 60000000); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1858 | static struct branch_clk usb_fs2_xcvr_clk = { |
| 1859 | .b = { |
| 1860 | .ctl_reg = USB_FSn_XCVR_FS_CLK_NS_REG(2), |
| 1861 | .en_mask = BIT(9), |
| 1862 | .reset_reg = USB_FSn_RESET_REG(2), |
| 1863 | .reset_mask = BIT(1), |
| 1864 | .halt_reg = CLK_HALT_CFPB_STATEA_REG, |
| 1865 | .halt_bit = 12, |
| 1866 | }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1867 | .c = { |
Saravana Kannan | 7a6532e | 2012-10-18 20:51:13 -0700 | [diff] [blame] | 1868 | .parent = &usb_fs2_src_clk.c, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1869 | .dbg_name = "usb_fs2_xcvr_clk", |
| 1870 | .ops = &clk_ops_branch, |
| 1871 | CLK_INIT(usb_fs2_xcvr_clk.c), |
| 1872 | }, |
| 1873 | }; |
| 1874 | |
| 1875 | static struct branch_clk usb_fs2_sys_clk = { |
| 1876 | .b = { |
| 1877 | .ctl_reg = USB_FSn_SYSTEM_CLK_CTL_REG(2), |
| 1878 | .en_mask = BIT(4), |
| 1879 | .reset_reg = USB_FSn_RESET_REG(2), |
| 1880 | .reset_mask = BIT(0), |
| 1881 | .halt_reg = CLK_HALT_CFPB_STATEA_REG, |
| 1882 | .halt_bit = 13, |
| 1883 | }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1884 | .c = { |
Saravana Kannan | 7a6532e | 2012-10-18 20:51:13 -0700 | [diff] [blame] | 1885 | .parent = &usb_fs2_src_clk.c, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1886 | .dbg_name = "usb_fs2_sys_clk", |
| 1887 | .ops = &clk_ops_branch, |
| 1888 | CLK_INIT(usb_fs2_sys_clk.c), |
| 1889 | }, |
| 1890 | }; |
| 1891 | |
| 1892 | /* Fast Peripheral Bus Clocks */ |
| 1893 | static struct branch_clk ce1_core_clk = { |
| 1894 | .b = { |
| 1895 | .ctl_reg = CE1_CORE_CLK_CTL_REG, |
| 1896 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 1897 | .hwcg_reg = CE1_CORE_CLK_CTL_REG, |
| 1898 | .hwcg_mask = BIT(6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1899 | .halt_reg = CLK_HALT_CFPB_STATEC_REG, |
| 1900 | .halt_bit = 27, |
| 1901 | }, |
| 1902 | .c = { |
| 1903 | .dbg_name = "ce1_core_clk", |
| 1904 | .ops = &clk_ops_branch, |
| 1905 | CLK_INIT(ce1_core_clk.c), |
| 1906 | }, |
| 1907 | }; |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 1908 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1909 | static struct branch_clk ce1_p_clk = { |
| 1910 | .b = { |
| 1911 | .ctl_reg = CE1_HCLK_CTL_REG, |
| 1912 | .en_mask = BIT(4), |
| 1913 | .halt_reg = CLK_HALT_CFPB_STATEC_REG, |
| 1914 | .halt_bit = 1, |
| 1915 | }, |
| 1916 | .c = { |
| 1917 | .dbg_name = "ce1_p_clk", |
| 1918 | .ops = &clk_ops_branch, |
| 1919 | CLK_INIT(ce1_p_clk.c), |
| 1920 | }, |
| 1921 | }; |
| 1922 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1923 | #define F_CE3(f, s, d) \ |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 1924 | { \ |
| 1925 | .freq_hz = f, \ |
| 1926 | .src_clk = &s##_clk.c, \ |
| 1927 | .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] | 1928 | } |
| 1929 | |
| 1930 | static struct clk_freq_tbl clk_tbl_ce3[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1931 | F_CE3( 0, gnd, 1), |
| 1932 | F_CE3( 48000000, pll8, 8), |
| 1933 | F_CE3(100000000, pll3, 12), |
Patrick Daly | b7c777a | 2012-08-23 19:07:30 -0700 | [diff] [blame] | 1934 | F_CE3(120000000, pll3, 10), |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 1935 | F_END |
| 1936 | }; |
| 1937 | |
| 1938 | static struct rcg_clk ce3_src_clk = { |
| 1939 | .b = { |
| 1940 | .ctl_reg = CE3_CLK_SRC_NS_REG, |
| 1941 | .halt_check = NOCHECK, |
| 1942 | }, |
| 1943 | .ns_reg = CE3_CLK_SRC_NS_REG, |
| 1944 | .root_en_mask = BIT(7), |
| 1945 | .ns_mask = BM(6, 0), |
| 1946 | .set_rate = set_rate_nop, |
| 1947 | .freq_tbl = clk_tbl_ce3, |
| 1948 | .current_freq = &rcg_dummy_freq, |
| 1949 | .c = { |
| 1950 | .dbg_name = "ce3_src_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 1951 | .ops = &clk_ops_rcg, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1952 | VDD_DIG_FMAX_MAP2(LOW, 50000000, NOMINAL, 100000000), |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 1953 | CLK_INIT(ce3_src_clk.c), |
| 1954 | }, |
| 1955 | }; |
| 1956 | |
Saravana Kannan | 55e959d | 2012-10-15 22:16:04 -0700 | [diff] [blame] | 1957 | static unsigned long fmax_ce3_8064v2[VDD_DIG_NUM] = { |
Patrick Daly | b7c777a | 2012-08-23 19:07:30 -0700 | [diff] [blame] | 1958 | [VDD_DIG_LOW] = 57000000, |
| 1959 | [VDD_DIG_NOMINAL] = 120000000, |
| 1960 | }; |
| 1961 | |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 1962 | static struct branch_clk ce3_core_clk = { |
| 1963 | .b = { |
| 1964 | .ctl_reg = CE3_CORE_CLK_CTL_REG, |
| 1965 | .en_mask = BIT(4), |
| 1966 | .reset_reg = CE3_CORE_CLK_CTL_REG, |
| 1967 | .reset_mask = BIT(7), |
| 1968 | .halt_reg = CLK_HALT_MSS_SMPSS_MISC_STATE_REG, |
| 1969 | .halt_bit = 5, |
| 1970 | }, |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 1971 | .c = { |
Saravana Kannan | 7a6532e | 2012-10-18 20:51:13 -0700 | [diff] [blame] | 1972 | .parent = &ce3_src_clk.c, |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 1973 | .dbg_name = "ce3_core_clk", |
| 1974 | .ops = &clk_ops_branch, |
| 1975 | CLK_INIT(ce3_core_clk.c), |
| 1976 | } |
| 1977 | }; |
| 1978 | |
| 1979 | static struct branch_clk ce3_p_clk = { |
| 1980 | .b = { |
| 1981 | .ctl_reg = CE3_HCLK_CTL_REG, |
| 1982 | .en_mask = BIT(4), |
| 1983 | .reset_reg = CE3_HCLK_CTL_REG, |
| 1984 | .reset_mask = BIT(7), |
| 1985 | .halt_reg = CLK_HALT_AFAB_SFAB_STATEB_REG, |
| 1986 | .halt_bit = 16, |
| 1987 | }, |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 1988 | .c = { |
Saravana Kannan | 7a6532e | 2012-10-18 20:51:13 -0700 | [diff] [blame] | 1989 | .parent = &ce3_src_clk.c, |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 1990 | .dbg_name = "ce3_p_clk", |
| 1991 | .ops = &clk_ops_branch, |
| 1992 | CLK_INIT(ce3_p_clk.c), |
| 1993 | } |
| 1994 | }; |
| 1995 | |
Tianyi Gou | 352955d | 2012-05-18 19:44:01 -0700 | [diff] [blame] | 1996 | #define F_SATA(f, s, d) \ |
| 1997 | { \ |
| 1998 | .freq_hz = f, \ |
| 1999 | .src_clk = &s##_clk.c, \ |
| 2000 | .ns_val = NS_DIVSRC(6, 3, d, 2, 0, s##_to_bb_mux), \ |
| 2001 | } |
| 2002 | |
| 2003 | static struct clk_freq_tbl clk_tbl_sata[] = { |
| 2004 | F_SATA( 0, gnd, 1), |
| 2005 | F_SATA( 48000000, pll8, 8), |
| 2006 | F_SATA(100000000, pll3, 12), |
| 2007 | F_END |
| 2008 | }; |
| 2009 | |
| 2010 | static struct rcg_clk sata_src_clk = { |
| 2011 | .b = { |
| 2012 | .ctl_reg = SATA_CLK_SRC_NS_REG, |
| 2013 | .halt_check = NOCHECK, |
| 2014 | }, |
| 2015 | .ns_reg = SATA_CLK_SRC_NS_REG, |
| 2016 | .root_en_mask = BIT(7), |
| 2017 | .ns_mask = BM(6, 0), |
| 2018 | .set_rate = set_rate_nop, |
| 2019 | .freq_tbl = clk_tbl_sata, |
| 2020 | .current_freq = &rcg_dummy_freq, |
| 2021 | .c = { |
| 2022 | .dbg_name = "sata_src_clk", |
| 2023 | .ops = &clk_ops_rcg, |
| 2024 | VDD_DIG_FMAX_MAP2(LOW, 50000000, NOMINAL, 100000000), |
| 2025 | CLK_INIT(sata_src_clk.c), |
| 2026 | }, |
| 2027 | }; |
| 2028 | |
| 2029 | static struct branch_clk sata_rxoob_clk = { |
| 2030 | .b = { |
| 2031 | .ctl_reg = SATA_RXOOB_CLK_CTL_REG, |
| 2032 | .en_mask = BIT(4), |
| 2033 | .halt_reg = CLK_HALT_MSS_SMPSS_MISC_STATE_REG, |
| 2034 | .halt_bit = 26, |
| 2035 | }, |
Tianyi Gou | 352955d | 2012-05-18 19:44:01 -0700 | [diff] [blame] | 2036 | .c = { |
Saravana Kannan | 7a6532e | 2012-10-18 20:51:13 -0700 | [diff] [blame] | 2037 | .parent = &sata_src_clk.c, |
Tianyi Gou | 352955d | 2012-05-18 19:44:01 -0700 | [diff] [blame] | 2038 | .dbg_name = "sata_rxoob_clk", |
| 2039 | .ops = &clk_ops_branch, |
| 2040 | CLK_INIT(sata_rxoob_clk.c), |
| 2041 | }, |
| 2042 | }; |
| 2043 | |
| 2044 | static struct branch_clk sata_pmalive_clk = { |
| 2045 | .b = { |
| 2046 | .ctl_reg = SATA_PMALIVE_CLK_CTL_REG, |
| 2047 | .en_mask = BIT(4), |
| 2048 | .halt_reg = CLK_HALT_MSS_SMPSS_MISC_STATE_REG, |
| 2049 | .halt_bit = 25, |
| 2050 | }, |
Tianyi Gou | 352955d | 2012-05-18 19:44:01 -0700 | [diff] [blame] | 2051 | .c = { |
Saravana Kannan | 7a6532e | 2012-10-18 20:51:13 -0700 | [diff] [blame] | 2052 | .parent = &sata_src_clk.c, |
Tianyi Gou | 352955d | 2012-05-18 19:44:01 -0700 | [diff] [blame] | 2053 | .dbg_name = "sata_pmalive_clk", |
| 2054 | .ops = &clk_ops_branch, |
| 2055 | CLK_INIT(sata_pmalive_clk.c), |
| 2056 | }, |
| 2057 | }; |
| 2058 | |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 2059 | static struct branch_clk sata_phy_ref_clk = { |
| 2060 | .b = { |
| 2061 | .ctl_reg = SATA_PHY_REF_CLK_CTL_REG, |
| 2062 | .en_mask = BIT(4), |
| 2063 | .halt_reg = CLK_HALT_MSS_SMPSS_MISC_STATE_REG, |
| 2064 | .halt_bit = 24, |
| 2065 | }, |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 2066 | .c = { |
Saravana Kannan | 7a6532e | 2012-10-18 20:51:13 -0700 | [diff] [blame] | 2067 | .parent = &pxo_clk.c, |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 2068 | .dbg_name = "sata_phy_ref_clk", |
| 2069 | .ops = &clk_ops_branch, |
| 2070 | CLK_INIT(sata_phy_ref_clk.c), |
| 2071 | }, |
| 2072 | }; |
| 2073 | |
Tianyi Gou | 352955d | 2012-05-18 19:44:01 -0700 | [diff] [blame] | 2074 | static struct branch_clk sata_a_clk = { |
| 2075 | .b = { |
| 2076 | .ctl_reg = SATA_ACLK_CTL_REG, |
| 2077 | .en_mask = BIT(4), |
| 2078 | .halt_reg = CLK_HALT_AFAB_SFAB_STATEA_REG, |
| 2079 | .halt_bit = 12, |
| 2080 | }, |
| 2081 | .c = { |
| 2082 | .dbg_name = "sata_a_clk", |
| 2083 | .ops = &clk_ops_branch, |
| 2084 | CLK_INIT(sata_a_clk.c), |
| 2085 | }, |
| 2086 | }; |
| 2087 | |
| 2088 | static struct branch_clk sata_p_clk = { |
| 2089 | .b = { |
| 2090 | .ctl_reg = SATA_HCLK_CTL_REG, |
| 2091 | .en_mask = BIT(4), |
| 2092 | .halt_reg = CLK_HALT_MSS_SMPSS_MISC_STATE_REG, |
| 2093 | .halt_bit = 27, |
Sujit Reddy Thumma | b0d51e7 | 2012-12-31 15:37:16 +0530 | [diff] [blame] | 2094 | .reset_reg = SATA_RESET, |
| 2095 | .reset_mask = BIT(0), |
Tianyi Gou | 352955d | 2012-05-18 19:44:01 -0700 | [diff] [blame] | 2096 | }, |
| 2097 | .c = { |
| 2098 | .dbg_name = "sata_p_clk", |
| 2099 | .ops = &clk_ops_branch, |
| 2100 | CLK_INIT(sata_p_clk.c), |
| 2101 | }, |
| 2102 | }; |
| 2103 | |
| 2104 | static struct branch_clk sfab_sata_s_p_clk = { |
| 2105 | .b = { |
| 2106 | .ctl_reg = SFAB_SATA_S_HCLK_CTL_REG, |
| 2107 | .en_mask = BIT(4), |
| 2108 | .halt_reg = CLK_HALT_AFAB_SFAB_STATEB_REG, |
| 2109 | .halt_bit = 14, |
| 2110 | }, |
| 2111 | .c = { |
| 2112 | .dbg_name = "sfab_sata_s_p_clk", |
| 2113 | .ops = &clk_ops_branch, |
| 2114 | CLK_INIT(sfab_sata_s_p_clk.c), |
| 2115 | }, |
| 2116 | }; |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 2117 | static struct branch_clk pcie_p_clk = { |
| 2118 | .b = { |
| 2119 | .ctl_reg = PCIE_HCLK_CTL_REG, |
| 2120 | .en_mask = BIT(4), |
| 2121 | .halt_reg = CLK_HALT_CFPB_STATEC_REG, |
| 2122 | .halt_bit = 8, |
| 2123 | }, |
| 2124 | .c = { |
| 2125 | .dbg_name = "pcie_p_clk", |
| 2126 | .ops = &clk_ops_branch, |
| 2127 | CLK_INIT(pcie_p_clk.c), |
| 2128 | }, |
| 2129 | }; |
| 2130 | |
Tianyi Gou | 6613de5 | 2012-01-27 17:57:53 -0800 | [diff] [blame] | 2131 | static struct branch_clk pcie_phy_ref_clk = { |
| 2132 | .b = { |
| 2133 | .ctl_reg = PCIE_PCLK_CTL_REG, |
| 2134 | .en_mask = BIT(4), |
| 2135 | .halt_reg = CLK_HALT_MSS_SMPSS_MISC_STATE_REG, |
| 2136 | .halt_bit = 29, |
| 2137 | }, |
| 2138 | .c = { |
| 2139 | .dbg_name = "pcie_phy_ref_clk", |
| 2140 | .ops = &clk_ops_branch, |
| 2141 | CLK_INIT(pcie_phy_ref_clk.c), |
| 2142 | }, |
| 2143 | }; |
| 2144 | |
| 2145 | static struct branch_clk pcie_a_clk = { |
| 2146 | .b = { |
| 2147 | .ctl_reg = PCIE_ACLK_CTL_REG, |
| 2148 | .en_mask = BIT(4), |
| 2149 | .halt_reg = CLK_HALT_AFAB_SFAB_STATEA_REG, |
| 2150 | .halt_bit = 13, |
| 2151 | }, |
| 2152 | .c = { |
| 2153 | .dbg_name = "pcie_a_clk", |
| 2154 | .ops = &clk_ops_branch, |
| 2155 | CLK_INIT(pcie_a_clk.c), |
| 2156 | }, |
| 2157 | }; |
| 2158 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2159 | static struct branch_clk dma_bam_p_clk = { |
| 2160 | .b = { |
| 2161 | .ctl_reg = DMA_BAM_HCLK_CTL, |
| 2162 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 2163 | .hwcg_reg = DMA_BAM_HCLK_CTL, |
| 2164 | .hwcg_mask = BIT(6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2165 | .halt_reg = CLK_HALT_DFAB_STATE_REG, |
| 2166 | .halt_bit = 12, |
| 2167 | }, |
| 2168 | .c = { |
| 2169 | .dbg_name = "dma_bam_p_clk", |
| 2170 | .ops = &clk_ops_branch, |
| 2171 | CLK_INIT(dma_bam_p_clk.c), |
| 2172 | }, |
| 2173 | }; |
| 2174 | |
| 2175 | static struct branch_clk gsbi1_p_clk = { |
| 2176 | .b = { |
| 2177 | .ctl_reg = GSBIn_HCLK_CTL_REG(1), |
| 2178 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 2179 | .hwcg_reg = GSBIn_HCLK_CTL_REG(1), |
| 2180 | .hwcg_mask = BIT(6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2181 | .halt_reg = CLK_HALT_CFPB_STATEA_REG, |
| 2182 | .halt_bit = 11, |
| 2183 | }, |
| 2184 | .c = { |
| 2185 | .dbg_name = "gsbi1_p_clk", |
| 2186 | .ops = &clk_ops_branch, |
| 2187 | CLK_INIT(gsbi1_p_clk.c), |
| 2188 | }, |
| 2189 | }; |
| 2190 | |
| 2191 | static struct branch_clk gsbi2_p_clk = { |
| 2192 | .b = { |
| 2193 | .ctl_reg = GSBIn_HCLK_CTL_REG(2), |
| 2194 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 2195 | .hwcg_reg = GSBIn_HCLK_CTL_REG(2), |
| 2196 | .hwcg_mask = BIT(6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2197 | .halt_reg = CLK_HALT_CFPB_STATEA_REG, |
| 2198 | .halt_bit = 7, |
| 2199 | }, |
| 2200 | .c = { |
| 2201 | .dbg_name = "gsbi2_p_clk", |
| 2202 | .ops = &clk_ops_branch, |
| 2203 | CLK_INIT(gsbi2_p_clk.c), |
| 2204 | }, |
| 2205 | }; |
| 2206 | |
| 2207 | static struct branch_clk gsbi3_p_clk = { |
| 2208 | .b = { |
| 2209 | .ctl_reg = GSBIn_HCLK_CTL_REG(3), |
| 2210 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 2211 | .hwcg_reg = GSBIn_HCLK_CTL_REG(3), |
| 2212 | .hwcg_mask = BIT(6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2213 | .halt_reg = CLK_HALT_CFPB_STATEA_REG, |
| 2214 | .halt_bit = 3, |
| 2215 | }, |
| 2216 | .c = { |
| 2217 | .dbg_name = "gsbi3_p_clk", |
| 2218 | .ops = &clk_ops_branch, |
| 2219 | CLK_INIT(gsbi3_p_clk.c), |
| 2220 | }, |
| 2221 | }; |
| 2222 | |
| 2223 | static struct branch_clk gsbi4_p_clk = { |
| 2224 | .b = { |
| 2225 | .ctl_reg = GSBIn_HCLK_CTL_REG(4), |
| 2226 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 2227 | .hwcg_reg = GSBIn_HCLK_CTL_REG(4), |
| 2228 | .hwcg_mask = BIT(6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2229 | .halt_reg = CLK_HALT_CFPB_STATEB_REG, |
| 2230 | .halt_bit = 27, |
| 2231 | }, |
| 2232 | .c = { |
| 2233 | .dbg_name = "gsbi4_p_clk", |
| 2234 | .ops = &clk_ops_branch, |
| 2235 | CLK_INIT(gsbi4_p_clk.c), |
| 2236 | }, |
| 2237 | }; |
| 2238 | |
| 2239 | static struct branch_clk gsbi5_p_clk = { |
| 2240 | .b = { |
| 2241 | .ctl_reg = GSBIn_HCLK_CTL_REG(5), |
| 2242 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 2243 | .hwcg_reg = GSBIn_HCLK_CTL_REG(5), |
| 2244 | .hwcg_mask = BIT(6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2245 | .halt_reg = CLK_HALT_CFPB_STATEB_REG, |
| 2246 | .halt_bit = 23, |
| 2247 | }, |
| 2248 | .c = { |
| 2249 | .dbg_name = "gsbi5_p_clk", |
| 2250 | .ops = &clk_ops_branch, |
| 2251 | CLK_INIT(gsbi5_p_clk.c), |
| 2252 | }, |
| 2253 | }; |
| 2254 | |
| 2255 | static struct branch_clk gsbi6_p_clk = { |
| 2256 | .b = { |
| 2257 | .ctl_reg = GSBIn_HCLK_CTL_REG(6), |
| 2258 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 2259 | .hwcg_reg = GSBIn_HCLK_CTL_REG(6), |
| 2260 | .hwcg_mask = BIT(6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2261 | .halt_reg = CLK_HALT_CFPB_STATEB_REG, |
| 2262 | .halt_bit = 19, |
| 2263 | }, |
| 2264 | .c = { |
| 2265 | .dbg_name = "gsbi6_p_clk", |
| 2266 | .ops = &clk_ops_branch, |
| 2267 | CLK_INIT(gsbi6_p_clk.c), |
| 2268 | }, |
| 2269 | }; |
| 2270 | |
| 2271 | static struct branch_clk gsbi7_p_clk = { |
| 2272 | .b = { |
| 2273 | .ctl_reg = GSBIn_HCLK_CTL_REG(7), |
| 2274 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 2275 | .hwcg_reg = GSBIn_HCLK_CTL_REG(7), |
| 2276 | .hwcg_mask = BIT(6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2277 | .halt_reg = CLK_HALT_CFPB_STATEB_REG, |
| 2278 | .halt_bit = 15, |
| 2279 | }, |
| 2280 | .c = { |
| 2281 | .dbg_name = "gsbi7_p_clk", |
| 2282 | .ops = &clk_ops_branch, |
| 2283 | CLK_INIT(gsbi7_p_clk.c), |
| 2284 | }, |
| 2285 | }; |
| 2286 | |
| 2287 | static struct branch_clk gsbi8_p_clk = { |
| 2288 | .b = { |
| 2289 | .ctl_reg = GSBIn_HCLK_CTL_REG(8), |
| 2290 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 2291 | .hwcg_reg = GSBIn_HCLK_CTL_REG(8), |
| 2292 | .hwcg_mask = BIT(6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2293 | .halt_reg = CLK_HALT_CFPB_STATEB_REG, |
| 2294 | .halt_bit = 11, |
| 2295 | }, |
| 2296 | .c = { |
| 2297 | .dbg_name = "gsbi8_p_clk", |
| 2298 | .ops = &clk_ops_branch, |
| 2299 | CLK_INIT(gsbi8_p_clk.c), |
| 2300 | }, |
| 2301 | }; |
| 2302 | |
| 2303 | static struct branch_clk gsbi9_p_clk = { |
| 2304 | .b = { |
| 2305 | .ctl_reg = GSBIn_HCLK_CTL_REG(9), |
| 2306 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 2307 | .hwcg_reg = GSBIn_HCLK_CTL_REG(9), |
| 2308 | .hwcg_mask = BIT(6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2309 | .halt_reg = CLK_HALT_CFPB_STATEB_REG, |
| 2310 | .halt_bit = 7, |
| 2311 | }, |
| 2312 | .c = { |
| 2313 | .dbg_name = "gsbi9_p_clk", |
| 2314 | .ops = &clk_ops_branch, |
| 2315 | CLK_INIT(gsbi9_p_clk.c), |
| 2316 | }, |
| 2317 | }; |
| 2318 | |
| 2319 | static struct branch_clk gsbi10_p_clk = { |
| 2320 | .b = { |
| 2321 | .ctl_reg = GSBIn_HCLK_CTL_REG(10), |
| 2322 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 2323 | .hwcg_reg = GSBIn_HCLK_CTL_REG(10), |
| 2324 | .hwcg_mask = BIT(6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2325 | .halt_reg = CLK_HALT_CFPB_STATEB_REG, |
| 2326 | .halt_bit = 3, |
| 2327 | }, |
| 2328 | .c = { |
| 2329 | .dbg_name = "gsbi10_p_clk", |
| 2330 | .ops = &clk_ops_branch, |
| 2331 | CLK_INIT(gsbi10_p_clk.c), |
| 2332 | }, |
| 2333 | }; |
| 2334 | |
| 2335 | static struct branch_clk gsbi11_p_clk = { |
| 2336 | .b = { |
| 2337 | .ctl_reg = GSBIn_HCLK_CTL_REG(11), |
| 2338 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 2339 | .hwcg_reg = GSBIn_HCLK_CTL_REG(11), |
| 2340 | .hwcg_mask = BIT(6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2341 | .halt_reg = CLK_HALT_CFPB_STATEC_REG, |
| 2342 | .halt_bit = 18, |
| 2343 | }, |
| 2344 | .c = { |
| 2345 | .dbg_name = "gsbi11_p_clk", |
| 2346 | .ops = &clk_ops_branch, |
| 2347 | CLK_INIT(gsbi11_p_clk.c), |
| 2348 | }, |
| 2349 | }; |
| 2350 | |
| 2351 | static struct branch_clk gsbi12_p_clk = { |
| 2352 | .b = { |
| 2353 | .ctl_reg = GSBIn_HCLK_CTL_REG(12), |
| 2354 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 2355 | .hwcg_reg = GSBIn_HCLK_CTL_REG(12), |
| 2356 | .hwcg_mask = BIT(6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2357 | .halt_reg = CLK_HALT_CFPB_STATEC_REG, |
| 2358 | .halt_bit = 14, |
| 2359 | }, |
| 2360 | .c = { |
| 2361 | .dbg_name = "gsbi12_p_clk", |
| 2362 | .ops = &clk_ops_branch, |
| 2363 | CLK_INIT(gsbi12_p_clk.c), |
| 2364 | }, |
| 2365 | }; |
| 2366 | |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 2367 | static struct branch_clk sata_phy_cfg_clk = { |
| 2368 | .b = { |
| 2369 | .ctl_reg = SATA_PHY_CFG_CLK_CTL_REG, |
| 2370 | .en_mask = BIT(4), |
| 2371 | .halt_reg = CLK_HALT_CFPB_STATEA_REG, |
| 2372 | .halt_bit = 12, |
| 2373 | }, |
| 2374 | .c = { |
| 2375 | .dbg_name = "sata_phy_cfg_clk", |
| 2376 | .ops = &clk_ops_branch, |
| 2377 | CLK_INIT(sata_phy_cfg_clk.c), |
Stephen Boyd | 973e4ba | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 2378 | }, |
| 2379 | }; |
| 2380 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2381 | static struct branch_clk tsif_p_clk = { |
| 2382 | .b = { |
| 2383 | .ctl_reg = TSIF_HCLK_CTL_REG, |
| 2384 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 2385 | .hwcg_reg = TSIF_HCLK_CTL_REG, |
| 2386 | .hwcg_mask = BIT(6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2387 | .halt_reg = CLK_HALT_CFPB_STATEC_REG, |
| 2388 | .halt_bit = 7, |
| 2389 | }, |
| 2390 | .c = { |
| 2391 | .dbg_name = "tsif_p_clk", |
| 2392 | .ops = &clk_ops_branch, |
| 2393 | CLK_INIT(tsif_p_clk.c), |
| 2394 | }, |
| 2395 | }; |
| 2396 | |
| 2397 | static struct branch_clk usb_fs1_p_clk = { |
| 2398 | .b = { |
| 2399 | .ctl_reg = USB_FSn_HCLK_CTL_REG(1), |
| 2400 | .en_mask = BIT(4), |
| 2401 | .halt_reg = CLK_HALT_CFPB_STATEA_REG, |
| 2402 | .halt_bit = 17, |
| 2403 | }, |
| 2404 | .c = { |
| 2405 | .dbg_name = "usb_fs1_p_clk", |
| 2406 | .ops = &clk_ops_branch, |
| 2407 | CLK_INIT(usb_fs1_p_clk.c), |
| 2408 | }, |
| 2409 | }; |
| 2410 | |
| 2411 | static struct branch_clk usb_fs2_p_clk = { |
| 2412 | .b = { |
| 2413 | .ctl_reg = USB_FSn_HCLK_CTL_REG(2), |
| 2414 | .en_mask = BIT(4), |
| 2415 | .halt_reg = CLK_HALT_CFPB_STATEA_REG, |
| 2416 | .halt_bit = 14, |
| 2417 | }, |
| 2418 | .c = { |
| 2419 | .dbg_name = "usb_fs2_p_clk", |
| 2420 | .ops = &clk_ops_branch, |
| 2421 | CLK_INIT(usb_fs2_p_clk.c), |
| 2422 | }, |
| 2423 | }; |
| 2424 | |
| 2425 | static struct branch_clk usb_hs1_p_clk = { |
| 2426 | .b = { |
| 2427 | .ctl_reg = USB_HS1_HCLK_CTL_REG, |
| 2428 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 2429 | .hwcg_reg = USB_HS1_HCLK_CTL_REG, |
| 2430 | .hwcg_mask = BIT(6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2431 | .halt_reg = CLK_HALT_DFAB_STATE_REG, |
| 2432 | .halt_bit = 1, |
| 2433 | }, |
| 2434 | .c = { |
| 2435 | .dbg_name = "usb_hs1_p_clk", |
| 2436 | .ops = &clk_ops_branch, |
| 2437 | CLK_INIT(usb_hs1_p_clk.c), |
| 2438 | }, |
| 2439 | }; |
| 2440 | |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 2441 | static struct branch_clk usb_hs3_p_clk = { |
| 2442 | .b = { |
| 2443 | .ctl_reg = USB_HS3_HCLK_CTL_REG, |
| 2444 | .en_mask = BIT(4), |
| 2445 | .halt_reg = CLK_HALT_DFAB_STATE_REG, |
| 2446 | .halt_bit = 31, |
| 2447 | }, |
| 2448 | .c = { |
| 2449 | .dbg_name = "usb_hs3_p_clk", |
| 2450 | .ops = &clk_ops_branch, |
| 2451 | CLK_INIT(usb_hs3_p_clk.c), |
| 2452 | }, |
| 2453 | }; |
| 2454 | |
| 2455 | static struct branch_clk usb_hs4_p_clk = { |
| 2456 | .b = { |
| 2457 | .ctl_reg = USB_HS4_HCLK_CTL_REG, |
| 2458 | .en_mask = BIT(4), |
| 2459 | .halt_reg = CLK_HALT_DFAB_STATE_REG, |
| 2460 | .halt_bit = 7, |
| 2461 | }, |
| 2462 | .c = { |
| 2463 | .dbg_name = "usb_hs4_p_clk", |
| 2464 | .ops = &clk_ops_branch, |
| 2465 | CLK_INIT(usb_hs4_p_clk.c), |
| 2466 | }, |
| 2467 | }; |
| 2468 | |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 2469 | static struct branch_clk usb_hsic_p_clk = { |
| 2470 | .b = { |
| 2471 | .ctl_reg = USB_HSIC_HCLK_CTL_REG, |
| 2472 | .en_mask = BIT(4), |
| 2473 | .halt_reg = CLK_HALT_CFPB_STATEA_REG, |
| 2474 | .halt_bit = 28, |
| 2475 | }, |
| 2476 | .c = { |
| 2477 | .dbg_name = "usb_hsic_p_clk", |
| 2478 | .ops = &clk_ops_branch, |
| 2479 | CLK_INIT(usb_hsic_p_clk.c), |
| 2480 | }, |
| 2481 | }; |
| 2482 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2483 | static struct branch_clk sdc1_p_clk = { |
| 2484 | .b = { |
| 2485 | .ctl_reg = SDCn_HCLK_CTL_REG(1), |
| 2486 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 2487 | .hwcg_reg = SDCn_HCLK_CTL_REG(1), |
| 2488 | .hwcg_mask = BIT(6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2489 | .halt_reg = CLK_HALT_DFAB_STATE_REG, |
| 2490 | .halt_bit = 11, |
| 2491 | }, |
| 2492 | .c = { |
| 2493 | .dbg_name = "sdc1_p_clk", |
| 2494 | .ops = &clk_ops_branch, |
| 2495 | CLK_INIT(sdc1_p_clk.c), |
| 2496 | }, |
| 2497 | }; |
| 2498 | |
| 2499 | static struct branch_clk sdc2_p_clk = { |
| 2500 | .b = { |
| 2501 | .ctl_reg = SDCn_HCLK_CTL_REG(2), |
| 2502 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 2503 | .hwcg_reg = SDCn_HCLK_CTL_REG(2), |
| 2504 | .hwcg_mask = BIT(6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2505 | .halt_reg = CLK_HALT_DFAB_STATE_REG, |
| 2506 | .halt_bit = 10, |
| 2507 | }, |
| 2508 | .c = { |
| 2509 | .dbg_name = "sdc2_p_clk", |
| 2510 | .ops = &clk_ops_branch, |
| 2511 | CLK_INIT(sdc2_p_clk.c), |
| 2512 | }, |
| 2513 | }; |
| 2514 | |
| 2515 | static struct branch_clk sdc3_p_clk = { |
| 2516 | .b = { |
| 2517 | .ctl_reg = SDCn_HCLK_CTL_REG(3), |
| 2518 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 2519 | .hwcg_reg = SDCn_HCLK_CTL_REG(3), |
| 2520 | .hwcg_mask = BIT(6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2521 | .halt_reg = CLK_HALT_DFAB_STATE_REG, |
| 2522 | .halt_bit = 9, |
| 2523 | }, |
| 2524 | .c = { |
| 2525 | .dbg_name = "sdc3_p_clk", |
| 2526 | .ops = &clk_ops_branch, |
| 2527 | CLK_INIT(sdc3_p_clk.c), |
| 2528 | }, |
| 2529 | }; |
| 2530 | |
| 2531 | static struct branch_clk sdc4_p_clk = { |
| 2532 | .b = { |
| 2533 | .ctl_reg = SDCn_HCLK_CTL_REG(4), |
| 2534 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 2535 | .hwcg_reg = SDCn_HCLK_CTL_REG(4), |
| 2536 | .hwcg_mask = BIT(6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2537 | .halt_reg = CLK_HALT_DFAB_STATE_REG, |
| 2538 | .halt_bit = 8, |
| 2539 | }, |
| 2540 | .c = { |
| 2541 | .dbg_name = "sdc4_p_clk", |
| 2542 | .ops = &clk_ops_branch, |
| 2543 | CLK_INIT(sdc4_p_clk.c), |
| 2544 | }, |
| 2545 | }; |
| 2546 | |
| 2547 | static struct branch_clk sdc5_p_clk = { |
| 2548 | .b = { |
| 2549 | .ctl_reg = SDCn_HCLK_CTL_REG(5), |
| 2550 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 2551 | .hwcg_reg = SDCn_HCLK_CTL_REG(5), |
| 2552 | .hwcg_mask = BIT(6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2553 | .halt_reg = CLK_HALT_DFAB_STATE_REG, |
| 2554 | .halt_bit = 7, |
| 2555 | }, |
| 2556 | .c = { |
| 2557 | .dbg_name = "sdc5_p_clk", |
| 2558 | .ops = &clk_ops_branch, |
| 2559 | CLK_INIT(sdc5_p_clk.c), |
| 2560 | }, |
| 2561 | }; |
| 2562 | |
| 2563 | /* HW-Voteable Clocks */ |
| 2564 | static struct branch_clk adm0_clk = { |
| 2565 | .b = { |
| 2566 | .ctl_reg = SC0_U_CLK_BRANCH_ENA_VOTE_REG, |
| 2567 | .en_mask = BIT(2), |
| 2568 | .halt_reg = CLK_HALT_MSS_SMPSS_MISC_STATE_REG, |
| 2569 | .halt_check = HALT_VOTED, |
| 2570 | .halt_bit = 14, |
| 2571 | }, |
| 2572 | .c = { |
| 2573 | .dbg_name = "adm0_clk", |
| 2574 | .ops = &clk_ops_branch, |
| 2575 | CLK_INIT(adm0_clk.c), |
| 2576 | }, |
| 2577 | }; |
| 2578 | |
| 2579 | static struct branch_clk adm0_p_clk = { |
| 2580 | .b = { |
| 2581 | .ctl_reg = SC0_U_CLK_BRANCH_ENA_VOTE_REG, |
| 2582 | .en_mask = BIT(3), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 2583 | .hwcg_reg = ADM0_PBUS_CLK_CTL_REG, |
| 2584 | .hwcg_mask = BIT(6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2585 | .halt_reg = CLK_HALT_MSS_SMPSS_MISC_STATE_REG, |
| 2586 | .halt_check = HALT_VOTED, |
| 2587 | .halt_bit = 13, |
| 2588 | }, |
| 2589 | .c = { |
| 2590 | .dbg_name = "adm0_p_clk", |
| 2591 | .ops = &clk_ops_branch, |
| 2592 | CLK_INIT(adm0_p_clk.c), |
| 2593 | }, |
| 2594 | }; |
| 2595 | |
| 2596 | static struct branch_clk pmic_arb0_p_clk = { |
| 2597 | .b = { |
| 2598 | .ctl_reg = SC0_U_CLK_BRANCH_ENA_VOTE_REG, |
| 2599 | .en_mask = BIT(8), |
| 2600 | .halt_reg = CLK_HALT_SFPB_MISC_STATE_REG, |
| 2601 | .halt_check = HALT_VOTED, |
| 2602 | .halt_bit = 22, |
| 2603 | }, |
| 2604 | .c = { |
| 2605 | .dbg_name = "pmic_arb0_p_clk", |
| 2606 | .ops = &clk_ops_branch, |
| 2607 | CLK_INIT(pmic_arb0_p_clk.c), |
| 2608 | }, |
| 2609 | }; |
| 2610 | |
| 2611 | static struct branch_clk pmic_arb1_p_clk = { |
| 2612 | .b = { |
| 2613 | .ctl_reg = SC0_U_CLK_BRANCH_ENA_VOTE_REG, |
| 2614 | .en_mask = BIT(9), |
| 2615 | .halt_reg = CLK_HALT_SFPB_MISC_STATE_REG, |
| 2616 | .halt_check = HALT_VOTED, |
| 2617 | .halt_bit = 21, |
| 2618 | }, |
| 2619 | .c = { |
| 2620 | .dbg_name = "pmic_arb1_p_clk", |
| 2621 | .ops = &clk_ops_branch, |
| 2622 | CLK_INIT(pmic_arb1_p_clk.c), |
| 2623 | }, |
| 2624 | }; |
| 2625 | |
| 2626 | static struct branch_clk pmic_ssbi2_clk = { |
| 2627 | .b = { |
| 2628 | .ctl_reg = SC0_U_CLK_BRANCH_ENA_VOTE_REG, |
| 2629 | .en_mask = BIT(7), |
| 2630 | .halt_reg = CLK_HALT_SFPB_MISC_STATE_REG, |
| 2631 | .halt_check = HALT_VOTED, |
| 2632 | .halt_bit = 23, |
| 2633 | }, |
| 2634 | .c = { |
| 2635 | .dbg_name = "pmic_ssbi2_clk", |
| 2636 | .ops = &clk_ops_branch, |
| 2637 | CLK_INIT(pmic_ssbi2_clk.c), |
| 2638 | }, |
| 2639 | }; |
| 2640 | |
| 2641 | static struct branch_clk rpm_msg_ram_p_clk = { |
| 2642 | .b = { |
| 2643 | .ctl_reg = SC0_U_CLK_BRANCH_ENA_VOTE_REG, |
| 2644 | .en_mask = BIT(6), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 2645 | .hwcg_reg = RPM_MSG_RAM_HCLK_CTL_REG, |
| 2646 | .hwcg_mask = BIT(6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2647 | .halt_reg = CLK_HALT_SFPB_MISC_STATE_REG, |
| 2648 | .halt_check = HALT_VOTED, |
| 2649 | .halt_bit = 12, |
| 2650 | }, |
| 2651 | .c = { |
| 2652 | .dbg_name = "rpm_msg_ram_p_clk", |
| 2653 | .ops = &clk_ops_branch, |
| 2654 | CLK_INIT(rpm_msg_ram_p_clk.c), |
| 2655 | }, |
| 2656 | }; |
| 2657 | |
| 2658 | /* |
| 2659 | * Multimedia Clocks |
| 2660 | */ |
| 2661 | |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 2662 | #define CLK_CAM(name, n, hb) \ |
| 2663 | struct rcg_clk name = { \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2664 | .b = { \ |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 2665 | .ctl_reg = CAMCLK##n##_CC_REG, \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2666 | .en_mask = BIT(0), \ |
| 2667 | .halt_reg = DBG_BUS_VEC_I_REG, \ |
| 2668 | .halt_bit = hb, \ |
| 2669 | }, \ |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 2670 | .ns_reg = CAMCLK##n##_NS_REG, \ |
| 2671 | .md_reg = CAMCLK##n##_MD_REG, \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2672 | .root_en_mask = BIT(2), \ |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 2673 | .ns_mask = BM(31, 24) | BM(15, 14) | BM(2, 0), \ |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame] | 2674 | .mnd_en_mask = BIT(5), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2675 | .ctl_mask = BM(7, 6), \ |
| 2676 | .set_rate = set_rate_mnd_8, \ |
| 2677 | .freq_tbl = clk_tbl_cam, \ |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 2678 | .current_freq = &rcg_dummy_freq, \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2679 | .c = { \ |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 2680 | .dbg_name = #name, \ |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 2681 | .ops = &clk_ops_rcg, \ |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 2682 | VDD_DIG_FMAX_MAP2(LOW, 64000000, NOMINAL, 128000000), \ |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 2683 | CLK_INIT(name.c), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2684 | }, \ |
| 2685 | } |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 2686 | #define F_CAM(f, s, d, m, n) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2687 | { \ |
| 2688 | .freq_hz = f, \ |
| 2689 | .src_clk = &s##_clk.c, \ |
| 2690 | .md_val = MD8(8, m, 0, n), \ |
| 2691 | .ns_val = NS_MM(31, 24, n, m, 15, 14, d, 2, 0, s##_to_mm_mux), \ |
| 2692 | .ctl_val = CC(6, n), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2693 | } |
| 2694 | static struct clk_freq_tbl clk_tbl_cam[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 2695 | F_CAM( 0, gnd, 1, 0, 0), |
| 2696 | F_CAM( 6000000, pll8, 4, 1, 16), |
| 2697 | F_CAM( 8000000, pll8, 4, 1, 12), |
| 2698 | F_CAM( 12000000, pll8, 4, 1, 8), |
| 2699 | F_CAM( 16000000, pll8, 4, 1, 6), |
| 2700 | F_CAM( 19200000, pll8, 4, 1, 5), |
| 2701 | F_CAM( 24000000, pll8, 4, 1, 4), |
| 2702 | F_CAM( 32000000, pll8, 4, 1, 3), |
| 2703 | F_CAM( 48000000, pll8, 4, 1, 2), |
| 2704 | F_CAM( 64000000, pll8, 3, 1, 2), |
| 2705 | F_CAM( 96000000, pll8, 4, 0, 0), |
| 2706 | F_CAM(128000000, pll8, 3, 0, 0), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2707 | F_END |
| 2708 | }; |
| 2709 | |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 2710 | static CLK_CAM(cam0_clk, 0, 15); |
| 2711 | static CLK_CAM(cam1_clk, 1, 16); |
| 2712 | static CLK_CAM(cam2_clk, 2, 31); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2713 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 2714 | #define F_CSI(f, s, d, m, n) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2715 | { \ |
| 2716 | .freq_hz = f, \ |
| 2717 | .src_clk = &s##_clk.c, \ |
| 2718 | .md_val = MD8(8, m, 0, n), \ |
| 2719 | .ns_val = NS_MM(31, 24, n, m, 15, 14, d, 2, 0, s##_to_mm_mux), \ |
| 2720 | .ctl_val = CC(6, n), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2721 | } |
| 2722 | static struct clk_freq_tbl clk_tbl_csi[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 2723 | F_CSI( 0, gnd, 1, 0, 0), |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 2724 | F_CSI( 27000000, pxo, 1, 0, 0), |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 2725 | F_CSI( 85330000, pll8, 1, 2, 9), |
| 2726 | F_CSI(177780000, pll2, 1, 2, 9), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2727 | F_END |
| 2728 | }; |
| 2729 | |
| 2730 | static struct rcg_clk csi0_src_clk = { |
| 2731 | .ns_reg = CSI0_NS_REG, |
| 2732 | .b = { |
| 2733 | .ctl_reg = CSI0_CC_REG, |
| 2734 | .halt_check = NOCHECK, |
| 2735 | }, |
| 2736 | .md_reg = CSI0_MD_REG, |
| 2737 | .root_en_mask = BIT(2), |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 2738 | .ns_mask = BM(31, 24) | BM(15, 14) | BM(2, 0), |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame] | 2739 | .mnd_en_mask = BIT(5), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2740 | .ctl_mask = BM(7, 6), |
| 2741 | .set_rate = set_rate_mnd, |
| 2742 | .freq_tbl = clk_tbl_csi, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 2743 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2744 | .c = { |
| 2745 | .dbg_name = "csi0_src_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 2746 | .ops = &clk_ops_rcg, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 2747 | VDD_DIG_FMAX_MAP2(LOW, 86000000, NOMINAL, 178000000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2748 | CLK_INIT(csi0_src_clk.c), |
| 2749 | }, |
| 2750 | }; |
| 2751 | |
| 2752 | static struct branch_clk csi0_clk = { |
| 2753 | .b = { |
| 2754 | .ctl_reg = CSI0_CC_REG, |
| 2755 | .en_mask = BIT(0), |
| 2756 | .reset_reg = SW_RESET_CORE_REG, |
| 2757 | .reset_mask = BIT(8), |
| 2758 | .halt_reg = DBG_BUS_VEC_B_REG, |
| 2759 | .halt_bit = 13, |
| 2760 | }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2761 | .c = { |
Saravana Kannan | 7a6532e | 2012-10-18 20:51:13 -0700 | [diff] [blame] | 2762 | .parent = &csi0_src_clk.c, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2763 | .dbg_name = "csi0_clk", |
| 2764 | .ops = &clk_ops_branch, |
| 2765 | CLK_INIT(csi0_clk.c), |
| 2766 | }, |
| 2767 | }; |
| 2768 | |
| 2769 | static struct branch_clk csi0_phy_clk = { |
| 2770 | .b = { |
| 2771 | .ctl_reg = CSI0_CC_REG, |
| 2772 | .en_mask = BIT(8), |
| 2773 | .reset_reg = SW_RESET_CORE_REG, |
| 2774 | .reset_mask = BIT(29), |
| 2775 | .halt_reg = DBG_BUS_VEC_I_REG, |
| 2776 | .halt_bit = 9, |
| 2777 | }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2778 | .c = { |
Saravana Kannan | 7a6532e | 2012-10-18 20:51:13 -0700 | [diff] [blame] | 2779 | .parent = &csi0_src_clk.c, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2780 | .dbg_name = "csi0_phy_clk", |
| 2781 | .ops = &clk_ops_branch, |
| 2782 | CLK_INIT(csi0_phy_clk.c), |
| 2783 | }, |
| 2784 | }; |
| 2785 | |
| 2786 | static struct rcg_clk csi1_src_clk = { |
| 2787 | .ns_reg = CSI1_NS_REG, |
| 2788 | .b = { |
| 2789 | .ctl_reg = CSI1_CC_REG, |
| 2790 | .halt_check = NOCHECK, |
| 2791 | }, |
| 2792 | .md_reg = CSI1_MD_REG, |
| 2793 | .root_en_mask = BIT(2), |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 2794 | .ns_mask = BM(31, 24) | BM(15, 14) | BM(2, 0), |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame] | 2795 | .mnd_en_mask = BIT(5), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2796 | .ctl_mask = BM(7, 6), |
| 2797 | .set_rate = set_rate_mnd, |
| 2798 | .freq_tbl = clk_tbl_csi, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 2799 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2800 | .c = { |
| 2801 | .dbg_name = "csi1_src_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 2802 | .ops = &clk_ops_rcg, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 2803 | VDD_DIG_FMAX_MAP2(LOW, 86000000, NOMINAL, 178000000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2804 | CLK_INIT(csi1_src_clk.c), |
| 2805 | }, |
| 2806 | }; |
| 2807 | |
| 2808 | static struct branch_clk csi1_clk = { |
| 2809 | .b = { |
| 2810 | .ctl_reg = CSI1_CC_REG, |
| 2811 | .en_mask = BIT(0), |
| 2812 | .reset_reg = SW_RESET_CORE_REG, |
| 2813 | .reset_mask = BIT(18), |
| 2814 | .halt_reg = DBG_BUS_VEC_B_REG, |
| 2815 | .halt_bit = 14, |
| 2816 | }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2817 | .c = { |
Saravana Kannan | 7a6532e | 2012-10-18 20:51:13 -0700 | [diff] [blame] | 2818 | .parent = &csi1_src_clk.c, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2819 | .dbg_name = "csi1_clk", |
| 2820 | .ops = &clk_ops_branch, |
| 2821 | CLK_INIT(csi1_clk.c), |
| 2822 | }, |
| 2823 | }; |
| 2824 | |
| 2825 | static struct branch_clk csi1_phy_clk = { |
| 2826 | .b = { |
| 2827 | .ctl_reg = CSI1_CC_REG, |
| 2828 | .en_mask = BIT(8), |
| 2829 | .reset_reg = SW_RESET_CORE_REG, |
| 2830 | .reset_mask = BIT(28), |
| 2831 | .halt_reg = DBG_BUS_VEC_I_REG, |
| 2832 | .halt_bit = 10, |
| 2833 | }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2834 | .c = { |
Saravana Kannan | 7a6532e | 2012-10-18 20:51:13 -0700 | [diff] [blame] | 2835 | .parent = &csi1_src_clk.c, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2836 | .dbg_name = "csi1_phy_clk", |
| 2837 | .ops = &clk_ops_branch, |
| 2838 | CLK_INIT(csi1_phy_clk.c), |
| 2839 | }, |
| 2840 | }; |
| 2841 | |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 2842 | static struct rcg_clk csi2_src_clk = { |
| 2843 | .ns_reg = CSI2_NS_REG, |
| 2844 | .b = { |
| 2845 | .ctl_reg = CSI2_CC_REG, |
| 2846 | .halt_check = NOCHECK, |
| 2847 | }, |
| 2848 | .md_reg = CSI2_MD_REG, |
| 2849 | .root_en_mask = BIT(2), |
| 2850 | .ns_mask = BM(31, 24) | BM(15, 14) | BM(2, 0), |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame] | 2851 | .mnd_en_mask = BIT(5), |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 2852 | .ctl_mask = BM(7, 6), |
| 2853 | .set_rate = set_rate_mnd, |
| 2854 | .freq_tbl = clk_tbl_csi, |
| 2855 | .current_freq = &rcg_dummy_freq, |
| 2856 | .c = { |
| 2857 | .dbg_name = "csi2_src_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 2858 | .ops = &clk_ops_rcg, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 2859 | VDD_DIG_FMAX_MAP2(LOW, 86000000, NOMINAL, 178000000), |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 2860 | CLK_INIT(csi2_src_clk.c), |
| 2861 | }, |
| 2862 | }; |
| 2863 | |
| 2864 | static struct branch_clk csi2_clk = { |
| 2865 | .b = { |
| 2866 | .ctl_reg = CSI2_CC_REG, |
| 2867 | .en_mask = BIT(0), |
| 2868 | .reset_reg = SW_RESET_CORE2_REG, |
| 2869 | .reset_mask = BIT(2), |
| 2870 | .halt_reg = DBG_BUS_VEC_B_REG, |
| 2871 | .halt_bit = 29, |
| 2872 | }, |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 2873 | .c = { |
Saravana Kannan | 7a6532e | 2012-10-18 20:51:13 -0700 | [diff] [blame] | 2874 | .parent = &csi2_src_clk.c, |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 2875 | .dbg_name = "csi2_clk", |
| 2876 | .ops = &clk_ops_branch, |
| 2877 | CLK_INIT(csi2_clk.c), |
| 2878 | }, |
| 2879 | }; |
| 2880 | |
| 2881 | static struct branch_clk csi2_phy_clk = { |
| 2882 | .b = { |
| 2883 | .ctl_reg = CSI2_CC_REG, |
| 2884 | .en_mask = BIT(8), |
| 2885 | .reset_reg = SW_RESET_CORE_REG, |
| 2886 | .reset_mask = BIT(31), |
| 2887 | .halt_reg = DBG_BUS_VEC_I_REG, |
| 2888 | .halt_bit = 29, |
| 2889 | }, |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 2890 | .c = { |
Saravana Kannan | 7a6532e | 2012-10-18 20:51:13 -0700 | [diff] [blame] | 2891 | .parent = &csi2_src_clk.c, |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 2892 | .dbg_name = "csi2_phy_clk", |
| 2893 | .ops = &clk_ops_branch, |
| 2894 | CLK_INIT(csi2_phy_clk.c), |
| 2895 | }, |
| 2896 | }; |
| 2897 | |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 2898 | static struct clk *pix_rdi_mux_map[] = { |
| 2899 | [0] = &csi0_clk.c, |
| 2900 | [1] = &csi1_clk.c, |
| 2901 | [2] = &csi2_clk.c, |
| 2902 | NULL, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2903 | }; |
| 2904 | |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 2905 | struct pix_rdi_clk { |
Stephen Boyd | d86d1f2 | 2012-01-24 17:36:34 -0800 | [diff] [blame] | 2906 | bool prepared; |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 2907 | bool enabled; |
Matt Wagantall | 9de3bfb | 2011-11-03 20:13:12 -0700 | [diff] [blame] | 2908 | unsigned long cur_rate; |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 2909 | |
| 2910 | void __iomem *const s_reg; |
| 2911 | u32 s_mask; |
| 2912 | |
| 2913 | void __iomem *const s2_reg; |
| 2914 | u32 s2_mask; |
| 2915 | |
| 2916 | struct branch b; |
| 2917 | struct clk c; |
| 2918 | }; |
| 2919 | |
Matt Wagantall | f82f294 | 2012-01-27 13:56:13 -0800 | [diff] [blame] | 2920 | static inline struct pix_rdi_clk *to_pix_rdi_clk(struct clk *c) |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 2921 | { |
Matt Wagantall | f82f294 | 2012-01-27 13:56:13 -0800 | [diff] [blame] | 2922 | return container_of(c, struct pix_rdi_clk, c); |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 2923 | } |
| 2924 | |
Matt Wagantall | 9de3bfb | 2011-11-03 20:13:12 -0700 | [diff] [blame] | 2925 | 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] | 2926 | { |
| 2927 | int ret, i; |
| 2928 | u32 reg; |
| 2929 | unsigned long flags; |
Matt Wagantall | f82f294 | 2012-01-27 13:56:13 -0800 | [diff] [blame] | 2930 | struct pix_rdi_clk *rdi = to_pix_rdi_clk(c); |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 2931 | struct clk **mux_map = pix_rdi_mux_map; |
Stephen Boyd | d86d1f2 | 2012-01-24 17:36:34 -0800 | [diff] [blame] | 2932 | unsigned long old_rate = rdi->cur_rate; |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 2933 | |
| 2934 | /* |
| 2935 | * These clocks select three inputs via two muxes. One mux selects |
| 2936 | * between csi0 and csi1 and the second mux selects between that mux's |
| 2937 | * output and csi2. The source and destination selections for each |
| 2938 | * mux must be clocking for the switch to succeed so just turn on |
| 2939 | * all three sources because it's easier than figuring out what source |
| 2940 | * needs to be on at what time. |
| 2941 | */ |
| 2942 | for (i = 0; mux_map[i]; i++) { |
Stephen Boyd | d86d1f2 | 2012-01-24 17:36:34 -0800 | [diff] [blame] | 2943 | ret = clk_prepare_enable(mux_map[i]); |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 2944 | if (ret) |
| 2945 | goto err; |
| 2946 | } |
| 2947 | if (rate >= i) { |
| 2948 | ret = -EINVAL; |
| 2949 | goto err; |
| 2950 | } |
| 2951 | /* Keep the new source on when switching inputs of an enabled clock */ |
Stephen Boyd | d86d1f2 | 2012-01-24 17:36:34 -0800 | [diff] [blame] | 2952 | if (rdi->prepared) { |
| 2953 | ret = clk_prepare(mux_map[rate]); |
| 2954 | if (ret) |
| 2955 | goto err; |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 2956 | } |
Stephen Boyd | d86d1f2 | 2012-01-24 17:36:34 -0800 | [diff] [blame] | 2957 | spin_lock_irqsave(&c->lock, flags); |
| 2958 | if (rdi->enabled) { |
| 2959 | ret = clk_enable(mux_map[rate]); |
| 2960 | if (ret) { |
| 2961 | spin_unlock_irqrestore(&c->lock, flags); |
| 2962 | clk_unprepare(mux_map[rate]); |
| 2963 | goto err; |
| 2964 | } |
| 2965 | } |
| 2966 | spin_lock(&local_clock_reg_lock); |
Matt Wagantall | f82f294 | 2012-01-27 13:56:13 -0800 | [diff] [blame] | 2967 | reg = readl_relaxed(rdi->s2_reg); |
| 2968 | reg &= ~rdi->s2_mask; |
| 2969 | reg |= rate == 2 ? rdi->s2_mask : 0; |
| 2970 | writel_relaxed(reg, rdi->s2_reg); |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 2971 | /* |
| 2972 | * Wait at least 6 cycles of slowest clock |
| 2973 | * for the glitch-free MUX to fully switch sources. |
| 2974 | */ |
| 2975 | mb(); |
| 2976 | udelay(1); |
Matt Wagantall | f82f294 | 2012-01-27 13:56:13 -0800 | [diff] [blame] | 2977 | reg = readl_relaxed(rdi->s_reg); |
| 2978 | reg &= ~rdi->s_mask; |
| 2979 | reg |= rate == 1 ? rdi->s_mask : 0; |
| 2980 | writel_relaxed(reg, rdi->s_reg); |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 2981 | /* |
| 2982 | * Wait at least 6 cycles of slowest clock |
| 2983 | * for the glitch-free MUX to fully switch sources. |
| 2984 | */ |
| 2985 | mb(); |
| 2986 | udelay(1); |
Matt Wagantall | f82f294 | 2012-01-27 13:56:13 -0800 | [diff] [blame] | 2987 | rdi->cur_rate = rate; |
Saravana Kannan | 7a6532e | 2012-10-18 20:51:13 -0700 | [diff] [blame] | 2988 | c->parent = mux_map[rate]; |
Stephen Boyd | d86d1f2 | 2012-01-24 17:36:34 -0800 | [diff] [blame] | 2989 | spin_unlock(&local_clock_reg_lock); |
| 2990 | |
| 2991 | if (rdi->enabled) |
| 2992 | clk_disable(mux_map[old_rate]); |
| 2993 | spin_unlock_irqrestore(&c->lock, flags); |
| 2994 | if (rdi->prepared) |
| 2995 | clk_unprepare(mux_map[old_rate]); |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 2996 | err: |
| 2997 | for (i--; i >= 0; i--) |
Stephen Boyd | d86d1f2 | 2012-01-24 17:36:34 -0800 | [diff] [blame] | 2998 | clk_disable_unprepare(mux_map[i]); |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 2999 | |
| 3000 | return 0; |
| 3001 | } |
| 3002 | |
Matt Wagantall | 9de3bfb | 2011-11-03 20:13:12 -0700 | [diff] [blame] | 3003 | static unsigned long pix_rdi_clk_get_rate(struct clk *c) |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 3004 | { |
| 3005 | return to_pix_rdi_clk(c)->cur_rate; |
| 3006 | } |
| 3007 | |
Stephen Boyd | d86d1f2 | 2012-01-24 17:36:34 -0800 | [diff] [blame] | 3008 | static int pix_rdi_clk_prepare(struct clk *c) |
| 3009 | { |
| 3010 | struct pix_rdi_clk *rdi = to_pix_rdi_clk(c); |
| 3011 | rdi->prepared = true; |
| 3012 | return 0; |
| 3013 | } |
| 3014 | |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 3015 | static int pix_rdi_clk_enable(struct clk *c) |
| 3016 | { |
| 3017 | unsigned long flags; |
Matt Wagantall | f82f294 | 2012-01-27 13:56:13 -0800 | [diff] [blame] | 3018 | struct pix_rdi_clk *rdi = to_pix_rdi_clk(c); |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 3019 | |
| 3020 | spin_lock_irqsave(&local_clock_reg_lock, flags); |
Matt Wagantall | 0de1b3f | 2012-06-05 19:52:43 -0700 | [diff] [blame] | 3021 | __branch_enable_reg(&rdi->b, rdi->c.dbg_name); |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 3022 | spin_unlock_irqrestore(&local_clock_reg_lock, flags); |
Matt Wagantall | f82f294 | 2012-01-27 13:56:13 -0800 | [diff] [blame] | 3023 | rdi->enabled = true; |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 3024 | |
| 3025 | return 0; |
| 3026 | } |
| 3027 | |
| 3028 | static void pix_rdi_clk_disable(struct clk *c) |
| 3029 | { |
| 3030 | unsigned long flags; |
Matt Wagantall | f82f294 | 2012-01-27 13:56:13 -0800 | [diff] [blame] | 3031 | struct pix_rdi_clk *rdi = to_pix_rdi_clk(c); |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 3032 | |
| 3033 | spin_lock_irqsave(&local_clock_reg_lock, flags); |
Matt Wagantall | 0de1b3f | 2012-06-05 19:52:43 -0700 | [diff] [blame] | 3034 | __branch_disable_reg(&rdi->b, rdi->c.dbg_name); |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 3035 | spin_unlock_irqrestore(&local_clock_reg_lock, flags); |
Matt Wagantall | f82f294 | 2012-01-27 13:56:13 -0800 | [diff] [blame] | 3036 | rdi->enabled = false; |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 3037 | } |
| 3038 | |
Stephen Boyd | d86d1f2 | 2012-01-24 17:36:34 -0800 | [diff] [blame] | 3039 | static void pix_rdi_clk_unprepare(struct clk *c) |
| 3040 | { |
| 3041 | struct pix_rdi_clk *rdi = to_pix_rdi_clk(c); |
| 3042 | rdi->prepared = false; |
| 3043 | } |
| 3044 | |
Matt Wagantall | f82f294 | 2012-01-27 13:56:13 -0800 | [diff] [blame] | 3045 | static int pix_rdi_clk_reset(struct clk *c, enum clk_reset_action action) |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 3046 | { |
Matt Wagantall | f82f294 | 2012-01-27 13:56:13 -0800 | [diff] [blame] | 3047 | return branch_reset(&to_pix_rdi_clk(c)->b, action); |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 3048 | } |
| 3049 | |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 3050 | static int pix_rdi_clk_list_rate(struct clk *c, unsigned n) |
| 3051 | { |
| 3052 | if (pix_rdi_mux_map[n]) |
| 3053 | return n; |
| 3054 | return -ENXIO; |
| 3055 | } |
| 3056 | |
Saravana Kannan | c85ecf9 | 2013-01-21 17:58:35 -0800 | [diff] [blame] | 3057 | static struct clk *pix_rdi_clk_get_parent(struct clk *c) |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 3058 | { |
| 3059 | u32 reg; |
Matt Wagantall | f82f294 | 2012-01-27 13:56:13 -0800 | [diff] [blame] | 3060 | struct pix_rdi_clk *rdi = to_pix_rdi_clk(c); |
Saravana Kannan | c85ecf9 | 2013-01-21 17:58:35 -0800 | [diff] [blame] | 3061 | |
| 3062 | reg = readl_relaxed(rdi->s_reg); |
| 3063 | rdi->cur_rate = reg & rdi->s_mask ? 1 : 0; |
| 3064 | reg = readl_relaxed(rdi->s2_reg); |
| 3065 | rdi->cur_rate = reg & rdi->s2_mask ? 2 : rdi->cur_rate; |
| 3066 | |
| 3067 | return pix_rdi_mux_map[rdi->cur_rate]; |
| 3068 | } |
| 3069 | |
| 3070 | static enum handoff pix_rdi_clk_handoff(struct clk *c) |
| 3071 | { |
| 3072 | struct pix_rdi_clk *rdi = to_pix_rdi_clk(c); |
Matt Wagantall | a15833b | 2012-04-03 11:00:56 -0700 | [diff] [blame] | 3073 | enum handoff ret; |
| 3074 | |
Matt Wagantall | f82f294 | 2012-01-27 13:56:13 -0800 | [diff] [blame] | 3075 | ret = branch_handoff(&rdi->b, &rdi->c); |
Matt Wagantall | a15833b | 2012-04-03 11:00:56 -0700 | [diff] [blame] | 3076 | if (ret == HANDOFF_DISABLED_CLK) |
| 3077 | return ret; |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 3078 | |
Saravana Kannan | c85ecf9 | 2013-01-21 17:58:35 -0800 | [diff] [blame] | 3079 | rdi->prepared = true; |
| 3080 | rdi->enabled = true; |
Matt Wagantall | a15833b | 2012-04-03 11:00:56 -0700 | [diff] [blame] | 3081 | return HANDOFF_ENABLED_CLK; |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 3082 | } |
| 3083 | |
| 3084 | static struct clk_ops clk_ops_pix_rdi_8960 = { |
Stephen Boyd | d86d1f2 | 2012-01-24 17:36:34 -0800 | [diff] [blame] | 3085 | .prepare = pix_rdi_clk_prepare, |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 3086 | .enable = pix_rdi_clk_enable, |
| 3087 | .disable = pix_rdi_clk_disable, |
Stephen Boyd | d86d1f2 | 2012-01-24 17:36:34 -0800 | [diff] [blame] | 3088 | .unprepare = pix_rdi_clk_unprepare, |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 3089 | .handoff = pix_rdi_clk_handoff, |
| 3090 | .set_rate = pix_rdi_clk_set_rate, |
| 3091 | .get_rate = pix_rdi_clk_get_rate, |
| 3092 | .list_rate = pix_rdi_clk_list_rate, |
| 3093 | .reset = pix_rdi_clk_reset, |
Saravana Kannan | c85ecf9 | 2013-01-21 17:58:35 -0800 | [diff] [blame] | 3094 | .get_parent = pix_rdi_clk_get_parent, |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 3095 | }; |
| 3096 | |
| 3097 | static struct pix_rdi_clk csi_pix_clk = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3098 | .b = { |
| 3099 | .ctl_reg = MISC_CC_REG, |
| 3100 | .en_mask = BIT(26), |
| 3101 | .halt_check = DELAY, |
| 3102 | .reset_reg = SW_RESET_CORE_REG, |
| 3103 | .reset_mask = BIT(26), |
| 3104 | }, |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 3105 | .s_reg = MISC_CC_REG, |
| 3106 | .s_mask = BIT(25), |
| 3107 | .s2_reg = MISC_CC3_REG, |
| 3108 | .s2_mask = BIT(13), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3109 | .c = { |
| 3110 | .dbg_name = "csi_pix_clk", |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 3111 | .ops = &clk_ops_pix_rdi_8960, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3112 | CLK_INIT(csi_pix_clk.c), |
| 3113 | }, |
| 3114 | }; |
| 3115 | |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 3116 | static struct pix_rdi_clk csi_pix1_clk = { |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 3117 | .b = { |
| 3118 | .ctl_reg = MISC_CC3_REG, |
| 3119 | .en_mask = BIT(10), |
| 3120 | .halt_check = DELAY, |
| 3121 | .reset_reg = SW_RESET_CORE_REG, |
| 3122 | .reset_mask = BIT(30), |
| 3123 | }, |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 3124 | .s_reg = MISC_CC3_REG, |
| 3125 | .s_mask = BIT(8), |
| 3126 | .s2_reg = MISC_CC3_REG, |
| 3127 | .s2_mask = BIT(9), |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 3128 | .c = { |
| 3129 | .dbg_name = "csi_pix1_clk", |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 3130 | .ops = &clk_ops_pix_rdi_8960, |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 3131 | CLK_INIT(csi_pix1_clk.c), |
| 3132 | }, |
| 3133 | }; |
| 3134 | |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 3135 | static struct pix_rdi_clk csi_rdi_clk = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3136 | .b = { |
| 3137 | .ctl_reg = MISC_CC_REG, |
| 3138 | .en_mask = BIT(13), |
| 3139 | .halt_check = DELAY, |
| 3140 | .reset_reg = SW_RESET_CORE_REG, |
| 3141 | .reset_mask = BIT(27), |
| 3142 | }, |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 3143 | .s_reg = MISC_CC_REG, |
| 3144 | .s_mask = BIT(12), |
| 3145 | .s2_reg = MISC_CC3_REG, |
| 3146 | .s2_mask = BIT(12), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3147 | .c = { |
| 3148 | .dbg_name = "csi_rdi_clk", |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 3149 | .ops = &clk_ops_pix_rdi_8960, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3150 | CLK_INIT(csi_rdi_clk.c), |
| 3151 | }, |
| 3152 | }; |
| 3153 | |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 3154 | static struct pix_rdi_clk csi_rdi1_clk = { |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 3155 | .b = { |
| 3156 | .ctl_reg = MISC_CC3_REG, |
| 3157 | .en_mask = BIT(2), |
| 3158 | .halt_check = DELAY, |
| 3159 | .reset_reg = SW_RESET_CORE2_REG, |
| 3160 | .reset_mask = BIT(1), |
| 3161 | }, |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 3162 | .s_reg = MISC_CC3_REG, |
| 3163 | .s_mask = BIT(0), |
| 3164 | .s2_reg = MISC_CC3_REG, |
| 3165 | .s2_mask = BIT(1), |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 3166 | .c = { |
| 3167 | .dbg_name = "csi_rdi1_clk", |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 3168 | .ops = &clk_ops_pix_rdi_8960, |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 3169 | CLK_INIT(csi_rdi1_clk.c), |
| 3170 | }, |
| 3171 | }; |
| 3172 | |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 3173 | static struct pix_rdi_clk csi_rdi2_clk = { |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 3174 | .b = { |
| 3175 | .ctl_reg = MISC_CC3_REG, |
| 3176 | .en_mask = BIT(6), |
| 3177 | .halt_check = DELAY, |
| 3178 | .reset_reg = SW_RESET_CORE2_REG, |
| 3179 | .reset_mask = BIT(0), |
| 3180 | }, |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 3181 | .s_reg = MISC_CC3_REG, |
| 3182 | .s_mask = BIT(4), |
| 3183 | .s2_reg = MISC_CC3_REG, |
| 3184 | .s2_mask = BIT(5), |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 3185 | .c = { |
| 3186 | .dbg_name = "csi_rdi2_clk", |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 3187 | .ops = &clk_ops_pix_rdi_8960, |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 3188 | CLK_INIT(csi_rdi2_clk.c), |
| 3189 | }, |
| 3190 | }; |
| 3191 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3192 | #define F_CSI_PHYTIMER(f, s, d, m, n) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3193 | { \ |
| 3194 | .freq_hz = f, \ |
| 3195 | .src_clk = &s##_clk.c, \ |
| 3196 | .md_val = MD8(8, m, 0, n), \ |
| 3197 | .ns_val = NS_MM(31, 24, n, m, 15, 14, d, 2, 0, s##_to_mm_mux), \ |
| 3198 | .ctl_val = CC(6, n), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3199 | } |
| 3200 | static struct clk_freq_tbl clk_tbl_csi_phytimer[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3201 | F_CSI_PHYTIMER( 0, gnd, 1, 0, 0), |
| 3202 | F_CSI_PHYTIMER( 85330000, pll8, 1, 2, 9), |
| 3203 | F_CSI_PHYTIMER(177780000, pll2, 1, 2, 9), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3204 | F_END |
| 3205 | }; |
| 3206 | |
| 3207 | static struct rcg_clk csiphy_timer_src_clk = { |
| 3208 | .ns_reg = CSIPHYTIMER_NS_REG, |
| 3209 | .b = { |
| 3210 | .ctl_reg = CSIPHYTIMER_CC_REG, |
| 3211 | .halt_check = NOCHECK, |
| 3212 | }, |
| 3213 | .md_reg = CSIPHYTIMER_MD_REG, |
| 3214 | .root_en_mask = BIT(2), |
| 3215 | .ns_mask = (BM(31, 24) | BM(15, 14) | BM(2, 0)), |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame] | 3216 | .mnd_en_mask = BIT(5), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3217 | .ctl_mask = BM(7, 6), |
| 3218 | .set_rate = set_rate_mnd_8, |
| 3219 | .freq_tbl = clk_tbl_csi_phytimer, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 3220 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3221 | .c = { |
| 3222 | .dbg_name = "csiphy_timer_src_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 3223 | .ops = &clk_ops_rcg, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3224 | VDD_DIG_FMAX_MAP2(LOW, 86000000, NOMINAL, 178000000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3225 | CLK_INIT(csiphy_timer_src_clk.c), |
| 3226 | }, |
| 3227 | }; |
| 3228 | |
| 3229 | static struct branch_clk csi0phy_timer_clk = { |
| 3230 | .b = { |
| 3231 | .ctl_reg = CSIPHYTIMER_CC_REG, |
| 3232 | .en_mask = BIT(0), |
| 3233 | .halt_reg = DBG_BUS_VEC_I_REG, |
| 3234 | .halt_bit = 17, |
| 3235 | }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3236 | .c = { |
Saravana Kannan | 7a6532e | 2012-10-18 20:51:13 -0700 | [diff] [blame] | 3237 | .parent = &csiphy_timer_src_clk.c, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3238 | .dbg_name = "csi0phy_timer_clk", |
| 3239 | .ops = &clk_ops_branch, |
| 3240 | CLK_INIT(csi0phy_timer_clk.c), |
| 3241 | }, |
| 3242 | }; |
| 3243 | |
| 3244 | static struct branch_clk csi1phy_timer_clk = { |
| 3245 | .b = { |
| 3246 | .ctl_reg = CSIPHYTIMER_CC_REG, |
| 3247 | .en_mask = BIT(9), |
| 3248 | .halt_reg = DBG_BUS_VEC_I_REG, |
| 3249 | .halt_bit = 18, |
| 3250 | }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3251 | .c = { |
Saravana Kannan | 7a6532e | 2012-10-18 20:51:13 -0700 | [diff] [blame] | 3252 | .parent = &csiphy_timer_src_clk.c, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3253 | .dbg_name = "csi1phy_timer_clk", |
| 3254 | .ops = &clk_ops_branch, |
| 3255 | CLK_INIT(csi1phy_timer_clk.c), |
| 3256 | }, |
| 3257 | }; |
| 3258 | |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 3259 | static struct branch_clk csi2phy_timer_clk = { |
| 3260 | .b = { |
| 3261 | .ctl_reg = CSIPHYTIMER_CC_REG, |
| 3262 | .en_mask = BIT(11), |
| 3263 | .halt_reg = DBG_BUS_VEC_I_REG, |
| 3264 | .halt_bit = 30, |
| 3265 | }, |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 3266 | .c = { |
Saravana Kannan | 7a6532e | 2012-10-18 20:51:13 -0700 | [diff] [blame] | 3267 | .parent = &csiphy_timer_src_clk.c, |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 3268 | .dbg_name = "csi2phy_timer_clk", |
| 3269 | .ops = &clk_ops_branch, |
| 3270 | CLK_INIT(csi2phy_timer_clk.c), |
| 3271 | }, |
| 3272 | }; |
| 3273 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3274 | #define F_DSI(d) \ |
| 3275 | { \ |
| 3276 | .freq_hz = d, \ |
| 3277 | .ns_val = BVAL(15, 12, (d-1)), \ |
| 3278 | } |
| 3279 | /* |
| 3280 | * The DSI_BYTE/ESC clock is sourced from the DSI PHY PLL, which may change rate |
| 3281 | * without this clock driver knowing. So, overload the clk_set_rate() to set |
| 3282 | * the divider (1 to 16) of the clock with respect to the PLL rate. |
| 3283 | */ |
| 3284 | static struct clk_freq_tbl clk_tbl_dsi_byte[] = { |
| 3285 | F_DSI(1), F_DSI(2), F_DSI(3), F_DSI(4), |
| 3286 | F_DSI(5), F_DSI(6), F_DSI(7), F_DSI(8), |
| 3287 | F_DSI(9), F_DSI(10), F_DSI(11), F_DSI(12), |
| 3288 | F_DSI(13), F_DSI(14), F_DSI(15), F_DSI(16), |
| 3289 | F_END |
| 3290 | }; |
| 3291 | |
Matt Wagantall | 735e41b | 2012-07-23 17:18:58 -0700 | [diff] [blame] | 3292 | static struct branch_clk dsi1_reset_clk = { |
| 3293 | .b = { |
| 3294 | .reset_reg = SW_RESET_CORE_REG, |
| 3295 | .reset_mask = BIT(7), |
| 3296 | .halt_check = NOCHECK, |
| 3297 | }, |
| 3298 | .c = { |
| 3299 | .dbg_name = "dsi1_reset_clk", |
| 3300 | .ops = &clk_ops_branch, |
| 3301 | CLK_INIT(dsi1_reset_clk.c), |
| 3302 | }, |
| 3303 | }; |
| 3304 | |
| 3305 | static struct branch_clk dsi2_reset_clk = { |
| 3306 | .b = { |
| 3307 | .reset_reg = SW_RESET_CORE_REG, |
| 3308 | .reset_mask = BIT(25), |
| 3309 | .halt_check = NOCHECK, |
| 3310 | }, |
| 3311 | .c = { |
| 3312 | .dbg_name = "dsi2_reset_clk", |
| 3313 | .ops = &clk_ops_branch, |
| 3314 | CLK_INIT(dsi2_reset_clk.c), |
| 3315 | }, |
| 3316 | }; |
| 3317 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3318 | static struct rcg_clk dsi1_byte_clk = { |
| 3319 | .b = { |
| 3320 | .ctl_reg = DSI1_BYTE_CC_REG, |
| 3321 | .en_mask = BIT(0), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3322 | .halt_reg = DBG_BUS_VEC_B_REG, |
| 3323 | .halt_bit = 21, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 3324 | .retain_reg = DSI1_BYTE_CC_REG, |
| 3325 | .retain_mask = BIT(31), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3326 | }, |
| 3327 | .ns_reg = DSI1_BYTE_NS_REG, |
| 3328 | .root_en_mask = BIT(2), |
| 3329 | .ns_mask = BM(15, 12), |
| 3330 | .set_rate = set_rate_nop, |
| 3331 | .freq_tbl = clk_tbl_dsi_byte, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 3332 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3333 | .c = { |
| 3334 | .dbg_name = "dsi1_byte_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 3335 | .ops = &clk_ops_rcg, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3336 | CLK_INIT(dsi1_byte_clk.c), |
| 3337 | }, |
| 3338 | }; |
| 3339 | |
| 3340 | static struct rcg_clk dsi2_byte_clk = { |
| 3341 | .b = { |
| 3342 | .ctl_reg = DSI2_BYTE_CC_REG, |
| 3343 | .en_mask = BIT(0), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3344 | .halt_reg = DBG_BUS_VEC_B_REG, |
| 3345 | .halt_bit = 20, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 3346 | .retain_reg = DSI2_BYTE_CC_REG, |
| 3347 | .retain_mask = BIT(31), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3348 | }, |
| 3349 | .ns_reg = DSI2_BYTE_NS_REG, |
| 3350 | .root_en_mask = BIT(2), |
| 3351 | .ns_mask = BM(15, 12), |
| 3352 | .set_rate = set_rate_nop, |
| 3353 | .freq_tbl = clk_tbl_dsi_byte, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 3354 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3355 | .c = { |
| 3356 | .dbg_name = "dsi2_byte_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 3357 | .ops = &clk_ops_rcg, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3358 | CLK_INIT(dsi2_byte_clk.c), |
| 3359 | }, |
| 3360 | }; |
| 3361 | |
| 3362 | static struct rcg_clk dsi1_esc_clk = { |
| 3363 | .b = { |
| 3364 | .ctl_reg = DSI1_ESC_CC_REG, |
| 3365 | .en_mask = BIT(0), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3366 | .halt_reg = DBG_BUS_VEC_I_REG, |
| 3367 | .halt_bit = 1, |
| 3368 | }, |
| 3369 | .ns_reg = DSI1_ESC_NS_REG, |
| 3370 | .root_en_mask = BIT(2), |
| 3371 | .ns_mask = BM(15, 12), |
| 3372 | .set_rate = set_rate_nop, |
| 3373 | .freq_tbl = clk_tbl_dsi_byte, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 3374 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3375 | .c = { |
| 3376 | .dbg_name = "dsi1_esc_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 3377 | .ops = &clk_ops_rcg, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3378 | CLK_INIT(dsi1_esc_clk.c), |
| 3379 | }, |
| 3380 | }; |
| 3381 | |
| 3382 | static struct rcg_clk dsi2_esc_clk = { |
| 3383 | .b = { |
| 3384 | .ctl_reg = DSI2_ESC_CC_REG, |
| 3385 | .en_mask = BIT(0), |
| 3386 | .halt_reg = DBG_BUS_VEC_I_REG, |
| 3387 | .halt_bit = 3, |
| 3388 | }, |
| 3389 | .ns_reg = DSI2_ESC_NS_REG, |
| 3390 | .root_en_mask = BIT(2), |
| 3391 | .ns_mask = BM(15, 12), |
| 3392 | .set_rate = set_rate_nop, |
| 3393 | .freq_tbl = clk_tbl_dsi_byte, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 3394 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3395 | .c = { |
| 3396 | .dbg_name = "dsi2_esc_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 3397 | .ops = &clk_ops_rcg, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3398 | CLK_INIT(dsi2_esc_clk.c), |
| 3399 | }, |
| 3400 | }; |
| 3401 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3402 | #define F_GFX2D(f, s, m, n) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3403 | { \ |
| 3404 | .freq_hz = f, \ |
| 3405 | .src_clk = &s##_clk.c, \ |
| 3406 | .md_val = MD4(4, m, 0, n), \ |
| 3407 | .ns_val = NS_MND_BANKED4(20, 16, n, m, 3, 0, s##_to_mm_mux), \ |
| 3408 | .ctl_val = CC_BANKED(9, 6, n), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3409 | } |
| 3410 | static struct clk_freq_tbl clk_tbl_gfx2d[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3411 | F_GFX2D( 0, gnd, 0, 0), |
| 3412 | F_GFX2D( 27000000, pxo, 0, 0), |
| 3413 | F_GFX2D( 48000000, pll8, 1, 8), |
| 3414 | F_GFX2D( 54857000, pll8, 1, 7), |
| 3415 | F_GFX2D( 64000000, pll8, 1, 6), |
| 3416 | F_GFX2D( 76800000, pll8, 1, 5), |
| 3417 | F_GFX2D( 96000000, pll8, 1, 4), |
| 3418 | F_GFX2D(128000000, pll8, 1, 3), |
| 3419 | F_GFX2D(145455000, pll2, 2, 11), |
| 3420 | F_GFX2D(160000000, pll2, 1, 5), |
| 3421 | F_GFX2D(177778000, pll2, 2, 9), |
| 3422 | F_GFX2D(200000000, pll2, 1, 4), |
| 3423 | F_GFX2D(228571000, pll2, 2, 7), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3424 | F_END |
| 3425 | }; |
| 3426 | |
| 3427 | static struct bank_masks bmnd_info_gfx2d0 = { |
| 3428 | .bank_sel_mask = BIT(11), |
| 3429 | .bank0_mask = { |
| 3430 | .md_reg = GFX2D0_MD0_REG, |
| 3431 | .ns_mask = BM(23, 20) | BM(5, 3), |
| 3432 | .rst_mask = BIT(25), |
| 3433 | .mnd_en_mask = BIT(8), |
| 3434 | .mode_mask = BM(10, 9), |
| 3435 | }, |
| 3436 | .bank1_mask = { |
| 3437 | .md_reg = GFX2D0_MD1_REG, |
| 3438 | .ns_mask = BM(19, 16) | BM(2, 0), |
| 3439 | .rst_mask = BIT(24), |
| 3440 | .mnd_en_mask = BIT(5), |
| 3441 | .mode_mask = BM(7, 6), |
| 3442 | }, |
| 3443 | }; |
| 3444 | |
| 3445 | static struct rcg_clk gfx2d0_clk = { |
| 3446 | .b = { |
| 3447 | .ctl_reg = GFX2D0_CC_REG, |
| 3448 | .en_mask = BIT(0), |
| 3449 | .reset_reg = SW_RESET_CORE_REG, |
| 3450 | .reset_mask = BIT(14), |
| 3451 | .halt_reg = DBG_BUS_VEC_A_REG, |
| 3452 | .halt_bit = 9, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 3453 | .retain_reg = GFX2D0_CC_REG, |
| 3454 | .retain_mask = BIT(31), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3455 | }, |
| 3456 | .ns_reg = GFX2D0_NS_REG, |
| 3457 | .root_en_mask = BIT(2), |
| 3458 | .set_rate = set_rate_mnd_banked, |
| 3459 | .freq_tbl = clk_tbl_gfx2d, |
Stephen Boyd | c78d9a7 | 2011-07-20 00:46:24 -0700 | [diff] [blame] | 3460 | .bank_info = &bmnd_info_gfx2d0, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 3461 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3462 | .c = { |
| 3463 | .dbg_name = "gfx2d0_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 3464 | .ops = &clk_ops_rcg, |
Matt Wagantall | 158f73b | 2012-05-16 11:29:35 -0700 | [diff] [blame] | 3465 | .flags = CLKFLAG_SKIP_HANDOFF, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3466 | VDD_DIG_FMAX_MAP3(LOW, 100000000, NOMINAL, 200000000, |
| 3467 | HIGH, 228571000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3468 | CLK_INIT(gfx2d0_clk.c), |
| 3469 | }, |
| 3470 | }; |
| 3471 | |
| 3472 | static struct bank_masks bmnd_info_gfx2d1 = { |
| 3473 | .bank_sel_mask = BIT(11), |
| 3474 | .bank0_mask = { |
| 3475 | .md_reg = GFX2D1_MD0_REG, |
| 3476 | .ns_mask = BM(23, 20) | BM(5, 3), |
| 3477 | .rst_mask = BIT(25), |
| 3478 | .mnd_en_mask = BIT(8), |
| 3479 | .mode_mask = BM(10, 9), |
| 3480 | }, |
| 3481 | .bank1_mask = { |
| 3482 | .md_reg = GFX2D1_MD1_REG, |
| 3483 | .ns_mask = BM(19, 16) | BM(2, 0), |
| 3484 | .rst_mask = BIT(24), |
| 3485 | .mnd_en_mask = BIT(5), |
| 3486 | .mode_mask = BM(7, 6), |
| 3487 | }, |
| 3488 | }; |
| 3489 | |
| 3490 | static struct rcg_clk gfx2d1_clk = { |
| 3491 | .b = { |
| 3492 | .ctl_reg = GFX2D1_CC_REG, |
| 3493 | .en_mask = BIT(0), |
| 3494 | .reset_reg = SW_RESET_CORE_REG, |
| 3495 | .reset_mask = BIT(13), |
| 3496 | .halt_reg = DBG_BUS_VEC_A_REG, |
| 3497 | .halt_bit = 14, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 3498 | .retain_reg = GFX2D1_CC_REG, |
| 3499 | .retain_mask = BIT(31), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3500 | }, |
| 3501 | .ns_reg = GFX2D1_NS_REG, |
| 3502 | .root_en_mask = BIT(2), |
| 3503 | .set_rate = set_rate_mnd_banked, |
| 3504 | .freq_tbl = clk_tbl_gfx2d, |
Stephen Boyd | c78d9a7 | 2011-07-20 00:46:24 -0700 | [diff] [blame] | 3505 | .bank_info = &bmnd_info_gfx2d1, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 3506 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3507 | .c = { |
| 3508 | .dbg_name = "gfx2d1_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 3509 | .ops = &clk_ops_rcg, |
Matt Wagantall | 158f73b | 2012-05-16 11:29:35 -0700 | [diff] [blame] | 3510 | .flags = CLKFLAG_SKIP_HANDOFF, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3511 | VDD_DIG_FMAX_MAP3(LOW, 100000000, NOMINAL, 200000000, |
| 3512 | HIGH, 228571000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3513 | CLK_INIT(gfx2d1_clk.c), |
| 3514 | }, |
| 3515 | }; |
| 3516 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3517 | #define F_GFX3D(f, s, m, n) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3518 | { \ |
| 3519 | .freq_hz = f, \ |
| 3520 | .src_clk = &s##_clk.c, \ |
| 3521 | .md_val = MD4(4, m, 0, n), \ |
| 3522 | .ns_val = NS_MND_BANKED4(18, 14, n, m, 3, 0, s##_to_mm_mux), \ |
| 3523 | .ctl_val = CC_BANKED(9, 6, n), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3524 | } |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 3525 | |
Patrick Daly | aa61456 | 2013-01-23 16:39:45 -0800 | [diff] [blame] | 3526 | /*Shared by 8064, and 8930*/ |
Patrick Daly | 2c09c4c | 2012-10-25 19:47:56 -0700 | [diff] [blame] | 3527 | static struct clk_freq_tbl clk_tbl_gfx3d[] = { |
| 3528 | F_GFX3D( 0, gnd, 0, 0), |
| 3529 | F_GFX3D( 27000000, pxo, 0, 0), |
| 3530 | F_GFX3D( 48000000, pll8, 1, 8), |
| 3531 | F_GFX3D( 54857000, pll8, 1, 7), |
| 3532 | F_GFX3D( 64000000, pll8, 1, 6), |
| 3533 | F_GFX3D( 76800000, pll8, 1, 5), |
| 3534 | F_GFX3D( 96000000, pll8, 1, 4), |
| 3535 | F_GFX3D(128000000, pll8, 1, 3), |
| 3536 | F_GFX3D(145455000, pll2, 2, 11), |
| 3537 | F_GFX3D(160000000, pll2, 1, 5), |
| 3538 | F_GFX3D(177778000, pll2, 2, 9), |
| 3539 | F_GFX3D(192000000, pll8, 1, 2), |
| 3540 | F_GFX3D(200000000, pll2, 1, 4), |
| 3541 | F_GFX3D(228571000, pll2, 2, 7), |
| 3542 | F_GFX3D(266667000, pll2, 1, 3), |
| 3543 | F_GFX3D(320000000, pll2, 2, 5), |
| 3544 | F_GFX3D(400000000, pll2, 1, 2), |
| 3545 | F_GFX3D(450000000, pll15, 1, 2), |
Patrick Daly | e6f48904 | 2012-07-11 15:29:15 -0700 | [diff] [blame] | 3546 | F_END |
| 3547 | }; |
| 3548 | |
Patrick Daly | aa61456 | 2013-01-23 16:39:45 -0800 | [diff] [blame] | 3549 | static struct clk_freq_tbl clk_tbl_gfx3d_8960ab[] = { |
| 3550 | F_GFX3D( 0, gnd, 0, 0), |
| 3551 | F_GFX3D( 27000000, pxo, 0, 0), |
| 3552 | F_GFX3D( 48000000, pll8, 1, 8), |
| 3553 | F_GFX3D( 54857000, pll8, 1, 7), |
| 3554 | F_GFX3D( 64000000, pll8, 1, 6), |
| 3555 | F_GFX3D( 76800000, pll8, 1, 5), |
| 3556 | F_GFX3D( 96000000, pll8, 1, 4), |
| 3557 | F_GFX3D(128000000, pll8, 1, 3), |
| 3558 | F_GFX3D(145455000, pll2, 2, 11), |
| 3559 | F_GFX3D(160000000, pll2, 1, 5), |
| 3560 | F_GFX3D(177778000, pll2, 2, 9), |
| 3561 | F_GFX3D(192000000, pll8, 1, 2), |
| 3562 | F_GFX3D(200000000, pll2, 1, 4), |
| 3563 | F_GFX3D(228571000, pll2, 2, 7), |
| 3564 | F_GFX3D(266667000, pll2, 1, 3), |
| 3565 | F_GFX3D(320000000, pll2, 2, 5), |
| 3566 | F_GFX3D(400000000, pll2, 1, 2), |
| 3567 | F_GFX3D(440000000, pll3, 1, 2), |
| 3568 | F_END |
| 3569 | }; |
| 3570 | |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 3571 | static struct clk_freq_tbl clk_tbl_gfx3d_8960[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3572 | F_GFX3D( 0, gnd, 0, 0), |
| 3573 | F_GFX3D( 27000000, pxo, 0, 0), |
| 3574 | F_GFX3D( 48000000, pll8, 1, 8), |
| 3575 | F_GFX3D( 54857000, pll8, 1, 7), |
| 3576 | F_GFX3D( 64000000, pll8, 1, 6), |
| 3577 | F_GFX3D( 76800000, pll8, 1, 5), |
| 3578 | F_GFX3D( 96000000, pll8, 1, 4), |
| 3579 | F_GFX3D(128000000, pll8, 1, 3), |
| 3580 | F_GFX3D(145455000, pll2, 2, 11), |
| 3581 | F_GFX3D(160000000, pll2, 1, 5), |
| 3582 | F_GFX3D(177778000, pll2, 2, 9), |
| 3583 | F_GFX3D(200000000, pll2, 1, 4), |
| 3584 | F_GFX3D(228571000, pll2, 2, 7), |
| 3585 | F_GFX3D(266667000, pll2, 1, 3), |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3586 | F_GFX3D(300000000, pll3, 1, 4), |
| 3587 | F_GFX3D(320000000, pll2, 2, 5), |
| 3588 | F_GFX3D(400000000, pll2, 1, 2), |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 3589 | F_END |
| 3590 | }; |
| 3591 | |
Seemanta Dutta | 4dc1708 | 2012-10-24 18:37:42 -0700 | [diff] [blame] | 3592 | static struct clk_freq_tbl clk_tbl_gfx3d_8930ab[] = { |
| 3593 | F_GFX3D( 0, gnd, 0, 0), |
| 3594 | F_GFX3D( 27000000, pxo, 0, 0), |
| 3595 | F_GFX3D( 48000000, pll8, 1, 8), |
| 3596 | F_GFX3D( 54857000, pll8, 1, 7), |
| 3597 | F_GFX3D( 64000000, pll8, 1, 6), |
| 3598 | F_GFX3D( 76800000, pll8, 1, 5), |
| 3599 | F_GFX3D( 96000000, pll8, 1, 4), |
| 3600 | F_GFX3D(128000000, pll8, 1, 3), |
| 3601 | F_GFX3D(145455000, pll2, 2, 11), |
| 3602 | F_GFX3D(160000000, pll2, 1, 5), |
| 3603 | F_GFX3D(177778000, pll2, 2, 9), |
| 3604 | F_GFX3D(192000000, pll8, 1, 2), |
| 3605 | F_GFX3D(200000000, pll2, 1, 4), |
| 3606 | F_GFX3D(228571000, pll2, 2, 7), |
| 3607 | F_GFX3D(266667000, pll2, 1, 3), |
| 3608 | F_GFX3D(320000000, pll2, 2, 5), |
| 3609 | F_GFX3D(400000000, pll2, 1, 2), |
| 3610 | F_GFX3D(500000000, pll15, 1, 2), |
| 3611 | F_END |
| 3612 | }; |
| 3613 | |
Saravana Kannan | 55e959d | 2012-10-15 22:16:04 -0700 | [diff] [blame] | 3614 | static unsigned long fmax_gfx3d_8064ab[VDD_DIG_NUM] = { |
Patrick Daly | b7c777a | 2012-08-23 19:07:30 -0700 | [diff] [blame] | 3615 | [VDD_DIG_LOW] = 128000000, |
| 3616 | [VDD_DIG_NOMINAL] = 325000000, |
| 3617 | [VDD_DIG_HIGH] = 450000000 |
| 3618 | }; |
| 3619 | |
Saravana Kannan | 55e959d | 2012-10-15 22:16:04 -0700 | [diff] [blame] | 3620 | static unsigned long fmax_gfx3d_8064[VDD_DIG_NUM] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3621 | [VDD_DIG_LOW] = 128000000, |
| 3622 | [VDD_DIG_NOMINAL] = 325000000, |
| 3623 | [VDD_DIG_HIGH] = 400000000 |
| 3624 | }; |
| 3625 | |
Saravana Kannan | 55e959d | 2012-10-15 22:16:04 -0700 | [diff] [blame] | 3626 | static unsigned long fmax_gfx3d_8930[VDD_DIG_NUM] = { |
Tianyi Gou | 4d33c9c | 2012-03-30 11:10:15 -0700 | [diff] [blame] | 3627 | [VDD_DIG_LOW] = 192000000, |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 3628 | [VDD_DIG_NOMINAL] = 320000000, |
Patrick Daly | ebe63c5 | 2012-08-07 15:41:30 -0700 | [diff] [blame] | 3629 | [VDD_DIG_HIGH] = 400000000 |
| 3630 | }; |
| 3631 | |
Saravana Kannan | 55e959d | 2012-10-15 22:16:04 -0700 | [diff] [blame] | 3632 | static unsigned long fmax_gfx3d_8930aa[VDD_DIG_NUM] = { |
Patrick Daly | ebe63c5 | 2012-08-07 15:41:30 -0700 | [diff] [blame] | 3633 | [VDD_DIG_LOW] = 192000000, |
| 3634 | [VDD_DIG_NOMINAL] = 320000000, |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 3635 | [VDD_DIG_HIGH] = 450000000 |
| 3636 | }; |
| 3637 | |
Seemanta Dutta | 4dc1708 | 2012-10-24 18:37:42 -0700 | [diff] [blame] | 3638 | static unsigned long fmax_gfx3d_8930ab[VDD_DIG_NUM] = { |
| 3639 | [VDD_DIG_LOW] = 192000000, |
| 3640 | [VDD_DIG_NOMINAL] = 320000000, |
| 3641 | [VDD_DIG_HIGH] = 500000000 |
| 3642 | }; |
| 3643 | |
Patrick Daly | aa61456 | 2013-01-23 16:39:45 -0800 | [diff] [blame] | 3644 | static unsigned long fmax_gfx3d_8960ab_400[VDD_DIG_NUM] = { |
Patrick Daly | 6e03432 | 2012-10-26 18:18:32 -0700 | [diff] [blame] | 3645 | [VDD_DIG_LOW] = 192000000, |
| 3646 | [VDD_DIG_NOMINAL] = 325000000, |
| 3647 | [VDD_DIG_HIGH] = 400000000 |
| 3648 | }; |
| 3649 | |
Patrick Daly | aa61456 | 2013-01-23 16:39:45 -0800 | [diff] [blame] | 3650 | static unsigned long fmax_gfx3d_8960ab_440[VDD_DIG_NUM] = { |
| 3651 | [VDD_DIG_LOW] = 192000000, |
| 3652 | [VDD_DIG_NOMINAL] = 325000000, |
| 3653 | [VDD_DIG_HIGH] = 440000000 |
| 3654 | }; |
| 3655 | |
| 3656 | static unsigned long *fmax_gfx3d_8960ab[] = { |
| 3657 | [0] = fmax_gfx3d_8960ab_400, |
| 3658 | [1] = fmax_gfx3d_8960ab_440, |
| 3659 | }; |
| 3660 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3661 | static struct bank_masks bmnd_info_gfx3d = { |
| 3662 | .bank_sel_mask = BIT(11), |
| 3663 | .bank0_mask = { |
| 3664 | .md_reg = GFX3D_MD0_REG, |
| 3665 | .ns_mask = BM(21, 18) | BM(5, 3), |
| 3666 | .rst_mask = BIT(23), |
| 3667 | .mnd_en_mask = BIT(8), |
| 3668 | .mode_mask = BM(10, 9), |
| 3669 | }, |
| 3670 | .bank1_mask = { |
| 3671 | .md_reg = GFX3D_MD1_REG, |
| 3672 | .ns_mask = BM(17, 14) | BM(2, 0), |
| 3673 | .rst_mask = BIT(22), |
| 3674 | .mnd_en_mask = BIT(5), |
| 3675 | .mode_mask = BM(7, 6), |
| 3676 | }, |
| 3677 | }; |
| 3678 | |
| 3679 | static struct rcg_clk gfx3d_clk = { |
| 3680 | .b = { |
| 3681 | .ctl_reg = GFX3D_CC_REG, |
| 3682 | .en_mask = BIT(0), |
| 3683 | .reset_reg = SW_RESET_CORE_REG, |
| 3684 | .reset_mask = BIT(12), |
| 3685 | .halt_reg = DBG_BUS_VEC_A_REG, |
| 3686 | .halt_bit = 4, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 3687 | .retain_reg = GFX3D_CC_REG, |
| 3688 | .retain_mask = BIT(31), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3689 | }, |
| 3690 | .ns_reg = GFX3D_NS_REG, |
| 3691 | .root_en_mask = BIT(2), |
| 3692 | .set_rate = set_rate_mnd_banked, |
Patrick Daly | 2c09c4c | 2012-10-25 19:47:56 -0700 | [diff] [blame] | 3693 | .freq_tbl = clk_tbl_gfx3d, |
Stephen Boyd | c78d9a7 | 2011-07-20 00:46:24 -0700 | [diff] [blame] | 3694 | .bank_info = &bmnd_info_gfx3d, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 3695 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3696 | .c = { |
| 3697 | .dbg_name = "gfx3d_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 3698 | .ops = &clk_ops_rcg, |
Tianyi Gou | 3022dfd | 2012-01-25 15:50:05 -0800 | [diff] [blame] | 3699 | VDD_DIG_FMAX_MAP3(LOW, 128000000, NOMINAL, 300000000, |
| 3700 | HIGH, 400000000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3701 | CLK_INIT(gfx3d_clk.c), |
Stephen Boyd | 7fa2674 | 2011-08-11 23:22:29 -0700 | [diff] [blame] | 3702 | .depends = &gmem_axi_clk.c, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3703 | }, |
| 3704 | }; |
| 3705 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3706 | #define F_VCAP(f, s, m, n) \ |
Tianyi Gou | 621f874 | 2011-09-01 21:45:01 -0700 | [diff] [blame] | 3707 | { \ |
| 3708 | .freq_hz = f, \ |
| 3709 | .src_clk = &s##_clk.c, \ |
| 3710 | .md_val = MD4(4, m, 0, n), \ |
| 3711 | .ns_val = NS_MND_BANKED4(18, 14, n, m, 3, 0, s##_to_mm_mux), \ |
| 3712 | .ctl_val = CC_BANKED(9, 6, n), \ |
Tianyi Gou | 621f874 | 2011-09-01 21:45:01 -0700 | [diff] [blame] | 3713 | } |
| 3714 | |
| 3715 | static struct clk_freq_tbl clk_tbl_vcap[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3716 | F_VCAP( 0, gnd, 0, 0), |
| 3717 | F_VCAP( 27000000, pxo, 0, 0), |
| 3718 | F_VCAP( 54860000, pll8, 1, 7), |
| 3719 | F_VCAP( 64000000, pll8, 1, 6), |
| 3720 | F_VCAP( 76800000, pll8, 1, 5), |
| 3721 | F_VCAP(128000000, pll8, 1, 3), |
| 3722 | F_VCAP(160000000, pll2, 1, 5), |
| 3723 | F_VCAP(200000000, pll2, 1, 4), |
Tianyi Gou | 621f874 | 2011-09-01 21:45:01 -0700 | [diff] [blame] | 3724 | F_END |
| 3725 | }; |
| 3726 | |
| 3727 | static struct bank_masks bmnd_info_vcap = { |
| 3728 | .bank_sel_mask = BIT(11), |
| 3729 | .bank0_mask = { |
| 3730 | .md_reg = VCAP_MD0_REG, |
| 3731 | .ns_mask = BM(21, 18) | BM(5, 3), |
| 3732 | .rst_mask = BIT(23), |
| 3733 | .mnd_en_mask = BIT(8), |
| 3734 | .mode_mask = BM(10, 9), |
| 3735 | }, |
| 3736 | .bank1_mask = { |
| 3737 | .md_reg = VCAP_MD1_REG, |
| 3738 | .ns_mask = BM(17, 14) | BM(2, 0), |
| 3739 | .rst_mask = BIT(22), |
| 3740 | .mnd_en_mask = BIT(5), |
| 3741 | .mode_mask = BM(7, 6), |
| 3742 | }, |
| 3743 | }; |
| 3744 | |
| 3745 | static struct rcg_clk vcap_clk = { |
| 3746 | .b = { |
| 3747 | .ctl_reg = VCAP_CC_REG, |
| 3748 | .en_mask = BIT(0), |
| 3749 | .halt_reg = DBG_BUS_VEC_J_REG, |
| 3750 | .halt_bit = 15, |
| 3751 | }, |
| 3752 | .ns_reg = VCAP_NS_REG, |
| 3753 | .root_en_mask = BIT(2), |
| 3754 | .set_rate = set_rate_mnd_banked, |
| 3755 | .freq_tbl = clk_tbl_vcap, |
| 3756 | .bank_info = &bmnd_info_vcap, |
| 3757 | .current_freq = &rcg_dummy_freq, |
| 3758 | .c = { |
| 3759 | .dbg_name = "vcap_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 3760 | .ops = &clk_ops_rcg, |
Tianyi Gou | 621f874 | 2011-09-01 21:45:01 -0700 | [diff] [blame] | 3761 | .depends = &vcap_axi_clk.c, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3762 | VDD_DIG_FMAX_MAP2(LOW, 100000000, NOMINAL, 200000000), |
Tianyi Gou | 621f874 | 2011-09-01 21:45:01 -0700 | [diff] [blame] | 3763 | CLK_INIT(vcap_clk.c), |
| 3764 | }, |
| 3765 | }; |
| 3766 | |
| 3767 | static struct branch_clk vcap_npl_clk = { |
| 3768 | .b = { |
| 3769 | .ctl_reg = VCAP_CC_REG, |
| 3770 | .en_mask = BIT(13), |
| 3771 | .halt_reg = DBG_BUS_VEC_J_REG, |
| 3772 | .halt_bit = 25, |
| 3773 | }, |
Tianyi Gou | 621f874 | 2011-09-01 21:45:01 -0700 | [diff] [blame] | 3774 | .c = { |
Saravana Kannan | 7a6532e | 2012-10-18 20:51:13 -0700 | [diff] [blame] | 3775 | .parent = &vcap_clk.c, |
Tianyi Gou | 621f874 | 2011-09-01 21:45:01 -0700 | [diff] [blame] | 3776 | .dbg_name = "vcap_npl_clk", |
| 3777 | .ops = &clk_ops_branch, |
| 3778 | CLK_INIT(vcap_npl_clk.c), |
| 3779 | }, |
| 3780 | }; |
| 3781 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3782 | #define F_IJPEG(f, s, d, m, n) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3783 | { \ |
| 3784 | .freq_hz = f, \ |
| 3785 | .src_clk = &s##_clk.c, \ |
| 3786 | .md_val = MD8(8, m, 0, n), \ |
| 3787 | .ns_val = NS_MM(23, 16, n, m, 15, 12, d, 2, 0, s##_to_mm_mux), \ |
| 3788 | .ctl_val = CC(6, n), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3789 | } |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 3790 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3791 | static struct clk_freq_tbl clk_tbl_ijpeg[] = { |
| 3792 | F_IJPEG( 0, gnd, 1, 0, 0), |
| 3793 | F_IJPEG( 27000000, pxo, 1, 0, 0), |
| 3794 | F_IJPEG( 36570000, pll8, 1, 2, 21), |
| 3795 | F_IJPEG( 54860000, pll8, 7, 0, 0), |
| 3796 | F_IJPEG( 96000000, pll8, 4, 0, 0), |
| 3797 | F_IJPEG(109710000, pll8, 1, 2, 7), |
| 3798 | F_IJPEG(128000000, pll8, 3, 0, 0), |
| 3799 | F_IJPEG(153600000, pll8, 1, 2, 5), |
| 3800 | F_IJPEG(200000000, pll2, 4, 0, 0), |
| 3801 | F_IJPEG(228571000, pll2, 1, 2, 7), |
| 3802 | F_IJPEG(266667000, pll2, 1, 1, 3), |
| 3803 | F_IJPEG(320000000, pll2, 1, 2, 5), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3804 | F_END |
| 3805 | }; |
| 3806 | |
Saravana Kannan | 55e959d | 2012-10-15 22:16:04 -0700 | [diff] [blame] | 3807 | static unsigned long fmax_ijpeg_8064[VDD_DIG_NUM] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3808 | [VDD_DIG_LOW] = 128000000, |
| 3809 | [VDD_DIG_NOMINAL] = 266667000, |
| 3810 | [VDD_DIG_HIGH] = 320000000 |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 3811 | }; |
| 3812 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3813 | static struct rcg_clk ijpeg_clk = { |
| 3814 | .b = { |
| 3815 | .ctl_reg = IJPEG_CC_REG, |
| 3816 | .en_mask = BIT(0), |
| 3817 | .reset_reg = SW_RESET_CORE_REG, |
| 3818 | .reset_mask = BIT(9), |
| 3819 | .halt_reg = DBG_BUS_VEC_A_REG, |
| 3820 | .halt_bit = 24, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 3821 | .retain_reg = IJPEG_CC_REG, |
| 3822 | .retain_mask = BIT(31), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3823 | }, |
| 3824 | .ns_reg = IJPEG_NS_REG, |
| 3825 | .md_reg = IJPEG_MD_REG, |
| 3826 | .root_en_mask = BIT(2), |
| 3827 | .ns_mask = (BM(23, 16) | BM(15, 12) | BM(2, 0)), |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame] | 3828 | .mnd_en_mask = BIT(5), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3829 | .ctl_mask = BM(7, 6), |
| 3830 | .set_rate = set_rate_mnd, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3831 | .freq_tbl = clk_tbl_ijpeg, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 3832 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3833 | .c = { |
| 3834 | .dbg_name = "ijpeg_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 3835 | .ops = &clk_ops_rcg, |
Tianyi Gou | 3022dfd | 2012-01-25 15:50:05 -0800 | [diff] [blame] | 3836 | VDD_DIG_FMAX_MAP3(LOW, 110000000, NOMINAL, 266667000, |
| 3837 | HIGH, 320000000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3838 | CLK_INIT(ijpeg_clk.c), |
Stephen Boyd | 7fa2674 | 2011-08-11 23:22:29 -0700 | [diff] [blame] | 3839 | .depends = &ijpeg_axi_clk.c, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3840 | }, |
| 3841 | }; |
| 3842 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3843 | #define F_JPEGD(f, s, d) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3844 | { \ |
| 3845 | .freq_hz = f, \ |
| 3846 | .src_clk = &s##_clk.c, \ |
| 3847 | .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] | 3848 | } |
| 3849 | static struct clk_freq_tbl clk_tbl_jpegd[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3850 | F_JPEGD( 0, gnd, 1), |
| 3851 | F_JPEGD( 64000000, pll8, 6), |
| 3852 | F_JPEGD( 76800000, pll8, 5), |
| 3853 | F_JPEGD( 96000000, pll8, 4), |
| 3854 | F_JPEGD(160000000, pll2, 5), |
| 3855 | F_JPEGD(200000000, pll2, 4), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3856 | F_END |
| 3857 | }; |
| 3858 | |
| 3859 | static struct rcg_clk jpegd_clk = { |
| 3860 | .b = { |
| 3861 | .ctl_reg = JPEGD_CC_REG, |
| 3862 | .en_mask = BIT(0), |
| 3863 | .reset_reg = SW_RESET_CORE_REG, |
| 3864 | .reset_mask = BIT(19), |
| 3865 | .halt_reg = DBG_BUS_VEC_A_REG, |
| 3866 | .halt_bit = 19, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 3867 | .retain_reg = JPEGD_CC_REG, |
| 3868 | .retain_mask = BIT(31), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3869 | }, |
| 3870 | .ns_reg = JPEGD_NS_REG, |
| 3871 | .root_en_mask = BIT(2), |
| 3872 | .ns_mask = (BM(15, 12) | BM(2, 0)), |
| 3873 | .set_rate = set_rate_nop, |
| 3874 | .freq_tbl = clk_tbl_jpegd, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 3875 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3876 | .c = { |
| 3877 | .dbg_name = "jpegd_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 3878 | .ops = &clk_ops_rcg, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3879 | VDD_DIG_FMAX_MAP2(LOW, 96000000, NOMINAL, 200000000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3880 | CLK_INIT(jpegd_clk.c), |
Stephen Boyd | 7fa2674 | 2011-08-11 23:22:29 -0700 | [diff] [blame] | 3881 | .depends = &jpegd_axi_clk.c, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3882 | }, |
| 3883 | }; |
| 3884 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3885 | #define F_MDP(f, s, m, n) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3886 | { \ |
| 3887 | .freq_hz = f, \ |
| 3888 | .src_clk = &s##_clk.c, \ |
| 3889 | .md_val = MD8(8, m, 0, n), \ |
| 3890 | .ns_val = NS_MND_BANKED8(22, 14, n, m, 3, 0, s##_to_mm_mux), \ |
| 3891 | .ctl_val = CC_BANKED(9, 6, n), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3892 | } |
Patrick Daly | e6f48904 | 2012-07-11 15:29:15 -0700 | [diff] [blame] | 3893 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3894 | static struct clk_freq_tbl clk_tbl_mdp[] = { |
| 3895 | F_MDP( 0, gnd, 0, 0), |
| 3896 | F_MDP( 9600000, pll8, 1, 40), |
| 3897 | F_MDP( 13710000, pll8, 1, 28), |
| 3898 | F_MDP( 27000000, pxo, 0, 0), |
| 3899 | F_MDP( 29540000, pll8, 1, 13), |
| 3900 | F_MDP( 34910000, pll8, 1, 11), |
| 3901 | F_MDP( 38400000, pll8, 1, 10), |
| 3902 | F_MDP( 59080000, pll8, 2, 13), |
| 3903 | F_MDP( 76800000, pll8, 1, 5), |
| 3904 | F_MDP( 85330000, pll8, 2, 9), |
| 3905 | F_MDP( 96000000, pll8, 1, 4), |
| 3906 | F_MDP(128000000, pll8, 1, 3), |
| 3907 | F_MDP(160000000, pll2, 1, 5), |
| 3908 | F_MDP(177780000, pll2, 2, 9), |
| 3909 | F_MDP(200000000, pll2, 1, 4), |
Patrick Daly | 6e03432 | 2012-10-26 18:18:32 -0700 | [diff] [blame] | 3910 | F_MDP(228571000, pll2, 2, 7), |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3911 | F_MDP(266667000, pll2, 1, 3), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3912 | F_END |
| 3913 | }; |
| 3914 | |
Saravana Kannan | 55e959d | 2012-10-15 22:16:04 -0700 | [diff] [blame] | 3915 | static unsigned long fmax_mdp_8064[VDD_DIG_NUM] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3916 | [VDD_DIG_LOW] = 128000000, |
| 3917 | [VDD_DIG_NOMINAL] = 266667000 |
Tianyi Gou | 621f874 | 2011-09-01 21:45:01 -0700 | [diff] [blame] | 3918 | }; |
| 3919 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3920 | static struct bank_masks bmnd_info_mdp = { |
| 3921 | .bank_sel_mask = BIT(11), |
| 3922 | .bank0_mask = { |
| 3923 | .md_reg = MDP_MD0_REG, |
| 3924 | .ns_mask = BM(29, 22) | BM(5, 3), |
| 3925 | .rst_mask = BIT(31), |
| 3926 | .mnd_en_mask = BIT(8), |
| 3927 | .mode_mask = BM(10, 9), |
| 3928 | }, |
| 3929 | .bank1_mask = { |
| 3930 | .md_reg = MDP_MD1_REG, |
| 3931 | .ns_mask = BM(21, 14) | BM(2, 0), |
| 3932 | .rst_mask = BIT(30), |
| 3933 | .mnd_en_mask = BIT(5), |
| 3934 | .mode_mask = BM(7, 6), |
| 3935 | }, |
| 3936 | }; |
| 3937 | |
| 3938 | static struct rcg_clk mdp_clk = { |
| 3939 | .b = { |
| 3940 | .ctl_reg = MDP_CC_REG, |
| 3941 | .en_mask = BIT(0), |
| 3942 | .reset_reg = SW_RESET_CORE_REG, |
| 3943 | .reset_mask = BIT(21), |
| 3944 | .halt_reg = DBG_BUS_VEC_C_REG, |
| 3945 | .halt_bit = 10, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 3946 | .retain_reg = MDP_CC_REG, |
| 3947 | .retain_mask = BIT(31), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3948 | }, |
| 3949 | .ns_reg = MDP_NS_REG, |
| 3950 | .root_en_mask = BIT(2), |
| 3951 | .set_rate = set_rate_mnd_banked, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3952 | .freq_tbl = clk_tbl_mdp, |
Stephen Boyd | c78d9a7 | 2011-07-20 00:46:24 -0700 | [diff] [blame] | 3953 | .bank_info = &bmnd_info_mdp, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 3954 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3955 | .c = { |
| 3956 | .dbg_name = "mdp_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 3957 | .ops = &clk_ops_rcg, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3958 | VDD_DIG_FMAX_MAP2(LOW, 96000000, NOMINAL, 200000000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3959 | CLK_INIT(mdp_clk.c), |
Stephen Boyd | 7fa2674 | 2011-08-11 23:22:29 -0700 | [diff] [blame] | 3960 | .depends = &mdp_axi_clk.c, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3961 | }, |
| 3962 | }; |
| 3963 | |
Patrick Daly | 6e03432 | 2012-10-26 18:18:32 -0700 | [diff] [blame] | 3964 | static unsigned long fmax_mdp_8960ab[VDD_DIG_NUM] = { |
| 3965 | [VDD_DIG_LOW] = 128000000, |
| 3966 | [VDD_DIG_NOMINAL] = 266667000 |
| 3967 | }; |
| 3968 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3969 | static struct branch_clk lut_mdp_clk = { |
| 3970 | .b = { |
| 3971 | .ctl_reg = MDP_LUT_CC_REG, |
| 3972 | .en_mask = BIT(0), |
| 3973 | .halt_reg = DBG_BUS_VEC_I_REG, |
| 3974 | .halt_bit = 13, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 3975 | .retain_reg = MDP_LUT_CC_REG, |
| 3976 | .retain_mask = BIT(31), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3977 | }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3978 | .c = { |
Saravana Kannan | 7a6532e | 2012-10-18 20:51:13 -0700 | [diff] [blame] | 3979 | .parent = &mdp_clk.c, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3980 | .dbg_name = "lut_mdp_clk", |
| 3981 | .ops = &clk_ops_branch, |
| 3982 | CLK_INIT(lut_mdp_clk.c), |
| 3983 | }, |
| 3984 | }; |
| 3985 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3986 | #define F_MDP_VSYNC(f, s) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3987 | { \ |
| 3988 | .freq_hz = f, \ |
| 3989 | .src_clk = &s##_clk.c, \ |
| 3990 | .ns_val = NS_SRC_SEL(13, 13, s##_to_bb_mux), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3991 | } |
| 3992 | static struct clk_freq_tbl clk_tbl_mdp_vsync[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3993 | F_MDP_VSYNC(27000000, pxo), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3994 | F_END |
| 3995 | }; |
| 3996 | |
| 3997 | static struct rcg_clk mdp_vsync_clk = { |
| 3998 | .b = { |
| 3999 | .ctl_reg = MISC_CC_REG, |
| 4000 | .en_mask = BIT(6), |
| 4001 | .reset_reg = SW_RESET_CORE_REG, |
| 4002 | .reset_mask = BIT(3), |
| 4003 | .halt_reg = DBG_BUS_VEC_B_REG, |
| 4004 | .halt_bit = 22, |
| 4005 | }, |
| 4006 | .ns_reg = MISC_CC2_REG, |
| 4007 | .ns_mask = BIT(13), |
| 4008 | .set_rate = set_rate_nop, |
| 4009 | .freq_tbl = clk_tbl_mdp_vsync, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 4010 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4011 | .c = { |
| 4012 | .dbg_name = "mdp_vsync_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 4013 | .ops = &clk_ops_rcg, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 4014 | VDD_DIG_FMAX_MAP1(LOW, 27000000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4015 | CLK_INIT(mdp_vsync_clk.c), |
| 4016 | }, |
| 4017 | }; |
| 4018 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 4019 | #define F_ROT(f, s, d) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4020 | { \ |
| 4021 | .freq_hz = f, \ |
| 4022 | .src_clk = &s##_clk.c, \ |
| 4023 | .ns_val = NS_DIVSRC_BANKED(29, 26, 25, 22, d, \ |
| 4024 | 21, 19, 18, 16, s##_to_mm_mux), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4025 | } |
| 4026 | static struct clk_freq_tbl clk_tbl_rot[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 4027 | F_ROT( 0, gnd, 1), |
| 4028 | F_ROT( 27000000, pxo, 1), |
| 4029 | F_ROT( 29540000, pll8, 13), |
| 4030 | F_ROT( 32000000, pll8, 12), |
| 4031 | F_ROT( 38400000, pll8, 10), |
| 4032 | F_ROT( 48000000, pll8, 8), |
| 4033 | F_ROT( 54860000, pll8, 7), |
| 4034 | F_ROT( 64000000, pll8, 6), |
| 4035 | F_ROT( 76800000, pll8, 5), |
| 4036 | F_ROT( 96000000, pll8, 4), |
| 4037 | F_ROT(100000000, pll2, 8), |
| 4038 | F_ROT(114290000, pll2, 7), |
| 4039 | F_ROT(133330000, pll2, 6), |
| 4040 | F_ROT(160000000, pll2, 5), |
| 4041 | F_ROT(200000000, pll2, 4), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4042 | F_END |
| 4043 | }; |
| 4044 | |
| 4045 | static struct bank_masks bdiv_info_rot = { |
| 4046 | .bank_sel_mask = BIT(30), |
| 4047 | .bank0_mask = { |
| 4048 | .ns_mask = BM(25, 22) | BM(18, 16), |
| 4049 | }, |
| 4050 | .bank1_mask = { |
| 4051 | .ns_mask = BM(29, 26) | BM(21, 19), |
| 4052 | }, |
| 4053 | }; |
| 4054 | |
| 4055 | static struct rcg_clk rot_clk = { |
| 4056 | .b = { |
| 4057 | .ctl_reg = ROT_CC_REG, |
| 4058 | .en_mask = BIT(0), |
| 4059 | .reset_reg = SW_RESET_CORE_REG, |
| 4060 | .reset_mask = BIT(2), |
| 4061 | .halt_reg = DBG_BUS_VEC_C_REG, |
| 4062 | .halt_bit = 15, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 4063 | .retain_reg = ROT_CC_REG, |
| 4064 | .retain_mask = BIT(31), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4065 | }, |
| 4066 | .ns_reg = ROT_NS_REG, |
| 4067 | .root_en_mask = BIT(2), |
| 4068 | .set_rate = set_rate_div_banked, |
| 4069 | .freq_tbl = clk_tbl_rot, |
Stephen Boyd | c78d9a7 | 2011-07-20 00:46:24 -0700 | [diff] [blame] | 4070 | .bank_info = &bdiv_info_rot, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 4071 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4072 | .c = { |
| 4073 | .dbg_name = "rot_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 4074 | .ops = &clk_ops_rcg, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 4075 | VDD_DIG_FMAX_MAP2(LOW, 96000000, NOMINAL, 200000000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4076 | CLK_INIT(rot_clk.c), |
Stephen Boyd | 7fa2674 | 2011-08-11 23:22:29 -0700 | [diff] [blame] | 4077 | .depends = &rot_axi_clk.c, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4078 | }, |
| 4079 | }; |
| 4080 | |
Matt Wagantall | f82f294 | 2012-01-27 13:56:13 -0800 | [diff] [blame] | 4081 | static int hdmi_pll_clk_enable(struct clk *c) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4082 | { |
| 4083 | int ret; |
| 4084 | unsigned long flags; |
| 4085 | spin_lock_irqsave(&local_clock_reg_lock, flags); |
| 4086 | ret = hdmi_pll_enable(); |
| 4087 | spin_unlock_irqrestore(&local_clock_reg_lock, flags); |
| 4088 | return ret; |
| 4089 | } |
| 4090 | |
Matt Wagantall | f82f294 | 2012-01-27 13:56:13 -0800 | [diff] [blame] | 4091 | static void hdmi_pll_clk_disable(struct clk *c) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4092 | { |
| 4093 | unsigned long flags; |
| 4094 | spin_lock_irqsave(&local_clock_reg_lock, flags); |
| 4095 | hdmi_pll_disable(); |
| 4096 | spin_unlock_irqrestore(&local_clock_reg_lock, flags); |
| 4097 | } |
| 4098 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4099 | static struct clk_ops clk_ops_hdmi_pll = { |
| 4100 | .enable = hdmi_pll_clk_enable, |
| 4101 | .disable = hdmi_pll_clk_disable, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4102 | }; |
| 4103 | |
| 4104 | static struct clk hdmi_pll_clk = { |
Saravana Kannan | 7a6532e | 2012-10-18 20:51:13 -0700 | [diff] [blame] | 4105 | .parent = &pxo_clk.c, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4106 | .dbg_name = "hdmi_pll_clk", |
| 4107 | .ops = &clk_ops_hdmi_pll, |
Matt Wagantall | 82feaa1 | 2012-07-09 10:54:49 -0700 | [diff] [blame] | 4108 | .vdd_class = &vdd_sr2_hdmi_pll, |
Saravana Kannan | 55e959d | 2012-10-15 22:16:04 -0700 | [diff] [blame] | 4109 | .fmax = (unsigned long [VDD_SR2_HDMI_PLL_NUM]) { |
| 4110 | [VDD_SR2_HDMI_PLL_ON] = ULONG_MAX, |
| 4111 | }, |
| 4112 | .num_fmax = VDD_SR2_HDMI_PLL_NUM, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4113 | CLK_INIT(hdmi_pll_clk), |
| 4114 | }; |
| 4115 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 4116 | #define F_TV_GND(f, s, p_r, d, m, n) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4117 | { \ |
| 4118 | .freq_hz = f, \ |
| 4119 | .src_clk = &s##_clk.c, \ |
| 4120 | .md_val = MD8(8, m, 0, n), \ |
| 4121 | .ns_val = NS_MM(23, 16, n, m, 15, 14, d, 2, 0, s##_to_mm_mux), \ |
| 4122 | .ctl_val = CC(6, n), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4123 | } |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 4124 | #define F_TV(f, s, p_r, d, m, n) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4125 | { \ |
| 4126 | .freq_hz = f, \ |
| 4127 | .src_clk = &s##_clk, \ |
| 4128 | .md_val = MD8(8, m, 0, n), \ |
| 4129 | .ns_val = NS_MM(23, 16, n, m, 15, 14, d, 2, 0, s##_to_mm_mux), \ |
| 4130 | .ctl_val = CC(6, n), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4131 | .extra_freq_data = (void *)p_r, \ |
| 4132 | } |
| 4133 | /* Switching TV freqs requires PLL reconfiguration. */ |
| 4134 | static struct clk_freq_tbl clk_tbl_tv[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 4135 | F_TV_GND( 0, gnd, 0, 1, 0, 0), |
| 4136 | F_TV( 25200000, hdmi_pll, 25200000, 1, 0, 0), |
| 4137 | F_TV( 27000000, hdmi_pll, 27000000, 1, 0, 0), |
| 4138 | F_TV( 27030000, hdmi_pll, 27030000, 1, 0, 0), |
| 4139 | F_TV( 74250000, hdmi_pll, 74250000, 1, 0, 0), |
Ajay Singh Parmar | 25c91bb | 2013-01-23 18:47:04 +0530 | [diff] [blame] | 4140 | F_TV(108000000, hdmi_pll, 108000000, 1, 0, 0), |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 4141 | F_TV(148500000, hdmi_pll, 148500000, 1, 0, 0), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4142 | F_END |
| 4143 | }; |
| 4144 | |
Saravana Kannan | 55e959d | 2012-10-15 22:16:04 -0700 | [diff] [blame] | 4145 | static unsigned long fmax_tv_src_8064[VDD_DIG_NUM] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 4146 | [VDD_DIG_LOW] = 74250000, |
| 4147 | [VDD_DIG_NOMINAL] = 149000000 |
| 4148 | }; |
| 4149 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4150 | /* |
| 4151 | * Unlike other clocks, the TV rate is adjusted through PLL |
| 4152 | * re-programming. It is also routed through an MND divider. |
| 4153 | */ |
Matt Wagantall | f82f294 | 2012-01-27 13:56:13 -0800 | [diff] [blame] | 4154 | void set_rate_tv(struct rcg_clk *rcg, struct clk_freq_tbl *nf) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4155 | { |
| 4156 | unsigned long pll_rate = (unsigned long)nf->extra_freq_data; |
Matt Wagantall | f6c39a1 | 2012-07-09 19:24:42 -0700 | [diff] [blame] | 4157 | if (pll_rate) { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4158 | hdmi_pll_set_rate(pll_rate); |
Matt Wagantall | f6c39a1 | 2012-07-09 19:24:42 -0700 | [diff] [blame] | 4159 | hdmi_pll_clk.rate = pll_rate; |
| 4160 | } |
Matt Wagantall | f82f294 | 2012-01-27 13:56:13 -0800 | [diff] [blame] | 4161 | set_rate_mnd(rcg, nf); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4162 | } |
| 4163 | |
| 4164 | static struct rcg_clk tv_src_clk = { |
| 4165 | .ns_reg = TV_NS_REG, |
| 4166 | .b = { |
| 4167 | .ctl_reg = TV_CC_REG, |
| 4168 | .halt_check = NOCHECK, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 4169 | .retain_reg = TV_CC_REG, |
| 4170 | .retain_mask = BIT(31), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4171 | }, |
| 4172 | .md_reg = TV_MD_REG, |
| 4173 | .root_en_mask = BIT(2), |
| 4174 | .ns_mask = (BM(23, 16) | BM(15, 14) | BM(2, 0)), |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame] | 4175 | .mnd_en_mask = BIT(5), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4176 | .ctl_mask = BM(7, 6), |
| 4177 | .set_rate = set_rate_tv, |
| 4178 | .freq_tbl = clk_tbl_tv, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 4179 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4180 | .c = { |
| 4181 | .dbg_name = "tv_src_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 4182 | .ops = &clk_ops_rcg, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 4183 | VDD_DIG_FMAX_MAP2(LOW, 27030000, NOMINAL, 149000000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4184 | CLK_INIT(tv_src_clk.c), |
| 4185 | }, |
| 4186 | }; |
| 4187 | |
Tianyi Gou | 5191880 | 2012-01-26 14:05:43 -0800 | [diff] [blame] | 4188 | static struct cdiv_clk tv_src_div_clk = { |
| 4189 | .b = { |
| 4190 | .ctl_reg = TV_NS_REG, |
| 4191 | .halt_check = NOCHECK, |
| 4192 | }, |
| 4193 | .ns_reg = TV_NS_REG, |
| 4194 | .div_offset = 6, |
| 4195 | .max_div = 2, |
| 4196 | .c = { |
| 4197 | .dbg_name = "tv_src_div_clk", |
| 4198 | .ops = &clk_ops_cdiv, |
| 4199 | CLK_INIT(tv_src_div_clk.c), |
Stephen Boyd | d51d5e8 | 2012-06-18 18:09:50 -0700 | [diff] [blame] | 4200 | .rate = ULONG_MAX, |
Tianyi Gou | 5191880 | 2012-01-26 14:05:43 -0800 | [diff] [blame] | 4201 | }, |
| 4202 | }; |
| 4203 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4204 | static struct branch_clk tv_enc_clk = { |
| 4205 | .b = { |
| 4206 | .ctl_reg = TV_CC_REG, |
| 4207 | .en_mask = BIT(8), |
| 4208 | .reset_reg = SW_RESET_CORE_REG, |
| 4209 | .reset_mask = BIT(0), |
| 4210 | .halt_reg = DBG_BUS_VEC_D_REG, |
| 4211 | .halt_bit = 9, |
| 4212 | }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4213 | .c = { |
Saravana Kannan | 7a6532e | 2012-10-18 20:51:13 -0700 | [diff] [blame] | 4214 | .parent = &tv_src_clk.c, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4215 | .dbg_name = "tv_enc_clk", |
| 4216 | .ops = &clk_ops_branch, |
| 4217 | CLK_INIT(tv_enc_clk.c), |
| 4218 | }, |
| 4219 | }; |
| 4220 | |
| 4221 | static struct branch_clk tv_dac_clk = { |
| 4222 | .b = { |
| 4223 | .ctl_reg = TV_CC_REG, |
| 4224 | .en_mask = BIT(10), |
| 4225 | .halt_reg = DBG_BUS_VEC_D_REG, |
| 4226 | .halt_bit = 10, |
| 4227 | }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4228 | .c = { |
Saravana Kannan | 7a6532e | 2012-10-18 20:51:13 -0700 | [diff] [blame] | 4229 | .parent = &tv_src_clk.c, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4230 | .dbg_name = "tv_dac_clk", |
| 4231 | .ops = &clk_ops_branch, |
| 4232 | CLK_INIT(tv_dac_clk.c), |
| 4233 | }, |
| 4234 | }; |
| 4235 | |
| 4236 | static struct branch_clk mdp_tv_clk = { |
| 4237 | .b = { |
| 4238 | .ctl_reg = TV_CC_REG, |
| 4239 | .en_mask = BIT(0), |
| 4240 | .reset_reg = SW_RESET_CORE_REG, |
| 4241 | .reset_mask = BIT(4), |
| 4242 | .halt_reg = DBG_BUS_VEC_D_REG, |
| 4243 | .halt_bit = 12, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 4244 | .retain_reg = TV_CC2_REG, |
| 4245 | .retain_mask = BIT(10), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4246 | }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4247 | .c = { |
Saravana Kannan | 7a6532e | 2012-10-18 20:51:13 -0700 | [diff] [blame] | 4248 | .parent = &tv_src_clk.c, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4249 | .dbg_name = "mdp_tv_clk", |
| 4250 | .ops = &clk_ops_branch, |
| 4251 | CLK_INIT(mdp_tv_clk.c), |
| 4252 | }, |
| 4253 | }; |
| 4254 | |
| 4255 | static struct branch_clk hdmi_tv_clk = { |
| 4256 | .b = { |
| 4257 | .ctl_reg = TV_CC_REG, |
| 4258 | .en_mask = BIT(12), |
| 4259 | .reset_reg = SW_RESET_CORE_REG, |
| 4260 | .reset_mask = BIT(1), |
| 4261 | .halt_reg = DBG_BUS_VEC_D_REG, |
| 4262 | .halt_bit = 11, |
| 4263 | }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4264 | .c = { |
Saravana Kannan | 7a6532e | 2012-10-18 20:51:13 -0700 | [diff] [blame] | 4265 | .parent = &tv_src_clk.c, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4266 | .dbg_name = "hdmi_tv_clk", |
| 4267 | .ops = &clk_ops_branch, |
| 4268 | CLK_INIT(hdmi_tv_clk.c), |
| 4269 | }, |
| 4270 | }; |
| 4271 | |
Tianyi Gou | 5191880 | 2012-01-26 14:05:43 -0800 | [diff] [blame] | 4272 | static struct branch_clk rgb_tv_clk = { |
| 4273 | .b = { |
| 4274 | .ctl_reg = TV_CC2_REG, |
| 4275 | .en_mask = BIT(14), |
| 4276 | .halt_reg = DBG_BUS_VEC_J_REG, |
| 4277 | .halt_bit = 27, |
| 4278 | }, |
Tianyi Gou | 5191880 | 2012-01-26 14:05:43 -0800 | [diff] [blame] | 4279 | .c = { |
Saravana Kannan | 7a6532e | 2012-10-18 20:51:13 -0700 | [diff] [blame] | 4280 | .parent = &tv_src_clk.c, |
Tianyi Gou | 5191880 | 2012-01-26 14:05:43 -0800 | [diff] [blame] | 4281 | .dbg_name = "rgb_tv_clk", |
| 4282 | .ops = &clk_ops_branch, |
| 4283 | CLK_INIT(rgb_tv_clk.c), |
| 4284 | }, |
| 4285 | }; |
| 4286 | |
| 4287 | static struct branch_clk npl_tv_clk = { |
| 4288 | .b = { |
| 4289 | .ctl_reg = TV_CC2_REG, |
| 4290 | .en_mask = BIT(16), |
| 4291 | .halt_reg = DBG_BUS_VEC_J_REG, |
| 4292 | .halt_bit = 26, |
| 4293 | }, |
Tianyi Gou | 5191880 | 2012-01-26 14:05:43 -0800 | [diff] [blame] | 4294 | .c = { |
Saravana Kannan | 7a6532e | 2012-10-18 20:51:13 -0700 | [diff] [blame] | 4295 | .parent = &tv_src_clk.c, |
Tianyi Gou | 5191880 | 2012-01-26 14:05:43 -0800 | [diff] [blame] | 4296 | .dbg_name = "npl_tv_clk", |
| 4297 | .ops = &clk_ops_branch, |
| 4298 | CLK_INIT(npl_tv_clk.c), |
| 4299 | }, |
| 4300 | }; |
| 4301 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4302 | static struct branch_clk hdmi_app_clk = { |
| 4303 | .b = { |
| 4304 | .ctl_reg = MISC_CC2_REG, |
| 4305 | .en_mask = BIT(11), |
| 4306 | .reset_reg = SW_RESET_CORE_REG, |
| 4307 | .reset_mask = BIT(11), |
| 4308 | .halt_reg = DBG_BUS_VEC_B_REG, |
| 4309 | .halt_bit = 25, |
| 4310 | }, |
| 4311 | .c = { |
| 4312 | .dbg_name = "hdmi_app_clk", |
| 4313 | .ops = &clk_ops_branch, |
| 4314 | CLK_INIT(hdmi_app_clk.c), |
| 4315 | }, |
| 4316 | }; |
| 4317 | |
| 4318 | static struct bank_masks bmnd_info_vcodec = { |
| 4319 | .bank_sel_mask = BIT(13), |
| 4320 | .bank0_mask = { |
| 4321 | .md_reg = VCODEC_MD0_REG, |
| 4322 | .ns_mask = BM(18, 11) | BM(2, 0), |
| 4323 | .rst_mask = BIT(31), |
| 4324 | .mnd_en_mask = BIT(5), |
| 4325 | .mode_mask = BM(7, 6), |
| 4326 | }, |
| 4327 | .bank1_mask = { |
| 4328 | .md_reg = VCODEC_MD1_REG, |
| 4329 | .ns_mask = BM(26, 19) | BM(29, 27), |
| 4330 | .rst_mask = BIT(30), |
| 4331 | .mnd_en_mask = BIT(10), |
| 4332 | .mode_mask = BM(12, 11), |
| 4333 | }, |
| 4334 | }; |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 4335 | #define F_VCODEC(f, s, m, n) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4336 | { \ |
| 4337 | .freq_hz = f, \ |
| 4338 | .src_clk = &s##_clk.c, \ |
| 4339 | .md_val = MD8(8, m, 0, n), \ |
| 4340 | .ns_val = NS_MND_BANKED8(11, 19, n, m, 0, 27, s##_to_mm_mux), \ |
| 4341 | .ctl_val = CC_BANKED(6, 11, n), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4342 | } |
| 4343 | static struct clk_freq_tbl clk_tbl_vcodec[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 4344 | F_VCODEC( 0, gnd, 0, 0), |
| 4345 | F_VCODEC( 27000000, pxo, 0, 0), |
| 4346 | F_VCODEC( 32000000, pll8, 1, 12), |
| 4347 | F_VCODEC( 48000000, pll8, 1, 8), |
| 4348 | F_VCODEC( 54860000, pll8, 1, 7), |
| 4349 | F_VCODEC( 96000000, pll8, 1, 4), |
| 4350 | F_VCODEC(133330000, pll2, 1, 6), |
| 4351 | F_VCODEC(200000000, pll2, 1, 4), |
| 4352 | F_VCODEC(228570000, pll2, 2, 7), |
Patrick Daly | b7c777a | 2012-08-23 19:07:30 -0700 | [diff] [blame] | 4353 | F_VCODEC(266670000, pll2, 1, 3), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4354 | F_END |
| 4355 | }; |
| 4356 | |
| 4357 | static struct rcg_clk vcodec_clk = { |
| 4358 | .b = { |
| 4359 | .ctl_reg = VCODEC_CC_REG, |
| 4360 | .en_mask = BIT(0), |
| 4361 | .reset_reg = SW_RESET_CORE_REG, |
| 4362 | .reset_mask = BIT(6), |
| 4363 | .halt_reg = DBG_BUS_VEC_C_REG, |
| 4364 | .halt_bit = 29, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 4365 | .retain_reg = VCODEC_CC_REG, |
| 4366 | .retain_mask = BIT(31), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4367 | }, |
| 4368 | .ns_reg = VCODEC_NS_REG, |
| 4369 | .root_en_mask = BIT(2), |
| 4370 | .set_rate = set_rate_mnd_banked, |
Stephen Boyd | c78d9a7 | 2011-07-20 00:46:24 -0700 | [diff] [blame] | 4371 | .bank_info = &bmnd_info_vcodec, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4372 | .freq_tbl = clk_tbl_vcodec, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 4373 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4374 | .c = { |
| 4375 | .dbg_name = "vcodec_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 4376 | .ops = &clk_ops_rcg, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 4377 | VDD_DIG_FMAX_MAP3(LOW, 100000000, NOMINAL, 200000000, |
| 4378 | HIGH, 228571000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4379 | CLK_INIT(vcodec_clk.c), |
Stephen Boyd | 7fa2674 | 2011-08-11 23:22:29 -0700 | [diff] [blame] | 4380 | .depends = &vcodec_axi_clk.c, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4381 | }, |
| 4382 | }; |
| 4383 | |
Saravana Kannan | 55e959d | 2012-10-15 22:16:04 -0700 | [diff] [blame] | 4384 | static unsigned long fmax_vcodec_8064v2[VDD_DIG_NUM] = { |
Patrick Daly | b7c777a | 2012-08-23 19:07:30 -0700 | [diff] [blame] | 4385 | [VDD_DIG_LOW] = 100000000, |
| 4386 | [VDD_DIG_NOMINAL] = 200000000, |
| 4387 | [VDD_DIG_HIGH] = 266670000, |
| 4388 | }; |
| 4389 | |
Seemanta Dutta | 4dc1708 | 2012-10-24 18:37:42 -0700 | [diff] [blame] | 4390 | static unsigned long fmax_vcodec_8930ab[VDD_DIG_NUM] = { |
| 4391 | [VDD_DIG_LOW] = 100000000, |
| 4392 | [VDD_DIG_NOMINAL] = 200000000, |
| 4393 | [VDD_DIG_HIGH] = 266670000 |
| 4394 | }; |
| 4395 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 4396 | #define F_VPE(f, s, d) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4397 | { \ |
| 4398 | .freq_hz = f, \ |
| 4399 | .src_clk = &s##_clk.c, \ |
| 4400 | .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] | 4401 | } |
| 4402 | static struct clk_freq_tbl clk_tbl_vpe[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 4403 | F_VPE( 0, gnd, 1), |
| 4404 | F_VPE( 27000000, pxo, 1), |
| 4405 | F_VPE( 34909000, pll8, 11), |
| 4406 | F_VPE( 38400000, pll8, 10), |
| 4407 | F_VPE( 64000000, pll8, 6), |
| 4408 | F_VPE( 76800000, pll8, 5), |
| 4409 | F_VPE( 96000000, pll8, 4), |
| 4410 | F_VPE(100000000, pll2, 8), |
| 4411 | F_VPE(160000000, pll2, 5), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4412 | F_END |
| 4413 | }; |
| 4414 | |
| 4415 | static struct rcg_clk vpe_clk = { |
| 4416 | .b = { |
| 4417 | .ctl_reg = VPE_CC_REG, |
| 4418 | .en_mask = BIT(0), |
| 4419 | .reset_reg = SW_RESET_CORE_REG, |
| 4420 | .reset_mask = BIT(17), |
| 4421 | .halt_reg = DBG_BUS_VEC_A_REG, |
| 4422 | .halt_bit = 28, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 4423 | .retain_reg = VPE_CC_REG, |
| 4424 | .retain_mask = BIT(31), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4425 | }, |
| 4426 | .ns_reg = VPE_NS_REG, |
| 4427 | .root_en_mask = BIT(2), |
| 4428 | .ns_mask = (BM(15, 12) | BM(2, 0)), |
| 4429 | .set_rate = set_rate_nop, |
| 4430 | .freq_tbl = clk_tbl_vpe, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 4431 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4432 | .c = { |
| 4433 | .dbg_name = "vpe_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 4434 | .ops = &clk_ops_rcg, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 4435 | VDD_DIG_FMAX_MAP2(LOW, 76800000, NOMINAL, 160000000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4436 | CLK_INIT(vpe_clk.c), |
Stephen Boyd | 7fa2674 | 2011-08-11 23:22:29 -0700 | [diff] [blame] | 4437 | .depends = &vpe_axi_clk.c, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4438 | }, |
| 4439 | }; |
| 4440 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 4441 | #define F_VFE(f, s, d, m, n) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4442 | { \ |
| 4443 | .freq_hz = f, \ |
| 4444 | .src_clk = &s##_clk.c, \ |
| 4445 | .md_val = MD8(8, m, 0, n), \ |
| 4446 | .ns_val = NS_MM(23, 16, n, m, 11, 10, d, 2, 0, s##_to_mm_mux), \ |
| 4447 | .ctl_val = CC(6, n), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4448 | } |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 4449 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 4450 | static struct clk_freq_tbl clk_tbl_vfe[] = { |
| 4451 | F_VFE( 0, gnd, 1, 0, 0), |
| 4452 | F_VFE( 13960000, pll8, 1, 2, 55), |
| 4453 | F_VFE( 27000000, pxo, 1, 0, 0), |
| 4454 | F_VFE( 36570000, pll8, 1, 2, 21), |
| 4455 | F_VFE( 38400000, pll8, 2, 1, 5), |
| 4456 | F_VFE( 45180000, pll8, 1, 2, 17), |
| 4457 | F_VFE( 48000000, pll8, 2, 1, 4), |
| 4458 | F_VFE( 54860000, pll8, 1, 1, 7), |
| 4459 | F_VFE( 64000000, pll8, 2, 1, 3), |
| 4460 | F_VFE( 76800000, pll8, 1, 1, 5), |
| 4461 | F_VFE( 96000000, pll8, 2, 1, 2), |
| 4462 | F_VFE(109710000, pll8, 1, 2, 7), |
| 4463 | F_VFE(128000000, pll8, 1, 1, 3), |
| 4464 | F_VFE(153600000, pll8, 1, 2, 5), |
| 4465 | F_VFE(200000000, pll2, 2, 1, 2), |
| 4466 | F_VFE(228570000, pll2, 1, 2, 7), |
| 4467 | F_VFE(266667000, pll2, 1, 1, 3), |
| 4468 | F_VFE(320000000, pll2, 1, 2, 5), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4469 | F_END |
| 4470 | }; |
| 4471 | |
Saravana Kannan | 55e959d | 2012-10-15 22:16:04 -0700 | [diff] [blame] | 4472 | static unsigned long fmax_vfe_8064[VDD_DIG_NUM] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 4473 | [VDD_DIG_LOW] = 128000000, |
| 4474 | [VDD_DIG_NOMINAL] = 266667000, |
| 4475 | [VDD_DIG_HIGH] = 320000000 |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 4476 | }; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4477 | |
| 4478 | static struct rcg_clk vfe_clk = { |
| 4479 | .b = { |
| 4480 | .ctl_reg = VFE_CC_REG, |
| 4481 | .reset_reg = SW_RESET_CORE_REG, |
| 4482 | .reset_mask = BIT(15), |
| 4483 | .halt_reg = DBG_BUS_VEC_B_REG, |
| 4484 | .halt_bit = 6, |
| 4485 | .en_mask = BIT(0), |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 4486 | .retain_reg = VFE_CC2_REG, |
| 4487 | .retain_mask = BIT(31), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4488 | }, |
| 4489 | .ns_reg = VFE_NS_REG, |
| 4490 | .md_reg = VFE_MD_REG, |
| 4491 | .root_en_mask = BIT(2), |
| 4492 | .ns_mask = (BM(23, 16) | BM(11, 10) | BM(2, 0)), |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame] | 4493 | .mnd_en_mask = BIT(5), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4494 | .ctl_mask = BM(7, 6), |
| 4495 | .set_rate = set_rate_mnd, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 4496 | .freq_tbl = clk_tbl_vfe, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 4497 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4498 | .c = { |
| 4499 | .dbg_name = "vfe_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 4500 | .ops = &clk_ops_rcg, |
Tianyi Gou | 3022dfd | 2012-01-25 15:50:05 -0800 | [diff] [blame] | 4501 | VDD_DIG_FMAX_MAP3(LOW, 110000000, NOMINAL, 266667000, |
| 4502 | HIGH, 320000000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4503 | CLK_INIT(vfe_clk.c), |
Stephen Boyd | 7fa2674 | 2011-08-11 23:22:29 -0700 | [diff] [blame] | 4504 | .depends = &vfe_axi_clk.c, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4505 | }, |
| 4506 | }; |
| 4507 | |
Matt Wagantall | c23eee9 | 2011-08-16 23:06:52 -0700 | [diff] [blame] | 4508 | static struct branch_clk csi_vfe_clk = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4509 | .b = { |
| 4510 | .ctl_reg = VFE_CC_REG, |
| 4511 | .en_mask = BIT(12), |
| 4512 | .reset_reg = SW_RESET_CORE_REG, |
| 4513 | .reset_mask = BIT(24), |
| 4514 | .halt_reg = DBG_BUS_VEC_B_REG, |
| 4515 | .halt_bit = 8, |
| 4516 | }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4517 | .c = { |
Saravana Kannan | 7a6532e | 2012-10-18 20:51:13 -0700 | [diff] [blame] | 4518 | .parent = &vfe_clk.c, |
Matt Wagantall | c23eee9 | 2011-08-16 23:06:52 -0700 | [diff] [blame] | 4519 | .dbg_name = "csi_vfe_clk", |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4520 | .ops = &clk_ops_branch, |
Matt Wagantall | c23eee9 | 2011-08-16 23:06:52 -0700 | [diff] [blame] | 4521 | CLK_INIT(csi_vfe_clk.c), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4522 | }, |
| 4523 | }; |
| 4524 | |
| 4525 | /* |
| 4526 | * Low Power Audio Clocks |
| 4527 | */ |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 4528 | #define F_AIF_OSR(f, s, d, m, n) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4529 | { \ |
| 4530 | .freq_hz = f, \ |
| 4531 | .src_clk = &s##_clk.c, \ |
| 4532 | .md_val = MD8(8, m, 0, n), \ |
| 4533 | .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] | 4534 | } |
Matt Wagantall | 86e0382 | 2011-12-12 10:59:24 -0800 | [diff] [blame] | 4535 | static struct clk_freq_tbl clk_tbl_aif_osr_492[] = { |
| 4536 | F_AIF_OSR( 0, gnd, 1, 0, 0), |
| 4537 | F_AIF_OSR( 512000, pll4, 4, 1, 240), |
| 4538 | F_AIF_OSR( 768000, pll4, 4, 1, 160), |
| 4539 | F_AIF_OSR( 1024000, pll4, 4, 1, 120), |
| 4540 | F_AIF_OSR( 1536000, pll4, 4, 1, 80), |
| 4541 | F_AIF_OSR( 2048000, pll4, 4, 1, 60), |
| 4542 | F_AIF_OSR( 3072000, pll4, 4, 1, 40), |
| 4543 | F_AIF_OSR( 4096000, pll4, 4, 1, 30), |
| 4544 | F_AIF_OSR( 6144000, pll4, 4, 1, 20), |
| 4545 | F_AIF_OSR( 8192000, pll4, 4, 1, 15), |
| 4546 | F_AIF_OSR(12288000, pll4, 4, 1, 10), |
| 4547 | F_AIF_OSR(24576000, pll4, 4, 1, 5), |
Matt Wagantall | ac15a37 | 2012-10-10 23:36:20 -0700 | [diff] [blame] | 4548 | F_AIF_OSR(27000000, pxo, 1, 0, 0), |
Matt Wagantall | 86e0382 | 2011-12-12 10:59:24 -0800 | [diff] [blame] | 4549 | F_END |
| 4550 | }; |
| 4551 | |
| 4552 | static struct clk_freq_tbl clk_tbl_aif_osr_393[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 4553 | F_AIF_OSR( 0, gnd, 1, 0, 0), |
| 4554 | F_AIF_OSR( 512000, pll4, 4, 1, 192), |
| 4555 | F_AIF_OSR( 768000, pll4, 4, 1, 128), |
| 4556 | F_AIF_OSR( 1024000, pll4, 4, 1, 96), |
| 4557 | F_AIF_OSR( 1536000, pll4, 4, 1, 64), |
| 4558 | F_AIF_OSR( 2048000, pll4, 4, 1, 48), |
| 4559 | F_AIF_OSR( 3072000, pll4, 4, 1, 32), |
| 4560 | F_AIF_OSR( 4096000, pll4, 4, 1, 24), |
| 4561 | F_AIF_OSR( 6144000, pll4, 4, 1, 16), |
| 4562 | F_AIF_OSR( 8192000, pll4, 4, 1, 12), |
| 4563 | F_AIF_OSR(12288000, pll4, 4, 1, 8), |
| 4564 | F_AIF_OSR(24576000, pll4, 4, 1, 4), |
Matt Wagantall | ac15a37 | 2012-10-10 23:36:20 -0700 | [diff] [blame] | 4565 | F_AIF_OSR(27000000, pxo, 1, 0, 0), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4566 | F_END |
| 4567 | }; |
| 4568 | |
| 4569 | #define CLK_AIF_OSR(i, ns, md, h_r) \ |
| 4570 | struct rcg_clk i##_clk = { \ |
| 4571 | .b = { \ |
| 4572 | .ctl_reg = ns, \ |
| 4573 | .en_mask = BIT(17), \ |
| 4574 | .reset_reg = ns, \ |
| 4575 | .reset_mask = BIT(19), \ |
| 4576 | .halt_reg = h_r, \ |
| 4577 | .halt_check = ENABLE, \ |
| 4578 | .halt_bit = 1, \ |
| 4579 | }, \ |
| 4580 | .ns_reg = ns, \ |
| 4581 | .md_reg = md, \ |
| 4582 | .root_en_mask = BIT(9), \ |
| 4583 | .ns_mask = (BM(31, 24) | BM(6, 0)), \ |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame] | 4584 | .mnd_en_mask = BIT(8), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4585 | .set_rate = set_rate_mnd, \ |
Matt Wagantall | 86e0382 | 2011-12-12 10:59:24 -0800 | [diff] [blame] | 4586 | .freq_tbl = clk_tbl_aif_osr_393, \ |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 4587 | .current_freq = &rcg_dummy_freq, \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4588 | .c = { \ |
| 4589 | .dbg_name = #i "_clk", \ |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 4590 | .ops = &clk_ops_rcg, \ |
Matt Wagantall | ac15a37 | 2012-10-10 23:36:20 -0700 | [diff] [blame] | 4591 | VDD_DIG_FMAX_MAP1(LOW, 27000000), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4592 | CLK_INIT(i##_clk.c), \ |
| 4593 | }, \ |
| 4594 | } |
| 4595 | #define CLK_AIF_OSR_DIV(i, ns, md, h_r) \ |
| 4596 | struct rcg_clk i##_clk = { \ |
| 4597 | .b = { \ |
| 4598 | .ctl_reg = ns, \ |
| 4599 | .en_mask = BIT(21), \ |
| 4600 | .reset_reg = ns, \ |
| 4601 | .reset_mask = BIT(23), \ |
| 4602 | .halt_reg = h_r, \ |
| 4603 | .halt_check = ENABLE, \ |
| 4604 | .halt_bit = 1, \ |
| 4605 | }, \ |
| 4606 | .ns_reg = ns, \ |
| 4607 | .md_reg = md, \ |
| 4608 | .root_en_mask = BIT(9), \ |
| 4609 | .ns_mask = (BM(31, 24) | BM(6, 0)), \ |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame] | 4610 | .mnd_en_mask = BIT(8), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4611 | .set_rate = set_rate_mnd, \ |
Matt Wagantall | 86e0382 | 2011-12-12 10:59:24 -0800 | [diff] [blame] | 4612 | .freq_tbl = clk_tbl_aif_osr_393, \ |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 4613 | .current_freq = &rcg_dummy_freq, \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4614 | .c = { \ |
| 4615 | .dbg_name = #i "_clk", \ |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 4616 | .ops = &clk_ops_rcg, \ |
Matt Wagantall | ac15a37 | 2012-10-10 23:36:20 -0700 | [diff] [blame] | 4617 | VDD_DIG_FMAX_MAP1(LOW, 27000000), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4618 | CLK_INIT(i##_clk.c), \ |
| 4619 | }, \ |
| 4620 | } |
| 4621 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4622 | #define CLK_AIF_BIT(i, ns, h_r) \ |
Stephen Boyd | 9fd1964 | 2011-11-16 11:11:09 -0800 | [diff] [blame] | 4623 | struct cdiv_clk i##_clk = { \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4624 | .b = { \ |
| 4625 | .ctl_reg = ns, \ |
| 4626 | .en_mask = BIT(15), \ |
| 4627 | .halt_reg = h_r, \ |
| 4628 | .halt_check = DELAY, \ |
| 4629 | }, \ |
| 4630 | .ns_reg = ns, \ |
Stephen Boyd | 9fd1964 | 2011-11-16 11:11:09 -0800 | [diff] [blame] | 4631 | .ext_mask = BIT(14), \ |
| 4632 | .div_offset = 10, \ |
| 4633 | .max_div = 16, \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4634 | .c = { \ |
| 4635 | .dbg_name = #i "_clk", \ |
Stephen Boyd | 9fd1964 | 2011-11-16 11:11:09 -0800 | [diff] [blame] | 4636 | .ops = &clk_ops_cdiv, \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4637 | CLK_INIT(i##_clk.c), \ |
Stephen Boyd | d51d5e8 | 2012-06-18 18:09:50 -0700 | [diff] [blame] | 4638 | .rate = ULONG_MAX, \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4639 | }, \ |
| 4640 | } |
| 4641 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4642 | #define CLK_AIF_BIT_DIV(i, ns, h_r) \ |
Stephen Boyd | 9fd1964 | 2011-11-16 11:11:09 -0800 | [diff] [blame] | 4643 | struct cdiv_clk i##_clk = { \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4644 | .b = { \ |
| 4645 | .ctl_reg = ns, \ |
| 4646 | .en_mask = BIT(19), \ |
| 4647 | .halt_reg = h_r, \ |
Stephen Boyd | 7bb9cf8 | 2012-01-25 18:09:01 -0800 | [diff] [blame] | 4648 | .halt_check = DELAY, \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4649 | }, \ |
| 4650 | .ns_reg = ns, \ |
Stephen Boyd | 9fd1964 | 2011-11-16 11:11:09 -0800 | [diff] [blame] | 4651 | .ext_mask = BIT(18), \ |
| 4652 | .div_offset = 10, \ |
| 4653 | .max_div = 256, \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4654 | .c = { \ |
| 4655 | .dbg_name = #i "_clk", \ |
Stephen Boyd | 9fd1964 | 2011-11-16 11:11:09 -0800 | [diff] [blame] | 4656 | .ops = &clk_ops_cdiv, \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4657 | CLK_INIT(i##_clk.c), \ |
Stephen Boyd | d51d5e8 | 2012-06-18 18:09:50 -0700 | [diff] [blame] | 4658 | .rate = ULONG_MAX, \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4659 | }, \ |
| 4660 | } |
| 4661 | |
| 4662 | static CLK_AIF_OSR(mi2s_osr, LCC_MI2S_NS_REG, LCC_MI2S_MD_REG, |
| 4663 | LCC_MI2S_STATUS_REG); |
| 4664 | static CLK_AIF_BIT(mi2s_bit, LCC_MI2S_NS_REG, LCC_MI2S_STATUS_REG); |
| 4665 | |
| 4666 | static CLK_AIF_OSR_DIV(codec_i2s_mic_osr, LCC_CODEC_I2S_MIC_NS_REG, |
| 4667 | LCC_CODEC_I2S_MIC_MD_REG, LCC_CODEC_I2S_MIC_STATUS_REG); |
| 4668 | static CLK_AIF_BIT_DIV(codec_i2s_mic_bit, LCC_CODEC_I2S_MIC_NS_REG, |
| 4669 | LCC_CODEC_I2S_MIC_STATUS_REG); |
| 4670 | |
| 4671 | static CLK_AIF_OSR_DIV(spare_i2s_mic_osr, LCC_SPARE_I2S_MIC_NS_REG, |
| 4672 | LCC_SPARE_I2S_MIC_MD_REG, LCC_SPARE_I2S_MIC_STATUS_REG); |
| 4673 | static CLK_AIF_BIT_DIV(spare_i2s_mic_bit, LCC_SPARE_I2S_MIC_NS_REG, |
| 4674 | LCC_SPARE_I2S_MIC_STATUS_REG); |
| 4675 | |
| 4676 | static CLK_AIF_OSR_DIV(codec_i2s_spkr_osr, LCC_CODEC_I2S_SPKR_NS_REG, |
| 4677 | LCC_CODEC_I2S_SPKR_MD_REG, LCC_CODEC_I2S_SPKR_STATUS_REG); |
| 4678 | static CLK_AIF_BIT_DIV(codec_i2s_spkr_bit, LCC_CODEC_I2S_SPKR_NS_REG, |
| 4679 | LCC_CODEC_I2S_SPKR_STATUS_REG); |
| 4680 | |
| 4681 | static CLK_AIF_OSR_DIV(spare_i2s_spkr_osr, LCC_SPARE_I2S_SPKR_NS_REG, |
| 4682 | LCC_SPARE_I2S_SPKR_MD_REG, LCC_SPARE_I2S_SPKR_STATUS_REG); |
| 4683 | static CLK_AIF_BIT_DIV(spare_i2s_spkr_bit, LCC_SPARE_I2S_SPKR_NS_REG, |
| 4684 | LCC_SPARE_I2S_SPKR_STATUS_REG); |
| 4685 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 4686 | #define F_PCM(f, s, d, m, n) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4687 | { \ |
| 4688 | .freq_hz = f, \ |
| 4689 | .src_clk = &s##_clk.c, \ |
| 4690 | .md_val = MD16(m, n), \ |
| 4691 | .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] | 4692 | } |
Matt Wagantall | 86e0382 | 2011-12-12 10:59:24 -0800 | [diff] [blame] | 4693 | static struct clk_freq_tbl clk_tbl_pcm_492[] = { |
| 4694 | { .ns_val = BIT(10) /* external input */ }, |
Stephen Boyd | e9ed94d | 2012-08-02 10:57:11 -0700 | [diff] [blame] | 4695 | F_PCM( 256000, pll4, 4, 1, 480), |
Matt Wagantall | 86e0382 | 2011-12-12 10:59:24 -0800 | [diff] [blame] | 4696 | F_PCM( 512000, pll4, 4, 1, 240), |
| 4697 | F_PCM( 768000, pll4, 4, 1, 160), |
| 4698 | F_PCM( 1024000, pll4, 4, 1, 120), |
| 4699 | F_PCM( 1536000, pll4, 4, 1, 80), |
| 4700 | F_PCM( 2048000, pll4, 4, 1, 60), |
| 4701 | F_PCM( 3072000, pll4, 4, 1, 40), |
| 4702 | F_PCM( 4096000, pll4, 4, 1, 30), |
| 4703 | F_PCM( 6144000, pll4, 4, 1, 20), |
| 4704 | F_PCM( 8192000, pll4, 4, 1, 15), |
| 4705 | F_PCM(12288000, pll4, 4, 1, 10), |
| 4706 | F_PCM(24576000, pll4, 4, 1, 5), |
Matt Wagantall | ac15a37 | 2012-10-10 23:36:20 -0700 | [diff] [blame] | 4707 | F_PCM(27000000, pxo, 1, 0, 0), |
Matt Wagantall | 86e0382 | 2011-12-12 10:59:24 -0800 | [diff] [blame] | 4708 | F_END |
| 4709 | }; |
| 4710 | |
| 4711 | static struct clk_freq_tbl clk_tbl_pcm_393[] = { |
Stephen Boyd | 630f325 | 2012-01-31 00:10:08 -0800 | [diff] [blame] | 4712 | { .ns_val = BIT(10) /* external input */ }, |
Stephen Boyd | e9ed94d | 2012-08-02 10:57:11 -0700 | [diff] [blame] | 4713 | F_PCM( 256000, pll4, 4, 1, 384), |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 4714 | F_PCM( 512000, pll4, 4, 1, 192), |
| 4715 | F_PCM( 768000, pll4, 4, 1, 128), |
| 4716 | F_PCM( 1024000, pll4, 4, 1, 96), |
| 4717 | F_PCM( 1536000, pll4, 4, 1, 64), |
| 4718 | F_PCM( 2048000, pll4, 4, 1, 48), |
| 4719 | F_PCM( 3072000, pll4, 4, 1, 32), |
| 4720 | F_PCM( 4096000, pll4, 4, 1, 24), |
| 4721 | F_PCM( 6144000, pll4, 4, 1, 16), |
| 4722 | F_PCM( 8192000, pll4, 4, 1, 12), |
| 4723 | F_PCM(12288000, pll4, 4, 1, 8), |
| 4724 | F_PCM(24576000, pll4, 4, 1, 4), |
Matt Wagantall | ac15a37 | 2012-10-10 23:36:20 -0700 | [diff] [blame] | 4725 | F_PCM(27000000, pxo, 1, 0, 0), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4726 | F_END |
| 4727 | }; |
| 4728 | |
| 4729 | static struct rcg_clk pcm_clk = { |
| 4730 | .b = { |
| 4731 | .ctl_reg = LCC_PCM_NS_REG, |
| 4732 | .en_mask = BIT(11), |
| 4733 | .reset_reg = LCC_PCM_NS_REG, |
| 4734 | .reset_mask = BIT(13), |
| 4735 | .halt_reg = LCC_PCM_STATUS_REG, |
| 4736 | .halt_check = ENABLE, |
| 4737 | .halt_bit = 0, |
| 4738 | }, |
| 4739 | .ns_reg = LCC_PCM_NS_REG, |
| 4740 | .md_reg = LCC_PCM_MD_REG, |
| 4741 | .root_en_mask = BIT(9), |
Stephen Boyd | 630f325 | 2012-01-31 00:10:08 -0800 | [diff] [blame] | 4742 | .ns_mask = BM(31, 16) | BIT(10) | BM(6, 0), |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame] | 4743 | .mnd_en_mask = BIT(8), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4744 | .set_rate = set_rate_mnd, |
Matt Wagantall | 86e0382 | 2011-12-12 10:59:24 -0800 | [diff] [blame] | 4745 | .freq_tbl = clk_tbl_pcm_393, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 4746 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4747 | .c = { |
| 4748 | .dbg_name = "pcm_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 4749 | .ops = &clk_ops_rcg, |
Matt Wagantall | ac15a37 | 2012-10-10 23:36:20 -0700 | [diff] [blame] | 4750 | VDD_DIG_FMAX_MAP1(LOW, 27000000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4751 | CLK_INIT(pcm_clk.c), |
Stephen Boyd | c5492fc | 2012-06-18 18:47:03 -0700 | [diff] [blame] | 4752 | .rate = ULONG_MAX, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4753 | }, |
| 4754 | }; |
| 4755 | |
| 4756 | static struct rcg_clk audio_slimbus_clk = { |
| 4757 | .b = { |
| 4758 | .ctl_reg = LCC_SLIMBUS_NS_REG, |
| 4759 | .en_mask = BIT(10), |
| 4760 | .reset_reg = LCC_AHBEX_BRANCH_CTL_REG, |
| 4761 | .reset_mask = BIT(5), |
| 4762 | .halt_reg = LCC_SLIMBUS_STATUS_REG, |
| 4763 | .halt_check = ENABLE, |
| 4764 | .halt_bit = 0, |
| 4765 | }, |
| 4766 | .ns_reg = LCC_SLIMBUS_NS_REG, |
| 4767 | .md_reg = LCC_SLIMBUS_MD_REG, |
| 4768 | .root_en_mask = BIT(9), |
| 4769 | .ns_mask = (BM(31, 24) | BM(6, 0)), |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame] | 4770 | .mnd_en_mask = BIT(8), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4771 | .set_rate = set_rate_mnd, |
Matt Wagantall | 86e0382 | 2011-12-12 10:59:24 -0800 | [diff] [blame] | 4772 | .freq_tbl = clk_tbl_aif_osr_393, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 4773 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4774 | .c = { |
| 4775 | .dbg_name = "audio_slimbus_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 4776 | .ops = &clk_ops_rcg, |
Matt Wagantall | ac15a37 | 2012-10-10 23:36:20 -0700 | [diff] [blame] | 4777 | VDD_DIG_FMAX_MAP1(LOW, 27000000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4778 | CLK_INIT(audio_slimbus_clk.c), |
| 4779 | }, |
| 4780 | }; |
| 4781 | |
| 4782 | static struct branch_clk sps_slimbus_clk = { |
| 4783 | .b = { |
| 4784 | .ctl_reg = LCC_SLIMBUS_NS_REG, |
| 4785 | .en_mask = BIT(12), |
| 4786 | .halt_reg = LCC_SLIMBUS_STATUS_REG, |
| 4787 | .halt_check = ENABLE, |
| 4788 | .halt_bit = 1, |
| 4789 | }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4790 | .c = { |
Saravana Kannan | 7a6532e | 2012-10-18 20:51:13 -0700 | [diff] [blame] | 4791 | .parent = &audio_slimbus_clk.c, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4792 | .dbg_name = "sps_slimbus_clk", |
| 4793 | .ops = &clk_ops_branch, |
| 4794 | CLK_INIT(sps_slimbus_clk.c), |
| 4795 | }, |
| 4796 | }; |
| 4797 | |
| 4798 | static struct branch_clk slimbus_xo_src_clk = { |
| 4799 | .b = { |
| 4800 | .ctl_reg = SLIMBUS_XO_SRC_CLK_CTL_REG, |
| 4801 | .en_mask = BIT(2), |
| 4802 | .halt_reg = CLK_HALT_DFAB_STATE_REG, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4803 | .halt_bit = 28, |
| 4804 | }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4805 | .c = { |
Saravana Kannan | 7a6532e | 2012-10-18 20:51:13 -0700 | [diff] [blame] | 4806 | .parent = &sps_slimbus_clk.c, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4807 | .dbg_name = "slimbus_xo_src_clk", |
| 4808 | .ops = &clk_ops_branch, |
| 4809 | CLK_INIT(slimbus_xo_src_clk.c), |
| 4810 | }, |
| 4811 | }; |
| 4812 | |
Matt Wagantall | 735f01a | 2011-08-12 12:40:28 -0700 | [diff] [blame] | 4813 | DEFINE_CLK_RPM(afab_clk, afab_a_clk, APPS_FABRIC, NULL); |
| 4814 | DEFINE_CLK_RPM(cfpb_clk, cfpb_a_clk, CFPB, NULL); |
| 4815 | DEFINE_CLK_RPM(dfab_clk, dfab_a_clk, DAYTONA_FABRIC, NULL); |
| 4816 | DEFINE_CLK_RPM(ebi1_clk, ebi1_a_clk, EBI1, NULL); |
| 4817 | DEFINE_CLK_RPM(mmfab_clk, mmfab_a_clk, MM_FABRIC, NULL); |
| 4818 | DEFINE_CLK_RPM(mmfpb_clk, mmfpb_a_clk, MMFPB, NULL); |
| 4819 | DEFINE_CLK_RPM(sfab_clk, sfab_a_clk, SYSTEM_FABRIC, NULL); |
| 4820 | DEFINE_CLK_RPM(sfpb_clk, sfpb_a_clk, SFPB, NULL); |
Stephen Boyd | c7fc3b1 | 2012-05-17 14:42:46 -0700 | [diff] [blame] | 4821 | DEFINE_CLK_RPM_QDSS(qdss_clk, qdss_a_clk); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4822 | |
Matt Wagantall | 35e78fc | 2012-04-05 14:18:44 -0700 | [diff] [blame] | 4823 | static DEFINE_CLK_VOTER(sfab_msmbus_a_clk, &sfab_a_clk.c, 0); |
| 4824 | 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] | 4825 | |
Matt Wagantall | 35e78fc | 2012-04-05 14:18:44 -0700 | [diff] [blame] | 4826 | static DEFINE_CLK_VOTER(dfab_dsps_clk, &dfab_clk.c, 0); |
| 4827 | static DEFINE_CLK_VOTER(dfab_usb_hs_clk, &dfab_clk.c, 0); |
| 4828 | static DEFINE_CLK_VOTER(dfab_usb_hs3_clk, &dfab_clk.c, 0); |
| 4829 | static DEFINE_CLK_VOTER(dfab_usb_hs4_clk, &dfab_clk.c, 0); |
| 4830 | static DEFINE_CLK_VOTER(dfab_sdc1_clk, &dfab_clk.c, 0); |
| 4831 | static DEFINE_CLK_VOTER(dfab_sdc2_clk, &dfab_clk.c, 0); |
| 4832 | static DEFINE_CLK_VOTER(dfab_sdc3_clk, &dfab_clk.c, 0); |
| 4833 | static DEFINE_CLK_VOTER(dfab_sdc4_clk, &dfab_clk.c, 0); |
| 4834 | static DEFINE_CLK_VOTER(dfab_sdc5_clk, &dfab_clk.c, 0); |
| 4835 | static DEFINE_CLK_VOTER(dfab_sps_clk, &dfab_clk.c, 0); |
| 4836 | static DEFINE_CLK_VOTER(dfab_bam_dmux_clk, &dfab_clk.c, 0); |
| 4837 | static DEFINE_CLK_VOTER(dfab_scm_clk, &dfab_clk.c, 0); |
Matt Wagantall | 35e78fc | 2012-04-05 14:18:44 -0700 | [diff] [blame] | 4838 | static DEFINE_CLK_VOTER(dfab_msmbus_clk, &dfab_clk.c, 0); |
| 4839 | 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] | 4840 | |
Matt Wagantall | 42cd12a | 2012-03-30 18:02:40 -0700 | [diff] [blame] | 4841 | static DEFINE_CLK_VOTER(ebi1_msmbus_clk, &ebi1_clk.c, LONG_MAX); |
Matt Wagantall | 35e78fc | 2012-04-05 14:18:44 -0700 | [diff] [blame] | 4842 | static DEFINE_CLK_VOTER(ebi1_adm_clk, &ebi1_clk.c, 0); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4843 | |
Matt Wagantall | 33bac7e | 2012-05-22 14:59:05 -0700 | [diff] [blame] | 4844 | static DEFINE_CLK_VOTER(ebi1_acpu_a_clk, &ebi1_a_clk.c, LONG_MAX); |
| 4845 | static DEFINE_CLK_VOTER(ebi1_msmbus_a_clk, &ebi1_a_clk.c, LONG_MAX); |
| 4846 | static DEFINE_CLK_VOTER(afab_acpu_a_clk, &afab_a_clk.c, LONG_MAX); |
| 4847 | static DEFINE_CLK_VOTER(afab_msmbus_a_clk, &afab_a_clk.c, LONG_MAX); |
| 4848 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4849 | #ifdef CONFIG_DEBUG_FS |
| 4850 | struct measure_sel { |
| 4851 | u32 test_vector; |
Matt Wagantall | f82f294 | 2012-01-27 13:56:13 -0800 | [diff] [blame] | 4852 | struct clk *c; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4853 | }; |
| 4854 | |
Matt Wagantall | 8b38f94 | 2011-08-02 18:23:18 -0700 | [diff] [blame] | 4855 | static DEFINE_CLK_MEASURE(l2_m_clk); |
| 4856 | static DEFINE_CLK_MEASURE(krait0_m_clk); |
| 4857 | static DEFINE_CLK_MEASURE(krait1_m_clk); |
Tianyi Gou | 455c13c | 2012-02-02 16:33:24 -0800 | [diff] [blame] | 4858 | static DEFINE_CLK_MEASURE(krait2_m_clk); |
| 4859 | static DEFINE_CLK_MEASURE(krait3_m_clk); |
Stephen Boyd | 3939c8d | 2011-08-29 17:36:22 -0700 | [diff] [blame] | 4860 | static DEFINE_CLK_MEASURE(q6sw_clk); |
| 4861 | static DEFINE_CLK_MEASURE(q6fw_clk); |
| 4862 | static DEFINE_CLK_MEASURE(q6_func_clk); |
Matt Wagantall | 8b38f94 | 2011-08-02 18:23:18 -0700 | [diff] [blame] | 4863 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4864 | static struct measure_sel measure_mux[] = { |
| 4865 | { TEST_PER_LS(0x08), &slimbus_xo_src_clk.c }, |
| 4866 | { TEST_PER_LS(0x12), &sdc1_p_clk.c }, |
| 4867 | { TEST_PER_LS(0x13), &sdc1_clk.c }, |
| 4868 | { TEST_PER_LS(0x14), &sdc2_p_clk.c }, |
| 4869 | { TEST_PER_LS(0x15), &sdc2_clk.c }, |
| 4870 | { TEST_PER_LS(0x16), &sdc3_p_clk.c }, |
| 4871 | { TEST_PER_LS(0x17), &sdc3_clk.c }, |
| 4872 | { TEST_PER_LS(0x18), &sdc4_p_clk.c }, |
| 4873 | { TEST_PER_LS(0x19), &sdc4_clk.c }, |
| 4874 | { TEST_PER_LS(0x1A), &sdc5_p_clk.c }, |
| 4875 | { TEST_PER_LS(0x1B), &sdc5_clk.c }, |
Matt Wagantall | 7625a4c | 2011-11-01 16:17:53 -0700 | [diff] [blame] | 4876 | { TEST_PER_LS(0x1F), &gp0_clk.c }, |
| 4877 | { TEST_PER_LS(0x20), &gp1_clk.c }, |
| 4878 | { TEST_PER_LS(0x21), &gp2_clk.c }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4879 | { TEST_PER_LS(0x25), &dfab_clk.c }, |
| 4880 | { TEST_PER_LS(0x25), &dfab_a_clk.c }, |
| 4881 | { TEST_PER_LS(0x26), &pmem_clk.c }, |
| 4882 | { TEST_PER_LS(0x32), &dma_bam_p_clk.c }, |
| 4883 | { TEST_PER_LS(0x33), &cfpb_clk.c }, |
| 4884 | { TEST_PER_LS(0x33), &cfpb_a_clk.c }, |
| 4885 | { TEST_PER_LS(0x3D), &gsbi1_p_clk.c }, |
| 4886 | { TEST_PER_LS(0x3E), &gsbi1_uart_clk.c }, |
| 4887 | { TEST_PER_LS(0x3F), &gsbi1_qup_clk.c }, |
| 4888 | { TEST_PER_LS(0x41), &gsbi2_p_clk.c }, |
| 4889 | { TEST_PER_LS(0x42), &gsbi2_uart_clk.c }, |
| 4890 | { TEST_PER_LS(0x44), &gsbi2_qup_clk.c }, |
| 4891 | { TEST_PER_LS(0x45), &gsbi3_p_clk.c }, |
| 4892 | { TEST_PER_LS(0x46), &gsbi3_uart_clk.c }, |
| 4893 | { TEST_PER_LS(0x48), &gsbi3_qup_clk.c }, |
| 4894 | { TEST_PER_LS(0x49), &gsbi4_p_clk.c }, |
| 4895 | { TEST_PER_LS(0x4A), &gsbi4_uart_clk.c }, |
| 4896 | { TEST_PER_LS(0x4C), &gsbi4_qup_clk.c }, |
| 4897 | { TEST_PER_LS(0x4D), &gsbi5_p_clk.c }, |
| 4898 | { TEST_PER_LS(0x4E), &gsbi5_uart_clk.c }, |
| 4899 | { TEST_PER_LS(0x50), &gsbi5_qup_clk.c }, |
| 4900 | { TEST_PER_LS(0x51), &gsbi6_p_clk.c }, |
| 4901 | { TEST_PER_LS(0x52), &gsbi6_uart_clk.c }, |
| 4902 | { TEST_PER_LS(0x54), &gsbi6_qup_clk.c }, |
| 4903 | { TEST_PER_LS(0x55), &gsbi7_p_clk.c }, |
| 4904 | { TEST_PER_LS(0x56), &gsbi7_uart_clk.c }, |
| 4905 | { TEST_PER_LS(0x58), &gsbi7_qup_clk.c }, |
| 4906 | { TEST_PER_LS(0x59), &gsbi8_p_clk.c }, |
Tianyi Gou | 352955d | 2012-05-18 19:44:01 -0700 | [diff] [blame] | 4907 | { TEST_PER_LS(0x59), &sfab_sata_s_p_clk.c }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4908 | { TEST_PER_LS(0x5A), &gsbi8_uart_clk.c }, |
Tianyi Gou | 352955d | 2012-05-18 19:44:01 -0700 | [diff] [blame] | 4909 | { TEST_PER_LS(0x5A), &sata_p_clk.c }, |
| 4910 | { TEST_PER_LS(0x5B), &sata_rxoob_clk.c }, |
| 4911 | { TEST_PER_LS(0x5C), &sata_pmalive_clk.c }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4912 | { TEST_PER_LS(0x5C), &gsbi8_qup_clk.c }, |
| 4913 | { TEST_PER_LS(0x5D), &gsbi9_p_clk.c }, |
| 4914 | { TEST_PER_LS(0x5E), &gsbi9_uart_clk.c }, |
| 4915 | { TEST_PER_LS(0x60), &gsbi9_qup_clk.c }, |
| 4916 | { TEST_PER_LS(0x61), &gsbi10_p_clk.c }, |
| 4917 | { TEST_PER_LS(0x62), &gsbi10_uart_clk.c }, |
| 4918 | { TEST_PER_LS(0x64), &gsbi10_qup_clk.c }, |
| 4919 | { TEST_PER_LS(0x65), &gsbi11_p_clk.c }, |
| 4920 | { TEST_PER_LS(0x66), &gsbi11_uart_clk.c }, |
| 4921 | { TEST_PER_LS(0x68), &gsbi11_qup_clk.c }, |
| 4922 | { TEST_PER_LS(0x69), &gsbi12_p_clk.c }, |
| 4923 | { TEST_PER_LS(0x6A), &gsbi12_uart_clk.c }, |
| 4924 | { TEST_PER_LS(0x6C), &gsbi12_qup_clk.c }, |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 4925 | { TEST_PER_LS(0x5E), &pcie_p_clk.c }, |
| 4926 | { TEST_PER_LS(0x5F), &ce3_p_clk.c }, |
| 4927 | { TEST_PER_LS(0x60), &ce3_core_clk.c }, |
| 4928 | { TEST_PER_LS(0x63), &usb_hs3_p_clk.c }, |
| 4929 | { TEST_PER_LS(0x64), &usb_hs3_xcvr_clk.c }, |
| 4930 | { TEST_PER_LS(0x65), &usb_hs4_p_clk.c }, |
| 4931 | { TEST_PER_LS(0x66), &usb_hs4_xcvr_clk.c }, |
| 4932 | { TEST_PER_LS(0x6B), &sata_phy_ref_clk.c }, |
| 4933 | { TEST_PER_LS(0x6C), &sata_phy_cfg_clk.c }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4934 | { TEST_PER_LS(0x78), &sfpb_clk.c }, |
| 4935 | { TEST_PER_LS(0x78), &sfpb_a_clk.c }, |
| 4936 | { TEST_PER_LS(0x7A), &pmic_ssbi2_clk.c }, |
| 4937 | { TEST_PER_LS(0x7B), &pmic_arb0_p_clk.c }, |
| 4938 | { TEST_PER_LS(0x7C), &pmic_arb1_p_clk.c }, |
| 4939 | { TEST_PER_LS(0x7D), &prng_clk.c }, |
| 4940 | { TEST_PER_LS(0x7F), &rpm_msg_ram_p_clk.c }, |
| 4941 | { TEST_PER_LS(0x80), &adm0_p_clk.c }, |
| 4942 | { TEST_PER_LS(0x84), &usb_hs1_p_clk.c }, |
| 4943 | { TEST_PER_LS(0x85), &usb_hs1_xcvr_clk.c }, |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 4944 | { TEST_PER_LS(0x86), &usb_hsic_p_clk.c }, |
| 4945 | { TEST_PER_LS(0x87), &usb_hsic_system_clk.c }, |
| 4946 | { TEST_PER_LS(0x88), &usb_hsic_xcvr_fs_clk.c }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4947 | { TEST_PER_LS(0x89), &usb_fs1_p_clk.c }, |
| 4948 | { TEST_PER_LS(0x8A), &usb_fs1_sys_clk.c }, |
| 4949 | { TEST_PER_LS(0x8B), &usb_fs1_xcvr_clk.c }, |
| 4950 | { TEST_PER_LS(0x8C), &usb_fs2_p_clk.c }, |
| 4951 | { TEST_PER_LS(0x8D), &usb_fs2_sys_clk.c }, |
| 4952 | { TEST_PER_LS(0x8E), &usb_fs2_xcvr_clk.c }, |
| 4953 | { TEST_PER_LS(0x8F), &tsif_p_clk.c }, |
| 4954 | { TEST_PER_LS(0x91), &tsif_ref_clk.c }, |
| 4955 | { TEST_PER_LS(0x92), &ce1_p_clk.c }, |
| 4956 | { TEST_PER_LS(0x94), &tssc_clk.c }, |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 4957 | { TEST_PER_LS(0x9D), &usb_hsic_hsio_cal_clk.c }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4958 | { TEST_PER_LS(0xA4), &ce1_core_clk.c }, |
| 4959 | |
| 4960 | { TEST_PER_HS(0x07), &afab_clk.c }, |
| 4961 | { TEST_PER_HS(0x07), &afab_a_clk.c }, |
| 4962 | { TEST_PER_HS(0x18), &sfab_clk.c }, |
| 4963 | { TEST_PER_HS(0x18), &sfab_a_clk.c }, |
Stephen Boyd | 3939c8d | 2011-08-29 17:36:22 -0700 | [diff] [blame] | 4964 | { TEST_PER_HS(0x26), &q6sw_clk }, |
| 4965 | { TEST_PER_HS(0x27), &q6fw_clk }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4966 | { TEST_PER_HS(0x2A), &adm0_clk.c }, |
Tianyi Gou | 352955d | 2012-05-18 19:44:01 -0700 | [diff] [blame] | 4967 | { TEST_PER_HS(0x31), &sata_a_clk.c }, |
Tianyi Gou | 6613de5 | 2012-01-27 17:57:53 -0800 | [diff] [blame] | 4968 | { TEST_PER_HS(0x2D), &pcie_phy_ref_clk.c }, |
| 4969 | { TEST_PER_HS(0x32), &pcie_a_clk.c }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4970 | { TEST_PER_HS(0x34), &ebi1_clk.c }, |
| 4971 | { TEST_PER_HS(0x34), &ebi1_a_clk.c }, |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 4972 | { TEST_PER_HS(0x50), &usb_hsic_hsic_clk.c }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4973 | |
| 4974 | { TEST_MM_LS(0x00), &dsi1_byte_clk.c }, |
| 4975 | { TEST_MM_LS(0x01), &dsi2_byte_clk.c }, |
| 4976 | { TEST_MM_LS(0x02), &cam1_clk.c }, |
| 4977 | { TEST_MM_LS(0x06), &_p_clk.c }, |
Matt Wagantall | c23eee9 | 2011-08-16 23:06:52 -0700 | [diff] [blame] | 4978 | { TEST_MM_LS(0x07), &csi_p_clk.c }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4979 | { TEST_MM_LS(0x08), &dsi2_s_p_clk.c }, |
| 4980 | { TEST_MM_LS(0x09), &dsi1_m_p_clk.c }, |
| 4981 | { TEST_MM_LS(0x0A), &dsi1_s_p_clk.c }, |
| 4982 | { TEST_MM_LS(0x0C), &gfx2d0_p_clk.c }, |
| 4983 | { TEST_MM_LS(0x0D), &gfx2d1_p_clk.c }, |
| 4984 | { TEST_MM_LS(0x0E), &gfx3d_p_clk.c }, |
| 4985 | { TEST_MM_LS(0x0F), &hdmi_m_p_clk.c }, |
| 4986 | { TEST_MM_LS(0x10), &hdmi_s_p_clk.c }, |
| 4987 | { TEST_MM_LS(0x11), &ijpeg_p_clk.c }, |
| 4988 | { TEST_MM_LS(0x12), &imem_p_clk.c }, |
| 4989 | { TEST_MM_LS(0x13), &jpegd_p_clk.c }, |
| 4990 | { TEST_MM_LS(0x14), &mdp_p_clk.c }, |
| 4991 | { TEST_MM_LS(0x16), &rot_p_clk.c }, |
| 4992 | { TEST_MM_LS(0x17), &dsi1_esc_clk.c }, |
| 4993 | { TEST_MM_LS(0x18), &smmu_p_clk.c }, |
| 4994 | { TEST_MM_LS(0x19), &tv_enc_p_clk.c }, |
| 4995 | { TEST_MM_LS(0x1A), &vcodec_p_clk.c }, |
| 4996 | { TEST_MM_LS(0x1B), &vfe_p_clk.c }, |
| 4997 | { TEST_MM_LS(0x1C), &vpe_p_clk.c }, |
| 4998 | { TEST_MM_LS(0x1D), &cam0_clk.c }, |
| 4999 | { TEST_MM_LS(0x1F), &hdmi_app_clk.c }, |
| 5000 | { TEST_MM_LS(0x20), &mdp_vsync_clk.c }, |
| 5001 | { TEST_MM_LS(0x21), &tv_dac_clk.c }, |
| 5002 | { TEST_MM_LS(0x22), &tv_enc_clk.c }, |
| 5003 | { TEST_MM_LS(0x23), &dsi2_esc_clk.c }, |
| 5004 | { TEST_MM_LS(0x25), &mmfpb_clk.c }, |
| 5005 | { TEST_MM_LS(0x25), &mmfpb_a_clk.c }, |
| 5006 | { TEST_MM_LS(0x26), &dsi2_m_p_clk.c }, |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 5007 | { TEST_MM_LS(0x27), &cam2_clk.c }, |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 5008 | { TEST_MM_LS(0x28), &vcap_p_clk.c }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5009 | |
| 5010 | { TEST_MM_HS(0x00), &csi0_clk.c }, |
| 5011 | { TEST_MM_HS(0x01), &csi1_clk.c }, |
Matt Wagantall | c23eee9 | 2011-08-16 23:06:52 -0700 | [diff] [blame] | 5012 | { TEST_MM_HS(0x04), &csi_vfe_clk.c }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5013 | { TEST_MM_HS(0x05), &ijpeg_clk.c }, |
| 5014 | { TEST_MM_HS(0x06), &vfe_clk.c }, |
| 5015 | { TEST_MM_HS(0x07), &gfx2d0_clk.c }, |
| 5016 | { TEST_MM_HS(0x08), &gfx2d1_clk.c }, |
| 5017 | { TEST_MM_HS(0x09), &gfx3d_clk.c }, |
| 5018 | { TEST_MM_HS(0x0A), &jpegd_clk.c }, |
| 5019 | { TEST_MM_HS(0x0B), &vcodec_clk.c }, |
| 5020 | { TEST_MM_HS(0x0F), &mmfab_clk.c }, |
| 5021 | { TEST_MM_HS(0x0F), &mmfab_a_clk.c }, |
| 5022 | { TEST_MM_HS(0x11), &gmem_axi_clk.c }, |
| 5023 | { TEST_MM_HS(0x12), &ijpeg_axi_clk.c }, |
| 5024 | { TEST_MM_HS(0x13), &imem_axi_clk.c }, |
| 5025 | { TEST_MM_HS(0x14), &jpegd_axi_clk.c }, |
| 5026 | { TEST_MM_HS(0x15), &mdp_axi_clk.c }, |
| 5027 | { TEST_MM_HS(0x16), &rot_axi_clk.c }, |
| 5028 | { TEST_MM_HS(0x17), &vcodec_axi_clk.c }, |
| 5029 | { TEST_MM_HS(0x18), &vfe_axi_clk.c }, |
| 5030 | { TEST_MM_HS(0x19), &vpe_axi_clk.c }, |
| 5031 | { TEST_MM_HS(0x1A), &mdp_clk.c }, |
| 5032 | { TEST_MM_HS(0x1B), &rot_clk.c }, |
| 5033 | { TEST_MM_HS(0x1C), &vpe_clk.c }, |
| 5034 | { TEST_MM_HS(0x1E), &hdmi_tv_clk.c }, |
| 5035 | { TEST_MM_HS(0x1F), &mdp_tv_clk.c }, |
| 5036 | { TEST_MM_HS(0x24), &csi0_phy_clk.c }, |
| 5037 | { TEST_MM_HS(0x25), &csi1_phy_clk.c }, |
| 5038 | { TEST_MM_HS(0x26), &csi_pix_clk.c }, |
| 5039 | { TEST_MM_HS(0x27), &csi_rdi_clk.c }, |
| 5040 | { TEST_MM_HS(0x28), &lut_mdp_clk.c }, |
| 5041 | { TEST_MM_HS(0x29), &vcodec_axi_a_clk.c }, |
| 5042 | { TEST_MM_HS(0x2A), &vcodec_axi_b_clk.c }, |
| 5043 | { TEST_MM_HS(0x2B), &csi1phy_timer_clk.c }, |
| 5044 | { TEST_MM_HS(0x2C), &csi0phy_timer_clk.c }, |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 5045 | { TEST_MM_HS(0x2D), &csi2_clk.c }, |
| 5046 | { TEST_MM_HS(0x2E), &csi2_phy_clk.c }, |
| 5047 | { TEST_MM_HS(0x2F), &csi2phy_timer_clk.c }, |
| 5048 | { TEST_MM_HS(0x30), &csi_pix1_clk.c }, |
| 5049 | { TEST_MM_HS(0x31), &csi_rdi1_clk.c }, |
| 5050 | { TEST_MM_HS(0x32), &csi_rdi2_clk.c }, |
Tianyi Gou | 621f874 | 2011-09-01 21:45:01 -0700 | [diff] [blame] | 5051 | { TEST_MM_HS(0x33), &vcap_clk.c }, |
| 5052 | { TEST_MM_HS(0x34), &vcap_npl_clk.c }, |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 5053 | { TEST_MM_HS(0x34), &gfx3d_axi_clk_8930.c }, |
Tianyi Gou | 7747a96 | 2012-02-03 15:03:55 -0800 | [diff] [blame] | 5054 | { TEST_MM_HS(0x35), &vcap_axi_clk.c }, |
Tianyi Gou | 5191880 | 2012-01-26 14:05:43 -0800 | [diff] [blame] | 5055 | { TEST_MM_HS(0x36), &rgb_tv_clk.c }, |
| 5056 | { TEST_MM_HS(0x37), &npl_tv_clk.c }, |
Patrick Daly | e6f48904 | 2012-07-11 15:29:15 -0700 | [diff] [blame] | 5057 | { TEST_MM_HS(0x38), &gfx3d_axi_clk.c }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5058 | |
| 5059 | { TEST_LPA(0x0F), &mi2s_bit_clk.c }, |
| 5060 | { TEST_LPA(0x10), &codec_i2s_mic_bit_clk.c }, |
| 5061 | { TEST_LPA(0x11), &codec_i2s_spkr_bit_clk.c }, |
| 5062 | { TEST_LPA(0x12), &spare_i2s_mic_bit_clk.c }, |
| 5063 | { TEST_LPA(0x13), &spare_i2s_spkr_bit_clk.c }, |
| 5064 | { TEST_LPA(0x14), &pcm_clk.c }, |
| 5065 | { TEST_LPA(0x1D), &audio_slimbus_clk.c }, |
Matt Wagantall | 8b38f94 | 2011-08-02 18:23:18 -0700 | [diff] [blame] | 5066 | |
Stephen Boyd | 3939c8d | 2011-08-29 17:36:22 -0700 | [diff] [blame] | 5067 | { TEST_LPA_HS(0x00), &q6_func_clk }, |
| 5068 | |
Stephen Boyd | 46fdf0d | 2011-11-22 12:25:09 -0800 | [diff] [blame] | 5069 | { TEST_CPUL2(0x2), &l2_m_clk }, |
| 5070 | { TEST_CPUL2(0x0), &krait0_m_clk }, |
| 5071 | { TEST_CPUL2(0x1), &krait1_m_clk }, |
Tianyi Gou | 455c13c | 2012-02-02 16:33:24 -0800 | [diff] [blame] | 5072 | { TEST_CPUL2(0x4), &krait2_m_clk }, |
| 5073 | { TEST_CPUL2(0x5), &krait3_m_clk }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5074 | }; |
| 5075 | |
Matt Wagantall | f82f294 | 2012-01-27 13:56:13 -0800 | [diff] [blame] | 5076 | static struct measure_sel *find_measure_sel(struct clk *c) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5077 | { |
| 5078 | int i; |
| 5079 | |
| 5080 | for (i = 0; i < ARRAY_SIZE(measure_mux); i++) |
Matt Wagantall | f82f294 | 2012-01-27 13:56:13 -0800 | [diff] [blame] | 5081 | if (measure_mux[i].c == c) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5082 | return &measure_mux[i]; |
| 5083 | return NULL; |
| 5084 | } |
| 5085 | |
Matt Wagantall | 8b38f94 | 2011-08-02 18:23:18 -0700 | [diff] [blame] | 5086 | static int measure_clk_set_parent(struct clk *c, struct clk *parent) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5087 | { |
| 5088 | int ret = 0; |
| 5089 | u32 clk_sel; |
| 5090 | struct measure_sel *p; |
Matt Wagantall | f82f294 | 2012-01-27 13:56:13 -0800 | [diff] [blame] | 5091 | struct measure_clk *measure = to_measure_clk(c); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5092 | unsigned long flags; |
| 5093 | |
| 5094 | if (!parent) |
| 5095 | return -EINVAL; |
| 5096 | |
| 5097 | p = find_measure_sel(parent); |
| 5098 | if (!p) |
| 5099 | return -EINVAL; |
| 5100 | |
| 5101 | spin_lock_irqsave(&local_clock_reg_lock, flags); |
| 5102 | |
Matt Wagantall | 8b38f94 | 2011-08-02 18:23:18 -0700 | [diff] [blame] | 5103 | /* |
| 5104 | * Program the test vector, measurement period (sample_ticks) |
| 5105 | * and scaling multiplier. |
| 5106 | */ |
Matt Wagantall | f82f294 | 2012-01-27 13:56:13 -0800 | [diff] [blame] | 5107 | measure->sample_ticks = 0x10000; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5108 | clk_sel = p->test_vector & TEST_CLK_SEL_MASK; |
Matt Wagantall | f82f294 | 2012-01-27 13:56:13 -0800 | [diff] [blame] | 5109 | measure->multiplier = 1; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5110 | switch (p->test_vector >> TEST_TYPE_SHIFT) { |
| 5111 | case TEST_TYPE_PER_LS: |
| 5112 | writel_relaxed(0x4030D00|BVAL(7, 0, clk_sel), CLK_TEST_REG); |
| 5113 | break; |
| 5114 | case TEST_TYPE_PER_HS: |
| 5115 | writel_relaxed(0x4020000|BVAL(16, 10, clk_sel), CLK_TEST_REG); |
| 5116 | break; |
| 5117 | case TEST_TYPE_MM_LS: |
| 5118 | writel_relaxed(0x4030D97, CLK_TEST_REG); |
| 5119 | writel_relaxed(BVAL(6, 1, clk_sel)|BIT(0), DBG_CFG_REG_LS_REG); |
| 5120 | break; |
| 5121 | case TEST_TYPE_MM_HS: |
| 5122 | writel_relaxed(0x402B800, CLK_TEST_REG); |
| 5123 | writel_relaxed(BVAL(6, 1, clk_sel)|BIT(0), DBG_CFG_REG_HS_REG); |
| 5124 | break; |
| 5125 | case TEST_TYPE_LPA: |
| 5126 | writel_relaxed(0x4030D98, CLK_TEST_REG); |
| 5127 | writel_relaxed(BVAL(6, 1, clk_sel)|BIT(0), |
| 5128 | LCC_CLK_LS_DEBUG_CFG_REG); |
| 5129 | break; |
Stephen Boyd | 3939c8d | 2011-08-29 17:36:22 -0700 | [diff] [blame] | 5130 | case TEST_TYPE_LPA_HS: |
| 5131 | writel_relaxed(0x402BC00, CLK_TEST_REG); |
| 5132 | writel_relaxed(BVAL(2, 1, clk_sel)|BIT(0), |
| 5133 | LCC_CLK_HS_DEBUG_CFG_REG); |
| 5134 | break; |
Matt Wagantall | 8b38f94 | 2011-08-02 18:23:18 -0700 | [diff] [blame] | 5135 | case TEST_TYPE_CPUL2: |
| 5136 | writel_relaxed(0x4030400, CLK_TEST_REG); |
| 5137 | writel_relaxed(0x80|BVAL(5, 3, clk_sel), GCC_APCS_CLK_DIAG); |
Matt Wagantall | f82f294 | 2012-01-27 13:56:13 -0800 | [diff] [blame] | 5138 | measure->sample_ticks = 0x4000; |
| 5139 | measure->multiplier = 2; |
Patrick Daly | 73db3ad | 2012-10-01 18:56:41 -0700 | [diff] [blame] | 5140 | if (cpu_is_krait_v3()) |
| 5141 | measure->multiplier = 8; |
Matt Wagantall | 8b38f94 | 2011-08-02 18:23:18 -0700 | [diff] [blame] | 5142 | break; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5143 | default: |
| 5144 | ret = -EPERM; |
| 5145 | } |
| 5146 | /* Make sure test vector is set before starting measurements. */ |
| 5147 | mb(); |
| 5148 | |
| 5149 | spin_unlock_irqrestore(&local_clock_reg_lock, flags); |
| 5150 | |
| 5151 | return ret; |
| 5152 | } |
| 5153 | |
| 5154 | /* Sample clock for 'ticks' reference clock ticks. */ |
| 5155 | static u32 run_measurement(unsigned ticks) |
| 5156 | { |
| 5157 | /* Stop counters and set the XO4 counter start value. */ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5158 | writel_relaxed(ticks, RINGOSC_TCXO_CTL_REG); |
| 5159 | |
| 5160 | /* Wait for timer to become ready. */ |
| 5161 | while ((readl_relaxed(RINGOSC_STATUS_REG) & BIT(25)) != 0) |
| 5162 | cpu_relax(); |
| 5163 | |
| 5164 | /* Run measurement and wait for completion. */ |
| 5165 | writel_relaxed(BIT(20)|ticks, RINGOSC_TCXO_CTL_REG); |
| 5166 | while ((readl_relaxed(RINGOSC_STATUS_REG) & BIT(25)) == 0) |
| 5167 | cpu_relax(); |
| 5168 | |
| 5169 | /* Stop counters. */ |
| 5170 | writel_relaxed(0x0, RINGOSC_TCXO_CTL_REG); |
| 5171 | |
| 5172 | /* Return measured ticks. */ |
| 5173 | return readl_relaxed(RINGOSC_STATUS_REG) & BM(24, 0); |
| 5174 | } |
| 5175 | |
| 5176 | |
| 5177 | /* Perform a hardware rate measurement for a given clock. |
| 5178 | FOR DEBUG USE ONLY: Measurements take ~15 ms! */ |
Matt Wagantall | 9de3bfb | 2011-11-03 20:13:12 -0700 | [diff] [blame] | 5179 | static unsigned long measure_clk_get_rate(struct clk *c) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5180 | { |
| 5181 | unsigned long flags; |
| 5182 | u32 pdm_reg_backup, ringosc_reg_backup; |
| 5183 | u64 raw_count_short, raw_count_full; |
Matt Wagantall | f82f294 | 2012-01-27 13:56:13 -0800 | [diff] [blame] | 5184 | struct measure_clk *measure = to_measure_clk(c); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5185 | unsigned ret; |
| 5186 | |
Stephen Boyd | e334aeb | 2012-01-24 12:17:29 -0800 | [diff] [blame] | 5187 | ret = clk_prepare_enable(&cxo_clk.c); |
Stephen Boyd | 3a35f0b | 2012-01-11 16:18:26 -0800 | [diff] [blame] | 5188 | if (ret) { |
| 5189 | pr_warning("CXO clock failed to enable. Can't measure\n"); |
| 5190 | return 0; |
| 5191 | } |
| 5192 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5193 | spin_lock_irqsave(&local_clock_reg_lock, flags); |
| 5194 | |
| 5195 | /* Enable CXO/4 and RINGOSC branch and root. */ |
| 5196 | pdm_reg_backup = readl_relaxed(PDM_CLK_NS_REG); |
| 5197 | ringosc_reg_backup = readl_relaxed(RINGOSC_NS_REG); |
| 5198 | writel_relaxed(0x2898, PDM_CLK_NS_REG); |
| 5199 | writel_relaxed(0xA00, RINGOSC_NS_REG); |
| 5200 | |
| 5201 | /* |
| 5202 | * The ring oscillator counter will not reset if the measured clock |
| 5203 | * is not running. To detect this, run a short measurement before |
| 5204 | * the full measurement. If the raw results of the two are the same |
| 5205 | * then the clock must be off. |
| 5206 | */ |
| 5207 | |
| 5208 | /* Run a short measurement. (~1 ms) */ |
| 5209 | raw_count_short = run_measurement(0x1000); |
| 5210 | /* Run a full measurement. (~14 ms) */ |
Matt Wagantall | f82f294 | 2012-01-27 13:56:13 -0800 | [diff] [blame] | 5211 | raw_count_full = run_measurement(measure->sample_ticks); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5212 | |
| 5213 | writel_relaxed(ringosc_reg_backup, RINGOSC_NS_REG); |
| 5214 | writel_relaxed(pdm_reg_backup, PDM_CLK_NS_REG); |
| 5215 | |
| 5216 | /* Return 0 if the clock is off. */ |
| 5217 | if (raw_count_full == raw_count_short) |
| 5218 | ret = 0; |
| 5219 | else { |
| 5220 | /* Compute rate in Hz. */ |
| 5221 | raw_count_full = ((raw_count_full * 10) + 15) * 4800000; |
Matt Wagantall | f82f294 | 2012-01-27 13:56:13 -0800 | [diff] [blame] | 5222 | do_div(raw_count_full, ((measure->sample_ticks * 10) + 35)); |
| 5223 | ret = (raw_count_full * measure->multiplier); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5224 | } |
| 5225 | |
| 5226 | /* Route dbg_hs_clk to PLLTEST. 300mV single-ended amplitude. */ |
Stephen Boyd | 69da840 | 2011-07-14 17:45:31 -0700 | [diff] [blame] | 5227 | writel_relaxed(0x38F8, PLLTEST_PAD_CFG_REG); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5228 | spin_unlock_irqrestore(&local_clock_reg_lock, flags); |
| 5229 | |
Stephen Boyd | e334aeb | 2012-01-24 12:17:29 -0800 | [diff] [blame] | 5230 | clk_disable_unprepare(&cxo_clk.c); |
Stephen Boyd | 3a35f0b | 2012-01-11 16:18:26 -0800 | [diff] [blame] | 5231 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5232 | return ret; |
| 5233 | } |
| 5234 | #else /* !CONFIG_DEBUG_FS */ |
Matt Wagantall | f82f294 | 2012-01-27 13:56:13 -0800 | [diff] [blame] | 5235 | static int measure_clk_set_parent(struct clk *c, struct clk *parent) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5236 | { |
| 5237 | return -EINVAL; |
| 5238 | } |
| 5239 | |
Matt Wagantall | f82f294 | 2012-01-27 13:56:13 -0800 | [diff] [blame] | 5240 | static unsigned long measure_clk_get_rate(struct clk *c) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5241 | { |
| 5242 | return 0; |
| 5243 | } |
| 5244 | #endif /* CONFIG_DEBUG_FS */ |
| 5245 | |
Matt Wagantall | ae05322 | 2012-05-14 19:42:07 -0700 | [diff] [blame] | 5246 | static struct clk_ops clk_ops_measure = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5247 | .set_parent = measure_clk_set_parent, |
| 5248 | .get_rate = measure_clk_get_rate, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5249 | }; |
| 5250 | |
Matt Wagantall | 8b38f94 | 2011-08-02 18:23:18 -0700 | [diff] [blame] | 5251 | static struct measure_clk measure_clk = { |
| 5252 | .c = { |
| 5253 | .dbg_name = "measure_clk", |
Matt Wagantall | ae05322 | 2012-05-14 19:42:07 -0700 | [diff] [blame] | 5254 | .ops = &clk_ops_measure, |
Matt Wagantall | 8b38f94 | 2011-08-02 18:23:18 -0700 | [diff] [blame] | 5255 | CLK_INIT(measure_clk.c), |
| 5256 | }, |
| 5257 | .multiplier = 1, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5258 | }; |
| 5259 | |
Tianyi Gou | a8b3cce | 2011-11-08 14:37:26 -0800 | [diff] [blame] | 5260 | static struct clk_lookup msm_clocks_8064[] = { |
Stephen Boyd | 72a8035 | 2012-01-26 15:57:38 -0800 | [diff] [blame] | 5261 | CLK_LOOKUP("xo", cxo_a_clk.c, ""), |
| 5262 | CLK_LOOKUP("xo", pxo_a_clk.c, ""), |
Mohan Pallaka | 804ca59 | 2012-06-14 14:37:38 +0530 | [diff] [blame] | 5263 | CLK_LOOKUP("pwm_clk", cxo_clk.c, "0-0048"), |
Stephen Boyd | ed630b0 | 2012-01-26 15:26:47 -0800 | [diff] [blame] | 5264 | CLK_LOOKUP("cxo", cxo_clk.c, "wcnss_wlan.0"), |
| 5265 | CLK_LOOKUP("cxo", cxo_clk.c, "pil_riva"), |
Stephen Boyd | bdb53f3 | 2012-06-05 18:39:47 -0700 | [diff] [blame] | 5266 | CLK_LOOKUP("xo", pxo_clk.c, "pil-q6v4-lpass"), |
Matt Wagantall | 292aace | 2012-01-26 19:12:34 -0800 | [diff] [blame] | 5267 | CLK_LOOKUP("xo", cxo_clk.c, "pil_gss"), |
Stephen Boyd | 69d35e3 | 2012-02-14 15:33:30 -0800 | [diff] [blame] | 5268 | CLK_LOOKUP("xo", cxo_clk.c, "BAM_RMNT"), |
Stephen Boyd | 5a190a8 | 2012-03-01 14:45:15 -0800 | [diff] [blame] | 5269 | CLK_LOOKUP("xo", cxo_clk.c, "msm_xo"), |
David Collins | a7d2353 | 2012-08-02 10:48:16 -0700 | [diff] [blame] | 5270 | CLK_LOOKUP("vref_buff", cxo_clk.c, "rpm-regulator"), |
Stephen Boyd | ed630b0 | 2012-01-26 15:26:47 -0800 | [diff] [blame] | 5271 | CLK_LOOKUP("pll2", pll2_clk.c, NULL), |
| 5272 | CLK_LOOKUP("pll8", pll8_clk.c, NULL), |
| 5273 | CLK_LOOKUP("pll4", pll4_clk.c, NULL), |
| 5274 | CLK_LOOKUP("measure", measure_clk.c, "debug"), |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 5275 | |
Matt Wagantall | d75f131 | 2012-05-23 16:17:35 -0700 | [diff] [blame] | 5276 | CLK_LOOKUP("bus_clk", afab_clk.c, ""), |
| 5277 | CLK_LOOKUP("bus_clk", afab_a_clk.c, ""), |
| 5278 | CLK_LOOKUP("bus_clk", cfpb_clk.c, ""), |
| 5279 | CLK_LOOKUP("bus_clk", cfpb_a_clk.c, ""), |
| 5280 | CLK_LOOKUP("bus_clk", dfab_clk.c, ""), |
| 5281 | CLK_LOOKUP("bus_clk", dfab_a_clk.c, ""), |
| 5282 | CLK_LOOKUP("mem_clk", ebi1_clk.c, ""), |
| 5283 | CLK_LOOKUP("mem_clk", ebi1_a_clk.c, ""), |
| 5284 | CLK_LOOKUP("bus_clk", mmfab_clk.c, ""), |
| 5285 | CLK_LOOKUP("bus_clk", mmfab_a_clk.c, ""), |
| 5286 | CLK_LOOKUP("bus_clk", mmfpb_clk.c, ""), |
| 5287 | CLK_LOOKUP("bus_clk", mmfpb_a_clk.c, ""), |
| 5288 | CLK_LOOKUP("bus_clk", sfab_clk.c, ""), |
| 5289 | CLK_LOOKUP("bus_clk", sfab_a_clk.c, ""), |
| 5290 | CLK_LOOKUP("bus_clk", sfpb_clk.c, ""), |
| 5291 | CLK_LOOKUP("bus_clk", sfpb_a_clk.c, ""), |
| 5292 | |
Tianyi Gou | 21a0e80 | 2012-02-04 22:34:10 -0800 | [diff] [blame] | 5293 | CLK_LOOKUP("bus_clk", afab_clk.c, "msm_apps_fab"), |
Matt Wagantall | 33bac7e | 2012-05-22 14:59:05 -0700 | [diff] [blame] | 5294 | CLK_LOOKUP("bus_a_clk", afab_msmbus_a_clk.c, "msm_apps_fab"), |
Tianyi Gou | 21a0e80 | 2012-02-04 22:34:10 -0800 | [diff] [blame] | 5295 | CLK_LOOKUP("bus_clk", cfpb_clk.c, "msm_cpss_fpb"), |
| 5296 | CLK_LOOKUP("bus_a_clk", cfpb_a_clk.c, "msm_cpss_fpb"), |
| 5297 | CLK_LOOKUP("bus_clk", sfab_clk.c, "msm_sys_fab"), |
Stephen Boyd | d7a143a | 2012-02-16 17:59:26 -0800 | [diff] [blame] | 5298 | 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] | 5299 | CLK_LOOKUP("bus_clk", sfpb_clk.c, "msm_sys_fpb"), |
| 5300 | CLK_LOOKUP("bus_a_clk", sfpb_a_clk.c, "msm_sys_fpb"), |
| 5301 | CLK_LOOKUP("bus_clk", mmfab_clk.c, "msm_mm_fab"), |
| 5302 | CLK_LOOKUP("bus_a_clk", mmfab_a_clk.c, "msm_mm_fab"), |
| 5303 | CLK_LOOKUP("mem_clk", ebi1_msmbus_clk.c, "msm_bus"), |
Matt Wagantall | 33bac7e | 2012-05-22 14:59:05 -0700 | [diff] [blame] | 5304 | CLK_LOOKUP("mem_a_clk", ebi1_msmbus_a_clk.c, "msm_bus"), |
Gagan Mac | bc5f81d | 2012-04-04 15:03:12 -0600 | [diff] [blame] | 5305 | CLK_LOOKUP("dfab_clk", dfab_msmbus_clk.c, "msm_bus"), |
| 5306 | CLK_LOOKUP("dfab_a_clk", dfab_msmbus_a_clk.c, "msm_bus"), |
Pratik Patel | f17b147 | 2012-05-25 22:23:52 -0700 | [diff] [blame] | 5307 | CLK_LOOKUP("core_a_clk", qdss_a_clk.c, ""), |
Pratik Patel | 3b0ca88 | 2012-06-01 16:54:14 -0700 | [diff] [blame] | 5308 | CLK_LOOKUP("core_clk", qdss_clk.c, "coresight-tpiu.0"), |
| 5309 | CLK_LOOKUP("core_clk", qdss_clk.c, "coresight-etb.0"), |
| 5310 | CLK_LOOKUP("core_clk", qdss_clk.c, "coresight-funnel.0"), |
| 5311 | CLK_LOOKUP("core_clk", qdss_clk.c, "coresight-etm.0"), |
| 5312 | CLK_LOOKUP("core_clk", qdss_clk.c, "coresight-etm.1"), |
| 5313 | CLK_LOOKUP("core_clk", qdss_clk.c, "coresight-etm.2"), |
| 5314 | CLK_LOOKUP("core_clk", qdss_clk.c, "coresight-etm.3"), |
Matt Wagantall | b2710b8 | 2011-11-16 19:55:17 -0800 | [diff] [blame] | 5315 | |
Tianyi Gou | 21a0e80 | 2012-02-04 22:34:10 -0800 | [diff] [blame] | 5316 | CLK_LOOKUP("ebi1_clk", ebi1_clk.c, ""), |
Tianyi Gou | 21a0e80 | 2012-02-04 22:34:10 -0800 | [diff] [blame] | 5317 | CLK_LOOKUP("mmfpb_clk", mmfpb_clk.c, ""), |
| 5318 | CLK_LOOKUP("mmfpb_a_clk", mmfpb_a_clk.c, "clock-8960"), |
| 5319 | CLK_LOOKUP("cfpb_a_clk", cfpb_a_clk.c, "clock-8960"), |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 5320 | |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5321 | CLK_LOOKUP("core_clk", gp0_clk.c, ""), |
| 5322 | CLK_LOOKUP("core_clk", gp1_clk.c, ""), |
| 5323 | CLK_LOOKUP("core_clk", gp2_clk.c, ""), |
Jin Hong | 4bbbfba | 2012-02-02 21:48:07 -0800 | [diff] [blame] | 5324 | CLK_LOOKUP("core_clk", gsbi1_uart_clk.c, "msm_serial_hsl.1"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5325 | CLK_LOOKUP("core_clk", gsbi2_uart_clk.c, ""), |
Rohit Vaswani | 0454abb | 2013-01-09 13:39:37 -0800 | [diff] [blame] | 5326 | CLK_LOOKUP("core_clk", gsbi2_uart_clk.c, "msm_serial_hsl.3"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5327 | CLK_LOOKUP("core_clk", gsbi3_uart_clk.c, ""), |
| 5328 | CLK_LOOKUP("core_clk", gsbi4_uart_clk.c, ""), |
Rohit Vaswani | 0454abb | 2013-01-09 13:39:37 -0800 | [diff] [blame] | 5329 | CLK_LOOKUP("core_clk", gsbi4_uart_clk.c, "msm_serial_hsl.4"), |
Saket Saurabh | d425a5d | 2012-11-06 16:08:28 +0530 | [diff] [blame] | 5330 | CLK_LOOKUP("core_clk", gsbi5_uart_clk.c, "msm_serial_hsl.2"), |
Mayank Rana | 262e903 | 2012-05-10 15:14:00 -0700 | [diff] [blame] | 5331 | CLK_LOOKUP("core_clk", gsbi6_uart_clk.c, "msm_serial_hs.0"), |
Jin Hong | 4bbbfba | 2012-02-02 21:48:07 -0800 | [diff] [blame] | 5332 | CLK_LOOKUP("core_clk", gsbi7_uart_clk.c, "msm_serial_hsl.0"), |
David Keitel | 3c40fc5 | 2012-02-09 17:53:52 -0800 | [diff] [blame] | 5333 | CLK_LOOKUP("core_clk", gsbi1_qup_clk.c, "qup_i2c.0"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5334 | CLK_LOOKUP("core_clk", gsbi2_qup_clk.c, ""), |
Jing Lin | 04601f9 | 2012-02-05 15:36:07 -0800 | [diff] [blame] | 5335 | CLK_LOOKUP("core_clk", gsbi3_qup_clk.c, "qup_i2c.3"), |
Kevin Chan | d07220e | 2012-02-13 15:52:22 -0800 | [diff] [blame] | 5336 | CLK_LOOKUP("core_clk", gsbi4_qup_clk.c, "qup_i2c.4"), |
Stepan Moskovchenko | 6499900 | 2012-01-31 15:52:59 -0800 | [diff] [blame] | 5337 | CLK_LOOKUP("core_clk", gsbi5_qup_clk.c, "spi_qsd.0"), |
Joel King | 8f839b9 | 2012-04-01 14:37:46 -0700 | [diff] [blame] | 5338 | CLK_LOOKUP("core_clk", gsbi5_qup_clk.c, "qup_i2c.5"), |
Bar Weiner | f82c587 | 2012-10-23 14:31:26 +0200 | [diff] [blame] | 5339 | CLK_LOOKUP("core_clk", gsbi6_qup_clk.c, "spi_qsd.1"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5340 | CLK_LOOKUP("core_clk", gsbi7_qup_clk.c, ""), |
| 5341 | CLK_LOOKUP("core_clk", pdm_clk.c, ""), |
Tianyi Gou | 50f2381 | 2012-02-06 16:04:19 -0800 | [diff] [blame] | 5342 | CLK_LOOKUP("mem_clk", pmem_clk.c, "msm_sps"), |
Tianyi Gou | 05e0110 | 2012-02-08 22:15:49 -0800 | [diff] [blame] | 5343 | CLK_LOOKUP("core_clk", prng_clk.c, "msm_rng.0"), |
Tianyi Gou | 43208a0 | 2011-09-27 15:35:13 -0700 | [diff] [blame] | 5344 | CLK_LOOKUP("core_clk", sdc1_clk.c, "msm_sdcc.1"), |
| 5345 | CLK_LOOKUP("core_clk", sdc2_clk.c, "msm_sdcc.2"), |
| 5346 | CLK_LOOKUP("core_clk", sdc3_clk.c, "msm_sdcc.3"), |
| 5347 | CLK_LOOKUP("core_clk", sdc4_clk.c, "msm_sdcc.4"), |
Joel Nider | 6cbe66a | 2012-06-26 11:11:59 +0300 | [diff] [blame] | 5348 | CLK_LOOKUP("ref_clk", tsif_ref_clk.c, "msm_tsif.0"), |
| 5349 | CLK_LOOKUP("iface_clk", tsif_p_clk.c, "msm_tsif.0"), |
| 5350 | CLK_LOOKUP("ref_clk", tsif_ref_clk.c, "msm_tsif.1"), |
| 5351 | CLK_LOOKUP("iface_clk", tsif_p_clk.c, "msm_tsif.1"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5352 | CLK_LOOKUP("core_clk", tssc_clk.c, ""), |
Manu Gautam | 5143b25 | 2012-01-05 19:25:23 -0800 | [diff] [blame] | 5353 | CLK_LOOKUP("alt_core_clk", usb_hs1_xcvr_clk.c, "msm_otg"), |
| 5354 | CLK_LOOKUP("alt_core_clk", usb_hs3_xcvr_clk.c, "msm_ehci_host.0"), |
| 5355 | 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] | 5356 | CLK_LOOKUP("src_clk", usb_fs1_src_clk.c, ""), |
| 5357 | CLK_LOOKUP("alt_core_clk", usb_fs1_xcvr_clk.c, ""), |
| 5358 | CLK_LOOKUP("sys_clk", usb_fs1_sys_clk.c, ""), |
Sujit Reddy Thumma | b0d51e7 | 2012-12-31 15:37:16 +0530 | [diff] [blame] | 5359 | CLK_LOOKUP("ref_clk", sata_phy_ref_clk.c, "msm_sata.0"), |
| 5360 | CLK_LOOKUP("cfg_clk", sata_phy_cfg_clk.c, "msm_sata.0"), |
| 5361 | CLK_LOOKUP("src_clk", sata_src_clk.c, "msm_sata.0"), |
| 5362 | CLK_LOOKUP("core_rxoob_clk", sata_rxoob_clk.c, "msm_sata.0"), |
| 5363 | CLK_LOOKUP("core_pmalive_clk", sata_pmalive_clk.c, "msm_sata.0"), |
| 5364 | CLK_LOOKUP("bus_clk", sata_a_clk.c, "msm_sata.0"), |
| 5365 | CLK_LOOKUP("iface_clk", sata_p_clk.c, "msm_sata.0"), |
| 5366 | CLK_LOOKUP("slave_iface_clk", sfab_sata_s_p_clk.c, "msm_sata.0"), |
Ramesh Masavarapu | 2831191 | 2011-10-27 11:04:12 -0700 | [diff] [blame] | 5367 | CLK_LOOKUP("iface_clk", ce3_p_clk.c, "qce.0"), |
| 5368 | CLK_LOOKUP("iface_clk", ce3_p_clk.c, "qcrypto.0"), |
| 5369 | CLK_LOOKUP("core_clk", ce3_core_clk.c, "qce.0"), |
| 5370 | CLK_LOOKUP("core_clk", ce3_core_clk.c, "qcrypto.0"), |
| 5371 | CLK_LOOKUP("ce3_core_src_clk", ce3_src_clk.c, "qce.0"), |
| 5372 | CLK_LOOKUP("ce3_core_src_clk", ce3_src_clk.c, "qcrypto.0"), |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 5373 | CLK_LOOKUP("dma_bam_pclk", dma_bam_p_clk.c, NULL), |
Jin Hong | 4bbbfba | 2012-02-02 21:48:07 -0800 | [diff] [blame] | 5374 | CLK_LOOKUP("iface_clk", gsbi1_p_clk.c, "msm_serial_hsl.1"), |
David Keitel | 3c40fc5 | 2012-02-09 17:53:52 -0800 | [diff] [blame] | 5375 | CLK_LOOKUP("iface_clk", gsbi1_p_clk.c, "qup_i2c.0"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5376 | CLK_LOOKUP("iface_clk", gsbi2_p_clk.c, ""), |
Rohit Vaswani | 0454abb | 2013-01-09 13:39:37 -0800 | [diff] [blame] | 5377 | CLK_LOOKUP("iface_clk", gsbi2_p_clk.c, "msm_serial_hsl.3"), |
Jing Lin | 04601f9 | 2012-02-05 15:36:07 -0800 | [diff] [blame] | 5378 | CLK_LOOKUP("iface_clk", gsbi3_p_clk.c, "qup_i2c.3"), |
Kevin Chan | d07220e | 2012-02-13 15:52:22 -0800 | [diff] [blame] | 5379 | CLK_LOOKUP("iface_clk", gsbi4_p_clk.c, "qup_i2c.4"), |
Saket Saurabh | d425a5d | 2012-11-06 16:08:28 +0530 | [diff] [blame] | 5380 | CLK_LOOKUP("iface_clk", gsbi5_p_clk.c, "msm_serial_hsl.2"), |
Stepan Moskovchenko | 6499900 | 2012-01-31 15:52:59 -0800 | [diff] [blame] | 5381 | CLK_LOOKUP("iface_clk", gsbi5_p_clk.c, "spi_qsd.0"), |
Joel King | 8f839b9 | 2012-04-01 14:37:46 -0700 | [diff] [blame] | 5382 | CLK_LOOKUP("iface_clk", gsbi5_p_clk.c, "qup_i2c.5"), |
Mayank Rana | 262e903 | 2012-05-10 15:14:00 -0700 | [diff] [blame] | 5383 | CLK_LOOKUP("iface_clk", gsbi6_p_clk.c, "msm_serial_hs.0"), |
Bar Weiner | f82c587 | 2012-10-23 14:31:26 +0200 | [diff] [blame] | 5384 | CLK_LOOKUP("iface_clk", gsbi6_p_clk.c, "spi_qsd.1"), |
Jin Hong | 4bbbfba | 2012-02-02 21:48:07 -0800 | [diff] [blame] | 5385 | CLK_LOOKUP("iface_clk", gsbi7_p_clk.c, "msm_serial_hsl.0"), |
Rohit Vaswani | 0454abb | 2013-01-09 13:39:37 -0800 | [diff] [blame] | 5386 | CLK_LOOKUP("iface_clk", gsbi7_p_clk.c, "msm_serial_hsl.4"), |
Joel Nider | 6d7d16c | 2012-05-30 18:02:42 +0300 | [diff] [blame] | 5387 | CLK_LOOKUP("ref_clk", tsif_ref_clk.c, "msm_tspp.0"), |
| 5388 | CLK_LOOKUP("iface_clk", tsif_p_clk.c, "msm_tspp.0"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5389 | CLK_LOOKUP("iface_clk", usb_fs1_p_clk.c, ""), |
Manu Gautam | 5143b25 | 2012-01-05 19:25:23 -0800 | [diff] [blame] | 5390 | CLK_LOOKUP("iface_clk", usb_hs1_p_clk.c, "msm_otg"), |
Manu Gautam | 7483f17 | 2011-11-08 15:22:26 +0530 | [diff] [blame] | 5391 | CLK_LOOKUP("iface_clk", usb_hs3_p_clk.c, "msm_ehci_host.0"), |
| 5392 | 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] | 5393 | CLK_LOOKUP("iface_clk", sdc1_p_clk.c, "msm_sdcc.1"), |
| 5394 | CLK_LOOKUP("iface_clk", sdc2_p_clk.c, "msm_sdcc.2"), |
| 5395 | CLK_LOOKUP("iface_clk", sdc3_p_clk.c, "msm_sdcc.3"), |
| 5396 | CLK_LOOKUP("iface_clk", sdc4_p_clk.c, "msm_sdcc.4"), |
Niranjana Vishwanathapura | 06f8933 | 2012-05-03 17:11:13 -0600 | [diff] [blame] | 5397 | CLK_LOOKUP("iface_clk", pcie_p_clk.c, "msm_pcie"), |
| 5398 | CLK_LOOKUP("ref_clk", pcie_phy_ref_clk.c, "msm_pcie"), |
| 5399 | CLK_LOOKUP("bus_clk", pcie_a_clk.c, "msm_pcie"), |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 5400 | CLK_LOOKUP("core_clk", adm0_clk.c, "msm_dmov"), |
| 5401 | CLK_LOOKUP("iface_clk", adm0_p_clk.c, "msm_dmov"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5402 | CLK_LOOKUP("iface_clk", pmic_arb0_p_clk.c, ""), |
| 5403 | CLK_LOOKUP("iface_clk", pmic_arb1_p_clk.c, ""), |
| 5404 | CLK_LOOKUP("core_clk", pmic_ssbi2_clk.c, ""), |
| 5405 | CLK_LOOKUP("mem_clk", rpm_msg_ram_p_clk.c, ""), |
Kevin Chan | d07220e | 2012-02-13 15:52:22 -0800 | [diff] [blame] | 5406 | CLK_LOOKUP("cam_clk", cam0_clk.c, "4-001a"), |
Punit Soni | 5785010 | 2012-09-26 11:31:27 -0700 | [diff] [blame] | 5407 | CLK_LOOKUP("cam_clk", cam0_clk.c, "4-0010"), |
Sreesudhan Ramakrish Ramkumar | 3381da7 | 2012-01-27 08:08:32 -0800 | [diff] [blame] | 5408 | CLK_LOOKUP("cam_clk", cam0_clk.c, "4-0034"), |
Sreesudhan Ramakrish Ramkumar | 8002a79 | 2012-04-09 17:42:58 -0700 | [diff] [blame] | 5409 | CLK_LOOKUP("cam_clk", cam0_clk.c, "4-0020"), |
Sreesudhan Ramakrish Ramkumar | 6c6f57c | 2012-02-21 15:12:44 -0800 | [diff] [blame] | 5410 | CLK_LOOKUP("cam_clk", cam1_clk.c, "4-0048"), |
Kevin Chan | d07220e | 2012-02-13 15:52:22 -0800 | [diff] [blame] | 5411 | CLK_LOOKUP("cam_clk", cam1_clk.c, "4-006c"), |
Stephen Boyd | 85328b2 | 2012-09-19 17:07:16 -0700 | [diff] [blame] | 5412 | CLK_LOOKUP("cam_clk", cam2_clk.c, ""), |
Kevin Chan | d07220e | 2012-02-13 15:52:22 -0800 | [diff] [blame] | 5413 | CLK_LOOKUP("csi_src_clk", csi0_src_clk.c, "msm_csid.0"), |
| 5414 | CLK_LOOKUP("csi_src_clk", csi1_src_clk.c, "msm_csid.1"), |
| 5415 | CLK_LOOKUP("csi_src_clk", csi2_src_clk.c, "msm_csid.2"), |
| 5416 | CLK_LOOKUP("csi_clk", csi0_clk.c, "msm_csid.0"), |
| 5417 | CLK_LOOKUP("csi_clk", csi1_clk.c, "msm_csid.1"), |
| 5418 | CLK_LOOKUP("csi_clk", csi2_clk.c, "msm_csid.2"), |
| 5419 | CLK_LOOKUP("csi_phy_clk", csi0_phy_clk.c, "msm_csid.0"), |
| 5420 | CLK_LOOKUP("csi_phy_clk", csi1_phy_clk.c, "msm_csid.1"), |
| 5421 | CLK_LOOKUP("csi_phy_clk", csi2_phy_clk.c, "msm_csid.2"), |
Kevin Chan | d07220e | 2012-02-13 15:52:22 -0800 | [diff] [blame] | 5422 | CLK_LOOKUP("csiphy_timer_src_clk", |
| 5423 | csiphy_timer_src_clk.c, "msm_csiphy.0"), |
| 5424 | CLK_LOOKUP("csiphy_timer_src_clk", |
| 5425 | csiphy_timer_src_clk.c, "msm_csiphy.1"), |
| 5426 | CLK_LOOKUP("csiphy_timer_src_clk", |
| 5427 | csiphy_timer_src_clk.c, "msm_csiphy.2"), |
| 5428 | CLK_LOOKUP("csiphy_timer_clk", csi0phy_timer_clk.c, "msm_csiphy.0"), |
| 5429 | CLK_LOOKUP("csiphy_timer_clk", csi1phy_timer_clk.c, "msm_csiphy.1"), |
| 5430 | CLK_LOOKUP("csiphy_timer_clk", csi2phy_timer_clk.c, "msm_csiphy.2"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 5431 | CLK_LOOKUP("byte_clk", dsi1_byte_clk.c, "mipi_dsi.1"), |
| 5432 | CLK_LOOKUP("byte_clk", dsi2_byte_clk.c, "mipi_dsi.2"), |
| 5433 | CLK_LOOKUP("esc_clk", dsi1_esc_clk.c, "mipi_dsi.1"), |
| 5434 | CLK_LOOKUP("esc_clk", dsi2_esc_clk.c, "mipi_dsi.2"), |
Tianyi Gou | 5191880 | 2012-01-26 14:05:43 -0800 | [diff] [blame] | 5435 | CLK_LOOKUP("rgb_clk", rgb_tv_clk.c, ""), |
| 5436 | CLK_LOOKUP("npl_clk", npl_tv_clk.c, ""), |
| 5437 | |
Pu Chen | 86b4be9 | 2011-11-03 17:27:57 -0700 | [diff] [blame] | 5438 | CLK_LOOKUP("core_clk", gfx3d_clk.c, "kgsl-3d0.0"), |
Matt Wagantall | c9a780c | 2011-10-28 12:12:18 -0700 | [diff] [blame] | 5439 | CLK_LOOKUP("core_clk", gfx3d_clk.c, "footswitch-8x60.2"), |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 5440 | CLK_LOOKUP("bus_clk", |
Patrick Daly | e6f48904 | 2012-07-11 15:29:15 -0700 | [diff] [blame] | 5441 | gfx3d_axi_clk.c, "footswitch-8x60.2"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5442 | CLK_LOOKUP("iface_clk", vcap_p_clk.c, ""), |
Terence Hampson | 2e1705f | 2012-04-11 19:55:29 -0400 | [diff] [blame] | 5443 | CLK_LOOKUP("iface_clk", vcap_p_clk.c, "msm_vcap.0"), |
Matt Wagantall | c9a780c | 2011-10-28 12:12:18 -0700 | [diff] [blame] | 5444 | CLK_LOOKUP("iface_clk", vcap_p_clk.c, "footswitch-8x60.10"), |
| 5445 | CLK_LOOKUP("bus_clk", vcap_axi_clk.c, "footswitch-8x60.10"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5446 | CLK_LOOKUP("core_clk", vcap_clk.c, ""), |
Terence Hampson | 2e1705f | 2012-04-11 19:55:29 -0400 | [diff] [blame] | 5447 | CLK_LOOKUP("core_clk", vcap_clk.c, "msm_vcap.0"), |
Matt Wagantall | c9a780c | 2011-10-28 12:12:18 -0700 | [diff] [blame] | 5448 | CLK_LOOKUP("core_clk", vcap_clk.c, "footswitch-8x60.10"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5449 | CLK_LOOKUP("vcap_npl_clk", vcap_npl_clk.c, ""), |
Terence Hampson | 2e1705f | 2012-04-11 19:55:29 -0400 | [diff] [blame] | 5450 | CLK_LOOKUP("vcap_npl_clk", vcap_npl_clk.c, "msm_vcap.0"), |
Matt Wagantall | c9a780c | 2011-10-28 12:12:18 -0700 | [diff] [blame] | 5451 | CLK_LOOKUP("bus_clk", ijpeg_axi_clk.c, "footswitch-8x60.3"), |
Matt Wagantall | f45cd36 | 2012-05-03 21:09:44 -0700 | [diff] [blame] | 5452 | CLK_LOOKUP("mem_clk", imem_axi_clk.c, "msm_gemini.0"), |
| 5453 | CLK_LOOKUP("core_clk", ijpeg_clk.c, "msm_gemini.0"), |
Matt Wagantall | c9a780c | 2011-10-28 12:12:18 -0700 | [diff] [blame] | 5454 | CLK_LOOKUP("core_clk", ijpeg_clk.c, "footswitch-8x60.3"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5455 | CLK_LOOKUP("core_clk", jpegd_clk.c, ""), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 5456 | CLK_LOOKUP("core_clk", mdp_clk.c, "mdp.0"), |
Matt Wagantall | c9a780c | 2011-10-28 12:12:18 -0700 | [diff] [blame] | 5457 | CLK_LOOKUP("core_clk", mdp_clk.c, "footswitch-8x60.4"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 5458 | CLK_LOOKUP("vsync_clk", mdp_vsync_clk.c, "mdp.0"), |
Matt Wagantall | b82a513 | 2011-12-12 22:26:41 -0800 | [diff] [blame] | 5459 | CLK_LOOKUP("vsync_clk", mdp_vsync_clk.c, "footswitch-8x60.4"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 5460 | CLK_LOOKUP("lut_clk", lut_mdp_clk.c, "mdp.0"), |
Matt Wagantall | b82a513 | 2011-12-12 22:26:41 -0800 | [diff] [blame] | 5461 | CLK_LOOKUP("lut_clk", lut_mdp_clk.c, "footswitch-8x60.4"), |
Matt Wagantall | bb90da9 | 2011-10-25 15:07:52 -0700 | [diff] [blame] | 5462 | CLK_LOOKUP("core_clk", rot_clk.c, "msm_rotator.0"), |
Matt Wagantall | c9a780c | 2011-10-28 12:12:18 -0700 | [diff] [blame] | 5463 | CLK_LOOKUP("core_clk", rot_clk.c, "footswitch-8x60.6"), |
Matt Wagantall | 6128631 | 2012-02-22 15:55:09 -0800 | [diff] [blame] | 5464 | CLK_LOOKUP("tv_src_clk", tv_src_clk.c, "footswitch-8x60.4"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 5465 | CLK_LOOKUP("src_clk", tv_src_clk.c, "dtv.0"), |
| 5466 | CLK_LOOKUP("div_clk", tv_src_div_clk.c, ""), |
Greg Grisco | fa47b53 | 2011-11-11 10:32:06 -0800 | [diff] [blame] | 5467 | CLK_LOOKUP("core_clk", vcodec_clk.c, "msm_vidc.0"), |
Matt Wagantall | c9a780c | 2011-10-28 12:12:18 -0700 | [diff] [blame] | 5468 | CLK_LOOKUP("core_clk", vcodec_clk.c, "footswitch-8x60.7"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 5469 | CLK_LOOKUP("mdp_clk", mdp_tv_clk.c, "dtv.0"), |
Tianyi Gou | 5191880 | 2012-01-26 14:05:43 -0800 | [diff] [blame] | 5470 | CLK_LOOKUP("tv_clk", mdp_tv_clk.c, "footswitch-8x60.4"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 5471 | CLK_LOOKUP("hdmi_clk", hdmi_tv_clk.c, "dtv.0"), |
Aravind Venkateswaran | 0507c8c | 2012-02-16 17:16:05 -0800 | [diff] [blame] | 5472 | CLK_LOOKUP("core_clk", hdmi_app_clk.c, "hdmi_msm.1"), |
Ujwal Patel | d041f98 | 2012-03-27 19:51:44 -0700 | [diff] [blame] | 5473 | CLK_LOOKUP("vpe_clk", vpe_clk.c, "msm_vpe.0"), |
Matt Wagantall | c9a780c | 2011-10-28 12:12:18 -0700 | [diff] [blame] | 5474 | CLK_LOOKUP("core_clk", vpe_clk.c, "footswitch-8x60.9"), |
Kevin Chan | d07220e | 2012-02-13 15:52:22 -0800 | [diff] [blame] | 5475 | CLK_LOOKUP("vfe_clk", vfe_clk.c, "msm_vfe.0"), |
Matt Wagantall | c9a780c | 2011-10-28 12:12:18 -0700 | [diff] [blame] | 5476 | CLK_LOOKUP("core_clk", vfe_clk.c, "footswitch-8x60.8"), |
Kevin Chan | d07220e | 2012-02-13 15:52:22 -0800 | [diff] [blame] | 5477 | CLK_LOOKUP("csi_vfe_clk", csi_vfe_clk.c, "msm_vfe.0"), |
Matt Wagantall | c9a780c | 2011-10-28 12:12:18 -0700 | [diff] [blame] | 5478 | CLK_LOOKUP("bus_clk", vfe_axi_clk.c, "footswitch-8x60.8"), |
| 5479 | CLK_LOOKUP("bus_clk", mdp_axi_clk.c, "footswitch-8x60.4"), |
| 5480 | CLK_LOOKUP("bus_clk", rot_axi_clk.c, "footswitch-8x60.6"), |
| 5481 | CLK_LOOKUP("bus_clk", vcodec_axi_clk.c, "footswitch-8x60.7"), |
| 5482 | CLK_LOOKUP("bus_a_clk", vcodec_axi_a_clk.c, "footswitch-8x60.7"), |
| 5483 | CLK_LOOKUP("bus_b_clk", vcodec_axi_b_clk.c, "footswitch-8x60.7"), |
| 5484 | CLK_LOOKUP("bus_clk", vpe_axi_clk.c, "footswitch-8x60.9"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 5485 | CLK_LOOKUP("arb_clk", amp_p_clk.c, "mipi_dsi.1"), |
| 5486 | CLK_LOOKUP("arb_clk", amp_p_clk.c, "mipi_dsi.2"), |
Kevin Chan | d07220e | 2012-02-13 15:52:22 -0800 | [diff] [blame] | 5487 | CLK_LOOKUP("csi_pclk", csi_p_clk.c, "msm_csid.0"), |
| 5488 | CLK_LOOKUP("csi_pclk", csi_p_clk.c, "msm_csid.1"), |
| 5489 | CLK_LOOKUP("csi_pclk", csi_p_clk.c, "msm_csid.2"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 5490 | CLK_LOOKUP("master_iface_clk", dsi1_m_p_clk.c, "mipi_dsi.1"), |
| 5491 | CLK_LOOKUP("slave_iface_clk", dsi1_s_p_clk.c, "mipi_dsi.1"), |
| 5492 | CLK_LOOKUP("master_iface_clk", dsi2_m_p_clk.c, "mipi_dsi.2"), |
| 5493 | 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] | 5494 | CLK_LOOKUP("iface_clk", gfx3d_p_clk.c, "kgsl-3d0.0"), |
Matt Wagantall | c9a780c | 2011-10-28 12:12:18 -0700 | [diff] [blame] | 5495 | CLK_LOOKUP("iface_clk", gfx3d_p_clk.c, "footswitch-8x60.2"), |
Aravind Venkateswaran | 0507c8c | 2012-02-16 17:16:05 -0800 | [diff] [blame] | 5496 | CLK_LOOKUP("master_iface_clk", hdmi_m_p_clk.c, "hdmi_msm.1"), |
| 5497 | 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] | 5498 | CLK_LOOKUP("iface_clk", ijpeg_p_clk.c, "msm_gemini.0"), |
Matt Wagantall | c9a780c | 2011-10-28 12:12:18 -0700 | [diff] [blame] | 5499 | CLK_LOOKUP("iface_clk", ijpeg_p_clk.c, "footswitch-8x60.3"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5500 | CLK_LOOKUP("iface_clk", jpegd_p_clk.c, ""), |
Matt Wagantall | 5d44ef2 | 2012-01-23 11:01:05 -0800 | [diff] [blame] | 5501 | CLK_LOOKUP("mem_iface_clk", imem_p_clk.c, "kgsl-3d0.0"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 5502 | CLK_LOOKUP("iface_clk", mdp_p_clk.c, "mdp.0"), |
Matt Wagantall | c9a780c | 2011-10-28 12:12:18 -0700 | [diff] [blame] | 5503 | CLK_LOOKUP("iface_clk", mdp_p_clk.c, "footswitch-8x60.4"), |
Olav Haugan | 0e22c48 | 2013-01-28 17:39:36 -0800 | [diff] [blame] | 5504 | CLK_LOOKUP("iface_clk", smmu_p_clk.c, "msm_iommu-v0.0"), |
| 5505 | CLK_LOOKUP("iface_clk", smmu_p_clk.c, "msm_iommu-v0.1"), |
| 5506 | CLK_LOOKUP("iface_clk", smmu_p_clk.c, "msm_iommu-v0.2"), |
| 5507 | CLK_LOOKUP("iface_clk", smmu_p_clk.c, "msm_iommu-v0.3"), |
| 5508 | CLK_LOOKUP("iface_clk", smmu_p_clk.c, "msm_iommu-v0.4"), |
| 5509 | CLK_LOOKUP("iface_clk", smmu_p_clk.c, "msm_iommu-v0.5"), |
| 5510 | CLK_LOOKUP("iface_clk", smmu_p_clk.c, "msm_iommu-v0.6"), |
| 5511 | CLK_LOOKUP("iface_clk", smmu_p_clk.c, "msm_iommu-v0.7"), |
| 5512 | CLK_LOOKUP("iface_clk", smmu_p_clk.c, "msm_iommu-v0.8"), |
| 5513 | CLK_LOOKUP("iface_clk", smmu_p_clk.c, "msm_iommu-v0.9"), |
| 5514 | CLK_LOOKUP("iface_clk", smmu_p_clk.c, "msm_iommu-v0.10"), |
| 5515 | CLK_LOOKUP("iface_clk", smmu_p_clk.c, "msm_iommu-v0.11"), |
Matt Wagantall | bb90da9 | 2011-10-25 15:07:52 -0700 | [diff] [blame] | 5516 | CLK_LOOKUP("iface_clk", rot_p_clk.c, "msm_rotator.0"), |
Matt Wagantall | c9a780c | 2011-10-28 12:12:18 -0700 | [diff] [blame] | 5517 | CLK_LOOKUP("iface_clk", rot_p_clk.c, "footswitch-8x60.6"), |
Greg Grisco | fa47b53 | 2011-11-11 10:32:06 -0800 | [diff] [blame] | 5518 | CLK_LOOKUP("iface_clk", vcodec_p_clk.c, "msm_vidc.0"), |
Matt Wagantall | c9a780c | 2011-10-28 12:12:18 -0700 | [diff] [blame] | 5519 | CLK_LOOKUP("iface_clk", vcodec_p_clk.c, "footswitch-8x60.7"), |
Kevin Chan | d07220e | 2012-02-13 15:52:22 -0800 | [diff] [blame] | 5520 | CLK_LOOKUP("vfe_pclk", vfe_p_clk.c, "msm_vfe.0"), |
Matt Wagantall | c9a780c | 2011-10-28 12:12:18 -0700 | [diff] [blame] | 5521 | CLK_LOOKUP("iface_clk", vfe_p_clk.c, "footswitch-8x60.8"), |
Kevin Chan | b20742b | 2012-02-27 15:47:35 -0800 | [diff] [blame] | 5522 | CLK_LOOKUP("vpe_pclk", vpe_p_clk.c, "msm_vpe.0"), |
Matt Wagantall | 6128631 | 2012-02-22 15:55:09 -0800 | [diff] [blame] | 5523 | CLK_LOOKUP("iface_clk", vpe_p_clk.c, "footswitch-8x60.9"), |
Tianyi Gou | 21a0e80 | 2012-02-04 22:34:10 -0800 | [diff] [blame] | 5524 | |
Patrick Lai | 04baee94 | 2012-05-01 14:38:47 -0700 | [diff] [blame] | 5525 | CLK_LOOKUP("bit_clk", mi2s_bit_clk.c, |
| 5526 | "msm-dai-q6-mi2s"), |
| 5527 | CLK_LOOKUP("osr_clk", mi2s_osr_clk.c, |
| 5528 | "msm-dai-q6-mi2s"), |
Kuirong Wang | a9c3acc | 2012-02-09 17:00:45 -0800 | [diff] [blame] | 5529 | CLK_LOOKUP("bit_clk", codec_i2s_mic_bit_clk.c, |
| 5530 | "msm-dai-q6.1"), |
| 5531 | CLK_LOOKUP("osr_clk", codec_i2s_mic_osr_clk.c, |
| 5532 | "msm-dai-q6.1"), |
| 5533 | CLK_LOOKUP("bit_clk", spare_i2s_mic_bit_clk.c, |
| 5534 | "msm-dai-q6.5"), |
| 5535 | CLK_LOOKUP("osr_clk", spare_i2s_mic_osr_clk.c, |
| 5536 | "msm-dai-q6.5"), |
| 5537 | CLK_LOOKUP("bit_clk", codec_i2s_spkr_bit_clk.c, |
Kuirong Wang | dea7c82 | 2012-08-20 20:52:42 -0700 | [diff] [blame] | 5538 | "msm-dai-q6.0"), |
| 5539 | CLK_LOOKUP("osr_clk", codec_i2s_spkr_osr_clk.c, |
| 5540 | "msm-dai-q6.0"), |
| 5541 | CLK_LOOKUP("bit_clk", codec_i2s_spkr_bit_clk.c, |
Kuirong Wang | a9c3acc | 2012-02-09 17:00:45 -0800 | [diff] [blame] | 5542 | "msm-dai-q6.16384"), |
| 5543 | CLK_LOOKUP("osr_clk", codec_i2s_spkr_osr_clk.c, |
| 5544 | "msm-dai-q6.16384"), |
| 5545 | CLK_LOOKUP("bit_clk", spare_i2s_spkr_bit_clk.c, |
| 5546 | "msm-dai-q6.4"), |
| 5547 | CLK_LOOKUP("osr_clk", spare_i2s_spkr_osr_clk.c, |
| 5548 | "msm-dai-q6.4"), |
| 5549 | CLK_LOOKUP("pcm_clk", pcm_clk.c, "msm-dai-q6.2"), |
Kiran Kandi | 5f4ab69 | 2012-02-23 11:23:56 -0800 | [diff] [blame] | 5550 | CLK_LOOKUP("pcm_clk", pcm_clk.c, "msm-dai-q6.3"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5551 | CLK_LOOKUP("sps_slimbus_clk", sps_slimbus_clk.c, ""), |
Tianyi Gou | 44a81b0 | 2012-02-06 17:49:07 -0800 | [diff] [blame] | 5552 | CLK_LOOKUP("core_clk", audio_slimbus_clk.c, "msm_slim_ctrl.1"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5553 | CLK_LOOKUP("core_clk", jpegd_axi_clk.c, ""), |
| 5554 | CLK_LOOKUP("core_clk", vpe_axi_clk.c, ""), |
| 5555 | CLK_LOOKUP("core_clk", mdp_axi_clk.c, ""), |
| 5556 | CLK_LOOKUP("core_clk", vcap_axi_clk.c, ""), |
| 5557 | CLK_LOOKUP("core_clk", rot_axi_clk.c, ""), |
| 5558 | CLK_LOOKUP("core_clk", ijpeg_axi_clk.c, ""), |
| 5559 | CLK_LOOKUP("core_clk", vfe_axi_clk.c, ""), |
| 5560 | CLK_LOOKUP("core_clk", vcodec_axi_a_clk.c, ""), |
| 5561 | CLK_LOOKUP("core_clk", vcodec_axi_b_clk.c, ""), |
Patrick Daly | e6f48904 | 2012-07-11 15:29:15 -0700 | [diff] [blame] | 5562 | CLK_LOOKUP("core_clk", gfx3d_axi_clk.c, ""), |
Tianyi Gou | 21a0e80 | 2012-02-04 22:34:10 -0800 | [diff] [blame] | 5563 | |
| 5564 | CLK_LOOKUP("dfab_dsps_clk", dfab_dsps_clk.c, NULL), |
| 5565 | CLK_LOOKUP("core_clk", dfab_usb_hs_clk.c, "msm_otg"), |
| 5566 | CLK_LOOKUP("core_clk", dfab_usb_hs3_clk.c, "msm_ehci_host.0"), |
| 5567 | CLK_LOOKUP("core_clk", dfab_usb_hs3_clk.c, "msm_ehci_host.1"), |
| 5568 | CLK_LOOKUP("bus_clk", dfab_sdc1_clk.c, "msm_sdcc.1"), |
| 5569 | CLK_LOOKUP("bus_clk", dfab_sdc2_clk.c, "msm_sdcc.2"), |
| 5570 | CLK_LOOKUP("bus_clk", dfab_sdc3_clk.c, "msm_sdcc.3"), |
| 5571 | CLK_LOOKUP("bus_clk", dfab_sdc4_clk.c, "msm_sdcc.4"), |
| 5572 | CLK_LOOKUP("dfab_clk", dfab_sps_clk.c, "msm_sps"), |
| 5573 | CLK_LOOKUP("bus_clk", dfab_bam_dmux_clk.c, "BAM_RMNT"), |
| 5574 | CLK_LOOKUP("bus_clk", dfab_scm_clk.c, "scm"), |
| 5575 | |
Manu Gautam | 5143b25 | 2012-01-05 19:25:23 -0800 | [diff] [blame] | 5576 | CLK_LOOKUP("alt_core_clk", usb_hsic_xcvr_fs_clk.c, "msm_hsic_host"), |
| 5577 | CLK_LOOKUP("phy_clk", usb_hsic_hsic_clk.c, "msm_hsic_host"), |
| 5578 | CLK_LOOKUP("cal_clk", usb_hsic_hsio_cal_clk.c, "msm_hsic_host"), |
| 5579 | CLK_LOOKUP("core_clk", usb_hsic_system_clk.c, "msm_hsic_host"), |
| 5580 | CLK_LOOKUP("iface_clk", usb_hsic_p_clk.c, "msm_hsic_host"), |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 5581 | |
Olav Haugan | 0e22c48 | 2013-01-28 17:39:36 -0800 | [diff] [blame] | 5582 | CLK_LOOKUP("core_clk", jpegd_axi_clk.c, "msm_iommu-v0.0"), |
| 5583 | CLK_LOOKUP("core_clk", vpe_axi_clk.c, "msm_iommu-v0.1"), |
| 5584 | CLK_LOOKUP("core_clk", mdp_axi_clk.c, "msm_iommu-v0.2"), |
| 5585 | CLK_LOOKUP("core_clk", mdp_axi_clk.c, "msm_iommu-v0.3"), |
| 5586 | CLK_LOOKUP("core_clk", rot_axi_clk.c, "msm_iommu-v0.4"), |
| 5587 | CLK_LOOKUP("core_clk", ijpeg_axi_clk.c, "msm_iommu-v0.5"), |
| 5588 | CLK_LOOKUP("core_clk", vfe_axi_clk.c, "msm_iommu-v0.6"), |
| 5589 | CLK_LOOKUP("core_clk", vcodec_axi_a_clk.c, "msm_iommu-v0.7"), |
| 5590 | CLK_LOOKUP("core_clk", vcodec_axi_b_clk.c, "msm_iommu-v0.8"), |
| 5591 | CLK_LOOKUP("core_clk", gfx3d_axi_clk.c, "msm_iommu-v0.9"), |
| 5592 | CLK_LOOKUP("core_clk", gfx3d_axi_clk.c, "msm_iommu-v0.10"), |
Patrick Daly | e6f48904 | 2012-07-11 15:29:15 -0700 | [diff] [blame] | 5593 | |
Olav Haugan | 0e22c48 | 2013-01-28 17:39:36 -0800 | [diff] [blame] | 5594 | CLK_LOOKUP("core_clk", vcap_axi_clk.c, "msm_iommu-v0.11"), |
Stepan Moskovchenko | 279b785 | 2012-01-31 20:42:46 -0800 | [diff] [blame] | 5595 | |
Deepak Kotur | 954b178 | 2012-04-24 17:58:19 -0700 | [diff] [blame] | 5596 | CLK_LOOKUP("mdp_iommu_clk", mdp_axi_clk.c, "msm_vidc.0"), |
| 5597 | CLK_LOOKUP("rot_iommu_clk", rot_axi_clk.c, "msm_vidc.0"), |
| 5598 | CLK_LOOKUP("vcodec_iommu0_clk", vcodec_axi_a_clk.c, "msm_vidc.0"), |
| 5599 | CLK_LOOKUP("vcodec_iommu1_clk", vcodec_axi_b_clk.c, "msm_vidc.0"), |
| 5600 | CLK_LOOKUP("smmu_iface_clk", smmu_p_clk.c, "msm_vidc.0"), |
Stephen Boyd | 7b973de | 2012-03-09 12:26:16 -0800 | [diff] [blame] | 5601 | CLK_LOOKUP("core_clk", vcodec_axi_clk.c, "pil_vidc"), |
| 5602 | CLK_LOOKUP("smmu_iface_clk", smmu_p_clk.c, "pil_vidc"), |
| 5603 | |
Jeff Ohlstein | 8c116c7 | 2011-10-27 17:34:48 -0700 | [diff] [blame] | 5604 | CLK_LOOKUP("mem_clk", ebi1_adm_clk.c, "msm_dmov"), |
Matt Wagantall | 33bac7e | 2012-05-22 14:59:05 -0700 | [diff] [blame] | 5605 | CLK_LOOKUP("mem_clk", ebi1_acpu_a_clk.c, ""), |
| 5606 | CLK_LOOKUP("bus_clk", afab_acpu_a_clk.c, ""), |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 5607 | |
Matt Wagantall | c33c1ed | 2012-07-23 17:19:08 -0700 | [diff] [blame] | 5608 | CLK_LOOKUP("reset1_clk", dsi1_reset_clk.c, "footswitch-8x60.4"), |
| 5609 | CLK_LOOKUP("reset2_clk", dsi2_reset_clk.c, "footswitch-8x60.4"), |
Matt Wagantall | 735e41b | 2012-07-23 17:18:58 -0700 | [diff] [blame] | 5610 | |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5611 | CLK_LOOKUP("l2_mclk", l2_m_clk, ""), |
| 5612 | CLK_LOOKUP("krait0_mclk", krait0_m_clk, ""), |
| 5613 | CLK_LOOKUP("krait1_mclk", krait1_m_clk, ""), |
Tianyi Gou | 455c13c | 2012-02-02 16:33:24 -0800 | [diff] [blame] | 5614 | CLK_LOOKUP("krait2_mclk", krait2_m_clk, ""), |
| 5615 | CLK_LOOKUP("krait3_mclk", krait3_m_clk, ""), |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 5616 | }; |
| 5617 | |
Patrick Daly | e6f48904 | 2012-07-11 15:29:15 -0700 | [diff] [blame] | 5618 | static struct clk_lookup msm_clocks_8960_common[] __initdata = { |
Stephen Boyd | 72a8035 | 2012-01-26 15:57:38 -0800 | [diff] [blame] | 5619 | CLK_LOOKUP("xo", cxo_a_clk.c, ""), |
| 5620 | CLK_LOOKUP("xo", pxo_a_clk.c, ""), |
Stephen Boyd | ed630b0 | 2012-01-26 15:26:47 -0800 | [diff] [blame] | 5621 | CLK_LOOKUP("cxo", cxo_clk.c, "wcnss_wlan.0"), |
| 5622 | CLK_LOOKUP("cxo", cxo_clk.c, "pil_riva"), |
Stephen Boyd | bdb53f3 | 2012-06-05 18:39:47 -0700 | [diff] [blame] | 5623 | CLK_LOOKUP("xo", pxo_clk.c, "pil-q6v4-lpass"), |
| 5624 | CLK_LOOKUP("xo", cxo_clk.c, "pil-q6v4-modem"), |
Stephen Boyd | 69d35e3 | 2012-02-14 15:33:30 -0800 | [diff] [blame] | 5625 | CLK_LOOKUP("xo", cxo_clk.c, "BAM_RMNT"), |
Stephen Boyd | 5a190a8 | 2012-03-01 14:45:15 -0800 | [diff] [blame] | 5626 | CLK_LOOKUP("xo", cxo_clk.c, "msm_xo"), |
David Collins | a7d2353 | 2012-08-02 10:48:16 -0700 | [diff] [blame] | 5627 | CLK_LOOKUP("vref_buff", cxo_clk.c, "rpm-regulator"), |
Stephen Boyd | ed630b0 | 2012-01-26 15:26:47 -0800 | [diff] [blame] | 5628 | CLK_LOOKUP("pll2", pll2_clk.c, NULL), |
| 5629 | CLK_LOOKUP("pll8", pll8_clk.c, NULL), |
| 5630 | CLK_LOOKUP("pll4", pll4_clk.c, NULL), |
| 5631 | CLK_LOOKUP("measure", measure_clk.c, "debug"), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5632 | |
Matt Wagantall | d75f131 | 2012-05-23 16:17:35 -0700 | [diff] [blame] | 5633 | CLK_LOOKUP("bus_clk", afab_clk.c, ""), |
| 5634 | CLK_LOOKUP("bus_clk", afab_a_clk.c, ""), |
| 5635 | CLK_LOOKUP("bus_clk", cfpb_clk.c, ""), |
| 5636 | CLK_LOOKUP("bus_clk", cfpb_a_clk.c, ""), |
| 5637 | CLK_LOOKUP("bus_clk", dfab_clk.c, ""), |
| 5638 | CLK_LOOKUP("bus_clk", dfab_a_clk.c, ""), |
| 5639 | CLK_LOOKUP("mem_clk", ebi1_clk.c, ""), |
| 5640 | CLK_LOOKUP("mem_clk", ebi1_a_clk.c, ""), |
| 5641 | CLK_LOOKUP("bus_clk", mmfab_clk.c, ""), |
| 5642 | CLK_LOOKUP("bus_clk", mmfab_a_clk.c, ""), |
| 5643 | CLK_LOOKUP("bus_clk", mmfpb_clk.c, ""), |
| 5644 | CLK_LOOKUP("bus_clk", mmfpb_a_clk.c, ""), |
| 5645 | CLK_LOOKUP("bus_clk", sfab_clk.c, ""), |
| 5646 | CLK_LOOKUP("bus_clk", sfab_a_clk.c, ""), |
| 5647 | CLK_LOOKUP("bus_clk", sfpb_clk.c, ""), |
| 5648 | CLK_LOOKUP("bus_clk", sfpb_a_clk.c, ""), |
| 5649 | |
Matt Wagantall | b2710b8 | 2011-11-16 19:55:17 -0800 | [diff] [blame] | 5650 | CLK_LOOKUP("bus_clk", afab_clk.c, "msm_apps_fab"), |
Matt Wagantall | 33bac7e | 2012-05-22 14:59:05 -0700 | [diff] [blame] | 5651 | CLK_LOOKUP("bus_a_clk", afab_msmbus_a_clk.c, "msm_apps_fab"), |
Matt Wagantall | b2710b8 | 2011-11-16 19:55:17 -0800 | [diff] [blame] | 5652 | CLK_LOOKUP("bus_clk", cfpb_clk.c, "msm_cpss_fpb"), |
| 5653 | CLK_LOOKUP("bus_a_clk", cfpb_a_clk.c, "msm_cpss_fpb"), |
| 5654 | CLK_LOOKUP("bus_clk", sfab_clk.c, "msm_sys_fab"), |
Stephen Boyd | d7a143a | 2012-02-16 17:59:26 -0800 | [diff] [blame] | 5655 | 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] | 5656 | CLK_LOOKUP("bus_clk", sfpb_clk.c, "msm_sys_fpb"), |
| 5657 | CLK_LOOKUP("bus_a_clk", sfpb_a_clk.c, "msm_sys_fpb"), |
| 5658 | CLK_LOOKUP("bus_clk", mmfab_clk.c, "msm_mm_fab"), |
| 5659 | CLK_LOOKUP("bus_a_clk", mmfab_a_clk.c, "msm_mm_fab"), |
| 5660 | CLK_LOOKUP("mem_clk", ebi1_msmbus_clk.c, "msm_bus"), |
Matt Wagantall | 33bac7e | 2012-05-22 14:59:05 -0700 | [diff] [blame] | 5661 | CLK_LOOKUP("mem_a_clk", ebi1_msmbus_a_clk.c, "msm_bus"), |
Gagan Mac | bc5f81d | 2012-04-04 15:03:12 -0600 | [diff] [blame] | 5662 | CLK_LOOKUP("dfab_clk", dfab_msmbus_clk.c, "msm_bus"), |
| 5663 | CLK_LOOKUP("dfab_a_clk", dfab_msmbus_a_clk.c, "msm_bus"), |
Pratik Patel | f17b147 | 2012-05-25 22:23:52 -0700 | [diff] [blame] | 5664 | CLK_LOOKUP("core_a_clk", qdss_a_clk.c, ""), |
Pratik Patel | 3b0ca88 | 2012-06-01 16:54:14 -0700 | [diff] [blame] | 5665 | CLK_LOOKUP("core_clk", qdss_clk.c, "coresight-tpiu.0"), |
| 5666 | CLK_LOOKUP("core_clk", qdss_clk.c, "coresight-etb.0"), |
| 5667 | CLK_LOOKUP("core_clk", qdss_clk.c, "coresight-funnel.0"), |
| 5668 | CLK_LOOKUP("core_clk", qdss_clk.c, "coresight-etm.0"), |
| 5669 | CLK_LOOKUP("core_clk", qdss_clk.c, "coresight-etm.1"), |
| 5670 | CLK_LOOKUP("core_clk", qdss_clk.c, "coresight-etm.2"), |
| 5671 | CLK_LOOKUP("core_clk", qdss_clk.c, "coresight-etm.3"), |
Matt Wagantall | b2710b8 | 2011-11-16 19:55:17 -0800 | [diff] [blame] | 5672 | |
| 5673 | CLK_LOOKUP("ebi1_clk", ebi1_clk.c, NULL), |
Matt Wagantall | b2710b8 | 2011-11-16 19:55:17 -0800 | [diff] [blame] | 5674 | CLK_LOOKUP("mmfpb_clk", mmfpb_clk.c, NULL), |
| 5675 | CLK_LOOKUP("mmfpb_a_clk", mmfpb_a_clk.c, "clock-8960"), |
| 5676 | CLK_LOOKUP("cfpb_a_clk", cfpb_a_clk.c, "clock-8960"), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5677 | |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5678 | CLK_LOOKUP("core_clk", gp0_clk.c, ""), |
| 5679 | CLK_LOOKUP("core_clk", gp1_clk.c, ""), |
| 5680 | CLK_LOOKUP("core_clk", gp2_clk.c, ""), |
| 5681 | CLK_LOOKUP("core_clk", gsbi1_uart_clk.c, ""), |
| 5682 | CLK_LOOKUP("core_clk", gsbi2_uart_clk.c, ""), |
| 5683 | CLK_LOOKUP("core_clk", gsbi3_uart_clk.c, ""), |
| 5684 | CLK_LOOKUP("core_clk", gsbi4_uart_clk.c, ""), |
Matt Wagantall | e252237 | 2011-08-17 14:52:21 -0700 | [diff] [blame] | 5685 | CLK_LOOKUP("core_clk", gsbi5_uart_clk.c, "msm_serial_hsl.0"), |
| 5686 | CLK_LOOKUP("core_clk", gsbi6_uart_clk.c, "msm_serial_hs.0"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5687 | CLK_LOOKUP("core_clk", gsbi7_uart_clk.c, ""), |
Mayank Rana | 1f02d95 | 2012-07-04 19:11:20 +0530 | [diff] [blame] | 5688 | /* used on 8960 SGLTE for console */ |
Stepan Moskovchenko | 2b4b1cd | 2012-03-29 18:21:04 -0700 | [diff] [blame] | 5689 | CLK_LOOKUP("core_clk", gsbi8_uart_clk.c, "msm_serial_hsl.1"), |
Mayank Rana | 1f02d95 | 2012-07-04 19:11:20 +0530 | [diff] [blame] | 5690 | /* used on 8960 standalone with Atheros Bluetooth */ |
| 5691 | CLK_LOOKUP("core_clk", gsbi8_uart_clk.c, "msm_serial_hs.2"), |
Mayank Rana | e009c92 | 2012-03-22 03:02:06 +0530 | [diff] [blame] | 5692 | CLK_LOOKUP("core_clk", gsbi9_uart_clk.c, "msm_serial_hs.1"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5693 | CLK_LOOKUP("core_clk", gsbi10_uart_clk.c, ""), |
| 5694 | CLK_LOOKUP("core_clk", gsbi11_uart_clk.c, ""), |
| 5695 | CLK_LOOKUP("core_clk", gsbi12_uart_clk.c, ""), |
Matt Wagantall | ac29485 | 2011-08-17 15:44:58 -0700 | [diff] [blame] | 5696 | CLK_LOOKUP("core_clk", gsbi1_qup_clk.c, "spi_qsd.0"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5697 | CLK_LOOKUP("core_clk", gsbi2_qup_clk.c, ""), |
Matt Wagantall | ac29485 | 2011-08-17 15:44:58 -0700 | [diff] [blame] | 5698 | CLK_LOOKUP("core_clk", gsbi3_qup_clk.c, "qup_i2c.3"), |
| 5699 | CLK_LOOKUP("core_clk", gsbi4_qup_clk.c, "qup_i2c.4"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5700 | CLK_LOOKUP("core_clk", gsbi5_qup_clk.c, ""), |
| 5701 | CLK_LOOKUP("core_clk", gsbi6_qup_clk.c, ""), |
| 5702 | CLK_LOOKUP("core_clk", gsbi7_qup_clk.c, ""), |
| 5703 | CLK_LOOKUP("core_clk", gsbi8_qup_clk.c, ""), |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 5704 | CLK_LOOKUP("core_clk", gsbi9_qup_clk.c, ""), |
Matt Wagantall | ac29485 | 2011-08-17 15:44:58 -0700 | [diff] [blame] | 5705 | CLK_LOOKUP("core_clk", gsbi10_qup_clk.c, "qup_i2c.10"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5706 | CLK_LOOKUP("core_clk", gsbi11_qup_clk.c, ""), |
Matt Wagantall | ac29485 | 2011-08-17 15:44:58 -0700 | [diff] [blame] | 5707 | CLK_LOOKUP("core_clk", gsbi12_qup_clk.c, "qup_i2c.12"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5708 | CLK_LOOKUP("core_clk", pdm_clk.c, ""), |
Vikram Mulukutla | dd0a237 | 2011-09-19 15:58:21 -0700 | [diff] [blame] | 5709 | CLK_LOOKUP("mem_clk", pmem_clk.c, "msm_sps"), |
Matt Wagantall | c120529 | 2011-08-11 17:19:31 -0700 | [diff] [blame] | 5710 | CLK_LOOKUP("core_clk", prng_clk.c, "msm_rng.0"), |
Matt Wagantall | 37ce384 | 2011-08-17 16:00:36 -0700 | [diff] [blame] | 5711 | CLK_LOOKUP("core_clk", sdc1_clk.c, "msm_sdcc.1"), |
| 5712 | CLK_LOOKUP("core_clk", sdc2_clk.c, "msm_sdcc.2"), |
| 5713 | CLK_LOOKUP("core_clk", sdc3_clk.c, "msm_sdcc.3"), |
| 5714 | CLK_LOOKUP("core_clk", sdc4_clk.c, "msm_sdcc.4"), |
| 5715 | CLK_LOOKUP("core_clk", sdc5_clk.c, "msm_sdcc.5"), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5716 | CLK_LOOKUP("slimbus_xo_src_clk", slimbus_xo_src_clk.c, NULL), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5717 | CLK_LOOKUP("core_clk", tssc_clk.c, ""), |
Manu Gautam | 5143b25 | 2012-01-05 19:25:23 -0800 | [diff] [blame] | 5718 | CLK_LOOKUP("alt_core_clk", usb_hs1_xcvr_clk.c, "msm_otg"), |
| 5719 | CLK_LOOKUP("phy_clk", usb_phy0_clk.c, "msm_otg"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5720 | CLK_LOOKUP("alt_core_clk", usb_fs1_xcvr_clk.c, ""), |
| 5721 | CLK_LOOKUP("sys_clk", usb_fs1_sys_clk.c, ""), |
| 5722 | CLK_LOOKUP("src_clk", usb_fs1_src_clk.c, ""), |
| 5723 | CLK_LOOKUP("alt_core_clk", usb_fs2_xcvr_clk.c, ""), |
| 5724 | CLK_LOOKUP("sys_clk", usb_fs2_sys_clk.c, ""), |
| 5725 | CLK_LOOKUP("src_clk", usb_fs2_src_clk.c, ""), |
Tianyi Gou | 3022dfd | 2012-01-25 15:50:05 -0800 | [diff] [blame] | 5726 | CLK_LOOKUP("alt_core_clk", usb_hsic_xcvr_fs_clk.c, "msm_hsic_host"), |
| 5727 | CLK_LOOKUP("phy_clk", usb_hsic_hsic_clk.c, "msm_hsic_host"), |
| 5728 | CLK_LOOKUP("cal_clk", usb_hsic_hsio_cal_clk.c, "msm_hsic_host"), |
| 5729 | CLK_LOOKUP("core_clk", usb_hsic_system_clk.c, "msm_hsic_host"), |
| 5730 | CLK_LOOKUP("iface_clk", usb_hsic_p_clk.c, "msm_hsic_host"), |
Matt Wagantall | c4b3a4d | 2011-08-17 16:58:39 -0700 | [diff] [blame] | 5731 | CLK_LOOKUP("iface_clk", ce1_p_clk.c, "qce.0"), |
Matt Wagantall | e0b1145 | 2011-09-13 17:25:33 -0700 | [diff] [blame] | 5732 | CLK_LOOKUP("iface_clk", ce1_p_clk.c, "qcrypto.0"), |
Matt Wagantall | c4b3a4d | 2011-08-17 16:58:39 -0700 | [diff] [blame] | 5733 | CLK_LOOKUP("core_clk", ce1_core_clk.c, "qce.0"), |
Matt Wagantall | e0b1145 | 2011-09-13 17:25:33 -0700 | [diff] [blame] | 5734 | CLK_LOOKUP("core_clk", ce1_core_clk.c, "qcrypto.0"), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5735 | CLK_LOOKUP("dma_bam_pclk", dma_bam_p_clk.c, NULL), |
Matt Wagantall | ac29485 | 2011-08-17 15:44:58 -0700 | [diff] [blame] | 5736 | CLK_LOOKUP("iface_clk", gsbi1_p_clk.c, "spi_qsd.0"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5737 | CLK_LOOKUP("iface_clk", gsbi2_p_clk.c, ""), |
Matt Wagantall | ac29485 | 2011-08-17 15:44:58 -0700 | [diff] [blame] | 5738 | CLK_LOOKUP("iface_clk", gsbi3_p_clk.c, "qup_i2c.3"), |
| 5739 | CLK_LOOKUP("iface_clk", gsbi4_p_clk.c, "qup_i2c.4"), |
Matt Wagantall | e252237 | 2011-08-17 14:52:21 -0700 | [diff] [blame] | 5740 | CLK_LOOKUP("iface_clk", gsbi5_p_clk.c, "msm_serial_hsl.0"), |
| 5741 | CLK_LOOKUP("iface_clk", gsbi6_p_clk.c, "msm_serial_hs.0"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5742 | CLK_LOOKUP("iface_clk", gsbi7_p_clk.c, ""), |
Mayank Rana | 1f02d95 | 2012-07-04 19:11:20 +0530 | [diff] [blame] | 5743 | /* used on 8960 SGLTE for serial console */ |
Stepan Moskovchenko | 2b4b1cd | 2012-03-29 18:21:04 -0700 | [diff] [blame] | 5744 | CLK_LOOKUP("iface_clk", gsbi8_p_clk.c, "msm_serial_hsl.1"), |
Mayank Rana | 1f02d95 | 2012-07-04 19:11:20 +0530 | [diff] [blame] | 5745 | /* used on 8960 standalone with Atheros Bluetooth */ |
| 5746 | CLK_LOOKUP("iface_clk", gsbi8_p_clk.c, "msm_serial_hs.2"), |
Mayank Rana | e009c92 | 2012-03-22 03:02:06 +0530 | [diff] [blame] | 5747 | CLK_LOOKUP("iface_clk", gsbi9_p_clk.c, "msm_serial_hs.1"), |
Matt Wagantall | ac29485 | 2011-08-17 15:44:58 -0700 | [diff] [blame] | 5748 | CLK_LOOKUP("iface_clk", gsbi10_p_clk.c, "qup_i2c.10"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5749 | CLK_LOOKUP("iface_clk", gsbi11_p_clk.c, ""), |
Matt Wagantall | ac29485 | 2011-08-17 15:44:58 -0700 | [diff] [blame] | 5750 | CLK_LOOKUP("iface_clk", gsbi12_p_clk.c, "qup_i2c.12"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5751 | CLK_LOOKUP("iface_clk", tsif_p_clk.c, ""), |
Joel Nider | 6d7d16c | 2012-05-30 18:02:42 +0300 | [diff] [blame] | 5752 | CLK_LOOKUP("ref_clk", tsif_ref_clk.c, "msm_tspp.0"), |
| 5753 | CLK_LOOKUP("iface_clk", tsif_p_clk.c, "msm_tspp.0"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5754 | CLK_LOOKUP("iface_clk", usb_fs1_p_clk.c, ""), |
| 5755 | CLK_LOOKUP("iface_clk", usb_fs2_p_clk.c, ""), |
Manu Gautam | 5143b25 | 2012-01-05 19:25:23 -0800 | [diff] [blame] | 5756 | CLK_LOOKUP("iface_clk", usb_hs1_p_clk.c, "msm_otg"), |
Matt Wagantall | 37ce384 | 2011-08-17 16:00:36 -0700 | [diff] [blame] | 5757 | CLK_LOOKUP("iface_clk", sdc1_p_clk.c, "msm_sdcc.1"), |
| 5758 | CLK_LOOKUP("iface_clk", sdc2_p_clk.c, "msm_sdcc.2"), |
| 5759 | CLK_LOOKUP("iface_clk", sdc3_p_clk.c, "msm_sdcc.3"), |
| 5760 | CLK_LOOKUP("iface_clk", sdc4_p_clk.c, "msm_sdcc.4"), |
| 5761 | CLK_LOOKUP("iface_clk", sdc5_p_clk.c, "msm_sdcc.5"), |
Matt Wagantall | e1a8606 | 2011-08-18 17:46:10 -0700 | [diff] [blame] | 5762 | CLK_LOOKUP("core_clk", adm0_clk.c, "msm_dmov"), |
| 5763 | CLK_LOOKUP("iface_clk", adm0_p_clk.c, "msm_dmov"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5764 | CLK_LOOKUP("iface_clk", pmic_arb0_p_clk.c, ""), |
| 5765 | CLK_LOOKUP("iface_clk", pmic_arb1_p_clk.c, ""), |
| 5766 | CLK_LOOKUP("core_clk", pmic_ssbi2_clk.c, ""), |
| 5767 | CLK_LOOKUP("mem_clk", rpm_msg_ram_p_clk.c, ""), |
Kevin Chan | 09f4e66 | 2011-12-16 08:17:02 -0800 | [diff] [blame] | 5768 | CLK_LOOKUP("cam_clk", cam0_clk.c, "4-001a"), |
| 5769 | CLK_LOOKUP("cam_clk", cam0_clk.c, "4-006c"), |
| 5770 | CLK_LOOKUP("cam_clk", cam0_clk.c, "4-0048"), |
Tianyi Gou | 3022dfd | 2012-01-25 15:50:05 -0800 | [diff] [blame] | 5771 | CLK_LOOKUP("cam_clk", cam2_clk.c, NULL), |
Sreesudhan Ramakrish Ramkumar | 8f11b8b | 2012-01-04 17:09:05 -0800 | [diff] [blame] | 5772 | CLK_LOOKUP("cam_clk", cam0_clk.c, "4-0020"), |
Sreesudhan Ramakrish Ramkumar | 3381da7 | 2012-01-27 08:08:32 -0800 | [diff] [blame] | 5773 | CLK_LOOKUP("cam_clk", cam0_clk.c, "4-0034"), |
Punit Soni | 5785010 | 2012-09-26 11:31:27 -0700 | [diff] [blame] | 5774 | CLK_LOOKUP("cam_clk", cam0_clk.c, "4-0010"), |
Kevin Chan | c8b52e8 | 2011-10-25 23:20:21 -0700 | [diff] [blame] | 5775 | CLK_LOOKUP("csi_src_clk", csi0_src_clk.c, "msm_csid.0"), |
| 5776 | 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] | 5777 | CLK_LOOKUP("csi_src_clk", csi2_src_clk.c, "msm_csid.2"), |
Kevin Chan | c8b52e8 | 2011-10-25 23:20:21 -0700 | [diff] [blame] | 5778 | CLK_LOOKUP("csi_clk", csi0_clk.c, "msm_csid.0"), |
| 5779 | CLK_LOOKUP("csi_clk", csi1_clk.c, "msm_csid.1"), |
Sreesudhan Ramakrish Ramkumar | b1edcd0 | 2012-01-17 11:33:05 -0800 | [diff] [blame] | 5780 | CLK_LOOKUP("csi_clk", csi2_clk.c, "msm_csid.2"), |
Kevin Chan | c8b52e8 | 2011-10-25 23:20:21 -0700 | [diff] [blame] | 5781 | CLK_LOOKUP("csi_phy_clk", csi0_phy_clk.c, "msm_csid.0"), |
| 5782 | 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] | 5783 | CLK_LOOKUP("csi_phy_clk", csi2_phy_clk.c, "msm_csid.2"), |
Kevin Chan | e12c667 | 2011-10-26 11:55:26 -0700 | [diff] [blame] | 5784 | CLK_LOOKUP("csi_pix_clk", csi_pix_clk.c, "msm_ispif.0"), |
| 5785 | CLK_LOOKUP("csi_rdi_clk", csi_rdi_clk.c, "msm_ispif.0"), |
Tianyi Gou | 3022dfd | 2012-01-25 15:50:05 -0800 | [diff] [blame] | 5786 | CLK_LOOKUP("csi_src_clk", csi2_src_clk.c, NULL), |
| 5787 | CLK_LOOKUP("csi_clk", csi2_clk.c, NULL), |
| 5788 | CLK_LOOKUP("csi_pix1_clk", csi_pix1_clk.c, "msm_ispif.0"), |
| 5789 | CLK_LOOKUP("csi_rdi1_clk", csi_rdi1_clk.c, "msm_ispif.0"), |
| 5790 | CLK_LOOKUP("csi_rdi2_clk", csi_rdi2_clk.c, "msm_ispif.0"), |
| 5791 | CLK_LOOKUP("csi_phy_clk", csi2_phy_clk.c, NULL), |
| 5792 | CLK_LOOKUP("csi2phy_timer_clk", csi2phy_timer_clk.c, NULL), |
Kevin Chan | f6216f2 | 2011-10-25 18:40:11 -0700 | [diff] [blame] | 5793 | CLK_LOOKUP("csiphy_timer_src_clk", |
| 5794 | csiphy_timer_src_clk.c, "msm_csiphy.0"), |
| 5795 | CLK_LOOKUP("csiphy_timer_src_clk", |
| 5796 | csiphy_timer_src_clk.c, "msm_csiphy.1"), |
Sreesudhan Ramakrish Ramkumar | b1edcd0 | 2012-01-17 11:33:05 -0800 | [diff] [blame] | 5797 | CLK_LOOKUP("csiphy_timer_src_clk", |
| 5798 | csiphy_timer_src_clk.c, "msm_csiphy.2"), |
Kevin Chan | f6216f2 | 2011-10-25 18:40:11 -0700 | [diff] [blame] | 5799 | CLK_LOOKUP("csiphy_timer_clk", csi0phy_timer_clk.c, "msm_csiphy.0"), |
| 5800 | 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] | 5801 | CLK_LOOKUP("csiphy_timer_clk", csi2phy_timer_clk.c, "msm_csiphy.2"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 5802 | CLK_LOOKUP("byte_clk", dsi1_byte_clk.c, "mipi_dsi.1"), |
| 5803 | CLK_LOOKUP("byte_clk", dsi2_byte_clk.c, "mipi_dsi.2"), |
| 5804 | CLK_LOOKUP("esc_clk", dsi1_esc_clk.c, "mipi_dsi.1"), |
| 5805 | CLK_LOOKUP("esc_clk", dsi2_esc_clk.c, "mipi_dsi.2"), |
Matt Wagantall | 9dc0163 | 2011-08-17 18:55:04 -0700 | [diff] [blame] | 5806 | CLK_LOOKUP("core_clk", gfx3d_clk.c, "kgsl-3d0.0"), |
Matt Wagantall | 4972271 | 2011-08-17 18:50:53 -0700 | [diff] [blame] | 5807 | CLK_LOOKUP("core_clk", gfx3d_clk.c, "footswitch-8x60.2"), |
| 5808 | CLK_LOOKUP("bus_clk", ijpeg_axi_clk.c, "footswitch-8x60.3"), |
Matt Wagantall | f45cd36 | 2012-05-03 21:09:44 -0700 | [diff] [blame] | 5809 | CLK_LOOKUP("mem_clk", imem_axi_clk.c, "msm_gemini.0"), |
| 5810 | CLK_LOOKUP("core_clk", ijpeg_clk.c, "msm_gemini.0"), |
Matt Wagantall | 4972271 | 2011-08-17 18:50:53 -0700 | [diff] [blame] | 5811 | CLK_LOOKUP("core_clk", ijpeg_clk.c, "footswitch-8x60.3"), |
Kalyani Oruganti | 465d1e1 | 2012-05-15 10:23:05 -0700 | [diff] [blame] | 5812 | CLK_LOOKUP("core_clk", jpegd_clk.c, "msm_mercury.0"), |
| 5813 | CLK_LOOKUP("iface_clk", jpegd_p_clk.c, "msm_mercury.0"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 5814 | CLK_LOOKUP("core_clk", mdp_clk.c, "mdp.0"), |
Matt Wagantall | 4972271 | 2011-08-17 18:50:53 -0700 | [diff] [blame] | 5815 | CLK_LOOKUP("core_clk", mdp_clk.c, "footswitch-8x60.4"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 5816 | CLK_LOOKUP("vsync_clk", mdp_vsync_clk.c, "mdp.0"), |
Matt Wagantall | b82a513 | 2011-12-12 22:26:41 -0800 | [diff] [blame] | 5817 | CLK_LOOKUP("vsync_clk", mdp_vsync_clk.c, "footswitch-8x60.4"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 5818 | CLK_LOOKUP("lut_clk", lut_mdp_clk.c, "mdp.0"), |
Matt Wagantall | b82a513 | 2011-12-12 22:26:41 -0800 | [diff] [blame] | 5819 | CLK_LOOKUP("lut_clk", lut_mdp_clk.c, "footswitch-8x60.4"), |
Matt Wagantall | bb90da9 | 2011-10-25 15:07:52 -0700 | [diff] [blame] | 5820 | CLK_LOOKUP("core_clk", rot_clk.c, "msm_rotator.0"), |
Matt Wagantall | 4972271 | 2011-08-17 18:50:53 -0700 | [diff] [blame] | 5821 | CLK_LOOKUP("core_clk", rot_clk.c, "footswitch-8x60.6"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 5822 | CLK_LOOKUP("src_clk", tv_src_clk.c, "dtv.0"), |
| 5823 | CLK_LOOKUP("src_clk", tv_src_clk.c, "tvenc.0"), |
Matt Wagantall | b82a513 | 2011-12-12 22:26:41 -0800 | [diff] [blame] | 5824 | CLK_LOOKUP("tv_src_clk", tv_src_clk.c, "footswitch-8x60.4"), |
Matt Wagantall | 3f7660b | 2011-08-17 21:25:13 -0700 | [diff] [blame] | 5825 | CLK_LOOKUP("core_clk", vcodec_clk.c, "msm_vidc.0"), |
Matt Wagantall | 4972271 | 2011-08-17 18:50:53 -0700 | [diff] [blame] | 5826 | CLK_LOOKUP("core_clk", vcodec_clk.c, "footswitch-8x60.7"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 5827 | CLK_LOOKUP("mdp_clk", mdp_tv_clk.c, "dtv.0"), |
| 5828 | CLK_LOOKUP("mdp_clk", mdp_tv_clk.c, "tvenc.0"), |
Matt Wagantall | b82a513 | 2011-12-12 22:26:41 -0800 | [diff] [blame] | 5829 | CLK_LOOKUP("tv_clk", mdp_tv_clk.c, "footswitch-8x60.4"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 5830 | CLK_LOOKUP("hdmi_clk", hdmi_tv_clk.c, "dtv.0"), |
Matt Wagantall | 5a4f1ba | 2011-08-18 18:13:03 -0700 | [diff] [blame] | 5831 | CLK_LOOKUP("core_clk", hdmi_app_clk.c, "hdmi_msm.1"), |
Kevin Chan | a085312 | 2011-11-07 19:48:44 -0800 | [diff] [blame] | 5832 | CLK_LOOKUP("vpe_clk", vpe_clk.c, "msm_vpe.0"), |
Matt Wagantall | 4972271 | 2011-08-17 18:50:53 -0700 | [diff] [blame] | 5833 | CLK_LOOKUP("core_clk", vpe_clk.c, "footswitch-8x60.9"), |
Kevin Chan | 5827c55 | 2011-10-28 18:36:32 -0700 | [diff] [blame] | 5834 | CLK_LOOKUP("vfe_clk", vfe_clk.c, "msm_vfe.0"), |
Matt Wagantall | 4972271 | 2011-08-17 18:50:53 -0700 | [diff] [blame] | 5835 | CLK_LOOKUP("core_clk", vfe_clk.c, "footswitch-8x60.8"), |
Kevin Chan | 5827c55 | 2011-10-28 18:36:32 -0700 | [diff] [blame] | 5836 | CLK_LOOKUP("csi_vfe_clk", csi_vfe_clk.c, "msm_vfe.0"), |
Matt Wagantall | 4972271 | 2011-08-17 18:50:53 -0700 | [diff] [blame] | 5837 | CLK_LOOKUP("bus_clk", vfe_axi_clk.c, "footswitch-8x60.8"), |
| 5838 | CLK_LOOKUP("bus_clk", mdp_axi_clk.c, "footswitch-8x60.4"), |
| 5839 | CLK_LOOKUP("bus_clk", rot_axi_clk.c, "footswitch-8x60.6"), |
| 5840 | CLK_LOOKUP("bus_clk", vcodec_axi_clk.c, "footswitch-8x60.7"), |
| 5841 | CLK_LOOKUP("bus_a_clk", vcodec_axi_a_clk.c, "footswitch-8x60.7"), |
| 5842 | CLK_LOOKUP("bus_b_clk", vcodec_axi_b_clk.c, "footswitch-8x60.7"), |
| 5843 | CLK_LOOKUP("bus_clk", vpe_axi_clk.c, "footswitch-8x60.9"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 5844 | CLK_LOOKUP("arb_clk", amp_p_clk.c, "mipi_dsi.1"), |
| 5845 | CLK_LOOKUP("arb_clk", amp_p_clk.c, "mipi_dsi.2"), |
Kevin Chan | c8b52e8 | 2011-10-25 23:20:21 -0700 | [diff] [blame] | 5846 | CLK_LOOKUP("csi_pclk", csi_p_clk.c, "msm_csid.0"), |
| 5847 | CLK_LOOKUP("csi_pclk", csi_p_clk.c, "msm_csid.1"), |
Sreesudhan Ramakrish Ramkumar | b1edcd0 | 2012-01-17 11:33:05 -0800 | [diff] [blame] | 5848 | CLK_LOOKUP("csi_pclk", csi_p_clk.c, "msm_csid.2"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 5849 | CLK_LOOKUP("master_iface_clk", dsi1_m_p_clk.c, "mipi_dsi.1"), |
| 5850 | CLK_LOOKUP("slave_iface_clk", dsi1_s_p_clk.c, "mipi_dsi.1"), |
| 5851 | CLK_LOOKUP("master_iface_clk", dsi2_m_p_clk.c, "mipi_dsi.2"), |
| 5852 | 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] | 5853 | CLK_LOOKUP("iface_clk", gfx3d_p_clk.c, "kgsl-3d0.0"), |
Matt Wagantall | 4972271 | 2011-08-17 18:50:53 -0700 | [diff] [blame] | 5854 | CLK_LOOKUP("iface_clk", gfx3d_p_clk.c, "footswitch-8x60.2"), |
Matt Wagantall | 5a4f1ba | 2011-08-18 18:13:03 -0700 | [diff] [blame] | 5855 | CLK_LOOKUP("master_iface_clk", hdmi_m_p_clk.c, "hdmi_msm.1"), |
| 5856 | 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] | 5857 | CLK_LOOKUP("iface_clk", ijpeg_p_clk.c, "msm_gemini.0"), |
Matt Wagantall | 4972271 | 2011-08-17 18:50:53 -0700 | [diff] [blame] | 5858 | CLK_LOOKUP("iface_clk", ijpeg_p_clk.c, "footswitch-8x60.3"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5859 | CLK_LOOKUP("iface_clk", jpegd_p_clk.c, ""), |
Matt Wagantall | 5d44ef2 | 2012-01-23 11:01:05 -0800 | [diff] [blame] | 5860 | CLK_LOOKUP("mem_iface_clk", imem_p_clk.c, "kgsl-3d0.0"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 5861 | CLK_LOOKUP("iface_clk", mdp_p_clk.c, "mdp.0"), |
Matt Wagantall | 4972271 | 2011-08-17 18:50:53 -0700 | [diff] [blame] | 5862 | CLK_LOOKUP("iface_clk", mdp_p_clk.c, "footswitch-8x60.4"), |
Olav Haugan | 0e22c48 | 2013-01-28 17:39:36 -0800 | [diff] [blame] | 5863 | CLK_LOOKUP("iface_clk", smmu_p_clk.c, "msm_iommu-v0.0"), |
| 5864 | CLK_LOOKUP("iface_clk", smmu_p_clk.c, "msm_iommu-v0.1"), |
| 5865 | CLK_LOOKUP("iface_clk", smmu_p_clk.c, "msm_iommu-v0.2"), |
| 5866 | CLK_LOOKUP("iface_clk", smmu_p_clk.c, "msm_iommu-v0.3"), |
| 5867 | CLK_LOOKUP("iface_clk", smmu_p_clk.c, "msm_iommu-v0.4"), |
| 5868 | CLK_LOOKUP("iface_clk", smmu_p_clk.c, "msm_iommu-v0.5"), |
| 5869 | CLK_LOOKUP("iface_clk", smmu_p_clk.c, "msm_iommu-v0.6"), |
| 5870 | CLK_LOOKUP("iface_clk", smmu_p_clk.c, "msm_iommu-v0.7"), |
| 5871 | CLK_LOOKUP("iface_clk", smmu_p_clk.c, "msm_iommu-v0.8"), |
| 5872 | CLK_LOOKUP("iface_clk", smmu_p_clk.c, "msm_iommu-v0.9"), |
Matt Wagantall | bb90da9 | 2011-10-25 15:07:52 -0700 | [diff] [blame] | 5873 | CLK_LOOKUP("iface_clk", rot_p_clk.c, "msm_rotator.0"), |
Matt Wagantall | 4972271 | 2011-08-17 18:50:53 -0700 | [diff] [blame] | 5874 | CLK_LOOKUP("iface_clk", rot_p_clk.c, "footswitch-8x60.6"), |
Matt Wagantall | 3f7660b | 2011-08-17 21:25:13 -0700 | [diff] [blame] | 5875 | CLK_LOOKUP("iface_clk", vcodec_p_clk.c, "msm_vidc.0"), |
Matt Wagantall | 4972271 | 2011-08-17 18:50:53 -0700 | [diff] [blame] | 5876 | CLK_LOOKUP("iface_clk", vcodec_p_clk.c, "footswitch-8x60.7"), |
Kevin Chan | 5827c55 | 2011-10-28 18:36:32 -0700 | [diff] [blame] | 5877 | CLK_LOOKUP("vfe_pclk", vfe_p_clk.c, "msm_vfe.0"), |
Matt Wagantall | 4972271 | 2011-08-17 18:50:53 -0700 | [diff] [blame] | 5878 | CLK_LOOKUP("iface_clk", vfe_p_clk.c, "footswitch-8x60.8"), |
Kevin Chan | a085312 | 2011-11-07 19:48:44 -0800 | [diff] [blame] | 5879 | CLK_LOOKUP("vpe_pclk", vpe_p_clk.c, "msm_vpe.0"), |
Matt Wagantall | 4972271 | 2011-08-17 18:50:53 -0700 | [diff] [blame] | 5880 | CLK_LOOKUP("iface_clk", vpe_p_clk.c, "footswitch-8x60.9"), |
Patrick Lai | 04baee94 | 2012-05-01 14:38:47 -0700 | [diff] [blame] | 5881 | CLK_LOOKUP("bit_clk", mi2s_bit_clk.c, |
| 5882 | "msm-dai-q6-mi2s"), |
| 5883 | CLK_LOOKUP("osr_clk", mi2s_osr_clk.c, |
| 5884 | "msm-dai-q6-mi2s"), |
Kuirong Wang | a9c3acc | 2012-02-09 17:00:45 -0800 | [diff] [blame] | 5885 | CLK_LOOKUP("bit_clk", codec_i2s_mic_bit_clk.c, |
| 5886 | "msm-dai-q6.1"), |
| 5887 | CLK_LOOKUP("osr_clk", codec_i2s_mic_osr_clk.c, |
| 5888 | "msm-dai-q6.1"), |
| 5889 | CLK_LOOKUP("bit_clk", spare_i2s_mic_bit_clk.c, |
| 5890 | "msm-dai-q6.5"), |
| 5891 | CLK_LOOKUP("osr_clk", spare_i2s_mic_osr_clk.c, |
| 5892 | "msm-dai-q6.5"), |
| 5893 | CLK_LOOKUP("bit_clk", codec_i2s_spkr_bit_clk.c, |
Kuirong Wang | dea7c82 | 2012-08-20 20:52:42 -0700 | [diff] [blame] | 5894 | "msm-dai-q6.0"), |
| 5895 | CLK_LOOKUP("osr_clk", codec_i2s_spkr_osr_clk.c, |
| 5896 | "msm-dai-q6.0"), |
| 5897 | CLK_LOOKUP("bit_clk", codec_i2s_spkr_bit_clk.c, |
Kuirong Wang | a9c3acc | 2012-02-09 17:00:45 -0800 | [diff] [blame] | 5898 | "msm-dai-q6.16384"), |
| 5899 | CLK_LOOKUP("osr_clk", codec_i2s_spkr_osr_clk.c, |
| 5900 | "msm-dai-q6.16384"), |
| 5901 | CLK_LOOKUP("bit_clk", spare_i2s_spkr_bit_clk.c, |
| 5902 | "msm-dai-q6.4"), |
| 5903 | CLK_LOOKUP("osr_clk", spare_i2s_spkr_osr_clk.c, |
| 5904 | "msm-dai-q6.4"), |
| 5905 | CLK_LOOKUP("pcm_clk", pcm_clk.c, "msm-dai-q6.2"), |
Kiran Kandi | 5f4ab69 | 2012-02-23 11:23:56 -0800 | [diff] [blame] | 5906 | CLK_LOOKUP("pcm_clk", pcm_clk.c, "msm-dai-q6.3"), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5907 | CLK_LOOKUP("sps_slimbus_clk", sps_slimbus_clk.c, NULL), |
Tianyi Gou | 44a81b0 | 2012-02-06 17:49:07 -0800 | [diff] [blame] | 5908 | CLK_LOOKUP("core_clk", audio_slimbus_clk.c, "msm_slim_ctrl.1"), |
Olav Haugan | 0e22c48 | 2013-01-28 17:39:36 -0800 | [diff] [blame] | 5909 | CLK_LOOKUP("core_clk", jpegd_axi_clk.c, "msm_iommu-v0.0"), |
| 5910 | CLK_LOOKUP("core_clk", vpe_axi_clk.c, "msm_iommu-v0.1"), |
| 5911 | CLK_LOOKUP("core_clk", mdp_axi_clk.c, "msm_iommu-v0.2"), |
| 5912 | CLK_LOOKUP("core_clk", mdp_axi_clk.c, "msm_iommu-v0.3"), |
| 5913 | CLK_LOOKUP("core_clk", rot_axi_clk.c, "msm_iommu-v0.4"), |
| 5914 | CLK_LOOKUP("core_clk", ijpeg_axi_clk.c, "msm_iommu-v0.5"), |
| 5915 | CLK_LOOKUP("core_clk", vfe_axi_clk.c, "msm_iommu-v0.6"), |
| 5916 | CLK_LOOKUP("core_clk", vcodec_axi_a_clk.c, "msm_iommu-v0.7"), |
| 5917 | CLK_LOOKUP("core_clk", vcodec_axi_b_clk.c, "msm_iommu-v0.8"), |
| 5918 | CLK_LOOKUP("core_clk", gfx3d_clk.c, "msm_iommu-v0.9"), |
Gopikrishnaiah Anandan | 4d05ed3 | 2012-01-13 11:08:44 -0800 | [diff] [blame] | 5919 | |
| 5920 | CLK_LOOKUP("mdp_iommu_clk", mdp_axi_clk.c, "msm_vidc.0"), |
| 5921 | CLK_LOOKUP("rot_iommu_clk", rot_axi_clk.c, "msm_vidc.0"), |
| 5922 | CLK_LOOKUP("vcodec_iommu0_clk", vcodec_axi_a_clk.c, "msm_vidc.0"), |
| 5923 | CLK_LOOKUP("vcodec_iommu1_clk", vcodec_axi_b_clk.c, "msm_vidc.0"), |
| 5924 | CLK_LOOKUP("smmu_iface_clk", smmu_p_clk.c, "msm_vidc.0"), |
Stephen Boyd | 7b973de | 2012-03-09 12:26:16 -0800 | [diff] [blame] | 5925 | CLK_LOOKUP("core_clk", vcodec_axi_clk.c, "pil_vidc"), |
| 5926 | CLK_LOOKUP("smmu_iface_clk", smmu_p_clk.c, "pil_vidc"), |
Gopikrishnaiah Anandan | 4d05ed3 | 2012-01-13 11:08:44 -0800 | [diff] [blame] | 5927 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5928 | CLK_LOOKUP("dfab_dsps_clk", dfab_dsps_clk.c, NULL), |
Manu Gautam | 5143b25 | 2012-01-05 19:25:23 -0800 | [diff] [blame] | 5929 | CLK_LOOKUP("core_clk", dfab_usb_hs_clk.c, "msm_otg"), |
Matt Wagantall | 37ce384 | 2011-08-17 16:00:36 -0700 | [diff] [blame] | 5930 | CLK_LOOKUP("bus_clk", dfab_sdc1_clk.c, "msm_sdcc.1"), |
| 5931 | CLK_LOOKUP("bus_clk", dfab_sdc2_clk.c, "msm_sdcc.2"), |
| 5932 | CLK_LOOKUP("bus_clk", dfab_sdc3_clk.c, "msm_sdcc.3"), |
| 5933 | CLK_LOOKUP("bus_clk", dfab_sdc4_clk.c, "msm_sdcc.4"), |
| 5934 | CLK_LOOKUP("bus_clk", dfab_sdc5_clk.c, "msm_sdcc.5"), |
Yan He | 160633e | 2011-06-30 12:18:56 -0700 | [diff] [blame] | 5935 | CLK_LOOKUP("dfab_clk", dfab_sps_clk.c, "msm_sps"), |
Stephen Boyd | 1c51a49 | 2011-10-26 12:11:47 -0700 | [diff] [blame] | 5936 | CLK_LOOKUP("bus_clk", dfab_bam_dmux_clk.c, "BAM_RMNT"), |
Stephen Boyd | ef5d1c4 | 2011-12-15 20:47:14 -0800 | [diff] [blame] | 5937 | CLK_LOOKUP("bus_clk", dfab_scm_clk.c, "scm"), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5938 | |
Matt Wagantall | e1a8606 | 2011-08-18 17:46:10 -0700 | [diff] [blame] | 5939 | CLK_LOOKUP("mem_clk", ebi1_adm_clk.c, "msm_dmov"), |
Matt Wagantall | 33bac7e | 2012-05-22 14:59:05 -0700 | [diff] [blame] | 5940 | CLK_LOOKUP("mem_clk", ebi1_acpu_a_clk.c, ""), |
| 5941 | CLK_LOOKUP("bus_clk", afab_acpu_a_clk.c, ""), |
Matt Wagantall | 8b38f94 | 2011-08-02 18:23:18 -0700 | [diff] [blame] | 5942 | |
Matt Wagantall | c33c1ed | 2012-07-23 17:19:08 -0700 | [diff] [blame] | 5943 | CLK_LOOKUP("reset1_clk", dsi1_reset_clk.c, "footswitch-8x60.4"), |
| 5944 | CLK_LOOKUP("reset2_clk", dsi2_reset_clk.c, "footswitch-8x60.4"), |
Matt Wagantall | 735e41b | 2012-07-23 17:18:58 -0700 | [diff] [blame] | 5945 | |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5946 | CLK_LOOKUP("l2_mclk", l2_m_clk, ""), |
| 5947 | CLK_LOOKUP("krait0_mclk", krait0_m_clk, ""), |
| 5948 | CLK_LOOKUP("krait1_mclk", krait1_m_clk, ""), |
| 5949 | CLK_LOOKUP("q6sw_clk", q6sw_clk, ""), |
| 5950 | CLK_LOOKUP("q6fw_clk", q6fw_clk, ""), |
| 5951 | CLK_LOOKUP("q6_func_clk", q6_func_clk, ""), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5952 | }; |
| 5953 | |
Patrick Daly | e6f48904 | 2012-07-11 15:29:15 -0700 | [diff] [blame] | 5954 | static struct clk_lookup msm_clocks_8960_only[] __initdata = { |
| 5955 | CLK_LOOKUP("enc_clk", tv_enc_clk.c, "tvenc.0"), |
| 5956 | CLK_LOOKUP("dac_clk", tv_dac_clk.c, "tvenc.0"), |
| 5957 | CLK_LOOKUP("iface_clk", tv_enc_p_clk.c, "tvenc.0"), |
| 5958 | |
| 5959 | CLK_LOOKUP("core_clk", gfx2d0_clk.c, "kgsl-2d0.0"), |
| 5960 | CLK_LOOKUP("core_clk", gfx2d0_clk.c, "footswitch-8x60.0"), |
| 5961 | CLK_LOOKUP("core_clk", gfx2d1_clk.c, "kgsl-2d1.1"), |
| 5962 | CLK_LOOKUP("core_clk", gfx2d1_clk.c, "footswitch-8x60.1"), |
| 5963 | CLK_LOOKUP("iface_clk", gfx2d0_p_clk.c, "kgsl-2d0.0"), |
| 5964 | CLK_LOOKUP("iface_clk", gfx2d0_p_clk.c, "footswitch-8x60.0"), |
| 5965 | CLK_LOOKUP("iface_clk", gfx2d1_p_clk.c, "kgsl-2d1.1"), |
| 5966 | CLK_LOOKUP("iface_clk", gfx2d1_p_clk.c, "footswitch-8x60.1"), |
Olav Haugan | 0e22c48 | 2013-01-28 17:39:36 -0800 | [diff] [blame] | 5967 | CLK_LOOKUP("iface_clk", smmu_p_clk.c, "msm_iommu-v0.10"), |
| 5968 | CLK_LOOKUP("iface_clk", smmu_p_clk.c, "msm_iommu-v0.11"), |
| 5969 | CLK_LOOKUP("core_clk", gfx2d0_clk.c, "msm_iommu-v0.10"), |
| 5970 | CLK_LOOKUP("core_clk", gfx2d1_clk.c, "msm_iommu-v0.11"), |
Patrick Daly | e6f48904 | 2012-07-11 15:29:15 -0700 | [diff] [blame] | 5971 | }; |
| 5972 | |
| 5973 | static struct clk_lookup msm_clocks_8960ab_only[] __initdata = { |
| 5974 | CLK_LOOKUP("bus_clk", gfx3d_axi_clk.c, "footswitch-8x60.2"), |
Olav Haugan | 0e22c48 | 2013-01-28 17:39:36 -0800 | [diff] [blame] | 5975 | CLK_LOOKUP("iface_clk", smmu_p_clk.c, "msm_iommu-v0.10"), |
| 5976 | CLK_LOOKUP("core_clk", gfx3d_axi_clk.c, "msm_iommu-v0.10"), |
Patrick Daly | e6f48904 | 2012-07-11 15:29:15 -0700 | [diff] [blame] | 5977 | CLK_LOOKUP("div_clk", tv_src_div_clk.c, ""), |
| 5978 | }; |
| 5979 | |
| 5980 | static struct clk_lookup msm_clocks_8960[ARRAY_SIZE(msm_clocks_8960_common) |
| 5981 | + ARRAY_SIZE(msm_clocks_8960_only) |
| 5982 | + ARRAY_SIZE(msm_clocks_8960ab_only)]; |
| 5983 | |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 5984 | static struct clk_lookup msm_clocks_8930[] = { |
Stephen Boyd | be1a739 | 2012-04-02 20:17:11 -0700 | [diff] [blame] | 5985 | CLK_LOOKUP("xo", cxo_clk.c, "msm_xo"), |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 5986 | CLK_LOOKUP("cxo", cxo_clk.c, "wcnss_wlan.0"), |
| 5987 | CLK_LOOKUP("cxo", cxo_clk.c, "pil_riva"), |
Stephen Boyd | bdb53f3 | 2012-06-05 18:39:47 -0700 | [diff] [blame] | 5988 | CLK_LOOKUP("xo", pxo_clk.c, "pil-q6v4-lpass"), |
| 5989 | CLK_LOOKUP("xo", cxo_clk.c, "pil-q6v4-modem"), |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 5990 | CLK_LOOKUP("xo", cxo_clk.c, "BAM_RMNT"), |
David Collins | a7d2353 | 2012-08-02 10:48:16 -0700 | [diff] [blame] | 5991 | CLK_LOOKUP("vref_buff", cxo_clk.c, "rpm-regulator"), |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 5992 | CLK_LOOKUP("pll2", pll2_clk.c, NULL), |
| 5993 | CLK_LOOKUP("pll8", pll8_clk.c, NULL), |
| 5994 | CLK_LOOKUP("pll4", pll4_clk.c, NULL), |
| 5995 | CLK_LOOKUP("measure", measure_clk.c, "debug"), |
| 5996 | |
Matt Wagantall | d75f131 | 2012-05-23 16:17:35 -0700 | [diff] [blame] | 5997 | CLK_LOOKUP("bus_clk", afab_clk.c, ""), |
| 5998 | CLK_LOOKUP("bus_clk", afab_a_clk.c, ""), |
| 5999 | CLK_LOOKUP("bus_clk", cfpb_clk.c, ""), |
| 6000 | CLK_LOOKUP("bus_clk", cfpb_a_clk.c, ""), |
| 6001 | CLK_LOOKUP("bus_clk", dfab_clk.c, ""), |
| 6002 | CLK_LOOKUP("bus_clk", dfab_a_clk.c, ""), |
| 6003 | CLK_LOOKUP("mem_clk", ebi1_clk.c, ""), |
| 6004 | CLK_LOOKUP("mem_clk", ebi1_a_clk.c, ""), |
| 6005 | CLK_LOOKUP("bus_clk", mmfab_clk.c, ""), |
| 6006 | CLK_LOOKUP("bus_clk", mmfab_a_clk.c, ""), |
| 6007 | CLK_LOOKUP("bus_clk", mmfpb_clk.c, ""), |
| 6008 | CLK_LOOKUP("bus_clk", mmfpb_a_clk.c, ""), |
| 6009 | CLK_LOOKUP("bus_clk", sfab_clk.c, ""), |
| 6010 | CLK_LOOKUP("bus_clk", sfab_a_clk.c, ""), |
| 6011 | CLK_LOOKUP("bus_clk", sfpb_clk.c, ""), |
| 6012 | CLK_LOOKUP("bus_clk", sfpb_a_clk.c, ""), |
| 6013 | |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 6014 | CLK_LOOKUP("bus_clk", afab_clk.c, "msm_apps_fab"), |
Matt Wagantall | 33bac7e | 2012-05-22 14:59:05 -0700 | [diff] [blame] | 6015 | CLK_LOOKUP("bus_a_clk", afab_msmbus_a_clk.c, "msm_apps_fab"), |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 6016 | CLK_LOOKUP("bus_clk", cfpb_clk.c, "msm_cpss_fpb"), |
| 6017 | CLK_LOOKUP("bus_a_clk", cfpb_a_clk.c, "msm_cpss_fpb"), |
| 6018 | CLK_LOOKUP("bus_clk", sfab_clk.c, "msm_sys_fab"), |
| 6019 | CLK_LOOKUP("bus_a_clk", sfab_msmbus_a_clk.c, "msm_sys_fab"), |
| 6020 | CLK_LOOKUP("bus_clk", sfpb_clk.c, "msm_sys_fpb"), |
| 6021 | CLK_LOOKUP("bus_a_clk", sfpb_a_clk.c, "msm_sys_fpb"), |
| 6022 | CLK_LOOKUP("bus_clk", mmfab_clk.c, "msm_mm_fab"), |
| 6023 | CLK_LOOKUP("bus_a_clk", mmfab_a_clk.c, "msm_mm_fab"), |
| 6024 | CLK_LOOKUP("mem_clk", ebi1_msmbus_clk.c, "msm_bus"), |
Matt Wagantall | 33bac7e | 2012-05-22 14:59:05 -0700 | [diff] [blame] | 6025 | CLK_LOOKUP("mem_a_clk", ebi1_msmbus_a_clk.c, "msm_bus"), |
Gagan Mac | bc5f81d | 2012-04-04 15:03:12 -0600 | [diff] [blame] | 6026 | CLK_LOOKUP("dfab_clk", dfab_msmbus_clk.c, "msm_bus"), |
| 6027 | CLK_LOOKUP("dfab_a_clk", dfab_msmbus_a_clk.c, "msm_bus"), |
Pratik Patel | f17b147 | 2012-05-25 22:23:52 -0700 | [diff] [blame] | 6028 | CLK_LOOKUP("core_a_clk", qdss_a_clk.c, ""), |
Pratik Patel | 3b0ca88 | 2012-06-01 16:54:14 -0700 | [diff] [blame] | 6029 | CLK_LOOKUP("core_clk", qdss_clk.c, "coresight-tpiu.0"), |
| 6030 | CLK_LOOKUP("core_clk", qdss_clk.c, "coresight-etb.0"), |
| 6031 | CLK_LOOKUP("core_clk", qdss_clk.c, "coresight-funnel.0"), |
| 6032 | CLK_LOOKUP("core_clk", qdss_clk.c, "coresight-etm.0"), |
| 6033 | CLK_LOOKUP("core_clk", qdss_clk.c, "coresight-etm.1"), |
| 6034 | CLK_LOOKUP("core_clk", qdss_clk.c, "coresight-etm.2"), |
| 6035 | CLK_LOOKUP("core_clk", qdss_clk.c, "coresight-etm.3"), |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 6036 | |
| 6037 | CLK_LOOKUP("ebi1_clk", ebi1_clk.c, NULL), |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 6038 | CLK_LOOKUP("mmfpb_clk", mmfpb_clk.c, NULL), |
| 6039 | CLK_LOOKUP("mmfpb_a_clk", mmfpb_a_clk.c, "clock-8960"), |
| 6040 | CLK_LOOKUP("cfpb_a_clk", cfpb_a_clk.c, "clock-8960"), |
| 6041 | |
| 6042 | CLK_LOOKUP("core_clk", gp0_clk.c, ""), |
| 6043 | CLK_LOOKUP("core_clk", gp1_clk.c, ""), |
| 6044 | CLK_LOOKUP("core_clk", gp2_clk.c, ""), |
| 6045 | CLK_LOOKUP("core_clk", gsbi1_uart_clk.c, ""), |
| 6046 | CLK_LOOKUP("core_clk", gsbi2_uart_clk.c, ""), |
| 6047 | CLK_LOOKUP("core_clk", gsbi3_uart_clk.c, ""), |
| 6048 | CLK_LOOKUP("core_clk", gsbi4_uart_clk.c, ""), |
| 6049 | CLK_LOOKUP("core_clk", gsbi5_uart_clk.c, "msm_serial_hsl.0"), |
| 6050 | CLK_LOOKUP("core_clk", gsbi6_uart_clk.c, "msm_serial_hs.0"), |
| 6051 | CLK_LOOKUP("core_clk", gsbi7_uart_clk.c, ""), |
| 6052 | CLK_LOOKUP("core_clk", gsbi8_uart_clk.c, ""), |
| 6053 | CLK_LOOKUP("core_clk", gsbi9_uart_clk.c, ""), |
| 6054 | CLK_LOOKUP("core_clk", gsbi10_uart_clk.c, ""), |
| 6055 | CLK_LOOKUP("core_clk", gsbi11_uart_clk.c, ""), |
| 6056 | CLK_LOOKUP("core_clk", gsbi12_uart_clk.c, ""), |
| 6057 | CLK_LOOKUP("core_clk", gsbi1_qup_clk.c, "spi_qsd.0"), |
| 6058 | CLK_LOOKUP("core_clk", gsbi2_qup_clk.c, ""), |
| 6059 | CLK_LOOKUP("core_clk", gsbi3_qup_clk.c, "qup_i2c.3"), |
| 6060 | CLK_LOOKUP("core_clk", gsbi4_qup_clk.c, "qup_i2c.4"), |
| 6061 | CLK_LOOKUP("core_clk", gsbi5_qup_clk.c, ""), |
| 6062 | CLK_LOOKUP("core_clk", gsbi6_qup_clk.c, ""), |
| 6063 | CLK_LOOKUP("core_clk", gsbi7_qup_clk.c, ""), |
| 6064 | CLK_LOOKUP("core_clk", gsbi8_qup_clk.c, ""), |
| 6065 | CLK_LOOKUP("core_clk", gsbi9_qup_clk.c, "qup_i2c.0"), |
| 6066 | CLK_LOOKUP("core_clk", gsbi10_qup_clk.c, "qup_i2c.10"), |
| 6067 | CLK_LOOKUP("core_clk", gsbi11_qup_clk.c, ""), |
| 6068 | CLK_LOOKUP("core_clk", gsbi12_qup_clk.c, "qup_i2c.12"), |
| 6069 | CLK_LOOKUP("core_clk", pdm_clk.c, ""), |
| 6070 | CLK_LOOKUP("mem_clk", pmem_clk.c, "msm_sps"), |
| 6071 | CLK_LOOKUP("core_clk", prng_clk.c, "msm_rng.0"), |
| 6072 | CLK_LOOKUP("core_clk", sdc1_clk.c, "msm_sdcc.1"), |
| 6073 | CLK_LOOKUP("core_clk", sdc2_clk.c, "msm_sdcc.2"), |
| 6074 | CLK_LOOKUP("core_clk", sdc3_clk.c, "msm_sdcc.3"), |
| 6075 | CLK_LOOKUP("core_clk", sdc4_clk.c, "msm_sdcc.4"), |
| 6076 | CLK_LOOKUP("core_clk", sdc5_clk.c, "msm_sdcc.5"), |
| 6077 | CLK_LOOKUP("ref_clk", tsif_ref_clk.c, ""), |
| 6078 | CLK_LOOKUP("core_clk", tssc_clk.c, ""), |
| 6079 | CLK_LOOKUP("alt_core_clk", usb_hs1_xcvr_clk.c, "msm_otg"), |
| 6080 | CLK_LOOKUP("phy_clk", usb_phy0_clk.c, "msm_otg"), |
| 6081 | CLK_LOOKUP("alt_core_clk", usb_fs1_xcvr_clk.c, ""), |
| 6082 | CLK_LOOKUP("sys_clk", usb_fs1_sys_clk.c, ""), |
| 6083 | CLK_LOOKUP("src_clk", usb_fs1_src_clk.c, ""), |
| 6084 | CLK_LOOKUP("alt_core_clk", usb_fs2_xcvr_clk.c, ""), |
| 6085 | CLK_LOOKUP("sys_clk", usb_fs2_sys_clk.c, ""), |
| 6086 | CLK_LOOKUP("src_clk", usb_fs2_src_clk.c, ""), |
| 6087 | CLK_LOOKUP("alt_core_clk", usb_hsic_xcvr_fs_clk.c, "msm_hsic_host"), |
| 6088 | CLK_LOOKUP("phy_clk", usb_hsic_hsic_clk.c, "msm_hsic_host"), |
| 6089 | CLK_LOOKUP("cal_clk", usb_hsic_hsio_cal_clk.c, "msm_hsic_host"), |
| 6090 | CLK_LOOKUP("core_clk", usb_hsic_system_clk.c, "msm_hsic_host"), |
| 6091 | CLK_LOOKUP("iface_clk", usb_hsic_p_clk.c, "msm_hsic_host"), |
| 6092 | CLK_LOOKUP("iface_clk", ce1_p_clk.c, "qce.0"), |
| 6093 | CLK_LOOKUP("iface_clk", ce1_p_clk.c, "qcrypto.0"), |
| 6094 | CLK_LOOKUP("core_clk", ce1_core_clk.c, "qce.0"), |
| 6095 | CLK_LOOKUP("core_clk", ce1_core_clk.c, "qcrypto.0"), |
| 6096 | CLK_LOOKUP("dma_bam_pclk", dma_bam_p_clk.c, NULL), |
| 6097 | CLK_LOOKUP("iface_clk", gsbi1_p_clk.c, "spi_qsd.0"), |
| 6098 | CLK_LOOKUP("iface_clk", gsbi2_p_clk.c, ""), |
| 6099 | CLK_LOOKUP("iface_clk", gsbi3_p_clk.c, "qup_i2c.3"), |
| 6100 | CLK_LOOKUP("iface_clk", gsbi4_p_clk.c, "qup_i2c.4"), |
| 6101 | CLK_LOOKUP("iface_clk", gsbi5_p_clk.c, "msm_serial_hsl.0"), |
| 6102 | CLK_LOOKUP("iface_clk", gsbi6_p_clk.c, "msm_serial_hs.0"), |
| 6103 | CLK_LOOKUP("iface_clk", gsbi7_p_clk.c, ""), |
| 6104 | CLK_LOOKUP("iface_clk", gsbi8_p_clk.c, ""), |
| 6105 | CLK_LOOKUP("iface_clk", gsbi9_p_clk.c, "qup_i2c.0"), |
| 6106 | CLK_LOOKUP("iface_clk", gsbi10_p_clk.c, "qup_i2c.10"), |
| 6107 | CLK_LOOKUP("iface_clk", gsbi11_p_clk.c, ""), |
| 6108 | CLK_LOOKUP("iface_clk", gsbi12_p_clk.c, "qup_i2c.12"), |
| 6109 | CLK_LOOKUP("iface_clk", tsif_p_clk.c, ""), |
| 6110 | CLK_LOOKUP("iface_clk", usb_fs1_p_clk.c, ""), |
| 6111 | CLK_LOOKUP("iface_clk", usb_fs2_p_clk.c, ""), |
| 6112 | CLK_LOOKUP("iface_clk", usb_hs1_p_clk.c, "msm_otg"), |
| 6113 | CLK_LOOKUP("iface_clk", sdc1_p_clk.c, "msm_sdcc.1"), |
| 6114 | CLK_LOOKUP("iface_clk", sdc2_p_clk.c, "msm_sdcc.2"), |
| 6115 | CLK_LOOKUP("iface_clk", sdc3_p_clk.c, "msm_sdcc.3"), |
| 6116 | CLK_LOOKUP("iface_clk", sdc4_p_clk.c, "msm_sdcc.4"), |
| 6117 | CLK_LOOKUP("iface_clk", sdc5_p_clk.c, "msm_sdcc.5"), |
| 6118 | CLK_LOOKUP("core_clk", adm0_clk.c, "msm_dmov"), |
| 6119 | CLK_LOOKUP("iface_clk", adm0_p_clk.c, "msm_dmov"), |
| 6120 | CLK_LOOKUP("iface_clk", pmic_arb0_p_clk.c, ""), |
| 6121 | CLK_LOOKUP("iface_clk", pmic_arb1_p_clk.c, ""), |
| 6122 | CLK_LOOKUP("core_clk", pmic_ssbi2_clk.c, ""), |
| 6123 | CLK_LOOKUP("mem_clk", rpm_msg_ram_p_clk.c, ""), |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 6124 | CLK_LOOKUP("cam_clk", cam0_clk.c, "4-001a"), |
Hody Hung | 994f462 | 2012-04-24 10:27:45 -0700 | [diff] [blame] | 6125 | CLK_LOOKUP("cam_clk", cam1_clk.c, "4-006c"), |
Sreesudhan Ramakrish Ramkumar | 981c82c | 2012-04-30 17:31:37 -0700 | [diff] [blame] | 6126 | CLK_LOOKUP("cam_clk", cam1_clk.c, "4-0048"), |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 6127 | CLK_LOOKUP("cam_clk", cam2_clk.c, NULL), |
| 6128 | CLK_LOOKUP("cam_clk", cam0_clk.c, "4-0020"), |
| 6129 | CLK_LOOKUP("csi_src_clk", csi0_src_clk.c, "msm_csid.0"), |
| 6130 | CLK_LOOKUP("csi_src_clk", csi1_src_clk.c, "msm_csid.1"), |
| 6131 | CLK_LOOKUP("csi_src_clk", csi2_src_clk.c, "msm_csid.2"), |
| 6132 | CLK_LOOKUP("csi_clk", csi0_clk.c, "msm_csid.0"), |
| 6133 | CLK_LOOKUP("csi_clk", csi1_clk.c, "msm_csid.1"), |
| 6134 | CLK_LOOKUP("csi_clk", csi2_clk.c, "msm_csid.2"), |
| 6135 | CLK_LOOKUP("csi_phy_clk", csi0_phy_clk.c, "msm_csid.0"), |
| 6136 | CLK_LOOKUP("csi_phy_clk", csi1_phy_clk.c, "msm_csid.1"), |
| 6137 | CLK_LOOKUP("csi_phy_clk", csi2_phy_clk.c, "msm_csid.2"), |
| 6138 | CLK_LOOKUP("csi_pix_clk", csi_pix_clk.c, "msm_ispif.0"), |
| 6139 | CLK_LOOKUP("csi_rdi_clk", csi_rdi_clk.c, "msm_ispif.0"), |
| 6140 | CLK_LOOKUP("csi_src_clk", csi2_src_clk.c, NULL), |
| 6141 | CLK_LOOKUP("csi_clk", csi2_clk.c, NULL), |
| 6142 | CLK_LOOKUP("csi_pix1_clk", csi_pix1_clk.c, "msm_ispif.0"), |
| 6143 | CLK_LOOKUP("csi_rdi1_clk", csi_rdi1_clk.c, "msm_ispif.0"), |
| 6144 | CLK_LOOKUP("csi_rdi2_clk", csi_rdi2_clk.c, "msm_ispif.0"), |
| 6145 | CLK_LOOKUP("csi_phy_clk", csi2_phy_clk.c, NULL), |
| 6146 | CLK_LOOKUP("csi2phy_timer_clk", csi2phy_timer_clk.c, NULL), |
| 6147 | CLK_LOOKUP("csiphy_timer_src_clk", |
| 6148 | csiphy_timer_src_clk.c, "msm_csiphy.0"), |
| 6149 | CLK_LOOKUP("csiphy_timer_src_clk", |
| 6150 | csiphy_timer_src_clk.c, "msm_csiphy.1"), |
| 6151 | CLK_LOOKUP("csiphy_timer_src_clk", |
| 6152 | csiphy_timer_src_clk.c, "msm_csiphy.2"), |
| 6153 | CLK_LOOKUP("csiphy_timer_clk", csi0phy_timer_clk.c, "msm_csiphy.0"), |
| 6154 | CLK_LOOKUP("csiphy_timer_clk", csi1phy_timer_clk.c, "msm_csiphy.1"), |
| 6155 | CLK_LOOKUP("csiphy_timer_clk", csi2phy_timer_clk.c, "msm_csiphy.2"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 6156 | CLK_LOOKUP("byte_clk", dsi1_byte_clk.c, "mipi_dsi.1"), |
| 6157 | CLK_LOOKUP("esc_clk", dsi1_esc_clk.c, "mipi_dsi.1"), |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 6158 | CLK_LOOKUP("core_clk", gfx3d_clk.c, "kgsl-3d0.0"), |
| 6159 | CLK_LOOKUP("core_clk", gfx3d_clk.c, "footswitch-8x60.2"), |
| 6160 | CLK_LOOKUP("bus_clk", |
| 6161 | gfx3d_axi_clk_8930.c, "footswitch-8x60.2"), |
| 6162 | CLK_LOOKUP("bus_clk", ijpeg_axi_clk.c, "footswitch-8x60.3"), |
Matt Wagantall | f45cd36 | 2012-05-03 21:09:44 -0700 | [diff] [blame] | 6163 | CLK_LOOKUP("mem_clk", imem_axi_clk.c, "msm_gemini.0"), |
| 6164 | CLK_LOOKUP("core_clk", ijpeg_clk.c, "msm_gemini.0"), |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 6165 | CLK_LOOKUP("core_clk", ijpeg_clk.c, "footswitch-8x60.3"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 6166 | CLK_LOOKUP("core_clk", mdp_clk.c, "mdp.0"), |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 6167 | CLK_LOOKUP("core_clk", mdp_clk.c, "footswitch-8x60.4"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 6168 | CLK_LOOKUP("vsync_clk", mdp_vsync_clk.c, "mdp.0"), |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 6169 | CLK_LOOKUP("vsync_clk", mdp_vsync_clk.c, "footswitch-8x60.4"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 6170 | CLK_LOOKUP("lut_clk", lut_mdp_clk.c, "mdp.0"), |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 6171 | CLK_LOOKUP("lut_clk", lut_mdp_clk.c, "footswitch-8x60.4"), |
| 6172 | CLK_LOOKUP("core_clk", rot_clk.c, "msm_rotator.0"), |
| 6173 | CLK_LOOKUP("core_clk", rot_clk.c, "footswitch-8x60.6"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 6174 | CLK_LOOKUP("src_clk", tv_src_clk.c, "dtv.0"), |
| 6175 | CLK_LOOKUP("src_clk", tv_src_clk.c, "tvenc.0"), |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 6176 | CLK_LOOKUP("tv_src_clk", tv_src_clk.c, "footswitch-8x60.4"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 6177 | CLK_LOOKUP("dac_clk", tv_dac_clk.c, "tvenc.0"), |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 6178 | CLK_LOOKUP("core_clk", vcodec_clk.c, "msm_vidc.0"), |
| 6179 | CLK_LOOKUP("core_clk", vcodec_clk.c, "footswitch-8x60.7"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 6180 | CLK_LOOKUP("mdp_clk", mdp_tv_clk.c, "dtv.0"), |
| 6181 | CLK_LOOKUP("mdp_clk", mdp_tv_clk.c, "tvenc.0"), |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 6182 | CLK_LOOKUP("tv_clk", mdp_tv_clk.c, "footswitch-8x60.4"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 6183 | CLK_LOOKUP("hdmi_clk", hdmi_tv_clk.c, "dtv.0"), |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 6184 | CLK_LOOKUP("core_clk", hdmi_app_clk.c, "hdmi_msm.1"), |
| 6185 | CLK_LOOKUP("vpe_clk", vpe_clk.c, "msm_vpe.0"), |
| 6186 | CLK_LOOKUP("core_clk", vpe_clk.c, "footswitch-8x60.9"), |
| 6187 | CLK_LOOKUP("vfe_clk", vfe_clk.c, "msm_vfe.0"), |
| 6188 | CLK_LOOKUP("core_clk", vfe_clk.c, "footswitch-8x60.8"), |
| 6189 | CLK_LOOKUP("csi_vfe_clk", csi_vfe_clk.c, "msm_vfe.0"), |
| 6190 | CLK_LOOKUP("bus_clk", vfe_axi_clk.c, "footswitch-8x60.8"), |
| 6191 | CLK_LOOKUP("bus_clk", mdp_axi_clk.c, "footswitch-8x60.4"), |
| 6192 | CLK_LOOKUP("bus_clk", rot_axi_clk.c, "footswitch-8x60.6"), |
| 6193 | CLK_LOOKUP("bus_clk", vcodec_axi_clk.c, "footswitch-8x60.7"), |
| 6194 | CLK_LOOKUP("bus_a_clk", vcodec_axi_a_clk.c, "footswitch-8x60.7"), |
| 6195 | CLK_LOOKUP("bus_b_clk", vcodec_axi_b_clk.c, "footswitch-8x60.7"), |
| 6196 | CLK_LOOKUP("bus_clk", vpe_axi_clk.c, "footswitch-8x60.9"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 6197 | CLK_LOOKUP("arb_clk", amp_p_clk.c, "mipi_dsi.1"), |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 6198 | CLK_LOOKUP("csi_pclk", csi_p_clk.c, "msm_csid.0"), |
| 6199 | CLK_LOOKUP("csi_pclk", csi_p_clk.c, "msm_csid.1"), |
| 6200 | CLK_LOOKUP("csi_pclk", csi_p_clk.c, "msm_csid.2"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 6201 | CLK_LOOKUP("master_iface_clk", dsi1_m_p_clk.c, "mipi_dsi.1"), |
| 6202 | 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] | 6203 | CLK_LOOKUP("iface_clk", gfx3d_p_clk.c, "kgsl-3d0.0"), |
| 6204 | CLK_LOOKUP("iface_clk", gfx3d_p_clk.c, "footswitch-8x60.2"), |
| 6205 | CLK_LOOKUP("master_iface_clk", hdmi_m_p_clk.c, "hdmi_msm.1"), |
| 6206 | 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] | 6207 | CLK_LOOKUP("iface_clk", ijpeg_p_clk.c, "msm_gemini.0"), |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 6208 | CLK_LOOKUP("iface_clk", ijpeg_p_clk.c, "footswitch-8x60.3"), |
| 6209 | CLK_LOOKUP("mem_iface_clk", imem_p_clk.c, "kgsl-3d0.0"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 6210 | CLK_LOOKUP("iface_clk", mdp_p_clk.c, "mdp.0"), |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 6211 | CLK_LOOKUP("iface_clk", mdp_p_clk.c, "footswitch-8x60.4"), |
Olav Haugan | 0e22c48 | 2013-01-28 17:39:36 -0800 | [diff] [blame] | 6212 | CLK_LOOKUP("iface_clk", smmu_p_clk.c, "msm_iommu-v0.0"), |
| 6213 | CLK_LOOKUP("iface_clk", smmu_p_clk.c, "msm_iommu-v0.1"), |
| 6214 | CLK_LOOKUP("iface_clk", smmu_p_clk.c, "msm_iommu-v0.2"), |
| 6215 | CLK_LOOKUP("iface_clk", smmu_p_clk.c, "msm_iommu-v0.3"), |
| 6216 | CLK_LOOKUP("iface_clk", smmu_p_clk.c, "msm_iommu-v0.4"), |
| 6217 | CLK_LOOKUP("iface_clk", smmu_p_clk.c, "msm_iommu-v0.5"), |
| 6218 | CLK_LOOKUP("iface_clk", smmu_p_clk.c, "msm_iommu-v0.6"), |
| 6219 | CLK_LOOKUP("iface_clk", smmu_p_clk.c, "msm_iommu-v0.7"), |
| 6220 | CLK_LOOKUP("iface_clk", smmu_p_clk.c, "msm_iommu-v0.8"), |
| 6221 | CLK_LOOKUP("iface_clk", smmu_p_clk.c, "msm_iommu-v0.9"), |
| 6222 | CLK_LOOKUP("iface_clk", smmu_p_clk.c, "msm_iommu-v0.10"), |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 6223 | CLK_LOOKUP("iface_clk", rot_p_clk.c, "msm_rotator.0"), |
| 6224 | CLK_LOOKUP("iface_clk", rot_p_clk.c, "footswitch-8x60.6"), |
| 6225 | CLK_LOOKUP("iface_clk", vcodec_p_clk.c, "msm_vidc.0"), |
| 6226 | CLK_LOOKUP("iface_clk", vcodec_p_clk.c, "footswitch-8x60.7"), |
| 6227 | CLK_LOOKUP("vfe_pclk", vfe_p_clk.c, "msm_vfe.0"), |
| 6228 | CLK_LOOKUP("iface_clk", vfe_p_clk.c, "footswitch-8x60.8"), |
| 6229 | CLK_LOOKUP("vpe_pclk", vpe_p_clk.c, "msm_vpe.0"), |
| 6230 | CLK_LOOKUP("iface_clk", vpe_p_clk.c, "footswitch-8x60.9"), |
| 6231 | CLK_LOOKUP("bit_clk", mi2s_bit_clk.c, "msm-dai-q6.6"), |
| 6232 | CLK_LOOKUP("osr_clk", mi2s_osr_clk.c, "msm-dai-q6.6"), |
| 6233 | CLK_LOOKUP("bit_clk", codec_i2s_mic_bit_clk.c, |
| 6234 | "msm-dai-q6.1"), |
| 6235 | CLK_LOOKUP("osr_clk", codec_i2s_mic_osr_clk.c, |
| 6236 | "msm-dai-q6.1"), |
| 6237 | CLK_LOOKUP("bit_clk", spare_i2s_mic_bit_clk.c, |
| 6238 | "msm-dai-q6.5"), |
| 6239 | CLK_LOOKUP("osr_clk", spare_i2s_mic_osr_clk.c, |
| 6240 | "msm-dai-q6.5"), |
| 6241 | CLK_LOOKUP("bit_clk", codec_i2s_spkr_bit_clk.c, |
Kuirong Wang | dea7c82 | 2012-08-20 20:52:42 -0700 | [diff] [blame] | 6242 | "msm-dai-q6.0"), |
| 6243 | CLK_LOOKUP("osr_clk", codec_i2s_spkr_osr_clk.c, |
| 6244 | "msm-dai-q6.0"), |
| 6245 | CLK_LOOKUP("bit_clk", codec_i2s_spkr_bit_clk.c, |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 6246 | "msm-dai-q6.16384"), |
| 6247 | CLK_LOOKUP("osr_clk", codec_i2s_spkr_osr_clk.c, |
| 6248 | "msm-dai-q6.16384"), |
| 6249 | CLK_LOOKUP("bit_clk", spare_i2s_spkr_bit_clk.c, |
| 6250 | "msm-dai-q6.4"), |
| 6251 | CLK_LOOKUP("osr_clk", spare_i2s_spkr_osr_clk.c, |
| 6252 | "msm-dai-q6.4"), |
| 6253 | CLK_LOOKUP("pcm_clk", pcm_clk.c, "msm-dai-q6.2"), |
| 6254 | CLK_LOOKUP("sps_slimbus_clk", sps_slimbus_clk.c, NULL), |
| 6255 | CLK_LOOKUP("core_clk", audio_slimbus_clk.c, "msm_slim_ctrl.1"), |
Olav Haugan | 0e22c48 | 2013-01-28 17:39:36 -0800 | [diff] [blame] | 6256 | CLK_LOOKUP("core_clk", vpe_axi_clk.c, "msm_iommu-v0.1"), |
| 6257 | CLK_LOOKUP("core_clk", mdp_axi_clk.c, "msm_iommu-v0.2"), |
| 6258 | CLK_LOOKUP("core_clk", mdp_axi_clk.c, "msm_iommu-v0.3"), |
| 6259 | CLK_LOOKUP("core_clk", rot_axi_clk.c, "msm_iommu-v0.4"), |
| 6260 | CLK_LOOKUP("core_clk", ijpeg_axi_clk.c, "msm_iommu-v0.5"), |
| 6261 | CLK_LOOKUP("core_clk", vfe_axi_clk.c, "msm_iommu-v0.6"), |
| 6262 | CLK_LOOKUP("core_clk", vcodec_axi_a_clk.c, "msm_iommu-v0.7"), |
| 6263 | CLK_LOOKUP("core_clk", vcodec_axi_b_clk.c, "msm_iommu-v0.8"), |
| 6264 | CLK_LOOKUP("core_clk", gfx3d_axi_clk_8930.c, "msm_iommu-v0.9"), |
| 6265 | CLK_LOOKUP("core_clk", gfx3d_axi_clk_8930.c, "msm_iommu-v0.10"), |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 6266 | |
| 6267 | CLK_LOOKUP("mdp_iommu_clk", mdp_axi_clk.c, "msm_vidc.0"), |
| 6268 | CLK_LOOKUP("rot_iommu_clk", rot_axi_clk.c, "msm_vidc.0"), |
| 6269 | CLK_LOOKUP("vcodec_iommu0_clk", vcodec_axi_a_clk.c, "msm_vidc.0"), |
| 6270 | CLK_LOOKUP("vcodec_iommu1_clk", vcodec_axi_b_clk.c, "msm_vidc.0"), |
| 6271 | CLK_LOOKUP("smmu_iface_clk", smmu_p_clk.c, "msm_vidc.0"), |
Stephen Boyd | 7b973de | 2012-03-09 12:26:16 -0800 | [diff] [blame] | 6272 | CLK_LOOKUP("core_clk", vcodec_axi_clk.c, "pil_vidc"), |
| 6273 | CLK_LOOKUP("smmu_iface_clk", smmu_p_clk.c, "pil_vidc"), |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 6274 | |
| 6275 | CLK_LOOKUP("dfab_dsps_clk", dfab_dsps_clk.c, NULL), |
| 6276 | CLK_LOOKUP("core_clk", dfab_usb_hs_clk.c, "msm_otg"), |
| 6277 | CLK_LOOKUP("bus_clk", dfab_sdc1_clk.c, "msm_sdcc.1"), |
| 6278 | CLK_LOOKUP("bus_clk", dfab_sdc2_clk.c, "msm_sdcc.2"), |
| 6279 | CLK_LOOKUP("bus_clk", dfab_sdc3_clk.c, "msm_sdcc.3"), |
| 6280 | CLK_LOOKUP("bus_clk", dfab_sdc4_clk.c, "msm_sdcc.4"), |
| 6281 | CLK_LOOKUP("bus_clk", dfab_sdc5_clk.c, "msm_sdcc.5"), |
| 6282 | CLK_LOOKUP("dfab_clk", dfab_sps_clk.c, "msm_sps"), |
| 6283 | CLK_LOOKUP("bus_clk", dfab_bam_dmux_clk.c, "BAM_RMNT"), |
| 6284 | CLK_LOOKUP("bus_clk", dfab_scm_clk.c, "scm"), |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 6285 | |
| 6286 | CLK_LOOKUP("mem_clk", ebi1_adm_clk.c, "msm_dmov"), |
Matt Wagantall | 33bac7e | 2012-05-22 14:59:05 -0700 | [diff] [blame] | 6287 | CLK_LOOKUP("mem_clk", ebi1_acpu_a_clk.c, ""), |
| 6288 | CLK_LOOKUP("bus_clk", afab_acpu_a_clk.c, ""), |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 6289 | |
Matt Wagantall | c33c1ed | 2012-07-23 17:19:08 -0700 | [diff] [blame] | 6290 | CLK_LOOKUP("reset1_clk", dsi1_reset_clk.c, "footswitch-8x60.4"), |
Matt Wagantall | 735e41b | 2012-07-23 17:18:58 -0700 | [diff] [blame] | 6291 | |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 6292 | CLK_LOOKUP("l2_mclk", l2_m_clk, ""), |
| 6293 | CLK_LOOKUP("krait0_mclk", krait0_m_clk, ""), |
| 6294 | CLK_LOOKUP("krait1_mclk", krait1_m_clk, ""), |
| 6295 | CLK_LOOKUP("q6sw_clk", q6sw_clk, ""), |
| 6296 | CLK_LOOKUP("q6fw_clk", q6fw_clk, ""), |
| 6297 | CLK_LOOKUP("q6_func_clk", q6_func_clk, ""), |
| 6298 | }; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 6299 | /* |
| 6300 | * Miscellaneous clock register initializations |
| 6301 | */ |
| 6302 | |
| 6303 | /* Read, modify, then write-back a register. */ |
| 6304 | static void __init rmwreg(uint32_t val, void *reg, uint32_t mask) |
| 6305 | { |
| 6306 | uint32_t regval = readl_relaxed(reg); |
| 6307 | regval &= ~mask; |
| 6308 | regval |= val; |
| 6309 | writel_relaxed(regval, reg); |
| 6310 | } |
| 6311 | |
Patrick Daly | aa61456 | 2013-01-23 16:39:45 -0800 | [diff] [blame] | 6312 | static struct pll_config_regs pll3_regs __initdata = { |
| 6313 | .l_reg = BB_MMCC_PLL2_L_REG, |
| 6314 | .m_reg = BB_MMCC_PLL2_M_REG, |
| 6315 | .n_reg = BB_MMCC_PLL2_N_REG, |
| 6316 | .config_reg = BB_MMCC_PLL2_CONFIG_REG, |
| 6317 | .mode_reg = BB_MMCC_PLL2_MODE_REG, |
| 6318 | }; |
| 6319 | |
| 6320 | /* Program PLL3 to 880MHZ */ |
| 6321 | static struct pll_config pll3_config __initdata = { |
| 6322 | .l = (32 | BVAL(31, 7, 0x8)), |
| 6323 | .m = 16, |
| 6324 | .n = 27, |
| 6325 | .vco_val = 0x0, |
| 6326 | .vco_mask = BM(8, 7), |
| 6327 | .pre_div_val = 0x0, |
| 6328 | .pre_div_mask = BIT(15), |
| 6329 | .post_div_val = 0x0, |
| 6330 | .post_div_mask = BIT(16), |
| 6331 | .mn_ena_val = 0, |
| 6332 | .mn_ena_mask = 0, |
| 6333 | .main_output_val = 0, |
| 6334 | .main_output_mask = 0, |
| 6335 | }; |
| 6336 | |
Vikram Mulukutla | 5b14672 | 2012-04-23 18:17:50 -0700 | [diff] [blame] | 6337 | static struct pll_config_regs pll4_regs __initdata = { |
| 6338 | .l_reg = LCC_PLL0_L_VAL_REG, |
| 6339 | .m_reg = LCC_PLL0_M_VAL_REG, |
| 6340 | .n_reg = LCC_PLL0_N_VAL_REG, |
| 6341 | .config_reg = LCC_PLL0_CONFIG_REG, |
| 6342 | .mode_reg = LCC_PLL0_MODE_REG, |
| 6343 | }; |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 6344 | |
Matt Wagantall | 86e0382 | 2011-12-12 10:59:24 -0800 | [diff] [blame] | 6345 | static struct pll_config pll4_config_393 __initdata = { |
Vikram Mulukutla | 5b14672 | 2012-04-23 18:17:50 -0700 | [diff] [blame] | 6346 | .l = 0xE, |
| 6347 | .m = 0x27A, |
| 6348 | .n = 0x465, |
| 6349 | .vco_val = 0x0, |
| 6350 | .vco_mask = BM(17, 16), |
| 6351 | .pre_div_val = 0x0, |
| 6352 | .pre_div_mask = BIT(19), |
| 6353 | .post_div_val = 0x0, |
| 6354 | .post_div_mask = BM(21, 20), |
| 6355 | .mn_ena_val = BIT(22), |
| 6356 | .mn_ena_mask = BIT(22), |
| 6357 | .main_output_val = BIT(23), |
| 6358 | .main_output_mask = BIT(23), |
| 6359 | }; |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 6360 | |
Vikram Mulukutla | 5b14672 | 2012-04-23 18:17:50 -0700 | [diff] [blame] | 6361 | static struct pll_config_regs pll15_regs __initdata = { |
| 6362 | .l_reg = MM_PLL3_L_VAL_REG, |
| 6363 | .m_reg = MM_PLL3_M_VAL_REG, |
| 6364 | .n_reg = MM_PLL3_N_VAL_REG, |
| 6365 | .config_reg = MM_PLL3_CONFIG_REG, |
| 6366 | .mode_reg = MM_PLL3_MODE_REG, |
| 6367 | }; |
Tianyi Gou | 358c386 | 2011-10-18 17:03:41 -0700 | [diff] [blame] | 6368 | |
Vikram Mulukutla | 5b14672 | 2012-04-23 18:17:50 -0700 | [diff] [blame] | 6369 | static struct pll_config pll15_config __initdata = { |
| 6370 | .l = (0x24 | BVAL(31, 7, 0x620)), |
| 6371 | .m = 0x1, |
| 6372 | .n = 0x9, |
| 6373 | .vco_val = BVAL(17, 16, 0x2), |
| 6374 | .vco_mask = BM(17, 16), |
| 6375 | .pre_div_val = 0x0, |
| 6376 | .pre_div_mask = BIT(19), |
| 6377 | .post_div_val = 0x0, |
| 6378 | .post_div_mask = BM(21, 20), |
| 6379 | .mn_ena_val = BIT(22), |
| 6380 | .mn_ena_mask = BIT(22), |
| 6381 | .main_output_val = BIT(23), |
| 6382 | .main_output_mask = BIT(23), |
| 6383 | }; |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 6384 | |
Vikram Mulukutla | 5b14672 | 2012-04-23 18:17:50 -0700 | [diff] [blame] | 6385 | static struct pll_config_regs pll14_regs __initdata = { |
| 6386 | .l_reg = BB_PLL14_L_VAL_REG, |
| 6387 | .m_reg = BB_PLL14_M_VAL_REG, |
| 6388 | .n_reg = BB_PLL14_N_VAL_REG, |
| 6389 | .config_reg = BB_PLL14_CONFIG_REG, |
| 6390 | .mode_reg = BB_PLL14_MODE_REG, |
| 6391 | }; |
| 6392 | |
| 6393 | static struct pll_config pll14_config __initdata = { |
| 6394 | .l = (0x11 | BVAL(31, 7, 0x620)), |
| 6395 | .m = 0x7, |
| 6396 | .n = 0x9, |
| 6397 | .vco_val = 0x0, |
| 6398 | .vco_mask = BM(17, 16), |
| 6399 | .pre_div_val = 0x0, |
| 6400 | .pre_div_mask = BIT(19), |
| 6401 | .post_div_val = 0x0, |
| 6402 | .post_div_mask = BM(21, 20), |
| 6403 | .mn_ena_val = BIT(22), |
| 6404 | .mn_ena_mask = BIT(22), |
| 6405 | .main_output_val = BIT(23), |
| 6406 | .main_output_mask = BIT(23), |
| 6407 | }; |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 6408 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 6409 | static void __init reg_init(void) |
| 6410 | { |
Stephen Boyd | d471e7a | 2011-11-19 01:37:39 -0800 | [diff] [blame] | 6411 | void __iomem *imem_reg; |
Vikram Mulukutla | 5b14672 | 2012-04-23 18:17:50 -0700 | [diff] [blame] | 6412 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 6413 | /* Deassert MM SW_RESET_ALL signal. */ |
| 6414 | writel_relaxed(0, SW_RESET_ALL_REG); |
| 6415 | |
Tianyi Gou | 8c1a118 | 2011-10-10 14:47:11 -0700 | [diff] [blame] | 6416 | /* |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 6417 | * Some bits are only used on 8960 or 8064 or 8930 and are marked as |
| 6418 | * reserved bits on the other SoCs. Writing to these reserved bits |
Tianyi Gou | 8c1a118 | 2011-10-10 14:47:11 -0700 | [diff] [blame] | 6419 | * should have no effect. |
| 6420 | */ |
Stephen Boyd | d471e7a | 2011-11-19 01:37:39 -0800 | [diff] [blame] | 6421 | /* |
| 6422 | * Initialize MM AHB registers: Enable the FPB clock and disable HW |
Tianyi Gou | 40ce889 | 2012-11-20 20:20:25 -0800 | [diff] [blame] | 6423 | * gating on 8627 and 8930ab for all clocks. Also set VFE_AHB's |
Stephen Boyd | d471e7a | 2011-11-19 01:37:39 -0800 | [diff] [blame] | 6424 | * FORCE_CORE_ON bit to prevent its memory from being collapsed when |
| 6425 | * the clock is halted. The sleep and wake-up delays are set to safe |
| 6426 | * values. |
| 6427 | */ |
Tianyi Gou | 40ce889 | 2012-11-20 20:20:25 -0800 | [diff] [blame] | 6428 | if (cpu_is_msm8627() || cpu_is_msm8930ab()) { |
Stephen Boyd | d471e7a | 2011-11-19 01:37:39 -0800 | [diff] [blame] | 6429 | rmwreg(0x00000003, AHB_EN_REG, 0x6C000103); |
| 6430 | writel_relaxed(0x000007F9, AHB_EN2_REG); |
Tianyi Gou | 33caa5d | 2012-06-18 12:04:11 -0700 | [diff] [blame] | 6431 | } else { |
David Garibaldi | f69836a | 2012-08-17 16:05:22 -0700 | [diff] [blame] | 6432 | rmwreg(0x40000000, AHB_EN_REG, 0x6C000103); |
Tianyi Gou | 33caa5d | 2012-06-18 12:04:11 -0700 | [diff] [blame] | 6433 | writel_relaxed(0x3C7097F9, AHB_EN2_REG); |
Stephen Boyd | d471e7a | 2011-11-19 01:37:39 -0800 | [diff] [blame] | 6434 | } |
Tianyi Gou | 33caa5d | 2012-06-18 12:04:11 -0700 | [diff] [blame] | 6435 | |
Jay Chokshi | 9c23261 | 2013-01-17 15:14:46 -0800 | [diff] [blame] | 6436 | if (soc_class_is_apq8064()) |
Tianyi Gou | 64daed5 | 2012-08-23 11:00:47 -0700 | [diff] [blame] | 6437 | rmwreg(0x00000000, AHB_EN3_REG, 0x00000001); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 6438 | |
| 6439 | /* Deassert all locally-owned MM AHB resets. */ |
| 6440 | rmwreg(0, SW_RESET_AHB_REG, 0xFFF7DFFF); |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 6441 | rmwreg(0, SW_RESET_AHB2_REG, 0x0000000F); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 6442 | |
| 6443 | /* Initialize MM AXI registers: Enable HW gating for all clocks that |
| 6444 | * support it. Also set FORCE_CORE_ON bits, and any sleep and wake-up |
| 6445 | * delays to safe values. */ |
Tianyi Gou | 40ce889 | 2012-11-20 20:20:25 -0800 | [diff] [blame] | 6446 | if ((cpu_is_msm8960() && |
Tianyi Gou | 33caa5d | 2012-06-18 12:04:11 -0700 | [diff] [blame] | 6447 | SOCINFO_VERSION_MAJOR(socinfo_get_version()) < 3) || |
Tianyi Gou | d287a76 | 2012-11-02 12:35:49 -0700 | [diff] [blame] | 6448 | cpu_is_msm8627() || cpu_is_msm8930ab()) { |
Stephen Boyd | d471e7a | 2011-11-19 01:37:39 -0800 | [diff] [blame] | 6449 | rmwreg(0x000007F9, MAXI_EN_REG, 0x0803FFFF); |
| 6450 | rmwreg(0x3027FCFF, MAXI_EN2_REG, 0x3A3FFFFF); |
Tianyi Gou | 33caa5d | 2012-06-18 12:04:11 -0700 | [diff] [blame] | 6451 | } else { |
| 6452 | rmwreg(0x0003AFF9, MAXI_EN_REG, 0x0803FFFF); |
| 6453 | rmwreg(0x3A27FCFF, MAXI_EN2_REG, 0x3A3FFFFF); |
Stephen Boyd | d471e7a | 2011-11-19 01:37:39 -0800 | [diff] [blame] | 6454 | } |
Tianyi Gou | 33caa5d | 2012-06-18 12:04:11 -0700 | [diff] [blame] | 6455 | |
Matt Wagantall | 53d968f | 2011-07-19 13:22:53 -0700 | [diff] [blame] | 6456 | rmwreg(0x0027FCFF, MAXI_EN3_REG, 0x003FFFFF); |
Tianyi Gou | 33caa5d | 2012-06-18 12:04:11 -0700 | [diff] [blame] | 6457 | rmwreg(0x0027FCFF, MAXI_EN4_REG, 0x017FFFFF); |
| 6458 | |
Jay Chokshi | 9c23261 | 2013-01-17 15:14:46 -0800 | [diff] [blame] | 6459 | if (soc_class_is_apq8064()) |
Tianyi Gou | f3095ea | 2012-05-22 14:16:06 -0700 | [diff] [blame] | 6460 | rmwreg(0x019FECFF, MAXI_EN5_REG, 0x01FFEFFF); |
Tianyi Gou | d287a76 | 2012-11-02 12:35:49 -0700 | [diff] [blame] | 6461 | if (cpu_is_msm8930() || cpu_is_msm8930aa() || cpu_is_msm8627() || |
| 6462 | cpu_is_msm8930ab()) |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 6463 | rmwreg(0x000004FF, MAXI_EN5_REG, 0x00000FFF); |
Patrick Daly | e6f48904 | 2012-07-11 15:29:15 -0700 | [diff] [blame] | 6464 | if (cpu_is_msm8960ab()) |
| 6465 | rmwreg(0x009FE000, MAXI_EN5_REG, 0x01FFE000); |
| 6466 | |
Tianyi Gou | d287a76 | 2012-11-02 12:35:49 -0700 | [diff] [blame] | 6467 | if (cpu_is_msm8627() || cpu_is_msm8930ab()) |
Stephen Boyd | d471e7a | 2011-11-19 01:37:39 -0800 | [diff] [blame] | 6468 | rmwreg(0x000003C7, SAXI_EN_REG, 0x00003FFF); |
Tianyi Gou | 33caa5d | 2012-06-18 12:04:11 -0700 | [diff] [blame] | 6469 | else |
| 6470 | rmwreg(0x00003C38, SAXI_EN_REG, 0x00003FFF); |
Stephen Boyd | d471e7a | 2011-11-19 01:37:39 -0800 | [diff] [blame] | 6471 | |
| 6472 | /* Enable IMEM's clk_on signal */ |
| 6473 | imem_reg = ioremap(0x04b00040, 4); |
| 6474 | if (imem_reg) { |
| 6475 | writel_relaxed(0x3, imem_reg); |
| 6476 | iounmap(imem_reg); |
| 6477 | } |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 6478 | |
| 6479 | /* Initialize MM CC registers: Set MM FORCE_CORE_ON bits so that core |
| 6480 | * memories retain state even when not clocked. Also, set sleep and |
| 6481 | * wake-up delays to safe values. */ |
Matt Wagantall | 53d968f | 2011-07-19 13:22:53 -0700 | [diff] [blame] | 6482 | rmwreg(0x00000000, CSI0_CC_REG, 0x00000410); |
| 6483 | rmwreg(0x00000000, CSI1_CC_REG, 0x00000410); |
| 6484 | rmwreg(0x80FF0000, DSI1_BYTE_CC_REG, 0xE0FF0010); |
Matt Wagantall | 53d968f | 2011-07-19 13:22:53 -0700 | [diff] [blame] | 6485 | rmwreg(0x80FF0000, DSI_PIXEL_CC_REG, 0xE0FF0010); |
Tarun Karra | 6fbc00a | 2011-12-13 09:23:47 -0700 | [diff] [blame] | 6486 | rmwreg(0xC0FF0000, GFX3D_CC_REG, 0xE0FF0010); |
Matt Wagantall | 53d968f | 2011-07-19 13:22:53 -0700 | [diff] [blame] | 6487 | rmwreg(0x80FF0000, IJPEG_CC_REG, 0xE0FF0010); |
Matt Wagantall | 53d968f | 2011-07-19 13:22:53 -0700 | [diff] [blame] | 6488 | rmwreg(0x80FF0000, MDP_CC_REG, 0xE1FF0010); |
| 6489 | rmwreg(0x80FF0000, MDP_LUT_CC_REG, 0xE0FF0010); |
| 6490 | rmwreg(0x80FF0000, ROT_CC_REG, 0xE0FF0010); |
Matt Wagantall | 53d968f | 2011-07-19 13:22:53 -0700 | [diff] [blame] | 6491 | rmwreg(0x000004FF, TV_CC2_REG, 0x000007FF); |
| 6492 | rmwreg(0xC0FF0000, VCODEC_CC_REG, 0xE0FF0010); |
| 6493 | rmwreg(0x80FF0000, VFE_CC_REG, 0xE0FF4010); |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 6494 | rmwreg(0x800000FF, VFE_CC2_REG, 0xE00000FF); |
Matt Wagantall | 53d968f | 2011-07-19 13:22:53 -0700 | [diff] [blame] | 6495 | rmwreg(0x80FF0000, VPE_CC_REG, 0xE0FF0010); |
Jay Chokshi | 9c23261 | 2013-01-17 15:14:46 -0800 | [diff] [blame] | 6496 | if (cpu_is_msm8960ab() || cpu_is_msm8960() || soc_class_is_apq8064()) { |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 6497 | rmwreg(0x80FF0000, DSI2_BYTE_CC_REG, 0xE0FF0010); |
| 6498 | rmwreg(0x80FF0000, DSI2_PIXEL_CC_REG, 0xE0FF0010); |
| 6499 | rmwreg(0x80FF0000, JPEGD_CC_REG, 0xE0FF0010); |
| 6500 | } |
Patrick Daly | e6f48904 | 2012-07-11 15:29:15 -0700 | [diff] [blame] | 6501 | if (cpu_is_msm8960ab()) |
| 6502 | rmwreg(0x00000001, DSI2_PIXEL_CC2_REG, 0x00000001); |
| 6503 | |
Stepan Moskovchenko | 0df9bb2 | 2012-07-06 18:19:15 -0700 | [diff] [blame] | 6504 | if (cpu_is_msm8960() || cpu_is_msm8930() || cpu_is_msm8930aa() || |
Tianyi Gou | d287a76 | 2012-11-02 12:35:49 -0700 | [diff] [blame] | 6505 | cpu_is_msm8627() || cpu_is_msm8930ab()) |
Patrick Daly | e6f48904 | 2012-07-11 15:29:15 -0700 | [diff] [blame] | 6506 | rmwreg(0x80FF0000, TV_CC_REG, 0xE1FFC010); |
| 6507 | if (cpu_is_msm8960ab()) |
| 6508 | rmwreg(0x00000000, TV_CC_REG, 0x00004010); |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 6509 | |
| 6510 | if (cpu_is_msm8960()) { |
Tianyi Gou | 8c1a118 | 2011-10-10 14:47:11 -0700 | [diff] [blame] | 6511 | rmwreg(0x80FF0000, GFX2D0_CC_REG, 0xE0FF0010); |
| 6512 | rmwreg(0x80FF0000, GFX2D1_CC_REG, 0xE0FF0010); |
Tianyi Gou | 8c1a118 | 2011-10-10 14:47:11 -0700 | [diff] [blame] | 6513 | } |
Jay Chokshi | 9c23261 | 2013-01-17 15:14:46 -0800 | [diff] [blame] | 6514 | if (soc_class_is_apq8064()) { |
Tianyi Gou | 8c1a118 | 2011-10-10 14:47:11 -0700 | [diff] [blame] | 6515 | rmwreg(0x00000000, TV_CC_REG, 0x00004010); |
Tianyi Gou | 621f874 | 2011-09-01 21:45:01 -0700 | [diff] [blame] | 6516 | rmwreg(0x80FF0000, VCAP_CC_REG, 0xE0FF1010); |
Tianyi Gou | 8c1a118 | 2011-10-10 14:47:11 -0700 | [diff] [blame] | 6517 | } |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 6518 | |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 6519 | /* |
| 6520 | * Initialize USB_HS_HCLK_FS registers: Set FORCE_C_ON bits so that |
| 6521 | * core remain active during halt state of the clk. Also, set sleep |
| 6522 | * and wake-up value to max. |
| 6523 | */ |
| 6524 | rmwreg(0x0000004F, USB_HS1_HCLK_FS_REG, 0x0000007F); |
Jay Chokshi | 9c23261 | 2013-01-17 15:14:46 -0800 | [diff] [blame] | 6525 | if (soc_class_is_apq8064()) { |
Tianyi Gou | 8c1a118 | 2011-10-10 14:47:11 -0700 | [diff] [blame] | 6526 | rmwreg(0x0000004F, USB_HS3_HCLK_FS_REG, 0x0000007F); |
| 6527 | rmwreg(0x0000004F, USB_HS4_HCLK_FS_REG, 0x0000007F); |
| 6528 | } |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 6529 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 6530 | /* De-assert MM AXI resets to all hardware blocks. */ |
| 6531 | writel_relaxed(0, SW_RESET_AXI_REG); |
| 6532 | |
| 6533 | /* Deassert all MM core resets. */ |
| 6534 | writel_relaxed(0, SW_RESET_CORE_REG); |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 6535 | writel_relaxed(0, SW_RESET_CORE2_REG); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 6536 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 6537 | /* Enable TSSC and PDM PXO sources. */ |
| 6538 | writel_relaxed(BIT(11), TSSC_CLK_CTL_REG); |
| 6539 | writel_relaxed(BIT(15), PDM_CLK_NS_REG); |
| 6540 | |
| 6541 | /* Source SLIMBus xo src from slimbus reference clock */ |
Patrick Daly | e6f48904 | 2012-07-11 15:29:15 -0700 | [diff] [blame] | 6542 | if (cpu_is_msm8960ab() || cpu_is_msm8960()) |
Tianyi Gou | 8c1a118 | 2011-10-10 14:47:11 -0700 | [diff] [blame] | 6543 | writel_relaxed(0x3, SLIMBUS_XO_SRC_CLK_CTL_REG); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 6544 | |
| 6545 | /* Source the dsi_byte_clks from the DSI PHY PLLs */ |
| 6546 | rmwreg(0x1, DSI1_BYTE_NS_REG, 0x7); |
Jay Chokshi | 9c23261 | 2013-01-17 15:14:46 -0800 | [diff] [blame] | 6547 | if (cpu_is_msm8960ab() || cpu_is_msm8960() || soc_class_is_apq8064()) |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 6548 | rmwreg(0x2, DSI2_BYTE_NS_REG, 0x7); |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 6549 | |
Siddhartha Agrawal | 482459c | 2012-05-24 15:28:53 -0700 | [diff] [blame] | 6550 | /* Source the dsi1_esc_clk from the DSI1 PHY PLLs */ |
| 6551 | rmwreg(0x1, DSI1_ESC_NS_REG, 0x7); |
| 6552 | |
Tianyi Gou | 352955d | 2012-05-18 19:44:01 -0700 | [diff] [blame] | 6553 | /* |
| 6554 | * Source the sata_phy_ref_clk from PXO and set predivider of |
| 6555 | * sata_pmalive_clk to 1. |
| 6556 | */ |
Jay Chokshi | 9c23261 | 2013-01-17 15:14:46 -0800 | [diff] [blame] | 6557 | if (soc_class_is_apq8064()) { |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 6558 | rmwreg(0, SATA_PHY_REF_CLK_CTL_REG, 0x1); |
Tianyi Gou | 352955d | 2012-05-18 19:44:01 -0700 | [diff] [blame] | 6559 | rmwreg(0, SATA_PMALIVE_CLK_CTL_REG, 0x3); |
| 6560 | } |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 6561 | |
| 6562 | /* |
Tianyi Gou | 05e0110 | 2012-02-08 22:15:49 -0800 | [diff] [blame] | 6563 | * TODO: Programming below PLLs and prng_clk is temporary and |
| 6564 | * needs to be removed after bootloaders program them. |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 6565 | */ |
Jay Chokshi | 9c23261 | 2013-01-17 15:14:46 -0800 | [diff] [blame] | 6566 | if (soc_class_is_apq8064()) { |
Tianyi Gou | 317aa86 | 2012-02-06 14:31:07 -0800 | [diff] [blame] | 6567 | u32 is_pll_enabled; |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 6568 | |
| 6569 | /* Program pxo_src_clk to source from PXO */ |
| 6570 | rmwreg(0x1, PXO_SRC_CLK_CTL_REG, 0x7); |
| 6571 | |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 6572 | /* Check if PLL14 is active */ |
| 6573 | is_pll_enabled = readl_relaxed(BB_PLL14_STATUS_REG) & BIT(16); |
Vikram Mulukutla | 5b14672 | 2012-04-23 18:17:50 -0700 | [diff] [blame] | 6574 | if (!is_pll_enabled) |
Tianyi Gou | df71f2e | 2011-10-24 22:25:04 -0700 | [diff] [blame] | 6575 | /* Ref clk = 27MHz and program pll14 to 480MHz */ |
Vikram Mulukutla | 6da35d3 | 2012-07-18 13:55:31 -0700 | [diff] [blame] | 6576 | configure_sr_pll(&pll14_config, &pll14_regs, 1); |
Tianyi Gou | 621f874 | 2011-09-01 21:45:01 -0700 | [diff] [blame] | 6577 | |
Tianyi Gou | c29c324 | 2011-10-12 21:02:15 -0700 | [diff] [blame] | 6578 | /* Check if PLL4 is active */ |
| 6579 | is_pll_enabled = readl_relaxed(LCC_PLL0_STATUS_REG) & BIT(16); |
Vikram Mulukutla | 5b14672 | 2012-04-23 18:17:50 -0700 | [diff] [blame] | 6580 | if (!is_pll_enabled) |
Tianyi Gou | df71f2e | 2011-10-24 22:25:04 -0700 | [diff] [blame] | 6581 | /* Ref clk = 27MHz and program pll4 to 393.2160MHz */ |
Vikram Mulukutla | 6da35d3 | 2012-07-18 13:55:31 -0700 | [diff] [blame] | 6582 | configure_sr_pll(&pll4_config_393, &pll4_regs, 1); |
Tianyi Gou | c29c324 | 2011-10-12 21:02:15 -0700 | [diff] [blame] | 6583 | |
| 6584 | /* Enable PLL4 source on the LPASS Primary PLL Mux */ |
| 6585 | writel_relaxed(0x1, LCC_PRI_PLL_CLK_CTL_REG); |
Tianyi Gou | 05e0110 | 2012-02-08 22:15:49 -0800 | [diff] [blame] | 6586 | |
| 6587 | /* Program prng_clk to 64MHz if it isn't configured */ |
| 6588 | if (!readl_relaxed(PRNG_CLK_NS_REG)) |
| 6589 | writel_relaxed(0x2B, PRNG_CLK_NS_REG); |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 6590 | } |
Tianyi Gou | 65c536a | 2012-03-20 23:20:29 -0700 | [diff] [blame] | 6591 | |
Jay Chokshi | 9c23261 | 2013-01-17 15:14:46 -0800 | [diff] [blame] | 6592 | if (cpu_is_apq8064() || cpu_is_apq8064aa()) { |
Patrick Daly | b7c777a | 2012-08-23 19:07:30 -0700 | [diff] [blame] | 6593 | /* Program PLL15 to 975MHz with ref clk = 27MHz */ |
| 6594 | configure_sr_pll(&pll15_config, &pll15_regs, 0); |
| 6595 | } else if (cpu_is_apq8064ab()) { |
| 6596 | /* Program PLL15 to 900MHZ */ |
| 6597 | pll15_config.l = 0x21 | BVAL(31, 7, 0x620); |
| 6598 | pll15_config.m = 0x1; |
| 6599 | pll15_config.n = 0x3; |
| 6600 | configure_sr_pll(&pll15_config, &pll15_regs, 0); |
Patrick Daly | aa61456 | 2013-01-23 16:39:45 -0800 | [diff] [blame] | 6601 | } else if (cpu_is_msm8960ab()) { |
| 6602 | pll3_clk.c.rate = 880000000; |
| 6603 | configure_sr_pll(&pll3_config, &pll3_regs, 0); |
Patrick Daly | b7c777a | 2012-08-23 19:07:30 -0700 | [diff] [blame] | 6604 | } |
| 6605 | |
Tianyi Gou | 65c536a | 2012-03-20 23:20:29 -0700 | [diff] [blame] | 6606 | /* |
Seemanta Dutta | 4dc1708 | 2012-10-24 18:37:42 -0700 | [diff] [blame] | 6607 | * Change PLL15 configuration based on the SoC we're running on. |
Tianyi Gou | 65c536a | 2012-03-20 23:20:29 -0700 | [diff] [blame] | 6608 | */ |
Stepan Moskovchenko | 0df9bb2 | 2012-07-06 18:19:15 -0700 | [diff] [blame] | 6609 | if (cpu_is_msm8930() || cpu_is_msm8930aa() || cpu_is_msm8627()) { |
Vikram Mulukutla | 5b14672 | 2012-04-23 18:17:50 -0700 | [diff] [blame] | 6610 | pll15_config.l = 0x21 | BVAL(31, 7, 0x600); |
| 6611 | pll15_config.m = 0x1; |
| 6612 | pll15_config.n = 0x3; |
Vikram Mulukutla | 6da35d3 | 2012-07-18 13:55:31 -0700 | [diff] [blame] | 6613 | configure_sr_pll(&pll15_config, &pll15_regs, 0); |
Vikram Mulukutla | 5b14672 | 2012-04-23 18:17:50 -0700 | [diff] [blame] | 6614 | /* Disable AUX and BIST outputs */ |
| 6615 | writel_relaxed(0, MM_PLL3_TEST_CTL_REG); |
Seemanta Dutta | 4dc1708 | 2012-10-24 18:37:42 -0700 | [diff] [blame] | 6616 | } else if (cpu_is_msm8930ab()) { |
| 6617 | pll15_config.l = 0x25 | BVAL(31, 7, 0x600); |
| 6618 | pll15_config.m = 0x25; |
| 6619 | pll15_config.n = 0x3E7; |
| 6620 | configure_sr_pll(&pll15_config, &pll15_regs, 0); |
| 6621 | /* Disable AUX and BIST outputs */ |
| 6622 | writel_relaxed(0, MM_PLL3_TEST_CTL_REG); |
Tianyi Gou | 65c536a | 2012-03-20 23:20:29 -0700 | [diff] [blame] | 6623 | } |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 6624 | } |
| 6625 | |
Patrick Daly | aa61456 | 2013-01-23 16:39:45 -0800 | [diff] [blame] | 6626 | #define PTE_EFUSE_GFX_PHYS (0x007000BC) |
| 6627 | |
| 6628 | static unsigned long *select_gfx_fmax_plan(unsigned long **gfx_fmax, int size) |
| 6629 | { |
| 6630 | void __iomem *pte_efuse; |
| 6631 | u32 gfx_speed_bin; |
| 6632 | |
| 6633 | pte_efuse = ioremap(PTE_EFUSE_GFX_PHYS, 4); |
| 6634 | gfx_speed_bin = readl_relaxed(pte_efuse); |
| 6635 | gfx_speed_bin = (gfx_speed_bin & BM(25, 24)) >> 24; |
| 6636 | iounmap(pte_efuse); |
| 6637 | |
| 6638 | if (gfx_speed_bin >= size) { |
| 6639 | pr_err("GFX_SPEED_BIN: defaulting to 0\n"); |
| 6640 | gfx_speed_bin = 0; |
| 6641 | } |
| 6642 | |
| 6643 | pr_info("GFX_SPEED_BIN: %d\n", gfx_speed_bin); |
| 6644 | return gfx_fmax[gfx_speed_bin]; |
| 6645 | } |
| 6646 | |
Patrick Daly | e6f48904 | 2012-07-11 15:29:15 -0700 | [diff] [blame] | 6647 | struct clock_init_data msm8960_clock_init_data __initdata; |
Matt Wagantall | b64888f | 2012-04-02 21:35:07 -0700 | [diff] [blame] | 6648 | static void __init msm8960_clock_pre_init(void) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 6649 | { |
Matt Wagantall | 86e0382 | 2011-12-12 10:59:24 -0800 | [diff] [blame] | 6650 | /* Initialize clock registers. */ |
| 6651 | reg_init(); |
| 6652 | |
Jay Chokshi | 9c23261 | 2013-01-17 15:14:46 -0800 | [diff] [blame] | 6653 | if (soc_class_is_apq8064()) |
Matt Wagantall | 82feaa1 | 2012-07-09 10:54:49 -0700 | [diff] [blame] | 6654 | vdd_sr2_hdmi_pll.set_vdd = set_vdd_sr2_hdmi_pll_8064; |
Tianyi Gou | bf3d0b1 | 2012-01-23 14:37:28 -0800 | [diff] [blame] | 6655 | |
Matt Wagantall | 86e0382 | 2011-12-12 10:59:24 -0800 | [diff] [blame] | 6656 | /* Detect PLL4 programmed for alternate 491.52MHz clock plan. */ |
| 6657 | if (readl_relaxed(LCC_PLL0_L_VAL_REG) == 0x12) { |
| 6658 | pll4_clk.c.rate = 491520000; |
| 6659 | audio_slimbus_clk.freq_tbl = clk_tbl_aif_osr_492; |
| 6660 | mi2s_osr_clk.freq_tbl = clk_tbl_aif_osr_492; |
| 6661 | codec_i2s_mic_osr_clk.freq_tbl = clk_tbl_aif_osr_492; |
| 6662 | spare_i2s_mic_osr_clk.freq_tbl = clk_tbl_aif_osr_492; |
| 6663 | codec_i2s_spkr_osr_clk.freq_tbl = clk_tbl_aif_osr_492; |
| 6664 | spare_i2s_spkr_osr_clk.freq_tbl = clk_tbl_aif_osr_492; |
| 6665 | pcm_clk.freq_tbl = clk_tbl_pcm_492; |
| 6666 | } |
| 6667 | |
Patrick Daly | e6f48904 | 2012-07-11 15:29:15 -0700 | [diff] [blame] | 6668 | if (cpu_is_msm8960() || cpu_is_msm8960ab()) |
| 6669 | memcpy(msm_clocks_8960, msm_clocks_8960_common, |
| 6670 | sizeof(msm_clocks_8960_common)); |
| 6671 | if (cpu_is_msm8960ab()) { |
Patrick Daly | aa61456 | 2013-01-23 16:39:45 -0800 | [diff] [blame] | 6672 | gfx3d_clk.freq_tbl = clk_tbl_gfx3d_8960ab; |
Patrick Daly | 6e03432 | 2012-10-26 18:18:32 -0700 | [diff] [blame] | 6673 | mdp_clk.c.fmax = fmax_mdp_8960ab; |
Patrick Daly | e6f48904 | 2012-07-11 15:29:15 -0700 | [diff] [blame] | 6674 | |
Patrick Daly | aa61456 | 2013-01-23 16:39:45 -0800 | [diff] [blame] | 6675 | gfx3d_clk.c.fmax = select_gfx_fmax_plan(fmax_gfx3d_8960ab, |
| 6676 | ARRAY_SIZE(fmax_gfx3d_8960ab)); |
| 6677 | |
Patrick Daly | e6f48904 | 2012-07-11 15:29:15 -0700 | [diff] [blame] | 6678 | memcpy(msm_clocks_8960 + ARRAY_SIZE(msm_clocks_8960_common), |
| 6679 | msm_clocks_8960ab_only, sizeof(msm_clocks_8960ab_only)); |
| 6680 | msm8960_clock_init_data.size -= |
| 6681 | ARRAY_SIZE(msm_clocks_8960_only); |
Joel King | 9af070b | 2012-08-19 22:32:14 -0700 | [diff] [blame] | 6682 | |
| 6683 | gmem_axi_clk.c.depends = &gfx3d_axi_clk.c; |
Patrick Daly | e6f48904 | 2012-07-11 15:29:15 -0700 | [diff] [blame] | 6684 | } else if (cpu_is_msm8960()) { |
Patrick Daly | 2c09c4c | 2012-10-25 19:47:56 -0700 | [diff] [blame] | 6685 | gfx3d_clk.freq_tbl = clk_tbl_gfx3d_8960; |
Patrick Daly | e6f48904 | 2012-07-11 15:29:15 -0700 | [diff] [blame] | 6686 | memcpy(msm_clocks_8960 + ARRAY_SIZE(msm_clocks_8960_common), |
| 6687 | msm_clocks_8960_only, sizeof(msm_clocks_8960_only)); |
| 6688 | msm8960_clock_init_data.size -= |
| 6689 | ARRAY_SIZE(msm_clocks_8960ab_only); |
| 6690 | } |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 6691 | /* |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 6692 | * Change the freq tables for and voltage requirements for |
Patrick Daly | b7c777a | 2012-08-23 19:07:30 -0700 | [diff] [blame] | 6693 | * clocks which differ between chips. |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 6694 | */ |
Jay Chokshi | 9c23261 | 2013-01-17 15:14:46 -0800 | [diff] [blame] | 6695 | if (cpu_is_apq8064() || cpu_is_apq8064aa()) |
Saravana Kannan | 55e959d | 2012-10-15 22:16:04 -0700 | [diff] [blame] | 6696 | gfx3d_clk.c.fmax = fmax_gfx3d_8064; |
Jay Chokshi | 9c23261 | 2013-01-17 15:14:46 -0800 | [diff] [blame] | 6697 | |
| 6698 | if (cpu_is_apq8064ab()) |
Saravana Kannan | 55e959d | 2012-10-15 22:16:04 -0700 | [diff] [blame] | 6699 | gfx3d_clk.c.fmax = fmax_gfx3d_8064ab; |
Jay Chokshi | 9c23261 | 2013-01-17 15:14:46 -0800 | [diff] [blame] | 6700 | |
Patrick Daly | b7c777a | 2012-08-23 19:07:30 -0700 | [diff] [blame] | 6701 | if ((cpu_is_apq8064() && |
| 6702 | SOCINFO_VERSION_MAJOR(socinfo_get_version()) == 2) || |
Jay Chokshi | 9c23261 | 2013-01-17 15:14:46 -0800 | [diff] [blame] | 6703 | cpu_is_apq8064ab() || cpu_is_apq8064aa()) { |
Patrick Daly | b7c777a | 2012-08-23 19:07:30 -0700 | [diff] [blame] | 6704 | |
Saravana Kannan | 55e959d | 2012-10-15 22:16:04 -0700 | [diff] [blame] | 6705 | vcodec_clk.c.fmax = fmax_vcodec_8064v2; |
| 6706 | ce3_src_clk.c.fmax = fmax_ce3_8064v2; |
| 6707 | sdc1_clk.c.fmax = fmax_sdc1_8064v2; |
Patrick Daly | b7c777a | 2012-08-23 19:07:30 -0700 | [diff] [blame] | 6708 | } |
Jay Chokshi | 9c23261 | 2013-01-17 15:14:46 -0800 | [diff] [blame] | 6709 | if (soc_class_is_apq8064()) { |
Saravana Kannan | 55e959d | 2012-10-15 22:16:04 -0700 | [diff] [blame] | 6710 | ijpeg_clk.c.fmax = fmax_ijpeg_8064; |
| 6711 | mdp_clk.c.fmax = fmax_mdp_8064; |
| 6712 | tv_src_clk.c.fmax = fmax_tv_src_8064; |
| 6713 | vfe_clk.c.fmax = fmax_vfe_8064; |
Patrick Daly | e6f48904 | 2012-07-11 15:29:15 -0700 | [diff] [blame] | 6714 | gmem_axi_clk.c.depends = &gfx3d_axi_clk.c; |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 6715 | } |
| 6716 | |
| 6717 | /* |
| 6718 | * Change the freq tables and voltage requirements for |
| 6719 | * clocks which differ between 8960 and 8930. |
| 6720 | */ |
Seemanta Dutta | 4dc1708 | 2012-10-24 18:37:42 -0700 | [diff] [blame] | 6721 | if (cpu_is_msm8930() || cpu_is_msm8627()) |
Saravana Kannan | 55e959d | 2012-10-15 22:16:04 -0700 | [diff] [blame] | 6722 | gfx3d_clk.c.fmax = fmax_gfx3d_8930; |
Seemanta Dutta | 4dc1708 | 2012-10-24 18:37:42 -0700 | [diff] [blame] | 6723 | else if (cpu_is_msm8930aa()) |
Saravana Kannan | 55e959d | 2012-10-15 22:16:04 -0700 | [diff] [blame] | 6724 | gfx3d_clk.c.fmax = fmax_gfx3d_8930aa; |
Patrick Daly | ebe63c5 | 2012-08-07 15:41:30 -0700 | [diff] [blame] | 6725 | if (cpu_is_msm8930() || cpu_is_msm8930aa() || cpu_is_msm8627()) { |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 6726 | pll15_clk.c.rate = 900000000; |
| 6727 | gmem_axi_clk.c.depends = &gfx3d_axi_clk_8930.c; |
Seemanta Dutta | 4dc1708 | 2012-10-24 18:37:42 -0700 | [diff] [blame] | 6728 | } else if (cpu_is_msm8930ab()) { |
| 6729 | gfx3d_clk.freq_tbl = clk_tbl_gfx3d_8930ab; |
| 6730 | pll15_clk.c.rate = 1000000000; |
| 6731 | gfx3d_clk.c.fmax = fmax_gfx3d_8930ab; |
| 6732 | gmem_axi_clk.c.depends = &gfx3d_axi_clk_8930.c; |
| 6733 | vcodec_clk.c.fmax = fmax_vcodec_8930ab; |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 6734 | } |
Stephen Boyd | 842a1f6 | 2012-04-26 19:07:38 -0700 | [diff] [blame] | 6735 | if ((readl_relaxed(PRNG_CLK_NS_REG) & 0x7F) == 0x2B) |
| 6736 | prng_clk.freq_tbl = clk_tbl_prng_64; |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 6737 | |
Vikram Mulukutla | 681d868 | 2012-03-09 23:56:20 -0800 | [diff] [blame] | 6738 | clk_ops_local_pll.enable = sr_pll_clk_enable; |
Matt Wagantall | b64888f | 2012-04-02 21:35:07 -0700 | [diff] [blame] | 6739 | } |
| 6740 | |
Patrick Daly | 1a3859f | 2012-08-27 16:10:26 -0700 | [diff] [blame] | 6741 | static void __init msm8930_pm8917_clock_pre_init(void) |
| 6742 | { |
| 6743 | /* detect pmic8917 from board file, and call this init function */ |
| 6744 | |
| 6745 | vdd_dig.set_vdd = set_vdd_dig_8930; |
| 6746 | rpm_vreg_dig_8930 = RPM_VREG_ID_PM8917_VDD_DIG_CORNER; |
| 6747 | vdd_sr2_hdmi_pll.set_vdd = set_vdd_sr2_hdmi_pll_8930_pm8917; |
| 6748 | |
| 6749 | msm8960_clock_pre_init(); |
| 6750 | } |
| 6751 | |
| 6752 | static void __init msm8930_clock_pre_init(void) |
| 6753 | { |
| 6754 | vdd_dig.set_vdd = set_vdd_dig_8930; |
| 6755 | vdd_sr2_hdmi_pll.set_vdd = set_vdd_sr2_hdmi_pll_8930; |
| 6756 | |
| 6757 | msm8960_clock_pre_init(); |
| 6758 | } |
| 6759 | |
Matt Wagantall | b64888f | 2012-04-02 21:35:07 -0700 | [diff] [blame] | 6760 | static void __init msm8960_clock_post_init(void) |
| 6761 | { |
| 6762 | /* Keep PXO on whenever APPS cpu is active */ |
| 6763 | clk_prepare_enable(&pxo_a_clk.c); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 6764 | |
Matt Wagantall | e655cd7 | 2012-04-09 10:15:03 -0700 | [diff] [blame] | 6765 | /* Reset 3D core while clocked to ensure it resets completely. */ |
| 6766 | clk_set_rate(&gfx3d_clk.c, 27000000); |
| 6767 | clk_prepare_enable(&gfx3d_clk.c); |
| 6768 | clk_reset(&gfx3d_clk.c, CLK_RESET_ASSERT); |
| 6769 | udelay(5); |
| 6770 | clk_reset(&gfx3d_clk.c, CLK_RESET_DEASSERT); |
| 6771 | clk_disable_unprepare(&gfx3d_clk.c); |
| 6772 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 6773 | /* Initialize rates for clocks that only support one. */ |
| 6774 | clk_set_rate(&pdm_clk.c, 27000000); |
Stephen Boyd | 842a1f6 | 2012-04-26 19:07:38 -0700 | [diff] [blame] | 6775 | clk_set_rate(&prng_clk.c, prng_clk.freq_tbl->freq_hz); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 6776 | clk_set_rate(&mdp_vsync_clk.c, 27000000); |
| 6777 | clk_set_rate(&tsif_ref_clk.c, 105000); |
| 6778 | clk_set_rate(&tssc_clk.c, 27000000); |
| 6779 | clk_set_rate(&usb_hs1_xcvr_clk.c, 60000000); |
Jay Chokshi | 9c23261 | 2013-01-17 15:14:46 -0800 | [diff] [blame] | 6780 | if (soc_class_is_apq8064()) { |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 6781 | clk_set_rate(&usb_hs3_xcvr_clk.c, 60000000); |
| 6782 | clk_set_rate(&usb_hs4_xcvr_clk.c, 60000000); |
| 6783 | } |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 6784 | clk_set_rate(&usb_fs1_src_clk.c, 60000000); |
Patrick Daly | e6f48904 | 2012-07-11 15:29:15 -0700 | [diff] [blame] | 6785 | if (cpu_is_msm8960ab() || cpu_is_msm8960() || cpu_is_msm8930() || |
Tianyi Gou | d287a76 | 2012-11-02 12:35:49 -0700 | [diff] [blame] | 6786 | cpu_is_msm8930aa() || cpu_is_msm8627() || cpu_is_msm8930ab()) |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 6787 | clk_set_rate(&usb_fs2_src_clk.c, 60000000); |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 6788 | clk_set_rate(&usb_hsic_xcvr_fs_clk.c, 60000000); |
| 6789 | clk_set_rate(&usb_hsic_hsic_src_clk.c, 480000000); |
| 6790 | clk_set_rate(&usb_hsic_hsio_cal_clk.c, 9000000); |
Lena Salman | 127823f | 2012-02-14 17:13:53 +0200 | [diff] [blame] | 6791 | clk_set_rate(&usb_hsic_system_clk.c, 60000000); |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 6792 | /* |
| 6793 | * Set the CSI rates to a safe default to avoid warnings when |
| 6794 | * switching csi pix and rdi clocks. |
| 6795 | */ |
| 6796 | clk_set_rate(&csi0_src_clk.c, 27000000); |
| 6797 | clk_set_rate(&csi1_src_clk.c, 27000000); |
| 6798 | clk_set_rate(&csi2_src_clk.c, 27000000); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 6799 | |
| 6800 | /* |
Stephen Boyd | 60496bb | 2011-10-17 13:51:37 -0700 | [diff] [blame] | 6801 | * The halt status bits for these clocks may be incorrect at boot. |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 6802 | * Toggle these clocks on and off to refresh them. |
| 6803 | */ |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 6804 | clk_prepare_enable(&pdm_clk.c); |
| 6805 | clk_disable_unprepare(&pdm_clk.c); |
| 6806 | clk_prepare_enable(&tssc_clk.c); |
| 6807 | clk_disable_unprepare(&tssc_clk.c); |
Stephen Boyd | e334aeb | 2012-01-24 12:17:29 -0800 | [diff] [blame] | 6808 | clk_prepare_enable(&usb_hsic_hsic_clk.c); |
| 6809 | clk_disable_unprepare(&usb_hsic_hsic_clk.c); |
Stephen Boyd | d7a143a | 2012-02-16 17:59:26 -0800 | [diff] [blame] | 6810 | |
| 6811 | /* |
| 6812 | * Keep sfab floor @ 54MHz so that Krait AHB is at least 27MHz at all |
| 6813 | * times when Apps CPU is active. This ensures the timer's requirement |
| 6814 | * of Krait AHB running 4 times as fast as the timer itself. |
| 6815 | */ |
| 6816 | clk_set_rate(&sfab_tmr_a_clk.c, 54000000); |
Stephen Boyd | e334aeb | 2012-01-24 12:17:29 -0800 | [diff] [blame] | 6817 | clk_prepare_enable(&sfab_tmr_a_clk.c); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 6818 | } |
| 6819 | |
Stephen Boyd | bb600ae | 2011-08-02 20:11:40 -0700 | [diff] [blame] | 6820 | static int __init msm8960_clock_late_init(void) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 6821 | { |
Stephen Boyd | a3787f3 | 2011-09-16 18:55:13 -0700 | [diff] [blame] | 6822 | int rc; |
| 6823 | 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] | 6824 | 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] | 6825 | |
Stephen Boyd | 9e497f0 | 2012-08-24 13:07:24 -0700 | [diff] [blame] | 6826 | /* Vote for MMFPB to be on when Apps is active. */ |
Stephen Boyd | a3787f3 | 2011-09-16 18:55:13 -0700 | [diff] [blame] | 6827 | if (WARN(IS_ERR(mmfpb_a_clk), "mmfpb_a_clk not found (%ld)\n", |
| 6828 | PTR_ERR(mmfpb_a_clk))) |
| 6829 | return PTR_ERR(mmfpb_a_clk); |
Stephen Boyd | 9e497f0 | 2012-08-24 13:07:24 -0700 | [diff] [blame] | 6830 | rc = clk_set_rate(mmfpb_a_clk, 38400000); |
Stephen Boyd | a3787f3 | 2011-09-16 18:55:13 -0700 | [diff] [blame] | 6831 | if (WARN(rc, "mmfpb_a_clk rate was not set (%d)\n", rc)) |
| 6832 | return rc; |
Stephen Boyd | e334aeb | 2012-01-24 12:17:29 -0800 | [diff] [blame] | 6833 | rc = clk_prepare_enable(mmfpb_a_clk); |
Stephen Boyd | a3787f3 | 2011-09-16 18:55:13 -0700 | [diff] [blame] | 6834 | if (WARN(rc, "mmfpb_a_clk not enabled (%d)\n", rc)) |
| 6835 | return rc; |
| 6836 | |
Stephen Boyd | 9e497f0 | 2012-08-24 13:07:24 -0700 | [diff] [blame] | 6837 | /* Vote for CFPB to be on when Apps is active. */ |
Stephen Boyd | 8543613 | 2011-09-16 18:55:13 -0700 | [diff] [blame] | 6838 | if (WARN(IS_ERR(cfpb_a_clk), "cfpb_a_clk not found (%ld)\n", |
| 6839 | PTR_ERR(cfpb_a_clk))) |
| 6840 | return PTR_ERR(cfpb_a_clk); |
Stephen Boyd | 9e497f0 | 2012-08-24 13:07:24 -0700 | [diff] [blame] | 6841 | rc = clk_set_rate(cfpb_a_clk, 32000000); |
Stephen Boyd | 8543613 | 2011-09-16 18:55:13 -0700 | [diff] [blame] | 6842 | if (WARN(rc, "cfpb_a_clk rate was not set (%d)\n", rc)) |
| 6843 | return rc; |
Stephen Boyd | e334aeb | 2012-01-24 12:17:29 -0800 | [diff] [blame] | 6844 | rc = clk_prepare_enable(cfpb_a_clk); |
Stephen Boyd | 8543613 | 2011-09-16 18:55:13 -0700 | [diff] [blame] | 6845 | if (WARN(rc, "cfpb_a_clk not enabled (%d)\n", rc)) |
| 6846 | return rc; |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 6847 | |
Patrick Daly | 441929e | 2013-02-14 11:48:26 -0800 | [diff] [blame] | 6848 | return 0; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 6849 | } |
Stephen Boyd | bb600ae | 2011-08-02 20:11:40 -0700 | [diff] [blame] | 6850 | |
| 6851 | struct clock_init_data msm8960_clock_init_data __initdata = { |
| 6852 | .table = msm_clocks_8960, |
| 6853 | .size = ARRAY_SIZE(msm_clocks_8960), |
Matt Wagantall | b64888f | 2012-04-02 21:35:07 -0700 | [diff] [blame] | 6854 | .pre_init = msm8960_clock_pre_init, |
| 6855 | .post_init = msm8960_clock_post_init, |
Stephen Boyd | bb600ae | 2011-08-02 20:11:40 -0700 | [diff] [blame] | 6856 | .late_init = msm8960_clock_late_init, |
| 6857 | }; |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 6858 | |
| 6859 | struct clock_init_data apq8064_clock_init_data __initdata = { |
| 6860 | .table = msm_clocks_8064, |
| 6861 | .size = ARRAY_SIZE(msm_clocks_8064), |
Matt Wagantall | b64888f | 2012-04-02 21:35:07 -0700 | [diff] [blame] | 6862 | .pre_init = msm8960_clock_pre_init, |
| 6863 | .post_init = msm8960_clock_post_init, |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 6864 | .late_init = msm8960_clock_late_init, |
| 6865 | }; |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 6866 | |
| 6867 | struct clock_init_data msm8930_clock_init_data __initdata = { |
| 6868 | .table = msm_clocks_8930, |
| 6869 | .size = ARRAY_SIZE(msm_clocks_8930), |
Patrick Daly | 1a3859f | 2012-08-27 16:10:26 -0700 | [diff] [blame] | 6870 | .pre_init = msm8930_clock_pre_init, |
| 6871 | .post_init = msm8960_clock_post_init, |
| 6872 | .late_init = msm8960_clock_late_init, |
| 6873 | }; |
| 6874 | |
| 6875 | struct clock_init_data msm8930_pm8917_clock_init_data __initdata = { |
| 6876 | .table = msm_clocks_8930, |
| 6877 | .size = ARRAY_SIZE(msm_clocks_8930), |
| 6878 | .pre_init = msm8930_pm8917_clock_pre_init, |
Matt Wagantall | b64888f | 2012-04-02 21:35:07 -0700 | [diff] [blame] | 6879 | .post_init = msm8960_clock_post_init, |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 6880 | .late_init = msm8960_clock_late_init, |
| 6881 | }; |