blob: 99bff66ebe491601f71ad5b5fe26fd32a6a8a88c [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")
Jay Chokshieb3e8b62013-05-10 17:33:54 -070058#define early_machine_is_msmsamarium() \
59 of_flat_dt_is_compatible(of_get_flat_dt_root(), "qcom,msmsamarium")
Sathish Ambleya99d6852011-10-31 15:50:55 -070060#else
Stepan Moskovchenko82f0eab2013-04-02 19:52:28 -070061#define of_board_is_sim() 0
62#define of_board_is_rumi() 0
63#define of_board_is_fluid() 0
64#define of_board_is_liquid() 0
Asaf Penso1d772412013-05-05 21:31:32 +030065#define of_board_is_dragonboard() 0
Stepan Moskovchenko82f0eab2013-04-02 19:52:28 -070066
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -070067#define machine_is_msm8974() 0
Rohit Vaswani47ee9e92012-04-23 18:42:03 -070068#define machine_is_msm9625() 0
Syed Rameez Mustafa3971c142013-01-09 19:04:53 -080069#define machine_is_msm8610() 0
Stepan Moskovchenkoa1346e42013-04-03 13:36:18 -070070#define machine_is_msm8226() 0
Asaf Penso1d772412013-05-05 21:31:32 +030071#define machine_is_apq8074() 0
Syed Rameez Mustafad6084d32012-08-23 15:47:50 -070072
Stepan Moskovchenkoa1346e42013-04-03 13:36:18 -070073#define early_machine_is_msm8610() 0
74#define early_machine_is_mpq8092() 0
Stepan Moskovchenkoe90cd652013-04-18 12:54:47 -070075#define early_machine_is_apq8084() 0
Abhimanyu Kapur37bea772013-04-11 18:19:38 -070076#define early_machine_is_msmkrypton() 0
Rohit Vaswanic3df8b92013-03-20 19:11:15 -070077#define early_machine_is_fsm9900() 0
Jay Chokshieb3e8b62013-05-10 17:33:54 -070078#define early_machine_is_msmsamarium() 0
Sathish Ambleya99d6852011-10-31 15:50:55 -070079#endif
80
Joel King15ccbfa2013-04-12 17:41:16 -070081#define PLATFORM_SUBTYPE_MDM 1
Stepan Moskovchenko2b4b1cd2012-03-29 18:21:04 -070082#define PLATFORM_SUBTYPE_SGLTE 6
83
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070084enum msm_cpu {
85 MSM_CPU_UNKNOWN = 0,
86 MSM_CPU_7X01,
87 MSM_CPU_7X25,
88 MSM_CPU_7X27,
89 MSM_CPU_8X50,
90 MSM_CPU_8X50A,
91 MSM_CPU_7X30,
92 MSM_CPU_8X55,
93 MSM_CPU_8X60,
94 MSM_CPU_8960,
Stepan Moskovchenkoec6a8032012-07-06 15:42:01 -070095 MSM_CPU_8960AB,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070096 MSM_CPU_7X27A,
97 FSM_CPU_9XXX,
98 MSM_CPU_7X25A,
99 MSM_CPU_7X25AA,
Pankaj Kumarfee56a82012-04-17 14:26:49 +0530100 MSM_CPU_7X25AB,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700101 MSM_CPU_8064,
Jay Chokshib2de5092012-09-19 18:28:12 -0700102 MSM_CPU_8064AB,
Jay Chokshif9294742013-01-15 13:06:27 -0800103 MSM_CPU_8064AA,
Stepan Moskovchenkoa8222192011-10-24 18:32:30 -0700104 MSM_CPU_8930,
Stepan Moskovchenko8b38bb32012-07-06 16:57:34 -0700105 MSM_CPU_8930AA,
Stepan Moskovchenkoa03e7612012-10-16 18:34:17 -0700106 MSM_CPU_8930AB,
Rohit Vaswani8a28b4a2011-08-10 19:07:00 -0700107 MSM_CPU_7X27AA,
108 MSM_CPU_9615,
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -0700109 MSM_CPU_8974,
Stepan Moskovchenkodb71cd62011-11-23 14:28:57 -0800110 MSM_CPU_8627,
Taniya Dasa04e1892011-11-16 14:49:12 +0530111 MSM_CPU_8625,
Ravi Kumar V754282d2012-08-31 22:32:20 +0530112 MSM_CPU_9625,
Syed Rameez Mustafad6084d32012-08-23 15:47:50 -0700113 MSM_CPU_8092,
Syed Rameez Mustafa158d6682012-09-21 18:25:50 -0700114 MSM_CPU_8226,
Syed Rameez Mustafa3971c142013-01-09 19:04:53 -0800115 MSM_CPU_8610,
Utsab Bose89b32992012-11-08 11:15:45 +0530116 MSM_CPU_8625Q,
Stepan Moskovchenkoe90cd652013-04-18 12:54:47 -0700117 MSM_CPU_8084,
Abhimanyu Kapur37bea772013-04-11 18:19:38 -0700118 MSM_CPU_KRYPTON,
Rohit Vaswanic3df8b92013-03-20 19:11:15 -0700119 FSM_CPU_9900,
Jay Chokshieb3e8b62013-05-10 17:33:54 -0700120 MSM_CPU_SAMARIUM,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700121};
122
Jin Hong9b556c32012-08-13 23:06:26 -0700123enum pmic_model {
124 PMIC_MODEL_PM8058 = 13,
125 PMIC_MODEL_PM8028 = 14,
126 PMIC_MODEL_PM8901 = 15,
127 PMIC_MODEL_PM8027 = 16,
128 PMIC_MODEL_ISL_9519 = 17,
129 PMIC_MODEL_PM8921 = 18,
130 PMIC_MODEL_PM8018 = 19,
131 PMIC_MODEL_PM8015 = 20,
132 PMIC_MODEL_PM8014 = 21,
133 PMIC_MODEL_PM8821 = 22,
134 PMIC_MODEL_PM8038 = 23,
135 PMIC_MODEL_PM8922 = 24,
136 PMIC_MODEL_PM8917 = 25,
137 PMIC_MODEL_UNKNOWN = 0xFFFFFFFF
138};
139
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700140enum msm_cpu socinfo_get_msm_cpu(void);
141uint32_t socinfo_get_id(void);
142uint32_t socinfo_get_version(void);
Pankaj Kumar50c705c2012-01-10 12:02:07 +0530143uint32_t socinfo_get_raw_id(void);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700144char *socinfo_get_build_id(void);
145uint32_t socinfo_get_platform_type(void);
146uint32_t socinfo_get_platform_subtype(void);
147uint32_t socinfo_get_platform_version(void);
Jin Hong9b556c32012-08-13 23:06:26 -0700148enum pmic_model socinfo_get_pmic_model(void);
149uint32_t socinfo_get_pmic_die_revision(void);
Abhimanyu Kapur91a0a502013-01-11 19:24:59 -0800150int __init socinfo_init(void) __must_check;
Stepan Moskovchenkoeff783a2011-08-22 19:01:58 -0700151const int read_msm_cpu_type(void);
152const int get_core_count(void);
Jin Hong12b8b432012-07-18 10:00:31 -0700153const int cpu_is_krait(void);
Stepan Moskovchenko70dc7cf2011-08-22 19:08:42 -0700154const int cpu_is_krait_v1(void);
Jin Hong12b8b432012-07-18 10:00:31 -0700155const int cpu_is_krait_v2(void);
Joel King824bd1f2012-08-19 12:55:49 -0700156const int cpu_is_krait_v3(void);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700157
158static inline int cpu_is_msm7x01(void)
159{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700160#ifdef CONFIG_ARCH_MSM7X01A
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700161 enum msm_cpu cpu = socinfo_get_msm_cpu();
162
163 BUG_ON(cpu == MSM_CPU_UNKNOWN);
164 return cpu == MSM_CPU_7X01;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700165#else
166 return 0;
167#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700168}
169
170static inline int cpu_is_msm7x25(void)
171{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700172#ifdef CONFIG_ARCH_MSM7X25
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700173 enum msm_cpu cpu = socinfo_get_msm_cpu();
174
175 BUG_ON(cpu == MSM_CPU_UNKNOWN);
176 return cpu == MSM_CPU_7X25;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700177#else
178 return 0;
179#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700180}
181
182static inline int cpu_is_msm7x27(void)
183{
Taniya Das8e352a42012-02-20 16:49:48 +0530184#if defined(CONFIG_ARCH_MSM7X27) && !defined(CONFIG_ARCH_MSM7X27A)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700185 enum msm_cpu cpu = socinfo_get_msm_cpu();
186
187 BUG_ON(cpu == MSM_CPU_UNKNOWN);
188 return cpu == MSM_CPU_7X27;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700189#else
190 return 0;
191#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700192}
193
194static inline int cpu_is_msm7x27a(void)
195{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700196#ifdef CONFIG_ARCH_MSM7X27A
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700197 enum msm_cpu cpu = socinfo_get_msm_cpu();
198
199 BUG_ON(cpu == MSM_CPU_UNKNOWN);
200 return cpu == MSM_CPU_7X27A;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700201#else
202 return 0;
203#endif
204}
205
206static inline int cpu_is_msm7x27aa(void)
207{
208#ifdef CONFIG_ARCH_MSM7X27A
209 enum msm_cpu cpu = socinfo_get_msm_cpu();
210
211 BUG_ON(cpu == MSM_CPU_UNKNOWN);
212 return cpu == MSM_CPU_7X27AA;
213#else
214 return 0;
215#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700216}
217
218static inline int cpu_is_msm7x25a(void)
219{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700220#ifdef CONFIG_ARCH_MSM7X27A
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700221 enum msm_cpu cpu = socinfo_get_msm_cpu();
222
223 BUG_ON(cpu == MSM_CPU_UNKNOWN);
224 return cpu == MSM_CPU_7X25A;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700225#else
226 return 0;
227#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700228}
229
230static inline int cpu_is_msm7x25aa(void)
231{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700232#ifdef CONFIG_ARCH_MSM7X27A
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700233 enum msm_cpu cpu = socinfo_get_msm_cpu();
234
235 BUG_ON(cpu == MSM_CPU_UNKNOWN);
236 return cpu == MSM_CPU_7X25AA;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700237#else
238 return 0;
239#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700240}
241
Pankaj Kumarfee56a82012-04-17 14:26:49 +0530242static inline int cpu_is_msm7x25ab(void)
243{
244#ifdef CONFIG_ARCH_MSM7X27A
245 enum msm_cpu cpu = socinfo_get_msm_cpu();
246
247 BUG_ON(cpu == MSM_CPU_UNKNOWN);
248 return cpu == MSM_CPU_7X25AB;
249#else
250 return 0;
251#endif
252}
253
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700254static inline int cpu_is_msm7x30(void)
255{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700256#ifdef CONFIG_ARCH_MSM7X30
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700257 enum msm_cpu cpu = socinfo_get_msm_cpu();
258
259 BUG_ON(cpu == MSM_CPU_UNKNOWN);
260 return cpu == MSM_CPU_7X30;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700261#else
262 return 0;
263#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700264}
265
266static inline int cpu_is_qsd8x50(void)
267{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700268#ifdef CONFIG_ARCH_QSD8X50
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700269 enum msm_cpu cpu = socinfo_get_msm_cpu();
270
271 BUG_ON(cpu == MSM_CPU_UNKNOWN);
272 return cpu == MSM_CPU_8X50;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700273#else
274 return 0;
275#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700276}
277
278static inline int cpu_is_msm8x55(void)
279{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700280#ifdef CONFIG_ARCH_MSM7X30
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700281 enum msm_cpu cpu = socinfo_get_msm_cpu();
282
283 BUG_ON(cpu == MSM_CPU_UNKNOWN);
284 return cpu == MSM_CPU_8X55;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700285#else
286 return 0;
287#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700288}
289
290static inline int cpu_is_msm8x60(void)
291{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700292#ifdef CONFIG_ARCH_MSM8X60
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700293 return read_msm_cpu_type() == MSM_CPU_8X60;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700294#else
295 return 0;
296#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700297}
298
299static inline int cpu_is_msm8960(void)
300{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700301#ifdef CONFIG_ARCH_MSM8960
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700302 return read_msm_cpu_type() == MSM_CPU_8960;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700303#else
304 return 0;
305#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700306}
307
Stepan Moskovchenkoec6a8032012-07-06 15:42:01 -0700308static inline int cpu_is_msm8960ab(void)
309{
310#ifdef CONFIG_ARCH_MSM8960
311 return read_msm_cpu_type() == MSM_CPU_8960AB;
312#else
313 return 0;
314#endif
315}
316
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700317static inline int cpu_is_apq8064(void)
318{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700319#ifdef CONFIG_ARCH_APQ8064
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700320 return read_msm_cpu_type() == MSM_CPU_8064;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700321#else
322 return 0;
323#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700324}
325
Jay Chokshib2de5092012-09-19 18:28:12 -0700326static inline int cpu_is_apq8064ab(void)
327{
328#ifdef CONFIG_ARCH_APQ8064
329 return read_msm_cpu_type() == MSM_CPU_8064AB;
330#else
331 return 0;
332#endif
333}
334
Jay Chokshif9294742013-01-15 13:06:27 -0800335static inline int cpu_is_apq8064aa(void)
336{
337#ifdef CONFIG_ARCH_APQ8064
338 return read_msm_cpu_type() == MSM_CPU_8064AA;
339#else
340 return 0;
341#endif
342}
343
Stepan Moskovchenkoa8222192011-10-24 18:32:30 -0700344static inline int cpu_is_msm8930(void)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700345{
Stepan Moskovchenkoa8f0a222011-10-24 18:53:17 -0700346#ifdef CONFIG_ARCH_MSM8930
Stepan Moskovchenkoaba208d2012-07-05 20:33:55 -0700347 return read_msm_cpu_type() == MSM_CPU_8930;
Stepan Moskovchenkodb71cd62011-11-23 14:28:57 -0800348#else
349 return 0;
350#endif
351}
352
Stepan Moskovchenko8b38bb32012-07-06 16:57:34 -0700353static inline int cpu_is_msm8930aa(void)
354{
355#ifdef CONFIG_ARCH_MSM8930
356 return read_msm_cpu_type() == MSM_CPU_8930AA;
357#else
358 return 0;
359#endif
360}
361
Stepan Moskovchenkoa03e7612012-10-16 18:34:17 -0700362static inline int cpu_is_msm8930ab(void)
363{
364#ifdef CONFIG_ARCH_MSM8930
365 return read_msm_cpu_type() == MSM_CPU_8930AB;
366#else
367 return 0;
368#endif
369}
370
Stepan Moskovchenkodb71cd62011-11-23 14:28:57 -0800371static inline int cpu_is_msm8627(void)
372{
373/* 8930 and 8627 will share the same CONFIG_ARCH type unless otherwise needed */
374#ifdef CONFIG_ARCH_MSM8930
375 return read_msm_cpu_type() == MSM_CPU_8627;
Stepan Moskovchenkoa8f0a222011-10-24 18:53:17 -0700376#else
377 return 0;
378#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700379}
380
381static inline int cpu_is_fsm9xxx(void)
382{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700383#ifdef CONFIG_ARCH_FSM9XXX
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700384 enum msm_cpu cpu = socinfo_get_msm_cpu();
385
386 BUG_ON(cpu == MSM_CPU_UNKNOWN);
387 return cpu == FSM_CPU_9XXX;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700388#else
389 return 0;
390#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700391}
392
Rohit Vaswani8a28b4a2011-08-10 19:07:00 -0700393static inline int cpu_is_msm9615(void)
394{
395#ifdef CONFIG_ARCH_MSM9615
396 enum msm_cpu cpu = socinfo_get_msm_cpu();
397
398 BUG_ON(cpu == MSM_CPU_UNKNOWN);
399 return cpu == MSM_CPU_9615;
400#else
401 return 0;
402#endif
403}
Taniya Dasa04e1892011-11-16 14:49:12 +0530404
405static inline int cpu_is_msm8625(void)
406{
407#ifdef CONFIG_ARCH_MSM8625
408 enum msm_cpu cpu = socinfo_get_msm_cpu();
409
410 BUG_ON(cpu == MSM_CPU_UNKNOWN);
411 return cpu == MSM_CPU_8625;
412#else
413 return 0;
414#endif
415}
416
Stepan Moskovchenko02c4d0c2012-07-26 14:33:02 -0700417static inline int cpu_is_msm8974(void)
418{
419#ifdef CONFIG_ARCH_MSM8974
420 enum msm_cpu cpu = socinfo_get_msm_cpu();
421
422 BUG_ON(cpu == MSM_CPU_UNKNOWN);
423 return cpu == MSM_CPU_8974;
424#else
425 return 0;
426#endif
427}
428
Ravi Kumar V754282d2012-08-31 22:32:20 +0530429static inline int cpu_is_mpq8092(void)
430{
431#ifdef CONFIG_ARCH_MPQ8092
432 enum msm_cpu cpu = socinfo_get_msm_cpu();
433
434 BUG_ON(cpu == MSM_CPU_UNKNOWN);
435 return cpu == MSM_CPU_8092;
436#else
437 return 0;
438#endif
439
440}
Syed Rameez Mustafad6084d32012-08-23 15:47:50 -0700441
442static inline int cpu_is_msm8226(void)
443{
444#ifdef CONFIG_ARCH_MSM8226
445 enum msm_cpu cpu = socinfo_get_msm_cpu();
446
447 BUG_ON(cpu == MSM_CPU_UNKNOWN);
448 return cpu == MSM_CPU_8226;
449#else
450 return 0;
451#endif
452}
453
Syed Rameez Mustafa3971c142013-01-09 19:04:53 -0800454static inline int cpu_is_msm8610(void)
Syed Rameez Mustafa158d6682012-09-21 18:25:50 -0700455{
Syed Rameez Mustafa3971c142013-01-09 19:04:53 -0800456#ifdef CONFIG_ARCH_MSM8610
Syed Rameez Mustafa158d6682012-09-21 18:25:50 -0700457 enum msm_cpu cpu = socinfo_get_msm_cpu();
458
459 BUG_ON(cpu == MSM_CPU_UNKNOWN);
Syed Rameez Mustafa3971c142013-01-09 19:04:53 -0800460 return cpu == MSM_CPU_8610;
Syed Rameez Mustafa158d6682012-09-21 18:25:50 -0700461#else
462 return 0;
463#endif
464}
Stepan Moskovchenko5b9e7762012-09-21 20:32:17 -0700465
Utsab Bose89b32992012-11-08 11:15:45 +0530466static inline int cpu_is_msm8625q(void)
467{
468#ifdef CONFIG_ARCH_MSM8625
469 enum msm_cpu cpu = socinfo_get_msm_cpu();
470
471 BUG_ON(cpu == MSM_CPU_UNKNOWN);
472 return cpu == MSM_CPU_8625Q;
473#else
474 return 0;
475#endif
476}
477
Stepan Moskovchenko5b9e7762012-09-21 20:32:17 -0700478static inline int soc_class_is_msm8960(void)
479{
480 return cpu_is_msm8960() || cpu_is_msm8960ab();
481}
482
483static inline int soc_class_is_apq8064(void)
484{
Jay Chokshif9294742013-01-15 13:06:27 -0800485 return cpu_is_apq8064() || cpu_is_apq8064ab() || cpu_is_apq8064aa();
Stepan Moskovchenko5b9e7762012-09-21 20:32:17 -0700486}
487
488static inline int soc_class_is_msm8930(void)
489{
Stepan Moskovchenkoecb0d9b2012-10-16 18:35:34 -0700490 return cpu_is_msm8930() || cpu_is_msm8930aa() || cpu_is_msm8930ab() ||
491 cpu_is_msm8627();
Stepan Moskovchenko5b9e7762012-09-21 20:32:17 -0700492}
493
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700494#endif