Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
cpu.h
Go to the documentation of this file.
1 /*
2  * arch/arm/mach-ixp4xx/include/mach/cpu.h
3  *
4  * IXP4XX cpu type detection
5  *
6  * Copyright (C) 2007 MontaVista Software, Inc.
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License version 2 as
10  * published by the Free Software Foundation.
11  *
12  */
13 
14 #ifndef __ASM_ARCH_CPU_H__
15 #define __ASM_ARCH_CPU_H__
16 
17 #include <linux/io.h>
18 #include <asm/cputype.h>
19 
20 /* Processor id value in CP15 Register 0 */
21 #define IXP42X_PROCESSOR_ID_VALUE 0x690541c0 /* including unused 0x690541Ex */
22 #define IXP42X_PROCESSOR_ID_MASK 0xffffffc0
23 
24 #define IXP43X_PROCESSOR_ID_VALUE 0x69054040
25 #define IXP43X_PROCESSOR_ID_MASK 0xfffffff0
26 
27 #define IXP46X_PROCESSOR_ID_VALUE 0x69054200 /* including IXP455 */
28 #define IXP46X_PROCESSOR_ID_MASK 0xfffffff0
29 
30 #define cpu_is_ixp42x_rev_a0() ((read_cpuid_id() & (IXP42X_PROCESSOR_ID_MASK | 0xF)) == \
31  IXP42X_PROCESSOR_ID_VALUE)
32 #define cpu_is_ixp42x() ((read_cpuid_id() & IXP42X_PROCESSOR_ID_MASK) == \
33  IXP42X_PROCESSOR_ID_VALUE)
34 #define cpu_is_ixp43x() ((read_cpuid_id() & IXP43X_PROCESSOR_ID_MASK) == \
35  IXP43X_PROCESSOR_ID_VALUE)
36 #define cpu_is_ixp46x() ((read_cpuid_id() & IXP46X_PROCESSOR_ID_MASK) == \
37  IXP46X_PROCESSOR_ID_VALUE)
38 
39 static inline u32 ixp4xx_read_feature_bits(void)
40 {
42 
46  if (cpu_is_ixp42x())
47  return val & IXP42X_FEATURE_MASK;
48  if (cpu_is_ixp43x())
49  return val & IXP43X_FEATURE_MASK;
50  return val & IXP46X_FEATURE_MASK;
51 }
52 
53 static inline void ixp4xx_write_feature_bits(u32 value)
54 {
56 }
57 
58 #endif /* _ASM_ARCH_CPU_H */