blob: ff1b3c5ef9986575284b345f6db5403c0d9da793 [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")
Stepan Moskovchenko55dfdc32013-01-24 15:48:23 -080077#define early_machine_is_msmzinc() \
78 of_flat_dt_is_compatible(of_get_flat_dt_root(), "qcom,msmzinc")
79#define machine_is_msmzinc_sim() \
80 of_machine_is_compatible("qcom,msmzinc-sim")
Sathish Ambleya99d6852011-10-31 15:50:55 -070081#else
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -070082#define early_machine_is_msm8974() 0
83#define machine_is_msm8974() 0
84#define machine_is_msm8974_sim() 0
85#define machine_is_msm8974_rumi() 0
Stepan Moskovchenkoebd05412013-02-07 20:39:56 -080086#define machine_is_msm8974_fluid() 0
Rohit Vaswani47ee9e92012-04-23 18:42:03 -070087#define early_machine_is_msm9625() 0
88#define machine_is_msm9625() 0
Ravi Kumar V754282d2012-08-31 22:32:20 +053089#define early_machine_is_mpq8092() 0
90#define machine_is_mpq8092_sim() 0
Syed Rameez Mustafad6084d32012-08-23 15:47:50 -070091#define early_machine_is_msm8226() 0
92#define machine_is_msm8226() 0
93#define machine_is_msm8226_sim() 0
Patrick Daly1a1e6d12012-11-21 14:22:26 -080094#define machine_is_msm8226_rumi() 0
Syed Rameez Mustafa3971c142013-01-09 19:04:53 -080095#define early_machine_is_msm8610() 0
96#define machine_is_msm8610() 0
97#define machine_is_msm8610_sim() 0
98#define machine_is_msm8610_rumi() 0
Stepan Moskovchenko55dfdc32013-01-24 15:48:23 -080099#define early_machine_is_msmzinc() 0
100#define machine_is_msmzinc_sim() 0
Syed Rameez Mustafad6084d32012-08-23 15:47:50 -0700101
Sathish Ambleya99d6852011-10-31 15:50:55 -0700102#endif
103
Stepan Moskovchenko2b4b1cd2012-03-29 18:21:04 -0700104#define PLATFORM_SUBTYPE_SGLTE 6
105
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700106enum msm_cpu {
107 MSM_CPU_UNKNOWN = 0,
108 MSM_CPU_7X01,
109 MSM_CPU_7X25,
110 MSM_CPU_7X27,
111 MSM_CPU_8X50,
112 MSM_CPU_8X50A,
113 MSM_CPU_7X30,
114 MSM_CPU_8X55,
115 MSM_CPU_8X60,
116 MSM_CPU_8960,
Stepan Moskovchenkoec6a8032012-07-06 15:42:01 -0700117 MSM_CPU_8960AB,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700118 MSM_CPU_7X27A,
119 FSM_CPU_9XXX,
120 MSM_CPU_7X25A,
121 MSM_CPU_7X25AA,
Pankaj Kumarfee56a82012-04-17 14:26:49 +0530122 MSM_CPU_7X25AB,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700123 MSM_CPU_8064,
Jay Chokshib2de5092012-09-19 18:28:12 -0700124 MSM_CPU_8064AB,
Jay Chokshif9294742013-01-15 13:06:27 -0800125 MSM_CPU_8064AA,
Stepan Moskovchenkoa8222192011-10-24 18:32:30 -0700126 MSM_CPU_8930,
Stepan Moskovchenko8b38bb32012-07-06 16:57:34 -0700127 MSM_CPU_8930AA,
Stepan Moskovchenkoa03e7612012-10-16 18:34:17 -0700128 MSM_CPU_8930AB,
Rohit Vaswani8a28b4a2011-08-10 19:07:00 -0700129 MSM_CPU_7X27AA,
130 MSM_CPU_9615,
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -0700131 MSM_CPU_8974,
Stepan Moskovchenkodb71cd62011-11-23 14:28:57 -0800132 MSM_CPU_8627,
Taniya Dasa04e1892011-11-16 14:49:12 +0530133 MSM_CPU_8625,
Ravi Kumar V754282d2012-08-31 22:32:20 +0530134 MSM_CPU_9625,
Syed Rameez Mustafad6084d32012-08-23 15:47:50 -0700135 MSM_CPU_8092,
Syed Rameez Mustafa158d6682012-09-21 18:25:50 -0700136 MSM_CPU_8226,
Syed Rameez Mustafa3971c142013-01-09 19:04:53 -0800137 MSM_CPU_8610,
Utsab Bose89b32992012-11-08 11:15:45 +0530138 MSM_CPU_8625Q,
Stepan Moskovchenko55dfdc32013-01-24 15:48:23 -0800139 MSM_CPU_ZINC,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700140};
141
Jin Hong9b556c32012-08-13 23:06:26 -0700142enum pmic_model {
143 PMIC_MODEL_PM8058 = 13,
144 PMIC_MODEL_PM8028 = 14,
145 PMIC_MODEL_PM8901 = 15,
146 PMIC_MODEL_PM8027 = 16,
147 PMIC_MODEL_ISL_9519 = 17,
148 PMIC_MODEL_PM8921 = 18,
149 PMIC_MODEL_PM8018 = 19,
150 PMIC_MODEL_PM8015 = 20,
151 PMIC_MODEL_PM8014 = 21,
152 PMIC_MODEL_PM8821 = 22,
153 PMIC_MODEL_PM8038 = 23,
154 PMIC_MODEL_PM8922 = 24,
155 PMIC_MODEL_PM8917 = 25,
156 PMIC_MODEL_UNKNOWN = 0xFFFFFFFF
157};
158
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700159enum msm_cpu socinfo_get_msm_cpu(void);
160uint32_t socinfo_get_id(void);
161uint32_t socinfo_get_version(void);
Pankaj Kumar50c705c2012-01-10 12:02:07 +0530162uint32_t socinfo_get_raw_id(void);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700163char *socinfo_get_build_id(void);
164uint32_t socinfo_get_platform_type(void);
165uint32_t socinfo_get_platform_subtype(void);
166uint32_t socinfo_get_platform_version(void);
Jin Hong9b556c32012-08-13 23:06:26 -0700167enum pmic_model socinfo_get_pmic_model(void);
168uint32_t socinfo_get_pmic_die_revision(void);
Abhimanyu Kapur91a0a502013-01-11 19:24:59 -0800169int __init socinfo_init(void) __must_check;
Stepan Moskovchenkoeff783a2011-08-22 19:01:58 -0700170const int read_msm_cpu_type(void);
171const int get_core_count(void);
Jin Hong12b8b432012-07-18 10:00:31 -0700172const int cpu_is_krait(void);
Stepan Moskovchenko70dc7cf2011-08-22 19:08:42 -0700173const int cpu_is_krait_v1(void);
Jin Hong12b8b432012-07-18 10:00:31 -0700174const int cpu_is_krait_v2(void);
Joel King824bd1f2012-08-19 12:55:49 -0700175const int cpu_is_krait_v3(void);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700176
177static inline int cpu_is_msm7x01(void)
178{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700179#ifdef CONFIG_ARCH_MSM7X01A
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700180 enum msm_cpu cpu = socinfo_get_msm_cpu();
181
182 BUG_ON(cpu == MSM_CPU_UNKNOWN);
183 return cpu == MSM_CPU_7X01;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700184#else
185 return 0;
186#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700187}
188
189static inline int cpu_is_msm7x25(void)
190{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700191#ifdef CONFIG_ARCH_MSM7X25
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700192 enum msm_cpu cpu = socinfo_get_msm_cpu();
193
194 BUG_ON(cpu == MSM_CPU_UNKNOWN);
195 return cpu == MSM_CPU_7X25;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700196#else
197 return 0;
198#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700199}
200
201static inline int cpu_is_msm7x27(void)
202{
Taniya Das8e352a42012-02-20 16:49:48 +0530203#if defined(CONFIG_ARCH_MSM7X27) && !defined(CONFIG_ARCH_MSM7X27A)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700204 enum msm_cpu cpu = socinfo_get_msm_cpu();
205
206 BUG_ON(cpu == MSM_CPU_UNKNOWN);
207 return cpu == MSM_CPU_7X27;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700208#else
209 return 0;
210#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700211}
212
213static inline int cpu_is_msm7x27a(void)
214{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700215#ifdef CONFIG_ARCH_MSM7X27A
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700216 enum msm_cpu cpu = socinfo_get_msm_cpu();
217
218 BUG_ON(cpu == MSM_CPU_UNKNOWN);
219 return cpu == MSM_CPU_7X27A;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700220#else
221 return 0;
222#endif
223}
224
225static inline int cpu_is_msm7x27aa(void)
226{
227#ifdef CONFIG_ARCH_MSM7X27A
228 enum msm_cpu cpu = socinfo_get_msm_cpu();
229
230 BUG_ON(cpu == MSM_CPU_UNKNOWN);
231 return cpu == MSM_CPU_7X27AA;
232#else
233 return 0;
234#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700235}
236
237static inline int cpu_is_msm7x25a(void)
238{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700239#ifdef CONFIG_ARCH_MSM7X27A
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700240 enum msm_cpu cpu = socinfo_get_msm_cpu();
241
242 BUG_ON(cpu == MSM_CPU_UNKNOWN);
243 return cpu == MSM_CPU_7X25A;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700244#else
245 return 0;
246#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700247}
248
249static inline int cpu_is_msm7x25aa(void)
250{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700251#ifdef CONFIG_ARCH_MSM7X27A
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700252 enum msm_cpu cpu = socinfo_get_msm_cpu();
253
254 BUG_ON(cpu == MSM_CPU_UNKNOWN);
255 return cpu == MSM_CPU_7X25AA;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700256#else
257 return 0;
258#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700259}
260
Pankaj Kumarfee56a82012-04-17 14:26:49 +0530261static inline int cpu_is_msm7x25ab(void)
262{
263#ifdef CONFIG_ARCH_MSM7X27A
264 enum msm_cpu cpu = socinfo_get_msm_cpu();
265
266 BUG_ON(cpu == MSM_CPU_UNKNOWN);
267 return cpu == MSM_CPU_7X25AB;
268#else
269 return 0;
270#endif
271}
272
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700273static inline int cpu_is_msm7x30(void)
274{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700275#ifdef CONFIG_ARCH_MSM7X30
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700276 enum msm_cpu cpu = socinfo_get_msm_cpu();
277
278 BUG_ON(cpu == MSM_CPU_UNKNOWN);
279 return cpu == MSM_CPU_7X30;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700280#else
281 return 0;
282#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700283}
284
285static inline int cpu_is_qsd8x50(void)
286{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700287#ifdef CONFIG_ARCH_QSD8X50
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700288 enum msm_cpu cpu = socinfo_get_msm_cpu();
289
290 BUG_ON(cpu == MSM_CPU_UNKNOWN);
291 return cpu == MSM_CPU_8X50;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700292#else
293 return 0;
294#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700295}
296
297static inline int cpu_is_msm8x55(void)
298{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700299#ifdef CONFIG_ARCH_MSM7X30
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700300 enum msm_cpu cpu = socinfo_get_msm_cpu();
301
302 BUG_ON(cpu == MSM_CPU_UNKNOWN);
303 return cpu == MSM_CPU_8X55;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700304#else
305 return 0;
306#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700307}
308
309static inline int cpu_is_msm8x60(void)
310{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700311#ifdef CONFIG_ARCH_MSM8X60
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700312 return read_msm_cpu_type() == MSM_CPU_8X60;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700313#else
314 return 0;
315#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700316}
317
318static inline int cpu_is_msm8960(void)
319{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700320#ifdef CONFIG_ARCH_MSM8960
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700321 return read_msm_cpu_type() == MSM_CPU_8960;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700322#else
323 return 0;
324#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700325}
326
Stepan Moskovchenkoec6a8032012-07-06 15:42:01 -0700327static inline int cpu_is_msm8960ab(void)
328{
329#ifdef CONFIG_ARCH_MSM8960
330 return read_msm_cpu_type() == MSM_CPU_8960AB;
331#else
332 return 0;
333#endif
334}
335
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700336static inline int cpu_is_apq8064(void)
337{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700338#ifdef CONFIG_ARCH_APQ8064
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700339 return read_msm_cpu_type() == MSM_CPU_8064;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700340#else
341 return 0;
342#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700343}
344
Jay Chokshib2de5092012-09-19 18:28:12 -0700345static inline int cpu_is_apq8064ab(void)
346{
347#ifdef CONFIG_ARCH_APQ8064
348 return read_msm_cpu_type() == MSM_CPU_8064AB;
349#else
350 return 0;
351#endif
352}
353
Jay Chokshif9294742013-01-15 13:06:27 -0800354static inline int cpu_is_apq8064aa(void)
355{
356#ifdef CONFIG_ARCH_APQ8064
357 return read_msm_cpu_type() == MSM_CPU_8064AA;
358#else
359 return 0;
360#endif
361}
362
Stepan Moskovchenkoa8222192011-10-24 18:32:30 -0700363static inline int cpu_is_msm8930(void)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700364{
Stepan Moskovchenkoa8f0a222011-10-24 18:53:17 -0700365#ifdef CONFIG_ARCH_MSM8930
Stepan Moskovchenkoaba208d2012-07-05 20:33:55 -0700366 return read_msm_cpu_type() == MSM_CPU_8930;
Stepan Moskovchenkodb71cd62011-11-23 14:28:57 -0800367#else
368 return 0;
369#endif
370}
371
Stepan Moskovchenko8b38bb32012-07-06 16:57:34 -0700372static inline int cpu_is_msm8930aa(void)
373{
374#ifdef CONFIG_ARCH_MSM8930
375 return read_msm_cpu_type() == MSM_CPU_8930AA;
376#else
377 return 0;
378#endif
379}
380
Stepan Moskovchenkoa03e7612012-10-16 18:34:17 -0700381static inline int cpu_is_msm8930ab(void)
382{
383#ifdef CONFIG_ARCH_MSM8930
384 return read_msm_cpu_type() == MSM_CPU_8930AB;
385#else
386 return 0;
387#endif
388}
389
Stepan Moskovchenkodb71cd62011-11-23 14:28:57 -0800390static inline int cpu_is_msm8627(void)
391{
392/* 8930 and 8627 will share the same CONFIG_ARCH type unless otherwise needed */
393#ifdef CONFIG_ARCH_MSM8930
394 return read_msm_cpu_type() == MSM_CPU_8627;
Stepan Moskovchenkoa8f0a222011-10-24 18:53:17 -0700395#else
396 return 0;
397#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700398}
399
400static inline int cpu_is_fsm9xxx(void)
401{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700402#ifdef CONFIG_ARCH_FSM9XXX
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700403 enum msm_cpu cpu = socinfo_get_msm_cpu();
404
405 BUG_ON(cpu == MSM_CPU_UNKNOWN);
406 return cpu == FSM_CPU_9XXX;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700407#else
408 return 0;
409#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700410}
411
Rohit Vaswani8a28b4a2011-08-10 19:07:00 -0700412static inline int cpu_is_msm9615(void)
413{
414#ifdef CONFIG_ARCH_MSM9615
415 enum msm_cpu cpu = socinfo_get_msm_cpu();
416
417 BUG_ON(cpu == MSM_CPU_UNKNOWN);
418 return cpu == MSM_CPU_9615;
419#else
420 return 0;
421#endif
422}
Taniya Dasa04e1892011-11-16 14:49:12 +0530423
424static inline int cpu_is_msm8625(void)
425{
426#ifdef CONFIG_ARCH_MSM8625
427 enum msm_cpu cpu = socinfo_get_msm_cpu();
428
429 BUG_ON(cpu == MSM_CPU_UNKNOWN);
430 return cpu == MSM_CPU_8625;
431#else
432 return 0;
433#endif
434}
435
Stepan Moskovchenko02c4d0c2012-07-26 14:33:02 -0700436static inline int cpu_is_msm8974(void)
437{
438#ifdef CONFIG_ARCH_MSM8974
439 enum msm_cpu cpu = socinfo_get_msm_cpu();
440
441 BUG_ON(cpu == MSM_CPU_UNKNOWN);
442 return cpu == MSM_CPU_8974;
443#else
444 return 0;
445#endif
446}
447
Ravi Kumar V754282d2012-08-31 22:32:20 +0530448static inline int cpu_is_mpq8092(void)
449{
450#ifdef CONFIG_ARCH_MPQ8092
451 enum msm_cpu cpu = socinfo_get_msm_cpu();
452
453 BUG_ON(cpu == MSM_CPU_UNKNOWN);
454 return cpu == MSM_CPU_8092;
455#else
456 return 0;
457#endif
458
459}
Syed Rameez Mustafad6084d32012-08-23 15:47:50 -0700460
461static inline int cpu_is_msm8226(void)
462{
463#ifdef CONFIG_ARCH_MSM8226
464 enum msm_cpu cpu = socinfo_get_msm_cpu();
465
466 BUG_ON(cpu == MSM_CPU_UNKNOWN);
467 return cpu == MSM_CPU_8226;
468#else
469 return 0;
470#endif
471}
472
Syed Rameez Mustafa3971c142013-01-09 19:04:53 -0800473static inline int cpu_is_msm8610(void)
Syed Rameez Mustafa158d6682012-09-21 18:25:50 -0700474{
Syed Rameez Mustafa3971c142013-01-09 19:04:53 -0800475#ifdef CONFIG_ARCH_MSM8610
Syed Rameez Mustafa158d6682012-09-21 18:25:50 -0700476 enum msm_cpu cpu = socinfo_get_msm_cpu();
477
478 BUG_ON(cpu == MSM_CPU_UNKNOWN);
Syed Rameez Mustafa3971c142013-01-09 19:04:53 -0800479 return cpu == MSM_CPU_8610;
Syed Rameez Mustafa158d6682012-09-21 18:25:50 -0700480#else
481 return 0;
482#endif
483}
Stepan Moskovchenko5b9e7762012-09-21 20:32:17 -0700484
Utsab Bose89b32992012-11-08 11:15:45 +0530485static inline int cpu_is_msm8625q(void)
486{
487#ifdef CONFIG_ARCH_MSM8625
488 enum msm_cpu cpu = socinfo_get_msm_cpu();
489
490 BUG_ON(cpu == MSM_CPU_UNKNOWN);
491 return cpu == MSM_CPU_8625Q;
492#else
493 return 0;
494#endif
495}
496
Stepan Moskovchenko5b9e7762012-09-21 20:32:17 -0700497static inline int soc_class_is_msm8960(void)
498{
499 return cpu_is_msm8960() || cpu_is_msm8960ab();
500}
501
502static inline int soc_class_is_apq8064(void)
503{
Jay Chokshif9294742013-01-15 13:06:27 -0800504 return cpu_is_apq8064() || cpu_is_apq8064ab() || cpu_is_apq8064aa();
Stepan Moskovchenko5b9e7762012-09-21 20:32:17 -0700505}
506
507static inline int soc_class_is_msm8930(void)
508{
Stepan Moskovchenkoecb0d9b2012-10-16 18:35:34 -0700509 return cpu_is_msm8930() || cpu_is_msm8930aa() || cpu_is_msm8930ab() ||
510 cpu_is_msm8627();
Stepan Moskovchenko5b9e7762012-09-21 20:32:17 -0700511}
512
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700513#endif