Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
cpuinfo.h
Go to the documentation of this file.
1 /*
2  * Generic support for queying CPU info
3  *
4  * Copyright (C) 2007-2009 Michal Simek <[email protected]>
5  * Copyright (C) 2007-2009 PetaLogix
6  * Copyright (C) 2007 John Williams <[email protected]>
7  *
8  * This file is subject to the terms and conditions of the GNU General
9  * Public License. See the file COPYING in the main directory of this
10  * archive for more details.
11  */
12 
13 #ifndef _ASM_MICROBLAZE_CPUINFO_H
14 #define _ASM_MICROBLAZE_CPUINFO_H
15 
16 #include <asm/prom.h>
17 
18 /* CPU Version and FPGA Family code conversion table type */
19 struct cpu_ver_key {
20  const char *s;
21  const unsigned k;
22 };
23 
24 extern const struct cpu_ver_key cpu_ver_lookup[];
25 
27  const char *s;
28  const unsigned k;
29 };
30 
31 extern const struct family_string_key family_string_lookup[];
32 
33 struct cpuinfo {
34  /* Core CPU configuration */
43 
44  /* CPU caches */
50  unsigned long icache_base;
51  unsigned long icache_high;
52 
59  unsigned long dcache_base;
60  unsigned long dcache_high;
61 
62  /* Bus connections */
68 
69  /* CPU interrupt line info */
72 
74 
75  /* HW debug support */
80  u32 cpu_clock_freq; /* store real freq of cpu */
81 
82  /* FPGA family */
84 
85  /* User define */
88 };
89 
90 extern struct cpuinfo cpuinfo;
91 
92 /* fwd declarations of the various CPUinfo populators */
93 void setup_cpuinfo(void);
94 
95 void set_cpuinfo_static(struct cpuinfo *ci, struct device_node *cpu);
96 void set_cpuinfo_pvr_full(struct cpuinfo *ci, struct device_node *cpu);
97 
98 static inline unsigned int fcpu(struct device_node *cpu, char *n)
99 {
100  const __be32 *val;
101  return (val = of_get_property(cpu, n, NULL)) ?
102  be32_to_cpup(val) : 0;
103 }
104 
105 #endif /* _ASM_MICROBLAZE_CPUINFO_H */