blob: 45f2646114aa0493518b0c04af131f2a08efb147 [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
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -070035#define early_machine_is_msm8974() \
36 of_flat_dt_is_compatible(of_get_flat_dt_root(), "qcom,msm8974")
37#define machine_is_msm8974() \
38 of_machine_is_compatible("qcom,msm8974")
39#define machine_is_msm8974_sim() \
40 of_machine_is_compatible("qcom,msm8974-sim")
41#define machine_is_msm8974_rumi() \
42 of_machine_is_compatible("qcom,msm8974-rumi")
Stepan Moskovchenkoebd05412013-02-07 20:39:56 -080043#define machine_is_msm8974_fluid() \
44 of_machine_is_compatible("qcom,msm8974-fluid")
Rohit Vaswani47ee9e92012-04-23 18:42:03 -070045#define early_machine_is_msm9625() \
46 of_flat_dt_is_compatible(of_get_flat_dt_root(), "qcom,msm9625")
47#define machine_is_msm9625() \
48 of_machine_is_compatible("qcom,msm9625")
Ravi Kumar V754282d2012-08-31 22:32:20 +053049#define early_machine_is_mpq8092() \
50 of_flat_dt_is_compatible(of_get_flat_dt_root(), "qcom,mpq8092")
51#define machine_is_mpq8092_sim() \
52 of_machine_is_compatible("qcom,mpq8092-sim")
Syed Rameez Mustafad6084d32012-08-23 15:47:50 -070053#define early_machine_is_msm8226() \
54 of_flat_dt_is_compatible(of_get_flat_dt_root(), "qcom,msm8226")
55#define machine_is_msm8226() \
56 of_machine_is_compatible("qcom,msm8226")
57#define machine_is_msm8226_sim() \
58 of_machine_is_compatible("qcom,msm8226-sim")
Patrick Daly1a1e6d12012-11-21 14:22:26 -080059#define machine_is_msm8226_rumi() \
60 of_machine_is_compatible("qcom,msm8226-rumi")
Hanumant Singh92a814a2013-02-21 15:51:53 -080061#define machine_is_msm8226_cdp() \
62 of_machine_is_compatible("qcom,msm8226-cdp")
63#define machine_is_msm8226_fluid() \
64 of_machine_is_compatible("qcom,msm8226-fluid")
65#define machine_is_msm8226_mtp() \
66 of_machine_is_compatible("qcom,msm8226-mtp")
67#define machine_is_msm8226_qrd() \
68 of_machine_is_compatible("qcom,msm8226-qrd")
Syed Rameez Mustafa3971c142013-01-09 19:04:53 -080069#define early_machine_is_msm8610() \
70 of_flat_dt_is_compatible(of_get_flat_dt_root(), "qcom,msm8610")
71#define machine_is_msm8610() \
72 of_machine_is_compatible("qcom,msm8610")
73#define machine_is_msm8610_sim() \
74 of_machine_is_compatible("qcom,msm8610-sim")
75#define machine_is_msm8610_rumi() \
76 of_machine_is_compatible("qcom,msm8610-rumi")
Hanumant Singh048a21c2013-03-19 14:26:13 -070077#define machine_is_msm8610_mtp() \
78 of_machine_is_compatible("qcom,msm8610-mtp")
79#define machine_is_msm8610_cdp() \
80 of_machine_is_compatible("qcom,msm8610-cdp")
Stepan Moskovchenko55dfdc32013-01-24 15:48:23 -080081#define early_machine_is_msmzinc() \
82 of_flat_dt_is_compatible(of_get_flat_dt_root(), "qcom,msmzinc")
83#define machine_is_msmzinc_sim() \
84 of_machine_is_compatible("qcom,msmzinc-sim")
Sathish Ambleya99d6852011-10-31 15:50:55 -070085#else
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -070086#define early_machine_is_msm8974() 0
87#define machine_is_msm8974() 0
88#define machine_is_msm8974_sim() 0
89#define machine_is_msm8974_rumi() 0
Stepan Moskovchenkoebd05412013-02-07 20:39:56 -080090#define machine_is_msm8974_fluid() 0
Rohit Vaswani47ee9e92012-04-23 18:42:03 -070091#define early_machine_is_msm9625() 0
92#define machine_is_msm9625() 0
Ravi Kumar V754282d2012-08-31 22:32:20 +053093#define early_machine_is_mpq8092() 0
94#define machine_is_mpq8092_sim() 0
Syed Rameez Mustafad6084d32012-08-23 15:47:50 -070095#define early_machine_is_msm8226() 0
96#define machine_is_msm8226() 0
97#define machine_is_msm8226_sim() 0
Patrick Daly1a1e6d12012-11-21 14:22:26 -080098#define machine_is_msm8226_rumi() 0
Syed Rameez Mustafa3971c142013-01-09 19:04:53 -080099#define early_machine_is_msm8610() 0
100#define machine_is_msm8610() 0
101#define machine_is_msm8610_sim() 0
102#define machine_is_msm8610_rumi() 0
Stepan Moskovchenko55dfdc32013-01-24 15:48:23 -0800103#define early_machine_is_msmzinc() 0
104#define machine_is_msmzinc_sim() 0
Syed Rameez Mustafad6084d32012-08-23 15:47:50 -0700105
Sathish Ambleya99d6852011-10-31 15:50:55 -0700106#endif
107
Stepan Moskovchenko2b4b1cd2012-03-29 18:21:04 -0700108#define PLATFORM_SUBTYPE_SGLTE 6
109
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700110enum msm_cpu {
111 MSM_CPU_UNKNOWN = 0,
112 MSM_CPU_7X01,
113 MSM_CPU_7X25,
114 MSM_CPU_7X27,
115 MSM_CPU_8X50,
116 MSM_CPU_8X50A,
117 MSM_CPU_7X30,
118 MSM_CPU_8X55,
119 MSM_CPU_8X60,
120 MSM_CPU_8960,
Stepan Moskovchenkoec6a8032012-07-06 15:42:01 -0700121 MSM_CPU_8960AB,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700122 MSM_CPU_7X27A,
123 FSM_CPU_9XXX,
124 MSM_CPU_7X25A,
125 MSM_CPU_7X25AA,
Pankaj Kumarfee56a82012-04-17 14:26:49 +0530126 MSM_CPU_7X25AB,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700127 MSM_CPU_8064,
Jay Chokshib2de5092012-09-19 18:28:12 -0700128 MSM_CPU_8064AB,
Jay Chokshif9294742013-01-15 13:06:27 -0800129 MSM_CPU_8064AA,
Stepan Moskovchenkoa8222192011-10-24 18:32:30 -0700130 MSM_CPU_8930,
Stepan Moskovchenko8b38bb32012-07-06 16:57:34 -0700131 MSM_CPU_8930AA,
Stepan Moskovchenkoa03e7612012-10-16 18:34:17 -0700132 MSM_CPU_8930AB,
Rohit Vaswani8a28b4a2011-08-10 19:07:00 -0700133 MSM_CPU_7X27AA,
134 MSM_CPU_9615,
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -0700135 MSM_CPU_8974,
Stepan Moskovchenkodb71cd62011-11-23 14:28:57 -0800136 MSM_CPU_8627,
Taniya Dasa04e1892011-11-16 14:49:12 +0530137 MSM_CPU_8625,
Ravi Kumar V754282d2012-08-31 22:32:20 +0530138 MSM_CPU_9625,
Syed Rameez Mustafad6084d32012-08-23 15:47:50 -0700139 MSM_CPU_8092,
Syed Rameez Mustafa158d6682012-09-21 18:25:50 -0700140 MSM_CPU_8226,
Syed Rameez Mustafa3971c142013-01-09 19:04:53 -0800141 MSM_CPU_8610,
Utsab Bose89b32992012-11-08 11:15:45 +0530142 MSM_CPU_8625Q,
Stepan Moskovchenko55dfdc32013-01-24 15:48:23 -0800143 MSM_CPU_ZINC,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700144};
145
Jin Hong9b556c32012-08-13 23:06:26 -0700146enum pmic_model {
147 PMIC_MODEL_PM8058 = 13,
148 PMIC_MODEL_PM8028 = 14,
149 PMIC_MODEL_PM8901 = 15,
150 PMIC_MODEL_PM8027 = 16,
151 PMIC_MODEL_ISL_9519 = 17,
152 PMIC_MODEL_PM8921 = 18,
153 PMIC_MODEL_PM8018 = 19,
154 PMIC_MODEL_PM8015 = 20,
155 PMIC_MODEL_PM8014 = 21,
156 PMIC_MODEL_PM8821 = 22,
157 PMIC_MODEL_PM8038 = 23,
158 PMIC_MODEL_PM8922 = 24,
159 PMIC_MODEL_PM8917 = 25,
160 PMIC_MODEL_UNKNOWN = 0xFFFFFFFF
161};
162
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700163enum msm_cpu socinfo_get_msm_cpu(void);
164uint32_t socinfo_get_id(void);
165uint32_t socinfo_get_version(void);
Pankaj Kumar50c705c2012-01-10 12:02:07 +0530166uint32_t socinfo_get_raw_id(void);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700167char *socinfo_get_build_id(void);
168uint32_t socinfo_get_platform_type(void);
169uint32_t socinfo_get_platform_subtype(void);
170uint32_t socinfo_get_platform_version(void);
Jin Hong9b556c32012-08-13 23:06:26 -0700171enum pmic_model socinfo_get_pmic_model(void);
172uint32_t socinfo_get_pmic_die_revision(void);
Abhimanyu Kapur91a0a502013-01-11 19:24:59 -0800173int __init socinfo_init(void) __must_check;
Stepan Moskovchenkoeff783a2011-08-22 19:01:58 -0700174const int read_msm_cpu_type(void);
175const int get_core_count(void);
Jin Hong12b8b432012-07-18 10:00:31 -0700176const int cpu_is_krait(void);
Stepan Moskovchenko70dc7cf2011-08-22 19:08:42 -0700177const int cpu_is_krait_v1(void);
Jin Hong12b8b432012-07-18 10:00:31 -0700178const int cpu_is_krait_v2(void);
Joel King824bd1f2012-08-19 12:55:49 -0700179const int cpu_is_krait_v3(void);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700180
181static inline int cpu_is_msm7x01(void)
182{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700183#ifdef CONFIG_ARCH_MSM7X01A
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700184 enum msm_cpu cpu = socinfo_get_msm_cpu();
185
186 BUG_ON(cpu == MSM_CPU_UNKNOWN);
187 return cpu == MSM_CPU_7X01;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700188#else
189 return 0;
190#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700191}
192
193static inline int cpu_is_msm7x25(void)
194{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700195#ifdef CONFIG_ARCH_MSM7X25
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700196 enum msm_cpu cpu = socinfo_get_msm_cpu();
197
198 BUG_ON(cpu == MSM_CPU_UNKNOWN);
199 return cpu == MSM_CPU_7X25;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700200#else
201 return 0;
202#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700203}
204
205static inline int cpu_is_msm7x27(void)
206{
Taniya Das8e352a42012-02-20 16:49:48 +0530207#if defined(CONFIG_ARCH_MSM7X27) && !defined(CONFIG_ARCH_MSM7X27A)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700208 enum msm_cpu cpu = socinfo_get_msm_cpu();
209
210 BUG_ON(cpu == MSM_CPU_UNKNOWN);
211 return cpu == MSM_CPU_7X27;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700212#else
213 return 0;
214#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700215}
216
217static inline int cpu_is_msm7x27a(void)
218{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700219#ifdef CONFIG_ARCH_MSM7X27A
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700220 enum msm_cpu cpu = socinfo_get_msm_cpu();
221
222 BUG_ON(cpu == MSM_CPU_UNKNOWN);
223 return cpu == MSM_CPU_7X27A;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700224#else
225 return 0;
226#endif
227}
228
229static inline int cpu_is_msm7x27aa(void)
230{
231#ifdef CONFIG_ARCH_MSM7X27A
232 enum msm_cpu cpu = socinfo_get_msm_cpu();
233
234 BUG_ON(cpu == MSM_CPU_UNKNOWN);
235 return cpu == MSM_CPU_7X27AA;
236#else
237 return 0;
238#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700239}
240
241static inline int cpu_is_msm7x25a(void)
242{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700243#ifdef CONFIG_ARCH_MSM7X27A
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700244 enum msm_cpu cpu = socinfo_get_msm_cpu();
245
246 BUG_ON(cpu == MSM_CPU_UNKNOWN);
247 return cpu == MSM_CPU_7X25A;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700248#else
249 return 0;
250#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700251}
252
253static inline int cpu_is_msm7x25aa(void)
254{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700255#ifdef CONFIG_ARCH_MSM7X27A
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700256 enum msm_cpu cpu = socinfo_get_msm_cpu();
257
258 BUG_ON(cpu == MSM_CPU_UNKNOWN);
259 return cpu == MSM_CPU_7X25AA;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700260#else
261 return 0;
262#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700263}
264
Pankaj Kumarfee56a82012-04-17 14:26:49 +0530265static inline int cpu_is_msm7x25ab(void)
266{
267#ifdef CONFIG_ARCH_MSM7X27A
268 enum msm_cpu cpu = socinfo_get_msm_cpu();
269
270 BUG_ON(cpu == MSM_CPU_UNKNOWN);
271 return cpu == MSM_CPU_7X25AB;
272#else
273 return 0;
274#endif
275}
276
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700277static inline int cpu_is_msm7x30(void)
278{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700279#ifdef CONFIG_ARCH_MSM7X30
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700280 enum msm_cpu cpu = socinfo_get_msm_cpu();
281
282 BUG_ON(cpu == MSM_CPU_UNKNOWN);
283 return cpu == MSM_CPU_7X30;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700284#else
285 return 0;
286#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700287}
288
289static inline int cpu_is_qsd8x50(void)
290{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700291#ifdef CONFIG_ARCH_QSD8X50
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700292 enum msm_cpu cpu = socinfo_get_msm_cpu();
293
294 BUG_ON(cpu == MSM_CPU_UNKNOWN);
295 return cpu == MSM_CPU_8X50;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700296#else
297 return 0;
298#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700299}
300
301static inline int cpu_is_msm8x55(void)
302{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700303#ifdef CONFIG_ARCH_MSM7X30
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700304 enum msm_cpu cpu = socinfo_get_msm_cpu();
305
306 BUG_ON(cpu == MSM_CPU_UNKNOWN);
307 return cpu == MSM_CPU_8X55;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700308#else
309 return 0;
310#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700311}
312
313static inline int cpu_is_msm8x60(void)
314{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700315#ifdef CONFIG_ARCH_MSM8X60
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700316 return read_msm_cpu_type() == MSM_CPU_8X60;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700317#else
318 return 0;
319#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700320}
321
322static inline int cpu_is_msm8960(void)
323{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700324#ifdef CONFIG_ARCH_MSM8960
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700325 return read_msm_cpu_type() == MSM_CPU_8960;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700326#else
327 return 0;
328#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700329}
330
Stepan Moskovchenkoec6a8032012-07-06 15:42:01 -0700331static inline int cpu_is_msm8960ab(void)
332{
333#ifdef CONFIG_ARCH_MSM8960
334 return read_msm_cpu_type() == MSM_CPU_8960AB;
335#else
336 return 0;
337#endif
338}
339
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700340static inline int cpu_is_apq8064(void)
341{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700342#ifdef CONFIG_ARCH_APQ8064
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700343 return read_msm_cpu_type() == MSM_CPU_8064;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700344#else
345 return 0;
346#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700347}
348
Jay Chokshib2de5092012-09-19 18:28:12 -0700349static inline int cpu_is_apq8064ab(void)
350{
351#ifdef CONFIG_ARCH_APQ8064
352 return read_msm_cpu_type() == MSM_CPU_8064AB;
353#else
354 return 0;
355#endif
356}
357
Jay Chokshif9294742013-01-15 13:06:27 -0800358static inline int cpu_is_apq8064aa(void)
359{
360#ifdef CONFIG_ARCH_APQ8064
361 return read_msm_cpu_type() == MSM_CPU_8064AA;
362#else
363 return 0;
364#endif
365}
366
Stepan Moskovchenkoa8222192011-10-24 18:32:30 -0700367static inline int cpu_is_msm8930(void)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700368{
Stepan Moskovchenkoa8f0a222011-10-24 18:53:17 -0700369#ifdef CONFIG_ARCH_MSM8930
Stepan Moskovchenkoaba208d2012-07-05 20:33:55 -0700370 return read_msm_cpu_type() == MSM_CPU_8930;
Stepan Moskovchenkodb71cd62011-11-23 14:28:57 -0800371#else
372 return 0;
373#endif
374}
375
Stepan Moskovchenko8b38bb32012-07-06 16:57:34 -0700376static inline int cpu_is_msm8930aa(void)
377{
378#ifdef CONFIG_ARCH_MSM8930
379 return read_msm_cpu_type() == MSM_CPU_8930AA;
380#else
381 return 0;
382#endif
383}
384
Stepan Moskovchenkoa03e7612012-10-16 18:34:17 -0700385static inline int cpu_is_msm8930ab(void)
386{
387#ifdef CONFIG_ARCH_MSM8930
388 return read_msm_cpu_type() == MSM_CPU_8930AB;
389#else
390 return 0;
391#endif
392}
393
Stepan Moskovchenkodb71cd62011-11-23 14:28:57 -0800394static inline int cpu_is_msm8627(void)
395{
396/* 8930 and 8627 will share the same CONFIG_ARCH type unless otherwise needed */
397#ifdef CONFIG_ARCH_MSM8930
398 return read_msm_cpu_type() == MSM_CPU_8627;
Stepan Moskovchenkoa8f0a222011-10-24 18:53:17 -0700399#else
400 return 0;
401#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700402}
403
404static inline int cpu_is_fsm9xxx(void)
405{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700406#ifdef CONFIG_ARCH_FSM9XXX
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700407 enum msm_cpu cpu = socinfo_get_msm_cpu();
408
409 BUG_ON(cpu == MSM_CPU_UNKNOWN);
410 return cpu == FSM_CPU_9XXX;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700411#else
412 return 0;
413#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700414}
415
Rohit Vaswani8a28b4a2011-08-10 19:07:00 -0700416static inline int cpu_is_msm9615(void)
417{
418#ifdef CONFIG_ARCH_MSM9615
419 enum msm_cpu cpu = socinfo_get_msm_cpu();
420
421 BUG_ON(cpu == MSM_CPU_UNKNOWN);
422 return cpu == MSM_CPU_9615;
423#else
424 return 0;
425#endif
426}
Taniya Dasa04e1892011-11-16 14:49:12 +0530427
428static inline int cpu_is_msm8625(void)
429{
430#ifdef CONFIG_ARCH_MSM8625
431 enum msm_cpu cpu = socinfo_get_msm_cpu();
432
433 BUG_ON(cpu == MSM_CPU_UNKNOWN);
434 return cpu == MSM_CPU_8625;
435#else
436 return 0;
437#endif
438}
439
Stepan Moskovchenko02c4d0c2012-07-26 14:33:02 -0700440static inline int cpu_is_msm8974(void)
441{
442#ifdef CONFIG_ARCH_MSM8974
443 enum msm_cpu cpu = socinfo_get_msm_cpu();
444
445 BUG_ON(cpu == MSM_CPU_UNKNOWN);
446 return cpu == MSM_CPU_8974;
447#else
448 return 0;
449#endif
450}
451
Ravi Kumar V754282d2012-08-31 22:32:20 +0530452static inline int cpu_is_mpq8092(void)
453{
454#ifdef CONFIG_ARCH_MPQ8092
455 enum msm_cpu cpu = socinfo_get_msm_cpu();
456
457 BUG_ON(cpu == MSM_CPU_UNKNOWN);
458 return cpu == MSM_CPU_8092;
459#else
460 return 0;
461#endif
462
463}
Syed Rameez Mustafad6084d32012-08-23 15:47:50 -0700464
465static inline int cpu_is_msm8226(void)
466{
467#ifdef CONFIG_ARCH_MSM8226
468 enum msm_cpu cpu = socinfo_get_msm_cpu();
469
470 BUG_ON(cpu == MSM_CPU_UNKNOWN);
471 return cpu == MSM_CPU_8226;
472#else
473 return 0;
474#endif
475}
476
Syed Rameez Mustafa3971c142013-01-09 19:04:53 -0800477static inline int cpu_is_msm8610(void)
Syed Rameez Mustafa158d6682012-09-21 18:25:50 -0700478{
Syed Rameez Mustafa3971c142013-01-09 19:04:53 -0800479#ifdef CONFIG_ARCH_MSM8610
Syed Rameez Mustafa158d6682012-09-21 18:25:50 -0700480 enum msm_cpu cpu = socinfo_get_msm_cpu();
481
482 BUG_ON(cpu == MSM_CPU_UNKNOWN);
Syed Rameez Mustafa3971c142013-01-09 19:04:53 -0800483 return cpu == MSM_CPU_8610;
Syed Rameez Mustafa158d6682012-09-21 18:25:50 -0700484#else
485 return 0;
486#endif
487}
Stepan Moskovchenko5b9e7762012-09-21 20:32:17 -0700488
Utsab Bose89b32992012-11-08 11:15:45 +0530489static inline int cpu_is_msm8625q(void)
490{
491#ifdef CONFIG_ARCH_MSM8625
492 enum msm_cpu cpu = socinfo_get_msm_cpu();
493
494 BUG_ON(cpu == MSM_CPU_UNKNOWN);
495 return cpu == MSM_CPU_8625Q;
496#else
497 return 0;
498#endif
499}
500
Stepan Moskovchenko5b9e7762012-09-21 20:32:17 -0700501static inline int soc_class_is_msm8960(void)
502{
503 return cpu_is_msm8960() || cpu_is_msm8960ab();
504}
505
506static inline int soc_class_is_apq8064(void)
507{
Jay Chokshif9294742013-01-15 13:06:27 -0800508 return cpu_is_apq8064() || cpu_is_apq8064ab() || cpu_is_apq8064aa();
Stepan Moskovchenko5b9e7762012-09-21 20:32:17 -0700509}
510
511static inline int soc_class_is_msm8930(void)
512{
Stepan Moskovchenkoecb0d9b2012-10-16 18:35:34 -0700513 return cpu_is_msm8930() || cpu_is_msm8930aa() || cpu_is_msm8930ab() ||
514 cpu_is_msm8627();
Stepan Moskovchenko5b9e7762012-09-21 20:32:17 -0700515}
516
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700517#endif