Tianyi Gou | 2520b6e | 2012-10-29 19:13:53 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2011-2012, The Linux Foundation. All rights reserved. |
| 3 | * |
| 4 | * This program is free software; you can redistribute it and/or modify |
| 5 | * it under the terms of the GNU General Public License version 2 and |
| 6 | * only version 2 as published by the Free Software Foundation. |
| 7 | * |
| 8 | * This program is distributed in the hope that it will be useful, |
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 11 | * GNU General Public License for more details. |
| 12 | */ |
| 13 | |
| 14 | #include <linux/kernel.h> |
| 15 | #include <linux/module.h> |
| 16 | #include <linux/platform_device.h> |
| 17 | #include <mach/rpm-regulator.h> |
| 18 | #include <mach/msm_bus_board.h> |
| 19 | #include <mach/msm_bus.h> |
| 20 | |
| 21 | #include "acpuclock.h" |
| 22 | #include "acpuclock-krait.h" |
| 23 | |
| 24 | /* Corner type vreg VDD values */ |
| 25 | #define LVL_NONE RPM_VREG_CORNER_NONE |
| 26 | #define LVL_LOW RPM_VREG_CORNER_LOW |
| 27 | #define LVL_NOM RPM_VREG_CORNER_NOMINAL |
| 28 | #define LVL_HIGH RPM_VREG_CORNER_HIGH |
| 29 | |
| 30 | static struct hfpll_data hfpll_data __initdata = { |
| 31 | .mode_offset = 0x00, |
| 32 | .l_offset = 0x08, |
| 33 | .m_offset = 0x0C, |
| 34 | .n_offset = 0x10, |
| 35 | .config_offset = 0x04, |
| 36 | .config_val = 0x7845C665, |
| 37 | .has_droop_ctl = true, |
| 38 | .droop_offset = 0x14, |
| 39 | .droop_val = 0x0108C000, |
| 40 | .low_vdd_l_max = 37, |
| 41 | .nom_vdd_l_max = 74, |
| 42 | .vdd[HFPLL_VDD_NONE] = LVL_NONE, |
| 43 | .vdd[HFPLL_VDD_LOW] = LVL_LOW, |
| 44 | .vdd[HFPLL_VDD_NOM] = LVL_NOM, |
| 45 | .vdd[HFPLL_VDD_HIGH] = LVL_HIGH, |
| 46 | }; |
| 47 | |
| 48 | static struct scalable scalable_pm8917[] __initdata = { |
| 49 | [CPU0] = { |
| 50 | .hfpll_phys_base = 0x00903200, |
| 51 | .aux_clk_sel_phys = 0x02088014, |
| 52 | .aux_clk_sel = 3, |
| 53 | .sec_clk_sel = 2, |
| 54 | .l2cpmr_iaddr = 0x4501, |
| 55 | .vreg[VREG_CORE] = { "krait0", 1300000 }, |
| 56 | .vreg[VREG_MEM] = { "krait0_mem", 1150000 }, |
| 57 | .vreg[VREG_DIG] = { "krait0_dig", 1150000 }, |
| 58 | .vreg[VREG_HFPLL_A] = { "krait0_s8", 2050000 }, |
| 59 | .vreg[VREG_HFPLL_B] = { "krait0_l23", 1800000 }, |
| 60 | }, |
| 61 | [CPU1] = { |
| 62 | .hfpll_phys_base = 0x00903300, |
| 63 | .aux_clk_sel_phys = 0x02098014, |
| 64 | .aux_clk_sel = 3, |
| 65 | .sec_clk_sel = 2, |
| 66 | .l2cpmr_iaddr = 0x5501, |
| 67 | .vreg[VREG_CORE] = { "krait1", 1300000 }, |
| 68 | .vreg[VREG_MEM] = { "krait1_mem", 1150000 }, |
| 69 | .vreg[VREG_DIG] = { "krait1_dig", 1150000 }, |
| 70 | .vreg[VREG_HFPLL_A] = { "krait1_s8", 2050000 }, |
| 71 | .vreg[VREG_HFPLL_B] = { "krait1_l23", 1800000 }, |
| 72 | }, |
| 73 | [L2] = { |
| 74 | .hfpll_phys_base = 0x00903400, |
| 75 | .aux_clk_sel_phys = 0x02011028, |
| 76 | .aux_clk_sel = 3, |
| 77 | .sec_clk_sel = 2, |
| 78 | .l2cpmr_iaddr = 0x0500, |
| 79 | .vreg[VREG_HFPLL_A] = { "l2_s8", 2050000 }, |
| 80 | .vreg[VREG_HFPLL_B] = { "l2_l23", 1800000 }, |
| 81 | }, |
| 82 | }; |
| 83 | |
| 84 | static struct scalable scalable[] __initdata = { |
| 85 | [CPU0] = { |
| 86 | .hfpll_phys_base = 0x00903200, |
| 87 | .aux_clk_sel_phys = 0x02088014, |
| 88 | .aux_clk_sel = 3, |
| 89 | .sec_clk_sel = 2, |
| 90 | .l2cpmr_iaddr = 0x4501, |
| 91 | .vreg[VREG_CORE] = { "krait0", 1300000 }, |
| 92 | .vreg[VREG_MEM] = { "krait0_mem", 1150000 }, |
| 93 | .vreg[VREG_DIG] = { "krait0_dig", 1150000 }, |
| 94 | .vreg[VREG_HFPLL_A] = { "krait0_hfpll", 1800000 }, |
| 95 | }, |
| 96 | [CPU1] = { |
| 97 | .hfpll_phys_base = 0x00903300, |
| 98 | .aux_clk_sel_phys = 0x02098014, |
| 99 | .aux_clk_sel = 3, |
| 100 | .sec_clk_sel = 2, |
| 101 | .l2cpmr_iaddr = 0x5501, |
| 102 | .vreg[VREG_CORE] = { "krait1", 1300000 }, |
| 103 | .vreg[VREG_MEM] = { "krait1_mem", 1150000 }, |
| 104 | .vreg[VREG_DIG] = { "krait1_dig", 1150000 }, |
| 105 | .vreg[VREG_HFPLL_A] = { "krait1_hfpll", 1800000 }, |
| 106 | }, |
| 107 | [L2] = { |
| 108 | .hfpll_phys_base = 0x00903400, |
| 109 | .aux_clk_sel_phys = 0x02011028, |
| 110 | .aux_clk_sel = 3, |
| 111 | .sec_clk_sel = 2, |
| 112 | .l2cpmr_iaddr = 0x0500, |
| 113 | .vreg[VREG_HFPLL_A] = { "l2_hfpll", 1800000 }, |
| 114 | }, |
| 115 | }; |
| 116 | |
| 117 | static struct msm_bus_paths bw_level_tbl[] __initdata = { |
| 118 | [0] = BW_MBPS(640), /* At least 80 MHz on bus. */ |
| 119 | [1] = BW_MBPS(1064), /* At least 133 MHz on bus. */ |
| 120 | [2] = BW_MBPS(1600), /* At least 200 MHz on bus. */ |
| 121 | [3] = BW_MBPS(2128), /* At least 266 MHz on bus. */ |
| 122 | [4] = BW_MBPS(3200), /* At least 400 MHz on bus. */ |
| 123 | [5] = BW_MBPS(4800), /* At least 600 MHz on bus. */ |
| 124 | }; |
| 125 | |
| 126 | static struct msm_bus_scale_pdata bus_scale_data __initdata = { |
| 127 | .usecase = bw_level_tbl, |
| 128 | .num_usecases = ARRAY_SIZE(bw_level_tbl), |
| 129 | .active_only = 1, |
| 130 | .name = "acpuclk-8930ab", |
| 131 | }; |
| 132 | |
| 133 | /* TODO: Update new L2 freqs once they are available */ |
| 134 | static struct l2_level l2_freq_tbl[] __initdata = { |
| 135 | [0] = { { 384000, PLL_8, 0, 0x00 }, LVL_NOM, 1050000, 1 }, |
| 136 | [1] = { { 432000, HFPLL, 2, 0x20 }, LVL_NOM, 1050000, 2 }, |
| 137 | [2] = { { 486000, HFPLL, 2, 0x24 }, LVL_NOM, 1050000, 2 }, |
| 138 | [3] = { { 540000, HFPLL, 2, 0x28 }, LVL_NOM, 1050000, 2 }, |
| 139 | [4] = { { 594000, HFPLL, 1, 0x16 }, LVL_NOM, 1050000, 2 }, |
| 140 | [5] = { { 648000, HFPLL, 1, 0x18 }, LVL_NOM, 1050000, 4 }, |
| 141 | [6] = { { 702000, HFPLL, 1, 0x1A }, LVL_NOM, 1050000, 4 }, |
| 142 | [7] = { { 756000, HFPLL, 1, 0x1C }, LVL_HIGH, 1150000, 4 }, |
| 143 | [8] = { { 810000, HFPLL, 1, 0x1E }, LVL_HIGH, 1150000, 4 }, |
| 144 | [9] = { { 864000, HFPLL, 1, 0x20 }, LVL_HIGH, 1150000, 4 }, |
| 145 | [10] = { { 918000, HFPLL, 1, 0x22 }, LVL_HIGH, 1150000, 5 }, |
| 146 | [11] = { { 972000, HFPLL, 1, 0x24 }, LVL_HIGH, 1150000, 5 }, |
| 147 | [12] = { { 1026000, HFPLL, 1, 0x26 }, LVL_HIGH, 1150000, 5 }, |
| 148 | [13] = { { 1080000, HFPLL, 1, 0x28 }, LVL_HIGH, 1150000, 5 }, |
| 149 | [14] = { { 1134000, HFPLL, 1, 0x2A }, LVL_HIGH, 1150000, 5 }, |
| 150 | [15] = { { 1188000, HFPLL, 1, 0x2C }, LVL_HIGH, 1150000, 5 }, |
| 151 | { } |
| 152 | }; |
| 153 | |
| 154 | static struct acpu_level acpu_freq_tbl_slow[] __initdata = { |
| 155 | { 1, { 384000, PLL_8, 0, 0x00 }, L2(0), 950000 }, |
Tianyi Gou | d278616 | 2012-11-28 15:28:05 -0800 | [diff] [blame] | 156 | { 0, { 432000, HFPLL, 2, 0x20 }, L2(5), 975000 }, |
Tianyi Gou | 2520b6e | 2012-10-29 19:13:53 -0700 | [diff] [blame] | 157 | { 1, { 486000, HFPLL, 2, 0x24 }, L2(5), 975000 }, |
Tianyi Gou | d278616 | 2012-11-28 15:28:05 -0800 | [diff] [blame] | 158 | { 0, { 540000, HFPLL, 2, 0x28 }, L2(5), 1000000 }, |
Tianyi Gou | 2520b6e | 2012-10-29 19:13:53 -0700 | [diff] [blame] | 159 | { 1, { 594000, HFPLL, 1, 0x16 }, L2(5), 1000000 }, |
Tianyi Gou | d278616 | 2012-11-28 15:28:05 -0800 | [diff] [blame] | 160 | { 0, { 648000, HFPLL, 1, 0x18 }, L2(5), 1025000 }, |
Tianyi Gou | 2520b6e | 2012-10-29 19:13:53 -0700 | [diff] [blame] | 161 | { 1, { 702000, HFPLL, 1, 0x1A }, L2(5), 1025000 }, |
Tianyi Gou | d278616 | 2012-11-28 15:28:05 -0800 | [diff] [blame] | 162 | { 0, { 756000, HFPLL, 1, 0x1C }, L2(10), 1075000 }, |
Tianyi Gou | 2520b6e | 2012-10-29 19:13:53 -0700 | [diff] [blame] | 163 | { 1, { 810000, HFPLL, 1, 0x1E }, L2(10), 1075000 }, |
Tianyi Gou | d278616 | 2012-11-28 15:28:05 -0800 | [diff] [blame] | 164 | { 0, { 864000, HFPLL, 1, 0x20 }, L2(10), 1100000 }, |
Tianyi Gou | 2520b6e | 2012-10-29 19:13:53 -0700 | [diff] [blame] | 165 | { 1, { 918000, HFPLL, 1, 0x22 }, L2(10), 1100000 }, |
Tianyi Gou | d278616 | 2012-11-28 15:28:05 -0800 | [diff] [blame] | 166 | { 0, { 972000, HFPLL, 1, 0x24 }, L2(10), 1125000 }, |
Tianyi Gou | 2520b6e | 2012-10-29 19:13:53 -0700 | [diff] [blame] | 167 | { 1, { 1026000, HFPLL, 1, 0x26 }, L2(10), 1125000 }, |
Tianyi Gou | d278616 | 2012-11-28 15:28:05 -0800 | [diff] [blame] | 168 | { 0, { 1080000, HFPLL, 1, 0x28 }, L2(15), 1175000 }, |
Tianyi Gou | 2520b6e | 2012-10-29 19:13:53 -0700 | [diff] [blame] | 169 | { 1, { 1134000, HFPLL, 1, 0x2A }, L2(15), 1175000 }, |
Tianyi Gou | d278616 | 2012-11-28 15:28:05 -0800 | [diff] [blame] | 170 | { 0, { 1188000, HFPLL, 1, 0x2C }, L2(15), 1200000 }, |
Tianyi Gou | 2520b6e | 2012-10-29 19:13:53 -0700 | [diff] [blame] | 171 | { 1, { 1242000, HFPLL, 1, 0x2E }, L2(15), 1200000 }, |
Tianyi Gou | d278616 | 2012-11-28 15:28:05 -0800 | [diff] [blame] | 172 | { 0, { 1296000, HFPLL, 1, 0x30 }, L2(15), 1225000 }, |
Tianyi Gou | 2520b6e | 2012-10-29 19:13:53 -0700 | [diff] [blame] | 173 | { 1, { 1350000, HFPLL, 1, 0x32 }, L2(15), 1225000 }, |
Tianyi Gou | d278616 | 2012-11-28 15:28:05 -0800 | [diff] [blame] | 174 | { 0, { 1404000, HFPLL, 1, 0x34 }, L2(15), 1237500 }, |
Tianyi Gou | 2520b6e | 2012-10-29 19:13:53 -0700 | [diff] [blame] | 175 | { 1, { 1458000, HFPLL, 1, 0x36 }, L2(15), 1237500 }, |
Tianyi Gou | d278616 | 2012-11-28 15:28:05 -0800 | [diff] [blame] | 176 | { 0, { 1512000, HFPLL, 1, 0x38 }, L2(15), 1250000 }, |
Tianyi Gou | 2520b6e | 2012-10-29 19:13:53 -0700 | [diff] [blame] | 177 | { 1, { 1566000, HFPLL, 1, 0x3A }, L2(15), 1250000 }, |
Tianyi Gou | d278616 | 2012-11-28 15:28:05 -0800 | [diff] [blame] | 178 | { 0, { 1620000, HFPLL, 1, 0x3C }, L2(15), 1262500 }, |
Tianyi Gou | 2520b6e | 2012-10-29 19:13:53 -0700 | [diff] [blame] | 179 | { 1, { 1674000, HFPLL, 1, 0x3E }, L2(15), 1262500 }, |
| 180 | { 1, { 1728000, HFPLL, 1, 0x40 }, L2(15), 1287500 }, |
| 181 | { 0, { 0 } } |
| 182 | }; |
| 183 | |
| 184 | static struct acpu_level acpu_freq_tbl_nom[] __initdata = { |
| 185 | { 1, { 384000, PLL_8, 0, 0x00 }, L2(0), 950000 }, |
Tianyi Gou | d278616 | 2012-11-28 15:28:05 -0800 | [diff] [blame] | 186 | { 0, { 432000, HFPLL, 2, 0x20 }, L2(5), 975000 }, |
Tianyi Gou | 2520b6e | 2012-10-29 19:13:53 -0700 | [diff] [blame] | 187 | { 1, { 486000, HFPLL, 2, 0x24 }, L2(5), 975000 }, |
Tianyi Gou | d278616 | 2012-11-28 15:28:05 -0800 | [diff] [blame] | 188 | { 0, { 540000, HFPLL, 2, 0x28 }, L2(5), 1000000 }, |
Tianyi Gou | 2520b6e | 2012-10-29 19:13:53 -0700 | [diff] [blame] | 189 | { 1, { 594000, HFPLL, 1, 0x16 }, L2(5), 1000000 }, |
Tianyi Gou | d278616 | 2012-11-28 15:28:05 -0800 | [diff] [blame] | 190 | { 0, { 648000, HFPLL, 1, 0x18 }, L2(5), 1025000 }, |
Tianyi Gou | 2520b6e | 2012-10-29 19:13:53 -0700 | [diff] [blame] | 191 | { 1, { 702000, HFPLL, 1, 0x1A }, L2(5), 1025000 }, |
Tianyi Gou | d278616 | 2012-11-28 15:28:05 -0800 | [diff] [blame] | 192 | { 0, { 756000, HFPLL, 1, 0x1C }, L2(10), 1075000 }, |
Tianyi Gou | 2520b6e | 2012-10-29 19:13:53 -0700 | [diff] [blame] | 193 | { 1, { 810000, HFPLL, 1, 0x1E }, L2(10), 1075000 }, |
Tianyi Gou | d278616 | 2012-11-28 15:28:05 -0800 | [diff] [blame] | 194 | { 0, { 864000, HFPLL, 1, 0x20 }, L2(10), 1100000 }, |
Tianyi Gou | 2520b6e | 2012-10-29 19:13:53 -0700 | [diff] [blame] | 195 | { 1, { 918000, HFPLL, 1, 0x22 }, L2(10), 1100000 }, |
Tianyi Gou | d278616 | 2012-11-28 15:28:05 -0800 | [diff] [blame] | 196 | { 0, { 972000, HFPLL, 1, 0x24 }, L2(10), 1125000 }, |
Tianyi Gou | 2520b6e | 2012-10-29 19:13:53 -0700 | [diff] [blame] | 197 | { 1, { 1026000, HFPLL, 1, 0x26 }, L2(10), 1125000 }, |
Tianyi Gou | d278616 | 2012-11-28 15:28:05 -0800 | [diff] [blame] | 198 | { 0, { 1080000, HFPLL, 1, 0x28 }, L2(15), 1175000 }, |
Tianyi Gou | 2520b6e | 2012-10-29 19:13:53 -0700 | [diff] [blame] | 199 | { 1, { 1134000, HFPLL, 1, 0x2A }, L2(15), 1175000 }, |
Tianyi Gou | d278616 | 2012-11-28 15:28:05 -0800 | [diff] [blame] | 200 | { 0, { 1188000, HFPLL, 1, 0x2C }, L2(15), 1200000 }, |
Tianyi Gou | 2520b6e | 2012-10-29 19:13:53 -0700 | [diff] [blame] | 201 | { 1, { 1242000, HFPLL, 1, 0x2E }, L2(15), 1200000 }, |
Tianyi Gou | d278616 | 2012-11-28 15:28:05 -0800 | [diff] [blame] | 202 | { 0, { 1296000, HFPLL, 1, 0x30 }, L2(15), 1225000 }, |
Tianyi Gou | 2520b6e | 2012-10-29 19:13:53 -0700 | [diff] [blame] | 203 | { 1, { 1350000, HFPLL, 1, 0x32 }, L2(15), 1225000 }, |
Tianyi Gou | d278616 | 2012-11-28 15:28:05 -0800 | [diff] [blame] | 204 | { 0, { 1404000, HFPLL, 1, 0x34 }, L2(15), 1237500 }, |
Tianyi Gou | 2520b6e | 2012-10-29 19:13:53 -0700 | [diff] [blame] | 205 | { 1, { 1458000, HFPLL, 1, 0x36 }, L2(15), 1237500 }, |
Tianyi Gou | d278616 | 2012-11-28 15:28:05 -0800 | [diff] [blame] | 206 | { 0, { 1512000, HFPLL, 1, 0x38 }, L2(15), 1250000 }, |
Tianyi Gou | 2520b6e | 2012-10-29 19:13:53 -0700 | [diff] [blame] | 207 | { 1, { 1566000, HFPLL, 1, 0x3A }, L2(15), 1250000 }, |
Tianyi Gou | d278616 | 2012-11-28 15:28:05 -0800 | [diff] [blame] | 208 | { 0, { 1620000, HFPLL, 1, 0x3C }, L2(15), 1262500 }, |
Tianyi Gou | 2520b6e | 2012-10-29 19:13:53 -0700 | [diff] [blame] | 209 | { 1, { 1674000, HFPLL, 1, 0x3E }, L2(15), 1262500 }, |
| 210 | { 1, { 1728000, HFPLL, 1, 0x40 }, L2(15), 1287500 }, |
| 211 | { 0, { 0 } } |
| 212 | }; |
| 213 | |
| 214 | static struct acpu_level acpu_freq_tbl_fast[] __initdata = { |
| 215 | { 1, { 384000, PLL_8, 0, 0x00 }, L2(0), 950000 }, |
Tianyi Gou | d278616 | 2012-11-28 15:28:05 -0800 | [diff] [blame] | 216 | { 0, { 432000, HFPLL, 2, 0x20 }, L2(5), 975000 }, |
Tianyi Gou | 2520b6e | 2012-10-29 19:13:53 -0700 | [diff] [blame] | 217 | { 1, { 486000, HFPLL, 2, 0x24 }, L2(5), 975000 }, |
Tianyi Gou | d278616 | 2012-11-28 15:28:05 -0800 | [diff] [blame] | 218 | { 0, { 540000, HFPLL, 2, 0x28 }, L2(5), 1000000 }, |
Tianyi Gou | 2520b6e | 2012-10-29 19:13:53 -0700 | [diff] [blame] | 219 | { 1, { 594000, HFPLL, 1, 0x16 }, L2(5), 1000000 }, |
Tianyi Gou | d278616 | 2012-11-28 15:28:05 -0800 | [diff] [blame] | 220 | { 0, { 648000, HFPLL, 1, 0x18 }, L2(5), 1025000 }, |
Tianyi Gou | 2520b6e | 2012-10-29 19:13:53 -0700 | [diff] [blame] | 221 | { 1, { 702000, HFPLL, 1, 0x1A }, L2(5), 1025000 }, |
Tianyi Gou | d278616 | 2012-11-28 15:28:05 -0800 | [diff] [blame] | 222 | { 0, { 756000, HFPLL, 1, 0x1C }, L2(10), 1075000 }, |
Tianyi Gou | 2520b6e | 2012-10-29 19:13:53 -0700 | [diff] [blame] | 223 | { 1, { 810000, HFPLL, 1, 0x1E }, L2(10), 1075000 }, |
Tianyi Gou | d278616 | 2012-11-28 15:28:05 -0800 | [diff] [blame] | 224 | { 0, { 864000, HFPLL, 1, 0x20 }, L2(10), 1100000 }, |
Tianyi Gou | 2520b6e | 2012-10-29 19:13:53 -0700 | [diff] [blame] | 225 | { 1, { 918000, HFPLL, 1, 0x22 }, L2(10), 1100000 }, |
Tianyi Gou | d278616 | 2012-11-28 15:28:05 -0800 | [diff] [blame] | 226 | { 0, { 972000, HFPLL, 1, 0x24 }, L2(10), 1125000 }, |
Tianyi Gou | 2520b6e | 2012-10-29 19:13:53 -0700 | [diff] [blame] | 227 | { 1, { 1026000, HFPLL, 1, 0x26 }, L2(10), 1125000 }, |
Tianyi Gou | d278616 | 2012-11-28 15:28:05 -0800 | [diff] [blame] | 228 | { 0, { 1080000, HFPLL, 1, 0x28 }, L2(15), 1175000 }, |
Tianyi Gou | 2520b6e | 2012-10-29 19:13:53 -0700 | [diff] [blame] | 229 | { 1, { 1134000, HFPLL, 1, 0x2A }, L2(15), 1175000 }, |
Tianyi Gou | d278616 | 2012-11-28 15:28:05 -0800 | [diff] [blame] | 230 | { 0, { 1188000, HFPLL, 1, 0x2C }, L2(15), 1200000 }, |
Tianyi Gou | 2520b6e | 2012-10-29 19:13:53 -0700 | [diff] [blame] | 231 | { 1, { 1242000, HFPLL, 1, 0x2E }, L2(15), 1200000 }, |
Tianyi Gou | d278616 | 2012-11-28 15:28:05 -0800 | [diff] [blame] | 232 | { 0, { 1296000, HFPLL, 1, 0x30 }, L2(15), 1225000 }, |
Tianyi Gou | 2520b6e | 2012-10-29 19:13:53 -0700 | [diff] [blame] | 233 | { 1, { 1350000, HFPLL, 1, 0x32 }, L2(15), 1225000 }, |
Tianyi Gou | d278616 | 2012-11-28 15:28:05 -0800 | [diff] [blame] | 234 | { 0, { 1404000, HFPLL, 1, 0x34 }, L2(15), 1237500 }, |
Tianyi Gou | 2520b6e | 2012-10-29 19:13:53 -0700 | [diff] [blame] | 235 | { 1, { 1458000, HFPLL, 1, 0x36 }, L2(15), 1237500 }, |
Tianyi Gou | d278616 | 2012-11-28 15:28:05 -0800 | [diff] [blame] | 236 | { 0, { 1512000, HFPLL, 1, 0x38 }, L2(15), 1250000 }, |
Tianyi Gou | 2520b6e | 2012-10-29 19:13:53 -0700 | [diff] [blame] | 237 | { 1, { 1566000, HFPLL, 1, 0x3A }, L2(15), 1250000 }, |
Tianyi Gou | d278616 | 2012-11-28 15:28:05 -0800 | [diff] [blame] | 238 | { 0, { 1620000, HFPLL, 1, 0x3C }, L2(15), 1262500 }, |
Tianyi Gou | 2520b6e | 2012-10-29 19:13:53 -0700 | [diff] [blame] | 239 | { 1, { 1674000, HFPLL, 1, 0x3E }, L2(15), 1262500 }, |
| 240 | { 1, { 1728000, HFPLL, 1, 0x40 }, L2(15), 1287500 }, |
| 241 | { 0, { 0 } } |
| 242 | }; |
| 243 | |
| 244 | /* TODO: Update boost voltage once the pvs data is available */ |
| 245 | static struct pvs_table pvs_tables[NUM_SPEED_BINS][NUM_PVS] __initdata = { |
| 246 | [0][PVS_SLOW] = { acpu_freq_tbl_slow, sizeof(acpu_freq_tbl_slow), 0 }, |
| 247 | [0][PVS_NOMINAL] = { acpu_freq_tbl_nom, sizeof(acpu_freq_tbl_nom), 0 }, |
| 248 | [0][PVS_FAST] = { acpu_freq_tbl_fast, sizeof(acpu_freq_tbl_fast), 0 }, |
| 249 | }; |
| 250 | |
| 251 | static struct acpuclk_krait_params acpuclk_8930ab_params __initdata = { |
| 252 | .scalable = scalable, |
| 253 | .scalable_size = sizeof(scalable), |
| 254 | .hfpll_data = &hfpll_data, |
| 255 | .pvs_tables = pvs_tables, |
| 256 | .l2_freq_tbl = l2_freq_tbl, |
| 257 | .l2_freq_tbl_size = sizeof(l2_freq_tbl), |
| 258 | .bus_scale = &bus_scale_data, |
| 259 | .pte_efuse_phys = 0x007000C0, |
| 260 | .stby_khz = 384000, |
| 261 | }; |
| 262 | |
| 263 | static int __init acpuclk_8930ab_probe(struct platform_device *pdev) |
| 264 | { |
| 265 | struct acpuclk_platform_data *pdata = pdev->dev.platform_data; |
| 266 | if (pdata && pdata->uses_pm8917) |
| 267 | acpuclk_8930ab_params.scalable = scalable_pm8917; |
| 268 | |
| 269 | return acpuclk_krait_init(&pdev->dev, &acpuclk_8930ab_params); |
| 270 | } |
| 271 | |
| 272 | static struct platform_driver acpuclk_8930ab_driver = { |
| 273 | .driver = { |
| 274 | .name = "acpuclk-8930ab", |
| 275 | .owner = THIS_MODULE, |
| 276 | }, |
| 277 | }; |
| 278 | |
| 279 | static int __init acpuclk_8930ab_init(void) |
| 280 | { |
| 281 | return platform_driver_probe(&acpuclk_8930ab_driver, |
| 282 | acpuclk_8930ab_probe); |
| 283 | } |
| 284 | device_initcall(acpuclk_8930ab_init); |