aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-davinci/include
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-davinci/include')
-rw-r--r--arch/arm/mach-davinci/include/mach/cputype.h49
1 files changed, 49 insertions, 0 deletions
diff --git a/arch/arm/mach-davinci/include/mach/cputype.h b/arch/arm/mach-davinci/include/mach/cputype.h
new file mode 100644
index 000000000000..27cfb1b3a662
--- /dev/null
+++ b/arch/arm/mach-davinci/include/mach/cputype.h
@@ -0,0 +1,49 @@
1/*
2 * DaVinci CPU type detection
3 *
4 * Author: Kevin Hilman, Deep Root Systems, LLC
5 *
6 * Defines the cpu_is_*() macros for runtime detection of DaVinci
7 * device type. In addtion, if support for a given device is not
8 * compiled in to the kernel, the macros return 0 so that
9 * resulting code can be optimized out.
10 *
11 * 2009 (c) Deep Root Systems, LLC. This file is licensed under
12 * the terms of the GNU General Public License version 2. This program
13 * is licensed "as is" without any warranty of any kind, whether express
14 * or implied.
15 */
16#ifndef _ASM_ARCH_CPU_H
17#define _ASM_ARCH_CPU_H
18
19extern unsigned int davinci_rev(void);
20
21#define IS_DAVINCI_CPU(type, id) \
22static inline int is_davinci_dm ##type(void) \
23{ \
24 return (davinci_rev() == (id)) ? 1 : 0; \
25}
26
27IS_DAVINCI_CPU(644x, 0x6446)
28IS_DAVINCI_CPU(646x, 0x6467)
29IS_DAVINCI_CPU(355, 0x355)
30
31#ifdef CONFIG_ARCH_DAVINCI_DM644x
32#define cpu_is_davinci_dm644x() is_davinci_dm644x()
33#else
34#define cpu_is_davinci_dm644x() 0
35#endif
36
37#ifdef CONFIG_ARCH_DAVINCI_DM646x
38#define cpu_is_davinci_dm646x() is_davinci_dm646x()
39#else
40#define cpu_is_davinci_dm646x() 0
41#endif
42
43#ifdef CONFIG_ARCH_DAVINCI_DM355
44#define cpu_is_davinci_dm355() is_davinci_dm355()
45#else
46#define cpu_is_davinci_dm355() 0
47#endif
48
49#endif