Merge tag 'locks-v3.16-2' of git://git.samba.org/jlayton/linux
[linux/fpc-iii.git] / arch / arm / mach-ux500 / id.h
blobbcc58a8cccbc9c248b9703421edf14212cdb7c44
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_u8520(void)
46 return dbx500_partnumber() == 0x8520;
49 static inline bool cpu_is_u8500_family(void)
51 return cpu_is_u8500() || cpu_is_u8520();
54 static inline bool __attribute_const__ cpu_is_u9540(void)
56 return dbx500_partnumber() == 0x9540;
59 static inline bool __attribute_const__ cpu_is_u8540(void)
61 return dbx500_partnumber() == 0x8540;
64 static inline bool __attribute_const__ cpu_is_u8580(void)
66 return dbx500_partnumber() == 0x8580;
69 static inline bool cpu_is_ux540_family(void)
71 return cpu_is_u9540() || cpu_is_u8540() || cpu_is_u8580();
75 * 8500 revisions
78 static inline bool __attribute_const__ cpu_is_u8500ed(void)
80 return cpu_is_u8500() && dbx500_revision() == 0x00;
83 static inline bool __attribute_const__ cpu_is_u8500v1(void)
85 return cpu_is_u8500() && (dbx500_revision() & 0xf0) == 0xA0;
88 static inline bool __attribute_const__ cpu_is_u8500v10(void)
90 return cpu_is_u8500() && dbx500_revision() == 0xA0;
93 static inline bool __attribute_const__ cpu_is_u8500v11(void)
95 return cpu_is_u8500() && dbx500_revision() == 0xA1;
98 static inline bool __attribute_const__ cpu_is_u8500v2(void)
100 return cpu_is_u8500() && ((dbx500_revision() & 0xf0) == 0xB0);
103 static inline bool cpu_is_u8500v20(void)
105 return cpu_is_u8500() && (dbx500_revision() == 0xB0);
108 static inline bool cpu_is_u8500v21(void)
110 return cpu_is_u8500() && (dbx500_revision() == 0xB1);
113 static inline bool cpu_is_u8500v22(void)
115 return cpu_is_u8500() && (dbx500_revision() == 0xB2);
118 static inline bool cpu_is_u8500v20_or_later(void)
120 return (cpu_is_u8500() && !cpu_is_u8500v10() && !cpu_is_u8500v11());
124 * 8540 revisions
127 static inline bool __attribute_const__ cpu_is_u8540v10(void)
129 return cpu_is_u8540() && dbx500_revision() == 0xA0;
132 static inline bool __attribute_const__ cpu_is_u8580v10(void)
134 return cpu_is_u8580() && dbx500_revision() == 0xA0;
137 static inline bool ux500_is_svp(void)
139 return false;
142 #define ux500_unknown_soc() BUG()
144 #endif