blob: 64531f0e0639d94a9c7bca6cb8f6b69a6cb09bf3 [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")
Sathish Ambleya99d6852011-10-31 15:50:55 -070056#else
Stepan Moskovchenko82f0eab2013-04-02 19:52:28 -070057#define of_board_is_sim() 0
58#define of_board_is_rumi() 0
59#define of_board_is_fluid() 0
60#define of_board_is_liquid() 0
Asaf Penso1d772412013-05-05 21:31:32 +030061#define of_board_is_dragonboard() 0
Stepan Moskovchenko82f0eab2013-04-02 19:52:28 -070062
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -070063#define machine_is_msm8974() 0
Rohit Vaswani47ee9e92012-04-23 18:42:03 -070064#define machine_is_msm9625() 0
Syed Rameez Mustafa3971c142013-01-09 19:04:53 -080065#define machine_is_msm8610() 0
Stepan Moskovchenkoa1346e42013-04-03 13:36:18 -070066#define machine_is_msm8226() 0
Asaf Penso1d772412013-05-05 21:31:32 +030067#define machine_is_apq8074() 0
Syed Rameez Mustafad6084d32012-08-23 15:47:50 -070068
Stepan Moskovchenkoa1346e42013-04-03 13:36:18 -070069#define early_machine_is_msm8610() 0
70#define early_machine_is_mpq8092() 0
Stepan Moskovchenkoe90cd652013-04-18 12:54:47 -070071#define early_machine_is_apq8084() 0
Abhimanyu Kapur37bea772013-04-11 18:19:38 -070072#define early_machine_is_msmkrypton() 0
Sathish Ambleya99d6852011-10-31 15:50:55 -070073#endif
74
Joel King15ccbfa2013-04-12 17:41:16 -070075#define PLATFORM_SUBTYPE_MDM 1
Stepan Moskovchenko2b4b1cd2012-03-29 18:21:04 -070076#define PLATFORM_SUBTYPE_SGLTE 6
77
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070078enum msm_cpu {
79 MSM_CPU_UNKNOWN = 0,
80 MSM_CPU_7X01,
81 MSM_CPU_7X25,
82 MSM_CPU_7X27,
83 MSM_CPU_8X50,
84 MSM_CPU_8X50A,
85 MSM_CPU_7X30,
86 MSM_CPU_8X55,
87 MSM_CPU_8X60,
88 MSM_CPU_8960,
Stepan Moskovchenkoec6a8032012-07-06 15:42:01 -070089 MSM_CPU_8960AB,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070090 MSM_CPU_7X27A,
91 FSM_CPU_9XXX,
92 MSM_CPU_7X25A,
93 MSM_CPU_7X25AA,
Pankaj Kumarfee56a82012-04-17 14:26:49 +053094 MSM_CPU_7X25AB,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070095 MSM_CPU_8064,
Jay Chokshib2de5092012-09-19 18:28:12 -070096 MSM_CPU_8064AB,
Jay Chokshif9294742013-01-15 13:06:27 -080097 MSM_CPU_8064AA,
Stepan Moskovchenkoa8222192011-10-24 18:32:30 -070098 MSM_CPU_8930,
Stepan Moskovchenko8b38bb32012-07-06 16:57:34 -070099 MSM_CPU_8930AA,
Stepan Moskovchenkoa03e7612012-10-16 18:34:17 -0700100 MSM_CPU_8930AB,
Rohit Vaswani8a28b4a2011-08-10 19:07:00 -0700101 MSM_CPU_7X27AA,
102 MSM_CPU_9615,
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -0700103 MSM_CPU_8974,
Stepan Moskovchenkodb71cd62011-11-23 14:28:57 -0800104 MSM_CPU_8627,
Taniya Dasa04e1892011-11-16 14:49:12 +0530105 MSM_CPU_8625,
Ravi Kumar V754282d2012-08-31 22:32:20 +0530106 MSM_CPU_9625,
Syed Rameez Mustafad6084d32012-08-23 15:47:50 -0700107 MSM_CPU_8092,
Syed Rameez Mustafa158d6682012-09-21 18:25:50 -0700108 MSM_CPU_8226,
Syed Rameez Mustafa3971c142013-01-09 19:04:53 -0800109 MSM_CPU_8610,
Utsab Bose89b32992012-11-08 11:15:45 +0530110 MSM_CPU_8625Q,
Stepan Moskovchenkoe90cd652013-04-18 12:54:47 -0700111 MSM_CPU_8084,
Abhimanyu Kapur37bea772013-04-11 18:19:38 -0700112 MSM_CPU_KRYPTON,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700113};
114
Jin Hong9b556c32012-08-13 23:06:26 -0700115enum pmic_model {
116 PMIC_MODEL_PM8058 = 13,
117 PMIC_MODEL_PM8028 = 14,
118 PMIC_MODEL_PM8901 = 15,
119 PMIC_MODEL_PM8027 = 16,
120 PMIC_MODEL_ISL_9519 = 17,
121 PMIC_MODEL_PM8921 = 18,
122 PMIC_MODEL_PM8018 = 19,
123 PMIC_MODEL_PM8015 = 20,
124 PMIC_MODEL_PM8014 = 21,
125 PMIC_MODEL_PM8821 = 22,
126 PMIC_MODEL_PM8038 = 23,
127 PMIC_MODEL_PM8922 = 24,
128 PMIC_MODEL_PM8917 = 25,
129 PMIC_MODEL_UNKNOWN = 0xFFFFFFFF
130};
131
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700132enum msm_cpu socinfo_get_msm_cpu(void);
133uint32_t socinfo_get_id(void);
134uint32_t socinfo_get_version(void);
Pankaj Kumar50c705c2012-01-10 12:02:07 +0530135uint32_t socinfo_get_raw_id(void);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700136char *socinfo_get_build_id(void);
137uint32_t socinfo_get_platform_type(void);
138uint32_t socinfo_get_platform_subtype(void);
139uint32_t socinfo_get_platform_version(void);
Jin Hong9b556c32012-08-13 23:06:26 -0700140enum pmic_model socinfo_get_pmic_model(void);
141uint32_t socinfo_get_pmic_die_revision(void);
Abhimanyu Kapur91a0a502013-01-11 19:24:59 -0800142int __init socinfo_init(void) __must_check;
Stepan Moskovchenkoeff783a2011-08-22 19:01:58 -0700143const int read_msm_cpu_type(void);
144const int get_core_count(void);
Jin Hong12b8b432012-07-18 10:00:31 -0700145const int cpu_is_krait(void);
Stepan Moskovchenko70dc7cf2011-08-22 19:08:42 -0700146const int cpu_is_krait_v1(void);
Jin Hong12b8b432012-07-18 10:00:31 -0700147const int cpu_is_krait_v2(void);
Joel King824bd1f2012-08-19 12:55:49 -0700148const int cpu_is_krait_v3(void);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700149
150static inline int cpu_is_msm7x01(void)
151{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700152#ifdef CONFIG_ARCH_MSM7X01A
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700153 enum msm_cpu cpu = socinfo_get_msm_cpu();
154
155 BUG_ON(cpu == MSM_CPU_UNKNOWN);
156 return cpu == MSM_CPU_7X01;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700157#else
158 return 0;
159#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700160}
161
162static inline int cpu_is_msm7x25(void)
163{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700164#ifdef CONFIG_ARCH_MSM7X25
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700165 enum msm_cpu cpu = socinfo_get_msm_cpu();
166
167 BUG_ON(cpu == MSM_CPU_UNKNOWN);
168 return cpu == MSM_CPU_7X25;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700169#else
170 return 0;
171#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700172}
173
174static inline int cpu_is_msm7x27(void)
175{
Taniya Das8e352a42012-02-20 16:49:48 +0530176#if defined(CONFIG_ARCH_MSM7X27) && !defined(CONFIG_ARCH_MSM7X27A)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700177 enum msm_cpu cpu = socinfo_get_msm_cpu();
178
179 BUG_ON(cpu == MSM_CPU_UNKNOWN);
180 return cpu == MSM_CPU_7X27;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700181#else
182 return 0;
183#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700184}
185
186static inline int cpu_is_msm7x27a(void)
187{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700188#ifdef CONFIG_ARCH_MSM7X27A
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700189 enum msm_cpu cpu = socinfo_get_msm_cpu();
190
191 BUG_ON(cpu == MSM_CPU_UNKNOWN);
192 return cpu == MSM_CPU_7X27A;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700193#else
194 return 0;
195#endif
196}
197
198static inline int cpu_is_msm7x27aa(void)
199{
200#ifdef CONFIG_ARCH_MSM7X27A
201 enum msm_cpu cpu = socinfo_get_msm_cpu();
202
203 BUG_ON(cpu == MSM_CPU_UNKNOWN);
204 return cpu == MSM_CPU_7X27AA;
205#else
206 return 0;
207#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700208}
209
210static inline int cpu_is_msm7x25a(void)
211{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700212#ifdef CONFIG_ARCH_MSM7X27A
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700213 enum msm_cpu cpu = socinfo_get_msm_cpu();
214
215 BUG_ON(cpu == MSM_CPU_UNKNOWN);
216 return cpu == MSM_CPU_7X25A;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700217#else
218 return 0;
219#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700220}
221
222static inline int cpu_is_msm7x25aa(void)
223{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700224#ifdef CONFIG_ARCH_MSM7X27A
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700225 enum msm_cpu cpu = socinfo_get_msm_cpu();
226
227 BUG_ON(cpu == MSM_CPU_UNKNOWN);
228 return cpu == MSM_CPU_7X25AA;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700229#else
230 return 0;
231#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700232}
233
Pankaj Kumarfee56a82012-04-17 14:26:49 +0530234static inline int cpu_is_msm7x25ab(void)
235{
236#ifdef CONFIG_ARCH_MSM7X27A
237 enum msm_cpu cpu = socinfo_get_msm_cpu();
238
239 BUG_ON(cpu == MSM_CPU_UNKNOWN);
240 return cpu == MSM_CPU_7X25AB;
241#else
242 return 0;
243#endif
244}
245
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700246static inline int cpu_is_msm7x30(void)
247{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700248#ifdef CONFIG_ARCH_MSM7X30
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700249 enum msm_cpu cpu = socinfo_get_msm_cpu();
250
251 BUG_ON(cpu == MSM_CPU_UNKNOWN);
252 return cpu == MSM_CPU_7X30;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700253#else
254 return 0;
255#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700256}
257
258static inline int cpu_is_qsd8x50(void)
259{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700260#ifdef CONFIG_ARCH_QSD8X50
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700261 enum msm_cpu cpu = socinfo_get_msm_cpu();
262
263 BUG_ON(cpu == MSM_CPU_UNKNOWN);
264 return cpu == MSM_CPU_8X50;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700265#else
266 return 0;
267#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700268}
269
270static inline int cpu_is_msm8x55(void)
271{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700272#ifdef CONFIG_ARCH_MSM7X30
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700273 enum msm_cpu cpu = socinfo_get_msm_cpu();
274
275 BUG_ON(cpu == MSM_CPU_UNKNOWN);
276 return cpu == MSM_CPU_8X55;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700277#else
278 return 0;
279#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700280}
281
282static inline int cpu_is_msm8x60(void)
283{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700284#ifdef CONFIG_ARCH_MSM8X60
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700285 return read_msm_cpu_type() == MSM_CPU_8X60;
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_msm8960(void)
292{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700293#ifdef CONFIG_ARCH_MSM8960
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700294 return read_msm_cpu_type() == MSM_CPU_8960;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700295#else
296 return 0;
297#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700298}
299
Stepan Moskovchenkoec6a8032012-07-06 15:42:01 -0700300static inline int cpu_is_msm8960ab(void)
301{
302#ifdef CONFIG_ARCH_MSM8960
303 return read_msm_cpu_type() == MSM_CPU_8960AB;
304#else
305 return 0;
306#endif
307}
308
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700309static inline int cpu_is_apq8064(void)
310{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700311#ifdef CONFIG_ARCH_APQ8064
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700312 return read_msm_cpu_type() == MSM_CPU_8064;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700313#else
314 return 0;
315#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700316}
317
Jay Chokshib2de5092012-09-19 18:28:12 -0700318static inline int cpu_is_apq8064ab(void)
319{
320#ifdef CONFIG_ARCH_APQ8064
321 return read_msm_cpu_type() == MSM_CPU_8064AB;
322#else
323 return 0;
324#endif
325}
326
Jay Chokshif9294742013-01-15 13:06:27 -0800327static inline int cpu_is_apq8064aa(void)
328{
329#ifdef CONFIG_ARCH_APQ8064
330 return read_msm_cpu_type() == MSM_CPU_8064AA;
331#else
332 return 0;
333#endif
334}
335
Stepan Moskovchenkoa8222192011-10-24 18:32:30 -0700336static inline int cpu_is_msm8930(void)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700337{
Stepan Moskovchenkoa8f0a222011-10-24 18:53:17 -0700338#ifdef CONFIG_ARCH_MSM8930
Stepan Moskovchenkoaba208d2012-07-05 20:33:55 -0700339 return read_msm_cpu_type() == MSM_CPU_8930;
Stepan Moskovchenkodb71cd62011-11-23 14:28:57 -0800340#else
341 return 0;
342#endif
343}
344
Stepan Moskovchenko8b38bb32012-07-06 16:57:34 -0700345static inline int cpu_is_msm8930aa(void)
346{
347#ifdef CONFIG_ARCH_MSM8930
348 return read_msm_cpu_type() == MSM_CPU_8930AA;
349#else
350 return 0;
351#endif
352}
353
Stepan Moskovchenkoa03e7612012-10-16 18:34:17 -0700354static inline int cpu_is_msm8930ab(void)
355{
356#ifdef CONFIG_ARCH_MSM8930
357 return read_msm_cpu_type() == MSM_CPU_8930AB;
358#else
359 return 0;
360#endif
361}
362
Stepan Moskovchenkodb71cd62011-11-23 14:28:57 -0800363static inline int cpu_is_msm8627(void)
364{
365/* 8930 and 8627 will share the same CONFIG_ARCH type unless otherwise needed */
366#ifdef CONFIG_ARCH_MSM8930
367 return read_msm_cpu_type() == MSM_CPU_8627;
Stepan Moskovchenkoa8f0a222011-10-24 18:53:17 -0700368#else
369 return 0;
370#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700371}
372
373static inline int cpu_is_fsm9xxx(void)
374{
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700375#ifdef CONFIG_ARCH_FSM9XXX
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700376 enum msm_cpu cpu = socinfo_get_msm_cpu();
377
378 BUG_ON(cpu == MSM_CPU_UNKNOWN);
379 return cpu == FSM_CPU_9XXX;
Stepan Moskovchenko03804a02011-08-09 15:24:21 -0700380#else
381 return 0;
382#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700383}
384
Rohit Vaswani8a28b4a2011-08-10 19:07:00 -0700385static inline int cpu_is_msm9615(void)
386{
387#ifdef CONFIG_ARCH_MSM9615
388 enum msm_cpu cpu = socinfo_get_msm_cpu();
389
390 BUG_ON(cpu == MSM_CPU_UNKNOWN);
391 return cpu == MSM_CPU_9615;
392#else
393 return 0;
394#endif
395}
Taniya Dasa04e1892011-11-16 14:49:12 +0530396
397static inline int cpu_is_msm8625(void)
398{
399#ifdef CONFIG_ARCH_MSM8625
400 enum msm_cpu cpu = socinfo_get_msm_cpu();
401
402 BUG_ON(cpu == MSM_CPU_UNKNOWN);
403 return cpu == MSM_CPU_8625;
404#else
405 return 0;
406#endif
407}
408
Stepan Moskovchenko02c4d0c2012-07-26 14:33:02 -0700409static inline int cpu_is_msm8974(void)
410{
411#ifdef CONFIG_ARCH_MSM8974
412 enum msm_cpu cpu = socinfo_get_msm_cpu();
413
414 BUG_ON(cpu == MSM_CPU_UNKNOWN);
415 return cpu == MSM_CPU_8974;
416#else
417 return 0;
418#endif
419}
420
Ravi Kumar V754282d2012-08-31 22:32:20 +0530421static inline int cpu_is_mpq8092(void)
422{
423#ifdef CONFIG_ARCH_MPQ8092
424 enum msm_cpu cpu = socinfo_get_msm_cpu();
425
426 BUG_ON(cpu == MSM_CPU_UNKNOWN);
427 return cpu == MSM_CPU_8092;
428#else
429 return 0;
430#endif
431
432}
Syed Rameez Mustafad6084d32012-08-23 15:47:50 -0700433
434static inline int cpu_is_msm8226(void)
435{
436#ifdef CONFIG_ARCH_MSM8226
437 enum msm_cpu cpu = socinfo_get_msm_cpu();
438
439 BUG_ON(cpu == MSM_CPU_UNKNOWN);
440 return cpu == MSM_CPU_8226;
441#else
442 return 0;
443#endif
444}
445
Syed Rameez Mustafa3971c142013-01-09 19:04:53 -0800446static inline int cpu_is_msm8610(void)
Syed Rameez Mustafa158d6682012-09-21 18:25:50 -0700447{
Syed Rameez Mustafa3971c142013-01-09 19:04:53 -0800448#ifdef CONFIG_ARCH_MSM8610
Syed Rameez Mustafa158d6682012-09-21 18:25:50 -0700449 enum msm_cpu cpu = socinfo_get_msm_cpu();
450
451 BUG_ON(cpu == MSM_CPU_UNKNOWN);
Syed Rameez Mustafa3971c142013-01-09 19:04:53 -0800452 return cpu == MSM_CPU_8610;
Syed Rameez Mustafa158d6682012-09-21 18:25:50 -0700453#else
454 return 0;
455#endif
456}
Stepan Moskovchenko5b9e7762012-09-21 20:32:17 -0700457
Utsab Bose89b32992012-11-08 11:15:45 +0530458static inline int cpu_is_msm8625q(void)
459{
460#ifdef CONFIG_ARCH_MSM8625
461 enum msm_cpu cpu = socinfo_get_msm_cpu();
462
463 BUG_ON(cpu == MSM_CPU_UNKNOWN);
464 return cpu == MSM_CPU_8625Q;
465#else
466 return 0;
467#endif
468}
469
Stepan Moskovchenko5b9e7762012-09-21 20:32:17 -0700470static inline int soc_class_is_msm8960(void)
471{
472 return cpu_is_msm8960() || cpu_is_msm8960ab();
473}
474
475static inline int soc_class_is_apq8064(void)
476{
Jay Chokshif9294742013-01-15 13:06:27 -0800477 return cpu_is_apq8064() || cpu_is_apq8064ab() || cpu_is_apq8064aa();
Stepan Moskovchenko5b9e7762012-09-21 20:32:17 -0700478}
479
480static inline int soc_class_is_msm8930(void)
481{
Stepan Moskovchenkoecb0d9b2012-10-16 18:35:34 -0700482 return cpu_is_msm8930() || cpu_is_msm8930aa() || cpu_is_msm8930ab() ||
483 cpu_is_msm8627();
Stepan Moskovchenko5b9e7762012-09-21 20:32:17 -0700484}
485
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700486#endif