Merge tag 'v3.3.7' into 3.3/master
[zen-stable.git] / arch / arm / mach-ux500 / include / mach / id.h
blob833d6a6edc9b0ebd10755b4b62af9e865ab40225
1 /*
2 * Copyright (C) ST-Ericsson SA 2010
4 * Author: Rabin Vincent <rabin.vincent@stericsson.com> for ST-Ericsson
5 * License terms: GNU General Public License (GPL) version 2
6 */
8 #ifndef __MACH_UX500_ID
9 #define __MACH_UX500_ID
11 /**
12 * struct dbx500_asic_id - fields of the ASIC ID
13 * @process: the manufacturing process, 0x40 is 40 nm 0x00 is "standard"
14 * @partnumber: hithereto 0x8500 for DB8500
15 * @revision: version code in the series
17 struct dbx500_asic_id {
18 u16 partnumber;
19 u8 revision;
20 u8 process;
23 extern struct dbx500_asic_id dbx500_id;
25 static inline unsigned int __attribute_const__ dbx500_partnumber(void)
27 return dbx500_id.partnumber;
30 static inline unsigned int __attribute_const__ dbx500_revision(void)
32 return dbx500_id.revision;
36 * SOCs
39 static inline bool __attribute_const__ cpu_is_u8500(void)
41 return dbx500_partnumber() == 0x8500;
44 static inline bool __attribute_const__ cpu_is_u5500(void)
46 return dbx500_partnumber() == 0x5500;
50 * 5500 revisions
53 static inline bool __attribute_const__ cpu_is_u5500v1(void)
55 return cpu_is_u5500() && (dbx500_revision() & 0xf0) == 0xA0;
58 static inline bool __attribute_const__ cpu_is_u5500v2(void)
60 return (dbx500_id.revision & 0xf0) == 0xB0;
63 static inline bool __attribute_const__ cpu_is_u5500v20(void)
65 return cpu_is_u5500() && ((dbx500_revision() & 0xf0) == 0xB0);
68 static inline bool __attribute_const__ cpu_is_u5500v21(void)
70 return cpu_is_u5500() && (dbx500_revision() == 0xB1);
74 * 8500 revisions
77 static inline bool __attribute_const__ cpu_is_u8500ed(void)
79 return cpu_is_u8500() && dbx500_revision() == 0x00;
82 static inline bool __attribute_const__ cpu_is_u8500v1(void)
84 return cpu_is_u8500() && (dbx500_revision() & 0xf0) == 0xA0;
87 static inline bool __attribute_const__ cpu_is_u8500v10(void)
89 return cpu_is_u8500() && dbx500_revision() == 0xA0;
92 static inline bool __attribute_const__ cpu_is_u8500v11(void)
94 return cpu_is_u8500() && dbx500_revision() == 0xA1;
97 static inline bool __attribute_const__ cpu_is_u8500v2(void)
99 return cpu_is_u8500() && ((dbx500_revision() & 0xf0) == 0xB0);
102 static inline bool cpu_is_u8500v20(void)
104 return cpu_is_u8500() && (dbx500_revision() == 0xB0);
107 static inline bool cpu_is_u8500v21(void)
109 return cpu_is_u8500() && (dbx500_revision() == 0xB1);
112 static inline bool cpu_is_u8500v20_or_later(void)
114 return cpu_is_u8500() && !cpu_is_u8500v10() && !cpu_is_u8500v11();
117 static inline bool ux500_is_svp(void)
119 return false;
122 #define ux500_unknown_soc() BUG()
124 #endif