blob: dc8cbaa9720ab44eacfcf35540bd8641417b3eb6 [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")
Stepan Moskovchenko82f0eab2013-04-02 19:52:28 -070041
Stepan Moskovchenkoa1346e42013-04-03 13:36:18 -070042#define machine_is_msm8974() of_machine_is_compatible("qcom,msm8974")
43#define machine_is_msm9625() of_machine_is_compatible("qcom,msm9625")
44#define machine_is_msm8610() of_machine_is_compatible("qcom,msm8610")
45#define machine_is_msm8226() of_machine_is_compatible("qcom,msm8226")
Asaf Penso1d772412013-05-05 21:31:32 +030046#define machine_is_apq8074() of_machine_is_compatible("qcom,apq8074")
Stepan Moskovchenkoa1346e42013-04-03 13:36:18 -070047
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")
Stepan Moskovchenkoa1346e42013-04-03 13:36:18 -070050#define early_machine_is_mpq8092() \
51 of_flat_dt_is_compatible(of_get_flat_dt_root(), "qcom,mpq8092")
Stepan Moskovchenkoe90cd652013-04-18 12:54:47 -070052#define early_machine_is_apq8084() \
53 of_flat_dt_is_compatible(of_get_flat_dt_root(), "qcom,apq8084")
Abhimanyu Kapur37bea772013-04-11 18:19:38 -070054#define early_machine_is_msmkrypton() \
55 of_flat_dt_is_compatible(of_get_flat_dt_root(), "qcom,msmkrypton")
Rohit Vaswanic3df8b92013-03-20 19:11:15 -070056#define early_machine_is_fsm9900() \
57 of_flat_dt_is_compatible(of_get_flat_dt_root(), "qcom,fsm9900")
Sathish Ambleya99d6852011-10-31 15:50:55 -070058#else
Stepan Moskovchenko82f0eab2013-04-02 19:52:28 -070059#define of_board_is_sim() 0
60#define of_board_is_rumi() 0
61#define of_board_is_fluid() 0
62#define of_board_is_liquid() 0
Asaf Penso1d772412013-05-05 21:31:32 +030063#define of_board_is_dragonboard() 0
Stepan Moskovchenko82f0eab2013-04-02 19:52:28 -070064
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -070065#define machine_is_msm8974() 0
Rohit Vaswani47ee9e92012-04-23 18:42:03 -070066#define machine_is_msm9625() 0
Syed Rameez Mustafa3971c142013-01-09 19:04:53 -080067#define machine_is_msm8610() 0
Stepan Moskovchenkoa1346e42013-04-03 13:36:18 -070068#define machine_is_msm8226() 0
Asaf Penso1d772412013-05-05 21:31:32 +030069#define machine_is_apq8074() 0
Syed Rameez Mustafad6084d32012-08-23 15:47:50 -070070
Stepan Moskovchenkoa1346e42013-04-03 13:36:18 -070071#define early_machine_is_msm8610() 0
72#define early_machine_is_mpq8092() 0
Stepan Moskovchenkoe90cd652013-04-18 12:54:47 -070073#define early_machine_is_apq8084() 0
Abhimanyu Kapur37bea772013-04-11 18:19:38 -070074#define early_machine_is_msmkrypton() 0
Rohit Vaswanic3df8b92013-03-20 19:11:15 -070075#define early_machine_is_fsm9900() 0
Sathish Ambleya99d6852011-10-31 15:50:55 -070076#endif
77
Joel King15ccbfa2013-04-12 17:41:16 -070078#define PLATFORM_SUBTYPE_MDM 1
Stepan Moskovchenko2b4b1cd2012-03-29 18:21:04 -070079#define PLATFORM_SUBTYPE_SGLTE 6
80
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070081enum msm_cpu {
82 MSM_CPU_UNKNOWN = 0,
83 MSM_CPU_7X01,
84 MSM_CPU_7X25,
85 MSM_CPU_7X27,
86 MSM_CPU_8X50,
87 MSM_CPU_8X50A,
88 MSM_CPU_7X30,
89 MSM_CPU_8X55,
90 MSM_CPU_8X60,
91 MSM_CPU_8960,
Stepan Moskovchenkoec6a8032012-07-06 15:42:01 -070092 MSM_CPU_8960AB,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070093 MSM_CPU_7X27A,
94 FSM_CPU_9XXX,
95 MSM_CPU_7X25A,
96 MSM_CPU_7X25AA,
Pankaj Kumarfee56a82012-04-17 14:26:49 +053097 MSM_CPU_7X25AB,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070098 MSM_CPU_8064,
Jay Chokshib2de5092012-09-19 18:28:12 -070099 MSM_CPU_8064AB,
Jay Chokshif9294742013-01-15 13:06:27 -0800100 MSM_CPU_8064AA,
Stepan Moskovchenkoa8222192011-10-24 18:32:30 -0700101 MSM_CPU_8930,
Stepan Moskovchenko8b38bb32012-07-06 16:57:34 -0700102 MSM_CPU_8930AA,
Stepan Moskovchenkoa03e7612012-10-16 18:34:17 -0700103 MSM_CPU_8930AB,
Rohit Vaswani8a28b4a2011-08-10 19:07:00 -0700104 MSM_CPU_7X27AA,
105 MSM_CPU_9615,
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -0700106 MSM_CPU_8974,
Stepan Moskovchenkodb71cd62011-11-23 14:28:57 -0800107 MSM_CPU_8627,
Taniya Dasa04e1892011-11-16 14:49:12 +0530108 MSM_CPU_8625,
Ravi Kumar V754282d2012-08-31 22:32:20 +0530109 MSM_CPU_9625,
Syed Rameez Mustafad6084d32012-08-23 15:47:50 -0700110 MSM_CPU_8092,
Syed Rameez Mustafa158d6682012-09-21 18:25:50 -0700111 MSM_CPU_8226,
Syed Rameez Mustafa3971c142013-01-09 19:04:53 -0800112 MSM_CPU_8610,
Utsab Bose89b32992012-11-08 11:15:45 +0530113 MSM_CPU_8625Q,
Stepan Moskovchenkoe90cd652013-04-18 12:54:47 -0700114 MSM_CPU_8084,
Abhimanyu Kapur37bea772013-04-11 18:19:38 -0700115 MSM_CPU_KRYPTON,
Rohit Vaswanic3df8b92013-03-20 19:11:15 -0700116 FSM_CPU_9900,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700117};
118
Jin Hong9b556c32012-08-13 23:06:26 -0700119enum pmic_model {
120 PMIC_MODEL_PM8058 = 13,
121 PMIC_MODEL_PM8028 = 14,
122 PMIC_MODEL_PM8901 = 15,
123 PMIC_MODEL_PM8027 = 16,
124 PMIC_MODEL_ISL_9519 = 17,
125 PMIC_MODEL_PM8921 = 18,
126 PMIC_MODEL_PM8018 = 19,
127 PMIC_MODEL_PM8015 = 20,
128 PMIC_MODEL_PM8014 = 21,
129 PMIC_MODEL_PM8821 = 22,
130 PMIC_MODEL_PM8038 = 23,
131 PMIC_MODEL_PM8922 = 24,
132 PMIC_MODEL_PM8917 = 25,
133 PMIC_MODEL_UNKNOWN = 0xFFFFFFFF
134};
135
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700136enum msm_cpu socinfo_get_msm_cpu(void);
137uint32_t socinfo_get_id(void);
138uint32_t socinfo_get_version(void);
Pankaj Kumar50c705c2012-01-10 12:02:07 +0530139uint32_t socinfo_get_raw_id(void);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700140char *socinfo_get_build_id(void);
141uint32_t socinfo_get_platform_type(void);
142uint32_t socinfo_get_platform_subtype(void);
143uint32_t socinfo_get_platform_version(void);
Jin Hong9b556c32012-08-13 23:06:26 -0700144enum pmic_model socinfo_get_pmic_model(void);
145uint32_t socinfo_get_pmic_die_revision(void);
Abhimanyu Kapur91a0a502013-01-11 19:24:59 -0800146int __init socinfo_init(void) __must_check;
Stepan Moskovchenkoeff783a2011-08-22 19:01:58 -0700147const int read_msm_cpu_type(void);
148const int get_core_count(void);
Jin Hong12b8b432012-07-18 10:00:31 -0700149const int cpu_is_krait(void);
Stepan Moskovchenko70dc7cf2011-08-22 19:08:42 -0700150const int cpu_is_krait_v1(void);
Jin Hong12b8b432012-07-18 10:00:31 -0700151const int cpu_is_krait_v2(void);
Joel King824bd1f2012-08-19 12:55:49 -0700152const int cpu_is_krait_v3(void);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700153
154static inline int cpu_is_msm7x01(void)
155{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700156#ifdef CONFIG_ARCH_MSM7X01A
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700157 enum msm_cpu cpu = socinfo_get_msm_cpu();
158
159 BUG_ON(cpu == MSM_CPU_UNKNOWN);
160 return cpu == MSM_CPU_7X01;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700161#else
162 return 0;
163#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700164}
165
166static inline int cpu_is_msm7x25(void)
167{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700168#ifdef CONFIG_ARCH_MSM7X25
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700169 enum msm_cpu cpu = socinfo_get_msm_cpu();
170
171 BUG_ON(cpu == MSM_CPU_UNKNOWN);
172 return cpu == MSM_CPU_7X25;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700173#else
174 return 0;
175#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700176}
177
178static inline int cpu_is_msm7x27(void)
179{
Taniya Das8e352a42012-02-20 16:49:48 +0530180#if defined(CONFIG_ARCH_MSM7X27) && !defined(CONFIG_ARCH_MSM7X27A)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700181 enum msm_cpu cpu = socinfo_get_msm_cpu();
182
183 BUG_ON(cpu == MSM_CPU_UNKNOWN);
184 return cpu == MSM_CPU_7X27;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700185#else
186 return 0;
187#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700188}
189
190static inline int cpu_is_msm7x27a(void)
191{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700192#ifdef CONFIG_ARCH_MSM7X27A
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700193 enum msm_cpu cpu = socinfo_get_msm_cpu();
194
195 BUG_ON(cpu == MSM_CPU_UNKNOWN);
196 return cpu == MSM_CPU_7X27A;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700197#else
198 return 0;
199#endif
200}
201
202static inline int cpu_is_msm7x27aa(void)
203{
204#ifdef CONFIG_ARCH_MSM7X27A
205 enum msm_cpu cpu = socinfo_get_msm_cpu();
206
207 BUG_ON(cpu == MSM_CPU_UNKNOWN);
208 return cpu == MSM_CPU_7X27AA;
209#else
210 return 0;
211#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700212}
213
214static inline int cpu_is_msm7x25a(void)
215{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700216#ifdef CONFIG_ARCH_MSM7X27A
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700217 enum msm_cpu cpu = socinfo_get_msm_cpu();
218
219 BUG_ON(cpu == MSM_CPU_UNKNOWN);
220 return cpu == MSM_CPU_7X25A;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700221#else
222 return 0;
223#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700224}
225
226static inline int cpu_is_msm7x25aa(void)
227{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700228#ifdef CONFIG_ARCH_MSM7X27A
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700229 enum msm_cpu cpu = socinfo_get_msm_cpu();
230
231 BUG_ON(cpu == MSM_CPU_UNKNOWN);
232 return cpu == MSM_CPU_7X25AA;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700233#else
234 return 0;
235#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700236}
237
Pankaj Kumarfee56a82012-04-17 14:26:49 +0530238static inline int cpu_is_msm7x25ab(void)
239{
240#ifdef CONFIG_ARCH_MSM7X27A
241 enum msm_cpu cpu = socinfo_get_msm_cpu();
242
243 BUG_ON(cpu == MSM_CPU_UNKNOWN);
244 return cpu == MSM_CPU_7X25AB;
245#else
246 return 0;
247#endif
248}
249
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700250static inline int cpu_is_msm7x30(void)
251{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700252#ifdef CONFIG_ARCH_MSM7X30
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700253 enum msm_cpu cpu = socinfo_get_msm_cpu();
254
255 BUG_ON(cpu == MSM_CPU_UNKNOWN);
256 return cpu == MSM_CPU_7X30;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700257#else
258 return 0;
259#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700260}
261
262static inline int cpu_is_qsd8x50(void)
263{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700264#ifdef CONFIG_ARCH_QSD8X50
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700265 enum msm_cpu cpu = socinfo_get_msm_cpu();
266
267 BUG_ON(cpu == MSM_CPU_UNKNOWN);
268 return cpu == MSM_CPU_8X50;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700269#else
270 return 0;
271#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700272}
273
274static inline int cpu_is_msm8x55(void)
275{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700276#ifdef CONFIG_ARCH_MSM7X30
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700277 enum msm_cpu cpu = socinfo_get_msm_cpu();
278
279 BUG_ON(cpu == MSM_CPU_UNKNOWN);
280 return cpu == MSM_CPU_8X55;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700281#else
282 return 0;
283#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700284}
285
286static inline int cpu_is_msm8x60(void)
287{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700288#ifdef CONFIG_ARCH_MSM8X60
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700289 return read_msm_cpu_type() == MSM_CPU_8X60;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700290#else
291 return 0;
292#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700293}
294
295static inline int cpu_is_msm8960(void)
296{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700297#ifdef CONFIG_ARCH_MSM8960
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700298 return read_msm_cpu_type() == MSM_CPU_8960;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700299#else
300 return 0;
301#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700302}
303
Stepan Moskovchenkoec6a8032012-07-06 15:42:01 -0700304static inline int cpu_is_msm8960ab(void)
305{
306#ifdef CONFIG_ARCH_MSM8960
307 return read_msm_cpu_type() == MSM_CPU_8960AB;
308#else
309 return 0;
310#endif
311}
312
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700313static inline int cpu_is_apq8064(void)
314{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700315#ifdef CONFIG_ARCH_APQ8064
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700316 return read_msm_cpu_type() == MSM_CPU_8064;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700317#else
318 return 0;
319#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700320}
321
Jay Chokshib2de5092012-09-19 18:28:12 -0700322static inline int cpu_is_apq8064ab(void)
323{
324#ifdef CONFIG_ARCH_APQ8064
325 return read_msm_cpu_type() == MSM_CPU_8064AB;
326#else
327 return 0;
328#endif
329}
330
Jay Chokshif9294742013-01-15 13:06:27 -0800331static inline int cpu_is_apq8064aa(void)
332{
333#ifdef CONFIG_ARCH_APQ8064
334 return read_msm_cpu_type() == MSM_CPU_8064AA;
335#else
336 return 0;
337#endif
338}
339
Stepan Moskovchenkoa8222192011-10-24 18:32:30 -0700340static inline int cpu_is_msm8930(void)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700341{
Stepan Moskovchenkoa8f0a222011-10-24 18:53:17 -0700342#ifdef CONFIG_ARCH_MSM8930
Stepan Moskovchenkoaba208d2012-07-05 20:33:55 -0700343 return read_msm_cpu_type() == MSM_CPU_8930;
Stepan Moskovchenkodb71cd62011-11-23 14:28:57 -0800344#else
345 return 0;
346#endif
347}
348
Stepan Moskovchenko8b38bb32012-07-06 16:57:34 -0700349static inline int cpu_is_msm8930aa(void)
350{
351#ifdef CONFIG_ARCH_MSM8930
352 return read_msm_cpu_type() == MSM_CPU_8930AA;
353#else
354 return 0;
355#endif
356}
357
Stepan Moskovchenkoa03e7612012-10-16 18:34:17 -0700358static inline int cpu_is_msm8930ab(void)
359{
360#ifdef CONFIG_ARCH_MSM8930
361 return read_msm_cpu_type() == MSM_CPU_8930AB;
362#else
363 return 0;
364#endif
365}
366
Stepan Moskovchenkodb71cd62011-11-23 14:28:57 -0800367static inline int cpu_is_msm8627(void)
368{
369/* 8930 and 8627 will share the same CONFIG_ARCH type unless otherwise needed */
370#ifdef CONFIG_ARCH_MSM8930
371 return read_msm_cpu_type() == MSM_CPU_8627;
Stepan Moskovchenkoa8f0a222011-10-24 18:53:17 -0700372#else
373 return 0;
374#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700375}
376
377static inline int cpu_is_fsm9xxx(void)
378{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700379#ifdef CONFIG_ARCH_FSM9XXX
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700380 enum msm_cpu cpu = socinfo_get_msm_cpu();
381
382 BUG_ON(cpu == MSM_CPU_UNKNOWN);
383 return cpu == FSM_CPU_9XXX;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700384#else
385 return 0;
386#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700387}
388
Rohit Vaswani8a28b4a2011-08-10 19:07:00 -0700389static inline int cpu_is_msm9615(void)
390{
391#ifdef CONFIG_ARCH_MSM9615
392 enum msm_cpu cpu = socinfo_get_msm_cpu();
393
394 BUG_ON(cpu == MSM_CPU_UNKNOWN);
395 return cpu == MSM_CPU_9615;
396#else
397 return 0;
398#endif
399}
Taniya Dasa04e1892011-11-16 14:49:12 +0530400
401static inline int cpu_is_msm8625(void)
402{
403#ifdef CONFIG_ARCH_MSM8625
404 enum msm_cpu cpu = socinfo_get_msm_cpu();
405
406 BUG_ON(cpu == MSM_CPU_UNKNOWN);
407 return cpu == MSM_CPU_8625;
408#else
409 return 0;
410#endif
411}
412
Stepan Moskovchenko02c4d0c2012-07-26 14:33:02 -0700413static inline int cpu_is_msm8974(void)
414{
415#ifdef CONFIG_ARCH_MSM8974
416 enum msm_cpu cpu = socinfo_get_msm_cpu();
417
418 BUG_ON(cpu == MSM_CPU_UNKNOWN);
419 return cpu == MSM_CPU_8974;
420#else
421 return 0;
422#endif
423}
424
Ravi Kumar V754282d2012-08-31 22:32:20 +0530425static inline int cpu_is_mpq8092(void)
426{
427#ifdef CONFIG_ARCH_MPQ8092
428 enum msm_cpu cpu = socinfo_get_msm_cpu();
429
430 BUG_ON(cpu == MSM_CPU_UNKNOWN);
431 return cpu == MSM_CPU_8092;
432#else
433 return 0;
434#endif
435
436}
Syed Rameez Mustafad6084d32012-08-23 15:47:50 -0700437
438static inline int cpu_is_msm8226(void)
439{
440#ifdef CONFIG_ARCH_MSM8226
441 enum msm_cpu cpu = socinfo_get_msm_cpu();
442
443 BUG_ON(cpu == MSM_CPU_UNKNOWN);
444 return cpu == MSM_CPU_8226;
445#else
446 return 0;
447#endif
448}
449
Syed Rameez Mustafa3971c142013-01-09 19:04:53 -0800450static inline int cpu_is_msm8610(void)
Syed Rameez Mustafa158d6682012-09-21 18:25:50 -0700451{
Syed Rameez Mustafa3971c142013-01-09 19:04:53 -0800452#ifdef CONFIG_ARCH_MSM8610
Syed Rameez Mustafa158d6682012-09-21 18:25:50 -0700453 enum msm_cpu cpu = socinfo_get_msm_cpu();
454
455 BUG_ON(cpu == MSM_CPU_UNKNOWN);
Syed Rameez Mustafa3971c142013-01-09 19:04:53 -0800456 return cpu == MSM_CPU_8610;
Syed Rameez Mustafa158d6682012-09-21 18:25:50 -0700457#else
458 return 0;
459#endif
460}
Stepan Moskovchenko5b9e7762012-09-21 20:32:17 -0700461
Utsab Bose89b32992012-11-08 11:15:45 +0530462static inline int cpu_is_msm8625q(void)
463{
464#ifdef CONFIG_ARCH_MSM8625
465 enum msm_cpu cpu = socinfo_get_msm_cpu();
466
467 BUG_ON(cpu == MSM_CPU_UNKNOWN);
468 return cpu == MSM_CPU_8625Q;
469#else
470 return 0;
471#endif
472}
473
Stepan Moskovchenko5b9e7762012-09-21 20:32:17 -0700474static inline int soc_class_is_msm8960(void)
475{
476 return cpu_is_msm8960() || cpu_is_msm8960ab();
477}
478
479static inline int soc_class_is_apq8064(void)
480{
Jay Chokshif9294742013-01-15 13:06:27 -0800481 return cpu_is_apq8064() || cpu_is_apq8064ab() || cpu_is_apq8064aa();
Stepan Moskovchenko5b9e7762012-09-21 20:32:17 -0700482}
483
484static inline int soc_class_is_msm8930(void)
485{
Stepan Moskovchenkoecb0d9b2012-10-16 18:35:34 -0700486 return cpu_is_msm8930() || cpu_is_msm8930aa() || cpu_is_msm8930ab() ||
487 cpu_is_msm8627();
Stepan Moskovchenko5b9e7762012-09-21 20:32:17 -0700488}
489
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700490#endif