2 * DaVinci CPU type detection
4 * Author: Kevin Hilman, Deep Root Systems, LLC
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.
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
16 #ifndef _ASM_ARCH_CPU_H
17 #define _ASM_ARCH_CPU_H
19 extern unsigned int davinci_rev(void);
21 #define IS_DAVINCI_CPU(type, id) \
22 static inline int is_davinci_dm ##type(void) \
24 return (davinci_rev() == (id)) ? 1 : 0; \
27 IS_DAVINCI_CPU(644x, 0x6446)
28 IS_DAVINCI_CPU(646x, 0x6467)
29 IS_DAVINCI_CPU(355, 0x355)
31 #ifdef CONFIG_ARCH_DAVINCI_DM644x
32 #define cpu_is_davinci_dm644x() is_davinci_dm644x()
34 #define cpu_is_davinci_dm644x() 0
37 #ifdef CONFIG_ARCH_DAVINCI_DM646x
38 #define cpu_is_davinci_dm646x() is_davinci_dm646x()
40 #define cpu_is_davinci_dm646x() 0
43 #ifdef CONFIG_ARCH_DAVINCI_DM355
44 #define cpu_is_davinci_dm355() is_davinci_dm355()
46 #define cpu_is_davinci_dm355() 0