blob: 5b4f00e211d448caad60b0b4505e70cc4e3aa3e1 [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")
Rohit Vaswani47ee9e92012-04-23 18:42:03 -070043#define early_machine_is_msm9625() \
44 of_flat_dt_is_compatible(of_get_flat_dt_root(), "qcom,msm9625")
45#define machine_is_msm9625() \
46 of_machine_is_compatible("qcom,msm9625")
Ravi Kumar V754282d2012-08-31 22:32:20 +053047#define early_machine_is_mpq8092() \
48 of_flat_dt_is_compatible(of_get_flat_dt_root(), "qcom,mpq8092")
49#define machine_is_mpq8092_sim() \
50 of_machine_is_compatible("qcom,mpq8092-sim")
Syed Rameez Mustafad6084d32012-08-23 15:47:50 -070051#define early_machine_is_msm8226() \
52 of_flat_dt_is_compatible(of_get_flat_dt_root(), "qcom,msm8226")
53#define machine_is_msm8226() \
54 of_machine_is_compatible("qcom,msm8226")
55#define machine_is_msm8226_sim() \
56 of_machine_is_compatible("qcom,msm8226-sim")
Patrick Daly1a1e6d12012-11-21 14:22:26 -080057#define machine_is_msm8226_rumi() \
58 of_machine_is_compatible("qcom,msm8226-rumi")
Syed Rameez Mustafa3971c142013-01-09 19:04:53 -080059#define early_machine_is_msm8610() \
60 of_flat_dt_is_compatible(of_get_flat_dt_root(), "qcom,msm8610")
61#define machine_is_msm8610() \
62 of_machine_is_compatible("qcom,msm8610")
63#define machine_is_msm8610_sim() \
64 of_machine_is_compatible("qcom,msm8610-sim")
65#define machine_is_msm8610_rumi() \
66 of_machine_is_compatible("qcom,msm8610-rumi")
Sathish Ambleya99d6852011-10-31 15:50:55 -070067#else
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -070068#define early_machine_is_msm8974() 0
69#define machine_is_msm8974() 0
70#define machine_is_msm8974_sim() 0
71#define machine_is_msm8974_rumi() 0
Rohit Vaswani47ee9e92012-04-23 18:42:03 -070072#define early_machine_is_msm9625() 0
73#define machine_is_msm9625() 0
Ravi Kumar V754282d2012-08-31 22:32:20 +053074#define early_machine_is_mpq8092() 0
75#define machine_is_mpq8092_sim() 0
Syed Rameez Mustafad6084d32012-08-23 15:47:50 -070076#define early_machine_is_msm8226() 0
77#define machine_is_msm8226() 0
78#define machine_is_msm8226_sim() 0
Patrick Daly1a1e6d12012-11-21 14:22:26 -080079#define machine_is_msm8226_rumi() 0
Syed Rameez Mustafa3971c142013-01-09 19:04:53 -080080#define early_machine_is_msm8610() 0
81#define machine_is_msm8610() 0
82#define machine_is_msm8610_sim() 0
83#define machine_is_msm8610_rumi() 0
Syed Rameez Mustafad6084d32012-08-23 15:47:50 -070084
Sathish Ambleya99d6852011-10-31 15:50:55 -070085#endif
86
Stepan Moskovchenko2b4b1cd2012-03-29 18:21:04 -070087#define PLATFORM_SUBTYPE_SGLTE 6
88
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070089enum msm_cpu {
90 MSM_CPU_UNKNOWN = 0,
91 MSM_CPU_7X01,
92 MSM_CPU_7X25,
93 MSM_CPU_7X27,
94 MSM_CPU_8X50,
95 MSM_CPU_8X50A,
96 MSM_CPU_7X30,
97 MSM_CPU_8X55,
98 MSM_CPU_8X60,
99 MSM_CPU_8960,
Stepan Moskovchenkoec6a8032012-07-06 15:42:01 -0700100 MSM_CPU_8960AB,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700101 MSM_CPU_7X27A,
102 FSM_CPU_9XXX,
103 MSM_CPU_7X25A,
104 MSM_CPU_7X25AA,
Pankaj Kumarfee56a82012-04-17 14:26:49 +0530105 MSM_CPU_7X25AB,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700106 MSM_CPU_8064,
Jay Chokshib2de5092012-09-19 18:28:12 -0700107 MSM_CPU_8064AB,
Jay Chokshif9294742013-01-15 13:06:27 -0800108 MSM_CPU_8064AA,
Stepan Moskovchenkoa8222192011-10-24 18:32:30 -0700109 MSM_CPU_8930,
Stepan Moskovchenko8b38bb32012-07-06 16:57:34 -0700110 MSM_CPU_8930AA,
Stepan Moskovchenkoa03e7612012-10-16 18:34:17 -0700111 MSM_CPU_8930AB,
Rohit Vaswani8a28b4a2011-08-10 19:07:00 -0700112 MSM_CPU_7X27AA,
113 MSM_CPU_9615,
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -0700114 MSM_CPU_8974,
Stepan Moskovchenkodb71cd62011-11-23 14:28:57 -0800115 MSM_CPU_8627,
Taniya Dasa04e1892011-11-16 14:49:12 +0530116 MSM_CPU_8625,
Ravi Kumar V754282d2012-08-31 22:32:20 +0530117 MSM_CPU_9625,
Syed Rameez Mustafad6084d32012-08-23 15:47:50 -0700118 MSM_CPU_8092,
Syed Rameez Mustafa158d6682012-09-21 18:25:50 -0700119 MSM_CPU_8226,
Syed Rameez Mustafa3971c142013-01-09 19:04:53 -0800120 MSM_CPU_8610,
Utsab Bose89b32992012-11-08 11:15:45 +0530121 MSM_CPU_8625Q,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700122};
123
Jin Hong9b556c32012-08-13 23:06:26 -0700124enum pmic_model {
125 PMIC_MODEL_PM8058 = 13,
126 PMIC_MODEL_PM8028 = 14,
127 PMIC_MODEL_PM8901 = 15,
128 PMIC_MODEL_PM8027 = 16,
129 PMIC_MODEL_ISL_9519 = 17,
130 PMIC_MODEL_PM8921 = 18,
131 PMIC_MODEL_PM8018 = 19,
132 PMIC_MODEL_PM8015 = 20,
133 PMIC_MODEL_PM8014 = 21,
134 PMIC_MODEL_PM8821 = 22,
135 PMIC_MODEL_PM8038 = 23,
136 PMIC_MODEL_PM8922 = 24,
137 PMIC_MODEL_PM8917 = 25,
138 PMIC_MODEL_UNKNOWN = 0xFFFFFFFF
139};
140
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700141enum msm_cpu socinfo_get_msm_cpu(void);
142uint32_t socinfo_get_id(void);
143uint32_t socinfo_get_version(void);
Pankaj Kumar50c705c2012-01-10 12:02:07 +0530144uint32_t socinfo_get_raw_id(void);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700145char *socinfo_get_build_id(void);
146uint32_t socinfo_get_platform_type(void);
147uint32_t socinfo_get_platform_subtype(void);
148uint32_t socinfo_get_platform_version(void);
Jin Hong9b556c32012-08-13 23:06:26 -0700149enum pmic_model socinfo_get_pmic_model(void);
150uint32_t socinfo_get_pmic_die_revision(void);
Abhimanyu Kapur91a0a502013-01-11 19:24:59 -0800151int __init socinfo_init(void) __must_check;
Stepan Moskovchenkoeff783a2011-08-22 19:01:58 -0700152const int read_msm_cpu_type(void);
153const int get_core_count(void);
Jin Hong12b8b432012-07-18 10:00:31 -0700154const int cpu_is_krait(void);
Stepan Moskovchenko70dc7cf2011-08-22 19:08:42 -0700155const int cpu_is_krait_v1(void);
Jin Hong12b8b432012-07-18 10:00:31 -0700156const int cpu_is_krait_v2(void);
Joel King824bd1f2012-08-19 12:55:49 -0700157const int cpu_is_krait_v3(void);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700158
159static inline int cpu_is_msm7x01(void)
160{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700161#ifdef CONFIG_ARCH_MSM7X01A
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700162 enum msm_cpu cpu = socinfo_get_msm_cpu();
163
164 BUG_ON(cpu == MSM_CPU_UNKNOWN);
165 return cpu == MSM_CPU_7X01;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700166#else
167 return 0;
168#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700169}
170
171static inline int cpu_is_msm7x25(void)
172{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700173#ifdef CONFIG_ARCH_MSM7X25
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700174 enum msm_cpu cpu = socinfo_get_msm_cpu();
175
176 BUG_ON(cpu == MSM_CPU_UNKNOWN);
177 return cpu == MSM_CPU_7X25;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700178#else
179 return 0;
180#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700181}
182
183static inline int cpu_is_msm7x27(void)
184{
Taniya Das8e352a42012-02-20 16:49:48 +0530185#if defined(CONFIG_ARCH_MSM7X27) && !defined(CONFIG_ARCH_MSM7X27A)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700186 enum msm_cpu cpu = socinfo_get_msm_cpu();
187
188 BUG_ON(cpu == MSM_CPU_UNKNOWN);
189 return cpu == MSM_CPU_7X27;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700190#else
191 return 0;
192#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700193}
194
195static inline int cpu_is_msm7x27a(void)
196{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700197#ifdef CONFIG_ARCH_MSM7X27A
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700198 enum msm_cpu cpu = socinfo_get_msm_cpu();
199
200 BUG_ON(cpu == MSM_CPU_UNKNOWN);
201 return cpu == MSM_CPU_7X27A;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700202#else
203 return 0;
204#endif
205}
206
207static inline int cpu_is_msm7x27aa(void)
208{
209#ifdef CONFIG_ARCH_MSM7X27A
210 enum msm_cpu cpu = socinfo_get_msm_cpu();
211
212 BUG_ON(cpu == MSM_CPU_UNKNOWN);
213 return cpu == MSM_CPU_7X27AA;
214#else
215 return 0;
216#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700217}
218
219static inline int cpu_is_msm7x25a(void)
220{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700221#ifdef CONFIG_ARCH_MSM7X27A
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700222 enum msm_cpu cpu = socinfo_get_msm_cpu();
223
224 BUG_ON(cpu == MSM_CPU_UNKNOWN);
225 return cpu == MSM_CPU_7X25A;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700226#else
227 return 0;
228#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700229}
230
231static inline int cpu_is_msm7x25aa(void)
232{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700233#ifdef CONFIG_ARCH_MSM7X27A
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700234 enum msm_cpu cpu = socinfo_get_msm_cpu();
235
236 BUG_ON(cpu == MSM_CPU_UNKNOWN);
237 return cpu == MSM_CPU_7X25AA;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700238#else
239 return 0;
240#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700241}
242
Pankaj Kumarfee56a82012-04-17 14:26:49 +0530243static inline int cpu_is_msm7x25ab(void)
244{
245#ifdef CONFIG_ARCH_MSM7X27A
246 enum msm_cpu cpu = socinfo_get_msm_cpu();
247
248 BUG_ON(cpu == MSM_CPU_UNKNOWN);
249 return cpu == MSM_CPU_7X25AB;
250#else
251 return 0;
252#endif
253}
254
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700255static inline int cpu_is_msm7x30(void)
256{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700257#ifdef CONFIG_ARCH_MSM7X30
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700258 enum msm_cpu cpu = socinfo_get_msm_cpu();
259
260 BUG_ON(cpu == MSM_CPU_UNKNOWN);
261 return cpu == MSM_CPU_7X30;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700262#else
263 return 0;
264#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700265}
266
267static inline int cpu_is_qsd8x50(void)
268{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700269#ifdef CONFIG_ARCH_QSD8X50
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700270 enum msm_cpu cpu = socinfo_get_msm_cpu();
271
272 BUG_ON(cpu == MSM_CPU_UNKNOWN);
273 return cpu == MSM_CPU_8X50;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700274#else
275 return 0;
276#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700277}
278
279static inline int cpu_is_msm8x55(void)
280{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700281#ifdef CONFIG_ARCH_MSM7X30
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700282 enum msm_cpu cpu = socinfo_get_msm_cpu();
283
284 BUG_ON(cpu == MSM_CPU_UNKNOWN);
285 return cpu == MSM_CPU_8X55;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700286#else
287 return 0;
288#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700289}
290
291static inline int cpu_is_msm8x60(void)
292{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700293#ifdef CONFIG_ARCH_MSM8X60
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700294 return read_msm_cpu_type() == MSM_CPU_8X60;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700295#else
296 return 0;
297#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700298}
299
300static inline int cpu_is_msm8960(void)
301{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700302#ifdef CONFIG_ARCH_MSM8960
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700303 return read_msm_cpu_type() == MSM_CPU_8960;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700304#else
305 return 0;
306#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700307}
308
Stepan Moskovchenkoec6a8032012-07-06 15:42:01 -0700309static inline int cpu_is_msm8960ab(void)
310{
311#ifdef CONFIG_ARCH_MSM8960
312 return read_msm_cpu_type() == MSM_CPU_8960AB;
313#else
314 return 0;
315#endif
316}
317
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700318static inline int cpu_is_apq8064(void)
319{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700320#ifdef CONFIG_ARCH_APQ8064
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700321 return read_msm_cpu_type() == MSM_CPU_8064;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700322#else
323 return 0;
324#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700325}
326
Jay Chokshib2de5092012-09-19 18:28:12 -0700327static inline int cpu_is_apq8064ab(void)
328{
329#ifdef CONFIG_ARCH_APQ8064
330 return read_msm_cpu_type() == MSM_CPU_8064AB;
331#else
332 return 0;
333#endif
334}
335
Jay Chokshif9294742013-01-15 13:06:27 -0800336static inline int cpu_is_apq8064aa(void)
337{
338#ifdef CONFIG_ARCH_APQ8064
339 return read_msm_cpu_type() == MSM_CPU_8064AA;
340#else
341 return 0;
342#endif
343}
344
Stepan Moskovchenkoa8222192011-10-24 18:32:30 -0700345static inline int cpu_is_msm8930(void)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700346{
Stepan Moskovchenkoa8f0a222011-10-24 18:53:17 -0700347#ifdef CONFIG_ARCH_MSM8930
Stepan Moskovchenkoaba208d2012-07-05 20:33:55 -0700348 return read_msm_cpu_type() == MSM_CPU_8930;
Stepan Moskovchenkodb71cd62011-11-23 14:28:57 -0800349#else
350 return 0;
351#endif
352}
353
Stepan Moskovchenko8b38bb32012-07-06 16:57:34 -0700354static inline int cpu_is_msm8930aa(void)
355{
356#ifdef CONFIG_ARCH_MSM8930
357 return read_msm_cpu_type() == MSM_CPU_8930AA;
358#else
359 return 0;
360#endif
361}
362
Stepan Moskovchenkoa03e7612012-10-16 18:34:17 -0700363static inline int cpu_is_msm8930ab(void)
364{
365#ifdef CONFIG_ARCH_MSM8930
366 return read_msm_cpu_type() == MSM_CPU_8930AB;
367#else
368 return 0;
369#endif
370}
371
Stepan Moskovchenkodb71cd62011-11-23 14:28:57 -0800372static inline int cpu_is_msm8627(void)
373{
374/* 8930 and 8627 will share the same CONFIG_ARCH type unless otherwise needed */
375#ifdef CONFIG_ARCH_MSM8930
376 return read_msm_cpu_type() == MSM_CPU_8627;
Stepan Moskovchenkoa8f0a222011-10-24 18:53:17 -0700377#else
378 return 0;
379#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700380}
381
382static inline int cpu_is_fsm9xxx(void)
383{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700384#ifdef CONFIG_ARCH_FSM9XXX
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700385 enum msm_cpu cpu = socinfo_get_msm_cpu();
386
387 BUG_ON(cpu == MSM_CPU_UNKNOWN);
388 return cpu == FSM_CPU_9XXX;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700389#else
390 return 0;
391#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700392}
393
Rohit Vaswani8a28b4a2011-08-10 19:07:00 -0700394static inline int cpu_is_msm9615(void)
395{
396#ifdef CONFIG_ARCH_MSM9615
397 enum msm_cpu cpu = socinfo_get_msm_cpu();
398
399 BUG_ON(cpu == MSM_CPU_UNKNOWN);
400 return cpu == MSM_CPU_9615;
401#else
402 return 0;
403#endif
404}
Taniya Dasa04e1892011-11-16 14:49:12 +0530405
406static inline int cpu_is_msm8625(void)
407{
408#ifdef CONFIG_ARCH_MSM8625
409 enum msm_cpu cpu = socinfo_get_msm_cpu();
410
411 BUG_ON(cpu == MSM_CPU_UNKNOWN);
412 return cpu == MSM_CPU_8625;
413#else
414 return 0;
415#endif
416}
417
Stepan Moskovchenko02c4d0c2012-07-26 14:33:02 -0700418static inline int cpu_is_msm8974(void)
419{
420#ifdef CONFIG_ARCH_MSM8974
421 enum msm_cpu cpu = socinfo_get_msm_cpu();
422
423 BUG_ON(cpu == MSM_CPU_UNKNOWN);
424 return cpu == MSM_CPU_8974;
425#else
426 return 0;
427#endif
428}
429
Ravi Kumar V754282d2012-08-31 22:32:20 +0530430static inline int cpu_is_mpq8092(void)
431{
432#ifdef CONFIG_ARCH_MPQ8092
433 enum msm_cpu cpu = socinfo_get_msm_cpu();
434
435 BUG_ON(cpu == MSM_CPU_UNKNOWN);
436 return cpu == MSM_CPU_8092;
437#else
438 return 0;
439#endif
440
441}
Syed Rameez Mustafad6084d32012-08-23 15:47:50 -0700442
443static inline int cpu_is_msm8226(void)
444{
445#ifdef CONFIG_ARCH_MSM8226
446 enum msm_cpu cpu = socinfo_get_msm_cpu();
447
448 BUG_ON(cpu == MSM_CPU_UNKNOWN);
449 return cpu == MSM_CPU_8226;
450#else
451 return 0;
452#endif
453}
454
Syed Rameez Mustafa3971c142013-01-09 19:04:53 -0800455static inline int cpu_is_msm8610(void)
Syed Rameez Mustafa158d6682012-09-21 18:25:50 -0700456{
Syed Rameez Mustafa3971c142013-01-09 19:04:53 -0800457#ifdef CONFIG_ARCH_MSM8610
Syed Rameez Mustafa158d6682012-09-21 18:25:50 -0700458 enum msm_cpu cpu = socinfo_get_msm_cpu();
459
460 BUG_ON(cpu == MSM_CPU_UNKNOWN);
Syed Rameez Mustafa3971c142013-01-09 19:04:53 -0800461 return cpu == MSM_CPU_8610;
Syed Rameez Mustafa158d6682012-09-21 18:25:50 -0700462#else
463 return 0;
464#endif
465}
Stepan Moskovchenko5b9e7762012-09-21 20:32:17 -0700466
Utsab Bose89b32992012-11-08 11:15:45 +0530467static inline int cpu_is_msm8625q(void)
468{
469#ifdef CONFIG_ARCH_MSM8625
470 enum msm_cpu cpu = socinfo_get_msm_cpu();
471
472 BUG_ON(cpu == MSM_CPU_UNKNOWN);
473 return cpu == MSM_CPU_8625Q;
474#else
475 return 0;
476#endif
477}
478
Stepan Moskovchenko5b9e7762012-09-21 20:32:17 -0700479static inline int soc_class_is_msm8960(void)
480{
481 return cpu_is_msm8960() || cpu_is_msm8960ab();
482}
483
484static inline int soc_class_is_apq8064(void)
485{
Jay Chokshif9294742013-01-15 13:06:27 -0800486 return cpu_is_apq8064() || cpu_is_apq8064ab() || cpu_is_apq8064aa();
Stepan Moskovchenko5b9e7762012-09-21 20:32:17 -0700487}
488
489static inline int soc_class_is_msm8930(void)
490{
Stepan Moskovchenkoecb0d9b2012-10-16 18:35:34 -0700491 return cpu_is_msm8930() || cpu_is_msm8930aa() || cpu_is_msm8930ab() ||
492 cpu_is_msm8627();
Stepan Moskovchenko5b9e7762012-09-21 20:32:17 -0700493}
494
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700495#endif