Manu Gautam | 5143b25 | 2012-01-05 19:25:23 -0800 | [diff] [blame] | 1 | /* Copyright (c) 2009-2012, Code Aurora Forum. All rights reserved. |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2 | * |
| 3 | * This program is free software; you can redistribute it and/or modify |
| 4 | * it under the terms of the GNU General Public License version 2 and |
| 5 | * only version 2 as published by the Free Software Foundation. |
| 6 | * |
| 7 | * This program is distributed in the hope that it will be useful, |
| 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 10 | * GNU General Public License for more details. |
| 11 | */ |
| 12 | |
| 13 | #include <linux/kernel.h> |
| 14 | #include <linux/init.h> |
| 15 | #include <linux/err.h> |
| 16 | #include <linux/ctype.h> |
| 17 | #include <linux/bitops.h> |
| 18 | #include <linux/io.h> |
| 19 | #include <linux/spinlock.h> |
| 20 | #include <linux/delay.h> |
| 21 | #include <linux/clk.h> |
| 22 | |
| 23 | #include <asm/clkdev.h> |
| 24 | #include <asm/mach-types.h> |
| 25 | |
| 26 | #include <mach/msm_iomap.h> |
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) |
| 88 | #define BB_MMCC_PLL2_TEST_CTL_REG REG(0x3170) |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 89 | #define BB_PLL14_MODE_REG REG(0x31C0) |
| 90 | #define BB_PLL14_L_VAL_REG REG(0x31C4) |
| 91 | #define BB_PLL14_M_VAL_REG REG(0x31C8) |
| 92 | #define BB_PLL14_N_VAL_REG REG(0x31CC) |
| 93 | #define BB_PLL14_TEST_CTL_REG REG(0x31D0) |
| 94 | #define BB_PLL14_CONFIG_REG REG(0x31D4) |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 95 | #define BB_PLL14_STATUS_REG REG(0x31D8) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 96 | #define PLLTEST_PAD_CFG_REG REG(0x2FA4) |
| 97 | #define PMEM_ACLK_CTL_REG REG(0x25A0) |
| 98 | #define RINGOSC_NS_REG REG(0x2DC0) |
| 99 | #define RINGOSC_STATUS_REG REG(0x2DCC) |
| 100 | #define RINGOSC_TCXO_CTL_REG REG(0x2DC4) |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 101 | #define RPM_MSG_RAM_HCLK_CTL_REG REG(0x27E0) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 102 | #define SC0_U_CLK_BRANCH_ENA_VOTE_REG REG(0x3080) |
| 103 | #define SDCn_APPS_CLK_MD_REG(n) REG(0x2828+(0x20*((n)-1))) |
| 104 | #define SDCn_APPS_CLK_NS_REG(n) REG(0x282C+(0x20*((n)-1))) |
| 105 | #define SDCn_HCLK_CTL_REG(n) REG(0x2820+(0x20*((n)-1))) |
| 106 | #define SDCn_RESET_REG(n) REG(0x2830+(0x20*((n)-1))) |
| 107 | #define SLIMBUS_XO_SRC_CLK_CTL_REG REG(0x2628) |
| 108 | #define TSIF_HCLK_CTL_REG REG(0x2700) |
| 109 | #define TSIF_REF_CLK_MD_REG REG(0x270C) |
| 110 | #define TSIF_REF_CLK_NS_REG REG(0x2710) |
| 111 | #define TSSC_CLK_CTL_REG REG(0x2CA0) |
Tianyi Gou | 352955d | 2012-05-18 19:44:01 -0700 | [diff] [blame] | 112 | #define SATA_HCLK_CTL_REG REG(0x2C00) |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 113 | #define SATA_CLK_SRC_NS_REG REG(0x2C08) |
| 114 | #define SATA_RXOOB_CLK_CTL_REG REG(0x2C0C) |
| 115 | #define SATA_PMALIVE_CLK_CTL_REG REG(0x2C10) |
| 116 | #define SATA_PHY_REF_CLK_CTL_REG REG(0x2C14) |
Tianyi Gou | 352955d | 2012-05-18 19:44:01 -0700 | [diff] [blame] | 117 | #define SATA_ACLK_CTL_REG REG(0x2C20) |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 118 | #define SATA_PHY_CFG_CLK_CTL_REG REG(0x2C40) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 119 | #define USB_FSn_HCLK_CTL_REG(n) REG(0x2960+(0x20*((n)-1))) |
| 120 | #define USB_FSn_RESET_REG(n) REG(0x2974+(0x20*((n)-1))) |
| 121 | #define USB_FSn_SYSTEM_CLK_CTL_REG(n) REG(0x296C+(0x20*((n)-1))) |
| 122 | #define USB_FSn_XCVR_FS_CLK_MD_REG(n) REG(0x2964+(0x20*((n)-1))) |
| 123 | #define USB_FSn_XCVR_FS_CLK_NS_REG(n) REG(0x2968+(0x20*((n)-1))) |
| 124 | #define USB_HS1_HCLK_CTL_REG REG(0x2900) |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 125 | #define USB_HS1_HCLK_FS_REG REG(0x2904) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 126 | #define USB_HS1_RESET_REG REG(0x2910) |
| 127 | #define USB_HS1_XCVR_FS_CLK_MD_REG REG(0x2908) |
| 128 | #define USB_HS1_XCVR_FS_CLK_NS_REG REG(0x290C) |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 129 | #define USB_HS3_HCLK_CTL_REG REG(0x3700) |
| 130 | #define USB_HS3_HCLK_FS_REG REG(0x3704) |
| 131 | #define USB_HS3_RESET_REG REG(0x3710) |
| 132 | #define USB_HS3_XCVR_FS_CLK_MD_REG REG(0X3708) |
| 133 | #define USB_HS3_XCVR_FS_CLK_NS_REG REG(0X370C) |
| 134 | #define USB_HS4_HCLK_CTL_REG REG(0x3720) |
| 135 | #define USB_HS4_HCLK_FS_REG REG(0x3724) |
| 136 | #define USB_HS4_RESET_REG REG(0x3730) |
| 137 | #define USB_HS4_XCVR_FS_CLK_MD_REG REG(0X3728) |
| 138 | #define USB_HS4_XCVR_FS_CLK_NS_REG REG(0X372C) |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 139 | #define USB_HSIC_HCLK_CTL_REG REG(0x2920) |
| 140 | #define USB_HSIC_HSIC_CLK_CTL_REG REG(0x2B44) |
| 141 | #define USB_HSIC_HSIC_CLK_SRC_CTL_REG REG(0x2B40) |
| 142 | #define USB_HSIC_HSIO_CAL_CLK_CTL_REG REG(0x2B48) |
| 143 | #define USB_HSIC_RESET_REG REG(0x2934) |
| 144 | #define USB_HSIC_SYSTEM_CLK_CTL_REG REG(0x292C) |
| 145 | #define USB_HSIC_XCVR_FS_CLK_MD_REG REG(0x2924) |
| 146 | #define USB_HSIC_XCVR_FS_CLK_NS_REG REG(0x2928) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 147 | #define USB_PHY0_RESET_REG REG(0x2E20) |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 148 | #define PCIE_ALT_REF_CLK_NS_REG REG(0x3860) |
Tianyi Gou | 6613de5 | 2012-01-27 17:57:53 -0800 | [diff] [blame] | 149 | #define PCIE_ACLK_CTL_REG REG(0x22C0) |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 150 | #define PCIE_HCLK_CTL_REG REG(0x22CC) |
Tianyi Gou | 6613de5 | 2012-01-27 17:57:53 -0800 | [diff] [blame] | 151 | #define PCIE_PCLK_CTL_REG REG(0x22D0) |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 152 | #define GPLL1_MODE_REG REG(0x3160) |
| 153 | #define GPLL1_L_VAL_REG REG(0x3164) |
| 154 | #define GPLL1_M_VAL_REG REG(0x3168) |
| 155 | #define GPLL1_N_VAL_REG REG(0x316C) |
| 156 | #define GPLL1_CONFIG_REG REG(0x3174) |
| 157 | #define GPLL1_STATUS_REG REG(0x3178) |
| 158 | #define PXO_SRC_CLK_CTL_REG REG(0x2EA0) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 159 | |
| 160 | /* Multimedia clock registers. */ |
| 161 | #define AHB_EN_REG REG_MM(0x0008) |
| 162 | #define AHB_EN2_REG REG_MM(0x0038) |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 163 | #define AHB_EN3_REG REG_MM(0x0248) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 164 | #define AHB_NS_REG REG_MM(0x0004) |
| 165 | #define AXI_NS_REG REG_MM(0x0014) |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 166 | #define CAMCLK0_NS_REG REG_MM(0x0148) |
| 167 | #define CAMCLK0_CC_REG REG_MM(0x0140) |
| 168 | #define CAMCLK0_MD_REG REG_MM(0x0144) |
| 169 | #define CAMCLK1_NS_REG REG_MM(0x015C) |
| 170 | #define CAMCLK1_CC_REG REG_MM(0x0154) |
| 171 | #define CAMCLK1_MD_REG REG_MM(0x0158) |
| 172 | #define CAMCLK2_NS_REG REG_MM(0x0228) |
| 173 | #define CAMCLK2_CC_REG REG_MM(0x0220) |
| 174 | #define CAMCLK2_MD_REG REG_MM(0x0224) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 175 | #define CSI0_NS_REG REG_MM(0x0048) |
| 176 | #define CSI0_CC_REG REG_MM(0x0040) |
| 177 | #define CSI0_MD_REG REG_MM(0x0044) |
| 178 | #define CSI1_NS_REG REG_MM(0x0010) |
| 179 | #define CSI1_CC_REG REG_MM(0x0024) |
| 180 | #define CSI1_MD_REG REG_MM(0x0028) |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 181 | #define CSI2_NS_REG REG_MM(0x0234) |
| 182 | #define CSI2_CC_REG REG_MM(0x022C) |
| 183 | #define CSI2_MD_REG REG_MM(0x0230) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 184 | #define CSIPHYTIMER_CC_REG REG_MM(0x0160) |
| 185 | #define CSIPHYTIMER_MD_REG REG_MM(0x0164) |
| 186 | #define CSIPHYTIMER_NS_REG REG_MM(0x0168) |
| 187 | #define DSI1_BYTE_NS_REG REG_MM(0x00B0) |
| 188 | #define DSI1_BYTE_CC_REG REG_MM(0x0090) |
| 189 | #define DSI2_BYTE_NS_REG REG_MM(0x00BC) |
| 190 | #define DSI2_BYTE_CC_REG REG_MM(0x00B4) |
| 191 | #define DSI1_ESC_NS_REG REG_MM(0x011C) |
| 192 | #define DSI1_ESC_CC_REG REG_MM(0x00CC) |
| 193 | #define DSI2_ESC_NS_REG REG_MM(0x0150) |
| 194 | #define DSI2_ESC_CC_REG REG_MM(0x013C) |
| 195 | #define DSI_PIXEL_CC_REG REG_MM(0x0130) |
| 196 | #define DSI2_PIXEL_CC_REG REG_MM(0x0094) |
Patrick Daly | e6f48904 | 2012-07-11 15:29:15 -0700 | [diff] [blame] | 197 | #define DSI2_PIXEL_CC2_REG REG_MM(0x0264) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 198 | #define DBG_BUS_VEC_A_REG REG_MM(0x01C8) |
| 199 | #define DBG_BUS_VEC_B_REG REG_MM(0x01CC) |
| 200 | #define DBG_BUS_VEC_C_REG REG_MM(0x01D0) |
| 201 | #define DBG_BUS_VEC_D_REG REG_MM(0x01D4) |
| 202 | #define DBG_BUS_VEC_E_REG REG_MM(0x01D8) |
| 203 | #define DBG_BUS_VEC_F_REG REG_MM(0x01DC) |
| 204 | #define DBG_BUS_VEC_G_REG REG_MM(0x01E0) |
| 205 | #define DBG_BUS_VEC_H_REG REG_MM(0x01E4) |
| 206 | #define DBG_BUS_VEC_I_REG REG_MM(0x01E8) |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 207 | #define DBG_BUS_VEC_J_REG REG_MM(0x0240) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 208 | #define DBG_CFG_REG_HS_REG REG_MM(0x01B4) |
| 209 | #define DBG_CFG_REG_LS_REG REG_MM(0x01B8) |
| 210 | #define GFX2D0_CC_REG REG_MM(0x0060) |
| 211 | #define GFX2D0_MD0_REG REG_MM(0x0064) |
| 212 | #define GFX2D0_MD1_REG REG_MM(0x0068) |
| 213 | #define GFX2D0_NS_REG REG_MM(0x0070) |
| 214 | #define GFX2D1_CC_REG REG_MM(0x0074) |
| 215 | #define GFX2D1_MD0_REG REG_MM(0x0078) |
| 216 | #define GFX2D1_MD1_REG REG_MM(0x006C) |
| 217 | #define GFX2D1_NS_REG REG_MM(0x007C) |
| 218 | #define GFX3D_CC_REG REG_MM(0x0080) |
| 219 | #define GFX3D_MD0_REG REG_MM(0x0084) |
| 220 | #define GFX3D_MD1_REG REG_MM(0x0088) |
| 221 | #define GFX3D_NS_REG REG_MM(0x008C) |
| 222 | #define IJPEG_CC_REG REG_MM(0x0098) |
| 223 | #define IJPEG_MD_REG REG_MM(0x009C) |
| 224 | #define IJPEG_NS_REG REG_MM(0x00A0) |
| 225 | #define JPEGD_CC_REG REG_MM(0x00A4) |
| 226 | #define JPEGD_NS_REG REG_MM(0x00AC) |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 227 | #define VCAP_CC_REG REG_MM(0x0178) |
| 228 | #define VCAP_NS_REG REG_MM(0x021C) |
| 229 | #define VCAP_MD0_REG REG_MM(0x01EC) |
| 230 | #define VCAP_MD1_REG REG_MM(0x0218) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 231 | #define MAXI_EN_REG REG_MM(0x0018) |
| 232 | #define MAXI_EN2_REG REG_MM(0x0020) |
| 233 | #define MAXI_EN3_REG REG_MM(0x002C) |
| 234 | #define MAXI_EN4_REG REG_MM(0x0114) |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 235 | #define MAXI_EN5_REG REG_MM(0x0244) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 236 | #define MDP_CC_REG REG_MM(0x00C0) |
| 237 | #define MDP_LUT_CC_REG REG_MM(0x016C) |
| 238 | #define MDP_MD0_REG REG_MM(0x00C4) |
| 239 | #define MDP_MD1_REG REG_MM(0x00C8) |
| 240 | #define MDP_NS_REG REG_MM(0x00D0) |
| 241 | #define MISC_CC_REG REG_MM(0x0058) |
| 242 | #define MISC_CC2_REG REG_MM(0x005C) |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 243 | #define MISC_CC3_REG REG_MM(0x0238) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 244 | #define MM_PLL1_MODE_REG REG_MM(0x031C) |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 245 | #define MM_PLL1_L_VAL_REG REG_MM(0x0320) |
| 246 | #define MM_PLL1_M_VAL_REG REG_MM(0x0324) |
| 247 | #define MM_PLL1_N_VAL_REG REG_MM(0x0328) |
| 248 | #define MM_PLL1_CONFIG_REG REG_MM(0x032C) |
| 249 | #define MM_PLL1_TEST_CTL_REG REG_MM(0x0330) |
| 250 | #define MM_PLL1_STATUS_REG REG_MM(0x0334) |
| 251 | #define MM_PLL3_MODE_REG REG_MM(0x0338) |
Tianyi Gou | 621f874 | 2011-09-01 21:45:01 -0700 | [diff] [blame] | 252 | #define MM_PLL3_L_VAL_REG REG_MM(0x033C) |
| 253 | #define MM_PLL3_M_VAL_REG REG_MM(0x0340) |
| 254 | #define MM_PLL3_N_VAL_REG REG_MM(0x0344) |
| 255 | #define MM_PLL3_CONFIG_REG REG_MM(0x0348) |
| 256 | #define MM_PLL3_TEST_CTL_REG REG_MM(0x034C) |
| 257 | #define MM_PLL3_STATUS_REG REG_MM(0x0350) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 258 | #define ROT_CC_REG REG_MM(0x00E0) |
| 259 | #define ROT_NS_REG REG_MM(0x00E8) |
| 260 | #define SAXI_EN_REG REG_MM(0x0030) |
| 261 | #define SW_RESET_AHB_REG REG_MM(0x020C) |
| 262 | #define SW_RESET_AHB2_REG REG_MM(0x0200) |
| 263 | #define SW_RESET_ALL_REG REG_MM(0x0204) |
| 264 | #define SW_RESET_AXI_REG REG_MM(0x0208) |
| 265 | #define SW_RESET_CORE_REG REG_MM(0x0210) |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 266 | #define SW_RESET_CORE2_REG REG_MM(0x0214) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 267 | #define TV_CC_REG REG_MM(0x00EC) |
| 268 | #define TV_CC2_REG REG_MM(0x0124) |
| 269 | #define TV_MD_REG REG_MM(0x00F0) |
| 270 | #define TV_NS_REG REG_MM(0x00F4) |
| 271 | #define VCODEC_CC_REG REG_MM(0x00F8) |
| 272 | #define VCODEC_MD0_REG REG_MM(0x00FC) |
| 273 | #define VCODEC_MD1_REG REG_MM(0x0128) |
| 274 | #define VCODEC_NS_REG REG_MM(0x0100) |
| 275 | #define VFE_CC_REG REG_MM(0x0104) |
| 276 | #define VFE_MD_REG REG_MM(0x0108) |
| 277 | #define VFE_NS_REG REG_MM(0x010C) |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 278 | #define VFE_CC2_REG REG_MM(0x023C) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 279 | #define VPE_CC_REG REG_MM(0x0110) |
| 280 | #define VPE_NS_REG REG_MM(0x0118) |
| 281 | |
| 282 | /* Low-power Audio clock registers. */ |
Stephen Boyd | 3939c8d | 2011-08-29 17:36:22 -0700 | [diff] [blame] | 283 | #define LCC_CLK_HS_DEBUG_CFG_REG REG_LPA(0x00A4) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 284 | #define LCC_CLK_LS_DEBUG_CFG_REG REG_LPA(0x00A8) |
| 285 | #define LCC_CODEC_I2S_MIC_MD_REG REG_LPA(0x0064) |
| 286 | #define LCC_CODEC_I2S_MIC_NS_REG REG_LPA(0x0060) |
| 287 | #define LCC_CODEC_I2S_MIC_STATUS_REG REG_LPA(0x0068) |
| 288 | #define LCC_CODEC_I2S_SPKR_MD_REG REG_LPA(0x0070) |
| 289 | #define LCC_CODEC_I2S_SPKR_NS_REG REG_LPA(0x006C) |
| 290 | #define LCC_CODEC_I2S_SPKR_STATUS_REG REG_LPA(0x0074) |
| 291 | #define LCC_MI2S_MD_REG REG_LPA(0x004C) |
| 292 | #define LCC_MI2S_NS_REG REG_LPA(0x0048) |
| 293 | #define LCC_MI2S_STATUS_REG REG_LPA(0x0050) |
| 294 | #define LCC_PCM_MD_REG REG_LPA(0x0058) |
| 295 | #define LCC_PCM_NS_REG REG_LPA(0x0054) |
| 296 | #define LCC_PCM_STATUS_REG REG_LPA(0x005C) |
Tianyi Gou | c29c324 | 2011-10-12 21:02:15 -0700 | [diff] [blame] | 297 | #define LCC_PLL0_MODE_REG REG_LPA(0x0000) |
| 298 | #define LCC_PLL0_L_VAL_REG REG_LPA(0x0004) |
| 299 | #define LCC_PLL0_M_VAL_REG REG_LPA(0x0008) |
| 300 | #define LCC_PLL0_N_VAL_REG REG_LPA(0x000C) |
| 301 | #define LCC_PLL0_CONFIG_REG REG_LPA(0x0014) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 302 | #define LCC_PLL0_STATUS_REG REG_LPA(0x0018) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 303 | #define LCC_SPARE_I2S_MIC_MD_REG REG_LPA(0x007C) |
| 304 | #define LCC_SPARE_I2S_MIC_NS_REG REG_LPA(0x0078) |
| 305 | #define LCC_SPARE_I2S_MIC_STATUS_REG REG_LPA(0x0080) |
| 306 | #define LCC_SPARE_I2S_SPKR_MD_REG REG_LPA(0x0088) |
| 307 | #define LCC_SPARE_I2S_SPKR_NS_REG REG_LPA(0x0084) |
| 308 | #define LCC_SPARE_I2S_SPKR_STATUS_REG REG_LPA(0x008C) |
| 309 | #define LCC_SLIMBUS_NS_REG REG_LPA(0x00CC) |
| 310 | #define LCC_SLIMBUS_MD_REG REG_LPA(0x00D0) |
| 311 | #define LCC_SLIMBUS_STATUS_REG REG_LPA(0x00D4) |
| 312 | #define LCC_AHBEX_BRANCH_CTL_REG REG_LPA(0x00E4) |
Tianyi Gou | c29c324 | 2011-10-12 21:02:15 -0700 | [diff] [blame] | 313 | #define LCC_PRI_PLL_CLK_CTL_REG REG_LPA(0x00C4) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 314 | |
Matt Wagantall | 8b38f94 | 2011-08-02 18:23:18 -0700 | [diff] [blame] | 315 | #define GCC_APCS_CLK_DIAG REG_GCC(0x001C) |
| 316 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 317 | /* MUX source input identifiers. */ |
| 318 | #define pxo_to_bb_mux 0 |
Matt Wagantall | 7625a4c | 2011-11-01 16:17:53 -0700 | [diff] [blame] | 319 | #define cxo_to_bb_mux 5 |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 320 | #define pll0_to_bb_mux 2 |
| 321 | #define pll8_to_bb_mux 3 |
| 322 | #define pll6_to_bb_mux 4 |
| 323 | #define gnd_to_bb_mux 5 |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 324 | #define pll3_to_bb_mux 6 |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 325 | #define pxo_to_mm_mux 0 |
| 326 | #define pll1_to_mm_mux 1 |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 327 | #define pll2_to_mm_mux 1 /* or MMCC_PLL1 */ |
| 328 | #define pll8_to_mm_mux 2 /* or GCC_PERF */ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 329 | #define pll0_to_mm_mux 3 |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 330 | #define pll15_to_mm_mux 3 /* or MM_PLL3 */ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 331 | #define gnd_to_mm_mux 4 |
Stephen Boyd | 7a776cd | 2011-10-20 12:46:04 -0700 | [diff] [blame] | 332 | #define pll3_to_mm_mux 3 /* or MMCC_PLL2 */ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 333 | #define hdmi_pll_to_mm_mux 3 |
| 334 | #define cxo_to_xo_mux 0 |
| 335 | #define pxo_to_xo_mux 1 |
| 336 | #define gnd_to_xo_mux 3 |
| 337 | #define pxo_to_lpa_mux 0 |
| 338 | #define cxo_to_lpa_mux 1 |
| 339 | #define pll4_to_lpa_mux 2 |
| 340 | #define gnd_to_lpa_mux 6 |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 341 | #define pxo_to_pcie_mux 0 |
| 342 | #define pll3_to_pcie_mux 1 |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 343 | |
| 344 | /* Test Vector Macros */ |
| 345 | #define TEST_TYPE_PER_LS 1 |
| 346 | #define TEST_TYPE_PER_HS 2 |
| 347 | #define TEST_TYPE_MM_LS 3 |
| 348 | #define TEST_TYPE_MM_HS 4 |
| 349 | #define TEST_TYPE_LPA 5 |
Matt Wagantall | 8b38f94 | 2011-08-02 18:23:18 -0700 | [diff] [blame] | 350 | #define TEST_TYPE_CPUL2 6 |
Stephen Boyd | 3939c8d | 2011-08-29 17:36:22 -0700 | [diff] [blame] | 351 | #define TEST_TYPE_LPA_HS 7 |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 352 | #define TEST_TYPE_SHIFT 24 |
| 353 | #define TEST_CLK_SEL_MASK BM(23, 0) |
| 354 | #define TEST_VECTOR(s, t) (((t) << TEST_TYPE_SHIFT) | BVAL(23, 0, (s))) |
| 355 | #define TEST_PER_LS(s) TEST_VECTOR((s), TEST_TYPE_PER_LS) |
| 356 | #define TEST_PER_HS(s) TEST_VECTOR((s), TEST_TYPE_PER_HS) |
| 357 | #define TEST_MM_LS(s) TEST_VECTOR((s), TEST_TYPE_MM_LS) |
| 358 | #define TEST_MM_HS(s) TEST_VECTOR((s), TEST_TYPE_MM_HS) |
| 359 | #define TEST_LPA(s) TEST_VECTOR((s), TEST_TYPE_LPA) |
Stephen Boyd | 3939c8d | 2011-08-29 17:36:22 -0700 | [diff] [blame] | 360 | #define TEST_LPA_HS(s) TEST_VECTOR((s), TEST_TYPE_LPA_HS) |
Matt Wagantall | 8b38f94 | 2011-08-02 18:23:18 -0700 | [diff] [blame] | 361 | #define TEST_CPUL2(s) TEST_VECTOR((s), TEST_TYPE_CPUL2) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 362 | |
| 363 | #define MN_MODE_DUAL_EDGE 0x2 |
| 364 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 365 | struct pll_rate { |
| 366 | const uint32_t l_val; |
| 367 | const uint32_t m_val; |
| 368 | const uint32_t n_val; |
| 369 | const uint32_t vco; |
| 370 | const uint32_t post_div; |
| 371 | const uint32_t i_bits; |
| 372 | }; |
| 373 | #define PLL_RATE(l, m, n, v, d, i) { l, m, n, v, (d>>1), i } |
| 374 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 375 | enum vdd_dig_levels { |
| 376 | VDD_DIG_NONE, |
| 377 | VDD_DIG_LOW, |
| 378 | VDD_DIG_NOMINAL, |
| 379 | VDD_DIG_HIGH |
| 380 | }; |
| 381 | |
Saravana Kannan | 298ec39 | 2012-02-08 19:21:47 -0800 | [diff] [blame] | 382 | 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] | 383 | { |
| 384 | static const int vdd_uv[] = { |
| 385 | [VDD_DIG_NONE] = 0, |
| 386 | [VDD_DIG_LOW] = 945000, |
| 387 | [VDD_DIG_NOMINAL] = 1050000, |
| 388 | [VDD_DIG_HIGH] = 1150000 |
| 389 | }; |
Saravana Kannan | 298ec39 | 2012-02-08 19:21:47 -0800 | [diff] [blame] | 390 | 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] | 391 | vdd_uv[level], 1150000, 1); |
| 392 | } |
| 393 | |
Saravana Kannan | 298ec39 | 2012-02-08 19:21:47 -0800 | [diff] [blame] | 394 | static DEFINE_VDD_CLASS(vdd_dig, set_vdd_dig_8960); |
| 395 | |
Patrick Daly | 1a3859f | 2012-08-27 16:10:26 -0700 | [diff] [blame] | 396 | 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] | 397 | static int set_vdd_dig_8930(struct clk_vdd_class *vdd_class, int level) |
| 398 | { |
Saravana Kannan | ebaa3ac | 2012-02-08 19:55:44 -0800 | [diff] [blame] | 399 | static const int vdd_corner[] = { |
| 400 | [VDD_DIG_NONE] = RPM_VREG_CORNER_NONE, |
| 401 | [VDD_DIG_LOW] = RPM_VREG_CORNER_LOW, |
| 402 | [VDD_DIG_NOMINAL] = RPM_VREG_CORNER_NOMINAL, |
| 403 | [VDD_DIG_HIGH] = RPM_VREG_CORNER_HIGH, |
Saravana Kannan | 298ec39 | 2012-02-08 19:21:47 -0800 | [diff] [blame] | 404 | }; |
Patrick Daly | 1a3859f | 2012-08-27 16:10:26 -0700 | [diff] [blame] | 405 | return rpm_vreg_set_voltage(rpm_vreg_dig_8930, |
Saravana Kannan | ebaa3ac | 2012-02-08 19:55:44 -0800 | [diff] [blame] | 406 | RPM_VREG_VOTER3, |
| 407 | vdd_corner[level], |
| 408 | RPM_VREG_CORNER_HIGH, 1); |
Saravana Kannan | 298ec39 | 2012-02-08 19:21:47 -0800 | [diff] [blame] | 409 | } |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 410 | |
| 411 | #define VDD_DIG_FMAX_MAP1(l1, f1) \ |
| 412 | .vdd_class = &vdd_dig, \ |
| 413 | .fmax[VDD_DIG_##l1] = (f1) |
| 414 | #define VDD_DIG_FMAX_MAP2(l1, f1, l2, f2) \ |
| 415 | .vdd_class = &vdd_dig, \ |
| 416 | .fmax[VDD_DIG_##l1] = (f1), \ |
| 417 | .fmax[VDD_DIG_##l2] = (f2) |
| 418 | #define VDD_DIG_FMAX_MAP3(l1, f1, l2, f2, l3, f3) \ |
| 419 | .vdd_class = &vdd_dig, \ |
| 420 | .fmax[VDD_DIG_##l1] = (f1), \ |
| 421 | .fmax[VDD_DIG_##l2] = (f2), \ |
| 422 | .fmax[VDD_DIG_##l3] = (f3) |
| 423 | |
Matt Wagantall | 82feaa1 | 2012-07-09 10:54:49 -0700 | [diff] [blame] | 424 | enum vdd_sr2_hdmi_pll_levels { |
| 425 | VDD_SR2_HDMI_PLL_OFF, |
| 426 | VDD_SR2_HDMI_PLL_ON |
Matt Wagantall | c57577d | 2011-10-06 17:06:53 -0700 | [diff] [blame] | 427 | }; |
| 428 | |
Matt Wagantall | 82feaa1 | 2012-07-09 10:54:49 -0700 | [diff] [blame] | 429 | 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] | 430 | { |
Tianyi Gou | bf3d0b1 | 2012-01-23 14:37:28 -0800 | [diff] [blame] | 431 | int rc = 0; |
Saravana Kannan | 298ec39 | 2012-02-08 19:21:47 -0800 | [diff] [blame] | 432 | |
Matt Wagantall | 82feaa1 | 2012-07-09 10:54:49 -0700 | [diff] [blame] | 433 | if (level == VDD_SR2_HDMI_PLL_OFF) { |
Saravana Kannan | 298ec39 | 2012-02-08 19:21:47 -0800 | [diff] [blame] | 434 | rc = rpm_vreg_set_voltage(RPM_VREG_ID_PM8921_L23, |
| 435 | RPM_VREG_VOTER3, 0, 0, 1); |
| 436 | if (rc) |
| 437 | return rc; |
| 438 | rc = rpm_vreg_set_voltage(RPM_VREG_ID_PM8921_S8, |
| 439 | RPM_VREG_VOTER3, 0, 0, 1); |
| 440 | if (rc) |
| 441 | rpm_vreg_set_voltage(RPM_VREG_ID_PM8921_L23, |
| 442 | RPM_VREG_VOTER3, 1800000, 1800000, 1); |
Tianyi Gou | e1faaf2 | 2012-01-24 16:07:19 -0800 | [diff] [blame] | 443 | } else { |
Saravana Kannan | 298ec39 | 2012-02-08 19:21:47 -0800 | [diff] [blame] | 444 | rc = rpm_vreg_set_voltage(RPM_VREG_ID_PM8921_S8, |
David Collins | 9a81d6c | 2012-03-29 15:11:33 -0700 | [diff] [blame] | 445 | RPM_VREG_VOTER3, 2050000, 2100000, 1); |
Saravana Kannan | 298ec39 | 2012-02-08 19:21:47 -0800 | [diff] [blame] | 446 | if (rc) |
| 447 | return rc; |
| 448 | rc = rpm_vreg_set_voltage(RPM_VREG_ID_PM8921_L23, |
| 449 | RPM_VREG_VOTER3, 1800000, 1800000, 1); |
| 450 | if (rc) |
| 451 | rpm_vreg_set_voltage(RPM_VREG_ID_PM8921_S8, |
Tianyi Gou | bf3d0b1 | 2012-01-23 14:37:28 -0800 | [diff] [blame] | 452 | RPM_VREG_VOTER3, 0, 0, 1); |
Matt Wagantall | c57577d | 2011-10-06 17:06:53 -0700 | [diff] [blame] | 453 | } |
| 454 | |
| 455 | return rc; |
| 456 | } |
| 457 | |
Matt Wagantall | 82feaa1 | 2012-07-09 10:54:49 -0700 | [diff] [blame] | 458 | static DEFINE_VDD_CLASS(vdd_sr2_hdmi_pll, set_vdd_sr2_hdmi_pll_8960); |
Saravana Kannan | 298ec39 | 2012-02-08 19:21:47 -0800 | [diff] [blame] | 459 | |
| 460 | static int sr2_lreg_uv[] = { |
Matt Wagantall | 82feaa1 | 2012-07-09 10:54:49 -0700 | [diff] [blame] | 461 | [VDD_SR2_HDMI_PLL_OFF] = 0, |
| 462 | [VDD_SR2_HDMI_PLL_ON] = 1800000, |
Saravana Kannan | 298ec39 | 2012-02-08 19:21:47 -0800 | [diff] [blame] | 463 | }; |
| 464 | |
Matt Wagantall | 82feaa1 | 2012-07-09 10:54:49 -0700 | [diff] [blame] | 465 | 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] | 466 | { |
| 467 | return rpm_vreg_set_voltage(RPM_VREG_ID_PM8921_LVS7, RPM_VREG_VOTER3, |
| 468 | sr2_lreg_uv[level], sr2_lreg_uv[level], 1); |
| 469 | } |
| 470 | |
Patrick Daly | 1a3859f | 2012-08-27 16:10:26 -0700 | [diff] [blame] | 471 | static int set_vdd_sr2_hdmi_pll_8930_pm8917(struct clk_vdd_class *vdd_class, |
| 472 | int level) |
| 473 | { |
| 474 | int rc = 0; |
| 475 | |
| 476 | if (level == VDD_SR2_HDMI_PLL_OFF) { |
| 477 | rc = rpm_vreg_set_voltage(RPM_VREG_ID_PM8917_L23, |
| 478 | RPM_VREG_VOTER3, 0, 0, 1); |
| 479 | if (rc) |
| 480 | return rc; |
| 481 | rc = rpm_vreg_set_voltage(RPM_VREG_ID_PM8917_S8, |
| 482 | RPM_VREG_VOTER3, 0, 0, 1); |
| 483 | if (rc) |
| 484 | rpm_vreg_set_voltage(RPM_VREG_ID_PM8917_L23, |
| 485 | RPM_VREG_VOTER3, 1800000, 1800000, 1); |
| 486 | } else { |
| 487 | rc = rpm_vreg_set_voltage(RPM_VREG_ID_PM8917_S8, |
| 488 | RPM_VREG_VOTER3, 2050000, 2100000, 1); |
| 489 | if (rc) |
| 490 | return rc; |
| 491 | rc = rpm_vreg_set_voltage(RPM_VREG_ID_PM8917_L23, |
| 492 | RPM_VREG_VOTER3, 1800000, 1800000, 1); |
| 493 | if (rc) |
| 494 | rpm_vreg_set_voltage(RPM_VREG_ID_PM8917_S8, |
| 495 | RPM_VREG_VOTER3, 0, 0, 1); |
| 496 | } |
| 497 | |
| 498 | return rc; |
| 499 | } |
| 500 | |
Matt Wagantall | 82feaa1 | 2012-07-09 10:54:49 -0700 | [diff] [blame] | 501 | 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] | 502 | { |
| 503 | return rpm_vreg_set_voltage(RPM_VREG_ID_PM8038_L23, RPM_VREG_VOTER3, |
| 504 | sr2_lreg_uv[level], sr2_lreg_uv[level], 1); |
| 505 | } |
Matt Wagantall | c57577d | 2011-10-06 17:06:53 -0700 | [diff] [blame] | 506 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 507 | /* |
| 508 | * Clock Descriptions |
| 509 | */ |
| 510 | |
Stephen Boyd | 72a8035 | 2012-01-26 15:57:38 -0800 | [diff] [blame] | 511 | DEFINE_CLK_RPM_BRANCH(pxo_clk, pxo_a_clk, PXO, 27000000); |
| 512 | DEFINE_CLK_RPM_BRANCH(cxo_clk, cxo_a_clk, CXO, 19200000); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 513 | |
| 514 | static struct pll_clk pll2_clk = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 515 | .mode_reg = MM_PLL1_MODE_REG, |
| 516 | .parent = &pxo_clk.c, |
| 517 | .c = { |
| 518 | .dbg_name = "pll2_clk", |
Tianyi Gou | 7949ecb | 2012-02-14 14:25:32 -0800 | [diff] [blame] | 519 | .rate = 800000000, |
Vikram Mulukutla | 681d868 | 2012-03-09 23:56:20 -0800 | [diff] [blame] | 520 | .ops = &clk_ops_local_pll, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 521 | CLK_INIT(pll2_clk.c), |
| 522 | }, |
| 523 | }; |
| 524 | |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 525 | static struct pll_clk pll3_clk = { |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 526 | .mode_reg = BB_MMCC_PLL2_MODE_REG, |
| 527 | .parent = &pxo_clk.c, |
| 528 | .c = { |
| 529 | .dbg_name = "pll3_clk", |
Tianyi Gou | 7949ecb | 2012-02-14 14:25:32 -0800 | [diff] [blame] | 530 | .rate = 1200000000, |
Vikram Mulukutla | 681d868 | 2012-03-09 23:56:20 -0800 | [diff] [blame] | 531 | .ops = &clk_ops_local_pll, |
Matt Wagantall | 82feaa1 | 2012-07-09 10:54:49 -0700 | [diff] [blame] | 532 | .vdd_class = &vdd_sr2_hdmi_pll, |
| 533 | .fmax[VDD_SR2_HDMI_PLL_ON] = ULONG_MAX, |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 534 | CLK_INIT(pll3_clk.c), |
| 535 | }, |
| 536 | }; |
| 537 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 538 | static struct pll_vote_clk pll4_clk = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 539 | .en_reg = BB_PLL_ENA_SC0_REG, |
| 540 | .en_mask = BIT(4), |
| 541 | .status_reg = LCC_PLL0_STATUS_REG, |
Vikram Mulukutla | 681d868 | 2012-03-09 23:56:20 -0800 | [diff] [blame] | 542 | .status_mask = BIT(16), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 543 | .parent = &pxo_clk.c, |
| 544 | .c = { |
| 545 | .dbg_name = "pll4_clk", |
Tianyi Gou | 7949ecb | 2012-02-14 14:25:32 -0800 | [diff] [blame] | 546 | .rate = 393216000, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 547 | .ops = &clk_ops_pll_vote, |
| 548 | CLK_INIT(pll4_clk.c), |
| 549 | }, |
| 550 | }; |
| 551 | |
| 552 | static struct pll_vote_clk pll8_clk = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 553 | .en_reg = BB_PLL_ENA_SC0_REG, |
| 554 | .en_mask = BIT(8), |
| 555 | .status_reg = BB_PLL8_STATUS_REG, |
Vikram Mulukutla | 681d868 | 2012-03-09 23:56:20 -0800 | [diff] [blame] | 556 | .status_mask = BIT(16), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 557 | .parent = &pxo_clk.c, |
| 558 | .c = { |
| 559 | .dbg_name = "pll8_clk", |
Tianyi Gou | 7949ecb | 2012-02-14 14:25:32 -0800 | [diff] [blame] | 560 | .rate = 384000000, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 561 | .ops = &clk_ops_pll_vote, |
| 562 | CLK_INIT(pll8_clk.c), |
| 563 | }, |
| 564 | }; |
| 565 | |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 566 | static struct pll_vote_clk pll14_clk = { |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 567 | .en_reg = BB_PLL_ENA_SC0_REG, |
| 568 | .en_mask = BIT(14), |
| 569 | .status_reg = BB_PLL14_STATUS_REG, |
Vikram Mulukutla | 681d868 | 2012-03-09 23:56:20 -0800 | [diff] [blame] | 570 | .status_mask = BIT(16), |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 571 | .parent = &pxo_clk.c, |
| 572 | .c = { |
| 573 | .dbg_name = "pll14_clk", |
Tianyi Gou | 7949ecb | 2012-02-14 14:25:32 -0800 | [diff] [blame] | 574 | .rate = 480000000, |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 575 | .ops = &clk_ops_pll_vote, |
| 576 | CLK_INIT(pll14_clk.c), |
| 577 | }, |
| 578 | }; |
| 579 | |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 580 | static struct pll_clk pll15_clk = { |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 581 | .mode_reg = MM_PLL3_MODE_REG, |
| 582 | .parent = &pxo_clk.c, |
| 583 | .c = { |
| 584 | .dbg_name = "pll15_clk", |
Tianyi Gou | 7949ecb | 2012-02-14 14:25:32 -0800 | [diff] [blame] | 585 | .rate = 975000000, |
Vikram Mulukutla | 681d868 | 2012-03-09 23:56:20 -0800 | [diff] [blame] | 586 | .ops = &clk_ops_local_pll, |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 587 | CLK_INIT(pll15_clk.c), |
| 588 | }, |
| 589 | }; |
| 590 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 591 | /* AXI Interfaces */ |
| 592 | static struct branch_clk gmem_axi_clk = { |
| 593 | .b = { |
| 594 | .ctl_reg = MAXI_EN_REG, |
| 595 | .en_mask = BIT(24), |
| 596 | .halt_reg = DBG_BUS_VEC_E_REG, |
| 597 | .halt_bit = 6, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 598 | .retain_reg = MAXI_EN2_REG, |
| 599 | .retain_mask = BIT(21), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 600 | }, |
| 601 | .c = { |
| 602 | .dbg_name = "gmem_axi_clk", |
| 603 | .ops = &clk_ops_branch, |
| 604 | CLK_INIT(gmem_axi_clk.c), |
| 605 | }, |
| 606 | }; |
| 607 | |
| 608 | static struct branch_clk ijpeg_axi_clk = { |
| 609 | .b = { |
| 610 | .ctl_reg = MAXI_EN_REG, |
| 611 | .en_mask = BIT(21), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 612 | .hwcg_reg = MAXI_EN_REG, |
| 613 | .hwcg_mask = BIT(11), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 614 | .reset_reg = SW_RESET_AXI_REG, |
| 615 | .reset_mask = BIT(14), |
| 616 | .halt_reg = DBG_BUS_VEC_E_REG, |
| 617 | .halt_bit = 4, |
| 618 | }, |
| 619 | .c = { |
| 620 | .dbg_name = "ijpeg_axi_clk", |
| 621 | .ops = &clk_ops_branch, |
| 622 | CLK_INIT(ijpeg_axi_clk.c), |
| 623 | }, |
| 624 | }; |
| 625 | |
| 626 | static struct branch_clk imem_axi_clk = { |
| 627 | .b = { |
| 628 | .ctl_reg = MAXI_EN_REG, |
| 629 | .en_mask = BIT(22), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 630 | .hwcg_reg = MAXI_EN_REG, |
| 631 | .hwcg_mask = BIT(15), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 632 | .reset_reg = SW_RESET_CORE_REG, |
| 633 | .reset_mask = BIT(10), |
| 634 | .halt_reg = DBG_BUS_VEC_E_REG, |
| 635 | .halt_bit = 7, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 636 | .retain_reg = MAXI_EN2_REG, |
| 637 | .retain_mask = BIT(10), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 638 | }, |
| 639 | .c = { |
| 640 | .dbg_name = "imem_axi_clk", |
| 641 | .ops = &clk_ops_branch, |
| 642 | CLK_INIT(imem_axi_clk.c), |
| 643 | }, |
| 644 | }; |
| 645 | |
| 646 | static struct branch_clk jpegd_axi_clk = { |
| 647 | .b = { |
| 648 | .ctl_reg = MAXI_EN_REG, |
| 649 | .en_mask = BIT(25), |
| 650 | .halt_reg = DBG_BUS_VEC_E_REG, |
| 651 | .halt_bit = 5, |
| 652 | }, |
| 653 | .c = { |
| 654 | .dbg_name = "jpegd_axi_clk", |
| 655 | .ops = &clk_ops_branch, |
| 656 | CLK_INIT(jpegd_axi_clk.c), |
| 657 | }, |
| 658 | }; |
| 659 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 660 | static struct branch_clk vcodec_axi_b_clk = { |
| 661 | .b = { |
| 662 | .ctl_reg = MAXI_EN4_REG, |
| 663 | .en_mask = BIT(23), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 664 | .hwcg_reg = MAXI_EN4_REG, |
| 665 | .hwcg_mask = BIT(22), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 666 | .halt_reg = DBG_BUS_VEC_I_REG, |
| 667 | .halt_bit = 25, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 668 | .retain_reg = MAXI_EN4_REG, |
| 669 | .retain_mask = BIT(21), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 670 | }, |
| 671 | .c = { |
| 672 | .dbg_name = "vcodec_axi_b_clk", |
| 673 | .ops = &clk_ops_branch, |
| 674 | CLK_INIT(vcodec_axi_b_clk.c), |
| 675 | }, |
| 676 | }; |
| 677 | |
Matt Wagantall | 91f4270 | 2011-07-14 12:01:15 -0700 | [diff] [blame] | 678 | static struct branch_clk vcodec_axi_a_clk = { |
| 679 | .b = { |
| 680 | .ctl_reg = MAXI_EN4_REG, |
| 681 | .en_mask = BIT(25), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 682 | .hwcg_reg = MAXI_EN4_REG, |
| 683 | .hwcg_mask = BIT(24), |
Matt Wagantall | 91f4270 | 2011-07-14 12:01:15 -0700 | [diff] [blame] | 684 | .halt_reg = DBG_BUS_VEC_I_REG, |
| 685 | .halt_bit = 26, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 686 | .retain_reg = MAXI_EN4_REG, |
| 687 | .retain_mask = BIT(10), |
Matt Wagantall | 91f4270 | 2011-07-14 12:01:15 -0700 | [diff] [blame] | 688 | }, |
Matt Wagantall | 91f4270 | 2011-07-14 12:01:15 -0700 | [diff] [blame] | 689 | .c = { |
| 690 | .dbg_name = "vcodec_axi_a_clk", |
| 691 | .ops = &clk_ops_branch, |
| 692 | CLK_INIT(vcodec_axi_a_clk.c), |
Stephen Boyd | 7fa2674 | 2011-08-11 23:22:29 -0700 | [diff] [blame] | 693 | .depends = &vcodec_axi_b_clk.c, |
Matt Wagantall | 91f4270 | 2011-07-14 12:01:15 -0700 | [diff] [blame] | 694 | }, |
| 695 | }; |
| 696 | |
| 697 | static struct branch_clk vcodec_axi_clk = { |
| 698 | .b = { |
| 699 | .ctl_reg = MAXI_EN_REG, |
| 700 | .en_mask = BIT(19), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 701 | .hwcg_reg = MAXI_EN_REG, |
| 702 | .hwcg_mask = BIT(13), |
Matt Wagantall | 91f4270 | 2011-07-14 12:01:15 -0700 | [diff] [blame] | 703 | .reset_reg = SW_RESET_AXI_REG, |
Gopikrishnaiah Anandan | 83b6e85 | 2012-01-05 17:47:02 -0800 | [diff] [blame] | 704 | .reset_mask = BIT(4)|BIT(5)|BIT(7), |
Matt Wagantall | 91f4270 | 2011-07-14 12:01:15 -0700 | [diff] [blame] | 705 | .halt_reg = DBG_BUS_VEC_E_REG, |
| 706 | .halt_bit = 3, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 707 | .retain_reg = MAXI_EN2_REG, |
| 708 | .retain_mask = BIT(28), |
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_clk", |
| 712 | .ops = &clk_ops_branch, |
| 713 | CLK_INIT(vcodec_axi_clk.c), |
Stephen Boyd | 7fa2674 | 2011-08-11 23:22:29 -0700 | [diff] [blame] | 714 | .depends = &vcodec_axi_a_clk.c, |
Matt Wagantall | 91f4270 | 2011-07-14 12:01:15 -0700 | [diff] [blame] | 715 | }, |
| 716 | }; |
| 717 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 718 | static struct branch_clk vfe_axi_clk = { |
| 719 | .b = { |
| 720 | .ctl_reg = MAXI_EN_REG, |
| 721 | .en_mask = BIT(18), |
| 722 | .reset_reg = SW_RESET_AXI_REG, |
| 723 | .reset_mask = BIT(9), |
| 724 | .halt_reg = DBG_BUS_VEC_E_REG, |
| 725 | .halt_bit = 0, |
| 726 | }, |
| 727 | .c = { |
| 728 | .dbg_name = "vfe_axi_clk", |
| 729 | .ops = &clk_ops_branch, |
| 730 | CLK_INIT(vfe_axi_clk.c), |
| 731 | }, |
| 732 | }; |
| 733 | |
| 734 | static struct branch_clk mdp_axi_clk = { |
| 735 | .b = { |
| 736 | .ctl_reg = MAXI_EN_REG, |
| 737 | .en_mask = BIT(23), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 738 | .hwcg_reg = MAXI_EN_REG, |
| 739 | .hwcg_mask = BIT(16), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 740 | .reset_reg = SW_RESET_AXI_REG, |
| 741 | .reset_mask = BIT(13), |
| 742 | .halt_reg = DBG_BUS_VEC_E_REG, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 743 | .halt_bit = 8, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 744 | .retain_reg = MAXI_EN_REG, |
| 745 | .retain_mask = BIT(0), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 746 | }, |
| 747 | .c = { |
| 748 | .dbg_name = "mdp_axi_clk", |
| 749 | .ops = &clk_ops_branch, |
| 750 | CLK_INIT(mdp_axi_clk.c), |
| 751 | }, |
| 752 | }; |
| 753 | |
| 754 | static struct branch_clk rot_axi_clk = { |
| 755 | .b = { |
| 756 | .ctl_reg = MAXI_EN2_REG, |
| 757 | .en_mask = BIT(24), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 758 | .hwcg_reg = MAXI_EN2_REG, |
| 759 | .hwcg_mask = BIT(25), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 760 | .reset_reg = SW_RESET_AXI_REG, |
| 761 | .reset_mask = BIT(6), |
| 762 | .halt_reg = DBG_BUS_VEC_E_REG, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 763 | .halt_bit = 2, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 764 | .retain_reg = MAXI_EN3_REG, |
| 765 | .retain_mask = BIT(10), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 766 | }, |
| 767 | .c = { |
| 768 | .dbg_name = "rot_axi_clk", |
| 769 | .ops = &clk_ops_branch, |
| 770 | CLK_INIT(rot_axi_clk.c), |
| 771 | }, |
| 772 | }; |
| 773 | |
| 774 | static struct branch_clk vpe_axi_clk = { |
| 775 | .b = { |
| 776 | .ctl_reg = MAXI_EN2_REG, |
| 777 | .en_mask = BIT(26), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 778 | .hwcg_reg = MAXI_EN2_REG, |
| 779 | .hwcg_mask = BIT(27), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 780 | .reset_reg = SW_RESET_AXI_REG, |
| 781 | .reset_mask = BIT(15), |
| 782 | .halt_reg = DBG_BUS_VEC_E_REG, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 783 | .halt_bit = 1, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 784 | .retain_reg = MAXI_EN3_REG, |
| 785 | .retain_mask = BIT(21), |
| 786 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 787 | }, |
| 788 | .c = { |
| 789 | .dbg_name = "vpe_axi_clk", |
| 790 | .ops = &clk_ops_branch, |
| 791 | CLK_INIT(vpe_axi_clk.c), |
| 792 | }, |
| 793 | }; |
| 794 | |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 795 | static struct branch_clk vcap_axi_clk = { |
| 796 | .b = { |
| 797 | .ctl_reg = MAXI_EN5_REG, |
| 798 | .en_mask = BIT(12), |
Tianyi Gou | f3095ea | 2012-05-22 14:16:06 -0700 | [diff] [blame] | 799 | .hwcg_reg = MAXI_EN5_REG, |
| 800 | .hwcg_mask = BIT(11), |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 801 | .reset_reg = SW_RESET_AXI_REG, |
| 802 | .reset_mask = BIT(16), |
| 803 | .halt_reg = DBG_BUS_VEC_J_REG, |
| 804 | .halt_bit = 20, |
| 805 | }, |
| 806 | .c = { |
| 807 | .dbg_name = "vcap_axi_clk", |
| 808 | .ops = &clk_ops_branch, |
| 809 | CLK_INIT(vcap_axi_clk.c), |
| 810 | }, |
| 811 | }; |
| 812 | |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 813 | /* 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] | 814 | static struct branch_clk gfx3d_axi_clk = { |
Tianyi Gou | 621f874 | 2011-09-01 21:45:01 -0700 | [diff] [blame] | 815 | .b = { |
| 816 | .ctl_reg = MAXI_EN5_REG, |
| 817 | .en_mask = BIT(25), |
Tianyi Gou | f3095ea | 2012-05-22 14:16:06 -0700 | [diff] [blame] | 818 | .hwcg_reg = MAXI_EN5_REG, |
| 819 | .hwcg_mask = BIT(24), |
Tianyi Gou | 621f874 | 2011-09-01 21:45:01 -0700 | [diff] [blame] | 820 | .reset_reg = SW_RESET_AXI_REG, |
| 821 | .reset_mask = BIT(17), |
| 822 | .halt_reg = DBG_BUS_VEC_J_REG, |
| 823 | .halt_bit = 30, |
| 824 | }, |
| 825 | .c = { |
| 826 | .dbg_name = "gfx3d_axi_clk", |
| 827 | .ops = &clk_ops_branch, |
Patrick Daly | e6f48904 | 2012-07-11 15:29:15 -0700 | [diff] [blame] | 828 | CLK_INIT(gfx3d_axi_clk.c), |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 829 | }, |
| 830 | }; |
| 831 | |
| 832 | static struct branch_clk gfx3d_axi_clk_8930 = { |
| 833 | .b = { |
| 834 | .ctl_reg = MAXI_EN5_REG, |
| 835 | .en_mask = BIT(12), |
| 836 | .reset_reg = SW_RESET_AXI_REG, |
| 837 | .reset_mask = BIT(16), |
| 838 | .halt_reg = DBG_BUS_VEC_J_REG, |
| 839 | .halt_bit = 12, |
| 840 | }, |
| 841 | .c = { |
| 842 | .dbg_name = "gfx3d_axi_clk", |
| 843 | .ops = &clk_ops_branch, |
| 844 | CLK_INIT(gfx3d_axi_clk_8930.c), |
Tianyi Gou | 621f874 | 2011-09-01 21:45:01 -0700 | [diff] [blame] | 845 | }, |
| 846 | }; |
| 847 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 848 | /* AHB Interfaces */ |
| 849 | static struct branch_clk amp_p_clk = { |
| 850 | .b = { |
| 851 | .ctl_reg = AHB_EN_REG, |
| 852 | .en_mask = BIT(24), |
Matt Wagantall | d40857a | 2012-04-10 19:15:43 -0700 | [diff] [blame] | 853 | .reset_reg = SW_RESET_CORE_REG, |
| 854 | .reset_mask = BIT(20), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 855 | .halt_reg = DBG_BUS_VEC_F_REG, |
| 856 | .halt_bit = 18, |
| 857 | }, |
| 858 | .c = { |
| 859 | .dbg_name = "amp_p_clk", |
| 860 | .ops = &clk_ops_branch, |
| 861 | CLK_INIT(amp_p_clk.c), |
| 862 | }, |
| 863 | }; |
| 864 | |
Matt Wagantall | c23eee9 | 2011-08-16 23:06:52 -0700 | [diff] [blame] | 865 | static struct branch_clk csi_p_clk = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 866 | .b = { |
| 867 | .ctl_reg = AHB_EN_REG, |
| 868 | .en_mask = BIT(7), |
| 869 | .reset_reg = SW_RESET_AHB_REG, |
| 870 | .reset_mask = BIT(17), |
| 871 | .halt_reg = DBG_BUS_VEC_F_REG, |
| 872 | .halt_bit = 16, |
| 873 | }, |
| 874 | .c = { |
Matt Wagantall | c23eee9 | 2011-08-16 23:06:52 -0700 | [diff] [blame] | 875 | .dbg_name = "csi_p_clk", |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 876 | .ops = &clk_ops_branch, |
Matt Wagantall | c23eee9 | 2011-08-16 23:06:52 -0700 | [diff] [blame] | 877 | CLK_INIT(csi_p_clk.c), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 878 | }, |
| 879 | }; |
| 880 | |
| 881 | static struct branch_clk dsi1_m_p_clk = { |
| 882 | .b = { |
| 883 | .ctl_reg = AHB_EN_REG, |
| 884 | .en_mask = BIT(9), |
| 885 | .reset_reg = SW_RESET_AHB_REG, |
| 886 | .reset_mask = BIT(6), |
| 887 | .halt_reg = DBG_BUS_VEC_F_REG, |
| 888 | .halt_bit = 19, |
| 889 | }, |
| 890 | .c = { |
| 891 | .dbg_name = "dsi1_m_p_clk", |
| 892 | .ops = &clk_ops_branch, |
| 893 | CLK_INIT(dsi1_m_p_clk.c), |
| 894 | }, |
| 895 | }; |
| 896 | |
| 897 | static struct branch_clk dsi1_s_p_clk = { |
| 898 | .b = { |
| 899 | .ctl_reg = AHB_EN_REG, |
| 900 | .en_mask = BIT(18), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 901 | .hwcg_reg = AHB_EN2_REG, |
| 902 | .hwcg_mask = BIT(20), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 903 | .reset_reg = SW_RESET_AHB_REG, |
| 904 | .reset_mask = BIT(5), |
| 905 | .halt_reg = DBG_BUS_VEC_F_REG, |
| 906 | .halt_bit = 21, |
| 907 | }, |
| 908 | .c = { |
| 909 | .dbg_name = "dsi1_s_p_clk", |
| 910 | .ops = &clk_ops_branch, |
| 911 | CLK_INIT(dsi1_s_p_clk.c), |
| 912 | }, |
| 913 | }; |
| 914 | |
| 915 | static struct branch_clk dsi2_m_p_clk = { |
| 916 | .b = { |
| 917 | .ctl_reg = AHB_EN_REG, |
| 918 | .en_mask = BIT(17), |
| 919 | .reset_reg = SW_RESET_AHB2_REG, |
| 920 | .reset_mask = BIT(1), |
| 921 | .halt_reg = DBG_BUS_VEC_E_REG, |
| 922 | .halt_bit = 18, |
| 923 | }, |
| 924 | .c = { |
| 925 | .dbg_name = "dsi2_m_p_clk", |
| 926 | .ops = &clk_ops_branch, |
| 927 | CLK_INIT(dsi2_m_p_clk.c), |
| 928 | }, |
| 929 | }; |
| 930 | |
| 931 | static struct branch_clk dsi2_s_p_clk = { |
| 932 | .b = { |
| 933 | .ctl_reg = AHB_EN_REG, |
| 934 | .en_mask = BIT(22), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 935 | .hwcg_reg = AHB_EN2_REG, |
| 936 | .hwcg_mask = BIT(15), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 937 | .reset_reg = SW_RESET_AHB2_REG, |
| 938 | .reset_mask = BIT(0), |
| 939 | .halt_reg = DBG_BUS_VEC_F_REG, |
| 940 | .halt_bit = 20, |
| 941 | }, |
| 942 | .c = { |
| 943 | .dbg_name = "dsi2_s_p_clk", |
| 944 | .ops = &clk_ops_branch, |
| 945 | CLK_INIT(dsi2_s_p_clk.c), |
| 946 | }, |
| 947 | }; |
| 948 | |
| 949 | static struct branch_clk gfx2d0_p_clk = { |
| 950 | .b = { |
| 951 | .ctl_reg = AHB_EN_REG, |
| 952 | .en_mask = BIT(19), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 953 | .hwcg_reg = AHB_EN2_REG, |
| 954 | .hwcg_mask = BIT(28), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 955 | .reset_reg = SW_RESET_AHB_REG, |
| 956 | .reset_mask = BIT(12), |
| 957 | .halt_reg = DBG_BUS_VEC_F_REG, |
| 958 | .halt_bit = 2, |
| 959 | }, |
| 960 | .c = { |
| 961 | .dbg_name = "gfx2d0_p_clk", |
| 962 | .ops = &clk_ops_branch, |
Matt Wagantall | 158f73b | 2012-05-16 11:29:35 -0700 | [diff] [blame] | 963 | .flags = CLKFLAG_SKIP_HANDOFF, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 964 | CLK_INIT(gfx2d0_p_clk.c), |
| 965 | }, |
| 966 | }; |
| 967 | |
| 968 | static struct branch_clk gfx2d1_p_clk = { |
| 969 | .b = { |
| 970 | .ctl_reg = AHB_EN_REG, |
| 971 | .en_mask = BIT(2), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 972 | .hwcg_reg = AHB_EN2_REG, |
| 973 | .hwcg_mask = BIT(29), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 974 | .reset_reg = SW_RESET_AHB_REG, |
| 975 | .reset_mask = BIT(11), |
| 976 | .halt_reg = DBG_BUS_VEC_F_REG, |
| 977 | .halt_bit = 3, |
| 978 | }, |
| 979 | .c = { |
| 980 | .dbg_name = "gfx2d1_p_clk", |
| 981 | .ops = &clk_ops_branch, |
Matt Wagantall | 158f73b | 2012-05-16 11:29:35 -0700 | [diff] [blame] | 982 | .flags = CLKFLAG_SKIP_HANDOFF, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 983 | CLK_INIT(gfx2d1_p_clk.c), |
| 984 | }, |
| 985 | }; |
| 986 | |
| 987 | static struct branch_clk gfx3d_p_clk = { |
| 988 | .b = { |
| 989 | .ctl_reg = AHB_EN_REG, |
| 990 | .en_mask = BIT(3), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 991 | .hwcg_reg = AHB_EN2_REG, |
| 992 | .hwcg_mask = BIT(27), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 993 | .reset_reg = SW_RESET_AHB_REG, |
| 994 | .reset_mask = BIT(10), |
| 995 | .halt_reg = DBG_BUS_VEC_F_REG, |
| 996 | .halt_bit = 4, |
| 997 | }, |
| 998 | .c = { |
| 999 | .dbg_name = "gfx3d_p_clk", |
| 1000 | .ops = &clk_ops_branch, |
| 1001 | CLK_INIT(gfx3d_p_clk.c), |
| 1002 | }, |
| 1003 | }; |
| 1004 | |
| 1005 | static struct branch_clk hdmi_m_p_clk = { |
| 1006 | .b = { |
| 1007 | .ctl_reg = AHB_EN_REG, |
| 1008 | .en_mask = BIT(14), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 1009 | .hwcg_reg = AHB_EN2_REG, |
| 1010 | .hwcg_mask = BIT(21), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1011 | .reset_reg = SW_RESET_AHB_REG, |
| 1012 | .reset_mask = BIT(9), |
| 1013 | .halt_reg = DBG_BUS_VEC_F_REG, |
| 1014 | .halt_bit = 5, |
| 1015 | }, |
| 1016 | .c = { |
| 1017 | .dbg_name = "hdmi_m_p_clk", |
| 1018 | .ops = &clk_ops_branch, |
| 1019 | CLK_INIT(hdmi_m_p_clk.c), |
| 1020 | }, |
| 1021 | }; |
| 1022 | |
| 1023 | static struct branch_clk hdmi_s_p_clk = { |
| 1024 | .b = { |
| 1025 | .ctl_reg = AHB_EN_REG, |
| 1026 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 1027 | .hwcg_reg = AHB_EN2_REG, |
| 1028 | .hwcg_mask = BIT(22), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1029 | .reset_reg = SW_RESET_AHB_REG, |
| 1030 | .reset_mask = BIT(9), |
| 1031 | .halt_reg = DBG_BUS_VEC_F_REG, |
| 1032 | .halt_bit = 6, |
| 1033 | }, |
| 1034 | .c = { |
| 1035 | .dbg_name = "hdmi_s_p_clk", |
| 1036 | .ops = &clk_ops_branch, |
| 1037 | CLK_INIT(hdmi_s_p_clk.c), |
| 1038 | }, |
| 1039 | }; |
| 1040 | |
| 1041 | static struct branch_clk ijpeg_p_clk = { |
| 1042 | .b = { |
| 1043 | .ctl_reg = AHB_EN_REG, |
| 1044 | .en_mask = BIT(5), |
| 1045 | .reset_reg = SW_RESET_AHB_REG, |
| 1046 | .reset_mask = BIT(7), |
| 1047 | .halt_reg = DBG_BUS_VEC_F_REG, |
| 1048 | .halt_bit = 9, |
| 1049 | }, |
| 1050 | .c = { |
| 1051 | .dbg_name = "ijpeg_p_clk", |
| 1052 | .ops = &clk_ops_branch, |
| 1053 | CLK_INIT(ijpeg_p_clk.c), |
| 1054 | }, |
| 1055 | }; |
| 1056 | |
| 1057 | static struct branch_clk imem_p_clk = { |
| 1058 | .b = { |
| 1059 | .ctl_reg = AHB_EN_REG, |
| 1060 | .en_mask = BIT(6), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 1061 | .hwcg_reg = AHB_EN2_REG, |
| 1062 | .hwcg_mask = BIT(12), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1063 | .reset_reg = SW_RESET_AHB_REG, |
| 1064 | .reset_mask = BIT(8), |
| 1065 | .halt_reg = DBG_BUS_VEC_F_REG, |
| 1066 | .halt_bit = 10, |
| 1067 | }, |
| 1068 | .c = { |
| 1069 | .dbg_name = "imem_p_clk", |
| 1070 | .ops = &clk_ops_branch, |
| 1071 | CLK_INIT(imem_p_clk.c), |
| 1072 | }, |
| 1073 | }; |
| 1074 | |
| 1075 | static struct branch_clk jpegd_p_clk = { |
| 1076 | .b = { |
| 1077 | .ctl_reg = AHB_EN_REG, |
| 1078 | .en_mask = BIT(21), |
| 1079 | .reset_reg = SW_RESET_AHB_REG, |
| 1080 | .reset_mask = BIT(4), |
| 1081 | .halt_reg = DBG_BUS_VEC_F_REG, |
| 1082 | .halt_bit = 7, |
| 1083 | }, |
| 1084 | .c = { |
| 1085 | .dbg_name = "jpegd_p_clk", |
| 1086 | .ops = &clk_ops_branch, |
| 1087 | CLK_INIT(jpegd_p_clk.c), |
| 1088 | }, |
| 1089 | }; |
| 1090 | |
| 1091 | static struct branch_clk mdp_p_clk = { |
| 1092 | .b = { |
| 1093 | .ctl_reg = AHB_EN_REG, |
| 1094 | .en_mask = BIT(10), |
| 1095 | .reset_reg = SW_RESET_AHB_REG, |
| 1096 | .reset_mask = BIT(3), |
| 1097 | .halt_reg = DBG_BUS_VEC_F_REG, |
| 1098 | .halt_bit = 11, |
| 1099 | }, |
| 1100 | .c = { |
| 1101 | .dbg_name = "mdp_p_clk", |
| 1102 | .ops = &clk_ops_branch, |
| 1103 | CLK_INIT(mdp_p_clk.c), |
| 1104 | }, |
| 1105 | }; |
| 1106 | |
| 1107 | static struct branch_clk rot_p_clk = { |
| 1108 | .b = { |
| 1109 | .ctl_reg = AHB_EN_REG, |
| 1110 | .en_mask = BIT(12), |
| 1111 | .reset_reg = SW_RESET_AHB_REG, |
| 1112 | .reset_mask = BIT(2), |
| 1113 | .halt_reg = DBG_BUS_VEC_F_REG, |
| 1114 | .halt_bit = 13, |
| 1115 | }, |
| 1116 | .c = { |
| 1117 | .dbg_name = "rot_p_clk", |
| 1118 | .ops = &clk_ops_branch, |
| 1119 | CLK_INIT(rot_p_clk.c), |
| 1120 | }, |
| 1121 | }; |
| 1122 | |
| 1123 | static struct branch_clk smmu_p_clk = { |
| 1124 | .b = { |
| 1125 | .ctl_reg = AHB_EN_REG, |
| 1126 | .en_mask = BIT(15), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 1127 | .hwcg_reg = AHB_EN_REG, |
| 1128 | .hwcg_mask = BIT(26), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1129 | .halt_reg = DBG_BUS_VEC_F_REG, |
| 1130 | .halt_bit = 22, |
| 1131 | }, |
| 1132 | .c = { |
| 1133 | .dbg_name = "smmu_p_clk", |
| 1134 | .ops = &clk_ops_branch, |
| 1135 | CLK_INIT(smmu_p_clk.c), |
| 1136 | }, |
| 1137 | }; |
| 1138 | |
| 1139 | static struct branch_clk tv_enc_p_clk = { |
| 1140 | .b = { |
| 1141 | .ctl_reg = AHB_EN_REG, |
| 1142 | .en_mask = BIT(25), |
| 1143 | .reset_reg = SW_RESET_AHB_REG, |
| 1144 | .reset_mask = BIT(15), |
| 1145 | .halt_reg = DBG_BUS_VEC_F_REG, |
| 1146 | .halt_bit = 23, |
| 1147 | }, |
| 1148 | .c = { |
| 1149 | .dbg_name = "tv_enc_p_clk", |
| 1150 | .ops = &clk_ops_branch, |
| 1151 | CLK_INIT(tv_enc_p_clk.c), |
| 1152 | }, |
| 1153 | }; |
| 1154 | |
| 1155 | static struct branch_clk vcodec_p_clk = { |
| 1156 | .b = { |
| 1157 | .ctl_reg = AHB_EN_REG, |
| 1158 | .en_mask = BIT(11), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 1159 | .hwcg_reg = AHB_EN2_REG, |
| 1160 | .hwcg_mask = BIT(26), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1161 | .reset_reg = SW_RESET_AHB_REG, |
| 1162 | .reset_mask = BIT(1), |
| 1163 | .halt_reg = DBG_BUS_VEC_F_REG, |
| 1164 | .halt_bit = 12, |
| 1165 | }, |
| 1166 | .c = { |
| 1167 | .dbg_name = "vcodec_p_clk", |
| 1168 | .ops = &clk_ops_branch, |
| 1169 | CLK_INIT(vcodec_p_clk.c), |
| 1170 | }, |
| 1171 | }; |
| 1172 | |
| 1173 | static struct branch_clk vfe_p_clk = { |
| 1174 | .b = { |
| 1175 | .ctl_reg = AHB_EN_REG, |
| 1176 | .en_mask = BIT(13), |
| 1177 | .reset_reg = SW_RESET_AHB_REG, |
| 1178 | .reset_mask = BIT(0), |
| 1179 | .halt_reg = DBG_BUS_VEC_F_REG, |
| 1180 | .halt_bit = 14, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 1181 | .retain_reg = AHB_EN2_REG, |
| 1182 | .retain_mask = BIT(0), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1183 | }, |
| 1184 | .c = { |
| 1185 | .dbg_name = "vfe_p_clk", |
| 1186 | .ops = &clk_ops_branch, |
| 1187 | CLK_INIT(vfe_p_clk.c), |
| 1188 | }, |
| 1189 | }; |
| 1190 | |
| 1191 | static struct branch_clk vpe_p_clk = { |
| 1192 | .b = { |
| 1193 | .ctl_reg = AHB_EN_REG, |
| 1194 | .en_mask = BIT(16), |
| 1195 | .reset_reg = SW_RESET_AHB_REG, |
| 1196 | .reset_mask = BIT(14), |
| 1197 | .halt_reg = DBG_BUS_VEC_F_REG, |
| 1198 | .halt_bit = 15, |
| 1199 | }, |
| 1200 | .c = { |
| 1201 | .dbg_name = "vpe_p_clk", |
| 1202 | .ops = &clk_ops_branch, |
| 1203 | CLK_INIT(vpe_p_clk.c), |
| 1204 | }, |
| 1205 | }; |
| 1206 | |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 1207 | static struct branch_clk vcap_p_clk = { |
| 1208 | .b = { |
| 1209 | .ctl_reg = AHB_EN3_REG, |
| 1210 | .en_mask = BIT(1), |
Tianyi Gou | f3095ea | 2012-05-22 14:16:06 -0700 | [diff] [blame] | 1211 | .hwcg_reg = AHB_EN3_REG, |
| 1212 | .hwcg_mask = BIT(0), |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 1213 | .reset_reg = SW_RESET_AHB2_REG, |
| 1214 | .reset_mask = BIT(2), |
| 1215 | .halt_reg = DBG_BUS_VEC_J_REG, |
| 1216 | .halt_bit = 23, |
| 1217 | }, |
| 1218 | .c = { |
| 1219 | .dbg_name = "vcap_p_clk", |
| 1220 | .ops = &clk_ops_branch, |
| 1221 | CLK_INIT(vcap_p_clk.c), |
| 1222 | }, |
| 1223 | }; |
| 1224 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1225 | /* |
| 1226 | * Peripheral Clocks |
| 1227 | */ |
Matt Wagantall | 7625a4c | 2011-11-01 16:17:53 -0700 | [diff] [blame] | 1228 | #define CLK_GP(i, n, h_r, h_b) \ |
| 1229 | struct rcg_clk i##_clk = { \ |
| 1230 | .b = { \ |
| 1231 | .ctl_reg = GPn_NS_REG(n), \ |
| 1232 | .en_mask = BIT(9), \ |
| 1233 | .halt_reg = h_r, \ |
| 1234 | .halt_bit = h_b, \ |
| 1235 | }, \ |
| 1236 | .ns_reg = GPn_NS_REG(n), \ |
| 1237 | .md_reg = GPn_MD_REG(n), \ |
| 1238 | .root_en_mask = BIT(11), \ |
| 1239 | .ns_mask = (BM(23, 16) | BM(6, 0)), \ |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame] | 1240 | .mnd_en_mask = BIT(8), \ |
Matt Wagantall | 7625a4c | 2011-11-01 16:17:53 -0700 | [diff] [blame] | 1241 | .set_rate = set_rate_mnd, \ |
| 1242 | .freq_tbl = clk_tbl_gp, \ |
| 1243 | .current_freq = &rcg_dummy_freq, \ |
| 1244 | .c = { \ |
| 1245 | .dbg_name = #i "_clk", \ |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 1246 | .ops = &clk_ops_rcg, \ |
Matt Wagantall | 7625a4c | 2011-11-01 16:17:53 -0700 | [diff] [blame] | 1247 | VDD_DIG_FMAX_MAP2(LOW, 100000000, NOMINAL, 200000000), \ |
| 1248 | CLK_INIT(i##_clk.c), \ |
| 1249 | }, \ |
| 1250 | } |
| 1251 | #define F_GP(f, s, d, m, n) \ |
| 1252 | { \ |
| 1253 | .freq_hz = f, \ |
| 1254 | .src_clk = &s##_clk.c, \ |
| 1255 | .md_val = MD8(16, m, 0, n), \ |
| 1256 | .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] | 1257 | } |
| 1258 | static struct clk_freq_tbl clk_tbl_gp[] = { |
| 1259 | F_GP( 0, gnd, 1, 0, 0), |
| 1260 | F_GP( 9600000, cxo, 2, 0, 0), |
| 1261 | F_GP( 13500000, pxo, 2, 0, 0), |
| 1262 | F_GP( 19200000, cxo, 1, 0, 0), |
| 1263 | F_GP( 27000000, pxo, 1, 0, 0), |
| 1264 | F_GP( 64000000, pll8, 2, 1, 3), |
| 1265 | F_GP( 76800000, pll8, 1, 1, 5), |
| 1266 | F_GP( 96000000, pll8, 4, 0, 0), |
| 1267 | F_GP(128000000, pll8, 3, 0, 0), |
| 1268 | F_GP(192000000, pll8, 2, 0, 0), |
Matt Wagantall | 7625a4c | 2011-11-01 16:17:53 -0700 | [diff] [blame] | 1269 | F_END |
| 1270 | }; |
| 1271 | |
| 1272 | static CLK_GP(gp0, 0, CLK_HALT_SFPB_MISC_STATE_REG, 7); |
| 1273 | static CLK_GP(gp1, 1, CLK_HALT_SFPB_MISC_STATE_REG, 6); |
| 1274 | static CLK_GP(gp2, 2, CLK_HALT_SFPB_MISC_STATE_REG, 5); |
| 1275 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1276 | #define CLK_GSBI_UART(i, n, h_r, h_b) \ |
| 1277 | struct rcg_clk i##_clk = { \ |
| 1278 | .b = { \ |
| 1279 | .ctl_reg = GSBIn_UART_APPS_NS_REG(n), \ |
| 1280 | .en_mask = BIT(9), \ |
| 1281 | .reset_reg = GSBIn_RESET_REG(n), \ |
| 1282 | .reset_mask = BIT(0), \ |
| 1283 | .halt_reg = h_r, \ |
| 1284 | .halt_bit = h_b, \ |
| 1285 | }, \ |
| 1286 | .ns_reg = GSBIn_UART_APPS_NS_REG(n), \ |
| 1287 | .md_reg = GSBIn_UART_APPS_MD_REG(n), \ |
| 1288 | .root_en_mask = BIT(11), \ |
| 1289 | .ns_mask = (BM(31, 16) | BM(6, 0)), \ |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame] | 1290 | .mnd_en_mask = BIT(8), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1291 | .set_rate = set_rate_mnd, \ |
| 1292 | .freq_tbl = clk_tbl_gsbi_uart, \ |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1293 | .current_freq = &rcg_dummy_freq, \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1294 | .c = { \ |
| 1295 | .dbg_name = #i "_clk", \ |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 1296 | .ops = &clk_ops_rcg, \ |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1297 | VDD_DIG_FMAX_MAP2(LOW, 32000000, NOMINAL, 64000000), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1298 | CLK_INIT(i##_clk.c), \ |
| 1299 | }, \ |
| 1300 | } |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1301 | #define F_GSBI_UART(f, s, d, m, n) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1302 | { \ |
| 1303 | .freq_hz = f, \ |
| 1304 | .src_clk = &s##_clk.c, \ |
| 1305 | .md_val = MD16(m, n), \ |
| 1306 | .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] | 1307 | } |
| 1308 | static struct clk_freq_tbl clk_tbl_gsbi_uart[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1309 | F_GSBI_UART( 0, gnd, 1, 0, 0), |
Matt Wagantall | 9a561f7 | 2012-01-19 16:13:12 -0800 | [diff] [blame] | 1310 | F_GSBI_UART( 1843200, pll8, 2, 6, 625), |
| 1311 | F_GSBI_UART( 3686400, pll8, 2, 12, 625), |
| 1312 | F_GSBI_UART( 7372800, pll8, 2, 24, 625), |
| 1313 | F_GSBI_UART(14745600, pll8, 2, 48, 625), |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1314 | F_GSBI_UART(16000000, pll8, 4, 1, 6), |
| 1315 | F_GSBI_UART(24000000, pll8, 4, 1, 4), |
| 1316 | F_GSBI_UART(32000000, pll8, 4, 1, 3), |
| 1317 | F_GSBI_UART(40000000, pll8, 1, 5, 48), |
| 1318 | F_GSBI_UART(46400000, pll8, 1, 29, 240), |
| 1319 | F_GSBI_UART(48000000, pll8, 4, 1, 2), |
| 1320 | F_GSBI_UART(51200000, pll8, 1, 2, 15), |
| 1321 | F_GSBI_UART(56000000, pll8, 1, 7, 48), |
| 1322 | F_GSBI_UART(58982400, pll8, 1, 96, 625), |
| 1323 | F_GSBI_UART(64000000, pll8, 2, 1, 3), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1324 | F_END |
| 1325 | }; |
| 1326 | |
| 1327 | static CLK_GSBI_UART(gsbi1_uart, 1, CLK_HALT_CFPB_STATEA_REG, 10); |
| 1328 | static CLK_GSBI_UART(gsbi2_uart, 2, CLK_HALT_CFPB_STATEA_REG, 6); |
| 1329 | static CLK_GSBI_UART(gsbi3_uart, 3, CLK_HALT_CFPB_STATEA_REG, 2); |
| 1330 | static CLK_GSBI_UART(gsbi4_uart, 4, CLK_HALT_CFPB_STATEB_REG, 26); |
| 1331 | static CLK_GSBI_UART(gsbi5_uart, 5, CLK_HALT_CFPB_STATEB_REG, 22); |
| 1332 | static CLK_GSBI_UART(gsbi6_uart, 6, CLK_HALT_CFPB_STATEB_REG, 18); |
| 1333 | static CLK_GSBI_UART(gsbi7_uart, 7, CLK_HALT_CFPB_STATEB_REG, 14); |
| 1334 | static CLK_GSBI_UART(gsbi8_uart, 8, CLK_HALT_CFPB_STATEB_REG, 10); |
| 1335 | static CLK_GSBI_UART(gsbi9_uart, 9, CLK_HALT_CFPB_STATEB_REG, 6); |
| 1336 | static CLK_GSBI_UART(gsbi10_uart, 10, CLK_HALT_CFPB_STATEB_REG, 2); |
| 1337 | static CLK_GSBI_UART(gsbi11_uart, 11, CLK_HALT_CFPB_STATEC_REG, 17); |
| 1338 | static CLK_GSBI_UART(gsbi12_uart, 12, CLK_HALT_CFPB_STATEC_REG, 13); |
| 1339 | |
| 1340 | #define CLK_GSBI_QUP(i, n, h_r, h_b) \ |
| 1341 | struct rcg_clk i##_clk = { \ |
| 1342 | .b = { \ |
| 1343 | .ctl_reg = GSBIn_QUP_APPS_NS_REG(n), \ |
| 1344 | .en_mask = BIT(9), \ |
| 1345 | .reset_reg = GSBIn_RESET_REG(n), \ |
| 1346 | .reset_mask = BIT(0), \ |
| 1347 | .halt_reg = h_r, \ |
| 1348 | .halt_bit = h_b, \ |
| 1349 | }, \ |
| 1350 | .ns_reg = GSBIn_QUP_APPS_NS_REG(n), \ |
| 1351 | .md_reg = GSBIn_QUP_APPS_MD_REG(n), \ |
| 1352 | .root_en_mask = BIT(11), \ |
| 1353 | .ns_mask = (BM(23, 16) | BM(6, 0)), \ |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame] | 1354 | .mnd_en_mask = BIT(8), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1355 | .set_rate = set_rate_mnd, \ |
| 1356 | .freq_tbl = clk_tbl_gsbi_qup, \ |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1357 | .current_freq = &rcg_dummy_freq, \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1358 | .c = { \ |
| 1359 | .dbg_name = #i "_clk", \ |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 1360 | .ops = &clk_ops_rcg, \ |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1361 | VDD_DIG_FMAX_MAP2(LOW, 24000000, NOMINAL, 52000000), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1362 | CLK_INIT(i##_clk.c), \ |
| 1363 | }, \ |
| 1364 | } |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1365 | #define F_GSBI_QUP(f, s, d, m, n) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1366 | { \ |
| 1367 | .freq_hz = f, \ |
| 1368 | .src_clk = &s##_clk.c, \ |
| 1369 | .md_val = MD8(16, m, 0, n), \ |
| 1370 | .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] | 1371 | } |
| 1372 | static struct clk_freq_tbl clk_tbl_gsbi_qup[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1373 | F_GSBI_QUP( 0, gnd, 1, 0, 0), |
| 1374 | F_GSBI_QUP( 1100000, pxo, 1, 2, 49), |
| 1375 | F_GSBI_QUP( 5400000, pxo, 1, 1, 5), |
| 1376 | F_GSBI_QUP(10800000, pxo, 1, 2, 5), |
| 1377 | F_GSBI_QUP(15060000, pll8, 1, 2, 51), |
| 1378 | F_GSBI_QUP(24000000, pll8, 4, 1, 4), |
| 1379 | F_GSBI_QUP(25600000, pll8, 1, 1, 15), |
| 1380 | F_GSBI_QUP(27000000, pxo, 1, 0, 0), |
| 1381 | F_GSBI_QUP(48000000, pll8, 4, 1, 2), |
| 1382 | F_GSBI_QUP(51200000, pll8, 1, 2, 15), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1383 | F_END |
| 1384 | }; |
| 1385 | |
| 1386 | static CLK_GSBI_QUP(gsbi1_qup, 1, CLK_HALT_CFPB_STATEA_REG, 9); |
| 1387 | static CLK_GSBI_QUP(gsbi2_qup, 2, CLK_HALT_CFPB_STATEA_REG, 4); |
| 1388 | static CLK_GSBI_QUP(gsbi3_qup, 3, CLK_HALT_CFPB_STATEA_REG, 0); |
| 1389 | static CLK_GSBI_QUP(gsbi4_qup, 4, CLK_HALT_CFPB_STATEB_REG, 24); |
| 1390 | static CLK_GSBI_QUP(gsbi5_qup, 5, CLK_HALT_CFPB_STATEB_REG, 20); |
| 1391 | static CLK_GSBI_QUP(gsbi6_qup, 6, CLK_HALT_CFPB_STATEB_REG, 16); |
| 1392 | static CLK_GSBI_QUP(gsbi7_qup, 7, CLK_HALT_CFPB_STATEB_REG, 12); |
| 1393 | static CLK_GSBI_QUP(gsbi8_qup, 8, CLK_HALT_CFPB_STATEB_REG, 8); |
| 1394 | static CLK_GSBI_QUP(gsbi9_qup, 9, CLK_HALT_CFPB_STATEB_REG, 4); |
| 1395 | static CLK_GSBI_QUP(gsbi10_qup, 10, CLK_HALT_CFPB_STATEB_REG, 0); |
| 1396 | static CLK_GSBI_QUP(gsbi11_qup, 11, CLK_HALT_CFPB_STATEC_REG, 15); |
| 1397 | static CLK_GSBI_QUP(gsbi12_qup, 12, CLK_HALT_CFPB_STATEC_REG, 11); |
| 1398 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1399 | #define F_PDM(f, s, d) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1400 | { \ |
| 1401 | .freq_hz = f, \ |
| 1402 | .src_clk = &s##_clk.c, \ |
| 1403 | .ns_val = NS_SRC_SEL(1, 0, s##_to_xo_mux), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1404 | } |
| 1405 | static struct clk_freq_tbl clk_tbl_pdm[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1406 | F_PDM( 0, gnd, 1), |
| 1407 | F_PDM(27000000, pxo, 1), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1408 | F_END |
| 1409 | }; |
| 1410 | |
| 1411 | static struct rcg_clk pdm_clk = { |
| 1412 | .b = { |
| 1413 | .ctl_reg = PDM_CLK_NS_REG, |
| 1414 | .en_mask = BIT(9), |
| 1415 | .reset_reg = PDM_CLK_NS_REG, |
| 1416 | .reset_mask = BIT(12), |
| 1417 | .halt_reg = CLK_HALT_CFPB_STATEC_REG, |
| 1418 | .halt_bit = 3, |
| 1419 | }, |
| 1420 | .ns_reg = PDM_CLK_NS_REG, |
| 1421 | .root_en_mask = BIT(11), |
| 1422 | .ns_mask = BM(1, 0), |
| 1423 | .set_rate = set_rate_nop, |
| 1424 | .freq_tbl = clk_tbl_pdm, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1425 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1426 | .c = { |
| 1427 | .dbg_name = "pdm_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 1428 | .ops = &clk_ops_rcg, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1429 | VDD_DIG_FMAX_MAP1(LOW, 27000000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1430 | CLK_INIT(pdm_clk.c), |
| 1431 | }, |
| 1432 | }; |
| 1433 | |
| 1434 | static struct branch_clk pmem_clk = { |
| 1435 | .b = { |
| 1436 | .ctl_reg = PMEM_ACLK_CTL_REG, |
| 1437 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 1438 | .hwcg_reg = PMEM_ACLK_CTL_REG, |
| 1439 | .hwcg_mask = BIT(6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1440 | .halt_reg = CLK_HALT_DFAB_STATE_REG, |
| 1441 | .halt_bit = 20, |
| 1442 | }, |
| 1443 | .c = { |
| 1444 | .dbg_name = "pmem_clk", |
| 1445 | .ops = &clk_ops_branch, |
| 1446 | CLK_INIT(pmem_clk.c), |
| 1447 | }, |
| 1448 | }; |
| 1449 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1450 | #define F_PRNG(f, s) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1451 | { \ |
| 1452 | .freq_hz = f, \ |
| 1453 | .src_clk = &s##_clk.c, \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1454 | } |
Stephen Boyd | 842a1f6 | 2012-04-26 19:07:38 -0700 | [diff] [blame] | 1455 | static struct clk_freq_tbl clk_tbl_prng_32[] = { |
| 1456 | F_PRNG(32000000, pll8), |
| 1457 | F_END |
| 1458 | }; |
| 1459 | |
| 1460 | static struct clk_freq_tbl clk_tbl_prng_64[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1461 | F_PRNG(64000000, pll8), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1462 | F_END |
| 1463 | }; |
| 1464 | |
| 1465 | static struct rcg_clk prng_clk = { |
| 1466 | .b = { |
| 1467 | .ctl_reg = SC0_U_CLK_BRANCH_ENA_VOTE_REG, |
| 1468 | .en_mask = BIT(10), |
| 1469 | .halt_reg = CLK_HALT_SFPB_MISC_STATE_REG, |
| 1470 | .halt_check = HALT_VOTED, |
| 1471 | .halt_bit = 10, |
| 1472 | }, |
| 1473 | .set_rate = set_rate_nop, |
Stephen Boyd | 842a1f6 | 2012-04-26 19:07:38 -0700 | [diff] [blame] | 1474 | .freq_tbl = clk_tbl_prng_32, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1475 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1476 | .c = { |
| 1477 | .dbg_name = "prng_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 1478 | .ops = &clk_ops_rcg, |
Stephen Boyd | 842a1f6 | 2012-04-26 19:07:38 -0700 | [diff] [blame] | 1479 | VDD_DIG_FMAX_MAP2(LOW, 32000000, NOMINAL, 64000000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1480 | CLK_INIT(prng_clk.c), |
| 1481 | }, |
| 1482 | }; |
| 1483 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1484 | #define CLK_SDC(name, n, h_b, fmax_low, fmax_nom) \ |
Stephen Boyd | a78a740 | 2011-08-02 11:23:39 -0700 | [diff] [blame] | 1485 | struct rcg_clk name = { \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1486 | .b = { \ |
| 1487 | .ctl_reg = SDCn_APPS_CLK_NS_REG(n), \ |
| 1488 | .en_mask = BIT(9), \ |
| 1489 | .reset_reg = SDCn_RESET_REG(n), \ |
| 1490 | .reset_mask = BIT(0), \ |
Stephen Boyd | a78a740 | 2011-08-02 11:23:39 -0700 | [diff] [blame] | 1491 | .halt_reg = CLK_HALT_DFAB_STATE_REG, \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1492 | .halt_bit = h_b, \ |
| 1493 | }, \ |
| 1494 | .ns_reg = SDCn_APPS_CLK_NS_REG(n), \ |
| 1495 | .md_reg = SDCn_APPS_CLK_MD_REG(n), \ |
| 1496 | .root_en_mask = BIT(11), \ |
| 1497 | .ns_mask = (BM(23, 16) | BM(6, 0)), \ |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame] | 1498 | .mnd_en_mask = BIT(8), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1499 | .set_rate = set_rate_mnd, \ |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1500 | .freq_tbl = clk_tbl_sdc, \ |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1501 | .current_freq = &rcg_dummy_freq, \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1502 | .c = { \ |
Stephen Boyd | a78a740 | 2011-08-02 11:23:39 -0700 | [diff] [blame] | 1503 | .dbg_name = #name, \ |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 1504 | .ops = &clk_ops_rcg, \ |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1505 | VDD_DIG_FMAX_MAP2(LOW, fmax_low, NOMINAL, fmax_nom), \ |
Stephen Boyd | a78a740 | 2011-08-02 11:23:39 -0700 | [diff] [blame] | 1506 | CLK_INIT(name.c), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1507 | }, \ |
| 1508 | } |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1509 | #define F_SDC(f, s, d, m, n) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1510 | { \ |
| 1511 | .freq_hz = f, \ |
| 1512 | .src_clk = &s##_clk.c, \ |
| 1513 | .md_val = MD8(16, m, 0, n), \ |
| 1514 | .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] | 1515 | } |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1516 | static struct clk_freq_tbl clk_tbl_sdc[] = { |
| 1517 | F_SDC( 0, gnd, 1, 0, 0), |
| 1518 | F_SDC( 144000, pxo, 3, 2, 125), |
| 1519 | F_SDC( 400000, pll8, 4, 1, 240), |
| 1520 | F_SDC( 16000000, pll8, 4, 1, 6), |
| 1521 | F_SDC( 17070000, pll8, 1, 2, 45), |
| 1522 | F_SDC( 20210000, pll8, 1, 1, 19), |
| 1523 | F_SDC( 24000000, pll8, 4, 1, 4), |
| 1524 | F_SDC( 48000000, pll8, 4, 1, 2), |
| 1525 | F_SDC( 64000000, pll8, 3, 1, 2), |
| 1526 | F_SDC( 96000000, pll8, 4, 0, 0), |
Subhash Jadavani | bd238ba | 2011-11-24 15:12:39 +0530 | [diff] [blame] | 1527 | F_SDC(192000000, pll8, 2, 0, 0), |
Stephen Boyd | a78a740 | 2011-08-02 11:23:39 -0700 | [diff] [blame] | 1528 | F_END |
| 1529 | }; |
| 1530 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1531 | static CLK_SDC(sdc1_clk, 1, 6, 52000000, 104000000); |
| 1532 | static CLK_SDC(sdc2_clk, 2, 5, 52000000, 104000000); |
| 1533 | static CLK_SDC(sdc3_clk, 3, 4, 104000000, 208000000); |
| 1534 | static CLK_SDC(sdc4_clk, 4, 3, 33000000, 67000000); |
| 1535 | static CLK_SDC(sdc5_clk, 5, 2, 33000000, 67000000); |
Stephen Boyd | a78a740 | 2011-08-02 11:23:39 -0700 | [diff] [blame] | 1536 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1537 | #define F_TSIF_REF(f, s, d, m, n) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1538 | { \ |
| 1539 | .freq_hz = f, \ |
| 1540 | .src_clk = &s##_clk.c, \ |
| 1541 | .md_val = MD16(m, n), \ |
| 1542 | .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] | 1543 | } |
| 1544 | static struct clk_freq_tbl clk_tbl_tsif_ref[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1545 | F_TSIF_REF( 0, gnd, 1, 0, 0), |
| 1546 | F_TSIF_REF(105000, pxo, 1, 1, 256), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1547 | F_END |
| 1548 | }; |
| 1549 | |
| 1550 | static struct rcg_clk tsif_ref_clk = { |
| 1551 | .b = { |
| 1552 | .ctl_reg = TSIF_REF_CLK_NS_REG, |
| 1553 | .en_mask = BIT(9), |
| 1554 | .halt_reg = CLK_HALT_CFPB_STATEC_REG, |
| 1555 | .halt_bit = 5, |
| 1556 | }, |
| 1557 | .ns_reg = TSIF_REF_CLK_NS_REG, |
| 1558 | .md_reg = TSIF_REF_CLK_MD_REG, |
| 1559 | .root_en_mask = BIT(11), |
| 1560 | .ns_mask = (BM(31, 16) | BM(6, 0)), |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame] | 1561 | .mnd_en_mask = BIT(8), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1562 | .set_rate = set_rate_mnd, |
| 1563 | .freq_tbl = clk_tbl_tsif_ref, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1564 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1565 | .c = { |
| 1566 | .dbg_name = "tsif_ref_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 1567 | .ops = &clk_ops_rcg, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1568 | VDD_DIG_FMAX_MAP2(LOW, 27000000, NOMINAL, 54000000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1569 | CLK_INIT(tsif_ref_clk.c), |
| 1570 | }, |
| 1571 | }; |
| 1572 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1573 | #define F_TSSC(f, s) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1574 | { \ |
| 1575 | .freq_hz = f, \ |
| 1576 | .src_clk = &s##_clk.c, \ |
| 1577 | .ns_val = NS_SRC_SEL(1, 0, s##_to_xo_mux), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1578 | } |
| 1579 | static struct clk_freq_tbl clk_tbl_tssc[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1580 | F_TSSC( 0, gnd), |
| 1581 | F_TSSC(27000000, pxo), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1582 | F_END |
| 1583 | }; |
| 1584 | |
| 1585 | static struct rcg_clk tssc_clk = { |
| 1586 | .b = { |
| 1587 | .ctl_reg = TSSC_CLK_CTL_REG, |
| 1588 | .en_mask = BIT(4), |
| 1589 | .halt_reg = CLK_HALT_CFPB_STATEC_REG, |
| 1590 | .halt_bit = 4, |
| 1591 | }, |
| 1592 | .ns_reg = TSSC_CLK_CTL_REG, |
| 1593 | .ns_mask = BM(1, 0), |
| 1594 | .set_rate = set_rate_nop, |
| 1595 | .freq_tbl = clk_tbl_tssc, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1596 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1597 | .c = { |
| 1598 | .dbg_name = "tssc_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 1599 | .ops = &clk_ops_rcg, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1600 | VDD_DIG_FMAX_MAP1(LOW, 27000000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1601 | CLK_INIT(tssc_clk.c), |
| 1602 | }, |
| 1603 | }; |
| 1604 | |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 1605 | #define CLK_USB_HS(name, n, h_b) \ |
| 1606 | static struct rcg_clk name = { \ |
| 1607 | .b = { \ |
| 1608 | .ctl_reg = USB_HS##n##_XCVR_FS_CLK_NS_REG, \ |
| 1609 | .en_mask = BIT(9), \ |
| 1610 | .reset_reg = USB_HS##n##_RESET_REG, \ |
| 1611 | .reset_mask = BIT(0), \ |
| 1612 | .halt_reg = CLK_HALT_DFAB_STATE_REG, \ |
| 1613 | .halt_bit = h_b, \ |
| 1614 | }, \ |
| 1615 | .ns_reg = USB_HS##n##_XCVR_FS_CLK_NS_REG, \ |
| 1616 | .md_reg = USB_HS##n##_XCVR_FS_CLK_MD_REG, \ |
| 1617 | .root_en_mask = BIT(11), \ |
| 1618 | .ns_mask = (BM(23, 16) | BM(6, 0)), \ |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame] | 1619 | .mnd_en_mask = BIT(8), \ |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 1620 | .set_rate = set_rate_mnd, \ |
| 1621 | .freq_tbl = clk_tbl_usb, \ |
| 1622 | .current_freq = &rcg_dummy_freq, \ |
| 1623 | .c = { \ |
| 1624 | .dbg_name = #name, \ |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 1625 | .ops = &clk_ops_rcg, \ |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1626 | VDD_DIG_FMAX_MAP1(NOMINAL, 64000000), \ |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 1627 | CLK_INIT(name.c), \ |
| 1628 | }, \ |
| 1629 | } |
| 1630 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1631 | #define F_USB(f, s, d, m, n) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1632 | { \ |
| 1633 | .freq_hz = f, \ |
| 1634 | .src_clk = &s##_clk.c, \ |
| 1635 | .md_val = MD8(16, m, 0, n), \ |
| 1636 | .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] | 1637 | } |
| 1638 | static struct clk_freq_tbl clk_tbl_usb[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1639 | F_USB( 0, gnd, 1, 0, 0), |
| 1640 | F_USB(60000000, pll8, 1, 5, 32), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1641 | F_END |
| 1642 | }; |
| 1643 | |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 1644 | CLK_USB_HS(usb_hs1_xcvr_clk, 1, 0); |
| 1645 | CLK_USB_HS(usb_hs3_xcvr_clk, 3, 30); |
| 1646 | CLK_USB_HS(usb_hs4_xcvr_clk, 4, 2); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1647 | |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 1648 | static struct clk_freq_tbl clk_tbl_usb_hsic[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1649 | F_USB( 0, gnd, 1, 0, 0), |
| 1650 | F_USB(60000000, pll8, 1, 5, 32), |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 1651 | F_END |
| 1652 | }; |
| 1653 | |
| 1654 | static struct rcg_clk usb_hsic_xcvr_fs_clk = { |
| 1655 | .b = { |
| 1656 | .ctl_reg = USB_HSIC_XCVR_FS_CLK_NS_REG, |
| 1657 | .en_mask = BIT(9), |
| 1658 | .halt_reg = CLK_HALT_CFPB_STATEA_REG, |
| 1659 | .halt_bit = 26, |
| 1660 | }, |
| 1661 | .ns_reg = USB_HSIC_XCVR_FS_CLK_NS_REG, |
| 1662 | .md_reg = USB_HSIC_XCVR_FS_CLK_MD_REG, |
| 1663 | .root_en_mask = BIT(11), |
| 1664 | .ns_mask = (BM(23, 16) | BM(6, 0)), |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame] | 1665 | .mnd_en_mask = BIT(8), |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 1666 | .set_rate = set_rate_mnd, |
| 1667 | .freq_tbl = clk_tbl_usb_hsic, |
| 1668 | .current_freq = &rcg_dummy_freq, |
| 1669 | .c = { |
| 1670 | .dbg_name = "usb_hsic_xcvr_fs_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 1671 | .ops = &clk_ops_rcg, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1672 | VDD_DIG_FMAX_MAP1(LOW, 60000000), |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 1673 | CLK_INIT(usb_hsic_xcvr_fs_clk.c), |
| 1674 | }, |
| 1675 | }; |
| 1676 | |
| 1677 | static struct branch_clk usb_hsic_system_clk = { |
| 1678 | .b = { |
| 1679 | .ctl_reg = USB_HSIC_SYSTEM_CLK_CTL_REG, |
| 1680 | .en_mask = BIT(4), |
| 1681 | .reset_reg = USB_HSIC_RESET_REG, |
| 1682 | .reset_mask = BIT(0), |
| 1683 | .halt_reg = CLK_HALT_CFPB_STATEA_REG, |
| 1684 | .halt_bit = 24, |
| 1685 | }, |
| 1686 | .parent = &usb_hsic_xcvr_fs_clk.c, |
| 1687 | .c = { |
| 1688 | .dbg_name = "usb_hsic_system_clk", |
| 1689 | .ops = &clk_ops_branch, |
| 1690 | CLK_INIT(usb_hsic_system_clk.c), |
| 1691 | }, |
| 1692 | }; |
| 1693 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1694 | #define F_USB_HSIC(f, s) \ |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 1695 | { \ |
| 1696 | .freq_hz = f, \ |
| 1697 | .src_clk = &s##_clk.c, \ |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 1698 | } |
| 1699 | static struct clk_freq_tbl clk_tbl_usb2_hsic[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1700 | F_USB_HSIC(480000000, pll14), |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 1701 | F_END |
| 1702 | }; |
| 1703 | |
| 1704 | static struct rcg_clk usb_hsic_hsic_src_clk = { |
| 1705 | .b = { |
| 1706 | .ctl_reg = USB_HSIC_HSIC_CLK_SRC_CTL_REG, |
| 1707 | .halt_check = NOCHECK, |
| 1708 | }, |
| 1709 | .root_en_mask = BIT(0), |
| 1710 | .set_rate = set_rate_nop, |
| 1711 | .freq_tbl = clk_tbl_usb2_hsic, |
| 1712 | .current_freq = &rcg_dummy_freq, |
| 1713 | .c = { |
| 1714 | .dbg_name = "usb_hsic_hsic_src_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 1715 | .ops = &clk_ops_rcg, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1716 | VDD_DIG_FMAX_MAP1(LOW, 480000000), |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 1717 | CLK_INIT(usb_hsic_hsic_src_clk.c), |
| 1718 | }, |
| 1719 | }; |
| 1720 | |
| 1721 | static struct branch_clk usb_hsic_hsic_clk = { |
| 1722 | .b = { |
| 1723 | .ctl_reg = USB_HSIC_HSIC_CLK_CTL_REG, |
| 1724 | .en_mask = BIT(0), |
| 1725 | .halt_reg = CLK_HALT_CFPB_STATEA_REG, |
| 1726 | .halt_bit = 19, |
| 1727 | }, |
| 1728 | .parent = &usb_hsic_hsic_src_clk.c, |
| 1729 | .c = { |
| 1730 | .dbg_name = "usb_hsic_hsic_clk", |
| 1731 | .ops = &clk_ops_branch, |
| 1732 | CLK_INIT(usb_hsic_hsic_clk.c), |
| 1733 | }, |
| 1734 | }; |
| 1735 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1736 | #define F_USB_HSIO_CAL(f, s) \ |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 1737 | { \ |
| 1738 | .freq_hz = f, \ |
| 1739 | .src_clk = &s##_clk.c, \ |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 1740 | } |
| 1741 | static struct clk_freq_tbl clk_tbl_usb_hsio_cal[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1742 | F_USB_HSIO_CAL(9000000, pxo), |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 1743 | F_END |
| 1744 | }; |
| 1745 | |
| 1746 | static struct rcg_clk usb_hsic_hsio_cal_clk = { |
| 1747 | .b = { |
| 1748 | .ctl_reg = USB_HSIC_HSIO_CAL_CLK_CTL_REG, |
| 1749 | .en_mask = BIT(0), |
| 1750 | .halt_reg = CLK_HALT_CFPB_STATEA_REG, |
| 1751 | .halt_bit = 23, |
| 1752 | }, |
| 1753 | .set_rate = set_rate_nop, |
| 1754 | .freq_tbl = clk_tbl_usb_hsio_cal, |
| 1755 | .current_freq = &rcg_dummy_freq, |
| 1756 | .c = { |
| 1757 | .dbg_name = "usb_hsic_hsio_cal_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 1758 | .ops = &clk_ops_rcg, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1759 | VDD_DIG_FMAX_MAP1(LOW, 10000000), |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 1760 | CLK_INIT(usb_hsic_hsio_cal_clk.c), |
| 1761 | }, |
| 1762 | }; |
| 1763 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1764 | static struct branch_clk usb_phy0_clk = { |
| 1765 | .b = { |
| 1766 | .reset_reg = USB_PHY0_RESET_REG, |
| 1767 | .reset_mask = BIT(0), |
| 1768 | }, |
| 1769 | .c = { |
| 1770 | .dbg_name = "usb_phy0_clk", |
| 1771 | .ops = &clk_ops_reset, |
| 1772 | CLK_INIT(usb_phy0_clk.c), |
| 1773 | }, |
| 1774 | }; |
| 1775 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1776 | #define CLK_USB_FS(i, n, fmax_nom) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1777 | struct rcg_clk i##_clk = { \ |
| 1778 | .ns_reg = USB_FSn_XCVR_FS_CLK_NS_REG(n), \ |
| 1779 | .b = { \ |
| 1780 | .ctl_reg = USB_FSn_XCVR_FS_CLK_NS_REG(n), \ |
| 1781 | .halt_check = NOCHECK, \ |
| 1782 | }, \ |
| 1783 | .md_reg = USB_FSn_XCVR_FS_CLK_MD_REG(n), \ |
| 1784 | .root_en_mask = BIT(11), \ |
| 1785 | .ns_mask = (BM(23, 16) | BM(6, 0)), \ |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame] | 1786 | .mnd_en_mask = BIT(8), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1787 | .set_rate = set_rate_mnd, \ |
| 1788 | .freq_tbl = clk_tbl_usb, \ |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 1789 | .current_freq = &rcg_dummy_freq, \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1790 | .c = { \ |
| 1791 | .dbg_name = #i "_clk", \ |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 1792 | .ops = &clk_ops_rcg, \ |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1793 | VDD_DIG_FMAX_MAP1(NOMINAL, fmax_nom), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1794 | CLK_INIT(i##_clk.c), \ |
| 1795 | }, \ |
| 1796 | } |
| 1797 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1798 | static CLK_USB_FS(usb_fs1_src, 1, 64000000); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1799 | static struct branch_clk usb_fs1_xcvr_clk = { |
| 1800 | .b = { |
| 1801 | .ctl_reg = USB_FSn_XCVR_FS_CLK_NS_REG(1), |
| 1802 | .en_mask = BIT(9), |
| 1803 | .reset_reg = USB_FSn_RESET_REG(1), |
| 1804 | .reset_mask = BIT(1), |
| 1805 | .halt_reg = CLK_HALT_CFPB_STATEA_REG, |
| 1806 | .halt_bit = 15, |
| 1807 | }, |
| 1808 | .parent = &usb_fs1_src_clk.c, |
| 1809 | .c = { |
| 1810 | .dbg_name = "usb_fs1_xcvr_clk", |
| 1811 | .ops = &clk_ops_branch, |
| 1812 | CLK_INIT(usb_fs1_xcvr_clk.c), |
| 1813 | }, |
| 1814 | }; |
| 1815 | |
| 1816 | static struct branch_clk usb_fs1_sys_clk = { |
| 1817 | .b = { |
| 1818 | .ctl_reg = USB_FSn_SYSTEM_CLK_CTL_REG(1), |
| 1819 | .en_mask = BIT(4), |
| 1820 | .reset_reg = USB_FSn_RESET_REG(1), |
| 1821 | .reset_mask = BIT(0), |
| 1822 | .halt_reg = CLK_HALT_CFPB_STATEA_REG, |
| 1823 | .halt_bit = 16, |
| 1824 | }, |
| 1825 | .parent = &usb_fs1_src_clk.c, |
| 1826 | .c = { |
| 1827 | .dbg_name = "usb_fs1_sys_clk", |
| 1828 | .ops = &clk_ops_branch, |
| 1829 | CLK_INIT(usb_fs1_sys_clk.c), |
| 1830 | }, |
| 1831 | }; |
| 1832 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1833 | static CLK_USB_FS(usb_fs2_src, 2, 60000000); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1834 | static struct branch_clk usb_fs2_xcvr_clk = { |
| 1835 | .b = { |
| 1836 | .ctl_reg = USB_FSn_XCVR_FS_CLK_NS_REG(2), |
| 1837 | .en_mask = BIT(9), |
| 1838 | .reset_reg = USB_FSn_RESET_REG(2), |
| 1839 | .reset_mask = BIT(1), |
| 1840 | .halt_reg = CLK_HALT_CFPB_STATEA_REG, |
| 1841 | .halt_bit = 12, |
| 1842 | }, |
| 1843 | .parent = &usb_fs2_src_clk.c, |
| 1844 | .c = { |
| 1845 | .dbg_name = "usb_fs2_xcvr_clk", |
| 1846 | .ops = &clk_ops_branch, |
| 1847 | CLK_INIT(usb_fs2_xcvr_clk.c), |
| 1848 | }, |
| 1849 | }; |
| 1850 | |
| 1851 | static struct branch_clk usb_fs2_sys_clk = { |
| 1852 | .b = { |
| 1853 | .ctl_reg = USB_FSn_SYSTEM_CLK_CTL_REG(2), |
| 1854 | .en_mask = BIT(4), |
| 1855 | .reset_reg = USB_FSn_RESET_REG(2), |
| 1856 | .reset_mask = BIT(0), |
| 1857 | .halt_reg = CLK_HALT_CFPB_STATEA_REG, |
| 1858 | .halt_bit = 13, |
| 1859 | }, |
| 1860 | .parent = &usb_fs2_src_clk.c, |
| 1861 | .c = { |
| 1862 | .dbg_name = "usb_fs2_sys_clk", |
| 1863 | .ops = &clk_ops_branch, |
| 1864 | CLK_INIT(usb_fs2_sys_clk.c), |
| 1865 | }, |
| 1866 | }; |
| 1867 | |
| 1868 | /* Fast Peripheral Bus Clocks */ |
| 1869 | static struct branch_clk ce1_core_clk = { |
| 1870 | .b = { |
| 1871 | .ctl_reg = CE1_CORE_CLK_CTL_REG, |
| 1872 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 1873 | .hwcg_reg = CE1_CORE_CLK_CTL_REG, |
| 1874 | .hwcg_mask = BIT(6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1875 | .halt_reg = CLK_HALT_CFPB_STATEC_REG, |
| 1876 | .halt_bit = 27, |
| 1877 | }, |
| 1878 | .c = { |
| 1879 | .dbg_name = "ce1_core_clk", |
| 1880 | .ops = &clk_ops_branch, |
| 1881 | CLK_INIT(ce1_core_clk.c), |
| 1882 | }, |
| 1883 | }; |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 1884 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1885 | static struct branch_clk ce1_p_clk = { |
| 1886 | .b = { |
| 1887 | .ctl_reg = CE1_HCLK_CTL_REG, |
| 1888 | .en_mask = BIT(4), |
| 1889 | .halt_reg = CLK_HALT_CFPB_STATEC_REG, |
| 1890 | .halt_bit = 1, |
| 1891 | }, |
| 1892 | .c = { |
| 1893 | .dbg_name = "ce1_p_clk", |
| 1894 | .ops = &clk_ops_branch, |
| 1895 | CLK_INIT(ce1_p_clk.c), |
| 1896 | }, |
| 1897 | }; |
| 1898 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1899 | #define F_CE3(f, s, d) \ |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 1900 | { \ |
| 1901 | .freq_hz = f, \ |
| 1902 | .src_clk = &s##_clk.c, \ |
| 1903 | .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] | 1904 | } |
| 1905 | |
| 1906 | static struct clk_freq_tbl clk_tbl_ce3[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1907 | F_CE3( 0, gnd, 1), |
| 1908 | F_CE3( 48000000, pll8, 8), |
| 1909 | F_CE3(100000000, pll3, 12), |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 1910 | F_END |
| 1911 | }; |
| 1912 | |
| 1913 | static struct rcg_clk ce3_src_clk = { |
| 1914 | .b = { |
| 1915 | .ctl_reg = CE3_CLK_SRC_NS_REG, |
| 1916 | .halt_check = NOCHECK, |
| 1917 | }, |
| 1918 | .ns_reg = CE3_CLK_SRC_NS_REG, |
| 1919 | .root_en_mask = BIT(7), |
| 1920 | .ns_mask = BM(6, 0), |
| 1921 | .set_rate = set_rate_nop, |
| 1922 | .freq_tbl = clk_tbl_ce3, |
| 1923 | .current_freq = &rcg_dummy_freq, |
| 1924 | .c = { |
| 1925 | .dbg_name = "ce3_src_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 1926 | .ops = &clk_ops_rcg, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 1927 | VDD_DIG_FMAX_MAP2(LOW, 50000000, NOMINAL, 100000000), |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 1928 | CLK_INIT(ce3_src_clk.c), |
| 1929 | }, |
| 1930 | }; |
| 1931 | |
| 1932 | static struct branch_clk ce3_core_clk = { |
| 1933 | .b = { |
| 1934 | .ctl_reg = CE3_CORE_CLK_CTL_REG, |
| 1935 | .en_mask = BIT(4), |
| 1936 | .reset_reg = CE3_CORE_CLK_CTL_REG, |
| 1937 | .reset_mask = BIT(7), |
| 1938 | .halt_reg = CLK_HALT_MSS_SMPSS_MISC_STATE_REG, |
| 1939 | .halt_bit = 5, |
| 1940 | }, |
| 1941 | .parent = &ce3_src_clk.c, |
| 1942 | .c = { |
| 1943 | .dbg_name = "ce3_core_clk", |
| 1944 | .ops = &clk_ops_branch, |
| 1945 | CLK_INIT(ce3_core_clk.c), |
| 1946 | } |
| 1947 | }; |
| 1948 | |
| 1949 | static struct branch_clk ce3_p_clk = { |
| 1950 | .b = { |
| 1951 | .ctl_reg = CE3_HCLK_CTL_REG, |
| 1952 | .en_mask = BIT(4), |
| 1953 | .reset_reg = CE3_HCLK_CTL_REG, |
| 1954 | .reset_mask = BIT(7), |
| 1955 | .halt_reg = CLK_HALT_AFAB_SFAB_STATEB_REG, |
| 1956 | .halt_bit = 16, |
| 1957 | }, |
| 1958 | .parent = &ce3_src_clk.c, |
| 1959 | .c = { |
| 1960 | .dbg_name = "ce3_p_clk", |
| 1961 | .ops = &clk_ops_branch, |
| 1962 | CLK_INIT(ce3_p_clk.c), |
| 1963 | } |
| 1964 | }; |
| 1965 | |
Tianyi Gou | 352955d | 2012-05-18 19:44:01 -0700 | [diff] [blame] | 1966 | #define F_SATA(f, s, d) \ |
| 1967 | { \ |
| 1968 | .freq_hz = f, \ |
| 1969 | .src_clk = &s##_clk.c, \ |
| 1970 | .ns_val = NS_DIVSRC(6, 3, d, 2, 0, s##_to_bb_mux), \ |
| 1971 | } |
| 1972 | |
| 1973 | static struct clk_freq_tbl clk_tbl_sata[] = { |
| 1974 | F_SATA( 0, gnd, 1), |
| 1975 | F_SATA( 48000000, pll8, 8), |
| 1976 | F_SATA(100000000, pll3, 12), |
| 1977 | F_END |
| 1978 | }; |
| 1979 | |
| 1980 | static struct rcg_clk sata_src_clk = { |
| 1981 | .b = { |
| 1982 | .ctl_reg = SATA_CLK_SRC_NS_REG, |
| 1983 | .halt_check = NOCHECK, |
| 1984 | }, |
| 1985 | .ns_reg = SATA_CLK_SRC_NS_REG, |
| 1986 | .root_en_mask = BIT(7), |
| 1987 | .ns_mask = BM(6, 0), |
| 1988 | .set_rate = set_rate_nop, |
| 1989 | .freq_tbl = clk_tbl_sata, |
| 1990 | .current_freq = &rcg_dummy_freq, |
| 1991 | .c = { |
| 1992 | .dbg_name = "sata_src_clk", |
| 1993 | .ops = &clk_ops_rcg, |
| 1994 | VDD_DIG_FMAX_MAP2(LOW, 50000000, NOMINAL, 100000000), |
| 1995 | CLK_INIT(sata_src_clk.c), |
| 1996 | }, |
| 1997 | }; |
| 1998 | |
| 1999 | static struct branch_clk sata_rxoob_clk = { |
| 2000 | .b = { |
| 2001 | .ctl_reg = SATA_RXOOB_CLK_CTL_REG, |
| 2002 | .en_mask = BIT(4), |
| 2003 | .halt_reg = CLK_HALT_MSS_SMPSS_MISC_STATE_REG, |
| 2004 | .halt_bit = 26, |
| 2005 | }, |
| 2006 | .parent = &sata_src_clk.c, |
| 2007 | .c = { |
| 2008 | .dbg_name = "sata_rxoob_clk", |
| 2009 | .ops = &clk_ops_branch, |
| 2010 | CLK_INIT(sata_rxoob_clk.c), |
| 2011 | }, |
| 2012 | }; |
| 2013 | |
| 2014 | static struct branch_clk sata_pmalive_clk = { |
| 2015 | .b = { |
| 2016 | .ctl_reg = SATA_PMALIVE_CLK_CTL_REG, |
| 2017 | .en_mask = BIT(4), |
| 2018 | .halt_reg = CLK_HALT_MSS_SMPSS_MISC_STATE_REG, |
| 2019 | .halt_bit = 25, |
| 2020 | }, |
| 2021 | .parent = &sata_src_clk.c, |
| 2022 | .c = { |
| 2023 | .dbg_name = "sata_pmalive_clk", |
| 2024 | .ops = &clk_ops_branch, |
| 2025 | CLK_INIT(sata_pmalive_clk.c), |
| 2026 | }, |
| 2027 | }; |
| 2028 | |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 2029 | static struct branch_clk sata_phy_ref_clk = { |
| 2030 | .b = { |
| 2031 | .ctl_reg = SATA_PHY_REF_CLK_CTL_REG, |
| 2032 | .en_mask = BIT(4), |
| 2033 | .halt_reg = CLK_HALT_MSS_SMPSS_MISC_STATE_REG, |
| 2034 | .halt_bit = 24, |
| 2035 | }, |
| 2036 | .parent = &pxo_clk.c, |
| 2037 | .c = { |
| 2038 | .dbg_name = "sata_phy_ref_clk", |
| 2039 | .ops = &clk_ops_branch, |
| 2040 | CLK_INIT(sata_phy_ref_clk.c), |
| 2041 | }, |
| 2042 | }; |
| 2043 | |
Tianyi Gou | 352955d | 2012-05-18 19:44:01 -0700 | [diff] [blame] | 2044 | static struct branch_clk sata_a_clk = { |
| 2045 | .b = { |
| 2046 | .ctl_reg = SATA_ACLK_CTL_REG, |
| 2047 | .en_mask = BIT(4), |
| 2048 | .halt_reg = CLK_HALT_AFAB_SFAB_STATEA_REG, |
| 2049 | .halt_bit = 12, |
| 2050 | }, |
| 2051 | .c = { |
| 2052 | .dbg_name = "sata_a_clk", |
| 2053 | .ops = &clk_ops_branch, |
| 2054 | CLK_INIT(sata_a_clk.c), |
| 2055 | }, |
| 2056 | }; |
| 2057 | |
| 2058 | static struct branch_clk sata_p_clk = { |
| 2059 | .b = { |
| 2060 | .ctl_reg = SATA_HCLK_CTL_REG, |
| 2061 | .en_mask = BIT(4), |
| 2062 | .halt_reg = CLK_HALT_MSS_SMPSS_MISC_STATE_REG, |
| 2063 | .halt_bit = 27, |
| 2064 | }, |
| 2065 | .c = { |
| 2066 | .dbg_name = "sata_p_clk", |
| 2067 | .ops = &clk_ops_branch, |
| 2068 | CLK_INIT(sata_p_clk.c), |
| 2069 | }, |
| 2070 | }; |
| 2071 | |
| 2072 | static struct branch_clk sfab_sata_s_p_clk = { |
| 2073 | .b = { |
| 2074 | .ctl_reg = SFAB_SATA_S_HCLK_CTL_REG, |
| 2075 | .en_mask = BIT(4), |
| 2076 | .halt_reg = CLK_HALT_AFAB_SFAB_STATEB_REG, |
| 2077 | .halt_bit = 14, |
| 2078 | }, |
| 2079 | .c = { |
| 2080 | .dbg_name = "sfab_sata_s_p_clk", |
| 2081 | .ops = &clk_ops_branch, |
| 2082 | CLK_INIT(sfab_sata_s_p_clk.c), |
| 2083 | }, |
| 2084 | }; |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 2085 | static struct branch_clk pcie_p_clk = { |
| 2086 | .b = { |
| 2087 | .ctl_reg = PCIE_HCLK_CTL_REG, |
| 2088 | .en_mask = BIT(4), |
| 2089 | .halt_reg = CLK_HALT_CFPB_STATEC_REG, |
| 2090 | .halt_bit = 8, |
| 2091 | }, |
| 2092 | .c = { |
| 2093 | .dbg_name = "pcie_p_clk", |
| 2094 | .ops = &clk_ops_branch, |
| 2095 | CLK_INIT(pcie_p_clk.c), |
| 2096 | }, |
| 2097 | }; |
| 2098 | |
Tianyi Gou | 6613de5 | 2012-01-27 17:57:53 -0800 | [diff] [blame] | 2099 | static struct branch_clk pcie_phy_ref_clk = { |
| 2100 | .b = { |
| 2101 | .ctl_reg = PCIE_PCLK_CTL_REG, |
| 2102 | .en_mask = BIT(4), |
| 2103 | .halt_reg = CLK_HALT_MSS_SMPSS_MISC_STATE_REG, |
| 2104 | .halt_bit = 29, |
| 2105 | }, |
| 2106 | .c = { |
| 2107 | .dbg_name = "pcie_phy_ref_clk", |
| 2108 | .ops = &clk_ops_branch, |
| 2109 | CLK_INIT(pcie_phy_ref_clk.c), |
| 2110 | }, |
| 2111 | }; |
| 2112 | |
| 2113 | static struct branch_clk pcie_a_clk = { |
| 2114 | .b = { |
| 2115 | .ctl_reg = PCIE_ACLK_CTL_REG, |
| 2116 | .en_mask = BIT(4), |
| 2117 | .halt_reg = CLK_HALT_AFAB_SFAB_STATEA_REG, |
| 2118 | .halt_bit = 13, |
| 2119 | }, |
| 2120 | .c = { |
| 2121 | .dbg_name = "pcie_a_clk", |
| 2122 | .ops = &clk_ops_branch, |
| 2123 | CLK_INIT(pcie_a_clk.c), |
| 2124 | }, |
| 2125 | }; |
| 2126 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2127 | static struct branch_clk dma_bam_p_clk = { |
| 2128 | .b = { |
| 2129 | .ctl_reg = DMA_BAM_HCLK_CTL, |
| 2130 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 2131 | .hwcg_reg = DMA_BAM_HCLK_CTL, |
| 2132 | .hwcg_mask = BIT(6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2133 | .halt_reg = CLK_HALT_DFAB_STATE_REG, |
| 2134 | .halt_bit = 12, |
| 2135 | }, |
| 2136 | .c = { |
| 2137 | .dbg_name = "dma_bam_p_clk", |
| 2138 | .ops = &clk_ops_branch, |
| 2139 | CLK_INIT(dma_bam_p_clk.c), |
| 2140 | }, |
| 2141 | }; |
| 2142 | |
| 2143 | static struct branch_clk gsbi1_p_clk = { |
| 2144 | .b = { |
| 2145 | .ctl_reg = GSBIn_HCLK_CTL_REG(1), |
| 2146 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 2147 | .hwcg_reg = GSBIn_HCLK_CTL_REG(1), |
| 2148 | .hwcg_mask = BIT(6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2149 | .halt_reg = CLK_HALT_CFPB_STATEA_REG, |
| 2150 | .halt_bit = 11, |
| 2151 | }, |
| 2152 | .c = { |
| 2153 | .dbg_name = "gsbi1_p_clk", |
| 2154 | .ops = &clk_ops_branch, |
| 2155 | CLK_INIT(gsbi1_p_clk.c), |
| 2156 | }, |
| 2157 | }; |
| 2158 | |
| 2159 | static struct branch_clk gsbi2_p_clk = { |
| 2160 | .b = { |
| 2161 | .ctl_reg = GSBIn_HCLK_CTL_REG(2), |
| 2162 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 2163 | .hwcg_reg = GSBIn_HCLK_CTL_REG(2), |
| 2164 | .hwcg_mask = BIT(6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2165 | .halt_reg = CLK_HALT_CFPB_STATEA_REG, |
| 2166 | .halt_bit = 7, |
| 2167 | }, |
| 2168 | .c = { |
| 2169 | .dbg_name = "gsbi2_p_clk", |
| 2170 | .ops = &clk_ops_branch, |
| 2171 | CLK_INIT(gsbi2_p_clk.c), |
| 2172 | }, |
| 2173 | }; |
| 2174 | |
| 2175 | static struct branch_clk gsbi3_p_clk = { |
| 2176 | .b = { |
| 2177 | .ctl_reg = GSBIn_HCLK_CTL_REG(3), |
| 2178 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 2179 | .hwcg_reg = GSBIn_HCLK_CTL_REG(3), |
| 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 = 3, |
| 2183 | }, |
| 2184 | .c = { |
| 2185 | .dbg_name = "gsbi3_p_clk", |
| 2186 | .ops = &clk_ops_branch, |
| 2187 | CLK_INIT(gsbi3_p_clk.c), |
| 2188 | }, |
| 2189 | }; |
| 2190 | |
| 2191 | static struct branch_clk gsbi4_p_clk = { |
| 2192 | .b = { |
| 2193 | .ctl_reg = GSBIn_HCLK_CTL_REG(4), |
| 2194 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 2195 | .hwcg_reg = GSBIn_HCLK_CTL_REG(4), |
| 2196 | .hwcg_mask = BIT(6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2197 | .halt_reg = CLK_HALT_CFPB_STATEB_REG, |
| 2198 | .halt_bit = 27, |
| 2199 | }, |
| 2200 | .c = { |
| 2201 | .dbg_name = "gsbi4_p_clk", |
| 2202 | .ops = &clk_ops_branch, |
| 2203 | CLK_INIT(gsbi4_p_clk.c), |
| 2204 | }, |
| 2205 | }; |
| 2206 | |
| 2207 | static struct branch_clk gsbi5_p_clk = { |
| 2208 | .b = { |
| 2209 | .ctl_reg = GSBIn_HCLK_CTL_REG(5), |
| 2210 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 2211 | .hwcg_reg = GSBIn_HCLK_CTL_REG(5), |
| 2212 | .hwcg_mask = BIT(6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2213 | .halt_reg = CLK_HALT_CFPB_STATEB_REG, |
| 2214 | .halt_bit = 23, |
| 2215 | }, |
| 2216 | .c = { |
| 2217 | .dbg_name = "gsbi5_p_clk", |
| 2218 | .ops = &clk_ops_branch, |
| 2219 | CLK_INIT(gsbi5_p_clk.c), |
| 2220 | }, |
| 2221 | }; |
| 2222 | |
| 2223 | static struct branch_clk gsbi6_p_clk = { |
| 2224 | .b = { |
| 2225 | .ctl_reg = GSBIn_HCLK_CTL_REG(6), |
| 2226 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 2227 | .hwcg_reg = GSBIn_HCLK_CTL_REG(6), |
| 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 = 19, |
| 2231 | }, |
| 2232 | .c = { |
| 2233 | .dbg_name = "gsbi6_p_clk", |
| 2234 | .ops = &clk_ops_branch, |
| 2235 | CLK_INIT(gsbi6_p_clk.c), |
| 2236 | }, |
| 2237 | }; |
| 2238 | |
| 2239 | static struct branch_clk gsbi7_p_clk = { |
| 2240 | .b = { |
| 2241 | .ctl_reg = GSBIn_HCLK_CTL_REG(7), |
| 2242 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 2243 | .hwcg_reg = GSBIn_HCLK_CTL_REG(7), |
| 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 = 15, |
| 2247 | }, |
| 2248 | .c = { |
| 2249 | .dbg_name = "gsbi7_p_clk", |
| 2250 | .ops = &clk_ops_branch, |
| 2251 | CLK_INIT(gsbi7_p_clk.c), |
| 2252 | }, |
| 2253 | }; |
| 2254 | |
| 2255 | static struct branch_clk gsbi8_p_clk = { |
| 2256 | .b = { |
| 2257 | .ctl_reg = GSBIn_HCLK_CTL_REG(8), |
| 2258 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 2259 | .hwcg_reg = GSBIn_HCLK_CTL_REG(8), |
| 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 = 11, |
| 2263 | }, |
| 2264 | .c = { |
| 2265 | .dbg_name = "gsbi8_p_clk", |
| 2266 | .ops = &clk_ops_branch, |
| 2267 | CLK_INIT(gsbi8_p_clk.c), |
| 2268 | }, |
| 2269 | }; |
| 2270 | |
| 2271 | static struct branch_clk gsbi9_p_clk = { |
| 2272 | .b = { |
| 2273 | .ctl_reg = GSBIn_HCLK_CTL_REG(9), |
| 2274 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 2275 | .hwcg_reg = GSBIn_HCLK_CTL_REG(9), |
| 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 = 7, |
| 2279 | }, |
| 2280 | .c = { |
| 2281 | .dbg_name = "gsbi9_p_clk", |
| 2282 | .ops = &clk_ops_branch, |
| 2283 | CLK_INIT(gsbi9_p_clk.c), |
| 2284 | }, |
| 2285 | }; |
| 2286 | |
| 2287 | static struct branch_clk gsbi10_p_clk = { |
| 2288 | .b = { |
| 2289 | .ctl_reg = GSBIn_HCLK_CTL_REG(10), |
| 2290 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 2291 | .hwcg_reg = GSBIn_HCLK_CTL_REG(10), |
| 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 = 3, |
| 2295 | }, |
| 2296 | .c = { |
| 2297 | .dbg_name = "gsbi10_p_clk", |
| 2298 | .ops = &clk_ops_branch, |
| 2299 | CLK_INIT(gsbi10_p_clk.c), |
| 2300 | }, |
| 2301 | }; |
| 2302 | |
| 2303 | static struct branch_clk gsbi11_p_clk = { |
| 2304 | .b = { |
| 2305 | .ctl_reg = GSBIn_HCLK_CTL_REG(11), |
| 2306 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 2307 | .hwcg_reg = GSBIn_HCLK_CTL_REG(11), |
| 2308 | .hwcg_mask = BIT(6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2309 | .halt_reg = CLK_HALT_CFPB_STATEC_REG, |
| 2310 | .halt_bit = 18, |
| 2311 | }, |
| 2312 | .c = { |
| 2313 | .dbg_name = "gsbi11_p_clk", |
| 2314 | .ops = &clk_ops_branch, |
| 2315 | CLK_INIT(gsbi11_p_clk.c), |
| 2316 | }, |
| 2317 | }; |
| 2318 | |
| 2319 | static struct branch_clk gsbi12_p_clk = { |
| 2320 | .b = { |
| 2321 | .ctl_reg = GSBIn_HCLK_CTL_REG(12), |
| 2322 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 2323 | .hwcg_reg = GSBIn_HCLK_CTL_REG(12), |
| 2324 | .hwcg_mask = BIT(6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2325 | .halt_reg = CLK_HALT_CFPB_STATEC_REG, |
| 2326 | .halt_bit = 14, |
| 2327 | }, |
| 2328 | .c = { |
| 2329 | .dbg_name = "gsbi12_p_clk", |
| 2330 | .ops = &clk_ops_branch, |
| 2331 | CLK_INIT(gsbi12_p_clk.c), |
| 2332 | }, |
| 2333 | }; |
| 2334 | |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 2335 | static struct branch_clk sata_phy_cfg_clk = { |
| 2336 | .b = { |
| 2337 | .ctl_reg = SATA_PHY_CFG_CLK_CTL_REG, |
| 2338 | .en_mask = BIT(4), |
| 2339 | .halt_reg = CLK_HALT_CFPB_STATEA_REG, |
| 2340 | .halt_bit = 12, |
| 2341 | }, |
| 2342 | .c = { |
| 2343 | .dbg_name = "sata_phy_cfg_clk", |
| 2344 | .ops = &clk_ops_branch, |
| 2345 | CLK_INIT(sata_phy_cfg_clk.c), |
Stephen Boyd | 973e4ba | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 2346 | }, |
| 2347 | }; |
| 2348 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2349 | static struct branch_clk tsif_p_clk = { |
| 2350 | .b = { |
| 2351 | .ctl_reg = TSIF_HCLK_CTL_REG, |
| 2352 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 2353 | .hwcg_reg = TSIF_HCLK_CTL_REG, |
| 2354 | .hwcg_mask = BIT(6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2355 | .halt_reg = CLK_HALT_CFPB_STATEC_REG, |
| 2356 | .halt_bit = 7, |
| 2357 | }, |
| 2358 | .c = { |
| 2359 | .dbg_name = "tsif_p_clk", |
| 2360 | .ops = &clk_ops_branch, |
| 2361 | CLK_INIT(tsif_p_clk.c), |
| 2362 | }, |
| 2363 | }; |
| 2364 | |
| 2365 | static struct branch_clk usb_fs1_p_clk = { |
| 2366 | .b = { |
| 2367 | .ctl_reg = USB_FSn_HCLK_CTL_REG(1), |
| 2368 | .en_mask = BIT(4), |
| 2369 | .halt_reg = CLK_HALT_CFPB_STATEA_REG, |
| 2370 | .halt_bit = 17, |
| 2371 | }, |
| 2372 | .c = { |
| 2373 | .dbg_name = "usb_fs1_p_clk", |
| 2374 | .ops = &clk_ops_branch, |
| 2375 | CLK_INIT(usb_fs1_p_clk.c), |
| 2376 | }, |
| 2377 | }; |
| 2378 | |
| 2379 | static struct branch_clk usb_fs2_p_clk = { |
| 2380 | .b = { |
| 2381 | .ctl_reg = USB_FSn_HCLK_CTL_REG(2), |
| 2382 | .en_mask = BIT(4), |
| 2383 | .halt_reg = CLK_HALT_CFPB_STATEA_REG, |
| 2384 | .halt_bit = 14, |
| 2385 | }, |
| 2386 | .c = { |
| 2387 | .dbg_name = "usb_fs2_p_clk", |
| 2388 | .ops = &clk_ops_branch, |
| 2389 | CLK_INIT(usb_fs2_p_clk.c), |
| 2390 | }, |
| 2391 | }; |
| 2392 | |
| 2393 | static struct branch_clk usb_hs1_p_clk = { |
| 2394 | .b = { |
| 2395 | .ctl_reg = USB_HS1_HCLK_CTL_REG, |
| 2396 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 2397 | .hwcg_reg = USB_HS1_HCLK_CTL_REG, |
| 2398 | .hwcg_mask = BIT(6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2399 | .halt_reg = CLK_HALT_DFAB_STATE_REG, |
| 2400 | .halt_bit = 1, |
| 2401 | }, |
| 2402 | .c = { |
| 2403 | .dbg_name = "usb_hs1_p_clk", |
| 2404 | .ops = &clk_ops_branch, |
| 2405 | CLK_INIT(usb_hs1_p_clk.c), |
| 2406 | }, |
| 2407 | }; |
| 2408 | |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 2409 | static struct branch_clk usb_hs3_p_clk = { |
| 2410 | .b = { |
| 2411 | .ctl_reg = USB_HS3_HCLK_CTL_REG, |
| 2412 | .en_mask = BIT(4), |
| 2413 | .halt_reg = CLK_HALT_DFAB_STATE_REG, |
| 2414 | .halt_bit = 31, |
| 2415 | }, |
| 2416 | .c = { |
| 2417 | .dbg_name = "usb_hs3_p_clk", |
| 2418 | .ops = &clk_ops_branch, |
| 2419 | CLK_INIT(usb_hs3_p_clk.c), |
| 2420 | }, |
| 2421 | }; |
| 2422 | |
| 2423 | static struct branch_clk usb_hs4_p_clk = { |
| 2424 | .b = { |
| 2425 | .ctl_reg = USB_HS4_HCLK_CTL_REG, |
| 2426 | .en_mask = BIT(4), |
| 2427 | .halt_reg = CLK_HALT_DFAB_STATE_REG, |
| 2428 | .halt_bit = 7, |
| 2429 | }, |
| 2430 | .c = { |
| 2431 | .dbg_name = "usb_hs4_p_clk", |
| 2432 | .ops = &clk_ops_branch, |
| 2433 | CLK_INIT(usb_hs4_p_clk.c), |
| 2434 | }, |
| 2435 | }; |
| 2436 | |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 2437 | static struct branch_clk usb_hsic_p_clk = { |
| 2438 | .b = { |
| 2439 | .ctl_reg = USB_HSIC_HCLK_CTL_REG, |
| 2440 | .en_mask = BIT(4), |
| 2441 | .halt_reg = CLK_HALT_CFPB_STATEA_REG, |
| 2442 | .halt_bit = 28, |
| 2443 | }, |
| 2444 | .c = { |
| 2445 | .dbg_name = "usb_hsic_p_clk", |
| 2446 | .ops = &clk_ops_branch, |
| 2447 | CLK_INIT(usb_hsic_p_clk.c), |
| 2448 | }, |
| 2449 | }; |
| 2450 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2451 | static struct branch_clk sdc1_p_clk = { |
| 2452 | .b = { |
| 2453 | .ctl_reg = SDCn_HCLK_CTL_REG(1), |
| 2454 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 2455 | .hwcg_reg = SDCn_HCLK_CTL_REG(1), |
| 2456 | .hwcg_mask = BIT(6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2457 | .halt_reg = CLK_HALT_DFAB_STATE_REG, |
| 2458 | .halt_bit = 11, |
| 2459 | }, |
| 2460 | .c = { |
| 2461 | .dbg_name = "sdc1_p_clk", |
| 2462 | .ops = &clk_ops_branch, |
| 2463 | CLK_INIT(sdc1_p_clk.c), |
| 2464 | }, |
| 2465 | }; |
| 2466 | |
| 2467 | static struct branch_clk sdc2_p_clk = { |
| 2468 | .b = { |
| 2469 | .ctl_reg = SDCn_HCLK_CTL_REG(2), |
| 2470 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 2471 | .hwcg_reg = SDCn_HCLK_CTL_REG(2), |
| 2472 | .hwcg_mask = BIT(6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2473 | .halt_reg = CLK_HALT_DFAB_STATE_REG, |
| 2474 | .halt_bit = 10, |
| 2475 | }, |
| 2476 | .c = { |
| 2477 | .dbg_name = "sdc2_p_clk", |
| 2478 | .ops = &clk_ops_branch, |
| 2479 | CLK_INIT(sdc2_p_clk.c), |
| 2480 | }, |
| 2481 | }; |
| 2482 | |
| 2483 | static struct branch_clk sdc3_p_clk = { |
| 2484 | .b = { |
| 2485 | .ctl_reg = SDCn_HCLK_CTL_REG(3), |
| 2486 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 2487 | .hwcg_reg = SDCn_HCLK_CTL_REG(3), |
| 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 = 9, |
| 2491 | }, |
| 2492 | .c = { |
| 2493 | .dbg_name = "sdc3_p_clk", |
| 2494 | .ops = &clk_ops_branch, |
| 2495 | CLK_INIT(sdc3_p_clk.c), |
| 2496 | }, |
| 2497 | }; |
| 2498 | |
| 2499 | static struct branch_clk sdc4_p_clk = { |
| 2500 | .b = { |
| 2501 | .ctl_reg = SDCn_HCLK_CTL_REG(4), |
| 2502 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 2503 | .hwcg_reg = SDCn_HCLK_CTL_REG(4), |
| 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 = 8, |
| 2507 | }, |
| 2508 | .c = { |
| 2509 | .dbg_name = "sdc4_p_clk", |
| 2510 | .ops = &clk_ops_branch, |
| 2511 | CLK_INIT(sdc4_p_clk.c), |
| 2512 | }, |
| 2513 | }; |
| 2514 | |
| 2515 | static struct branch_clk sdc5_p_clk = { |
| 2516 | .b = { |
| 2517 | .ctl_reg = SDCn_HCLK_CTL_REG(5), |
| 2518 | .en_mask = BIT(4), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 2519 | .hwcg_reg = SDCn_HCLK_CTL_REG(5), |
| 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 = 7, |
| 2523 | }, |
| 2524 | .c = { |
| 2525 | .dbg_name = "sdc5_p_clk", |
| 2526 | .ops = &clk_ops_branch, |
| 2527 | CLK_INIT(sdc5_p_clk.c), |
| 2528 | }, |
| 2529 | }; |
| 2530 | |
| 2531 | /* HW-Voteable Clocks */ |
| 2532 | static struct branch_clk adm0_clk = { |
| 2533 | .b = { |
| 2534 | .ctl_reg = SC0_U_CLK_BRANCH_ENA_VOTE_REG, |
| 2535 | .en_mask = BIT(2), |
| 2536 | .halt_reg = CLK_HALT_MSS_SMPSS_MISC_STATE_REG, |
| 2537 | .halt_check = HALT_VOTED, |
| 2538 | .halt_bit = 14, |
| 2539 | }, |
| 2540 | .c = { |
| 2541 | .dbg_name = "adm0_clk", |
| 2542 | .ops = &clk_ops_branch, |
| 2543 | CLK_INIT(adm0_clk.c), |
| 2544 | }, |
| 2545 | }; |
| 2546 | |
| 2547 | static struct branch_clk adm0_p_clk = { |
| 2548 | .b = { |
| 2549 | .ctl_reg = SC0_U_CLK_BRANCH_ENA_VOTE_REG, |
| 2550 | .en_mask = BIT(3), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 2551 | .hwcg_reg = ADM0_PBUS_CLK_CTL_REG, |
| 2552 | .hwcg_mask = BIT(6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2553 | .halt_reg = CLK_HALT_MSS_SMPSS_MISC_STATE_REG, |
| 2554 | .halt_check = HALT_VOTED, |
| 2555 | .halt_bit = 13, |
| 2556 | }, |
| 2557 | .c = { |
| 2558 | .dbg_name = "adm0_p_clk", |
| 2559 | .ops = &clk_ops_branch, |
| 2560 | CLK_INIT(adm0_p_clk.c), |
| 2561 | }, |
| 2562 | }; |
| 2563 | |
| 2564 | static struct branch_clk pmic_arb0_p_clk = { |
| 2565 | .b = { |
| 2566 | .ctl_reg = SC0_U_CLK_BRANCH_ENA_VOTE_REG, |
| 2567 | .en_mask = BIT(8), |
| 2568 | .halt_reg = CLK_HALT_SFPB_MISC_STATE_REG, |
| 2569 | .halt_check = HALT_VOTED, |
| 2570 | .halt_bit = 22, |
| 2571 | }, |
| 2572 | .c = { |
| 2573 | .dbg_name = "pmic_arb0_p_clk", |
| 2574 | .ops = &clk_ops_branch, |
| 2575 | CLK_INIT(pmic_arb0_p_clk.c), |
| 2576 | }, |
| 2577 | }; |
| 2578 | |
| 2579 | static struct branch_clk pmic_arb1_p_clk = { |
| 2580 | .b = { |
| 2581 | .ctl_reg = SC0_U_CLK_BRANCH_ENA_VOTE_REG, |
| 2582 | .en_mask = BIT(9), |
| 2583 | .halt_reg = CLK_HALT_SFPB_MISC_STATE_REG, |
| 2584 | .halt_check = HALT_VOTED, |
| 2585 | .halt_bit = 21, |
| 2586 | }, |
| 2587 | .c = { |
| 2588 | .dbg_name = "pmic_arb1_p_clk", |
| 2589 | .ops = &clk_ops_branch, |
| 2590 | CLK_INIT(pmic_arb1_p_clk.c), |
| 2591 | }, |
| 2592 | }; |
| 2593 | |
| 2594 | static struct branch_clk pmic_ssbi2_clk = { |
| 2595 | .b = { |
| 2596 | .ctl_reg = SC0_U_CLK_BRANCH_ENA_VOTE_REG, |
| 2597 | .en_mask = BIT(7), |
| 2598 | .halt_reg = CLK_HALT_SFPB_MISC_STATE_REG, |
| 2599 | .halt_check = HALT_VOTED, |
| 2600 | .halt_bit = 23, |
| 2601 | }, |
| 2602 | .c = { |
| 2603 | .dbg_name = "pmic_ssbi2_clk", |
| 2604 | .ops = &clk_ops_branch, |
| 2605 | CLK_INIT(pmic_ssbi2_clk.c), |
| 2606 | }, |
| 2607 | }; |
| 2608 | |
| 2609 | static struct branch_clk rpm_msg_ram_p_clk = { |
| 2610 | .b = { |
| 2611 | .ctl_reg = SC0_U_CLK_BRANCH_ENA_VOTE_REG, |
| 2612 | .en_mask = BIT(6), |
Stephen Boyd | a52d7e3 | 2011-11-10 11:59:00 -0800 | [diff] [blame] | 2613 | .hwcg_reg = RPM_MSG_RAM_HCLK_CTL_REG, |
| 2614 | .hwcg_mask = BIT(6), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2615 | .halt_reg = CLK_HALT_SFPB_MISC_STATE_REG, |
| 2616 | .halt_check = HALT_VOTED, |
| 2617 | .halt_bit = 12, |
| 2618 | }, |
| 2619 | .c = { |
| 2620 | .dbg_name = "rpm_msg_ram_p_clk", |
| 2621 | .ops = &clk_ops_branch, |
| 2622 | CLK_INIT(rpm_msg_ram_p_clk.c), |
| 2623 | }, |
| 2624 | }; |
| 2625 | |
| 2626 | /* |
| 2627 | * Multimedia Clocks |
| 2628 | */ |
| 2629 | |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 2630 | #define CLK_CAM(name, n, hb) \ |
| 2631 | struct rcg_clk name = { \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2632 | .b = { \ |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 2633 | .ctl_reg = CAMCLK##n##_CC_REG, \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2634 | .en_mask = BIT(0), \ |
| 2635 | .halt_reg = DBG_BUS_VEC_I_REG, \ |
| 2636 | .halt_bit = hb, \ |
| 2637 | }, \ |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 2638 | .ns_reg = CAMCLK##n##_NS_REG, \ |
| 2639 | .md_reg = CAMCLK##n##_MD_REG, \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2640 | .root_en_mask = BIT(2), \ |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 2641 | .ns_mask = BM(31, 24) | BM(15, 14) | BM(2, 0), \ |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame] | 2642 | .mnd_en_mask = BIT(5), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2643 | .ctl_mask = BM(7, 6), \ |
| 2644 | .set_rate = set_rate_mnd_8, \ |
| 2645 | .freq_tbl = clk_tbl_cam, \ |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 2646 | .current_freq = &rcg_dummy_freq, \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2647 | .c = { \ |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 2648 | .dbg_name = #name, \ |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 2649 | .ops = &clk_ops_rcg, \ |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 2650 | VDD_DIG_FMAX_MAP2(LOW, 64000000, NOMINAL, 128000000), \ |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 2651 | CLK_INIT(name.c), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2652 | }, \ |
| 2653 | } |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 2654 | #define F_CAM(f, s, d, m, n) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2655 | { \ |
| 2656 | .freq_hz = f, \ |
| 2657 | .src_clk = &s##_clk.c, \ |
| 2658 | .md_val = MD8(8, m, 0, n), \ |
| 2659 | .ns_val = NS_MM(31, 24, n, m, 15, 14, d, 2, 0, s##_to_mm_mux), \ |
| 2660 | .ctl_val = CC(6, n), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2661 | } |
| 2662 | static struct clk_freq_tbl clk_tbl_cam[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 2663 | F_CAM( 0, gnd, 1, 0, 0), |
| 2664 | F_CAM( 6000000, pll8, 4, 1, 16), |
| 2665 | F_CAM( 8000000, pll8, 4, 1, 12), |
| 2666 | F_CAM( 12000000, pll8, 4, 1, 8), |
| 2667 | F_CAM( 16000000, pll8, 4, 1, 6), |
| 2668 | F_CAM( 19200000, pll8, 4, 1, 5), |
| 2669 | F_CAM( 24000000, pll8, 4, 1, 4), |
| 2670 | F_CAM( 32000000, pll8, 4, 1, 3), |
| 2671 | F_CAM( 48000000, pll8, 4, 1, 2), |
| 2672 | F_CAM( 64000000, pll8, 3, 1, 2), |
| 2673 | F_CAM( 96000000, pll8, 4, 0, 0), |
| 2674 | F_CAM(128000000, pll8, 3, 0, 0), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2675 | F_END |
| 2676 | }; |
| 2677 | |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 2678 | static CLK_CAM(cam0_clk, 0, 15); |
| 2679 | static CLK_CAM(cam1_clk, 1, 16); |
| 2680 | static CLK_CAM(cam2_clk, 2, 31); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2681 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 2682 | #define F_CSI(f, s, d, m, n) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2683 | { \ |
| 2684 | .freq_hz = f, \ |
| 2685 | .src_clk = &s##_clk.c, \ |
| 2686 | .md_val = MD8(8, m, 0, n), \ |
| 2687 | .ns_val = NS_MM(31, 24, n, m, 15, 14, d, 2, 0, s##_to_mm_mux), \ |
| 2688 | .ctl_val = CC(6, n), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2689 | } |
| 2690 | static struct clk_freq_tbl clk_tbl_csi[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 2691 | F_CSI( 0, gnd, 1, 0, 0), |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 2692 | F_CSI( 27000000, pxo, 1, 0, 0), |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 2693 | F_CSI( 85330000, pll8, 1, 2, 9), |
| 2694 | F_CSI(177780000, pll2, 1, 2, 9), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2695 | F_END |
| 2696 | }; |
| 2697 | |
| 2698 | static struct rcg_clk csi0_src_clk = { |
| 2699 | .ns_reg = CSI0_NS_REG, |
| 2700 | .b = { |
| 2701 | .ctl_reg = CSI0_CC_REG, |
| 2702 | .halt_check = NOCHECK, |
| 2703 | }, |
| 2704 | .md_reg = CSI0_MD_REG, |
| 2705 | .root_en_mask = BIT(2), |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 2706 | .ns_mask = BM(31, 24) | BM(15, 14) | BM(2, 0), |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame] | 2707 | .mnd_en_mask = BIT(5), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2708 | .ctl_mask = BM(7, 6), |
| 2709 | .set_rate = set_rate_mnd, |
| 2710 | .freq_tbl = clk_tbl_csi, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 2711 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2712 | .c = { |
| 2713 | .dbg_name = "csi0_src_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 2714 | .ops = &clk_ops_rcg, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 2715 | VDD_DIG_FMAX_MAP2(LOW, 86000000, NOMINAL, 178000000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2716 | CLK_INIT(csi0_src_clk.c), |
| 2717 | }, |
| 2718 | }; |
| 2719 | |
| 2720 | static struct branch_clk csi0_clk = { |
| 2721 | .b = { |
| 2722 | .ctl_reg = CSI0_CC_REG, |
| 2723 | .en_mask = BIT(0), |
| 2724 | .reset_reg = SW_RESET_CORE_REG, |
| 2725 | .reset_mask = BIT(8), |
| 2726 | .halt_reg = DBG_BUS_VEC_B_REG, |
| 2727 | .halt_bit = 13, |
| 2728 | }, |
| 2729 | .parent = &csi0_src_clk.c, |
| 2730 | .c = { |
| 2731 | .dbg_name = "csi0_clk", |
| 2732 | .ops = &clk_ops_branch, |
| 2733 | CLK_INIT(csi0_clk.c), |
| 2734 | }, |
| 2735 | }; |
| 2736 | |
| 2737 | static struct branch_clk csi0_phy_clk = { |
| 2738 | .b = { |
| 2739 | .ctl_reg = CSI0_CC_REG, |
| 2740 | .en_mask = BIT(8), |
| 2741 | .reset_reg = SW_RESET_CORE_REG, |
| 2742 | .reset_mask = BIT(29), |
| 2743 | .halt_reg = DBG_BUS_VEC_I_REG, |
| 2744 | .halt_bit = 9, |
| 2745 | }, |
| 2746 | .parent = &csi0_src_clk.c, |
| 2747 | .c = { |
| 2748 | .dbg_name = "csi0_phy_clk", |
| 2749 | .ops = &clk_ops_branch, |
| 2750 | CLK_INIT(csi0_phy_clk.c), |
| 2751 | }, |
| 2752 | }; |
| 2753 | |
| 2754 | static struct rcg_clk csi1_src_clk = { |
| 2755 | .ns_reg = CSI1_NS_REG, |
| 2756 | .b = { |
| 2757 | .ctl_reg = CSI1_CC_REG, |
| 2758 | .halt_check = NOCHECK, |
| 2759 | }, |
| 2760 | .md_reg = CSI1_MD_REG, |
| 2761 | .root_en_mask = BIT(2), |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 2762 | .ns_mask = BM(31, 24) | BM(15, 14) | BM(2, 0), |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame] | 2763 | .mnd_en_mask = BIT(5), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2764 | .ctl_mask = BM(7, 6), |
| 2765 | .set_rate = set_rate_mnd, |
| 2766 | .freq_tbl = clk_tbl_csi, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 2767 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2768 | .c = { |
| 2769 | .dbg_name = "csi1_src_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 2770 | .ops = &clk_ops_rcg, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 2771 | VDD_DIG_FMAX_MAP2(LOW, 86000000, NOMINAL, 178000000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2772 | CLK_INIT(csi1_src_clk.c), |
| 2773 | }, |
| 2774 | }; |
| 2775 | |
| 2776 | static struct branch_clk csi1_clk = { |
| 2777 | .b = { |
| 2778 | .ctl_reg = CSI1_CC_REG, |
| 2779 | .en_mask = BIT(0), |
| 2780 | .reset_reg = SW_RESET_CORE_REG, |
| 2781 | .reset_mask = BIT(18), |
| 2782 | .halt_reg = DBG_BUS_VEC_B_REG, |
| 2783 | .halt_bit = 14, |
| 2784 | }, |
| 2785 | .parent = &csi1_src_clk.c, |
| 2786 | .c = { |
| 2787 | .dbg_name = "csi1_clk", |
| 2788 | .ops = &clk_ops_branch, |
| 2789 | CLK_INIT(csi1_clk.c), |
| 2790 | }, |
| 2791 | }; |
| 2792 | |
| 2793 | static struct branch_clk csi1_phy_clk = { |
| 2794 | .b = { |
| 2795 | .ctl_reg = CSI1_CC_REG, |
| 2796 | .en_mask = BIT(8), |
| 2797 | .reset_reg = SW_RESET_CORE_REG, |
| 2798 | .reset_mask = BIT(28), |
| 2799 | .halt_reg = DBG_BUS_VEC_I_REG, |
| 2800 | .halt_bit = 10, |
| 2801 | }, |
| 2802 | .parent = &csi1_src_clk.c, |
| 2803 | .c = { |
| 2804 | .dbg_name = "csi1_phy_clk", |
| 2805 | .ops = &clk_ops_branch, |
| 2806 | CLK_INIT(csi1_phy_clk.c), |
| 2807 | }, |
| 2808 | }; |
| 2809 | |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 2810 | static struct rcg_clk csi2_src_clk = { |
| 2811 | .ns_reg = CSI2_NS_REG, |
| 2812 | .b = { |
| 2813 | .ctl_reg = CSI2_CC_REG, |
| 2814 | .halt_check = NOCHECK, |
| 2815 | }, |
| 2816 | .md_reg = CSI2_MD_REG, |
| 2817 | .root_en_mask = BIT(2), |
| 2818 | .ns_mask = BM(31, 24) | BM(15, 14) | BM(2, 0), |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame] | 2819 | .mnd_en_mask = BIT(5), |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 2820 | .ctl_mask = BM(7, 6), |
| 2821 | .set_rate = set_rate_mnd, |
| 2822 | .freq_tbl = clk_tbl_csi, |
| 2823 | .current_freq = &rcg_dummy_freq, |
| 2824 | .c = { |
| 2825 | .dbg_name = "csi2_src_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 2826 | .ops = &clk_ops_rcg, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 2827 | VDD_DIG_FMAX_MAP2(LOW, 86000000, NOMINAL, 178000000), |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 2828 | CLK_INIT(csi2_src_clk.c), |
| 2829 | }, |
| 2830 | }; |
| 2831 | |
| 2832 | static struct branch_clk csi2_clk = { |
| 2833 | .b = { |
| 2834 | .ctl_reg = CSI2_CC_REG, |
| 2835 | .en_mask = BIT(0), |
| 2836 | .reset_reg = SW_RESET_CORE2_REG, |
| 2837 | .reset_mask = BIT(2), |
| 2838 | .halt_reg = DBG_BUS_VEC_B_REG, |
| 2839 | .halt_bit = 29, |
| 2840 | }, |
| 2841 | .parent = &csi2_src_clk.c, |
| 2842 | .c = { |
| 2843 | .dbg_name = "csi2_clk", |
| 2844 | .ops = &clk_ops_branch, |
| 2845 | CLK_INIT(csi2_clk.c), |
| 2846 | }, |
| 2847 | }; |
| 2848 | |
| 2849 | static struct branch_clk csi2_phy_clk = { |
| 2850 | .b = { |
| 2851 | .ctl_reg = CSI2_CC_REG, |
| 2852 | .en_mask = BIT(8), |
| 2853 | .reset_reg = SW_RESET_CORE_REG, |
| 2854 | .reset_mask = BIT(31), |
| 2855 | .halt_reg = DBG_BUS_VEC_I_REG, |
| 2856 | .halt_bit = 29, |
| 2857 | }, |
| 2858 | .parent = &csi2_src_clk.c, |
| 2859 | .c = { |
| 2860 | .dbg_name = "csi2_phy_clk", |
| 2861 | .ops = &clk_ops_branch, |
| 2862 | CLK_INIT(csi2_phy_clk.c), |
| 2863 | }, |
| 2864 | }; |
| 2865 | |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 2866 | static struct clk *pix_rdi_mux_map[] = { |
| 2867 | [0] = &csi0_clk.c, |
| 2868 | [1] = &csi1_clk.c, |
| 2869 | [2] = &csi2_clk.c, |
| 2870 | NULL, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2871 | }; |
| 2872 | |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 2873 | struct pix_rdi_clk { |
Stephen Boyd | d86d1f2 | 2012-01-24 17:36:34 -0800 | [diff] [blame] | 2874 | bool prepared; |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 2875 | bool enabled; |
Matt Wagantall | 9de3bfb | 2011-11-03 20:13:12 -0700 | [diff] [blame] | 2876 | unsigned long cur_rate; |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 2877 | |
| 2878 | void __iomem *const s_reg; |
| 2879 | u32 s_mask; |
| 2880 | |
| 2881 | void __iomem *const s2_reg; |
| 2882 | u32 s2_mask; |
| 2883 | |
| 2884 | struct branch b; |
| 2885 | struct clk c; |
| 2886 | }; |
| 2887 | |
Matt Wagantall | f82f294 | 2012-01-27 13:56:13 -0800 | [diff] [blame] | 2888 | 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] | 2889 | { |
Matt Wagantall | f82f294 | 2012-01-27 13:56:13 -0800 | [diff] [blame] | 2890 | return container_of(c, struct pix_rdi_clk, c); |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 2891 | } |
| 2892 | |
Matt Wagantall | 9de3bfb | 2011-11-03 20:13:12 -0700 | [diff] [blame] | 2893 | 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] | 2894 | { |
| 2895 | int ret, i; |
| 2896 | u32 reg; |
| 2897 | unsigned long flags; |
Matt Wagantall | f82f294 | 2012-01-27 13:56:13 -0800 | [diff] [blame] | 2898 | struct pix_rdi_clk *rdi = to_pix_rdi_clk(c); |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 2899 | struct clk **mux_map = pix_rdi_mux_map; |
Stephen Boyd | d86d1f2 | 2012-01-24 17:36:34 -0800 | [diff] [blame] | 2900 | unsigned long old_rate = rdi->cur_rate; |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 2901 | |
| 2902 | /* |
| 2903 | * These clocks select three inputs via two muxes. One mux selects |
| 2904 | * between csi0 and csi1 and the second mux selects between that mux's |
| 2905 | * output and csi2. The source and destination selections for each |
| 2906 | * mux must be clocking for the switch to succeed so just turn on |
| 2907 | * all three sources because it's easier than figuring out what source |
| 2908 | * needs to be on at what time. |
| 2909 | */ |
| 2910 | for (i = 0; mux_map[i]; i++) { |
Stephen Boyd | d86d1f2 | 2012-01-24 17:36:34 -0800 | [diff] [blame] | 2911 | ret = clk_prepare_enable(mux_map[i]); |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 2912 | if (ret) |
| 2913 | goto err; |
| 2914 | } |
| 2915 | if (rate >= i) { |
| 2916 | ret = -EINVAL; |
| 2917 | goto err; |
| 2918 | } |
| 2919 | /* Keep the new source on when switching inputs of an enabled clock */ |
Stephen Boyd | d86d1f2 | 2012-01-24 17:36:34 -0800 | [diff] [blame] | 2920 | if (rdi->prepared) { |
| 2921 | ret = clk_prepare(mux_map[rate]); |
| 2922 | if (ret) |
| 2923 | goto err; |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 2924 | } |
Stephen Boyd | d86d1f2 | 2012-01-24 17:36:34 -0800 | [diff] [blame] | 2925 | spin_lock_irqsave(&c->lock, flags); |
| 2926 | if (rdi->enabled) { |
| 2927 | ret = clk_enable(mux_map[rate]); |
| 2928 | if (ret) { |
| 2929 | spin_unlock_irqrestore(&c->lock, flags); |
| 2930 | clk_unprepare(mux_map[rate]); |
| 2931 | goto err; |
| 2932 | } |
| 2933 | } |
| 2934 | spin_lock(&local_clock_reg_lock); |
Matt Wagantall | f82f294 | 2012-01-27 13:56:13 -0800 | [diff] [blame] | 2935 | reg = readl_relaxed(rdi->s2_reg); |
| 2936 | reg &= ~rdi->s2_mask; |
| 2937 | reg |= rate == 2 ? rdi->s2_mask : 0; |
| 2938 | writel_relaxed(reg, rdi->s2_reg); |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 2939 | /* |
| 2940 | * Wait at least 6 cycles of slowest clock |
| 2941 | * for the glitch-free MUX to fully switch sources. |
| 2942 | */ |
| 2943 | mb(); |
| 2944 | udelay(1); |
Matt Wagantall | f82f294 | 2012-01-27 13:56:13 -0800 | [diff] [blame] | 2945 | reg = readl_relaxed(rdi->s_reg); |
| 2946 | reg &= ~rdi->s_mask; |
| 2947 | reg |= rate == 1 ? rdi->s_mask : 0; |
| 2948 | writel_relaxed(reg, rdi->s_reg); |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 2949 | /* |
| 2950 | * Wait at least 6 cycles of slowest clock |
| 2951 | * for the glitch-free MUX to fully switch sources. |
| 2952 | */ |
| 2953 | mb(); |
| 2954 | udelay(1); |
Matt Wagantall | f82f294 | 2012-01-27 13:56:13 -0800 | [diff] [blame] | 2955 | rdi->cur_rate = rate; |
Stephen Boyd | d86d1f2 | 2012-01-24 17:36:34 -0800 | [diff] [blame] | 2956 | spin_unlock(&local_clock_reg_lock); |
| 2957 | |
| 2958 | if (rdi->enabled) |
| 2959 | clk_disable(mux_map[old_rate]); |
| 2960 | spin_unlock_irqrestore(&c->lock, flags); |
| 2961 | if (rdi->prepared) |
| 2962 | clk_unprepare(mux_map[old_rate]); |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 2963 | err: |
| 2964 | for (i--; i >= 0; i--) |
Stephen Boyd | d86d1f2 | 2012-01-24 17:36:34 -0800 | [diff] [blame] | 2965 | clk_disable_unprepare(mux_map[i]); |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 2966 | |
| 2967 | return 0; |
| 2968 | } |
| 2969 | |
Matt Wagantall | 9de3bfb | 2011-11-03 20:13:12 -0700 | [diff] [blame] | 2970 | static unsigned long pix_rdi_clk_get_rate(struct clk *c) |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 2971 | { |
| 2972 | return to_pix_rdi_clk(c)->cur_rate; |
| 2973 | } |
| 2974 | |
Stephen Boyd | d86d1f2 | 2012-01-24 17:36:34 -0800 | [diff] [blame] | 2975 | static int pix_rdi_clk_prepare(struct clk *c) |
| 2976 | { |
| 2977 | struct pix_rdi_clk *rdi = to_pix_rdi_clk(c); |
| 2978 | rdi->prepared = true; |
| 2979 | return 0; |
| 2980 | } |
| 2981 | |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 2982 | static int pix_rdi_clk_enable(struct clk *c) |
| 2983 | { |
| 2984 | unsigned long flags; |
Matt Wagantall | f82f294 | 2012-01-27 13:56:13 -0800 | [diff] [blame] | 2985 | struct pix_rdi_clk *rdi = to_pix_rdi_clk(c); |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 2986 | |
| 2987 | spin_lock_irqsave(&local_clock_reg_lock, flags); |
Matt Wagantall | 0de1b3f | 2012-06-05 19:52:43 -0700 | [diff] [blame] | 2988 | __branch_enable_reg(&rdi->b, rdi->c.dbg_name); |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 2989 | spin_unlock_irqrestore(&local_clock_reg_lock, flags); |
Matt Wagantall | f82f294 | 2012-01-27 13:56:13 -0800 | [diff] [blame] | 2990 | rdi->enabled = true; |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 2991 | |
| 2992 | return 0; |
| 2993 | } |
| 2994 | |
| 2995 | static void pix_rdi_clk_disable(struct clk *c) |
| 2996 | { |
| 2997 | unsigned long flags; |
Matt Wagantall | f82f294 | 2012-01-27 13:56:13 -0800 | [diff] [blame] | 2998 | struct pix_rdi_clk *rdi = to_pix_rdi_clk(c); |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 2999 | |
| 3000 | spin_lock_irqsave(&local_clock_reg_lock, flags); |
Matt Wagantall | 0de1b3f | 2012-06-05 19:52:43 -0700 | [diff] [blame] | 3001 | __branch_disable_reg(&rdi->b, rdi->c.dbg_name); |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 3002 | spin_unlock_irqrestore(&local_clock_reg_lock, flags); |
Matt Wagantall | f82f294 | 2012-01-27 13:56:13 -0800 | [diff] [blame] | 3003 | rdi->enabled = false; |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 3004 | } |
| 3005 | |
Stephen Boyd | d86d1f2 | 2012-01-24 17:36:34 -0800 | [diff] [blame] | 3006 | static void pix_rdi_clk_unprepare(struct clk *c) |
| 3007 | { |
| 3008 | struct pix_rdi_clk *rdi = to_pix_rdi_clk(c); |
| 3009 | rdi->prepared = false; |
| 3010 | } |
| 3011 | |
Matt Wagantall | f82f294 | 2012-01-27 13:56:13 -0800 | [diff] [blame] | 3012 | 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] | 3013 | { |
Matt Wagantall | f82f294 | 2012-01-27 13:56:13 -0800 | [diff] [blame] | 3014 | return branch_reset(&to_pix_rdi_clk(c)->b, action); |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 3015 | } |
| 3016 | |
| 3017 | static struct clk *pix_rdi_clk_get_parent(struct clk *c) |
| 3018 | { |
Matt Wagantall | f82f294 | 2012-01-27 13:56:13 -0800 | [diff] [blame] | 3019 | return pix_rdi_mux_map[to_pix_rdi_clk(c)->cur_rate]; |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 3020 | } |
| 3021 | |
| 3022 | static int pix_rdi_clk_list_rate(struct clk *c, unsigned n) |
| 3023 | { |
| 3024 | if (pix_rdi_mux_map[n]) |
| 3025 | return n; |
| 3026 | return -ENXIO; |
| 3027 | } |
| 3028 | |
Matt Wagantall | a15833b | 2012-04-03 11:00:56 -0700 | [diff] [blame] | 3029 | static enum handoff pix_rdi_clk_handoff(struct clk *c) |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 3030 | { |
| 3031 | u32 reg; |
Matt Wagantall | f82f294 | 2012-01-27 13:56:13 -0800 | [diff] [blame] | 3032 | struct pix_rdi_clk *rdi = to_pix_rdi_clk(c); |
Matt Wagantall | a15833b | 2012-04-03 11:00:56 -0700 | [diff] [blame] | 3033 | enum handoff ret; |
| 3034 | |
Matt Wagantall | f82f294 | 2012-01-27 13:56:13 -0800 | [diff] [blame] | 3035 | ret = branch_handoff(&rdi->b, &rdi->c); |
Matt Wagantall | a15833b | 2012-04-03 11:00:56 -0700 | [diff] [blame] | 3036 | if (ret == HANDOFF_DISABLED_CLK) |
| 3037 | return ret; |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 3038 | |
Matt Wagantall | f82f294 | 2012-01-27 13:56:13 -0800 | [diff] [blame] | 3039 | reg = readl_relaxed(rdi->s_reg); |
| 3040 | rdi->cur_rate = reg & rdi->s_mask ? 1 : 0; |
| 3041 | reg = readl_relaxed(rdi->s2_reg); |
| 3042 | rdi->cur_rate = reg & rdi->s2_mask ? 2 : rdi->cur_rate; |
Matt Wagantall | a15833b | 2012-04-03 11:00:56 -0700 | [diff] [blame] | 3043 | |
| 3044 | return HANDOFF_ENABLED_CLK; |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 3045 | } |
| 3046 | |
| 3047 | static struct clk_ops clk_ops_pix_rdi_8960 = { |
Stephen Boyd | d86d1f2 | 2012-01-24 17:36:34 -0800 | [diff] [blame] | 3048 | .prepare = pix_rdi_clk_prepare, |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 3049 | .enable = pix_rdi_clk_enable, |
| 3050 | .disable = pix_rdi_clk_disable, |
Stephen Boyd | d86d1f2 | 2012-01-24 17:36:34 -0800 | [diff] [blame] | 3051 | .unprepare = pix_rdi_clk_unprepare, |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 3052 | .handoff = pix_rdi_clk_handoff, |
| 3053 | .set_rate = pix_rdi_clk_set_rate, |
| 3054 | .get_rate = pix_rdi_clk_get_rate, |
| 3055 | .list_rate = pix_rdi_clk_list_rate, |
| 3056 | .reset = pix_rdi_clk_reset, |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 3057 | .get_parent = pix_rdi_clk_get_parent, |
| 3058 | }; |
| 3059 | |
| 3060 | static struct pix_rdi_clk csi_pix_clk = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3061 | .b = { |
| 3062 | .ctl_reg = MISC_CC_REG, |
| 3063 | .en_mask = BIT(26), |
| 3064 | .halt_check = DELAY, |
| 3065 | .reset_reg = SW_RESET_CORE_REG, |
| 3066 | .reset_mask = BIT(26), |
| 3067 | }, |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 3068 | .s_reg = MISC_CC_REG, |
| 3069 | .s_mask = BIT(25), |
| 3070 | .s2_reg = MISC_CC3_REG, |
| 3071 | .s2_mask = BIT(13), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3072 | .c = { |
| 3073 | .dbg_name = "csi_pix_clk", |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 3074 | .ops = &clk_ops_pix_rdi_8960, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3075 | CLK_INIT(csi_pix_clk.c), |
| 3076 | }, |
| 3077 | }; |
| 3078 | |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 3079 | static struct pix_rdi_clk csi_pix1_clk = { |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 3080 | .b = { |
| 3081 | .ctl_reg = MISC_CC3_REG, |
| 3082 | .en_mask = BIT(10), |
| 3083 | .halt_check = DELAY, |
| 3084 | .reset_reg = SW_RESET_CORE_REG, |
| 3085 | .reset_mask = BIT(30), |
| 3086 | }, |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 3087 | .s_reg = MISC_CC3_REG, |
| 3088 | .s_mask = BIT(8), |
| 3089 | .s2_reg = MISC_CC3_REG, |
| 3090 | .s2_mask = BIT(9), |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 3091 | .c = { |
| 3092 | .dbg_name = "csi_pix1_clk", |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 3093 | .ops = &clk_ops_pix_rdi_8960, |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 3094 | CLK_INIT(csi_pix1_clk.c), |
| 3095 | }, |
| 3096 | }; |
| 3097 | |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 3098 | static struct pix_rdi_clk csi_rdi_clk = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3099 | .b = { |
| 3100 | .ctl_reg = MISC_CC_REG, |
| 3101 | .en_mask = BIT(13), |
| 3102 | .halt_check = DELAY, |
| 3103 | .reset_reg = SW_RESET_CORE_REG, |
| 3104 | .reset_mask = BIT(27), |
| 3105 | }, |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 3106 | .s_reg = MISC_CC_REG, |
| 3107 | .s_mask = BIT(12), |
| 3108 | .s2_reg = MISC_CC3_REG, |
| 3109 | .s2_mask = BIT(12), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3110 | .c = { |
| 3111 | .dbg_name = "csi_rdi_clk", |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 3112 | .ops = &clk_ops_pix_rdi_8960, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3113 | CLK_INIT(csi_rdi_clk.c), |
| 3114 | }, |
| 3115 | }; |
| 3116 | |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 3117 | static struct pix_rdi_clk csi_rdi1_clk = { |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 3118 | .b = { |
| 3119 | .ctl_reg = MISC_CC3_REG, |
| 3120 | .en_mask = BIT(2), |
| 3121 | .halt_check = DELAY, |
| 3122 | .reset_reg = SW_RESET_CORE2_REG, |
| 3123 | .reset_mask = BIT(1), |
| 3124 | }, |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 3125 | .s_reg = MISC_CC3_REG, |
| 3126 | .s_mask = BIT(0), |
| 3127 | .s2_reg = MISC_CC3_REG, |
| 3128 | .s2_mask = BIT(1), |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 3129 | .c = { |
| 3130 | .dbg_name = "csi_rdi1_clk", |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 3131 | .ops = &clk_ops_pix_rdi_8960, |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 3132 | CLK_INIT(csi_rdi1_clk.c), |
| 3133 | }, |
| 3134 | }; |
| 3135 | |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 3136 | static struct pix_rdi_clk csi_rdi2_clk = { |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 3137 | .b = { |
| 3138 | .ctl_reg = MISC_CC3_REG, |
| 3139 | .en_mask = BIT(6), |
| 3140 | .halt_check = DELAY, |
| 3141 | .reset_reg = SW_RESET_CORE2_REG, |
| 3142 | .reset_mask = BIT(0), |
| 3143 | }, |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 3144 | .s_reg = MISC_CC3_REG, |
| 3145 | .s_mask = BIT(4), |
| 3146 | .s2_reg = MISC_CC3_REG, |
| 3147 | .s2_mask = BIT(5), |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 3148 | .c = { |
| 3149 | .dbg_name = "csi_rdi2_clk", |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 3150 | .ops = &clk_ops_pix_rdi_8960, |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 3151 | CLK_INIT(csi_rdi2_clk.c), |
| 3152 | }, |
| 3153 | }; |
| 3154 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3155 | #define F_CSI_PHYTIMER(f, s, d, m, n) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3156 | { \ |
| 3157 | .freq_hz = f, \ |
| 3158 | .src_clk = &s##_clk.c, \ |
| 3159 | .md_val = MD8(8, m, 0, n), \ |
| 3160 | .ns_val = NS_MM(31, 24, n, m, 15, 14, d, 2, 0, s##_to_mm_mux), \ |
| 3161 | .ctl_val = CC(6, n), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3162 | } |
| 3163 | static struct clk_freq_tbl clk_tbl_csi_phytimer[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3164 | F_CSI_PHYTIMER( 0, gnd, 1, 0, 0), |
| 3165 | F_CSI_PHYTIMER( 85330000, pll8, 1, 2, 9), |
| 3166 | F_CSI_PHYTIMER(177780000, pll2, 1, 2, 9), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3167 | F_END |
| 3168 | }; |
| 3169 | |
| 3170 | static struct rcg_clk csiphy_timer_src_clk = { |
| 3171 | .ns_reg = CSIPHYTIMER_NS_REG, |
| 3172 | .b = { |
| 3173 | .ctl_reg = CSIPHYTIMER_CC_REG, |
| 3174 | .halt_check = NOCHECK, |
| 3175 | }, |
| 3176 | .md_reg = CSIPHYTIMER_MD_REG, |
| 3177 | .root_en_mask = BIT(2), |
| 3178 | .ns_mask = (BM(31, 24) | BM(15, 14) | BM(2, 0)), |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame] | 3179 | .mnd_en_mask = BIT(5), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3180 | .ctl_mask = BM(7, 6), |
| 3181 | .set_rate = set_rate_mnd_8, |
| 3182 | .freq_tbl = clk_tbl_csi_phytimer, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 3183 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3184 | .c = { |
| 3185 | .dbg_name = "csiphy_timer_src_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 3186 | .ops = &clk_ops_rcg, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3187 | VDD_DIG_FMAX_MAP2(LOW, 86000000, NOMINAL, 178000000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3188 | CLK_INIT(csiphy_timer_src_clk.c), |
| 3189 | }, |
| 3190 | }; |
| 3191 | |
| 3192 | static struct branch_clk csi0phy_timer_clk = { |
| 3193 | .b = { |
| 3194 | .ctl_reg = CSIPHYTIMER_CC_REG, |
| 3195 | .en_mask = BIT(0), |
| 3196 | .halt_reg = DBG_BUS_VEC_I_REG, |
| 3197 | .halt_bit = 17, |
| 3198 | }, |
| 3199 | .parent = &csiphy_timer_src_clk.c, |
| 3200 | .c = { |
| 3201 | .dbg_name = "csi0phy_timer_clk", |
| 3202 | .ops = &clk_ops_branch, |
| 3203 | CLK_INIT(csi0phy_timer_clk.c), |
| 3204 | }, |
| 3205 | }; |
| 3206 | |
| 3207 | static struct branch_clk csi1phy_timer_clk = { |
| 3208 | .b = { |
| 3209 | .ctl_reg = CSIPHYTIMER_CC_REG, |
| 3210 | .en_mask = BIT(9), |
| 3211 | .halt_reg = DBG_BUS_VEC_I_REG, |
| 3212 | .halt_bit = 18, |
| 3213 | }, |
| 3214 | .parent = &csiphy_timer_src_clk.c, |
| 3215 | .c = { |
| 3216 | .dbg_name = "csi1phy_timer_clk", |
| 3217 | .ops = &clk_ops_branch, |
| 3218 | CLK_INIT(csi1phy_timer_clk.c), |
| 3219 | }, |
| 3220 | }; |
| 3221 | |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 3222 | static struct branch_clk csi2phy_timer_clk = { |
| 3223 | .b = { |
| 3224 | .ctl_reg = CSIPHYTIMER_CC_REG, |
| 3225 | .en_mask = BIT(11), |
| 3226 | .halt_reg = DBG_BUS_VEC_I_REG, |
| 3227 | .halt_bit = 30, |
| 3228 | }, |
| 3229 | .parent = &csiphy_timer_src_clk.c, |
| 3230 | .c = { |
| 3231 | .dbg_name = "csi2phy_timer_clk", |
| 3232 | .ops = &clk_ops_branch, |
| 3233 | CLK_INIT(csi2phy_timer_clk.c), |
| 3234 | }, |
| 3235 | }; |
| 3236 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3237 | #define F_DSI(d) \ |
| 3238 | { \ |
| 3239 | .freq_hz = d, \ |
| 3240 | .ns_val = BVAL(15, 12, (d-1)), \ |
| 3241 | } |
| 3242 | /* |
| 3243 | * The DSI_BYTE/ESC clock is sourced from the DSI PHY PLL, which may change rate |
| 3244 | * without this clock driver knowing. So, overload the clk_set_rate() to set |
| 3245 | * the divider (1 to 16) of the clock with respect to the PLL rate. |
| 3246 | */ |
| 3247 | static struct clk_freq_tbl clk_tbl_dsi_byte[] = { |
| 3248 | F_DSI(1), F_DSI(2), F_DSI(3), F_DSI(4), |
| 3249 | F_DSI(5), F_DSI(6), F_DSI(7), F_DSI(8), |
| 3250 | F_DSI(9), F_DSI(10), F_DSI(11), F_DSI(12), |
| 3251 | F_DSI(13), F_DSI(14), F_DSI(15), F_DSI(16), |
| 3252 | F_END |
| 3253 | }; |
| 3254 | |
Matt Wagantall | 735e41b | 2012-07-23 17:18:58 -0700 | [diff] [blame] | 3255 | static struct branch_clk dsi1_reset_clk = { |
| 3256 | .b = { |
| 3257 | .reset_reg = SW_RESET_CORE_REG, |
| 3258 | .reset_mask = BIT(7), |
| 3259 | .halt_check = NOCHECK, |
| 3260 | }, |
| 3261 | .c = { |
| 3262 | .dbg_name = "dsi1_reset_clk", |
| 3263 | .ops = &clk_ops_branch, |
| 3264 | CLK_INIT(dsi1_reset_clk.c), |
| 3265 | }, |
| 3266 | }; |
| 3267 | |
| 3268 | static struct branch_clk dsi2_reset_clk = { |
| 3269 | .b = { |
| 3270 | .reset_reg = SW_RESET_CORE_REG, |
| 3271 | .reset_mask = BIT(25), |
| 3272 | .halt_check = NOCHECK, |
| 3273 | }, |
| 3274 | .c = { |
| 3275 | .dbg_name = "dsi2_reset_clk", |
| 3276 | .ops = &clk_ops_branch, |
| 3277 | CLK_INIT(dsi2_reset_clk.c), |
| 3278 | }, |
| 3279 | }; |
| 3280 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3281 | static struct rcg_clk dsi1_byte_clk = { |
| 3282 | .b = { |
| 3283 | .ctl_reg = DSI1_BYTE_CC_REG, |
| 3284 | .en_mask = BIT(0), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3285 | .halt_reg = DBG_BUS_VEC_B_REG, |
| 3286 | .halt_bit = 21, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 3287 | .retain_reg = DSI1_BYTE_CC_REG, |
| 3288 | .retain_mask = BIT(31), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3289 | }, |
| 3290 | .ns_reg = DSI1_BYTE_NS_REG, |
| 3291 | .root_en_mask = BIT(2), |
| 3292 | .ns_mask = BM(15, 12), |
| 3293 | .set_rate = set_rate_nop, |
| 3294 | .freq_tbl = clk_tbl_dsi_byte, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 3295 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3296 | .c = { |
| 3297 | .dbg_name = "dsi1_byte_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 3298 | .ops = &clk_ops_rcg, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3299 | CLK_INIT(dsi1_byte_clk.c), |
| 3300 | }, |
| 3301 | }; |
| 3302 | |
| 3303 | static struct rcg_clk dsi2_byte_clk = { |
| 3304 | .b = { |
| 3305 | .ctl_reg = DSI2_BYTE_CC_REG, |
| 3306 | .en_mask = BIT(0), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3307 | .halt_reg = DBG_BUS_VEC_B_REG, |
| 3308 | .halt_bit = 20, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 3309 | .retain_reg = DSI2_BYTE_CC_REG, |
| 3310 | .retain_mask = BIT(31), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3311 | }, |
| 3312 | .ns_reg = DSI2_BYTE_NS_REG, |
| 3313 | .root_en_mask = BIT(2), |
| 3314 | .ns_mask = BM(15, 12), |
| 3315 | .set_rate = set_rate_nop, |
| 3316 | .freq_tbl = clk_tbl_dsi_byte, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 3317 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3318 | .c = { |
| 3319 | .dbg_name = "dsi2_byte_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 3320 | .ops = &clk_ops_rcg, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3321 | CLK_INIT(dsi2_byte_clk.c), |
| 3322 | }, |
| 3323 | }; |
| 3324 | |
| 3325 | static struct rcg_clk dsi1_esc_clk = { |
| 3326 | .b = { |
| 3327 | .ctl_reg = DSI1_ESC_CC_REG, |
| 3328 | .en_mask = BIT(0), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3329 | .halt_reg = DBG_BUS_VEC_I_REG, |
| 3330 | .halt_bit = 1, |
| 3331 | }, |
| 3332 | .ns_reg = DSI1_ESC_NS_REG, |
| 3333 | .root_en_mask = BIT(2), |
| 3334 | .ns_mask = BM(15, 12), |
| 3335 | .set_rate = set_rate_nop, |
| 3336 | .freq_tbl = clk_tbl_dsi_byte, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 3337 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3338 | .c = { |
| 3339 | .dbg_name = "dsi1_esc_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 3340 | .ops = &clk_ops_rcg, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3341 | CLK_INIT(dsi1_esc_clk.c), |
| 3342 | }, |
| 3343 | }; |
| 3344 | |
| 3345 | static struct rcg_clk dsi2_esc_clk = { |
| 3346 | .b = { |
| 3347 | .ctl_reg = DSI2_ESC_CC_REG, |
| 3348 | .en_mask = BIT(0), |
| 3349 | .halt_reg = DBG_BUS_VEC_I_REG, |
| 3350 | .halt_bit = 3, |
| 3351 | }, |
| 3352 | .ns_reg = DSI2_ESC_NS_REG, |
| 3353 | .root_en_mask = BIT(2), |
| 3354 | .ns_mask = BM(15, 12), |
| 3355 | .set_rate = set_rate_nop, |
| 3356 | .freq_tbl = clk_tbl_dsi_byte, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 3357 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3358 | .c = { |
| 3359 | .dbg_name = "dsi2_esc_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 3360 | .ops = &clk_ops_rcg, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3361 | CLK_INIT(dsi2_esc_clk.c), |
| 3362 | }, |
| 3363 | }; |
| 3364 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3365 | #define F_GFX2D(f, s, m, n) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3366 | { \ |
| 3367 | .freq_hz = f, \ |
| 3368 | .src_clk = &s##_clk.c, \ |
| 3369 | .md_val = MD4(4, m, 0, n), \ |
| 3370 | .ns_val = NS_MND_BANKED4(20, 16, n, m, 3, 0, s##_to_mm_mux), \ |
| 3371 | .ctl_val = CC_BANKED(9, 6, n), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3372 | } |
| 3373 | static struct clk_freq_tbl clk_tbl_gfx2d[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3374 | F_GFX2D( 0, gnd, 0, 0), |
| 3375 | F_GFX2D( 27000000, pxo, 0, 0), |
| 3376 | F_GFX2D( 48000000, pll8, 1, 8), |
| 3377 | F_GFX2D( 54857000, pll8, 1, 7), |
| 3378 | F_GFX2D( 64000000, pll8, 1, 6), |
| 3379 | F_GFX2D( 76800000, pll8, 1, 5), |
| 3380 | F_GFX2D( 96000000, pll8, 1, 4), |
| 3381 | F_GFX2D(128000000, pll8, 1, 3), |
| 3382 | F_GFX2D(145455000, pll2, 2, 11), |
| 3383 | F_GFX2D(160000000, pll2, 1, 5), |
| 3384 | F_GFX2D(177778000, pll2, 2, 9), |
| 3385 | F_GFX2D(200000000, pll2, 1, 4), |
| 3386 | F_GFX2D(228571000, pll2, 2, 7), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3387 | F_END |
| 3388 | }; |
| 3389 | |
| 3390 | static struct bank_masks bmnd_info_gfx2d0 = { |
| 3391 | .bank_sel_mask = BIT(11), |
| 3392 | .bank0_mask = { |
| 3393 | .md_reg = GFX2D0_MD0_REG, |
| 3394 | .ns_mask = BM(23, 20) | BM(5, 3), |
| 3395 | .rst_mask = BIT(25), |
| 3396 | .mnd_en_mask = BIT(8), |
| 3397 | .mode_mask = BM(10, 9), |
| 3398 | }, |
| 3399 | .bank1_mask = { |
| 3400 | .md_reg = GFX2D0_MD1_REG, |
| 3401 | .ns_mask = BM(19, 16) | BM(2, 0), |
| 3402 | .rst_mask = BIT(24), |
| 3403 | .mnd_en_mask = BIT(5), |
| 3404 | .mode_mask = BM(7, 6), |
| 3405 | }, |
| 3406 | }; |
| 3407 | |
| 3408 | static struct rcg_clk gfx2d0_clk = { |
| 3409 | .b = { |
| 3410 | .ctl_reg = GFX2D0_CC_REG, |
| 3411 | .en_mask = BIT(0), |
| 3412 | .reset_reg = SW_RESET_CORE_REG, |
| 3413 | .reset_mask = BIT(14), |
| 3414 | .halt_reg = DBG_BUS_VEC_A_REG, |
| 3415 | .halt_bit = 9, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 3416 | .retain_reg = GFX2D0_CC_REG, |
| 3417 | .retain_mask = BIT(31), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3418 | }, |
| 3419 | .ns_reg = GFX2D0_NS_REG, |
| 3420 | .root_en_mask = BIT(2), |
| 3421 | .set_rate = set_rate_mnd_banked, |
| 3422 | .freq_tbl = clk_tbl_gfx2d, |
Stephen Boyd | c78d9a7 | 2011-07-20 00:46:24 -0700 | [diff] [blame] | 3423 | .bank_info = &bmnd_info_gfx2d0, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 3424 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3425 | .c = { |
| 3426 | .dbg_name = "gfx2d0_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 3427 | .ops = &clk_ops_rcg, |
Matt Wagantall | 158f73b | 2012-05-16 11:29:35 -0700 | [diff] [blame] | 3428 | .flags = CLKFLAG_SKIP_HANDOFF, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3429 | VDD_DIG_FMAX_MAP3(LOW, 100000000, NOMINAL, 200000000, |
| 3430 | HIGH, 228571000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3431 | CLK_INIT(gfx2d0_clk.c), |
| 3432 | }, |
| 3433 | }; |
| 3434 | |
| 3435 | static struct bank_masks bmnd_info_gfx2d1 = { |
| 3436 | .bank_sel_mask = BIT(11), |
| 3437 | .bank0_mask = { |
| 3438 | .md_reg = GFX2D1_MD0_REG, |
| 3439 | .ns_mask = BM(23, 20) | BM(5, 3), |
| 3440 | .rst_mask = BIT(25), |
| 3441 | .mnd_en_mask = BIT(8), |
| 3442 | .mode_mask = BM(10, 9), |
| 3443 | }, |
| 3444 | .bank1_mask = { |
| 3445 | .md_reg = GFX2D1_MD1_REG, |
| 3446 | .ns_mask = BM(19, 16) | BM(2, 0), |
| 3447 | .rst_mask = BIT(24), |
| 3448 | .mnd_en_mask = BIT(5), |
| 3449 | .mode_mask = BM(7, 6), |
| 3450 | }, |
| 3451 | }; |
| 3452 | |
| 3453 | static struct rcg_clk gfx2d1_clk = { |
| 3454 | .b = { |
| 3455 | .ctl_reg = GFX2D1_CC_REG, |
| 3456 | .en_mask = BIT(0), |
| 3457 | .reset_reg = SW_RESET_CORE_REG, |
| 3458 | .reset_mask = BIT(13), |
| 3459 | .halt_reg = DBG_BUS_VEC_A_REG, |
| 3460 | .halt_bit = 14, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 3461 | .retain_reg = GFX2D1_CC_REG, |
| 3462 | .retain_mask = BIT(31), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3463 | }, |
| 3464 | .ns_reg = GFX2D1_NS_REG, |
| 3465 | .root_en_mask = BIT(2), |
| 3466 | .set_rate = set_rate_mnd_banked, |
| 3467 | .freq_tbl = clk_tbl_gfx2d, |
Stephen Boyd | c78d9a7 | 2011-07-20 00:46:24 -0700 | [diff] [blame] | 3468 | .bank_info = &bmnd_info_gfx2d1, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 3469 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3470 | .c = { |
| 3471 | .dbg_name = "gfx2d1_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 3472 | .ops = &clk_ops_rcg, |
Matt Wagantall | 158f73b | 2012-05-16 11:29:35 -0700 | [diff] [blame] | 3473 | .flags = CLKFLAG_SKIP_HANDOFF, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3474 | VDD_DIG_FMAX_MAP3(LOW, 100000000, NOMINAL, 200000000, |
| 3475 | HIGH, 228571000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3476 | CLK_INIT(gfx2d1_clk.c), |
| 3477 | }, |
| 3478 | }; |
| 3479 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3480 | #define F_GFX3D(f, s, m, n) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3481 | { \ |
| 3482 | .freq_hz = f, \ |
| 3483 | .src_clk = &s##_clk.c, \ |
| 3484 | .md_val = MD4(4, m, 0, n), \ |
| 3485 | .ns_val = NS_MND_BANKED4(18, 14, n, m, 3, 0, s##_to_mm_mux), \ |
| 3486 | .ctl_val = CC_BANKED(9, 6, n), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3487 | } |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 3488 | |
Patrick Daly | e6f48904 | 2012-07-11 15:29:15 -0700 | [diff] [blame] | 3489 | static struct clk_freq_tbl clk_tbl_gfx3d_8960ab[] = { |
| 3490 | F_GFX3D( 0, gnd, 0, 0), |
| 3491 | F_GFX3D( 27000000, pxo, 0, 0), |
| 3492 | F_GFX3D( 48000000, pll8, 1, 8), |
| 3493 | F_GFX3D( 54857000, pll8, 1, 7), |
| 3494 | F_GFX3D( 64000000, pll8, 1, 6), |
| 3495 | F_GFX3D( 76800000, pll8, 1, 5), |
| 3496 | F_GFX3D( 96000000, pll8, 1, 4), |
| 3497 | F_GFX3D(128000000, pll8, 1, 3), |
| 3498 | F_GFX3D(145455000, pll2, 2, 11), |
| 3499 | F_GFX3D(160000000, pll2, 1, 5), |
| 3500 | F_GFX3D(177778000, pll2, 2, 9), |
| 3501 | F_GFX3D(200000000, pll2, 1, 4), |
| 3502 | F_GFX3D(228571000, pll2, 2, 7), |
| 3503 | F_GFX3D(266667000, pll2, 1, 3), |
| 3504 | F_GFX3D(320000000, pll2, 2, 5), |
| 3505 | F_GFX3D(325000000, pll3, 1, 2), |
| 3506 | F_GFX3D(400000000, pll2, 1, 2), |
| 3507 | F_END |
| 3508 | }; |
| 3509 | |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 3510 | static struct clk_freq_tbl clk_tbl_gfx3d_8960[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3511 | F_GFX3D( 0, gnd, 0, 0), |
| 3512 | F_GFX3D( 27000000, pxo, 0, 0), |
| 3513 | F_GFX3D( 48000000, pll8, 1, 8), |
| 3514 | F_GFX3D( 54857000, pll8, 1, 7), |
| 3515 | F_GFX3D( 64000000, pll8, 1, 6), |
| 3516 | F_GFX3D( 76800000, pll8, 1, 5), |
| 3517 | F_GFX3D( 96000000, pll8, 1, 4), |
| 3518 | F_GFX3D(128000000, pll8, 1, 3), |
| 3519 | F_GFX3D(145455000, pll2, 2, 11), |
| 3520 | F_GFX3D(160000000, pll2, 1, 5), |
| 3521 | F_GFX3D(177778000, pll2, 2, 9), |
| 3522 | F_GFX3D(200000000, pll2, 1, 4), |
| 3523 | F_GFX3D(228571000, pll2, 2, 7), |
| 3524 | F_GFX3D(266667000, pll2, 1, 3), |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3525 | F_GFX3D(300000000, pll3, 1, 4), |
| 3526 | F_GFX3D(320000000, pll2, 2, 5), |
| 3527 | F_GFX3D(400000000, pll2, 1, 2), |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 3528 | F_END |
| 3529 | }; |
| 3530 | |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 3531 | static struct clk_freq_tbl clk_tbl_gfx3d_8064[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3532 | F_GFX3D( 0, gnd, 0, 0), |
| 3533 | F_GFX3D( 27000000, pxo, 0, 0), |
| 3534 | F_GFX3D( 48000000, pll8, 1, 8), |
| 3535 | F_GFX3D( 54857000, pll8, 1, 7), |
| 3536 | F_GFX3D( 64000000, pll8, 1, 6), |
| 3537 | F_GFX3D( 76800000, pll8, 1, 5), |
| 3538 | F_GFX3D( 96000000, pll8, 1, 4), |
| 3539 | F_GFX3D(128000000, pll8, 1, 3), |
| 3540 | F_GFX3D(145455000, pll2, 2, 11), |
| 3541 | F_GFX3D(160000000, pll2, 1, 5), |
| 3542 | F_GFX3D(177778000, pll2, 2, 9), |
| 3543 | F_GFX3D(200000000, pll2, 1, 4), |
| 3544 | F_GFX3D(228571000, pll2, 2, 7), |
| 3545 | F_GFX3D(266667000, pll2, 1, 3), |
Tianyi Gou | 0c50fe3 | 2011-10-19 15:50:35 -0700 | [diff] [blame] | 3546 | F_GFX3D(325000000, pll15, 1, 3), |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3547 | F_GFX3D(400000000, pll2, 1, 2), |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 3548 | F_END |
| 3549 | }; |
| 3550 | |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 3551 | static struct clk_freq_tbl clk_tbl_gfx3d_8930[] = { |
| 3552 | F_GFX3D( 0, gnd, 0, 0), |
| 3553 | F_GFX3D( 27000000, pxo, 0, 0), |
| 3554 | F_GFX3D( 48000000, pll8, 1, 8), |
| 3555 | F_GFX3D( 54857000, pll8, 1, 7), |
| 3556 | F_GFX3D( 64000000, pll8, 1, 6), |
| 3557 | F_GFX3D( 76800000, pll8, 1, 5), |
| 3558 | F_GFX3D( 96000000, pll8, 1, 4), |
| 3559 | F_GFX3D(128000000, pll8, 1, 3), |
| 3560 | F_GFX3D(145455000, pll2, 2, 11), |
| 3561 | F_GFX3D(160000000, pll2, 1, 5), |
| 3562 | F_GFX3D(177778000, pll2, 2, 9), |
Tianyi Gou | 4d33c9c | 2012-03-30 11:10:15 -0700 | [diff] [blame] | 3563 | F_GFX3D(192000000, pll8, 1, 2), |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 3564 | F_GFX3D(200000000, pll2, 1, 4), |
| 3565 | F_GFX3D(228571000, pll2, 2, 7), |
| 3566 | F_GFX3D(266667000, pll2, 1, 3), |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 3567 | F_GFX3D(320000000, pll2, 2, 5), |
| 3568 | F_GFX3D(400000000, pll2, 1, 2), |
| 3569 | F_GFX3D(450000000, pll15, 1, 2), |
| 3570 | F_END |
| 3571 | }; |
| 3572 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3573 | static unsigned long fmax_gfx3d_8064[MAX_VDD_LEVELS] __initdata = { |
| 3574 | [VDD_DIG_LOW] = 128000000, |
| 3575 | [VDD_DIG_NOMINAL] = 325000000, |
| 3576 | [VDD_DIG_HIGH] = 400000000 |
| 3577 | }; |
| 3578 | |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 3579 | static unsigned long fmax_gfx3d_8930[MAX_VDD_LEVELS] __initdata = { |
Tianyi Gou | 4d33c9c | 2012-03-30 11:10:15 -0700 | [diff] [blame] | 3580 | [VDD_DIG_LOW] = 192000000, |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 3581 | [VDD_DIG_NOMINAL] = 320000000, |
Patrick Daly | ebe63c5 | 2012-08-07 15:41:30 -0700 | [diff] [blame] | 3582 | [VDD_DIG_HIGH] = 400000000 |
| 3583 | }; |
| 3584 | |
| 3585 | static unsigned long fmax_gfx3d_8930aa[MAX_VDD_LEVELS] __initdata = { |
| 3586 | [VDD_DIG_LOW] = 192000000, |
| 3587 | [VDD_DIG_NOMINAL] = 320000000, |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 3588 | [VDD_DIG_HIGH] = 450000000 |
| 3589 | }; |
| 3590 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3591 | static struct bank_masks bmnd_info_gfx3d = { |
| 3592 | .bank_sel_mask = BIT(11), |
| 3593 | .bank0_mask = { |
| 3594 | .md_reg = GFX3D_MD0_REG, |
| 3595 | .ns_mask = BM(21, 18) | BM(5, 3), |
| 3596 | .rst_mask = BIT(23), |
| 3597 | .mnd_en_mask = BIT(8), |
| 3598 | .mode_mask = BM(10, 9), |
| 3599 | }, |
| 3600 | .bank1_mask = { |
| 3601 | .md_reg = GFX3D_MD1_REG, |
| 3602 | .ns_mask = BM(17, 14) | BM(2, 0), |
| 3603 | .rst_mask = BIT(22), |
| 3604 | .mnd_en_mask = BIT(5), |
| 3605 | .mode_mask = BM(7, 6), |
| 3606 | }, |
| 3607 | }; |
| 3608 | |
| 3609 | static struct rcg_clk gfx3d_clk = { |
| 3610 | .b = { |
| 3611 | .ctl_reg = GFX3D_CC_REG, |
| 3612 | .en_mask = BIT(0), |
| 3613 | .reset_reg = SW_RESET_CORE_REG, |
| 3614 | .reset_mask = BIT(12), |
| 3615 | .halt_reg = DBG_BUS_VEC_A_REG, |
| 3616 | .halt_bit = 4, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 3617 | .retain_reg = GFX3D_CC_REG, |
| 3618 | .retain_mask = BIT(31), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3619 | }, |
| 3620 | .ns_reg = GFX3D_NS_REG, |
| 3621 | .root_en_mask = BIT(2), |
| 3622 | .set_rate = set_rate_mnd_banked, |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 3623 | .freq_tbl = clk_tbl_gfx3d_8960, |
Stephen Boyd | c78d9a7 | 2011-07-20 00:46:24 -0700 | [diff] [blame] | 3624 | .bank_info = &bmnd_info_gfx3d, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 3625 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3626 | .c = { |
| 3627 | .dbg_name = "gfx3d_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 3628 | .ops = &clk_ops_rcg, |
Tianyi Gou | 3022dfd | 2012-01-25 15:50:05 -0800 | [diff] [blame] | 3629 | VDD_DIG_FMAX_MAP3(LOW, 128000000, NOMINAL, 300000000, |
| 3630 | HIGH, 400000000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3631 | CLK_INIT(gfx3d_clk.c), |
Stephen Boyd | 7fa2674 | 2011-08-11 23:22:29 -0700 | [diff] [blame] | 3632 | .depends = &gmem_axi_clk.c, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3633 | }, |
| 3634 | }; |
| 3635 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3636 | #define F_VCAP(f, s, m, n) \ |
Tianyi Gou | 621f874 | 2011-09-01 21:45:01 -0700 | [diff] [blame] | 3637 | { \ |
| 3638 | .freq_hz = f, \ |
| 3639 | .src_clk = &s##_clk.c, \ |
| 3640 | .md_val = MD4(4, m, 0, n), \ |
| 3641 | .ns_val = NS_MND_BANKED4(18, 14, n, m, 3, 0, s##_to_mm_mux), \ |
| 3642 | .ctl_val = CC_BANKED(9, 6, n), \ |
Tianyi Gou | 621f874 | 2011-09-01 21:45:01 -0700 | [diff] [blame] | 3643 | } |
| 3644 | |
| 3645 | static struct clk_freq_tbl clk_tbl_vcap[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3646 | F_VCAP( 0, gnd, 0, 0), |
| 3647 | F_VCAP( 27000000, pxo, 0, 0), |
| 3648 | F_VCAP( 54860000, pll8, 1, 7), |
| 3649 | F_VCAP( 64000000, pll8, 1, 6), |
| 3650 | F_VCAP( 76800000, pll8, 1, 5), |
| 3651 | F_VCAP(128000000, pll8, 1, 3), |
| 3652 | F_VCAP(160000000, pll2, 1, 5), |
| 3653 | F_VCAP(200000000, pll2, 1, 4), |
Tianyi Gou | 621f874 | 2011-09-01 21:45:01 -0700 | [diff] [blame] | 3654 | F_END |
| 3655 | }; |
| 3656 | |
| 3657 | static struct bank_masks bmnd_info_vcap = { |
| 3658 | .bank_sel_mask = BIT(11), |
| 3659 | .bank0_mask = { |
| 3660 | .md_reg = VCAP_MD0_REG, |
| 3661 | .ns_mask = BM(21, 18) | BM(5, 3), |
| 3662 | .rst_mask = BIT(23), |
| 3663 | .mnd_en_mask = BIT(8), |
| 3664 | .mode_mask = BM(10, 9), |
| 3665 | }, |
| 3666 | .bank1_mask = { |
| 3667 | .md_reg = VCAP_MD1_REG, |
| 3668 | .ns_mask = BM(17, 14) | BM(2, 0), |
| 3669 | .rst_mask = BIT(22), |
| 3670 | .mnd_en_mask = BIT(5), |
| 3671 | .mode_mask = BM(7, 6), |
| 3672 | }, |
| 3673 | }; |
| 3674 | |
| 3675 | static struct rcg_clk vcap_clk = { |
| 3676 | .b = { |
| 3677 | .ctl_reg = VCAP_CC_REG, |
| 3678 | .en_mask = BIT(0), |
| 3679 | .halt_reg = DBG_BUS_VEC_J_REG, |
| 3680 | .halt_bit = 15, |
| 3681 | }, |
| 3682 | .ns_reg = VCAP_NS_REG, |
| 3683 | .root_en_mask = BIT(2), |
| 3684 | .set_rate = set_rate_mnd_banked, |
| 3685 | .freq_tbl = clk_tbl_vcap, |
| 3686 | .bank_info = &bmnd_info_vcap, |
| 3687 | .current_freq = &rcg_dummy_freq, |
| 3688 | .c = { |
| 3689 | .dbg_name = "vcap_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 3690 | .ops = &clk_ops_rcg, |
Tianyi Gou | 621f874 | 2011-09-01 21:45:01 -0700 | [diff] [blame] | 3691 | .depends = &vcap_axi_clk.c, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3692 | VDD_DIG_FMAX_MAP2(LOW, 100000000, NOMINAL, 200000000), |
Tianyi Gou | 621f874 | 2011-09-01 21:45:01 -0700 | [diff] [blame] | 3693 | CLK_INIT(vcap_clk.c), |
| 3694 | }, |
| 3695 | }; |
| 3696 | |
| 3697 | static struct branch_clk vcap_npl_clk = { |
| 3698 | .b = { |
| 3699 | .ctl_reg = VCAP_CC_REG, |
| 3700 | .en_mask = BIT(13), |
| 3701 | .halt_reg = DBG_BUS_VEC_J_REG, |
| 3702 | .halt_bit = 25, |
| 3703 | }, |
| 3704 | .parent = &vcap_clk.c, |
| 3705 | .c = { |
| 3706 | .dbg_name = "vcap_npl_clk", |
| 3707 | .ops = &clk_ops_branch, |
| 3708 | CLK_INIT(vcap_npl_clk.c), |
| 3709 | }, |
| 3710 | }; |
| 3711 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3712 | #define F_IJPEG(f, s, d, m, n) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3713 | { \ |
| 3714 | .freq_hz = f, \ |
| 3715 | .src_clk = &s##_clk.c, \ |
| 3716 | .md_val = MD8(8, m, 0, n), \ |
| 3717 | .ns_val = NS_MM(23, 16, n, m, 15, 12, d, 2, 0, s##_to_mm_mux), \ |
| 3718 | .ctl_val = CC(6, n), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3719 | } |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 3720 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3721 | static struct clk_freq_tbl clk_tbl_ijpeg[] = { |
| 3722 | F_IJPEG( 0, gnd, 1, 0, 0), |
| 3723 | F_IJPEG( 27000000, pxo, 1, 0, 0), |
| 3724 | F_IJPEG( 36570000, pll8, 1, 2, 21), |
| 3725 | F_IJPEG( 54860000, pll8, 7, 0, 0), |
| 3726 | F_IJPEG( 96000000, pll8, 4, 0, 0), |
| 3727 | F_IJPEG(109710000, pll8, 1, 2, 7), |
| 3728 | F_IJPEG(128000000, pll8, 3, 0, 0), |
| 3729 | F_IJPEG(153600000, pll8, 1, 2, 5), |
| 3730 | F_IJPEG(200000000, pll2, 4, 0, 0), |
| 3731 | F_IJPEG(228571000, pll2, 1, 2, 7), |
| 3732 | F_IJPEG(266667000, pll2, 1, 1, 3), |
| 3733 | F_IJPEG(320000000, pll2, 1, 2, 5), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3734 | F_END |
| 3735 | }; |
| 3736 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3737 | static unsigned long fmax_ijpeg_8064[MAX_VDD_LEVELS] __initdata = { |
| 3738 | [VDD_DIG_LOW] = 128000000, |
| 3739 | [VDD_DIG_NOMINAL] = 266667000, |
| 3740 | [VDD_DIG_HIGH] = 320000000 |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 3741 | }; |
| 3742 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3743 | static struct rcg_clk ijpeg_clk = { |
| 3744 | .b = { |
| 3745 | .ctl_reg = IJPEG_CC_REG, |
| 3746 | .en_mask = BIT(0), |
| 3747 | .reset_reg = SW_RESET_CORE_REG, |
| 3748 | .reset_mask = BIT(9), |
| 3749 | .halt_reg = DBG_BUS_VEC_A_REG, |
| 3750 | .halt_bit = 24, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 3751 | .retain_reg = IJPEG_CC_REG, |
| 3752 | .retain_mask = BIT(31), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3753 | }, |
| 3754 | .ns_reg = IJPEG_NS_REG, |
| 3755 | .md_reg = IJPEG_MD_REG, |
| 3756 | .root_en_mask = BIT(2), |
| 3757 | .ns_mask = (BM(23, 16) | BM(15, 12) | BM(2, 0)), |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame] | 3758 | .mnd_en_mask = BIT(5), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3759 | .ctl_mask = BM(7, 6), |
| 3760 | .set_rate = set_rate_mnd, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3761 | .freq_tbl = clk_tbl_ijpeg, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 3762 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3763 | .c = { |
| 3764 | .dbg_name = "ijpeg_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 3765 | .ops = &clk_ops_rcg, |
Tianyi Gou | 3022dfd | 2012-01-25 15:50:05 -0800 | [diff] [blame] | 3766 | VDD_DIG_FMAX_MAP3(LOW, 110000000, NOMINAL, 266667000, |
| 3767 | HIGH, 320000000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3768 | CLK_INIT(ijpeg_clk.c), |
Stephen Boyd | 7fa2674 | 2011-08-11 23:22:29 -0700 | [diff] [blame] | 3769 | .depends = &ijpeg_axi_clk.c, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3770 | }, |
| 3771 | }; |
| 3772 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3773 | #define F_JPEGD(f, s, d) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3774 | { \ |
| 3775 | .freq_hz = f, \ |
| 3776 | .src_clk = &s##_clk.c, \ |
| 3777 | .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] | 3778 | } |
| 3779 | static struct clk_freq_tbl clk_tbl_jpegd[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3780 | F_JPEGD( 0, gnd, 1), |
| 3781 | F_JPEGD( 64000000, pll8, 6), |
| 3782 | F_JPEGD( 76800000, pll8, 5), |
| 3783 | F_JPEGD( 96000000, pll8, 4), |
| 3784 | F_JPEGD(160000000, pll2, 5), |
| 3785 | F_JPEGD(200000000, pll2, 4), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3786 | F_END |
| 3787 | }; |
| 3788 | |
| 3789 | static struct rcg_clk jpegd_clk = { |
| 3790 | .b = { |
| 3791 | .ctl_reg = JPEGD_CC_REG, |
| 3792 | .en_mask = BIT(0), |
| 3793 | .reset_reg = SW_RESET_CORE_REG, |
| 3794 | .reset_mask = BIT(19), |
| 3795 | .halt_reg = DBG_BUS_VEC_A_REG, |
| 3796 | .halt_bit = 19, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 3797 | .retain_reg = JPEGD_CC_REG, |
| 3798 | .retain_mask = BIT(31), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3799 | }, |
| 3800 | .ns_reg = JPEGD_NS_REG, |
| 3801 | .root_en_mask = BIT(2), |
| 3802 | .ns_mask = (BM(15, 12) | BM(2, 0)), |
| 3803 | .set_rate = set_rate_nop, |
| 3804 | .freq_tbl = clk_tbl_jpegd, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 3805 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3806 | .c = { |
| 3807 | .dbg_name = "jpegd_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 3808 | .ops = &clk_ops_rcg, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3809 | VDD_DIG_FMAX_MAP2(LOW, 96000000, NOMINAL, 200000000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3810 | CLK_INIT(jpegd_clk.c), |
Stephen Boyd | 7fa2674 | 2011-08-11 23:22:29 -0700 | [diff] [blame] | 3811 | .depends = &jpegd_axi_clk.c, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3812 | }, |
| 3813 | }; |
| 3814 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3815 | #define F_MDP(f, s, m, n) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3816 | { \ |
| 3817 | .freq_hz = f, \ |
| 3818 | .src_clk = &s##_clk.c, \ |
| 3819 | .md_val = MD8(8, m, 0, n), \ |
| 3820 | .ns_val = NS_MND_BANKED8(22, 14, n, m, 3, 0, s##_to_mm_mux), \ |
| 3821 | .ctl_val = CC_BANKED(9, 6, n), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3822 | } |
Patrick Daly | e6f48904 | 2012-07-11 15:29:15 -0700 | [diff] [blame] | 3823 | static struct clk_freq_tbl clk_tbl_mdp_8960ab[] = { |
| 3824 | F_MDP( 0, gnd, 0, 0), |
| 3825 | F_MDP( 9600000, pll8, 1, 40), |
| 3826 | F_MDP( 13710000, pll8, 1, 28), |
| 3827 | F_MDP( 27000000, pxo, 0, 0), |
| 3828 | F_MDP( 29540000, pll8, 1, 13), |
| 3829 | F_MDP( 34910000, pll8, 1, 11), |
| 3830 | F_MDP( 38400000, pll8, 1, 10), |
| 3831 | F_MDP( 59080000, pll8, 2, 13), |
| 3832 | F_MDP( 76800000, pll8, 1, 5), |
| 3833 | F_MDP( 85330000, pll8, 2, 9), |
| 3834 | F_MDP( 96000000, pll8, 1, 4), |
| 3835 | F_MDP(128000000, pll8, 1, 3), |
| 3836 | F_MDP(160000000, pll2, 1, 5), |
| 3837 | F_MDP(177780000, pll2, 2, 9), |
| 3838 | F_MDP(200000000, pll2, 1, 4), |
| 3839 | F_MDP(228571000, pll2, 2, 7), |
| 3840 | F_MDP(266667000, pll2, 1, 3), |
| 3841 | F_END |
| 3842 | }; |
| 3843 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3844 | static struct clk_freq_tbl clk_tbl_mdp[] = { |
| 3845 | F_MDP( 0, gnd, 0, 0), |
| 3846 | F_MDP( 9600000, pll8, 1, 40), |
| 3847 | F_MDP( 13710000, pll8, 1, 28), |
| 3848 | F_MDP( 27000000, pxo, 0, 0), |
| 3849 | F_MDP( 29540000, pll8, 1, 13), |
| 3850 | F_MDP( 34910000, pll8, 1, 11), |
| 3851 | F_MDP( 38400000, pll8, 1, 10), |
| 3852 | F_MDP( 59080000, pll8, 2, 13), |
| 3853 | F_MDP( 76800000, pll8, 1, 5), |
| 3854 | F_MDP( 85330000, pll8, 2, 9), |
| 3855 | F_MDP( 96000000, pll8, 1, 4), |
| 3856 | F_MDP(128000000, pll8, 1, 3), |
| 3857 | F_MDP(160000000, pll2, 1, 5), |
| 3858 | F_MDP(177780000, pll2, 2, 9), |
| 3859 | F_MDP(200000000, pll2, 1, 4), |
| 3860 | F_MDP(266667000, pll2, 1, 3), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3861 | F_END |
| 3862 | }; |
| 3863 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3864 | static unsigned long fmax_mdp_8064[MAX_VDD_LEVELS] __initdata = { |
| 3865 | [VDD_DIG_LOW] = 128000000, |
| 3866 | [VDD_DIG_NOMINAL] = 266667000 |
Tianyi Gou | 621f874 | 2011-09-01 21:45:01 -0700 | [diff] [blame] | 3867 | }; |
| 3868 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3869 | static struct bank_masks bmnd_info_mdp = { |
| 3870 | .bank_sel_mask = BIT(11), |
| 3871 | .bank0_mask = { |
| 3872 | .md_reg = MDP_MD0_REG, |
| 3873 | .ns_mask = BM(29, 22) | BM(5, 3), |
| 3874 | .rst_mask = BIT(31), |
| 3875 | .mnd_en_mask = BIT(8), |
| 3876 | .mode_mask = BM(10, 9), |
| 3877 | }, |
| 3878 | .bank1_mask = { |
| 3879 | .md_reg = MDP_MD1_REG, |
| 3880 | .ns_mask = BM(21, 14) | BM(2, 0), |
| 3881 | .rst_mask = BIT(30), |
| 3882 | .mnd_en_mask = BIT(5), |
| 3883 | .mode_mask = BM(7, 6), |
| 3884 | }, |
| 3885 | }; |
| 3886 | |
| 3887 | static struct rcg_clk mdp_clk = { |
| 3888 | .b = { |
| 3889 | .ctl_reg = MDP_CC_REG, |
| 3890 | .en_mask = BIT(0), |
| 3891 | .reset_reg = SW_RESET_CORE_REG, |
| 3892 | .reset_mask = BIT(21), |
| 3893 | .halt_reg = DBG_BUS_VEC_C_REG, |
| 3894 | .halt_bit = 10, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 3895 | .retain_reg = MDP_CC_REG, |
| 3896 | .retain_mask = BIT(31), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3897 | }, |
| 3898 | .ns_reg = MDP_NS_REG, |
| 3899 | .root_en_mask = BIT(2), |
| 3900 | .set_rate = set_rate_mnd_banked, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3901 | .freq_tbl = clk_tbl_mdp, |
Stephen Boyd | c78d9a7 | 2011-07-20 00:46:24 -0700 | [diff] [blame] | 3902 | .bank_info = &bmnd_info_mdp, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 3903 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3904 | .c = { |
| 3905 | .dbg_name = "mdp_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 3906 | .ops = &clk_ops_rcg, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3907 | VDD_DIG_FMAX_MAP2(LOW, 96000000, NOMINAL, 200000000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3908 | CLK_INIT(mdp_clk.c), |
Stephen Boyd | 7fa2674 | 2011-08-11 23:22:29 -0700 | [diff] [blame] | 3909 | .depends = &mdp_axi_clk.c, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3910 | }, |
| 3911 | }; |
| 3912 | |
| 3913 | static struct branch_clk lut_mdp_clk = { |
| 3914 | .b = { |
| 3915 | .ctl_reg = MDP_LUT_CC_REG, |
| 3916 | .en_mask = BIT(0), |
| 3917 | .halt_reg = DBG_BUS_VEC_I_REG, |
| 3918 | .halt_bit = 13, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 3919 | .retain_reg = MDP_LUT_CC_REG, |
| 3920 | .retain_mask = BIT(31), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3921 | }, |
| 3922 | .parent = &mdp_clk.c, |
| 3923 | .c = { |
| 3924 | .dbg_name = "lut_mdp_clk", |
| 3925 | .ops = &clk_ops_branch, |
| 3926 | CLK_INIT(lut_mdp_clk.c), |
| 3927 | }, |
| 3928 | }; |
| 3929 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3930 | #define F_MDP_VSYNC(f, s) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3931 | { \ |
| 3932 | .freq_hz = f, \ |
| 3933 | .src_clk = &s##_clk.c, \ |
| 3934 | .ns_val = NS_SRC_SEL(13, 13, s##_to_bb_mux), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3935 | } |
| 3936 | static struct clk_freq_tbl clk_tbl_mdp_vsync[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3937 | F_MDP_VSYNC(27000000, pxo), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3938 | F_END |
| 3939 | }; |
| 3940 | |
| 3941 | static struct rcg_clk mdp_vsync_clk = { |
| 3942 | .b = { |
| 3943 | .ctl_reg = MISC_CC_REG, |
| 3944 | .en_mask = BIT(6), |
| 3945 | .reset_reg = SW_RESET_CORE_REG, |
| 3946 | .reset_mask = BIT(3), |
| 3947 | .halt_reg = DBG_BUS_VEC_B_REG, |
| 3948 | .halt_bit = 22, |
| 3949 | }, |
| 3950 | .ns_reg = MISC_CC2_REG, |
| 3951 | .ns_mask = BIT(13), |
| 3952 | .set_rate = set_rate_nop, |
| 3953 | .freq_tbl = clk_tbl_mdp_vsync, |
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_vsync_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_MAP1(LOW, 27000000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3959 | CLK_INIT(mdp_vsync_clk.c), |
| 3960 | }, |
| 3961 | }; |
| 3962 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3963 | #define F_ROT(f, s, d) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3964 | { \ |
| 3965 | .freq_hz = f, \ |
| 3966 | .src_clk = &s##_clk.c, \ |
| 3967 | .ns_val = NS_DIVSRC_BANKED(29, 26, 25, 22, d, \ |
| 3968 | 21, 19, 18, 16, s##_to_mm_mux), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3969 | } |
| 3970 | static struct clk_freq_tbl clk_tbl_rot[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 3971 | F_ROT( 0, gnd, 1), |
| 3972 | F_ROT( 27000000, pxo, 1), |
| 3973 | F_ROT( 29540000, pll8, 13), |
| 3974 | F_ROT( 32000000, pll8, 12), |
| 3975 | F_ROT( 38400000, pll8, 10), |
| 3976 | F_ROT( 48000000, pll8, 8), |
| 3977 | F_ROT( 54860000, pll8, 7), |
| 3978 | F_ROT( 64000000, pll8, 6), |
| 3979 | F_ROT( 76800000, pll8, 5), |
| 3980 | F_ROT( 96000000, pll8, 4), |
| 3981 | F_ROT(100000000, pll2, 8), |
| 3982 | F_ROT(114290000, pll2, 7), |
| 3983 | F_ROT(133330000, pll2, 6), |
| 3984 | F_ROT(160000000, pll2, 5), |
| 3985 | F_ROT(200000000, pll2, 4), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3986 | F_END |
| 3987 | }; |
| 3988 | |
| 3989 | static struct bank_masks bdiv_info_rot = { |
| 3990 | .bank_sel_mask = BIT(30), |
| 3991 | .bank0_mask = { |
| 3992 | .ns_mask = BM(25, 22) | BM(18, 16), |
| 3993 | }, |
| 3994 | .bank1_mask = { |
| 3995 | .ns_mask = BM(29, 26) | BM(21, 19), |
| 3996 | }, |
| 3997 | }; |
| 3998 | |
| 3999 | static struct rcg_clk rot_clk = { |
| 4000 | .b = { |
| 4001 | .ctl_reg = ROT_CC_REG, |
| 4002 | .en_mask = BIT(0), |
| 4003 | .reset_reg = SW_RESET_CORE_REG, |
| 4004 | .reset_mask = BIT(2), |
| 4005 | .halt_reg = DBG_BUS_VEC_C_REG, |
| 4006 | .halt_bit = 15, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 4007 | .retain_reg = ROT_CC_REG, |
| 4008 | .retain_mask = BIT(31), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4009 | }, |
| 4010 | .ns_reg = ROT_NS_REG, |
| 4011 | .root_en_mask = BIT(2), |
| 4012 | .set_rate = set_rate_div_banked, |
| 4013 | .freq_tbl = clk_tbl_rot, |
Stephen Boyd | c78d9a7 | 2011-07-20 00:46:24 -0700 | [diff] [blame] | 4014 | .bank_info = &bdiv_info_rot, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 4015 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4016 | .c = { |
| 4017 | .dbg_name = "rot_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 4018 | .ops = &clk_ops_rcg, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 4019 | VDD_DIG_FMAX_MAP2(LOW, 96000000, NOMINAL, 200000000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4020 | CLK_INIT(rot_clk.c), |
Stephen Boyd | 7fa2674 | 2011-08-11 23:22:29 -0700 | [diff] [blame] | 4021 | .depends = &rot_axi_clk.c, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4022 | }, |
| 4023 | }; |
| 4024 | |
Matt Wagantall | f82f294 | 2012-01-27 13:56:13 -0800 | [diff] [blame] | 4025 | static int hdmi_pll_clk_enable(struct clk *c) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4026 | { |
| 4027 | int ret; |
| 4028 | unsigned long flags; |
| 4029 | spin_lock_irqsave(&local_clock_reg_lock, flags); |
| 4030 | ret = hdmi_pll_enable(); |
| 4031 | spin_unlock_irqrestore(&local_clock_reg_lock, flags); |
| 4032 | return ret; |
| 4033 | } |
| 4034 | |
Matt Wagantall | f82f294 | 2012-01-27 13:56:13 -0800 | [diff] [blame] | 4035 | static void hdmi_pll_clk_disable(struct clk *c) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4036 | { |
| 4037 | unsigned long flags; |
| 4038 | spin_lock_irqsave(&local_clock_reg_lock, flags); |
| 4039 | hdmi_pll_disable(); |
| 4040 | spin_unlock_irqrestore(&local_clock_reg_lock, flags); |
| 4041 | } |
| 4042 | |
Matt Wagantall | f82f294 | 2012-01-27 13:56:13 -0800 | [diff] [blame] | 4043 | static struct clk *hdmi_pll_clk_get_parent(struct clk *c) |
Stephen Boyd | 5b35dee | 2011-09-21 12:17:38 -0700 | [diff] [blame] | 4044 | { |
| 4045 | return &pxo_clk.c; |
| 4046 | } |
| 4047 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4048 | static struct clk_ops clk_ops_hdmi_pll = { |
| 4049 | .enable = hdmi_pll_clk_enable, |
| 4050 | .disable = hdmi_pll_clk_disable, |
Stephen Boyd | 5b35dee | 2011-09-21 12:17:38 -0700 | [diff] [blame] | 4051 | .get_parent = hdmi_pll_clk_get_parent, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4052 | }; |
| 4053 | |
| 4054 | static struct clk hdmi_pll_clk = { |
| 4055 | .dbg_name = "hdmi_pll_clk", |
| 4056 | .ops = &clk_ops_hdmi_pll, |
Matt Wagantall | 82feaa1 | 2012-07-09 10:54:49 -0700 | [diff] [blame] | 4057 | .vdd_class = &vdd_sr2_hdmi_pll, |
| 4058 | .fmax[VDD_SR2_HDMI_PLL_ON] = ULONG_MAX, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4059 | CLK_INIT(hdmi_pll_clk), |
| 4060 | }; |
| 4061 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 4062 | #define F_TV_GND(f, s, p_r, d, m, n) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4063 | { \ |
| 4064 | .freq_hz = f, \ |
| 4065 | .src_clk = &s##_clk.c, \ |
| 4066 | .md_val = MD8(8, m, 0, n), \ |
| 4067 | .ns_val = NS_MM(23, 16, n, m, 15, 14, d, 2, 0, s##_to_mm_mux), \ |
| 4068 | .ctl_val = CC(6, n), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4069 | } |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 4070 | #define F_TV(f, s, p_r, d, m, n) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4071 | { \ |
| 4072 | .freq_hz = f, \ |
| 4073 | .src_clk = &s##_clk, \ |
| 4074 | .md_val = MD8(8, m, 0, n), \ |
| 4075 | .ns_val = NS_MM(23, 16, n, m, 15, 14, d, 2, 0, s##_to_mm_mux), \ |
| 4076 | .ctl_val = CC(6, n), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4077 | .extra_freq_data = (void *)p_r, \ |
| 4078 | } |
| 4079 | /* Switching TV freqs requires PLL reconfiguration. */ |
| 4080 | static struct clk_freq_tbl clk_tbl_tv[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 4081 | F_TV_GND( 0, gnd, 0, 1, 0, 0), |
| 4082 | F_TV( 25200000, hdmi_pll, 25200000, 1, 0, 0), |
| 4083 | F_TV( 27000000, hdmi_pll, 27000000, 1, 0, 0), |
| 4084 | F_TV( 27030000, hdmi_pll, 27030000, 1, 0, 0), |
| 4085 | F_TV( 74250000, hdmi_pll, 74250000, 1, 0, 0), |
| 4086 | F_TV(148500000, hdmi_pll, 148500000, 1, 0, 0), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4087 | F_END |
| 4088 | }; |
| 4089 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 4090 | static unsigned long fmax_tv_src_8064[MAX_VDD_LEVELS] __initdata = { |
| 4091 | [VDD_DIG_LOW] = 74250000, |
| 4092 | [VDD_DIG_NOMINAL] = 149000000 |
| 4093 | }; |
| 4094 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4095 | /* |
| 4096 | * Unlike other clocks, the TV rate is adjusted through PLL |
| 4097 | * re-programming. It is also routed through an MND divider. |
| 4098 | */ |
Matt Wagantall | f82f294 | 2012-01-27 13:56:13 -0800 | [diff] [blame] | 4099 | 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] | 4100 | { |
| 4101 | unsigned long pll_rate = (unsigned long)nf->extra_freq_data; |
Matt Wagantall | f6c39a1 | 2012-07-09 19:24:42 -0700 | [diff] [blame] | 4102 | if (pll_rate) { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4103 | hdmi_pll_set_rate(pll_rate); |
Matt Wagantall | f6c39a1 | 2012-07-09 19:24:42 -0700 | [diff] [blame] | 4104 | hdmi_pll_clk.rate = pll_rate; |
| 4105 | } |
Matt Wagantall | f82f294 | 2012-01-27 13:56:13 -0800 | [diff] [blame] | 4106 | set_rate_mnd(rcg, nf); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4107 | } |
| 4108 | |
| 4109 | static struct rcg_clk tv_src_clk = { |
| 4110 | .ns_reg = TV_NS_REG, |
| 4111 | .b = { |
| 4112 | .ctl_reg = TV_CC_REG, |
| 4113 | .halt_check = NOCHECK, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 4114 | .retain_reg = TV_CC_REG, |
| 4115 | .retain_mask = BIT(31), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4116 | }, |
| 4117 | .md_reg = TV_MD_REG, |
| 4118 | .root_en_mask = BIT(2), |
| 4119 | .ns_mask = (BM(23, 16) | BM(15, 14) | BM(2, 0)), |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame] | 4120 | .mnd_en_mask = BIT(5), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4121 | .ctl_mask = BM(7, 6), |
| 4122 | .set_rate = set_rate_tv, |
| 4123 | .freq_tbl = clk_tbl_tv, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 4124 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4125 | .c = { |
| 4126 | .dbg_name = "tv_src_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 4127 | .ops = &clk_ops_rcg, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 4128 | VDD_DIG_FMAX_MAP2(LOW, 27030000, NOMINAL, 149000000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4129 | CLK_INIT(tv_src_clk.c), |
| 4130 | }, |
| 4131 | }; |
| 4132 | |
Tianyi Gou | 5191880 | 2012-01-26 14:05:43 -0800 | [diff] [blame] | 4133 | static struct cdiv_clk tv_src_div_clk = { |
| 4134 | .b = { |
| 4135 | .ctl_reg = TV_NS_REG, |
| 4136 | .halt_check = NOCHECK, |
| 4137 | }, |
| 4138 | .ns_reg = TV_NS_REG, |
| 4139 | .div_offset = 6, |
| 4140 | .max_div = 2, |
| 4141 | .c = { |
| 4142 | .dbg_name = "tv_src_div_clk", |
| 4143 | .ops = &clk_ops_cdiv, |
| 4144 | CLK_INIT(tv_src_div_clk.c), |
Stephen Boyd | d51d5e8 | 2012-06-18 18:09:50 -0700 | [diff] [blame] | 4145 | .rate = ULONG_MAX, |
Tianyi Gou | 5191880 | 2012-01-26 14:05:43 -0800 | [diff] [blame] | 4146 | }, |
| 4147 | }; |
| 4148 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4149 | static struct branch_clk tv_enc_clk = { |
| 4150 | .b = { |
| 4151 | .ctl_reg = TV_CC_REG, |
| 4152 | .en_mask = BIT(8), |
| 4153 | .reset_reg = SW_RESET_CORE_REG, |
| 4154 | .reset_mask = BIT(0), |
| 4155 | .halt_reg = DBG_BUS_VEC_D_REG, |
| 4156 | .halt_bit = 9, |
| 4157 | }, |
| 4158 | .parent = &tv_src_clk.c, |
| 4159 | .c = { |
| 4160 | .dbg_name = "tv_enc_clk", |
| 4161 | .ops = &clk_ops_branch, |
| 4162 | CLK_INIT(tv_enc_clk.c), |
| 4163 | }, |
| 4164 | }; |
| 4165 | |
| 4166 | static struct branch_clk tv_dac_clk = { |
| 4167 | .b = { |
| 4168 | .ctl_reg = TV_CC_REG, |
| 4169 | .en_mask = BIT(10), |
| 4170 | .halt_reg = DBG_BUS_VEC_D_REG, |
| 4171 | .halt_bit = 10, |
| 4172 | }, |
| 4173 | .parent = &tv_src_clk.c, |
| 4174 | .c = { |
| 4175 | .dbg_name = "tv_dac_clk", |
| 4176 | .ops = &clk_ops_branch, |
| 4177 | CLK_INIT(tv_dac_clk.c), |
| 4178 | }, |
| 4179 | }; |
| 4180 | |
| 4181 | static struct branch_clk mdp_tv_clk = { |
| 4182 | .b = { |
| 4183 | .ctl_reg = TV_CC_REG, |
| 4184 | .en_mask = BIT(0), |
| 4185 | .reset_reg = SW_RESET_CORE_REG, |
| 4186 | .reset_mask = BIT(4), |
| 4187 | .halt_reg = DBG_BUS_VEC_D_REG, |
| 4188 | .halt_bit = 12, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 4189 | .retain_reg = TV_CC2_REG, |
| 4190 | .retain_mask = BIT(10), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4191 | }, |
| 4192 | .parent = &tv_src_clk.c, |
| 4193 | .c = { |
| 4194 | .dbg_name = "mdp_tv_clk", |
| 4195 | .ops = &clk_ops_branch, |
| 4196 | CLK_INIT(mdp_tv_clk.c), |
| 4197 | }, |
| 4198 | }; |
| 4199 | |
| 4200 | static struct branch_clk hdmi_tv_clk = { |
| 4201 | .b = { |
| 4202 | .ctl_reg = TV_CC_REG, |
| 4203 | .en_mask = BIT(12), |
| 4204 | .reset_reg = SW_RESET_CORE_REG, |
| 4205 | .reset_mask = BIT(1), |
| 4206 | .halt_reg = DBG_BUS_VEC_D_REG, |
| 4207 | .halt_bit = 11, |
| 4208 | }, |
| 4209 | .parent = &tv_src_clk.c, |
| 4210 | .c = { |
| 4211 | .dbg_name = "hdmi_tv_clk", |
| 4212 | .ops = &clk_ops_branch, |
| 4213 | CLK_INIT(hdmi_tv_clk.c), |
| 4214 | }, |
| 4215 | }; |
| 4216 | |
Tianyi Gou | 5191880 | 2012-01-26 14:05:43 -0800 | [diff] [blame] | 4217 | static struct branch_clk rgb_tv_clk = { |
| 4218 | .b = { |
| 4219 | .ctl_reg = TV_CC2_REG, |
| 4220 | .en_mask = BIT(14), |
| 4221 | .halt_reg = DBG_BUS_VEC_J_REG, |
| 4222 | .halt_bit = 27, |
| 4223 | }, |
| 4224 | .parent = &tv_src_clk.c, |
| 4225 | .c = { |
| 4226 | .dbg_name = "rgb_tv_clk", |
| 4227 | .ops = &clk_ops_branch, |
| 4228 | CLK_INIT(rgb_tv_clk.c), |
| 4229 | }, |
| 4230 | }; |
| 4231 | |
| 4232 | static struct branch_clk npl_tv_clk = { |
| 4233 | .b = { |
| 4234 | .ctl_reg = TV_CC2_REG, |
| 4235 | .en_mask = BIT(16), |
| 4236 | .halt_reg = DBG_BUS_VEC_J_REG, |
| 4237 | .halt_bit = 26, |
| 4238 | }, |
| 4239 | .parent = &tv_src_clk.c, |
| 4240 | .c = { |
| 4241 | .dbg_name = "npl_tv_clk", |
| 4242 | .ops = &clk_ops_branch, |
| 4243 | CLK_INIT(npl_tv_clk.c), |
| 4244 | }, |
| 4245 | }; |
| 4246 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4247 | static struct branch_clk hdmi_app_clk = { |
| 4248 | .b = { |
| 4249 | .ctl_reg = MISC_CC2_REG, |
| 4250 | .en_mask = BIT(11), |
| 4251 | .reset_reg = SW_RESET_CORE_REG, |
| 4252 | .reset_mask = BIT(11), |
| 4253 | .halt_reg = DBG_BUS_VEC_B_REG, |
| 4254 | .halt_bit = 25, |
| 4255 | }, |
| 4256 | .c = { |
| 4257 | .dbg_name = "hdmi_app_clk", |
| 4258 | .ops = &clk_ops_branch, |
| 4259 | CLK_INIT(hdmi_app_clk.c), |
| 4260 | }, |
| 4261 | }; |
| 4262 | |
| 4263 | static struct bank_masks bmnd_info_vcodec = { |
| 4264 | .bank_sel_mask = BIT(13), |
| 4265 | .bank0_mask = { |
| 4266 | .md_reg = VCODEC_MD0_REG, |
| 4267 | .ns_mask = BM(18, 11) | BM(2, 0), |
| 4268 | .rst_mask = BIT(31), |
| 4269 | .mnd_en_mask = BIT(5), |
| 4270 | .mode_mask = BM(7, 6), |
| 4271 | }, |
| 4272 | .bank1_mask = { |
| 4273 | .md_reg = VCODEC_MD1_REG, |
| 4274 | .ns_mask = BM(26, 19) | BM(29, 27), |
| 4275 | .rst_mask = BIT(30), |
| 4276 | .mnd_en_mask = BIT(10), |
| 4277 | .mode_mask = BM(12, 11), |
| 4278 | }, |
| 4279 | }; |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 4280 | #define F_VCODEC(f, s, m, n) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4281 | { \ |
| 4282 | .freq_hz = f, \ |
| 4283 | .src_clk = &s##_clk.c, \ |
| 4284 | .md_val = MD8(8, m, 0, n), \ |
| 4285 | .ns_val = NS_MND_BANKED8(11, 19, n, m, 0, 27, s##_to_mm_mux), \ |
| 4286 | .ctl_val = CC_BANKED(6, 11, n), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4287 | } |
| 4288 | static struct clk_freq_tbl clk_tbl_vcodec[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 4289 | F_VCODEC( 0, gnd, 0, 0), |
| 4290 | F_VCODEC( 27000000, pxo, 0, 0), |
| 4291 | F_VCODEC( 32000000, pll8, 1, 12), |
| 4292 | F_VCODEC( 48000000, pll8, 1, 8), |
| 4293 | F_VCODEC( 54860000, pll8, 1, 7), |
| 4294 | F_VCODEC( 96000000, pll8, 1, 4), |
| 4295 | F_VCODEC(133330000, pll2, 1, 6), |
| 4296 | F_VCODEC(200000000, pll2, 1, 4), |
| 4297 | F_VCODEC(228570000, pll2, 2, 7), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4298 | F_END |
| 4299 | }; |
| 4300 | |
| 4301 | static struct rcg_clk vcodec_clk = { |
| 4302 | .b = { |
| 4303 | .ctl_reg = VCODEC_CC_REG, |
| 4304 | .en_mask = BIT(0), |
| 4305 | .reset_reg = SW_RESET_CORE_REG, |
| 4306 | .reset_mask = BIT(6), |
| 4307 | .halt_reg = DBG_BUS_VEC_C_REG, |
| 4308 | .halt_bit = 29, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 4309 | .retain_reg = VCODEC_CC_REG, |
| 4310 | .retain_mask = BIT(31), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4311 | }, |
| 4312 | .ns_reg = VCODEC_NS_REG, |
| 4313 | .root_en_mask = BIT(2), |
| 4314 | .set_rate = set_rate_mnd_banked, |
Stephen Boyd | c78d9a7 | 2011-07-20 00:46:24 -0700 | [diff] [blame] | 4315 | .bank_info = &bmnd_info_vcodec, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4316 | .freq_tbl = clk_tbl_vcodec, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 4317 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4318 | .c = { |
| 4319 | .dbg_name = "vcodec_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 4320 | .ops = &clk_ops_rcg, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 4321 | VDD_DIG_FMAX_MAP3(LOW, 100000000, NOMINAL, 200000000, |
| 4322 | HIGH, 228571000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4323 | CLK_INIT(vcodec_clk.c), |
Stephen Boyd | 7fa2674 | 2011-08-11 23:22:29 -0700 | [diff] [blame] | 4324 | .depends = &vcodec_axi_clk.c, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4325 | }, |
| 4326 | }; |
| 4327 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 4328 | #define F_VPE(f, s, d) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4329 | { \ |
| 4330 | .freq_hz = f, \ |
| 4331 | .src_clk = &s##_clk.c, \ |
| 4332 | .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] | 4333 | } |
| 4334 | static struct clk_freq_tbl clk_tbl_vpe[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 4335 | F_VPE( 0, gnd, 1), |
| 4336 | F_VPE( 27000000, pxo, 1), |
| 4337 | F_VPE( 34909000, pll8, 11), |
| 4338 | F_VPE( 38400000, pll8, 10), |
| 4339 | F_VPE( 64000000, pll8, 6), |
| 4340 | F_VPE( 76800000, pll8, 5), |
| 4341 | F_VPE( 96000000, pll8, 4), |
| 4342 | F_VPE(100000000, pll2, 8), |
| 4343 | F_VPE(160000000, pll2, 5), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4344 | F_END |
| 4345 | }; |
| 4346 | |
| 4347 | static struct rcg_clk vpe_clk = { |
| 4348 | .b = { |
| 4349 | .ctl_reg = VPE_CC_REG, |
| 4350 | .en_mask = BIT(0), |
| 4351 | .reset_reg = SW_RESET_CORE_REG, |
| 4352 | .reset_mask = BIT(17), |
| 4353 | .halt_reg = DBG_BUS_VEC_A_REG, |
| 4354 | .halt_bit = 28, |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 4355 | .retain_reg = VPE_CC_REG, |
| 4356 | .retain_mask = BIT(31), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4357 | }, |
| 4358 | .ns_reg = VPE_NS_REG, |
| 4359 | .root_en_mask = BIT(2), |
| 4360 | .ns_mask = (BM(15, 12) | BM(2, 0)), |
| 4361 | .set_rate = set_rate_nop, |
| 4362 | .freq_tbl = clk_tbl_vpe, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 4363 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4364 | .c = { |
| 4365 | .dbg_name = "vpe_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 4366 | .ops = &clk_ops_rcg, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 4367 | VDD_DIG_FMAX_MAP2(LOW, 76800000, NOMINAL, 160000000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4368 | CLK_INIT(vpe_clk.c), |
Stephen Boyd | 7fa2674 | 2011-08-11 23:22:29 -0700 | [diff] [blame] | 4369 | .depends = &vpe_axi_clk.c, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4370 | }, |
| 4371 | }; |
| 4372 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 4373 | #define F_VFE(f, s, d, m, n) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4374 | { \ |
| 4375 | .freq_hz = f, \ |
| 4376 | .src_clk = &s##_clk.c, \ |
| 4377 | .md_val = MD8(8, m, 0, n), \ |
| 4378 | .ns_val = NS_MM(23, 16, n, m, 11, 10, d, 2, 0, s##_to_mm_mux), \ |
| 4379 | .ctl_val = CC(6, n), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4380 | } |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 4381 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 4382 | static struct clk_freq_tbl clk_tbl_vfe[] = { |
| 4383 | F_VFE( 0, gnd, 1, 0, 0), |
| 4384 | F_VFE( 13960000, pll8, 1, 2, 55), |
| 4385 | F_VFE( 27000000, pxo, 1, 0, 0), |
| 4386 | F_VFE( 36570000, pll8, 1, 2, 21), |
| 4387 | F_VFE( 38400000, pll8, 2, 1, 5), |
| 4388 | F_VFE( 45180000, pll8, 1, 2, 17), |
| 4389 | F_VFE( 48000000, pll8, 2, 1, 4), |
| 4390 | F_VFE( 54860000, pll8, 1, 1, 7), |
| 4391 | F_VFE( 64000000, pll8, 2, 1, 3), |
| 4392 | F_VFE( 76800000, pll8, 1, 1, 5), |
| 4393 | F_VFE( 96000000, pll8, 2, 1, 2), |
| 4394 | F_VFE(109710000, pll8, 1, 2, 7), |
| 4395 | F_VFE(128000000, pll8, 1, 1, 3), |
| 4396 | F_VFE(153600000, pll8, 1, 2, 5), |
| 4397 | F_VFE(200000000, pll2, 2, 1, 2), |
| 4398 | F_VFE(228570000, pll2, 1, 2, 7), |
| 4399 | F_VFE(266667000, pll2, 1, 1, 3), |
| 4400 | F_VFE(320000000, pll2, 1, 2, 5), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4401 | F_END |
| 4402 | }; |
| 4403 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 4404 | static unsigned long fmax_vfe_8064[MAX_VDD_LEVELS] __initdata = { |
| 4405 | [VDD_DIG_LOW] = 128000000, |
| 4406 | [VDD_DIG_NOMINAL] = 266667000, |
| 4407 | [VDD_DIG_HIGH] = 320000000 |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 4408 | }; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4409 | |
| 4410 | static struct rcg_clk vfe_clk = { |
| 4411 | .b = { |
| 4412 | .ctl_reg = VFE_CC_REG, |
| 4413 | .reset_reg = SW_RESET_CORE_REG, |
| 4414 | .reset_mask = BIT(15), |
| 4415 | .halt_reg = DBG_BUS_VEC_B_REG, |
| 4416 | .halt_bit = 6, |
| 4417 | .en_mask = BIT(0), |
Matt Wagantall | 7e0b6c9 | 2012-01-20 18:48:05 -0800 | [diff] [blame] | 4418 | .retain_reg = VFE_CC2_REG, |
| 4419 | .retain_mask = BIT(31), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4420 | }, |
| 4421 | .ns_reg = VFE_NS_REG, |
| 4422 | .md_reg = VFE_MD_REG, |
| 4423 | .root_en_mask = BIT(2), |
| 4424 | .ns_mask = (BM(23, 16) | BM(11, 10) | BM(2, 0)), |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame] | 4425 | .mnd_en_mask = BIT(5), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4426 | .ctl_mask = BM(7, 6), |
| 4427 | .set_rate = set_rate_mnd, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 4428 | .freq_tbl = clk_tbl_vfe, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 4429 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4430 | .c = { |
| 4431 | .dbg_name = "vfe_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 4432 | .ops = &clk_ops_rcg, |
Tianyi Gou | 3022dfd | 2012-01-25 15:50:05 -0800 | [diff] [blame] | 4433 | VDD_DIG_FMAX_MAP3(LOW, 110000000, NOMINAL, 266667000, |
| 4434 | HIGH, 320000000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4435 | CLK_INIT(vfe_clk.c), |
Stephen Boyd | 7fa2674 | 2011-08-11 23:22:29 -0700 | [diff] [blame] | 4436 | .depends = &vfe_axi_clk.c, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4437 | }, |
| 4438 | }; |
| 4439 | |
Matt Wagantall | c23eee9 | 2011-08-16 23:06:52 -0700 | [diff] [blame] | 4440 | static struct branch_clk csi_vfe_clk = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4441 | .b = { |
| 4442 | .ctl_reg = VFE_CC_REG, |
| 4443 | .en_mask = BIT(12), |
| 4444 | .reset_reg = SW_RESET_CORE_REG, |
| 4445 | .reset_mask = BIT(24), |
| 4446 | .halt_reg = DBG_BUS_VEC_B_REG, |
| 4447 | .halt_bit = 8, |
| 4448 | }, |
| 4449 | .parent = &vfe_clk.c, |
| 4450 | .c = { |
Matt Wagantall | c23eee9 | 2011-08-16 23:06:52 -0700 | [diff] [blame] | 4451 | .dbg_name = "csi_vfe_clk", |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4452 | .ops = &clk_ops_branch, |
Matt Wagantall | c23eee9 | 2011-08-16 23:06:52 -0700 | [diff] [blame] | 4453 | CLK_INIT(csi_vfe_clk.c), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4454 | }, |
| 4455 | }; |
| 4456 | |
| 4457 | /* |
| 4458 | * Low Power Audio Clocks |
| 4459 | */ |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 4460 | #define F_AIF_OSR(f, s, d, m, n) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4461 | { \ |
| 4462 | .freq_hz = f, \ |
| 4463 | .src_clk = &s##_clk.c, \ |
| 4464 | .md_val = MD8(8, m, 0, n), \ |
| 4465 | .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] | 4466 | } |
Matt Wagantall | 86e0382 | 2011-12-12 10:59:24 -0800 | [diff] [blame] | 4467 | static struct clk_freq_tbl clk_tbl_aif_osr_492[] = { |
| 4468 | F_AIF_OSR( 0, gnd, 1, 0, 0), |
| 4469 | F_AIF_OSR( 512000, pll4, 4, 1, 240), |
| 4470 | F_AIF_OSR( 768000, pll4, 4, 1, 160), |
| 4471 | F_AIF_OSR( 1024000, pll4, 4, 1, 120), |
| 4472 | F_AIF_OSR( 1536000, pll4, 4, 1, 80), |
| 4473 | F_AIF_OSR( 2048000, pll4, 4, 1, 60), |
| 4474 | F_AIF_OSR( 3072000, pll4, 4, 1, 40), |
| 4475 | F_AIF_OSR( 4096000, pll4, 4, 1, 30), |
| 4476 | F_AIF_OSR( 6144000, pll4, 4, 1, 20), |
| 4477 | F_AIF_OSR( 8192000, pll4, 4, 1, 15), |
| 4478 | F_AIF_OSR(12288000, pll4, 4, 1, 10), |
| 4479 | F_AIF_OSR(24576000, pll4, 4, 1, 5), |
| 4480 | F_END |
| 4481 | }; |
| 4482 | |
| 4483 | static struct clk_freq_tbl clk_tbl_aif_osr_393[] = { |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 4484 | F_AIF_OSR( 0, gnd, 1, 0, 0), |
| 4485 | F_AIF_OSR( 512000, pll4, 4, 1, 192), |
| 4486 | F_AIF_OSR( 768000, pll4, 4, 1, 128), |
| 4487 | F_AIF_OSR( 1024000, pll4, 4, 1, 96), |
| 4488 | F_AIF_OSR( 1536000, pll4, 4, 1, 64), |
| 4489 | F_AIF_OSR( 2048000, pll4, 4, 1, 48), |
| 4490 | F_AIF_OSR( 3072000, pll4, 4, 1, 32), |
| 4491 | F_AIF_OSR( 4096000, pll4, 4, 1, 24), |
| 4492 | F_AIF_OSR( 6144000, pll4, 4, 1, 16), |
| 4493 | F_AIF_OSR( 8192000, pll4, 4, 1, 12), |
| 4494 | F_AIF_OSR(12288000, pll4, 4, 1, 8), |
| 4495 | F_AIF_OSR(24576000, pll4, 4, 1, 4), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4496 | F_END |
| 4497 | }; |
| 4498 | |
| 4499 | #define CLK_AIF_OSR(i, ns, md, h_r) \ |
| 4500 | struct rcg_clk i##_clk = { \ |
| 4501 | .b = { \ |
| 4502 | .ctl_reg = ns, \ |
| 4503 | .en_mask = BIT(17), \ |
| 4504 | .reset_reg = ns, \ |
| 4505 | .reset_mask = BIT(19), \ |
| 4506 | .halt_reg = h_r, \ |
| 4507 | .halt_check = ENABLE, \ |
| 4508 | .halt_bit = 1, \ |
| 4509 | }, \ |
| 4510 | .ns_reg = ns, \ |
| 4511 | .md_reg = md, \ |
| 4512 | .root_en_mask = BIT(9), \ |
| 4513 | .ns_mask = (BM(31, 24) | BM(6, 0)), \ |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame] | 4514 | .mnd_en_mask = BIT(8), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4515 | .set_rate = set_rate_mnd, \ |
Matt Wagantall | 86e0382 | 2011-12-12 10:59:24 -0800 | [diff] [blame] | 4516 | .freq_tbl = clk_tbl_aif_osr_393, \ |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 4517 | .current_freq = &rcg_dummy_freq, \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4518 | .c = { \ |
| 4519 | .dbg_name = #i "_clk", \ |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 4520 | .ops = &clk_ops_rcg, \ |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 4521 | VDD_DIG_FMAX_MAP1(LOW, 24576000), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4522 | CLK_INIT(i##_clk.c), \ |
| 4523 | }, \ |
| 4524 | } |
| 4525 | #define CLK_AIF_OSR_DIV(i, ns, md, h_r) \ |
| 4526 | struct rcg_clk i##_clk = { \ |
| 4527 | .b = { \ |
| 4528 | .ctl_reg = ns, \ |
| 4529 | .en_mask = BIT(21), \ |
| 4530 | .reset_reg = ns, \ |
| 4531 | .reset_mask = BIT(23), \ |
| 4532 | .halt_reg = h_r, \ |
| 4533 | .halt_check = ENABLE, \ |
| 4534 | .halt_bit = 1, \ |
| 4535 | }, \ |
| 4536 | .ns_reg = ns, \ |
| 4537 | .md_reg = md, \ |
| 4538 | .root_en_mask = BIT(9), \ |
| 4539 | .ns_mask = (BM(31, 24) | BM(6, 0)), \ |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame] | 4540 | .mnd_en_mask = BIT(8), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4541 | .set_rate = set_rate_mnd, \ |
Matt Wagantall | 86e0382 | 2011-12-12 10:59:24 -0800 | [diff] [blame] | 4542 | .freq_tbl = clk_tbl_aif_osr_393, \ |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 4543 | .current_freq = &rcg_dummy_freq, \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4544 | .c = { \ |
| 4545 | .dbg_name = #i "_clk", \ |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 4546 | .ops = &clk_ops_rcg, \ |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 4547 | VDD_DIG_FMAX_MAP1(LOW, 24576000), \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4548 | CLK_INIT(i##_clk.c), \ |
| 4549 | }, \ |
| 4550 | } |
| 4551 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4552 | #define CLK_AIF_BIT(i, ns, h_r) \ |
Stephen Boyd | 9fd1964 | 2011-11-16 11:11:09 -0800 | [diff] [blame] | 4553 | struct cdiv_clk i##_clk = { \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4554 | .b = { \ |
| 4555 | .ctl_reg = ns, \ |
| 4556 | .en_mask = BIT(15), \ |
| 4557 | .halt_reg = h_r, \ |
| 4558 | .halt_check = DELAY, \ |
| 4559 | }, \ |
| 4560 | .ns_reg = ns, \ |
Stephen Boyd | 9fd1964 | 2011-11-16 11:11:09 -0800 | [diff] [blame] | 4561 | .ext_mask = BIT(14), \ |
| 4562 | .div_offset = 10, \ |
| 4563 | .max_div = 16, \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4564 | .c = { \ |
| 4565 | .dbg_name = #i "_clk", \ |
Stephen Boyd | 9fd1964 | 2011-11-16 11:11:09 -0800 | [diff] [blame] | 4566 | .ops = &clk_ops_cdiv, \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4567 | CLK_INIT(i##_clk.c), \ |
Stephen Boyd | d51d5e8 | 2012-06-18 18:09:50 -0700 | [diff] [blame] | 4568 | .rate = ULONG_MAX, \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4569 | }, \ |
| 4570 | } |
| 4571 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4572 | #define CLK_AIF_BIT_DIV(i, ns, h_r) \ |
Stephen Boyd | 9fd1964 | 2011-11-16 11:11:09 -0800 | [diff] [blame] | 4573 | struct cdiv_clk i##_clk = { \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4574 | .b = { \ |
| 4575 | .ctl_reg = ns, \ |
| 4576 | .en_mask = BIT(19), \ |
| 4577 | .halt_reg = h_r, \ |
Stephen Boyd | 7bb9cf8 | 2012-01-25 18:09:01 -0800 | [diff] [blame] | 4578 | .halt_check = DELAY, \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4579 | }, \ |
| 4580 | .ns_reg = ns, \ |
Stephen Boyd | 9fd1964 | 2011-11-16 11:11:09 -0800 | [diff] [blame] | 4581 | .ext_mask = BIT(18), \ |
| 4582 | .div_offset = 10, \ |
| 4583 | .max_div = 256, \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4584 | .c = { \ |
| 4585 | .dbg_name = #i "_clk", \ |
Stephen Boyd | 9fd1964 | 2011-11-16 11:11:09 -0800 | [diff] [blame] | 4586 | .ops = &clk_ops_cdiv, \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4587 | CLK_INIT(i##_clk.c), \ |
Stephen Boyd | d51d5e8 | 2012-06-18 18:09:50 -0700 | [diff] [blame] | 4588 | .rate = ULONG_MAX, \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4589 | }, \ |
| 4590 | } |
| 4591 | |
| 4592 | static CLK_AIF_OSR(mi2s_osr, LCC_MI2S_NS_REG, LCC_MI2S_MD_REG, |
| 4593 | LCC_MI2S_STATUS_REG); |
| 4594 | static CLK_AIF_BIT(mi2s_bit, LCC_MI2S_NS_REG, LCC_MI2S_STATUS_REG); |
| 4595 | |
| 4596 | static CLK_AIF_OSR_DIV(codec_i2s_mic_osr, LCC_CODEC_I2S_MIC_NS_REG, |
| 4597 | LCC_CODEC_I2S_MIC_MD_REG, LCC_CODEC_I2S_MIC_STATUS_REG); |
| 4598 | static CLK_AIF_BIT_DIV(codec_i2s_mic_bit, LCC_CODEC_I2S_MIC_NS_REG, |
| 4599 | LCC_CODEC_I2S_MIC_STATUS_REG); |
| 4600 | |
| 4601 | static CLK_AIF_OSR_DIV(spare_i2s_mic_osr, LCC_SPARE_I2S_MIC_NS_REG, |
| 4602 | LCC_SPARE_I2S_MIC_MD_REG, LCC_SPARE_I2S_MIC_STATUS_REG); |
| 4603 | static CLK_AIF_BIT_DIV(spare_i2s_mic_bit, LCC_SPARE_I2S_MIC_NS_REG, |
| 4604 | LCC_SPARE_I2S_MIC_STATUS_REG); |
| 4605 | |
| 4606 | static CLK_AIF_OSR_DIV(codec_i2s_spkr_osr, LCC_CODEC_I2S_SPKR_NS_REG, |
| 4607 | LCC_CODEC_I2S_SPKR_MD_REG, LCC_CODEC_I2S_SPKR_STATUS_REG); |
| 4608 | static CLK_AIF_BIT_DIV(codec_i2s_spkr_bit, LCC_CODEC_I2S_SPKR_NS_REG, |
| 4609 | LCC_CODEC_I2S_SPKR_STATUS_REG); |
| 4610 | |
| 4611 | static CLK_AIF_OSR_DIV(spare_i2s_spkr_osr, LCC_SPARE_I2S_SPKR_NS_REG, |
| 4612 | LCC_SPARE_I2S_SPKR_MD_REG, LCC_SPARE_I2S_SPKR_STATUS_REG); |
| 4613 | static CLK_AIF_BIT_DIV(spare_i2s_spkr_bit, LCC_SPARE_I2S_SPKR_NS_REG, |
| 4614 | LCC_SPARE_I2S_SPKR_STATUS_REG); |
| 4615 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 4616 | #define F_PCM(f, s, d, m, n) \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4617 | { \ |
| 4618 | .freq_hz = f, \ |
| 4619 | .src_clk = &s##_clk.c, \ |
| 4620 | .md_val = MD16(m, n), \ |
| 4621 | .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] | 4622 | } |
Matt Wagantall | 86e0382 | 2011-12-12 10:59:24 -0800 | [diff] [blame] | 4623 | static struct clk_freq_tbl clk_tbl_pcm_492[] = { |
| 4624 | { .ns_val = BIT(10) /* external input */ }, |
Stephen Boyd | e9ed94d | 2012-08-02 10:57:11 -0700 | [diff] [blame] | 4625 | F_PCM( 256000, pll4, 4, 1, 480), |
Matt Wagantall | 86e0382 | 2011-12-12 10:59:24 -0800 | [diff] [blame] | 4626 | F_PCM( 512000, pll4, 4, 1, 240), |
| 4627 | F_PCM( 768000, pll4, 4, 1, 160), |
| 4628 | F_PCM( 1024000, pll4, 4, 1, 120), |
| 4629 | F_PCM( 1536000, pll4, 4, 1, 80), |
| 4630 | F_PCM( 2048000, pll4, 4, 1, 60), |
| 4631 | F_PCM( 3072000, pll4, 4, 1, 40), |
| 4632 | F_PCM( 4096000, pll4, 4, 1, 30), |
| 4633 | F_PCM( 6144000, pll4, 4, 1, 20), |
| 4634 | F_PCM( 8192000, pll4, 4, 1, 15), |
| 4635 | F_PCM(12288000, pll4, 4, 1, 10), |
| 4636 | F_PCM(24576000, pll4, 4, 1, 5), |
| 4637 | F_END |
| 4638 | }; |
| 4639 | |
| 4640 | static struct clk_freq_tbl clk_tbl_pcm_393[] = { |
Stephen Boyd | 630f325 | 2012-01-31 00:10:08 -0800 | [diff] [blame] | 4641 | { .ns_val = BIT(10) /* external input */ }, |
Stephen Boyd | e9ed94d | 2012-08-02 10:57:11 -0700 | [diff] [blame] | 4642 | F_PCM( 256000, pll4, 4, 1, 384), |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 4643 | F_PCM( 512000, pll4, 4, 1, 192), |
| 4644 | F_PCM( 768000, pll4, 4, 1, 128), |
| 4645 | F_PCM( 1024000, pll4, 4, 1, 96), |
| 4646 | F_PCM( 1536000, pll4, 4, 1, 64), |
| 4647 | F_PCM( 2048000, pll4, 4, 1, 48), |
| 4648 | F_PCM( 3072000, pll4, 4, 1, 32), |
| 4649 | F_PCM( 4096000, pll4, 4, 1, 24), |
| 4650 | F_PCM( 6144000, pll4, 4, 1, 16), |
| 4651 | F_PCM( 8192000, pll4, 4, 1, 12), |
| 4652 | F_PCM(12288000, pll4, 4, 1, 8), |
| 4653 | F_PCM(24576000, pll4, 4, 1, 4), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4654 | F_END |
| 4655 | }; |
| 4656 | |
| 4657 | static struct rcg_clk pcm_clk = { |
| 4658 | .b = { |
| 4659 | .ctl_reg = LCC_PCM_NS_REG, |
| 4660 | .en_mask = BIT(11), |
| 4661 | .reset_reg = LCC_PCM_NS_REG, |
| 4662 | .reset_mask = BIT(13), |
| 4663 | .halt_reg = LCC_PCM_STATUS_REG, |
| 4664 | .halt_check = ENABLE, |
| 4665 | .halt_bit = 0, |
| 4666 | }, |
| 4667 | .ns_reg = LCC_PCM_NS_REG, |
| 4668 | .md_reg = LCC_PCM_MD_REG, |
| 4669 | .root_en_mask = BIT(9), |
Stephen Boyd | 630f325 | 2012-01-31 00:10:08 -0800 | [diff] [blame] | 4670 | .ns_mask = BM(31, 16) | BIT(10) | BM(6, 0), |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame] | 4671 | .mnd_en_mask = BIT(8), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4672 | .set_rate = set_rate_mnd, |
Matt Wagantall | 86e0382 | 2011-12-12 10:59:24 -0800 | [diff] [blame] | 4673 | .freq_tbl = clk_tbl_pcm_393, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 4674 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4675 | .c = { |
| 4676 | .dbg_name = "pcm_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 4677 | .ops = &clk_ops_rcg, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 4678 | VDD_DIG_FMAX_MAP1(LOW, 24576000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4679 | CLK_INIT(pcm_clk.c), |
Stephen Boyd | c5492fc | 2012-06-18 18:47:03 -0700 | [diff] [blame] | 4680 | .rate = ULONG_MAX, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4681 | }, |
| 4682 | }; |
| 4683 | |
| 4684 | static struct rcg_clk audio_slimbus_clk = { |
| 4685 | .b = { |
| 4686 | .ctl_reg = LCC_SLIMBUS_NS_REG, |
| 4687 | .en_mask = BIT(10), |
| 4688 | .reset_reg = LCC_AHBEX_BRANCH_CTL_REG, |
| 4689 | .reset_mask = BIT(5), |
| 4690 | .halt_reg = LCC_SLIMBUS_STATUS_REG, |
| 4691 | .halt_check = ENABLE, |
| 4692 | .halt_bit = 0, |
| 4693 | }, |
| 4694 | .ns_reg = LCC_SLIMBUS_NS_REG, |
| 4695 | .md_reg = LCC_SLIMBUS_MD_REG, |
| 4696 | .root_en_mask = BIT(9), |
| 4697 | .ns_mask = (BM(31, 24) | BM(6, 0)), |
Matt Wagantall | 07c4547 | 2012-02-10 23:27:24 -0800 | [diff] [blame] | 4698 | .mnd_en_mask = BIT(8), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4699 | .set_rate = set_rate_mnd, |
Matt Wagantall | 86e0382 | 2011-12-12 10:59:24 -0800 | [diff] [blame] | 4700 | .freq_tbl = clk_tbl_aif_osr_393, |
Matt Wagantall | 84f43fd | 2011-08-16 23:28:38 -0700 | [diff] [blame] | 4701 | .current_freq = &rcg_dummy_freq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4702 | .c = { |
| 4703 | .dbg_name = "audio_slimbus_clk", |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 4704 | .ops = &clk_ops_rcg, |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 4705 | VDD_DIG_FMAX_MAP1(LOW, 24576000), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4706 | CLK_INIT(audio_slimbus_clk.c), |
| 4707 | }, |
| 4708 | }; |
| 4709 | |
| 4710 | static struct branch_clk sps_slimbus_clk = { |
| 4711 | .b = { |
| 4712 | .ctl_reg = LCC_SLIMBUS_NS_REG, |
| 4713 | .en_mask = BIT(12), |
| 4714 | .halt_reg = LCC_SLIMBUS_STATUS_REG, |
| 4715 | .halt_check = ENABLE, |
| 4716 | .halt_bit = 1, |
| 4717 | }, |
| 4718 | .parent = &audio_slimbus_clk.c, |
| 4719 | .c = { |
| 4720 | .dbg_name = "sps_slimbus_clk", |
| 4721 | .ops = &clk_ops_branch, |
| 4722 | CLK_INIT(sps_slimbus_clk.c), |
| 4723 | }, |
| 4724 | }; |
| 4725 | |
| 4726 | static struct branch_clk slimbus_xo_src_clk = { |
| 4727 | .b = { |
| 4728 | .ctl_reg = SLIMBUS_XO_SRC_CLK_CTL_REG, |
| 4729 | .en_mask = BIT(2), |
| 4730 | .halt_reg = CLK_HALT_DFAB_STATE_REG, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4731 | .halt_bit = 28, |
| 4732 | }, |
| 4733 | .parent = &sps_slimbus_clk.c, |
| 4734 | .c = { |
| 4735 | .dbg_name = "slimbus_xo_src_clk", |
| 4736 | .ops = &clk_ops_branch, |
| 4737 | CLK_INIT(slimbus_xo_src_clk.c), |
| 4738 | }, |
| 4739 | }; |
| 4740 | |
Matt Wagantall | 735f01a | 2011-08-12 12:40:28 -0700 | [diff] [blame] | 4741 | DEFINE_CLK_RPM(afab_clk, afab_a_clk, APPS_FABRIC, NULL); |
| 4742 | DEFINE_CLK_RPM(cfpb_clk, cfpb_a_clk, CFPB, NULL); |
| 4743 | DEFINE_CLK_RPM(dfab_clk, dfab_a_clk, DAYTONA_FABRIC, NULL); |
| 4744 | DEFINE_CLK_RPM(ebi1_clk, ebi1_a_clk, EBI1, NULL); |
| 4745 | DEFINE_CLK_RPM(mmfab_clk, mmfab_a_clk, MM_FABRIC, NULL); |
| 4746 | DEFINE_CLK_RPM(mmfpb_clk, mmfpb_a_clk, MMFPB, NULL); |
| 4747 | DEFINE_CLK_RPM(sfab_clk, sfab_a_clk, SYSTEM_FABRIC, NULL); |
| 4748 | DEFINE_CLK_RPM(sfpb_clk, sfpb_a_clk, SFPB, NULL); |
Stephen Boyd | c7fc3b1 | 2012-05-17 14:42:46 -0700 | [diff] [blame] | 4749 | DEFINE_CLK_RPM_QDSS(qdss_clk, qdss_a_clk); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4750 | |
Matt Wagantall | 35e78fc | 2012-04-05 14:18:44 -0700 | [diff] [blame] | 4751 | static DEFINE_CLK_VOTER(sfab_msmbus_a_clk, &sfab_a_clk.c, 0); |
| 4752 | 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] | 4753 | |
Matt Wagantall | 35e78fc | 2012-04-05 14:18:44 -0700 | [diff] [blame] | 4754 | static DEFINE_CLK_VOTER(dfab_dsps_clk, &dfab_clk.c, 0); |
| 4755 | static DEFINE_CLK_VOTER(dfab_usb_hs_clk, &dfab_clk.c, 0); |
| 4756 | static DEFINE_CLK_VOTER(dfab_usb_hs3_clk, &dfab_clk.c, 0); |
| 4757 | static DEFINE_CLK_VOTER(dfab_usb_hs4_clk, &dfab_clk.c, 0); |
| 4758 | static DEFINE_CLK_VOTER(dfab_sdc1_clk, &dfab_clk.c, 0); |
| 4759 | static DEFINE_CLK_VOTER(dfab_sdc2_clk, &dfab_clk.c, 0); |
| 4760 | static DEFINE_CLK_VOTER(dfab_sdc3_clk, &dfab_clk.c, 0); |
| 4761 | static DEFINE_CLK_VOTER(dfab_sdc4_clk, &dfab_clk.c, 0); |
| 4762 | static DEFINE_CLK_VOTER(dfab_sdc5_clk, &dfab_clk.c, 0); |
| 4763 | static DEFINE_CLK_VOTER(dfab_sps_clk, &dfab_clk.c, 0); |
| 4764 | static DEFINE_CLK_VOTER(dfab_bam_dmux_clk, &dfab_clk.c, 0); |
| 4765 | static DEFINE_CLK_VOTER(dfab_scm_clk, &dfab_clk.c, 0); |
Matt Wagantall | 35e78fc | 2012-04-05 14:18:44 -0700 | [diff] [blame] | 4766 | static DEFINE_CLK_VOTER(dfab_msmbus_clk, &dfab_clk.c, 0); |
| 4767 | 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] | 4768 | |
Matt Wagantall | 42cd12a | 2012-03-30 18:02:40 -0700 | [diff] [blame] | 4769 | static DEFINE_CLK_VOTER(ebi1_msmbus_clk, &ebi1_clk.c, LONG_MAX); |
Matt Wagantall | 35e78fc | 2012-04-05 14:18:44 -0700 | [diff] [blame] | 4770 | static DEFINE_CLK_VOTER(ebi1_adm_clk, &ebi1_clk.c, 0); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4771 | |
Matt Wagantall | 33bac7e | 2012-05-22 14:59:05 -0700 | [diff] [blame] | 4772 | static DEFINE_CLK_VOTER(ebi1_acpu_a_clk, &ebi1_a_clk.c, LONG_MAX); |
| 4773 | static DEFINE_CLK_VOTER(ebi1_msmbus_a_clk, &ebi1_a_clk.c, LONG_MAX); |
| 4774 | static DEFINE_CLK_VOTER(afab_acpu_a_clk, &afab_a_clk.c, LONG_MAX); |
| 4775 | static DEFINE_CLK_VOTER(afab_msmbus_a_clk, &afab_a_clk.c, LONG_MAX); |
| 4776 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4777 | #ifdef CONFIG_DEBUG_FS |
| 4778 | struct measure_sel { |
| 4779 | u32 test_vector; |
Matt Wagantall | f82f294 | 2012-01-27 13:56:13 -0800 | [diff] [blame] | 4780 | struct clk *c; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4781 | }; |
| 4782 | |
Matt Wagantall | 8b38f94 | 2011-08-02 18:23:18 -0700 | [diff] [blame] | 4783 | static DEFINE_CLK_MEASURE(l2_m_clk); |
| 4784 | static DEFINE_CLK_MEASURE(krait0_m_clk); |
| 4785 | static DEFINE_CLK_MEASURE(krait1_m_clk); |
Tianyi Gou | 455c13c | 2012-02-02 16:33:24 -0800 | [diff] [blame] | 4786 | static DEFINE_CLK_MEASURE(krait2_m_clk); |
| 4787 | static DEFINE_CLK_MEASURE(krait3_m_clk); |
Stephen Boyd | 3939c8d | 2011-08-29 17:36:22 -0700 | [diff] [blame] | 4788 | static DEFINE_CLK_MEASURE(q6sw_clk); |
| 4789 | static DEFINE_CLK_MEASURE(q6fw_clk); |
| 4790 | static DEFINE_CLK_MEASURE(q6_func_clk); |
Matt Wagantall | 8b38f94 | 2011-08-02 18:23:18 -0700 | [diff] [blame] | 4791 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4792 | static struct measure_sel measure_mux[] = { |
| 4793 | { TEST_PER_LS(0x08), &slimbus_xo_src_clk.c }, |
| 4794 | { TEST_PER_LS(0x12), &sdc1_p_clk.c }, |
| 4795 | { TEST_PER_LS(0x13), &sdc1_clk.c }, |
| 4796 | { TEST_PER_LS(0x14), &sdc2_p_clk.c }, |
| 4797 | { TEST_PER_LS(0x15), &sdc2_clk.c }, |
| 4798 | { TEST_PER_LS(0x16), &sdc3_p_clk.c }, |
| 4799 | { TEST_PER_LS(0x17), &sdc3_clk.c }, |
| 4800 | { TEST_PER_LS(0x18), &sdc4_p_clk.c }, |
| 4801 | { TEST_PER_LS(0x19), &sdc4_clk.c }, |
| 4802 | { TEST_PER_LS(0x1A), &sdc5_p_clk.c }, |
| 4803 | { TEST_PER_LS(0x1B), &sdc5_clk.c }, |
Matt Wagantall | 7625a4c | 2011-11-01 16:17:53 -0700 | [diff] [blame] | 4804 | { TEST_PER_LS(0x1F), &gp0_clk.c }, |
| 4805 | { TEST_PER_LS(0x20), &gp1_clk.c }, |
| 4806 | { TEST_PER_LS(0x21), &gp2_clk.c }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4807 | { TEST_PER_LS(0x25), &dfab_clk.c }, |
| 4808 | { TEST_PER_LS(0x25), &dfab_a_clk.c }, |
| 4809 | { TEST_PER_LS(0x26), &pmem_clk.c }, |
| 4810 | { TEST_PER_LS(0x32), &dma_bam_p_clk.c }, |
| 4811 | { TEST_PER_LS(0x33), &cfpb_clk.c }, |
| 4812 | { TEST_PER_LS(0x33), &cfpb_a_clk.c }, |
| 4813 | { TEST_PER_LS(0x3D), &gsbi1_p_clk.c }, |
| 4814 | { TEST_PER_LS(0x3E), &gsbi1_uart_clk.c }, |
| 4815 | { TEST_PER_LS(0x3F), &gsbi1_qup_clk.c }, |
| 4816 | { TEST_PER_LS(0x41), &gsbi2_p_clk.c }, |
| 4817 | { TEST_PER_LS(0x42), &gsbi2_uart_clk.c }, |
| 4818 | { TEST_PER_LS(0x44), &gsbi2_qup_clk.c }, |
| 4819 | { TEST_PER_LS(0x45), &gsbi3_p_clk.c }, |
| 4820 | { TEST_PER_LS(0x46), &gsbi3_uart_clk.c }, |
| 4821 | { TEST_PER_LS(0x48), &gsbi3_qup_clk.c }, |
| 4822 | { TEST_PER_LS(0x49), &gsbi4_p_clk.c }, |
| 4823 | { TEST_PER_LS(0x4A), &gsbi4_uart_clk.c }, |
| 4824 | { TEST_PER_LS(0x4C), &gsbi4_qup_clk.c }, |
| 4825 | { TEST_PER_LS(0x4D), &gsbi5_p_clk.c }, |
| 4826 | { TEST_PER_LS(0x4E), &gsbi5_uart_clk.c }, |
| 4827 | { TEST_PER_LS(0x50), &gsbi5_qup_clk.c }, |
| 4828 | { TEST_PER_LS(0x51), &gsbi6_p_clk.c }, |
| 4829 | { TEST_PER_LS(0x52), &gsbi6_uart_clk.c }, |
| 4830 | { TEST_PER_LS(0x54), &gsbi6_qup_clk.c }, |
| 4831 | { TEST_PER_LS(0x55), &gsbi7_p_clk.c }, |
| 4832 | { TEST_PER_LS(0x56), &gsbi7_uart_clk.c }, |
| 4833 | { TEST_PER_LS(0x58), &gsbi7_qup_clk.c }, |
| 4834 | { TEST_PER_LS(0x59), &gsbi8_p_clk.c }, |
Tianyi Gou | 352955d | 2012-05-18 19:44:01 -0700 | [diff] [blame] | 4835 | { TEST_PER_LS(0x59), &sfab_sata_s_p_clk.c }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4836 | { TEST_PER_LS(0x5A), &gsbi8_uart_clk.c }, |
Tianyi Gou | 352955d | 2012-05-18 19:44:01 -0700 | [diff] [blame] | 4837 | { TEST_PER_LS(0x5A), &sata_p_clk.c }, |
| 4838 | { TEST_PER_LS(0x5B), &sata_rxoob_clk.c }, |
| 4839 | { TEST_PER_LS(0x5C), &sata_pmalive_clk.c }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4840 | { TEST_PER_LS(0x5C), &gsbi8_qup_clk.c }, |
| 4841 | { TEST_PER_LS(0x5D), &gsbi9_p_clk.c }, |
| 4842 | { TEST_PER_LS(0x5E), &gsbi9_uart_clk.c }, |
| 4843 | { TEST_PER_LS(0x60), &gsbi9_qup_clk.c }, |
| 4844 | { TEST_PER_LS(0x61), &gsbi10_p_clk.c }, |
| 4845 | { TEST_PER_LS(0x62), &gsbi10_uart_clk.c }, |
| 4846 | { TEST_PER_LS(0x64), &gsbi10_qup_clk.c }, |
| 4847 | { TEST_PER_LS(0x65), &gsbi11_p_clk.c }, |
| 4848 | { TEST_PER_LS(0x66), &gsbi11_uart_clk.c }, |
| 4849 | { TEST_PER_LS(0x68), &gsbi11_qup_clk.c }, |
| 4850 | { TEST_PER_LS(0x69), &gsbi12_p_clk.c }, |
| 4851 | { TEST_PER_LS(0x6A), &gsbi12_uart_clk.c }, |
| 4852 | { TEST_PER_LS(0x6C), &gsbi12_qup_clk.c }, |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 4853 | { TEST_PER_LS(0x5E), &pcie_p_clk.c }, |
| 4854 | { TEST_PER_LS(0x5F), &ce3_p_clk.c }, |
| 4855 | { TEST_PER_LS(0x60), &ce3_core_clk.c }, |
| 4856 | { TEST_PER_LS(0x63), &usb_hs3_p_clk.c }, |
| 4857 | { TEST_PER_LS(0x64), &usb_hs3_xcvr_clk.c }, |
| 4858 | { TEST_PER_LS(0x65), &usb_hs4_p_clk.c }, |
| 4859 | { TEST_PER_LS(0x66), &usb_hs4_xcvr_clk.c }, |
| 4860 | { TEST_PER_LS(0x6B), &sata_phy_ref_clk.c }, |
| 4861 | { TEST_PER_LS(0x6C), &sata_phy_cfg_clk.c }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4862 | { TEST_PER_LS(0x78), &sfpb_clk.c }, |
| 4863 | { TEST_PER_LS(0x78), &sfpb_a_clk.c }, |
| 4864 | { TEST_PER_LS(0x7A), &pmic_ssbi2_clk.c }, |
| 4865 | { TEST_PER_LS(0x7B), &pmic_arb0_p_clk.c }, |
| 4866 | { TEST_PER_LS(0x7C), &pmic_arb1_p_clk.c }, |
| 4867 | { TEST_PER_LS(0x7D), &prng_clk.c }, |
| 4868 | { TEST_PER_LS(0x7F), &rpm_msg_ram_p_clk.c }, |
| 4869 | { TEST_PER_LS(0x80), &adm0_p_clk.c }, |
| 4870 | { TEST_PER_LS(0x84), &usb_hs1_p_clk.c }, |
| 4871 | { TEST_PER_LS(0x85), &usb_hs1_xcvr_clk.c }, |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 4872 | { TEST_PER_LS(0x86), &usb_hsic_p_clk.c }, |
| 4873 | { TEST_PER_LS(0x87), &usb_hsic_system_clk.c }, |
| 4874 | { TEST_PER_LS(0x88), &usb_hsic_xcvr_fs_clk.c }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4875 | { TEST_PER_LS(0x89), &usb_fs1_p_clk.c }, |
| 4876 | { TEST_PER_LS(0x8A), &usb_fs1_sys_clk.c }, |
| 4877 | { TEST_PER_LS(0x8B), &usb_fs1_xcvr_clk.c }, |
| 4878 | { TEST_PER_LS(0x8C), &usb_fs2_p_clk.c }, |
| 4879 | { TEST_PER_LS(0x8D), &usb_fs2_sys_clk.c }, |
| 4880 | { TEST_PER_LS(0x8E), &usb_fs2_xcvr_clk.c }, |
| 4881 | { TEST_PER_LS(0x8F), &tsif_p_clk.c }, |
| 4882 | { TEST_PER_LS(0x91), &tsif_ref_clk.c }, |
| 4883 | { TEST_PER_LS(0x92), &ce1_p_clk.c }, |
| 4884 | { TEST_PER_LS(0x94), &tssc_clk.c }, |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 4885 | { TEST_PER_LS(0x9D), &usb_hsic_hsio_cal_clk.c }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4886 | { TEST_PER_LS(0xA4), &ce1_core_clk.c }, |
| 4887 | |
| 4888 | { TEST_PER_HS(0x07), &afab_clk.c }, |
| 4889 | { TEST_PER_HS(0x07), &afab_a_clk.c }, |
| 4890 | { TEST_PER_HS(0x18), &sfab_clk.c }, |
| 4891 | { TEST_PER_HS(0x18), &sfab_a_clk.c }, |
Stephen Boyd | 3939c8d | 2011-08-29 17:36:22 -0700 | [diff] [blame] | 4892 | { TEST_PER_HS(0x26), &q6sw_clk }, |
| 4893 | { TEST_PER_HS(0x27), &q6fw_clk }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4894 | { TEST_PER_HS(0x2A), &adm0_clk.c }, |
Tianyi Gou | 352955d | 2012-05-18 19:44:01 -0700 | [diff] [blame] | 4895 | { TEST_PER_HS(0x31), &sata_a_clk.c }, |
Tianyi Gou | 6613de5 | 2012-01-27 17:57:53 -0800 | [diff] [blame] | 4896 | { TEST_PER_HS(0x2D), &pcie_phy_ref_clk.c }, |
| 4897 | { TEST_PER_HS(0x32), &pcie_a_clk.c }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4898 | { TEST_PER_HS(0x34), &ebi1_clk.c }, |
| 4899 | { TEST_PER_HS(0x34), &ebi1_a_clk.c }, |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 4900 | { TEST_PER_HS(0x50), &usb_hsic_hsic_clk.c }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4901 | |
| 4902 | { TEST_MM_LS(0x00), &dsi1_byte_clk.c }, |
| 4903 | { TEST_MM_LS(0x01), &dsi2_byte_clk.c }, |
| 4904 | { TEST_MM_LS(0x02), &cam1_clk.c }, |
| 4905 | { TEST_MM_LS(0x06), &_p_clk.c }, |
Matt Wagantall | c23eee9 | 2011-08-16 23:06:52 -0700 | [diff] [blame] | 4906 | { TEST_MM_LS(0x07), &csi_p_clk.c }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4907 | { TEST_MM_LS(0x08), &dsi2_s_p_clk.c }, |
| 4908 | { TEST_MM_LS(0x09), &dsi1_m_p_clk.c }, |
| 4909 | { TEST_MM_LS(0x0A), &dsi1_s_p_clk.c }, |
| 4910 | { TEST_MM_LS(0x0C), &gfx2d0_p_clk.c }, |
| 4911 | { TEST_MM_LS(0x0D), &gfx2d1_p_clk.c }, |
| 4912 | { TEST_MM_LS(0x0E), &gfx3d_p_clk.c }, |
| 4913 | { TEST_MM_LS(0x0F), &hdmi_m_p_clk.c }, |
| 4914 | { TEST_MM_LS(0x10), &hdmi_s_p_clk.c }, |
| 4915 | { TEST_MM_LS(0x11), &ijpeg_p_clk.c }, |
| 4916 | { TEST_MM_LS(0x12), &imem_p_clk.c }, |
| 4917 | { TEST_MM_LS(0x13), &jpegd_p_clk.c }, |
| 4918 | { TEST_MM_LS(0x14), &mdp_p_clk.c }, |
| 4919 | { TEST_MM_LS(0x16), &rot_p_clk.c }, |
| 4920 | { TEST_MM_LS(0x17), &dsi1_esc_clk.c }, |
| 4921 | { TEST_MM_LS(0x18), &smmu_p_clk.c }, |
| 4922 | { TEST_MM_LS(0x19), &tv_enc_p_clk.c }, |
| 4923 | { TEST_MM_LS(0x1A), &vcodec_p_clk.c }, |
| 4924 | { TEST_MM_LS(0x1B), &vfe_p_clk.c }, |
| 4925 | { TEST_MM_LS(0x1C), &vpe_p_clk.c }, |
| 4926 | { TEST_MM_LS(0x1D), &cam0_clk.c }, |
| 4927 | { TEST_MM_LS(0x1F), &hdmi_app_clk.c }, |
| 4928 | { TEST_MM_LS(0x20), &mdp_vsync_clk.c }, |
| 4929 | { TEST_MM_LS(0x21), &tv_dac_clk.c }, |
| 4930 | { TEST_MM_LS(0x22), &tv_enc_clk.c }, |
| 4931 | { TEST_MM_LS(0x23), &dsi2_esc_clk.c }, |
| 4932 | { TEST_MM_LS(0x25), &mmfpb_clk.c }, |
| 4933 | { TEST_MM_LS(0x25), &mmfpb_a_clk.c }, |
| 4934 | { TEST_MM_LS(0x26), &dsi2_m_p_clk.c }, |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 4935 | { TEST_MM_LS(0x27), &cam2_clk.c }, |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 4936 | { TEST_MM_LS(0x28), &vcap_p_clk.c }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4937 | |
| 4938 | { TEST_MM_HS(0x00), &csi0_clk.c }, |
| 4939 | { TEST_MM_HS(0x01), &csi1_clk.c }, |
Matt Wagantall | c23eee9 | 2011-08-16 23:06:52 -0700 | [diff] [blame] | 4940 | { TEST_MM_HS(0x04), &csi_vfe_clk.c }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4941 | { TEST_MM_HS(0x05), &ijpeg_clk.c }, |
| 4942 | { TEST_MM_HS(0x06), &vfe_clk.c }, |
| 4943 | { TEST_MM_HS(0x07), &gfx2d0_clk.c }, |
| 4944 | { TEST_MM_HS(0x08), &gfx2d1_clk.c }, |
| 4945 | { TEST_MM_HS(0x09), &gfx3d_clk.c }, |
| 4946 | { TEST_MM_HS(0x0A), &jpegd_clk.c }, |
| 4947 | { TEST_MM_HS(0x0B), &vcodec_clk.c }, |
| 4948 | { TEST_MM_HS(0x0F), &mmfab_clk.c }, |
| 4949 | { TEST_MM_HS(0x0F), &mmfab_a_clk.c }, |
| 4950 | { TEST_MM_HS(0x11), &gmem_axi_clk.c }, |
| 4951 | { TEST_MM_HS(0x12), &ijpeg_axi_clk.c }, |
| 4952 | { TEST_MM_HS(0x13), &imem_axi_clk.c }, |
| 4953 | { TEST_MM_HS(0x14), &jpegd_axi_clk.c }, |
| 4954 | { TEST_MM_HS(0x15), &mdp_axi_clk.c }, |
| 4955 | { TEST_MM_HS(0x16), &rot_axi_clk.c }, |
| 4956 | { TEST_MM_HS(0x17), &vcodec_axi_clk.c }, |
| 4957 | { TEST_MM_HS(0x18), &vfe_axi_clk.c }, |
| 4958 | { TEST_MM_HS(0x19), &vpe_axi_clk.c }, |
| 4959 | { TEST_MM_HS(0x1A), &mdp_clk.c }, |
| 4960 | { TEST_MM_HS(0x1B), &rot_clk.c }, |
| 4961 | { TEST_MM_HS(0x1C), &vpe_clk.c }, |
| 4962 | { TEST_MM_HS(0x1E), &hdmi_tv_clk.c }, |
| 4963 | { TEST_MM_HS(0x1F), &mdp_tv_clk.c }, |
| 4964 | { TEST_MM_HS(0x24), &csi0_phy_clk.c }, |
| 4965 | { TEST_MM_HS(0x25), &csi1_phy_clk.c }, |
| 4966 | { TEST_MM_HS(0x26), &csi_pix_clk.c }, |
| 4967 | { TEST_MM_HS(0x27), &csi_rdi_clk.c }, |
| 4968 | { TEST_MM_HS(0x28), &lut_mdp_clk.c }, |
| 4969 | { TEST_MM_HS(0x29), &vcodec_axi_a_clk.c }, |
| 4970 | { TEST_MM_HS(0x2A), &vcodec_axi_b_clk.c }, |
| 4971 | { TEST_MM_HS(0x2B), &csi1phy_timer_clk.c }, |
| 4972 | { TEST_MM_HS(0x2C), &csi0phy_timer_clk.c }, |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 4973 | { TEST_MM_HS(0x2D), &csi2_clk.c }, |
| 4974 | { TEST_MM_HS(0x2E), &csi2_phy_clk.c }, |
| 4975 | { TEST_MM_HS(0x2F), &csi2phy_timer_clk.c }, |
| 4976 | { TEST_MM_HS(0x30), &csi_pix1_clk.c }, |
| 4977 | { TEST_MM_HS(0x31), &csi_rdi1_clk.c }, |
| 4978 | { TEST_MM_HS(0x32), &csi_rdi2_clk.c }, |
Tianyi Gou | 621f874 | 2011-09-01 21:45:01 -0700 | [diff] [blame] | 4979 | { TEST_MM_HS(0x33), &vcap_clk.c }, |
| 4980 | { TEST_MM_HS(0x34), &vcap_npl_clk.c }, |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 4981 | { TEST_MM_HS(0x34), &gfx3d_axi_clk_8930.c }, |
Tianyi Gou | 7747a96 | 2012-02-03 15:03:55 -0800 | [diff] [blame] | 4982 | { TEST_MM_HS(0x35), &vcap_axi_clk.c }, |
Tianyi Gou | 5191880 | 2012-01-26 14:05:43 -0800 | [diff] [blame] | 4983 | { TEST_MM_HS(0x36), &rgb_tv_clk.c }, |
| 4984 | { TEST_MM_HS(0x37), &npl_tv_clk.c }, |
Patrick Daly | e6f48904 | 2012-07-11 15:29:15 -0700 | [diff] [blame] | 4985 | { TEST_MM_HS(0x38), &gfx3d_axi_clk.c }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 4986 | |
| 4987 | { TEST_LPA(0x0F), &mi2s_bit_clk.c }, |
| 4988 | { TEST_LPA(0x10), &codec_i2s_mic_bit_clk.c }, |
| 4989 | { TEST_LPA(0x11), &codec_i2s_spkr_bit_clk.c }, |
| 4990 | { TEST_LPA(0x12), &spare_i2s_mic_bit_clk.c }, |
| 4991 | { TEST_LPA(0x13), &spare_i2s_spkr_bit_clk.c }, |
| 4992 | { TEST_LPA(0x14), &pcm_clk.c }, |
| 4993 | { TEST_LPA(0x1D), &audio_slimbus_clk.c }, |
Matt Wagantall | 8b38f94 | 2011-08-02 18:23:18 -0700 | [diff] [blame] | 4994 | |
Stephen Boyd | 3939c8d | 2011-08-29 17:36:22 -0700 | [diff] [blame] | 4995 | { TEST_LPA_HS(0x00), &q6_func_clk }, |
| 4996 | |
Stephen Boyd | 46fdf0d | 2011-11-22 12:25:09 -0800 | [diff] [blame] | 4997 | { TEST_CPUL2(0x2), &l2_m_clk }, |
| 4998 | { TEST_CPUL2(0x0), &krait0_m_clk }, |
| 4999 | { TEST_CPUL2(0x1), &krait1_m_clk }, |
Tianyi Gou | 455c13c | 2012-02-02 16:33:24 -0800 | [diff] [blame] | 5000 | { TEST_CPUL2(0x4), &krait2_m_clk }, |
| 5001 | { TEST_CPUL2(0x5), &krait3_m_clk }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5002 | }; |
| 5003 | |
Matt Wagantall | f82f294 | 2012-01-27 13:56:13 -0800 | [diff] [blame] | 5004 | static struct measure_sel *find_measure_sel(struct clk *c) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5005 | { |
| 5006 | int i; |
| 5007 | |
| 5008 | for (i = 0; i < ARRAY_SIZE(measure_mux); i++) |
Matt Wagantall | f82f294 | 2012-01-27 13:56:13 -0800 | [diff] [blame] | 5009 | if (measure_mux[i].c == c) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5010 | return &measure_mux[i]; |
| 5011 | return NULL; |
| 5012 | } |
| 5013 | |
Matt Wagantall | 8b38f94 | 2011-08-02 18:23:18 -0700 | [diff] [blame] | 5014 | static int measure_clk_set_parent(struct clk *c, struct clk *parent) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5015 | { |
| 5016 | int ret = 0; |
| 5017 | u32 clk_sel; |
| 5018 | struct measure_sel *p; |
Matt Wagantall | f82f294 | 2012-01-27 13:56:13 -0800 | [diff] [blame] | 5019 | struct measure_clk *measure = to_measure_clk(c); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5020 | unsigned long flags; |
| 5021 | |
| 5022 | if (!parent) |
| 5023 | return -EINVAL; |
| 5024 | |
| 5025 | p = find_measure_sel(parent); |
| 5026 | if (!p) |
| 5027 | return -EINVAL; |
| 5028 | |
| 5029 | spin_lock_irqsave(&local_clock_reg_lock, flags); |
| 5030 | |
Matt Wagantall | 8b38f94 | 2011-08-02 18:23:18 -0700 | [diff] [blame] | 5031 | /* |
| 5032 | * Program the test vector, measurement period (sample_ticks) |
| 5033 | * and scaling multiplier. |
| 5034 | */ |
Matt Wagantall | f82f294 | 2012-01-27 13:56:13 -0800 | [diff] [blame] | 5035 | measure->sample_ticks = 0x10000; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5036 | clk_sel = p->test_vector & TEST_CLK_SEL_MASK; |
Matt Wagantall | f82f294 | 2012-01-27 13:56:13 -0800 | [diff] [blame] | 5037 | measure->multiplier = 1; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5038 | switch (p->test_vector >> TEST_TYPE_SHIFT) { |
| 5039 | case TEST_TYPE_PER_LS: |
| 5040 | writel_relaxed(0x4030D00|BVAL(7, 0, clk_sel), CLK_TEST_REG); |
| 5041 | break; |
| 5042 | case TEST_TYPE_PER_HS: |
| 5043 | writel_relaxed(0x4020000|BVAL(16, 10, clk_sel), CLK_TEST_REG); |
| 5044 | break; |
| 5045 | case TEST_TYPE_MM_LS: |
| 5046 | writel_relaxed(0x4030D97, CLK_TEST_REG); |
| 5047 | writel_relaxed(BVAL(6, 1, clk_sel)|BIT(0), DBG_CFG_REG_LS_REG); |
| 5048 | break; |
| 5049 | case TEST_TYPE_MM_HS: |
| 5050 | writel_relaxed(0x402B800, CLK_TEST_REG); |
| 5051 | writel_relaxed(BVAL(6, 1, clk_sel)|BIT(0), DBG_CFG_REG_HS_REG); |
| 5052 | break; |
| 5053 | case TEST_TYPE_LPA: |
| 5054 | writel_relaxed(0x4030D98, CLK_TEST_REG); |
| 5055 | writel_relaxed(BVAL(6, 1, clk_sel)|BIT(0), |
| 5056 | LCC_CLK_LS_DEBUG_CFG_REG); |
| 5057 | break; |
Stephen Boyd | 3939c8d | 2011-08-29 17:36:22 -0700 | [diff] [blame] | 5058 | case TEST_TYPE_LPA_HS: |
| 5059 | writel_relaxed(0x402BC00, CLK_TEST_REG); |
| 5060 | writel_relaxed(BVAL(2, 1, clk_sel)|BIT(0), |
| 5061 | LCC_CLK_HS_DEBUG_CFG_REG); |
| 5062 | break; |
Matt Wagantall | 8b38f94 | 2011-08-02 18:23:18 -0700 | [diff] [blame] | 5063 | case TEST_TYPE_CPUL2: |
| 5064 | writel_relaxed(0x4030400, CLK_TEST_REG); |
| 5065 | writel_relaxed(0x80|BVAL(5, 3, clk_sel), GCC_APCS_CLK_DIAG); |
Matt Wagantall | f82f294 | 2012-01-27 13:56:13 -0800 | [diff] [blame] | 5066 | measure->sample_ticks = 0x4000; |
| 5067 | measure->multiplier = 2; |
Matt Wagantall | 8b38f94 | 2011-08-02 18:23:18 -0700 | [diff] [blame] | 5068 | break; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5069 | default: |
| 5070 | ret = -EPERM; |
| 5071 | } |
| 5072 | /* Make sure test vector is set before starting measurements. */ |
| 5073 | mb(); |
| 5074 | |
| 5075 | spin_unlock_irqrestore(&local_clock_reg_lock, flags); |
| 5076 | |
| 5077 | return ret; |
| 5078 | } |
| 5079 | |
| 5080 | /* Sample clock for 'ticks' reference clock ticks. */ |
| 5081 | static u32 run_measurement(unsigned ticks) |
| 5082 | { |
| 5083 | /* Stop counters and set the XO4 counter start value. */ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5084 | writel_relaxed(ticks, RINGOSC_TCXO_CTL_REG); |
| 5085 | |
| 5086 | /* Wait for timer to become ready. */ |
| 5087 | while ((readl_relaxed(RINGOSC_STATUS_REG) & BIT(25)) != 0) |
| 5088 | cpu_relax(); |
| 5089 | |
| 5090 | /* Run measurement and wait for completion. */ |
| 5091 | writel_relaxed(BIT(20)|ticks, RINGOSC_TCXO_CTL_REG); |
| 5092 | while ((readl_relaxed(RINGOSC_STATUS_REG) & BIT(25)) == 0) |
| 5093 | cpu_relax(); |
| 5094 | |
| 5095 | /* Stop counters. */ |
| 5096 | writel_relaxed(0x0, RINGOSC_TCXO_CTL_REG); |
| 5097 | |
| 5098 | /* Return measured ticks. */ |
| 5099 | return readl_relaxed(RINGOSC_STATUS_REG) & BM(24, 0); |
| 5100 | } |
| 5101 | |
| 5102 | |
| 5103 | /* Perform a hardware rate measurement for a given clock. |
| 5104 | FOR DEBUG USE ONLY: Measurements take ~15 ms! */ |
Matt Wagantall | 9de3bfb | 2011-11-03 20:13:12 -0700 | [diff] [blame] | 5105 | static unsigned long measure_clk_get_rate(struct clk *c) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5106 | { |
| 5107 | unsigned long flags; |
| 5108 | u32 pdm_reg_backup, ringosc_reg_backup; |
| 5109 | u64 raw_count_short, raw_count_full; |
Matt Wagantall | f82f294 | 2012-01-27 13:56:13 -0800 | [diff] [blame] | 5110 | struct measure_clk *measure = to_measure_clk(c); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5111 | unsigned ret; |
| 5112 | |
Stephen Boyd | e334aeb | 2012-01-24 12:17:29 -0800 | [diff] [blame] | 5113 | ret = clk_prepare_enable(&cxo_clk.c); |
Stephen Boyd | 3a35f0b | 2012-01-11 16:18:26 -0800 | [diff] [blame] | 5114 | if (ret) { |
| 5115 | pr_warning("CXO clock failed to enable. Can't measure\n"); |
| 5116 | return 0; |
| 5117 | } |
| 5118 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5119 | spin_lock_irqsave(&local_clock_reg_lock, flags); |
| 5120 | |
| 5121 | /* Enable CXO/4 and RINGOSC branch and root. */ |
| 5122 | pdm_reg_backup = readl_relaxed(PDM_CLK_NS_REG); |
| 5123 | ringosc_reg_backup = readl_relaxed(RINGOSC_NS_REG); |
| 5124 | writel_relaxed(0x2898, PDM_CLK_NS_REG); |
| 5125 | writel_relaxed(0xA00, RINGOSC_NS_REG); |
| 5126 | |
| 5127 | /* |
| 5128 | * The ring oscillator counter will not reset if the measured clock |
| 5129 | * is not running. To detect this, run a short measurement before |
| 5130 | * the full measurement. If the raw results of the two are the same |
| 5131 | * then the clock must be off. |
| 5132 | */ |
| 5133 | |
| 5134 | /* Run a short measurement. (~1 ms) */ |
| 5135 | raw_count_short = run_measurement(0x1000); |
| 5136 | /* Run a full measurement. (~14 ms) */ |
Matt Wagantall | f82f294 | 2012-01-27 13:56:13 -0800 | [diff] [blame] | 5137 | raw_count_full = run_measurement(measure->sample_ticks); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5138 | |
| 5139 | writel_relaxed(ringosc_reg_backup, RINGOSC_NS_REG); |
| 5140 | writel_relaxed(pdm_reg_backup, PDM_CLK_NS_REG); |
| 5141 | |
| 5142 | /* Return 0 if the clock is off. */ |
| 5143 | if (raw_count_full == raw_count_short) |
| 5144 | ret = 0; |
| 5145 | else { |
| 5146 | /* Compute rate in Hz. */ |
| 5147 | raw_count_full = ((raw_count_full * 10) + 15) * 4800000; |
Matt Wagantall | f82f294 | 2012-01-27 13:56:13 -0800 | [diff] [blame] | 5148 | do_div(raw_count_full, ((measure->sample_ticks * 10) + 35)); |
| 5149 | ret = (raw_count_full * measure->multiplier); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5150 | } |
| 5151 | |
| 5152 | /* Route dbg_hs_clk to PLLTEST. 300mV single-ended amplitude. */ |
Stephen Boyd | 69da840 | 2011-07-14 17:45:31 -0700 | [diff] [blame] | 5153 | writel_relaxed(0x38F8, PLLTEST_PAD_CFG_REG); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5154 | spin_unlock_irqrestore(&local_clock_reg_lock, flags); |
| 5155 | |
Stephen Boyd | e334aeb | 2012-01-24 12:17:29 -0800 | [diff] [blame] | 5156 | clk_disable_unprepare(&cxo_clk.c); |
Stephen Boyd | 3a35f0b | 2012-01-11 16:18:26 -0800 | [diff] [blame] | 5157 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5158 | return ret; |
| 5159 | } |
| 5160 | #else /* !CONFIG_DEBUG_FS */ |
Matt Wagantall | f82f294 | 2012-01-27 13:56:13 -0800 | [diff] [blame] | 5161 | static int measure_clk_set_parent(struct clk *c, struct clk *parent) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5162 | { |
| 5163 | return -EINVAL; |
| 5164 | } |
| 5165 | |
Matt Wagantall | f82f294 | 2012-01-27 13:56:13 -0800 | [diff] [blame] | 5166 | static unsigned long measure_clk_get_rate(struct clk *c) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5167 | { |
| 5168 | return 0; |
| 5169 | } |
| 5170 | #endif /* CONFIG_DEBUG_FS */ |
| 5171 | |
Matt Wagantall | ae05322 | 2012-05-14 19:42:07 -0700 | [diff] [blame] | 5172 | static struct clk_ops clk_ops_measure = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5173 | .set_parent = measure_clk_set_parent, |
| 5174 | .get_rate = measure_clk_get_rate, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5175 | }; |
| 5176 | |
Matt Wagantall | 8b38f94 | 2011-08-02 18:23:18 -0700 | [diff] [blame] | 5177 | static struct measure_clk measure_clk = { |
| 5178 | .c = { |
| 5179 | .dbg_name = "measure_clk", |
Matt Wagantall | ae05322 | 2012-05-14 19:42:07 -0700 | [diff] [blame] | 5180 | .ops = &clk_ops_measure, |
Matt Wagantall | 8b38f94 | 2011-08-02 18:23:18 -0700 | [diff] [blame] | 5181 | CLK_INIT(measure_clk.c), |
| 5182 | }, |
| 5183 | .multiplier = 1, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5184 | }; |
| 5185 | |
Tianyi Gou | a8b3cce | 2011-11-08 14:37:26 -0800 | [diff] [blame] | 5186 | static struct clk_lookup msm_clocks_8064[] = { |
Stephen Boyd | 72a8035 | 2012-01-26 15:57:38 -0800 | [diff] [blame] | 5187 | CLK_LOOKUP("xo", cxo_a_clk.c, ""), |
| 5188 | CLK_LOOKUP("xo", pxo_a_clk.c, ""), |
Mohan Pallaka | 804ca59 | 2012-06-14 14:37:38 +0530 | [diff] [blame] | 5189 | CLK_LOOKUP("pwm_clk", cxo_clk.c, "0-0048"), |
Stephen Boyd | ed630b0 | 2012-01-26 15:26:47 -0800 | [diff] [blame] | 5190 | CLK_LOOKUP("cxo", cxo_clk.c, "wcnss_wlan.0"), |
| 5191 | CLK_LOOKUP("cxo", cxo_clk.c, "pil_riva"), |
| 5192 | CLK_LOOKUP("xo", pxo_clk.c, "pil_qdsp6v4.0"), |
| 5193 | CLK_LOOKUP("xo", cxo_clk.c, "pil_qdsp6v4.1"), |
| 5194 | CLK_LOOKUP("xo", cxo_clk.c, "pil_qdsp6v4.2"), |
Matt Wagantall | 292aace | 2012-01-26 19:12:34 -0800 | [diff] [blame] | 5195 | CLK_LOOKUP("xo", cxo_clk.c, "pil_gss"), |
Stephen Boyd | 69d35e3 | 2012-02-14 15:33:30 -0800 | [diff] [blame] | 5196 | CLK_LOOKUP("xo", cxo_clk.c, "BAM_RMNT"), |
Stephen Boyd | 5a190a8 | 2012-03-01 14:45:15 -0800 | [diff] [blame] | 5197 | CLK_LOOKUP("xo", cxo_clk.c, "msm_xo"), |
David Collins | a7d2353 | 2012-08-02 10:48:16 -0700 | [diff] [blame] | 5198 | CLK_LOOKUP("vref_buff", cxo_clk.c, "rpm-regulator"), |
Stephen Boyd | ed630b0 | 2012-01-26 15:26:47 -0800 | [diff] [blame] | 5199 | CLK_LOOKUP("pll2", pll2_clk.c, NULL), |
| 5200 | CLK_LOOKUP("pll8", pll8_clk.c, NULL), |
| 5201 | CLK_LOOKUP("pll4", pll4_clk.c, NULL), |
| 5202 | CLK_LOOKUP("measure", measure_clk.c, "debug"), |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 5203 | |
Matt Wagantall | d75f131 | 2012-05-23 16:17:35 -0700 | [diff] [blame] | 5204 | CLK_LOOKUP("bus_clk", afab_clk.c, ""), |
| 5205 | CLK_LOOKUP("bus_clk", afab_a_clk.c, ""), |
| 5206 | CLK_LOOKUP("bus_clk", cfpb_clk.c, ""), |
| 5207 | CLK_LOOKUP("bus_clk", cfpb_a_clk.c, ""), |
| 5208 | CLK_LOOKUP("bus_clk", dfab_clk.c, ""), |
| 5209 | CLK_LOOKUP("bus_clk", dfab_a_clk.c, ""), |
| 5210 | CLK_LOOKUP("mem_clk", ebi1_clk.c, ""), |
| 5211 | CLK_LOOKUP("mem_clk", ebi1_a_clk.c, ""), |
| 5212 | CLK_LOOKUP("bus_clk", mmfab_clk.c, ""), |
| 5213 | CLK_LOOKUP("bus_clk", mmfab_a_clk.c, ""), |
| 5214 | CLK_LOOKUP("bus_clk", mmfpb_clk.c, ""), |
| 5215 | CLK_LOOKUP("bus_clk", mmfpb_a_clk.c, ""), |
| 5216 | CLK_LOOKUP("bus_clk", sfab_clk.c, ""), |
| 5217 | CLK_LOOKUP("bus_clk", sfab_a_clk.c, ""), |
| 5218 | CLK_LOOKUP("bus_clk", sfpb_clk.c, ""), |
| 5219 | CLK_LOOKUP("bus_clk", sfpb_a_clk.c, ""), |
| 5220 | |
Tianyi Gou | 21a0e80 | 2012-02-04 22:34:10 -0800 | [diff] [blame] | 5221 | CLK_LOOKUP("bus_clk", afab_clk.c, "msm_apps_fab"), |
Matt Wagantall | 33bac7e | 2012-05-22 14:59:05 -0700 | [diff] [blame] | 5222 | 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] | 5223 | CLK_LOOKUP("bus_clk", cfpb_clk.c, "msm_cpss_fpb"), |
| 5224 | CLK_LOOKUP("bus_a_clk", cfpb_a_clk.c, "msm_cpss_fpb"), |
| 5225 | CLK_LOOKUP("bus_clk", sfab_clk.c, "msm_sys_fab"), |
Stephen Boyd | d7a143a | 2012-02-16 17:59:26 -0800 | [diff] [blame] | 5226 | 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] | 5227 | CLK_LOOKUP("bus_clk", sfpb_clk.c, "msm_sys_fpb"), |
| 5228 | CLK_LOOKUP("bus_a_clk", sfpb_a_clk.c, "msm_sys_fpb"), |
| 5229 | CLK_LOOKUP("bus_clk", mmfab_clk.c, "msm_mm_fab"), |
| 5230 | CLK_LOOKUP("bus_a_clk", mmfab_a_clk.c, "msm_mm_fab"), |
| 5231 | CLK_LOOKUP("mem_clk", ebi1_msmbus_clk.c, "msm_bus"), |
Matt Wagantall | 33bac7e | 2012-05-22 14:59:05 -0700 | [diff] [blame] | 5232 | CLK_LOOKUP("mem_a_clk", ebi1_msmbus_a_clk.c, "msm_bus"), |
Gagan Mac | bc5f81d | 2012-04-04 15:03:12 -0600 | [diff] [blame] | 5233 | CLK_LOOKUP("dfab_clk", dfab_msmbus_clk.c, "msm_bus"), |
| 5234 | CLK_LOOKUP("dfab_a_clk", dfab_msmbus_a_clk.c, "msm_bus"), |
Pratik Patel | f17b147 | 2012-05-25 22:23:52 -0700 | [diff] [blame] | 5235 | CLK_LOOKUP("core_a_clk", qdss_a_clk.c, ""), |
Pratik Patel | 3b0ca88 | 2012-06-01 16:54:14 -0700 | [diff] [blame] | 5236 | CLK_LOOKUP("core_clk", qdss_clk.c, "coresight-tpiu.0"), |
| 5237 | CLK_LOOKUP("core_clk", qdss_clk.c, "coresight-etb.0"), |
| 5238 | CLK_LOOKUP("core_clk", qdss_clk.c, "coresight-funnel.0"), |
| 5239 | CLK_LOOKUP("core_clk", qdss_clk.c, "coresight-etm.0"), |
| 5240 | CLK_LOOKUP("core_clk", qdss_clk.c, "coresight-etm.1"), |
| 5241 | CLK_LOOKUP("core_clk", qdss_clk.c, "coresight-etm.2"), |
| 5242 | CLK_LOOKUP("core_clk", qdss_clk.c, "coresight-etm.3"), |
Matt Wagantall | b2710b8 | 2011-11-16 19:55:17 -0800 | [diff] [blame] | 5243 | |
Tianyi Gou | 21a0e80 | 2012-02-04 22:34:10 -0800 | [diff] [blame] | 5244 | CLK_LOOKUP("ebi1_clk", ebi1_clk.c, ""), |
Tianyi Gou | 21a0e80 | 2012-02-04 22:34:10 -0800 | [diff] [blame] | 5245 | CLK_LOOKUP("mmfpb_clk", mmfpb_clk.c, ""), |
| 5246 | CLK_LOOKUP("mmfpb_a_clk", mmfpb_a_clk.c, "clock-8960"), |
| 5247 | CLK_LOOKUP("cfpb_a_clk", cfpb_a_clk.c, "clock-8960"), |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 5248 | |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5249 | CLK_LOOKUP("core_clk", gp0_clk.c, ""), |
| 5250 | CLK_LOOKUP("core_clk", gp1_clk.c, ""), |
| 5251 | CLK_LOOKUP("core_clk", gp2_clk.c, ""), |
Jin Hong | 4bbbfba | 2012-02-02 21:48:07 -0800 | [diff] [blame] | 5252 | CLK_LOOKUP("core_clk", gsbi1_uart_clk.c, "msm_serial_hsl.1"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5253 | CLK_LOOKUP("core_clk", gsbi2_uart_clk.c, ""), |
| 5254 | CLK_LOOKUP("core_clk", gsbi3_uart_clk.c, ""), |
| 5255 | CLK_LOOKUP("core_clk", gsbi4_uart_clk.c, ""), |
| 5256 | CLK_LOOKUP("core_clk", gsbi5_uart_clk.c, ""), |
Mayank Rana | 262e903 | 2012-05-10 15:14:00 -0700 | [diff] [blame] | 5257 | CLK_LOOKUP("core_clk", gsbi6_uart_clk.c, "msm_serial_hs.0"), |
Jin Hong | 4bbbfba | 2012-02-02 21:48:07 -0800 | [diff] [blame] | 5258 | CLK_LOOKUP("core_clk", gsbi7_uart_clk.c, "msm_serial_hsl.0"), |
David Keitel | 3c40fc5 | 2012-02-09 17:53:52 -0800 | [diff] [blame] | 5259 | CLK_LOOKUP("core_clk", gsbi1_qup_clk.c, "qup_i2c.0"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5260 | CLK_LOOKUP("core_clk", gsbi2_qup_clk.c, ""), |
Jing Lin | 04601f9 | 2012-02-05 15:36:07 -0800 | [diff] [blame] | 5261 | CLK_LOOKUP("core_clk", gsbi3_qup_clk.c, "qup_i2c.3"), |
Kevin Chan | d07220e | 2012-02-13 15:52:22 -0800 | [diff] [blame] | 5262 | CLK_LOOKUP("core_clk", gsbi4_qup_clk.c, "qup_i2c.4"), |
Stepan Moskovchenko | 6499900 | 2012-01-31 15:52:59 -0800 | [diff] [blame] | 5263 | CLK_LOOKUP("core_clk", gsbi5_qup_clk.c, "spi_qsd.0"), |
Joel King | 8f839b9 | 2012-04-01 14:37:46 -0700 | [diff] [blame] | 5264 | CLK_LOOKUP("core_clk", gsbi5_qup_clk.c, "qup_i2c.5"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5265 | CLK_LOOKUP("core_clk", gsbi6_qup_clk.c, ""), |
| 5266 | CLK_LOOKUP("core_clk", gsbi7_qup_clk.c, ""), |
| 5267 | CLK_LOOKUP("core_clk", pdm_clk.c, ""), |
Tianyi Gou | 50f2381 | 2012-02-06 16:04:19 -0800 | [diff] [blame] | 5268 | CLK_LOOKUP("mem_clk", pmem_clk.c, "msm_sps"), |
Tianyi Gou | 05e0110 | 2012-02-08 22:15:49 -0800 | [diff] [blame] | 5269 | CLK_LOOKUP("core_clk", prng_clk.c, "msm_rng.0"), |
Tianyi Gou | 43208a0 | 2011-09-27 15:35:13 -0700 | [diff] [blame] | 5270 | CLK_LOOKUP("core_clk", sdc1_clk.c, "msm_sdcc.1"), |
| 5271 | CLK_LOOKUP("core_clk", sdc2_clk.c, "msm_sdcc.2"), |
| 5272 | CLK_LOOKUP("core_clk", sdc3_clk.c, "msm_sdcc.3"), |
| 5273 | CLK_LOOKUP("core_clk", sdc4_clk.c, "msm_sdcc.4"), |
Joel Nider | 6cbe66a | 2012-06-26 11:11:59 +0300 | [diff] [blame] | 5274 | CLK_LOOKUP("ref_clk", tsif_ref_clk.c, "msm_tsif.0"), |
| 5275 | CLK_LOOKUP("iface_clk", tsif_p_clk.c, "msm_tsif.0"), |
| 5276 | CLK_LOOKUP("ref_clk", tsif_ref_clk.c, "msm_tsif.1"), |
| 5277 | CLK_LOOKUP("iface_clk", tsif_p_clk.c, "msm_tsif.1"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5278 | CLK_LOOKUP("core_clk", tssc_clk.c, ""), |
Manu Gautam | 5143b25 | 2012-01-05 19:25:23 -0800 | [diff] [blame] | 5279 | CLK_LOOKUP("alt_core_clk", usb_hs1_xcvr_clk.c, "msm_otg"), |
| 5280 | CLK_LOOKUP("alt_core_clk", usb_hs3_xcvr_clk.c, "msm_ehci_host.0"), |
| 5281 | 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] | 5282 | CLK_LOOKUP("src_clk", usb_fs1_src_clk.c, ""), |
| 5283 | CLK_LOOKUP("alt_core_clk", usb_fs1_xcvr_clk.c, ""), |
| 5284 | CLK_LOOKUP("sys_clk", usb_fs1_sys_clk.c, ""), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5285 | CLK_LOOKUP("ref_clk", sata_phy_ref_clk.c, ""), |
| 5286 | CLK_LOOKUP("cfg_clk", sata_phy_cfg_clk.c, ""), |
Tianyi Gou | 352955d | 2012-05-18 19:44:01 -0700 | [diff] [blame] | 5287 | CLK_LOOKUP("src_clk", sata_src_clk.c, ""), |
| 5288 | CLK_LOOKUP("core_rxoob_clk", sata_rxoob_clk.c, ""), |
| 5289 | CLK_LOOKUP("core_pmalive_clk", sata_pmalive_clk.c, ""), |
| 5290 | CLK_LOOKUP("bus_clk", sata_a_clk.c, ""), |
| 5291 | CLK_LOOKUP("iface_clk", sata_p_clk.c, ""), |
| 5292 | CLK_LOOKUP("slave_iface_clk", sfab_sata_s_p_clk.c, ""), |
Ramesh Masavarapu | 2831191 | 2011-10-27 11:04:12 -0700 | [diff] [blame] | 5293 | CLK_LOOKUP("iface_clk", ce3_p_clk.c, "qce.0"), |
| 5294 | CLK_LOOKUP("iface_clk", ce3_p_clk.c, "qcrypto.0"), |
| 5295 | CLK_LOOKUP("core_clk", ce3_core_clk.c, "qce.0"), |
| 5296 | CLK_LOOKUP("core_clk", ce3_core_clk.c, "qcrypto.0"), |
| 5297 | CLK_LOOKUP("ce3_core_src_clk", ce3_src_clk.c, "qce.0"), |
| 5298 | CLK_LOOKUP("ce3_core_src_clk", ce3_src_clk.c, "qcrypto.0"), |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 5299 | CLK_LOOKUP("dma_bam_pclk", dma_bam_p_clk.c, NULL), |
Jin Hong | 4bbbfba | 2012-02-02 21:48:07 -0800 | [diff] [blame] | 5300 | CLK_LOOKUP("iface_clk", gsbi1_p_clk.c, "msm_serial_hsl.1"), |
David Keitel | 3c40fc5 | 2012-02-09 17:53:52 -0800 | [diff] [blame] | 5301 | CLK_LOOKUP("iface_clk", gsbi1_p_clk.c, "qup_i2c.0"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5302 | CLK_LOOKUP("iface_clk", gsbi2_p_clk.c, ""), |
Jing Lin | 04601f9 | 2012-02-05 15:36:07 -0800 | [diff] [blame] | 5303 | CLK_LOOKUP("iface_clk", gsbi3_p_clk.c, "qup_i2c.3"), |
Kevin Chan | d07220e | 2012-02-13 15:52:22 -0800 | [diff] [blame] | 5304 | CLK_LOOKUP("iface_clk", gsbi4_p_clk.c, "qup_i2c.4"), |
Stepan Moskovchenko | 6499900 | 2012-01-31 15:52:59 -0800 | [diff] [blame] | 5305 | CLK_LOOKUP("iface_clk", gsbi5_p_clk.c, "spi_qsd.0"), |
Joel King | 8f839b9 | 2012-04-01 14:37:46 -0700 | [diff] [blame] | 5306 | CLK_LOOKUP("iface_clk", gsbi5_p_clk.c, "qup_i2c.5"), |
Mayank Rana | 262e903 | 2012-05-10 15:14:00 -0700 | [diff] [blame] | 5307 | CLK_LOOKUP("iface_clk", gsbi6_p_clk.c, "msm_serial_hs.0"), |
Jin Hong | 4bbbfba | 2012-02-02 21:48:07 -0800 | [diff] [blame] | 5308 | CLK_LOOKUP("iface_clk", gsbi7_p_clk.c, "msm_serial_hsl.0"), |
Joel Nider | 6d7d16c | 2012-05-30 18:02:42 +0300 | [diff] [blame] | 5309 | CLK_LOOKUP("ref_clk", tsif_ref_clk.c, "msm_tspp.0"), |
| 5310 | CLK_LOOKUP("iface_clk", tsif_p_clk.c, "msm_tspp.0"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5311 | CLK_LOOKUP("iface_clk", usb_fs1_p_clk.c, ""), |
Manu Gautam | 5143b25 | 2012-01-05 19:25:23 -0800 | [diff] [blame] | 5312 | CLK_LOOKUP("iface_clk", usb_hs1_p_clk.c, "msm_otg"), |
Manu Gautam | 7483f17 | 2011-11-08 15:22:26 +0530 | [diff] [blame] | 5313 | CLK_LOOKUP("iface_clk", usb_hs3_p_clk.c, "msm_ehci_host.0"), |
| 5314 | 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] | 5315 | CLK_LOOKUP("iface_clk", sdc1_p_clk.c, "msm_sdcc.1"), |
| 5316 | CLK_LOOKUP("iface_clk", sdc2_p_clk.c, "msm_sdcc.2"), |
| 5317 | CLK_LOOKUP("iface_clk", sdc3_p_clk.c, "msm_sdcc.3"), |
| 5318 | CLK_LOOKUP("iface_clk", sdc4_p_clk.c, "msm_sdcc.4"), |
Niranjana Vishwanathapura | 06f8933 | 2012-05-03 17:11:13 -0600 | [diff] [blame] | 5319 | CLK_LOOKUP("iface_clk", pcie_p_clk.c, "msm_pcie"), |
| 5320 | CLK_LOOKUP("ref_clk", pcie_phy_ref_clk.c, "msm_pcie"), |
| 5321 | CLK_LOOKUP("bus_clk", pcie_a_clk.c, "msm_pcie"), |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 5322 | CLK_LOOKUP("core_clk", adm0_clk.c, "msm_dmov"), |
| 5323 | CLK_LOOKUP("iface_clk", adm0_p_clk.c, "msm_dmov"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5324 | CLK_LOOKUP("iface_clk", pmic_arb0_p_clk.c, ""), |
| 5325 | CLK_LOOKUP("iface_clk", pmic_arb1_p_clk.c, ""), |
| 5326 | CLK_LOOKUP("core_clk", pmic_ssbi2_clk.c, ""), |
| 5327 | CLK_LOOKUP("mem_clk", rpm_msg_ram_p_clk.c, ""), |
Kevin Chan | d07220e | 2012-02-13 15:52:22 -0800 | [diff] [blame] | 5328 | CLK_LOOKUP("cam_clk", cam0_clk.c, "4-001a"), |
Sreesudhan Ramakrish Ramkumar | 3381da7 | 2012-01-27 08:08:32 -0800 | [diff] [blame] | 5329 | CLK_LOOKUP("cam_clk", cam0_clk.c, "4-0034"), |
Sreesudhan Ramakrish Ramkumar | 8002a79 | 2012-04-09 17:42:58 -0700 | [diff] [blame] | 5330 | CLK_LOOKUP("cam_clk", cam0_clk.c, "4-0020"), |
Sreesudhan Ramakrish Ramkumar | 6c6f57c | 2012-02-21 15:12:44 -0800 | [diff] [blame] | 5331 | CLK_LOOKUP("cam_clk", cam1_clk.c, "4-0048"), |
Kevin Chan | d07220e | 2012-02-13 15:52:22 -0800 | [diff] [blame] | 5332 | CLK_LOOKUP("cam_clk", cam1_clk.c, "4-006c"), |
Stephen Boyd | 85328b2 | 2012-09-19 17:07:16 -0700 | [diff] [blame] | 5333 | CLK_LOOKUP("cam_clk", cam2_clk.c, ""), |
Kevin Chan | d07220e | 2012-02-13 15:52:22 -0800 | [diff] [blame] | 5334 | CLK_LOOKUP("csi_src_clk", csi0_src_clk.c, "msm_csid.0"), |
| 5335 | CLK_LOOKUP("csi_src_clk", csi1_src_clk.c, "msm_csid.1"), |
| 5336 | CLK_LOOKUP("csi_src_clk", csi2_src_clk.c, "msm_csid.2"), |
| 5337 | CLK_LOOKUP("csi_clk", csi0_clk.c, "msm_csid.0"), |
| 5338 | CLK_LOOKUP("csi_clk", csi1_clk.c, "msm_csid.1"), |
| 5339 | CLK_LOOKUP("csi_clk", csi2_clk.c, "msm_csid.2"), |
| 5340 | CLK_LOOKUP("csi_phy_clk", csi0_phy_clk.c, "msm_csid.0"), |
| 5341 | CLK_LOOKUP("csi_phy_clk", csi1_phy_clk.c, "msm_csid.1"), |
| 5342 | CLK_LOOKUP("csi_phy_clk", csi2_phy_clk.c, "msm_csid.2"), |
| 5343 | CLK_LOOKUP("csi_pix_clk", csi_pix_clk.c, "msm_ispif.0"), |
| 5344 | CLK_LOOKUP("csi_pix1_clk", csi_pix1_clk.c, "msm_ispif.0"), |
| 5345 | CLK_LOOKUP("csi_rdi_clk", csi_rdi_clk.c, "msm_ispif.0"), |
| 5346 | CLK_LOOKUP("csi_rdi1_clk", csi_rdi1_clk.c, "msm_ispif.0"), |
| 5347 | CLK_LOOKUP("csi_rdi2_clk", csi_rdi2_clk.c, "msm_ispif.0"), |
| 5348 | CLK_LOOKUP("csiphy_timer_src_clk", |
| 5349 | csiphy_timer_src_clk.c, "msm_csiphy.0"), |
| 5350 | CLK_LOOKUP("csiphy_timer_src_clk", |
| 5351 | csiphy_timer_src_clk.c, "msm_csiphy.1"), |
| 5352 | CLK_LOOKUP("csiphy_timer_src_clk", |
| 5353 | csiphy_timer_src_clk.c, "msm_csiphy.2"), |
| 5354 | CLK_LOOKUP("csiphy_timer_clk", csi0phy_timer_clk.c, "msm_csiphy.0"), |
| 5355 | CLK_LOOKUP("csiphy_timer_clk", csi1phy_timer_clk.c, "msm_csiphy.1"), |
| 5356 | CLK_LOOKUP("csiphy_timer_clk", csi2phy_timer_clk.c, "msm_csiphy.2"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 5357 | CLK_LOOKUP("byte_clk", dsi1_byte_clk.c, "mipi_dsi.1"), |
| 5358 | CLK_LOOKUP("byte_clk", dsi2_byte_clk.c, "mipi_dsi.2"), |
| 5359 | CLK_LOOKUP("esc_clk", dsi1_esc_clk.c, "mipi_dsi.1"), |
| 5360 | CLK_LOOKUP("esc_clk", dsi2_esc_clk.c, "mipi_dsi.2"), |
Tianyi Gou | 5191880 | 2012-01-26 14:05:43 -0800 | [diff] [blame] | 5361 | CLK_LOOKUP("rgb_clk", rgb_tv_clk.c, ""), |
| 5362 | CLK_LOOKUP("npl_clk", npl_tv_clk.c, ""), |
| 5363 | |
Pu Chen | 86b4be9 | 2011-11-03 17:27:57 -0700 | [diff] [blame] | 5364 | CLK_LOOKUP("core_clk", gfx3d_clk.c, "kgsl-3d0.0"), |
Matt Wagantall | c9a780c | 2011-10-28 12:12:18 -0700 | [diff] [blame] | 5365 | CLK_LOOKUP("core_clk", gfx3d_clk.c, "footswitch-8x60.2"), |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 5366 | CLK_LOOKUP("bus_clk", |
Patrick Daly | e6f48904 | 2012-07-11 15:29:15 -0700 | [diff] [blame] | 5367 | gfx3d_axi_clk.c, "footswitch-8x60.2"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5368 | CLK_LOOKUP("iface_clk", vcap_p_clk.c, ""), |
Terence Hampson | 2e1705f | 2012-04-11 19:55:29 -0400 | [diff] [blame] | 5369 | CLK_LOOKUP("iface_clk", vcap_p_clk.c, "msm_vcap.0"), |
Matt Wagantall | c9a780c | 2011-10-28 12:12:18 -0700 | [diff] [blame] | 5370 | CLK_LOOKUP("iface_clk", vcap_p_clk.c, "footswitch-8x60.10"), |
| 5371 | CLK_LOOKUP("bus_clk", vcap_axi_clk.c, "footswitch-8x60.10"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5372 | CLK_LOOKUP("core_clk", vcap_clk.c, ""), |
Terence Hampson | 2e1705f | 2012-04-11 19:55:29 -0400 | [diff] [blame] | 5373 | CLK_LOOKUP("core_clk", vcap_clk.c, "msm_vcap.0"), |
Matt Wagantall | c9a780c | 2011-10-28 12:12:18 -0700 | [diff] [blame] | 5374 | CLK_LOOKUP("core_clk", vcap_clk.c, "footswitch-8x60.10"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5375 | CLK_LOOKUP("vcap_npl_clk", vcap_npl_clk.c, ""), |
Terence Hampson | 2e1705f | 2012-04-11 19:55:29 -0400 | [diff] [blame] | 5376 | CLK_LOOKUP("vcap_npl_clk", vcap_npl_clk.c, "msm_vcap.0"), |
Matt Wagantall | c9a780c | 2011-10-28 12:12:18 -0700 | [diff] [blame] | 5377 | CLK_LOOKUP("bus_clk", ijpeg_axi_clk.c, "footswitch-8x60.3"), |
Matt Wagantall | f45cd36 | 2012-05-03 21:09:44 -0700 | [diff] [blame] | 5378 | CLK_LOOKUP("mem_clk", imem_axi_clk.c, "msm_gemini.0"), |
| 5379 | CLK_LOOKUP("core_clk", ijpeg_clk.c, "msm_gemini.0"), |
Matt Wagantall | c9a780c | 2011-10-28 12:12:18 -0700 | [diff] [blame] | 5380 | CLK_LOOKUP("core_clk", ijpeg_clk.c, "footswitch-8x60.3"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5381 | CLK_LOOKUP("core_clk", jpegd_clk.c, ""), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 5382 | CLK_LOOKUP("core_clk", mdp_clk.c, "mdp.0"), |
Matt Wagantall | c9a780c | 2011-10-28 12:12:18 -0700 | [diff] [blame] | 5383 | CLK_LOOKUP("core_clk", mdp_clk.c, "footswitch-8x60.4"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 5384 | CLK_LOOKUP("vsync_clk", mdp_vsync_clk.c, "mdp.0"), |
Matt Wagantall | b82a513 | 2011-12-12 22:26:41 -0800 | [diff] [blame] | 5385 | CLK_LOOKUP("vsync_clk", mdp_vsync_clk.c, "footswitch-8x60.4"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 5386 | CLK_LOOKUP("lut_clk", lut_mdp_clk.c, "mdp.0"), |
Matt Wagantall | b82a513 | 2011-12-12 22:26:41 -0800 | [diff] [blame] | 5387 | CLK_LOOKUP("lut_clk", lut_mdp_clk.c, "footswitch-8x60.4"), |
Matt Wagantall | bb90da9 | 2011-10-25 15:07:52 -0700 | [diff] [blame] | 5388 | CLK_LOOKUP("core_clk", rot_clk.c, "msm_rotator.0"), |
Matt Wagantall | c9a780c | 2011-10-28 12:12:18 -0700 | [diff] [blame] | 5389 | CLK_LOOKUP("core_clk", rot_clk.c, "footswitch-8x60.6"), |
Matt Wagantall | 6128631 | 2012-02-22 15:55:09 -0800 | [diff] [blame] | 5390 | CLK_LOOKUP("tv_src_clk", tv_src_clk.c, "footswitch-8x60.4"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 5391 | CLK_LOOKUP("src_clk", tv_src_clk.c, "dtv.0"), |
| 5392 | CLK_LOOKUP("div_clk", tv_src_div_clk.c, ""), |
Greg Grisco | fa47b53 | 2011-11-11 10:32:06 -0800 | [diff] [blame] | 5393 | CLK_LOOKUP("core_clk", vcodec_clk.c, "msm_vidc.0"), |
Matt Wagantall | c9a780c | 2011-10-28 12:12:18 -0700 | [diff] [blame] | 5394 | CLK_LOOKUP("core_clk", vcodec_clk.c, "footswitch-8x60.7"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 5395 | CLK_LOOKUP("mdp_clk", mdp_tv_clk.c, "dtv.0"), |
Tianyi Gou | 5191880 | 2012-01-26 14:05:43 -0800 | [diff] [blame] | 5396 | CLK_LOOKUP("tv_clk", mdp_tv_clk.c, "footswitch-8x60.4"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 5397 | CLK_LOOKUP("hdmi_clk", hdmi_tv_clk.c, "dtv.0"), |
Aravind Venkateswaran | 0507c8c | 2012-02-16 17:16:05 -0800 | [diff] [blame] | 5398 | CLK_LOOKUP("core_clk", hdmi_app_clk.c, "hdmi_msm.1"), |
Ujwal Patel | d041f98 | 2012-03-27 19:51:44 -0700 | [diff] [blame] | 5399 | CLK_LOOKUP("vpe_clk", vpe_clk.c, "msm_vpe.0"), |
Matt Wagantall | c9a780c | 2011-10-28 12:12:18 -0700 | [diff] [blame] | 5400 | CLK_LOOKUP("core_clk", vpe_clk.c, "footswitch-8x60.9"), |
Kevin Chan | d07220e | 2012-02-13 15:52:22 -0800 | [diff] [blame] | 5401 | CLK_LOOKUP("vfe_clk", vfe_clk.c, "msm_vfe.0"), |
Matt Wagantall | c9a780c | 2011-10-28 12:12:18 -0700 | [diff] [blame] | 5402 | CLK_LOOKUP("core_clk", vfe_clk.c, "footswitch-8x60.8"), |
Kevin Chan | d07220e | 2012-02-13 15:52:22 -0800 | [diff] [blame] | 5403 | CLK_LOOKUP("csi_vfe_clk", csi_vfe_clk.c, "msm_vfe.0"), |
Matt Wagantall | c9a780c | 2011-10-28 12:12:18 -0700 | [diff] [blame] | 5404 | CLK_LOOKUP("bus_clk", vfe_axi_clk.c, "footswitch-8x60.8"), |
| 5405 | CLK_LOOKUP("bus_clk", mdp_axi_clk.c, "footswitch-8x60.4"), |
| 5406 | CLK_LOOKUP("bus_clk", rot_axi_clk.c, "footswitch-8x60.6"), |
| 5407 | CLK_LOOKUP("bus_clk", vcodec_axi_clk.c, "footswitch-8x60.7"), |
| 5408 | CLK_LOOKUP("bus_a_clk", vcodec_axi_a_clk.c, "footswitch-8x60.7"), |
| 5409 | CLK_LOOKUP("bus_b_clk", vcodec_axi_b_clk.c, "footswitch-8x60.7"), |
| 5410 | CLK_LOOKUP("bus_clk", vpe_axi_clk.c, "footswitch-8x60.9"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 5411 | CLK_LOOKUP("arb_clk", amp_p_clk.c, "mipi_dsi.1"), |
| 5412 | CLK_LOOKUP("arb_clk", amp_p_clk.c, "mipi_dsi.2"), |
Kevin Chan | d07220e | 2012-02-13 15:52:22 -0800 | [diff] [blame] | 5413 | CLK_LOOKUP("csi_pclk", csi_p_clk.c, "msm_csid.0"), |
| 5414 | CLK_LOOKUP("csi_pclk", csi_p_clk.c, "msm_csid.1"), |
| 5415 | CLK_LOOKUP("csi_pclk", csi_p_clk.c, "msm_csid.2"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 5416 | CLK_LOOKUP("master_iface_clk", dsi1_m_p_clk.c, "mipi_dsi.1"), |
| 5417 | CLK_LOOKUP("slave_iface_clk", dsi1_s_p_clk.c, "mipi_dsi.1"), |
| 5418 | CLK_LOOKUP("master_iface_clk", dsi2_m_p_clk.c, "mipi_dsi.2"), |
| 5419 | 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] | 5420 | CLK_LOOKUP("iface_clk", gfx3d_p_clk.c, "kgsl-3d0.0"), |
Matt Wagantall | c9a780c | 2011-10-28 12:12:18 -0700 | [diff] [blame] | 5421 | CLK_LOOKUP("iface_clk", gfx3d_p_clk.c, "footswitch-8x60.2"), |
Aravind Venkateswaran | 0507c8c | 2012-02-16 17:16:05 -0800 | [diff] [blame] | 5422 | CLK_LOOKUP("master_iface_clk", hdmi_m_p_clk.c, "hdmi_msm.1"), |
| 5423 | 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] | 5424 | CLK_LOOKUP("iface_clk", ijpeg_p_clk.c, "msm_gemini.0"), |
Matt Wagantall | c9a780c | 2011-10-28 12:12:18 -0700 | [diff] [blame] | 5425 | CLK_LOOKUP("iface_clk", ijpeg_p_clk.c, "footswitch-8x60.3"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5426 | CLK_LOOKUP("iface_clk", jpegd_p_clk.c, ""), |
Matt Wagantall | 5d44ef2 | 2012-01-23 11:01:05 -0800 | [diff] [blame] | 5427 | CLK_LOOKUP("mem_iface_clk", imem_p_clk.c, "kgsl-3d0.0"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 5428 | CLK_LOOKUP("iface_clk", mdp_p_clk.c, "mdp.0"), |
Matt Wagantall | c9a780c | 2011-10-28 12:12:18 -0700 | [diff] [blame] | 5429 | CLK_LOOKUP("iface_clk", mdp_p_clk.c, "footswitch-8x60.4"), |
Stepan Moskovchenko | 279b785 | 2012-01-31 20:42:46 -0800 | [diff] [blame] | 5430 | CLK_LOOKUP("iface_clk", smmu_p_clk.c, "msm_iommu"), |
Matt Wagantall | bb90da9 | 2011-10-25 15:07:52 -0700 | [diff] [blame] | 5431 | CLK_LOOKUP("iface_clk", rot_p_clk.c, "msm_rotator.0"), |
Matt Wagantall | c9a780c | 2011-10-28 12:12:18 -0700 | [diff] [blame] | 5432 | CLK_LOOKUP("iface_clk", rot_p_clk.c, "footswitch-8x60.6"), |
Greg Grisco | fa47b53 | 2011-11-11 10:32:06 -0800 | [diff] [blame] | 5433 | CLK_LOOKUP("iface_clk", vcodec_p_clk.c, "msm_vidc.0"), |
Matt Wagantall | c9a780c | 2011-10-28 12:12:18 -0700 | [diff] [blame] | 5434 | CLK_LOOKUP("iface_clk", vcodec_p_clk.c, "footswitch-8x60.7"), |
Kevin Chan | d07220e | 2012-02-13 15:52:22 -0800 | [diff] [blame] | 5435 | CLK_LOOKUP("vfe_pclk", vfe_p_clk.c, "msm_vfe.0"), |
Matt Wagantall | c9a780c | 2011-10-28 12:12:18 -0700 | [diff] [blame] | 5436 | CLK_LOOKUP("iface_clk", vfe_p_clk.c, "footswitch-8x60.8"), |
Kevin Chan | b20742b | 2012-02-27 15:47:35 -0800 | [diff] [blame] | 5437 | CLK_LOOKUP("vpe_pclk", vpe_p_clk.c, "msm_vpe.0"), |
Matt Wagantall | 6128631 | 2012-02-22 15:55:09 -0800 | [diff] [blame] | 5438 | CLK_LOOKUP("iface_clk", vpe_p_clk.c, "footswitch-8x60.9"), |
Tianyi Gou | 21a0e80 | 2012-02-04 22:34:10 -0800 | [diff] [blame] | 5439 | |
Patrick Lai | 04baee94 | 2012-05-01 14:38:47 -0700 | [diff] [blame] | 5440 | CLK_LOOKUP("bit_clk", mi2s_bit_clk.c, |
| 5441 | "msm-dai-q6-mi2s"), |
| 5442 | CLK_LOOKUP("osr_clk", mi2s_osr_clk.c, |
| 5443 | "msm-dai-q6-mi2s"), |
Kuirong Wang | a9c3acc | 2012-02-09 17:00:45 -0800 | [diff] [blame] | 5444 | CLK_LOOKUP("bit_clk", codec_i2s_mic_bit_clk.c, |
| 5445 | "msm-dai-q6.1"), |
| 5446 | CLK_LOOKUP("osr_clk", codec_i2s_mic_osr_clk.c, |
| 5447 | "msm-dai-q6.1"), |
| 5448 | CLK_LOOKUP("bit_clk", spare_i2s_mic_bit_clk.c, |
| 5449 | "msm-dai-q6.5"), |
| 5450 | CLK_LOOKUP("osr_clk", spare_i2s_mic_osr_clk.c, |
| 5451 | "msm-dai-q6.5"), |
| 5452 | CLK_LOOKUP("bit_clk", codec_i2s_spkr_bit_clk.c, |
Kuirong Wang | dea7c82 | 2012-08-20 20:52:42 -0700 | [diff] [blame^] | 5453 | "msm-dai-q6.0"), |
| 5454 | CLK_LOOKUP("osr_clk", codec_i2s_spkr_osr_clk.c, |
| 5455 | "msm-dai-q6.0"), |
| 5456 | CLK_LOOKUP("bit_clk", codec_i2s_spkr_bit_clk.c, |
Kuirong Wang | a9c3acc | 2012-02-09 17:00:45 -0800 | [diff] [blame] | 5457 | "msm-dai-q6.16384"), |
| 5458 | CLK_LOOKUP("osr_clk", codec_i2s_spkr_osr_clk.c, |
| 5459 | "msm-dai-q6.16384"), |
| 5460 | CLK_LOOKUP("bit_clk", spare_i2s_spkr_bit_clk.c, |
| 5461 | "msm-dai-q6.4"), |
| 5462 | CLK_LOOKUP("osr_clk", spare_i2s_spkr_osr_clk.c, |
| 5463 | "msm-dai-q6.4"), |
| 5464 | CLK_LOOKUP("pcm_clk", pcm_clk.c, "msm-dai-q6.2"), |
Kiran Kandi | 5f4ab69 | 2012-02-23 11:23:56 -0800 | [diff] [blame] | 5465 | CLK_LOOKUP("pcm_clk", pcm_clk.c, "msm-dai-q6.3"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5466 | CLK_LOOKUP("sps_slimbus_clk", sps_slimbus_clk.c, ""), |
Tianyi Gou | 44a81b0 | 2012-02-06 17:49:07 -0800 | [diff] [blame] | 5467 | CLK_LOOKUP("core_clk", audio_slimbus_clk.c, "msm_slim_ctrl.1"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5468 | CLK_LOOKUP("core_clk", jpegd_axi_clk.c, ""), |
| 5469 | CLK_LOOKUP("core_clk", vpe_axi_clk.c, ""), |
| 5470 | CLK_LOOKUP("core_clk", mdp_axi_clk.c, ""), |
| 5471 | CLK_LOOKUP("core_clk", vcap_axi_clk.c, ""), |
| 5472 | CLK_LOOKUP("core_clk", rot_axi_clk.c, ""), |
| 5473 | CLK_LOOKUP("core_clk", ijpeg_axi_clk.c, ""), |
| 5474 | CLK_LOOKUP("core_clk", vfe_axi_clk.c, ""), |
| 5475 | CLK_LOOKUP("core_clk", vcodec_axi_a_clk.c, ""), |
| 5476 | CLK_LOOKUP("core_clk", vcodec_axi_b_clk.c, ""), |
Patrick Daly | e6f48904 | 2012-07-11 15:29:15 -0700 | [diff] [blame] | 5477 | CLK_LOOKUP("core_clk", gfx3d_axi_clk.c, ""), |
Tianyi Gou | 21a0e80 | 2012-02-04 22:34:10 -0800 | [diff] [blame] | 5478 | |
| 5479 | CLK_LOOKUP("dfab_dsps_clk", dfab_dsps_clk.c, NULL), |
| 5480 | CLK_LOOKUP("core_clk", dfab_usb_hs_clk.c, "msm_otg"), |
| 5481 | CLK_LOOKUP("core_clk", dfab_usb_hs3_clk.c, "msm_ehci_host.0"), |
| 5482 | CLK_LOOKUP("core_clk", dfab_usb_hs3_clk.c, "msm_ehci_host.1"), |
| 5483 | CLK_LOOKUP("bus_clk", dfab_sdc1_clk.c, "msm_sdcc.1"), |
| 5484 | CLK_LOOKUP("bus_clk", dfab_sdc2_clk.c, "msm_sdcc.2"), |
| 5485 | CLK_LOOKUP("bus_clk", dfab_sdc3_clk.c, "msm_sdcc.3"), |
| 5486 | CLK_LOOKUP("bus_clk", dfab_sdc4_clk.c, "msm_sdcc.4"), |
| 5487 | CLK_LOOKUP("dfab_clk", dfab_sps_clk.c, "msm_sps"), |
| 5488 | CLK_LOOKUP("bus_clk", dfab_bam_dmux_clk.c, "BAM_RMNT"), |
| 5489 | CLK_LOOKUP("bus_clk", dfab_scm_clk.c, "scm"), |
| 5490 | |
Manu Gautam | 5143b25 | 2012-01-05 19:25:23 -0800 | [diff] [blame] | 5491 | CLK_LOOKUP("alt_core_clk", usb_hsic_xcvr_fs_clk.c, "msm_hsic_host"), |
| 5492 | CLK_LOOKUP("phy_clk", usb_hsic_hsic_clk.c, "msm_hsic_host"), |
| 5493 | CLK_LOOKUP("cal_clk", usb_hsic_hsio_cal_clk.c, "msm_hsic_host"), |
| 5494 | CLK_LOOKUP("core_clk", usb_hsic_system_clk.c, "msm_hsic_host"), |
| 5495 | CLK_LOOKUP("iface_clk", usb_hsic_p_clk.c, "msm_hsic_host"), |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 5496 | |
Stepan Moskovchenko | 279b785 | 2012-01-31 20:42:46 -0800 | [diff] [blame] | 5497 | CLK_LOOKUP("core_clk", jpegd_axi_clk.c, "msm_iommu.0"), |
| 5498 | CLK_LOOKUP("core_clk", vpe_axi_clk.c, "msm_iommu.1"), |
| 5499 | CLK_LOOKUP("core_clk", mdp_axi_clk.c, "msm_iommu.2"), |
| 5500 | CLK_LOOKUP("core_clk", mdp_axi_clk.c, "msm_iommu.3"), |
| 5501 | CLK_LOOKUP("core_clk", rot_axi_clk.c, "msm_iommu.4"), |
| 5502 | CLK_LOOKUP("core_clk", ijpeg_axi_clk.c, "msm_iommu.5"), |
| 5503 | CLK_LOOKUP("core_clk", vfe_axi_clk.c, "msm_iommu.6"), |
| 5504 | CLK_LOOKUP("core_clk", vcodec_axi_a_clk.c, "msm_iommu.7"), |
| 5505 | CLK_LOOKUP("core_clk", vcodec_axi_b_clk.c, "msm_iommu.8"), |
Patrick Daly | e6f48904 | 2012-07-11 15:29:15 -0700 | [diff] [blame] | 5506 | CLK_LOOKUP("core_clk", gfx3d_axi_clk.c, "msm_iommu.9"), |
| 5507 | CLK_LOOKUP("core_clk", gfx3d_axi_clk.c, "msm_iommu.10"), |
| 5508 | |
Stepan Moskovchenko | 279b785 | 2012-01-31 20:42:46 -0800 | [diff] [blame] | 5509 | CLK_LOOKUP("core_clk", vcap_axi_clk.c, "msm_iommu.11"), |
| 5510 | |
Deepak Kotur | 954b178 | 2012-04-24 17:58:19 -0700 | [diff] [blame] | 5511 | CLK_LOOKUP("mdp_iommu_clk", mdp_axi_clk.c, "msm_vidc.0"), |
| 5512 | CLK_LOOKUP("rot_iommu_clk", rot_axi_clk.c, "msm_vidc.0"), |
| 5513 | CLK_LOOKUP("vcodec_iommu0_clk", vcodec_axi_a_clk.c, "msm_vidc.0"), |
| 5514 | CLK_LOOKUP("vcodec_iommu1_clk", vcodec_axi_b_clk.c, "msm_vidc.0"), |
| 5515 | CLK_LOOKUP("smmu_iface_clk", smmu_p_clk.c, "msm_vidc.0"), |
Stephen Boyd | 7b973de | 2012-03-09 12:26:16 -0800 | [diff] [blame] | 5516 | CLK_LOOKUP("core_clk", vcodec_axi_clk.c, "pil_vidc"), |
| 5517 | CLK_LOOKUP("smmu_iface_clk", smmu_p_clk.c, "pil_vidc"), |
| 5518 | |
Jeff Ohlstein | 8c116c7 | 2011-10-27 17:34:48 -0700 | [diff] [blame] | 5519 | CLK_LOOKUP("mem_clk", ebi1_adm_clk.c, "msm_dmov"), |
Matt Wagantall | 33bac7e | 2012-05-22 14:59:05 -0700 | [diff] [blame] | 5520 | CLK_LOOKUP("mem_clk", ebi1_acpu_a_clk.c, ""), |
| 5521 | CLK_LOOKUP("bus_clk", afab_acpu_a_clk.c, ""), |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 5522 | |
Matt Wagantall | c33c1ed | 2012-07-23 17:19:08 -0700 | [diff] [blame] | 5523 | CLK_LOOKUP("reset1_clk", dsi1_reset_clk.c, "footswitch-8x60.4"), |
| 5524 | CLK_LOOKUP("reset2_clk", dsi2_reset_clk.c, "footswitch-8x60.4"), |
Matt Wagantall | 735e41b | 2012-07-23 17:18:58 -0700 | [diff] [blame] | 5525 | |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5526 | CLK_LOOKUP("l2_mclk", l2_m_clk, ""), |
| 5527 | CLK_LOOKUP("krait0_mclk", krait0_m_clk, ""), |
| 5528 | CLK_LOOKUP("krait1_mclk", krait1_m_clk, ""), |
Tianyi Gou | 455c13c | 2012-02-02 16:33:24 -0800 | [diff] [blame] | 5529 | CLK_LOOKUP("krait2_mclk", krait2_m_clk, ""), |
| 5530 | CLK_LOOKUP("krait3_mclk", krait3_m_clk, ""), |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 5531 | }; |
| 5532 | |
Patrick Daly | e6f48904 | 2012-07-11 15:29:15 -0700 | [diff] [blame] | 5533 | static struct clk_lookup msm_clocks_8960_common[] __initdata = { |
Stephen Boyd | 72a8035 | 2012-01-26 15:57:38 -0800 | [diff] [blame] | 5534 | CLK_LOOKUP("xo", cxo_a_clk.c, ""), |
| 5535 | CLK_LOOKUP("xo", pxo_a_clk.c, ""), |
Stephen Boyd | ed630b0 | 2012-01-26 15:26:47 -0800 | [diff] [blame] | 5536 | CLK_LOOKUP("cxo", cxo_clk.c, "wcnss_wlan.0"), |
| 5537 | CLK_LOOKUP("cxo", cxo_clk.c, "pil_riva"), |
| 5538 | CLK_LOOKUP("xo", pxo_clk.c, "pil_qdsp6v4.0"), |
| 5539 | CLK_LOOKUP("xo", cxo_clk.c, "pil_qdsp6v4.1"), |
| 5540 | CLK_LOOKUP("xo", cxo_clk.c, "pil_qdsp6v4.2"), |
Stephen Boyd | 69d35e3 | 2012-02-14 15:33:30 -0800 | [diff] [blame] | 5541 | CLK_LOOKUP("xo", cxo_clk.c, "BAM_RMNT"), |
Stephen Boyd | 5a190a8 | 2012-03-01 14:45:15 -0800 | [diff] [blame] | 5542 | CLK_LOOKUP("xo", cxo_clk.c, "msm_xo"), |
David Collins | a7d2353 | 2012-08-02 10:48:16 -0700 | [diff] [blame] | 5543 | CLK_LOOKUP("vref_buff", cxo_clk.c, "rpm-regulator"), |
Stephen Boyd | ed630b0 | 2012-01-26 15:26:47 -0800 | [diff] [blame] | 5544 | CLK_LOOKUP("pll2", pll2_clk.c, NULL), |
| 5545 | CLK_LOOKUP("pll8", pll8_clk.c, NULL), |
| 5546 | CLK_LOOKUP("pll4", pll4_clk.c, NULL), |
| 5547 | CLK_LOOKUP("measure", measure_clk.c, "debug"), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5548 | |
Matt Wagantall | d75f131 | 2012-05-23 16:17:35 -0700 | [diff] [blame] | 5549 | CLK_LOOKUP("bus_clk", afab_clk.c, ""), |
| 5550 | CLK_LOOKUP("bus_clk", afab_a_clk.c, ""), |
| 5551 | CLK_LOOKUP("bus_clk", cfpb_clk.c, ""), |
| 5552 | CLK_LOOKUP("bus_clk", cfpb_a_clk.c, ""), |
| 5553 | CLK_LOOKUP("bus_clk", dfab_clk.c, ""), |
| 5554 | CLK_LOOKUP("bus_clk", dfab_a_clk.c, ""), |
| 5555 | CLK_LOOKUP("mem_clk", ebi1_clk.c, ""), |
| 5556 | CLK_LOOKUP("mem_clk", ebi1_a_clk.c, ""), |
| 5557 | CLK_LOOKUP("bus_clk", mmfab_clk.c, ""), |
| 5558 | CLK_LOOKUP("bus_clk", mmfab_a_clk.c, ""), |
| 5559 | CLK_LOOKUP("bus_clk", mmfpb_clk.c, ""), |
| 5560 | CLK_LOOKUP("bus_clk", mmfpb_a_clk.c, ""), |
| 5561 | CLK_LOOKUP("bus_clk", sfab_clk.c, ""), |
| 5562 | CLK_LOOKUP("bus_clk", sfab_a_clk.c, ""), |
| 5563 | CLK_LOOKUP("bus_clk", sfpb_clk.c, ""), |
| 5564 | CLK_LOOKUP("bus_clk", sfpb_a_clk.c, ""), |
| 5565 | |
Matt Wagantall | b2710b8 | 2011-11-16 19:55:17 -0800 | [diff] [blame] | 5566 | CLK_LOOKUP("bus_clk", afab_clk.c, "msm_apps_fab"), |
Matt Wagantall | 33bac7e | 2012-05-22 14:59:05 -0700 | [diff] [blame] | 5567 | 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] | 5568 | CLK_LOOKUP("bus_clk", cfpb_clk.c, "msm_cpss_fpb"), |
| 5569 | CLK_LOOKUP("bus_a_clk", cfpb_a_clk.c, "msm_cpss_fpb"), |
| 5570 | CLK_LOOKUP("bus_clk", sfab_clk.c, "msm_sys_fab"), |
Stephen Boyd | d7a143a | 2012-02-16 17:59:26 -0800 | [diff] [blame] | 5571 | 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] | 5572 | CLK_LOOKUP("bus_clk", sfpb_clk.c, "msm_sys_fpb"), |
| 5573 | CLK_LOOKUP("bus_a_clk", sfpb_a_clk.c, "msm_sys_fpb"), |
| 5574 | CLK_LOOKUP("bus_clk", mmfab_clk.c, "msm_mm_fab"), |
| 5575 | CLK_LOOKUP("bus_a_clk", mmfab_a_clk.c, "msm_mm_fab"), |
| 5576 | CLK_LOOKUP("mem_clk", ebi1_msmbus_clk.c, "msm_bus"), |
Matt Wagantall | 33bac7e | 2012-05-22 14:59:05 -0700 | [diff] [blame] | 5577 | CLK_LOOKUP("mem_a_clk", ebi1_msmbus_a_clk.c, "msm_bus"), |
Gagan Mac | bc5f81d | 2012-04-04 15:03:12 -0600 | [diff] [blame] | 5578 | CLK_LOOKUP("dfab_clk", dfab_msmbus_clk.c, "msm_bus"), |
| 5579 | CLK_LOOKUP("dfab_a_clk", dfab_msmbus_a_clk.c, "msm_bus"), |
Pratik Patel | f17b147 | 2012-05-25 22:23:52 -0700 | [diff] [blame] | 5580 | CLK_LOOKUP("core_a_clk", qdss_a_clk.c, ""), |
Pratik Patel | 3b0ca88 | 2012-06-01 16:54:14 -0700 | [diff] [blame] | 5581 | CLK_LOOKUP("core_clk", qdss_clk.c, "coresight-tpiu.0"), |
| 5582 | CLK_LOOKUP("core_clk", qdss_clk.c, "coresight-etb.0"), |
| 5583 | CLK_LOOKUP("core_clk", qdss_clk.c, "coresight-funnel.0"), |
| 5584 | CLK_LOOKUP("core_clk", qdss_clk.c, "coresight-etm.0"), |
| 5585 | CLK_LOOKUP("core_clk", qdss_clk.c, "coresight-etm.1"), |
| 5586 | CLK_LOOKUP("core_clk", qdss_clk.c, "coresight-etm.2"), |
| 5587 | CLK_LOOKUP("core_clk", qdss_clk.c, "coresight-etm.3"), |
Matt Wagantall | b2710b8 | 2011-11-16 19:55:17 -0800 | [diff] [blame] | 5588 | |
| 5589 | CLK_LOOKUP("ebi1_clk", ebi1_clk.c, NULL), |
Matt Wagantall | b2710b8 | 2011-11-16 19:55:17 -0800 | [diff] [blame] | 5590 | CLK_LOOKUP("mmfpb_clk", mmfpb_clk.c, NULL), |
| 5591 | CLK_LOOKUP("mmfpb_a_clk", mmfpb_a_clk.c, "clock-8960"), |
| 5592 | CLK_LOOKUP("cfpb_a_clk", cfpb_a_clk.c, "clock-8960"), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5593 | |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5594 | CLK_LOOKUP("core_clk", gp0_clk.c, ""), |
| 5595 | CLK_LOOKUP("core_clk", gp1_clk.c, ""), |
| 5596 | CLK_LOOKUP("core_clk", gp2_clk.c, ""), |
| 5597 | CLK_LOOKUP("core_clk", gsbi1_uart_clk.c, ""), |
| 5598 | CLK_LOOKUP("core_clk", gsbi2_uart_clk.c, ""), |
| 5599 | CLK_LOOKUP("core_clk", gsbi3_uart_clk.c, ""), |
| 5600 | CLK_LOOKUP("core_clk", gsbi4_uart_clk.c, ""), |
Matt Wagantall | e252237 | 2011-08-17 14:52:21 -0700 | [diff] [blame] | 5601 | CLK_LOOKUP("core_clk", gsbi5_uart_clk.c, "msm_serial_hsl.0"), |
| 5602 | CLK_LOOKUP("core_clk", gsbi6_uart_clk.c, "msm_serial_hs.0"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5603 | CLK_LOOKUP("core_clk", gsbi7_uart_clk.c, ""), |
Mayank Rana | 1f02d95 | 2012-07-04 19:11:20 +0530 | [diff] [blame] | 5604 | /* used on 8960 SGLTE for console */ |
Stepan Moskovchenko | 2b4b1cd | 2012-03-29 18:21:04 -0700 | [diff] [blame] | 5605 | CLK_LOOKUP("core_clk", gsbi8_uart_clk.c, "msm_serial_hsl.1"), |
Mayank Rana | 1f02d95 | 2012-07-04 19:11:20 +0530 | [diff] [blame] | 5606 | /* used on 8960 standalone with Atheros Bluetooth */ |
| 5607 | CLK_LOOKUP("core_clk", gsbi8_uart_clk.c, "msm_serial_hs.2"), |
Mayank Rana | e009c92 | 2012-03-22 03:02:06 +0530 | [diff] [blame] | 5608 | CLK_LOOKUP("core_clk", gsbi9_uart_clk.c, "msm_serial_hs.1"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5609 | CLK_LOOKUP("core_clk", gsbi10_uart_clk.c, ""), |
| 5610 | CLK_LOOKUP("core_clk", gsbi11_uart_clk.c, ""), |
| 5611 | CLK_LOOKUP("core_clk", gsbi12_uart_clk.c, ""), |
Matt Wagantall | ac29485 | 2011-08-17 15:44:58 -0700 | [diff] [blame] | 5612 | CLK_LOOKUP("core_clk", gsbi1_qup_clk.c, "spi_qsd.0"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5613 | CLK_LOOKUP("core_clk", gsbi2_qup_clk.c, ""), |
Matt Wagantall | ac29485 | 2011-08-17 15:44:58 -0700 | [diff] [blame] | 5614 | CLK_LOOKUP("core_clk", gsbi3_qup_clk.c, "qup_i2c.3"), |
| 5615 | CLK_LOOKUP("core_clk", gsbi4_qup_clk.c, "qup_i2c.4"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5616 | CLK_LOOKUP("core_clk", gsbi5_qup_clk.c, ""), |
| 5617 | CLK_LOOKUP("core_clk", gsbi6_qup_clk.c, ""), |
| 5618 | CLK_LOOKUP("core_clk", gsbi7_qup_clk.c, ""), |
| 5619 | CLK_LOOKUP("core_clk", gsbi8_qup_clk.c, ""), |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 5620 | CLK_LOOKUP("core_clk", gsbi9_qup_clk.c, ""), |
Matt Wagantall | ac29485 | 2011-08-17 15:44:58 -0700 | [diff] [blame] | 5621 | CLK_LOOKUP("core_clk", gsbi10_qup_clk.c, "qup_i2c.10"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5622 | CLK_LOOKUP("core_clk", gsbi11_qup_clk.c, ""), |
Matt Wagantall | ac29485 | 2011-08-17 15:44:58 -0700 | [diff] [blame] | 5623 | CLK_LOOKUP("core_clk", gsbi12_qup_clk.c, "qup_i2c.12"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5624 | CLK_LOOKUP("core_clk", pdm_clk.c, ""), |
Vikram Mulukutla | dd0a237 | 2011-09-19 15:58:21 -0700 | [diff] [blame] | 5625 | CLK_LOOKUP("mem_clk", pmem_clk.c, "msm_sps"), |
Matt Wagantall | c120529 | 2011-08-11 17:19:31 -0700 | [diff] [blame] | 5626 | CLK_LOOKUP("core_clk", prng_clk.c, "msm_rng.0"), |
Matt Wagantall | 37ce384 | 2011-08-17 16:00:36 -0700 | [diff] [blame] | 5627 | CLK_LOOKUP("core_clk", sdc1_clk.c, "msm_sdcc.1"), |
| 5628 | CLK_LOOKUP("core_clk", sdc2_clk.c, "msm_sdcc.2"), |
| 5629 | CLK_LOOKUP("core_clk", sdc3_clk.c, "msm_sdcc.3"), |
| 5630 | CLK_LOOKUP("core_clk", sdc4_clk.c, "msm_sdcc.4"), |
| 5631 | CLK_LOOKUP("core_clk", sdc5_clk.c, "msm_sdcc.5"), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5632 | CLK_LOOKUP("slimbus_xo_src_clk", slimbus_xo_src_clk.c, NULL), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5633 | CLK_LOOKUP("core_clk", tssc_clk.c, ""), |
Manu Gautam | 5143b25 | 2012-01-05 19:25:23 -0800 | [diff] [blame] | 5634 | CLK_LOOKUP("alt_core_clk", usb_hs1_xcvr_clk.c, "msm_otg"), |
| 5635 | CLK_LOOKUP("phy_clk", usb_phy0_clk.c, "msm_otg"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5636 | CLK_LOOKUP("alt_core_clk", usb_fs1_xcvr_clk.c, ""), |
| 5637 | CLK_LOOKUP("sys_clk", usb_fs1_sys_clk.c, ""), |
| 5638 | CLK_LOOKUP("src_clk", usb_fs1_src_clk.c, ""), |
| 5639 | CLK_LOOKUP("alt_core_clk", usb_fs2_xcvr_clk.c, ""), |
| 5640 | CLK_LOOKUP("sys_clk", usb_fs2_sys_clk.c, ""), |
| 5641 | CLK_LOOKUP("src_clk", usb_fs2_src_clk.c, ""), |
Tianyi Gou | 3022dfd | 2012-01-25 15:50:05 -0800 | [diff] [blame] | 5642 | CLK_LOOKUP("alt_core_clk", usb_hsic_xcvr_fs_clk.c, "msm_hsic_host"), |
| 5643 | CLK_LOOKUP("phy_clk", usb_hsic_hsic_clk.c, "msm_hsic_host"), |
| 5644 | CLK_LOOKUP("cal_clk", usb_hsic_hsio_cal_clk.c, "msm_hsic_host"), |
| 5645 | CLK_LOOKUP("core_clk", usb_hsic_system_clk.c, "msm_hsic_host"), |
| 5646 | CLK_LOOKUP("iface_clk", usb_hsic_p_clk.c, "msm_hsic_host"), |
Matt Wagantall | c4b3a4d | 2011-08-17 16:58:39 -0700 | [diff] [blame] | 5647 | CLK_LOOKUP("iface_clk", ce1_p_clk.c, "qce.0"), |
Matt Wagantall | e0b1145 | 2011-09-13 17:25:33 -0700 | [diff] [blame] | 5648 | CLK_LOOKUP("iface_clk", ce1_p_clk.c, "qcrypto.0"), |
Matt Wagantall | c4b3a4d | 2011-08-17 16:58:39 -0700 | [diff] [blame] | 5649 | CLK_LOOKUP("core_clk", ce1_core_clk.c, "qce.0"), |
Matt Wagantall | e0b1145 | 2011-09-13 17:25:33 -0700 | [diff] [blame] | 5650 | CLK_LOOKUP("core_clk", ce1_core_clk.c, "qcrypto.0"), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5651 | CLK_LOOKUP("dma_bam_pclk", dma_bam_p_clk.c, NULL), |
Matt Wagantall | ac29485 | 2011-08-17 15:44:58 -0700 | [diff] [blame] | 5652 | CLK_LOOKUP("iface_clk", gsbi1_p_clk.c, "spi_qsd.0"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5653 | CLK_LOOKUP("iface_clk", gsbi2_p_clk.c, ""), |
Matt Wagantall | ac29485 | 2011-08-17 15:44:58 -0700 | [diff] [blame] | 5654 | CLK_LOOKUP("iface_clk", gsbi3_p_clk.c, "qup_i2c.3"), |
| 5655 | CLK_LOOKUP("iface_clk", gsbi4_p_clk.c, "qup_i2c.4"), |
Matt Wagantall | e252237 | 2011-08-17 14:52:21 -0700 | [diff] [blame] | 5656 | CLK_LOOKUP("iface_clk", gsbi5_p_clk.c, "msm_serial_hsl.0"), |
| 5657 | CLK_LOOKUP("iface_clk", gsbi6_p_clk.c, "msm_serial_hs.0"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5658 | CLK_LOOKUP("iface_clk", gsbi7_p_clk.c, ""), |
Mayank Rana | 1f02d95 | 2012-07-04 19:11:20 +0530 | [diff] [blame] | 5659 | /* used on 8960 SGLTE for serial console */ |
Stepan Moskovchenko | 2b4b1cd | 2012-03-29 18:21:04 -0700 | [diff] [blame] | 5660 | CLK_LOOKUP("iface_clk", gsbi8_p_clk.c, "msm_serial_hsl.1"), |
Mayank Rana | 1f02d95 | 2012-07-04 19:11:20 +0530 | [diff] [blame] | 5661 | /* used on 8960 standalone with Atheros Bluetooth */ |
| 5662 | CLK_LOOKUP("iface_clk", gsbi8_p_clk.c, "msm_serial_hs.2"), |
Mayank Rana | e009c92 | 2012-03-22 03:02:06 +0530 | [diff] [blame] | 5663 | CLK_LOOKUP("iface_clk", gsbi9_p_clk.c, "msm_serial_hs.1"), |
Matt Wagantall | ac29485 | 2011-08-17 15:44:58 -0700 | [diff] [blame] | 5664 | CLK_LOOKUP("iface_clk", gsbi10_p_clk.c, "qup_i2c.10"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5665 | CLK_LOOKUP("iface_clk", gsbi11_p_clk.c, ""), |
Matt Wagantall | ac29485 | 2011-08-17 15:44:58 -0700 | [diff] [blame] | 5666 | CLK_LOOKUP("iface_clk", gsbi12_p_clk.c, "qup_i2c.12"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5667 | CLK_LOOKUP("iface_clk", tsif_p_clk.c, ""), |
Joel Nider | 6d7d16c | 2012-05-30 18:02:42 +0300 | [diff] [blame] | 5668 | CLK_LOOKUP("ref_clk", tsif_ref_clk.c, "msm_tspp.0"), |
| 5669 | CLK_LOOKUP("iface_clk", tsif_p_clk.c, "msm_tspp.0"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5670 | CLK_LOOKUP("iface_clk", usb_fs1_p_clk.c, ""), |
| 5671 | CLK_LOOKUP("iface_clk", usb_fs2_p_clk.c, ""), |
Manu Gautam | 5143b25 | 2012-01-05 19:25:23 -0800 | [diff] [blame] | 5672 | CLK_LOOKUP("iface_clk", usb_hs1_p_clk.c, "msm_otg"), |
Matt Wagantall | 37ce384 | 2011-08-17 16:00:36 -0700 | [diff] [blame] | 5673 | CLK_LOOKUP("iface_clk", sdc1_p_clk.c, "msm_sdcc.1"), |
| 5674 | CLK_LOOKUP("iface_clk", sdc2_p_clk.c, "msm_sdcc.2"), |
| 5675 | CLK_LOOKUP("iface_clk", sdc3_p_clk.c, "msm_sdcc.3"), |
| 5676 | CLK_LOOKUP("iface_clk", sdc4_p_clk.c, "msm_sdcc.4"), |
| 5677 | CLK_LOOKUP("iface_clk", sdc5_p_clk.c, "msm_sdcc.5"), |
Matt Wagantall | e1a8606 | 2011-08-18 17:46:10 -0700 | [diff] [blame] | 5678 | CLK_LOOKUP("core_clk", adm0_clk.c, "msm_dmov"), |
| 5679 | CLK_LOOKUP("iface_clk", adm0_p_clk.c, "msm_dmov"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5680 | CLK_LOOKUP("iface_clk", pmic_arb0_p_clk.c, ""), |
| 5681 | CLK_LOOKUP("iface_clk", pmic_arb1_p_clk.c, ""), |
| 5682 | CLK_LOOKUP("core_clk", pmic_ssbi2_clk.c, ""), |
| 5683 | CLK_LOOKUP("mem_clk", rpm_msg_ram_p_clk.c, ""), |
Kevin Chan | 09f4e66 | 2011-12-16 08:17:02 -0800 | [diff] [blame] | 5684 | CLK_LOOKUP("cam_clk", cam0_clk.c, "4-001a"), |
| 5685 | CLK_LOOKUP("cam_clk", cam0_clk.c, "4-006c"), |
| 5686 | CLK_LOOKUP("cam_clk", cam0_clk.c, "4-0048"), |
Tianyi Gou | 3022dfd | 2012-01-25 15:50:05 -0800 | [diff] [blame] | 5687 | CLK_LOOKUP("cam_clk", cam2_clk.c, NULL), |
Sreesudhan Ramakrish Ramkumar | 8f11b8b | 2012-01-04 17:09:05 -0800 | [diff] [blame] | 5688 | CLK_LOOKUP("cam_clk", cam0_clk.c, "4-0020"), |
Sreesudhan Ramakrish Ramkumar | 3381da7 | 2012-01-27 08:08:32 -0800 | [diff] [blame] | 5689 | CLK_LOOKUP("cam_clk", cam0_clk.c, "4-0034"), |
Kevin Chan | c8b52e8 | 2011-10-25 23:20:21 -0700 | [diff] [blame] | 5690 | CLK_LOOKUP("csi_src_clk", csi0_src_clk.c, "msm_csid.0"), |
| 5691 | 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] | 5692 | CLK_LOOKUP("csi_src_clk", csi2_src_clk.c, "msm_csid.2"), |
Kevin Chan | c8b52e8 | 2011-10-25 23:20:21 -0700 | [diff] [blame] | 5693 | CLK_LOOKUP("csi_clk", csi0_clk.c, "msm_csid.0"), |
| 5694 | CLK_LOOKUP("csi_clk", csi1_clk.c, "msm_csid.1"), |
Sreesudhan Ramakrish Ramkumar | b1edcd0 | 2012-01-17 11:33:05 -0800 | [diff] [blame] | 5695 | CLK_LOOKUP("csi_clk", csi2_clk.c, "msm_csid.2"), |
Kevin Chan | c8b52e8 | 2011-10-25 23:20:21 -0700 | [diff] [blame] | 5696 | CLK_LOOKUP("csi_phy_clk", csi0_phy_clk.c, "msm_csid.0"), |
| 5697 | 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] | 5698 | CLK_LOOKUP("csi_phy_clk", csi2_phy_clk.c, "msm_csid.2"), |
Kevin Chan | e12c667 | 2011-10-26 11:55:26 -0700 | [diff] [blame] | 5699 | CLK_LOOKUP("csi_pix_clk", csi_pix_clk.c, "msm_ispif.0"), |
| 5700 | CLK_LOOKUP("csi_rdi_clk", csi_rdi_clk.c, "msm_ispif.0"), |
Tianyi Gou | 3022dfd | 2012-01-25 15:50:05 -0800 | [diff] [blame] | 5701 | CLK_LOOKUP("csi_src_clk", csi2_src_clk.c, NULL), |
| 5702 | CLK_LOOKUP("csi_clk", csi2_clk.c, NULL), |
| 5703 | CLK_LOOKUP("csi_pix1_clk", csi_pix1_clk.c, "msm_ispif.0"), |
| 5704 | CLK_LOOKUP("csi_rdi1_clk", csi_rdi1_clk.c, "msm_ispif.0"), |
| 5705 | CLK_LOOKUP("csi_rdi2_clk", csi_rdi2_clk.c, "msm_ispif.0"), |
| 5706 | CLK_LOOKUP("csi_phy_clk", csi2_phy_clk.c, NULL), |
| 5707 | CLK_LOOKUP("csi2phy_timer_clk", csi2phy_timer_clk.c, NULL), |
Kevin Chan | f6216f2 | 2011-10-25 18:40:11 -0700 | [diff] [blame] | 5708 | CLK_LOOKUP("csiphy_timer_src_clk", |
| 5709 | csiphy_timer_src_clk.c, "msm_csiphy.0"), |
| 5710 | CLK_LOOKUP("csiphy_timer_src_clk", |
| 5711 | csiphy_timer_src_clk.c, "msm_csiphy.1"), |
Sreesudhan Ramakrish Ramkumar | b1edcd0 | 2012-01-17 11:33:05 -0800 | [diff] [blame] | 5712 | CLK_LOOKUP("csiphy_timer_src_clk", |
| 5713 | csiphy_timer_src_clk.c, "msm_csiphy.2"), |
Kevin Chan | f6216f2 | 2011-10-25 18:40:11 -0700 | [diff] [blame] | 5714 | CLK_LOOKUP("csiphy_timer_clk", csi0phy_timer_clk.c, "msm_csiphy.0"), |
| 5715 | 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] | 5716 | CLK_LOOKUP("csiphy_timer_clk", csi2phy_timer_clk.c, "msm_csiphy.2"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 5717 | CLK_LOOKUP("byte_clk", dsi1_byte_clk.c, "mipi_dsi.1"), |
| 5718 | CLK_LOOKUP("byte_clk", dsi2_byte_clk.c, "mipi_dsi.2"), |
| 5719 | CLK_LOOKUP("esc_clk", dsi1_esc_clk.c, "mipi_dsi.1"), |
| 5720 | CLK_LOOKUP("esc_clk", dsi2_esc_clk.c, "mipi_dsi.2"), |
Matt Wagantall | 9dc0163 | 2011-08-17 18:55:04 -0700 | [diff] [blame] | 5721 | CLK_LOOKUP("core_clk", gfx3d_clk.c, "kgsl-3d0.0"), |
Matt Wagantall | 4972271 | 2011-08-17 18:50:53 -0700 | [diff] [blame] | 5722 | CLK_LOOKUP("core_clk", gfx3d_clk.c, "footswitch-8x60.2"), |
| 5723 | CLK_LOOKUP("bus_clk", ijpeg_axi_clk.c, "footswitch-8x60.3"), |
Matt Wagantall | f45cd36 | 2012-05-03 21:09:44 -0700 | [diff] [blame] | 5724 | CLK_LOOKUP("mem_clk", imem_axi_clk.c, "msm_gemini.0"), |
| 5725 | CLK_LOOKUP("core_clk", ijpeg_clk.c, "msm_gemini.0"), |
Matt Wagantall | 4972271 | 2011-08-17 18:50:53 -0700 | [diff] [blame] | 5726 | CLK_LOOKUP("core_clk", ijpeg_clk.c, "footswitch-8x60.3"), |
Kalyani Oruganti | 465d1e1 | 2012-05-15 10:23:05 -0700 | [diff] [blame] | 5727 | CLK_LOOKUP("core_clk", jpegd_clk.c, "msm_mercury.0"), |
| 5728 | CLK_LOOKUP("iface_clk", jpegd_p_clk.c, "msm_mercury.0"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 5729 | CLK_LOOKUP("core_clk", mdp_clk.c, "mdp.0"), |
Matt Wagantall | 4972271 | 2011-08-17 18:50:53 -0700 | [diff] [blame] | 5730 | CLK_LOOKUP("core_clk", mdp_clk.c, "footswitch-8x60.4"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 5731 | CLK_LOOKUP("vsync_clk", mdp_vsync_clk.c, "mdp.0"), |
Matt Wagantall | b82a513 | 2011-12-12 22:26:41 -0800 | [diff] [blame] | 5732 | CLK_LOOKUP("vsync_clk", mdp_vsync_clk.c, "footswitch-8x60.4"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 5733 | CLK_LOOKUP("lut_clk", lut_mdp_clk.c, "mdp.0"), |
Matt Wagantall | b82a513 | 2011-12-12 22:26:41 -0800 | [diff] [blame] | 5734 | CLK_LOOKUP("lut_clk", lut_mdp_clk.c, "footswitch-8x60.4"), |
Matt Wagantall | bb90da9 | 2011-10-25 15:07:52 -0700 | [diff] [blame] | 5735 | CLK_LOOKUP("core_clk", rot_clk.c, "msm_rotator.0"), |
Matt Wagantall | 4972271 | 2011-08-17 18:50:53 -0700 | [diff] [blame] | 5736 | CLK_LOOKUP("core_clk", rot_clk.c, "footswitch-8x60.6"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 5737 | CLK_LOOKUP("src_clk", tv_src_clk.c, "dtv.0"), |
| 5738 | CLK_LOOKUP("src_clk", tv_src_clk.c, "tvenc.0"), |
Matt Wagantall | b82a513 | 2011-12-12 22:26:41 -0800 | [diff] [blame] | 5739 | CLK_LOOKUP("tv_src_clk", tv_src_clk.c, "footswitch-8x60.4"), |
Matt Wagantall | 3f7660b | 2011-08-17 21:25:13 -0700 | [diff] [blame] | 5740 | CLK_LOOKUP("core_clk", vcodec_clk.c, "msm_vidc.0"), |
Matt Wagantall | 4972271 | 2011-08-17 18:50:53 -0700 | [diff] [blame] | 5741 | CLK_LOOKUP("core_clk", vcodec_clk.c, "footswitch-8x60.7"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 5742 | CLK_LOOKUP("mdp_clk", mdp_tv_clk.c, "dtv.0"), |
| 5743 | CLK_LOOKUP("mdp_clk", mdp_tv_clk.c, "tvenc.0"), |
Matt Wagantall | b82a513 | 2011-12-12 22:26:41 -0800 | [diff] [blame] | 5744 | CLK_LOOKUP("tv_clk", mdp_tv_clk.c, "footswitch-8x60.4"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 5745 | CLK_LOOKUP("hdmi_clk", hdmi_tv_clk.c, "dtv.0"), |
Matt Wagantall | 5a4f1ba | 2011-08-18 18:13:03 -0700 | [diff] [blame] | 5746 | CLK_LOOKUP("core_clk", hdmi_app_clk.c, "hdmi_msm.1"), |
Kevin Chan | a085312 | 2011-11-07 19:48:44 -0800 | [diff] [blame] | 5747 | CLK_LOOKUP("vpe_clk", vpe_clk.c, "msm_vpe.0"), |
Matt Wagantall | 4972271 | 2011-08-17 18:50:53 -0700 | [diff] [blame] | 5748 | CLK_LOOKUP("core_clk", vpe_clk.c, "footswitch-8x60.9"), |
Kevin Chan | 5827c55 | 2011-10-28 18:36:32 -0700 | [diff] [blame] | 5749 | CLK_LOOKUP("vfe_clk", vfe_clk.c, "msm_vfe.0"), |
Matt Wagantall | 4972271 | 2011-08-17 18:50:53 -0700 | [diff] [blame] | 5750 | CLK_LOOKUP("core_clk", vfe_clk.c, "footswitch-8x60.8"), |
Kevin Chan | 5827c55 | 2011-10-28 18:36:32 -0700 | [diff] [blame] | 5751 | CLK_LOOKUP("csi_vfe_clk", csi_vfe_clk.c, "msm_vfe.0"), |
Matt Wagantall | 4972271 | 2011-08-17 18:50:53 -0700 | [diff] [blame] | 5752 | CLK_LOOKUP("bus_clk", vfe_axi_clk.c, "footswitch-8x60.8"), |
| 5753 | CLK_LOOKUP("bus_clk", mdp_axi_clk.c, "footswitch-8x60.4"), |
| 5754 | CLK_LOOKUP("bus_clk", rot_axi_clk.c, "footswitch-8x60.6"), |
| 5755 | CLK_LOOKUP("bus_clk", vcodec_axi_clk.c, "footswitch-8x60.7"), |
| 5756 | CLK_LOOKUP("bus_a_clk", vcodec_axi_a_clk.c, "footswitch-8x60.7"), |
| 5757 | CLK_LOOKUP("bus_b_clk", vcodec_axi_b_clk.c, "footswitch-8x60.7"), |
| 5758 | CLK_LOOKUP("bus_clk", vpe_axi_clk.c, "footswitch-8x60.9"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 5759 | CLK_LOOKUP("arb_clk", amp_p_clk.c, "mipi_dsi.1"), |
| 5760 | CLK_LOOKUP("arb_clk", amp_p_clk.c, "mipi_dsi.2"), |
Kevin Chan | c8b52e8 | 2011-10-25 23:20:21 -0700 | [diff] [blame] | 5761 | CLK_LOOKUP("csi_pclk", csi_p_clk.c, "msm_csid.0"), |
| 5762 | CLK_LOOKUP("csi_pclk", csi_p_clk.c, "msm_csid.1"), |
Sreesudhan Ramakrish Ramkumar | b1edcd0 | 2012-01-17 11:33:05 -0800 | [diff] [blame] | 5763 | CLK_LOOKUP("csi_pclk", csi_p_clk.c, "msm_csid.2"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 5764 | CLK_LOOKUP("master_iface_clk", dsi1_m_p_clk.c, "mipi_dsi.1"), |
| 5765 | CLK_LOOKUP("slave_iface_clk", dsi1_s_p_clk.c, "mipi_dsi.1"), |
| 5766 | CLK_LOOKUP("master_iface_clk", dsi2_m_p_clk.c, "mipi_dsi.2"), |
| 5767 | 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] | 5768 | CLK_LOOKUP("iface_clk", gfx3d_p_clk.c, "kgsl-3d0.0"), |
Matt Wagantall | 4972271 | 2011-08-17 18:50:53 -0700 | [diff] [blame] | 5769 | CLK_LOOKUP("iface_clk", gfx3d_p_clk.c, "footswitch-8x60.2"), |
Matt Wagantall | 5a4f1ba | 2011-08-18 18:13:03 -0700 | [diff] [blame] | 5770 | CLK_LOOKUP("master_iface_clk", hdmi_m_p_clk.c, "hdmi_msm.1"), |
| 5771 | 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] | 5772 | CLK_LOOKUP("iface_clk", ijpeg_p_clk.c, "msm_gemini.0"), |
Matt Wagantall | 4972271 | 2011-08-17 18:50:53 -0700 | [diff] [blame] | 5773 | CLK_LOOKUP("iface_clk", ijpeg_p_clk.c, "footswitch-8x60.3"), |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5774 | CLK_LOOKUP("iface_clk", jpegd_p_clk.c, ""), |
Matt Wagantall | 5d44ef2 | 2012-01-23 11:01:05 -0800 | [diff] [blame] | 5775 | CLK_LOOKUP("mem_iface_clk", imem_p_clk.c, "kgsl-3d0.0"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 5776 | CLK_LOOKUP("iface_clk", mdp_p_clk.c, "mdp.0"), |
Matt Wagantall | 4972271 | 2011-08-17 18:50:53 -0700 | [diff] [blame] | 5777 | CLK_LOOKUP("iface_clk", mdp_p_clk.c, "footswitch-8x60.4"), |
Matt Wagantall | e604d71 | 2011-10-21 15:38:18 -0700 | [diff] [blame] | 5778 | CLK_LOOKUP("iface_clk", smmu_p_clk.c, "msm_iommu"), |
Matt Wagantall | bb90da9 | 2011-10-25 15:07:52 -0700 | [diff] [blame] | 5779 | CLK_LOOKUP("iface_clk", rot_p_clk.c, "msm_rotator.0"), |
Matt Wagantall | 4972271 | 2011-08-17 18:50:53 -0700 | [diff] [blame] | 5780 | CLK_LOOKUP("iface_clk", rot_p_clk.c, "footswitch-8x60.6"), |
Matt Wagantall | 3f7660b | 2011-08-17 21:25:13 -0700 | [diff] [blame] | 5781 | CLK_LOOKUP("iface_clk", vcodec_p_clk.c, "msm_vidc.0"), |
Matt Wagantall | 4972271 | 2011-08-17 18:50:53 -0700 | [diff] [blame] | 5782 | CLK_LOOKUP("iface_clk", vcodec_p_clk.c, "footswitch-8x60.7"), |
Kevin Chan | 5827c55 | 2011-10-28 18:36:32 -0700 | [diff] [blame] | 5783 | CLK_LOOKUP("vfe_pclk", vfe_p_clk.c, "msm_vfe.0"), |
Matt Wagantall | 4972271 | 2011-08-17 18:50:53 -0700 | [diff] [blame] | 5784 | CLK_LOOKUP("iface_clk", vfe_p_clk.c, "footswitch-8x60.8"), |
Kevin Chan | a085312 | 2011-11-07 19:48:44 -0800 | [diff] [blame] | 5785 | CLK_LOOKUP("vpe_pclk", vpe_p_clk.c, "msm_vpe.0"), |
Matt Wagantall | 4972271 | 2011-08-17 18:50:53 -0700 | [diff] [blame] | 5786 | CLK_LOOKUP("iface_clk", vpe_p_clk.c, "footswitch-8x60.9"), |
Patrick Lai | 04baee94 | 2012-05-01 14:38:47 -0700 | [diff] [blame] | 5787 | CLK_LOOKUP("bit_clk", mi2s_bit_clk.c, |
| 5788 | "msm-dai-q6-mi2s"), |
| 5789 | CLK_LOOKUP("osr_clk", mi2s_osr_clk.c, |
| 5790 | "msm-dai-q6-mi2s"), |
Kuirong Wang | a9c3acc | 2012-02-09 17:00:45 -0800 | [diff] [blame] | 5791 | CLK_LOOKUP("bit_clk", codec_i2s_mic_bit_clk.c, |
| 5792 | "msm-dai-q6.1"), |
| 5793 | CLK_LOOKUP("osr_clk", codec_i2s_mic_osr_clk.c, |
| 5794 | "msm-dai-q6.1"), |
| 5795 | CLK_LOOKUP("bit_clk", spare_i2s_mic_bit_clk.c, |
| 5796 | "msm-dai-q6.5"), |
| 5797 | CLK_LOOKUP("osr_clk", spare_i2s_mic_osr_clk.c, |
| 5798 | "msm-dai-q6.5"), |
| 5799 | CLK_LOOKUP("bit_clk", codec_i2s_spkr_bit_clk.c, |
Kuirong Wang | dea7c82 | 2012-08-20 20:52:42 -0700 | [diff] [blame^] | 5800 | "msm-dai-q6.0"), |
| 5801 | CLK_LOOKUP("osr_clk", codec_i2s_spkr_osr_clk.c, |
| 5802 | "msm-dai-q6.0"), |
| 5803 | CLK_LOOKUP("bit_clk", codec_i2s_spkr_bit_clk.c, |
Kuirong Wang | a9c3acc | 2012-02-09 17:00:45 -0800 | [diff] [blame] | 5804 | "msm-dai-q6.16384"), |
| 5805 | CLK_LOOKUP("osr_clk", codec_i2s_spkr_osr_clk.c, |
| 5806 | "msm-dai-q6.16384"), |
| 5807 | CLK_LOOKUP("bit_clk", spare_i2s_spkr_bit_clk.c, |
| 5808 | "msm-dai-q6.4"), |
| 5809 | CLK_LOOKUP("osr_clk", spare_i2s_spkr_osr_clk.c, |
| 5810 | "msm-dai-q6.4"), |
| 5811 | CLK_LOOKUP("pcm_clk", pcm_clk.c, "msm-dai-q6.2"), |
Kiran Kandi | 5f4ab69 | 2012-02-23 11:23:56 -0800 | [diff] [blame] | 5812 | CLK_LOOKUP("pcm_clk", pcm_clk.c, "msm-dai-q6.3"), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5813 | CLK_LOOKUP("sps_slimbus_clk", sps_slimbus_clk.c, NULL), |
Tianyi Gou | 44a81b0 | 2012-02-06 17:49:07 -0800 | [diff] [blame] | 5814 | CLK_LOOKUP("core_clk", audio_slimbus_clk.c, "msm_slim_ctrl.1"), |
Matt Wagantall | e604d71 | 2011-10-21 15:38:18 -0700 | [diff] [blame] | 5815 | CLK_LOOKUP("core_clk", jpegd_axi_clk.c, "msm_iommu.0"), |
| 5816 | CLK_LOOKUP("core_clk", vpe_axi_clk.c, "msm_iommu.1"), |
| 5817 | CLK_LOOKUP("core_clk", mdp_axi_clk.c, "msm_iommu.2"), |
| 5818 | CLK_LOOKUP("core_clk", mdp_axi_clk.c, "msm_iommu.3"), |
| 5819 | CLK_LOOKUP("core_clk", rot_axi_clk.c, "msm_iommu.4"), |
| 5820 | CLK_LOOKUP("core_clk", ijpeg_axi_clk.c, "msm_iommu.5"), |
| 5821 | CLK_LOOKUP("core_clk", vfe_axi_clk.c, "msm_iommu.6"), |
| 5822 | CLK_LOOKUP("core_clk", vcodec_axi_a_clk.c, "msm_iommu.7"), |
| 5823 | CLK_LOOKUP("core_clk", vcodec_axi_b_clk.c, "msm_iommu.8"), |
| 5824 | CLK_LOOKUP("core_clk", gfx3d_clk.c, "msm_iommu.9"), |
Gopikrishnaiah Anandan | 4d05ed3 | 2012-01-13 11:08:44 -0800 | [diff] [blame] | 5825 | |
| 5826 | CLK_LOOKUP("mdp_iommu_clk", mdp_axi_clk.c, "msm_vidc.0"), |
| 5827 | CLK_LOOKUP("rot_iommu_clk", rot_axi_clk.c, "msm_vidc.0"), |
| 5828 | CLK_LOOKUP("vcodec_iommu0_clk", vcodec_axi_a_clk.c, "msm_vidc.0"), |
| 5829 | CLK_LOOKUP("vcodec_iommu1_clk", vcodec_axi_b_clk.c, "msm_vidc.0"), |
| 5830 | CLK_LOOKUP("smmu_iface_clk", smmu_p_clk.c, "msm_vidc.0"), |
Stephen Boyd | 7b973de | 2012-03-09 12:26:16 -0800 | [diff] [blame] | 5831 | CLK_LOOKUP("core_clk", vcodec_axi_clk.c, "pil_vidc"), |
| 5832 | CLK_LOOKUP("smmu_iface_clk", smmu_p_clk.c, "pil_vidc"), |
Gopikrishnaiah Anandan | 4d05ed3 | 2012-01-13 11:08:44 -0800 | [diff] [blame] | 5833 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5834 | CLK_LOOKUP("dfab_dsps_clk", dfab_dsps_clk.c, NULL), |
Manu Gautam | 5143b25 | 2012-01-05 19:25:23 -0800 | [diff] [blame] | 5835 | CLK_LOOKUP("core_clk", dfab_usb_hs_clk.c, "msm_otg"), |
Matt Wagantall | 37ce384 | 2011-08-17 16:00:36 -0700 | [diff] [blame] | 5836 | CLK_LOOKUP("bus_clk", dfab_sdc1_clk.c, "msm_sdcc.1"), |
| 5837 | CLK_LOOKUP("bus_clk", dfab_sdc2_clk.c, "msm_sdcc.2"), |
| 5838 | CLK_LOOKUP("bus_clk", dfab_sdc3_clk.c, "msm_sdcc.3"), |
| 5839 | CLK_LOOKUP("bus_clk", dfab_sdc4_clk.c, "msm_sdcc.4"), |
| 5840 | CLK_LOOKUP("bus_clk", dfab_sdc5_clk.c, "msm_sdcc.5"), |
Yan He | 160633e | 2011-06-30 12:18:56 -0700 | [diff] [blame] | 5841 | CLK_LOOKUP("dfab_clk", dfab_sps_clk.c, "msm_sps"), |
Stephen Boyd | 1c51a49 | 2011-10-26 12:11:47 -0700 | [diff] [blame] | 5842 | CLK_LOOKUP("bus_clk", dfab_bam_dmux_clk.c, "BAM_RMNT"), |
Stephen Boyd | ef5d1c4 | 2011-12-15 20:47:14 -0800 | [diff] [blame] | 5843 | CLK_LOOKUP("bus_clk", dfab_scm_clk.c, "scm"), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5844 | |
Matt Wagantall | e1a8606 | 2011-08-18 17:46:10 -0700 | [diff] [blame] | 5845 | CLK_LOOKUP("mem_clk", ebi1_adm_clk.c, "msm_dmov"), |
Matt Wagantall | 33bac7e | 2012-05-22 14:59:05 -0700 | [diff] [blame] | 5846 | CLK_LOOKUP("mem_clk", ebi1_acpu_a_clk.c, ""), |
| 5847 | CLK_LOOKUP("bus_clk", afab_acpu_a_clk.c, ""), |
Matt Wagantall | 8b38f94 | 2011-08-02 18:23:18 -0700 | [diff] [blame] | 5848 | |
Matt Wagantall | c33c1ed | 2012-07-23 17:19:08 -0700 | [diff] [blame] | 5849 | CLK_LOOKUP("reset1_clk", dsi1_reset_clk.c, "footswitch-8x60.4"), |
| 5850 | CLK_LOOKUP("reset2_clk", dsi2_reset_clk.c, "footswitch-8x60.4"), |
Matt Wagantall | 735e41b | 2012-07-23 17:18:58 -0700 | [diff] [blame] | 5851 | |
Matt Wagantall | c00f95d | 2012-01-05 14:22:45 -0800 | [diff] [blame] | 5852 | CLK_LOOKUP("l2_mclk", l2_m_clk, ""), |
| 5853 | CLK_LOOKUP("krait0_mclk", krait0_m_clk, ""), |
| 5854 | CLK_LOOKUP("krait1_mclk", krait1_m_clk, ""), |
| 5855 | CLK_LOOKUP("q6sw_clk", q6sw_clk, ""), |
| 5856 | CLK_LOOKUP("q6fw_clk", q6fw_clk, ""), |
| 5857 | CLK_LOOKUP("q6_func_clk", q6_func_clk, ""), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 5858 | }; |
| 5859 | |
Patrick Daly | e6f48904 | 2012-07-11 15:29:15 -0700 | [diff] [blame] | 5860 | static struct clk_lookup msm_clocks_8960_only[] __initdata = { |
| 5861 | CLK_LOOKUP("enc_clk", tv_enc_clk.c, "tvenc.0"), |
| 5862 | CLK_LOOKUP("dac_clk", tv_dac_clk.c, "tvenc.0"), |
| 5863 | CLK_LOOKUP("iface_clk", tv_enc_p_clk.c, "tvenc.0"), |
| 5864 | |
| 5865 | CLK_LOOKUP("core_clk", gfx2d0_clk.c, "kgsl-2d0.0"), |
| 5866 | CLK_LOOKUP("core_clk", gfx2d0_clk.c, "footswitch-8x60.0"), |
| 5867 | CLK_LOOKUP("core_clk", gfx2d1_clk.c, "kgsl-2d1.1"), |
| 5868 | CLK_LOOKUP("core_clk", gfx2d1_clk.c, "footswitch-8x60.1"), |
| 5869 | CLK_LOOKUP("iface_clk", gfx2d0_p_clk.c, "kgsl-2d0.0"), |
| 5870 | CLK_LOOKUP("iface_clk", gfx2d0_p_clk.c, "footswitch-8x60.0"), |
| 5871 | CLK_LOOKUP("iface_clk", gfx2d1_p_clk.c, "kgsl-2d1.1"), |
| 5872 | CLK_LOOKUP("iface_clk", gfx2d1_p_clk.c, "footswitch-8x60.1"), |
| 5873 | CLK_LOOKUP("core_clk", gfx2d0_clk.c, "msm_iommu.10"), |
| 5874 | CLK_LOOKUP("core_clk", gfx2d1_clk.c, "msm_iommu.11"), |
| 5875 | }; |
| 5876 | |
| 5877 | static struct clk_lookup msm_clocks_8960ab_only[] __initdata = { |
| 5878 | CLK_LOOKUP("bus_clk", gfx3d_axi_clk.c, "footswitch-8x60.2"), |
Joel King | 9af070b | 2012-08-19 22:32:14 -0700 | [diff] [blame] | 5879 | CLK_LOOKUP("core_clk", gfx3d_axi_clk.c, "msm_iommu.10"), |
Patrick Daly | e6f48904 | 2012-07-11 15:29:15 -0700 | [diff] [blame] | 5880 | CLK_LOOKUP("div_clk", tv_src_div_clk.c, ""), |
| 5881 | }; |
| 5882 | |
| 5883 | static struct clk_lookup msm_clocks_8960[ARRAY_SIZE(msm_clocks_8960_common) |
| 5884 | + ARRAY_SIZE(msm_clocks_8960_only) |
| 5885 | + ARRAY_SIZE(msm_clocks_8960ab_only)]; |
| 5886 | |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 5887 | static struct clk_lookup msm_clocks_8930[] = { |
Stephen Boyd | be1a739 | 2012-04-02 20:17:11 -0700 | [diff] [blame] | 5888 | CLK_LOOKUP("xo", cxo_clk.c, "msm_xo"), |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 5889 | CLK_LOOKUP("cxo", cxo_clk.c, "wcnss_wlan.0"), |
| 5890 | CLK_LOOKUP("cxo", cxo_clk.c, "pil_riva"), |
| 5891 | CLK_LOOKUP("xo", pxo_clk.c, "pil_qdsp6v4.0"), |
| 5892 | CLK_LOOKUP("xo", cxo_clk.c, "pil_qdsp6v4.1"), |
| 5893 | CLK_LOOKUP("xo", cxo_clk.c, "pil_qdsp6v4.2"), |
| 5894 | CLK_LOOKUP("xo", cxo_clk.c, "BAM_RMNT"), |
David Collins | a7d2353 | 2012-08-02 10:48:16 -0700 | [diff] [blame] | 5895 | CLK_LOOKUP("vref_buff", cxo_clk.c, "rpm-regulator"), |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 5896 | CLK_LOOKUP("pll2", pll2_clk.c, NULL), |
| 5897 | CLK_LOOKUP("pll8", pll8_clk.c, NULL), |
| 5898 | CLK_LOOKUP("pll4", pll4_clk.c, NULL), |
| 5899 | CLK_LOOKUP("measure", measure_clk.c, "debug"), |
| 5900 | |
Matt Wagantall | d75f131 | 2012-05-23 16:17:35 -0700 | [diff] [blame] | 5901 | CLK_LOOKUP("bus_clk", afab_clk.c, ""), |
| 5902 | CLK_LOOKUP("bus_clk", afab_a_clk.c, ""), |
| 5903 | CLK_LOOKUP("bus_clk", cfpb_clk.c, ""), |
| 5904 | CLK_LOOKUP("bus_clk", cfpb_a_clk.c, ""), |
| 5905 | CLK_LOOKUP("bus_clk", dfab_clk.c, ""), |
| 5906 | CLK_LOOKUP("bus_clk", dfab_a_clk.c, ""), |
| 5907 | CLK_LOOKUP("mem_clk", ebi1_clk.c, ""), |
| 5908 | CLK_LOOKUP("mem_clk", ebi1_a_clk.c, ""), |
| 5909 | CLK_LOOKUP("bus_clk", mmfab_clk.c, ""), |
| 5910 | CLK_LOOKUP("bus_clk", mmfab_a_clk.c, ""), |
| 5911 | CLK_LOOKUP("bus_clk", mmfpb_clk.c, ""), |
| 5912 | CLK_LOOKUP("bus_clk", mmfpb_a_clk.c, ""), |
| 5913 | CLK_LOOKUP("bus_clk", sfab_clk.c, ""), |
| 5914 | CLK_LOOKUP("bus_clk", sfab_a_clk.c, ""), |
| 5915 | CLK_LOOKUP("bus_clk", sfpb_clk.c, ""), |
| 5916 | CLK_LOOKUP("bus_clk", sfpb_a_clk.c, ""), |
| 5917 | |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 5918 | CLK_LOOKUP("bus_clk", afab_clk.c, "msm_apps_fab"), |
Matt Wagantall | 33bac7e | 2012-05-22 14:59:05 -0700 | [diff] [blame] | 5919 | 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] | 5920 | CLK_LOOKUP("bus_clk", cfpb_clk.c, "msm_cpss_fpb"), |
| 5921 | CLK_LOOKUP("bus_a_clk", cfpb_a_clk.c, "msm_cpss_fpb"), |
| 5922 | CLK_LOOKUP("bus_clk", sfab_clk.c, "msm_sys_fab"), |
| 5923 | CLK_LOOKUP("bus_a_clk", sfab_msmbus_a_clk.c, "msm_sys_fab"), |
| 5924 | CLK_LOOKUP("bus_clk", sfpb_clk.c, "msm_sys_fpb"), |
| 5925 | CLK_LOOKUP("bus_a_clk", sfpb_a_clk.c, "msm_sys_fpb"), |
| 5926 | CLK_LOOKUP("bus_clk", mmfab_clk.c, "msm_mm_fab"), |
| 5927 | CLK_LOOKUP("bus_a_clk", mmfab_a_clk.c, "msm_mm_fab"), |
| 5928 | CLK_LOOKUP("mem_clk", ebi1_msmbus_clk.c, "msm_bus"), |
Matt Wagantall | 33bac7e | 2012-05-22 14:59:05 -0700 | [diff] [blame] | 5929 | CLK_LOOKUP("mem_a_clk", ebi1_msmbus_a_clk.c, "msm_bus"), |
Gagan Mac | bc5f81d | 2012-04-04 15:03:12 -0600 | [diff] [blame] | 5930 | CLK_LOOKUP("dfab_clk", dfab_msmbus_clk.c, "msm_bus"), |
| 5931 | CLK_LOOKUP("dfab_a_clk", dfab_msmbus_a_clk.c, "msm_bus"), |
Pratik Patel | f17b147 | 2012-05-25 22:23:52 -0700 | [diff] [blame] | 5932 | CLK_LOOKUP("core_a_clk", qdss_a_clk.c, ""), |
Pratik Patel | 3b0ca88 | 2012-06-01 16:54:14 -0700 | [diff] [blame] | 5933 | CLK_LOOKUP("core_clk", qdss_clk.c, "coresight-tpiu.0"), |
| 5934 | CLK_LOOKUP("core_clk", qdss_clk.c, "coresight-etb.0"), |
| 5935 | CLK_LOOKUP("core_clk", qdss_clk.c, "coresight-funnel.0"), |
| 5936 | CLK_LOOKUP("core_clk", qdss_clk.c, "coresight-etm.0"), |
| 5937 | CLK_LOOKUP("core_clk", qdss_clk.c, "coresight-etm.1"), |
| 5938 | CLK_LOOKUP("core_clk", qdss_clk.c, "coresight-etm.2"), |
| 5939 | CLK_LOOKUP("core_clk", qdss_clk.c, "coresight-etm.3"), |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 5940 | |
| 5941 | CLK_LOOKUP("ebi1_clk", ebi1_clk.c, NULL), |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 5942 | CLK_LOOKUP("mmfpb_clk", mmfpb_clk.c, NULL), |
| 5943 | CLK_LOOKUP("mmfpb_a_clk", mmfpb_a_clk.c, "clock-8960"), |
| 5944 | CLK_LOOKUP("cfpb_a_clk", cfpb_a_clk.c, "clock-8960"), |
| 5945 | |
| 5946 | CLK_LOOKUP("core_clk", gp0_clk.c, ""), |
| 5947 | CLK_LOOKUP("core_clk", gp1_clk.c, ""), |
| 5948 | CLK_LOOKUP("core_clk", gp2_clk.c, ""), |
| 5949 | CLK_LOOKUP("core_clk", gsbi1_uart_clk.c, ""), |
| 5950 | CLK_LOOKUP("core_clk", gsbi2_uart_clk.c, ""), |
| 5951 | CLK_LOOKUP("core_clk", gsbi3_uart_clk.c, ""), |
| 5952 | CLK_LOOKUP("core_clk", gsbi4_uart_clk.c, ""), |
| 5953 | CLK_LOOKUP("core_clk", gsbi5_uart_clk.c, "msm_serial_hsl.0"), |
| 5954 | CLK_LOOKUP("core_clk", gsbi6_uart_clk.c, "msm_serial_hs.0"), |
| 5955 | CLK_LOOKUP("core_clk", gsbi7_uart_clk.c, ""), |
| 5956 | CLK_LOOKUP("core_clk", gsbi8_uart_clk.c, ""), |
| 5957 | CLK_LOOKUP("core_clk", gsbi9_uart_clk.c, ""), |
| 5958 | CLK_LOOKUP("core_clk", gsbi10_uart_clk.c, ""), |
| 5959 | CLK_LOOKUP("core_clk", gsbi11_uart_clk.c, ""), |
| 5960 | CLK_LOOKUP("core_clk", gsbi12_uart_clk.c, ""), |
| 5961 | CLK_LOOKUP("core_clk", gsbi1_qup_clk.c, "spi_qsd.0"), |
| 5962 | CLK_LOOKUP("core_clk", gsbi2_qup_clk.c, ""), |
| 5963 | CLK_LOOKUP("core_clk", gsbi3_qup_clk.c, "qup_i2c.3"), |
| 5964 | CLK_LOOKUP("core_clk", gsbi4_qup_clk.c, "qup_i2c.4"), |
| 5965 | CLK_LOOKUP("core_clk", gsbi5_qup_clk.c, ""), |
| 5966 | CLK_LOOKUP("core_clk", gsbi6_qup_clk.c, ""), |
| 5967 | CLK_LOOKUP("core_clk", gsbi7_qup_clk.c, ""), |
| 5968 | CLK_LOOKUP("core_clk", gsbi8_qup_clk.c, ""), |
| 5969 | CLK_LOOKUP("core_clk", gsbi9_qup_clk.c, "qup_i2c.0"), |
| 5970 | CLK_LOOKUP("core_clk", gsbi10_qup_clk.c, "qup_i2c.10"), |
| 5971 | CLK_LOOKUP("core_clk", gsbi11_qup_clk.c, ""), |
| 5972 | CLK_LOOKUP("core_clk", gsbi12_qup_clk.c, "qup_i2c.12"), |
| 5973 | CLK_LOOKUP("core_clk", pdm_clk.c, ""), |
| 5974 | CLK_LOOKUP("mem_clk", pmem_clk.c, "msm_sps"), |
| 5975 | CLK_LOOKUP("core_clk", prng_clk.c, "msm_rng.0"), |
| 5976 | CLK_LOOKUP("core_clk", sdc1_clk.c, "msm_sdcc.1"), |
| 5977 | CLK_LOOKUP("core_clk", sdc2_clk.c, "msm_sdcc.2"), |
| 5978 | CLK_LOOKUP("core_clk", sdc3_clk.c, "msm_sdcc.3"), |
| 5979 | CLK_LOOKUP("core_clk", sdc4_clk.c, "msm_sdcc.4"), |
| 5980 | CLK_LOOKUP("core_clk", sdc5_clk.c, "msm_sdcc.5"), |
| 5981 | CLK_LOOKUP("ref_clk", tsif_ref_clk.c, ""), |
| 5982 | CLK_LOOKUP("core_clk", tssc_clk.c, ""), |
| 5983 | CLK_LOOKUP("alt_core_clk", usb_hs1_xcvr_clk.c, "msm_otg"), |
| 5984 | CLK_LOOKUP("phy_clk", usb_phy0_clk.c, "msm_otg"), |
| 5985 | CLK_LOOKUP("alt_core_clk", usb_fs1_xcvr_clk.c, ""), |
| 5986 | CLK_LOOKUP("sys_clk", usb_fs1_sys_clk.c, ""), |
| 5987 | CLK_LOOKUP("src_clk", usb_fs1_src_clk.c, ""), |
| 5988 | CLK_LOOKUP("alt_core_clk", usb_fs2_xcvr_clk.c, ""), |
| 5989 | CLK_LOOKUP("sys_clk", usb_fs2_sys_clk.c, ""), |
| 5990 | CLK_LOOKUP("src_clk", usb_fs2_src_clk.c, ""), |
| 5991 | CLK_LOOKUP("alt_core_clk", usb_hsic_xcvr_fs_clk.c, "msm_hsic_host"), |
| 5992 | CLK_LOOKUP("phy_clk", usb_hsic_hsic_clk.c, "msm_hsic_host"), |
| 5993 | CLK_LOOKUP("cal_clk", usb_hsic_hsio_cal_clk.c, "msm_hsic_host"), |
| 5994 | CLK_LOOKUP("core_clk", usb_hsic_system_clk.c, "msm_hsic_host"), |
| 5995 | CLK_LOOKUP("iface_clk", usb_hsic_p_clk.c, "msm_hsic_host"), |
| 5996 | CLK_LOOKUP("iface_clk", ce1_p_clk.c, "qce.0"), |
| 5997 | CLK_LOOKUP("iface_clk", ce1_p_clk.c, "qcrypto.0"), |
| 5998 | CLK_LOOKUP("core_clk", ce1_core_clk.c, "qce.0"), |
| 5999 | CLK_LOOKUP("core_clk", ce1_core_clk.c, "qcrypto.0"), |
| 6000 | CLK_LOOKUP("dma_bam_pclk", dma_bam_p_clk.c, NULL), |
| 6001 | CLK_LOOKUP("iface_clk", gsbi1_p_clk.c, "spi_qsd.0"), |
| 6002 | CLK_LOOKUP("iface_clk", gsbi2_p_clk.c, ""), |
| 6003 | CLK_LOOKUP("iface_clk", gsbi3_p_clk.c, "qup_i2c.3"), |
| 6004 | CLK_LOOKUP("iface_clk", gsbi4_p_clk.c, "qup_i2c.4"), |
| 6005 | CLK_LOOKUP("iface_clk", gsbi5_p_clk.c, "msm_serial_hsl.0"), |
| 6006 | CLK_LOOKUP("iface_clk", gsbi6_p_clk.c, "msm_serial_hs.0"), |
| 6007 | CLK_LOOKUP("iface_clk", gsbi7_p_clk.c, ""), |
| 6008 | CLK_LOOKUP("iface_clk", gsbi8_p_clk.c, ""), |
| 6009 | CLK_LOOKUP("iface_clk", gsbi9_p_clk.c, "qup_i2c.0"), |
| 6010 | CLK_LOOKUP("iface_clk", gsbi10_p_clk.c, "qup_i2c.10"), |
| 6011 | CLK_LOOKUP("iface_clk", gsbi11_p_clk.c, ""), |
| 6012 | CLK_LOOKUP("iface_clk", gsbi12_p_clk.c, "qup_i2c.12"), |
| 6013 | CLK_LOOKUP("iface_clk", tsif_p_clk.c, ""), |
| 6014 | CLK_LOOKUP("iface_clk", usb_fs1_p_clk.c, ""), |
| 6015 | CLK_LOOKUP("iface_clk", usb_fs2_p_clk.c, ""), |
| 6016 | CLK_LOOKUP("iface_clk", usb_hs1_p_clk.c, "msm_otg"), |
| 6017 | CLK_LOOKUP("iface_clk", sdc1_p_clk.c, "msm_sdcc.1"), |
| 6018 | CLK_LOOKUP("iface_clk", sdc2_p_clk.c, "msm_sdcc.2"), |
| 6019 | CLK_LOOKUP("iface_clk", sdc3_p_clk.c, "msm_sdcc.3"), |
| 6020 | CLK_LOOKUP("iface_clk", sdc4_p_clk.c, "msm_sdcc.4"), |
| 6021 | CLK_LOOKUP("iface_clk", sdc5_p_clk.c, "msm_sdcc.5"), |
| 6022 | CLK_LOOKUP("core_clk", adm0_clk.c, "msm_dmov"), |
| 6023 | CLK_LOOKUP("iface_clk", adm0_p_clk.c, "msm_dmov"), |
| 6024 | CLK_LOOKUP("iface_clk", pmic_arb0_p_clk.c, ""), |
| 6025 | CLK_LOOKUP("iface_clk", pmic_arb1_p_clk.c, ""), |
| 6026 | CLK_LOOKUP("core_clk", pmic_ssbi2_clk.c, ""), |
| 6027 | CLK_LOOKUP("mem_clk", rpm_msg_ram_p_clk.c, ""), |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 6028 | CLK_LOOKUP("cam_clk", cam0_clk.c, "4-001a"), |
Hody Hung | 994f462 | 2012-04-24 10:27:45 -0700 | [diff] [blame] | 6029 | CLK_LOOKUP("cam_clk", cam1_clk.c, "4-006c"), |
Sreesudhan Ramakrish Ramkumar | 981c82c | 2012-04-30 17:31:37 -0700 | [diff] [blame] | 6030 | CLK_LOOKUP("cam_clk", cam1_clk.c, "4-0048"), |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 6031 | CLK_LOOKUP("cam_clk", cam2_clk.c, NULL), |
| 6032 | CLK_LOOKUP("cam_clk", cam0_clk.c, "4-0020"), |
| 6033 | CLK_LOOKUP("csi_src_clk", csi0_src_clk.c, "msm_csid.0"), |
| 6034 | CLK_LOOKUP("csi_src_clk", csi1_src_clk.c, "msm_csid.1"), |
| 6035 | CLK_LOOKUP("csi_src_clk", csi2_src_clk.c, "msm_csid.2"), |
| 6036 | CLK_LOOKUP("csi_clk", csi0_clk.c, "msm_csid.0"), |
| 6037 | CLK_LOOKUP("csi_clk", csi1_clk.c, "msm_csid.1"), |
| 6038 | CLK_LOOKUP("csi_clk", csi2_clk.c, "msm_csid.2"), |
| 6039 | CLK_LOOKUP("csi_phy_clk", csi0_phy_clk.c, "msm_csid.0"), |
| 6040 | CLK_LOOKUP("csi_phy_clk", csi1_phy_clk.c, "msm_csid.1"), |
| 6041 | CLK_LOOKUP("csi_phy_clk", csi2_phy_clk.c, "msm_csid.2"), |
| 6042 | CLK_LOOKUP("csi_pix_clk", csi_pix_clk.c, "msm_ispif.0"), |
| 6043 | CLK_LOOKUP("csi_rdi_clk", csi_rdi_clk.c, "msm_ispif.0"), |
| 6044 | CLK_LOOKUP("csi_src_clk", csi2_src_clk.c, NULL), |
| 6045 | CLK_LOOKUP("csi_clk", csi2_clk.c, NULL), |
| 6046 | CLK_LOOKUP("csi_pix1_clk", csi_pix1_clk.c, "msm_ispif.0"), |
| 6047 | CLK_LOOKUP("csi_rdi1_clk", csi_rdi1_clk.c, "msm_ispif.0"), |
| 6048 | CLK_LOOKUP("csi_rdi2_clk", csi_rdi2_clk.c, "msm_ispif.0"), |
| 6049 | CLK_LOOKUP("csi_phy_clk", csi2_phy_clk.c, NULL), |
| 6050 | CLK_LOOKUP("csi2phy_timer_clk", csi2phy_timer_clk.c, NULL), |
| 6051 | CLK_LOOKUP("csiphy_timer_src_clk", |
| 6052 | csiphy_timer_src_clk.c, "msm_csiphy.0"), |
| 6053 | CLK_LOOKUP("csiphy_timer_src_clk", |
| 6054 | csiphy_timer_src_clk.c, "msm_csiphy.1"), |
| 6055 | CLK_LOOKUP("csiphy_timer_src_clk", |
| 6056 | csiphy_timer_src_clk.c, "msm_csiphy.2"), |
| 6057 | CLK_LOOKUP("csiphy_timer_clk", csi0phy_timer_clk.c, "msm_csiphy.0"), |
| 6058 | CLK_LOOKUP("csiphy_timer_clk", csi1phy_timer_clk.c, "msm_csiphy.1"), |
| 6059 | CLK_LOOKUP("csiphy_timer_clk", csi2phy_timer_clk.c, "msm_csiphy.2"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 6060 | CLK_LOOKUP("byte_clk", dsi1_byte_clk.c, "mipi_dsi.1"), |
| 6061 | CLK_LOOKUP("esc_clk", dsi1_esc_clk.c, "mipi_dsi.1"), |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 6062 | CLK_LOOKUP("core_clk", gfx3d_clk.c, "kgsl-3d0.0"), |
| 6063 | CLK_LOOKUP("core_clk", gfx3d_clk.c, "footswitch-8x60.2"), |
| 6064 | CLK_LOOKUP("bus_clk", |
| 6065 | gfx3d_axi_clk_8930.c, "footswitch-8x60.2"), |
| 6066 | CLK_LOOKUP("bus_clk", ijpeg_axi_clk.c, "footswitch-8x60.3"), |
Matt Wagantall | f45cd36 | 2012-05-03 21:09:44 -0700 | [diff] [blame] | 6067 | CLK_LOOKUP("mem_clk", imem_axi_clk.c, "msm_gemini.0"), |
| 6068 | CLK_LOOKUP("core_clk", ijpeg_clk.c, "msm_gemini.0"), |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 6069 | CLK_LOOKUP("core_clk", ijpeg_clk.c, "footswitch-8x60.3"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 6070 | CLK_LOOKUP("core_clk", mdp_clk.c, "mdp.0"), |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 6071 | CLK_LOOKUP("core_clk", mdp_clk.c, "footswitch-8x60.4"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 6072 | CLK_LOOKUP("vsync_clk", mdp_vsync_clk.c, "mdp.0"), |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 6073 | CLK_LOOKUP("vsync_clk", mdp_vsync_clk.c, "footswitch-8x60.4"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 6074 | CLK_LOOKUP("lut_clk", lut_mdp_clk.c, "mdp.0"), |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 6075 | CLK_LOOKUP("lut_clk", lut_mdp_clk.c, "footswitch-8x60.4"), |
| 6076 | CLK_LOOKUP("core_clk", rot_clk.c, "msm_rotator.0"), |
| 6077 | CLK_LOOKUP("core_clk", rot_clk.c, "footswitch-8x60.6"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 6078 | CLK_LOOKUP("src_clk", tv_src_clk.c, "dtv.0"), |
| 6079 | CLK_LOOKUP("src_clk", tv_src_clk.c, "tvenc.0"), |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 6080 | CLK_LOOKUP("tv_src_clk", tv_src_clk.c, "footswitch-8x60.4"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 6081 | CLK_LOOKUP("dac_clk", tv_dac_clk.c, "tvenc.0"), |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 6082 | CLK_LOOKUP("core_clk", vcodec_clk.c, "msm_vidc.0"), |
| 6083 | CLK_LOOKUP("core_clk", vcodec_clk.c, "footswitch-8x60.7"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 6084 | CLK_LOOKUP("mdp_clk", mdp_tv_clk.c, "dtv.0"), |
| 6085 | CLK_LOOKUP("mdp_clk", mdp_tv_clk.c, "tvenc.0"), |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 6086 | CLK_LOOKUP("tv_clk", mdp_tv_clk.c, "footswitch-8x60.4"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 6087 | CLK_LOOKUP("hdmi_clk", hdmi_tv_clk.c, "dtv.0"), |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 6088 | CLK_LOOKUP("core_clk", hdmi_app_clk.c, "hdmi_msm.1"), |
| 6089 | CLK_LOOKUP("vpe_clk", vpe_clk.c, "msm_vpe.0"), |
| 6090 | CLK_LOOKUP("core_clk", vpe_clk.c, "footswitch-8x60.9"), |
| 6091 | CLK_LOOKUP("vfe_clk", vfe_clk.c, "msm_vfe.0"), |
| 6092 | CLK_LOOKUP("core_clk", vfe_clk.c, "footswitch-8x60.8"), |
| 6093 | CLK_LOOKUP("csi_vfe_clk", csi_vfe_clk.c, "msm_vfe.0"), |
| 6094 | CLK_LOOKUP("bus_clk", vfe_axi_clk.c, "footswitch-8x60.8"), |
| 6095 | CLK_LOOKUP("bus_clk", mdp_axi_clk.c, "footswitch-8x60.4"), |
| 6096 | CLK_LOOKUP("bus_clk", rot_axi_clk.c, "footswitch-8x60.6"), |
| 6097 | CLK_LOOKUP("bus_clk", vcodec_axi_clk.c, "footswitch-8x60.7"), |
| 6098 | CLK_LOOKUP("bus_a_clk", vcodec_axi_a_clk.c, "footswitch-8x60.7"), |
| 6099 | CLK_LOOKUP("bus_b_clk", vcodec_axi_b_clk.c, "footswitch-8x60.7"), |
| 6100 | CLK_LOOKUP("bus_clk", vpe_axi_clk.c, "footswitch-8x60.9"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 6101 | CLK_LOOKUP("arb_clk", amp_p_clk.c, "mipi_dsi.1"), |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 6102 | CLK_LOOKUP("csi_pclk", csi_p_clk.c, "msm_csid.0"), |
| 6103 | CLK_LOOKUP("csi_pclk", csi_p_clk.c, "msm_csid.1"), |
| 6104 | CLK_LOOKUP("csi_pclk", csi_p_clk.c, "msm_csid.2"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 6105 | CLK_LOOKUP("master_iface_clk", dsi1_m_p_clk.c, "mipi_dsi.1"), |
| 6106 | 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] | 6107 | CLK_LOOKUP("iface_clk", gfx3d_p_clk.c, "kgsl-3d0.0"), |
| 6108 | CLK_LOOKUP("iface_clk", gfx3d_p_clk.c, "footswitch-8x60.2"), |
| 6109 | CLK_LOOKUP("master_iface_clk", hdmi_m_p_clk.c, "hdmi_msm.1"), |
| 6110 | 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] | 6111 | CLK_LOOKUP("iface_clk", ijpeg_p_clk.c, "msm_gemini.0"), |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 6112 | CLK_LOOKUP("iface_clk", ijpeg_p_clk.c, "footswitch-8x60.3"), |
| 6113 | CLK_LOOKUP("mem_iface_clk", imem_p_clk.c, "kgsl-3d0.0"), |
Ravishangar Kalyanam | 1b064f5 | 2012-03-15 18:17:54 -0700 | [diff] [blame] | 6114 | CLK_LOOKUP("iface_clk", mdp_p_clk.c, "mdp.0"), |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 6115 | CLK_LOOKUP("iface_clk", mdp_p_clk.c, "footswitch-8x60.4"), |
| 6116 | CLK_LOOKUP("iface_clk", smmu_p_clk.c, "msm_iommu"), |
| 6117 | CLK_LOOKUP("iface_clk", rot_p_clk.c, "msm_rotator.0"), |
| 6118 | CLK_LOOKUP("iface_clk", rot_p_clk.c, "footswitch-8x60.6"), |
| 6119 | CLK_LOOKUP("iface_clk", vcodec_p_clk.c, "msm_vidc.0"), |
| 6120 | CLK_LOOKUP("iface_clk", vcodec_p_clk.c, "footswitch-8x60.7"), |
| 6121 | CLK_LOOKUP("vfe_pclk", vfe_p_clk.c, "msm_vfe.0"), |
| 6122 | CLK_LOOKUP("iface_clk", vfe_p_clk.c, "footswitch-8x60.8"), |
| 6123 | CLK_LOOKUP("vpe_pclk", vpe_p_clk.c, "msm_vpe.0"), |
| 6124 | CLK_LOOKUP("iface_clk", vpe_p_clk.c, "footswitch-8x60.9"), |
| 6125 | CLK_LOOKUP("bit_clk", mi2s_bit_clk.c, "msm-dai-q6.6"), |
| 6126 | CLK_LOOKUP("osr_clk", mi2s_osr_clk.c, "msm-dai-q6.6"), |
| 6127 | CLK_LOOKUP("bit_clk", codec_i2s_mic_bit_clk.c, |
| 6128 | "msm-dai-q6.1"), |
| 6129 | CLK_LOOKUP("osr_clk", codec_i2s_mic_osr_clk.c, |
| 6130 | "msm-dai-q6.1"), |
| 6131 | CLK_LOOKUP("bit_clk", spare_i2s_mic_bit_clk.c, |
| 6132 | "msm-dai-q6.5"), |
| 6133 | CLK_LOOKUP("osr_clk", spare_i2s_mic_osr_clk.c, |
| 6134 | "msm-dai-q6.5"), |
| 6135 | CLK_LOOKUP("bit_clk", codec_i2s_spkr_bit_clk.c, |
Kuirong Wang | dea7c82 | 2012-08-20 20:52:42 -0700 | [diff] [blame^] | 6136 | "msm-dai-q6.0"), |
| 6137 | CLK_LOOKUP("osr_clk", codec_i2s_spkr_osr_clk.c, |
| 6138 | "msm-dai-q6.0"), |
| 6139 | CLK_LOOKUP("bit_clk", codec_i2s_spkr_bit_clk.c, |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 6140 | "msm-dai-q6.16384"), |
| 6141 | CLK_LOOKUP("osr_clk", codec_i2s_spkr_osr_clk.c, |
| 6142 | "msm-dai-q6.16384"), |
| 6143 | CLK_LOOKUP("bit_clk", spare_i2s_spkr_bit_clk.c, |
| 6144 | "msm-dai-q6.4"), |
| 6145 | CLK_LOOKUP("osr_clk", spare_i2s_spkr_osr_clk.c, |
| 6146 | "msm-dai-q6.4"), |
| 6147 | CLK_LOOKUP("pcm_clk", pcm_clk.c, "msm-dai-q6.2"), |
| 6148 | CLK_LOOKUP("sps_slimbus_clk", sps_slimbus_clk.c, NULL), |
| 6149 | CLK_LOOKUP("core_clk", audio_slimbus_clk.c, "msm_slim_ctrl.1"), |
| 6150 | CLK_LOOKUP("core_clk", vpe_axi_clk.c, "msm_iommu.1"), |
| 6151 | CLK_LOOKUP("core_clk", mdp_axi_clk.c, "msm_iommu.2"), |
| 6152 | CLK_LOOKUP("core_clk", mdp_axi_clk.c, "msm_iommu.3"), |
| 6153 | CLK_LOOKUP("core_clk", rot_axi_clk.c, "msm_iommu.4"), |
| 6154 | CLK_LOOKUP("core_clk", ijpeg_axi_clk.c, "msm_iommu.5"), |
| 6155 | CLK_LOOKUP("core_clk", vfe_axi_clk.c, "msm_iommu.6"), |
| 6156 | CLK_LOOKUP("core_clk", vcodec_axi_a_clk.c, "msm_iommu.7"), |
| 6157 | CLK_LOOKUP("core_clk", vcodec_axi_b_clk.c, "msm_iommu.8"), |
| 6158 | CLK_LOOKUP("core_clk", gfx3d_axi_clk_8930.c, "msm_iommu.9"), |
| 6159 | CLK_LOOKUP("core_clk", gfx3d_axi_clk_8930.c, "msm_iommu.10"), |
| 6160 | |
| 6161 | CLK_LOOKUP("mdp_iommu_clk", mdp_axi_clk.c, "msm_vidc.0"), |
| 6162 | CLK_LOOKUP("rot_iommu_clk", rot_axi_clk.c, "msm_vidc.0"), |
| 6163 | CLK_LOOKUP("vcodec_iommu0_clk", vcodec_axi_a_clk.c, "msm_vidc.0"), |
| 6164 | CLK_LOOKUP("vcodec_iommu1_clk", vcodec_axi_b_clk.c, "msm_vidc.0"), |
| 6165 | CLK_LOOKUP("smmu_iface_clk", smmu_p_clk.c, "msm_vidc.0"), |
Stephen Boyd | 7b973de | 2012-03-09 12:26:16 -0800 | [diff] [blame] | 6166 | CLK_LOOKUP("core_clk", vcodec_axi_clk.c, "pil_vidc"), |
| 6167 | CLK_LOOKUP("smmu_iface_clk", smmu_p_clk.c, "pil_vidc"), |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 6168 | |
| 6169 | CLK_LOOKUP("dfab_dsps_clk", dfab_dsps_clk.c, NULL), |
| 6170 | CLK_LOOKUP("core_clk", dfab_usb_hs_clk.c, "msm_otg"), |
| 6171 | CLK_LOOKUP("bus_clk", dfab_sdc1_clk.c, "msm_sdcc.1"), |
| 6172 | CLK_LOOKUP("bus_clk", dfab_sdc2_clk.c, "msm_sdcc.2"), |
| 6173 | CLK_LOOKUP("bus_clk", dfab_sdc3_clk.c, "msm_sdcc.3"), |
| 6174 | CLK_LOOKUP("bus_clk", dfab_sdc4_clk.c, "msm_sdcc.4"), |
| 6175 | CLK_LOOKUP("bus_clk", dfab_sdc5_clk.c, "msm_sdcc.5"), |
| 6176 | CLK_LOOKUP("dfab_clk", dfab_sps_clk.c, "msm_sps"), |
| 6177 | CLK_LOOKUP("bus_clk", dfab_bam_dmux_clk.c, "BAM_RMNT"), |
| 6178 | CLK_LOOKUP("bus_clk", dfab_scm_clk.c, "scm"), |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 6179 | |
| 6180 | CLK_LOOKUP("mem_clk", ebi1_adm_clk.c, "msm_dmov"), |
Matt Wagantall | 33bac7e | 2012-05-22 14:59:05 -0700 | [diff] [blame] | 6181 | CLK_LOOKUP("mem_clk", ebi1_acpu_a_clk.c, ""), |
| 6182 | CLK_LOOKUP("bus_clk", afab_acpu_a_clk.c, ""), |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 6183 | |
Matt Wagantall | c33c1ed | 2012-07-23 17:19:08 -0700 | [diff] [blame] | 6184 | CLK_LOOKUP("reset1_clk", dsi1_reset_clk.c, "footswitch-8x60.4"), |
Matt Wagantall | 735e41b | 2012-07-23 17:18:58 -0700 | [diff] [blame] | 6185 | |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 6186 | CLK_LOOKUP("l2_mclk", l2_m_clk, ""), |
| 6187 | CLK_LOOKUP("krait0_mclk", krait0_m_clk, ""), |
| 6188 | CLK_LOOKUP("krait1_mclk", krait1_m_clk, ""), |
| 6189 | CLK_LOOKUP("q6sw_clk", q6sw_clk, ""), |
| 6190 | CLK_LOOKUP("q6fw_clk", q6fw_clk, ""), |
| 6191 | CLK_LOOKUP("q6_func_clk", q6_func_clk, ""), |
| 6192 | }; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 6193 | /* |
| 6194 | * Miscellaneous clock register initializations |
| 6195 | */ |
| 6196 | |
| 6197 | /* Read, modify, then write-back a register. */ |
| 6198 | static void __init rmwreg(uint32_t val, void *reg, uint32_t mask) |
| 6199 | { |
| 6200 | uint32_t regval = readl_relaxed(reg); |
| 6201 | regval &= ~mask; |
| 6202 | regval |= val; |
| 6203 | writel_relaxed(regval, reg); |
| 6204 | } |
| 6205 | |
Vikram Mulukutla | 5b14672 | 2012-04-23 18:17:50 -0700 | [diff] [blame] | 6206 | static struct pll_config_regs pll4_regs __initdata = { |
| 6207 | .l_reg = LCC_PLL0_L_VAL_REG, |
| 6208 | .m_reg = LCC_PLL0_M_VAL_REG, |
| 6209 | .n_reg = LCC_PLL0_N_VAL_REG, |
| 6210 | .config_reg = LCC_PLL0_CONFIG_REG, |
| 6211 | .mode_reg = LCC_PLL0_MODE_REG, |
| 6212 | }; |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 6213 | |
Matt Wagantall | 86e0382 | 2011-12-12 10:59:24 -0800 | [diff] [blame] | 6214 | static struct pll_config pll4_config_393 __initdata = { |
Vikram Mulukutla | 5b14672 | 2012-04-23 18:17:50 -0700 | [diff] [blame] | 6215 | .l = 0xE, |
| 6216 | .m = 0x27A, |
| 6217 | .n = 0x465, |
| 6218 | .vco_val = 0x0, |
| 6219 | .vco_mask = BM(17, 16), |
| 6220 | .pre_div_val = 0x0, |
| 6221 | .pre_div_mask = BIT(19), |
| 6222 | .post_div_val = 0x0, |
| 6223 | .post_div_mask = BM(21, 20), |
| 6224 | .mn_ena_val = BIT(22), |
| 6225 | .mn_ena_mask = BIT(22), |
| 6226 | .main_output_val = BIT(23), |
| 6227 | .main_output_mask = BIT(23), |
| 6228 | }; |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 6229 | |
Vikram Mulukutla | 5b14672 | 2012-04-23 18:17:50 -0700 | [diff] [blame] | 6230 | static struct pll_config_regs pll15_regs __initdata = { |
| 6231 | .l_reg = MM_PLL3_L_VAL_REG, |
| 6232 | .m_reg = MM_PLL3_M_VAL_REG, |
| 6233 | .n_reg = MM_PLL3_N_VAL_REG, |
| 6234 | .config_reg = MM_PLL3_CONFIG_REG, |
| 6235 | .mode_reg = MM_PLL3_MODE_REG, |
| 6236 | }; |
Tianyi Gou | 358c386 | 2011-10-18 17:03:41 -0700 | [diff] [blame] | 6237 | |
Vikram Mulukutla | 5b14672 | 2012-04-23 18:17:50 -0700 | [diff] [blame] | 6238 | static struct pll_config pll15_config __initdata = { |
| 6239 | .l = (0x24 | BVAL(31, 7, 0x620)), |
| 6240 | .m = 0x1, |
| 6241 | .n = 0x9, |
| 6242 | .vco_val = BVAL(17, 16, 0x2), |
| 6243 | .vco_mask = BM(17, 16), |
| 6244 | .pre_div_val = 0x0, |
| 6245 | .pre_div_mask = BIT(19), |
| 6246 | .post_div_val = 0x0, |
| 6247 | .post_div_mask = BM(21, 20), |
| 6248 | .mn_ena_val = BIT(22), |
| 6249 | .mn_ena_mask = BIT(22), |
| 6250 | .main_output_val = BIT(23), |
| 6251 | .main_output_mask = BIT(23), |
| 6252 | }; |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 6253 | |
Vikram Mulukutla | 5b14672 | 2012-04-23 18:17:50 -0700 | [diff] [blame] | 6254 | static struct pll_config_regs pll14_regs __initdata = { |
| 6255 | .l_reg = BB_PLL14_L_VAL_REG, |
| 6256 | .m_reg = BB_PLL14_M_VAL_REG, |
| 6257 | .n_reg = BB_PLL14_N_VAL_REG, |
| 6258 | .config_reg = BB_PLL14_CONFIG_REG, |
| 6259 | .mode_reg = BB_PLL14_MODE_REG, |
| 6260 | }; |
| 6261 | |
| 6262 | static struct pll_config pll14_config __initdata = { |
| 6263 | .l = (0x11 | BVAL(31, 7, 0x620)), |
| 6264 | .m = 0x7, |
| 6265 | .n = 0x9, |
| 6266 | .vco_val = 0x0, |
| 6267 | .vco_mask = BM(17, 16), |
| 6268 | .pre_div_val = 0x0, |
| 6269 | .pre_div_mask = BIT(19), |
| 6270 | .post_div_val = 0x0, |
| 6271 | .post_div_mask = BM(21, 20), |
| 6272 | .mn_ena_val = BIT(22), |
| 6273 | .mn_ena_mask = BIT(22), |
| 6274 | .main_output_val = BIT(23), |
| 6275 | .main_output_mask = BIT(23), |
| 6276 | }; |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 6277 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 6278 | static void __init reg_init(void) |
| 6279 | { |
Stephen Boyd | d471e7a | 2011-11-19 01:37:39 -0800 | [diff] [blame] | 6280 | void __iomem *imem_reg; |
Vikram Mulukutla | 5b14672 | 2012-04-23 18:17:50 -0700 | [diff] [blame] | 6281 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 6282 | /* Deassert MM SW_RESET_ALL signal. */ |
| 6283 | writel_relaxed(0, SW_RESET_ALL_REG); |
| 6284 | |
Tianyi Gou | 8c1a118 | 2011-10-10 14:47:11 -0700 | [diff] [blame] | 6285 | /* |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 6286 | * Some bits are only used on 8960 or 8064 or 8930 and are marked as |
| 6287 | * reserved bits on the other SoCs. Writing to these reserved bits |
Tianyi Gou | 8c1a118 | 2011-10-10 14:47:11 -0700 | [diff] [blame] | 6288 | * should have no effect. |
| 6289 | */ |
Stephen Boyd | d471e7a | 2011-11-19 01:37:39 -0800 | [diff] [blame] | 6290 | /* |
| 6291 | * Initialize MM AHB registers: Enable the FPB clock and disable HW |
Patrick Daly | e6f48904 | 2012-07-11 15:29:15 -0700 | [diff] [blame] | 6292 | * gating on 8627 and 8960 for all clocks. Also set VFE_AHB's |
Stephen Boyd | d471e7a | 2011-11-19 01:37:39 -0800 | [diff] [blame] | 6293 | * FORCE_CORE_ON bit to prevent its memory from being collapsed when |
| 6294 | * the clock is halted. The sleep and wake-up delays are set to safe |
| 6295 | * values. |
| 6296 | */ |
Patrick Daly | e6f48904 | 2012-07-11 15:29:15 -0700 | [diff] [blame] | 6297 | if (cpu_is_msm8627() || cpu_is_msm8960ab()) { |
Stephen Boyd | d471e7a | 2011-11-19 01:37:39 -0800 | [diff] [blame] | 6298 | rmwreg(0x00000003, AHB_EN_REG, 0x6C000103); |
| 6299 | writel_relaxed(0x000007F9, AHB_EN2_REG); |
Tianyi Gou | 33caa5d | 2012-06-18 12:04:11 -0700 | [diff] [blame] | 6300 | } else { |
David Garibaldi | f69836a | 2012-08-17 16:05:22 -0700 | [diff] [blame] | 6301 | rmwreg(0x40000000, AHB_EN_REG, 0x6C000103); |
Tianyi Gou | 33caa5d | 2012-06-18 12:04:11 -0700 | [diff] [blame] | 6302 | writel_relaxed(0x3C7097F9, AHB_EN2_REG); |
Stephen Boyd | d471e7a | 2011-11-19 01:37:39 -0800 | [diff] [blame] | 6303 | } |
Tianyi Gou | 33caa5d | 2012-06-18 12:04:11 -0700 | [diff] [blame] | 6304 | |
Tianyi Gou | 8c1a118 | 2011-10-10 14:47:11 -0700 | [diff] [blame] | 6305 | if (cpu_is_apq8064()) |
Tianyi Gou | f3095ea | 2012-05-22 14:16:06 -0700 | [diff] [blame] | 6306 | rmwreg(0x00000001, AHB_EN3_REG, 0x00000001); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 6307 | |
| 6308 | /* Deassert all locally-owned MM AHB resets. */ |
| 6309 | rmwreg(0, SW_RESET_AHB_REG, 0xFFF7DFFF); |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 6310 | rmwreg(0, SW_RESET_AHB2_REG, 0x0000000F); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 6311 | |
| 6312 | /* Initialize MM AXI registers: Enable HW gating for all clocks that |
| 6313 | * support it. Also set FORCE_CORE_ON bits, and any sleep and wake-up |
| 6314 | * delays to safe values. */ |
Patrick Daly | e6f48904 | 2012-07-11 15:29:15 -0700 | [diff] [blame] | 6315 | if (cpu_is_msm8960ab() || (cpu_is_msm8960() && |
Tianyi Gou | 33caa5d | 2012-06-18 12:04:11 -0700 | [diff] [blame] | 6316 | SOCINFO_VERSION_MAJOR(socinfo_get_version()) < 3) || |
| 6317 | cpu_is_msm8627()) { |
Stephen Boyd | d471e7a | 2011-11-19 01:37:39 -0800 | [diff] [blame] | 6318 | rmwreg(0x000007F9, MAXI_EN_REG, 0x0803FFFF); |
| 6319 | rmwreg(0x3027FCFF, MAXI_EN2_REG, 0x3A3FFFFF); |
Tianyi Gou | 33caa5d | 2012-06-18 12:04:11 -0700 | [diff] [blame] | 6320 | } else { |
| 6321 | rmwreg(0x0003AFF9, MAXI_EN_REG, 0x0803FFFF); |
| 6322 | rmwreg(0x3A27FCFF, MAXI_EN2_REG, 0x3A3FFFFF); |
Stephen Boyd | d471e7a | 2011-11-19 01:37:39 -0800 | [diff] [blame] | 6323 | } |
Tianyi Gou | 33caa5d | 2012-06-18 12:04:11 -0700 | [diff] [blame] | 6324 | |
Matt Wagantall | 53d968f | 2011-07-19 13:22:53 -0700 | [diff] [blame] | 6325 | rmwreg(0x0027FCFF, MAXI_EN3_REG, 0x003FFFFF); |
Tianyi Gou | 33caa5d | 2012-06-18 12:04:11 -0700 | [diff] [blame] | 6326 | rmwreg(0x0027FCFF, MAXI_EN4_REG, 0x017FFFFF); |
| 6327 | |
Tianyi Gou | 8c1a118 | 2011-10-10 14:47:11 -0700 | [diff] [blame] | 6328 | if (cpu_is_apq8064()) |
Tianyi Gou | f3095ea | 2012-05-22 14:16:06 -0700 | [diff] [blame] | 6329 | rmwreg(0x019FECFF, MAXI_EN5_REG, 0x01FFEFFF); |
Stepan Moskovchenko | 0df9bb2 | 2012-07-06 18:19:15 -0700 | [diff] [blame] | 6330 | if (cpu_is_msm8930() || cpu_is_msm8930aa() || cpu_is_msm8627()) |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 6331 | rmwreg(0x000004FF, MAXI_EN5_REG, 0x00000FFF); |
Patrick Daly | e6f48904 | 2012-07-11 15:29:15 -0700 | [diff] [blame] | 6332 | if (cpu_is_msm8960ab()) |
| 6333 | rmwreg(0x009FE000, MAXI_EN5_REG, 0x01FFE000); |
| 6334 | |
Tianyi Gou | 33caa5d | 2012-06-18 12:04:11 -0700 | [diff] [blame] | 6335 | if (cpu_is_msm8627()) |
Stephen Boyd | d471e7a | 2011-11-19 01:37:39 -0800 | [diff] [blame] | 6336 | rmwreg(0x000003C7, SAXI_EN_REG, 0x00003FFF); |
Patrick Daly | e6f48904 | 2012-07-11 15:29:15 -0700 | [diff] [blame] | 6337 | else if (cpu_is_msm8960ab()) |
| 6338 | rmwreg(0x000001C6, SAXI_EN_REG, 0x00001DF6); |
Tianyi Gou | 33caa5d | 2012-06-18 12:04:11 -0700 | [diff] [blame] | 6339 | else |
| 6340 | rmwreg(0x00003C38, SAXI_EN_REG, 0x00003FFF); |
Stephen Boyd | d471e7a | 2011-11-19 01:37:39 -0800 | [diff] [blame] | 6341 | |
| 6342 | /* Enable IMEM's clk_on signal */ |
| 6343 | imem_reg = ioremap(0x04b00040, 4); |
| 6344 | if (imem_reg) { |
| 6345 | writel_relaxed(0x3, imem_reg); |
| 6346 | iounmap(imem_reg); |
| 6347 | } |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 6348 | |
| 6349 | /* Initialize MM CC registers: Set MM FORCE_CORE_ON bits so that core |
| 6350 | * memories retain state even when not clocked. Also, set sleep and |
| 6351 | * wake-up delays to safe values. */ |
Matt Wagantall | 53d968f | 2011-07-19 13:22:53 -0700 | [diff] [blame] | 6352 | rmwreg(0x00000000, CSI0_CC_REG, 0x00000410); |
| 6353 | rmwreg(0x00000000, CSI1_CC_REG, 0x00000410); |
| 6354 | rmwreg(0x80FF0000, DSI1_BYTE_CC_REG, 0xE0FF0010); |
Matt Wagantall | 53d968f | 2011-07-19 13:22:53 -0700 | [diff] [blame] | 6355 | rmwreg(0x80FF0000, DSI_PIXEL_CC_REG, 0xE0FF0010); |
Tarun Karra | 6fbc00a | 2011-12-13 09:23:47 -0700 | [diff] [blame] | 6356 | rmwreg(0xC0FF0000, GFX3D_CC_REG, 0xE0FF0010); |
Matt Wagantall | 53d968f | 2011-07-19 13:22:53 -0700 | [diff] [blame] | 6357 | rmwreg(0x80FF0000, IJPEG_CC_REG, 0xE0FF0010); |
Matt Wagantall | 53d968f | 2011-07-19 13:22:53 -0700 | [diff] [blame] | 6358 | rmwreg(0x80FF0000, MDP_CC_REG, 0xE1FF0010); |
| 6359 | rmwreg(0x80FF0000, MDP_LUT_CC_REG, 0xE0FF0010); |
| 6360 | rmwreg(0x80FF0000, ROT_CC_REG, 0xE0FF0010); |
Matt Wagantall | 53d968f | 2011-07-19 13:22:53 -0700 | [diff] [blame] | 6361 | rmwreg(0x000004FF, TV_CC2_REG, 0x000007FF); |
| 6362 | rmwreg(0xC0FF0000, VCODEC_CC_REG, 0xE0FF0010); |
| 6363 | rmwreg(0x80FF0000, VFE_CC_REG, 0xE0FF4010); |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 6364 | rmwreg(0x800000FF, VFE_CC2_REG, 0xE00000FF); |
Matt Wagantall | 53d968f | 2011-07-19 13:22:53 -0700 | [diff] [blame] | 6365 | rmwreg(0x80FF0000, VPE_CC_REG, 0xE0FF0010); |
Patrick Daly | e6f48904 | 2012-07-11 15:29:15 -0700 | [diff] [blame] | 6366 | if (cpu_is_msm8960ab() || cpu_is_msm8960() || cpu_is_apq8064()) { |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 6367 | rmwreg(0x80FF0000, DSI2_BYTE_CC_REG, 0xE0FF0010); |
| 6368 | rmwreg(0x80FF0000, DSI2_PIXEL_CC_REG, 0xE0FF0010); |
| 6369 | rmwreg(0x80FF0000, JPEGD_CC_REG, 0xE0FF0010); |
| 6370 | } |
Patrick Daly | e6f48904 | 2012-07-11 15:29:15 -0700 | [diff] [blame] | 6371 | if (cpu_is_msm8960ab()) |
| 6372 | rmwreg(0x00000001, DSI2_PIXEL_CC2_REG, 0x00000001); |
| 6373 | |
Stepan Moskovchenko | 0df9bb2 | 2012-07-06 18:19:15 -0700 | [diff] [blame] | 6374 | if (cpu_is_msm8960() || cpu_is_msm8930() || cpu_is_msm8930aa() || |
| 6375 | cpu_is_msm8627()) |
Patrick Daly | e6f48904 | 2012-07-11 15:29:15 -0700 | [diff] [blame] | 6376 | rmwreg(0x80FF0000, TV_CC_REG, 0xE1FFC010); |
| 6377 | if (cpu_is_msm8960ab()) |
| 6378 | rmwreg(0x00000000, TV_CC_REG, 0x00004010); |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 6379 | |
| 6380 | if (cpu_is_msm8960()) { |
Tianyi Gou | 8c1a118 | 2011-10-10 14:47:11 -0700 | [diff] [blame] | 6381 | rmwreg(0x80FF0000, GFX2D0_CC_REG, 0xE0FF0010); |
| 6382 | rmwreg(0x80FF0000, GFX2D1_CC_REG, 0xE0FF0010); |
Tianyi Gou | 8c1a118 | 2011-10-10 14:47:11 -0700 | [diff] [blame] | 6383 | } |
| 6384 | if (cpu_is_apq8064()) { |
| 6385 | rmwreg(0x00000000, TV_CC_REG, 0x00004010); |
Tianyi Gou | 621f874 | 2011-09-01 21:45:01 -0700 | [diff] [blame] | 6386 | rmwreg(0x80FF0000, VCAP_CC_REG, 0xE0FF1010); |
Tianyi Gou | 8c1a118 | 2011-10-10 14:47:11 -0700 | [diff] [blame] | 6387 | } |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 6388 | |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 6389 | /* |
| 6390 | * Initialize USB_HS_HCLK_FS registers: Set FORCE_C_ON bits so that |
| 6391 | * core remain active during halt state of the clk. Also, set sleep |
| 6392 | * and wake-up value to max. |
| 6393 | */ |
| 6394 | rmwreg(0x0000004F, USB_HS1_HCLK_FS_REG, 0x0000007F); |
Tianyi Gou | 8c1a118 | 2011-10-10 14:47:11 -0700 | [diff] [blame] | 6395 | if (cpu_is_apq8064()) { |
| 6396 | rmwreg(0x0000004F, USB_HS3_HCLK_FS_REG, 0x0000007F); |
| 6397 | rmwreg(0x0000004F, USB_HS4_HCLK_FS_REG, 0x0000007F); |
| 6398 | } |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 6399 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 6400 | /* De-assert MM AXI resets to all hardware blocks. */ |
| 6401 | writel_relaxed(0, SW_RESET_AXI_REG); |
| 6402 | |
| 6403 | /* Deassert all MM core resets. */ |
| 6404 | writel_relaxed(0, SW_RESET_CORE_REG); |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 6405 | writel_relaxed(0, SW_RESET_CORE2_REG); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 6406 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 6407 | /* Enable TSSC and PDM PXO sources. */ |
| 6408 | writel_relaxed(BIT(11), TSSC_CLK_CTL_REG); |
| 6409 | writel_relaxed(BIT(15), PDM_CLK_NS_REG); |
| 6410 | |
| 6411 | /* Source SLIMBus xo src from slimbus reference clock */ |
Patrick Daly | e6f48904 | 2012-07-11 15:29:15 -0700 | [diff] [blame] | 6412 | if (cpu_is_msm8960ab() || cpu_is_msm8960()) |
Tianyi Gou | 8c1a118 | 2011-10-10 14:47:11 -0700 | [diff] [blame] | 6413 | writel_relaxed(0x3, SLIMBUS_XO_SRC_CLK_CTL_REG); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 6414 | |
| 6415 | /* Source the dsi_byte_clks from the DSI PHY PLLs */ |
| 6416 | rmwreg(0x1, DSI1_BYTE_NS_REG, 0x7); |
Patrick Daly | e6f48904 | 2012-07-11 15:29:15 -0700 | [diff] [blame] | 6417 | if (cpu_is_msm8960ab() || cpu_is_msm8960() || cpu_is_apq8064()) |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 6418 | rmwreg(0x2, DSI2_BYTE_NS_REG, 0x7); |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 6419 | |
Siddhartha Agrawal | 482459c | 2012-05-24 15:28:53 -0700 | [diff] [blame] | 6420 | /* Source the dsi1_esc_clk from the DSI1 PHY PLLs */ |
| 6421 | rmwreg(0x1, DSI1_ESC_NS_REG, 0x7); |
| 6422 | |
Tianyi Gou | 352955d | 2012-05-18 19:44:01 -0700 | [diff] [blame] | 6423 | /* |
| 6424 | * Source the sata_phy_ref_clk from PXO and set predivider of |
| 6425 | * sata_pmalive_clk to 1. |
| 6426 | */ |
| 6427 | if (cpu_is_apq8064()) { |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 6428 | rmwreg(0, SATA_PHY_REF_CLK_CTL_REG, 0x1); |
Tianyi Gou | 352955d | 2012-05-18 19:44:01 -0700 | [diff] [blame] | 6429 | rmwreg(0, SATA_PMALIVE_CLK_CTL_REG, 0x3); |
| 6430 | } |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 6431 | |
| 6432 | /* |
Tianyi Gou | 05e0110 | 2012-02-08 22:15:49 -0800 | [diff] [blame] | 6433 | * TODO: Programming below PLLs and prng_clk is temporary and |
| 6434 | * needs to be removed after bootloaders program them. |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 6435 | */ |
| 6436 | if (cpu_is_apq8064()) { |
Tianyi Gou | 317aa86 | 2012-02-06 14:31:07 -0800 | [diff] [blame] | 6437 | u32 is_pll_enabled; |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 6438 | |
| 6439 | /* Program pxo_src_clk to source from PXO */ |
| 6440 | rmwreg(0x1, PXO_SRC_CLK_CTL_REG, 0x7); |
| 6441 | |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 6442 | /* Check if PLL14 is active */ |
| 6443 | is_pll_enabled = readl_relaxed(BB_PLL14_STATUS_REG) & BIT(16); |
Vikram Mulukutla | 5b14672 | 2012-04-23 18:17:50 -0700 | [diff] [blame] | 6444 | if (!is_pll_enabled) |
Tianyi Gou | df71f2e | 2011-10-24 22:25:04 -0700 | [diff] [blame] | 6445 | /* Ref clk = 27MHz and program pll14 to 480MHz */ |
Vikram Mulukutla | 6da35d3 | 2012-07-18 13:55:31 -0700 | [diff] [blame] | 6446 | configure_sr_pll(&pll14_config, &pll14_regs, 1); |
Tianyi Gou | 621f874 | 2011-09-01 21:45:01 -0700 | [diff] [blame] | 6447 | |
Tianyi Gou | 621f874 | 2011-09-01 21:45:01 -0700 | [diff] [blame] | 6448 | /* Program PLL15 to 975MHz with ref clk = 27MHz */ |
Vikram Mulukutla | 6da35d3 | 2012-07-18 13:55:31 -0700 | [diff] [blame] | 6449 | configure_sr_pll(&pll15_config, &pll15_regs, 0); |
Tianyi Gou | c29c324 | 2011-10-12 21:02:15 -0700 | [diff] [blame] | 6450 | |
| 6451 | /* Check if PLL4 is active */ |
| 6452 | is_pll_enabled = readl_relaxed(LCC_PLL0_STATUS_REG) & BIT(16); |
Vikram Mulukutla | 5b14672 | 2012-04-23 18:17:50 -0700 | [diff] [blame] | 6453 | if (!is_pll_enabled) |
Tianyi Gou | df71f2e | 2011-10-24 22:25:04 -0700 | [diff] [blame] | 6454 | /* Ref clk = 27MHz and program pll4 to 393.2160MHz */ |
Vikram Mulukutla | 6da35d3 | 2012-07-18 13:55:31 -0700 | [diff] [blame] | 6455 | configure_sr_pll(&pll4_config_393, &pll4_regs, 1); |
Tianyi Gou | c29c324 | 2011-10-12 21:02:15 -0700 | [diff] [blame] | 6456 | |
| 6457 | /* Enable PLL4 source on the LPASS Primary PLL Mux */ |
| 6458 | writel_relaxed(0x1, LCC_PRI_PLL_CLK_CTL_REG); |
Tianyi Gou | 05e0110 | 2012-02-08 22:15:49 -0800 | [diff] [blame] | 6459 | |
| 6460 | /* Program prng_clk to 64MHz if it isn't configured */ |
| 6461 | if (!readl_relaxed(PRNG_CLK_NS_REG)) |
| 6462 | writel_relaxed(0x2B, PRNG_CLK_NS_REG); |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 6463 | } |
Tianyi Gou | 65c536a | 2012-03-20 23:20:29 -0700 | [diff] [blame] | 6464 | |
| 6465 | /* |
| 6466 | * Program PLL15 to 900MHz with ref clk = 27MHz and |
| 6467 | * only enable PLL main output. |
| 6468 | */ |
Stepan Moskovchenko | 0df9bb2 | 2012-07-06 18:19:15 -0700 | [diff] [blame] | 6469 | if (cpu_is_msm8930() || cpu_is_msm8930aa() || cpu_is_msm8627()) { |
Vikram Mulukutla | 5b14672 | 2012-04-23 18:17:50 -0700 | [diff] [blame] | 6470 | pll15_config.l = 0x21 | BVAL(31, 7, 0x600); |
| 6471 | pll15_config.m = 0x1; |
| 6472 | pll15_config.n = 0x3; |
Vikram Mulukutla | 6da35d3 | 2012-07-18 13:55:31 -0700 | [diff] [blame] | 6473 | configure_sr_pll(&pll15_config, &pll15_regs, 0); |
Vikram Mulukutla | 5b14672 | 2012-04-23 18:17:50 -0700 | [diff] [blame] | 6474 | /* Disable AUX and BIST outputs */ |
| 6475 | writel_relaxed(0, MM_PLL3_TEST_CTL_REG); |
Tianyi Gou | 65c536a | 2012-03-20 23:20:29 -0700 | [diff] [blame] | 6476 | } |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 6477 | } |
| 6478 | |
Patrick Daly | e6f48904 | 2012-07-11 15:29:15 -0700 | [diff] [blame] | 6479 | struct clock_init_data msm8960_clock_init_data __initdata; |
Matt Wagantall | b64888f | 2012-04-02 21:35:07 -0700 | [diff] [blame] | 6480 | static void __init msm8960_clock_pre_init(void) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 6481 | { |
Matt Wagantall | 86e0382 | 2011-12-12 10:59:24 -0800 | [diff] [blame] | 6482 | /* Initialize clock registers. */ |
| 6483 | reg_init(); |
| 6484 | |
Patrick Daly | 1a3859f | 2012-08-27 16:10:26 -0700 | [diff] [blame] | 6485 | if (cpu_is_apq8064()) |
Matt Wagantall | 82feaa1 | 2012-07-09 10:54:49 -0700 | [diff] [blame] | 6486 | vdd_sr2_hdmi_pll.set_vdd = set_vdd_sr2_hdmi_pll_8064; |
Tianyi Gou | bf3d0b1 | 2012-01-23 14:37:28 -0800 | [diff] [blame] | 6487 | |
Matt Wagantall | 86e0382 | 2011-12-12 10:59:24 -0800 | [diff] [blame] | 6488 | /* Detect PLL4 programmed for alternate 491.52MHz clock plan. */ |
| 6489 | if (readl_relaxed(LCC_PLL0_L_VAL_REG) == 0x12) { |
| 6490 | pll4_clk.c.rate = 491520000; |
| 6491 | audio_slimbus_clk.freq_tbl = clk_tbl_aif_osr_492; |
| 6492 | mi2s_osr_clk.freq_tbl = clk_tbl_aif_osr_492; |
| 6493 | codec_i2s_mic_osr_clk.freq_tbl = clk_tbl_aif_osr_492; |
| 6494 | spare_i2s_mic_osr_clk.freq_tbl = clk_tbl_aif_osr_492; |
| 6495 | codec_i2s_spkr_osr_clk.freq_tbl = clk_tbl_aif_osr_492; |
| 6496 | spare_i2s_spkr_osr_clk.freq_tbl = clk_tbl_aif_osr_492; |
| 6497 | pcm_clk.freq_tbl = clk_tbl_pcm_492; |
| 6498 | } |
| 6499 | |
Patrick Daly | e6f48904 | 2012-07-11 15:29:15 -0700 | [diff] [blame] | 6500 | if (cpu_is_msm8960() || cpu_is_msm8960ab()) |
| 6501 | memcpy(msm_clocks_8960, msm_clocks_8960_common, |
| 6502 | sizeof(msm_clocks_8960_common)); |
| 6503 | if (cpu_is_msm8960ab()) { |
| 6504 | pll3_clk.c.rate = 650000000; |
| 6505 | gfx3d_clk.freq_tbl = clk_tbl_gfx3d_8960ab; |
| 6506 | gfx3d_clk.c.fmax[VDD_DIG_LOW] = 192000000; |
| 6507 | gfx3d_clk.c.fmax[VDD_DIG_NOMINAL] = 325000000; |
| 6508 | gfx3d_clk.c.fmax[VDD_DIG_HIGH] = 400000000; |
| 6509 | mdp_clk.freq_tbl = clk_tbl_mdp_8960ab; |
| 6510 | mdp_clk.c.fmax[VDD_DIG_LOW] = 128000000; |
| 6511 | mdp_clk.c.fmax[VDD_DIG_NOMINAL] = 266667000; |
| 6512 | |
| 6513 | memcpy(msm_clocks_8960 + ARRAY_SIZE(msm_clocks_8960_common), |
| 6514 | msm_clocks_8960ab_only, sizeof(msm_clocks_8960ab_only)); |
| 6515 | msm8960_clock_init_data.size -= |
| 6516 | ARRAY_SIZE(msm_clocks_8960_only); |
Joel King | 9af070b | 2012-08-19 22:32:14 -0700 | [diff] [blame] | 6517 | |
| 6518 | gmem_axi_clk.c.depends = &gfx3d_axi_clk.c; |
Patrick Daly | e6f48904 | 2012-07-11 15:29:15 -0700 | [diff] [blame] | 6519 | } else if (cpu_is_msm8960()) { |
| 6520 | memcpy(msm_clocks_8960 + ARRAY_SIZE(msm_clocks_8960_common), |
| 6521 | msm_clocks_8960_only, sizeof(msm_clocks_8960_only)); |
| 6522 | msm8960_clock_init_data.size -= |
| 6523 | ARRAY_SIZE(msm_clocks_8960ab_only); |
| 6524 | } |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 6525 | /* |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 6526 | * Change the freq tables for and voltage requirements for |
| 6527 | * clocks which differ between 8960 and 8064. |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 6528 | */ |
| 6529 | if (cpu_is_apq8064()) { |
| 6530 | gfx3d_clk.freq_tbl = clk_tbl_gfx3d_8064; |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 6531 | |
| 6532 | memcpy(gfx3d_clk.c.fmax, fmax_gfx3d_8064, |
| 6533 | sizeof(gfx3d_clk.c.fmax)); |
| 6534 | memcpy(ijpeg_clk.c.fmax, fmax_ijpeg_8064, |
| 6535 | sizeof(ijpeg_clk.c.fmax)); |
| 6536 | memcpy(mdp_clk.c.fmax, fmax_mdp_8064, |
| 6537 | sizeof(ijpeg_clk.c.fmax)); |
| 6538 | memcpy(tv_src_clk.c.fmax, fmax_tv_src_8064, |
| 6539 | sizeof(tv_src_clk.c.fmax)); |
| 6540 | memcpy(vfe_clk.c.fmax, fmax_vfe_8064, |
| 6541 | sizeof(vfe_clk.c.fmax)); |
| 6542 | |
Patrick Daly | e6f48904 | 2012-07-11 15:29:15 -0700 | [diff] [blame] | 6543 | gmem_axi_clk.c.depends = &gfx3d_axi_clk.c; |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 6544 | } |
| 6545 | |
| 6546 | /* |
| 6547 | * Change the freq tables and voltage requirements for |
| 6548 | * clocks which differ between 8960 and 8930. |
| 6549 | */ |
Patrick Daly | ebe63c5 | 2012-08-07 15:41:30 -0700 | [diff] [blame] | 6550 | if (cpu_is_msm8930() || cpu_is_msm8627()) { |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 6551 | memcpy(gfx3d_clk.c.fmax, fmax_gfx3d_8930, |
| 6552 | sizeof(gfx3d_clk.c.fmax)); |
Patrick Daly | ebe63c5 | 2012-08-07 15:41:30 -0700 | [diff] [blame] | 6553 | } else if (cpu_is_msm8930aa()) { |
| 6554 | memcpy(gfx3d_clk.c.fmax, fmax_gfx3d_8930aa, |
| 6555 | sizeof(gfx3d_clk.c.fmax)); |
| 6556 | } |
| 6557 | if (cpu_is_msm8930() || cpu_is_msm8930aa() || cpu_is_msm8627()) { |
| 6558 | gfx3d_clk.freq_tbl = clk_tbl_gfx3d_8930; |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 6559 | pll15_clk.c.rate = 900000000; |
| 6560 | gmem_axi_clk.c.depends = &gfx3d_axi_clk_8930.c; |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 6561 | } |
Stephen Boyd | 842a1f6 | 2012-04-26 19:07:38 -0700 | [diff] [blame] | 6562 | if ((readl_relaxed(PRNG_CLK_NS_REG) & 0x7F) == 0x2B) |
| 6563 | prng_clk.freq_tbl = clk_tbl_prng_64; |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 6564 | |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 6565 | vote_vdd_level(&vdd_dig, VDD_DIG_HIGH); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 6566 | |
Vikram Mulukutla | 681d868 | 2012-03-09 23:56:20 -0800 | [diff] [blame] | 6567 | clk_ops_local_pll.enable = sr_pll_clk_enable; |
Matt Wagantall | b64888f | 2012-04-02 21:35:07 -0700 | [diff] [blame] | 6568 | } |
| 6569 | |
Patrick Daly | 1a3859f | 2012-08-27 16:10:26 -0700 | [diff] [blame] | 6570 | static void __init msm8930_pm8917_clock_pre_init(void) |
| 6571 | { |
| 6572 | /* detect pmic8917 from board file, and call this init function */ |
| 6573 | |
| 6574 | vdd_dig.set_vdd = set_vdd_dig_8930; |
| 6575 | rpm_vreg_dig_8930 = RPM_VREG_ID_PM8917_VDD_DIG_CORNER; |
| 6576 | vdd_sr2_hdmi_pll.set_vdd = set_vdd_sr2_hdmi_pll_8930_pm8917; |
| 6577 | |
| 6578 | msm8960_clock_pre_init(); |
| 6579 | } |
| 6580 | |
| 6581 | static void __init msm8930_clock_pre_init(void) |
| 6582 | { |
| 6583 | vdd_dig.set_vdd = set_vdd_dig_8930; |
| 6584 | vdd_sr2_hdmi_pll.set_vdd = set_vdd_sr2_hdmi_pll_8930; |
| 6585 | |
| 6586 | msm8960_clock_pre_init(); |
| 6587 | } |
| 6588 | |
Matt Wagantall | b64888f | 2012-04-02 21:35:07 -0700 | [diff] [blame] | 6589 | static void __init msm8960_clock_post_init(void) |
| 6590 | { |
| 6591 | /* Keep PXO on whenever APPS cpu is active */ |
| 6592 | clk_prepare_enable(&pxo_a_clk.c); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 6593 | |
Matt Wagantall | e655cd7 | 2012-04-09 10:15:03 -0700 | [diff] [blame] | 6594 | /* Reset 3D core while clocked to ensure it resets completely. */ |
| 6595 | clk_set_rate(&gfx3d_clk.c, 27000000); |
| 6596 | clk_prepare_enable(&gfx3d_clk.c); |
| 6597 | clk_reset(&gfx3d_clk.c, CLK_RESET_ASSERT); |
| 6598 | udelay(5); |
| 6599 | clk_reset(&gfx3d_clk.c, CLK_RESET_DEASSERT); |
| 6600 | clk_disable_unprepare(&gfx3d_clk.c); |
| 6601 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 6602 | /* Initialize rates for clocks that only support one. */ |
| 6603 | clk_set_rate(&pdm_clk.c, 27000000); |
Stephen Boyd | 842a1f6 | 2012-04-26 19:07:38 -0700 | [diff] [blame] | 6604 | clk_set_rate(&prng_clk.c, prng_clk.freq_tbl->freq_hz); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 6605 | clk_set_rate(&mdp_vsync_clk.c, 27000000); |
| 6606 | clk_set_rate(&tsif_ref_clk.c, 105000); |
| 6607 | clk_set_rate(&tssc_clk.c, 27000000); |
| 6608 | clk_set_rate(&usb_hs1_xcvr_clk.c, 60000000); |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 6609 | if (cpu_is_apq8064()) { |
| 6610 | clk_set_rate(&usb_hs3_xcvr_clk.c, 60000000); |
| 6611 | clk_set_rate(&usb_hs4_xcvr_clk.c, 60000000); |
| 6612 | } |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 6613 | clk_set_rate(&usb_fs1_src_clk.c, 60000000); |
Patrick Daly | e6f48904 | 2012-07-11 15:29:15 -0700 | [diff] [blame] | 6614 | if (cpu_is_msm8960ab() || cpu_is_msm8960() || cpu_is_msm8930() || |
| 6615 | cpu_is_msm8930aa() || cpu_is_msm8627()) |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 6616 | clk_set_rate(&usb_fs2_src_clk.c, 60000000); |
Stephen Boyd | 94625ef | 2011-07-12 17:06:01 -0700 | [diff] [blame] | 6617 | clk_set_rate(&usb_hsic_xcvr_fs_clk.c, 60000000); |
| 6618 | clk_set_rate(&usb_hsic_hsic_src_clk.c, 480000000); |
| 6619 | clk_set_rate(&usb_hsic_hsio_cal_clk.c, 9000000); |
Lena Salman | 127823f | 2012-02-14 17:13:53 +0200 | [diff] [blame] | 6620 | clk_set_rate(&usb_hsic_system_clk.c, 60000000); |
Stephen Boyd | 092fd18 | 2011-10-21 15:56:30 -0700 | [diff] [blame] | 6621 | /* |
| 6622 | * Set the CSI rates to a safe default to avoid warnings when |
| 6623 | * switching csi pix and rdi clocks. |
| 6624 | */ |
| 6625 | clk_set_rate(&csi0_src_clk.c, 27000000); |
| 6626 | clk_set_rate(&csi1_src_clk.c, 27000000); |
| 6627 | clk_set_rate(&csi2_src_clk.c, 27000000); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 6628 | |
| 6629 | /* |
Stephen Boyd | 60496bb | 2011-10-17 13:51:37 -0700 | [diff] [blame] | 6630 | * The halt status bits for these clocks may be incorrect at boot. |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 6631 | * Toggle these clocks on and off to refresh them. |
| 6632 | */ |
Stephen Boyd | 409b8b4 | 2012-04-10 12:12:56 -0700 | [diff] [blame] | 6633 | clk_prepare_enable(&pdm_clk.c); |
| 6634 | clk_disable_unprepare(&pdm_clk.c); |
| 6635 | clk_prepare_enable(&tssc_clk.c); |
| 6636 | clk_disable_unprepare(&tssc_clk.c); |
Stephen Boyd | e334aeb | 2012-01-24 12:17:29 -0800 | [diff] [blame] | 6637 | clk_prepare_enable(&usb_hsic_hsic_clk.c); |
| 6638 | clk_disable_unprepare(&usb_hsic_hsic_clk.c); |
Stephen Boyd | d7a143a | 2012-02-16 17:59:26 -0800 | [diff] [blame] | 6639 | |
| 6640 | /* |
| 6641 | * Keep sfab floor @ 54MHz so that Krait AHB is at least 27MHz at all |
| 6642 | * times when Apps CPU is active. This ensures the timer's requirement |
| 6643 | * of Krait AHB running 4 times as fast as the timer itself. |
| 6644 | */ |
| 6645 | clk_set_rate(&sfab_tmr_a_clk.c, 54000000); |
Stephen Boyd | e334aeb | 2012-01-24 12:17:29 -0800 | [diff] [blame] | 6646 | clk_prepare_enable(&sfab_tmr_a_clk.c); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 6647 | } |
| 6648 | |
Stephen Boyd | bb600ae | 2011-08-02 20:11:40 -0700 | [diff] [blame] | 6649 | static int __init msm8960_clock_late_init(void) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 6650 | { |
Stephen Boyd | a3787f3 | 2011-09-16 18:55:13 -0700 | [diff] [blame] | 6651 | int rc; |
| 6652 | 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] | 6653 | 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] | 6654 | |
| 6655 | /* Vote for MMFPB to be at least 76.8MHz when an Apps CPU is active. */ |
| 6656 | if (WARN(IS_ERR(mmfpb_a_clk), "mmfpb_a_clk not found (%ld)\n", |
| 6657 | PTR_ERR(mmfpb_a_clk))) |
| 6658 | return PTR_ERR(mmfpb_a_clk); |
Matt Wagantall | de555f56 | 2011-11-08 14:18:07 -0800 | [diff] [blame] | 6659 | rc = clk_set_rate(mmfpb_a_clk, 76800000); |
Stephen Boyd | a3787f3 | 2011-09-16 18:55:13 -0700 | [diff] [blame] | 6660 | if (WARN(rc, "mmfpb_a_clk rate was not set (%d)\n", rc)) |
| 6661 | return rc; |
Stephen Boyd | e334aeb | 2012-01-24 12:17:29 -0800 | [diff] [blame] | 6662 | rc = clk_prepare_enable(mmfpb_a_clk); |
Stephen Boyd | a3787f3 | 2011-09-16 18:55:13 -0700 | [diff] [blame] | 6663 | if (WARN(rc, "mmfpb_a_clk not enabled (%d)\n", rc)) |
| 6664 | return rc; |
| 6665 | |
Stephen Boyd | 8543613 | 2011-09-16 18:55:13 -0700 | [diff] [blame] | 6666 | /* Vote for CFPB to be at least 64MHz when an Apps CPU is active. */ |
| 6667 | if (WARN(IS_ERR(cfpb_a_clk), "cfpb_a_clk not found (%ld)\n", |
| 6668 | PTR_ERR(cfpb_a_clk))) |
| 6669 | return PTR_ERR(cfpb_a_clk); |
Matt Wagantall | de555f56 | 2011-11-08 14:18:07 -0800 | [diff] [blame] | 6670 | rc = clk_set_rate(cfpb_a_clk, 64000000); |
Stephen Boyd | 8543613 | 2011-09-16 18:55:13 -0700 | [diff] [blame] | 6671 | if (WARN(rc, "cfpb_a_clk rate was not set (%d)\n", rc)) |
| 6672 | return rc; |
Stephen Boyd | e334aeb | 2012-01-24 12:17:29 -0800 | [diff] [blame] | 6673 | rc = clk_prepare_enable(cfpb_a_clk); |
Stephen Boyd | 8543613 | 2011-09-16 18:55:13 -0700 | [diff] [blame] | 6674 | if (WARN(rc, "cfpb_a_clk not enabled (%d)\n", rc)) |
| 6675 | return rc; |
Matt Wagantall | e18bbc8 | 2011-10-06 10:07:28 -0700 | [diff] [blame] | 6676 | |
| 6677 | return unvote_vdd_level(&vdd_dig, VDD_DIG_HIGH); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 6678 | } |
Stephen Boyd | bb600ae | 2011-08-02 20:11:40 -0700 | [diff] [blame] | 6679 | |
| 6680 | struct clock_init_data msm8960_clock_init_data __initdata = { |
| 6681 | .table = msm_clocks_8960, |
| 6682 | .size = ARRAY_SIZE(msm_clocks_8960), |
Matt Wagantall | b64888f | 2012-04-02 21:35:07 -0700 | [diff] [blame] | 6683 | .pre_init = msm8960_clock_pre_init, |
| 6684 | .post_init = msm8960_clock_post_init, |
Stephen Boyd | bb600ae | 2011-08-02 20:11:40 -0700 | [diff] [blame] | 6685 | .late_init = msm8960_clock_late_init, |
| 6686 | }; |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 6687 | |
| 6688 | struct clock_init_data apq8064_clock_init_data __initdata = { |
| 6689 | .table = msm_clocks_8064, |
| 6690 | .size = ARRAY_SIZE(msm_clocks_8064), |
Matt Wagantall | b64888f | 2012-04-02 21:35:07 -0700 | [diff] [blame] | 6691 | .pre_init = msm8960_clock_pre_init, |
| 6692 | .post_init = msm8960_clock_post_init, |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 6693 | .late_init = msm8960_clock_late_init, |
| 6694 | }; |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 6695 | |
| 6696 | struct clock_init_data msm8930_clock_init_data __initdata = { |
| 6697 | .table = msm_clocks_8930, |
| 6698 | .size = ARRAY_SIZE(msm_clocks_8930), |
Patrick Daly | 1a3859f | 2012-08-27 16:10:26 -0700 | [diff] [blame] | 6699 | .pre_init = msm8930_clock_pre_init, |
| 6700 | .post_init = msm8960_clock_post_init, |
| 6701 | .late_init = msm8960_clock_late_init, |
| 6702 | }; |
| 6703 | |
| 6704 | struct clock_init_data msm8930_pm8917_clock_init_data __initdata = { |
| 6705 | .table = msm_clocks_8930, |
| 6706 | .size = ARRAY_SIZE(msm_clocks_8930), |
| 6707 | .pre_init = msm8930_pm8917_clock_pre_init, |
Matt Wagantall | b64888f | 2012-04-02 21:35:07 -0700 | [diff] [blame] | 6708 | .post_init = msm8960_clock_post_init, |
Tianyi Gou | e3d4f54 | 2012-03-15 17:06:45 -0700 | [diff] [blame] | 6709 | .late_init = msm8960_clock_late_init, |
| 6710 | }; |