blob: d4565a4f5100219d991f4450a340c513c4dd5e9a [file] [log] [blame]
Abhimanyu Kapur440cdde2012-12-04 00:05:40 -08001/* Copyright (c) 2009-2013, The Linux Foundation. All rights reserved.
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002 *
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
14#ifndef _ARCH_ARM_MACH_MSM_SOCINFO_H_
15#define _ARCH_ARM_MACH_MSM_SOCINFO_H_
16
Stepan Moskovchenko87192362011-08-05 18:02:01 -070017#include <linux/kernel.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070018#include <linux/init.h>
Sathish Ambleya99d6852011-10-31 15:50:55 -070019#include <linux/errno.h>
20#include <linux/of_fdt.h>
21#include <linux/of.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070022
23#include <asm/cputype.h>
24#include <asm/mach-types.h>
25/*
26 * SOC version type with major number in the upper 16 bits and minor
27 * number in the lower 16 bits. For example:
28 * 1.0 -> 0x00010000
29 * 2.3 -> 0x00020003
30 */
31#define SOCINFO_VERSION_MAJOR(ver) ((ver & 0xffff0000) >> 16)
32#define SOCINFO_VERSION_MINOR(ver) (ver & 0x0000ffff)
33
Sathish Ambleya99d6852011-10-31 15:50:55 -070034#ifdef CONFIG_OF
Stepan Moskovchenko82f0eab2013-04-02 19:52:28 -070035#define of_board_is_sim() of_machine_is_compatible("qcom,sim")
36#define of_board_is_rumi() of_machine_is_compatible("qcom,rumi")
37#define of_board_is_fluid() of_machine_is_compatible("qcom,fluid")
38#define of_board_is_liquid() of_machine_is_compatible("qcom,liquid")
39
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -070040#define machine_is_msm8974() \
41 of_machine_is_compatible("qcom,msm8974")
Rohit Vaswani47ee9e92012-04-23 18:42:03 -070042#define machine_is_msm9625() \
43 of_machine_is_compatible("qcom,msm9625")
Ravi Kumar V754282d2012-08-31 22:32:20 +053044#define early_machine_is_mpq8092() \
45 of_flat_dt_is_compatible(of_get_flat_dt_root(), "qcom,mpq8092")
Syed Rameez Mustafad6084d32012-08-23 15:47:50 -070046#define machine_is_msm8226() \
47 of_machine_is_compatible("qcom,msm8226")
Syed Rameez Mustafa3971c142013-01-09 19:04:53 -080048#define early_machine_is_msm8610() \
49 of_flat_dt_is_compatible(of_get_flat_dt_root(), "qcom,msm8610")
50#define machine_is_msm8610() \
51 of_machine_is_compatible("qcom,msm8610")
Stepan Moskovchenko55dfdc32013-01-24 15:48:23 -080052#define early_machine_is_msmzinc() \
53 of_flat_dt_is_compatible(of_get_flat_dt_root(), "qcom,msmzinc")
Sathish Ambleya99d6852011-10-31 15:50:55 -070054#else
Stepan Moskovchenko82f0eab2013-04-02 19:52:28 -070055#define of_board_is_sim() 0
56#define of_board_is_rumi() 0
57#define of_board_is_fluid() 0
58#define of_board_is_liquid() 0
59
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -070060#define machine_is_msm8974() 0
Rohit Vaswani47ee9e92012-04-23 18:42:03 -070061#define machine_is_msm9625() 0
Ravi Kumar V754282d2012-08-31 22:32:20 +053062#define early_machine_is_mpq8092() 0
Syed Rameez Mustafad6084d32012-08-23 15:47:50 -070063#define machine_is_msm8226() 0
Syed Rameez Mustafa3971c142013-01-09 19:04:53 -080064#define early_machine_is_msm8610() 0
65#define machine_is_msm8610() 0
Stepan Moskovchenko55dfdc32013-01-24 15:48:23 -080066#define early_machine_is_msmzinc() 0
Syed Rameez Mustafad6084d32012-08-23 15:47:50 -070067
Sathish Ambleya99d6852011-10-31 15:50:55 -070068#endif
69
Stepan Moskovchenko2b4b1cd2012-03-29 18:21:04 -070070#define PLATFORM_SUBTYPE_SGLTE 6
71
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070072enum msm_cpu {
73 MSM_CPU_UNKNOWN = 0,
74 MSM_CPU_7X01,
75 MSM_CPU_7X25,
76 MSM_CPU_7X27,
77 MSM_CPU_8X50,
78 MSM_CPU_8X50A,
79 MSM_CPU_7X30,
80 MSM_CPU_8X55,
81 MSM_CPU_8X60,
82 MSM_CPU_8960,
Stepan Moskovchenkoec6a8032012-07-06 15:42:01 -070083 MSM_CPU_8960AB,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070084 MSM_CPU_7X27A,
85 FSM_CPU_9XXX,
86 MSM_CPU_7X25A,
87 MSM_CPU_7X25AA,
Pankaj Kumarfee56a82012-04-17 14:26:49 +053088 MSM_CPU_7X25AB,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070089 MSM_CPU_8064,
Jay Chokshib2de5092012-09-19 18:28:12 -070090 MSM_CPU_8064AB,
Jay Chokshif9294742013-01-15 13:06:27 -080091 MSM_CPU_8064AA,
Stepan Moskovchenkoa8222192011-10-24 18:32:30 -070092 MSM_CPU_8930,
Stepan Moskovchenko8b38bb32012-07-06 16:57:34 -070093 MSM_CPU_8930AA,
Stepan Moskovchenkoa03e7612012-10-16 18:34:17 -070094 MSM_CPU_8930AB,
Rohit Vaswani8a28b4a2011-08-10 19:07:00 -070095 MSM_CPU_7X27AA,
96 MSM_CPU_9615,
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -070097 MSM_CPU_8974,
Stepan Moskovchenkodb71cd62011-11-23 14:28:57 -080098 MSM_CPU_8627,
Taniya Dasa04e1892011-11-16 14:49:12 +053099 MSM_CPU_8625,
Ravi Kumar V754282d2012-08-31 22:32:20 +0530100 MSM_CPU_9625,
Syed Rameez Mustafad6084d32012-08-23 15:47:50 -0700101 MSM_CPU_8092,
Syed Rameez Mustafa158d6682012-09-21 18:25:50 -0700102 MSM_CPU_8226,
Syed Rameez Mustafa3971c142013-01-09 19:04:53 -0800103 MSM_CPU_8610,
Utsab Bose89b32992012-11-08 11:15:45 +0530104 MSM_CPU_8625Q,
Stepan Moskovchenko55dfdc32013-01-24 15:48:23 -0800105 MSM_CPU_ZINC,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700106};
107
Jin Hong9b556c32012-08-13 23:06:26 -0700108enum pmic_model {
109 PMIC_MODEL_PM8058 = 13,
110 PMIC_MODEL_PM8028 = 14,
111 PMIC_MODEL_PM8901 = 15,
112 PMIC_MODEL_PM8027 = 16,
113 PMIC_MODEL_ISL_9519 = 17,
114 PMIC_MODEL_PM8921 = 18,
115 PMIC_MODEL_PM8018 = 19,
116 PMIC_MODEL_PM8015 = 20,
117 PMIC_MODEL_PM8014 = 21,
118 PMIC_MODEL_PM8821 = 22,
119 PMIC_MODEL_PM8038 = 23,
120 PMIC_MODEL_PM8922 = 24,
121 PMIC_MODEL_PM8917 = 25,
122 PMIC_MODEL_UNKNOWN = 0xFFFFFFFF
123};
124
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700125enum msm_cpu socinfo_get_msm_cpu(void);
126uint32_t socinfo_get_id(void);
127uint32_t socinfo_get_version(void);
Pankaj Kumar50c705c2012-01-10 12:02:07 +0530128uint32_t socinfo_get_raw_id(void);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700129char *socinfo_get_build_id(void);
130uint32_t socinfo_get_platform_type(void);
131uint32_t socinfo_get_platform_subtype(void);
132uint32_t socinfo_get_platform_version(void);
Jin Hong9b556c32012-08-13 23:06:26 -0700133enum pmic_model socinfo_get_pmic_model(void);
134uint32_t socinfo_get_pmic_die_revision(void);
Abhimanyu Kapur91a0a502013-01-11 19:24:59 -0800135int __init socinfo_init(void) __must_check;
Stepan Moskovchenkoeff783a2011-08-22 19:01:58 -0700136const int read_msm_cpu_type(void);
137const int get_core_count(void);
Jin Hong12b8b432012-07-18 10:00:31 -0700138const int cpu_is_krait(void);
Stepan Moskovchenko70dc7cf2011-08-22 19:08:42 -0700139const int cpu_is_krait_v1(void);
Jin Hong12b8b432012-07-18 10:00:31 -0700140const int cpu_is_krait_v2(void);
Joel King824bd1f2012-08-19 12:55:49 -0700141const int cpu_is_krait_v3(void);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700142
143static inline int cpu_is_msm7x01(void)
144{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700145#ifdef CONFIG_ARCH_MSM7X01A
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700146 enum msm_cpu cpu = socinfo_get_msm_cpu();
147
148 BUG_ON(cpu == MSM_CPU_UNKNOWN);
149 return cpu == MSM_CPU_7X01;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700150#else
151 return 0;
152#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700153}
154
155static inline int cpu_is_msm7x25(void)
156{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700157#ifdef CONFIG_ARCH_MSM7X25
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700158 enum msm_cpu cpu = socinfo_get_msm_cpu();
159
160 BUG_ON(cpu == MSM_CPU_UNKNOWN);
161 return cpu == MSM_CPU_7X25;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700162#else
163 return 0;
164#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700165}
166
167static inline int cpu_is_msm7x27(void)
168{
Taniya Das8e352a42012-02-20 16:49:48 +0530169#if defined(CONFIG_ARCH_MSM7X27) && !defined(CONFIG_ARCH_MSM7X27A)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700170 enum msm_cpu cpu = socinfo_get_msm_cpu();
171
172 BUG_ON(cpu == MSM_CPU_UNKNOWN);
173 return cpu == MSM_CPU_7X27;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700174#else
175 return 0;
176#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700177}
178
179static inline int cpu_is_msm7x27a(void)
180{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700181#ifdef CONFIG_ARCH_MSM7X27A
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700182 enum msm_cpu cpu = socinfo_get_msm_cpu();
183
184 BUG_ON(cpu == MSM_CPU_UNKNOWN);
185 return cpu == MSM_CPU_7X27A;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700186#else
187 return 0;
188#endif
189}
190
191static inline int cpu_is_msm7x27aa(void)
192{
193#ifdef CONFIG_ARCH_MSM7X27A
194 enum msm_cpu cpu = socinfo_get_msm_cpu();
195
196 BUG_ON(cpu == MSM_CPU_UNKNOWN);
197 return cpu == MSM_CPU_7X27AA;
198#else
199 return 0;
200#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700201}
202
203static inline int cpu_is_msm7x25a(void)
204{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700205#ifdef CONFIG_ARCH_MSM7X27A
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700206 enum msm_cpu cpu = socinfo_get_msm_cpu();
207
208 BUG_ON(cpu == MSM_CPU_UNKNOWN);
209 return cpu == MSM_CPU_7X25A;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700210#else
211 return 0;
212#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700213}
214
215static inline int cpu_is_msm7x25aa(void)
216{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700217#ifdef CONFIG_ARCH_MSM7X27A
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700218 enum msm_cpu cpu = socinfo_get_msm_cpu();
219
220 BUG_ON(cpu == MSM_CPU_UNKNOWN);
221 return cpu == MSM_CPU_7X25AA;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700222#else
223 return 0;
224#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700225}
226
Pankaj Kumarfee56a82012-04-17 14:26:49 +0530227static inline int cpu_is_msm7x25ab(void)
228{
229#ifdef CONFIG_ARCH_MSM7X27A
230 enum msm_cpu cpu = socinfo_get_msm_cpu();
231
232 BUG_ON(cpu == MSM_CPU_UNKNOWN);
233 return cpu == MSM_CPU_7X25AB;
234#else
235 return 0;
236#endif
237}
238
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700239static inline int cpu_is_msm7x30(void)
240{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700241#ifdef CONFIG_ARCH_MSM7X30
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700242 enum msm_cpu cpu = socinfo_get_msm_cpu();
243
244 BUG_ON(cpu == MSM_CPU_UNKNOWN);
245 return cpu == MSM_CPU_7X30;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700246#else
247 return 0;
248#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700249}
250
251static inline int cpu_is_qsd8x50(void)
252{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700253#ifdef CONFIG_ARCH_QSD8X50
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700254 enum msm_cpu cpu = socinfo_get_msm_cpu();
255
256 BUG_ON(cpu == MSM_CPU_UNKNOWN);
257 return cpu == MSM_CPU_8X50;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700258#else
259 return 0;
260#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700261}
262
263static inline int cpu_is_msm8x55(void)
264{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700265#ifdef CONFIG_ARCH_MSM7X30
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700266 enum msm_cpu cpu = socinfo_get_msm_cpu();
267
268 BUG_ON(cpu == MSM_CPU_UNKNOWN);
269 return cpu == MSM_CPU_8X55;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700270#else
271 return 0;
272#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700273}
274
275static inline int cpu_is_msm8x60(void)
276{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700277#ifdef CONFIG_ARCH_MSM8X60
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700278 return read_msm_cpu_type() == MSM_CPU_8X60;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700279#else
280 return 0;
281#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700282}
283
284static inline int cpu_is_msm8960(void)
285{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700286#ifdef CONFIG_ARCH_MSM8960
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700287 return read_msm_cpu_type() == MSM_CPU_8960;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700288#else
289 return 0;
290#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700291}
292
Stepan Moskovchenkoec6a8032012-07-06 15:42:01 -0700293static inline int cpu_is_msm8960ab(void)
294{
295#ifdef CONFIG_ARCH_MSM8960
296 return read_msm_cpu_type() == MSM_CPU_8960AB;
297#else
298 return 0;
299#endif
300}
301
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700302static inline int cpu_is_apq8064(void)
303{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700304#ifdef CONFIG_ARCH_APQ8064
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700305 return read_msm_cpu_type() == MSM_CPU_8064;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700306#else
307 return 0;
308#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700309}
310
Jay Chokshib2de5092012-09-19 18:28:12 -0700311static inline int cpu_is_apq8064ab(void)
312{
313#ifdef CONFIG_ARCH_APQ8064
314 return read_msm_cpu_type() == MSM_CPU_8064AB;
315#else
316 return 0;
317#endif
318}
319
Jay Chokshif9294742013-01-15 13:06:27 -0800320static inline int cpu_is_apq8064aa(void)
321{
322#ifdef CONFIG_ARCH_APQ8064
323 return read_msm_cpu_type() == MSM_CPU_8064AA;
324#else
325 return 0;
326#endif
327}
328
Stepan Moskovchenkoa8222192011-10-24 18:32:30 -0700329static inline int cpu_is_msm8930(void)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700330{
Stepan Moskovchenkoa8f0a222011-10-24 18:53:17 -0700331#ifdef CONFIG_ARCH_MSM8930
Stepan Moskovchenkoaba208d2012-07-05 20:33:55 -0700332 return read_msm_cpu_type() == MSM_CPU_8930;
Stepan Moskovchenkodb71cd62011-11-23 14:28:57 -0800333#else
334 return 0;
335#endif
336}
337
Stepan Moskovchenko8b38bb32012-07-06 16:57:34 -0700338static inline int cpu_is_msm8930aa(void)
339{
340#ifdef CONFIG_ARCH_MSM8930
341 return read_msm_cpu_type() == MSM_CPU_8930AA;
342#else
343 return 0;
344#endif
345}
346
Stepan Moskovchenkoa03e7612012-10-16 18:34:17 -0700347static inline int cpu_is_msm8930ab(void)
348{
349#ifdef CONFIG_ARCH_MSM8930
350 return read_msm_cpu_type() == MSM_CPU_8930AB;
351#else
352 return 0;
353#endif
354}
355
Stepan Moskovchenkodb71cd62011-11-23 14:28:57 -0800356static inline int cpu_is_msm8627(void)
357{
358/* 8930 and 8627 will share the same CONFIG_ARCH type unless otherwise needed */
359#ifdef CONFIG_ARCH_MSM8930
360 return read_msm_cpu_type() == MSM_CPU_8627;
Stepan Moskovchenkoa8f0a222011-10-24 18:53:17 -0700361#else
362 return 0;
363#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700364}
365
366static inline int cpu_is_fsm9xxx(void)
367{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700368#ifdef CONFIG_ARCH_FSM9XXX
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700369 enum msm_cpu cpu = socinfo_get_msm_cpu();
370
371 BUG_ON(cpu == MSM_CPU_UNKNOWN);
372 return cpu == FSM_CPU_9XXX;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700373#else
374 return 0;
375#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700376}
377
Rohit Vaswani8a28b4a2011-08-10 19:07:00 -0700378static inline int cpu_is_msm9615(void)
379{
380#ifdef CONFIG_ARCH_MSM9615
381 enum msm_cpu cpu = socinfo_get_msm_cpu();
382
383 BUG_ON(cpu == MSM_CPU_UNKNOWN);
384 return cpu == MSM_CPU_9615;
385#else
386 return 0;
387#endif
388}
Taniya Dasa04e1892011-11-16 14:49:12 +0530389
390static inline int cpu_is_msm8625(void)
391{
392#ifdef CONFIG_ARCH_MSM8625
393 enum msm_cpu cpu = socinfo_get_msm_cpu();
394
395 BUG_ON(cpu == MSM_CPU_UNKNOWN);
396 return cpu == MSM_CPU_8625;
397#else
398 return 0;
399#endif
400}
401
Stepan Moskovchenko02c4d0c2012-07-26 14:33:02 -0700402static inline int cpu_is_msm8974(void)
403{
404#ifdef CONFIG_ARCH_MSM8974
405 enum msm_cpu cpu = socinfo_get_msm_cpu();
406
407 BUG_ON(cpu == MSM_CPU_UNKNOWN);
408 return cpu == MSM_CPU_8974;
409#else
410 return 0;
411#endif
412}
413
Ravi Kumar V754282d2012-08-31 22:32:20 +0530414static inline int cpu_is_mpq8092(void)
415{
416#ifdef CONFIG_ARCH_MPQ8092
417 enum msm_cpu cpu = socinfo_get_msm_cpu();
418
419 BUG_ON(cpu == MSM_CPU_UNKNOWN);
420 return cpu == MSM_CPU_8092;
421#else
422 return 0;
423#endif
424
425}
Syed Rameez Mustafad6084d32012-08-23 15:47:50 -0700426
427static inline int cpu_is_msm8226(void)
428{
429#ifdef CONFIG_ARCH_MSM8226
430 enum msm_cpu cpu = socinfo_get_msm_cpu();
431
432 BUG_ON(cpu == MSM_CPU_UNKNOWN);
433 return cpu == MSM_CPU_8226;
434#else
435 return 0;
436#endif
437}
438
Syed Rameez Mustafa3971c142013-01-09 19:04:53 -0800439static inline int cpu_is_msm8610(void)
Syed Rameez Mustafa158d6682012-09-21 18:25:50 -0700440{
Syed Rameez Mustafa3971c142013-01-09 19:04:53 -0800441#ifdef CONFIG_ARCH_MSM8610
Syed Rameez Mustafa158d6682012-09-21 18:25:50 -0700442 enum msm_cpu cpu = socinfo_get_msm_cpu();
443
444 BUG_ON(cpu == MSM_CPU_UNKNOWN);
Syed Rameez Mustafa3971c142013-01-09 19:04:53 -0800445 return cpu == MSM_CPU_8610;
Syed Rameez Mustafa158d6682012-09-21 18:25:50 -0700446#else
447 return 0;
448#endif
449}
Stepan Moskovchenko5b9e7762012-09-21 20:32:17 -0700450
Utsab Bose89b32992012-11-08 11:15:45 +0530451static inline int cpu_is_msm8625q(void)
452{
453#ifdef CONFIG_ARCH_MSM8625
454 enum msm_cpu cpu = socinfo_get_msm_cpu();
455
456 BUG_ON(cpu == MSM_CPU_UNKNOWN);
457 return cpu == MSM_CPU_8625Q;
458#else
459 return 0;
460#endif
461}
462
Stepan Moskovchenko5b9e7762012-09-21 20:32:17 -0700463static inline int soc_class_is_msm8960(void)
464{
465 return cpu_is_msm8960() || cpu_is_msm8960ab();
466}
467
468static inline int soc_class_is_apq8064(void)
469{
Jay Chokshif9294742013-01-15 13:06:27 -0800470 return cpu_is_apq8064() || cpu_is_apq8064ab() || cpu_is_apq8064aa();
Stepan Moskovchenko5b9e7762012-09-21 20:32:17 -0700471}
472
473static inline int soc_class_is_msm8930(void)
474{
Stepan Moskovchenkoecb0d9b2012-10-16 18:35:34 -0700475 return cpu_is_msm8930() || cpu_is_msm8930aa() || cpu_is_msm8930ab() ||
476 cpu_is_msm8627();
Stepan Moskovchenko5b9e7762012-09-21 20:32:17 -0700477}
478
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700479#endif