blob: d52686cdf60d0f93b044237841444133da6532e8 [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")
Syed Rameez Mustafa79717332013-06-06 15:20:38 -070044#define of_board_is_xpm() of_machine_is_compatible("qcom,xpm")
Stepan Moskovchenko82f0eab2013-04-02 19:52:28 -070045
Stepan Moskovchenkoa1346e42013-04-03 13:36:18 -070046#define machine_is_msm8974() of_machine_is_compatible("qcom,msm8974")
47#define machine_is_msm9625() of_machine_is_compatible("qcom,msm9625")
48#define machine_is_msm8610() of_machine_is_compatible("qcom,msm8610")
49#define machine_is_msm8226() of_machine_is_compatible("qcom,msm8226")
Asaf Penso1d772412013-05-05 21:31:32 +030050#define machine_is_apq8074() of_machine_is_compatible("qcom,apq8074")
Stepan Moskovchenkoa1346e42013-04-03 13:36:18 -070051
Syed Rameez Mustafa3971c142013-01-09 19:04:53 -080052#define early_machine_is_msm8610() \
53 of_flat_dt_is_compatible(of_get_flat_dt_root(), "qcom,msm8610")
Stepan Moskovchenkoa1346e42013-04-03 13:36:18 -070054#define early_machine_is_mpq8092() \
55 of_flat_dt_is_compatible(of_get_flat_dt_root(), "qcom,mpq8092")
Stepan Moskovchenkoe90cd652013-04-18 12:54:47 -070056#define early_machine_is_apq8084() \
57 of_flat_dt_is_compatible(of_get_flat_dt_root(), "qcom,apq8084")
Abhimanyu Kapur37bea772013-04-11 18:19:38 -070058#define early_machine_is_msmkrypton() \
59 of_flat_dt_is_compatible(of_get_flat_dt_root(), "qcom,msmkrypton")
Rohit Vaswanic3df8b92013-03-20 19:11:15 -070060#define early_machine_is_fsm9900() \
61 of_flat_dt_is_compatible(of_get_flat_dt_root(), "qcom,fsm9900")
Jay Chokshieb3e8b62013-05-10 17:33:54 -070062#define early_machine_is_msmsamarium() \
63 of_flat_dt_is_compatible(of_get_flat_dt_root(), "qcom,msmsamarium")
Sathish Ambleya99d6852011-10-31 15:50:55 -070064#else
Stepan Moskovchenko82f0eab2013-04-02 19:52:28 -070065#define of_board_is_sim() 0
66#define of_board_is_rumi() 0
67#define of_board_is_fluid() 0
68#define of_board_is_liquid() 0
Asaf Penso1d772412013-05-05 21:31:32 +030069#define of_board_is_dragonboard() 0
David Collins722299b2013-05-29 13:53:14 -070070#define of_board_is_cdp() 0
71#define of_board_is_mtp() 0
72#define of_board_is_qrd() 0
Syed Rameez Mustafa79717332013-06-06 15:20:38 -070073#define of_board_is_xpm() 0
Stepan Moskovchenko82f0eab2013-04-02 19:52:28 -070074
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -070075#define machine_is_msm8974() 0
Rohit Vaswani47ee9e92012-04-23 18:42:03 -070076#define machine_is_msm9625() 0
Syed Rameez Mustafa3971c142013-01-09 19:04:53 -080077#define machine_is_msm8610() 0
Stepan Moskovchenkoa1346e42013-04-03 13:36:18 -070078#define machine_is_msm8226() 0
Asaf Penso1d772412013-05-05 21:31:32 +030079#define machine_is_apq8074() 0
Syed Rameez Mustafad6084d32012-08-23 15:47:50 -070080
Stepan Moskovchenkoa1346e42013-04-03 13:36:18 -070081#define early_machine_is_msm8610() 0
82#define early_machine_is_mpq8092() 0
Stepan Moskovchenkoe90cd652013-04-18 12:54:47 -070083#define early_machine_is_apq8084() 0
Abhimanyu Kapur37bea772013-04-11 18:19:38 -070084#define early_machine_is_msmkrypton() 0
Rohit Vaswanic3df8b92013-03-20 19:11:15 -070085#define early_machine_is_fsm9900() 0
Jay Chokshieb3e8b62013-05-10 17:33:54 -070086#define early_machine_is_msmsamarium() 0
Sathish Ambleya99d6852011-10-31 15:50:55 -070087#endif
88
Joel King15ccbfa2013-04-12 17:41:16 -070089#define PLATFORM_SUBTYPE_MDM 1
Stepan Moskovchenko2b4b1cd2012-03-29 18:21:04 -070090#define PLATFORM_SUBTYPE_SGLTE 6
91
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070092enum msm_cpu {
93 MSM_CPU_UNKNOWN = 0,
94 MSM_CPU_7X01,
95 MSM_CPU_7X25,
96 MSM_CPU_7X27,
97 MSM_CPU_8X50,
98 MSM_CPU_8X50A,
99 MSM_CPU_7X30,
100 MSM_CPU_8X55,
101 MSM_CPU_8X60,
102 MSM_CPU_8960,
Stepan Moskovchenkoec6a8032012-07-06 15:42:01 -0700103 MSM_CPU_8960AB,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700104 MSM_CPU_7X27A,
105 FSM_CPU_9XXX,
106 MSM_CPU_7X25A,
107 MSM_CPU_7X25AA,
Pankaj Kumarfee56a82012-04-17 14:26:49 +0530108 MSM_CPU_7X25AB,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700109 MSM_CPU_8064,
Jay Chokshib2de5092012-09-19 18:28:12 -0700110 MSM_CPU_8064AB,
Jay Chokshif9294742013-01-15 13:06:27 -0800111 MSM_CPU_8064AA,
Stepan Moskovchenkoa8222192011-10-24 18:32:30 -0700112 MSM_CPU_8930,
Stepan Moskovchenko8b38bb32012-07-06 16:57:34 -0700113 MSM_CPU_8930AA,
Stepan Moskovchenkoa03e7612012-10-16 18:34:17 -0700114 MSM_CPU_8930AB,
Rohit Vaswani8a28b4a2011-08-10 19:07:00 -0700115 MSM_CPU_7X27AA,
116 MSM_CPU_9615,
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -0700117 MSM_CPU_8974,
Stepan Moskovchenkodb71cd62011-11-23 14:28:57 -0800118 MSM_CPU_8627,
Taniya Dasa04e1892011-11-16 14:49:12 +0530119 MSM_CPU_8625,
Ravi Kumar V754282d2012-08-31 22:32:20 +0530120 MSM_CPU_9625,
Syed Rameez Mustafad6084d32012-08-23 15:47:50 -0700121 MSM_CPU_8092,
Syed Rameez Mustafa158d6682012-09-21 18:25:50 -0700122 MSM_CPU_8226,
Syed Rameez Mustafa3971c142013-01-09 19:04:53 -0800123 MSM_CPU_8610,
Utsab Bose89b32992012-11-08 11:15:45 +0530124 MSM_CPU_8625Q,
Stepan Moskovchenkoe90cd652013-04-18 12:54:47 -0700125 MSM_CPU_8084,
Abhimanyu Kapur37bea772013-04-11 18:19:38 -0700126 MSM_CPU_KRYPTON,
Rohit Vaswanic3df8b92013-03-20 19:11:15 -0700127 FSM_CPU_9900,
Jay Chokshieb3e8b62013-05-10 17:33:54 -0700128 MSM_CPU_SAMARIUM,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700129};
130
Jin Hong9b556c32012-08-13 23:06:26 -0700131enum pmic_model {
132 PMIC_MODEL_PM8058 = 13,
133 PMIC_MODEL_PM8028 = 14,
134 PMIC_MODEL_PM8901 = 15,
135 PMIC_MODEL_PM8027 = 16,
136 PMIC_MODEL_ISL_9519 = 17,
137 PMIC_MODEL_PM8921 = 18,
138 PMIC_MODEL_PM8018 = 19,
139 PMIC_MODEL_PM8015 = 20,
140 PMIC_MODEL_PM8014 = 21,
141 PMIC_MODEL_PM8821 = 22,
142 PMIC_MODEL_PM8038 = 23,
143 PMIC_MODEL_PM8922 = 24,
144 PMIC_MODEL_PM8917 = 25,
145 PMIC_MODEL_UNKNOWN = 0xFFFFFFFF
146};
147
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700148enum msm_cpu socinfo_get_msm_cpu(void);
149uint32_t socinfo_get_id(void);
150uint32_t socinfo_get_version(void);
Pankaj Kumar50c705c2012-01-10 12:02:07 +0530151uint32_t socinfo_get_raw_id(void);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700152char *socinfo_get_build_id(void);
153uint32_t socinfo_get_platform_type(void);
154uint32_t socinfo_get_platform_subtype(void);
155uint32_t socinfo_get_platform_version(void);
Jin Hong9b556c32012-08-13 23:06:26 -0700156enum pmic_model socinfo_get_pmic_model(void);
157uint32_t socinfo_get_pmic_die_revision(void);
Abhimanyu Kapur91a0a502013-01-11 19:24:59 -0800158int __init socinfo_init(void) __must_check;
Stepan Moskovchenkoeff783a2011-08-22 19:01:58 -0700159const int read_msm_cpu_type(void);
160const int get_core_count(void);
Jin Hong12b8b432012-07-18 10:00:31 -0700161const int cpu_is_krait(void);
Stepan Moskovchenko70dc7cf2011-08-22 19:08:42 -0700162const int cpu_is_krait_v1(void);
Jin Hong12b8b432012-07-18 10:00:31 -0700163const int cpu_is_krait_v2(void);
Joel King824bd1f2012-08-19 12:55:49 -0700164const int cpu_is_krait_v3(void);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700165
166static inline int cpu_is_msm7x01(void)
167{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700168#ifdef CONFIG_ARCH_MSM7X01A
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_7X01;
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_msm7x25(void)
179{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700180#ifdef CONFIG_ARCH_MSM7X25
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_7X25;
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_msm7x27(void)
191{
Taniya Das8e352a42012-02-20 16:49:48 +0530192#if defined(CONFIG_ARCH_MSM7X27) && !defined(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_7X27;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700197#else
198 return 0;
199#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700200}
201
202static inline int cpu_is_msm7x27a(void)
203{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700204#ifdef CONFIG_ARCH_MSM7X27A
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700205 enum msm_cpu cpu = socinfo_get_msm_cpu();
206
207 BUG_ON(cpu == MSM_CPU_UNKNOWN);
208 return cpu == MSM_CPU_7X27A;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700209#else
210 return 0;
211#endif
212}
213
214static inline int cpu_is_msm7x27aa(void)
215{
216#ifdef CONFIG_ARCH_MSM7X27A
217 enum msm_cpu cpu = socinfo_get_msm_cpu();
218
219 BUG_ON(cpu == MSM_CPU_UNKNOWN);
220 return cpu == MSM_CPU_7X27AA;
221#else
222 return 0;
223#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700224}
225
226static inline int cpu_is_msm7x25a(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_7X25A;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700233#else
234 return 0;
235#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700236}
237
238static inline int cpu_is_msm7x25aa(void)
239{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700240#ifdef CONFIG_ARCH_MSM7X27A
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700241 enum msm_cpu cpu = socinfo_get_msm_cpu();
242
243 BUG_ON(cpu == MSM_CPU_UNKNOWN);
244 return cpu == MSM_CPU_7X25AA;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700245#else
246 return 0;
247#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700248}
249
Pankaj Kumarfee56a82012-04-17 14:26:49 +0530250static inline int cpu_is_msm7x25ab(void)
251{
252#ifdef CONFIG_ARCH_MSM7X27A
253 enum msm_cpu cpu = socinfo_get_msm_cpu();
254
255 BUG_ON(cpu == MSM_CPU_UNKNOWN);
256 return cpu == MSM_CPU_7X25AB;
257#else
258 return 0;
259#endif
260}
261
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700262static inline int cpu_is_msm7x30(void)
263{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700264#ifdef CONFIG_ARCH_MSM7X30
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_7X30;
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_qsd8x50(void)
275{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700276#ifdef CONFIG_ARCH_QSD8X50
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_8X50;
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_msm8x55(void)
287{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700288#ifdef CONFIG_ARCH_MSM7X30
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700289 enum msm_cpu cpu = socinfo_get_msm_cpu();
290
291 BUG_ON(cpu == MSM_CPU_UNKNOWN);
292 return cpu == MSM_CPU_8X55;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700293#else
294 return 0;
295#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700296}
297
298static inline int cpu_is_msm8x60(void)
299{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700300#ifdef CONFIG_ARCH_MSM8X60
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700301 return read_msm_cpu_type() == MSM_CPU_8X60;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700302#else
303 return 0;
304#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700305}
306
307static inline int cpu_is_msm8960(void)
308{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700309#ifdef CONFIG_ARCH_MSM8960
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700310 return read_msm_cpu_type() == MSM_CPU_8960;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700311#else
312 return 0;
313#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700314}
315
Stepan Moskovchenkoec6a8032012-07-06 15:42:01 -0700316static inline int cpu_is_msm8960ab(void)
317{
318#ifdef CONFIG_ARCH_MSM8960
319 return read_msm_cpu_type() == MSM_CPU_8960AB;
320#else
321 return 0;
322#endif
323}
324
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700325static inline int cpu_is_apq8064(void)
326{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700327#ifdef CONFIG_ARCH_APQ8064
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700328 return read_msm_cpu_type() == MSM_CPU_8064;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700329#else
330 return 0;
331#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700332}
333
Jay Chokshib2de5092012-09-19 18:28:12 -0700334static inline int cpu_is_apq8064ab(void)
335{
336#ifdef CONFIG_ARCH_APQ8064
337 return read_msm_cpu_type() == MSM_CPU_8064AB;
338#else
339 return 0;
340#endif
341}
342
Jay Chokshif9294742013-01-15 13:06:27 -0800343static inline int cpu_is_apq8064aa(void)
344{
345#ifdef CONFIG_ARCH_APQ8064
346 return read_msm_cpu_type() == MSM_CPU_8064AA;
347#else
348 return 0;
349#endif
350}
351
Stepan Moskovchenkoa8222192011-10-24 18:32:30 -0700352static inline int cpu_is_msm8930(void)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700353{
Stepan Moskovchenkoa8f0a222011-10-24 18:53:17 -0700354#ifdef CONFIG_ARCH_MSM8930
Stepan Moskovchenkoaba208d2012-07-05 20:33:55 -0700355 return read_msm_cpu_type() == MSM_CPU_8930;
Stepan Moskovchenkodb71cd62011-11-23 14:28:57 -0800356#else
357 return 0;
358#endif
359}
360
Stepan Moskovchenko8b38bb32012-07-06 16:57:34 -0700361static inline int cpu_is_msm8930aa(void)
362{
363#ifdef CONFIG_ARCH_MSM8930
364 return read_msm_cpu_type() == MSM_CPU_8930AA;
365#else
366 return 0;
367#endif
368}
369
Stepan Moskovchenkoa03e7612012-10-16 18:34:17 -0700370static inline int cpu_is_msm8930ab(void)
371{
372#ifdef CONFIG_ARCH_MSM8930
373 return read_msm_cpu_type() == MSM_CPU_8930AB;
374#else
375 return 0;
376#endif
377}
378
Stepan Moskovchenkodb71cd62011-11-23 14:28:57 -0800379static inline int cpu_is_msm8627(void)
380{
381/* 8930 and 8627 will share the same CONFIG_ARCH type unless otherwise needed */
382#ifdef CONFIG_ARCH_MSM8930
383 return read_msm_cpu_type() == MSM_CPU_8627;
Stepan Moskovchenkoa8f0a222011-10-24 18:53:17 -0700384#else
385 return 0;
386#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700387}
388
389static inline int cpu_is_fsm9xxx(void)
390{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700391#ifdef CONFIG_ARCH_FSM9XXX
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700392 enum msm_cpu cpu = socinfo_get_msm_cpu();
393
394 BUG_ON(cpu == MSM_CPU_UNKNOWN);
395 return cpu == FSM_CPU_9XXX;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700396#else
397 return 0;
398#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700399}
400
Rohit Vaswani8a28b4a2011-08-10 19:07:00 -0700401static inline int cpu_is_msm9615(void)
402{
403#ifdef CONFIG_ARCH_MSM9615
404 enum msm_cpu cpu = socinfo_get_msm_cpu();
405
406 BUG_ON(cpu == MSM_CPU_UNKNOWN);
407 return cpu == MSM_CPU_9615;
408#else
409 return 0;
410#endif
411}
Taniya Dasa04e1892011-11-16 14:49:12 +0530412
413static inline int cpu_is_msm8625(void)
414{
415#ifdef CONFIG_ARCH_MSM8625
416 enum msm_cpu cpu = socinfo_get_msm_cpu();
417
418 BUG_ON(cpu == MSM_CPU_UNKNOWN);
419 return cpu == MSM_CPU_8625;
420#else
421 return 0;
422#endif
423}
424
Stepan Moskovchenko02c4d0c2012-07-26 14:33:02 -0700425static inline int cpu_is_msm8974(void)
426{
427#ifdef CONFIG_ARCH_MSM8974
428 enum msm_cpu cpu = socinfo_get_msm_cpu();
429
430 BUG_ON(cpu == MSM_CPU_UNKNOWN);
431 return cpu == MSM_CPU_8974;
432#else
433 return 0;
434#endif
435}
436
Ravi Kumar V754282d2012-08-31 22:32:20 +0530437static inline int cpu_is_mpq8092(void)
438{
439#ifdef CONFIG_ARCH_MPQ8092
440 enum msm_cpu cpu = socinfo_get_msm_cpu();
441
442 BUG_ON(cpu == MSM_CPU_UNKNOWN);
443 return cpu == MSM_CPU_8092;
444#else
445 return 0;
446#endif
447
448}
Syed Rameez Mustafad6084d32012-08-23 15:47:50 -0700449
450static inline int cpu_is_msm8226(void)
451{
452#ifdef CONFIG_ARCH_MSM8226
453 enum msm_cpu cpu = socinfo_get_msm_cpu();
454
455 BUG_ON(cpu == MSM_CPU_UNKNOWN);
456 return cpu == MSM_CPU_8226;
457#else
458 return 0;
459#endif
460}
461
Syed Rameez Mustafa3971c142013-01-09 19:04:53 -0800462static inline int cpu_is_msm8610(void)
Syed Rameez Mustafa158d6682012-09-21 18:25:50 -0700463{
Syed Rameez Mustafa3971c142013-01-09 19:04:53 -0800464#ifdef CONFIG_ARCH_MSM8610
Syed Rameez Mustafa158d6682012-09-21 18:25:50 -0700465 enum msm_cpu cpu = socinfo_get_msm_cpu();
466
467 BUG_ON(cpu == MSM_CPU_UNKNOWN);
Syed Rameez Mustafa3971c142013-01-09 19:04:53 -0800468 return cpu == MSM_CPU_8610;
Syed Rameez Mustafa158d6682012-09-21 18:25:50 -0700469#else
470 return 0;
471#endif
472}
Stepan Moskovchenko5b9e7762012-09-21 20:32:17 -0700473
Utsab Bose89b32992012-11-08 11:15:45 +0530474static inline int cpu_is_msm8625q(void)
475{
476#ifdef CONFIG_ARCH_MSM8625
477 enum msm_cpu cpu = socinfo_get_msm_cpu();
478
479 BUG_ON(cpu == MSM_CPU_UNKNOWN);
480 return cpu == MSM_CPU_8625Q;
481#else
482 return 0;
483#endif
484}
485
Stepan Moskovchenko5b9e7762012-09-21 20:32:17 -0700486static inline int soc_class_is_msm8960(void)
487{
488 return cpu_is_msm8960() || cpu_is_msm8960ab();
489}
490
491static inline int soc_class_is_apq8064(void)
492{
Jay Chokshif9294742013-01-15 13:06:27 -0800493 return cpu_is_apq8064() || cpu_is_apq8064ab() || cpu_is_apq8064aa();
Stepan Moskovchenko5b9e7762012-09-21 20:32:17 -0700494}
495
496static inline int soc_class_is_msm8930(void)
497{
Stepan Moskovchenkoecb0d9b2012-10-16 18:35:34 -0700498 return cpu_is_msm8930() || cpu_is_msm8930aa() || cpu_is_msm8930ab() ||
499 cpu_is_msm8627();
Stepan Moskovchenko5b9e7762012-09-21 20:32:17 -0700500}
501
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700502#endif