blob: 5aaab18e960ac19344f2bffb5aca58158570e30d [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")
Asaf Penso1d772412013-05-05 21:31:32 +030039#define of_board_is_dragonboard() \
40 of_machine_is_compatible("qcom,dragonboard")
David Collins722299b2013-05-29 13:53:14 -070041#define of_board_is_cdp() of_machine_is_compatible("qcom,cdp")
42#define of_board_is_mtp() of_machine_is_compatible("qcom,mtp")
43#define of_board_is_qrd() of_machine_is_compatible("qcom,qrd")
Stepan Moskovchenko82f0eab2013-04-02 19:52:28 -070044
Stepan Moskovchenkoa1346e42013-04-03 13:36:18 -070045#define machine_is_msm8974() of_machine_is_compatible("qcom,msm8974")
46#define machine_is_msm9625() of_machine_is_compatible("qcom,msm9625")
47#define machine_is_msm8610() of_machine_is_compatible("qcom,msm8610")
48#define machine_is_msm8226() of_machine_is_compatible("qcom,msm8226")
Asaf Penso1d772412013-05-05 21:31:32 +030049#define machine_is_apq8074() of_machine_is_compatible("qcom,apq8074")
Stepan Moskovchenkoa1346e42013-04-03 13:36:18 -070050
Syed Rameez Mustafa3971c142013-01-09 19:04:53 -080051#define early_machine_is_msm8610() \
52 of_flat_dt_is_compatible(of_get_flat_dt_root(), "qcom,msm8610")
Stepan Moskovchenkoa1346e42013-04-03 13:36:18 -070053#define early_machine_is_mpq8092() \
54 of_flat_dt_is_compatible(of_get_flat_dt_root(), "qcom,mpq8092")
Stepan Moskovchenkoe90cd652013-04-18 12:54:47 -070055#define early_machine_is_apq8084() \
56 of_flat_dt_is_compatible(of_get_flat_dt_root(), "qcom,apq8084")
Abhimanyu Kapur37bea772013-04-11 18:19:38 -070057#define early_machine_is_msmkrypton() \
58 of_flat_dt_is_compatible(of_get_flat_dt_root(), "qcom,msmkrypton")
Rohit Vaswanic3df8b92013-03-20 19:11:15 -070059#define early_machine_is_fsm9900() \
60 of_flat_dt_is_compatible(of_get_flat_dt_root(), "qcom,fsm9900")
Jay Chokshieb3e8b62013-05-10 17:33:54 -070061#define early_machine_is_msmsamarium() \
62 of_flat_dt_is_compatible(of_get_flat_dt_root(), "qcom,msmsamarium")
Sathish Ambleya99d6852011-10-31 15:50:55 -070063#else
Stepan Moskovchenko82f0eab2013-04-02 19:52:28 -070064#define of_board_is_sim() 0
65#define of_board_is_rumi() 0
66#define of_board_is_fluid() 0
67#define of_board_is_liquid() 0
Asaf Penso1d772412013-05-05 21:31:32 +030068#define of_board_is_dragonboard() 0
David Collins722299b2013-05-29 13:53:14 -070069#define of_board_is_cdp() 0
70#define of_board_is_mtp() 0
71#define of_board_is_qrd() 0
Stepan Moskovchenko82f0eab2013-04-02 19:52:28 -070072
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -070073#define machine_is_msm8974() 0
Rohit Vaswani47ee9e92012-04-23 18:42:03 -070074#define machine_is_msm9625() 0
Syed Rameez Mustafa3971c142013-01-09 19:04:53 -080075#define machine_is_msm8610() 0
Stepan Moskovchenkoa1346e42013-04-03 13:36:18 -070076#define machine_is_msm8226() 0
Asaf Penso1d772412013-05-05 21:31:32 +030077#define machine_is_apq8074() 0
Syed Rameez Mustafad6084d32012-08-23 15:47:50 -070078
Stepan Moskovchenkoa1346e42013-04-03 13:36:18 -070079#define early_machine_is_msm8610() 0
80#define early_machine_is_mpq8092() 0
Stepan Moskovchenkoe90cd652013-04-18 12:54:47 -070081#define early_machine_is_apq8084() 0
Abhimanyu Kapur37bea772013-04-11 18:19:38 -070082#define early_machine_is_msmkrypton() 0
Rohit Vaswanic3df8b92013-03-20 19:11:15 -070083#define early_machine_is_fsm9900() 0
Jay Chokshieb3e8b62013-05-10 17:33:54 -070084#define early_machine_is_msmsamarium() 0
Sathish Ambleya99d6852011-10-31 15:50:55 -070085#endif
86
Joel King15ccbfa2013-04-12 17:41:16 -070087#define PLATFORM_SUBTYPE_MDM 1
Stepan Moskovchenko2b4b1cd2012-03-29 18:21:04 -070088#define PLATFORM_SUBTYPE_SGLTE 6
89
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070090enum msm_cpu {
91 MSM_CPU_UNKNOWN = 0,
92 MSM_CPU_7X01,
93 MSM_CPU_7X25,
94 MSM_CPU_7X27,
95 MSM_CPU_8X50,
96 MSM_CPU_8X50A,
97 MSM_CPU_7X30,
98 MSM_CPU_8X55,
99 MSM_CPU_8X60,
100 MSM_CPU_8960,
Stepan Moskovchenkoec6a8032012-07-06 15:42:01 -0700101 MSM_CPU_8960AB,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700102 MSM_CPU_7X27A,
103 FSM_CPU_9XXX,
104 MSM_CPU_7X25A,
105 MSM_CPU_7X25AA,
Pankaj Kumarfee56a82012-04-17 14:26:49 +0530106 MSM_CPU_7X25AB,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700107 MSM_CPU_8064,
Jay Chokshib2de5092012-09-19 18:28:12 -0700108 MSM_CPU_8064AB,
Jay Chokshif9294742013-01-15 13:06:27 -0800109 MSM_CPU_8064AA,
Stepan Moskovchenkoa8222192011-10-24 18:32:30 -0700110 MSM_CPU_8930,
Stepan Moskovchenko8b38bb32012-07-06 16:57:34 -0700111 MSM_CPU_8930AA,
Stepan Moskovchenkoa03e7612012-10-16 18:34:17 -0700112 MSM_CPU_8930AB,
Rohit Vaswani8a28b4a2011-08-10 19:07:00 -0700113 MSM_CPU_7X27AA,
114 MSM_CPU_9615,
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -0700115 MSM_CPU_8974,
Stepan Moskovchenkodb71cd62011-11-23 14:28:57 -0800116 MSM_CPU_8627,
Taniya Dasa04e1892011-11-16 14:49:12 +0530117 MSM_CPU_8625,
Ravi Kumar V754282d2012-08-31 22:32:20 +0530118 MSM_CPU_9625,
Syed Rameez Mustafad6084d32012-08-23 15:47:50 -0700119 MSM_CPU_8092,
Syed Rameez Mustafa158d6682012-09-21 18:25:50 -0700120 MSM_CPU_8226,
Syed Rameez Mustafa3971c142013-01-09 19:04:53 -0800121 MSM_CPU_8610,
Utsab Bose89b32992012-11-08 11:15:45 +0530122 MSM_CPU_8625Q,
Stepan Moskovchenkoe90cd652013-04-18 12:54:47 -0700123 MSM_CPU_8084,
Abhimanyu Kapur37bea772013-04-11 18:19:38 -0700124 MSM_CPU_KRYPTON,
Rohit Vaswanic3df8b92013-03-20 19:11:15 -0700125 FSM_CPU_9900,
Jay Chokshieb3e8b62013-05-10 17:33:54 -0700126 MSM_CPU_SAMARIUM,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700127};
128
Jin Hong9b556c32012-08-13 23:06:26 -0700129enum pmic_model {
130 PMIC_MODEL_PM8058 = 13,
131 PMIC_MODEL_PM8028 = 14,
132 PMIC_MODEL_PM8901 = 15,
133 PMIC_MODEL_PM8027 = 16,
134 PMIC_MODEL_ISL_9519 = 17,
135 PMIC_MODEL_PM8921 = 18,
136 PMIC_MODEL_PM8018 = 19,
137 PMIC_MODEL_PM8015 = 20,
138 PMIC_MODEL_PM8014 = 21,
139 PMIC_MODEL_PM8821 = 22,
140 PMIC_MODEL_PM8038 = 23,
141 PMIC_MODEL_PM8922 = 24,
142 PMIC_MODEL_PM8917 = 25,
143 PMIC_MODEL_UNKNOWN = 0xFFFFFFFF
144};
145
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700146enum msm_cpu socinfo_get_msm_cpu(void);
147uint32_t socinfo_get_id(void);
148uint32_t socinfo_get_version(void);
Pankaj Kumar50c705c2012-01-10 12:02:07 +0530149uint32_t socinfo_get_raw_id(void);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700150char *socinfo_get_build_id(void);
151uint32_t socinfo_get_platform_type(void);
152uint32_t socinfo_get_platform_subtype(void);
153uint32_t socinfo_get_platform_version(void);
Jin Hong9b556c32012-08-13 23:06:26 -0700154enum pmic_model socinfo_get_pmic_model(void);
155uint32_t socinfo_get_pmic_die_revision(void);
Abhimanyu Kapur91a0a502013-01-11 19:24:59 -0800156int __init socinfo_init(void) __must_check;
Stepan Moskovchenkoeff783a2011-08-22 19:01:58 -0700157const int read_msm_cpu_type(void);
158const int get_core_count(void);
Jin Hong12b8b432012-07-18 10:00:31 -0700159const int cpu_is_krait(void);
Stepan Moskovchenko70dc7cf2011-08-22 19:08:42 -0700160const int cpu_is_krait_v1(void);
Jin Hong12b8b432012-07-18 10:00:31 -0700161const int cpu_is_krait_v2(void);
Joel King824bd1f2012-08-19 12:55:49 -0700162const int cpu_is_krait_v3(void);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700163
164static inline int cpu_is_msm7x01(void)
165{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700166#ifdef CONFIG_ARCH_MSM7X01A
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700167 enum msm_cpu cpu = socinfo_get_msm_cpu();
168
169 BUG_ON(cpu == MSM_CPU_UNKNOWN);
170 return cpu == MSM_CPU_7X01;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700171#else
172 return 0;
173#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700174}
175
176static inline int cpu_is_msm7x25(void)
177{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700178#ifdef CONFIG_ARCH_MSM7X25
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700179 enum msm_cpu cpu = socinfo_get_msm_cpu();
180
181 BUG_ON(cpu == MSM_CPU_UNKNOWN);
182 return cpu == MSM_CPU_7X25;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700183#else
184 return 0;
185#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700186}
187
188static inline int cpu_is_msm7x27(void)
189{
Taniya Das8e352a42012-02-20 16:49:48 +0530190#if defined(CONFIG_ARCH_MSM7X27) && !defined(CONFIG_ARCH_MSM7X27A)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700191 enum msm_cpu cpu = socinfo_get_msm_cpu();
192
193 BUG_ON(cpu == MSM_CPU_UNKNOWN);
194 return cpu == MSM_CPU_7X27;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700195#else
196 return 0;
197#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700198}
199
200static inline int cpu_is_msm7x27a(void)
201{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700202#ifdef CONFIG_ARCH_MSM7X27A
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700203 enum msm_cpu cpu = socinfo_get_msm_cpu();
204
205 BUG_ON(cpu == MSM_CPU_UNKNOWN);
206 return cpu == MSM_CPU_7X27A;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700207#else
208 return 0;
209#endif
210}
211
212static inline int cpu_is_msm7x27aa(void)
213{
214#ifdef CONFIG_ARCH_MSM7X27A
215 enum msm_cpu cpu = socinfo_get_msm_cpu();
216
217 BUG_ON(cpu == MSM_CPU_UNKNOWN);
218 return cpu == MSM_CPU_7X27AA;
219#else
220 return 0;
221#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700222}
223
224static inline int cpu_is_msm7x25a(void)
225{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700226#ifdef CONFIG_ARCH_MSM7X27A
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700227 enum msm_cpu cpu = socinfo_get_msm_cpu();
228
229 BUG_ON(cpu == MSM_CPU_UNKNOWN);
230 return cpu == MSM_CPU_7X25A;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700231#else
232 return 0;
233#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700234}
235
236static inline int cpu_is_msm7x25aa(void)
237{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700238#ifdef CONFIG_ARCH_MSM7X27A
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700239 enum msm_cpu cpu = socinfo_get_msm_cpu();
240
241 BUG_ON(cpu == MSM_CPU_UNKNOWN);
242 return cpu == MSM_CPU_7X25AA;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700243#else
244 return 0;
245#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700246}
247
Pankaj Kumarfee56a82012-04-17 14:26:49 +0530248static inline int cpu_is_msm7x25ab(void)
249{
250#ifdef CONFIG_ARCH_MSM7X27A
251 enum msm_cpu cpu = socinfo_get_msm_cpu();
252
253 BUG_ON(cpu == MSM_CPU_UNKNOWN);
254 return cpu == MSM_CPU_7X25AB;
255#else
256 return 0;
257#endif
258}
259
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700260static inline int cpu_is_msm7x30(void)
261{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700262#ifdef CONFIG_ARCH_MSM7X30
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700263 enum msm_cpu cpu = socinfo_get_msm_cpu();
264
265 BUG_ON(cpu == MSM_CPU_UNKNOWN);
266 return cpu == MSM_CPU_7X30;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700267#else
268 return 0;
269#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700270}
271
272static inline int cpu_is_qsd8x50(void)
273{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700274#ifdef CONFIG_ARCH_QSD8X50
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700275 enum msm_cpu cpu = socinfo_get_msm_cpu();
276
277 BUG_ON(cpu == MSM_CPU_UNKNOWN);
278 return cpu == MSM_CPU_8X50;
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_msm8x55(void)
285{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700286#ifdef CONFIG_ARCH_MSM7X30
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700287 enum msm_cpu cpu = socinfo_get_msm_cpu();
288
289 BUG_ON(cpu == MSM_CPU_UNKNOWN);
290 return cpu == MSM_CPU_8X55;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700291#else
292 return 0;
293#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700294}
295
296static inline int cpu_is_msm8x60(void)
297{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700298#ifdef CONFIG_ARCH_MSM8X60
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700299 return read_msm_cpu_type() == MSM_CPU_8X60;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700300#else
301 return 0;
302#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700303}
304
305static inline int cpu_is_msm8960(void)
306{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700307#ifdef CONFIG_ARCH_MSM8960
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700308 return read_msm_cpu_type() == MSM_CPU_8960;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700309#else
310 return 0;
311#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700312}
313
Stepan Moskovchenkoec6a8032012-07-06 15:42:01 -0700314static inline int cpu_is_msm8960ab(void)
315{
316#ifdef CONFIG_ARCH_MSM8960
317 return read_msm_cpu_type() == MSM_CPU_8960AB;
318#else
319 return 0;
320#endif
321}
322
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700323static inline int cpu_is_apq8064(void)
324{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700325#ifdef CONFIG_ARCH_APQ8064
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700326 return read_msm_cpu_type() == MSM_CPU_8064;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700327#else
328 return 0;
329#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700330}
331
Jay Chokshib2de5092012-09-19 18:28:12 -0700332static inline int cpu_is_apq8064ab(void)
333{
334#ifdef CONFIG_ARCH_APQ8064
335 return read_msm_cpu_type() == MSM_CPU_8064AB;
336#else
337 return 0;
338#endif
339}
340
Jay Chokshif9294742013-01-15 13:06:27 -0800341static inline int cpu_is_apq8064aa(void)
342{
343#ifdef CONFIG_ARCH_APQ8064
344 return read_msm_cpu_type() == MSM_CPU_8064AA;
345#else
346 return 0;
347#endif
348}
349
Stepan Moskovchenkoa8222192011-10-24 18:32:30 -0700350static inline int cpu_is_msm8930(void)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700351{
Stepan Moskovchenkoa8f0a222011-10-24 18:53:17 -0700352#ifdef CONFIG_ARCH_MSM8930
Stepan Moskovchenkoaba208d2012-07-05 20:33:55 -0700353 return read_msm_cpu_type() == MSM_CPU_8930;
Stepan Moskovchenkodb71cd62011-11-23 14:28:57 -0800354#else
355 return 0;
356#endif
357}
358
Stepan Moskovchenko8b38bb32012-07-06 16:57:34 -0700359static inline int cpu_is_msm8930aa(void)
360{
361#ifdef CONFIG_ARCH_MSM8930
362 return read_msm_cpu_type() == MSM_CPU_8930AA;
363#else
364 return 0;
365#endif
366}
367
Stepan Moskovchenkoa03e7612012-10-16 18:34:17 -0700368static inline int cpu_is_msm8930ab(void)
369{
370#ifdef CONFIG_ARCH_MSM8930
371 return read_msm_cpu_type() == MSM_CPU_8930AB;
372#else
373 return 0;
374#endif
375}
376
Stepan Moskovchenkodb71cd62011-11-23 14:28:57 -0800377static inline int cpu_is_msm8627(void)
378{
379/* 8930 and 8627 will share the same CONFIG_ARCH type unless otherwise needed */
380#ifdef CONFIG_ARCH_MSM8930
381 return read_msm_cpu_type() == MSM_CPU_8627;
Stepan Moskovchenkoa8f0a222011-10-24 18:53:17 -0700382#else
383 return 0;
384#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700385}
386
387static inline int cpu_is_fsm9xxx(void)
388{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700389#ifdef CONFIG_ARCH_FSM9XXX
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700390 enum msm_cpu cpu = socinfo_get_msm_cpu();
391
392 BUG_ON(cpu == MSM_CPU_UNKNOWN);
393 return cpu == FSM_CPU_9XXX;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700394#else
395 return 0;
396#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700397}
398
Rohit Vaswani8a28b4a2011-08-10 19:07:00 -0700399static inline int cpu_is_msm9615(void)
400{
401#ifdef CONFIG_ARCH_MSM9615
402 enum msm_cpu cpu = socinfo_get_msm_cpu();
403
404 BUG_ON(cpu == MSM_CPU_UNKNOWN);
405 return cpu == MSM_CPU_9615;
406#else
407 return 0;
408#endif
409}
Taniya Dasa04e1892011-11-16 14:49:12 +0530410
411static inline int cpu_is_msm8625(void)
412{
413#ifdef CONFIG_ARCH_MSM8625
414 enum msm_cpu cpu = socinfo_get_msm_cpu();
415
416 BUG_ON(cpu == MSM_CPU_UNKNOWN);
417 return cpu == MSM_CPU_8625;
418#else
419 return 0;
420#endif
421}
422
Stepan Moskovchenko02c4d0c2012-07-26 14:33:02 -0700423static inline int cpu_is_msm8974(void)
424{
425#ifdef CONFIG_ARCH_MSM8974
426 enum msm_cpu cpu = socinfo_get_msm_cpu();
427
428 BUG_ON(cpu == MSM_CPU_UNKNOWN);
429 return cpu == MSM_CPU_8974;
430#else
431 return 0;
432#endif
433}
434
Ravi Kumar V754282d2012-08-31 22:32:20 +0530435static inline int cpu_is_mpq8092(void)
436{
437#ifdef CONFIG_ARCH_MPQ8092
438 enum msm_cpu cpu = socinfo_get_msm_cpu();
439
440 BUG_ON(cpu == MSM_CPU_UNKNOWN);
441 return cpu == MSM_CPU_8092;
442#else
443 return 0;
444#endif
445
446}
Syed Rameez Mustafad6084d32012-08-23 15:47:50 -0700447
448static inline int cpu_is_msm8226(void)
449{
450#ifdef CONFIG_ARCH_MSM8226
451 enum msm_cpu cpu = socinfo_get_msm_cpu();
452
453 BUG_ON(cpu == MSM_CPU_UNKNOWN);
454 return cpu == MSM_CPU_8226;
455#else
456 return 0;
457#endif
458}
459
Syed Rameez Mustafa3971c142013-01-09 19:04:53 -0800460static inline int cpu_is_msm8610(void)
Syed Rameez Mustafa158d6682012-09-21 18:25:50 -0700461{
Syed Rameez Mustafa3971c142013-01-09 19:04:53 -0800462#ifdef CONFIG_ARCH_MSM8610
Syed Rameez Mustafa158d6682012-09-21 18:25:50 -0700463 enum msm_cpu cpu = socinfo_get_msm_cpu();
464
465 BUG_ON(cpu == MSM_CPU_UNKNOWN);
Syed Rameez Mustafa3971c142013-01-09 19:04:53 -0800466 return cpu == MSM_CPU_8610;
Syed Rameez Mustafa158d6682012-09-21 18:25:50 -0700467#else
468 return 0;
469#endif
470}
Stepan Moskovchenko5b9e7762012-09-21 20:32:17 -0700471
Utsab Bose89b32992012-11-08 11:15:45 +0530472static inline int cpu_is_msm8625q(void)
473{
474#ifdef CONFIG_ARCH_MSM8625
475 enum msm_cpu cpu = socinfo_get_msm_cpu();
476
477 BUG_ON(cpu == MSM_CPU_UNKNOWN);
478 return cpu == MSM_CPU_8625Q;
479#else
480 return 0;
481#endif
482}
483
Stepan Moskovchenko5b9e7762012-09-21 20:32:17 -0700484static inline int soc_class_is_msm8960(void)
485{
486 return cpu_is_msm8960() || cpu_is_msm8960ab();
487}
488
489static inline int soc_class_is_apq8064(void)
490{
Jay Chokshif9294742013-01-15 13:06:27 -0800491 return cpu_is_apq8064() || cpu_is_apq8064ab() || cpu_is_apq8064aa();
Stepan Moskovchenko5b9e7762012-09-21 20:32:17 -0700492}
493
494static inline int soc_class_is_msm8930(void)
495{
Stepan Moskovchenkoecb0d9b2012-10-16 18:35:34 -0700496 return cpu_is_msm8930() || cpu_is_msm8930aa() || cpu_is_msm8930ab() ||
497 cpu_is_msm8627();
Stepan Moskovchenko5b9e7762012-09-21 20:32:17 -0700498}
499
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700500#endif